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 "lib/replace/system/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 23664 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 23664 : switch (var_size) {
35 40 : case 8:
36 40 : return UINT64_MAX;
37 1252 : case 4:
38 1252 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 22372 : case 1:
42 22372 : 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 303 : static PyObject *py_lsa_String_get_length(PyObject *obj, void *closure)
211 : {
212 303 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
213 4 : PyObject *py_length;
214 303 : py_length = PyLong_FromLong((uint16_t)object->length);
215 303 : 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 0 : 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 4 : static PyObject *py_lsa_String_get_size(PyObject *obj, void *closure)
249 : {
250 4 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
251 4 : PyObject *py_size;
252 4 : py_size = PyLong_FromLong((uint16_t)object->size);
253 4 : 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 0 : 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 205 : static PyObject *py_lsa_String_get_string(PyObject *obj, void *closure)
287 : {
288 205 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(obj);
289 4 : PyObject *py_string;
290 205 : if (object->string == NULL) {
291 1 : Py_RETURN_NONE;
292 : }
293 204 : if (object->string == NULL) {
294 0 : py_string = Py_None;
295 0 : Py_INCREF(py_string);
296 : } else {
297 204 : if (object->string == NULL) {
298 0 : py_string = Py_None;
299 0 : Py_INCREF(py_string);
300 : } else {
301 204 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
302 : }
303 : }
304 204 : return py_string;
305 : }
306 :
307 940 : static int py_lsa_String_set_string(PyObject *py_obj, PyObject *value, void *closure)
308 : {
309 940 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
310 940 : if (value == NULL) {
311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
312 0 : return -1;
313 : }
314 940 : if (value == Py_None) {
315 0 : object->string = NULL;
316 : } else {
317 940 : object->string = NULL;
318 : {
319 0 : const char *test_str;
320 0 : const char *talloc_str;
321 940 : PyObject *unicode = NULL;
322 940 : if (PyUnicode_Check(value)) {
323 940 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
324 940 : if (unicode == NULL) {
325 0 : return -1;
326 : }
327 940 : test_str = PyBytes_AS_STRING(unicode);
328 0 : } else if (PyBytes_Check(value)) {
329 0 : test_str = PyBytes_AS_STRING(value);
330 : } else {
331 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
332 0 : return -1;
333 : }
334 940 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
335 940 : if (unicode != NULL) {
336 508 : Py_DECREF(unicode);
337 : }
338 940 : if (talloc_str == NULL) {
339 0 : PyErr_NoMemory();
340 0 : return -1;
341 : }
342 940 : object->string = talloc_str;
343 : }
344 : }
345 940 : return 0;
346 : }
347 :
348 : static PyGetSetDef py_lsa_String_getsetters[] = {
349 : {
350 : .name = discard_const_p(char, "length"),
351 : .get = py_lsa_String_get_length,
352 : .set = py_lsa_String_set_length,
353 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
354 : },
355 : {
356 : .name = discard_const_p(char, "size"),
357 : .get = py_lsa_String_get_size,
358 : .set = py_lsa_String_set_size,
359 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
360 : },
361 : {
362 : .name = discard_const_p(char, "string"),
363 : .get = py_lsa_String_get_string,
364 : .set = py_lsa_String_set_string,
365 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
366 : },
367 : { .name = NULL }
368 : };
369 :
370 385 : static PyObject *py_lsa_String_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
371 : {
372 385 : return pytalloc_new(struct lsa_String, type);
373 : }
374 :
375 1 : static PyObject *py_lsa_String_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
376 : {
377 1 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
378 1 : PyObject *ret = NULL;
379 1 : DATA_BLOB blob;
380 1 : enum ndr_err_code err;
381 1 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
382 1 : if (tmp_ctx == NULL) {
383 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
384 0 : return NULL;
385 : }
386 1 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_String);
387 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
388 0 : TALLOC_FREE(tmp_ctx);
389 0 : PyErr_SetNdrError(err);
390 0 : return NULL;
391 : }
392 :
393 1 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
394 1 : TALLOC_FREE(tmp_ctx);
395 1 : return ret;
396 : }
397 :
398 1 : static PyObject *py_lsa_String_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
399 : {
400 1 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
401 1 : DATA_BLOB blob = {.data = NULL, .length = 0};
402 1 : Py_ssize_t blob_length = 0;
403 1 : enum ndr_err_code err;
404 1 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
405 1 : PyObject *allow_remaining_obj = NULL;
406 1 : bool allow_remaining = false;
407 :
408 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
409 : discard_const_p(char *, kwnames),
410 : &blob.data, &blob_length,
411 : &allow_remaining_obj)) {
412 0 : return NULL;
413 : }
414 1 : blob.length = blob_length;
415 :
416 1 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
417 0 : allow_remaining = true;
418 : }
419 :
420 0 : if (allow_remaining) {
421 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
422 : } else {
423 1 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
424 : }
425 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
426 0 : PyErr_SetNdrError(err);
427 0 : return NULL;
428 : }
429 :
430 1 : Py_RETURN_NONE;
431 : }
432 :
433 0 : static PyObject *py_lsa_String_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
434 : {
435 0 : struct lsa_String *object = (struct lsa_String *)pytalloc_get_ptr(py_obj);
436 0 : PyObject *ret;
437 0 : char *retstr;
438 :
439 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_String, "lsa_String", object);
440 0 : ret = PyUnicode_FromString(retstr);
441 0 : talloc_free(retstr);
442 :
443 0 : return ret;
444 : }
445 :
446 : static PyMethodDef py_lsa_String_methods[] = {
447 : { "__ndr_pack__", (PyCFunction)py_lsa_String_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
448 : { "__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" },
449 : { "__ndr_print__", (PyCFunction)py_lsa_String_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
450 : { NULL, NULL, 0, NULL }
451 : };
452 :
453 :
454 : static PyTypeObject lsa_String_Type = {
455 : PyVarObject_HEAD_INIT(NULL, 0)
456 : .tp_name = "lsa.String",
457 : .tp_getset = py_lsa_String_getsetters,
458 : .tp_methods = py_lsa_String_methods,
459 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
460 : .tp_new = py_lsa_String_new,
461 : };
462 :
463 :
464 0 : static PyObject *py_lsa_StringLarge_get_length(PyObject *obj, void *closure)
465 : {
466 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
467 0 : PyObject *py_length;
468 0 : py_length = PyLong_FromLong((uint16_t)object->length);
469 0 : return py_length;
470 : }
471 :
472 0 : static int py_lsa_StringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
473 : {
474 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
475 0 : if (value == NULL) {
476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
477 0 : return -1;
478 : }
479 : {
480 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
481 0 : if (PyLong_Check(value)) {
482 0 : unsigned long long test_var;
483 0 : test_var = PyLong_AsUnsignedLongLong(value);
484 0 : if (PyErr_Occurred() != NULL) {
485 0 : return -1;
486 : }
487 0 : if (test_var > uint_max) {
488 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
489 : PyLong_Type.tp_name, uint_max, test_var);
490 0 : return -1;
491 : }
492 0 : object->length = test_var;
493 : } else {
494 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
495 : PyLong_Type.tp_name);
496 0 : return -1;
497 : }
498 : }
499 0 : return 0;
500 : }
501 :
502 0 : static PyObject *py_lsa_StringLarge_get_size(PyObject *obj, void *closure)
503 : {
504 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
505 0 : PyObject *py_size;
506 0 : py_size = PyLong_FromLong((uint16_t)object->size);
507 0 : return py_size;
508 : }
509 :
510 0 : static int py_lsa_StringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
511 : {
512 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
513 0 : if (value == NULL) {
514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
515 0 : return -1;
516 : }
517 : {
518 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
519 0 : if (PyLong_Check(value)) {
520 0 : unsigned long long test_var;
521 0 : test_var = PyLong_AsUnsignedLongLong(value);
522 0 : if (PyErr_Occurred() != NULL) {
523 0 : return -1;
524 : }
525 0 : if (test_var > uint_max) {
526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
527 : PyLong_Type.tp_name, uint_max, test_var);
528 0 : return -1;
529 : }
530 0 : object->size = test_var;
531 : } else {
532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
533 : PyLong_Type.tp_name);
534 0 : return -1;
535 : }
536 : }
537 0 : return 0;
538 : }
539 :
540 3657 : static PyObject *py_lsa_StringLarge_get_string(PyObject *obj, void *closure)
541 : {
542 3657 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(obj);
543 24 : PyObject *py_string;
544 3657 : if (object->string == NULL) {
545 0 : Py_RETURN_NONE;
546 : }
547 3657 : if (object->string == NULL) {
548 0 : py_string = Py_None;
549 0 : Py_INCREF(py_string);
550 : } else {
551 3657 : if (object->string == NULL) {
552 0 : py_string = Py_None;
553 0 : Py_INCREF(py_string);
554 : } else {
555 3657 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
556 : }
557 : }
558 3657 : return py_string;
559 : }
560 :
561 56 : static int py_lsa_StringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
562 : {
563 56 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
564 56 : if (value == NULL) {
565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
566 0 : return -1;
567 : }
568 56 : if (value == Py_None) {
569 0 : object->string = NULL;
570 : } else {
571 56 : object->string = NULL;
572 : {
573 0 : const char *test_str;
574 0 : const char *talloc_str;
575 56 : PyObject *unicode = NULL;
576 56 : if (PyUnicode_Check(value)) {
577 56 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
578 56 : if (unicode == NULL) {
579 0 : return -1;
580 : }
581 56 : test_str = PyBytes_AS_STRING(unicode);
582 0 : } else if (PyBytes_Check(value)) {
583 0 : test_str = PyBytes_AS_STRING(value);
584 : } else {
585 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
586 0 : return -1;
587 : }
588 56 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
589 56 : if (unicode != NULL) {
590 28 : Py_DECREF(unicode);
591 : }
592 56 : if (talloc_str == NULL) {
593 0 : PyErr_NoMemory();
594 0 : return -1;
595 : }
596 56 : object->string = talloc_str;
597 : }
598 : }
599 56 : return 0;
600 : }
601 :
602 : static PyGetSetDef py_lsa_StringLarge_getsetters[] = {
603 : {
604 : .name = discard_const_p(char, "length"),
605 : .get = py_lsa_StringLarge_get_length,
606 : .set = py_lsa_StringLarge_set_length,
607 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
608 : },
609 : {
610 : .name = discard_const_p(char, "size"),
611 : .get = py_lsa_StringLarge_get_size,
612 : .set = py_lsa_StringLarge_set_size,
613 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
614 : },
615 : {
616 : .name = discard_const_p(char, "string"),
617 : .get = py_lsa_StringLarge_get_string,
618 : .set = py_lsa_StringLarge_set_string,
619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
620 : },
621 : { .name = NULL }
622 : };
623 :
624 0 : static PyObject *py_lsa_StringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
625 : {
626 0 : return pytalloc_new(struct lsa_StringLarge, type);
627 : }
628 :
629 0 : static PyObject *py_lsa_StringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
630 : {
631 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
632 0 : PyObject *ret = NULL;
633 0 : DATA_BLOB blob;
634 0 : enum ndr_err_code err;
635 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
636 0 : if (tmp_ctx == NULL) {
637 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
638 0 : return NULL;
639 : }
640 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
641 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
642 0 : TALLOC_FREE(tmp_ctx);
643 0 : PyErr_SetNdrError(err);
644 0 : return NULL;
645 : }
646 :
647 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
648 0 : TALLOC_FREE(tmp_ctx);
649 0 : return ret;
650 : }
651 :
652 0 : static PyObject *py_lsa_StringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
653 : {
654 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
655 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
656 0 : Py_ssize_t blob_length = 0;
657 0 : enum ndr_err_code err;
658 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
659 0 : PyObject *allow_remaining_obj = NULL;
660 0 : bool allow_remaining = false;
661 :
662 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
663 : discard_const_p(char *, kwnames),
664 : &blob.data, &blob_length,
665 : &allow_remaining_obj)) {
666 0 : return NULL;
667 : }
668 0 : blob.length = blob_length;
669 :
670 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
671 0 : allow_remaining = true;
672 : }
673 :
674 0 : if (allow_remaining) {
675 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
676 : } else {
677 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
678 : }
679 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
680 0 : PyErr_SetNdrError(err);
681 0 : return NULL;
682 : }
683 :
684 0 : Py_RETURN_NONE;
685 : }
686 :
687 0 : static PyObject *py_lsa_StringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
688 : {
689 0 : struct lsa_StringLarge *object = (struct lsa_StringLarge *)pytalloc_get_ptr(py_obj);
690 0 : PyObject *ret;
691 0 : char *retstr;
692 :
693 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_StringLarge, "lsa_StringLarge", object);
694 0 : ret = PyUnicode_FromString(retstr);
695 0 : talloc_free(retstr);
696 :
697 0 : return ret;
698 : }
699 :
700 : static PyMethodDef py_lsa_StringLarge_methods[] = {
701 : { "__ndr_pack__", (PyCFunction)py_lsa_StringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
702 : { "__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" },
703 : { "__ndr_print__", (PyCFunction)py_lsa_StringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
704 : { NULL, NULL, 0, NULL }
705 : };
706 :
707 :
708 : static PyTypeObject lsa_StringLarge_Type = {
709 : PyVarObject_HEAD_INIT(NULL, 0)
710 : .tp_name = "lsa.StringLarge",
711 : .tp_getset = py_lsa_StringLarge_getsetters,
712 : .tp_methods = py_lsa_StringLarge_methods,
713 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
714 : .tp_new = py_lsa_StringLarge_new,
715 : };
716 :
717 :
718 0 : static PyObject *py_lsa_Strings_get_count(PyObject *obj, void *closure)
719 : {
720 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
721 0 : PyObject *py_count;
722 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
723 0 : return py_count;
724 : }
725 :
726 0 : static int py_lsa_Strings_set_count(PyObject *py_obj, PyObject *value, void *closure)
727 : {
728 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
729 0 : if (value == NULL) {
730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
731 0 : return -1;
732 : }
733 : {
734 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
735 0 : if (PyLong_Check(value)) {
736 0 : unsigned long long test_var;
737 0 : test_var = PyLong_AsUnsignedLongLong(value);
738 0 : if (PyErr_Occurred() != NULL) {
739 0 : return -1;
740 : }
741 0 : if (test_var > uint_max) {
742 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
743 : PyLong_Type.tp_name, uint_max, test_var);
744 0 : return -1;
745 : }
746 0 : object->count = test_var;
747 : } else {
748 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
749 : PyLong_Type.tp_name);
750 0 : return -1;
751 : }
752 : }
753 0 : return 0;
754 : }
755 :
756 0 : static PyObject *py_lsa_Strings_get_names(PyObject *obj, void *closure)
757 : {
758 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(obj);
759 0 : PyObject *py_names;
760 0 : if (object->names == NULL) {
761 0 : Py_RETURN_NONE;
762 : }
763 0 : if (object->names == NULL) {
764 0 : py_names = Py_None;
765 0 : Py_INCREF(py_names);
766 : } else {
767 0 : py_names = PyList_New(object->count);
768 0 : if (py_names == NULL) {
769 0 : return NULL;
770 : }
771 : {
772 : int names_cntr_1;
773 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
774 0 : PyObject *py_names_1;
775 0 : py_names_1 = pytalloc_reference_ex(&lsa_String_Type, object->names, &object->names[names_cntr_1]);
776 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
777 : }
778 : }
779 : }
780 0 : return py_names;
781 : }
782 :
783 0 : static int py_lsa_Strings_set_names(PyObject *py_obj, PyObject *value, void *closure)
784 : {
785 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
786 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
787 0 : if (value == NULL) {
788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
789 0 : return -1;
790 : }
791 0 : if (value == Py_None) {
792 0 : object->names = NULL;
793 : } else {
794 0 : object->names = NULL;
795 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
796 : {
797 0 : int names_cntr_1;
798 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
799 0 : if (!object->names) { return -1; }
800 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
801 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
802 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
804 0 : return -1;
805 : }
806 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
807 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
808 0 : PyErr_NoMemory();
809 0 : return -1;
810 : }
811 0 : object->names[names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
812 : }
813 : }
814 : }
815 0 : return 0;
816 : }
817 :
818 : static PyGetSetDef py_lsa_Strings_getsetters[] = {
819 : {
820 : .name = discard_const_p(char, "count"),
821 : .get = py_lsa_Strings_get_count,
822 : .set = py_lsa_Strings_set_count,
823 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
824 : },
825 : {
826 : .name = discard_const_p(char, "names"),
827 : .get = py_lsa_Strings_get_names,
828 : .set = py_lsa_Strings_set_names,
829 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
830 : },
831 : { .name = NULL }
832 : };
833 :
834 0 : static PyObject *py_lsa_Strings_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
835 : {
836 0 : return pytalloc_new(struct lsa_Strings, type);
837 : }
838 :
839 0 : static PyObject *py_lsa_Strings_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
840 : {
841 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
842 0 : PyObject *ret = NULL;
843 0 : DATA_BLOB blob;
844 0 : enum ndr_err_code err;
845 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
846 0 : if (tmp_ctx == NULL) {
847 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
848 0 : return NULL;
849 : }
850 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_Strings);
851 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
852 0 : TALLOC_FREE(tmp_ctx);
853 0 : PyErr_SetNdrError(err);
854 0 : return NULL;
855 : }
856 :
857 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
858 0 : TALLOC_FREE(tmp_ctx);
859 0 : return ret;
860 : }
861 :
862 0 : static PyObject *py_lsa_Strings_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
863 : {
864 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
865 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
866 0 : Py_ssize_t blob_length = 0;
867 0 : enum ndr_err_code err;
868 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
869 0 : PyObject *allow_remaining_obj = NULL;
870 0 : bool allow_remaining = false;
871 :
872 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
873 : discard_const_p(char *, kwnames),
874 : &blob.data, &blob_length,
875 : &allow_remaining_obj)) {
876 0 : return NULL;
877 : }
878 0 : blob.length = blob_length;
879 :
880 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
881 0 : allow_remaining = true;
882 : }
883 :
884 0 : if (allow_remaining) {
885 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
886 : } else {
887 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
888 : }
889 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
890 0 : PyErr_SetNdrError(err);
891 0 : return NULL;
892 : }
893 :
894 0 : Py_RETURN_NONE;
895 : }
896 :
897 0 : static PyObject *py_lsa_Strings_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
898 : {
899 0 : struct lsa_Strings *object = (struct lsa_Strings *)pytalloc_get_ptr(py_obj);
900 0 : PyObject *ret;
901 0 : char *retstr;
902 :
903 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_Strings, "lsa_Strings", object);
904 0 : ret = PyUnicode_FromString(retstr);
905 0 : talloc_free(retstr);
906 :
907 0 : return ret;
908 : }
909 :
910 : static PyMethodDef py_lsa_Strings_methods[] = {
911 : { "__ndr_pack__", (PyCFunction)py_lsa_Strings_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
912 : { "__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" },
913 : { "__ndr_print__", (PyCFunction)py_lsa_Strings_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
914 : { NULL, NULL, 0, NULL }
915 : };
916 :
917 :
918 : static PyTypeObject lsa_Strings_Type = {
919 : PyVarObject_HEAD_INIT(NULL, 0)
920 : .tp_name = "lsa.Strings",
921 : .tp_getset = py_lsa_Strings_getsetters,
922 : .tp_methods = py_lsa_Strings_methods,
923 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
924 : .tp_new = py_lsa_Strings_new,
925 : };
926 :
927 :
928 0 : static PyObject *py_lsa_AsciiString_get_length(PyObject *obj, void *closure)
929 : {
930 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
931 0 : PyObject *py_length;
932 0 : py_length = PyLong_FromLong((uint16_t)object->length);
933 0 : return py_length;
934 : }
935 :
936 0 : static int py_lsa_AsciiString_set_length(PyObject *py_obj, PyObject *value, void *closure)
937 : {
938 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
939 0 : if (value == NULL) {
940 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
941 0 : return -1;
942 : }
943 : {
944 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
945 0 : if (PyLong_Check(value)) {
946 0 : unsigned long long test_var;
947 0 : test_var = PyLong_AsUnsignedLongLong(value);
948 0 : if (PyErr_Occurred() != NULL) {
949 0 : return -1;
950 : }
951 0 : if (test_var > uint_max) {
952 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
953 : PyLong_Type.tp_name, uint_max, test_var);
954 0 : return -1;
955 : }
956 0 : object->length = test_var;
957 : } else {
958 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
959 : PyLong_Type.tp_name);
960 0 : return -1;
961 : }
962 : }
963 0 : return 0;
964 : }
965 :
966 0 : static PyObject *py_lsa_AsciiString_get_size(PyObject *obj, void *closure)
967 : {
968 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
969 0 : PyObject *py_size;
970 0 : py_size = PyLong_FromLong((uint16_t)object->size);
971 0 : return py_size;
972 : }
973 :
974 0 : static int py_lsa_AsciiString_set_size(PyObject *py_obj, PyObject *value, void *closure)
975 : {
976 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
977 0 : if (value == NULL) {
978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
979 0 : return -1;
980 : }
981 : {
982 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
983 0 : if (PyLong_Check(value)) {
984 0 : unsigned long long test_var;
985 0 : test_var = PyLong_AsUnsignedLongLong(value);
986 0 : if (PyErr_Occurred() != NULL) {
987 0 : return -1;
988 : }
989 0 : if (test_var > uint_max) {
990 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
991 : PyLong_Type.tp_name, uint_max, test_var);
992 0 : return -1;
993 : }
994 0 : object->size = test_var;
995 : } else {
996 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
997 : PyLong_Type.tp_name);
998 0 : return -1;
999 : }
1000 : }
1001 0 : return 0;
1002 : }
1003 :
1004 0 : static PyObject *py_lsa_AsciiString_get_string(PyObject *obj, void *closure)
1005 : {
1006 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(obj);
1007 0 : PyObject *py_string;
1008 0 : if (object->string == NULL) {
1009 0 : Py_RETURN_NONE;
1010 : }
1011 0 : if (object->string == NULL) {
1012 0 : py_string = Py_None;
1013 0 : Py_INCREF(py_string);
1014 : } else {
1015 0 : if (object->string == NULL) {
1016 0 : py_string = Py_None;
1017 0 : Py_INCREF(py_string);
1018 : } else {
1019 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1020 : }
1021 : }
1022 0 : return py_string;
1023 : }
1024 :
1025 0 : static int py_lsa_AsciiString_set_string(PyObject *py_obj, PyObject *value, void *closure)
1026 : {
1027 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1028 0 : if (value == NULL) {
1029 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
1030 0 : return -1;
1031 : }
1032 0 : if (value == Py_None) {
1033 0 : object->string = NULL;
1034 : } else {
1035 0 : object->string = NULL;
1036 : {
1037 0 : const char *test_str;
1038 0 : const char *talloc_str;
1039 0 : PyObject *unicode = NULL;
1040 0 : if (PyUnicode_Check(value)) {
1041 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1042 0 : if (unicode == NULL) {
1043 0 : return -1;
1044 : }
1045 0 : test_str = PyBytes_AS_STRING(unicode);
1046 0 : } else if (PyBytes_Check(value)) {
1047 0 : test_str = PyBytes_AS_STRING(value);
1048 : } else {
1049 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1050 0 : return -1;
1051 : }
1052 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1053 0 : if (unicode != NULL) {
1054 0 : Py_DECREF(unicode);
1055 : }
1056 0 : if (talloc_str == NULL) {
1057 0 : PyErr_NoMemory();
1058 0 : return -1;
1059 : }
1060 0 : object->string = talloc_str;
1061 : }
1062 : }
1063 0 : return 0;
1064 : }
1065 :
1066 : static PyGetSetDef py_lsa_AsciiString_getsetters[] = {
1067 : {
1068 : .name = discard_const_p(char, "length"),
1069 : .get = py_lsa_AsciiString_get_length,
1070 : .set = py_lsa_AsciiString_set_length,
1071 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1072 : },
1073 : {
1074 : .name = discard_const_p(char, "size"),
1075 : .get = py_lsa_AsciiString_get_size,
1076 : .set = py_lsa_AsciiString_set_size,
1077 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1078 : },
1079 : {
1080 : .name = discard_const_p(char, "string"),
1081 : .get = py_lsa_AsciiString_get_string,
1082 : .set = py_lsa_AsciiString_set_string,
1083 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1084 : },
1085 : { .name = NULL }
1086 : };
1087 :
1088 0 : static PyObject *py_lsa_AsciiString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1089 : {
1090 0 : return pytalloc_new(struct lsa_AsciiString, type);
1091 : }
1092 :
1093 0 : static PyObject *py_lsa_AsciiString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1094 : {
1095 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1096 0 : PyObject *ret = NULL;
1097 0 : DATA_BLOB blob;
1098 0 : enum ndr_err_code err;
1099 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1100 0 : if (tmp_ctx == NULL) {
1101 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1102 0 : return NULL;
1103 : }
1104 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiString);
1105 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1106 0 : TALLOC_FREE(tmp_ctx);
1107 0 : PyErr_SetNdrError(err);
1108 0 : return NULL;
1109 : }
1110 :
1111 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1112 0 : TALLOC_FREE(tmp_ctx);
1113 0 : return ret;
1114 : }
1115 :
1116 0 : static PyObject *py_lsa_AsciiString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1117 : {
1118 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1119 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1120 0 : Py_ssize_t blob_length = 0;
1121 0 : enum ndr_err_code err;
1122 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1123 0 : PyObject *allow_remaining_obj = NULL;
1124 0 : bool allow_remaining = false;
1125 :
1126 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1127 : discard_const_p(char *, kwnames),
1128 : &blob.data, &blob_length,
1129 : &allow_remaining_obj)) {
1130 0 : return NULL;
1131 : }
1132 0 : blob.length = blob_length;
1133 :
1134 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1135 0 : allow_remaining = true;
1136 : }
1137 :
1138 0 : if (allow_remaining) {
1139 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1140 : } else {
1141 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1142 : }
1143 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1144 0 : PyErr_SetNdrError(err);
1145 0 : return NULL;
1146 : }
1147 :
1148 0 : Py_RETURN_NONE;
1149 : }
1150 :
1151 0 : static PyObject *py_lsa_AsciiString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1152 : {
1153 0 : struct lsa_AsciiString *object = (struct lsa_AsciiString *)pytalloc_get_ptr(py_obj);
1154 0 : PyObject *ret;
1155 0 : char *retstr;
1156 :
1157 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiString, "lsa_AsciiString", object);
1158 0 : ret = PyUnicode_FromString(retstr);
1159 0 : talloc_free(retstr);
1160 :
1161 0 : return ret;
1162 : }
1163 :
1164 : static PyMethodDef py_lsa_AsciiString_methods[] = {
1165 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1166 : { "__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" },
1167 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1168 : { NULL, NULL, 0, NULL }
1169 : };
1170 :
1171 :
1172 : static PyTypeObject lsa_AsciiString_Type = {
1173 : PyVarObject_HEAD_INIT(NULL, 0)
1174 : .tp_name = "lsa.AsciiString",
1175 : .tp_getset = py_lsa_AsciiString_getsetters,
1176 : .tp_methods = py_lsa_AsciiString_methods,
1177 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1178 : .tp_new = py_lsa_AsciiString_new,
1179 : };
1180 :
1181 :
1182 0 : static PyObject *py_lsa_AsciiStringLarge_get_length(PyObject *obj, void *closure)
1183 : {
1184 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1185 0 : PyObject *py_length;
1186 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1187 0 : return py_length;
1188 : }
1189 :
1190 0 : static int py_lsa_AsciiStringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
1191 : {
1192 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1193 0 : if (value == NULL) {
1194 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1195 0 : return -1;
1196 : }
1197 : {
1198 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1199 0 : if (PyLong_Check(value)) {
1200 0 : unsigned long long test_var;
1201 0 : test_var = PyLong_AsUnsignedLongLong(value);
1202 0 : if (PyErr_Occurred() != NULL) {
1203 0 : return -1;
1204 : }
1205 0 : if (test_var > uint_max) {
1206 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1207 : PyLong_Type.tp_name, uint_max, test_var);
1208 0 : return -1;
1209 : }
1210 0 : object->length = test_var;
1211 : } else {
1212 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1213 : PyLong_Type.tp_name);
1214 0 : return -1;
1215 : }
1216 : }
1217 0 : return 0;
1218 : }
1219 :
1220 0 : static PyObject *py_lsa_AsciiStringLarge_get_size(PyObject *obj, void *closure)
1221 : {
1222 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1223 0 : PyObject *py_size;
1224 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1225 0 : return py_size;
1226 : }
1227 :
1228 0 : static int py_lsa_AsciiStringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
1229 : {
1230 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1231 0 : if (value == NULL) {
1232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1233 0 : return -1;
1234 : }
1235 : {
1236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1237 0 : if (PyLong_Check(value)) {
1238 0 : unsigned long long test_var;
1239 0 : test_var = PyLong_AsUnsignedLongLong(value);
1240 0 : if (PyErr_Occurred() != NULL) {
1241 0 : return -1;
1242 : }
1243 0 : if (test_var > uint_max) {
1244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1245 : PyLong_Type.tp_name, uint_max, test_var);
1246 0 : return -1;
1247 : }
1248 0 : object->size = test_var;
1249 : } else {
1250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1251 : PyLong_Type.tp_name);
1252 0 : return -1;
1253 : }
1254 : }
1255 0 : return 0;
1256 : }
1257 :
1258 179 : static PyObject *py_lsa_AsciiStringLarge_get_string(PyObject *obj, void *closure)
1259 : {
1260 179 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(obj);
1261 0 : PyObject *py_string;
1262 179 : if (object->string == NULL) {
1263 0 : Py_RETURN_NONE;
1264 : }
1265 179 : if (object->string == NULL) {
1266 0 : py_string = Py_None;
1267 0 : Py_INCREF(py_string);
1268 : } else {
1269 179 : if (object->string == NULL) {
1270 0 : py_string = Py_None;
1271 0 : Py_INCREF(py_string);
1272 : } else {
1273 179 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1274 : }
1275 : }
1276 179 : return py_string;
1277 : }
1278 :
1279 0 : static int py_lsa_AsciiStringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
1280 : {
1281 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1282 0 : if (value == NULL) {
1283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->string");
1284 0 : return -1;
1285 : }
1286 0 : if (value == Py_None) {
1287 0 : object->string = NULL;
1288 : } else {
1289 0 : object->string = NULL;
1290 : {
1291 0 : const char *test_str;
1292 0 : const char *talloc_str;
1293 0 : PyObject *unicode = NULL;
1294 0 : if (PyUnicode_Check(value)) {
1295 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1296 0 : if (unicode == NULL) {
1297 0 : return -1;
1298 : }
1299 0 : test_str = PyBytes_AS_STRING(unicode);
1300 0 : } else if (PyBytes_Check(value)) {
1301 0 : test_str = PyBytes_AS_STRING(value);
1302 : } else {
1303 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1304 0 : return -1;
1305 : }
1306 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1307 0 : if (unicode != NULL) {
1308 0 : Py_DECREF(unicode);
1309 : }
1310 0 : if (talloc_str == NULL) {
1311 0 : PyErr_NoMemory();
1312 0 : return -1;
1313 : }
1314 0 : object->string = talloc_str;
1315 : }
1316 : }
1317 0 : return 0;
1318 : }
1319 :
1320 : static PyGetSetDef py_lsa_AsciiStringLarge_getsetters[] = {
1321 : {
1322 : .name = discard_const_p(char, "length"),
1323 : .get = py_lsa_AsciiStringLarge_get_length,
1324 : .set = py_lsa_AsciiStringLarge_set_length,
1325 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1326 : },
1327 : {
1328 : .name = discard_const_p(char, "size"),
1329 : .get = py_lsa_AsciiStringLarge_get_size,
1330 : .set = py_lsa_AsciiStringLarge_set_size,
1331 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1332 : },
1333 : {
1334 : .name = discard_const_p(char, "string"),
1335 : .get = py_lsa_AsciiStringLarge_get_string,
1336 : .set = py_lsa_AsciiStringLarge_set_string,
1337 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1338 : },
1339 : { .name = NULL }
1340 : };
1341 :
1342 0 : static PyObject *py_lsa_AsciiStringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1343 : {
1344 0 : return pytalloc_new(struct lsa_AsciiStringLarge, type);
1345 : }
1346 :
1347 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1348 : {
1349 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1350 0 : PyObject *ret = NULL;
1351 0 : DATA_BLOB blob;
1352 0 : enum ndr_err_code err;
1353 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1354 0 : if (tmp_ctx == NULL) {
1355 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1356 0 : return NULL;
1357 : }
1358 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiStringLarge);
1359 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1360 0 : TALLOC_FREE(tmp_ctx);
1361 0 : PyErr_SetNdrError(err);
1362 0 : return NULL;
1363 : }
1364 :
1365 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1366 0 : TALLOC_FREE(tmp_ctx);
1367 0 : return ret;
1368 : }
1369 :
1370 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1371 : {
1372 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1373 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1374 0 : Py_ssize_t blob_length = 0;
1375 0 : enum ndr_err_code err;
1376 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1377 0 : PyObject *allow_remaining_obj = NULL;
1378 0 : bool allow_remaining = false;
1379 :
1380 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1381 : discard_const_p(char *, kwnames),
1382 : &blob.data, &blob_length,
1383 : &allow_remaining_obj)) {
1384 0 : return NULL;
1385 : }
1386 0 : blob.length = blob_length;
1387 :
1388 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1389 0 : allow_remaining = true;
1390 : }
1391 :
1392 0 : if (allow_remaining) {
1393 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1394 : } else {
1395 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1396 : }
1397 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1398 0 : PyErr_SetNdrError(err);
1399 0 : return NULL;
1400 : }
1401 :
1402 0 : Py_RETURN_NONE;
1403 : }
1404 :
1405 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1406 : {
1407 0 : struct lsa_AsciiStringLarge *object = (struct lsa_AsciiStringLarge *)pytalloc_get_ptr(py_obj);
1408 0 : PyObject *ret;
1409 0 : char *retstr;
1410 :
1411 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiStringLarge, "lsa_AsciiStringLarge", object);
1412 0 : ret = PyUnicode_FromString(retstr);
1413 0 : talloc_free(retstr);
1414 :
1415 0 : return ret;
1416 : }
1417 :
1418 : static PyMethodDef py_lsa_AsciiStringLarge_methods[] = {
1419 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1420 : { "__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" },
1421 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1422 : { NULL, NULL, 0, NULL }
1423 : };
1424 :
1425 :
1426 : static PyTypeObject lsa_AsciiStringLarge_Type = {
1427 : PyVarObject_HEAD_INIT(NULL, 0)
1428 : .tp_name = "lsa.AsciiStringLarge",
1429 : .tp_getset = py_lsa_AsciiStringLarge_getsetters,
1430 : .tp_methods = py_lsa_AsciiStringLarge_methods,
1431 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1432 : .tp_new = py_lsa_AsciiStringLarge_new,
1433 : };
1434 :
1435 :
1436 0 : static PyObject *py_lsa_BinaryString_get_length(PyObject *obj, void *closure)
1437 : {
1438 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1439 0 : PyObject *py_length;
1440 0 : py_length = PyLong_FromLong((uint16_t)object->length);
1441 0 : return py_length;
1442 : }
1443 :
1444 0 : static int py_lsa_BinaryString_set_length(PyObject *py_obj, PyObject *value, void *closure)
1445 : {
1446 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1447 0 : if (value == NULL) {
1448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
1449 0 : return -1;
1450 : }
1451 : {
1452 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1453 0 : if (PyLong_Check(value)) {
1454 0 : unsigned long long test_var;
1455 0 : test_var = PyLong_AsUnsignedLongLong(value);
1456 0 : if (PyErr_Occurred() != NULL) {
1457 0 : return -1;
1458 : }
1459 0 : if (test_var > uint_max) {
1460 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1461 : PyLong_Type.tp_name, uint_max, test_var);
1462 0 : return -1;
1463 : }
1464 0 : object->length = test_var;
1465 : } else {
1466 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1467 : PyLong_Type.tp_name);
1468 0 : return -1;
1469 : }
1470 : }
1471 0 : return 0;
1472 : }
1473 :
1474 0 : static PyObject *py_lsa_BinaryString_get_size(PyObject *obj, void *closure)
1475 : {
1476 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1477 0 : PyObject *py_size;
1478 0 : py_size = PyLong_FromLong((uint16_t)object->size);
1479 0 : return py_size;
1480 : }
1481 :
1482 0 : static int py_lsa_BinaryString_set_size(PyObject *py_obj, PyObject *value, void *closure)
1483 : {
1484 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1485 0 : if (value == NULL) {
1486 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
1487 0 : return -1;
1488 : }
1489 : {
1490 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1491 0 : if (PyLong_Check(value)) {
1492 0 : unsigned long long test_var;
1493 0 : test_var = PyLong_AsUnsignedLongLong(value);
1494 0 : if (PyErr_Occurred() != NULL) {
1495 0 : return -1;
1496 : }
1497 0 : if (test_var > uint_max) {
1498 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1499 : PyLong_Type.tp_name, uint_max, test_var);
1500 0 : return -1;
1501 : }
1502 0 : object->size = test_var;
1503 : } else {
1504 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1505 : PyLong_Type.tp_name);
1506 0 : return -1;
1507 : }
1508 : }
1509 0 : return 0;
1510 : }
1511 :
1512 0 : static PyObject *py_lsa_BinaryString_get_array(PyObject *obj, void *closure)
1513 : {
1514 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(obj);
1515 0 : PyObject *py_array;
1516 0 : if (object->array == NULL) {
1517 0 : Py_RETURN_NONE;
1518 : }
1519 0 : if (object->array == NULL) {
1520 0 : py_array = Py_None;
1521 0 : Py_INCREF(py_array);
1522 : } else {
1523 0 : py_array = PyList_New(object->length / 2);
1524 0 : if (py_array == NULL) {
1525 0 : return NULL;
1526 : }
1527 : {
1528 : int array_cntr_1;
1529 0 : for (array_cntr_1 = 0; array_cntr_1 < (object->length / 2); array_cntr_1++) {
1530 0 : PyObject *py_array_1;
1531 0 : py_array_1 = PyLong_FromLong((uint16_t)object->array[array_cntr_1]);
1532 0 : PyList_SetItem(py_array, array_cntr_1, py_array_1);
1533 : }
1534 : }
1535 : }
1536 0 : return py_array;
1537 : }
1538 :
1539 0 : static int py_lsa_BinaryString_set_array(PyObject *py_obj, PyObject *value, void *closure)
1540 : {
1541 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1542 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
1543 0 : if (value == NULL) {
1544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
1545 0 : return -1;
1546 : }
1547 0 : if (value == Py_None) {
1548 0 : object->array = NULL;
1549 : } else {
1550 0 : object->array = NULL;
1551 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1552 : {
1553 0 : int array_cntr_1;
1554 0 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
1555 0 : if (!object->array) { return -1; }
1556 0 : talloc_set_name_const(object->array, "ARRAY: object->array");
1557 0 : for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
1558 0 : if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
1559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
1560 0 : return -1;
1561 : }
1562 : {
1563 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->array[array_cntr_1]));
1564 0 : if (PyLong_Check(PyList_GET_ITEM(value, array_cntr_1))) {
1565 0 : unsigned long long test_var;
1566 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, array_cntr_1));
1567 0 : if (PyErr_Occurred() != NULL) {
1568 0 : return -1;
1569 : }
1570 0 : if (test_var > uint_max) {
1571 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1572 : PyLong_Type.tp_name, uint_max, test_var);
1573 0 : return -1;
1574 : }
1575 0 : object->array[array_cntr_1] = test_var;
1576 : } else {
1577 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1578 : PyLong_Type.tp_name);
1579 0 : return -1;
1580 : }
1581 : }
1582 : }
1583 : }
1584 : }
1585 0 : return 0;
1586 : }
1587 :
1588 : static PyGetSetDef py_lsa_BinaryString_getsetters[] = {
1589 : {
1590 : .name = discard_const_p(char, "length"),
1591 : .get = py_lsa_BinaryString_get_length,
1592 : .set = py_lsa_BinaryString_set_length,
1593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1594 : },
1595 : {
1596 : .name = discard_const_p(char, "size"),
1597 : .get = py_lsa_BinaryString_get_size,
1598 : .set = py_lsa_BinaryString_set_size,
1599 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1600 : },
1601 : {
1602 : .name = discard_const_p(char, "array"),
1603 : .get = py_lsa_BinaryString_get_array,
1604 : .set = py_lsa_BinaryString_set_array,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1606 : },
1607 : { .name = NULL }
1608 : };
1609 :
1610 0 : static PyObject *py_lsa_BinaryString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1611 : {
1612 0 : return pytalloc_new(struct lsa_BinaryString, type);
1613 : }
1614 :
1615 0 : static PyObject *py_lsa_BinaryString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1616 : {
1617 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1618 0 : PyObject *ret = NULL;
1619 0 : DATA_BLOB blob;
1620 0 : enum ndr_err_code err;
1621 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1622 0 : if (tmp_ctx == NULL) {
1623 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1624 0 : return NULL;
1625 : }
1626 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_BinaryString);
1627 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1628 0 : TALLOC_FREE(tmp_ctx);
1629 0 : PyErr_SetNdrError(err);
1630 0 : return NULL;
1631 : }
1632 :
1633 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1634 0 : TALLOC_FREE(tmp_ctx);
1635 0 : return ret;
1636 : }
1637 :
1638 0 : static PyObject *py_lsa_BinaryString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1639 : {
1640 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1641 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1642 0 : Py_ssize_t blob_length = 0;
1643 0 : enum ndr_err_code err;
1644 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1645 0 : PyObject *allow_remaining_obj = NULL;
1646 0 : bool allow_remaining = false;
1647 :
1648 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1649 : discard_const_p(char *, kwnames),
1650 : &blob.data, &blob_length,
1651 : &allow_remaining_obj)) {
1652 0 : return NULL;
1653 : }
1654 0 : blob.length = blob_length;
1655 :
1656 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1657 0 : allow_remaining = true;
1658 : }
1659 :
1660 0 : if (allow_remaining) {
1661 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1662 : } else {
1663 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1664 : }
1665 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1666 0 : PyErr_SetNdrError(err);
1667 0 : return NULL;
1668 : }
1669 :
1670 0 : Py_RETURN_NONE;
1671 : }
1672 :
1673 0 : static PyObject *py_lsa_BinaryString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1674 : {
1675 0 : struct lsa_BinaryString *object = (struct lsa_BinaryString *)pytalloc_get_ptr(py_obj);
1676 0 : PyObject *ret;
1677 0 : char *retstr;
1678 :
1679 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_BinaryString, "lsa_BinaryString", object);
1680 0 : ret = PyUnicode_FromString(retstr);
1681 0 : talloc_free(retstr);
1682 :
1683 0 : return ret;
1684 : }
1685 :
1686 : static PyMethodDef py_lsa_BinaryString_methods[] = {
1687 : { "__ndr_pack__", (PyCFunction)py_lsa_BinaryString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1688 : { "__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" },
1689 : { "__ndr_print__", (PyCFunction)py_lsa_BinaryString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1690 : { NULL, NULL, 0, NULL }
1691 : };
1692 :
1693 :
1694 : static PyTypeObject lsa_BinaryString_Type = {
1695 : PyVarObject_HEAD_INIT(NULL, 0)
1696 : .tp_name = "lsa.BinaryString",
1697 : .tp_getset = py_lsa_BinaryString_getsetters,
1698 : .tp_methods = py_lsa_BinaryString_methods,
1699 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1700 : .tp_new = py_lsa_BinaryString_new,
1701 : };
1702 :
1703 :
1704 0 : static PyObject *py_lsa_LUID_get_low(PyObject *obj, void *closure)
1705 : {
1706 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1707 0 : PyObject *py_low;
1708 0 : py_low = PyLong_FromUnsignedLongLong((uint32_t)object->low);
1709 0 : return py_low;
1710 : }
1711 :
1712 0 : static int py_lsa_LUID_set_low(PyObject *py_obj, PyObject *value, void *closure)
1713 : {
1714 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1715 0 : if (value == NULL) {
1716 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->low");
1717 0 : return -1;
1718 : }
1719 : {
1720 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->low));
1721 0 : if (PyLong_Check(value)) {
1722 0 : unsigned long long test_var;
1723 0 : test_var = PyLong_AsUnsignedLongLong(value);
1724 0 : if (PyErr_Occurred() != NULL) {
1725 0 : return -1;
1726 : }
1727 0 : if (test_var > uint_max) {
1728 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1729 : PyLong_Type.tp_name, uint_max, test_var);
1730 0 : return -1;
1731 : }
1732 0 : object->low = test_var;
1733 : } else {
1734 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1735 : PyLong_Type.tp_name);
1736 0 : return -1;
1737 : }
1738 : }
1739 0 : return 0;
1740 : }
1741 :
1742 0 : static PyObject *py_lsa_LUID_get_high(PyObject *obj, void *closure)
1743 : {
1744 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(obj);
1745 0 : PyObject *py_high;
1746 0 : py_high = PyLong_FromUnsignedLongLong((uint32_t)object->high);
1747 0 : return py_high;
1748 : }
1749 :
1750 0 : static int py_lsa_LUID_set_high(PyObject *py_obj, PyObject *value, void *closure)
1751 : {
1752 0 : struct lsa_LUID *object = (struct lsa_LUID *)pytalloc_get_ptr(py_obj);
1753 0 : if (value == NULL) {
1754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->high");
1755 0 : return -1;
1756 : }
1757 : {
1758 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high));
1759 0 : if (PyLong_Check(value)) {
1760 0 : unsigned long long test_var;
1761 0 : test_var = PyLong_AsUnsignedLongLong(value);
1762 0 : if (PyErr_Occurred() != NULL) {
1763 0 : return -1;
1764 : }
1765 0 : if (test_var > uint_max) {
1766 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1767 : PyLong_Type.tp_name, uint_max, test_var);
1768 0 : return -1;
1769 : }
1770 0 : object->high = test_var;
1771 : } else {
1772 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1773 : PyLong_Type.tp_name);
1774 0 : return -1;
1775 : }
1776 : }
1777 0 : return 0;
1778 : }
1779 :
1780 : static PyGetSetDef py_lsa_LUID_getsetters[] = {
1781 : {
1782 : .name = discard_const_p(char, "low"),
1783 : .get = py_lsa_LUID_get_low,
1784 : .set = py_lsa_LUID_set_low,
1785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1786 : },
1787 : {
1788 : .name = discard_const_p(char, "high"),
1789 : .get = py_lsa_LUID_get_high,
1790 : .set = py_lsa_LUID_set_high,
1791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1792 : },
1793 : { .name = NULL }
1794 : };
1795 :
1796 0 : static PyObject *py_lsa_LUID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1797 : {
1798 0 : return pytalloc_new(struct lsa_LUID, type);
1799 : }
1800 :
1801 :
1802 : static PyTypeObject lsa_LUID_Type = {
1803 : PyVarObject_HEAD_INIT(NULL, 0)
1804 : .tp_name = "lsa.LUID",
1805 : .tp_getset = py_lsa_LUID_getsetters,
1806 : .tp_methods = NULL,
1807 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1808 : .tp_new = py_lsa_LUID_new,
1809 : };
1810 :
1811 :
1812 0 : static PyObject *py_lsa_PrivEntry_get_name(PyObject *obj, void *closure)
1813 : {
1814 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1815 0 : PyObject *py_name;
1816 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
1817 0 : return py_name;
1818 : }
1819 :
1820 0 : static int py_lsa_PrivEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
1821 : {
1822 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1823 0 : if (value == NULL) {
1824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
1825 0 : return -1;
1826 : }
1827 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
1828 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1829 0 : PyErr_NoMemory();
1830 0 : return -1;
1831 : }
1832 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
1833 0 : return 0;
1834 : }
1835 :
1836 0 : static PyObject *py_lsa_PrivEntry_get_luid(PyObject *obj, void *closure)
1837 : {
1838 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(obj);
1839 0 : PyObject *py_luid;
1840 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
1841 0 : return py_luid;
1842 : }
1843 :
1844 0 : static int py_lsa_PrivEntry_set_luid(PyObject *py_obj, PyObject *value, void *closure)
1845 : {
1846 0 : struct lsa_PrivEntry *object = (struct lsa_PrivEntry *)pytalloc_get_ptr(py_obj);
1847 0 : if (value == NULL) {
1848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->luid");
1849 0 : return -1;
1850 : }
1851 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
1852 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1853 0 : PyErr_NoMemory();
1854 0 : return -1;
1855 : }
1856 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
1857 0 : return 0;
1858 : }
1859 :
1860 : static PyGetSetDef py_lsa_PrivEntry_getsetters[] = {
1861 : {
1862 : .name = discard_const_p(char, "name"),
1863 : .get = py_lsa_PrivEntry_get_name,
1864 : .set = py_lsa_PrivEntry_set_name,
1865 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
1866 : },
1867 : {
1868 : .name = discard_const_p(char, "luid"),
1869 : .get = py_lsa_PrivEntry_get_luid,
1870 : .set = py_lsa_PrivEntry_set_luid,
1871 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
1872 : },
1873 : { .name = NULL }
1874 : };
1875 :
1876 0 : static PyObject *py_lsa_PrivEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1877 : {
1878 0 : return pytalloc_new(struct lsa_PrivEntry, type);
1879 : }
1880 :
1881 :
1882 : static PyTypeObject lsa_PrivEntry_Type = {
1883 : PyVarObject_HEAD_INIT(NULL, 0)
1884 : .tp_name = "lsa.PrivEntry",
1885 : .tp_getset = py_lsa_PrivEntry_getsetters,
1886 : .tp_methods = NULL,
1887 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1888 : .tp_new = py_lsa_PrivEntry_new,
1889 : };
1890 :
1891 :
1892 0 : static PyObject *py_lsa_PrivArray_get_count(PyObject *obj, void *closure)
1893 : {
1894 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1895 0 : PyObject *py_count;
1896 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
1897 0 : return py_count;
1898 : }
1899 :
1900 0 : static int py_lsa_PrivArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1901 : {
1902 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1903 0 : if (value == NULL) {
1904 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
1905 0 : return -1;
1906 : }
1907 : {
1908 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1909 0 : if (PyLong_Check(value)) {
1910 0 : unsigned long long test_var;
1911 0 : test_var = PyLong_AsUnsignedLongLong(value);
1912 0 : if (PyErr_Occurred() != NULL) {
1913 0 : return -1;
1914 : }
1915 0 : if (test_var > uint_max) {
1916 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1917 : PyLong_Type.tp_name, uint_max, test_var);
1918 0 : return -1;
1919 : }
1920 0 : object->count = test_var;
1921 : } else {
1922 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1923 : PyLong_Type.tp_name);
1924 0 : return -1;
1925 : }
1926 : }
1927 0 : return 0;
1928 : }
1929 :
1930 0 : static PyObject *py_lsa_PrivArray_get_privs(PyObject *obj, void *closure)
1931 : {
1932 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(obj);
1933 0 : PyObject *py_privs;
1934 0 : if (object->privs == NULL) {
1935 0 : Py_RETURN_NONE;
1936 : }
1937 0 : if (object->privs == NULL) {
1938 0 : py_privs = Py_None;
1939 0 : Py_INCREF(py_privs);
1940 : } else {
1941 0 : py_privs = PyList_New(object->count);
1942 0 : if (py_privs == NULL) {
1943 0 : return NULL;
1944 : }
1945 : {
1946 : int privs_cntr_1;
1947 0 : for (privs_cntr_1 = 0; privs_cntr_1 < (object->count); privs_cntr_1++) {
1948 0 : PyObject *py_privs_1;
1949 0 : py_privs_1 = pytalloc_reference_ex(&lsa_PrivEntry_Type, object->privs, &object->privs[privs_cntr_1]);
1950 0 : PyList_SetItem(py_privs, privs_cntr_1, py_privs_1);
1951 : }
1952 : }
1953 : }
1954 0 : return py_privs;
1955 : }
1956 :
1957 0 : static int py_lsa_PrivArray_set_privs(PyObject *py_obj, PyObject *value, void *closure)
1958 : {
1959 0 : struct lsa_PrivArray *object = (struct lsa_PrivArray *)pytalloc_get_ptr(py_obj);
1960 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privs));
1961 0 : if (value == NULL) {
1962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privs");
1963 0 : return -1;
1964 : }
1965 0 : if (value == Py_None) {
1966 0 : object->privs = NULL;
1967 : } else {
1968 0 : object->privs = NULL;
1969 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1970 : {
1971 0 : int privs_cntr_1;
1972 0 : object->privs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privs, PyList_GET_SIZE(value));
1973 0 : if (!object->privs) { return -1; }
1974 0 : talloc_set_name_const(object->privs, "ARRAY: object->privs");
1975 0 : for (privs_cntr_1 = 0; privs_cntr_1 < PyList_GET_SIZE(value); privs_cntr_1++) {
1976 0 : if (PyList_GET_ITEM(value, privs_cntr_1) == NULL) {
1977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->privs[privs_cntr_1]");
1978 0 : return -1;
1979 : }
1980 0 : PY_CHECK_TYPE(&lsa_PrivEntry_Type, PyList_GET_ITEM(value, privs_cntr_1), return -1;);
1981 0 : if (talloc_reference(object->privs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privs_cntr_1))) == NULL) {
1982 0 : PyErr_NoMemory();
1983 0 : return -1;
1984 : }
1985 0 : object->privs[privs_cntr_1] = *(struct lsa_PrivEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, privs_cntr_1));
1986 : }
1987 : }
1988 : }
1989 0 : return 0;
1990 : }
1991 :
1992 : static PyGetSetDef py_lsa_PrivArray_getsetters[] = {
1993 : {
1994 : .name = discard_const_p(char, "count"),
1995 : .get = py_lsa_PrivArray_get_count,
1996 : .set = py_lsa_PrivArray_set_count,
1997 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1998 : },
1999 : {
2000 : .name = discard_const_p(char, "privs"),
2001 : .get = py_lsa_PrivArray_get_privs,
2002 : .set = py_lsa_PrivArray_set_privs,
2003 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivEntry")
2004 : },
2005 : { .name = NULL }
2006 : };
2007 :
2008 0 : static PyObject *py_lsa_PrivArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2009 : {
2010 0 : return pytalloc_new(struct lsa_PrivArray, type);
2011 : }
2012 :
2013 :
2014 : static PyTypeObject lsa_PrivArray_Type = {
2015 : PyVarObject_HEAD_INIT(NULL, 0)
2016 : .tp_name = "lsa.PrivArray",
2017 : .tp_getset = py_lsa_PrivArray_getsetters,
2018 : .tp_methods = NULL,
2019 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2020 : .tp_new = py_lsa_PrivArray_new,
2021 : };
2022 :
2023 :
2024 0 : static PyObject *py_lsa_QosInfo_get_len(PyObject *obj, void *closure)
2025 : {
2026 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2027 0 : PyObject *py_len;
2028 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len);
2029 0 : return py_len;
2030 : }
2031 :
2032 0 : static int py_lsa_QosInfo_set_len(PyObject *py_obj, PyObject *value, void *closure)
2033 : {
2034 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2035 0 : if (value == NULL) {
2036 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len");
2037 0 : return -1;
2038 : }
2039 : {
2040 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2041 0 : if (PyLong_Check(value)) {
2042 0 : unsigned long long test_var;
2043 0 : test_var = PyLong_AsUnsignedLongLong(value);
2044 0 : if (PyErr_Occurred() != NULL) {
2045 0 : return -1;
2046 : }
2047 0 : if (test_var > uint_max) {
2048 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2049 : PyLong_Type.tp_name, uint_max, test_var);
2050 0 : return -1;
2051 : }
2052 0 : object->len = test_var;
2053 : } else {
2054 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2055 : PyLong_Type.tp_name);
2056 0 : return -1;
2057 : }
2058 : }
2059 0 : return 0;
2060 : }
2061 :
2062 0 : static PyObject *py_lsa_QosInfo_get_impersonation_level(PyObject *obj, void *closure)
2063 : {
2064 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2065 0 : PyObject *py_impersonation_level;
2066 0 : py_impersonation_level = PyLong_FromLong((uint16_t)object->impersonation_level);
2067 0 : return py_impersonation_level;
2068 : }
2069 :
2070 0 : static int py_lsa_QosInfo_set_impersonation_level(PyObject *py_obj, PyObject *value, void *closure)
2071 : {
2072 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2073 0 : if (value == NULL) {
2074 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->impersonation_level");
2075 0 : return -1;
2076 : }
2077 : {
2078 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->impersonation_level));
2079 0 : if (PyLong_Check(value)) {
2080 0 : unsigned long long test_var;
2081 0 : test_var = PyLong_AsUnsignedLongLong(value);
2082 0 : if (PyErr_Occurred() != NULL) {
2083 0 : return -1;
2084 : }
2085 0 : if (test_var > uint_max) {
2086 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2087 : PyLong_Type.tp_name, uint_max, test_var);
2088 0 : return -1;
2089 : }
2090 0 : object->impersonation_level = test_var;
2091 : } else {
2092 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2093 : PyLong_Type.tp_name);
2094 0 : return -1;
2095 : }
2096 : }
2097 0 : return 0;
2098 : }
2099 :
2100 0 : static PyObject *py_lsa_QosInfo_get_context_mode(PyObject *obj, void *closure)
2101 : {
2102 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2103 0 : PyObject *py_context_mode;
2104 0 : py_context_mode = PyLong_FromLong((uint16_t)object->context_mode);
2105 0 : return py_context_mode;
2106 : }
2107 :
2108 0 : static int py_lsa_QosInfo_set_context_mode(PyObject *py_obj, PyObject *value, void *closure)
2109 : {
2110 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2111 0 : if (value == NULL) {
2112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->context_mode");
2113 0 : return -1;
2114 : }
2115 : {
2116 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_mode));
2117 0 : if (PyLong_Check(value)) {
2118 0 : unsigned long long test_var;
2119 0 : test_var = PyLong_AsUnsignedLongLong(value);
2120 0 : if (PyErr_Occurred() != NULL) {
2121 0 : return -1;
2122 : }
2123 0 : if (test_var > uint_max) {
2124 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2125 : PyLong_Type.tp_name, uint_max, test_var);
2126 0 : return -1;
2127 : }
2128 0 : object->context_mode = test_var;
2129 : } else {
2130 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2131 : PyLong_Type.tp_name);
2132 0 : return -1;
2133 : }
2134 : }
2135 0 : return 0;
2136 : }
2137 :
2138 0 : static PyObject *py_lsa_QosInfo_get_effective_only(PyObject *obj, void *closure)
2139 : {
2140 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(obj);
2141 0 : PyObject *py_effective_only;
2142 0 : py_effective_only = PyLong_FromLong((uint16_t)object->effective_only);
2143 0 : return py_effective_only;
2144 : }
2145 :
2146 0 : static int py_lsa_QosInfo_set_effective_only(PyObject *py_obj, PyObject *value, void *closure)
2147 : {
2148 0 : struct lsa_QosInfo *object = (struct lsa_QosInfo *)pytalloc_get_ptr(py_obj);
2149 0 : if (value == NULL) {
2150 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->effective_only");
2151 0 : return -1;
2152 : }
2153 : {
2154 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->effective_only));
2155 0 : if (PyLong_Check(value)) {
2156 0 : unsigned long long test_var;
2157 0 : test_var = PyLong_AsUnsignedLongLong(value);
2158 0 : if (PyErr_Occurred() != NULL) {
2159 0 : return -1;
2160 : }
2161 0 : if (test_var > uint_max) {
2162 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2163 : PyLong_Type.tp_name, uint_max, test_var);
2164 0 : return -1;
2165 : }
2166 0 : object->effective_only = test_var;
2167 : } else {
2168 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2169 : PyLong_Type.tp_name);
2170 0 : return -1;
2171 : }
2172 : }
2173 0 : return 0;
2174 : }
2175 :
2176 : static PyGetSetDef py_lsa_QosInfo_getsetters[] = {
2177 : {
2178 : .name = discard_const_p(char, "len"),
2179 : .get = py_lsa_QosInfo_get_len,
2180 : .set = py_lsa_QosInfo_set_len,
2181 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2182 : },
2183 : {
2184 : .name = discard_const_p(char, "impersonation_level"),
2185 : .get = py_lsa_QosInfo_get_impersonation_level,
2186 : .set = py_lsa_QosInfo_set_impersonation_level,
2187 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2188 : },
2189 : {
2190 : .name = discard_const_p(char, "context_mode"),
2191 : .get = py_lsa_QosInfo_get_context_mode,
2192 : .set = py_lsa_QosInfo_set_context_mode,
2193 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2194 : },
2195 : {
2196 : .name = discard_const_p(char, "effective_only"),
2197 : .get = py_lsa_QosInfo_get_effective_only,
2198 : .set = py_lsa_QosInfo_set_effective_only,
2199 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2200 : },
2201 : { .name = NULL }
2202 : };
2203 :
2204 229 : static PyObject *py_lsa_QosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2205 : {
2206 229 : return pytalloc_new(struct lsa_QosInfo, type);
2207 : }
2208 :
2209 :
2210 : static PyTypeObject lsa_QosInfo_Type = {
2211 : PyVarObject_HEAD_INIT(NULL, 0)
2212 : .tp_name = "lsa.QosInfo",
2213 : .tp_getset = py_lsa_QosInfo_getsetters,
2214 : .tp_methods = NULL,
2215 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2216 : .tp_new = py_lsa_QosInfo_new,
2217 : };
2218 :
2219 :
2220 0 : static PyObject *py_lsa_ObjectAttribute_get_len(PyObject *obj, void *closure)
2221 : {
2222 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2223 0 : PyObject *py_len;
2224 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)object->len);
2225 0 : return py_len;
2226 : }
2227 :
2228 0 : static int py_lsa_ObjectAttribute_set_len(PyObject *py_obj, PyObject *value, void *closure)
2229 : {
2230 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2231 0 : if (value == NULL) {
2232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->len");
2233 0 : return -1;
2234 : }
2235 : {
2236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2237 0 : if (PyLong_Check(value)) {
2238 0 : unsigned long long test_var;
2239 0 : test_var = PyLong_AsUnsignedLongLong(value);
2240 0 : if (PyErr_Occurred() != NULL) {
2241 0 : return -1;
2242 : }
2243 0 : if (test_var > uint_max) {
2244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2245 : PyLong_Type.tp_name, uint_max, test_var);
2246 0 : return -1;
2247 : }
2248 0 : object->len = test_var;
2249 : } else {
2250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2251 : PyLong_Type.tp_name);
2252 0 : return -1;
2253 : }
2254 : }
2255 0 : return 0;
2256 : }
2257 :
2258 0 : static PyObject *py_lsa_ObjectAttribute_get_root_dir(PyObject *obj, void *closure)
2259 : {
2260 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2261 0 : PyObject *py_root_dir;
2262 0 : if (object->root_dir == NULL) {
2263 0 : Py_RETURN_NONE;
2264 : }
2265 0 : if (object->root_dir == NULL) {
2266 0 : py_root_dir = Py_None;
2267 0 : Py_INCREF(py_root_dir);
2268 : } else {
2269 0 : py_root_dir = PyLong_FromLong((uint16_t)*object->root_dir);
2270 : }
2271 0 : return py_root_dir;
2272 : }
2273 :
2274 0 : static int py_lsa_ObjectAttribute_set_root_dir(PyObject *py_obj, PyObject *value, void *closure)
2275 : {
2276 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2277 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->root_dir));
2278 0 : if (value == NULL) {
2279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->root_dir");
2280 0 : return -1;
2281 : }
2282 0 : if (value == Py_None) {
2283 0 : object->root_dir = NULL;
2284 : } else {
2285 0 : object->root_dir = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->root_dir);
2286 0 : if (object->root_dir == NULL) {
2287 0 : PyErr_NoMemory();
2288 0 : return -1;
2289 : }
2290 : {
2291 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->root_dir));
2292 0 : if (PyLong_Check(value)) {
2293 0 : unsigned long long test_var;
2294 0 : test_var = PyLong_AsUnsignedLongLong(value);
2295 0 : if (PyErr_Occurred() != NULL) {
2296 0 : return -1;
2297 : }
2298 0 : if (test_var > uint_max) {
2299 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2300 : PyLong_Type.tp_name, uint_max, test_var);
2301 0 : return -1;
2302 : }
2303 0 : *object->root_dir = test_var;
2304 : } else {
2305 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2306 : PyLong_Type.tp_name);
2307 0 : return -1;
2308 : }
2309 : }
2310 : }
2311 0 : return 0;
2312 : }
2313 :
2314 0 : static PyObject *py_lsa_ObjectAttribute_get_object_name(PyObject *obj, void *closure)
2315 : {
2316 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2317 0 : PyObject *py_object_name;
2318 0 : if (object->object_name == NULL) {
2319 0 : Py_RETURN_NONE;
2320 : }
2321 0 : if (object->object_name == NULL) {
2322 0 : py_object_name = Py_None;
2323 0 : Py_INCREF(py_object_name);
2324 : } else {
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 : py_object_name = PyUnicode_Decode(object->object_name, strlen(object->object_name), "utf-8", "ignore");
2330 : }
2331 : }
2332 0 : return py_object_name;
2333 : }
2334 :
2335 0 : static int py_lsa_ObjectAttribute_set_object_name(PyObject *py_obj, PyObject *value, void *closure)
2336 : {
2337 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2338 0 : if (value == NULL) {
2339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->object_name");
2340 0 : return -1;
2341 : }
2342 0 : if (value == Py_None) {
2343 0 : object->object_name = NULL;
2344 : } else {
2345 0 : object->object_name = NULL;
2346 : {
2347 0 : const char *test_str;
2348 0 : const char *talloc_str;
2349 0 : PyObject *unicode = NULL;
2350 0 : if (PyUnicode_Check(value)) {
2351 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2352 0 : if (unicode == NULL) {
2353 0 : return -1;
2354 : }
2355 0 : test_str = PyBytes_AS_STRING(unicode);
2356 0 : } else if (PyBytes_Check(value)) {
2357 0 : test_str = PyBytes_AS_STRING(value);
2358 : } else {
2359 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2360 0 : return -1;
2361 : }
2362 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2363 0 : if (unicode != NULL) {
2364 0 : Py_DECREF(unicode);
2365 : }
2366 0 : if (talloc_str == NULL) {
2367 0 : PyErr_NoMemory();
2368 0 : return -1;
2369 : }
2370 0 : object->object_name = talloc_str;
2371 : }
2372 : }
2373 0 : return 0;
2374 : }
2375 :
2376 0 : static PyObject *py_lsa_ObjectAttribute_get_attributes(PyObject *obj, void *closure)
2377 : {
2378 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2379 0 : PyObject *py_attributes;
2380 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
2381 0 : return py_attributes;
2382 : }
2383 :
2384 0 : static int py_lsa_ObjectAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2385 : {
2386 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2387 0 : if (value == NULL) {
2388 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
2389 0 : return -1;
2390 : }
2391 : {
2392 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2393 0 : if (PyLong_Check(value)) {
2394 0 : unsigned long long test_var;
2395 0 : test_var = PyLong_AsUnsignedLongLong(value);
2396 0 : if (PyErr_Occurred() != NULL) {
2397 0 : return -1;
2398 : }
2399 0 : if (test_var > uint_max) {
2400 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2401 : PyLong_Type.tp_name, uint_max, test_var);
2402 0 : return -1;
2403 : }
2404 0 : object->attributes = test_var;
2405 : } else {
2406 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2407 : PyLong_Type.tp_name);
2408 0 : return -1;
2409 : }
2410 : }
2411 0 : return 0;
2412 : }
2413 :
2414 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_desc(PyObject *obj, void *closure)
2415 : {
2416 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2417 0 : PyObject *py_sec_desc;
2418 0 : if (object->sec_desc == NULL) {
2419 0 : Py_RETURN_NONE;
2420 : }
2421 0 : if (object->sec_desc == NULL) {
2422 0 : py_sec_desc = Py_None;
2423 0 : Py_INCREF(py_sec_desc);
2424 : } else {
2425 0 : py_sec_desc = pytalloc_reference_ex(security_descriptor_Type, object->sec_desc, object->sec_desc);
2426 : }
2427 0 : return py_sec_desc;
2428 : }
2429 :
2430 0 : static int py_lsa_ObjectAttribute_set_sec_desc(PyObject *py_obj, PyObject *value, void *closure)
2431 : {
2432 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2433 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_desc));
2434 0 : if (value == NULL) {
2435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sec_desc");
2436 0 : return -1;
2437 : }
2438 0 : if (value == Py_None) {
2439 0 : object->sec_desc = NULL;
2440 : } else {
2441 0 : object->sec_desc = NULL;
2442 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
2443 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2444 0 : PyErr_NoMemory();
2445 0 : return -1;
2446 : }
2447 0 : object->sec_desc = (struct security_descriptor *)pytalloc_get_ptr(value);
2448 : }
2449 0 : return 0;
2450 : }
2451 :
2452 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_qos(PyObject *obj, void *closure)
2453 : {
2454 0 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(obj);
2455 0 : PyObject *py_sec_qos;
2456 0 : if (object->sec_qos == NULL) {
2457 0 : Py_RETURN_NONE;
2458 : }
2459 0 : if (object->sec_qos == NULL) {
2460 0 : py_sec_qos = Py_None;
2461 0 : Py_INCREF(py_sec_qos);
2462 : } else {
2463 0 : py_sec_qos = pytalloc_reference_ex(&lsa_QosInfo_Type, object->sec_qos, object->sec_qos);
2464 : }
2465 0 : return py_sec_qos;
2466 : }
2467 :
2468 229 : static int py_lsa_ObjectAttribute_set_sec_qos(PyObject *py_obj, PyObject *value, void *closure)
2469 : {
2470 229 : struct lsa_ObjectAttribute *object = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_obj);
2471 229 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_qos));
2472 229 : if (value == NULL) {
2473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sec_qos");
2474 0 : return -1;
2475 : }
2476 229 : if (value == Py_None) {
2477 0 : object->sec_qos = NULL;
2478 : } else {
2479 229 : object->sec_qos = NULL;
2480 229 : PY_CHECK_TYPE(&lsa_QosInfo_Type, value, return -1;);
2481 229 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2482 0 : PyErr_NoMemory();
2483 0 : return -1;
2484 : }
2485 229 : object->sec_qos = (struct lsa_QosInfo *)pytalloc_get_ptr(value);
2486 : }
2487 227 : return 0;
2488 : }
2489 :
2490 : static PyGetSetDef py_lsa_ObjectAttribute_getsetters[] = {
2491 : {
2492 : .name = discard_const_p(char, "len"),
2493 : .get = py_lsa_ObjectAttribute_get_len,
2494 : .set = py_lsa_ObjectAttribute_set_len,
2495 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2496 : },
2497 : {
2498 : .name = discard_const_p(char, "root_dir"),
2499 : .get = py_lsa_ObjectAttribute_get_root_dir,
2500 : .set = py_lsa_ObjectAttribute_set_root_dir,
2501 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2502 : },
2503 : {
2504 : .name = discard_const_p(char, "object_name"),
2505 : .get = py_lsa_ObjectAttribute_get_object_name,
2506 : .set = py_lsa_ObjectAttribute_set_object_name,
2507 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2508 : },
2509 : {
2510 : .name = discard_const_p(char, "attributes"),
2511 : .get = py_lsa_ObjectAttribute_get_attributes,
2512 : .set = py_lsa_ObjectAttribute_set_attributes,
2513 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2514 : },
2515 : {
2516 : .name = discard_const_p(char, "sec_desc"),
2517 : .get = py_lsa_ObjectAttribute_get_sec_desc,
2518 : .set = py_lsa_ObjectAttribute_set_sec_desc,
2519 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
2520 : },
2521 : {
2522 : .name = discard_const_p(char, "sec_qos"),
2523 : .get = py_lsa_ObjectAttribute_get_sec_qos,
2524 : .set = py_lsa_ObjectAttribute_set_sec_qos,
2525 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_QosInfo")
2526 : },
2527 : { .name = NULL }
2528 : };
2529 :
2530 234 : static PyObject *py_lsa_ObjectAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2531 : {
2532 234 : return pytalloc_new(struct lsa_ObjectAttribute, type);
2533 : }
2534 :
2535 :
2536 : static PyTypeObject lsa_ObjectAttribute_Type = {
2537 : PyVarObject_HEAD_INIT(NULL, 0)
2538 : .tp_name = "lsa.ObjectAttribute",
2539 : .tp_getset = py_lsa_ObjectAttribute_getsetters,
2540 : .tp_methods = NULL,
2541 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2542 : .tp_new = py_lsa_ObjectAttribute_new,
2543 : };
2544 :
2545 :
2546 0 : static PyObject *py_lsa_AuditLogInfo_get_percent_full(PyObject *obj, void *closure)
2547 : {
2548 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2549 0 : PyObject *py_percent_full;
2550 0 : py_percent_full = PyLong_FromUnsignedLongLong((uint32_t)object->percent_full);
2551 0 : return py_percent_full;
2552 : }
2553 :
2554 0 : static int py_lsa_AuditLogInfo_set_percent_full(PyObject *py_obj, PyObject *value, void *closure)
2555 : {
2556 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2557 0 : if (value == NULL) {
2558 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->percent_full");
2559 0 : return -1;
2560 : }
2561 : {
2562 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->percent_full));
2563 0 : if (PyLong_Check(value)) {
2564 0 : unsigned long long test_var;
2565 0 : test_var = PyLong_AsUnsignedLongLong(value);
2566 0 : if (PyErr_Occurred() != NULL) {
2567 0 : return -1;
2568 : }
2569 0 : if (test_var > uint_max) {
2570 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2571 : PyLong_Type.tp_name, uint_max, test_var);
2572 0 : return -1;
2573 : }
2574 0 : object->percent_full = test_var;
2575 : } else {
2576 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2577 : PyLong_Type.tp_name);
2578 0 : return -1;
2579 : }
2580 : }
2581 0 : return 0;
2582 : }
2583 :
2584 0 : static PyObject *py_lsa_AuditLogInfo_get_maximum_log_size(PyObject *obj, void *closure)
2585 : {
2586 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2587 0 : PyObject *py_maximum_log_size;
2588 0 : py_maximum_log_size = PyLong_FromUnsignedLongLong((uint32_t)object->maximum_log_size);
2589 0 : return py_maximum_log_size;
2590 : }
2591 :
2592 0 : static int py_lsa_AuditLogInfo_set_maximum_log_size(PyObject *py_obj, PyObject *value, void *closure)
2593 : {
2594 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2595 0 : if (value == NULL) {
2596 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->maximum_log_size");
2597 0 : return -1;
2598 : }
2599 : {
2600 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximum_log_size));
2601 0 : if (PyLong_Check(value)) {
2602 0 : unsigned long long test_var;
2603 0 : test_var = PyLong_AsUnsignedLongLong(value);
2604 0 : if (PyErr_Occurred() != NULL) {
2605 0 : return -1;
2606 : }
2607 0 : if (test_var > uint_max) {
2608 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2609 : PyLong_Type.tp_name, uint_max, test_var);
2610 0 : return -1;
2611 : }
2612 0 : object->maximum_log_size = test_var;
2613 : } else {
2614 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2615 : PyLong_Type.tp_name);
2616 0 : return -1;
2617 : }
2618 : }
2619 0 : return 0;
2620 : }
2621 :
2622 0 : static PyObject *py_lsa_AuditLogInfo_get_retention_time(PyObject *obj, void *closure)
2623 : {
2624 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2625 0 : PyObject *py_retention_time;
2626 0 : py_retention_time = PyLong_FromUnsignedLongLong(object->retention_time);
2627 0 : return py_retention_time;
2628 : }
2629 :
2630 0 : static int py_lsa_AuditLogInfo_set_retention_time(PyObject *py_obj, PyObject *value, void *closure)
2631 : {
2632 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2633 0 : if (value == NULL) {
2634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->retention_time");
2635 0 : return -1;
2636 : }
2637 : {
2638 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->retention_time));
2639 0 : if (PyLong_Check(value)) {
2640 0 : unsigned long long test_var;
2641 0 : test_var = PyLong_AsUnsignedLongLong(value);
2642 0 : if (PyErr_Occurred() != NULL) {
2643 0 : return -1;
2644 : }
2645 0 : if (test_var > uint_max) {
2646 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2647 : PyLong_Type.tp_name, uint_max, test_var);
2648 0 : return -1;
2649 : }
2650 0 : object->retention_time = test_var;
2651 : } else {
2652 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2653 : PyLong_Type.tp_name);
2654 0 : return -1;
2655 : }
2656 : }
2657 0 : return 0;
2658 : }
2659 :
2660 0 : static PyObject *py_lsa_AuditLogInfo_get_shutdown_in_progress(PyObject *obj, void *closure)
2661 : {
2662 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2663 0 : PyObject *py_shutdown_in_progress;
2664 0 : py_shutdown_in_progress = PyLong_FromLong((uint16_t)object->shutdown_in_progress);
2665 0 : return py_shutdown_in_progress;
2666 : }
2667 :
2668 0 : static int py_lsa_AuditLogInfo_set_shutdown_in_progress(PyObject *py_obj, PyObject *value, void *closure)
2669 : {
2670 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2671 0 : if (value == NULL) {
2672 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_in_progress");
2673 0 : return -1;
2674 : }
2675 : {
2676 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_in_progress));
2677 0 : if (PyLong_Check(value)) {
2678 0 : unsigned long long test_var;
2679 0 : test_var = PyLong_AsUnsignedLongLong(value);
2680 0 : if (PyErr_Occurred() != NULL) {
2681 0 : return -1;
2682 : }
2683 0 : if (test_var > uint_max) {
2684 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2685 : PyLong_Type.tp_name, uint_max, test_var);
2686 0 : return -1;
2687 : }
2688 0 : object->shutdown_in_progress = test_var;
2689 : } else {
2690 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2691 : PyLong_Type.tp_name);
2692 0 : return -1;
2693 : }
2694 : }
2695 0 : return 0;
2696 : }
2697 :
2698 0 : static PyObject *py_lsa_AuditLogInfo_get_time_to_shutdown(PyObject *obj, void *closure)
2699 : {
2700 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2701 0 : PyObject *py_time_to_shutdown;
2702 0 : py_time_to_shutdown = PyLong_FromUnsignedLongLong(object->time_to_shutdown);
2703 0 : return py_time_to_shutdown;
2704 : }
2705 :
2706 0 : static int py_lsa_AuditLogInfo_set_time_to_shutdown(PyObject *py_obj, PyObject *value, void *closure)
2707 : {
2708 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2709 0 : if (value == NULL) {
2710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time_to_shutdown");
2711 0 : return -1;
2712 : }
2713 : {
2714 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time_to_shutdown));
2715 0 : if (PyLong_Check(value)) {
2716 0 : unsigned long long test_var;
2717 0 : test_var = PyLong_AsUnsignedLongLong(value);
2718 0 : if (PyErr_Occurred() != NULL) {
2719 0 : return -1;
2720 : }
2721 0 : if (test_var > uint_max) {
2722 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2723 : PyLong_Type.tp_name, uint_max, test_var);
2724 0 : return -1;
2725 : }
2726 0 : object->time_to_shutdown = test_var;
2727 : } else {
2728 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2729 : PyLong_Type.tp_name);
2730 0 : return -1;
2731 : }
2732 : }
2733 0 : return 0;
2734 : }
2735 :
2736 0 : static PyObject *py_lsa_AuditLogInfo_get_next_audit_record(PyObject *obj, void *closure)
2737 : {
2738 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(obj);
2739 0 : PyObject *py_next_audit_record;
2740 0 : py_next_audit_record = PyLong_FromUnsignedLongLong((uint32_t)object->next_audit_record);
2741 0 : return py_next_audit_record;
2742 : }
2743 :
2744 0 : static int py_lsa_AuditLogInfo_set_next_audit_record(PyObject *py_obj, PyObject *value, void *closure)
2745 : {
2746 0 : struct lsa_AuditLogInfo *object = (struct lsa_AuditLogInfo *)pytalloc_get_ptr(py_obj);
2747 0 : if (value == NULL) {
2748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->next_audit_record");
2749 0 : return -1;
2750 : }
2751 : {
2752 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->next_audit_record));
2753 0 : if (PyLong_Check(value)) {
2754 0 : unsigned long long test_var;
2755 0 : test_var = PyLong_AsUnsignedLongLong(value);
2756 0 : if (PyErr_Occurred() != NULL) {
2757 0 : return -1;
2758 : }
2759 0 : if (test_var > uint_max) {
2760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2761 : PyLong_Type.tp_name, uint_max, test_var);
2762 0 : return -1;
2763 : }
2764 0 : object->next_audit_record = test_var;
2765 : } else {
2766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2767 : PyLong_Type.tp_name);
2768 0 : return -1;
2769 : }
2770 : }
2771 0 : return 0;
2772 : }
2773 :
2774 : static PyGetSetDef py_lsa_AuditLogInfo_getsetters[] = {
2775 : {
2776 : .name = discard_const_p(char, "percent_full"),
2777 : .get = py_lsa_AuditLogInfo_get_percent_full,
2778 : .set = py_lsa_AuditLogInfo_set_percent_full,
2779 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2780 : },
2781 : {
2782 : .name = discard_const_p(char, "maximum_log_size"),
2783 : .get = py_lsa_AuditLogInfo_get_maximum_log_size,
2784 : .set = py_lsa_AuditLogInfo_set_maximum_log_size,
2785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2786 : },
2787 : {
2788 : .name = discard_const_p(char, "retention_time"),
2789 : .get = py_lsa_AuditLogInfo_get_retention_time,
2790 : .set = py_lsa_AuditLogInfo_set_retention_time,
2791 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2792 : },
2793 : {
2794 : .name = discard_const_p(char, "shutdown_in_progress"),
2795 : .get = py_lsa_AuditLogInfo_get_shutdown_in_progress,
2796 : .set = py_lsa_AuditLogInfo_set_shutdown_in_progress,
2797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2798 : },
2799 : {
2800 : .name = discard_const_p(char, "time_to_shutdown"),
2801 : .get = py_lsa_AuditLogInfo_get_time_to_shutdown,
2802 : .set = py_lsa_AuditLogInfo_set_time_to_shutdown,
2803 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2804 : },
2805 : {
2806 : .name = discard_const_p(char, "next_audit_record"),
2807 : .get = py_lsa_AuditLogInfo_get_next_audit_record,
2808 : .set = py_lsa_AuditLogInfo_set_next_audit_record,
2809 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2810 : },
2811 : { .name = NULL }
2812 : };
2813 :
2814 0 : static PyObject *py_lsa_AuditLogInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2815 : {
2816 0 : return pytalloc_new(struct lsa_AuditLogInfo, type);
2817 : }
2818 :
2819 :
2820 : static PyTypeObject lsa_AuditLogInfo_Type = {
2821 : PyVarObject_HEAD_INIT(NULL, 0)
2822 : .tp_name = "lsa.AuditLogInfo",
2823 : .tp_getset = py_lsa_AuditLogInfo_getsetters,
2824 : .tp_methods = NULL,
2825 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2826 : .tp_new = py_lsa_AuditLogInfo_new,
2827 : };
2828 :
2829 :
2830 0 : static PyObject *py_lsa_AuditEventsInfo_get_auditing_mode(PyObject *obj, void *closure)
2831 : {
2832 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2833 0 : PyObject *py_auditing_mode;
2834 0 : py_auditing_mode = PyLong_FromUnsignedLongLong((uint32_t)object->auditing_mode);
2835 0 : return py_auditing_mode;
2836 : }
2837 :
2838 0 : static int py_lsa_AuditEventsInfo_set_auditing_mode(PyObject *py_obj, PyObject *value, void *closure)
2839 : {
2840 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2841 0 : if (value == NULL) {
2842 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auditing_mode");
2843 0 : return -1;
2844 : }
2845 : {
2846 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditing_mode));
2847 0 : if (PyLong_Check(value)) {
2848 0 : unsigned long long test_var;
2849 0 : test_var = PyLong_AsUnsignedLongLong(value);
2850 0 : if (PyErr_Occurred() != NULL) {
2851 0 : return -1;
2852 : }
2853 0 : if (test_var > uint_max) {
2854 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2855 : PyLong_Type.tp_name, uint_max, test_var);
2856 0 : return -1;
2857 : }
2858 0 : object->auditing_mode = test_var;
2859 : } else {
2860 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2861 : PyLong_Type.tp_name);
2862 0 : return -1;
2863 : }
2864 : }
2865 0 : return 0;
2866 : }
2867 :
2868 0 : static PyObject *py_lsa_AuditEventsInfo_get_settings(PyObject *obj, void *closure)
2869 : {
2870 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2871 0 : PyObject *py_settings;
2872 0 : if (object->settings == NULL) {
2873 0 : Py_RETURN_NONE;
2874 : }
2875 0 : if (object->settings == NULL) {
2876 0 : py_settings = Py_None;
2877 0 : Py_INCREF(py_settings);
2878 : } else {
2879 0 : py_settings = PyList_New(object->count);
2880 0 : if (py_settings == NULL) {
2881 0 : return NULL;
2882 : }
2883 : {
2884 : int settings_cntr_1;
2885 0 : for (settings_cntr_1 = 0; settings_cntr_1 < (object->count); settings_cntr_1++) {
2886 0 : PyObject *py_settings_1;
2887 0 : py_settings_1 = PyLong_FromUnsignedLongLong((uint32_t)object->settings[settings_cntr_1]);
2888 0 : PyList_SetItem(py_settings, settings_cntr_1, py_settings_1);
2889 : }
2890 : }
2891 : }
2892 0 : return py_settings;
2893 : }
2894 :
2895 0 : static int py_lsa_AuditEventsInfo_set_settings(PyObject *py_obj, PyObject *value, void *closure)
2896 : {
2897 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2898 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->settings));
2899 0 : if (value == NULL) {
2900 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->settings");
2901 0 : return -1;
2902 : }
2903 0 : if (value == Py_None) {
2904 0 : object->settings = NULL;
2905 : } else {
2906 0 : object->settings = NULL;
2907 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2908 : {
2909 0 : int settings_cntr_1;
2910 0 : object->settings = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->settings, PyList_GET_SIZE(value));
2911 0 : if (!object->settings) { return -1; }
2912 0 : talloc_set_name_const(object->settings, "ARRAY: object->settings");
2913 0 : for (settings_cntr_1 = 0; settings_cntr_1 < PyList_GET_SIZE(value); settings_cntr_1++) {
2914 0 : if (PyList_GET_ITEM(value, settings_cntr_1) == NULL) {
2915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->settings[settings_cntr_1]");
2916 0 : return -1;
2917 : }
2918 : {
2919 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->settings[settings_cntr_1]));
2920 0 : if (PyLong_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
2921 0 : unsigned long long test_var;
2922 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, settings_cntr_1));
2923 0 : if (PyErr_Occurred() != NULL) {
2924 0 : return -1;
2925 : }
2926 0 : if (test_var > uint_max) {
2927 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2928 : PyLong_Type.tp_name, uint_max, test_var);
2929 0 : return -1;
2930 : }
2931 0 : object->settings[settings_cntr_1] = test_var;
2932 : } else {
2933 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2934 : PyLong_Type.tp_name);
2935 0 : return -1;
2936 : }
2937 : }
2938 : }
2939 : }
2940 : }
2941 0 : return 0;
2942 : }
2943 :
2944 0 : static PyObject *py_lsa_AuditEventsInfo_get_count(PyObject *obj, void *closure)
2945 : {
2946 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(obj);
2947 0 : PyObject *py_count;
2948 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
2949 0 : return py_count;
2950 : }
2951 :
2952 0 : static int py_lsa_AuditEventsInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
2953 : {
2954 0 : struct lsa_AuditEventsInfo *object = (struct lsa_AuditEventsInfo *)pytalloc_get_ptr(py_obj);
2955 0 : if (value == NULL) {
2956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
2957 0 : return -1;
2958 : }
2959 : {
2960 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2961 0 : if (PyLong_Check(value)) {
2962 0 : unsigned long long test_var;
2963 0 : test_var = PyLong_AsUnsignedLongLong(value);
2964 0 : if (PyErr_Occurred() != NULL) {
2965 0 : return -1;
2966 : }
2967 0 : if (test_var > uint_max) {
2968 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2969 : PyLong_Type.tp_name, uint_max, test_var);
2970 0 : return -1;
2971 : }
2972 0 : object->count = test_var;
2973 : } else {
2974 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2975 : PyLong_Type.tp_name);
2976 0 : return -1;
2977 : }
2978 : }
2979 0 : return 0;
2980 : }
2981 :
2982 : static PyGetSetDef py_lsa_AuditEventsInfo_getsetters[] = {
2983 : {
2984 : .name = discard_const_p(char, "auditing_mode"),
2985 : .get = py_lsa_AuditEventsInfo_get_auditing_mode,
2986 : .set = py_lsa_AuditEventsInfo_set_auditing_mode,
2987 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2988 : },
2989 : {
2990 : .name = discard_const_p(char, "settings"),
2991 : .get = py_lsa_AuditEventsInfo_get_settings,
2992 : .set = py_lsa_AuditEventsInfo_set_settings,
2993 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAuditPolicy")
2994 : },
2995 : {
2996 : .name = discard_const_p(char, "count"),
2997 : .get = py_lsa_AuditEventsInfo_get_count,
2998 : .set = py_lsa_AuditEventsInfo_set_count,
2999 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3000 : },
3001 : { .name = NULL }
3002 : };
3003 :
3004 0 : static PyObject *py_lsa_AuditEventsInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3005 : {
3006 0 : return pytalloc_new(struct lsa_AuditEventsInfo, type);
3007 : }
3008 :
3009 :
3010 : static PyTypeObject lsa_AuditEventsInfo_Type = {
3011 : PyVarObject_HEAD_INIT(NULL, 0)
3012 : .tp_name = "lsa.AuditEventsInfo",
3013 : .tp_getset = py_lsa_AuditEventsInfo_getsetters,
3014 : .tp_methods = NULL,
3015 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3016 : .tp_new = py_lsa_AuditEventsInfo_new,
3017 : };
3018 :
3019 :
3020 0 : static PyObject *py_lsa_DomainInfo_get_name(PyObject *obj, void *closure)
3021 : {
3022 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
3023 0 : PyObject *py_name;
3024 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3025 0 : return py_name;
3026 : }
3027 :
3028 0 : static int py_lsa_DomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3029 : {
3030 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
3031 0 : if (value == NULL) {
3032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3033 0 : return -1;
3034 : }
3035 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3036 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3037 0 : PyErr_NoMemory();
3038 0 : return -1;
3039 : }
3040 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3041 0 : return 0;
3042 : }
3043 :
3044 0 : static PyObject *py_lsa_DomainInfo_get_sid(PyObject *obj, void *closure)
3045 : {
3046 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(obj);
3047 0 : PyObject *py_sid;
3048 0 : if (object->sid == NULL) {
3049 0 : Py_RETURN_NONE;
3050 : }
3051 0 : if (object->sid == NULL) {
3052 0 : py_sid = Py_None;
3053 0 : Py_INCREF(py_sid);
3054 : } else {
3055 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3056 : }
3057 0 : return py_sid;
3058 : }
3059 :
3060 0 : static int py_lsa_DomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3061 : {
3062 0 : struct lsa_DomainInfo *object = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_obj);
3063 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3064 0 : if (value == NULL) {
3065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
3066 0 : return -1;
3067 : }
3068 0 : if (value == Py_None) {
3069 0 : object->sid = NULL;
3070 : } else {
3071 0 : object->sid = NULL;
3072 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3073 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3074 0 : PyErr_NoMemory();
3075 0 : return -1;
3076 : }
3077 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3078 : }
3079 0 : return 0;
3080 : }
3081 :
3082 : static PyGetSetDef py_lsa_DomainInfo_getsetters[] = {
3083 : {
3084 : .name = discard_const_p(char, "name"),
3085 : .get = py_lsa_DomainInfo_get_name,
3086 : .set = py_lsa_DomainInfo_set_name,
3087 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
3088 : },
3089 : {
3090 : .name = discard_const_p(char, "sid"),
3091 : .get = py_lsa_DomainInfo_get_sid,
3092 : .set = py_lsa_DomainInfo_set_sid,
3093 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
3094 : },
3095 : { .name = NULL }
3096 : };
3097 :
3098 0 : static PyObject *py_lsa_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3099 : {
3100 0 : return pytalloc_new(struct lsa_DomainInfo, type);
3101 : }
3102 :
3103 :
3104 : static PyTypeObject lsa_DomainInfo_Type = {
3105 : PyVarObject_HEAD_INIT(NULL, 0)
3106 : .tp_name = "lsa.DomainInfo",
3107 : .tp_getset = py_lsa_DomainInfo_getsetters,
3108 : .tp_methods = NULL,
3109 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3110 : .tp_new = py_lsa_DomainInfo_new,
3111 : };
3112 :
3113 :
3114 0 : static PyObject *py_lsa_PDAccountInfo_get_name(PyObject *obj, void *closure)
3115 : {
3116 0 : struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(obj);
3117 0 : PyObject *py_name;
3118 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
3119 0 : return py_name;
3120 : }
3121 :
3122 0 : static int py_lsa_PDAccountInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3123 : {
3124 0 : struct lsa_PDAccountInfo *object = (struct lsa_PDAccountInfo *)pytalloc_get_ptr(py_obj);
3125 0 : if (value == NULL) {
3126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3127 0 : return -1;
3128 : }
3129 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3130 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3131 0 : PyErr_NoMemory();
3132 0 : return -1;
3133 : }
3134 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
3135 0 : return 0;
3136 : }
3137 :
3138 : static PyGetSetDef py_lsa_PDAccountInfo_getsetters[] = {
3139 : {
3140 : .name = discard_const_p(char, "name"),
3141 : .get = py_lsa_PDAccountInfo_get_name,
3142 : .set = py_lsa_PDAccountInfo_set_name,
3143 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3144 : },
3145 : { .name = NULL }
3146 : };
3147 :
3148 0 : static PyObject *py_lsa_PDAccountInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3149 : {
3150 0 : return pytalloc_new(struct lsa_PDAccountInfo, type);
3151 : }
3152 :
3153 :
3154 : static PyTypeObject lsa_PDAccountInfo_Type = {
3155 : PyVarObject_HEAD_INIT(NULL, 0)
3156 : .tp_name = "lsa.PDAccountInfo",
3157 : .tp_getset = py_lsa_PDAccountInfo_getsetters,
3158 : .tp_methods = NULL,
3159 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3160 : .tp_new = py_lsa_PDAccountInfo_new,
3161 : };
3162 :
3163 :
3164 0 : static PyObject *py_lsa_ServerRole_get_role(PyObject *obj, void *closure)
3165 : {
3166 0 : struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(obj);
3167 0 : PyObject *py_role;
3168 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role);
3169 0 : return py_role;
3170 : }
3171 :
3172 0 : static int py_lsa_ServerRole_set_role(PyObject *py_obj, PyObject *value, void *closure)
3173 : {
3174 0 : struct lsa_ServerRole *object = (struct lsa_ServerRole *)pytalloc_get_ptr(py_obj);
3175 0 : if (value == NULL) {
3176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role");
3177 0 : return -1;
3178 : }
3179 : {
3180 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
3181 0 : if (PyLong_Check(value)) {
3182 0 : unsigned long long test_var;
3183 0 : test_var = PyLong_AsUnsignedLongLong(value);
3184 0 : if (PyErr_Occurred() != NULL) {
3185 0 : return -1;
3186 : }
3187 0 : if (test_var > uint_max) {
3188 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3189 : PyLong_Type.tp_name, uint_max, test_var);
3190 0 : return -1;
3191 : }
3192 0 : object->role = test_var;
3193 : } else {
3194 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3195 : PyLong_Type.tp_name);
3196 0 : return -1;
3197 : }
3198 : }
3199 0 : return 0;
3200 : }
3201 :
3202 : static PyGetSetDef py_lsa_ServerRole_getsetters[] = {
3203 : {
3204 : .name = discard_const_p(char, "role"),
3205 : .get = py_lsa_ServerRole_get_role,
3206 : .set = py_lsa_ServerRole_set_role,
3207 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_Role")
3208 : },
3209 : { .name = NULL }
3210 : };
3211 :
3212 0 : static PyObject *py_lsa_ServerRole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3213 : {
3214 0 : return pytalloc_new(struct lsa_ServerRole, type);
3215 : }
3216 :
3217 :
3218 : static PyTypeObject lsa_ServerRole_Type = {
3219 : PyVarObject_HEAD_INIT(NULL, 0)
3220 : .tp_name = "lsa.ServerRole",
3221 : .tp_getset = py_lsa_ServerRole_getsetters,
3222 : .tp_methods = NULL,
3223 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3224 : .tp_new = py_lsa_ServerRole_new,
3225 : };
3226 :
3227 :
3228 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_source(PyObject *obj, void *closure)
3229 : {
3230 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
3231 0 : PyObject *py_source;
3232 0 : py_source = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->source);
3233 0 : return py_source;
3234 : }
3235 :
3236 0 : static int py_lsa_ReplicaSourceInfo_set_source(PyObject *py_obj, PyObject *value, void *closure)
3237 : {
3238 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
3239 0 : if (value == NULL) {
3240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->source");
3241 0 : return -1;
3242 : }
3243 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3244 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3245 0 : PyErr_NoMemory();
3246 0 : return -1;
3247 : }
3248 0 : object->source = *(struct lsa_String *)pytalloc_get_ptr(value);
3249 0 : return 0;
3250 : }
3251 :
3252 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_account(PyObject *obj, void *closure)
3253 : {
3254 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(obj);
3255 0 : PyObject *py_account;
3256 0 : py_account = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account);
3257 0 : return py_account;
3258 : }
3259 :
3260 0 : static int py_lsa_ReplicaSourceInfo_set_account(PyObject *py_obj, PyObject *value, void *closure)
3261 : {
3262 0 : struct lsa_ReplicaSourceInfo *object = (struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(py_obj);
3263 0 : if (value == NULL) {
3264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account");
3265 0 : return -1;
3266 : }
3267 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3268 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3269 0 : PyErr_NoMemory();
3270 0 : return -1;
3271 : }
3272 0 : object->account = *(struct lsa_String *)pytalloc_get_ptr(value);
3273 0 : return 0;
3274 : }
3275 :
3276 : static PyGetSetDef py_lsa_ReplicaSourceInfo_getsetters[] = {
3277 : {
3278 : .name = discard_const_p(char, "source"),
3279 : .get = py_lsa_ReplicaSourceInfo_get_source,
3280 : .set = py_lsa_ReplicaSourceInfo_set_source,
3281 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3282 : },
3283 : {
3284 : .name = discard_const_p(char, "account"),
3285 : .get = py_lsa_ReplicaSourceInfo_get_account,
3286 : .set = py_lsa_ReplicaSourceInfo_set_account,
3287 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3288 : },
3289 : { .name = NULL }
3290 : };
3291 :
3292 0 : static PyObject *py_lsa_ReplicaSourceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3293 : {
3294 0 : return pytalloc_new(struct lsa_ReplicaSourceInfo, type);
3295 : }
3296 :
3297 :
3298 : static PyTypeObject lsa_ReplicaSourceInfo_Type = {
3299 : PyVarObject_HEAD_INIT(NULL, 0)
3300 : .tp_name = "lsa.ReplicaSourceInfo",
3301 : .tp_getset = py_lsa_ReplicaSourceInfo_getsetters,
3302 : .tp_methods = NULL,
3303 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3304 : .tp_new = py_lsa_ReplicaSourceInfo_new,
3305 : };
3306 :
3307 :
3308 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_paged_pool(PyObject *obj, void *closure)
3309 : {
3310 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3311 0 : PyObject *py_paged_pool;
3312 0 : py_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)object->paged_pool);
3313 0 : return py_paged_pool;
3314 : }
3315 :
3316 0 : static int py_lsa_DefaultQuotaInfo_set_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3317 : {
3318 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3319 0 : if (value == NULL) {
3320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->paged_pool");
3321 0 : return -1;
3322 : }
3323 : {
3324 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paged_pool));
3325 0 : if (PyLong_Check(value)) {
3326 0 : unsigned long long test_var;
3327 0 : test_var = PyLong_AsUnsignedLongLong(value);
3328 0 : if (PyErr_Occurred() != NULL) {
3329 0 : return -1;
3330 : }
3331 0 : if (test_var > uint_max) {
3332 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3333 : PyLong_Type.tp_name, uint_max, test_var);
3334 0 : return -1;
3335 : }
3336 0 : object->paged_pool = test_var;
3337 : } else {
3338 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3339 : PyLong_Type.tp_name);
3340 0 : return -1;
3341 : }
3342 : }
3343 0 : return 0;
3344 : }
3345 :
3346 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_non_paged_pool(PyObject *obj, void *closure)
3347 : {
3348 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3349 0 : PyObject *py_non_paged_pool;
3350 0 : py_non_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)object->non_paged_pool);
3351 0 : return py_non_paged_pool;
3352 : }
3353 :
3354 0 : static int py_lsa_DefaultQuotaInfo_set_non_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3355 : {
3356 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3357 0 : if (value == NULL) {
3358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->non_paged_pool");
3359 0 : return -1;
3360 : }
3361 : {
3362 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->non_paged_pool));
3363 0 : if (PyLong_Check(value)) {
3364 0 : unsigned long long test_var;
3365 0 : test_var = PyLong_AsUnsignedLongLong(value);
3366 0 : if (PyErr_Occurred() != NULL) {
3367 0 : return -1;
3368 : }
3369 0 : if (test_var > uint_max) {
3370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3371 : PyLong_Type.tp_name, uint_max, test_var);
3372 0 : return -1;
3373 : }
3374 0 : object->non_paged_pool = test_var;
3375 : } else {
3376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3377 : PyLong_Type.tp_name);
3378 0 : return -1;
3379 : }
3380 : }
3381 0 : return 0;
3382 : }
3383 :
3384 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_min_wss(PyObject *obj, void *closure)
3385 : {
3386 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3387 0 : PyObject *py_min_wss;
3388 0 : py_min_wss = PyLong_FromUnsignedLongLong((uint32_t)object->min_wss);
3389 0 : return py_min_wss;
3390 : }
3391 :
3392 0 : static int py_lsa_DefaultQuotaInfo_set_min_wss(PyObject *py_obj, PyObject *value, void *closure)
3393 : {
3394 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3395 0 : if (value == NULL) {
3396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_wss");
3397 0 : return -1;
3398 : }
3399 : {
3400 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_wss));
3401 0 : if (PyLong_Check(value)) {
3402 0 : unsigned long long test_var;
3403 0 : test_var = PyLong_AsUnsignedLongLong(value);
3404 0 : if (PyErr_Occurred() != NULL) {
3405 0 : return -1;
3406 : }
3407 0 : if (test_var > uint_max) {
3408 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3409 : PyLong_Type.tp_name, uint_max, test_var);
3410 0 : return -1;
3411 : }
3412 0 : object->min_wss = test_var;
3413 : } else {
3414 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3415 : PyLong_Type.tp_name);
3416 0 : return -1;
3417 : }
3418 : }
3419 0 : return 0;
3420 : }
3421 :
3422 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_max_wss(PyObject *obj, void *closure)
3423 : {
3424 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3425 0 : PyObject *py_max_wss;
3426 0 : py_max_wss = PyLong_FromUnsignedLongLong((uint32_t)object->max_wss);
3427 0 : return py_max_wss;
3428 : }
3429 :
3430 0 : static int py_lsa_DefaultQuotaInfo_set_max_wss(PyObject *py_obj, PyObject *value, void *closure)
3431 : {
3432 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3433 0 : if (value == NULL) {
3434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_wss");
3435 0 : return -1;
3436 : }
3437 : {
3438 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_wss));
3439 0 : if (PyLong_Check(value)) {
3440 0 : unsigned long long test_var;
3441 0 : test_var = PyLong_AsUnsignedLongLong(value);
3442 0 : if (PyErr_Occurred() != NULL) {
3443 0 : return -1;
3444 : }
3445 0 : if (test_var > uint_max) {
3446 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3447 : PyLong_Type.tp_name, uint_max, test_var);
3448 0 : return -1;
3449 : }
3450 0 : object->max_wss = test_var;
3451 : } else {
3452 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3453 : PyLong_Type.tp_name);
3454 0 : return -1;
3455 : }
3456 : }
3457 0 : return 0;
3458 : }
3459 :
3460 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_pagefile(PyObject *obj, void *closure)
3461 : {
3462 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3463 0 : PyObject *py_pagefile;
3464 0 : py_pagefile = PyLong_FromUnsignedLongLong((uint32_t)object->pagefile);
3465 0 : return py_pagefile;
3466 : }
3467 :
3468 0 : static int py_lsa_DefaultQuotaInfo_set_pagefile(PyObject *py_obj, PyObject *value, void *closure)
3469 : {
3470 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3471 0 : if (value == NULL) {
3472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pagefile");
3473 0 : return -1;
3474 : }
3475 : {
3476 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefile));
3477 0 : if (PyLong_Check(value)) {
3478 0 : unsigned long long test_var;
3479 0 : test_var = PyLong_AsUnsignedLongLong(value);
3480 0 : if (PyErr_Occurred() != NULL) {
3481 0 : return -1;
3482 : }
3483 0 : if (test_var > uint_max) {
3484 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3485 : PyLong_Type.tp_name, uint_max, test_var);
3486 0 : return -1;
3487 : }
3488 0 : object->pagefile = test_var;
3489 : } else {
3490 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3491 : PyLong_Type.tp_name);
3492 0 : return -1;
3493 : }
3494 : }
3495 0 : return 0;
3496 : }
3497 :
3498 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_unknown(PyObject *obj, void *closure)
3499 : {
3500 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(obj);
3501 0 : PyObject *py_unknown;
3502 0 : py_unknown = PyLong_FromUnsignedLongLong(object->unknown);
3503 0 : return py_unknown;
3504 : }
3505 :
3506 0 : static int py_lsa_DefaultQuotaInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
3507 : {
3508 0 : struct lsa_DefaultQuotaInfo *object = (struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(py_obj);
3509 0 : if (value == NULL) {
3510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
3511 0 : return -1;
3512 : }
3513 : {
3514 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
3515 0 : if (PyLong_Check(value)) {
3516 0 : unsigned long long test_var;
3517 0 : test_var = PyLong_AsUnsignedLongLong(value);
3518 0 : if (PyErr_Occurred() != NULL) {
3519 0 : return -1;
3520 : }
3521 0 : if (test_var > uint_max) {
3522 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3523 : PyLong_Type.tp_name, uint_max, test_var);
3524 0 : return -1;
3525 : }
3526 0 : object->unknown = test_var;
3527 : } else {
3528 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3529 : PyLong_Type.tp_name);
3530 0 : return -1;
3531 : }
3532 : }
3533 0 : return 0;
3534 : }
3535 :
3536 : static PyGetSetDef py_lsa_DefaultQuotaInfo_getsetters[] = {
3537 : {
3538 : .name = discard_const_p(char, "paged_pool"),
3539 : .get = py_lsa_DefaultQuotaInfo_get_paged_pool,
3540 : .set = py_lsa_DefaultQuotaInfo_set_paged_pool,
3541 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3542 : },
3543 : {
3544 : .name = discard_const_p(char, "non_paged_pool"),
3545 : .get = py_lsa_DefaultQuotaInfo_get_non_paged_pool,
3546 : .set = py_lsa_DefaultQuotaInfo_set_non_paged_pool,
3547 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3548 : },
3549 : {
3550 : .name = discard_const_p(char, "min_wss"),
3551 : .get = py_lsa_DefaultQuotaInfo_get_min_wss,
3552 : .set = py_lsa_DefaultQuotaInfo_set_min_wss,
3553 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3554 : },
3555 : {
3556 : .name = discard_const_p(char, "max_wss"),
3557 : .get = py_lsa_DefaultQuotaInfo_get_max_wss,
3558 : .set = py_lsa_DefaultQuotaInfo_set_max_wss,
3559 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3560 : },
3561 : {
3562 : .name = discard_const_p(char, "pagefile"),
3563 : .get = py_lsa_DefaultQuotaInfo_get_pagefile,
3564 : .set = py_lsa_DefaultQuotaInfo_set_pagefile,
3565 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3566 : },
3567 : {
3568 : .name = discard_const_p(char, "unknown"),
3569 : .get = py_lsa_DefaultQuotaInfo_get_unknown,
3570 : .set = py_lsa_DefaultQuotaInfo_set_unknown,
3571 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3572 : },
3573 : { .name = NULL }
3574 : };
3575 :
3576 0 : static PyObject *py_lsa_DefaultQuotaInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3577 : {
3578 0 : return pytalloc_new(struct lsa_DefaultQuotaInfo, type);
3579 : }
3580 :
3581 :
3582 : static PyTypeObject lsa_DefaultQuotaInfo_Type = {
3583 : PyVarObject_HEAD_INIT(NULL, 0)
3584 : .tp_name = "lsa.DefaultQuotaInfo",
3585 : .tp_getset = py_lsa_DefaultQuotaInfo_getsetters,
3586 : .tp_methods = NULL,
3587 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3588 : .tp_new = py_lsa_DefaultQuotaInfo_new,
3589 : };
3590 :
3591 :
3592 0 : static PyObject *py_lsa_ModificationInfo_get_modified_id(PyObject *obj, void *closure)
3593 : {
3594 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3595 0 : PyObject *py_modified_id;
3596 0 : py_modified_id = PyLong_FromUnsignedLongLong(object->modified_id);
3597 0 : return py_modified_id;
3598 : }
3599 :
3600 0 : static int py_lsa_ModificationInfo_set_modified_id(PyObject *py_obj, PyObject *value, void *closure)
3601 : {
3602 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3603 0 : if (value == NULL) {
3604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->modified_id");
3605 0 : return -1;
3606 : }
3607 : {
3608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_id));
3609 0 : if (PyLong_Check(value)) {
3610 0 : unsigned long long test_var;
3611 0 : test_var = PyLong_AsUnsignedLongLong(value);
3612 0 : if (PyErr_Occurred() != NULL) {
3613 0 : return -1;
3614 : }
3615 0 : if (test_var > uint_max) {
3616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3617 : PyLong_Type.tp_name, uint_max, test_var);
3618 0 : return -1;
3619 : }
3620 0 : object->modified_id = test_var;
3621 : } else {
3622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3623 : PyLong_Type.tp_name);
3624 0 : return -1;
3625 : }
3626 : }
3627 0 : return 0;
3628 : }
3629 :
3630 0 : static PyObject *py_lsa_ModificationInfo_get_db_create_time(PyObject *obj, void *closure)
3631 : {
3632 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(obj);
3633 0 : PyObject *py_db_create_time;
3634 0 : py_db_create_time = PyLong_FromUnsignedLongLong(object->db_create_time);
3635 0 : return py_db_create_time;
3636 : }
3637 :
3638 0 : static int py_lsa_ModificationInfo_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
3639 : {
3640 0 : struct lsa_ModificationInfo *object = (struct lsa_ModificationInfo *)pytalloc_get_ptr(py_obj);
3641 0 : if (value == NULL) {
3642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->db_create_time");
3643 0 : return -1;
3644 : }
3645 : {
3646 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time));
3647 0 : if (PyLong_Check(value)) {
3648 0 : unsigned long long test_var;
3649 0 : test_var = PyLong_AsUnsignedLongLong(value);
3650 0 : if (PyErr_Occurred() != NULL) {
3651 0 : return -1;
3652 : }
3653 0 : if (test_var > uint_max) {
3654 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3655 : PyLong_Type.tp_name, uint_max, test_var);
3656 0 : return -1;
3657 : }
3658 0 : object->db_create_time = test_var;
3659 : } else {
3660 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3661 : PyLong_Type.tp_name);
3662 0 : return -1;
3663 : }
3664 : }
3665 0 : return 0;
3666 : }
3667 :
3668 : static PyGetSetDef py_lsa_ModificationInfo_getsetters[] = {
3669 : {
3670 : .name = discard_const_p(char, "modified_id"),
3671 : .get = py_lsa_ModificationInfo_get_modified_id,
3672 : .set = py_lsa_ModificationInfo_set_modified_id,
3673 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3674 : },
3675 : {
3676 : .name = discard_const_p(char, "db_create_time"),
3677 : .get = py_lsa_ModificationInfo_get_db_create_time,
3678 : .set = py_lsa_ModificationInfo_set_db_create_time,
3679 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
3680 : },
3681 : { .name = NULL }
3682 : };
3683 :
3684 0 : static PyObject *py_lsa_ModificationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3685 : {
3686 0 : return pytalloc_new(struct lsa_ModificationInfo, type);
3687 : }
3688 :
3689 :
3690 : static PyTypeObject lsa_ModificationInfo_Type = {
3691 : PyVarObject_HEAD_INIT(NULL, 0)
3692 : .tp_name = "lsa.ModificationInfo",
3693 : .tp_getset = py_lsa_ModificationInfo_getsetters,
3694 : .tp_methods = NULL,
3695 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3696 : .tp_new = py_lsa_ModificationInfo_new,
3697 : };
3698 :
3699 :
3700 0 : static PyObject *py_lsa_AuditFullSetInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3701 : {
3702 0 : struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(obj);
3703 0 : PyObject *py_shutdown_on_full;
3704 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)object->shutdown_on_full);
3705 0 : return py_shutdown_on_full;
3706 : }
3707 :
3708 0 : static int py_lsa_AuditFullSetInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3709 : {
3710 0 : struct lsa_AuditFullSetInfo *object = (struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(py_obj);
3711 0 : if (value == NULL) {
3712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_on_full");
3713 0 : return -1;
3714 : }
3715 : {
3716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3717 0 : if (PyLong_Check(value)) {
3718 0 : unsigned long long test_var;
3719 0 : test_var = PyLong_AsUnsignedLongLong(value);
3720 0 : if (PyErr_Occurred() != NULL) {
3721 0 : return -1;
3722 : }
3723 0 : if (test_var > uint_max) {
3724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3725 : PyLong_Type.tp_name, uint_max, test_var);
3726 0 : return -1;
3727 : }
3728 0 : object->shutdown_on_full = test_var;
3729 : } else {
3730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3731 : PyLong_Type.tp_name);
3732 0 : return -1;
3733 : }
3734 : }
3735 0 : return 0;
3736 : }
3737 :
3738 : static PyGetSetDef py_lsa_AuditFullSetInfo_getsetters[] = {
3739 : {
3740 : .name = discard_const_p(char, "shutdown_on_full"),
3741 : .get = py_lsa_AuditFullSetInfo_get_shutdown_on_full,
3742 : .set = py_lsa_AuditFullSetInfo_set_shutdown_on_full,
3743 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3744 : },
3745 : { .name = NULL }
3746 : };
3747 :
3748 0 : static PyObject *py_lsa_AuditFullSetInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3749 : {
3750 0 : return pytalloc_new(struct lsa_AuditFullSetInfo, type);
3751 : }
3752 :
3753 :
3754 : static PyTypeObject lsa_AuditFullSetInfo_Type = {
3755 : PyVarObject_HEAD_INIT(NULL, 0)
3756 : .tp_name = "lsa.AuditFullSetInfo",
3757 : .tp_getset = py_lsa_AuditFullSetInfo_getsetters,
3758 : .tp_methods = NULL,
3759 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3760 : .tp_new = py_lsa_AuditFullSetInfo_new,
3761 : };
3762 :
3763 :
3764 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3765 : {
3766 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3767 0 : PyObject *py_shutdown_on_full;
3768 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)object->shutdown_on_full);
3769 0 : return py_shutdown_on_full;
3770 : }
3771 :
3772 0 : static int py_lsa_AuditFullQueryInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3773 : {
3774 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3775 0 : if (value == NULL) {
3776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->shutdown_on_full");
3777 0 : return -1;
3778 : }
3779 : {
3780 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3781 0 : if (PyLong_Check(value)) {
3782 0 : unsigned long long test_var;
3783 0 : test_var = PyLong_AsUnsignedLongLong(value);
3784 0 : if (PyErr_Occurred() != NULL) {
3785 0 : return -1;
3786 : }
3787 0 : if (test_var > uint_max) {
3788 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3789 : PyLong_Type.tp_name, uint_max, test_var);
3790 0 : return -1;
3791 : }
3792 0 : object->shutdown_on_full = test_var;
3793 : } else {
3794 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3795 : PyLong_Type.tp_name);
3796 0 : return -1;
3797 : }
3798 : }
3799 0 : return 0;
3800 : }
3801 :
3802 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_log_is_full(PyObject *obj, void *closure)
3803 : {
3804 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(obj);
3805 0 : PyObject *py_log_is_full;
3806 0 : py_log_is_full = PyLong_FromLong((uint16_t)object->log_is_full);
3807 0 : return py_log_is_full;
3808 : }
3809 :
3810 0 : static int py_lsa_AuditFullQueryInfo_set_log_is_full(PyObject *py_obj, PyObject *value, void *closure)
3811 : {
3812 0 : struct lsa_AuditFullQueryInfo *object = (struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(py_obj);
3813 0 : if (value == NULL) {
3814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->log_is_full");
3815 0 : return -1;
3816 : }
3817 : {
3818 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->log_is_full));
3819 0 : if (PyLong_Check(value)) {
3820 0 : unsigned long long test_var;
3821 0 : test_var = PyLong_AsUnsignedLongLong(value);
3822 0 : if (PyErr_Occurred() != NULL) {
3823 0 : return -1;
3824 : }
3825 0 : if (test_var > uint_max) {
3826 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3827 : PyLong_Type.tp_name, uint_max, test_var);
3828 0 : return -1;
3829 : }
3830 0 : object->log_is_full = test_var;
3831 : } else {
3832 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3833 : PyLong_Type.tp_name);
3834 0 : return -1;
3835 : }
3836 : }
3837 0 : return 0;
3838 : }
3839 :
3840 : static PyGetSetDef py_lsa_AuditFullQueryInfo_getsetters[] = {
3841 : {
3842 : .name = discard_const_p(char, "shutdown_on_full"),
3843 : .get = py_lsa_AuditFullQueryInfo_get_shutdown_on_full,
3844 : .set = py_lsa_AuditFullQueryInfo_set_shutdown_on_full,
3845 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3846 : },
3847 : {
3848 : .name = discard_const_p(char, "log_is_full"),
3849 : .get = py_lsa_AuditFullQueryInfo_get_log_is_full,
3850 : .set = py_lsa_AuditFullQueryInfo_set_log_is_full,
3851 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3852 : },
3853 : { .name = NULL }
3854 : };
3855 :
3856 0 : static PyObject *py_lsa_AuditFullQueryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3857 : {
3858 0 : return pytalloc_new(struct lsa_AuditFullQueryInfo, type);
3859 : }
3860 :
3861 :
3862 : static PyTypeObject lsa_AuditFullQueryInfo_Type = {
3863 : PyVarObject_HEAD_INIT(NULL, 0)
3864 : .tp_name = "lsa.AuditFullQueryInfo",
3865 : .tp_getset = py_lsa_AuditFullQueryInfo_getsetters,
3866 : .tp_methods = NULL,
3867 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3868 : .tp_new = py_lsa_AuditFullQueryInfo_new,
3869 : };
3870 :
3871 :
3872 245 : static PyObject *py_lsa_DnsDomainInfo_get_name(PyObject *obj, void *closure)
3873 : {
3874 245 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3875 2 : PyObject *py_name;
3876 245 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3877 245 : return py_name;
3878 : }
3879 :
3880 0 : static int py_lsa_DnsDomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3881 : {
3882 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3883 0 : if (value == NULL) {
3884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3885 0 : return -1;
3886 : }
3887 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3888 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3889 0 : PyErr_NoMemory();
3890 0 : return -1;
3891 : }
3892 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3893 0 : return 0;
3894 : }
3895 :
3896 440 : static PyObject *py_lsa_DnsDomainInfo_get_dns_domain(PyObject *obj, void *closure)
3897 : {
3898 440 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3899 6 : PyObject *py_dns_domain;
3900 440 : py_dns_domain = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain);
3901 440 : return py_dns_domain;
3902 : }
3903 :
3904 0 : static int py_lsa_DnsDomainInfo_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
3905 : {
3906 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3907 0 : if (value == NULL) {
3908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain");
3909 0 : return -1;
3910 : }
3911 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3912 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3913 0 : PyErr_NoMemory();
3914 0 : return -1;
3915 : }
3916 0 : object->dns_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3917 0 : return 0;
3918 : }
3919 :
3920 0 : static PyObject *py_lsa_DnsDomainInfo_get_dns_forest(PyObject *obj, void *closure)
3921 : {
3922 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3923 0 : PyObject *py_dns_forest;
3924 0 : py_dns_forest = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forest);
3925 0 : return py_dns_forest;
3926 : }
3927 :
3928 0 : static int py_lsa_DnsDomainInfo_set_dns_forest(PyObject *py_obj, PyObject *value, void *closure)
3929 : {
3930 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3931 0 : if (value == NULL) {
3932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_forest");
3933 0 : return -1;
3934 : }
3935 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3936 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3937 0 : PyErr_NoMemory();
3938 0 : return -1;
3939 : }
3940 0 : object->dns_forest = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3941 0 : return 0;
3942 : }
3943 :
3944 0 : static PyObject *py_lsa_DnsDomainInfo_get_domain_guid(PyObject *obj, void *closure)
3945 : {
3946 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3947 0 : PyObject *py_domain_guid;
3948 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
3949 0 : return py_domain_guid;
3950 : }
3951 :
3952 0 : static int py_lsa_DnsDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
3953 : {
3954 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3955 0 : if (value == NULL) {
3956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_guid");
3957 0 : return -1;
3958 : }
3959 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3960 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3961 0 : PyErr_NoMemory();
3962 0 : return -1;
3963 : }
3964 0 : object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
3965 0 : return 0;
3966 : }
3967 :
3968 245 : static PyObject *py_lsa_DnsDomainInfo_get_sid(PyObject *obj, void *closure)
3969 : {
3970 245 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(obj);
3971 2 : PyObject *py_sid;
3972 245 : if (object->sid == NULL) {
3973 0 : Py_RETURN_NONE;
3974 : }
3975 245 : if (object->sid == NULL) {
3976 0 : py_sid = Py_None;
3977 0 : Py_INCREF(py_sid);
3978 : } else {
3979 245 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3980 : }
3981 245 : return py_sid;
3982 : }
3983 :
3984 0 : static int py_lsa_DnsDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3985 : {
3986 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
3987 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3988 0 : if (value == NULL) {
3989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
3990 0 : return -1;
3991 : }
3992 0 : if (value == Py_None) {
3993 0 : object->sid = NULL;
3994 : } else {
3995 0 : object->sid = NULL;
3996 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3997 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3998 0 : PyErr_NoMemory();
3999 0 : return -1;
4000 : }
4001 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4002 : }
4003 0 : return 0;
4004 : }
4005 :
4006 : static PyGetSetDef py_lsa_DnsDomainInfo_getsetters[] = {
4007 : {
4008 : .name = discard_const_p(char, "name"),
4009 : .get = py_lsa_DnsDomainInfo_get_name,
4010 : .set = py_lsa_DnsDomainInfo_set_name,
4011 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4012 : },
4013 : {
4014 : .name = discard_const_p(char, "dns_domain"),
4015 : .get = py_lsa_DnsDomainInfo_get_dns_domain,
4016 : .set = py_lsa_DnsDomainInfo_set_dns_domain,
4017 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4018 : },
4019 : {
4020 : .name = discard_const_p(char, "dns_forest"),
4021 : .get = py_lsa_DnsDomainInfo_get_dns_forest,
4022 : .set = py_lsa_DnsDomainInfo_set_dns_forest,
4023 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4024 : },
4025 : {
4026 : .name = discard_const_p(char, "domain_guid"),
4027 : .get = py_lsa_DnsDomainInfo_get_domain_guid,
4028 : .set = py_lsa_DnsDomainInfo_set_domain_guid,
4029 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4030 : },
4031 : {
4032 : .name = discard_const_p(char, "sid"),
4033 : .get = py_lsa_DnsDomainInfo_get_sid,
4034 : .set = py_lsa_DnsDomainInfo_set_sid,
4035 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4036 : },
4037 : { .name = NULL }
4038 : };
4039 :
4040 0 : static PyObject *py_lsa_DnsDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4041 : {
4042 0 : return pytalloc_new(struct lsa_DnsDomainInfo, type);
4043 : }
4044 :
4045 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4046 : {
4047 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4048 0 : PyObject *ret = NULL;
4049 0 : DATA_BLOB blob;
4050 0 : enum ndr_err_code err;
4051 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4052 0 : if (tmp_ctx == NULL) {
4053 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4054 0 : return NULL;
4055 : }
4056 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_DnsDomainInfo);
4057 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4058 0 : TALLOC_FREE(tmp_ctx);
4059 0 : PyErr_SetNdrError(err);
4060 0 : return NULL;
4061 : }
4062 :
4063 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4064 0 : TALLOC_FREE(tmp_ctx);
4065 0 : return ret;
4066 : }
4067 :
4068 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4069 : {
4070 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4071 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4072 0 : Py_ssize_t blob_length = 0;
4073 0 : enum ndr_err_code err;
4074 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4075 0 : PyObject *allow_remaining_obj = NULL;
4076 0 : bool allow_remaining = false;
4077 :
4078 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4079 : discard_const_p(char *, kwnames),
4080 : &blob.data, &blob_length,
4081 : &allow_remaining_obj)) {
4082 0 : return NULL;
4083 : }
4084 0 : blob.length = blob_length;
4085 :
4086 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4087 0 : allow_remaining = true;
4088 : }
4089 :
4090 0 : if (allow_remaining) {
4091 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4092 : } else {
4093 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4094 : }
4095 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4096 0 : PyErr_SetNdrError(err);
4097 0 : return NULL;
4098 : }
4099 :
4100 0 : Py_RETURN_NONE;
4101 : }
4102 :
4103 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4104 : {
4105 0 : struct lsa_DnsDomainInfo *object = (struct lsa_DnsDomainInfo *)pytalloc_get_ptr(py_obj);
4106 0 : PyObject *ret;
4107 0 : char *retstr;
4108 :
4109 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_DnsDomainInfo, "lsa_DnsDomainInfo", object);
4110 0 : ret = PyUnicode_FromString(retstr);
4111 0 : talloc_free(retstr);
4112 :
4113 0 : return ret;
4114 : }
4115 :
4116 : static PyMethodDef py_lsa_DnsDomainInfo_methods[] = {
4117 : { "__ndr_pack__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4118 : { "__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" },
4119 : { "__ndr_print__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4120 : { NULL, NULL, 0, NULL }
4121 : };
4122 :
4123 :
4124 : static PyTypeObject lsa_DnsDomainInfo_Type = {
4125 : PyVarObject_HEAD_INIT(NULL, 0)
4126 : .tp_name = "lsa.DnsDomainInfo",
4127 : .tp_getset = py_lsa_DnsDomainInfo_getsetters,
4128 : .tp_methods = py_lsa_DnsDomainInfo_methods,
4129 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4130 : .tp_new = py_lsa_DnsDomainInfo_new,
4131 : };
4132 :
4133 223 : static PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in)
4134 : {
4135 2 : PyObject *ret;
4136 :
4137 223 : switch (level) {
4138 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4139 0 : ret = pytalloc_reference_ex(&lsa_AuditLogInfo_Type, mem_ctx, &in->audit_log);
4140 0 : return ret;
4141 :
4142 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4143 0 : ret = pytalloc_reference_ex(&lsa_AuditEventsInfo_Type, mem_ctx, &in->audit_events);
4144 0 : return ret;
4145 :
4146 0 : case LSA_POLICY_INFO_DOMAIN:
4147 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->domain);
4148 0 : return ret;
4149 :
4150 0 : case LSA_POLICY_INFO_PD:
4151 0 : ret = pytalloc_reference_ex(&lsa_PDAccountInfo_Type, mem_ctx, &in->pd);
4152 0 : return ret;
4153 :
4154 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4155 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->account_domain);
4156 0 : return ret;
4157 :
4158 0 : case LSA_POLICY_INFO_ROLE:
4159 0 : ret = pytalloc_reference_ex(&lsa_ServerRole_Type, mem_ctx, &in->role);
4160 0 : return ret;
4161 :
4162 0 : case LSA_POLICY_INFO_REPLICA:
4163 0 : ret = pytalloc_reference_ex(&lsa_ReplicaSourceInfo_Type, mem_ctx, &in->replica);
4164 0 : return ret;
4165 :
4166 0 : case LSA_POLICY_INFO_QUOTA:
4167 0 : ret = pytalloc_reference_ex(&lsa_DefaultQuotaInfo_Type, mem_ctx, &in->quota);
4168 0 : return ret;
4169 :
4170 0 : case LSA_POLICY_INFO_MOD:
4171 0 : ret = pytalloc_reference_ex(&lsa_ModificationInfo_Type, mem_ctx, &in->mod);
4172 0 : return ret;
4173 :
4174 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4175 0 : ret = pytalloc_reference_ex(&lsa_AuditFullSetInfo_Type, mem_ctx, &in->auditfullset);
4176 0 : return ret;
4177 :
4178 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4179 0 : ret = pytalloc_reference_ex(&lsa_AuditFullQueryInfo_Type, mem_ctx, &in->auditfullquery);
4180 0 : return ret;
4181 :
4182 223 : case LSA_POLICY_INFO_DNS:
4183 223 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
4184 223 : return ret;
4185 :
4186 0 : case LSA_POLICY_INFO_DNS_INT:
4187 0 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
4188 0 : return ret;
4189 :
4190 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4191 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->l_account_domain);
4192 0 : return ret;
4193 :
4194 : }
4195 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4196 0 : return NULL;
4197 : }
4198 :
4199 0 : static union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4200 : {
4201 0 : union lsa_PolicyInformation *ret = talloc_zero(mem_ctx, union lsa_PolicyInformation);
4202 0 : switch (level) {
4203 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4204 0 : if (in == NULL) {
4205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->audit_log");
4206 0 : talloc_free(ret); return NULL;
4207 : }
4208 0 : PY_CHECK_TYPE(&lsa_AuditLogInfo_Type, in, talloc_free(ret); return NULL;);
4209 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4210 0 : PyErr_NoMemory();
4211 0 : talloc_free(ret); return NULL;
4212 : }
4213 0 : ret->audit_log = *(struct lsa_AuditLogInfo *)pytalloc_get_ptr(in);
4214 0 : break;
4215 :
4216 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4217 0 : if (in == NULL) {
4218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->audit_events");
4219 0 : talloc_free(ret); return NULL;
4220 : }
4221 0 : PY_CHECK_TYPE(&lsa_AuditEventsInfo_Type, in, talloc_free(ret); return NULL;);
4222 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4223 0 : PyErr_NoMemory();
4224 0 : talloc_free(ret); return NULL;
4225 : }
4226 0 : ret->audit_events = *(struct lsa_AuditEventsInfo *)pytalloc_get_ptr(in);
4227 0 : break;
4228 :
4229 0 : case LSA_POLICY_INFO_DOMAIN:
4230 0 : if (in == NULL) {
4231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain");
4232 0 : talloc_free(ret); return NULL;
4233 : }
4234 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4235 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4236 0 : PyErr_NoMemory();
4237 0 : talloc_free(ret); return NULL;
4238 : }
4239 0 : ret->domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4240 0 : break;
4241 :
4242 0 : case LSA_POLICY_INFO_PD:
4243 0 : if (in == NULL) {
4244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->pd");
4245 0 : talloc_free(ret); return NULL;
4246 : }
4247 0 : PY_CHECK_TYPE(&lsa_PDAccountInfo_Type, in, talloc_free(ret); return NULL;);
4248 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4249 0 : PyErr_NoMemory();
4250 0 : talloc_free(ret); return NULL;
4251 : }
4252 0 : ret->pd = *(struct lsa_PDAccountInfo *)pytalloc_get_ptr(in);
4253 0 : break;
4254 :
4255 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4256 0 : if (in == NULL) {
4257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->account_domain");
4258 0 : talloc_free(ret); return NULL;
4259 : }
4260 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4261 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4262 0 : PyErr_NoMemory();
4263 0 : talloc_free(ret); return NULL;
4264 : }
4265 0 : ret->account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4266 0 : break;
4267 :
4268 0 : case LSA_POLICY_INFO_ROLE:
4269 0 : if (in == NULL) {
4270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->role");
4271 0 : talloc_free(ret); return NULL;
4272 : }
4273 0 : PY_CHECK_TYPE(&lsa_ServerRole_Type, in, talloc_free(ret); return NULL;);
4274 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4275 0 : PyErr_NoMemory();
4276 0 : talloc_free(ret); return NULL;
4277 : }
4278 0 : ret->role = *(struct lsa_ServerRole *)pytalloc_get_ptr(in);
4279 0 : break;
4280 :
4281 0 : case LSA_POLICY_INFO_REPLICA:
4282 0 : if (in == NULL) {
4283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->replica");
4284 0 : talloc_free(ret); return NULL;
4285 : }
4286 0 : PY_CHECK_TYPE(&lsa_ReplicaSourceInfo_Type, in, talloc_free(ret); return NULL;);
4287 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4288 0 : PyErr_NoMemory();
4289 0 : talloc_free(ret); return NULL;
4290 : }
4291 0 : ret->replica = *(struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(in);
4292 0 : break;
4293 :
4294 0 : case LSA_POLICY_INFO_QUOTA:
4295 0 : if (in == NULL) {
4296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->quota");
4297 0 : talloc_free(ret); return NULL;
4298 : }
4299 0 : PY_CHECK_TYPE(&lsa_DefaultQuotaInfo_Type, in, talloc_free(ret); return NULL;);
4300 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4301 0 : PyErr_NoMemory();
4302 0 : talloc_free(ret); return NULL;
4303 : }
4304 0 : ret->quota = *(struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(in);
4305 0 : break;
4306 :
4307 0 : case LSA_POLICY_INFO_MOD:
4308 0 : if (in == NULL) {
4309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->mod");
4310 0 : talloc_free(ret); return NULL;
4311 : }
4312 0 : PY_CHECK_TYPE(&lsa_ModificationInfo_Type, in, talloc_free(ret); return NULL;);
4313 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4314 0 : PyErr_NoMemory();
4315 0 : talloc_free(ret); return NULL;
4316 : }
4317 0 : ret->mod = *(struct lsa_ModificationInfo *)pytalloc_get_ptr(in);
4318 0 : break;
4319 :
4320 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4321 0 : if (in == NULL) {
4322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auditfullset");
4323 0 : talloc_free(ret); return NULL;
4324 : }
4325 0 : PY_CHECK_TYPE(&lsa_AuditFullSetInfo_Type, in, talloc_free(ret); return NULL;);
4326 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4327 0 : PyErr_NoMemory();
4328 0 : talloc_free(ret); return NULL;
4329 : }
4330 0 : ret->auditfullset = *(struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(in);
4331 0 : break;
4332 :
4333 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4334 0 : if (in == NULL) {
4335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auditfullquery");
4336 0 : talloc_free(ret); return NULL;
4337 : }
4338 0 : PY_CHECK_TYPE(&lsa_AuditFullQueryInfo_Type, in, talloc_free(ret); return NULL;);
4339 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4340 0 : PyErr_NoMemory();
4341 0 : talloc_free(ret); return NULL;
4342 : }
4343 0 : ret->auditfullquery = *(struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(in);
4344 0 : break;
4345 :
4346 0 : case LSA_POLICY_INFO_DNS:
4347 0 : if (in == NULL) {
4348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dns");
4349 0 : talloc_free(ret); return NULL;
4350 : }
4351 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4352 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4353 0 : PyErr_NoMemory();
4354 0 : talloc_free(ret); return NULL;
4355 : }
4356 0 : ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4357 0 : break;
4358 :
4359 0 : case LSA_POLICY_INFO_DNS_INT:
4360 0 : if (in == NULL) {
4361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->dns");
4362 0 : talloc_free(ret); return NULL;
4363 : }
4364 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4365 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4366 0 : PyErr_NoMemory();
4367 0 : talloc_free(ret); return NULL;
4368 : }
4369 0 : ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4370 0 : break;
4371 :
4372 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4373 0 : if (in == NULL) {
4374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->l_account_domain");
4375 0 : talloc_free(ret); return NULL;
4376 : }
4377 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4378 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4379 0 : PyErr_NoMemory();
4380 0 : talloc_free(ret); return NULL;
4381 : }
4382 0 : ret->l_account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4383 0 : break;
4384 :
4385 0 : default:
4386 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4387 0 : talloc_free(ret);
4388 0 : ret = NULL;
4389 : }
4390 :
4391 0 : return ret;
4392 : }
4393 :
4394 223 : static PyObject *py_lsa_PolicyInformation_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4395 : {
4396 223 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4397 223 : PyObject *mem_ctx_obj = NULL;
4398 223 : TALLOC_CTX *mem_ctx = NULL;
4399 223 : int level = 0;
4400 223 : PyObject *in_obj = NULL;
4401 223 : union lsa_PolicyInformation *in = NULL;
4402 :
4403 223 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4404 : discard_const_p(char *, kwnames),
4405 : &mem_ctx_obj,
4406 : &level,
4407 : &in_obj)) {
4408 0 : return NULL;
4409 : }
4410 223 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4411 223 : if (mem_ctx == NULL) {
4412 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4413 0 : return NULL;
4414 : }
4415 223 : in = (union lsa_PolicyInformation *)pytalloc_get_ptr(in_obj);
4416 223 : if (in == NULL) {
4417 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_PolicyInformation!");
4418 0 : return NULL;
4419 : }
4420 :
4421 223 : return py_import_lsa_PolicyInformation(mem_ctx, level, in);
4422 : }
4423 :
4424 0 : static PyObject *py_lsa_PolicyInformation_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4425 : {
4426 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4427 0 : PyObject *mem_ctx_obj = NULL;
4428 0 : TALLOC_CTX *mem_ctx = NULL;
4429 0 : int level = 0;
4430 0 : PyObject *in = NULL;
4431 0 : union lsa_PolicyInformation *out = NULL;
4432 :
4433 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4434 : discard_const_p(char *, kwnames),
4435 : &mem_ctx_obj,
4436 : &level,
4437 : &in)) {
4438 0 : return NULL;
4439 : }
4440 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4441 0 : if (mem_ctx == NULL) {
4442 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4443 0 : return NULL;
4444 : }
4445 :
4446 0 : out = py_export_lsa_PolicyInformation(mem_ctx, level, in);
4447 0 : if (out == NULL) {
4448 0 : return NULL;
4449 : }
4450 :
4451 0 : return pytalloc_GenericObject_reference(out);
4452 : }
4453 :
4454 : static PyMethodDef py_lsa_PolicyInformation_methods[] = {
4455 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_import),
4456 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4457 : "T.__import__(mem_ctx, level, in) => ret." },
4458 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_export),
4459 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4460 : "T.__export__(mem_ctx, level, in) => ret." },
4461 : { NULL, NULL, 0, NULL }
4462 : };
4463 :
4464 0 : static PyObject *py_lsa_PolicyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4465 : {
4466 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4467 0 : return NULL;
4468 : }
4469 :
4470 :
4471 : static PyTypeObject lsa_PolicyInformation_Type = {
4472 : PyVarObject_HEAD_INIT(NULL, 0)
4473 : .tp_name = "lsa.PolicyInformation",
4474 : .tp_getset = NULL,
4475 : .tp_methods = py_lsa_PolicyInformation_methods,
4476 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4477 : .tp_new = py_lsa_PolicyInformation_new,
4478 : };
4479 :
4480 :
4481 0 : static PyObject *py_lsa_SidPtr_get_sid(PyObject *obj, void *closure)
4482 : {
4483 0 : struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(obj);
4484 0 : PyObject *py_sid;
4485 0 : if (object->sid == NULL) {
4486 0 : Py_RETURN_NONE;
4487 : }
4488 0 : if (object->sid == NULL) {
4489 0 : py_sid = Py_None;
4490 0 : Py_INCREF(py_sid);
4491 : } else {
4492 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
4493 : }
4494 0 : return py_sid;
4495 : }
4496 :
4497 7 : static int py_lsa_SidPtr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
4498 : {
4499 7 : struct lsa_SidPtr *object = (struct lsa_SidPtr *)pytalloc_get_ptr(py_obj);
4500 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
4501 7 : if (value == NULL) {
4502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
4503 0 : return -1;
4504 : }
4505 7 : if (value == Py_None) {
4506 0 : object->sid = NULL;
4507 : } else {
4508 7 : object->sid = NULL;
4509 7 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4510 7 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4511 0 : PyErr_NoMemory();
4512 0 : return -1;
4513 : }
4514 7 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4515 : }
4516 7 : return 0;
4517 : }
4518 :
4519 : static PyGetSetDef py_lsa_SidPtr_getsetters[] = {
4520 : {
4521 : .name = discard_const_p(char, "sid"),
4522 : .get = py_lsa_SidPtr_get_sid,
4523 : .set = py_lsa_SidPtr_set_sid,
4524 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4525 : },
4526 : { .name = NULL }
4527 : };
4528 :
4529 7 : static PyObject *py_lsa_SidPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4530 : {
4531 7 : return pytalloc_new(struct lsa_SidPtr, type);
4532 : }
4533 :
4534 :
4535 : static PyTypeObject lsa_SidPtr_Type = {
4536 : PyVarObject_HEAD_INIT(NULL, 0)
4537 : .tp_name = "lsa.SidPtr",
4538 : .tp_getset = py_lsa_SidPtr_getsetters,
4539 : .tp_methods = NULL,
4540 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4541 : .tp_new = py_lsa_SidPtr_new,
4542 : };
4543 :
4544 :
4545 0 : static PyObject *py_lsa_SidArray_get_num_sids(PyObject *obj, void *closure)
4546 : {
4547 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
4548 0 : PyObject *py_num_sids;
4549 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)object->num_sids);
4550 0 : return py_num_sids;
4551 : }
4552 :
4553 6 : static int py_lsa_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
4554 : {
4555 6 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4556 6 : if (value == NULL) {
4557 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_sids");
4558 0 : return -1;
4559 : }
4560 : {
4561 6 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
4562 6 : if (PyLong_Check(value)) {
4563 0 : unsigned long long test_var;
4564 6 : test_var = PyLong_AsUnsignedLongLong(value);
4565 6 : if (PyErr_Occurred() != NULL) {
4566 0 : return -1;
4567 : }
4568 6 : if (test_var > uint_max) {
4569 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4570 : PyLong_Type.tp_name, uint_max, test_var);
4571 0 : return -1;
4572 : }
4573 6 : object->num_sids = test_var;
4574 : } else {
4575 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4576 : PyLong_Type.tp_name);
4577 0 : return -1;
4578 : }
4579 : }
4580 6 : return 0;
4581 : }
4582 :
4583 0 : static PyObject *py_lsa_SidArray_get_sids(PyObject *obj, void *closure)
4584 : {
4585 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(obj);
4586 0 : PyObject *py_sids;
4587 0 : if (object->sids == NULL) {
4588 0 : Py_RETURN_NONE;
4589 : }
4590 0 : if (object->sids == NULL) {
4591 0 : py_sids = Py_None;
4592 0 : Py_INCREF(py_sids);
4593 : } else {
4594 0 : py_sids = PyList_New(object->num_sids);
4595 0 : if (py_sids == NULL) {
4596 0 : return NULL;
4597 : }
4598 : {
4599 : int sids_cntr_1;
4600 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->num_sids); sids_cntr_1++) {
4601 0 : PyObject *py_sids_1;
4602 0 : py_sids_1 = pytalloc_reference_ex(&lsa_SidPtr_Type, object->sids, &object->sids[sids_cntr_1]);
4603 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4604 : }
4605 : }
4606 : }
4607 0 : return py_sids;
4608 : }
4609 :
4610 7 : static int py_lsa_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4611 : {
4612 7 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4613 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4614 7 : if (value == NULL) {
4615 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
4616 0 : return -1;
4617 : }
4618 7 : if (value == Py_None) {
4619 0 : object->sids = NULL;
4620 : } else {
4621 7 : object->sids = NULL;
4622 7 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4623 : {
4624 0 : int sids_cntr_1;
4625 7 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4626 7 : if (!object->sids) { return -1; }
4627 7 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
4628 14 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4629 7 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
4630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
4631 0 : return -1;
4632 : }
4633 7 : PY_CHECK_TYPE(&lsa_SidPtr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4634 7 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4635 0 : PyErr_NoMemory();
4636 0 : return -1;
4637 : }
4638 7 : object->sids[sids_cntr_1] = *(struct lsa_SidPtr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4639 : }
4640 : }
4641 : }
4642 7 : return 0;
4643 : }
4644 :
4645 : static PyGetSetDef py_lsa_SidArray_getsetters[] = {
4646 : {
4647 : .name = discard_const_p(char, "num_sids"),
4648 : .get = py_lsa_SidArray_get_num_sids,
4649 : .set = py_lsa_SidArray_set_num_sids,
4650 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4651 : },
4652 : {
4653 : .name = discard_const_p(char, "sids"),
4654 : .get = py_lsa_SidArray_get_sids,
4655 : .set = py_lsa_SidArray_set_sids,
4656 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidPtr")
4657 : },
4658 : { .name = NULL }
4659 : };
4660 :
4661 7 : static PyObject *py_lsa_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4662 : {
4663 7 : return pytalloc_new(struct lsa_SidArray, type);
4664 : }
4665 :
4666 0 : static PyObject *py_lsa_SidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4667 : {
4668 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4669 0 : PyObject *ret = NULL;
4670 0 : DATA_BLOB blob;
4671 0 : enum ndr_err_code err;
4672 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4673 0 : if (tmp_ctx == NULL) {
4674 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4675 0 : return NULL;
4676 : }
4677 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_SidArray);
4678 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4679 0 : TALLOC_FREE(tmp_ctx);
4680 0 : PyErr_SetNdrError(err);
4681 0 : return NULL;
4682 : }
4683 :
4684 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4685 0 : TALLOC_FREE(tmp_ctx);
4686 0 : return ret;
4687 : }
4688 :
4689 0 : static PyObject *py_lsa_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4690 : {
4691 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4692 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4693 0 : Py_ssize_t blob_length = 0;
4694 0 : enum ndr_err_code err;
4695 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4696 0 : PyObject *allow_remaining_obj = NULL;
4697 0 : bool allow_remaining = false;
4698 :
4699 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4700 : discard_const_p(char *, kwnames),
4701 : &blob.data, &blob_length,
4702 : &allow_remaining_obj)) {
4703 0 : return NULL;
4704 : }
4705 0 : blob.length = blob_length;
4706 :
4707 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4708 0 : allow_remaining = true;
4709 : }
4710 :
4711 0 : if (allow_remaining) {
4712 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4713 : } else {
4714 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4715 : }
4716 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4717 0 : PyErr_SetNdrError(err);
4718 0 : return NULL;
4719 : }
4720 :
4721 0 : Py_RETURN_NONE;
4722 : }
4723 :
4724 0 : static PyObject *py_lsa_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4725 : {
4726 0 : struct lsa_SidArray *object = (struct lsa_SidArray *)pytalloc_get_ptr(py_obj);
4727 0 : PyObject *ret;
4728 0 : char *retstr;
4729 :
4730 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_SidArray, "lsa_SidArray", object);
4731 0 : ret = PyUnicode_FromString(retstr);
4732 0 : talloc_free(retstr);
4733 :
4734 0 : return ret;
4735 : }
4736 :
4737 : static PyMethodDef py_lsa_SidArray_methods[] = {
4738 : { "__ndr_pack__", (PyCFunction)py_lsa_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4739 : { "__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" },
4740 : { "__ndr_print__", (PyCFunction)py_lsa_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4741 : { NULL, NULL, 0, NULL }
4742 : };
4743 :
4744 :
4745 : static PyTypeObject lsa_SidArray_Type = {
4746 : PyVarObject_HEAD_INIT(NULL, 0)
4747 : .tp_name = "lsa.SidArray",
4748 : .tp_getset = py_lsa_SidArray_getsetters,
4749 : .tp_methods = py_lsa_SidArray_methods,
4750 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4751 : .tp_new = py_lsa_SidArray_new,
4752 : };
4753 :
4754 :
4755 0 : static PyObject *py_lsa_DomainList_get_count(PyObject *obj, void *closure)
4756 : {
4757 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4758 0 : PyObject *py_count;
4759 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
4760 0 : return py_count;
4761 : }
4762 :
4763 0 : static int py_lsa_DomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4764 : {
4765 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4766 0 : if (value == NULL) {
4767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
4768 0 : return -1;
4769 : }
4770 : {
4771 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4772 0 : if (PyLong_Check(value)) {
4773 0 : unsigned long long test_var;
4774 0 : test_var = PyLong_AsUnsignedLongLong(value);
4775 0 : if (PyErr_Occurred() != NULL) {
4776 0 : return -1;
4777 : }
4778 0 : if (test_var > uint_max) {
4779 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4780 : PyLong_Type.tp_name, uint_max, test_var);
4781 0 : return -1;
4782 : }
4783 0 : object->count = test_var;
4784 : } else {
4785 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4786 : PyLong_Type.tp_name);
4787 0 : return -1;
4788 : }
4789 : }
4790 0 : return 0;
4791 : }
4792 :
4793 0 : static PyObject *py_lsa_DomainList_get_domains(PyObject *obj, void *closure)
4794 : {
4795 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(obj);
4796 0 : PyObject *py_domains;
4797 0 : if (object->domains == NULL) {
4798 0 : Py_RETURN_NONE;
4799 : }
4800 0 : if (object->domains == NULL) {
4801 0 : py_domains = Py_None;
4802 0 : Py_INCREF(py_domains);
4803 : } else {
4804 0 : py_domains = PyList_New(object->count);
4805 0 : if (py_domains == NULL) {
4806 0 : return NULL;
4807 : }
4808 : {
4809 : int domains_cntr_1;
4810 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
4811 0 : PyObject *py_domains_1;
4812 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
4813 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
4814 : }
4815 : }
4816 : }
4817 0 : return py_domains;
4818 : }
4819 :
4820 0 : static int py_lsa_DomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4821 : {
4822 0 : struct lsa_DomainList *object = (struct lsa_DomainList *)pytalloc_get_ptr(py_obj);
4823 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
4824 0 : if (value == NULL) {
4825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
4826 0 : return -1;
4827 : }
4828 0 : if (value == Py_None) {
4829 0 : object->domains = NULL;
4830 : } else {
4831 0 : object->domains = NULL;
4832 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4833 : {
4834 0 : int domains_cntr_1;
4835 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
4836 0 : if (!object->domains) { return -1; }
4837 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
4838 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
4839 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
4840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
4841 0 : return -1;
4842 : }
4843 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
4844 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
4845 0 : PyErr_NoMemory();
4846 0 : return -1;
4847 : }
4848 0 : object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4849 : }
4850 : }
4851 : }
4852 0 : return 0;
4853 : }
4854 :
4855 : static PyGetSetDef py_lsa_DomainList_getsetters[] = {
4856 : {
4857 : .name = discard_const_p(char, "count"),
4858 : .get = py_lsa_DomainList_get_count,
4859 : .set = py_lsa_DomainList_set_count,
4860 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4861 : },
4862 : {
4863 : .name = discard_const_p(char, "domains"),
4864 : .get = py_lsa_DomainList_get_domains,
4865 : .set = py_lsa_DomainList_set_domains,
4866 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
4867 : },
4868 : { .name = NULL }
4869 : };
4870 :
4871 0 : static PyObject *py_lsa_DomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4872 : {
4873 0 : return pytalloc_new(struct lsa_DomainList, type);
4874 : }
4875 :
4876 :
4877 : static PyTypeObject lsa_DomainList_Type = {
4878 : PyVarObject_HEAD_INIT(NULL, 0)
4879 : .tp_name = "lsa.DomainList",
4880 : .tp_getset = py_lsa_DomainList_getsetters,
4881 : .tp_methods = NULL,
4882 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4883 : .tp_new = py_lsa_DomainList_new,
4884 : };
4885 :
4886 :
4887 0 : static PyObject *py_lsa_TranslatedSid_get_sid_type(PyObject *obj, void *closure)
4888 : {
4889 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4890 0 : PyObject *py_sid_type;
4891 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
4892 0 : return py_sid_type;
4893 : }
4894 :
4895 0 : static int py_lsa_TranslatedSid_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4896 : {
4897 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4898 0 : if (value == NULL) {
4899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
4900 0 : return -1;
4901 : }
4902 : {
4903 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
4904 0 : if (PyLong_Check(value)) {
4905 0 : unsigned long long test_var;
4906 0 : test_var = PyLong_AsUnsignedLongLong(value);
4907 0 : if (PyErr_Occurred() != NULL) {
4908 0 : return -1;
4909 : }
4910 0 : if (test_var > uint_max) {
4911 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4912 : PyLong_Type.tp_name, uint_max, test_var);
4913 0 : return -1;
4914 : }
4915 0 : object->sid_type = test_var;
4916 : } else {
4917 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4918 : PyLong_Type.tp_name);
4919 0 : return -1;
4920 : }
4921 : }
4922 0 : return 0;
4923 : }
4924 :
4925 0 : static PyObject *py_lsa_TranslatedSid_get_rid(PyObject *obj, void *closure)
4926 : {
4927 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4928 0 : PyObject *py_rid;
4929 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4930 0 : return py_rid;
4931 : }
4932 :
4933 0 : static int py_lsa_TranslatedSid_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4934 : {
4935 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4936 0 : if (value == NULL) {
4937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
4938 0 : return -1;
4939 : }
4940 : {
4941 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
4942 0 : if (PyLong_Check(value)) {
4943 0 : unsigned long long test_var;
4944 0 : test_var = PyLong_AsUnsignedLongLong(value);
4945 0 : if (PyErr_Occurred() != NULL) {
4946 0 : return -1;
4947 : }
4948 0 : if (test_var > uint_max) {
4949 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4950 : PyLong_Type.tp_name, uint_max, test_var);
4951 0 : return -1;
4952 : }
4953 0 : object->rid = test_var;
4954 : } else {
4955 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4956 : PyLong_Type.tp_name);
4957 0 : return -1;
4958 : }
4959 : }
4960 0 : return 0;
4961 : }
4962 :
4963 0 : static PyObject *py_lsa_TranslatedSid_get_sid_index(PyObject *obj, void *closure)
4964 : {
4965 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(obj);
4966 0 : PyObject *py_sid_index;
4967 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
4968 0 : return py_sid_index;
4969 : }
4970 :
4971 0 : static int py_lsa_TranslatedSid_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4972 : {
4973 0 : struct lsa_TranslatedSid *object = (struct lsa_TranslatedSid *)pytalloc_get_ptr(py_obj);
4974 0 : if (value == NULL) {
4975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
4976 0 : return -1;
4977 : }
4978 : {
4979 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
4980 0 : if (PyLong_Check(value)) {
4981 0 : unsigned long long test_var;
4982 0 : test_var = PyLong_AsUnsignedLongLong(value);
4983 0 : if (PyErr_Occurred() != NULL) {
4984 0 : return -1;
4985 : }
4986 0 : if (test_var > uint_max) {
4987 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4988 : PyLong_Type.tp_name, uint_max, test_var);
4989 0 : return -1;
4990 : }
4991 0 : object->sid_index = test_var;
4992 : } else {
4993 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4994 : PyLong_Type.tp_name);
4995 0 : return -1;
4996 : }
4997 : }
4998 0 : return 0;
4999 : }
5000 :
5001 : static PyGetSetDef py_lsa_TranslatedSid_getsetters[] = {
5002 : {
5003 : .name = discard_const_p(char, "sid_type"),
5004 : .get = py_lsa_TranslatedSid_get_sid_type,
5005 : .set = py_lsa_TranslatedSid_set_sid_type,
5006 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5007 : },
5008 : {
5009 : .name = discard_const_p(char, "rid"),
5010 : .get = py_lsa_TranslatedSid_get_rid,
5011 : .set = py_lsa_TranslatedSid_set_rid,
5012 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5013 : },
5014 : {
5015 : .name = discard_const_p(char, "sid_index"),
5016 : .get = py_lsa_TranslatedSid_get_sid_index,
5017 : .set = py_lsa_TranslatedSid_set_sid_index,
5018 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5019 : },
5020 : { .name = NULL }
5021 : };
5022 :
5023 0 : static PyObject *py_lsa_TranslatedSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5024 : {
5025 0 : return pytalloc_new(struct lsa_TranslatedSid, type);
5026 : }
5027 :
5028 :
5029 : static PyTypeObject lsa_TranslatedSid_Type = {
5030 : PyVarObject_HEAD_INIT(NULL, 0)
5031 : .tp_name = "lsa.TranslatedSid",
5032 : .tp_getset = py_lsa_TranslatedSid_getsetters,
5033 : .tp_methods = NULL,
5034 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5035 : .tp_new = py_lsa_TranslatedSid_new,
5036 : };
5037 :
5038 :
5039 0 : static PyObject *py_lsa_TransSidArray_get_count(PyObject *obj, void *closure)
5040 : {
5041 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
5042 0 : PyObject *py_count;
5043 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5044 0 : return py_count;
5045 : }
5046 :
5047 0 : static int py_lsa_TransSidArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5048 : {
5049 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
5050 0 : if (value == NULL) {
5051 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5052 0 : return -1;
5053 : }
5054 : {
5055 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5056 0 : if (PyLong_Check(value)) {
5057 0 : unsigned long long test_var;
5058 0 : test_var = PyLong_AsUnsignedLongLong(value);
5059 0 : if (PyErr_Occurred() != NULL) {
5060 0 : return -1;
5061 : }
5062 0 : if (test_var > uint_max) {
5063 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5064 : PyLong_Type.tp_name, uint_max, test_var);
5065 0 : return -1;
5066 : }
5067 0 : object->count = test_var;
5068 : } else {
5069 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5070 : PyLong_Type.tp_name);
5071 0 : return -1;
5072 : }
5073 : }
5074 0 : return 0;
5075 : }
5076 :
5077 0 : static PyObject *py_lsa_TransSidArray_get_sids(PyObject *obj, void *closure)
5078 : {
5079 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(obj);
5080 0 : PyObject *py_sids;
5081 0 : if (object->sids == NULL) {
5082 0 : Py_RETURN_NONE;
5083 : }
5084 0 : if (object->sids == NULL) {
5085 0 : py_sids = Py_None;
5086 0 : Py_INCREF(py_sids);
5087 : } else {
5088 0 : py_sids = PyList_New(object->count);
5089 0 : if (py_sids == NULL) {
5090 0 : return NULL;
5091 : }
5092 : {
5093 : int sids_cntr_1;
5094 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
5095 0 : PyObject *py_sids_1;
5096 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid_Type, object->sids, &object->sids[sids_cntr_1]);
5097 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
5098 : }
5099 : }
5100 : }
5101 0 : return py_sids;
5102 : }
5103 :
5104 0 : static int py_lsa_TransSidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
5105 : {
5106 0 : struct lsa_TransSidArray *object = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_obj);
5107 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
5108 0 : if (value == NULL) {
5109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
5110 0 : return -1;
5111 : }
5112 0 : if (value == Py_None) {
5113 0 : object->sids = NULL;
5114 : } else {
5115 0 : object->sids = NULL;
5116 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5117 : {
5118 0 : int sids_cntr_1;
5119 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
5120 0 : if (!object->sids) { return -1; }
5121 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
5122 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
5123 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
5124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
5125 0 : return -1;
5126 : }
5127 0 : PY_CHECK_TYPE(&lsa_TranslatedSid_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
5128 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
5129 0 : PyErr_NoMemory();
5130 0 : return -1;
5131 : }
5132 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
5133 : }
5134 : }
5135 : }
5136 0 : return 0;
5137 : }
5138 :
5139 : static PyGetSetDef py_lsa_TransSidArray_getsetters[] = {
5140 : {
5141 : .name = discard_const_p(char, "count"),
5142 : .get = py_lsa_TransSidArray_get_count,
5143 : .set = py_lsa_TransSidArray_set_count,
5144 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5145 : },
5146 : {
5147 : .name = discard_const_p(char, "sids"),
5148 : .get = py_lsa_TransSidArray_get_sids,
5149 : .set = py_lsa_TransSidArray_set_sids,
5150 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid")
5151 : },
5152 : { .name = NULL }
5153 : };
5154 :
5155 1 : static PyObject *py_lsa_TransSidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5156 : {
5157 1 : return pytalloc_new(struct lsa_TransSidArray, type);
5158 : }
5159 :
5160 :
5161 : static PyTypeObject lsa_TransSidArray_Type = {
5162 : PyVarObject_HEAD_INIT(NULL, 0)
5163 : .tp_name = "lsa.TransSidArray",
5164 : .tp_getset = py_lsa_TransSidArray_getsetters,
5165 : .tp_methods = NULL,
5166 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5167 : .tp_new = py_lsa_TransSidArray_new,
5168 : };
5169 :
5170 :
5171 0 : static PyObject *py_lsa_RefDomainList_get_count(PyObject *obj, void *closure)
5172 : {
5173 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5174 0 : PyObject *py_count;
5175 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5176 0 : return py_count;
5177 : }
5178 :
5179 0 : static int py_lsa_RefDomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
5180 : {
5181 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5182 0 : if (value == NULL) {
5183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5184 0 : return -1;
5185 : }
5186 : {
5187 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5188 0 : if (PyLong_Check(value)) {
5189 0 : unsigned long long test_var;
5190 0 : test_var = PyLong_AsUnsignedLongLong(value);
5191 0 : if (PyErr_Occurred() != NULL) {
5192 0 : return -1;
5193 : }
5194 0 : if (test_var > uint_max) {
5195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5196 : PyLong_Type.tp_name, uint_max, test_var);
5197 0 : return -1;
5198 : }
5199 0 : object->count = test_var;
5200 : } else {
5201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5202 : PyLong_Type.tp_name);
5203 0 : return -1;
5204 : }
5205 : }
5206 0 : return 0;
5207 : }
5208 :
5209 0 : static PyObject *py_lsa_RefDomainList_get_domains(PyObject *obj, void *closure)
5210 : {
5211 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5212 0 : PyObject *py_domains;
5213 0 : if (object->domains == NULL) {
5214 0 : Py_RETURN_NONE;
5215 : }
5216 0 : if (object->domains == NULL) {
5217 0 : py_domains = Py_None;
5218 0 : Py_INCREF(py_domains);
5219 : } else {
5220 0 : py_domains = PyList_New(object->count);
5221 0 : if (py_domains == NULL) {
5222 0 : return NULL;
5223 : }
5224 : {
5225 : int domains_cntr_1;
5226 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
5227 0 : PyObject *py_domains_1;
5228 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &object->domains[domains_cntr_1]);
5229 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
5230 : }
5231 : }
5232 : }
5233 0 : return py_domains;
5234 : }
5235 :
5236 0 : static int py_lsa_RefDomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
5237 : {
5238 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5239 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
5240 0 : if (value == NULL) {
5241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
5242 0 : return -1;
5243 : }
5244 0 : if (value == Py_None) {
5245 0 : object->domains = NULL;
5246 : } else {
5247 0 : object->domains = NULL;
5248 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5249 : {
5250 0 : int domains_cntr_1;
5251 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
5252 0 : if (!object->domains) { return -1; }
5253 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
5254 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
5255 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
5256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
5257 0 : return -1;
5258 : }
5259 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
5260 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
5261 0 : PyErr_NoMemory();
5262 0 : return -1;
5263 : }
5264 0 : object->domains[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
5265 : }
5266 : }
5267 : }
5268 0 : return 0;
5269 : }
5270 :
5271 0 : static PyObject *py_lsa_RefDomainList_get_max_size(PyObject *obj, void *closure)
5272 : {
5273 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(obj);
5274 0 : PyObject *py_max_size;
5275 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->max_size);
5276 0 : return py_max_size;
5277 : }
5278 :
5279 0 : static int py_lsa_RefDomainList_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
5280 : {
5281 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5282 0 : if (value == NULL) {
5283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_size");
5284 0 : return -1;
5285 : }
5286 : {
5287 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_size));
5288 0 : if (PyLong_Check(value)) {
5289 0 : unsigned long long test_var;
5290 0 : test_var = PyLong_AsUnsignedLongLong(value);
5291 0 : if (PyErr_Occurred() != NULL) {
5292 0 : return -1;
5293 : }
5294 0 : if (test_var > uint_max) {
5295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5296 : PyLong_Type.tp_name, uint_max, test_var);
5297 0 : return -1;
5298 : }
5299 0 : object->max_size = test_var;
5300 : } else {
5301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5302 : PyLong_Type.tp_name);
5303 0 : return -1;
5304 : }
5305 : }
5306 0 : return 0;
5307 : }
5308 :
5309 : static PyGetSetDef py_lsa_RefDomainList_getsetters[] = {
5310 : {
5311 : .name = discard_const_p(char, "count"),
5312 : .get = py_lsa_RefDomainList_get_count,
5313 : .set = py_lsa_RefDomainList_set_count,
5314 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5315 : },
5316 : {
5317 : .name = discard_const_p(char, "domains"),
5318 : .get = py_lsa_RefDomainList_get_domains,
5319 : .set = py_lsa_RefDomainList_set_domains,
5320 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
5321 : },
5322 : {
5323 : .name = discard_const_p(char, "max_size"),
5324 : .get = py_lsa_RefDomainList_get_max_size,
5325 : .set = py_lsa_RefDomainList_set_max_size,
5326 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5327 : },
5328 : { .name = NULL }
5329 : };
5330 :
5331 0 : static PyObject *py_lsa_RefDomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5332 : {
5333 0 : return pytalloc_new(struct lsa_RefDomainList, type);
5334 : }
5335 :
5336 0 : static PyObject *py_lsa_RefDomainList_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5337 : {
5338 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5339 0 : PyObject *ret = NULL;
5340 0 : DATA_BLOB blob;
5341 0 : enum ndr_err_code err;
5342 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5343 0 : if (tmp_ctx == NULL) {
5344 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5345 0 : return NULL;
5346 : }
5347 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_RefDomainList);
5348 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5349 0 : TALLOC_FREE(tmp_ctx);
5350 0 : PyErr_SetNdrError(err);
5351 0 : return NULL;
5352 : }
5353 :
5354 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5355 0 : TALLOC_FREE(tmp_ctx);
5356 0 : return ret;
5357 : }
5358 :
5359 0 : static PyObject *py_lsa_RefDomainList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5360 : {
5361 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5362 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5363 0 : Py_ssize_t blob_length = 0;
5364 0 : enum ndr_err_code err;
5365 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5366 0 : PyObject *allow_remaining_obj = NULL;
5367 0 : bool allow_remaining = false;
5368 :
5369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5370 : discard_const_p(char *, kwnames),
5371 : &blob.data, &blob_length,
5372 : &allow_remaining_obj)) {
5373 0 : return NULL;
5374 : }
5375 0 : blob.length = blob_length;
5376 :
5377 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5378 0 : allow_remaining = true;
5379 : }
5380 :
5381 0 : if (allow_remaining) {
5382 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5383 : } else {
5384 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5385 : }
5386 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5387 0 : PyErr_SetNdrError(err);
5388 0 : return NULL;
5389 : }
5390 :
5391 0 : Py_RETURN_NONE;
5392 : }
5393 :
5394 0 : static PyObject *py_lsa_RefDomainList_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5395 : {
5396 0 : struct lsa_RefDomainList *object = (struct lsa_RefDomainList *)pytalloc_get_ptr(py_obj);
5397 0 : PyObject *ret;
5398 0 : char *retstr;
5399 :
5400 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_RefDomainList, "lsa_RefDomainList", object);
5401 0 : ret = PyUnicode_FromString(retstr);
5402 0 : talloc_free(retstr);
5403 :
5404 0 : return ret;
5405 : }
5406 :
5407 : static PyMethodDef py_lsa_RefDomainList_methods[] = {
5408 : { "__ndr_pack__", (PyCFunction)py_lsa_RefDomainList_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5409 : { "__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" },
5410 : { "__ndr_print__", (PyCFunction)py_lsa_RefDomainList_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5411 : { NULL, NULL, 0, NULL }
5412 : };
5413 :
5414 :
5415 : static PyTypeObject lsa_RefDomainList_Type = {
5416 : PyVarObject_HEAD_INIT(NULL, 0)
5417 : .tp_name = "lsa.RefDomainList",
5418 : .tp_getset = py_lsa_RefDomainList_getsetters,
5419 : .tp_methods = py_lsa_RefDomainList_methods,
5420 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5421 : .tp_new = py_lsa_RefDomainList_new,
5422 : };
5423 :
5424 :
5425 0 : static PyObject *py_lsa_TranslatedName_get_sid_type(PyObject *obj, void *closure)
5426 : {
5427 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5428 0 : PyObject *py_sid_type;
5429 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
5430 0 : return py_sid_type;
5431 : }
5432 :
5433 0 : static int py_lsa_TranslatedName_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
5434 : {
5435 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5436 0 : if (value == NULL) {
5437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
5438 0 : return -1;
5439 : }
5440 : {
5441 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
5442 0 : if (PyLong_Check(value)) {
5443 0 : unsigned long long test_var;
5444 0 : test_var = PyLong_AsUnsignedLongLong(value);
5445 0 : if (PyErr_Occurred() != NULL) {
5446 0 : return -1;
5447 : }
5448 0 : if (test_var > uint_max) {
5449 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5450 : PyLong_Type.tp_name, uint_max, test_var);
5451 0 : return -1;
5452 : }
5453 0 : object->sid_type = test_var;
5454 : } else {
5455 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5456 : PyLong_Type.tp_name);
5457 0 : return -1;
5458 : }
5459 : }
5460 0 : return 0;
5461 : }
5462 :
5463 0 : static PyObject *py_lsa_TranslatedName_get_name(PyObject *obj, void *closure)
5464 : {
5465 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5466 0 : PyObject *py_name;
5467 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
5468 0 : return py_name;
5469 : }
5470 :
5471 0 : static int py_lsa_TranslatedName_set_name(PyObject *py_obj, PyObject *value, void *closure)
5472 : {
5473 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5474 0 : if (value == NULL) {
5475 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
5476 0 : return -1;
5477 : }
5478 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
5479 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5480 0 : PyErr_NoMemory();
5481 0 : return -1;
5482 : }
5483 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
5484 0 : return 0;
5485 : }
5486 :
5487 0 : static PyObject *py_lsa_TranslatedName_get_sid_index(PyObject *obj, void *closure)
5488 : {
5489 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(obj);
5490 0 : PyObject *py_sid_index;
5491 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
5492 0 : return py_sid_index;
5493 : }
5494 :
5495 0 : static int py_lsa_TranslatedName_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
5496 : {
5497 0 : struct lsa_TranslatedName *object = (struct lsa_TranslatedName *)pytalloc_get_ptr(py_obj);
5498 0 : if (value == NULL) {
5499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
5500 0 : return -1;
5501 : }
5502 : {
5503 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
5504 0 : if (PyLong_Check(value)) {
5505 0 : unsigned long long test_var;
5506 0 : test_var = PyLong_AsUnsignedLongLong(value);
5507 0 : if (PyErr_Occurred() != NULL) {
5508 0 : return -1;
5509 : }
5510 0 : if (test_var > uint_max) {
5511 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5512 : PyLong_Type.tp_name, uint_max, test_var);
5513 0 : return -1;
5514 : }
5515 0 : object->sid_index = test_var;
5516 : } else {
5517 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5518 : PyLong_Type.tp_name);
5519 0 : return -1;
5520 : }
5521 : }
5522 0 : return 0;
5523 : }
5524 :
5525 : static PyGetSetDef py_lsa_TranslatedName_getsetters[] = {
5526 : {
5527 : .name = discard_const_p(char, "sid_type"),
5528 : .get = py_lsa_TranslatedName_get_sid_type,
5529 : .set = py_lsa_TranslatedName_set_sid_type,
5530 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5531 : },
5532 : {
5533 : .name = discard_const_p(char, "name"),
5534 : .get = py_lsa_TranslatedName_get_name,
5535 : .set = py_lsa_TranslatedName_set_name,
5536 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5537 : },
5538 : {
5539 : .name = discard_const_p(char, "sid_index"),
5540 : .get = py_lsa_TranslatedName_get_sid_index,
5541 : .set = py_lsa_TranslatedName_set_sid_index,
5542 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5543 : },
5544 : { .name = NULL }
5545 : };
5546 :
5547 0 : static PyObject *py_lsa_TranslatedName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5548 : {
5549 0 : return pytalloc_new(struct lsa_TranslatedName, type);
5550 : }
5551 :
5552 :
5553 : static PyTypeObject lsa_TranslatedName_Type = {
5554 : PyVarObject_HEAD_INIT(NULL, 0)
5555 : .tp_name = "lsa.TranslatedName",
5556 : .tp_getset = py_lsa_TranslatedName_getsetters,
5557 : .tp_methods = NULL,
5558 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5559 : .tp_new = py_lsa_TranslatedName_new,
5560 : };
5561 :
5562 :
5563 0 : static PyObject *py_lsa_TransNameArray_get_count(PyObject *obj, void *closure)
5564 : {
5565 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
5566 0 : PyObject *py_count;
5567 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5568 0 : return py_count;
5569 : }
5570 :
5571 0 : static int py_lsa_TransNameArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5572 : {
5573 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5574 0 : if (value == NULL) {
5575 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5576 0 : return -1;
5577 : }
5578 : {
5579 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5580 0 : if (PyLong_Check(value)) {
5581 0 : unsigned long long test_var;
5582 0 : test_var = PyLong_AsUnsignedLongLong(value);
5583 0 : if (PyErr_Occurred() != NULL) {
5584 0 : return -1;
5585 : }
5586 0 : if (test_var > uint_max) {
5587 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5588 : PyLong_Type.tp_name, uint_max, test_var);
5589 0 : return -1;
5590 : }
5591 0 : object->count = test_var;
5592 : } else {
5593 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5594 : PyLong_Type.tp_name);
5595 0 : return -1;
5596 : }
5597 : }
5598 0 : return 0;
5599 : }
5600 :
5601 0 : static PyObject *py_lsa_TransNameArray_get_names(PyObject *obj, void *closure)
5602 : {
5603 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(obj);
5604 0 : PyObject *py_names;
5605 0 : if (object->names == NULL) {
5606 0 : Py_RETURN_NONE;
5607 : }
5608 0 : if (object->names == NULL) {
5609 0 : py_names = Py_None;
5610 0 : Py_INCREF(py_names);
5611 : } else {
5612 0 : py_names = PyList_New(object->count);
5613 0 : if (py_names == NULL) {
5614 0 : return NULL;
5615 : }
5616 : {
5617 : int names_cntr_1;
5618 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
5619 0 : PyObject *py_names_1;
5620 0 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName_Type, object->names, &object->names[names_cntr_1]);
5621 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
5622 : }
5623 : }
5624 : }
5625 0 : return py_names;
5626 : }
5627 :
5628 0 : static int py_lsa_TransNameArray_set_names(PyObject *py_obj, PyObject *value, void *closure)
5629 : {
5630 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5631 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
5632 0 : if (value == NULL) {
5633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
5634 0 : return -1;
5635 : }
5636 0 : if (value == Py_None) {
5637 0 : object->names = NULL;
5638 : } else {
5639 0 : object->names = NULL;
5640 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5641 : {
5642 0 : int names_cntr_1;
5643 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
5644 0 : if (!object->names) { return -1; }
5645 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
5646 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
5647 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
5648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
5649 0 : return -1;
5650 : }
5651 0 : PY_CHECK_TYPE(&lsa_TranslatedName_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
5652 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
5653 0 : PyErr_NoMemory();
5654 0 : return -1;
5655 : }
5656 0 : object->names[names_cntr_1] = *(struct lsa_TranslatedName *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
5657 : }
5658 : }
5659 : }
5660 0 : return 0;
5661 : }
5662 :
5663 : static PyGetSetDef py_lsa_TransNameArray_getsetters[] = {
5664 : {
5665 : .name = discard_const_p(char, "count"),
5666 : .get = py_lsa_TransNameArray_get_count,
5667 : .set = py_lsa_TransNameArray_set_count,
5668 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5669 : },
5670 : {
5671 : .name = discard_const_p(char, "names"),
5672 : .get = py_lsa_TransNameArray_get_names,
5673 : .set = py_lsa_TransNameArray_set_names,
5674 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName")
5675 : },
5676 : { .name = NULL }
5677 : };
5678 :
5679 1 : static PyObject *py_lsa_TransNameArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5680 : {
5681 1 : return pytalloc_new(struct lsa_TransNameArray, type);
5682 : }
5683 :
5684 0 : static PyObject *py_lsa_TransNameArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5685 : {
5686 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5687 0 : PyObject *ret = NULL;
5688 0 : DATA_BLOB blob;
5689 0 : enum ndr_err_code err;
5690 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5691 0 : if (tmp_ctx == NULL) {
5692 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5693 0 : return NULL;
5694 : }
5695 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TransNameArray);
5696 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5697 0 : TALLOC_FREE(tmp_ctx);
5698 0 : PyErr_SetNdrError(err);
5699 0 : return NULL;
5700 : }
5701 :
5702 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5703 0 : TALLOC_FREE(tmp_ctx);
5704 0 : return ret;
5705 : }
5706 :
5707 0 : static PyObject *py_lsa_TransNameArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5708 : {
5709 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5710 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5711 0 : Py_ssize_t blob_length = 0;
5712 0 : enum ndr_err_code err;
5713 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5714 0 : PyObject *allow_remaining_obj = NULL;
5715 0 : bool allow_remaining = false;
5716 :
5717 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5718 : discard_const_p(char *, kwnames),
5719 : &blob.data, &blob_length,
5720 : &allow_remaining_obj)) {
5721 0 : return NULL;
5722 : }
5723 0 : blob.length = blob_length;
5724 :
5725 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5726 0 : allow_remaining = true;
5727 : }
5728 :
5729 0 : if (allow_remaining) {
5730 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5731 : } else {
5732 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5733 : }
5734 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5735 0 : PyErr_SetNdrError(err);
5736 0 : return NULL;
5737 : }
5738 :
5739 0 : Py_RETURN_NONE;
5740 : }
5741 :
5742 0 : static PyObject *py_lsa_TransNameArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5743 : {
5744 0 : struct lsa_TransNameArray *object = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_obj);
5745 0 : PyObject *ret;
5746 0 : char *retstr;
5747 :
5748 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TransNameArray, "lsa_TransNameArray", object);
5749 0 : ret = PyUnicode_FromString(retstr);
5750 0 : talloc_free(retstr);
5751 :
5752 0 : return ret;
5753 : }
5754 :
5755 : static PyMethodDef py_lsa_TransNameArray_methods[] = {
5756 : { "__ndr_pack__", (PyCFunction)py_lsa_TransNameArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5757 : { "__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" },
5758 : { "__ndr_print__", (PyCFunction)py_lsa_TransNameArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5759 : { NULL, NULL, 0, NULL }
5760 : };
5761 :
5762 :
5763 : static PyTypeObject lsa_TransNameArray_Type = {
5764 : PyVarObject_HEAD_INIT(NULL, 0)
5765 : .tp_name = "lsa.TransNameArray",
5766 : .tp_getset = py_lsa_TransNameArray_getsetters,
5767 : .tp_methods = py_lsa_TransNameArray_methods,
5768 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5769 : .tp_new = py_lsa_TransNameArray_new,
5770 : };
5771 :
5772 :
5773 0 : static PyObject *py_lsa_LUIDAttribute_get_luid(PyObject *obj, void *closure)
5774 : {
5775 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5776 0 : PyObject *py_luid;
5777 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
5778 0 : return py_luid;
5779 : }
5780 :
5781 0 : static int py_lsa_LUIDAttribute_set_luid(PyObject *py_obj, PyObject *value, void *closure)
5782 : {
5783 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5784 0 : if (value == NULL) {
5785 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->luid");
5786 0 : return -1;
5787 : }
5788 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
5789 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5790 0 : PyErr_NoMemory();
5791 0 : return -1;
5792 : }
5793 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
5794 0 : return 0;
5795 : }
5796 :
5797 0 : static PyObject *py_lsa_LUIDAttribute_get_attribute(PyObject *obj, void *closure)
5798 : {
5799 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(obj);
5800 0 : PyObject *py_attribute;
5801 0 : py_attribute = PyLong_FromUnsignedLongLong((uint32_t)object->attribute);
5802 0 : return py_attribute;
5803 : }
5804 :
5805 0 : static int py_lsa_LUIDAttribute_set_attribute(PyObject *py_obj, PyObject *value, void *closure)
5806 : {
5807 0 : struct lsa_LUIDAttribute *object = (struct lsa_LUIDAttribute *)pytalloc_get_ptr(py_obj);
5808 0 : if (value == NULL) {
5809 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attribute");
5810 0 : return -1;
5811 : }
5812 : {
5813 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribute));
5814 0 : if (PyLong_Check(value)) {
5815 0 : unsigned long long test_var;
5816 0 : test_var = PyLong_AsUnsignedLongLong(value);
5817 0 : if (PyErr_Occurred() != NULL) {
5818 0 : return -1;
5819 : }
5820 0 : if (test_var > uint_max) {
5821 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5822 : PyLong_Type.tp_name, uint_max, test_var);
5823 0 : return -1;
5824 : }
5825 0 : object->attribute = test_var;
5826 : } else {
5827 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5828 : PyLong_Type.tp_name);
5829 0 : return -1;
5830 : }
5831 : }
5832 0 : return 0;
5833 : }
5834 :
5835 : static PyGetSetDef py_lsa_LUIDAttribute_getsetters[] = {
5836 : {
5837 : .name = discard_const_p(char, "luid"),
5838 : .get = py_lsa_LUIDAttribute_get_luid,
5839 : .set = py_lsa_LUIDAttribute_set_luid,
5840 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
5841 : },
5842 : {
5843 : .name = discard_const_p(char, "attribute"),
5844 : .get = py_lsa_LUIDAttribute_get_attribute,
5845 : .set = py_lsa_LUIDAttribute_set_attribute,
5846 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5847 : },
5848 : { .name = NULL }
5849 : };
5850 :
5851 0 : static PyObject *py_lsa_LUIDAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5852 : {
5853 0 : return pytalloc_new(struct lsa_LUIDAttribute, type);
5854 : }
5855 :
5856 :
5857 : static PyTypeObject lsa_LUIDAttribute_Type = {
5858 : PyVarObject_HEAD_INIT(NULL, 0)
5859 : .tp_name = "lsa.LUIDAttribute",
5860 : .tp_getset = py_lsa_LUIDAttribute_getsetters,
5861 : .tp_methods = NULL,
5862 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5863 : .tp_new = py_lsa_LUIDAttribute_new,
5864 : };
5865 :
5866 :
5867 0 : static PyObject *py_lsa_PrivilegeSet_get_count(PyObject *obj, void *closure)
5868 : {
5869 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5870 0 : PyObject *py_count;
5871 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
5872 0 : return py_count;
5873 : }
5874 :
5875 0 : static int py_lsa_PrivilegeSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
5876 : {
5877 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5878 0 : if (value == NULL) {
5879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
5880 0 : return -1;
5881 : }
5882 : {
5883 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5884 0 : if (PyLong_Check(value)) {
5885 0 : unsigned long long test_var;
5886 0 : test_var = PyLong_AsUnsignedLongLong(value);
5887 0 : if (PyErr_Occurred() != NULL) {
5888 0 : return -1;
5889 : }
5890 0 : if (test_var > uint_max) {
5891 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5892 : PyLong_Type.tp_name, uint_max, test_var);
5893 0 : return -1;
5894 : }
5895 0 : object->count = test_var;
5896 : } else {
5897 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5898 : PyLong_Type.tp_name);
5899 0 : return -1;
5900 : }
5901 : }
5902 0 : return 0;
5903 : }
5904 :
5905 0 : static PyObject *py_lsa_PrivilegeSet_get_unknown(PyObject *obj, void *closure)
5906 : {
5907 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5908 0 : PyObject *py_unknown;
5909 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
5910 0 : return py_unknown;
5911 : }
5912 :
5913 0 : static int py_lsa_PrivilegeSet_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
5914 : {
5915 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5916 0 : if (value == NULL) {
5917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
5918 0 : return -1;
5919 : }
5920 : {
5921 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
5922 0 : if (PyLong_Check(value)) {
5923 0 : unsigned long long test_var;
5924 0 : test_var = PyLong_AsUnsignedLongLong(value);
5925 0 : if (PyErr_Occurred() != NULL) {
5926 0 : return -1;
5927 : }
5928 0 : if (test_var > uint_max) {
5929 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5930 : PyLong_Type.tp_name, uint_max, test_var);
5931 0 : return -1;
5932 : }
5933 0 : object->unknown = test_var;
5934 : } else {
5935 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5936 : PyLong_Type.tp_name);
5937 0 : return -1;
5938 : }
5939 : }
5940 0 : return 0;
5941 : }
5942 :
5943 0 : static PyObject *py_lsa_PrivilegeSet_get_set(PyObject *obj, void *closure)
5944 : {
5945 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(obj);
5946 0 : PyObject *py_set;
5947 0 : py_set = PyList_New(object->count);
5948 0 : if (py_set == NULL) {
5949 0 : return NULL;
5950 : }
5951 : {
5952 : int set_cntr_0;
5953 0 : for (set_cntr_0 = 0; set_cntr_0 < (object->count); set_cntr_0++) {
5954 0 : PyObject *py_set_0;
5955 0 : py_set_0 = pytalloc_reference_ex(&lsa_LUIDAttribute_Type, object->set, &object->set[set_cntr_0]);
5956 0 : PyList_SetItem(py_set, set_cntr_0, py_set_0);
5957 : }
5958 : }
5959 0 : return py_set;
5960 : }
5961 :
5962 0 : static int py_lsa_PrivilegeSet_set_set(PyObject *py_obj, PyObject *value, void *closure)
5963 : {
5964 0 : struct lsa_PrivilegeSet *object = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_obj);
5965 0 : if (value == NULL) {
5966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->set");
5967 0 : return -1;
5968 : }
5969 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5970 : {
5971 0 : int set_cntr_0;
5972 0 : object->set = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->set, PyList_GET_SIZE(value));
5973 0 : if (!object->set) { return -1; }
5974 0 : talloc_set_name_const(object->set, "ARRAY: object->set");
5975 0 : for (set_cntr_0 = 0; set_cntr_0 < PyList_GET_SIZE(value); set_cntr_0++) {
5976 0 : if (PyList_GET_ITEM(value, set_cntr_0) == NULL) {
5977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->set[set_cntr_0]");
5978 0 : return -1;
5979 : }
5980 0 : PY_CHECK_TYPE(&lsa_LUIDAttribute_Type, PyList_GET_ITEM(value, set_cntr_0), return -1;);
5981 0 : if (talloc_reference(object->set, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, set_cntr_0))) == NULL) {
5982 0 : PyErr_NoMemory();
5983 0 : return -1;
5984 : }
5985 0 : object->set[set_cntr_0] = *(struct lsa_LUIDAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, set_cntr_0));
5986 : }
5987 : }
5988 0 : return 0;
5989 : }
5990 :
5991 : static PyGetSetDef py_lsa_PrivilegeSet_getsetters[] = {
5992 : {
5993 : .name = discard_const_p(char, "count"),
5994 : .get = py_lsa_PrivilegeSet_get_count,
5995 : .set = py_lsa_PrivilegeSet_set_count,
5996 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5997 : },
5998 : {
5999 : .name = discard_const_p(char, "unknown"),
6000 : .get = py_lsa_PrivilegeSet_get_unknown,
6001 : .set = py_lsa_PrivilegeSet_set_unknown,
6002 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6003 : },
6004 : {
6005 : .name = discard_const_p(char, "set"),
6006 : .get = py_lsa_PrivilegeSet_get_set,
6007 : .set = py_lsa_PrivilegeSet_set_set,
6008 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUIDAttribute")
6009 : },
6010 : { .name = NULL }
6011 : };
6012 :
6013 0 : static PyObject *py_lsa_PrivilegeSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6014 : {
6015 0 : return pytalloc_new(struct lsa_PrivilegeSet, type);
6016 : }
6017 :
6018 :
6019 : static PyTypeObject lsa_PrivilegeSet_Type = {
6020 : PyVarObject_HEAD_INIT(NULL, 0)
6021 : .tp_name = "lsa.PrivilegeSet",
6022 : .tp_getset = py_lsa_PrivilegeSet_getsetters,
6023 : .tp_methods = NULL,
6024 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6025 : .tp_new = py_lsa_PrivilegeSet_new,
6026 : };
6027 :
6028 :
6029 0 : static PyObject *py_lsa_DATA_BUF_get_length(PyObject *obj, void *closure)
6030 : {
6031 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6032 0 : PyObject *py_length;
6033 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
6034 0 : return py_length;
6035 : }
6036 :
6037 0 : static int py_lsa_DATA_BUF_set_length(PyObject *py_obj, PyObject *value, void *closure)
6038 : {
6039 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6040 0 : if (value == NULL) {
6041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
6042 0 : return -1;
6043 : }
6044 : {
6045 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
6046 0 : if (PyLong_Check(value)) {
6047 0 : unsigned long long test_var;
6048 0 : test_var = PyLong_AsUnsignedLongLong(value);
6049 0 : if (PyErr_Occurred() != NULL) {
6050 0 : return -1;
6051 : }
6052 0 : if (test_var > uint_max) {
6053 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6054 : PyLong_Type.tp_name, uint_max, test_var);
6055 0 : return -1;
6056 : }
6057 0 : object->length = test_var;
6058 : } else {
6059 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6060 : PyLong_Type.tp_name);
6061 0 : return -1;
6062 : }
6063 : }
6064 0 : return 0;
6065 : }
6066 :
6067 0 : static PyObject *py_lsa_DATA_BUF_get_size(PyObject *obj, void *closure)
6068 : {
6069 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6070 0 : PyObject *py_size;
6071 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
6072 0 : return py_size;
6073 : }
6074 :
6075 0 : static int py_lsa_DATA_BUF_set_size(PyObject *py_obj, PyObject *value, void *closure)
6076 : {
6077 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6078 0 : if (value == NULL) {
6079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
6080 0 : return -1;
6081 : }
6082 : {
6083 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6084 0 : if (PyLong_Check(value)) {
6085 0 : unsigned long long test_var;
6086 0 : test_var = PyLong_AsUnsignedLongLong(value);
6087 0 : if (PyErr_Occurred() != NULL) {
6088 0 : return -1;
6089 : }
6090 0 : if (test_var > uint_max) {
6091 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6092 : PyLong_Type.tp_name, uint_max, test_var);
6093 0 : return -1;
6094 : }
6095 0 : object->size = test_var;
6096 : } else {
6097 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6098 : PyLong_Type.tp_name);
6099 0 : return -1;
6100 : }
6101 : }
6102 0 : return 0;
6103 : }
6104 :
6105 0 : static PyObject *py_lsa_DATA_BUF_get_data(PyObject *obj, void *closure)
6106 : {
6107 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(obj);
6108 0 : PyObject *py_data;
6109 0 : if (object->data == NULL) {
6110 0 : Py_RETURN_NONE;
6111 : }
6112 0 : if (object->data == NULL) {
6113 0 : py_data = Py_None;
6114 0 : Py_INCREF(py_data);
6115 : } else {
6116 0 : py_data = PyList_New(object->length);
6117 0 : if (py_data == NULL) {
6118 0 : return NULL;
6119 : }
6120 : {
6121 : int data_cntr_1;
6122 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
6123 0 : PyObject *py_data_1;
6124 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
6125 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6126 : }
6127 : }
6128 : }
6129 0 : return py_data;
6130 : }
6131 :
6132 0 : static int py_lsa_DATA_BUF_set_data(PyObject *py_obj, PyObject *value, void *closure)
6133 : {
6134 0 : struct lsa_DATA_BUF *object = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_obj);
6135 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6136 0 : if (value == NULL) {
6137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
6138 0 : return -1;
6139 : }
6140 0 : if (value == Py_None) {
6141 0 : object->data = NULL;
6142 : } else {
6143 0 : object->data = NULL;
6144 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6145 : {
6146 0 : int data_cntr_1;
6147 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6148 0 : if (!object->data) { return -1; }
6149 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
6150 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6151 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
6153 0 : return -1;
6154 : }
6155 : {
6156 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
6157 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6158 0 : unsigned long long test_var;
6159 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6160 0 : if (PyErr_Occurred() != NULL) {
6161 0 : return -1;
6162 : }
6163 0 : if (test_var > uint_max) {
6164 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6165 : PyLong_Type.tp_name, uint_max, test_var);
6166 0 : return -1;
6167 : }
6168 0 : object->data[data_cntr_1] = test_var;
6169 : } else {
6170 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6171 : PyLong_Type.tp_name);
6172 0 : return -1;
6173 : }
6174 : }
6175 : }
6176 : }
6177 : }
6178 0 : return 0;
6179 : }
6180 :
6181 : static PyGetSetDef py_lsa_DATA_BUF_getsetters[] = {
6182 : {
6183 : .name = discard_const_p(char, "length"),
6184 : .get = py_lsa_DATA_BUF_get_length,
6185 : .set = py_lsa_DATA_BUF_set_length,
6186 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6187 : },
6188 : {
6189 : .name = discard_const_p(char, "size"),
6190 : .get = py_lsa_DATA_BUF_get_size,
6191 : .set = py_lsa_DATA_BUF_set_size,
6192 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6193 : },
6194 : {
6195 : .name = discard_const_p(char, "data"),
6196 : .get = py_lsa_DATA_BUF_get_data,
6197 : .set = py_lsa_DATA_BUF_set_data,
6198 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6199 : },
6200 : { .name = NULL }
6201 : };
6202 :
6203 0 : static PyObject *py_lsa_DATA_BUF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6204 : {
6205 0 : return pytalloc_new(struct lsa_DATA_BUF, type);
6206 : }
6207 :
6208 :
6209 : static PyTypeObject lsa_DATA_BUF_Type = {
6210 : PyVarObject_HEAD_INIT(NULL, 0)
6211 : .tp_name = "lsa.DATA_BUF",
6212 : .tp_getset = py_lsa_DATA_BUF_getsetters,
6213 : .tp_methods = NULL,
6214 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6215 : .tp_new = py_lsa_DATA_BUF_new,
6216 : };
6217 :
6218 :
6219 0 : static PyObject *py_lsa_DATA_BUF2_get_size(PyObject *obj, void *closure)
6220 : {
6221 0 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
6222 0 : PyObject *py_size;
6223 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)object->size);
6224 0 : return py_size;
6225 : }
6226 :
6227 23 : static int py_lsa_DATA_BUF2_set_size(PyObject *py_obj, PyObject *value, void *closure)
6228 : {
6229 23 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
6230 23 : if (value == NULL) {
6231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
6232 0 : return -1;
6233 : }
6234 : {
6235 23 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6236 23 : if (PyLong_Check(value)) {
6237 0 : unsigned long long test_var;
6238 23 : test_var = PyLong_AsUnsignedLongLong(value);
6239 23 : if (PyErr_Occurred() != NULL) {
6240 0 : return -1;
6241 : }
6242 23 : if (test_var > uint_max) {
6243 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6244 : PyLong_Type.tp_name, uint_max, test_var);
6245 0 : return -1;
6246 : }
6247 23 : object->size = test_var;
6248 : } else {
6249 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6250 : PyLong_Type.tp_name);
6251 0 : return -1;
6252 : }
6253 : }
6254 23 : return 0;
6255 : }
6256 :
6257 0 : static PyObject *py_lsa_DATA_BUF2_get_data(PyObject *obj, void *closure)
6258 : {
6259 0 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(obj);
6260 0 : PyObject *py_data;
6261 0 : if (object->data == NULL) {
6262 0 : Py_RETURN_NONE;
6263 : }
6264 0 : if (object->data == NULL) {
6265 0 : py_data = Py_None;
6266 0 : Py_INCREF(py_data);
6267 : } else {
6268 0 : py_data = PyList_New(object->size);
6269 0 : if (py_data == NULL) {
6270 0 : return NULL;
6271 : }
6272 : {
6273 : int data_cntr_1;
6274 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->size); data_cntr_1++) {
6275 0 : PyObject *py_data_1;
6276 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
6277 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6278 : }
6279 : }
6280 : }
6281 0 : return py_data;
6282 : }
6283 :
6284 23 : static int py_lsa_DATA_BUF2_set_data(PyObject *py_obj, PyObject *value, void *closure)
6285 : {
6286 23 : struct lsa_DATA_BUF2 *object = (struct lsa_DATA_BUF2 *)pytalloc_get_ptr(py_obj);
6287 23 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6288 23 : if (value == NULL) {
6289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
6290 0 : return -1;
6291 : }
6292 23 : if (value == Py_None) {
6293 0 : object->data = NULL;
6294 : } else {
6295 23 : object->data = NULL;
6296 23 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6297 : {
6298 0 : int data_cntr_1;
6299 23 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6300 23 : if (!object->data) { return -1; }
6301 23 : talloc_set_name_const(object->data, "ARRAY: object->data");
6302 22327 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6303 22304 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6304 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
6305 0 : return -1;
6306 : }
6307 : {
6308 22304 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
6309 22304 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6310 0 : unsigned long long test_var;
6311 22304 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6312 22304 : if (PyErr_Occurred() != NULL) {
6313 0 : return -1;
6314 : }
6315 22304 : if (test_var > uint_max) {
6316 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6317 : PyLong_Type.tp_name, uint_max, test_var);
6318 0 : return -1;
6319 : }
6320 22304 : object->data[data_cntr_1] = test_var;
6321 : } else {
6322 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6323 : PyLong_Type.tp_name);
6324 0 : return -1;
6325 : }
6326 : }
6327 : }
6328 : }
6329 : }
6330 23 : return 0;
6331 : }
6332 :
6333 : static PyGetSetDef py_lsa_DATA_BUF2_getsetters[] = {
6334 : {
6335 : .name = discard_const_p(char, "size"),
6336 : .get = py_lsa_DATA_BUF2_get_size,
6337 : .set = py_lsa_DATA_BUF2_set_size,
6338 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6339 : },
6340 : {
6341 : .name = discard_const_p(char, "data"),
6342 : .get = py_lsa_DATA_BUF2_get_data,
6343 : .set = py_lsa_DATA_BUF2_set_data,
6344 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6345 : },
6346 : { .name = NULL }
6347 : };
6348 :
6349 23 : static PyObject *py_lsa_DATA_BUF2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6350 : {
6351 23 : return pytalloc_new(struct lsa_DATA_BUF2, type);
6352 : }
6353 :
6354 :
6355 : static PyTypeObject lsa_DATA_BUF2_Type = {
6356 : PyVarObject_HEAD_INIT(NULL, 0)
6357 : .tp_name = "lsa.DATA_BUF2",
6358 : .tp_getset = py_lsa_DATA_BUF2_getsetters,
6359 : .tp_methods = NULL,
6360 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6361 : .tp_new = py_lsa_DATA_BUF2_new,
6362 : };
6363 :
6364 :
6365 0 : static PyObject *py_lsa_TrustDomainInfoName_get_netbios_name(PyObject *obj, void *closure)
6366 : {
6367 0 : struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(obj);
6368 0 : PyObject *py_netbios_name;
6369 0 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6370 0 : return py_netbios_name;
6371 : }
6372 :
6373 0 : static int py_lsa_TrustDomainInfoName_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6374 : {
6375 0 : struct lsa_TrustDomainInfoName *object = (struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(py_obj);
6376 0 : if (value == NULL) {
6377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6378 0 : return -1;
6379 : }
6380 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6381 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6382 0 : PyErr_NoMemory();
6383 0 : return -1;
6384 : }
6385 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6386 0 : return 0;
6387 : }
6388 :
6389 : static PyGetSetDef py_lsa_TrustDomainInfoName_getsetters[] = {
6390 : {
6391 : .name = discard_const_p(char, "netbios_name"),
6392 : .get = py_lsa_TrustDomainInfoName_get_netbios_name,
6393 : .set = py_lsa_TrustDomainInfoName_set_netbios_name,
6394 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6395 : },
6396 : { .name = NULL }
6397 : };
6398 :
6399 0 : static PyObject *py_lsa_TrustDomainInfoName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6400 : {
6401 0 : return pytalloc_new(struct lsa_TrustDomainInfoName, type);
6402 : }
6403 :
6404 :
6405 : static PyTypeObject lsa_TrustDomainInfoName_Type = {
6406 : PyVarObject_HEAD_INIT(NULL, 0)
6407 : .tp_name = "lsa.TrustDomainInfoName",
6408 : .tp_getset = py_lsa_TrustDomainInfoName_getsetters,
6409 : .tp_methods = NULL,
6410 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6411 : .tp_new = py_lsa_TrustDomainInfoName_new,
6412 : };
6413 :
6414 :
6415 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_entries(PyObject *obj, void *closure)
6416 : {
6417 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
6418 0 : PyObject *py_entries;
6419 0 : py_entries = PyLong_FromUnsignedLongLong((uint32_t)object->entries);
6420 0 : return py_entries;
6421 : }
6422 :
6423 0 : static int py_lsa_TrustDomainInfoControllers_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6424 : {
6425 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
6426 0 : if (value == NULL) {
6427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
6428 0 : return -1;
6429 : }
6430 : {
6431 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entries));
6432 0 : if (PyLong_Check(value)) {
6433 0 : unsigned long long test_var;
6434 0 : test_var = PyLong_AsUnsignedLongLong(value);
6435 0 : if (PyErr_Occurred() != NULL) {
6436 0 : return -1;
6437 : }
6438 0 : if (test_var > uint_max) {
6439 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6440 : PyLong_Type.tp_name, uint_max, test_var);
6441 0 : return -1;
6442 : }
6443 0 : object->entries = test_var;
6444 : } else {
6445 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6446 : PyLong_Type.tp_name);
6447 0 : return -1;
6448 : }
6449 : }
6450 0 : return 0;
6451 : }
6452 :
6453 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_netbios_names(PyObject *obj, void *closure)
6454 : {
6455 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(obj);
6456 0 : PyObject *py_netbios_names;
6457 0 : if (object->netbios_names == NULL) {
6458 0 : Py_RETURN_NONE;
6459 : }
6460 0 : if (object->netbios_names == NULL) {
6461 0 : py_netbios_names = Py_None;
6462 0 : Py_INCREF(py_netbios_names);
6463 : } else {
6464 0 : py_netbios_names = PyList_New(object->entries);
6465 0 : if (py_netbios_names == NULL) {
6466 0 : return NULL;
6467 : }
6468 : {
6469 : int netbios_names_cntr_1;
6470 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < (object->entries); netbios_names_cntr_1++) {
6471 0 : PyObject *py_netbios_names_1;
6472 0 : py_netbios_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->netbios_names, &object->netbios_names[netbios_names_cntr_1]);
6473 0 : PyList_SetItem(py_netbios_names, netbios_names_cntr_1, py_netbios_names_1);
6474 : }
6475 : }
6476 : }
6477 0 : return py_netbios_names;
6478 : }
6479 :
6480 0 : static int py_lsa_TrustDomainInfoControllers_set_netbios_names(PyObject *py_obj, PyObject *value, void *closure)
6481 : {
6482 0 : struct lsa_TrustDomainInfoControllers *object = (struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(py_obj);
6483 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->netbios_names));
6484 0 : if (value == NULL) {
6485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_names");
6486 0 : return -1;
6487 : }
6488 0 : if (value == Py_None) {
6489 0 : object->netbios_names = NULL;
6490 : } else {
6491 0 : object->netbios_names = NULL;
6492 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6493 : {
6494 0 : int netbios_names_cntr_1;
6495 0 : object->netbios_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->netbios_names, PyList_GET_SIZE(value));
6496 0 : if (!object->netbios_names) { return -1; }
6497 0 : talloc_set_name_const(object->netbios_names, "ARRAY: object->netbios_names");
6498 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < PyList_GET_SIZE(value); netbios_names_cntr_1++) {
6499 0 : if (PyList_GET_ITEM(value, netbios_names_cntr_1) == NULL) {
6500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_names[netbios_names_cntr_1]");
6501 0 : return -1;
6502 : }
6503 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, netbios_names_cntr_1), return -1;);
6504 0 : if (talloc_reference(object->netbios_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, netbios_names_cntr_1))) == NULL) {
6505 0 : PyErr_NoMemory();
6506 0 : return -1;
6507 : }
6508 0 : object->netbios_names[netbios_names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, netbios_names_cntr_1));
6509 : }
6510 : }
6511 : }
6512 0 : return 0;
6513 : }
6514 :
6515 : static PyGetSetDef py_lsa_TrustDomainInfoControllers_getsetters[] = {
6516 : {
6517 : .name = discard_const_p(char, "entries"),
6518 : .get = py_lsa_TrustDomainInfoControllers_get_entries,
6519 : .set = py_lsa_TrustDomainInfoControllers_set_entries,
6520 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6521 : },
6522 : {
6523 : .name = discard_const_p(char, "netbios_names"),
6524 : .get = py_lsa_TrustDomainInfoControllers_get_netbios_names,
6525 : .set = py_lsa_TrustDomainInfoControllers_set_netbios_names,
6526 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6527 : },
6528 : { .name = NULL }
6529 : };
6530 :
6531 0 : static PyObject *py_lsa_TrustDomainInfoControllers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6532 : {
6533 0 : return pytalloc_new(struct lsa_TrustDomainInfoControllers, type);
6534 : }
6535 :
6536 :
6537 : static PyTypeObject lsa_TrustDomainInfoControllers_Type = {
6538 : PyVarObject_HEAD_INIT(NULL, 0)
6539 : .tp_name = "lsa.TrustDomainInfoControllers",
6540 : .tp_getset = py_lsa_TrustDomainInfoControllers_getsetters,
6541 : .tp_methods = NULL,
6542 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6543 : .tp_new = py_lsa_TrustDomainInfoControllers_new,
6544 : };
6545 :
6546 :
6547 48 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_get_posix_offset(PyObject *obj, void *closure)
6548 : {
6549 48 : struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(obj);
6550 0 : PyObject *py_posix_offset;
6551 48 : py_posix_offset = PyLong_FromUnsignedLongLong((uint32_t)object->posix_offset);
6552 48 : return py_posix_offset;
6553 : }
6554 :
6555 0 : static int py_lsa_TrustDomainInfoPosixOffset_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
6556 : {
6557 0 : struct lsa_TrustDomainInfoPosixOffset *object = (struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(py_obj);
6558 0 : if (value == NULL) {
6559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
6560 0 : return -1;
6561 : }
6562 : {
6563 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset));
6564 0 : if (PyLong_Check(value)) {
6565 0 : unsigned long long test_var;
6566 0 : test_var = PyLong_AsUnsignedLongLong(value);
6567 0 : if (PyErr_Occurred() != NULL) {
6568 0 : return -1;
6569 : }
6570 0 : if (test_var > uint_max) {
6571 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6572 : PyLong_Type.tp_name, uint_max, test_var);
6573 0 : return -1;
6574 : }
6575 0 : object->posix_offset = test_var;
6576 : } else {
6577 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6578 : PyLong_Type.tp_name);
6579 0 : return -1;
6580 : }
6581 : }
6582 0 : return 0;
6583 : }
6584 :
6585 : static PyGetSetDef py_lsa_TrustDomainInfoPosixOffset_getsetters[] = {
6586 : {
6587 : .name = discard_const_p(char, "posix_offset"),
6588 : .get = py_lsa_TrustDomainInfoPosixOffset_get_posix_offset,
6589 : .set = py_lsa_TrustDomainInfoPosixOffset_set_posix_offset,
6590 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6591 : },
6592 : { .name = NULL }
6593 : };
6594 :
6595 0 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6596 : {
6597 0 : return pytalloc_new(struct lsa_TrustDomainInfoPosixOffset, type);
6598 : }
6599 :
6600 :
6601 : static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type = {
6602 : PyVarObject_HEAD_INIT(NULL, 0)
6603 : .tp_name = "lsa.TrustDomainInfoPosixOffset",
6604 : .tp_getset = py_lsa_TrustDomainInfoPosixOffset_getsetters,
6605 : .tp_methods = NULL,
6606 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6607 : .tp_new = py_lsa_TrustDomainInfoPosixOffset_new,
6608 : };
6609 :
6610 :
6611 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_password(PyObject *obj, void *closure)
6612 : {
6613 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
6614 0 : PyObject *py_password;
6615 0 : if (object->password == NULL) {
6616 0 : Py_RETURN_NONE;
6617 : }
6618 0 : if (object->password == NULL) {
6619 0 : py_password = Py_None;
6620 0 : Py_INCREF(py_password);
6621 : } else {
6622 0 : py_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->password, object->password);
6623 : }
6624 0 : return py_password;
6625 : }
6626 :
6627 0 : static int py_lsa_TrustDomainInfoPassword_set_password(PyObject *py_obj, PyObject *value, void *closure)
6628 : {
6629 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
6630 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->password));
6631 0 : if (value == NULL) {
6632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
6633 0 : return -1;
6634 : }
6635 0 : if (value == Py_None) {
6636 0 : object->password = NULL;
6637 : } else {
6638 0 : object->password = NULL;
6639 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6640 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6641 0 : PyErr_NoMemory();
6642 0 : return -1;
6643 : }
6644 0 : object->password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6645 : }
6646 0 : return 0;
6647 : }
6648 :
6649 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_old_password(PyObject *obj, void *closure)
6650 : {
6651 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(obj);
6652 0 : PyObject *py_old_password;
6653 0 : if (object->old_password == NULL) {
6654 0 : Py_RETURN_NONE;
6655 : }
6656 0 : if (object->old_password == NULL) {
6657 0 : py_old_password = Py_None;
6658 0 : Py_INCREF(py_old_password);
6659 : } else {
6660 0 : py_old_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->old_password, object->old_password);
6661 : }
6662 0 : return py_old_password;
6663 : }
6664 :
6665 0 : static int py_lsa_TrustDomainInfoPassword_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
6666 : {
6667 0 : struct lsa_TrustDomainInfoPassword *object = (struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(py_obj);
6668 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->old_password));
6669 0 : if (value == NULL) {
6670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->old_password");
6671 0 : return -1;
6672 : }
6673 0 : if (value == Py_None) {
6674 0 : object->old_password = NULL;
6675 : } else {
6676 0 : object->old_password = NULL;
6677 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6678 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6679 0 : PyErr_NoMemory();
6680 0 : return -1;
6681 : }
6682 0 : object->old_password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6683 : }
6684 0 : return 0;
6685 : }
6686 :
6687 : static PyGetSetDef py_lsa_TrustDomainInfoPassword_getsetters[] = {
6688 : {
6689 : .name = discard_const_p(char, "password"),
6690 : .get = py_lsa_TrustDomainInfoPassword_get_password,
6691 : .set = py_lsa_TrustDomainInfoPassword_set_password,
6692 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6693 : },
6694 : {
6695 : .name = discard_const_p(char, "old_password"),
6696 : .get = py_lsa_TrustDomainInfoPassword_get_old_password,
6697 : .set = py_lsa_TrustDomainInfoPassword_set_old_password,
6698 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6699 : },
6700 : { .name = NULL }
6701 : };
6702 :
6703 0 : static PyObject *py_lsa_TrustDomainInfoPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6704 : {
6705 0 : return pytalloc_new(struct lsa_TrustDomainInfoPassword, type);
6706 : }
6707 :
6708 :
6709 : static PyTypeObject lsa_TrustDomainInfoPassword_Type = {
6710 : PyVarObject_HEAD_INIT(NULL, 0)
6711 : .tp_name = "lsa.TrustDomainInfoPassword",
6712 : .tp_getset = py_lsa_TrustDomainInfoPassword_getsetters,
6713 : .tp_methods = NULL,
6714 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6715 : .tp_new = py_lsa_TrustDomainInfoPassword_new,
6716 : };
6717 :
6718 :
6719 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_netbios_name(PyObject *obj, void *closure)
6720 : {
6721 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
6722 0 : PyObject *py_netbios_name;
6723 0 : py_netbios_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6724 0 : return py_netbios_name;
6725 : }
6726 :
6727 0 : static int py_lsa_TrustDomainInfoBasic_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6728 : {
6729 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
6730 0 : if (value == NULL) {
6731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6732 0 : return -1;
6733 : }
6734 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
6735 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6736 0 : PyErr_NoMemory();
6737 0 : return -1;
6738 : }
6739 0 : object->netbios_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6740 0 : return 0;
6741 : }
6742 :
6743 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_sid(PyObject *obj, void *closure)
6744 : {
6745 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(obj);
6746 0 : PyObject *py_sid;
6747 0 : if (object->sid == NULL) {
6748 0 : Py_RETURN_NONE;
6749 : }
6750 0 : if (object->sid == NULL) {
6751 0 : py_sid = Py_None;
6752 0 : Py_INCREF(py_sid);
6753 : } else {
6754 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6755 : }
6756 0 : return py_sid;
6757 : }
6758 :
6759 0 : static int py_lsa_TrustDomainInfoBasic_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6760 : {
6761 0 : struct lsa_TrustDomainInfoBasic *object = (struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(py_obj);
6762 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6763 0 : if (value == NULL) {
6764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6765 0 : return -1;
6766 : }
6767 0 : if (value == Py_None) {
6768 0 : object->sid = NULL;
6769 : } else {
6770 0 : object->sid = NULL;
6771 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6772 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6773 0 : PyErr_NoMemory();
6774 0 : return -1;
6775 : }
6776 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6777 : }
6778 0 : return 0;
6779 : }
6780 :
6781 : static PyGetSetDef py_lsa_TrustDomainInfoBasic_getsetters[] = {
6782 : {
6783 : .name = discard_const_p(char, "netbios_name"),
6784 : .get = py_lsa_TrustDomainInfoBasic_get_netbios_name,
6785 : .set = py_lsa_TrustDomainInfoBasic_set_netbios_name,
6786 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6787 : },
6788 : {
6789 : .name = discard_const_p(char, "sid"),
6790 : .get = py_lsa_TrustDomainInfoBasic_get_sid,
6791 : .set = py_lsa_TrustDomainInfoBasic_set_sid,
6792 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
6793 : },
6794 : { .name = NULL }
6795 : };
6796 :
6797 0 : static PyObject *py_lsa_TrustDomainInfoBasic_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6798 : {
6799 0 : return pytalloc_new(struct lsa_TrustDomainInfoBasic, type);
6800 : }
6801 :
6802 :
6803 : static PyTypeObject lsa_TrustDomainInfoBasic_Type = {
6804 : PyVarObject_HEAD_INIT(NULL, 0)
6805 : .tp_name = "lsa.TrustDomainInfoBasic",
6806 : .tp_getset = py_lsa_TrustDomainInfoBasic_getsetters,
6807 : .tp_methods = NULL,
6808 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6809 : .tp_new = py_lsa_TrustDomainInfoBasic_new,
6810 : };
6811 :
6812 :
6813 606 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_domain_name(PyObject *obj, void *closure)
6814 : {
6815 606 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6816 0 : PyObject *py_domain_name;
6817 606 : py_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
6818 606 : return py_domain_name;
6819 : }
6820 :
6821 0 : static int py_lsa_TrustDomainInfoInfoEx_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
6822 : {
6823 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6824 0 : if (value == NULL) {
6825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
6826 0 : return -1;
6827 : }
6828 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6829 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6830 0 : PyErr_NoMemory();
6831 0 : return -1;
6832 : }
6833 0 : object->domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6834 0 : return 0;
6835 : }
6836 :
6837 190 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_netbios_name(PyObject *obj, void *closure)
6838 : {
6839 190 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6840 0 : PyObject *py_netbios_name;
6841 190 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6842 190 : return py_netbios_name;
6843 : }
6844 :
6845 0 : static int py_lsa_TrustDomainInfoInfoEx_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6846 : {
6847 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6848 0 : if (value == NULL) {
6849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_name");
6850 0 : return -1;
6851 : }
6852 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6853 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6854 0 : PyErr_NoMemory();
6855 0 : return -1;
6856 : }
6857 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6858 0 : return 0;
6859 : }
6860 :
6861 121 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_sid(PyObject *obj, void *closure)
6862 : {
6863 121 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6864 0 : PyObject *py_sid;
6865 121 : if (object->sid == NULL) {
6866 0 : Py_RETURN_NONE;
6867 : }
6868 121 : if (object->sid == NULL) {
6869 0 : py_sid = Py_None;
6870 0 : Py_INCREF(py_sid);
6871 : } else {
6872 121 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6873 : }
6874 121 : return py_sid;
6875 : }
6876 :
6877 24 : static int py_lsa_TrustDomainInfoInfoEx_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6878 : {
6879 24 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6880 24 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6881 24 : if (value == NULL) {
6882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
6883 0 : return -1;
6884 : }
6885 24 : if (value == Py_None) {
6886 0 : object->sid = NULL;
6887 : } else {
6888 24 : object->sid = NULL;
6889 24 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6890 24 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6891 0 : PyErr_NoMemory();
6892 0 : return -1;
6893 : }
6894 24 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6895 : }
6896 24 : return 0;
6897 : }
6898 :
6899 106 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_direction(PyObject *obj, void *closure)
6900 : {
6901 106 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6902 0 : PyObject *py_trust_direction;
6903 106 : py_trust_direction = PyLong_FromUnsignedLongLong((uint32_t)object->trust_direction);
6904 106 : return py_trust_direction;
6905 : }
6906 :
6907 62 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_direction(PyObject *py_obj, PyObject *value, void *closure)
6908 : {
6909 62 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6910 62 : if (value == NULL) {
6911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_direction");
6912 0 : return -1;
6913 : }
6914 : {
6915 62 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_direction));
6916 62 : if (PyLong_Check(value)) {
6917 0 : unsigned long long test_var;
6918 62 : test_var = PyLong_AsUnsignedLongLong(value);
6919 62 : if (PyErr_Occurred() != NULL) {
6920 0 : return -1;
6921 : }
6922 62 : if (test_var > uint_max) {
6923 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6924 : PyLong_Type.tp_name, uint_max, test_var);
6925 0 : return -1;
6926 : }
6927 62 : object->trust_direction = test_var;
6928 : } else {
6929 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6930 : PyLong_Type.tp_name);
6931 0 : return -1;
6932 : }
6933 : }
6934 62 : return 0;
6935 : }
6936 :
6937 24 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_type(PyObject *obj, void *closure)
6938 : {
6939 24 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6940 0 : PyObject *py_trust_type;
6941 24 : py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)object->trust_type);
6942 24 : return py_trust_type;
6943 : }
6944 :
6945 24 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
6946 : {
6947 24 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6948 24 : if (value == NULL) {
6949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_type");
6950 0 : return -1;
6951 : }
6952 : {
6953 24 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
6954 24 : if (PyLong_Check(value)) {
6955 0 : unsigned long long test_var;
6956 24 : test_var = PyLong_AsUnsignedLongLong(value);
6957 24 : if (PyErr_Occurred() != NULL) {
6958 0 : return -1;
6959 : }
6960 24 : if (test_var > uint_max) {
6961 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6962 : PyLong_Type.tp_name, uint_max, test_var);
6963 0 : return -1;
6964 : }
6965 24 : object->trust_type = test_var;
6966 : } else {
6967 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6968 : PyLong_Type.tp_name);
6969 0 : return -1;
6970 : }
6971 : }
6972 24 : return 0;
6973 : }
6974 :
6975 177 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_attributes(PyObject *obj, void *closure)
6976 : {
6977 177 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(obj);
6978 0 : PyObject *py_trust_attributes;
6979 177 : py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->trust_attributes);
6980 177 : return py_trust_attributes;
6981 : }
6982 :
6983 46 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
6984 : {
6985 46 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
6986 46 : if (value == NULL) {
6987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->trust_attributes");
6988 0 : return -1;
6989 : }
6990 : {
6991 46 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
6992 46 : if (PyLong_Check(value)) {
6993 0 : unsigned long long test_var;
6994 46 : test_var = PyLong_AsUnsignedLongLong(value);
6995 46 : if (PyErr_Occurred() != NULL) {
6996 0 : return -1;
6997 : }
6998 46 : if (test_var > uint_max) {
6999 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7000 : PyLong_Type.tp_name, uint_max, test_var);
7001 0 : return -1;
7002 : }
7003 46 : object->trust_attributes = test_var;
7004 : } else {
7005 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7006 : PyLong_Type.tp_name);
7007 0 : return -1;
7008 : }
7009 : }
7010 46 : return 0;
7011 : }
7012 :
7013 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx_getsetters[] = {
7014 : {
7015 : .name = discard_const_p(char, "domain_name"),
7016 : .get = py_lsa_TrustDomainInfoInfoEx_get_domain_name,
7017 : .set = py_lsa_TrustDomainInfoInfoEx_set_domain_name,
7018 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7019 : },
7020 : {
7021 : .name = discard_const_p(char, "netbios_name"),
7022 : .get = py_lsa_TrustDomainInfoInfoEx_get_netbios_name,
7023 : .set = py_lsa_TrustDomainInfoInfoEx_set_netbios_name,
7024 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7025 : },
7026 : {
7027 : .name = discard_const_p(char, "sid"),
7028 : .get = py_lsa_TrustDomainInfoInfoEx_get_sid,
7029 : .set = py_lsa_TrustDomainInfoInfoEx_set_sid,
7030 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
7031 : },
7032 : {
7033 : .name = discard_const_p(char, "trust_direction"),
7034 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_direction,
7035 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_direction,
7036 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDirection")
7037 : },
7038 : {
7039 : .name = discard_const_p(char, "trust_type"),
7040 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_type,
7041 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_type,
7042 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType")
7043 : },
7044 : {
7045 : .name = discard_const_p(char, "trust_attributes"),
7046 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_attributes,
7047 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_attributes,
7048 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes")
7049 : },
7050 : { .name = NULL }
7051 : };
7052 :
7053 24 : static PyObject *py_lsa_TrustDomainInfoInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7054 : {
7055 24 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx, type);
7056 : }
7057 :
7058 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7059 : {
7060 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7061 0 : PyObject *ret = NULL;
7062 0 : DATA_BLOB blob;
7063 0 : enum ndr_err_code err;
7064 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7065 0 : if (tmp_ctx == NULL) {
7066 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7067 0 : return NULL;
7068 : }
7069 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoInfoEx);
7070 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7071 0 : TALLOC_FREE(tmp_ctx);
7072 0 : PyErr_SetNdrError(err);
7073 0 : return NULL;
7074 : }
7075 :
7076 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7077 0 : TALLOC_FREE(tmp_ctx);
7078 0 : return ret;
7079 : }
7080 :
7081 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7082 : {
7083 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7084 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7085 0 : Py_ssize_t blob_length = 0;
7086 0 : enum ndr_err_code err;
7087 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7088 0 : PyObject *allow_remaining_obj = NULL;
7089 0 : bool allow_remaining = false;
7090 :
7091 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7092 : discard_const_p(char *, kwnames),
7093 : &blob.data, &blob_length,
7094 : &allow_remaining_obj)) {
7095 0 : return NULL;
7096 : }
7097 0 : blob.length = blob_length;
7098 :
7099 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7100 0 : allow_remaining = true;
7101 : }
7102 :
7103 0 : if (allow_remaining) {
7104 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7105 : } else {
7106 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7107 : }
7108 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7109 0 : PyErr_SetNdrError(err);
7110 0 : return NULL;
7111 : }
7112 :
7113 0 : Py_RETURN_NONE;
7114 : }
7115 :
7116 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7117 : {
7118 0 : struct lsa_TrustDomainInfoInfoEx *object = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_obj);
7119 0 : PyObject *ret;
7120 0 : char *retstr;
7121 :
7122 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoInfoEx, "lsa_TrustDomainInfoInfoEx", object);
7123 0 : ret = PyUnicode_FromString(retstr);
7124 0 : talloc_free(retstr);
7125 :
7126 0 : return ret;
7127 : }
7128 :
7129 : static PyMethodDef py_lsa_TrustDomainInfoInfoEx_methods[] = {
7130 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7131 : { "__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" },
7132 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7133 : { NULL, NULL, 0, NULL }
7134 : };
7135 :
7136 :
7137 : static PyTypeObject lsa_TrustDomainInfoInfoEx_Type = {
7138 : PyVarObject_HEAD_INIT(NULL, 0)
7139 : .tp_name = "lsa.TrustDomainInfoInfoEx",
7140 : .tp_getset = py_lsa_TrustDomainInfoInfoEx_getsetters,
7141 : .tp_methods = py_lsa_TrustDomainInfoInfoEx_methods,
7142 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7143 : .tp_new = py_lsa_TrustDomainInfoInfoEx_new,
7144 : };
7145 :
7146 :
7147 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_last_update_time(PyObject *obj, void *closure)
7148 : {
7149 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7150 0 : PyObject *py_last_update_time;
7151 0 : py_last_update_time = PyLong_FromUnsignedLongLong(object->last_update_time);
7152 0 : return py_last_update_time;
7153 : }
7154 :
7155 0 : static int py_lsa_TrustDomainInfoBuffer_set_last_update_time(PyObject *py_obj, PyObject *value, void *closure)
7156 : {
7157 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7158 0 : if (value == NULL) {
7159 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_update_time");
7160 0 : return -1;
7161 : }
7162 : {
7163 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_update_time));
7164 0 : if (PyLong_Check(value)) {
7165 0 : unsigned long long test_var;
7166 0 : test_var = PyLong_AsUnsignedLongLong(value);
7167 0 : if (PyErr_Occurred() != NULL) {
7168 0 : return -1;
7169 : }
7170 0 : if (test_var > uint_max) {
7171 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7172 : PyLong_Type.tp_name, uint_max, test_var);
7173 0 : return -1;
7174 : }
7175 0 : object->last_update_time = test_var;
7176 : } else {
7177 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7178 : PyLong_Type.tp_name);
7179 0 : return -1;
7180 : }
7181 : }
7182 0 : return 0;
7183 : }
7184 :
7185 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_AuthType(PyObject *obj, void *closure)
7186 : {
7187 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7188 0 : PyObject *py_AuthType;
7189 0 : py_AuthType = PyLong_FromUnsignedLongLong((uint32_t)object->AuthType);
7190 0 : return py_AuthType;
7191 : }
7192 :
7193 0 : static int py_lsa_TrustDomainInfoBuffer_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
7194 : {
7195 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7196 0 : if (value == NULL) {
7197 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->AuthType");
7198 0 : return -1;
7199 : }
7200 : {
7201 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AuthType));
7202 0 : if (PyLong_Check(value)) {
7203 0 : unsigned long long test_var;
7204 0 : test_var = PyLong_AsUnsignedLongLong(value);
7205 0 : if (PyErr_Occurred() != NULL) {
7206 0 : return -1;
7207 : }
7208 0 : if (test_var > uint_max) {
7209 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7210 : PyLong_Type.tp_name, uint_max, test_var);
7211 0 : return -1;
7212 : }
7213 0 : object->AuthType = test_var;
7214 : } else {
7215 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7216 : PyLong_Type.tp_name);
7217 0 : return -1;
7218 : }
7219 : }
7220 0 : return 0;
7221 : }
7222 :
7223 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_data(PyObject *obj, void *closure)
7224 : {
7225 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(obj);
7226 0 : PyObject *py_data;
7227 0 : py_data = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->data);
7228 0 : return py_data;
7229 : }
7230 :
7231 0 : static int py_lsa_TrustDomainInfoBuffer_set_data(PyObject *py_obj, PyObject *value, void *closure)
7232 : {
7233 0 : struct lsa_TrustDomainInfoBuffer *object = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(py_obj);
7234 0 : if (value == NULL) {
7235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
7236 0 : return -1;
7237 : }
7238 0 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7239 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7240 0 : PyErr_NoMemory();
7241 0 : return -1;
7242 : }
7243 0 : object->data = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7244 0 : return 0;
7245 : }
7246 :
7247 : static PyGetSetDef py_lsa_TrustDomainInfoBuffer_getsetters[] = {
7248 : {
7249 : .name = discard_const_p(char, "last_update_time"),
7250 : .get = py_lsa_TrustDomainInfoBuffer_get_last_update_time,
7251 : .set = py_lsa_TrustDomainInfoBuffer_set_last_update_time,
7252 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
7253 : },
7254 : {
7255 : .name = discard_const_p(char, "AuthType"),
7256 : .get = py_lsa_TrustDomainInfoBuffer_get_AuthType,
7257 : .set = py_lsa_TrustDomainInfoBuffer_set_AuthType,
7258 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAuthType")
7259 : },
7260 : {
7261 : .name = discard_const_p(char, "data"),
7262 : .get = py_lsa_TrustDomainInfoBuffer_get_data,
7263 : .set = py_lsa_TrustDomainInfoBuffer_set_data,
7264 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7265 : },
7266 : { .name = NULL }
7267 : };
7268 :
7269 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7270 : {
7271 0 : return pytalloc_new(struct lsa_TrustDomainInfoBuffer, type);
7272 : }
7273 :
7274 :
7275 : static PyTypeObject lsa_TrustDomainInfoBuffer_Type = {
7276 : PyVarObject_HEAD_INIT(NULL, 0)
7277 : .tp_name = "lsa.TrustDomainInfoBuffer",
7278 : .tp_getset = py_lsa_TrustDomainInfoBuffer_getsetters,
7279 : .tp_methods = NULL,
7280 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7281 : .tp_new = py_lsa_TrustDomainInfoBuffer_new,
7282 : };
7283 :
7284 :
7285 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_count(PyObject *obj, void *closure)
7286 : {
7287 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7288 0 : PyObject *py_incoming_count;
7289 0 : py_incoming_count = PyLong_FromUnsignedLongLong((uint32_t)object->incoming_count);
7290 0 : return py_incoming_count;
7291 : }
7292 :
7293 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_count(PyObject *py_obj, PyObject *value, void *closure)
7294 : {
7295 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7296 0 : if (value == NULL) {
7297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_count");
7298 0 : return -1;
7299 : }
7300 : {
7301 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->incoming_count));
7302 0 : if (PyLong_Check(value)) {
7303 0 : unsigned long long test_var;
7304 0 : test_var = PyLong_AsUnsignedLongLong(value);
7305 0 : if (PyErr_Occurred() != NULL) {
7306 0 : return -1;
7307 : }
7308 0 : if (test_var > uint_max) {
7309 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7310 : PyLong_Type.tp_name, uint_max, test_var);
7311 0 : return -1;
7312 : }
7313 0 : object->incoming_count = test_var;
7314 : } else {
7315 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7316 : PyLong_Type.tp_name);
7317 0 : return -1;
7318 : }
7319 : }
7320 0 : return 0;
7321 : }
7322 :
7323 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info(PyObject *obj, void *closure)
7324 : {
7325 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7326 0 : PyObject *py_incoming_current_auth_info;
7327 0 : if (object->incoming_current_auth_info == NULL) {
7328 0 : Py_RETURN_NONE;
7329 : }
7330 0 : if (object->incoming_current_auth_info == NULL) {
7331 0 : py_incoming_current_auth_info = Py_None;
7332 0 : Py_INCREF(py_incoming_current_auth_info);
7333 : } else {
7334 0 : py_incoming_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_current_auth_info, object->incoming_current_auth_info);
7335 : }
7336 0 : return py_incoming_current_auth_info;
7337 : }
7338 :
7339 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7340 : {
7341 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7342 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_current_auth_info));
7343 0 : if (value == NULL) {
7344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_current_auth_info");
7345 0 : return -1;
7346 : }
7347 0 : if (value == Py_None) {
7348 0 : object->incoming_current_auth_info = NULL;
7349 : } else {
7350 0 : object->incoming_current_auth_info = NULL;
7351 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7352 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7353 0 : PyErr_NoMemory();
7354 0 : return -1;
7355 : }
7356 0 : object->incoming_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7357 : }
7358 0 : return 0;
7359 : }
7360 :
7361 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info(PyObject *obj, void *closure)
7362 : {
7363 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7364 0 : PyObject *py_incoming_previous_auth_info;
7365 0 : if (object->incoming_previous_auth_info == NULL) {
7366 0 : Py_RETURN_NONE;
7367 : }
7368 0 : if (object->incoming_previous_auth_info == NULL) {
7369 0 : py_incoming_previous_auth_info = Py_None;
7370 0 : Py_INCREF(py_incoming_previous_auth_info);
7371 : } else {
7372 0 : py_incoming_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_previous_auth_info, object->incoming_previous_auth_info);
7373 : }
7374 0 : return py_incoming_previous_auth_info;
7375 : }
7376 :
7377 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7378 : {
7379 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7380 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_previous_auth_info));
7381 0 : if (value == NULL) {
7382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->incoming_previous_auth_info");
7383 0 : return -1;
7384 : }
7385 0 : if (value == Py_None) {
7386 0 : object->incoming_previous_auth_info = NULL;
7387 : } else {
7388 0 : object->incoming_previous_auth_info = NULL;
7389 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7390 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7391 0 : PyErr_NoMemory();
7392 0 : return -1;
7393 : }
7394 0 : object->incoming_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7395 : }
7396 0 : return 0;
7397 : }
7398 :
7399 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count(PyObject *obj, void *closure)
7400 : {
7401 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7402 0 : PyObject *py_outgoing_count;
7403 0 : py_outgoing_count = PyLong_FromUnsignedLongLong((uint32_t)object->outgoing_count);
7404 0 : return py_outgoing_count;
7405 : }
7406 :
7407 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count(PyObject *py_obj, PyObject *value, void *closure)
7408 : {
7409 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7410 0 : if (value == NULL) {
7411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_count");
7412 0 : return -1;
7413 : }
7414 : {
7415 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->outgoing_count));
7416 0 : if (PyLong_Check(value)) {
7417 0 : unsigned long long test_var;
7418 0 : test_var = PyLong_AsUnsignedLongLong(value);
7419 0 : if (PyErr_Occurred() != NULL) {
7420 0 : return -1;
7421 : }
7422 0 : if (test_var > uint_max) {
7423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7424 : PyLong_Type.tp_name, uint_max, test_var);
7425 0 : return -1;
7426 : }
7427 0 : object->outgoing_count = test_var;
7428 : } else {
7429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7430 : PyLong_Type.tp_name);
7431 0 : return -1;
7432 : }
7433 : }
7434 0 : return 0;
7435 : }
7436 :
7437 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info(PyObject *obj, void *closure)
7438 : {
7439 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7440 0 : PyObject *py_outgoing_current_auth_info;
7441 0 : if (object->outgoing_current_auth_info == NULL) {
7442 0 : Py_RETURN_NONE;
7443 : }
7444 0 : if (object->outgoing_current_auth_info == NULL) {
7445 0 : py_outgoing_current_auth_info = Py_None;
7446 0 : Py_INCREF(py_outgoing_current_auth_info);
7447 : } else {
7448 0 : py_outgoing_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_current_auth_info, object->outgoing_current_auth_info);
7449 : }
7450 0 : return py_outgoing_current_auth_info;
7451 : }
7452 :
7453 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7454 : {
7455 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7456 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_current_auth_info));
7457 0 : if (value == NULL) {
7458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_current_auth_info");
7459 0 : return -1;
7460 : }
7461 0 : if (value == Py_None) {
7462 0 : object->outgoing_current_auth_info = NULL;
7463 : } else {
7464 0 : object->outgoing_current_auth_info = NULL;
7465 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7466 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7467 0 : PyErr_NoMemory();
7468 0 : return -1;
7469 : }
7470 0 : object->outgoing_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7471 : }
7472 0 : return 0;
7473 : }
7474 :
7475 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info(PyObject *obj, void *closure)
7476 : {
7477 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(obj);
7478 0 : PyObject *py_outgoing_previous_auth_info;
7479 0 : if (object->outgoing_previous_auth_info == NULL) {
7480 0 : Py_RETURN_NONE;
7481 : }
7482 0 : if (object->outgoing_previous_auth_info == NULL) {
7483 0 : py_outgoing_previous_auth_info = Py_None;
7484 0 : Py_INCREF(py_outgoing_previous_auth_info);
7485 : } else {
7486 0 : py_outgoing_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_previous_auth_info, object->outgoing_previous_auth_info);
7487 : }
7488 0 : return py_outgoing_previous_auth_info;
7489 : }
7490 :
7491 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7492 : {
7493 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7494 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_previous_auth_info));
7495 0 : if (value == NULL) {
7496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->outgoing_previous_auth_info");
7497 0 : return -1;
7498 : }
7499 0 : if (value == Py_None) {
7500 0 : object->outgoing_previous_auth_info = NULL;
7501 : } else {
7502 0 : object->outgoing_previous_auth_info = NULL;
7503 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7504 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7505 0 : PyErr_NoMemory();
7506 0 : return -1;
7507 : }
7508 0 : object->outgoing_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7509 : }
7510 0 : return 0;
7511 : }
7512 :
7513 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfo_getsetters[] = {
7514 : {
7515 : .name = discard_const_p(char, "incoming_count"),
7516 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_count,
7517 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_count,
7518 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7519 : },
7520 : {
7521 : .name = discard_const_p(char, "incoming_current_auth_info"),
7522 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info,
7523 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info,
7524 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7525 : },
7526 : {
7527 : .name = discard_const_p(char, "incoming_previous_auth_info"),
7528 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info,
7529 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info,
7530 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7531 : },
7532 : {
7533 : .name = discard_const_p(char, "outgoing_count"),
7534 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count,
7535 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count,
7536 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7537 : },
7538 : {
7539 : .name = discard_const_p(char, "outgoing_current_auth_info"),
7540 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info,
7541 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info,
7542 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7543 : },
7544 : {
7545 : .name = discard_const_p(char, "outgoing_previous_auth_info"),
7546 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info,
7547 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info,
7548 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7549 : },
7550 : { .name = NULL }
7551 : };
7552 :
7553 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7554 : {
7555 0 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfo, type);
7556 : }
7557 :
7558 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7559 : {
7560 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7561 0 : PyObject *ret = NULL;
7562 0 : DATA_BLOB blob;
7563 0 : enum ndr_err_code err;
7564 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7565 0 : if (tmp_ctx == NULL) {
7566 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7567 0 : return NULL;
7568 : }
7569 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoAuthInfo);
7570 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7571 0 : TALLOC_FREE(tmp_ctx);
7572 0 : PyErr_SetNdrError(err);
7573 0 : return NULL;
7574 : }
7575 :
7576 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7577 0 : TALLOC_FREE(tmp_ctx);
7578 0 : return ret;
7579 : }
7580 :
7581 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7582 : {
7583 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7584 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7585 0 : Py_ssize_t blob_length = 0;
7586 0 : enum ndr_err_code err;
7587 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7588 0 : PyObject *allow_remaining_obj = NULL;
7589 0 : bool allow_remaining = false;
7590 :
7591 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7592 : discard_const_p(char *, kwnames),
7593 : &blob.data, &blob_length,
7594 : &allow_remaining_obj)) {
7595 0 : return NULL;
7596 : }
7597 0 : blob.length = blob_length;
7598 :
7599 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7600 0 : allow_remaining = true;
7601 : }
7602 :
7603 0 : if (allow_remaining) {
7604 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7605 : } else {
7606 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7607 : }
7608 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7609 0 : PyErr_SetNdrError(err);
7610 0 : return NULL;
7611 : }
7612 :
7613 0 : Py_RETURN_NONE;
7614 : }
7615 :
7616 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7617 : {
7618 0 : struct lsa_TrustDomainInfoAuthInfo *object = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_obj);
7619 0 : PyObject *ret;
7620 0 : char *retstr;
7621 :
7622 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoAuthInfo, "lsa_TrustDomainInfoAuthInfo", object);
7623 0 : ret = PyUnicode_FromString(retstr);
7624 0 : talloc_free(retstr);
7625 :
7626 0 : return ret;
7627 : }
7628 :
7629 : static PyMethodDef py_lsa_TrustDomainInfoAuthInfo_methods[] = {
7630 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7631 : { "__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" },
7632 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7633 : { NULL, NULL, 0, NULL }
7634 : };
7635 :
7636 :
7637 : static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type = {
7638 : PyVarObject_HEAD_INIT(NULL, 0)
7639 : .tp_name = "lsa.TrustDomainInfoAuthInfo",
7640 : .tp_getset = py_lsa_TrustDomainInfoAuthInfo_getsetters,
7641 : .tp_methods = py_lsa_TrustDomainInfoAuthInfo_methods,
7642 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7643 : .tp_new = py_lsa_TrustDomainInfoAuthInfo_new,
7644 : };
7645 :
7646 :
7647 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_info_ex(PyObject *obj, void *closure)
7648 : {
7649 24 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7650 0 : PyObject *py_info_ex;
7651 24 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7652 24 : return py_info_ex;
7653 : }
7654 :
7655 0 : static int py_lsa_TrustDomainInfoFullInfo_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7656 : {
7657 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7658 0 : if (value == NULL) {
7659 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7660 0 : return -1;
7661 : }
7662 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7663 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7664 0 : PyErr_NoMemory();
7665 0 : return -1;
7666 : }
7667 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7668 0 : return 0;
7669 : }
7670 :
7671 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_posix_offset(PyObject *obj, void *closure)
7672 : {
7673 24 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7674 0 : PyObject *py_posix_offset;
7675 24 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7676 24 : return py_posix_offset;
7677 : }
7678 :
7679 0 : static int py_lsa_TrustDomainInfoFullInfo_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7680 : {
7681 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7682 0 : if (value == NULL) {
7683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
7684 0 : return -1;
7685 : }
7686 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7687 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7688 0 : PyErr_NoMemory();
7689 0 : return -1;
7690 : }
7691 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7692 0 : return 0;
7693 : }
7694 :
7695 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_auth_info(PyObject *obj, void *closure)
7696 : {
7697 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(obj);
7698 0 : PyObject *py_auth_info;
7699 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7700 0 : return py_auth_info;
7701 : }
7702 :
7703 0 : static int py_lsa_TrustDomainInfoFullInfo_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7704 : {
7705 0 : struct lsa_TrustDomainInfoFullInfo *object = (struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(py_obj);
7706 0 : if (value == NULL) {
7707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
7708 0 : return -1;
7709 : }
7710 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
7711 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7712 0 : PyErr_NoMemory();
7713 0 : return -1;
7714 : }
7715 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
7716 0 : return 0;
7717 : }
7718 :
7719 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo_getsetters[] = {
7720 : {
7721 : .name = discard_const_p(char, "info_ex"),
7722 : .get = py_lsa_TrustDomainInfoFullInfo_get_info_ex,
7723 : .set = py_lsa_TrustDomainInfoFullInfo_set_info_ex,
7724 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7725 : },
7726 : {
7727 : .name = discard_const_p(char, "posix_offset"),
7728 : .get = py_lsa_TrustDomainInfoFullInfo_get_posix_offset,
7729 : .set = py_lsa_TrustDomainInfoFullInfo_set_posix_offset,
7730 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7731 : },
7732 : {
7733 : .name = discard_const_p(char, "auth_info"),
7734 : .get = py_lsa_TrustDomainInfoFullInfo_get_auth_info,
7735 : .set = py_lsa_TrustDomainInfoFullInfo_set_auth_info,
7736 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
7737 : },
7738 : { .name = NULL }
7739 : };
7740 :
7741 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7742 : {
7743 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo, type);
7744 : }
7745 :
7746 :
7747 : static PyTypeObject lsa_TrustDomainInfoFullInfo_Type = {
7748 : PyVarObject_HEAD_INIT(NULL, 0)
7749 : .tp_name = "lsa.TrustDomainInfoFullInfo",
7750 : .tp_getset = py_lsa_TrustDomainInfoFullInfo_getsetters,
7751 : .tp_methods = NULL,
7752 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7753 : .tp_new = py_lsa_TrustDomainInfoFullInfo_new,
7754 : };
7755 :
7756 :
7757 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob(PyObject *obj, void *closure)
7758 : {
7759 0 : struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(obj);
7760 0 : PyObject *py_auth_blob;
7761 0 : py_auth_blob = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->auth_blob);
7762 0 : return py_auth_blob;
7763 : }
7764 :
7765 23 : static int py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob(PyObject *py_obj, PyObject *value, void *closure)
7766 : {
7767 23 : struct lsa_TrustDomainInfoAuthInfoInternal *object = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_obj);
7768 23 : if (value == NULL) {
7769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_blob");
7770 0 : return -1;
7771 : }
7772 23 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7773 23 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7774 0 : PyErr_NoMemory();
7775 0 : return -1;
7776 : }
7777 23 : object->auth_blob = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7778 23 : return 0;
7779 : }
7780 :
7781 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfoInternal_getsetters[] = {
7782 : {
7783 : .name = discard_const_p(char, "auth_blob"),
7784 : .get = py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob,
7785 : .set = py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob,
7786 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7787 : },
7788 : { .name = NULL }
7789 : };
7790 :
7791 23 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7792 : {
7793 23 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternal, type);
7794 : }
7795 :
7796 :
7797 : static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type = {
7798 : PyVarObject_HEAD_INIT(NULL, 0)
7799 : .tp_name = "lsa.TrustDomainInfoAuthInfoInternal",
7800 : .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternal_getsetters,
7801 : .tp_methods = NULL,
7802 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7803 : .tp_new = py_lsa_TrustDomainInfoAuthInfoInternal_new,
7804 : };
7805 :
7806 :
7807 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex(PyObject *obj, void *closure)
7808 : {
7809 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7810 0 : PyObject *py_info_ex;
7811 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7812 0 : return py_info_ex;
7813 : }
7814 :
7815 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7816 : {
7817 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7818 0 : if (value == NULL) {
7819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7820 0 : return -1;
7821 : }
7822 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7823 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7824 0 : PyErr_NoMemory();
7825 0 : return -1;
7826 : }
7827 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7828 0 : return 0;
7829 : }
7830 :
7831 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset(PyObject *obj, void *closure)
7832 : {
7833 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7834 0 : PyObject *py_posix_offset;
7835 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7836 0 : return py_posix_offset;
7837 : }
7838 :
7839 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7840 : {
7841 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7842 0 : if (value == NULL) {
7843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
7844 0 : return -1;
7845 : }
7846 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7847 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7848 0 : PyErr_NoMemory();
7849 0 : return -1;
7850 : }
7851 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7852 0 : return 0;
7853 : }
7854 :
7855 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info(PyObject *obj, void *closure)
7856 : {
7857 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(obj);
7858 0 : PyObject *py_auth_info;
7859 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7860 0 : return py_auth_info;
7861 : }
7862 :
7863 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7864 : {
7865 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = (struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(py_obj);
7866 0 : if (value == NULL) {
7867 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
7868 0 : return -1;
7869 : }
7870 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
7871 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7872 0 : PyErr_NoMemory();
7873 0 : return -1;
7874 : }
7875 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
7876 0 : return 0;
7877 : }
7878 :
7879 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfoInternal_getsetters[] = {
7880 : {
7881 : .name = discard_const_p(char, "info_ex"),
7882 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex,
7883 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex,
7884 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7885 : },
7886 : {
7887 : .name = discard_const_p(char, "posix_offset"),
7888 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset,
7889 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset,
7890 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7891 : },
7892 : {
7893 : .name = discard_const_p(char, "auth_info"),
7894 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info,
7895 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info,
7896 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
7897 : },
7898 : { .name = NULL }
7899 : };
7900 :
7901 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7902 : {
7903 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternal, type);
7904 : }
7905 :
7906 :
7907 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type = {
7908 : PyVarObject_HEAD_INIT(NULL, 0)
7909 : .tp_name = "lsa.TrustDomainInfoFullInfoInternal",
7910 : .tp_getset = py_lsa_TrustDomainInfoFullInfoInternal_getsetters,
7911 : .tp_methods = NULL,
7912 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7913 : .tp_new = py_lsa_TrustDomainInfoFullInfoInternal_new,
7914 : };
7915 :
7916 :
7917 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex(PyObject *obj, void *closure)
7918 : {
7919 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7920 0 : PyObject *py_info_ex;
7921 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7922 0 : return py_info_ex;
7923 : }
7924 :
7925 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7926 : {
7927 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
7928 0 : if (value == NULL) {
7929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info_ex");
7930 0 : return -1;
7931 : }
7932 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7933 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7934 0 : PyErr_NoMemory();
7935 0 : return -1;
7936 : }
7937 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7938 0 : return 0;
7939 : }
7940 :
7941 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length(PyObject *obj, void *closure)
7942 : {
7943 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7944 0 : PyObject *py_forest_trust_length;
7945 0 : py_forest_trust_length = PyLong_FromUnsignedLongLong((uint32_t)object->forest_trust_length);
7946 0 : return py_forest_trust_length;
7947 : }
7948 :
7949 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length(PyObject *py_obj, PyObject *value, void *closure)
7950 : {
7951 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
7952 0 : if (value == NULL) {
7953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_length");
7954 0 : return -1;
7955 : }
7956 : {
7957 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_length));
7958 0 : if (PyLong_Check(value)) {
7959 0 : unsigned long long test_var;
7960 0 : test_var = PyLong_AsUnsignedLongLong(value);
7961 0 : if (PyErr_Occurred() != NULL) {
7962 0 : return -1;
7963 : }
7964 0 : if (test_var > uint_max) {
7965 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7966 : PyLong_Type.tp_name, uint_max, test_var);
7967 0 : return -1;
7968 : }
7969 0 : object->forest_trust_length = test_var;
7970 : } else {
7971 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7972 : PyLong_Type.tp_name);
7973 0 : return -1;
7974 : }
7975 : }
7976 0 : return 0;
7977 : }
7978 :
7979 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data(PyObject *obj, void *closure)
7980 : {
7981 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(obj);
7982 0 : PyObject *py_forest_trust_data;
7983 0 : if (object->forest_trust_data == NULL) {
7984 0 : Py_RETURN_NONE;
7985 : }
7986 0 : if (object->forest_trust_data == NULL) {
7987 0 : py_forest_trust_data = Py_None;
7988 0 : Py_INCREF(py_forest_trust_data);
7989 : } else {
7990 0 : py_forest_trust_data = PyList_New(object->forest_trust_length);
7991 0 : if (py_forest_trust_data == NULL) {
7992 0 : return NULL;
7993 : }
7994 : {
7995 : int forest_trust_data_cntr_1;
7996 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < (object->forest_trust_length); forest_trust_data_cntr_1++) {
7997 0 : PyObject *py_forest_trust_data_1;
7998 0 : py_forest_trust_data_1 = PyLong_FromLong((uint16_t)object->forest_trust_data[forest_trust_data_cntr_1]);
7999 0 : PyList_SetItem(py_forest_trust_data, forest_trust_data_cntr_1, py_forest_trust_data_1);
8000 : }
8001 : }
8002 : }
8003 0 : return py_forest_trust_data;
8004 : }
8005 :
8006 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
8007 : {
8008 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = (struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(py_obj);
8009 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->forest_trust_data));
8010 0 : if (value == NULL) {
8011 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data");
8012 0 : return -1;
8013 : }
8014 0 : if (value == Py_None) {
8015 0 : object->forest_trust_data = NULL;
8016 : } else {
8017 0 : object->forest_trust_data = NULL;
8018 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8019 : {
8020 0 : int forest_trust_data_cntr_1;
8021 0 : object->forest_trust_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->forest_trust_data, PyList_GET_SIZE(value));
8022 0 : if (!object->forest_trust_data) { return -1; }
8023 0 : talloc_set_name_const(object->forest_trust_data, "ARRAY: object->forest_trust_data");
8024 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < PyList_GET_SIZE(value); forest_trust_data_cntr_1++) {
8025 0 : if (PyList_GET_ITEM(value, forest_trust_data_cntr_1) == NULL) {
8026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data[forest_trust_data_cntr_1]");
8027 0 : return -1;
8028 : }
8029 : {
8030 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_data[forest_trust_data_cntr_1]));
8031 0 : if (PyLong_Check(PyList_GET_ITEM(value, forest_trust_data_cntr_1))) {
8032 0 : unsigned long long test_var;
8033 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, forest_trust_data_cntr_1));
8034 0 : if (PyErr_Occurred() != NULL) {
8035 0 : return -1;
8036 : }
8037 0 : if (test_var > uint_max) {
8038 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8039 : PyLong_Type.tp_name, uint_max, test_var);
8040 0 : return -1;
8041 : }
8042 0 : object->forest_trust_data[forest_trust_data_cntr_1] = test_var;
8043 : } else {
8044 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8045 : PyLong_Type.tp_name);
8046 0 : return -1;
8047 : }
8048 : }
8049 : }
8050 : }
8051 : }
8052 0 : return 0;
8053 : }
8054 :
8055 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx2Internal_getsetters[] = {
8056 : {
8057 : .name = discard_const_p(char, "info_ex"),
8058 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex,
8059 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex,
8060 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8061 : },
8062 : {
8063 : .name = discard_const_p(char, "forest_trust_length"),
8064 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length,
8065 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length,
8066 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8067 : },
8068 : {
8069 : .name = discard_const_p(char, "forest_trust_data"),
8070 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data,
8071 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data,
8072 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8073 : },
8074 : { .name = NULL }
8075 : };
8076 :
8077 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8078 : {
8079 0 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx2Internal, type);
8080 : }
8081 :
8082 :
8083 : static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type = {
8084 : PyVarObject_HEAD_INIT(NULL, 0)
8085 : .tp_name = "lsa.TrustDomainInfoInfoEx2Internal",
8086 : .tp_getset = py_lsa_TrustDomainInfoInfoEx2Internal_getsetters,
8087 : .tp_methods = NULL,
8088 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8089 : .tp_new = py_lsa_TrustDomainInfoInfoEx2Internal_new,
8090 : };
8091 :
8092 :
8093 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_info(PyObject *obj, void *closure)
8094 : {
8095 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8096 0 : PyObject *py_info;
8097 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, pytalloc_get_mem_ctx(obj), &object->info);
8098 0 : return py_info;
8099 : }
8100 :
8101 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_info(PyObject *py_obj, PyObject *value, void *closure)
8102 : {
8103 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8104 0 : if (value == NULL) {
8105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
8106 0 : return -1;
8107 : }
8108 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, value, return -1;);
8109 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8110 0 : PyErr_NoMemory();
8111 0 : return -1;
8112 : }
8113 0 : object->info = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(value);
8114 0 : return 0;
8115 : }
8116 :
8117 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset(PyObject *obj, void *closure)
8118 : {
8119 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8120 0 : PyObject *py_posix_offset;
8121 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
8122 0 : return py_posix_offset;
8123 : }
8124 :
8125 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
8126 : {
8127 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8128 0 : if (value == NULL) {
8129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->posix_offset");
8130 0 : return -1;
8131 : }
8132 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
8133 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8134 0 : PyErr_NoMemory();
8135 0 : return -1;
8136 : }
8137 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
8138 0 : return 0;
8139 : }
8140 :
8141 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info(PyObject *obj, void *closure)
8142 : {
8143 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(obj);
8144 0 : PyObject *py_auth_info;
8145 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
8146 0 : return py_auth_info;
8147 : }
8148 :
8149 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
8150 : {
8151 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = (struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(py_obj);
8152 0 : if (value == NULL) {
8153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_info");
8154 0 : return -1;
8155 : }
8156 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
8157 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8158 0 : PyErr_NoMemory();
8159 0 : return -1;
8160 : }
8161 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
8162 0 : return 0;
8163 : }
8164 :
8165 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo2Internal_getsetters[] = {
8166 : {
8167 : .name = discard_const_p(char, "info"),
8168 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_info,
8169 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_info,
8170 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx2Internal")
8171 : },
8172 : {
8173 : .name = discard_const_p(char, "posix_offset"),
8174 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset,
8175 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset,
8176 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
8177 : },
8178 : {
8179 : .name = discard_const_p(char, "auth_info"),
8180 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info,
8181 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info,
8182 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
8183 : },
8184 : { .name = NULL }
8185 : };
8186 :
8187 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8188 : {
8189 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo2Internal, type);
8190 : }
8191 :
8192 :
8193 : static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type = {
8194 : PyVarObject_HEAD_INIT(NULL, 0)
8195 : .tp_name = "lsa.TrustDomainInfoFullInfo2Internal",
8196 : .tp_getset = py_lsa_TrustDomainInfoFullInfo2Internal_getsetters,
8197 : .tp_methods = NULL,
8198 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8199 : .tp_new = py_lsa_TrustDomainInfoFullInfo2Internal_new,
8200 : };
8201 :
8202 :
8203 28 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types(PyObject *obj, void *closure)
8204 : {
8205 28 : struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(obj);
8206 0 : PyObject *py_enc_types;
8207 28 : py_enc_types = PyLong_FromUnsignedLongLong((uint32_t)object->enc_types);
8208 28 : return py_enc_types;
8209 : }
8210 :
8211 15 : static int py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types(PyObject *py_obj, PyObject *value, void *closure)
8212 : {
8213 15 : struct lsa_TrustDomainInfoSupportedEncTypes *object = (struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(py_obj);
8214 15 : if (value == NULL) {
8215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->enc_types");
8216 0 : return -1;
8217 : }
8218 : {
8219 15 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enc_types));
8220 15 : if (PyLong_Check(value)) {
8221 0 : unsigned long long test_var;
8222 15 : test_var = PyLong_AsUnsignedLongLong(value);
8223 15 : if (PyErr_Occurred() != NULL) {
8224 0 : return -1;
8225 : }
8226 15 : if (test_var > uint_max) {
8227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8228 : PyLong_Type.tp_name, uint_max, test_var);
8229 0 : return -1;
8230 : }
8231 15 : object->enc_types = test_var;
8232 : } else {
8233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8234 : PyLong_Type.tp_name);
8235 0 : return -1;
8236 : }
8237 : }
8238 15 : return 0;
8239 : }
8240 :
8241 : static PyGetSetDef py_lsa_TrustDomainInfoSupportedEncTypes_getsetters[] = {
8242 : {
8243 : .name = discard_const_p(char, "enc_types"),
8244 : .get = py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types,
8245 : .set = py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types,
8246 : .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes")
8247 : },
8248 : { .name = NULL }
8249 : };
8250 :
8251 11 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8252 : {
8253 11 : return pytalloc_new(struct lsa_TrustDomainInfoSupportedEncTypes, type);
8254 : }
8255 :
8256 :
8257 : static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type = {
8258 : PyVarObject_HEAD_INIT(NULL, 0)
8259 : .tp_name = "lsa.TrustDomainInfoSupportedEncTypes",
8260 : .tp_getset = py_lsa_TrustDomainInfoSupportedEncTypes_getsetters,
8261 : .tp_methods = NULL,
8262 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8263 : .tp_new = py_lsa_TrustDomainInfoSupportedEncTypes_new,
8264 : };
8265 :
8266 144 : static PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in)
8267 : {
8268 0 : PyObject *ret;
8269 :
8270 144 : switch (level) {
8271 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8272 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoName_Type, mem_ctx, &in->name);
8273 0 : return ret;
8274 :
8275 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8276 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoControllers_Type, mem_ctx, &in->controllers);
8277 0 : return ret;
8278 :
8279 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8280 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, mem_ctx, &in->posix_offset);
8281 0 : return ret;
8282 :
8283 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8284 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPassword_Type, mem_ctx, &in->password);
8285 0 : return ret;
8286 :
8287 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8288 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoBasic_Type, mem_ctx, &in->info_basic);
8289 0 : return ret;
8290 :
8291 96 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8292 96 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, mem_ctx, &in->info_ex);
8293 96 : return ret;
8294 :
8295 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8296 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, mem_ctx, &in->auth_info);
8297 0 : return ret;
8298 :
8299 24 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8300 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo_Type, mem_ctx, &in->full_info);
8301 24 : return ret;
8302 :
8303 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8304 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, mem_ctx, &in->auth_info_internal);
8305 0 : return ret;
8306 :
8307 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8308 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternal_Type, mem_ctx, &in->full_info_internal);
8309 0 : return ret;
8310 :
8311 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8312 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, mem_ctx, &in->info_ex2_internal);
8313 0 : return ret;
8314 :
8315 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8316 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo2Internal_Type, mem_ctx, &in->full_info2_internal);
8317 0 : return ret;
8318 :
8319 24 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8320 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoSupportedEncTypes_Type, mem_ctx, &in->enc_types);
8321 24 : return ret;
8322 :
8323 : }
8324 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
8325 0 : return NULL;
8326 : }
8327 :
8328 22 : static union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8329 : {
8330 22 : union lsa_TrustedDomainInfo *ret = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
8331 22 : switch (level) {
8332 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8333 0 : if (in == NULL) {
8334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
8335 0 : talloc_free(ret); return NULL;
8336 : }
8337 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoName_Type, in, talloc_free(ret); return NULL;);
8338 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8339 0 : PyErr_NoMemory();
8340 0 : talloc_free(ret); return NULL;
8341 : }
8342 0 : ret->name = *(struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(in);
8343 0 : break;
8344 :
8345 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8346 0 : if (in == NULL) {
8347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->controllers");
8348 0 : talloc_free(ret); return NULL;
8349 : }
8350 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoControllers_Type, in, talloc_free(ret); return NULL;);
8351 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8352 0 : PyErr_NoMemory();
8353 0 : talloc_free(ret); return NULL;
8354 : }
8355 0 : ret->controllers = *(struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(in);
8356 0 : break;
8357 :
8358 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8359 0 : if (in == NULL) {
8360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->posix_offset");
8361 0 : talloc_free(ret); return NULL;
8362 : }
8363 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, in, talloc_free(ret); return NULL;);
8364 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8365 0 : PyErr_NoMemory();
8366 0 : talloc_free(ret); return NULL;
8367 : }
8368 0 : ret->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(in);
8369 0 : break;
8370 :
8371 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8372 0 : if (in == NULL) {
8373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->password");
8374 0 : talloc_free(ret); return NULL;
8375 : }
8376 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPassword_Type, in, talloc_free(ret); return NULL;);
8377 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8378 0 : PyErr_NoMemory();
8379 0 : talloc_free(ret); return NULL;
8380 : }
8381 0 : ret->password = *(struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(in);
8382 0 : break;
8383 :
8384 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8385 0 : if (in == NULL) {
8386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_basic");
8387 0 : talloc_free(ret); return NULL;
8388 : }
8389 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBasic_Type, in, talloc_free(ret); return NULL;);
8390 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8391 0 : PyErr_NoMemory();
8392 0 : talloc_free(ret); return NULL;
8393 : }
8394 0 : ret->info_basic = *(struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(in);
8395 0 : break;
8396 :
8397 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8398 0 : if (in == NULL) {
8399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_ex");
8400 0 : talloc_free(ret); return NULL;
8401 : }
8402 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, in, talloc_free(ret); return NULL;);
8403 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8404 0 : PyErr_NoMemory();
8405 0 : talloc_free(ret); return NULL;
8406 : }
8407 0 : ret->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(in);
8408 0 : break;
8409 :
8410 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8411 0 : if (in == NULL) {
8412 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auth_info");
8413 0 : talloc_free(ret); return NULL;
8414 : }
8415 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, in, talloc_free(ret); return NULL;);
8416 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8417 0 : PyErr_NoMemory();
8418 0 : talloc_free(ret); return NULL;
8419 : }
8420 0 : ret->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(in);
8421 0 : break;
8422 :
8423 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8424 0 : if (in == NULL) {
8425 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info");
8426 0 : talloc_free(ret); return NULL;
8427 : }
8428 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo_Type, in, talloc_free(ret); return NULL;);
8429 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8430 0 : PyErr_NoMemory();
8431 0 : talloc_free(ret); return NULL;
8432 : }
8433 0 : ret->full_info = *(struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(in);
8434 0 : break;
8435 :
8436 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8437 0 : if (in == NULL) {
8438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->auth_info_internal");
8439 0 : talloc_free(ret); return NULL;
8440 : }
8441 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, in, talloc_free(ret); return NULL;);
8442 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8443 0 : PyErr_NoMemory();
8444 0 : talloc_free(ret); return NULL;
8445 : }
8446 0 : ret->auth_info_internal = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(in);
8447 0 : break;
8448 :
8449 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8450 0 : if (in == NULL) {
8451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info_internal");
8452 0 : talloc_free(ret); return NULL;
8453 : }
8454 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfoInternal_Type, in, talloc_free(ret); return NULL;);
8455 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8456 0 : PyErr_NoMemory();
8457 0 : talloc_free(ret); return NULL;
8458 : }
8459 0 : ret->full_info_internal = *(struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(in);
8460 0 : break;
8461 :
8462 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8463 0 : if (in == NULL) {
8464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info_ex2_internal");
8465 0 : talloc_free(ret); return NULL;
8466 : }
8467 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, in, talloc_free(ret); return NULL;);
8468 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8469 0 : PyErr_NoMemory();
8470 0 : talloc_free(ret); return NULL;
8471 : }
8472 0 : ret->info_ex2_internal = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(in);
8473 0 : break;
8474 :
8475 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8476 0 : if (in == NULL) {
8477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->full_info2_internal");
8478 0 : talloc_free(ret); return NULL;
8479 : }
8480 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo2Internal_Type, in, talloc_free(ret); return NULL;);
8481 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8482 0 : PyErr_NoMemory();
8483 0 : talloc_free(ret); return NULL;
8484 : }
8485 0 : ret->full_info2_internal = *(struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(in);
8486 0 : break;
8487 :
8488 22 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8489 22 : if (in == NULL) {
8490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->enc_types");
8491 0 : talloc_free(ret); return NULL;
8492 : }
8493 22 : PY_CHECK_TYPE(&lsa_TrustDomainInfoSupportedEncTypes_Type, in, talloc_free(ret); return NULL;);
8494 22 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8495 0 : PyErr_NoMemory();
8496 0 : talloc_free(ret); return NULL;
8497 : }
8498 22 : ret->enc_types = *(struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(in);
8499 22 : break;
8500 :
8501 0 : default:
8502 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
8503 0 : talloc_free(ret);
8504 0 : ret = NULL;
8505 : }
8506 :
8507 22 : return ret;
8508 : }
8509 :
8510 144 : static PyObject *py_lsa_TrustedDomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8511 : {
8512 144 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8513 144 : PyObject *mem_ctx_obj = NULL;
8514 144 : TALLOC_CTX *mem_ctx = NULL;
8515 144 : int level = 0;
8516 144 : PyObject *in_obj = NULL;
8517 144 : union lsa_TrustedDomainInfo *in = NULL;
8518 :
8519 144 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
8520 : discard_const_p(char *, kwnames),
8521 : &mem_ctx_obj,
8522 : &level,
8523 : &in_obj)) {
8524 0 : return NULL;
8525 : }
8526 144 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8527 144 : if (mem_ctx == NULL) {
8528 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8529 0 : return NULL;
8530 : }
8531 144 : in = (union lsa_TrustedDomainInfo *)pytalloc_get_ptr(in_obj);
8532 144 : if (in == NULL) {
8533 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_TrustedDomainInfo!");
8534 0 : return NULL;
8535 : }
8536 :
8537 144 : return py_import_lsa_TrustedDomainInfo(mem_ctx, level, in);
8538 : }
8539 :
8540 22 : static PyObject *py_lsa_TrustedDomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8541 : {
8542 22 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8543 22 : PyObject *mem_ctx_obj = NULL;
8544 22 : TALLOC_CTX *mem_ctx = NULL;
8545 22 : int level = 0;
8546 22 : PyObject *in = NULL;
8547 22 : union lsa_TrustedDomainInfo *out = NULL;
8548 :
8549 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
8550 : discard_const_p(char *, kwnames),
8551 : &mem_ctx_obj,
8552 : &level,
8553 : &in)) {
8554 0 : return NULL;
8555 : }
8556 22 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8557 22 : if (mem_ctx == NULL) {
8558 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8559 0 : return NULL;
8560 : }
8561 :
8562 22 : out = py_export_lsa_TrustedDomainInfo(mem_ctx, level, in);
8563 22 : if (out == NULL) {
8564 0 : return NULL;
8565 : }
8566 :
8567 22 : return pytalloc_GenericObject_reference(out);
8568 : }
8569 :
8570 : static PyMethodDef py_lsa_TrustedDomainInfo_methods[] = {
8571 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_import),
8572 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8573 : "T.__import__(mem_ctx, level, in) => ret." },
8574 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_export),
8575 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8576 : "T.__export__(mem_ctx, level, in) => ret." },
8577 : { NULL, NULL, 0, NULL }
8578 : };
8579 :
8580 0 : static PyObject *py_lsa_TrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8581 : {
8582 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
8583 0 : return NULL;
8584 : }
8585 :
8586 :
8587 : static PyTypeObject lsa_TrustedDomainInfo_Type = {
8588 : PyVarObject_HEAD_INIT(NULL, 0)
8589 : .tp_name = "lsa.TrustedDomainInfo",
8590 : .tp_getset = NULL,
8591 : .tp_methods = py_lsa_TrustedDomainInfo_methods,
8592 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8593 : .tp_new = py_lsa_TrustedDomainInfo_new,
8594 : };
8595 :
8596 :
8597 0 : static PyObject *py_lsa_DATA_BUF_PTR_get_buf(PyObject *obj, void *closure)
8598 : {
8599 0 : struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(obj);
8600 0 : PyObject *py_buf;
8601 0 : if (object->buf == NULL) {
8602 0 : Py_RETURN_NONE;
8603 : }
8604 0 : if (object->buf == NULL) {
8605 0 : py_buf = Py_None;
8606 0 : Py_INCREF(py_buf);
8607 : } else {
8608 0 : py_buf = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->buf, object->buf);
8609 : }
8610 0 : return py_buf;
8611 : }
8612 :
8613 0 : static int py_lsa_DATA_BUF_PTR_set_buf(PyObject *py_obj, PyObject *value, void *closure)
8614 : {
8615 0 : struct lsa_DATA_BUF_PTR *object = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_obj);
8616 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buf));
8617 0 : if (value == NULL) {
8618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buf");
8619 0 : return -1;
8620 : }
8621 0 : if (value == Py_None) {
8622 0 : object->buf = NULL;
8623 : } else {
8624 0 : object->buf = NULL;
8625 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
8626 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8627 0 : PyErr_NoMemory();
8628 0 : return -1;
8629 : }
8630 0 : object->buf = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
8631 : }
8632 0 : return 0;
8633 : }
8634 :
8635 : static PyGetSetDef py_lsa_DATA_BUF_PTR_getsetters[] = {
8636 : {
8637 : .name = discard_const_p(char, "buf"),
8638 : .get = py_lsa_DATA_BUF_PTR_get_buf,
8639 : .set = py_lsa_DATA_BUF_PTR_set_buf,
8640 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
8641 : },
8642 : { .name = NULL }
8643 : };
8644 :
8645 0 : static PyObject *py_lsa_DATA_BUF_PTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8646 : {
8647 0 : return pytalloc_new(struct lsa_DATA_BUF_PTR, type);
8648 : }
8649 :
8650 :
8651 : static PyTypeObject lsa_DATA_BUF_PTR_Type = {
8652 : PyVarObject_HEAD_INIT(NULL, 0)
8653 : .tp_name = "lsa.DATA_BUF_PTR",
8654 : .tp_getset = py_lsa_DATA_BUF_PTR_getsetters,
8655 : .tp_methods = NULL,
8656 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8657 : .tp_new = py_lsa_DATA_BUF_PTR_new,
8658 : };
8659 :
8660 :
8661 0 : static PyObject *py_lsa_RightAttribute_get_name(PyObject *obj, void *closure)
8662 : {
8663 0 : struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(obj);
8664 0 : PyObject *py_name;
8665 0 : if (object->name == NULL) {
8666 0 : Py_RETURN_NONE;
8667 : }
8668 0 : if (object->name == NULL) {
8669 0 : py_name = Py_None;
8670 0 : Py_INCREF(py_name);
8671 : } else {
8672 0 : if (object->name == NULL) {
8673 0 : py_name = Py_None;
8674 0 : Py_INCREF(py_name);
8675 : } else {
8676 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
8677 : }
8678 : }
8679 0 : return py_name;
8680 : }
8681 :
8682 0 : static int py_lsa_RightAttribute_set_name(PyObject *py_obj, PyObject *value, void *closure)
8683 : {
8684 0 : struct lsa_RightAttribute *object = (struct lsa_RightAttribute *)pytalloc_get_ptr(py_obj);
8685 0 : if (value == NULL) {
8686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
8687 0 : return -1;
8688 : }
8689 0 : if (value == Py_None) {
8690 0 : object->name = NULL;
8691 : } else {
8692 0 : object->name = NULL;
8693 : {
8694 0 : const char *test_str;
8695 0 : const char *talloc_str;
8696 0 : PyObject *unicode = NULL;
8697 0 : if (PyUnicode_Check(value)) {
8698 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
8699 0 : if (unicode == NULL) {
8700 0 : return -1;
8701 : }
8702 0 : test_str = PyBytes_AS_STRING(unicode);
8703 0 : } else if (PyBytes_Check(value)) {
8704 0 : test_str = PyBytes_AS_STRING(value);
8705 : } else {
8706 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
8707 0 : return -1;
8708 : }
8709 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
8710 0 : if (unicode != NULL) {
8711 0 : Py_DECREF(unicode);
8712 : }
8713 0 : if (talloc_str == NULL) {
8714 0 : PyErr_NoMemory();
8715 0 : return -1;
8716 : }
8717 0 : object->name = talloc_str;
8718 : }
8719 : }
8720 0 : return 0;
8721 : }
8722 :
8723 : static PyGetSetDef py_lsa_RightAttribute_getsetters[] = {
8724 : {
8725 : .name = discard_const_p(char, "name"),
8726 : .get = py_lsa_RightAttribute_get_name,
8727 : .set = py_lsa_RightAttribute_set_name,
8728 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8729 : },
8730 : { .name = NULL }
8731 : };
8732 :
8733 0 : static PyObject *py_lsa_RightAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8734 : {
8735 0 : return pytalloc_new(struct lsa_RightAttribute, type);
8736 : }
8737 :
8738 :
8739 : static PyTypeObject lsa_RightAttribute_Type = {
8740 : PyVarObject_HEAD_INIT(NULL, 0)
8741 : .tp_name = "lsa.RightAttribute",
8742 : .tp_getset = py_lsa_RightAttribute_getsetters,
8743 : .tp_methods = NULL,
8744 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8745 : .tp_new = py_lsa_RightAttribute_new,
8746 : };
8747 :
8748 :
8749 0 : static PyObject *py_lsa_RightSet_get_count(PyObject *obj, void *closure)
8750 : {
8751 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
8752 0 : PyObject *py_count;
8753 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
8754 0 : return py_count;
8755 : }
8756 :
8757 0 : static int py_lsa_RightSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
8758 : {
8759 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
8760 0 : if (value == NULL) {
8761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
8762 0 : return -1;
8763 : }
8764 : {
8765 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8766 0 : if (PyLong_Check(value)) {
8767 0 : unsigned long long test_var;
8768 0 : test_var = PyLong_AsUnsignedLongLong(value);
8769 0 : if (PyErr_Occurred() != NULL) {
8770 0 : return -1;
8771 : }
8772 0 : if (test_var > uint_max) {
8773 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8774 : PyLong_Type.tp_name, uint_max, test_var);
8775 0 : return -1;
8776 : }
8777 0 : object->count = test_var;
8778 : } else {
8779 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8780 : PyLong_Type.tp_name);
8781 0 : return -1;
8782 : }
8783 : }
8784 0 : return 0;
8785 : }
8786 :
8787 0 : static PyObject *py_lsa_RightSet_get_names(PyObject *obj, void *closure)
8788 : {
8789 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(obj);
8790 0 : PyObject *py_names;
8791 0 : if (object->names == NULL) {
8792 0 : Py_RETURN_NONE;
8793 : }
8794 0 : if (object->names == NULL) {
8795 0 : py_names = Py_None;
8796 0 : Py_INCREF(py_names);
8797 : } else {
8798 0 : py_names = PyList_New(object->count);
8799 0 : if (py_names == NULL) {
8800 0 : return NULL;
8801 : }
8802 : {
8803 : int names_cntr_1;
8804 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
8805 0 : PyObject *py_names_1;
8806 0 : py_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->names, &object->names[names_cntr_1]);
8807 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
8808 : }
8809 : }
8810 : }
8811 0 : return py_names;
8812 : }
8813 :
8814 0 : static int py_lsa_RightSet_set_names(PyObject *py_obj, PyObject *value, void *closure)
8815 : {
8816 0 : struct lsa_RightSet *object = (struct lsa_RightSet *)pytalloc_get_ptr(py_obj);
8817 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
8818 0 : if (value == NULL) {
8819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
8820 0 : return -1;
8821 : }
8822 0 : if (value == Py_None) {
8823 0 : object->names = NULL;
8824 : } else {
8825 0 : object->names = NULL;
8826 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8827 : {
8828 0 : int names_cntr_1;
8829 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
8830 0 : if (!object->names) { return -1; }
8831 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
8832 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
8833 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
8834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
8835 0 : return -1;
8836 : }
8837 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
8838 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
8839 0 : PyErr_NoMemory();
8840 0 : return -1;
8841 : }
8842 0 : object->names[names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
8843 : }
8844 : }
8845 : }
8846 0 : return 0;
8847 : }
8848 :
8849 : static PyGetSetDef py_lsa_RightSet_getsetters[] = {
8850 : {
8851 : .name = discard_const_p(char, "count"),
8852 : .get = py_lsa_RightSet_get_count,
8853 : .set = py_lsa_RightSet_set_count,
8854 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8855 : },
8856 : {
8857 : .name = discard_const_p(char, "names"),
8858 : .get = py_lsa_RightSet_get_names,
8859 : .set = py_lsa_RightSet_set_names,
8860 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
8861 : },
8862 : { .name = NULL }
8863 : };
8864 :
8865 0 : static PyObject *py_lsa_RightSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8866 : {
8867 0 : return pytalloc_new(struct lsa_RightSet, type);
8868 : }
8869 :
8870 :
8871 : static PyTypeObject lsa_RightSet_Type = {
8872 : PyVarObject_HEAD_INIT(NULL, 0)
8873 : .tp_name = "lsa.RightSet",
8874 : .tp_getset = py_lsa_RightSet_getsetters,
8875 : .tp_methods = NULL,
8876 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8877 : .tp_new = py_lsa_RightSet_new,
8878 : };
8879 :
8880 :
8881 0 : static PyObject *py_lsa_DomainListEx_get_count(PyObject *obj, void *closure)
8882 : {
8883 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
8884 0 : PyObject *py_count;
8885 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
8886 0 : return py_count;
8887 : }
8888 :
8889 0 : static int py_lsa_DomainListEx_set_count(PyObject *py_obj, PyObject *value, void *closure)
8890 : {
8891 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
8892 0 : if (value == NULL) {
8893 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
8894 0 : return -1;
8895 : }
8896 : {
8897 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
8898 0 : if (PyLong_Check(value)) {
8899 0 : unsigned long long test_var;
8900 0 : test_var = PyLong_AsUnsignedLongLong(value);
8901 0 : if (PyErr_Occurred() != NULL) {
8902 0 : return -1;
8903 : }
8904 0 : if (test_var > uint_max) {
8905 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8906 : PyLong_Type.tp_name, uint_max, test_var);
8907 0 : return -1;
8908 : }
8909 0 : object->count = test_var;
8910 : } else {
8911 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8912 : PyLong_Type.tp_name);
8913 0 : return -1;
8914 : }
8915 : }
8916 0 : return 0;
8917 : }
8918 :
8919 0 : static PyObject *py_lsa_DomainListEx_get_domains(PyObject *obj, void *closure)
8920 : {
8921 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(obj);
8922 0 : PyObject *py_domains;
8923 0 : if (object->domains == NULL) {
8924 0 : Py_RETURN_NONE;
8925 : }
8926 0 : if (object->domains == NULL) {
8927 0 : py_domains = Py_None;
8928 0 : Py_INCREF(py_domains);
8929 : } else {
8930 0 : py_domains = PyList_New(object->count);
8931 0 : if (py_domains == NULL) {
8932 0 : return NULL;
8933 : }
8934 : {
8935 : int domains_cntr_1;
8936 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
8937 0 : PyObject *py_domains_1;
8938 0 : py_domains_1 = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->domains, &object->domains[domains_cntr_1]);
8939 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
8940 : }
8941 : }
8942 : }
8943 0 : return py_domains;
8944 : }
8945 :
8946 0 : static int py_lsa_DomainListEx_set_domains(PyObject *py_obj, PyObject *value, void *closure)
8947 : {
8948 0 : struct lsa_DomainListEx *object = (struct lsa_DomainListEx *)pytalloc_get_ptr(py_obj);
8949 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
8950 0 : if (value == NULL) {
8951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains");
8952 0 : return -1;
8953 : }
8954 0 : if (value == Py_None) {
8955 0 : object->domains = NULL;
8956 : } else {
8957 0 : object->domains = NULL;
8958 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8959 : {
8960 0 : int domains_cntr_1;
8961 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
8962 0 : if (!object->domains) { return -1; }
8963 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
8964 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
8965 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
8966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domains[domains_cntr_1]");
8967 0 : return -1;
8968 : }
8969 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
8970 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
8971 0 : PyErr_NoMemory();
8972 0 : return -1;
8973 : }
8974 0 : object->domains[domains_cntr_1] = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
8975 : }
8976 : }
8977 : }
8978 0 : return 0;
8979 : }
8980 :
8981 : static PyGetSetDef py_lsa_DomainListEx_getsetters[] = {
8982 : {
8983 : .name = discard_const_p(char, "count"),
8984 : .get = py_lsa_DomainListEx_get_count,
8985 : .set = py_lsa_DomainListEx_set_count,
8986 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8987 : },
8988 : {
8989 : .name = discard_const_p(char, "domains"),
8990 : .get = py_lsa_DomainListEx_get_domains,
8991 : .set = py_lsa_DomainListEx_set_domains,
8992 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8993 : },
8994 : { .name = NULL }
8995 : };
8996 :
8997 0 : static PyObject *py_lsa_DomainListEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8998 : {
8999 0 : return pytalloc_new(struct lsa_DomainListEx, type);
9000 : }
9001 :
9002 :
9003 : static PyTypeObject lsa_DomainListEx_Type = {
9004 : PyVarObject_HEAD_INIT(NULL, 0)
9005 : .tp_name = "lsa.DomainListEx",
9006 : .tp_getset = py_lsa_DomainListEx_getsetters,
9007 : .tp_methods = NULL,
9008 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9009 : .tp_new = py_lsa_DomainListEx_new,
9010 : };
9011 :
9012 :
9013 0 : static PyObject *py_lsa_DomainInfoKerberos_get_authentication_options(PyObject *obj, void *closure)
9014 : {
9015 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9016 0 : PyObject *py_authentication_options;
9017 0 : py_authentication_options = PyLong_FromUnsignedLongLong((uint32_t)object->authentication_options);
9018 0 : return py_authentication_options;
9019 : }
9020 :
9021 0 : static int py_lsa_DomainInfoKerberos_set_authentication_options(PyObject *py_obj, PyObject *value, void *closure)
9022 : {
9023 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9024 0 : if (value == NULL) {
9025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->authentication_options");
9026 0 : return -1;
9027 : }
9028 : {
9029 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->authentication_options));
9030 0 : if (PyLong_Check(value)) {
9031 0 : unsigned long long test_var;
9032 0 : test_var = PyLong_AsUnsignedLongLong(value);
9033 0 : if (PyErr_Occurred() != NULL) {
9034 0 : return -1;
9035 : }
9036 0 : if (test_var > uint_max) {
9037 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9038 : PyLong_Type.tp_name, uint_max, test_var);
9039 0 : return -1;
9040 : }
9041 0 : object->authentication_options = test_var;
9042 : } else {
9043 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9044 : PyLong_Type.tp_name);
9045 0 : return -1;
9046 : }
9047 : }
9048 0 : return 0;
9049 : }
9050 :
9051 0 : static PyObject *py_lsa_DomainInfoKerberos_get_service_tkt_lifetime(PyObject *obj, void *closure)
9052 : {
9053 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9054 0 : PyObject *py_service_tkt_lifetime;
9055 0 : py_service_tkt_lifetime = PyLong_FromUnsignedLongLong(object->service_tkt_lifetime);
9056 0 : return py_service_tkt_lifetime;
9057 : }
9058 :
9059 0 : static int py_lsa_DomainInfoKerberos_set_service_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9060 : {
9061 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9062 0 : if (value == NULL) {
9063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->service_tkt_lifetime");
9064 0 : return -1;
9065 : }
9066 : {
9067 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_tkt_lifetime));
9068 0 : if (PyLong_Check(value)) {
9069 0 : unsigned long long test_var;
9070 0 : test_var = PyLong_AsUnsignedLongLong(value);
9071 0 : if (PyErr_Occurred() != NULL) {
9072 0 : return -1;
9073 : }
9074 0 : if (test_var > uint_max) {
9075 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9076 : PyLong_Type.tp_name, uint_max, test_var);
9077 0 : return -1;
9078 : }
9079 0 : object->service_tkt_lifetime = test_var;
9080 : } else {
9081 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9082 : PyLong_Type.tp_name);
9083 0 : return -1;
9084 : }
9085 : }
9086 0 : return 0;
9087 : }
9088 :
9089 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_lifetime(PyObject *obj, void *closure)
9090 : {
9091 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9092 0 : PyObject *py_user_tkt_lifetime;
9093 0 : py_user_tkt_lifetime = PyLong_FromUnsignedLongLong(object->user_tkt_lifetime);
9094 0 : return py_user_tkt_lifetime;
9095 : }
9096 :
9097 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9098 : {
9099 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9100 0 : if (value == NULL) {
9101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_tkt_lifetime");
9102 0 : return -1;
9103 : }
9104 : {
9105 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_lifetime));
9106 0 : if (PyLong_Check(value)) {
9107 0 : unsigned long long test_var;
9108 0 : test_var = PyLong_AsUnsignedLongLong(value);
9109 0 : if (PyErr_Occurred() != NULL) {
9110 0 : return -1;
9111 : }
9112 0 : if (test_var > uint_max) {
9113 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9114 : PyLong_Type.tp_name, uint_max, test_var);
9115 0 : return -1;
9116 : }
9117 0 : object->user_tkt_lifetime = test_var;
9118 : } else {
9119 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9120 : PyLong_Type.tp_name);
9121 0 : return -1;
9122 : }
9123 : }
9124 0 : return 0;
9125 : }
9126 :
9127 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime(PyObject *obj, void *closure)
9128 : {
9129 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9130 0 : PyObject *py_user_tkt_renewaltime;
9131 0 : py_user_tkt_renewaltime = PyLong_FromUnsignedLongLong(object->user_tkt_renewaltime);
9132 0 : return py_user_tkt_renewaltime;
9133 : }
9134 :
9135 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime(PyObject *py_obj, PyObject *value, void *closure)
9136 : {
9137 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9138 0 : if (value == NULL) {
9139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_tkt_renewaltime");
9140 0 : return -1;
9141 : }
9142 : {
9143 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_renewaltime));
9144 0 : if (PyLong_Check(value)) {
9145 0 : unsigned long long test_var;
9146 0 : test_var = PyLong_AsUnsignedLongLong(value);
9147 0 : if (PyErr_Occurred() != NULL) {
9148 0 : return -1;
9149 : }
9150 0 : if (test_var > uint_max) {
9151 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9152 : PyLong_Type.tp_name, uint_max, test_var);
9153 0 : return -1;
9154 : }
9155 0 : object->user_tkt_renewaltime = test_var;
9156 : } else {
9157 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9158 : PyLong_Type.tp_name);
9159 0 : return -1;
9160 : }
9161 : }
9162 0 : return 0;
9163 : }
9164 :
9165 0 : static PyObject *py_lsa_DomainInfoKerberos_get_clock_skew(PyObject *obj, void *closure)
9166 : {
9167 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9168 0 : PyObject *py_clock_skew;
9169 0 : py_clock_skew = PyLong_FromUnsignedLongLong(object->clock_skew);
9170 0 : return py_clock_skew;
9171 : }
9172 :
9173 0 : static int py_lsa_DomainInfoKerberos_set_clock_skew(PyObject *py_obj, PyObject *value, void *closure)
9174 : {
9175 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9176 0 : if (value == NULL) {
9177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->clock_skew");
9178 0 : return -1;
9179 : }
9180 : {
9181 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clock_skew));
9182 0 : if (PyLong_Check(value)) {
9183 0 : unsigned long long test_var;
9184 0 : test_var = PyLong_AsUnsignedLongLong(value);
9185 0 : if (PyErr_Occurred() != NULL) {
9186 0 : return -1;
9187 : }
9188 0 : if (test_var > uint_max) {
9189 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9190 : PyLong_Type.tp_name, uint_max, test_var);
9191 0 : return -1;
9192 : }
9193 0 : object->clock_skew = test_var;
9194 : } else {
9195 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9196 : PyLong_Type.tp_name);
9197 0 : return -1;
9198 : }
9199 : }
9200 0 : return 0;
9201 : }
9202 :
9203 0 : static PyObject *py_lsa_DomainInfoKerberos_get_reserved(PyObject *obj, void *closure)
9204 : {
9205 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(obj);
9206 0 : PyObject *py_reserved;
9207 0 : py_reserved = PyLong_FromUnsignedLongLong(object->reserved);
9208 0 : return py_reserved;
9209 : }
9210 :
9211 0 : static int py_lsa_DomainInfoKerberos_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
9212 : {
9213 0 : struct lsa_DomainInfoKerberos *object = (struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(py_obj);
9214 0 : if (value == NULL) {
9215 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
9216 0 : return -1;
9217 : }
9218 : {
9219 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
9220 0 : if (PyLong_Check(value)) {
9221 0 : unsigned long long test_var;
9222 0 : test_var = PyLong_AsUnsignedLongLong(value);
9223 0 : if (PyErr_Occurred() != NULL) {
9224 0 : return -1;
9225 : }
9226 0 : if (test_var > uint_max) {
9227 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9228 : PyLong_Type.tp_name, uint_max, test_var);
9229 0 : return -1;
9230 : }
9231 0 : object->reserved = test_var;
9232 : } else {
9233 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9234 : PyLong_Type.tp_name);
9235 0 : return -1;
9236 : }
9237 : }
9238 0 : return 0;
9239 : }
9240 :
9241 : static PyGetSetDef py_lsa_DomainInfoKerberos_getsetters[] = {
9242 : {
9243 : .name = discard_const_p(char, "authentication_options"),
9244 : .get = py_lsa_DomainInfoKerberos_get_authentication_options,
9245 : .set = py_lsa_DomainInfoKerberos_set_authentication_options,
9246 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_krbAuthenticationOptions")
9247 : },
9248 : {
9249 : .name = discard_const_p(char, "service_tkt_lifetime"),
9250 : .get = py_lsa_DomainInfoKerberos_get_service_tkt_lifetime,
9251 : .set = py_lsa_DomainInfoKerberos_set_service_tkt_lifetime,
9252 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9253 : },
9254 : {
9255 : .name = discard_const_p(char, "user_tkt_lifetime"),
9256 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_lifetime,
9257 : .set = py_lsa_DomainInfoKerberos_set_user_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_renewaltime"),
9262 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime,
9263 : .set = py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime,
9264 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9265 : },
9266 : {
9267 : .name = discard_const_p(char, "clock_skew"),
9268 : .get = py_lsa_DomainInfoKerberos_get_clock_skew,
9269 : .set = py_lsa_DomainInfoKerberos_set_clock_skew,
9270 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9271 : },
9272 : {
9273 : .name = discard_const_p(char, "reserved"),
9274 : .get = py_lsa_DomainInfoKerberos_get_reserved,
9275 : .set = py_lsa_DomainInfoKerberos_set_reserved,
9276 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9277 : },
9278 : { .name = NULL }
9279 : };
9280 :
9281 0 : static PyObject *py_lsa_DomainInfoKerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9282 : {
9283 0 : return pytalloc_new(struct lsa_DomainInfoKerberos, type);
9284 : }
9285 :
9286 :
9287 : static PyTypeObject lsa_DomainInfoKerberos_Type = {
9288 : PyVarObject_HEAD_INIT(NULL, 0)
9289 : .tp_name = "lsa.DomainInfoKerberos",
9290 : .tp_getset = py_lsa_DomainInfoKerberos_getsetters,
9291 : .tp_methods = NULL,
9292 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9293 : .tp_new = py_lsa_DomainInfoKerberos_new,
9294 : };
9295 :
9296 :
9297 0 : static PyObject *py_lsa_DomainInfoEfs_get_blob_size(PyObject *obj, void *closure)
9298 : {
9299 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
9300 0 : PyObject *py_blob_size;
9301 0 : py_blob_size = PyLong_FromUnsignedLongLong((uint32_t)object->blob_size);
9302 0 : return py_blob_size;
9303 : }
9304 :
9305 0 : static int py_lsa_DomainInfoEfs_set_blob_size(PyObject *py_obj, PyObject *value, void *closure)
9306 : {
9307 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
9308 0 : if (value == NULL) {
9309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->blob_size");
9310 0 : return -1;
9311 : }
9312 : {
9313 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blob_size));
9314 0 : if (PyLong_Check(value)) {
9315 0 : unsigned long long test_var;
9316 0 : test_var = PyLong_AsUnsignedLongLong(value);
9317 0 : if (PyErr_Occurred() != NULL) {
9318 0 : return -1;
9319 : }
9320 0 : if (test_var > uint_max) {
9321 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9322 : PyLong_Type.tp_name, uint_max, test_var);
9323 0 : return -1;
9324 : }
9325 0 : object->blob_size = test_var;
9326 : } else {
9327 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9328 : PyLong_Type.tp_name);
9329 0 : return -1;
9330 : }
9331 : }
9332 0 : return 0;
9333 : }
9334 :
9335 0 : static PyObject *py_lsa_DomainInfoEfs_get_efs_blob(PyObject *obj, void *closure)
9336 : {
9337 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(obj);
9338 0 : PyObject *py_efs_blob;
9339 0 : if (object->efs_blob == NULL) {
9340 0 : Py_RETURN_NONE;
9341 : }
9342 0 : if (object->efs_blob == NULL) {
9343 0 : py_efs_blob = Py_None;
9344 0 : Py_INCREF(py_efs_blob);
9345 : } else {
9346 0 : py_efs_blob = PyList_New(object->blob_size);
9347 0 : if (py_efs_blob == NULL) {
9348 0 : return NULL;
9349 : }
9350 : {
9351 : int efs_blob_cntr_1;
9352 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < (object->blob_size); efs_blob_cntr_1++) {
9353 0 : PyObject *py_efs_blob_1;
9354 0 : py_efs_blob_1 = PyLong_FromLong((uint16_t)object->efs_blob[efs_blob_cntr_1]);
9355 0 : PyList_SetItem(py_efs_blob, efs_blob_cntr_1, py_efs_blob_1);
9356 : }
9357 : }
9358 : }
9359 0 : return py_efs_blob;
9360 : }
9361 :
9362 0 : static int py_lsa_DomainInfoEfs_set_efs_blob(PyObject *py_obj, PyObject *value, void *closure)
9363 : {
9364 0 : struct lsa_DomainInfoEfs *object = (struct lsa_DomainInfoEfs *)pytalloc_get_ptr(py_obj);
9365 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->efs_blob));
9366 0 : if (value == NULL) {
9367 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->efs_blob");
9368 0 : return -1;
9369 : }
9370 0 : if (value == Py_None) {
9371 0 : object->efs_blob = NULL;
9372 : } else {
9373 0 : object->efs_blob = NULL;
9374 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9375 : {
9376 0 : int efs_blob_cntr_1;
9377 0 : object->efs_blob = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->efs_blob, PyList_GET_SIZE(value));
9378 0 : if (!object->efs_blob) { return -1; }
9379 0 : talloc_set_name_const(object->efs_blob, "ARRAY: object->efs_blob");
9380 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < PyList_GET_SIZE(value); efs_blob_cntr_1++) {
9381 0 : if (PyList_GET_ITEM(value, efs_blob_cntr_1) == NULL) {
9382 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->efs_blob[efs_blob_cntr_1]");
9383 0 : return -1;
9384 : }
9385 : {
9386 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->efs_blob[efs_blob_cntr_1]));
9387 0 : if (PyLong_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
9388 0 : unsigned long long test_var;
9389 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, efs_blob_cntr_1));
9390 0 : if (PyErr_Occurred() != NULL) {
9391 0 : return -1;
9392 : }
9393 0 : if (test_var > uint_max) {
9394 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9395 : PyLong_Type.tp_name, uint_max, test_var);
9396 0 : return -1;
9397 : }
9398 0 : object->efs_blob[efs_blob_cntr_1] = test_var;
9399 : } else {
9400 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9401 : PyLong_Type.tp_name);
9402 0 : return -1;
9403 : }
9404 : }
9405 : }
9406 : }
9407 : }
9408 0 : return 0;
9409 : }
9410 :
9411 : static PyGetSetDef py_lsa_DomainInfoEfs_getsetters[] = {
9412 : {
9413 : .name = discard_const_p(char, "blob_size"),
9414 : .get = py_lsa_DomainInfoEfs_get_blob_size,
9415 : .set = py_lsa_DomainInfoEfs_set_blob_size,
9416 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9417 : },
9418 : {
9419 : .name = discard_const_p(char, "efs_blob"),
9420 : .get = py_lsa_DomainInfoEfs_get_efs_blob,
9421 : .set = py_lsa_DomainInfoEfs_set_efs_blob,
9422 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9423 : },
9424 : { .name = NULL }
9425 : };
9426 :
9427 0 : static PyObject *py_lsa_DomainInfoEfs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9428 : {
9429 0 : return pytalloc_new(struct lsa_DomainInfoEfs, type);
9430 : }
9431 :
9432 :
9433 : static PyTypeObject lsa_DomainInfoEfs_Type = {
9434 : PyVarObject_HEAD_INIT(NULL, 0)
9435 : .tp_name = "lsa.DomainInfoEfs",
9436 : .tp_getset = py_lsa_DomainInfoEfs_getsetters,
9437 : .tp_methods = NULL,
9438 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9439 : .tp_new = py_lsa_DomainInfoEfs_new,
9440 : };
9441 :
9442 0 : static PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in)
9443 : {
9444 0 : PyObject *ret;
9445 :
9446 0 : switch (level) {
9447 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9448 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoEfs_Type, mem_ctx, &in->efs_info);
9449 0 : return ret;
9450 :
9451 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9452 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoKerberos_Type, mem_ctx, &in->kerberos_info);
9453 0 : return ret;
9454 :
9455 : }
9456 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9457 0 : return NULL;
9458 : }
9459 :
9460 0 : static union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9461 : {
9462 0 : union lsa_DomainInformationPolicy *ret = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy);
9463 0 : switch (level) {
9464 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9465 0 : if (in == NULL) {
9466 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->efs_info");
9467 0 : talloc_free(ret); return NULL;
9468 : }
9469 0 : PY_CHECK_TYPE(&lsa_DomainInfoEfs_Type, in, talloc_free(ret); return NULL;);
9470 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9471 0 : PyErr_NoMemory();
9472 0 : talloc_free(ret); return NULL;
9473 : }
9474 0 : ret->efs_info = *(struct lsa_DomainInfoEfs *)pytalloc_get_ptr(in);
9475 0 : break;
9476 :
9477 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9478 0 : if (in == NULL) {
9479 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->kerberos_info");
9480 0 : talloc_free(ret); return NULL;
9481 : }
9482 0 : PY_CHECK_TYPE(&lsa_DomainInfoKerberos_Type, in, talloc_free(ret); return NULL;);
9483 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9484 0 : PyErr_NoMemory();
9485 0 : talloc_free(ret); return NULL;
9486 : }
9487 0 : ret->kerberos_info = *(struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(in);
9488 0 : break;
9489 :
9490 0 : default:
9491 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9492 0 : talloc_free(ret);
9493 0 : ret = NULL;
9494 : }
9495 :
9496 0 : return ret;
9497 : }
9498 :
9499 0 : static PyObject *py_lsa_DomainInformationPolicy_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9500 : {
9501 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9502 0 : PyObject *mem_ctx_obj = NULL;
9503 0 : TALLOC_CTX *mem_ctx = NULL;
9504 0 : int level = 0;
9505 0 : PyObject *in_obj = NULL;
9506 0 : union lsa_DomainInformationPolicy *in = NULL;
9507 :
9508 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9509 : discard_const_p(char *, kwnames),
9510 : &mem_ctx_obj,
9511 : &level,
9512 : &in_obj)) {
9513 0 : return NULL;
9514 : }
9515 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9516 0 : if (mem_ctx == NULL) {
9517 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9518 0 : return NULL;
9519 : }
9520 0 : in = (union lsa_DomainInformationPolicy *)pytalloc_get_ptr(in_obj);
9521 0 : if (in == NULL) {
9522 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_DomainInformationPolicy!");
9523 0 : return NULL;
9524 : }
9525 :
9526 0 : return py_import_lsa_DomainInformationPolicy(mem_ctx, level, in);
9527 : }
9528 :
9529 0 : static PyObject *py_lsa_DomainInformationPolicy_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9530 : {
9531 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9532 0 : PyObject *mem_ctx_obj = NULL;
9533 0 : TALLOC_CTX *mem_ctx = NULL;
9534 0 : int level = 0;
9535 0 : PyObject *in = NULL;
9536 0 : union lsa_DomainInformationPolicy *out = NULL;
9537 :
9538 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9539 : discard_const_p(char *, kwnames),
9540 : &mem_ctx_obj,
9541 : &level,
9542 : &in)) {
9543 0 : return NULL;
9544 : }
9545 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9546 0 : if (mem_ctx == NULL) {
9547 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9548 0 : return NULL;
9549 : }
9550 :
9551 0 : out = py_export_lsa_DomainInformationPolicy(mem_ctx, level, in);
9552 0 : if (out == NULL) {
9553 0 : return NULL;
9554 : }
9555 :
9556 0 : return pytalloc_GenericObject_reference(out);
9557 : }
9558 :
9559 : static PyMethodDef py_lsa_DomainInformationPolicy_methods[] = {
9560 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_import),
9561 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9562 : "T.__import__(mem_ctx, level, in) => ret." },
9563 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_export),
9564 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9565 : "T.__export__(mem_ctx, level, in) => ret." },
9566 : { NULL, NULL, 0, NULL }
9567 : };
9568 :
9569 0 : static PyObject *py_lsa_DomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9570 : {
9571 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9572 0 : return NULL;
9573 : }
9574 :
9575 :
9576 : static PyTypeObject lsa_DomainInformationPolicy_Type = {
9577 : PyVarObject_HEAD_INIT(NULL, 0)
9578 : .tp_name = "lsa.DomainInformationPolicy",
9579 : .tp_getset = NULL,
9580 : .tp_methods = py_lsa_DomainInformationPolicy_methods,
9581 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9582 : .tp_new = py_lsa_DomainInformationPolicy_new,
9583 : };
9584 :
9585 :
9586 0 : static PyObject *py_lsa_TranslatedName2_get_sid_type(PyObject *obj, void *closure)
9587 : {
9588 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9589 0 : PyObject *py_sid_type;
9590 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
9591 0 : return py_sid_type;
9592 : }
9593 :
9594 0 : static int py_lsa_TranslatedName2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
9595 : {
9596 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9597 0 : if (value == NULL) {
9598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
9599 0 : return -1;
9600 : }
9601 : {
9602 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
9603 0 : if (PyLong_Check(value)) {
9604 0 : unsigned long long test_var;
9605 0 : test_var = PyLong_AsUnsignedLongLong(value);
9606 0 : if (PyErr_Occurred() != NULL) {
9607 0 : return -1;
9608 : }
9609 0 : if (test_var > uint_max) {
9610 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9611 : PyLong_Type.tp_name, uint_max, test_var);
9612 0 : return -1;
9613 : }
9614 0 : object->sid_type = test_var;
9615 : } else {
9616 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9617 : PyLong_Type.tp_name);
9618 0 : return -1;
9619 : }
9620 : }
9621 0 : return 0;
9622 : }
9623 :
9624 5 : static PyObject *py_lsa_TranslatedName2_get_name(PyObject *obj, void *closure)
9625 : {
9626 5 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9627 0 : PyObject *py_name;
9628 5 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
9629 5 : return py_name;
9630 : }
9631 :
9632 0 : static int py_lsa_TranslatedName2_set_name(PyObject *py_obj, PyObject *value, void *closure)
9633 : {
9634 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9635 0 : if (value == NULL) {
9636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
9637 0 : return -1;
9638 : }
9639 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
9640 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9641 0 : PyErr_NoMemory();
9642 0 : return -1;
9643 : }
9644 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
9645 0 : return 0;
9646 : }
9647 :
9648 0 : static PyObject *py_lsa_TranslatedName2_get_sid_index(PyObject *obj, void *closure)
9649 : {
9650 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9651 0 : PyObject *py_sid_index;
9652 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
9653 0 : return py_sid_index;
9654 : }
9655 :
9656 0 : static int py_lsa_TranslatedName2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
9657 : {
9658 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9659 0 : if (value == NULL) {
9660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
9661 0 : return -1;
9662 : }
9663 : {
9664 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
9665 0 : if (PyLong_Check(value)) {
9666 0 : unsigned long long test_var;
9667 0 : test_var = PyLong_AsUnsignedLongLong(value);
9668 0 : if (PyErr_Occurred() != NULL) {
9669 0 : return -1;
9670 : }
9671 0 : if (test_var > uint_max) {
9672 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9673 : PyLong_Type.tp_name, uint_max, test_var);
9674 0 : return -1;
9675 : }
9676 0 : object->sid_index = test_var;
9677 : } else {
9678 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9679 : PyLong_Type.tp_name);
9680 0 : return -1;
9681 : }
9682 : }
9683 0 : return 0;
9684 : }
9685 :
9686 0 : static PyObject *py_lsa_TranslatedName2_get_unknown(PyObject *obj, void *closure)
9687 : {
9688 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(obj);
9689 0 : PyObject *py_unknown;
9690 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
9691 0 : return py_unknown;
9692 : }
9693 :
9694 0 : static int py_lsa_TranslatedName2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
9695 : {
9696 0 : struct lsa_TranslatedName2 *object = (struct lsa_TranslatedName2 *)pytalloc_get_ptr(py_obj);
9697 0 : if (value == NULL) {
9698 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
9699 0 : return -1;
9700 : }
9701 : {
9702 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
9703 0 : if (PyLong_Check(value)) {
9704 0 : unsigned long long test_var;
9705 0 : test_var = PyLong_AsUnsignedLongLong(value);
9706 0 : if (PyErr_Occurred() != NULL) {
9707 0 : return -1;
9708 : }
9709 0 : if (test_var > uint_max) {
9710 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9711 : PyLong_Type.tp_name, uint_max, test_var);
9712 0 : return -1;
9713 : }
9714 0 : object->unknown = test_var;
9715 : } else {
9716 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9717 : PyLong_Type.tp_name);
9718 0 : return -1;
9719 : }
9720 : }
9721 0 : return 0;
9722 : }
9723 :
9724 : static PyGetSetDef py_lsa_TranslatedName2_getsetters[] = {
9725 : {
9726 : .name = discard_const_p(char, "sid_type"),
9727 : .get = py_lsa_TranslatedName2_get_sid_type,
9728 : .set = py_lsa_TranslatedName2_set_sid_type,
9729 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
9730 : },
9731 : {
9732 : .name = discard_const_p(char, "name"),
9733 : .get = py_lsa_TranslatedName2_get_name,
9734 : .set = py_lsa_TranslatedName2_set_name,
9735 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
9736 : },
9737 : {
9738 : .name = discard_const_p(char, "sid_index"),
9739 : .get = py_lsa_TranslatedName2_get_sid_index,
9740 : .set = py_lsa_TranslatedName2_set_sid_index,
9741 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9742 : },
9743 : {
9744 : .name = discard_const_p(char, "unknown"),
9745 : .get = py_lsa_TranslatedName2_get_unknown,
9746 : .set = py_lsa_TranslatedName2_set_unknown,
9747 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9748 : },
9749 : { .name = NULL }
9750 : };
9751 :
9752 0 : static PyObject *py_lsa_TranslatedName2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9753 : {
9754 0 : return pytalloc_new(struct lsa_TranslatedName2, type);
9755 : }
9756 :
9757 :
9758 : static PyTypeObject lsa_TranslatedName2_Type = {
9759 : PyVarObject_HEAD_INIT(NULL, 0)
9760 : .tp_name = "lsa.TranslatedName2",
9761 : .tp_getset = py_lsa_TranslatedName2_getsetters,
9762 : .tp_methods = NULL,
9763 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9764 : .tp_new = py_lsa_TranslatedName2_new,
9765 : };
9766 :
9767 :
9768 5 : static PyObject *py_lsa_TransNameArray2_get_count(PyObject *obj, void *closure)
9769 : {
9770 5 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
9771 0 : PyObject *py_count;
9772 5 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
9773 5 : return py_count;
9774 : }
9775 :
9776 0 : static int py_lsa_TransNameArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
9777 : {
9778 0 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
9779 0 : if (value == NULL) {
9780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
9781 0 : return -1;
9782 : }
9783 : {
9784 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9785 0 : if (PyLong_Check(value)) {
9786 0 : unsigned long long test_var;
9787 0 : test_var = PyLong_AsUnsignedLongLong(value);
9788 0 : if (PyErr_Occurred() != NULL) {
9789 0 : return -1;
9790 : }
9791 0 : if (test_var > uint_max) {
9792 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9793 : PyLong_Type.tp_name, uint_max, test_var);
9794 0 : return -1;
9795 : }
9796 0 : object->count = test_var;
9797 : } else {
9798 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9799 : PyLong_Type.tp_name);
9800 0 : return -1;
9801 : }
9802 : }
9803 0 : return 0;
9804 : }
9805 :
9806 5 : static PyObject *py_lsa_TransNameArray2_get_names(PyObject *obj, void *closure)
9807 : {
9808 5 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(obj);
9809 0 : PyObject *py_names;
9810 5 : if (object->names == NULL) {
9811 0 : Py_RETURN_NONE;
9812 : }
9813 5 : if (object->names == NULL) {
9814 0 : py_names = Py_None;
9815 0 : Py_INCREF(py_names);
9816 : } else {
9817 5 : py_names = PyList_New(object->count);
9818 5 : if (py_names == NULL) {
9819 0 : return NULL;
9820 : }
9821 : {
9822 : int names_cntr_1;
9823 10 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
9824 0 : PyObject *py_names_1;
9825 5 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName2_Type, object->names, &object->names[names_cntr_1]);
9826 5 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
9827 : }
9828 : }
9829 : }
9830 5 : return py_names;
9831 : }
9832 :
9833 0 : static int py_lsa_TransNameArray2_set_names(PyObject *py_obj, PyObject *value, void *closure)
9834 : {
9835 0 : struct lsa_TransNameArray2 *object = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_obj);
9836 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
9837 0 : if (value == NULL) {
9838 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names");
9839 0 : return -1;
9840 : }
9841 0 : if (value == Py_None) {
9842 0 : object->names = NULL;
9843 : } else {
9844 0 : object->names = NULL;
9845 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9846 : {
9847 0 : int names_cntr_1;
9848 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
9849 0 : if (!object->names) { return -1; }
9850 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
9851 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
9852 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
9853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->names[names_cntr_1]");
9854 0 : return -1;
9855 : }
9856 0 : PY_CHECK_TYPE(&lsa_TranslatedName2_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
9857 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
9858 0 : PyErr_NoMemory();
9859 0 : return -1;
9860 : }
9861 0 : object->names[names_cntr_1] = *(struct lsa_TranslatedName2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
9862 : }
9863 : }
9864 : }
9865 0 : return 0;
9866 : }
9867 :
9868 : static PyGetSetDef py_lsa_TransNameArray2_getsetters[] = {
9869 : {
9870 : .name = discard_const_p(char, "count"),
9871 : .get = py_lsa_TransNameArray2_get_count,
9872 : .set = py_lsa_TransNameArray2_set_count,
9873 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9874 : },
9875 : {
9876 : .name = discard_const_p(char, "names"),
9877 : .get = py_lsa_TransNameArray2_get_names,
9878 : .set = py_lsa_TransNameArray2_set_names,
9879 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName2")
9880 : },
9881 : { .name = NULL }
9882 : };
9883 :
9884 5 : static PyObject *py_lsa_TransNameArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9885 : {
9886 5 : return pytalloc_new(struct lsa_TransNameArray2, type);
9887 : }
9888 :
9889 :
9890 : static PyTypeObject lsa_TransNameArray2_Type = {
9891 : PyVarObject_HEAD_INIT(NULL, 0)
9892 : .tp_name = "lsa.TransNameArray2",
9893 : .tp_getset = py_lsa_TransNameArray2_getsetters,
9894 : .tp_methods = NULL,
9895 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9896 : .tp_new = py_lsa_TransNameArray2_new,
9897 : };
9898 :
9899 :
9900 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_type(PyObject *obj, void *closure)
9901 : {
9902 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9903 0 : PyObject *py_sid_type;
9904 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
9905 0 : return py_sid_type;
9906 : }
9907 :
9908 0 : static int py_lsa_TranslatedSid2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
9909 : {
9910 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9911 0 : if (value == NULL) {
9912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
9913 0 : return -1;
9914 : }
9915 : {
9916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
9917 0 : if (PyLong_Check(value)) {
9918 0 : unsigned long long test_var;
9919 0 : test_var = PyLong_AsUnsignedLongLong(value);
9920 0 : if (PyErr_Occurred() != NULL) {
9921 0 : return -1;
9922 : }
9923 0 : if (test_var > uint_max) {
9924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9925 : PyLong_Type.tp_name, uint_max, test_var);
9926 0 : return -1;
9927 : }
9928 0 : object->sid_type = test_var;
9929 : } else {
9930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9931 : PyLong_Type.tp_name);
9932 0 : return -1;
9933 : }
9934 : }
9935 0 : return 0;
9936 : }
9937 :
9938 0 : static PyObject *py_lsa_TranslatedSid2_get_rid(PyObject *obj, void *closure)
9939 : {
9940 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9941 0 : PyObject *py_rid;
9942 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
9943 0 : return py_rid;
9944 : }
9945 :
9946 0 : static int py_lsa_TranslatedSid2_set_rid(PyObject *py_obj, PyObject *value, void *closure)
9947 : {
9948 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9949 0 : if (value == NULL) {
9950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
9951 0 : return -1;
9952 : }
9953 : {
9954 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
9955 0 : if (PyLong_Check(value)) {
9956 0 : unsigned long long test_var;
9957 0 : test_var = PyLong_AsUnsignedLongLong(value);
9958 0 : if (PyErr_Occurred() != NULL) {
9959 0 : return -1;
9960 : }
9961 0 : if (test_var > uint_max) {
9962 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9963 : PyLong_Type.tp_name, uint_max, test_var);
9964 0 : return -1;
9965 : }
9966 0 : object->rid = test_var;
9967 : } else {
9968 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9969 : PyLong_Type.tp_name);
9970 0 : return -1;
9971 : }
9972 : }
9973 0 : return 0;
9974 : }
9975 :
9976 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_index(PyObject *obj, void *closure)
9977 : {
9978 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
9979 0 : PyObject *py_sid_index;
9980 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
9981 0 : return py_sid_index;
9982 : }
9983 :
9984 0 : static int py_lsa_TranslatedSid2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
9985 : {
9986 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
9987 0 : if (value == NULL) {
9988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
9989 0 : return -1;
9990 : }
9991 : {
9992 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
9993 0 : if (PyLong_Check(value)) {
9994 0 : unsigned long long test_var;
9995 0 : test_var = PyLong_AsUnsignedLongLong(value);
9996 0 : if (PyErr_Occurred() != NULL) {
9997 0 : return -1;
9998 : }
9999 0 : if (test_var > uint_max) {
10000 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10001 : PyLong_Type.tp_name, uint_max, test_var);
10002 0 : return -1;
10003 : }
10004 0 : object->sid_index = test_var;
10005 : } else {
10006 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10007 : PyLong_Type.tp_name);
10008 0 : return -1;
10009 : }
10010 : }
10011 0 : return 0;
10012 : }
10013 :
10014 0 : static PyObject *py_lsa_TranslatedSid2_get_unknown(PyObject *obj, void *closure)
10015 : {
10016 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(obj);
10017 0 : PyObject *py_unknown;
10018 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->unknown);
10019 0 : return py_unknown;
10020 : }
10021 :
10022 0 : static int py_lsa_TranslatedSid2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
10023 : {
10024 0 : struct lsa_TranslatedSid2 *object = (struct lsa_TranslatedSid2 *)pytalloc_get_ptr(py_obj);
10025 0 : if (value == NULL) {
10026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown");
10027 0 : return -1;
10028 : }
10029 : {
10030 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
10031 0 : if (PyLong_Check(value)) {
10032 0 : unsigned long long test_var;
10033 0 : test_var = PyLong_AsUnsignedLongLong(value);
10034 0 : if (PyErr_Occurred() != NULL) {
10035 0 : return -1;
10036 : }
10037 0 : if (test_var > uint_max) {
10038 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10039 : PyLong_Type.tp_name, uint_max, test_var);
10040 0 : return -1;
10041 : }
10042 0 : object->unknown = test_var;
10043 : } else {
10044 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10045 : PyLong_Type.tp_name);
10046 0 : return -1;
10047 : }
10048 : }
10049 0 : return 0;
10050 : }
10051 :
10052 : static PyGetSetDef py_lsa_TranslatedSid2_getsetters[] = {
10053 : {
10054 : .name = discard_const_p(char, "sid_type"),
10055 : .get = py_lsa_TranslatedSid2_get_sid_type,
10056 : .set = py_lsa_TranslatedSid2_set_sid_type,
10057 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10058 : },
10059 : {
10060 : .name = discard_const_p(char, "rid"),
10061 : .get = py_lsa_TranslatedSid2_get_rid,
10062 : .set = py_lsa_TranslatedSid2_set_rid,
10063 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10064 : },
10065 : {
10066 : .name = discard_const_p(char, "sid_index"),
10067 : .get = py_lsa_TranslatedSid2_get_sid_index,
10068 : .set = py_lsa_TranslatedSid2_set_sid_index,
10069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10070 : },
10071 : {
10072 : .name = discard_const_p(char, "unknown"),
10073 : .get = py_lsa_TranslatedSid2_get_unknown,
10074 : .set = py_lsa_TranslatedSid2_set_unknown,
10075 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10076 : },
10077 : { .name = NULL }
10078 : };
10079 :
10080 0 : static PyObject *py_lsa_TranslatedSid2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10081 : {
10082 0 : return pytalloc_new(struct lsa_TranslatedSid2, type);
10083 : }
10084 :
10085 :
10086 : static PyTypeObject lsa_TranslatedSid2_Type = {
10087 : PyVarObject_HEAD_INIT(NULL, 0)
10088 : .tp_name = "lsa.TranslatedSid2",
10089 : .tp_getset = py_lsa_TranslatedSid2_getsetters,
10090 : .tp_methods = NULL,
10091 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10092 : .tp_new = py_lsa_TranslatedSid2_new,
10093 : };
10094 :
10095 :
10096 0 : static PyObject *py_lsa_TransSidArray2_get_count(PyObject *obj, void *closure)
10097 : {
10098 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
10099 0 : PyObject *py_count;
10100 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10101 0 : return py_count;
10102 : }
10103 :
10104 0 : static int py_lsa_TransSidArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
10105 : {
10106 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
10107 0 : if (value == NULL) {
10108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10109 0 : return -1;
10110 : }
10111 : {
10112 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10113 0 : if (PyLong_Check(value)) {
10114 0 : unsigned long long test_var;
10115 0 : test_var = PyLong_AsUnsignedLongLong(value);
10116 0 : if (PyErr_Occurred() != NULL) {
10117 0 : return -1;
10118 : }
10119 0 : if (test_var > uint_max) {
10120 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10121 : PyLong_Type.tp_name, uint_max, test_var);
10122 0 : return -1;
10123 : }
10124 0 : object->count = test_var;
10125 : } else {
10126 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10127 : PyLong_Type.tp_name);
10128 0 : return -1;
10129 : }
10130 : }
10131 0 : return 0;
10132 : }
10133 :
10134 0 : static PyObject *py_lsa_TransSidArray2_get_sids(PyObject *obj, void *closure)
10135 : {
10136 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(obj);
10137 0 : PyObject *py_sids;
10138 0 : if (object->sids == NULL) {
10139 0 : Py_RETURN_NONE;
10140 : }
10141 0 : if (object->sids == NULL) {
10142 0 : py_sids = Py_None;
10143 0 : Py_INCREF(py_sids);
10144 : } else {
10145 0 : py_sids = PyList_New(object->count);
10146 0 : if (py_sids == NULL) {
10147 0 : return NULL;
10148 : }
10149 : {
10150 : int sids_cntr_1;
10151 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10152 0 : PyObject *py_sids_1;
10153 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid2_Type, object->sids, &object->sids[sids_cntr_1]);
10154 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10155 : }
10156 : }
10157 : }
10158 0 : return py_sids;
10159 : }
10160 :
10161 0 : static int py_lsa_TransSidArray2_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10162 : {
10163 0 : struct lsa_TransSidArray2 *object = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_obj);
10164 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10165 0 : if (value == NULL) {
10166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
10167 0 : return -1;
10168 : }
10169 0 : if (value == Py_None) {
10170 0 : object->sids = NULL;
10171 : } else {
10172 0 : object->sids = NULL;
10173 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10174 : {
10175 0 : int sids_cntr_1;
10176 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10177 0 : if (!object->sids) { return -1; }
10178 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10179 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10180 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
10182 0 : return -1;
10183 : }
10184 0 : PY_CHECK_TYPE(&lsa_TranslatedSid2_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10185 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10186 0 : PyErr_NoMemory();
10187 0 : return -1;
10188 : }
10189 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10190 : }
10191 : }
10192 : }
10193 0 : return 0;
10194 : }
10195 :
10196 : static PyGetSetDef py_lsa_TransSidArray2_getsetters[] = {
10197 : {
10198 : .name = discard_const_p(char, "count"),
10199 : .get = py_lsa_TransSidArray2_get_count,
10200 : .set = py_lsa_TransSidArray2_set_count,
10201 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10202 : },
10203 : {
10204 : .name = discard_const_p(char, "sids"),
10205 : .get = py_lsa_TransSidArray2_get_sids,
10206 : .set = py_lsa_TransSidArray2_set_sids,
10207 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid2")
10208 : },
10209 : { .name = NULL }
10210 : };
10211 :
10212 0 : static PyObject *py_lsa_TransSidArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10213 : {
10214 0 : return pytalloc_new(struct lsa_TransSidArray2, type);
10215 : }
10216 :
10217 :
10218 : static PyTypeObject lsa_TransSidArray2_Type = {
10219 : PyVarObject_HEAD_INIT(NULL, 0)
10220 : .tp_name = "lsa.TransSidArray2",
10221 : .tp_getset = py_lsa_TransSidArray2_getsetters,
10222 : .tp_methods = NULL,
10223 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10224 : .tp_new = py_lsa_TransSidArray2_new,
10225 : };
10226 :
10227 :
10228 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_type(PyObject *obj, void *closure)
10229 : {
10230 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10231 0 : PyObject *py_sid_type;
10232 0 : py_sid_type = PyLong_FromLong((uint16_t)object->sid_type);
10233 0 : return py_sid_type;
10234 : }
10235 :
10236 0 : static int py_lsa_TranslatedSid3_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
10237 : {
10238 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10239 0 : if (value == NULL) {
10240 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_type");
10241 0 : return -1;
10242 : }
10243 : {
10244 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
10245 0 : if (PyLong_Check(value)) {
10246 0 : unsigned long long test_var;
10247 0 : test_var = PyLong_AsUnsignedLongLong(value);
10248 0 : if (PyErr_Occurred() != NULL) {
10249 0 : return -1;
10250 : }
10251 0 : if (test_var > uint_max) {
10252 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10253 : PyLong_Type.tp_name, uint_max, test_var);
10254 0 : return -1;
10255 : }
10256 0 : object->sid_type = test_var;
10257 : } else {
10258 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10259 : PyLong_Type.tp_name);
10260 0 : return -1;
10261 : }
10262 : }
10263 0 : return 0;
10264 : }
10265 :
10266 1 : static PyObject *py_lsa_TranslatedSid3_get_sid(PyObject *obj, void *closure)
10267 : {
10268 1 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10269 0 : PyObject *py_sid;
10270 1 : if (object->sid == NULL) {
10271 0 : Py_RETURN_NONE;
10272 : }
10273 1 : if (object->sid == NULL) {
10274 0 : py_sid = Py_None;
10275 0 : Py_INCREF(py_sid);
10276 : } else {
10277 1 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
10278 : }
10279 1 : return py_sid;
10280 : }
10281 :
10282 0 : static int py_lsa_TranslatedSid3_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10283 : {
10284 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10285 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
10286 0 : if (value == NULL) {
10287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid");
10288 0 : return -1;
10289 : }
10290 0 : if (value == Py_None) {
10291 0 : object->sid = NULL;
10292 : } else {
10293 0 : object->sid = NULL;
10294 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10295 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10296 0 : PyErr_NoMemory();
10297 0 : return -1;
10298 : }
10299 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
10300 : }
10301 0 : return 0;
10302 : }
10303 :
10304 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_index(PyObject *obj, void *closure)
10305 : {
10306 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10307 0 : PyObject *py_sid_index;
10308 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)object->sid_index);
10309 0 : return py_sid_index;
10310 : }
10311 :
10312 0 : static int py_lsa_TranslatedSid3_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
10313 : {
10314 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10315 0 : if (value == NULL) {
10316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sid_index");
10317 0 : return -1;
10318 : }
10319 : {
10320 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
10321 0 : if (PyLong_Check(value)) {
10322 0 : unsigned long long test_var;
10323 0 : test_var = PyLong_AsUnsignedLongLong(value);
10324 0 : if (PyErr_Occurred() != NULL) {
10325 0 : return -1;
10326 : }
10327 0 : if (test_var > uint_max) {
10328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10329 : PyLong_Type.tp_name, uint_max, test_var);
10330 0 : return -1;
10331 : }
10332 0 : object->sid_index = test_var;
10333 : } else {
10334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10335 : PyLong_Type.tp_name);
10336 0 : return -1;
10337 : }
10338 : }
10339 0 : return 0;
10340 : }
10341 :
10342 0 : static PyObject *py_lsa_TranslatedSid3_get_flags(PyObject *obj, void *closure)
10343 : {
10344 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(obj);
10345 0 : PyObject *py_flags;
10346 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
10347 0 : return py_flags;
10348 : }
10349 :
10350 0 : static int py_lsa_TranslatedSid3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
10351 : {
10352 0 : struct lsa_TranslatedSid3 *object = (struct lsa_TranslatedSid3 *)pytalloc_get_ptr(py_obj);
10353 0 : if (value == NULL) {
10354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
10355 0 : return -1;
10356 : }
10357 : {
10358 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
10359 0 : if (PyLong_Check(value)) {
10360 0 : unsigned long long test_var;
10361 0 : test_var = PyLong_AsUnsignedLongLong(value);
10362 0 : if (PyErr_Occurred() != NULL) {
10363 0 : return -1;
10364 : }
10365 0 : if (test_var > uint_max) {
10366 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10367 : PyLong_Type.tp_name, uint_max, test_var);
10368 0 : return -1;
10369 : }
10370 0 : object->flags = test_var;
10371 : } else {
10372 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10373 : PyLong_Type.tp_name);
10374 0 : return -1;
10375 : }
10376 : }
10377 0 : return 0;
10378 : }
10379 :
10380 : static PyGetSetDef py_lsa_TranslatedSid3_getsetters[] = {
10381 : {
10382 : .name = discard_const_p(char, "sid_type"),
10383 : .get = py_lsa_TranslatedSid3_get_sid_type,
10384 : .set = py_lsa_TranslatedSid3_set_sid_type,
10385 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10386 : },
10387 : {
10388 : .name = discard_const_p(char, "sid"),
10389 : .get = py_lsa_TranslatedSid3_get_sid,
10390 : .set = py_lsa_TranslatedSid3_set_sid,
10391 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
10392 : },
10393 : {
10394 : .name = discard_const_p(char, "sid_index"),
10395 : .get = py_lsa_TranslatedSid3_get_sid_index,
10396 : .set = py_lsa_TranslatedSid3_set_sid_index,
10397 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10398 : },
10399 : {
10400 : .name = discard_const_p(char, "flags"),
10401 : .get = py_lsa_TranslatedSid3_get_flags,
10402 : .set = py_lsa_TranslatedSid3_set_flags,
10403 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10404 : },
10405 : { .name = NULL }
10406 : };
10407 :
10408 0 : static PyObject *py_lsa_TranslatedSid3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10409 : {
10410 0 : return pytalloc_new(struct lsa_TranslatedSid3, type);
10411 : }
10412 :
10413 :
10414 : static PyTypeObject lsa_TranslatedSid3_Type = {
10415 : PyVarObject_HEAD_INIT(NULL, 0)
10416 : .tp_name = "lsa.TranslatedSid3",
10417 : .tp_getset = py_lsa_TranslatedSid3_getsetters,
10418 : .tp_methods = NULL,
10419 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10420 : .tp_new = py_lsa_TranslatedSid3_new,
10421 : };
10422 :
10423 :
10424 1 : static PyObject *py_lsa_TransSidArray3_get_count(PyObject *obj, void *closure)
10425 : {
10426 1 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
10427 0 : PyObject *py_count;
10428 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10429 1 : return py_count;
10430 : }
10431 :
10432 0 : static int py_lsa_TransSidArray3_set_count(PyObject *py_obj, PyObject *value, void *closure)
10433 : {
10434 0 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
10435 0 : if (value == NULL) {
10436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10437 0 : return -1;
10438 : }
10439 : {
10440 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10441 0 : if (PyLong_Check(value)) {
10442 0 : unsigned long long test_var;
10443 0 : test_var = PyLong_AsUnsignedLongLong(value);
10444 0 : if (PyErr_Occurred() != NULL) {
10445 0 : return -1;
10446 : }
10447 0 : if (test_var > uint_max) {
10448 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10449 : PyLong_Type.tp_name, uint_max, test_var);
10450 0 : return -1;
10451 : }
10452 0 : object->count = test_var;
10453 : } else {
10454 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10455 : PyLong_Type.tp_name);
10456 0 : return -1;
10457 : }
10458 : }
10459 0 : return 0;
10460 : }
10461 :
10462 1 : static PyObject *py_lsa_TransSidArray3_get_sids(PyObject *obj, void *closure)
10463 : {
10464 1 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(obj);
10465 0 : PyObject *py_sids;
10466 1 : if (object->sids == NULL) {
10467 0 : Py_RETURN_NONE;
10468 : }
10469 1 : if (object->sids == NULL) {
10470 0 : py_sids = Py_None;
10471 0 : Py_INCREF(py_sids);
10472 : } else {
10473 1 : py_sids = PyList_New(object->count);
10474 1 : if (py_sids == NULL) {
10475 0 : return NULL;
10476 : }
10477 : {
10478 : int sids_cntr_1;
10479 2 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10480 0 : PyObject *py_sids_1;
10481 1 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid3_Type, object->sids, &object->sids[sids_cntr_1]);
10482 1 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10483 : }
10484 : }
10485 : }
10486 1 : return py_sids;
10487 : }
10488 :
10489 0 : static int py_lsa_TransSidArray3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10490 : {
10491 0 : struct lsa_TransSidArray3 *object = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_obj);
10492 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10493 0 : if (value == NULL) {
10494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids");
10495 0 : return -1;
10496 : }
10497 0 : if (value == Py_None) {
10498 0 : object->sids = NULL;
10499 : } else {
10500 0 : object->sids = NULL;
10501 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10502 : {
10503 0 : int sids_cntr_1;
10504 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10505 0 : if (!object->sids) { return -1; }
10506 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10507 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10508 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sids[sids_cntr_1]");
10510 0 : return -1;
10511 : }
10512 0 : PY_CHECK_TYPE(&lsa_TranslatedSid3_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10513 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10514 0 : PyErr_NoMemory();
10515 0 : return -1;
10516 : }
10517 0 : object->sids[sids_cntr_1] = *(struct lsa_TranslatedSid3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10518 : }
10519 : }
10520 : }
10521 0 : return 0;
10522 : }
10523 :
10524 : static PyGetSetDef py_lsa_TransSidArray3_getsetters[] = {
10525 : {
10526 : .name = discard_const_p(char, "count"),
10527 : .get = py_lsa_TransSidArray3_get_count,
10528 : .set = py_lsa_TransSidArray3_set_count,
10529 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10530 : },
10531 : {
10532 : .name = discard_const_p(char, "sids"),
10533 : .get = py_lsa_TransSidArray3_get_sids,
10534 : .set = py_lsa_TransSidArray3_set_sids,
10535 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid3")
10536 : },
10537 : { .name = NULL }
10538 : };
10539 :
10540 6 : static PyObject *py_lsa_TransSidArray3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10541 : {
10542 6 : return pytalloc_new(struct lsa_TransSidArray3, type);
10543 : }
10544 :
10545 :
10546 : static PyTypeObject lsa_TransSidArray3_Type = {
10547 : PyVarObject_HEAD_INIT(NULL, 0)
10548 : .tp_name = "lsa.TransSidArray3",
10549 : .tp_getset = py_lsa_TransSidArray3_getsetters,
10550 : .tp_methods = NULL,
10551 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10552 : .tp_new = py_lsa_TransSidArray3_new,
10553 : };
10554 :
10555 :
10556 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_length(PyObject *obj, void *closure)
10557 : {
10558 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
10559 0 : PyObject *py_length;
10560 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
10561 0 : return py_length;
10562 : }
10563 :
10564 0 : static int py_lsa_ForestTrustBinaryData_set_length(PyObject *py_obj, PyObject *value, void *closure)
10565 : {
10566 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
10567 0 : if (value == NULL) {
10568 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
10569 0 : return -1;
10570 : }
10571 : {
10572 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
10573 0 : if (PyLong_Check(value)) {
10574 0 : unsigned long long test_var;
10575 0 : test_var = PyLong_AsUnsignedLongLong(value);
10576 0 : if (PyErr_Occurred() != NULL) {
10577 0 : return -1;
10578 : }
10579 0 : if (test_var > uint_max) {
10580 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10581 : PyLong_Type.tp_name, uint_max, test_var);
10582 0 : return -1;
10583 : }
10584 0 : object->length = test_var;
10585 : } else {
10586 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10587 : PyLong_Type.tp_name);
10588 0 : return -1;
10589 : }
10590 : }
10591 0 : return 0;
10592 : }
10593 :
10594 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_data(PyObject *obj, void *closure)
10595 : {
10596 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(obj);
10597 0 : PyObject *py_data;
10598 0 : if (object->data == NULL) {
10599 0 : Py_RETURN_NONE;
10600 : }
10601 0 : if (object->data == NULL) {
10602 0 : py_data = Py_None;
10603 0 : Py_INCREF(py_data);
10604 : } else {
10605 0 : py_data = PyList_New(object->length);
10606 0 : if (py_data == NULL) {
10607 0 : return NULL;
10608 : }
10609 : {
10610 : int data_cntr_1;
10611 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
10612 0 : PyObject *py_data_1;
10613 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
10614 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
10615 : }
10616 : }
10617 : }
10618 0 : return py_data;
10619 : }
10620 :
10621 0 : static int py_lsa_ForestTrustBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
10622 : {
10623 0 : struct lsa_ForestTrustBinaryData *object = (struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(py_obj);
10624 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
10625 0 : if (value == NULL) {
10626 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
10627 0 : return -1;
10628 : }
10629 0 : if (value == Py_None) {
10630 0 : object->data = NULL;
10631 : } else {
10632 0 : object->data = NULL;
10633 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10634 : {
10635 0 : int data_cntr_1;
10636 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
10637 0 : if (!object->data) { return -1; }
10638 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
10639 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
10640 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
10641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
10642 0 : return -1;
10643 : }
10644 : {
10645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
10646 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
10647 0 : unsigned long long test_var;
10648 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
10649 0 : if (PyErr_Occurred() != NULL) {
10650 0 : return -1;
10651 : }
10652 0 : if (test_var > uint_max) {
10653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10654 : PyLong_Type.tp_name, uint_max, test_var);
10655 0 : return -1;
10656 : }
10657 0 : object->data[data_cntr_1] = test_var;
10658 : } else {
10659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10660 : PyLong_Type.tp_name);
10661 0 : return -1;
10662 : }
10663 : }
10664 : }
10665 : }
10666 : }
10667 0 : return 0;
10668 : }
10669 :
10670 : static PyGetSetDef py_lsa_ForestTrustBinaryData_getsetters[] = {
10671 : {
10672 : .name = discard_const_p(char, "length"),
10673 : .get = py_lsa_ForestTrustBinaryData_get_length,
10674 : .set = py_lsa_ForestTrustBinaryData_set_length,
10675 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
10676 : },
10677 : {
10678 : .name = discard_const_p(char, "data"),
10679 : .get = py_lsa_ForestTrustBinaryData_get_data,
10680 : .set = py_lsa_ForestTrustBinaryData_set_data,
10681 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
10682 : },
10683 : { .name = NULL }
10684 : };
10685 :
10686 0 : static PyObject *py_lsa_ForestTrustBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10687 : {
10688 0 : return pytalloc_new(struct lsa_ForestTrustBinaryData, type);
10689 : }
10690 :
10691 :
10692 : static PyTypeObject lsa_ForestTrustBinaryData_Type = {
10693 : PyVarObject_HEAD_INIT(NULL, 0)
10694 : .tp_name = "lsa.ForestTrustBinaryData",
10695 : .tp_getset = py_lsa_ForestTrustBinaryData_getsetters,
10696 : .tp_methods = NULL,
10697 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10698 : .tp_new = py_lsa_ForestTrustBinaryData_new,
10699 : };
10700 :
10701 :
10702 334 : static PyObject *py_lsa_ForestTrustDomainInfo_get_domain_sid(PyObject *obj, void *closure)
10703 : {
10704 334 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10705 4 : PyObject *py_domain_sid;
10706 334 : if (object->domain_sid == NULL) {
10707 0 : Py_RETURN_NONE;
10708 : }
10709 334 : if (object->domain_sid == NULL) {
10710 0 : py_domain_sid = Py_None;
10711 0 : Py_INCREF(py_domain_sid);
10712 : } else {
10713 334 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
10714 : }
10715 334 : return py_domain_sid;
10716 : }
10717 :
10718 0 : static int py_lsa_ForestTrustDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
10719 : {
10720 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10721 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
10722 0 : if (value == NULL) {
10723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
10724 0 : return -1;
10725 : }
10726 0 : if (value == Py_None) {
10727 0 : object->domain_sid = NULL;
10728 : } else {
10729 0 : object->domain_sid = NULL;
10730 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10731 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10732 0 : PyErr_NoMemory();
10733 0 : return -1;
10734 : }
10735 0 : object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
10736 : }
10737 0 : return 0;
10738 : }
10739 :
10740 326 : static PyObject *py_lsa_ForestTrustDomainInfo_get_dns_domain_name(PyObject *obj, void *closure)
10741 : {
10742 326 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10743 4 : PyObject *py_dns_domain_name;
10744 326 : py_dns_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain_name);
10745 326 : return py_dns_domain_name;
10746 : }
10747 :
10748 0 : static int py_lsa_ForestTrustDomainInfo_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
10749 : {
10750 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10751 0 : if (value == NULL) {
10752 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name");
10753 0 : return -1;
10754 : }
10755 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
10756 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10757 0 : PyErr_NoMemory();
10758 0 : return -1;
10759 : }
10760 0 : object->dns_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
10761 0 : return 0;
10762 : }
10763 :
10764 334 : static PyObject *py_lsa_ForestTrustDomainInfo_get_netbios_domain_name(PyObject *obj, void *closure)
10765 : {
10766 334 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(obj);
10767 4 : PyObject *py_netbios_domain_name;
10768 334 : py_netbios_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_domain_name);
10769 334 : return py_netbios_domain_name;
10770 : }
10771 :
10772 0 : static int py_lsa_ForestTrustDomainInfo_set_netbios_domain_name(PyObject *py_obj, PyObject *value, void *closure)
10773 : {
10774 0 : struct lsa_ForestTrustDomainInfo *object = (struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(py_obj);
10775 0 : if (value == NULL) {
10776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->netbios_domain_name");
10777 0 : return -1;
10778 : }
10779 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
10780 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10781 0 : PyErr_NoMemory();
10782 0 : return -1;
10783 : }
10784 0 : object->netbios_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
10785 0 : return 0;
10786 : }
10787 :
10788 : static PyGetSetDef py_lsa_ForestTrustDomainInfo_getsetters[] = {
10789 : {
10790 : .name = discard_const_p(char, "domain_sid"),
10791 : .get = py_lsa_ForestTrustDomainInfo_get_domain_sid,
10792 : .set = py_lsa_ForestTrustDomainInfo_set_domain_sid,
10793 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
10794 : },
10795 : {
10796 : .name = discard_const_p(char, "dns_domain_name"),
10797 : .get = py_lsa_ForestTrustDomainInfo_get_dns_domain_name,
10798 : .set = py_lsa_ForestTrustDomainInfo_set_dns_domain_name,
10799 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
10800 : },
10801 : {
10802 : .name = discard_const_p(char, "netbios_domain_name"),
10803 : .get = py_lsa_ForestTrustDomainInfo_get_netbios_domain_name,
10804 : .set = py_lsa_ForestTrustDomainInfo_set_netbios_domain_name,
10805 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
10806 : },
10807 : { .name = NULL }
10808 : };
10809 :
10810 0 : static PyObject *py_lsa_ForestTrustDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10811 : {
10812 0 : return pytalloc_new(struct lsa_ForestTrustDomainInfo, type);
10813 : }
10814 :
10815 :
10816 : static PyTypeObject lsa_ForestTrustDomainInfo_Type = {
10817 : PyVarObject_HEAD_INIT(NULL, 0)
10818 : .tp_name = "lsa.ForestTrustDomainInfo",
10819 : .tp_getset = py_lsa_ForestTrustDomainInfo_getsetters,
10820 : .tp_methods = NULL,
10821 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10822 : .tp_new = py_lsa_ForestTrustDomainInfo_new,
10823 : };
10824 :
10825 1982 : static PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in)
10826 : {
10827 12 : PyObject *ret;
10828 :
10829 1982 : switch (level) {
10830 1560 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
10831 1560 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
10832 1560 : return ret;
10833 :
10834 80 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
10835 80 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
10836 80 : return ret;
10837 :
10838 342 : case LSA_FOREST_TRUST_DOMAIN_INFO:
10839 342 : ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
10840 342 : return ret;
10841 :
10842 0 : default:
10843 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
10844 0 : return ret;
10845 :
10846 : }
10847 : PyErr_SetString(PyExc_TypeError, "unknown union level");
10848 : return NULL;
10849 : }
10850 :
10851 0 : static union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
10852 : {
10853 0 : union lsa_ForestTrustData *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData);
10854 0 : switch (level) {
10855 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
10856 0 : if (in == NULL) {
10857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->top_level_name");
10858 0 : talloc_free(ret); return NULL;
10859 : }
10860 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
10861 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10862 0 : PyErr_NoMemory();
10863 0 : talloc_free(ret); return NULL;
10864 : }
10865 0 : ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
10866 0 : break;
10867 :
10868 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
10869 0 : if (in == NULL) {
10870 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->top_level_name_ex");
10871 0 : talloc_free(ret); return NULL;
10872 : }
10873 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
10874 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10875 0 : PyErr_NoMemory();
10876 0 : talloc_free(ret); return NULL;
10877 : }
10878 0 : ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
10879 0 : break;
10880 :
10881 0 : case LSA_FOREST_TRUST_DOMAIN_INFO:
10882 0 : if (in == NULL) {
10883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->domain_info");
10884 0 : talloc_free(ret); return NULL;
10885 : }
10886 0 : PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
10887 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10888 0 : PyErr_NoMemory();
10889 0 : talloc_free(ret); return NULL;
10890 : }
10891 0 : ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
10892 0 : break;
10893 :
10894 0 : default:
10895 0 : if (in == NULL) {
10896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->data");
10897 0 : talloc_free(ret); return NULL;
10898 : }
10899 0 : PY_CHECK_TYPE(&lsa_ForestTrustBinaryData_Type, in, talloc_free(ret); return NULL;);
10900 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
10901 0 : PyErr_NoMemory();
10902 0 : talloc_free(ret); return NULL;
10903 : }
10904 0 : ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
10905 0 : break;
10906 :
10907 : }
10908 :
10909 0 : return ret;
10910 : }
10911 :
10912 1982 : static PyObject *py_lsa_ForestTrustData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10913 : {
10914 1982 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10915 1982 : PyObject *mem_ctx_obj = NULL;
10916 1982 : TALLOC_CTX *mem_ctx = NULL;
10917 1982 : int level = 0;
10918 1982 : PyObject *in_obj = NULL;
10919 1982 : union lsa_ForestTrustData *in = NULL;
10920 :
10921 1982 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
10922 : discard_const_p(char *, kwnames),
10923 : &mem_ctx_obj,
10924 : &level,
10925 : &in_obj)) {
10926 0 : return NULL;
10927 : }
10928 1982 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10929 1982 : if (mem_ctx == NULL) {
10930 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10931 0 : return NULL;
10932 : }
10933 1982 : in = (union lsa_ForestTrustData *)pytalloc_get_ptr(in_obj);
10934 1982 : if (in == NULL) {
10935 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_ForestTrustData!");
10936 0 : return NULL;
10937 : }
10938 :
10939 1982 : return py_import_lsa_ForestTrustData(mem_ctx, level, in);
10940 : }
10941 :
10942 0 : static PyObject *py_lsa_ForestTrustData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10943 : {
10944 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
10945 0 : PyObject *mem_ctx_obj = NULL;
10946 0 : TALLOC_CTX *mem_ctx = NULL;
10947 0 : int level = 0;
10948 0 : PyObject *in = NULL;
10949 0 : union lsa_ForestTrustData *out = NULL;
10950 :
10951 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
10952 : discard_const_p(char *, kwnames),
10953 : &mem_ctx_obj,
10954 : &level,
10955 : &in)) {
10956 0 : return NULL;
10957 : }
10958 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
10959 0 : if (mem_ctx == NULL) {
10960 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
10961 0 : return NULL;
10962 : }
10963 :
10964 0 : out = py_export_lsa_ForestTrustData(mem_ctx, level, in);
10965 0 : if (out == NULL) {
10966 0 : return NULL;
10967 : }
10968 :
10969 0 : return pytalloc_GenericObject_reference(out);
10970 : }
10971 :
10972 : static PyMethodDef py_lsa_ForestTrustData_methods[] = {
10973 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_import),
10974 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10975 : "T.__import__(mem_ctx, level, in) => ret." },
10976 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_export),
10977 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
10978 : "T.__export__(mem_ctx, level, in) => ret." },
10979 : { NULL, NULL, 0, NULL }
10980 : };
10981 :
10982 0 : static PyObject *py_lsa_ForestTrustData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10983 : {
10984 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
10985 0 : return NULL;
10986 : }
10987 :
10988 :
10989 : static PyTypeObject lsa_ForestTrustData_Type = {
10990 : PyVarObject_HEAD_INIT(NULL, 0)
10991 : .tp_name = "lsa.ForestTrustData",
10992 : .tp_getset = NULL,
10993 : .tp_methods = py_lsa_ForestTrustData_methods,
10994 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10995 : .tp_new = py_lsa_ForestTrustData_new,
10996 : };
10997 :
10998 :
10999 1922 : static PyObject *py_lsa_ForestTrustRecord_get_flags(PyObject *obj, void *closure)
11000 : {
11001 1922 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11002 12 : PyObject *py_flags;
11003 1922 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
11004 1922 : return py_flags;
11005 : }
11006 :
11007 52 : static int py_lsa_ForestTrustRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11008 : {
11009 52 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11010 52 : if (value == NULL) {
11011 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
11012 0 : return -1;
11013 : }
11014 : {
11015 52 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11016 52 : if (PyLong_Check(value)) {
11017 0 : unsigned long long test_var;
11018 52 : test_var = PyLong_AsUnsignedLongLong(value);
11019 52 : if (PyErr_Occurred() != NULL) {
11020 0 : return -1;
11021 : }
11022 52 : if (test_var > uint_max) {
11023 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11024 : PyLong_Type.tp_name, uint_max, test_var);
11025 0 : return -1;
11026 : }
11027 52 : object->flags = test_var;
11028 : } else {
11029 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11030 : PyLong_Type.tp_name);
11031 0 : return -1;
11032 : }
11033 : }
11034 52 : return 0;
11035 : }
11036 :
11037 2866 : static PyObject *py_lsa_ForestTrustRecord_get_type(PyObject *obj, void *closure)
11038 : {
11039 2866 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11040 20 : PyObject *py_type;
11041 2866 : py_type = PyLong_FromLong((uint16_t)object->type);
11042 2866 : return py_type;
11043 : }
11044 :
11045 8 : static int py_lsa_ForestTrustRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11046 : {
11047 8 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11048 8 : if (value == NULL) {
11049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
11050 0 : return -1;
11051 : }
11052 : {
11053 8 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11054 8 : if (PyLong_Check(value)) {
11055 0 : unsigned long long test_var;
11056 8 : test_var = PyLong_AsUnsignedLongLong(value);
11057 8 : if (PyErr_Occurred() != NULL) {
11058 0 : return -1;
11059 : }
11060 8 : if (test_var > uint_max) {
11061 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11062 : PyLong_Type.tp_name, uint_max, test_var);
11063 0 : return -1;
11064 : }
11065 8 : object->type = test_var;
11066 : } else {
11067 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11068 : PyLong_Type.tp_name);
11069 0 : return -1;
11070 : }
11071 : }
11072 8 : return 0;
11073 : }
11074 :
11075 0 : static PyObject *py_lsa_ForestTrustRecord_get_time(PyObject *obj, void *closure)
11076 : {
11077 0 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11078 0 : PyObject *py_time;
11079 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
11080 0 : return py_time;
11081 : }
11082 :
11083 40 : static int py_lsa_ForestTrustRecord_set_time(PyObject *py_obj, PyObject *value, void *closure)
11084 : {
11085 40 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11086 40 : if (value == NULL) {
11087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
11088 0 : return -1;
11089 : }
11090 : {
11091 40 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
11092 40 : if (PyLong_Check(value)) {
11093 0 : unsigned long long test_var;
11094 40 : test_var = PyLong_AsUnsignedLongLong(value);
11095 40 : if (PyErr_Occurred() != NULL) {
11096 0 : return -1;
11097 : }
11098 40 : if (test_var > uint_max) {
11099 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11100 : PyLong_Type.tp_name, uint_max, test_var);
11101 0 : return -1;
11102 : }
11103 40 : object->time = test_var;
11104 : } else {
11105 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11106 : PyLong_Type.tp_name);
11107 0 : return -1;
11108 : }
11109 : }
11110 40 : return 0;
11111 : }
11112 :
11113 1982 : static PyObject *py_lsa_ForestTrustRecord_get_forest_trust_data(PyObject *obj, void *closure)
11114 : {
11115 1982 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(obj);
11116 12 : PyObject *py_forest_trust_data;
11117 1982 : py_forest_trust_data = pyrpc_import_union(&lsa_ForestTrustData_Type, pytalloc_get_mem_ctx(obj), object->type, &object->forest_trust_data, "union lsa_ForestTrustData");
11118 1982 : if (py_forest_trust_data == NULL) {
11119 0 : return NULL;
11120 : }
11121 1970 : return py_forest_trust_data;
11122 : }
11123 :
11124 0 : static int py_lsa_ForestTrustRecord_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
11125 : {
11126 0 : struct lsa_ForestTrustRecord *object = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(py_obj);
11127 0 : if (value == NULL) {
11128 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->forest_trust_data");
11129 0 : return -1;
11130 : }
11131 : {
11132 0 : union lsa_ForestTrustData *forest_trust_data_switch_0;
11133 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");
11134 0 : if (forest_trust_data_switch_0 == NULL) {
11135 0 : return -1;
11136 : }
11137 0 : object->forest_trust_data = *forest_trust_data_switch_0;
11138 : }
11139 0 : return 0;
11140 : }
11141 :
11142 : static PyGetSetDef py_lsa_ForestTrustRecord_getsetters[] = {
11143 : {
11144 : .name = discard_const_p(char, "flags"),
11145 : .get = py_lsa_ForestTrustRecord_get_flags,
11146 : .set = py_lsa_ForestTrustRecord_set_flags,
11147 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11148 : },
11149 : {
11150 : .name = discard_const_p(char, "type"),
11151 : .get = py_lsa_ForestTrustRecord_get_type,
11152 : .set = py_lsa_ForestTrustRecord_set_type,
11153 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
11154 : },
11155 : {
11156 : .name = discard_const_p(char, "time"),
11157 : .get = py_lsa_ForestTrustRecord_get_time,
11158 : .set = py_lsa_ForestTrustRecord_set_time,
11159 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
11160 : },
11161 : {
11162 : .name = discard_const_p(char, "forest_trust_data"),
11163 : .get = py_lsa_ForestTrustRecord_get_forest_trust_data,
11164 : .set = py_lsa_ForestTrustRecord_set_forest_trust_data,
11165 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustData")
11166 : },
11167 : { .name = NULL }
11168 : };
11169 :
11170 8 : static PyObject *py_lsa_ForestTrustRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11171 : {
11172 8 : return pytalloc_new(struct lsa_ForestTrustRecord, type);
11173 : }
11174 :
11175 :
11176 : static PyTypeObject lsa_ForestTrustRecord_Type = {
11177 : PyVarObject_HEAD_INIT(NULL, 0)
11178 : .tp_name = "lsa.ForestTrustRecord",
11179 : .tp_getset = py_lsa_ForestTrustRecord_getsetters,
11180 : .tp_methods = NULL,
11181 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11182 : .tp_new = py_lsa_ForestTrustRecord_new,
11183 : };
11184 :
11185 :
11186 0 : static PyObject *py_lsa_ForestTrustInformation_get_count(PyObject *obj, void *closure)
11187 : {
11188 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
11189 0 : PyObject *py_count;
11190 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11191 0 : return py_count;
11192 : }
11193 :
11194 64 : static int py_lsa_ForestTrustInformation_set_count(PyObject *py_obj, PyObject *value, void *closure)
11195 : {
11196 64 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11197 64 : if (value == NULL) {
11198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11199 0 : return -1;
11200 : }
11201 : {
11202 64 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11203 64 : if (PyLong_Check(value)) {
11204 0 : unsigned long long test_var;
11205 64 : test_var = PyLong_AsUnsignedLongLong(value);
11206 64 : if (PyErr_Occurred() != NULL) {
11207 0 : return -1;
11208 : }
11209 64 : if (test_var > uint_max) {
11210 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11211 : PyLong_Type.tp_name, uint_max, test_var);
11212 0 : return -1;
11213 : }
11214 64 : object->count = test_var;
11215 : } else {
11216 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11217 : PyLong_Type.tp_name);
11218 0 : return -1;
11219 : }
11220 : }
11221 64 : return 0;
11222 : }
11223 :
11224 880 : static PyObject *py_lsa_ForestTrustInformation_get_entries(PyObject *obj, void *closure)
11225 : {
11226 880 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(obj);
11227 8 : PyObject *py_entries;
11228 880 : if (object->entries == NULL) {
11229 0 : Py_RETURN_NONE;
11230 : }
11231 880 : if (object->entries == NULL) {
11232 0 : py_entries = Py_None;
11233 0 : Py_INCREF(py_entries);
11234 : } else {
11235 880 : py_entries = PyList_New(object->count);
11236 880 : if (py_entries == NULL) {
11237 0 : return NULL;
11238 : }
11239 : {
11240 : int entries_cntr_1;
11241 6220 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11242 24 : PyObject *py_entries_1;
11243 5340 : if (object->entries[entries_cntr_1] == NULL) {
11244 0 : py_entries_1 = Py_None;
11245 0 : Py_INCREF(py_entries_1);
11246 : } else {
11247 5340 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
11248 : }
11249 5340 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11250 : }
11251 : }
11252 : }
11253 872 : return py_entries;
11254 : }
11255 :
11256 64 : static int py_lsa_ForestTrustInformation_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11257 : {
11258 64 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11259 64 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11260 64 : if (value == NULL) {
11261 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11262 0 : return -1;
11263 : }
11264 64 : if (value == Py_None) {
11265 0 : object->entries = NULL;
11266 : } else {
11267 64 : object->entries = NULL;
11268 64 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11269 : {
11270 0 : int entries_cntr_1;
11271 64 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11272 64 : if (!object->entries) { return -1; }
11273 64 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11274 544 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11275 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11277 0 : return -1;
11278 : }
11279 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
11280 0 : object->entries[entries_cntr_1] = NULL;
11281 : } else {
11282 480 : object->entries[entries_cntr_1] = NULL;
11283 480 : PY_CHECK_TYPE(&lsa_ForestTrustRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11284 480 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11285 0 : PyErr_NoMemory();
11286 0 : return -1;
11287 : }
11288 480 : object->entries[entries_cntr_1] = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11289 : }
11290 : }
11291 : }
11292 : }
11293 64 : return 0;
11294 : }
11295 :
11296 : static PyGetSetDef py_lsa_ForestTrustInformation_getsetters[] = {
11297 : {
11298 : .name = discard_const_p(char, "count"),
11299 : .get = py_lsa_ForestTrustInformation_get_count,
11300 : .set = py_lsa_ForestTrustInformation_set_count,
11301 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11302 : },
11303 : {
11304 : .name = discard_const_p(char, "entries"),
11305 : .get = py_lsa_ForestTrustInformation_get_entries,
11306 : .set = py_lsa_ForestTrustInformation_set_entries,
11307 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecord")
11308 : },
11309 : { .name = NULL }
11310 : };
11311 :
11312 48 : static PyObject *py_lsa_ForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11313 : {
11314 48 : return pytalloc_new(struct lsa_ForestTrustInformation, type);
11315 : }
11316 :
11317 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11318 : {
11319 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11320 0 : PyObject *ret = NULL;
11321 0 : DATA_BLOB blob;
11322 0 : enum ndr_err_code err;
11323 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11324 0 : if (tmp_ctx == NULL) {
11325 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11326 0 : return NULL;
11327 : }
11328 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustInformation);
11329 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11330 0 : TALLOC_FREE(tmp_ctx);
11331 0 : PyErr_SetNdrError(err);
11332 0 : return NULL;
11333 : }
11334 :
11335 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11336 0 : TALLOC_FREE(tmp_ctx);
11337 0 : return ret;
11338 : }
11339 :
11340 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11341 : {
11342 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11343 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11344 0 : Py_ssize_t blob_length = 0;
11345 0 : enum ndr_err_code err;
11346 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11347 0 : PyObject *allow_remaining_obj = NULL;
11348 0 : bool allow_remaining = false;
11349 :
11350 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11351 : discard_const_p(char *, kwnames),
11352 : &blob.data, &blob_length,
11353 : &allow_remaining_obj)) {
11354 0 : return NULL;
11355 : }
11356 0 : blob.length = blob_length;
11357 :
11358 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11359 0 : allow_remaining = true;
11360 : }
11361 :
11362 0 : if (allow_remaining) {
11363 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11364 : } else {
11365 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11366 : }
11367 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11368 0 : PyErr_SetNdrError(err);
11369 0 : return NULL;
11370 : }
11371 :
11372 0 : Py_RETURN_NONE;
11373 : }
11374 :
11375 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11376 : {
11377 0 : struct lsa_ForestTrustInformation *object = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_obj);
11378 0 : PyObject *ret;
11379 0 : char *retstr;
11380 :
11381 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustInformation, "lsa_ForestTrustInformation", object);
11382 0 : ret = PyUnicode_FromString(retstr);
11383 0 : talloc_free(retstr);
11384 :
11385 0 : return ret;
11386 : }
11387 :
11388 : static PyMethodDef py_lsa_ForestTrustInformation_methods[] = {
11389 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11390 : { "__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" },
11391 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11392 : { NULL, NULL, 0, NULL }
11393 : };
11394 :
11395 :
11396 : static PyTypeObject lsa_ForestTrustInformation_Type = {
11397 : PyVarObject_HEAD_INIT(NULL, 0)
11398 : .tp_name = "lsa.ForestTrustInformation",
11399 : .tp_getset = py_lsa_ForestTrustInformation_getsetters,
11400 : .tp_methods = py_lsa_ForestTrustInformation_methods,
11401 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11402 : .tp_new = py_lsa_ForestTrustInformation_new,
11403 : };
11404 :
11405 :
11406 224 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_index(PyObject *obj, void *closure)
11407 : {
11408 224 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11409 0 : PyObject *py_index;
11410 224 : py_index = PyLong_FromUnsignedLongLong((uint32_t)object->index);
11411 224 : return py_index;
11412 : }
11413 :
11414 0 : static int py_lsa_ForestTrustCollisionRecord_set_index(PyObject *py_obj, PyObject *value, void *closure)
11415 : {
11416 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11417 0 : if (value == NULL) {
11418 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->index");
11419 0 : return -1;
11420 : }
11421 : {
11422 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->index));
11423 0 : if (PyLong_Check(value)) {
11424 0 : unsigned long long test_var;
11425 0 : test_var = PyLong_AsUnsignedLongLong(value);
11426 0 : if (PyErr_Occurred() != NULL) {
11427 0 : return -1;
11428 : }
11429 0 : if (test_var > uint_max) {
11430 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11431 : PyLong_Type.tp_name, uint_max, test_var);
11432 0 : return -1;
11433 : }
11434 0 : object->index = test_var;
11435 : } else {
11436 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11437 : PyLong_Type.tp_name);
11438 0 : return -1;
11439 : }
11440 : }
11441 0 : return 0;
11442 : }
11443 :
11444 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_type(PyObject *obj, void *closure)
11445 : {
11446 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11447 0 : PyObject *py_type;
11448 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
11449 0 : return py_type;
11450 : }
11451 :
11452 0 : static int py_lsa_ForestTrustCollisionRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11453 : {
11454 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11455 0 : if (value == NULL) {
11456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
11457 0 : return -1;
11458 : }
11459 : {
11460 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11461 0 : if (PyLong_Check(value)) {
11462 0 : unsigned long long test_var;
11463 0 : test_var = PyLong_AsUnsignedLongLong(value);
11464 0 : if (PyErr_Occurred() != NULL) {
11465 0 : return -1;
11466 : }
11467 0 : if (test_var > uint_max) {
11468 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11469 : PyLong_Type.tp_name, uint_max, test_var);
11470 0 : return -1;
11471 : }
11472 0 : object->type = test_var;
11473 : } else {
11474 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11475 : PyLong_Type.tp_name);
11476 0 : return -1;
11477 : }
11478 : }
11479 0 : return 0;
11480 : }
11481 :
11482 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_flags(PyObject *obj, void *closure)
11483 : {
11484 32 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11485 0 : PyObject *py_flags;
11486 32 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
11487 32 : return py_flags;
11488 : }
11489 :
11490 0 : static int py_lsa_ForestTrustCollisionRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11491 : {
11492 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11493 0 : if (value == NULL) {
11494 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
11495 0 : return -1;
11496 : }
11497 : {
11498 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11499 0 : if (PyLong_Check(value)) {
11500 0 : unsigned long long test_var;
11501 0 : test_var = PyLong_AsUnsignedLongLong(value);
11502 0 : if (PyErr_Occurred() != NULL) {
11503 0 : return -1;
11504 : }
11505 0 : if (test_var > uint_max) {
11506 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11507 : PyLong_Type.tp_name, uint_max, test_var);
11508 0 : return -1;
11509 : }
11510 0 : object->flags = test_var;
11511 : } else {
11512 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11513 : PyLong_Type.tp_name);
11514 0 : return -1;
11515 : }
11516 : }
11517 0 : return 0;
11518 : }
11519 :
11520 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_name(PyObject *obj, void *closure)
11521 : {
11522 32 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(obj);
11523 0 : PyObject *py_name;
11524 32 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
11525 32 : return py_name;
11526 : }
11527 :
11528 0 : static int py_lsa_ForestTrustCollisionRecord_set_name(PyObject *py_obj, PyObject *value, void *closure)
11529 : {
11530 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11531 0 : if (value == NULL) {
11532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
11533 0 : return -1;
11534 : }
11535 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
11536 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11537 0 : PyErr_NoMemory();
11538 0 : return -1;
11539 : }
11540 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
11541 0 : return 0;
11542 : }
11543 :
11544 : static PyGetSetDef py_lsa_ForestTrustCollisionRecord_getsetters[] = {
11545 : {
11546 : .name = discard_const_p(char, "index"),
11547 : .get = py_lsa_ForestTrustCollisionRecord_get_index,
11548 : .set = py_lsa_ForestTrustCollisionRecord_set_index,
11549 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11550 : },
11551 : {
11552 : .name = discard_const_p(char, "type"),
11553 : .get = py_lsa_ForestTrustCollisionRecord_get_type,
11554 : .set = py_lsa_ForestTrustCollisionRecord_set_type,
11555 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecordType")
11556 : },
11557 : {
11558 : .name = discard_const_p(char, "flags"),
11559 : .get = py_lsa_ForestTrustCollisionRecord_get_flags,
11560 : .set = py_lsa_ForestTrustCollisionRecord_set_flags,
11561 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11562 : },
11563 : {
11564 : .name = discard_const_p(char, "name"),
11565 : .get = py_lsa_ForestTrustCollisionRecord_get_name,
11566 : .set = py_lsa_ForestTrustCollisionRecord_set_name,
11567 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11568 : },
11569 : { .name = NULL }
11570 : };
11571 :
11572 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11573 : {
11574 0 : return pytalloc_new(struct lsa_ForestTrustCollisionRecord, type);
11575 : }
11576 :
11577 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11578 : {
11579 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11580 0 : PyObject *ret = NULL;
11581 0 : DATA_BLOB blob;
11582 0 : enum ndr_err_code err;
11583 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11584 0 : if (tmp_ctx == NULL) {
11585 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11586 0 : return NULL;
11587 : }
11588 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionRecord);
11589 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11590 0 : TALLOC_FREE(tmp_ctx);
11591 0 : PyErr_SetNdrError(err);
11592 0 : return NULL;
11593 : }
11594 :
11595 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11596 0 : TALLOC_FREE(tmp_ctx);
11597 0 : return ret;
11598 : }
11599 :
11600 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11601 : {
11602 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11603 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11604 0 : Py_ssize_t blob_length = 0;
11605 0 : enum ndr_err_code err;
11606 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11607 0 : PyObject *allow_remaining_obj = NULL;
11608 0 : bool allow_remaining = false;
11609 :
11610 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11611 : discard_const_p(char *, kwnames),
11612 : &blob.data, &blob_length,
11613 : &allow_remaining_obj)) {
11614 0 : return NULL;
11615 : }
11616 0 : blob.length = blob_length;
11617 :
11618 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11619 0 : allow_remaining = true;
11620 : }
11621 :
11622 0 : if (allow_remaining) {
11623 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
11624 : } else {
11625 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
11626 : }
11627 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11628 0 : PyErr_SetNdrError(err);
11629 0 : return NULL;
11630 : }
11631 :
11632 0 : Py_RETURN_NONE;
11633 : }
11634 :
11635 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11636 : {
11637 0 : struct lsa_ForestTrustCollisionRecord *object = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(py_obj);
11638 0 : PyObject *ret;
11639 0 : char *retstr;
11640 :
11641 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionRecord, "lsa_ForestTrustCollisionRecord", object);
11642 0 : ret = PyUnicode_FromString(retstr);
11643 0 : talloc_free(retstr);
11644 :
11645 0 : return ret;
11646 : }
11647 :
11648 : static PyMethodDef py_lsa_ForestTrustCollisionRecord_methods[] = {
11649 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11650 : { "__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" },
11651 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11652 : { NULL, NULL, 0, NULL }
11653 : };
11654 :
11655 :
11656 : static PyTypeObject lsa_ForestTrustCollisionRecord_Type = {
11657 : PyVarObject_HEAD_INIT(NULL, 0)
11658 : .tp_name = "lsa.ForestTrustCollisionRecord",
11659 : .tp_getset = py_lsa_ForestTrustCollisionRecord_getsetters,
11660 : .tp_methods = py_lsa_ForestTrustCollisionRecord_methods,
11661 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11662 : .tp_new = py_lsa_ForestTrustCollisionRecord_new,
11663 : };
11664 :
11665 :
11666 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_count(PyObject *obj, void *closure)
11667 : {
11668 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
11669 0 : PyObject *py_count;
11670 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11671 0 : return py_count;
11672 : }
11673 :
11674 0 : static int py_lsa_ForestTrustCollisionInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
11675 : {
11676 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11677 0 : if (value == NULL) {
11678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11679 0 : return -1;
11680 : }
11681 : {
11682 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11683 0 : if (PyLong_Check(value)) {
11684 0 : unsigned long long test_var;
11685 0 : test_var = PyLong_AsUnsignedLongLong(value);
11686 0 : if (PyErr_Occurred() != NULL) {
11687 0 : return -1;
11688 : }
11689 0 : if (test_var > uint_max) {
11690 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11691 : PyLong_Type.tp_name, uint_max, test_var);
11692 0 : return -1;
11693 : }
11694 0 : object->count = test_var;
11695 : } else {
11696 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11697 : PyLong_Type.tp_name);
11698 0 : return -1;
11699 : }
11700 : }
11701 0 : return 0;
11702 : }
11703 :
11704 112 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_entries(PyObject *obj, void *closure)
11705 : {
11706 112 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(obj);
11707 0 : PyObject *py_entries;
11708 112 : if (object->entries == NULL) {
11709 0 : Py_RETURN_NONE;
11710 : }
11711 112 : if (object->entries == NULL) {
11712 0 : py_entries = Py_None;
11713 0 : Py_INCREF(py_entries);
11714 : } else {
11715 112 : py_entries = PyList_New(object->count);
11716 112 : if (py_entries == NULL) {
11717 0 : return NULL;
11718 : }
11719 : {
11720 : int entries_cntr_1;
11721 336 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11722 0 : PyObject *py_entries_1;
11723 224 : if (object->entries[entries_cntr_1] == NULL) {
11724 0 : py_entries_1 = Py_None;
11725 0 : Py_INCREF(py_entries_1);
11726 : } else {
11727 224 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustCollisionRecord_Type, object->entries[entries_cntr_1], object->entries[entries_cntr_1]);
11728 : }
11729 224 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11730 : }
11731 : }
11732 : }
11733 112 : return py_entries;
11734 : }
11735 :
11736 0 : static int py_lsa_ForestTrustCollisionInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11737 : {
11738 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11739 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11740 0 : if (value == NULL) {
11741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11742 0 : return -1;
11743 : }
11744 0 : if (value == Py_None) {
11745 0 : object->entries = NULL;
11746 : } else {
11747 0 : object->entries = NULL;
11748 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11749 : {
11750 0 : int entries_cntr_1;
11751 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11752 0 : if (!object->entries) { return -1; }
11753 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11754 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11755 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11757 0 : return -1;
11758 : }
11759 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
11760 0 : object->entries[entries_cntr_1] = NULL;
11761 : } else {
11762 0 : object->entries[entries_cntr_1] = NULL;
11763 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11764 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11765 0 : PyErr_NoMemory();
11766 0 : return -1;
11767 : }
11768 0 : object->entries[entries_cntr_1] = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11769 : }
11770 : }
11771 : }
11772 : }
11773 0 : return 0;
11774 : }
11775 :
11776 : static PyGetSetDef py_lsa_ForestTrustCollisionInfo_getsetters[] = {
11777 : {
11778 : .name = discard_const_p(char, "count"),
11779 : .get = py_lsa_ForestTrustCollisionInfo_get_count,
11780 : .set = py_lsa_ForestTrustCollisionInfo_set_count,
11781 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11782 : },
11783 : {
11784 : .name = discard_const_p(char, "entries"),
11785 : .get = py_lsa_ForestTrustCollisionInfo_get_entries,
11786 : .set = py_lsa_ForestTrustCollisionInfo_set_entries,
11787 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecord")
11788 : },
11789 : { .name = NULL }
11790 : };
11791 :
11792 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11793 : {
11794 0 : return pytalloc_new(struct lsa_ForestTrustCollisionInfo, type);
11795 : }
11796 :
11797 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11798 : {
11799 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11800 0 : PyObject *ret = NULL;
11801 0 : DATA_BLOB blob;
11802 0 : enum ndr_err_code err;
11803 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11804 0 : if (tmp_ctx == NULL) {
11805 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11806 0 : return NULL;
11807 : }
11808 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionInfo);
11809 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11810 0 : TALLOC_FREE(tmp_ctx);
11811 0 : PyErr_SetNdrError(err);
11812 0 : return NULL;
11813 : }
11814 :
11815 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11816 0 : TALLOC_FREE(tmp_ctx);
11817 0 : return ret;
11818 : }
11819 :
11820 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11821 : {
11822 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11823 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11824 0 : Py_ssize_t blob_length = 0;
11825 0 : enum ndr_err_code err;
11826 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11827 0 : PyObject *allow_remaining_obj = NULL;
11828 0 : bool allow_remaining = false;
11829 :
11830 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11831 : discard_const_p(char *, kwnames),
11832 : &blob.data, &blob_length,
11833 : &allow_remaining_obj)) {
11834 0 : return NULL;
11835 : }
11836 0 : blob.length = blob_length;
11837 :
11838 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11839 0 : allow_remaining = true;
11840 : }
11841 :
11842 0 : if (allow_remaining) {
11843 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
11844 : } else {
11845 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
11846 : }
11847 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11848 0 : PyErr_SetNdrError(err);
11849 0 : return NULL;
11850 : }
11851 :
11852 0 : Py_RETURN_NONE;
11853 : }
11854 :
11855 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11856 : {
11857 0 : struct lsa_ForestTrustCollisionInfo *object = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(py_obj);
11858 0 : PyObject *ret;
11859 0 : char *retstr;
11860 :
11861 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionInfo, "lsa_ForestTrustCollisionInfo", object);
11862 0 : ret = PyUnicode_FromString(retstr);
11863 0 : talloc_free(retstr);
11864 :
11865 0 : return ret;
11866 : }
11867 :
11868 : static PyMethodDef py_lsa_ForestTrustCollisionInfo_methods[] = {
11869 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11870 : { "__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" },
11871 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11872 : { NULL, NULL, 0, NULL }
11873 : };
11874 :
11875 :
11876 : static PyTypeObject lsa_ForestTrustCollisionInfo_Type = {
11877 : PyVarObject_HEAD_INIT(NULL, 0)
11878 : .tp_name = "lsa.ForestTrustCollisionInfo",
11879 : .tp_getset = py_lsa_ForestTrustCollisionInfo_getsetters,
11880 : .tp_methods = py_lsa_ForestTrustCollisionInfo_methods,
11881 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11882 : .tp_new = py_lsa_ForestTrustCollisionInfo_new,
11883 : };
11884 :
11885 :
11886 :
11887 0 : static PyObject *py_lsa_Close_in_get_handle(PyObject *obj, void *closure)
11888 : {
11889 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11890 0 : PyObject *py_handle;
11891 0 : if (object->in.handle == NULL) {
11892 0 : Py_RETURN_NONE;
11893 : }
11894 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
11895 0 : return py_handle;
11896 : }
11897 :
11898 0 : static int py_lsa_Close_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
11899 : {
11900 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11901 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
11902 0 : if (value == NULL) {
11903 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
11904 0 : return -1;
11905 : }
11906 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
11907 0 : if (object->in.handle == NULL) {
11908 0 : PyErr_NoMemory();
11909 0 : return -1;
11910 : }
11911 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
11912 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11913 0 : PyErr_NoMemory();
11914 0 : return -1;
11915 : }
11916 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
11917 0 : return 0;
11918 : }
11919 :
11920 0 : static PyObject *py_lsa_Close_out_get_handle(PyObject *obj, void *closure)
11921 : {
11922 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11923 0 : PyObject *py_handle;
11924 0 : if (object->out.handle == NULL) {
11925 0 : Py_RETURN_NONE;
11926 : }
11927 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
11928 0 : return py_handle;
11929 : }
11930 :
11931 0 : static int py_lsa_Close_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
11932 : {
11933 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11934 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
11935 0 : if (value == NULL) {
11936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
11937 0 : return -1;
11938 : }
11939 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
11940 0 : if (object->out.handle == NULL) {
11941 0 : PyErr_NoMemory();
11942 0 : return -1;
11943 : }
11944 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
11945 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11946 0 : PyErr_NoMemory();
11947 0 : return -1;
11948 : }
11949 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
11950 0 : return 0;
11951 : }
11952 :
11953 0 : static PyObject *py_lsa_Close_get_result(PyObject *obj, void *closure)
11954 : {
11955 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(obj);
11956 0 : PyObject *py_result;
11957 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
11958 0 : return py_result;
11959 : }
11960 :
11961 0 : static int py_lsa_Close_set_result(PyObject *py_obj, PyObject *value, void *closure)
11962 : {
11963 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
11964 0 : if (value == NULL) {
11965 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
11966 0 : return -1;
11967 : }
11968 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
11969 0 : return 0;
11970 : }
11971 :
11972 : static PyGetSetDef py_lsa_Close_getsetters[] = {
11973 : {
11974 : .name = discard_const_p(char, "in_handle"),
11975 : .get = py_lsa_Close_in_get_handle,
11976 : .set = py_lsa_Close_in_set_handle,
11977 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11978 : },
11979 : {
11980 : .name = discard_const_p(char, "out_handle"),
11981 : .get = py_lsa_Close_out_get_handle,
11982 : .set = py_lsa_Close_out_set_handle,
11983 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
11984 : },
11985 : {
11986 : .name = discard_const_p(char, "result"),
11987 : .get = py_lsa_Close_get_result,
11988 : .set = py_lsa_Close_set_result,
11989 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
11990 : },
11991 : { .name = NULL }
11992 : };
11993 :
11994 0 : static PyObject *py_lsa_Close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11995 : {
11996 0 : PyObject *self = pytalloc_new(struct lsa_Close, type);
11997 0 : struct lsa_Close *_self = (struct lsa_Close *)pytalloc_get_ptr(self);
11998 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
11999 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12000 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
12001 0 : return self;
12002 : }
12003 :
12004 0 : static PyObject *py_lsa_Close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12005 : {
12006 :
12007 :
12008 0 : return PyLong_FromLong(0);
12009 : }
12010 :
12011 0 : static PyObject *py_lsa_Close_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
12012 : {
12013 0 : const struct ndr_interface_call *call = NULL;
12014 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12015 0 : PyObject *ret = NULL;
12016 0 : struct ndr_push *push = NULL;
12017 0 : DATA_BLOB blob;
12018 0 : enum ndr_err_code err;
12019 :
12020 0 : if (ndr_table_lsarpc.num_calls < 1) {
12021 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_pack");
12022 0 : return NULL;
12023 : }
12024 0 : call = &ndr_table_lsarpc.calls[0];
12025 :
12026 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12027 0 : if (push == NULL) {
12028 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12029 0 : return NULL;
12030 : }
12031 :
12032 0 : push->flags |= ndr_push_flags;
12033 :
12034 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12035 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12036 0 : TALLOC_FREE(push);
12037 0 : PyErr_SetNdrError(err);
12038 0 : return NULL;
12039 : }
12040 0 : blob = ndr_push_blob(push);
12041 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12042 0 : TALLOC_FREE(push);
12043 0 : return ret;
12044 : }
12045 :
12046 0 : static PyObject *py_lsa_Close_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12047 : {
12048 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12049 0 : PyObject *bigendian_obj = NULL;
12050 0 : PyObject *ndr64_obj = NULL;
12051 0 : libndr_flags ndr_push_flags = 0;
12052 :
12053 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12054 : discard_const_p(char *, kwnames),
12055 : &bigendian_obj,
12056 : &ndr64_obj)) {
12057 0 : return NULL;
12058 : }
12059 :
12060 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12061 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12062 : }
12063 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12064 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12065 : }
12066 :
12067 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12068 : }
12069 :
12070 0 : static PyObject *py_lsa_Close_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12071 : {
12072 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12073 0 : PyObject *bigendian_obj = NULL;
12074 0 : PyObject *ndr64_obj = NULL;
12075 0 : libndr_flags ndr_push_flags = 0;
12076 :
12077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12078 : discard_const_p(char *, kwnames),
12079 : &bigendian_obj,
12080 : &ndr64_obj)) {
12081 0 : return NULL;
12082 : }
12083 :
12084 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12085 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12086 : }
12087 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12088 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12089 : }
12090 :
12091 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12092 : }
12093 :
12094 0 : static PyObject *py_lsa_Close_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
12095 : {
12096 0 : const struct ndr_interface_call *call = NULL;
12097 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12098 0 : struct ndr_pull *pull = NULL;
12099 0 : enum ndr_err_code err;
12100 :
12101 0 : if (ndr_table_lsarpc.num_calls < 1) {
12102 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_unpack");
12103 0 : return NULL;
12104 : }
12105 0 : call = &ndr_table_lsarpc.calls[0];
12106 :
12107 0 : pull = ndr_pull_init_blob(blob, object);
12108 0 : if (pull == NULL) {
12109 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12110 0 : return NULL;
12111 : }
12112 :
12113 0 : pull->flags |= ndr_pull_flags;
12114 :
12115 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12116 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12117 0 : TALLOC_FREE(pull);
12118 0 : PyErr_SetNdrError(err);
12119 0 : return NULL;
12120 : }
12121 0 : if (!allow_remaining) {
12122 0 : uint32_t highest_ofs;
12123 :
12124 0 : if (pull->offset > pull->relative_highest_offset) {
12125 0 : highest_ofs = pull->offset;
12126 : } else {
12127 0 : highest_ofs = pull->relative_highest_offset;
12128 : }
12129 0 : if (highest_ofs < pull->data_size) {
12130 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12131 : "not all bytes consumed ofs[%u] size[%u]",
12132 : highest_ofs, pull->data_size);
12133 0 : TALLOC_FREE(pull);
12134 0 : PyErr_SetNdrError(err);
12135 0 : return NULL;
12136 : }
12137 : }
12138 :
12139 0 : TALLOC_FREE(pull);
12140 0 : Py_RETURN_NONE;
12141 : }
12142 :
12143 0 : static PyObject *py_lsa_Close_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12144 : {
12145 0 : DATA_BLOB blob;
12146 0 : Py_ssize_t blob_length = 0;
12147 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12148 0 : PyObject *bigendian_obj = NULL;
12149 0 : PyObject *ndr64_obj = NULL;
12150 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12151 0 : PyObject *allow_remaining_obj = NULL;
12152 0 : bool allow_remaining = false;
12153 :
12154 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12155 : discard_const_p(char *, kwnames),
12156 : &blob.data, &blob_length,
12157 : &bigendian_obj,
12158 : &ndr64_obj,
12159 : &allow_remaining_obj)) {
12160 0 : return NULL;
12161 : }
12162 0 : blob.length = blob_length;
12163 :
12164 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12165 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12166 : }
12167 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12168 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12169 : }
12170 :
12171 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12172 0 : allow_remaining = true;
12173 : }
12174 :
12175 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12176 : }
12177 :
12178 0 : static PyObject *py_lsa_Close_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12179 : {
12180 0 : DATA_BLOB blob;
12181 0 : Py_ssize_t blob_length = 0;
12182 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12183 0 : PyObject *bigendian_obj = NULL;
12184 0 : PyObject *ndr64_obj = NULL;
12185 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12186 0 : PyObject *allow_remaining_obj = NULL;
12187 0 : bool allow_remaining = false;
12188 :
12189 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12190 : discard_const_p(char *, kwnames),
12191 : &blob.data, &blob_length,
12192 : &bigendian_obj,
12193 : &ndr64_obj,
12194 : &allow_remaining_obj)) {
12195 0 : return NULL;
12196 : }
12197 0 : blob.length = blob_length;
12198 :
12199 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12200 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12201 : }
12202 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12203 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12204 : }
12205 :
12206 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12207 0 : allow_remaining = true;
12208 : }
12209 :
12210 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12211 : }
12212 :
12213 0 : static PyObject *py_lsa_Close_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12214 : {
12215 0 : const struct ndr_interface_call *call = NULL;
12216 0 : struct lsa_Close *object = (struct lsa_Close *)pytalloc_get_ptr(py_obj);
12217 0 : PyObject *ret;
12218 0 : char *retstr;
12219 :
12220 0 : if (ndr_table_lsarpc.num_calls < 1) {
12221 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_print");
12222 0 : return NULL;
12223 : }
12224 0 : call = &ndr_table_lsarpc.calls[0];
12225 :
12226 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12227 0 : ret = PyUnicode_FromString(retstr);
12228 0 : TALLOC_FREE(retstr);
12229 :
12230 0 : return ret;
12231 : }
12232 :
12233 0 : static PyObject *py_lsa_Close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12234 : {
12235 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_in", NDR_IN);
12236 : }
12237 :
12238 0 : static PyObject *py_lsa_Close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12239 : {
12240 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_out", NDR_OUT);
12241 : }
12242 :
12243 : static PyMethodDef py_lsa_Close_methods[] = {
12244 : { "opnum", (PyCFunction)py_lsa_Close_ndr_opnum, METH_NOARGS|METH_CLASS,
12245 : "lsa.Close.opnum() -> 0 (0x00) " },
12246 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12247 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12248 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12249 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12250 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12251 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12252 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12253 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12254 : { "__ndr_print_in__", (PyCFunction)py_lsa_Close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12255 : { "__ndr_print_out__", (PyCFunction)py_lsa_Close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12256 : { NULL, NULL, 0, NULL }
12257 : };
12258 :
12259 :
12260 : static PyTypeObject lsa_Close_Type = {
12261 : PyVarObject_HEAD_INIT(NULL, 0)
12262 : .tp_name = "lsa.Close",
12263 : .tp_getset = py_lsa_Close_getsetters,
12264 : .tp_methods = py_lsa_Close_methods,
12265 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12266 : .tp_new = py_lsa_Close_new,
12267 : };
12268 :
12269 23 : static bool pack_py_lsa_Close_args_in(PyObject *args, PyObject *kwargs, struct lsa_Close *r)
12270 : {
12271 0 : PyObject *py_handle;
12272 23 : const char *kwnames[] = {
12273 : "handle", NULL
12274 : };
12275 :
12276 23 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Close", discard_const_p(char *, kwnames), &py_handle)) {
12277 0 : return false;
12278 : }
12279 :
12280 23 : if (py_handle == NULL) {
12281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
12282 0 : return false;
12283 : }
12284 23 : r->in.handle = talloc_ptrtype(r, r->in.handle);
12285 23 : if (r->in.handle == NULL) {
12286 0 : PyErr_NoMemory();
12287 0 : return false;
12288 : }
12289 23 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12290 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12291 0 : PyErr_NoMemory();
12292 0 : return false;
12293 : }
12294 23 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12295 23 : return true;
12296 : }
12297 :
12298 23 : static PyObject *unpack_py_lsa_Close_args_out(struct lsa_Close *r)
12299 : {
12300 0 : PyObject *result;
12301 0 : PyObject *py_handle;
12302 23 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
12303 23 : result = py_handle;
12304 23 : if (NT_STATUS_IS_ERR(r->out.result)) {
12305 0 : PyErr_SetNTSTATUS(r->out.result);
12306 0 : return NULL;
12307 : }
12308 :
12309 23 : return result;
12310 : }
12311 :
12312 :
12313 0 : static PyObject *py_lsa_Delete_in_get_handle(PyObject *obj, void *closure)
12314 : {
12315 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(obj);
12316 0 : PyObject *py_handle;
12317 0 : if (object->in.handle == NULL) {
12318 0 : Py_RETURN_NONE;
12319 : }
12320 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
12321 0 : return py_handle;
12322 : }
12323 :
12324 0 : static int py_lsa_Delete_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12325 : {
12326 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12327 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
12328 0 : if (value == NULL) {
12329 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
12330 0 : return -1;
12331 : }
12332 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
12333 0 : if (object->in.handle == NULL) {
12334 0 : PyErr_NoMemory();
12335 0 : return -1;
12336 : }
12337 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12338 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12339 0 : PyErr_NoMemory();
12340 0 : return -1;
12341 : }
12342 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12343 0 : return 0;
12344 : }
12345 :
12346 0 : static PyObject *py_lsa_Delete_get_result(PyObject *obj, void *closure)
12347 : {
12348 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(obj);
12349 0 : PyObject *py_result;
12350 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12351 0 : return py_result;
12352 : }
12353 :
12354 0 : static int py_lsa_Delete_set_result(PyObject *py_obj, PyObject *value, void *closure)
12355 : {
12356 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12357 0 : if (value == NULL) {
12358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12359 0 : return -1;
12360 : }
12361 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12362 0 : return 0;
12363 : }
12364 :
12365 : static PyGetSetDef py_lsa_Delete_getsetters[] = {
12366 : {
12367 : .name = discard_const_p(char, "in_handle"),
12368 : .get = py_lsa_Delete_in_get_handle,
12369 : .set = py_lsa_Delete_in_set_handle,
12370 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12371 : },
12372 : {
12373 : .name = discard_const_p(char, "result"),
12374 : .get = py_lsa_Delete_get_result,
12375 : .set = py_lsa_Delete_set_result,
12376 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12377 : },
12378 : { .name = NULL }
12379 : };
12380 :
12381 0 : static PyObject *py_lsa_Delete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12382 : {
12383 0 : PyObject *self = pytalloc_new(struct lsa_Delete, type);
12384 0 : struct lsa_Delete *_self = (struct lsa_Delete *)pytalloc_get_ptr(self);
12385 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12386 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12387 0 : return self;
12388 : }
12389 :
12390 0 : static PyObject *py_lsa_Delete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12391 : {
12392 :
12393 :
12394 0 : return PyLong_FromLong(1);
12395 : }
12396 :
12397 0 : static PyObject *py_lsa_Delete_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
12398 : {
12399 0 : const struct ndr_interface_call *call = NULL;
12400 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12401 0 : PyObject *ret = NULL;
12402 0 : struct ndr_push *push = NULL;
12403 0 : DATA_BLOB blob;
12404 0 : enum ndr_err_code err;
12405 :
12406 0 : if (ndr_table_lsarpc.num_calls < 2) {
12407 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_pack");
12408 0 : return NULL;
12409 : }
12410 0 : call = &ndr_table_lsarpc.calls[1];
12411 :
12412 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12413 0 : if (push == NULL) {
12414 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12415 0 : return NULL;
12416 : }
12417 :
12418 0 : push->flags |= ndr_push_flags;
12419 :
12420 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12421 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12422 0 : TALLOC_FREE(push);
12423 0 : PyErr_SetNdrError(err);
12424 0 : return NULL;
12425 : }
12426 0 : blob = ndr_push_blob(push);
12427 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12428 0 : TALLOC_FREE(push);
12429 0 : return ret;
12430 : }
12431 :
12432 0 : static PyObject *py_lsa_Delete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12433 : {
12434 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12435 0 : PyObject *bigendian_obj = NULL;
12436 0 : PyObject *ndr64_obj = NULL;
12437 0 : libndr_flags ndr_push_flags = 0;
12438 :
12439 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
12440 : discard_const_p(char *, kwnames),
12441 : &bigendian_obj,
12442 : &ndr64_obj)) {
12443 0 : return NULL;
12444 : }
12445 :
12446 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12447 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12448 : }
12449 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12450 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12451 : }
12452 :
12453 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
12454 : }
12455 :
12456 0 : static PyObject *py_lsa_Delete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12457 : {
12458 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
12459 0 : PyObject *bigendian_obj = NULL;
12460 0 : PyObject *ndr64_obj = NULL;
12461 0 : libndr_flags ndr_push_flags = 0;
12462 :
12463 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
12464 : discard_const_p(char *, kwnames),
12465 : &bigendian_obj,
12466 : &ndr64_obj)) {
12467 0 : return NULL;
12468 : }
12469 :
12470 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12471 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
12472 : }
12473 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12474 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
12475 : }
12476 :
12477 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
12478 : }
12479 :
12480 0 : static PyObject *py_lsa_Delete_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
12481 : {
12482 0 : const struct ndr_interface_call *call = NULL;
12483 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12484 0 : struct ndr_pull *pull = NULL;
12485 0 : enum ndr_err_code err;
12486 :
12487 0 : if (ndr_table_lsarpc.num_calls < 2) {
12488 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_unpack");
12489 0 : return NULL;
12490 : }
12491 0 : call = &ndr_table_lsarpc.calls[1];
12492 :
12493 0 : pull = ndr_pull_init_blob(blob, object);
12494 0 : if (pull == NULL) {
12495 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12496 0 : return NULL;
12497 : }
12498 :
12499 0 : pull->flags |= ndr_pull_flags;
12500 :
12501 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
12502 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12503 0 : TALLOC_FREE(pull);
12504 0 : PyErr_SetNdrError(err);
12505 0 : return NULL;
12506 : }
12507 0 : if (!allow_remaining) {
12508 0 : uint32_t highest_ofs;
12509 :
12510 0 : if (pull->offset > pull->relative_highest_offset) {
12511 0 : highest_ofs = pull->offset;
12512 : } else {
12513 0 : highest_ofs = pull->relative_highest_offset;
12514 : }
12515 0 : if (highest_ofs < pull->data_size) {
12516 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
12517 : "not all bytes consumed ofs[%u] size[%u]",
12518 : highest_ofs, pull->data_size);
12519 0 : TALLOC_FREE(pull);
12520 0 : PyErr_SetNdrError(err);
12521 0 : return NULL;
12522 : }
12523 : }
12524 :
12525 0 : TALLOC_FREE(pull);
12526 0 : Py_RETURN_NONE;
12527 : }
12528 :
12529 0 : static PyObject *py_lsa_Delete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12530 : {
12531 0 : DATA_BLOB blob;
12532 0 : Py_ssize_t blob_length = 0;
12533 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12534 0 : PyObject *bigendian_obj = NULL;
12535 0 : PyObject *ndr64_obj = NULL;
12536 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12537 0 : PyObject *allow_remaining_obj = NULL;
12538 0 : bool allow_remaining = false;
12539 :
12540 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
12541 : discard_const_p(char *, kwnames),
12542 : &blob.data, &blob_length,
12543 : &bigendian_obj,
12544 : &ndr64_obj,
12545 : &allow_remaining_obj)) {
12546 0 : return NULL;
12547 : }
12548 0 : blob.length = blob_length;
12549 :
12550 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12551 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12552 : }
12553 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12554 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12555 : }
12556 :
12557 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12558 0 : allow_remaining = true;
12559 : }
12560 :
12561 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
12562 : }
12563 :
12564 0 : static PyObject *py_lsa_Delete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12565 : {
12566 0 : DATA_BLOB blob;
12567 0 : Py_ssize_t blob_length = 0;
12568 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
12569 0 : PyObject *bigendian_obj = NULL;
12570 0 : PyObject *ndr64_obj = NULL;
12571 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
12572 0 : PyObject *allow_remaining_obj = NULL;
12573 0 : bool allow_remaining = false;
12574 :
12575 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
12576 : discard_const_p(char *, kwnames),
12577 : &blob.data, &blob_length,
12578 : &bigendian_obj,
12579 : &ndr64_obj,
12580 : &allow_remaining_obj)) {
12581 0 : return NULL;
12582 : }
12583 0 : blob.length = blob_length;
12584 :
12585 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
12586 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
12587 : }
12588 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
12589 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
12590 : }
12591 :
12592 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12593 0 : allow_remaining = true;
12594 : }
12595 :
12596 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
12597 : }
12598 :
12599 0 : static PyObject *py_lsa_Delete_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
12600 : {
12601 0 : const struct ndr_interface_call *call = NULL;
12602 0 : struct lsa_Delete *object = (struct lsa_Delete *)pytalloc_get_ptr(py_obj);
12603 0 : PyObject *ret;
12604 0 : char *retstr;
12605 :
12606 0 : if (ndr_table_lsarpc.num_calls < 2) {
12607 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_print");
12608 0 : return NULL;
12609 : }
12610 0 : call = &ndr_table_lsarpc.calls[1];
12611 :
12612 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
12613 0 : ret = PyUnicode_FromString(retstr);
12614 0 : TALLOC_FREE(retstr);
12615 :
12616 0 : return ret;
12617 : }
12618 :
12619 0 : static PyObject *py_lsa_Delete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12620 : {
12621 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_in", NDR_IN);
12622 : }
12623 :
12624 0 : static PyObject *py_lsa_Delete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12625 : {
12626 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_out", NDR_OUT);
12627 : }
12628 :
12629 : static PyMethodDef py_lsa_Delete_methods[] = {
12630 : { "opnum", (PyCFunction)py_lsa_Delete_ndr_opnum, METH_NOARGS|METH_CLASS,
12631 : "lsa.Delete.opnum() -> 1 (0x01) " },
12632 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
12633 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
12634 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
12635 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
12636 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
12637 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
12638 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
12639 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
12640 : { "__ndr_print_in__", (PyCFunction)py_lsa_Delete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
12641 : { "__ndr_print_out__", (PyCFunction)py_lsa_Delete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
12642 : { NULL, NULL, 0, NULL }
12643 : };
12644 :
12645 :
12646 : static PyTypeObject lsa_Delete_Type = {
12647 : PyVarObject_HEAD_INIT(NULL, 0)
12648 : .tp_name = "lsa.Delete",
12649 : .tp_getset = py_lsa_Delete_getsetters,
12650 : .tp_methods = py_lsa_Delete_methods,
12651 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12652 : .tp_new = py_lsa_Delete_new,
12653 : };
12654 :
12655 0 : static bool pack_py_lsa_Delete_args_in(PyObject *args, PyObject *kwargs, struct lsa_Delete *r)
12656 : {
12657 0 : PyObject *py_handle;
12658 0 : const char *kwnames[] = {
12659 : "handle", NULL
12660 : };
12661 :
12662 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Delete", discard_const_p(char *, kwnames), &py_handle)) {
12663 0 : return false;
12664 : }
12665 :
12666 0 : if (py_handle == NULL) {
12667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
12668 0 : return false;
12669 : }
12670 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
12671 0 : if (r->in.handle == NULL) {
12672 0 : PyErr_NoMemory();
12673 0 : return false;
12674 : }
12675 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
12676 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
12677 0 : PyErr_NoMemory();
12678 0 : return false;
12679 : }
12680 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
12681 0 : return true;
12682 : }
12683 :
12684 0 : static PyObject *unpack_py_lsa_Delete_args_out(struct lsa_Delete *r)
12685 : {
12686 0 : PyObject *result;
12687 0 : result = Py_None;
12688 0 : Py_INCREF(result);
12689 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
12690 0 : PyErr_SetNTSTATUS(r->out.result);
12691 0 : return NULL;
12692 : }
12693 :
12694 0 : return result;
12695 : }
12696 :
12697 :
12698 0 : static PyObject *py_lsa_EnumPrivs_in_get_handle(PyObject *obj, void *closure)
12699 : {
12700 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12701 0 : PyObject *py_handle;
12702 0 : if (object->in.handle == NULL) {
12703 0 : Py_RETURN_NONE;
12704 : }
12705 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
12706 0 : return py_handle;
12707 : }
12708 :
12709 0 : static int py_lsa_EnumPrivs_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
12710 : {
12711 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12712 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
12713 0 : if (value == NULL) {
12714 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
12715 0 : return -1;
12716 : }
12717 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
12718 0 : if (object->in.handle == NULL) {
12719 0 : PyErr_NoMemory();
12720 0 : return -1;
12721 : }
12722 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
12723 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12724 0 : PyErr_NoMemory();
12725 0 : return -1;
12726 : }
12727 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
12728 0 : return 0;
12729 : }
12730 :
12731 0 : static PyObject *py_lsa_EnumPrivs_in_get_resume_handle(PyObject *obj, void *closure)
12732 : {
12733 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12734 0 : PyObject *py_resume_handle;
12735 0 : if (object->in.resume_handle == NULL) {
12736 0 : Py_RETURN_NONE;
12737 : }
12738 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
12739 0 : return py_resume_handle;
12740 : }
12741 :
12742 0 : static int py_lsa_EnumPrivs_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
12743 : {
12744 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12745 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
12746 0 : if (value == NULL) {
12747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
12748 0 : return -1;
12749 : }
12750 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
12751 0 : if (object->in.resume_handle == NULL) {
12752 0 : PyErr_NoMemory();
12753 0 : return -1;
12754 : }
12755 : {
12756 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
12757 0 : if (PyLong_Check(value)) {
12758 0 : unsigned long long test_var;
12759 0 : test_var = PyLong_AsUnsignedLongLong(value);
12760 0 : if (PyErr_Occurred() != NULL) {
12761 0 : return -1;
12762 : }
12763 0 : if (test_var > uint_max) {
12764 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12765 : PyLong_Type.tp_name, uint_max, test_var);
12766 0 : return -1;
12767 : }
12768 0 : *object->in.resume_handle = test_var;
12769 : } else {
12770 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12771 : PyLong_Type.tp_name);
12772 0 : return -1;
12773 : }
12774 : }
12775 0 : return 0;
12776 : }
12777 :
12778 0 : static PyObject *py_lsa_EnumPrivs_out_get_resume_handle(PyObject *obj, void *closure)
12779 : {
12780 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12781 0 : PyObject *py_resume_handle;
12782 0 : if (object->out.resume_handle == NULL) {
12783 0 : Py_RETURN_NONE;
12784 : }
12785 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
12786 0 : return py_resume_handle;
12787 : }
12788 :
12789 0 : static int py_lsa_EnumPrivs_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
12790 : {
12791 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12792 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
12793 0 : if (value == NULL) {
12794 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
12795 0 : return -1;
12796 : }
12797 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
12798 0 : if (object->out.resume_handle == NULL) {
12799 0 : PyErr_NoMemory();
12800 0 : return -1;
12801 : }
12802 : {
12803 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
12804 0 : if (PyLong_Check(value)) {
12805 0 : unsigned long long test_var;
12806 0 : test_var = PyLong_AsUnsignedLongLong(value);
12807 0 : if (PyErr_Occurred() != NULL) {
12808 0 : return -1;
12809 : }
12810 0 : if (test_var > uint_max) {
12811 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12812 : PyLong_Type.tp_name, uint_max, test_var);
12813 0 : return -1;
12814 : }
12815 0 : *object->out.resume_handle = test_var;
12816 : } else {
12817 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12818 : PyLong_Type.tp_name);
12819 0 : return -1;
12820 : }
12821 : }
12822 0 : return 0;
12823 : }
12824 :
12825 0 : static PyObject *py_lsa_EnumPrivs_out_get_privs(PyObject *obj, void *closure)
12826 : {
12827 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12828 0 : PyObject *py_privs;
12829 0 : if (object->out.privs == NULL) {
12830 0 : Py_RETURN_NONE;
12831 : }
12832 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, object->out.privs, object->out.privs);
12833 0 : return py_privs;
12834 : }
12835 :
12836 0 : static int py_lsa_EnumPrivs_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
12837 : {
12838 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12839 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
12840 0 : if (value == NULL) {
12841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.privs");
12842 0 : return -1;
12843 : }
12844 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
12845 0 : if (object->out.privs == NULL) {
12846 0 : PyErr_NoMemory();
12847 0 : return -1;
12848 : }
12849 0 : PY_CHECK_TYPE(&lsa_PrivArray_Type, value, return -1;);
12850 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12851 0 : PyErr_NoMemory();
12852 0 : return -1;
12853 : }
12854 0 : object->out.privs = (struct lsa_PrivArray *)pytalloc_get_ptr(value);
12855 0 : return 0;
12856 : }
12857 :
12858 0 : static PyObject *py_lsa_EnumPrivs_in_get_max_count(PyObject *obj, void *closure)
12859 : {
12860 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12861 0 : PyObject *py_max_count;
12862 0 : py_max_count = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_count);
12863 0 : return py_max_count;
12864 : }
12865 :
12866 0 : static int py_lsa_EnumPrivs_in_set_max_count(PyObject *py_obj, PyObject *value, void *closure)
12867 : {
12868 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12869 0 : if (value == NULL) {
12870 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_count");
12871 0 : return -1;
12872 : }
12873 : {
12874 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_count));
12875 0 : if (PyLong_Check(value)) {
12876 0 : unsigned long long test_var;
12877 0 : test_var = PyLong_AsUnsignedLongLong(value);
12878 0 : if (PyErr_Occurred() != NULL) {
12879 0 : return -1;
12880 : }
12881 0 : if (test_var > uint_max) {
12882 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12883 : PyLong_Type.tp_name, uint_max, test_var);
12884 0 : return -1;
12885 : }
12886 0 : object->in.max_count = test_var;
12887 : } else {
12888 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12889 : PyLong_Type.tp_name);
12890 0 : return -1;
12891 : }
12892 : }
12893 0 : return 0;
12894 : }
12895 :
12896 0 : static PyObject *py_lsa_EnumPrivs_get_result(PyObject *obj, void *closure)
12897 : {
12898 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(obj);
12899 0 : PyObject *py_result;
12900 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
12901 0 : return py_result;
12902 : }
12903 :
12904 0 : static int py_lsa_EnumPrivs_set_result(PyObject *py_obj, PyObject *value, void *closure)
12905 : {
12906 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12907 0 : if (value == NULL) {
12908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
12909 0 : return -1;
12910 : }
12911 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
12912 0 : return 0;
12913 : }
12914 :
12915 : static PyGetSetDef py_lsa_EnumPrivs_getsetters[] = {
12916 : {
12917 : .name = discard_const_p(char, "in_handle"),
12918 : .get = py_lsa_EnumPrivs_in_get_handle,
12919 : .set = py_lsa_EnumPrivs_in_set_handle,
12920 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
12921 : },
12922 : {
12923 : .name = discard_const_p(char, "in_resume_handle"),
12924 : .get = py_lsa_EnumPrivs_in_get_resume_handle,
12925 : .set = py_lsa_EnumPrivs_in_set_resume_handle,
12926 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12927 : },
12928 : {
12929 : .name = discard_const_p(char, "out_resume_handle"),
12930 : .get = py_lsa_EnumPrivs_out_get_resume_handle,
12931 : .set = py_lsa_EnumPrivs_out_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_privs"),
12936 : .get = py_lsa_EnumPrivs_out_get_privs,
12937 : .set = py_lsa_EnumPrivs_out_set_privs,
12938 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivArray")
12939 : },
12940 : {
12941 : .name = discard_const_p(char, "in_max_count"),
12942 : .get = py_lsa_EnumPrivs_in_get_max_count,
12943 : .set = py_lsa_EnumPrivs_in_set_max_count,
12944 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12945 : },
12946 : {
12947 : .name = discard_const_p(char, "result"),
12948 : .get = py_lsa_EnumPrivs_get_result,
12949 : .set = py_lsa_EnumPrivs_set_result,
12950 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
12951 : },
12952 : { .name = NULL }
12953 : };
12954 :
12955 0 : static PyObject *py_lsa_EnumPrivs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12956 : {
12957 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivs, type);
12958 0 : struct lsa_EnumPrivs *_self = (struct lsa_EnumPrivs *)pytalloc_get_ptr(self);
12959 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
12960 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
12961 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
12962 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
12963 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivArray);
12964 0 : return self;
12965 : }
12966 :
12967 0 : static PyObject *py_lsa_EnumPrivs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
12968 : {
12969 :
12970 :
12971 0 : return PyLong_FromLong(2);
12972 : }
12973 :
12974 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
12975 : {
12976 0 : const struct ndr_interface_call *call = NULL;
12977 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
12978 0 : PyObject *ret = NULL;
12979 0 : struct ndr_push *push = NULL;
12980 0 : DATA_BLOB blob;
12981 0 : enum ndr_err_code err;
12982 :
12983 0 : if (ndr_table_lsarpc.num_calls < 3) {
12984 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_pack");
12985 0 : return NULL;
12986 : }
12987 0 : call = &ndr_table_lsarpc.calls[2];
12988 :
12989 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
12990 0 : if (push == NULL) {
12991 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12992 0 : return NULL;
12993 : }
12994 :
12995 0 : push->flags |= ndr_push_flags;
12996 :
12997 0 : err = call->ndr_push(push, ndr_inout_flags, object);
12998 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12999 0 : TALLOC_FREE(push);
13000 0 : PyErr_SetNdrError(err);
13001 0 : return NULL;
13002 : }
13003 0 : blob = ndr_push_blob(push);
13004 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13005 0 : TALLOC_FREE(push);
13006 0 : return ret;
13007 : }
13008 :
13009 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13010 : {
13011 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13012 0 : PyObject *bigendian_obj = NULL;
13013 0 : PyObject *ndr64_obj = NULL;
13014 0 : libndr_flags ndr_push_flags = 0;
13015 :
13016 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13017 : discard_const_p(char *, kwnames),
13018 : &bigendian_obj,
13019 : &ndr64_obj)) {
13020 0 : return NULL;
13021 : }
13022 :
13023 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13024 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13025 : }
13026 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13027 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13028 : }
13029 :
13030 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13031 : }
13032 :
13033 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13034 : {
13035 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13036 0 : PyObject *bigendian_obj = NULL;
13037 0 : PyObject *ndr64_obj = NULL;
13038 0 : libndr_flags ndr_push_flags = 0;
13039 :
13040 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13041 : discard_const_p(char *, kwnames),
13042 : &bigendian_obj,
13043 : &ndr64_obj)) {
13044 0 : return NULL;
13045 : }
13046 :
13047 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13048 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13049 : }
13050 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13051 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13052 : }
13053 :
13054 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13055 : }
13056 :
13057 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13058 : {
13059 0 : const struct ndr_interface_call *call = NULL;
13060 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
13061 0 : struct ndr_pull *pull = NULL;
13062 0 : enum ndr_err_code err;
13063 :
13064 0 : if (ndr_table_lsarpc.num_calls < 3) {
13065 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_unpack");
13066 0 : return NULL;
13067 : }
13068 0 : call = &ndr_table_lsarpc.calls[2];
13069 :
13070 0 : pull = ndr_pull_init_blob(blob, object);
13071 0 : if (pull == NULL) {
13072 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13073 0 : return NULL;
13074 : }
13075 :
13076 0 : pull->flags |= ndr_pull_flags;
13077 :
13078 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13079 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13080 0 : TALLOC_FREE(pull);
13081 0 : PyErr_SetNdrError(err);
13082 0 : return NULL;
13083 : }
13084 0 : if (!allow_remaining) {
13085 0 : uint32_t highest_ofs;
13086 :
13087 0 : if (pull->offset > pull->relative_highest_offset) {
13088 0 : highest_ofs = pull->offset;
13089 : } else {
13090 0 : highest_ofs = pull->relative_highest_offset;
13091 : }
13092 0 : if (highest_ofs < pull->data_size) {
13093 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13094 : "not all bytes consumed ofs[%u] size[%u]",
13095 : highest_ofs, pull->data_size);
13096 0 : TALLOC_FREE(pull);
13097 0 : PyErr_SetNdrError(err);
13098 0 : return NULL;
13099 : }
13100 : }
13101 :
13102 0 : TALLOC_FREE(pull);
13103 0 : Py_RETURN_NONE;
13104 : }
13105 :
13106 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13107 : {
13108 0 : DATA_BLOB blob;
13109 0 : Py_ssize_t blob_length = 0;
13110 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13111 0 : PyObject *bigendian_obj = NULL;
13112 0 : PyObject *ndr64_obj = NULL;
13113 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13114 0 : PyObject *allow_remaining_obj = NULL;
13115 0 : bool allow_remaining = false;
13116 :
13117 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13118 : discard_const_p(char *, kwnames),
13119 : &blob.data, &blob_length,
13120 : &bigendian_obj,
13121 : &ndr64_obj,
13122 : &allow_remaining_obj)) {
13123 0 : return NULL;
13124 : }
13125 0 : blob.length = blob_length;
13126 :
13127 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13128 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13129 : }
13130 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13131 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13132 : }
13133 :
13134 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13135 0 : allow_remaining = true;
13136 : }
13137 :
13138 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13139 : }
13140 :
13141 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13142 : {
13143 0 : DATA_BLOB blob;
13144 0 : Py_ssize_t blob_length = 0;
13145 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13146 0 : PyObject *bigendian_obj = NULL;
13147 0 : PyObject *ndr64_obj = NULL;
13148 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13149 0 : PyObject *allow_remaining_obj = NULL;
13150 0 : bool allow_remaining = false;
13151 :
13152 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13153 : discard_const_p(char *, kwnames),
13154 : &blob.data, &blob_length,
13155 : &bigendian_obj,
13156 : &ndr64_obj,
13157 : &allow_remaining_obj)) {
13158 0 : return NULL;
13159 : }
13160 0 : blob.length = blob_length;
13161 :
13162 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13163 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13164 : }
13165 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13166 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13167 : }
13168 :
13169 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13170 0 : allow_remaining = true;
13171 : }
13172 :
13173 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13174 : }
13175 :
13176 0 : static PyObject *py_lsa_EnumPrivs_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13177 : {
13178 0 : const struct ndr_interface_call *call = NULL;
13179 0 : struct lsa_EnumPrivs *object = (struct lsa_EnumPrivs *)pytalloc_get_ptr(py_obj);
13180 0 : PyObject *ret;
13181 0 : char *retstr;
13182 :
13183 0 : if (ndr_table_lsarpc.num_calls < 3) {
13184 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_print");
13185 0 : return NULL;
13186 : }
13187 0 : call = &ndr_table_lsarpc.calls[2];
13188 :
13189 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13190 0 : ret = PyUnicode_FromString(retstr);
13191 0 : TALLOC_FREE(retstr);
13192 :
13193 0 : return ret;
13194 : }
13195 :
13196 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13197 : {
13198 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_in", NDR_IN);
13199 : }
13200 :
13201 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13202 : {
13203 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_out", NDR_OUT);
13204 : }
13205 :
13206 : static PyMethodDef py_lsa_EnumPrivs_methods[] = {
13207 : { "opnum", (PyCFunction)py_lsa_EnumPrivs_ndr_opnum, METH_NOARGS|METH_CLASS,
13208 : "lsa.EnumPrivs.opnum() -> 2 (0x02) " },
13209 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13210 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13211 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13212 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13213 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13214 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13215 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13216 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13217 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13218 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13219 : { NULL, NULL, 0, NULL }
13220 : };
13221 :
13222 :
13223 : static PyTypeObject lsa_EnumPrivs_Type = {
13224 : PyVarObject_HEAD_INIT(NULL, 0)
13225 : .tp_name = "lsa.EnumPrivs",
13226 : .tp_getset = py_lsa_EnumPrivs_getsetters,
13227 : .tp_methods = py_lsa_EnumPrivs_methods,
13228 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13229 : .tp_new = py_lsa_EnumPrivs_new,
13230 : };
13231 :
13232 0 : static bool pack_py_lsa_EnumPrivs_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivs *r)
13233 : {
13234 0 : PyObject *py_handle;
13235 0 : PyObject *py_resume_handle;
13236 0 : PyObject *py_max_count;
13237 0 : const char *kwnames[] = {
13238 : "handle", "resume_handle", "max_count", NULL
13239 : };
13240 :
13241 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumPrivs", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_count)) {
13242 0 : return false;
13243 : }
13244 :
13245 0 : if (py_handle == NULL) {
13246 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
13247 0 : return false;
13248 : }
13249 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13250 0 : if (r->in.handle == NULL) {
13251 0 : PyErr_NoMemory();
13252 0 : return false;
13253 : }
13254 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13255 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13256 0 : PyErr_NoMemory();
13257 0 : return false;
13258 : }
13259 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13260 0 : if (py_resume_handle == NULL) {
13261 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
13262 0 : return false;
13263 : }
13264 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
13265 0 : if (r->in.resume_handle == NULL) {
13266 0 : PyErr_NoMemory();
13267 0 : return false;
13268 : }
13269 : {
13270 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
13271 0 : if (PyLong_Check(py_resume_handle)) {
13272 0 : unsigned long long test_var;
13273 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
13274 0 : if (PyErr_Occurred() != NULL) {
13275 0 : return false;
13276 : }
13277 0 : if (test_var > uint_max) {
13278 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13279 : PyLong_Type.tp_name, uint_max, test_var);
13280 0 : return false;
13281 : }
13282 0 : *r->in.resume_handle = test_var;
13283 : } else {
13284 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13285 : PyLong_Type.tp_name);
13286 0 : return false;
13287 : }
13288 : }
13289 0 : if (py_max_count == NULL) {
13290 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_count");
13291 0 : return false;
13292 : }
13293 : {
13294 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_count));
13295 0 : if (PyLong_Check(py_max_count)) {
13296 0 : unsigned long long test_var;
13297 0 : test_var = PyLong_AsUnsignedLongLong(py_max_count);
13298 0 : if (PyErr_Occurred() != NULL) {
13299 0 : return false;
13300 : }
13301 0 : if (test_var > uint_max) {
13302 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13303 : PyLong_Type.tp_name, uint_max, test_var);
13304 0 : return false;
13305 : }
13306 0 : r->in.max_count = test_var;
13307 : } else {
13308 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13309 : PyLong_Type.tp_name);
13310 0 : return false;
13311 : }
13312 : }
13313 0 : return true;
13314 : }
13315 :
13316 0 : static PyObject *unpack_py_lsa_EnumPrivs_args_out(struct lsa_EnumPrivs *r)
13317 : {
13318 0 : PyObject *result;
13319 0 : PyObject *py_resume_handle;
13320 0 : PyObject *py_privs;
13321 0 : result = PyTuple_New(2);
13322 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
13323 0 : PyTuple_SetItem(result, 0, py_resume_handle);
13324 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, r->out.privs, r->out.privs);
13325 0 : PyTuple_SetItem(result, 1, py_privs);
13326 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13327 0 : PyErr_SetNTSTATUS(r->out.result);
13328 0 : return NULL;
13329 : }
13330 :
13331 0 : return result;
13332 : }
13333 :
13334 :
13335 0 : static PyObject *py_lsa_QuerySecurity_in_get_handle(PyObject *obj, void *closure)
13336 : {
13337 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13338 0 : PyObject *py_handle;
13339 0 : if (object->in.handle == NULL) {
13340 0 : Py_RETURN_NONE;
13341 : }
13342 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13343 0 : return py_handle;
13344 : }
13345 :
13346 0 : static int py_lsa_QuerySecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13347 : {
13348 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13349 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13350 0 : if (value == NULL) {
13351 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13352 0 : return -1;
13353 : }
13354 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13355 0 : if (object->in.handle == NULL) {
13356 0 : PyErr_NoMemory();
13357 0 : return -1;
13358 : }
13359 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13360 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13361 0 : PyErr_NoMemory();
13362 0 : return -1;
13363 : }
13364 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13365 0 : return 0;
13366 : }
13367 :
13368 0 : static PyObject *py_lsa_QuerySecurity_in_get_sec_info(PyObject *obj, void *closure)
13369 : {
13370 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13371 0 : PyObject *py_sec_info;
13372 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
13373 0 : return py_sec_info;
13374 : }
13375 :
13376 0 : static int py_lsa_QuerySecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
13377 : {
13378 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13379 0 : if (value == NULL) {
13380 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
13381 0 : return -1;
13382 : }
13383 : {
13384 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
13385 0 : if (PyLong_Check(value)) {
13386 0 : unsigned long long test_var;
13387 0 : test_var = PyLong_AsUnsignedLongLong(value);
13388 0 : if (PyErr_Occurred() != NULL) {
13389 0 : return -1;
13390 : }
13391 0 : if (test_var > uint_max) {
13392 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13393 : PyLong_Type.tp_name, uint_max, test_var);
13394 0 : return -1;
13395 : }
13396 0 : object->in.sec_info = test_var;
13397 : } else {
13398 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13399 : PyLong_Type.tp_name);
13400 0 : return -1;
13401 : }
13402 : }
13403 0 : return 0;
13404 : }
13405 :
13406 0 : static PyObject *py_lsa_QuerySecurity_out_get_sdbuf(PyObject *obj, void *closure)
13407 : {
13408 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13409 0 : PyObject *py_sdbuf;
13410 0 : if (object->out.sdbuf == NULL) {
13411 0 : Py_RETURN_NONE;
13412 : }
13413 0 : if (*object->out.sdbuf == NULL) {
13414 0 : py_sdbuf = Py_None;
13415 0 : Py_INCREF(py_sdbuf);
13416 : } else {
13417 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *object->out.sdbuf, *object->out.sdbuf);
13418 : }
13419 0 : return py_sdbuf;
13420 : }
13421 :
13422 0 : static int py_lsa_QuerySecurity_out_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13423 : {
13424 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13425 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sdbuf));
13426 0 : if (value == NULL) {
13427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sdbuf");
13428 0 : return -1;
13429 : }
13430 0 : object->out.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sdbuf);
13431 0 : if (object->out.sdbuf == NULL) {
13432 0 : PyErr_NoMemory();
13433 0 : return -1;
13434 : }
13435 0 : if (value == Py_None) {
13436 0 : *object->out.sdbuf = NULL;
13437 : } else {
13438 0 : *object->out.sdbuf = NULL;
13439 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13440 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13441 0 : PyErr_NoMemory();
13442 0 : return -1;
13443 : }
13444 0 : *object->out.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
13445 : }
13446 0 : return 0;
13447 : }
13448 :
13449 0 : static PyObject *py_lsa_QuerySecurity_get_result(PyObject *obj, void *closure)
13450 : {
13451 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(obj);
13452 0 : PyObject *py_result;
13453 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13454 0 : return py_result;
13455 : }
13456 :
13457 0 : static int py_lsa_QuerySecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
13458 : {
13459 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13460 0 : if (value == NULL) {
13461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13462 0 : return -1;
13463 : }
13464 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13465 0 : return 0;
13466 : }
13467 :
13468 : static PyGetSetDef py_lsa_QuerySecurity_getsetters[] = {
13469 : {
13470 : .name = discard_const_p(char, "in_handle"),
13471 : .get = py_lsa_QuerySecurity_in_get_handle,
13472 : .set = py_lsa_QuerySecurity_in_set_handle,
13473 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13474 : },
13475 : {
13476 : .name = discard_const_p(char, "in_sec_info"),
13477 : .get = py_lsa_QuerySecurity_in_get_sec_info,
13478 : .set = py_lsa_QuerySecurity_in_set_sec_info,
13479 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
13480 : },
13481 : {
13482 : .name = discard_const_p(char, "out_sdbuf"),
13483 : .get = py_lsa_QuerySecurity_out_get_sdbuf,
13484 : .set = py_lsa_QuerySecurity_out_set_sdbuf,
13485 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13486 : },
13487 : {
13488 : .name = discard_const_p(char, "result"),
13489 : .get = py_lsa_QuerySecurity_get_result,
13490 : .set = py_lsa_QuerySecurity_set_result,
13491 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13492 : },
13493 : { .name = NULL }
13494 : };
13495 :
13496 0 : static PyObject *py_lsa_QuerySecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13497 : {
13498 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecurity, type);
13499 0 : struct lsa_QuerySecurity *_self = (struct lsa_QuerySecurity *)pytalloc_get_ptr(self);
13500 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13501 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
13502 : /* a pointer to a NULL pointer */
13503 0 : _self->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
13504 0 : return self;
13505 : }
13506 :
13507 0 : static PyObject *py_lsa_QuerySecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13508 : {
13509 :
13510 :
13511 0 : return PyLong_FromLong(3);
13512 : }
13513 :
13514 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13515 : {
13516 0 : const struct ndr_interface_call *call = NULL;
13517 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13518 0 : PyObject *ret = NULL;
13519 0 : struct ndr_push *push = NULL;
13520 0 : DATA_BLOB blob;
13521 0 : enum ndr_err_code err;
13522 :
13523 0 : if (ndr_table_lsarpc.num_calls < 4) {
13524 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_pack");
13525 0 : return NULL;
13526 : }
13527 0 : call = &ndr_table_lsarpc.calls[3];
13528 :
13529 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13530 0 : if (push == NULL) {
13531 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13532 0 : return NULL;
13533 : }
13534 :
13535 0 : push->flags |= ndr_push_flags;
13536 :
13537 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13538 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13539 0 : TALLOC_FREE(push);
13540 0 : PyErr_SetNdrError(err);
13541 0 : return NULL;
13542 : }
13543 0 : blob = ndr_push_blob(push);
13544 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13545 0 : TALLOC_FREE(push);
13546 0 : return ret;
13547 : }
13548 :
13549 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13550 : {
13551 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13552 0 : PyObject *bigendian_obj = NULL;
13553 0 : PyObject *ndr64_obj = NULL;
13554 0 : libndr_flags ndr_push_flags = 0;
13555 :
13556 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13557 : discard_const_p(char *, kwnames),
13558 : &bigendian_obj,
13559 : &ndr64_obj)) {
13560 0 : return NULL;
13561 : }
13562 :
13563 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13564 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13565 : }
13566 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13567 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13568 : }
13569 :
13570 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13571 : }
13572 :
13573 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13574 : {
13575 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13576 0 : PyObject *bigendian_obj = NULL;
13577 0 : PyObject *ndr64_obj = NULL;
13578 0 : libndr_flags ndr_push_flags = 0;
13579 :
13580 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13581 : discard_const_p(char *, kwnames),
13582 : &bigendian_obj,
13583 : &ndr64_obj)) {
13584 0 : return NULL;
13585 : }
13586 :
13587 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13588 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13589 : }
13590 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13591 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13592 : }
13593 :
13594 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13595 : }
13596 :
13597 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13598 : {
13599 0 : const struct ndr_interface_call *call = NULL;
13600 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13601 0 : struct ndr_pull *pull = NULL;
13602 0 : enum ndr_err_code err;
13603 :
13604 0 : if (ndr_table_lsarpc.num_calls < 4) {
13605 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_unpack");
13606 0 : return NULL;
13607 : }
13608 0 : call = &ndr_table_lsarpc.calls[3];
13609 :
13610 0 : pull = ndr_pull_init_blob(blob, object);
13611 0 : if (pull == NULL) {
13612 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13613 0 : return NULL;
13614 : }
13615 :
13616 0 : pull->flags |= ndr_pull_flags;
13617 :
13618 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13619 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13620 0 : TALLOC_FREE(pull);
13621 0 : PyErr_SetNdrError(err);
13622 0 : return NULL;
13623 : }
13624 0 : if (!allow_remaining) {
13625 0 : uint32_t highest_ofs;
13626 :
13627 0 : if (pull->offset > pull->relative_highest_offset) {
13628 0 : highest_ofs = pull->offset;
13629 : } else {
13630 0 : highest_ofs = pull->relative_highest_offset;
13631 : }
13632 0 : if (highest_ofs < pull->data_size) {
13633 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13634 : "not all bytes consumed ofs[%u] size[%u]",
13635 : highest_ofs, pull->data_size);
13636 0 : TALLOC_FREE(pull);
13637 0 : PyErr_SetNdrError(err);
13638 0 : return NULL;
13639 : }
13640 : }
13641 :
13642 0 : TALLOC_FREE(pull);
13643 0 : Py_RETURN_NONE;
13644 : }
13645 :
13646 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13647 : {
13648 0 : DATA_BLOB blob;
13649 0 : Py_ssize_t blob_length = 0;
13650 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13651 0 : PyObject *bigendian_obj = NULL;
13652 0 : PyObject *ndr64_obj = NULL;
13653 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13654 0 : PyObject *allow_remaining_obj = NULL;
13655 0 : bool allow_remaining = false;
13656 :
13657 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13658 : discard_const_p(char *, kwnames),
13659 : &blob.data, &blob_length,
13660 : &bigendian_obj,
13661 : &ndr64_obj,
13662 : &allow_remaining_obj)) {
13663 0 : return NULL;
13664 : }
13665 0 : blob.length = blob_length;
13666 :
13667 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13668 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13669 : }
13670 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13671 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13672 : }
13673 :
13674 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13675 0 : allow_remaining = true;
13676 : }
13677 :
13678 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13679 : }
13680 :
13681 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13682 : {
13683 0 : DATA_BLOB blob;
13684 0 : Py_ssize_t blob_length = 0;
13685 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13686 0 : PyObject *bigendian_obj = NULL;
13687 0 : PyObject *ndr64_obj = NULL;
13688 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13689 0 : PyObject *allow_remaining_obj = NULL;
13690 0 : bool allow_remaining = false;
13691 :
13692 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13693 : discard_const_p(char *, kwnames),
13694 : &blob.data, &blob_length,
13695 : &bigendian_obj,
13696 : &ndr64_obj,
13697 : &allow_remaining_obj)) {
13698 0 : return NULL;
13699 : }
13700 0 : blob.length = blob_length;
13701 :
13702 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13703 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13704 : }
13705 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13706 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13707 : }
13708 :
13709 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13710 0 : allow_remaining = true;
13711 : }
13712 :
13713 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13714 : }
13715 :
13716 0 : static PyObject *py_lsa_QuerySecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13717 : {
13718 0 : const struct ndr_interface_call *call = NULL;
13719 0 : struct lsa_QuerySecurity *object = (struct lsa_QuerySecurity *)pytalloc_get_ptr(py_obj);
13720 0 : PyObject *ret;
13721 0 : char *retstr;
13722 :
13723 0 : if (ndr_table_lsarpc.num_calls < 4) {
13724 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_print");
13725 0 : return NULL;
13726 : }
13727 0 : call = &ndr_table_lsarpc.calls[3];
13728 :
13729 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13730 0 : ret = PyUnicode_FromString(retstr);
13731 0 : TALLOC_FREE(retstr);
13732 :
13733 0 : return ret;
13734 : }
13735 :
13736 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13737 : {
13738 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_in", NDR_IN);
13739 : }
13740 :
13741 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13742 : {
13743 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_out", NDR_OUT);
13744 : }
13745 :
13746 : static PyMethodDef py_lsa_QuerySecurity_methods[] = {
13747 : { "opnum", (PyCFunction)py_lsa_QuerySecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
13748 : "lsa.QuerySecurity.opnum() -> 3 (0x03) " },
13749 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13750 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13751 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13752 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13753 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13754 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13755 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13756 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13757 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13758 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13759 : { NULL, NULL, 0, NULL }
13760 : };
13761 :
13762 :
13763 : static PyTypeObject lsa_QuerySecurity_Type = {
13764 : PyVarObject_HEAD_INIT(NULL, 0)
13765 : .tp_name = "lsa.QuerySecurity",
13766 : .tp_getset = py_lsa_QuerySecurity_getsetters,
13767 : .tp_methods = py_lsa_QuerySecurity_methods,
13768 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13769 : .tp_new = py_lsa_QuerySecurity_new,
13770 : };
13771 :
13772 0 : static bool pack_py_lsa_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecurity *r)
13773 : {
13774 0 : PyObject *py_handle;
13775 0 : PyObject *py_sec_info;
13776 0 : const char *kwnames[] = {
13777 : "handle", "sec_info", NULL
13778 : };
13779 :
13780 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
13781 0 : return false;
13782 : }
13783 :
13784 0 : if (py_handle == NULL) {
13785 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
13786 0 : return false;
13787 : }
13788 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13789 0 : if (r->in.handle == NULL) {
13790 0 : PyErr_NoMemory();
13791 0 : return false;
13792 : }
13793 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13794 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13795 0 : PyErr_NoMemory();
13796 0 : return false;
13797 : }
13798 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13799 0 : if (py_sec_info == NULL) {
13800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
13801 0 : return false;
13802 : }
13803 : {
13804 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
13805 0 : if (PyLong_Check(py_sec_info)) {
13806 0 : unsigned long long test_var;
13807 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
13808 0 : if (PyErr_Occurred() != NULL) {
13809 0 : return false;
13810 : }
13811 0 : if (test_var > uint_max) {
13812 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13813 : PyLong_Type.tp_name, uint_max, test_var);
13814 0 : return false;
13815 : }
13816 0 : r->in.sec_info = test_var;
13817 : } else {
13818 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13819 : PyLong_Type.tp_name);
13820 0 : return false;
13821 : }
13822 : }
13823 0 : return true;
13824 : }
13825 :
13826 0 : static PyObject *unpack_py_lsa_QuerySecurity_args_out(struct lsa_QuerySecurity *r)
13827 : {
13828 0 : PyObject *result;
13829 0 : PyObject *py_sdbuf;
13830 0 : if (*r->out.sdbuf == NULL) {
13831 0 : py_sdbuf = Py_None;
13832 0 : Py_INCREF(py_sdbuf);
13833 : } else {
13834 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
13835 : }
13836 0 : result = py_sdbuf;
13837 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13838 0 : PyErr_SetNTSTATUS(r->out.result);
13839 0 : return NULL;
13840 : }
13841 :
13842 0 : return result;
13843 : }
13844 :
13845 :
13846 0 : static PyObject *py_lsa_SetSecObj_in_get_handle(PyObject *obj, void *closure)
13847 : {
13848 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13849 0 : PyObject *py_handle;
13850 0 : if (object->in.handle == NULL) {
13851 0 : Py_RETURN_NONE;
13852 : }
13853 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13854 0 : return py_handle;
13855 : }
13856 :
13857 0 : static int py_lsa_SetSecObj_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13858 : {
13859 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13860 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13861 0 : if (value == NULL) {
13862 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13863 0 : return -1;
13864 : }
13865 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13866 0 : if (object->in.handle == NULL) {
13867 0 : PyErr_NoMemory();
13868 0 : return -1;
13869 : }
13870 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13871 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13872 0 : PyErr_NoMemory();
13873 0 : return -1;
13874 : }
13875 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13876 0 : return 0;
13877 : }
13878 :
13879 0 : static PyObject *py_lsa_SetSecObj_in_get_sec_info(PyObject *obj, void *closure)
13880 : {
13881 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13882 0 : PyObject *py_sec_info;
13883 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
13884 0 : return py_sec_info;
13885 : }
13886 :
13887 0 : static int py_lsa_SetSecObj_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
13888 : {
13889 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13890 0 : if (value == NULL) {
13891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
13892 0 : return -1;
13893 : }
13894 : {
13895 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
13896 0 : if (PyLong_Check(value)) {
13897 0 : unsigned long long test_var;
13898 0 : test_var = PyLong_AsUnsignedLongLong(value);
13899 0 : if (PyErr_Occurred() != NULL) {
13900 0 : return -1;
13901 : }
13902 0 : if (test_var > uint_max) {
13903 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13904 : PyLong_Type.tp_name, uint_max, test_var);
13905 0 : return -1;
13906 : }
13907 0 : object->in.sec_info = test_var;
13908 : } else {
13909 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13910 : PyLong_Type.tp_name);
13911 0 : return -1;
13912 : }
13913 : }
13914 0 : return 0;
13915 : }
13916 :
13917 0 : static PyObject *py_lsa_SetSecObj_in_get_sdbuf(PyObject *obj, void *closure)
13918 : {
13919 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13920 0 : PyObject *py_sdbuf;
13921 0 : if (object->in.sdbuf == NULL) {
13922 0 : Py_RETURN_NONE;
13923 : }
13924 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, object->in.sdbuf, object->in.sdbuf);
13925 0 : return py_sdbuf;
13926 : }
13927 :
13928 0 : static int py_lsa_SetSecObj_in_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
13929 : {
13930 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13931 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sdbuf));
13932 0 : if (value == NULL) {
13933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sdbuf");
13934 0 : return -1;
13935 : }
13936 0 : object->in.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sdbuf);
13937 0 : if (object->in.sdbuf == NULL) {
13938 0 : PyErr_NoMemory();
13939 0 : return -1;
13940 : }
13941 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
13942 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13943 0 : PyErr_NoMemory();
13944 0 : return -1;
13945 : }
13946 0 : object->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
13947 0 : return 0;
13948 : }
13949 :
13950 0 : static PyObject *py_lsa_SetSecObj_get_result(PyObject *obj, void *closure)
13951 : {
13952 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(obj);
13953 0 : PyObject *py_result;
13954 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13955 0 : return py_result;
13956 : }
13957 :
13958 0 : static int py_lsa_SetSecObj_set_result(PyObject *py_obj, PyObject *value, void *closure)
13959 : {
13960 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
13961 0 : if (value == NULL) {
13962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13963 0 : return -1;
13964 : }
13965 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13966 0 : return 0;
13967 : }
13968 :
13969 : static PyGetSetDef py_lsa_SetSecObj_getsetters[] = {
13970 : {
13971 : .name = discard_const_p(char, "in_handle"),
13972 : .get = py_lsa_SetSecObj_in_get_handle,
13973 : .set = py_lsa_SetSecObj_in_set_handle,
13974 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13975 : },
13976 : {
13977 : .name = discard_const_p(char, "in_sec_info"),
13978 : .get = py_lsa_SetSecObj_in_get_sec_info,
13979 : .set = py_lsa_SetSecObj_in_set_sec_info,
13980 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
13981 : },
13982 : {
13983 : .name = discard_const_p(char, "in_sdbuf"),
13984 : .get = py_lsa_SetSecObj_in_get_sdbuf,
13985 : .set = py_lsa_SetSecObj_in_set_sdbuf,
13986 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
13987 : },
13988 : {
13989 : .name = discard_const_p(char, "result"),
13990 : .get = py_lsa_SetSecObj_get_result,
13991 : .set = py_lsa_SetSecObj_set_result,
13992 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13993 : },
13994 : { .name = NULL }
13995 : };
13996 :
13997 0 : static PyObject *py_lsa_SetSecObj_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13998 : {
13999 0 : PyObject *self = pytalloc_new(struct lsa_SetSecObj, type);
14000 0 : struct lsa_SetSecObj *_self = (struct lsa_SetSecObj *)pytalloc_get_ptr(self);
14001 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14002 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14003 0 : _self->in.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf);
14004 0 : return self;
14005 : }
14006 :
14007 0 : static PyObject *py_lsa_SetSecObj_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14008 : {
14009 :
14010 :
14011 0 : return PyLong_FromLong(4);
14012 : }
14013 :
14014 0 : static PyObject *py_lsa_SetSecObj_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14015 : {
14016 0 : const struct ndr_interface_call *call = NULL;
14017 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14018 0 : PyObject *ret = NULL;
14019 0 : struct ndr_push *push = NULL;
14020 0 : DATA_BLOB blob;
14021 0 : enum ndr_err_code err;
14022 :
14023 0 : if (ndr_table_lsarpc.num_calls < 5) {
14024 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_pack");
14025 0 : return NULL;
14026 : }
14027 0 : call = &ndr_table_lsarpc.calls[4];
14028 :
14029 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14030 0 : if (push == NULL) {
14031 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14032 0 : return NULL;
14033 : }
14034 :
14035 0 : push->flags |= ndr_push_flags;
14036 :
14037 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14038 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14039 0 : TALLOC_FREE(push);
14040 0 : PyErr_SetNdrError(err);
14041 0 : return NULL;
14042 : }
14043 0 : blob = ndr_push_blob(push);
14044 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14045 0 : TALLOC_FREE(push);
14046 0 : return ret;
14047 : }
14048 :
14049 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14050 : {
14051 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14052 0 : PyObject *bigendian_obj = NULL;
14053 0 : PyObject *ndr64_obj = NULL;
14054 0 : libndr_flags ndr_push_flags = 0;
14055 :
14056 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14057 : discard_const_p(char *, kwnames),
14058 : &bigendian_obj,
14059 : &ndr64_obj)) {
14060 0 : return NULL;
14061 : }
14062 :
14063 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14064 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14065 : }
14066 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14067 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14068 : }
14069 :
14070 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14071 : }
14072 :
14073 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14074 : {
14075 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14076 0 : PyObject *bigendian_obj = NULL;
14077 0 : PyObject *ndr64_obj = NULL;
14078 0 : libndr_flags ndr_push_flags = 0;
14079 :
14080 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14081 : discard_const_p(char *, kwnames),
14082 : &bigendian_obj,
14083 : &ndr64_obj)) {
14084 0 : return NULL;
14085 : }
14086 :
14087 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14088 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14089 : }
14090 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14091 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14092 : }
14093 :
14094 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14095 : }
14096 :
14097 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14098 : {
14099 0 : const struct ndr_interface_call *call = NULL;
14100 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14101 0 : struct ndr_pull *pull = NULL;
14102 0 : enum ndr_err_code err;
14103 :
14104 0 : if (ndr_table_lsarpc.num_calls < 5) {
14105 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_unpack");
14106 0 : return NULL;
14107 : }
14108 0 : call = &ndr_table_lsarpc.calls[4];
14109 :
14110 0 : pull = ndr_pull_init_blob(blob, object);
14111 0 : if (pull == NULL) {
14112 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14113 0 : return NULL;
14114 : }
14115 :
14116 0 : pull->flags |= ndr_pull_flags;
14117 :
14118 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14119 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14120 0 : TALLOC_FREE(pull);
14121 0 : PyErr_SetNdrError(err);
14122 0 : return NULL;
14123 : }
14124 0 : if (!allow_remaining) {
14125 0 : uint32_t highest_ofs;
14126 :
14127 0 : if (pull->offset > pull->relative_highest_offset) {
14128 0 : highest_ofs = pull->offset;
14129 : } else {
14130 0 : highest_ofs = pull->relative_highest_offset;
14131 : }
14132 0 : if (highest_ofs < pull->data_size) {
14133 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14134 : "not all bytes consumed ofs[%u] size[%u]",
14135 : highest_ofs, pull->data_size);
14136 0 : TALLOC_FREE(pull);
14137 0 : PyErr_SetNdrError(err);
14138 0 : return NULL;
14139 : }
14140 : }
14141 :
14142 0 : TALLOC_FREE(pull);
14143 0 : Py_RETURN_NONE;
14144 : }
14145 :
14146 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14147 : {
14148 0 : DATA_BLOB blob;
14149 0 : Py_ssize_t blob_length = 0;
14150 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14151 0 : PyObject *bigendian_obj = NULL;
14152 0 : PyObject *ndr64_obj = NULL;
14153 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14154 0 : PyObject *allow_remaining_obj = NULL;
14155 0 : bool allow_remaining = false;
14156 :
14157 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14158 : discard_const_p(char *, kwnames),
14159 : &blob.data, &blob_length,
14160 : &bigendian_obj,
14161 : &ndr64_obj,
14162 : &allow_remaining_obj)) {
14163 0 : return NULL;
14164 : }
14165 0 : blob.length = blob_length;
14166 :
14167 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14168 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14169 : }
14170 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14171 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14172 : }
14173 :
14174 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14175 0 : allow_remaining = true;
14176 : }
14177 :
14178 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14179 : }
14180 :
14181 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14182 : {
14183 0 : DATA_BLOB blob;
14184 0 : Py_ssize_t blob_length = 0;
14185 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14186 0 : PyObject *bigendian_obj = NULL;
14187 0 : PyObject *ndr64_obj = NULL;
14188 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14189 0 : PyObject *allow_remaining_obj = NULL;
14190 0 : bool allow_remaining = false;
14191 :
14192 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14193 : discard_const_p(char *, kwnames),
14194 : &blob.data, &blob_length,
14195 : &bigendian_obj,
14196 : &ndr64_obj,
14197 : &allow_remaining_obj)) {
14198 0 : return NULL;
14199 : }
14200 0 : blob.length = blob_length;
14201 :
14202 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14203 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14204 : }
14205 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14206 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14207 : }
14208 :
14209 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14210 0 : allow_remaining = true;
14211 : }
14212 :
14213 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14214 : }
14215 :
14216 0 : static PyObject *py_lsa_SetSecObj_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14217 : {
14218 0 : const struct ndr_interface_call *call = NULL;
14219 0 : struct lsa_SetSecObj *object = (struct lsa_SetSecObj *)pytalloc_get_ptr(py_obj);
14220 0 : PyObject *ret;
14221 0 : char *retstr;
14222 :
14223 0 : if (ndr_table_lsarpc.num_calls < 5) {
14224 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_print");
14225 0 : return NULL;
14226 : }
14227 0 : call = &ndr_table_lsarpc.calls[4];
14228 :
14229 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14230 0 : ret = PyUnicode_FromString(retstr);
14231 0 : TALLOC_FREE(retstr);
14232 :
14233 0 : return ret;
14234 : }
14235 :
14236 0 : static PyObject *py_lsa_SetSecObj_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14237 : {
14238 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_in", NDR_IN);
14239 : }
14240 :
14241 0 : static PyObject *py_lsa_SetSecObj_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14242 : {
14243 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_out", NDR_OUT);
14244 : }
14245 :
14246 : static PyMethodDef py_lsa_SetSecObj_methods[] = {
14247 : { "opnum", (PyCFunction)py_lsa_SetSecObj_ndr_opnum, METH_NOARGS|METH_CLASS,
14248 : "lsa.SetSecObj.opnum() -> 4 (0x04) " },
14249 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14250 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14251 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14252 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14253 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14254 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14255 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14256 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14257 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecObj_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14258 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecObj_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14259 : { NULL, NULL, 0, NULL }
14260 : };
14261 :
14262 :
14263 : static PyTypeObject lsa_SetSecObj_Type = {
14264 : PyVarObject_HEAD_INIT(NULL, 0)
14265 : .tp_name = "lsa.SetSecObj",
14266 : .tp_getset = py_lsa_SetSecObj_getsetters,
14267 : .tp_methods = py_lsa_SetSecObj_methods,
14268 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14269 : .tp_new = py_lsa_SetSecObj_new,
14270 : };
14271 :
14272 0 : static bool pack_py_lsa_SetSecObj_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecObj *r)
14273 : {
14274 0 : PyObject *py_handle;
14275 0 : PyObject *py_sec_info;
14276 0 : PyObject *py_sdbuf;
14277 0 : const char *kwnames[] = {
14278 : "handle", "sec_info", "sdbuf", NULL
14279 : };
14280 :
14281 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecObj", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
14282 0 : return false;
14283 : }
14284 :
14285 0 : if (py_handle == NULL) {
14286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14287 0 : return false;
14288 : }
14289 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14290 0 : if (r->in.handle == NULL) {
14291 0 : PyErr_NoMemory();
14292 0 : return false;
14293 : }
14294 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14295 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14296 0 : PyErr_NoMemory();
14297 0 : return false;
14298 : }
14299 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14300 0 : if (py_sec_info == NULL) {
14301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
14302 0 : return false;
14303 : }
14304 : {
14305 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
14306 0 : if (PyLong_Check(py_sec_info)) {
14307 0 : unsigned long long test_var;
14308 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
14309 0 : if (PyErr_Occurred() != NULL) {
14310 0 : return false;
14311 : }
14312 0 : if (test_var > uint_max) {
14313 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14314 : PyLong_Type.tp_name, uint_max, test_var);
14315 0 : return false;
14316 : }
14317 0 : r->in.sec_info = test_var;
14318 : } else {
14319 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14320 : PyLong_Type.tp_name);
14321 0 : return false;
14322 : }
14323 : }
14324 0 : if (py_sdbuf == NULL) {
14325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sdbuf");
14326 0 : return false;
14327 : }
14328 0 : r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
14329 0 : if (r->in.sdbuf == NULL) {
14330 0 : PyErr_NoMemory();
14331 0 : return false;
14332 : }
14333 0 : PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
14334 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
14335 0 : PyErr_NoMemory();
14336 0 : return false;
14337 : }
14338 0 : r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
14339 0 : return true;
14340 : }
14341 :
14342 0 : static PyObject *unpack_py_lsa_SetSecObj_args_out(struct lsa_SetSecObj *r)
14343 : {
14344 0 : PyObject *result;
14345 0 : result = Py_None;
14346 0 : Py_INCREF(result);
14347 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14348 0 : PyErr_SetNTSTATUS(r->out.result);
14349 0 : return NULL;
14350 : }
14351 :
14352 0 : return result;
14353 : }
14354 :
14355 :
14356 0 : static PyObject *py_lsa_OpenPolicy_in_get_system_name(PyObject *obj, void *closure)
14357 : {
14358 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14359 0 : PyObject *py_system_name;
14360 0 : if (object->in.system_name == NULL) {
14361 0 : Py_RETURN_NONE;
14362 : }
14363 0 : if (object->in.system_name == NULL) {
14364 0 : py_system_name = Py_None;
14365 0 : Py_INCREF(py_system_name);
14366 : } else {
14367 0 : py_system_name = PyLong_FromLong((uint16_t)*object->in.system_name);
14368 : }
14369 0 : return py_system_name;
14370 : }
14371 :
14372 0 : static int py_lsa_OpenPolicy_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
14373 : {
14374 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14375 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.system_name));
14376 0 : if (value == NULL) {
14377 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
14378 0 : return -1;
14379 : }
14380 0 : if (value == Py_None) {
14381 0 : object->in.system_name = NULL;
14382 : } else {
14383 0 : object->in.system_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.system_name);
14384 0 : if (object->in.system_name == NULL) {
14385 0 : PyErr_NoMemory();
14386 0 : return -1;
14387 : }
14388 : {
14389 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.system_name));
14390 0 : if (PyLong_Check(value)) {
14391 0 : unsigned long long test_var;
14392 0 : test_var = PyLong_AsUnsignedLongLong(value);
14393 0 : if (PyErr_Occurred() != NULL) {
14394 0 : return -1;
14395 : }
14396 0 : if (test_var > uint_max) {
14397 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14398 : PyLong_Type.tp_name, uint_max, test_var);
14399 0 : return -1;
14400 : }
14401 0 : *object->in.system_name = test_var;
14402 : } else {
14403 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14404 : PyLong_Type.tp_name);
14405 0 : return -1;
14406 : }
14407 : }
14408 : }
14409 0 : return 0;
14410 : }
14411 :
14412 0 : static PyObject *py_lsa_OpenPolicy_in_get_attr(PyObject *obj, void *closure)
14413 : {
14414 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14415 0 : PyObject *py_attr;
14416 0 : if (object->in.attr == NULL) {
14417 0 : Py_RETURN_NONE;
14418 : }
14419 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
14420 0 : return py_attr;
14421 : }
14422 :
14423 0 : static int py_lsa_OpenPolicy_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
14424 : {
14425 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14426 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
14427 0 : if (value == NULL) {
14428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.attr");
14429 0 : return -1;
14430 : }
14431 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
14432 0 : if (object->in.attr == NULL) {
14433 0 : PyErr_NoMemory();
14434 0 : return -1;
14435 : }
14436 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
14437 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14438 0 : PyErr_NoMemory();
14439 0 : return -1;
14440 : }
14441 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
14442 0 : return 0;
14443 : }
14444 :
14445 0 : static PyObject *py_lsa_OpenPolicy_in_get_access_mask(PyObject *obj, void *closure)
14446 : {
14447 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14448 0 : PyObject *py_access_mask;
14449 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
14450 0 : return py_access_mask;
14451 : }
14452 :
14453 0 : static int py_lsa_OpenPolicy_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
14454 : {
14455 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14456 0 : if (value == NULL) {
14457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
14458 0 : return -1;
14459 : }
14460 : {
14461 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
14462 0 : if (PyLong_Check(value)) {
14463 0 : unsigned long long test_var;
14464 0 : test_var = PyLong_AsUnsignedLongLong(value);
14465 0 : if (PyErr_Occurred() != NULL) {
14466 0 : return -1;
14467 : }
14468 0 : if (test_var > uint_max) {
14469 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14470 : PyLong_Type.tp_name, uint_max, test_var);
14471 0 : return -1;
14472 : }
14473 0 : object->in.access_mask = test_var;
14474 : } else {
14475 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14476 : PyLong_Type.tp_name);
14477 0 : return -1;
14478 : }
14479 : }
14480 0 : return 0;
14481 : }
14482 :
14483 0 : static PyObject *py_lsa_OpenPolicy_out_get_handle(PyObject *obj, void *closure)
14484 : {
14485 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14486 0 : PyObject *py_handle;
14487 0 : if (object->out.handle == NULL) {
14488 0 : Py_RETURN_NONE;
14489 : }
14490 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
14491 0 : return py_handle;
14492 : }
14493 :
14494 0 : static int py_lsa_OpenPolicy_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14495 : {
14496 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14497 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
14498 0 : if (value == NULL) {
14499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
14500 0 : return -1;
14501 : }
14502 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
14503 0 : if (object->out.handle == NULL) {
14504 0 : PyErr_NoMemory();
14505 0 : return -1;
14506 : }
14507 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14508 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14509 0 : PyErr_NoMemory();
14510 0 : return -1;
14511 : }
14512 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14513 0 : return 0;
14514 : }
14515 :
14516 0 : static PyObject *py_lsa_OpenPolicy_get_result(PyObject *obj, void *closure)
14517 : {
14518 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(obj);
14519 0 : PyObject *py_result;
14520 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14521 0 : return py_result;
14522 : }
14523 :
14524 0 : static int py_lsa_OpenPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
14525 : {
14526 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14527 0 : if (value == NULL) {
14528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14529 0 : return -1;
14530 : }
14531 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14532 0 : return 0;
14533 : }
14534 :
14535 : static PyGetSetDef py_lsa_OpenPolicy_getsetters[] = {
14536 : {
14537 : .name = discard_const_p(char, "in_system_name"),
14538 : .get = py_lsa_OpenPolicy_in_get_system_name,
14539 : .set = py_lsa_OpenPolicy_in_set_system_name,
14540 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
14541 : },
14542 : {
14543 : .name = discard_const_p(char, "in_attr"),
14544 : .get = py_lsa_OpenPolicy_in_get_attr,
14545 : .set = py_lsa_OpenPolicy_in_set_attr,
14546 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
14547 : },
14548 : {
14549 : .name = discard_const_p(char, "in_access_mask"),
14550 : .get = py_lsa_OpenPolicy_in_get_access_mask,
14551 : .set = py_lsa_OpenPolicy_in_set_access_mask,
14552 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
14553 : },
14554 : {
14555 : .name = discard_const_p(char, "out_handle"),
14556 : .get = py_lsa_OpenPolicy_out_get_handle,
14557 : .set = py_lsa_OpenPolicy_out_set_handle,
14558 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14559 : },
14560 : {
14561 : .name = discard_const_p(char, "result"),
14562 : .get = py_lsa_OpenPolicy_get_result,
14563 : .set = py_lsa_OpenPolicy_set_result,
14564 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14565 : },
14566 : { .name = NULL }
14567 : };
14568 :
14569 0 : static PyObject *py_lsa_OpenPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14570 : {
14571 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy, type);
14572 0 : struct lsa_OpenPolicy *_self = (struct lsa_OpenPolicy *)pytalloc_get_ptr(self);
14573 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14574 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
14575 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
14576 0 : return self;
14577 : }
14578 :
14579 0 : static PyObject *py_lsa_OpenPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14580 : {
14581 :
14582 :
14583 0 : return PyLong_FromLong(6);
14584 : }
14585 :
14586 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14587 : {
14588 0 : const struct ndr_interface_call *call = NULL;
14589 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14590 0 : PyObject *ret = NULL;
14591 0 : struct ndr_push *push = NULL;
14592 0 : DATA_BLOB blob;
14593 0 : enum ndr_err_code err;
14594 :
14595 0 : if (ndr_table_lsarpc.num_calls < 7) {
14596 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_pack");
14597 0 : return NULL;
14598 : }
14599 0 : call = &ndr_table_lsarpc.calls[6];
14600 :
14601 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14602 0 : if (push == NULL) {
14603 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14604 0 : return NULL;
14605 : }
14606 :
14607 0 : push->flags |= ndr_push_flags;
14608 :
14609 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14610 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14611 0 : TALLOC_FREE(push);
14612 0 : PyErr_SetNdrError(err);
14613 0 : return NULL;
14614 : }
14615 0 : blob = ndr_push_blob(push);
14616 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14617 0 : TALLOC_FREE(push);
14618 0 : return ret;
14619 : }
14620 :
14621 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14622 : {
14623 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14624 0 : PyObject *bigendian_obj = NULL;
14625 0 : PyObject *ndr64_obj = NULL;
14626 0 : libndr_flags ndr_push_flags = 0;
14627 :
14628 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14629 : discard_const_p(char *, kwnames),
14630 : &bigendian_obj,
14631 : &ndr64_obj)) {
14632 0 : return NULL;
14633 : }
14634 :
14635 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14636 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14637 : }
14638 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14639 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14640 : }
14641 :
14642 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14643 : }
14644 :
14645 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14646 : {
14647 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14648 0 : PyObject *bigendian_obj = NULL;
14649 0 : PyObject *ndr64_obj = NULL;
14650 0 : libndr_flags ndr_push_flags = 0;
14651 :
14652 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14653 : discard_const_p(char *, kwnames),
14654 : &bigendian_obj,
14655 : &ndr64_obj)) {
14656 0 : return NULL;
14657 : }
14658 :
14659 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14660 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14661 : }
14662 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14663 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14664 : }
14665 :
14666 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14667 : }
14668 :
14669 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14670 : {
14671 0 : const struct ndr_interface_call *call = NULL;
14672 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14673 0 : struct ndr_pull *pull = NULL;
14674 0 : enum ndr_err_code err;
14675 :
14676 0 : if (ndr_table_lsarpc.num_calls < 7) {
14677 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_unpack");
14678 0 : return NULL;
14679 : }
14680 0 : call = &ndr_table_lsarpc.calls[6];
14681 :
14682 0 : pull = ndr_pull_init_blob(blob, object);
14683 0 : if (pull == NULL) {
14684 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14685 0 : return NULL;
14686 : }
14687 :
14688 0 : pull->flags |= ndr_pull_flags;
14689 :
14690 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14691 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14692 0 : TALLOC_FREE(pull);
14693 0 : PyErr_SetNdrError(err);
14694 0 : return NULL;
14695 : }
14696 0 : if (!allow_remaining) {
14697 0 : uint32_t highest_ofs;
14698 :
14699 0 : if (pull->offset > pull->relative_highest_offset) {
14700 0 : highest_ofs = pull->offset;
14701 : } else {
14702 0 : highest_ofs = pull->relative_highest_offset;
14703 : }
14704 0 : if (highest_ofs < pull->data_size) {
14705 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14706 : "not all bytes consumed ofs[%u] size[%u]",
14707 : highest_ofs, pull->data_size);
14708 0 : TALLOC_FREE(pull);
14709 0 : PyErr_SetNdrError(err);
14710 0 : return NULL;
14711 : }
14712 : }
14713 :
14714 0 : TALLOC_FREE(pull);
14715 0 : Py_RETURN_NONE;
14716 : }
14717 :
14718 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14719 : {
14720 0 : DATA_BLOB blob;
14721 0 : Py_ssize_t blob_length = 0;
14722 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14723 0 : PyObject *bigendian_obj = NULL;
14724 0 : PyObject *ndr64_obj = NULL;
14725 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14726 0 : PyObject *allow_remaining_obj = NULL;
14727 0 : bool allow_remaining = false;
14728 :
14729 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14730 : discard_const_p(char *, kwnames),
14731 : &blob.data, &blob_length,
14732 : &bigendian_obj,
14733 : &ndr64_obj,
14734 : &allow_remaining_obj)) {
14735 0 : return NULL;
14736 : }
14737 0 : blob.length = blob_length;
14738 :
14739 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14740 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14741 : }
14742 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14743 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14744 : }
14745 :
14746 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14747 0 : allow_remaining = true;
14748 : }
14749 :
14750 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14751 : }
14752 :
14753 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14754 : {
14755 0 : DATA_BLOB blob;
14756 0 : Py_ssize_t blob_length = 0;
14757 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14758 0 : PyObject *bigendian_obj = NULL;
14759 0 : PyObject *ndr64_obj = NULL;
14760 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14761 0 : PyObject *allow_remaining_obj = NULL;
14762 0 : bool allow_remaining = false;
14763 :
14764 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14765 : discard_const_p(char *, kwnames),
14766 : &blob.data, &blob_length,
14767 : &bigendian_obj,
14768 : &ndr64_obj,
14769 : &allow_remaining_obj)) {
14770 0 : return NULL;
14771 : }
14772 0 : blob.length = blob_length;
14773 :
14774 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14775 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14776 : }
14777 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14778 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14779 : }
14780 :
14781 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14782 0 : allow_remaining = true;
14783 : }
14784 :
14785 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14786 : }
14787 :
14788 0 : static PyObject *py_lsa_OpenPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14789 : {
14790 0 : const struct ndr_interface_call *call = NULL;
14791 0 : struct lsa_OpenPolicy *object = (struct lsa_OpenPolicy *)pytalloc_get_ptr(py_obj);
14792 0 : PyObject *ret;
14793 0 : char *retstr;
14794 :
14795 0 : if (ndr_table_lsarpc.num_calls < 7) {
14796 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_print");
14797 0 : return NULL;
14798 : }
14799 0 : call = &ndr_table_lsarpc.calls[6];
14800 :
14801 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14802 0 : ret = PyUnicode_FromString(retstr);
14803 0 : TALLOC_FREE(retstr);
14804 :
14805 0 : return ret;
14806 : }
14807 :
14808 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14809 : {
14810 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_in", NDR_IN);
14811 : }
14812 :
14813 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14814 : {
14815 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_out", NDR_OUT);
14816 : }
14817 :
14818 : static PyMethodDef py_lsa_OpenPolicy_methods[] = {
14819 : { "opnum", (PyCFunction)py_lsa_OpenPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
14820 : "lsa.OpenPolicy.opnum() -> 6 (0x06) " },
14821 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14822 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14823 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14824 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14825 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14826 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14827 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14828 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14829 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14830 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14831 : { NULL, NULL, 0, NULL }
14832 : };
14833 :
14834 :
14835 : static PyTypeObject lsa_OpenPolicy_Type = {
14836 : PyVarObject_HEAD_INIT(NULL, 0)
14837 : .tp_name = "lsa.OpenPolicy",
14838 : .tp_getset = py_lsa_OpenPolicy_getsetters,
14839 : .tp_methods = py_lsa_OpenPolicy_methods,
14840 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14841 : .tp_new = py_lsa_OpenPolicy_new,
14842 : };
14843 :
14844 0 : static bool pack_py_lsa_OpenPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy *r)
14845 : {
14846 0 : PyObject *py_system_name;
14847 0 : PyObject *py_attr;
14848 0 : PyObject *py_access_mask;
14849 0 : const char *kwnames[] = {
14850 : "system_name", "attr", "access_mask", NULL
14851 : };
14852 :
14853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
14854 0 : return false;
14855 : }
14856 :
14857 0 : if (py_system_name == NULL) {
14858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
14859 0 : return false;
14860 : }
14861 0 : if (py_system_name == Py_None) {
14862 0 : r->in.system_name = NULL;
14863 : } else {
14864 0 : r->in.system_name = talloc_ptrtype(r, r->in.system_name);
14865 0 : if (r->in.system_name == NULL) {
14866 0 : PyErr_NoMemory();
14867 0 : return false;
14868 : }
14869 : {
14870 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name));
14871 0 : if (PyLong_Check(py_system_name)) {
14872 0 : unsigned long long test_var;
14873 0 : test_var = PyLong_AsUnsignedLongLong(py_system_name);
14874 0 : if (PyErr_Occurred() != NULL) {
14875 0 : return false;
14876 : }
14877 0 : if (test_var > uint_max) {
14878 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14879 : PyLong_Type.tp_name, uint_max, test_var);
14880 0 : return false;
14881 : }
14882 0 : *r->in.system_name = test_var;
14883 : } else {
14884 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14885 : PyLong_Type.tp_name);
14886 0 : return false;
14887 : }
14888 : }
14889 : }
14890 0 : if (py_attr == NULL) {
14891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.attr");
14892 0 : return false;
14893 : }
14894 0 : r->in.attr = talloc_ptrtype(r, r->in.attr);
14895 0 : if (r->in.attr == NULL) {
14896 0 : PyErr_NoMemory();
14897 0 : return false;
14898 : }
14899 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
14900 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
14901 0 : PyErr_NoMemory();
14902 0 : return false;
14903 : }
14904 0 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
14905 0 : if (py_access_mask == NULL) {
14906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
14907 0 : return false;
14908 : }
14909 : {
14910 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
14911 0 : if (PyLong_Check(py_access_mask)) {
14912 0 : unsigned long long test_var;
14913 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
14914 0 : if (PyErr_Occurred() != NULL) {
14915 0 : return false;
14916 : }
14917 0 : if (test_var > uint_max) {
14918 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14919 : PyLong_Type.tp_name, uint_max, test_var);
14920 0 : return false;
14921 : }
14922 0 : r->in.access_mask = test_var;
14923 : } else {
14924 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14925 : PyLong_Type.tp_name);
14926 0 : return false;
14927 : }
14928 : }
14929 0 : return true;
14930 : }
14931 :
14932 0 : static PyObject *unpack_py_lsa_OpenPolicy_args_out(struct lsa_OpenPolicy *r)
14933 : {
14934 0 : PyObject *result;
14935 0 : PyObject *py_handle;
14936 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
14937 0 : result = py_handle;
14938 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14939 0 : PyErr_SetNTSTATUS(r->out.result);
14940 0 : return NULL;
14941 : }
14942 :
14943 0 : return result;
14944 : }
14945 :
14946 :
14947 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_handle(PyObject *obj, void *closure)
14948 : {
14949 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
14950 0 : PyObject *py_handle;
14951 0 : if (object->in.handle == NULL) {
14952 0 : Py_RETURN_NONE;
14953 : }
14954 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14955 0 : return py_handle;
14956 : }
14957 :
14958 0 : static int py_lsa_QueryInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14959 : {
14960 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
14961 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14962 0 : if (value == NULL) {
14963 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14964 0 : return -1;
14965 : }
14966 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14967 0 : if (object->in.handle == NULL) {
14968 0 : PyErr_NoMemory();
14969 0 : return -1;
14970 : }
14971 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14972 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14973 0 : PyErr_NoMemory();
14974 0 : return -1;
14975 : }
14976 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14977 0 : return 0;
14978 : }
14979 :
14980 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_level(PyObject *obj, void *closure)
14981 : {
14982 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
14983 0 : PyObject *py_level;
14984 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
14985 0 : return py_level;
14986 : }
14987 :
14988 0 : static int py_lsa_QueryInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
14989 : {
14990 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
14991 0 : if (value == NULL) {
14992 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
14993 0 : return -1;
14994 : }
14995 : {
14996 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
14997 0 : if (PyLong_Check(value)) {
14998 0 : unsigned long long test_var;
14999 0 : test_var = PyLong_AsUnsignedLongLong(value);
15000 0 : if (PyErr_Occurred() != NULL) {
15001 0 : return -1;
15002 : }
15003 0 : if (test_var > uint_max) {
15004 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15005 : PyLong_Type.tp_name, uint_max, test_var);
15006 0 : return -1;
15007 : }
15008 0 : object->in.level = test_var;
15009 : } else {
15010 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15011 : PyLong_Type.tp_name);
15012 0 : return -1;
15013 : }
15014 : }
15015 0 : return 0;
15016 : }
15017 :
15018 0 : static PyObject *py_lsa_QueryInfoPolicy_out_get_info(PyObject *obj, void *closure)
15019 : {
15020 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
15021 0 : PyObject *py_info;
15022 0 : if (object->out.info == NULL) {
15023 0 : Py_RETURN_NONE;
15024 : }
15025 0 : if (*object->out.info == NULL) {
15026 0 : py_info = Py_None;
15027 0 : Py_INCREF(py_info);
15028 : } else {
15029 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
15030 0 : if (py_info == NULL) {
15031 0 : return NULL;
15032 : }
15033 : }
15034 0 : return py_info;
15035 : }
15036 :
15037 0 : static int py_lsa_QueryInfoPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
15038 : {
15039 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15040 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
15041 0 : if (value == NULL) {
15042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
15043 0 : return -1;
15044 : }
15045 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
15046 0 : if (object->out.info == NULL) {
15047 0 : PyErr_NoMemory();
15048 0 : return -1;
15049 : }
15050 0 : if (value == Py_None) {
15051 0 : *object->out.info = NULL;
15052 : } else {
15053 0 : *object->out.info = NULL;
15054 : {
15055 0 : union lsa_PolicyInformation *info_switch_2;
15056 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");
15057 0 : if (info_switch_2 == NULL) {
15058 0 : return -1;
15059 : }
15060 0 : *object->out.info = info_switch_2;
15061 : }
15062 : }
15063 0 : return 0;
15064 : }
15065 :
15066 0 : static PyObject *py_lsa_QueryInfoPolicy_get_result(PyObject *obj, void *closure)
15067 : {
15068 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(obj);
15069 0 : PyObject *py_result;
15070 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15071 0 : return py_result;
15072 : }
15073 :
15074 0 : static int py_lsa_QueryInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
15075 : {
15076 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15077 0 : if (value == NULL) {
15078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15079 0 : return -1;
15080 : }
15081 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15082 0 : return 0;
15083 : }
15084 :
15085 : static PyGetSetDef py_lsa_QueryInfoPolicy_getsetters[] = {
15086 : {
15087 : .name = discard_const_p(char, "in_handle"),
15088 : .get = py_lsa_QueryInfoPolicy_in_get_handle,
15089 : .set = py_lsa_QueryInfoPolicy_in_set_handle,
15090 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15091 : },
15092 : {
15093 : .name = discard_const_p(char, "in_level"),
15094 : .get = py_lsa_QueryInfoPolicy_in_get_level,
15095 : .set = py_lsa_QueryInfoPolicy_in_set_level,
15096 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
15097 : },
15098 : {
15099 : .name = discard_const_p(char, "out_info"),
15100 : .get = py_lsa_QueryInfoPolicy_out_get_info,
15101 : .set = py_lsa_QueryInfoPolicy_out_set_info,
15102 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
15103 : },
15104 : {
15105 : .name = discard_const_p(char, "result"),
15106 : .get = py_lsa_QueryInfoPolicy_get_result,
15107 : .set = py_lsa_QueryInfoPolicy_set_result,
15108 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15109 : },
15110 : { .name = NULL }
15111 : };
15112 :
15113 0 : static PyObject *py_lsa_QueryInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15114 : {
15115 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy, type);
15116 0 : struct lsa_QueryInfoPolicy *_self = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(self);
15117 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15118 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15119 : /* a pointer to a NULL pointer */
15120 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
15121 0 : return self;
15122 : }
15123 :
15124 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15125 : {
15126 :
15127 :
15128 0 : return PyLong_FromLong(7);
15129 : }
15130 :
15131 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15132 : {
15133 0 : const struct ndr_interface_call *call = NULL;
15134 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15135 0 : PyObject *ret = NULL;
15136 0 : struct ndr_push *push = NULL;
15137 0 : DATA_BLOB blob;
15138 0 : enum ndr_err_code err;
15139 :
15140 0 : if (ndr_table_lsarpc.num_calls < 8) {
15141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_pack");
15142 0 : return NULL;
15143 : }
15144 0 : call = &ndr_table_lsarpc.calls[7];
15145 :
15146 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15147 0 : if (push == NULL) {
15148 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15149 0 : return NULL;
15150 : }
15151 :
15152 0 : push->flags |= ndr_push_flags;
15153 :
15154 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15155 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15156 0 : TALLOC_FREE(push);
15157 0 : PyErr_SetNdrError(err);
15158 0 : return NULL;
15159 : }
15160 0 : blob = ndr_push_blob(push);
15161 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15162 0 : TALLOC_FREE(push);
15163 0 : return ret;
15164 : }
15165 :
15166 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15167 : {
15168 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15169 0 : PyObject *bigendian_obj = NULL;
15170 0 : PyObject *ndr64_obj = NULL;
15171 0 : libndr_flags ndr_push_flags = 0;
15172 :
15173 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15174 : discard_const_p(char *, kwnames),
15175 : &bigendian_obj,
15176 : &ndr64_obj)) {
15177 0 : return NULL;
15178 : }
15179 :
15180 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15181 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15182 : }
15183 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15184 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15185 : }
15186 :
15187 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15188 : }
15189 :
15190 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15191 : {
15192 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15193 0 : PyObject *bigendian_obj = NULL;
15194 0 : PyObject *ndr64_obj = NULL;
15195 0 : libndr_flags ndr_push_flags = 0;
15196 :
15197 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15198 : discard_const_p(char *, kwnames),
15199 : &bigendian_obj,
15200 : &ndr64_obj)) {
15201 0 : return NULL;
15202 : }
15203 :
15204 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15205 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15206 : }
15207 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15208 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15209 : }
15210 :
15211 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15212 : }
15213 :
15214 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15215 : {
15216 0 : const struct ndr_interface_call *call = NULL;
15217 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15218 0 : struct ndr_pull *pull = NULL;
15219 0 : enum ndr_err_code err;
15220 :
15221 0 : if (ndr_table_lsarpc.num_calls < 8) {
15222 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_unpack");
15223 0 : return NULL;
15224 : }
15225 0 : call = &ndr_table_lsarpc.calls[7];
15226 :
15227 0 : pull = ndr_pull_init_blob(blob, object);
15228 0 : if (pull == NULL) {
15229 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15230 0 : return NULL;
15231 : }
15232 :
15233 0 : pull->flags |= ndr_pull_flags;
15234 :
15235 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15236 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15237 0 : TALLOC_FREE(pull);
15238 0 : PyErr_SetNdrError(err);
15239 0 : return NULL;
15240 : }
15241 0 : if (!allow_remaining) {
15242 0 : uint32_t highest_ofs;
15243 :
15244 0 : if (pull->offset > pull->relative_highest_offset) {
15245 0 : highest_ofs = pull->offset;
15246 : } else {
15247 0 : highest_ofs = pull->relative_highest_offset;
15248 : }
15249 0 : if (highest_ofs < pull->data_size) {
15250 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15251 : "not all bytes consumed ofs[%u] size[%u]",
15252 : highest_ofs, pull->data_size);
15253 0 : TALLOC_FREE(pull);
15254 0 : PyErr_SetNdrError(err);
15255 0 : return NULL;
15256 : }
15257 : }
15258 :
15259 0 : TALLOC_FREE(pull);
15260 0 : Py_RETURN_NONE;
15261 : }
15262 :
15263 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15264 : {
15265 0 : DATA_BLOB blob;
15266 0 : Py_ssize_t blob_length = 0;
15267 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15268 0 : PyObject *bigendian_obj = NULL;
15269 0 : PyObject *ndr64_obj = NULL;
15270 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15271 0 : PyObject *allow_remaining_obj = NULL;
15272 0 : bool allow_remaining = false;
15273 :
15274 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15275 : discard_const_p(char *, kwnames),
15276 : &blob.data, &blob_length,
15277 : &bigendian_obj,
15278 : &ndr64_obj,
15279 : &allow_remaining_obj)) {
15280 0 : return NULL;
15281 : }
15282 0 : blob.length = blob_length;
15283 :
15284 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15285 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15286 : }
15287 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15288 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15289 : }
15290 :
15291 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15292 0 : allow_remaining = true;
15293 : }
15294 :
15295 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15296 : }
15297 :
15298 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15299 : {
15300 0 : DATA_BLOB blob;
15301 0 : Py_ssize_t blob_length = 0;
15302 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15303 0 : PyObject *bigendian_obj = NULL;
15304 0 : PyObject *ndr64_obj = NULL;
15305 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15306 0 : PyObject *allow_remaining_obj = NULL;
15307 0 : bool allow_remaining = false;
15308 :
15309 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15310 : discard_const_p(char *, kwnames),
15311 : &blob.data, &blob_length,
15312 : &bigendian_obj,
15313 : &ndr64_obj,
15314 : &allow_remaining_obj)) {
15315 0 : return NULL;
15316 : }
15317 0 : blob.length = blob_length;
15318 :
15319 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15320 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15321 : }
15322 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15323 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15324 : }
15325 :
15326 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15327 0 : allow_remaining = true;
15328 : }
15329 :
15330 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15331 : }
15332 :
15333 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15334 : {
15335 0 : const struct ndr_interface_call *call = NULL;
15336 0 : struct lsa_QueryInfoPolicy *object = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(py_obj);
15337 0 : PyObject *ret;
15338 0 : char *retstr;
15339 :
15340 0 : if (ndr_table_lsarpc.num_calls < 8) {
15341 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_print");
15342 0 : return NULL;
15343 : }
15344 0 : call = &ndr_table_lsarpc.calls[7];
15345 :
15346 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15347 0 : ret = PyUnicode_FromString(retstr);
15348 0 : TALLOC_FREE(retstr);
15349 :
15350 0 : return ret;
15351 : }
15352 :
15353 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15354 : {
15355 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_in", NDR_IN);
15356 : }
15357 :
15358 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15359 : {
15360 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_out", NDR_OUT);
15361 : }
15362 :
15363 : static PyMethodDef py_lsa_QueryInfoPolicy_methods[] = {
15364 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
15365 : "lsa.QueryInfoPolicy.opnum() -> 7 (0x07) " },
15366 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15367 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15368 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15369 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15370 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15371 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15372 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15373 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15374 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15375 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15376 : { NULL, NULL, 0, NULL }
15377 : };
15378 :
15379 :
15380 : static PyTypeObject lsa_QueryInfoPolicy_Type = {
15381 : PyVarObject_HEAD_INIT(NULL, 0)
15382 : .tp_name = "lsa.QueryInfoPolicy",
15383 : .tp_getset = py_lsa_QueryInfoPolicy_getsetters,
15384 : .tp_methods = py_lsa_QueryInfoPolicy_methods,
15385 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15386 : .tp_new = py_lsa_QueryInfoPolicy_new,
15387 : };
15388 :
15389 0 : static bool pack_py_lsa_QueryInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy *r)
15390 : {
15391 0 : PyObject *py_handle;
15392 0 : PyObject *py_level;
15393 0 : const char *kwnames[] = {
15394 : "handle", "level", NULL
15395 : };
15396 :
15397 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
15398 0 : return false;
15399 : }
15400 :
15401 0 : if (py_handle == NULL) {
15402 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15403 0 : return false;
15404 : }
15405 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15406 0 : if (r->in.handle == NULL) {
15407 0 : PyErr_NoMemory();
15408 0 : return false;
15409 : }
15410 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15411 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15412 0 : PyErr_NoMemory();
15413 0 : return false;
15414 : }
15415 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15416 0 : if (py_level == NULL) {
15417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
15418 0 : return false;
15419 : }
15420 : {
15421 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
15422 0 : if (PyLong_Check(py_level)) {
15423 0 : unsigned long long test_var;
15424 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
15425 0 : if (PyErr_Occurred() != NULL) {
15426 0 : return false;
15427 : }
15428 0 : if (test_var > uint_max) {
15429 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15430 : PyLong_Type.tp_name, uint_max, test_var);
15431 0 : return false;
15432 : }
15433 0 : r->in.level = test_var;
15434 : } else {
15435 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15436 : PyLong_Type.tp_name);
15437 0 : return false;
15438 : }
15439 : }
15440 0 : return true;
15441 : }
15442 :
15443 0 : static PyObject *unpack_py_lsa_QueryInfoPolicy_args_out(struct lsa_QueryInfoPolicy *r)
15444 : {
15445 0 : PyObject *result;
15446 0 : PyObject *py_info;
15447 0 : if (*r->out.info == NULL) {
15448 0 : py_info = Py_None;
15449 0 : Py_INCREF(py_info);
15450 : } else {
15451 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
15452 0 : if (py_info == NULL) {
15453 0 : return NULL;
15454 : }
15455 : }
15456 0 : result = py_info;
15457 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15458 0 : PyErr_SetNTSTATUS(r->out.result);
15459 0 : return NULL;
15460 : }
15461 :
15462 0 : return result;
15463 : }
15464 :
15465 :
15466 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_handle(PyObject *obj, void *closure)
15467 : {
15468 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15469 0 : PyObject *py_handle;
15470 0 : if (object->in.handle == NULL) {
15471 0 : Py_RETURN_NONE;
15472 : }
15473 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15474 0 : return py_handle;
15475 : }
15476 :
15477 0 : static int py_lsa_SetInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15478 : {
15479 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15480 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
15481 0 : if (value == NULL) {
15482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
15483 0 : return -1;
15484 : }
15485 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
15486 0 : if (object->in.handle == NULL) {
15487 0 : PyErr_NoMemory();
15488 0 : return -1;
15489 : }
15490 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15491 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15492 0 : PyErr_NoMemory();
15493 0 : return -1;
15494 : }
15495 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
15496 0 : return 0;
15497 : }
15498 :
15499 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_level(PyObject *obj, void *closure)
15500 : {
15501 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15502 0 : PyObject *py_level;
15503 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
15504 0 : return py_level;
15505 : }
15506 :
15507 0 : static int py_lsa_SetInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
15508 : {
15509 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15510 0 : if (value == NULL) {
15511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
15512 0 : return -1;
15513 : }
15514 : {
15515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
15516 0 : if (PyLong_Check(value)) {
15517 0 : unsigned long long test_var;
15518 0 : test_var = PyLong_AsUnsignedLongLong(value);
15519 0 : if (PyErr_Occurred() != NULL) {
15520 0 : return -1;
15521 : }
15522 0 : if (test_var > uint_max) {
15523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15524 : PyLong_Type.tp_name, uint_max, test_var);
15525 0 : return -1;
15526 : }
15527 0 : object->in.level = test_var;
15528 : } else {
15529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15530 : PyLong_Type.tp_name);
15531 0 : return -1;
15532 : }
15533 : }
15534 0 : return 0;
15535 : }
15536 :
15537 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_info(PyObject *obj, void *closure)
15538 : {
15539 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15540 0 : PyObject *py_info;
15541 0 : if (object->in.info == NULL) {
15542 0 : Py_RETURN_NONE;
15543 : }
15544 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
15545 0 : if (py_info == NULL) {
15546 0 : return NULL;
15547 : }
15548 0 : return py_info;
15549 : }
15550 :
15551 0 : static int py_lsa_SetInfoPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
15552 : {
15553 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
15555 0 : if (value == NULL) {
15556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
15557 0 : return -1;
15558 : }
15559 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
15560 0 : if (object->in.info == NULL) {
15561 0 : PyErr_NoMemory();
15562 0 : return -1;
15563 : }
15564 : {
15565 0 : union lsa_PolicyInformation *info_switch_1;
15566 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");
15567 0 : if (info_switch_1 == NULL) {
15568 0 : return -1;
15569 : }
15570 0 : object->in.info = info_switch_1;
15571 : }
15572 0 : return 0;
15573 : }
15574 :
15575 0 : static PyObject *py_lsa_SetInfoPolicy_get_result(PyObject *obj, void *closure)
15576 : {
15577 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(obj);
15578 0 : PyObject *py_result;
15579 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15580 0 : return py_result;
15581 : }
15582 :
15583 0 : static int py_lsa_SetInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
15584 : {
15585 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15586 0 : if (value == NULL) {
15587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15588 0 : return -1;
15589 : }
15590 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15591 0 : return 0;
15592 : }
15593 :
15594 : static PyGetSetDef py_lsa_SetInfoPolicy_getsetters[] = {
15595 : {
15596 : .name = discard_const_p(char, "in_handle"),
15597 : .get = py_lsa_SetInfoPolicy_in_get_handle,
15598 : .set = py_lsa_SetInfoPolicy_in_set_handle,
15599 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15600 : },
15601 : {
15602 : .name = discard_const_p(char, "in_level"),
15603 : .get = py_lsa_SetInfoPolicy_in_get_level,
15604 : .set = py_lsa_SetInfoPolicy_in_set_level,
15605 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
15606 : },
15607 : {
15608 : .name = discard_const_p(char, "in_info"),
15609 : .get = py_lsa_SetInfoPolicy_in_get_info,
15610 : .set = py_lsa_SetInfoPolicy_in_set_info,
15611 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
15612 : },
15613 : {
15614 : .name = discard_const_p(char, "result"),
15615 : .get = py_lsa_SetInfoPolicy_get_result,
15616 : .set = py_lsa_SetInfoPolicy_set_result,
15617 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15618 : },
15619 : { .name = NULL }
15620 : };
15621 :
15622 0 : static PyObject *py_lsa_SetInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15623 : {
15624 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy, type);
15625 0 : struct lsa_SetInfoPolicy *_self = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(self);
15626 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15627 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15628 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
15629 0 : return self;
15630 : }
15631 :
15632 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15633 : {
15634 :
15635 :
15636 0 : return PyLong_FromLong(8);
15637 : }
15638 :
15639 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15640 : {
15641 0 : const struct ndr_interface_call *call = NULL;
15642 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15643 0 : PyObject *ret = NULL;
15644 0 : struct ndr_push *push = NULL;
15645 0 : DATA_BLOB blob;
15646 0 : enum ndr_err_code err;
15647 :
15648 0 : if (ndr_table_lsarpc.num_calls < 9) {
15649 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_pack");
15650 0 : return NULL;
15651 : }
15652 0 : call = &ndr_table_lsarpc.calls[8];
15653 :
15654 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15655 0 : if (push == NULL) {
15656 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15657 0 : return NULL;
15658 : }
15659 :
15660 0 : push->flags |= ndr_push_flags;
15661 :
15662 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15663 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15664 0 : TALLOC_FREE(push);
15665 0 : PyErr_SetNdrError(err);
15666 0 : return NULL;
15667 : }
15668 0 : blob = ndr_push_blob(push);
15669 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15670 0 : TALLOC_FREE(push);
15671 0 : return ret;
15672 : }
15673 :
15674 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15675 : {
15676 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15677 0 : PyObject *bigendian_obj = NULL;
15678 0 : PyObject *ndr64_obj = NULL;
15679 0 : libndr_flags ndr_push_flags = 0;
15680 :
15681 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15682 : discard_const_p(char *, kwnames),
15683 : &bigendian_obj,
15684 : &ndr64_obj)) {
15685 0 : return NULL;
15686 : }
15687 :
15688 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15689 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15690 : }
15691 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15692 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15693 : }
15694 :
15695 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15696 : }
15697 :
15698 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15699 : {
15700 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15701 0 : PyObject *bigendian_obj = NULL;
15702 0 : PyObject *ndr64_obj = NULL;
15703 0 : libndr_flags ndr_push_flags = 0;
15704 :
15705 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15706 : discard_const_p(char *, kwnames),
15707 : &bigendian_obj,
15708 : &ndr64_obj)) {
15709 0 : return NULL;
15710 : }
15711 :
15712 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15713 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15714 : }
15715 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15716 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15717 : }
15718 :
15719 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15720 : }
15721 :
15722 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15723 : {
15724 0 : const struct ndr_interface_call *call = NULL;
15725 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15726 0 : struct ndr_pull *pull = NULL;
15727 0 : enum ndr_err_code err;
15728 :
15729 0 : if (ndr_table_lsarpc.num_calls < 9) {
15730 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_unpack");
15731 0 : return NULL;
15732 : }
15733 0 : call = &ndr_table_lsarpc.calls[8];
15734 :
15735 0 : pull = ndr_pull_init_blob(blob, object);
15736 0 : if (pull == NULL) {
15737 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15738 0 : return NULL;
15739 : }
15740 :
15741 0 : pull->flags |= ndr_pull_flags;
15742 :
15743 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15744 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15745 0 : TALLOC_FREE(pull);
15746 0 : PyErr_SetNdrError(err);
15747 0 : return NULL;
15748 : }
15749 0 : if (!allow_remaining) {
15750 0 : uint32_t highest_ofs;
15751 :
15752 0 : if (pull->offset > pull->relative_highest_offset) {
15753 0 : highest_ofs = pull->offset;
15754 : } else {
15755 0 : highest_ofs = pull->relative_highest_offset;
15756 : }
15757 0 : if (highest_ofs < pull->data_size) {
15758 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15759 : "not all bytes consumed ofs[%u] size[%u]",
15760 : highest_ofs, pull->data_size);
15761 0 : TALLOC_FREE(pull);
15762 0 : PyErr_SetNdrError(err);
15763 0 : return NULL;
15764 : }
15765 : }
15766 :
15767 0 : TALLOC_FREE(pull);
15768 0 : Py_RETURN_NONE;
15769 : }
15770 :
15771 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15772 : {
15773 0 : DATA_BLOB blob;
15774 0 : Py_ssize_t blob_length = 0;
15775 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15776 0 : PyObject *bigendian_obj = NULL;
15777 0 : PyObject *ndr64_obj = NULL;
15778 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15779 0 : PyObject *allow_remaining_obj = NULL;
15780 0 : bool allow_remaining = false;
15781 :
15782 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15783 : discard_const_p(char *, kwnames),
15784 : &blob.data, &blob_length,
15785 : &bigendian_obj,
15786 : &ndr64_obj,
15787 : &allow_remaining_obj)) {
15788 0 : return NULL;
15789 : }
15790 0 : blob.length = blob_length;
15791 :
15792 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15793 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15794 : }
15795 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15796 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15797 : }
15798 :
15799 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15800 0 : allow_remaining = true;
15801 : }
15802 :
15803 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15804 : }
15805 :
15806 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15807 : {
15808 0 : DATA_BLOB blob;
15809 0 : Py_ssize_t blob_length = 0;
15810 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15811 0 : PyObject *bigendian_obj = NULL;
15812 0 : PyObject *ndr64_obj = NULL;
15813 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15814 0 : PyObject *allow_remaining_obj = NULL;
15815 0 : bool allow_remaining = false;
15816 :
15817 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15818 : discard_const_p(char *, kwnames),
15819 : &blob.data, &blob_length,
15820 : &bigendian_obj,
15821 : &ndr64_obj,
15822 : &allow_remaining_obj)) {
15823 0 : return NULL;
15824 : }
15825 0 : blob.length = blob_length;
15826 :
15827 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15828 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15829 : }
15830 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15831 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15832 : }
15833 :
15834 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15835 0 : allow_remaining = true;
15836 : }
15837 :
15838 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15839 : }
15840 :
15841 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15842 : {
15843 0 : const struct ndr_interface_call *call = NULL;
15844 0 : struct lsa_SetInfoPolicy *object = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(py_obj);
15845 0 : PyObject *ret;
15846 0 : char *retstr;
15847 :
15848 0 : if (ndr_table_lsarpc.num_calls < 9) {
15849 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_print");
15850 0 : return NULL;
15851 : }
15852 0 : call = &ndr_table_lsarpc.calls[8];
15853 :
15854 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15855 0 : ret = PyUnicode_FromString(retstr);
15856 0 : TALLOC_FREE(retstr);
15857 :
15858 0 : return ret;
15859 : }
15860 :
15861 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15862 : {
15863 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_in", NDR_IN);
15864 : }
15865 :
15866 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15867 : {
15868 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_out", NDR_OUT);
15869 : }
15870 :
15871 : static PyMethodDef py_lsa_SetInfoPolicy_methods[] = {
15872 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
15873 : "lsa.SetInfoPolicy.opnum() -> 8 (0x08) " },
15874 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15875 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15876 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15877 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15878 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15879 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15880 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15881 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15882 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15883 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15884 : { NULL, NULL, 0, NULL }
15885 : };
15886 :
15887 :
15888 : static PyTypeObject lsa_SetInfoPolicy_Type = {
15889 : PyVarObject_HEAD_INIT(NULL, 0)
15890 : .tp_name = "lsa.SetInfoPolicy",
15891 : .tp_getset = py_lsa_SetInfoPolicy_getsetters,
15892 : .tp_methods = py_lsa_SetInfoPolicy_methods,
15893 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15894 : .tp_new = py_lsa_SetInfoPolicy_new,
15895 : };
15896 :
15897 0 : static bool pack_py_lsa_SetInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy *r)
15898 : {
15899 0 : PyObject *py_handle;
15900 0 : PyObject *py_level;
15901 0 : PyObject *py_info;
15902 0 : const char *kwnames[] = {
15903 : "handle", "level", "info", NULL
15904 : };
15905 :
15906 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
15907 0 : return false;
15908 : }
15909 :
15910 0 : if (py_handle == NULL) {
15911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15912 0 : return false;
15913 : }
15914 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15915 0 : if (r->in.handle == NULL) {
15916 0 : PyErr_NoMemory();
15917 0 : return false;
15918 : }
15919 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15920 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15921 0 : PyErr_NoMemory();
15922 0 : return false;
15923 : }
15924 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15925 0 : if (py_level == NULL) {
15926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
15927 0 : return false;
15928 : }
15929 : {
15930 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
15931 0 : if (PyLong_Check(py_level)) {
15932 0 : unsigned long long test_var;
15933 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
15934 0 : if (PyErr_Occurred() != NULL) {
15935 0 : return false;
15936 : }
15937 0 : if (test_var > uint_max) {
15938 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15939 : PyLong_Type.tp_name, uint_max, test_var);
15940 0 : return false;
15941 : }
15942 0 : r->in.level = test_var;
15943 : } else {
15944 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15945 : PyLong_Type.tp_name);
15946 0 : return false;
15947 : }
15948 : }
15949 0 : if (py_info == NULL) {
15950 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
15951 0 : return false;
15952 : }
15953 0 : r->in.info = talloc_ptrtype(r, r->in.info);
15954 0 : if (r->in.info == NULL) {
15955 0 : PyErr_NoMemory();
15956 0 : return false;
15957 : }
15958 : {
15959 0 : union lsa_PolicyInformation *info_switch_1;
15960 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
15961 0 : if (info_switch_1 == NULL) {
15962 0 : return false;
15963 : }
15964 0 : r->in.info = info_switch_1;
15965 : }
15966 0 : return true;
15967 : }
15968 :
15969 0 : static PyObject *unpack_py_lsa_SetInfoPolicy_args_out(struct lsa_SetInfoPolicy *r)
15970 : {
15971 0 : PyObject *result;
15972 0 : result = Py_None;
15973 0 : Py_INCREF(result);
15974 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15975 0 : PyErr_SetNTSTATUS(r->out.result);
15976 0 : return NULL;
15977 : }
15978 :
15979 0 : return result;
15980 : }
15981 :
15982 :
15983 0 : static PyObject *py_lsa_CreateAccount_in_get_handle(PyObject *obj, void *closure)
15984 : {
15985 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
15986 0 : PyObject *py_handle;
15987 0 : if (object->in.handle == NULL) {
15988 0 : Py_RETURN_NONE;
15989 : }
15990 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15991 0 : return py_handle;
15992 : }
15993 :
15994 0 : static int py_lsa_CreateAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15995 : {
15996 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
15997 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
15998 0 : if (value == NULL) {
15999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
16000 0 : return -1;
16001 : }
16002 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16003 0 : if (object->in.handle == NULL) {
16004 0 : PyErr_NoMemory();
16005 0 : return -1;
16006 : }
16007 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16008 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16009 0 : PyErr_NoMemory();
16010 0 : return -1;
16011 : }
16012 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16013 0 : return 0;
16014 : }
16015 :
16016 0 : static PyObject *py_lsa_CreateAccount_in_get_sid(PyObject *obj, void *closure)
16017 : {
16018 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16019 0 : PyObject *py_sid;
16020 0 : if (object->in.sid == NULL) {
16021 0 : Py_RETURN_NONE;
16022 : }
16023 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
16024 0 : return py_sid;
16025 : }
16026 :
16027 0 : static int py_lsa_CreateAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
16028 : {
16029 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16030 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
16031 0 : if (value == NULL) {
16032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
16033 0 : return -1;
16034 : }
16035 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
16036 0 : if (object->in.sid == NULL) {
16037 0 : PyErr_NoMemory();
16038 0 : return -1;
16039 : }
16040 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
16041 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16042 0 : PyErr_NoMemory();
16043 0 : return -1;
16044 : }
16045 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
16046 0 : return 0;
16047 : }
16048 :
16049 0 : static PyObject *py_lsa_CreateAccount_in_get_access_mask(PyObject *obj, void *closure)
16050 : {
16051 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16052 0 : PyObject *py_access_mask;
16053 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
16054 0 : return py_access_mask;
16055 : }
16056 :
16057 0 : static int py_lsa_CreateAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
16058 : {
16059 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16060 0 : if (value == NULL) {
16061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
16062 0 : return -1;
16063 : }
16064 : {
16065 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
16066 0 : if (PyLong_Check(value)) {
16067 0 : unsigned long long test_var;
16068 0 : test_var = PyLong_AsUnsignedLongLong(value);
16069 0 : if (PyErr_Occurred() != NULL) {
16070 0 : return -1;
16071 : }
16072 0 : if (test_var > uint_max) {
16073 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16074 : PyLong_Type.tp_name, uint_max, test_var);
16075 0 : return -1;
16076 : }
16077 0 : object->in.access_mask = test_var;
16078 : } else {
16079 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16080 : PyLong_Type.tp_name);
16081 0 : return -1;
16082 : }
16083 : }
16084 0 : return 0;
16085 : }
16086 :
16087 0 : static PyObject *py_lsa_CreateAccount_out_get_acct_handle(PyObject *obj, void *closure)
16088 : {
16089 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16090 0 : PyObject *py_acct_handle;
16091 0 : if (object->out.acct_handle == NULL) {
16092 0 : Py_RETURN_NONE;
16093 : }
16094 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
16095 0 : return py_acct_handle;
16096 : }
16097 :
16098 0 : static int py_lsa_CreateAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
16099 : {
16100 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16101 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
16102 0 : if (value == NULL) {
16103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.acct_handle");
16104 0 : return -1;
16105 : }
16106 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
16107 0 : if (object->out.acct_handle == NULL) {
16108 0 : PyErr_NoMemory();
16109 0 : return -1;
16110 : }
16111 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16112 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16113 0 : PyErr_NoMemory();
16114 0 : return -1;
16115 : }
16116 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
16117 0 : return 0;
16118 : }
16119 :
16120 0 : static PyObject *py_lsa_CreateAccount_get_result(PyObject *obj, void *closure)
16121 : {
16122 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(obj);
16123 0 : PyObject *py_result;
16124 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16125 0 : return py_result;
16126 : }
16127 :
16128 0 : static int py_lsa_CreateAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
16129 : {
16130 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16131 0 : if (value == NULL) {
16132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16133 0 : return -1;
16134 : }
16135 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16136 0 : return 0;
16137 : }
16138 :
16139 : static PyGetSetDef py_lsa_CreateAccount_getsetters[] = {
16140 : {
16141 : .name = discard_const_p(char, "in_handle"),
16142 : .get = py_lsa_CreateAccount_in_get_handle,
16143 : .set = py_lsa_CreateAccount_in_set_handle,
16144 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16145 : },
16146 : {
16147 : .name = discard_const_p(char, "in_sid"),
16148 : .get = py_lsa_CreateAccount_in_get_sid,
16149 : .set = py_lsa_CreateAccount_in_set_sid,
16150 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
16151 : },
16152 : {
16153 : .name = discard_const_p(char, "in_access_mask"),
16154 : .get = py_lsa_CreateAccount_in_get_access_mask,
16155 : .set = py_lsa_CreateAccount_in_set_access_mask,
16156 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
16157 : },
16158 : {
16159 : .name = discard_const_p(char, "out_acct_handle"),
16160 : .get = py_lsa_CreateAccount_out_get_acct_handle,
16161 : .set = py_lsa_CreateAccount_out_set_acct_handle,
16162 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16163 : },
16164 : {
16165 : .name = discard_const_p(char, "result"),
16166 : .get = py_lsa_CreateAccount_get_result,
16167 : .set = py_lsa_CreateAccount_set_result,
16168 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16169 : },
16170 : { .name = NULL }
16171 : };
16172 :
16173 0 : static PyObject *py_lsa_CreateAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16174 : {
16175 0 : PyObject *self = pytalloc_new(struct lsa_CreateAccount, type);
16176 0 : struct lsa_CreateAccount *_self = (struct lsa_CreateAccount *)pytalloc_get_ptr(self);
16177 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16178 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16179 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
16180 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
16181 0 : return self;
16182 : }
16183 :
16184 0 : static PyObject *py_lsa_CreateAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16185 : {
16186 :
16187 :
16188 0 : return PyLong_FromLong(10);
16189 : }
16190 :
16191 0 : static PyObject *py_lsa_CreateAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16192 : {
16193 0 : const struct ndr_interface_call *call = NULL;
16194 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16195 0 : PyObject *ret = NULL;
16196 0 : struct ndr_push *push = NULL;
16197 0 : DATA_BLOB blob;
16198 0 : enum ndr_err_code err;
16199 :
16200 0 : if (ndr_table_lsarpc.num_calls < 11) {
16201 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_pack");
16202 0 : return NULL;
16203 : }
16204 0 : call = &ndr_table_lsarpc.calls[10];
16205 :
16206 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16207 0 : if (push == NULL) {
16208 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16209 0 : return NULL;
16210 : }
16211 :
16212 0 : push->flags |= ndr_push_flags;
16213 :
16214 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16215 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16216 0 : TALLOC_FREE(push);
16217 0 : PyErr_SetNdrError(err);
16218 0 : return NULL;
16219 : }
16220 0 : blob = ndr_push_blob(push);
16221 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16222 0 : TALLOC_FREE(push);
16223 0 : return ret;
16224 : }
16225 :
16226 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16227 : {
16228 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16229 0 : PyObject *bigendian_obj = NULL;
16230 0 : PyObject *ndr64_obj = NULL;
16231 0 : libndr_flags ndr_push_flags = 0;
16232 :
16233 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16234 : discard_const_p(char *, kwnames),
16235 : &bigendian_obj,
16236 : &ndr64_obj)) {
16237 0 : return NULL;
16238 : }
16239 :
16240 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16241 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16242 : }
16243 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16244 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16245 : }
16246 :
16247 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16248 : }
16249 :
16250 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16251 : {
16252 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16253 0 : PyObject *bigendian_obj = NULL;
16254 0 : PyObject *ndr64_obj = NULL;
16255 0 : libndr_flags ndr_push_flags = 0;
16256 :
16257 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16258 : discard_const_p(char *, kwnames),
16259 : &bigendian_obj,
16260 : &ndr64_obj)) {
16261 0 : return NULL;
16262 : }
16263 :
16264 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16265 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16266 : }
16267 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16268 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16269 : }
16270 :
16271 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16272 : }
16273 :
16274 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16275 : {
16276 0 : const struct ndr_interface_call *call = NULL;
16277 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16278 0 : struct ndr_pull *pull = NULL;
16279 0 : enum ndr_err_code err;
16280 :
16281 0 : if (ndr_table_lsarpc.num_calls < 11) {
16282 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_unpack");
16283 0 : return NULL;
16284 : }
16285 0 : call = &ndr_table_lsarpc.calls[10];
16286 :
16287 0 : pull = ndr_pull_init_blob(blob, object);
16288 0 : if (pull == NULL) {
16289 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16290 0 : return NULL;
16291 : }
16292 :
16293 0 : pull->flags |= ndr_pull_flags;
16294 :
16295 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16296 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16297 0 : TALLOC_FREE(pull);
16298 0 : PyErr_SetNdrError(err);
16299 0 : return NULL;
16300 : }
16301 0 : if (!allow_remaining) {
16302 0 : uint32_t highest_ofs;
16303 :
16304 0 : if (pull->offset > pull->relative_highest_offset) {
16305 0 : highest_ofs = pull->offset;
16306 : } else {
16307 0 : highest_ofs = pull->relative_highest_offset;
16308 : }
16309 0 : if (highest_ofs < pull->data_size) {
16310 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16311 : "not all bytes consumed ofs[%u] size[%u]",
16312 : highest_ofs, pull->data_size);
16313 0 : TALLOC_FREE(pull);
16314 0 : PyErr_SetNdrError(err);
16315 0 : return NULL;
16316 : }
16317 : }
16318 :
16319 0 : TALLOC_FREE(pull);
16320 0 : Py_RETURN_NONE;
16321 : }
16322 :
16323 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16324 : {
16325 0 : DATA_BLOB blob;
16326 0 : Py_ssize_t blob_length = 0;
16327 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16328 0 : PyObject *bigendian_obj = NULL;
16329 0 : PyObject *ndr64_obj = NULL;
16330 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16331 0 : PyObject *allow_remaining_obj = NULL;
16332 0 : bool allow_remaining = false;
16333 :
16334 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16335 : discard_const_p(char *, kwnames),
16336 : &blob.data, &blob_length,
16337 : &bigendian_obj,
16338 : &ndr64_obj,
16339 : &allow_remaining_obj)) {
16340 0 : return NULL;
16341 : }
16342 0 : blob.length = blob_length;
16343 :
16344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16345 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16346 : }
16347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16348 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16349 : }
16350 :
16351 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16352 0 : allow_remaining = true;
16353 : }
16354 :
16355 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16356 : }
16357 :
16358 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16359 : {
16360 0 : DATA_BLOB blob;
16361 0 : Py_ssize_t blob_length = 0;
16362 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16363 0 : PyObject *bigendian_obj = NULL;
16364 0 : PyObject *ndr64_obj = NULL;
16365 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16366 0 : PyObject *allow_remaining_obj = NULL;
16367 0 : bool allow_remaining = false;
16368 :
16369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16370 : discard_const_p(char *, kwnames),
16371 : &blob.data, &blob_length,
16372 : &bigendian_obj,
16373 : &ndr64_obj,
16374 : &allow_remaining_obj)) {
16375 0 : return NULL;
16376 : }
16377 0 : blob.length = blob_length;
16378 :
16379 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16380 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16381 : }
16382 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16383 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16384 : }
16385 :
16386 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16387 0 : allow_remaining = true;
16388 : }
16389 :
16390 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16391 : }
16392 :
16393 0 : static PyObject *py_lsa_CreateAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16394 : {
16395 0 : const struct ndr_interface_call *call = NULL;
16396 0 : struct lsa_CreateAccount *object = (struct lsa_CreateAccount *)pytalloc_get_ptr(py_obj);
16397 0 : PyObject *ret;
16398 0 : char *retstr;
16399 :
16400 0 : if (ndr_table_lsarpc.num_calls < 11) {
16401 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_print");
16402 0 : return NULL;
16403 : }
16404 0 : call = &ndr_table_lsarpc.calls[10];
16405 :
16406 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16407 0 : ret = PyUnicode_FromString(retstr);
16408 0 : TALLOC_FREE(retstr);
16409 :
16410 0 : return ret;
16411 : }
16412 :
16413 0 : static PyObject *py_lsa_CreateAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16414 : {
16415 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_in", NDR_IN);
16416 : }
16417 :
16418 0 : static PyObject *py_lsa_CreateAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16419 : {
16420 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_out", NDR_OUT);
16421 : }
16422 :
16423 : static PyMethodDef py_lsa_CreateAccount_methods[] = {
16424 : { "opnum", (PyCFunction)py_lsa_CreateAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
16425 : "lsa.CreateAccount.opnum() -> 10 (0x0a) " },
16426 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16427 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16428 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16429 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16430 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16431 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16432 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16433 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16434 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16435 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16436 : { NULL, NULL, 0, NULL }
16437 : };
16438 :
16439 :
16440 : static PyTypeObject lsa_CreateAccount_Type = {
16441 : PyVarObject_HEAD_INIT(NULL, 0)
16442 : .tp_name = "lsa.CreateAccount",
16443 : .tp_getset = py_lsa_CreateAccount_getsetters,
16444 : .tp_methods = py_lsa_CreateAccount_methods,
16445 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16446 : .tp_new = py_lsa_CreateAccount_new,
16447 : };
16448 :
16449 0 : static bool pack_py_lsa_CreateAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateAccount *r)
16450 : {
16451 0 : PyObject *py_handle;
16452 0 : PyObject *py_sid;
16453 0 : PyObject *py_access_mask;
16454 0 : const char *kwnames[] = {
16455 : "handle", "sid", "access_mask", NULL
16456 : };
16457 :
16458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
16459 0 : return false;
16460 : }
16461 :
16462 0 : if (py_handle == NULL) {
16463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
16464 0 : return false;
16465 : }
16466 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
16467 0 : if (r->in.handle == NULL) {
16468 0 : PyErr_NoMemory();
16469 0 : return false;
16470 : }
16471 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
16472 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
16473 0 : PyErr_NoMemory();
16474 0 : return false;
16475 : }
16476 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
16477 0 : if (py_sid == NULL) {
16478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
16479 0 : return false;
16480 : }
16481 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
16482 0 : if (r->in.sid == NULL) {
16483 0 : PyErr_NoMemory();
16484 0 : return false;
16485 : }
16486 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
16487 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
16488 0 : PyErr_NoMemory();
16489 0 : return false;
16490 : }
16491 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
16492 0 : if (py_access_mask == NULL) {
16493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
16494 0 : return false;
16495 : }
16496 : {
16497 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
16498 0 : if (PyLong_Check(py_access_mask)) {
16499 0 : unsigned long long test_var;
16500 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
16501 0 : if (PyErr_Occurred() != NULL) {
16502 0 : return false;
16503 : }
16504 0 : if (test_var > uint_max) {
16505 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16506 : PyLong_Type.tp_name, uint_max, test_var);
16507 0 : return false;
16508 : }
16509 0 : r->in.access_mask = test_var;
16510 : } else {
16511 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16512 : PyLong_Type.tp_name);
16513 0 : return false;
16514 : }
16515 : }
16516 0 : return true;
16517 : }
16518 :
16519 0 : static PyObject *unpack_py_lsa_CreateAccount_args_out(struct lsa_CreateAccount *r)
16520 : {
16521 0 : PyObject *result;
16522 0 : PyObject *py_acct_handle;
16523 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
16524 0 : result = py_acct_handle;
16525 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
16526 0 : PyErr_SetNTSTATUS(r->out.result);
16527 0 : return NULL;
16528 : }
16529 :
16530 0 : return result;
16531 : }
16532 :
16533 :
16534 0 : static PyObject *py_lsa_EnumAccounts_in_get_handle(PyObject *obj, void *closure)
16535 : {
16536 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16537 0 : PyObject *py_handle;
16538 0 : if (object->in.handle == NULL) {
16539 0 : Py_RETURN_NONE;
16540 : }
16541 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
16542 0 : return py_handle;
16543 : }
16544 :
16545 0 : static int py_lsa_EnumAccounts_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16546 : {
16547 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16548 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16549 0 : if (value == NULL) {
16550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
16551 0 : return -1;
16552 : }
16553 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16554 0 : if (object->in.handle == NULL) {
16555 0 : PyErr_NoMemory();
16556 0 : return -1;
16557 : }
16558 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16559 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16560 0 : PyErr_NoMemory();
16561 0 : return -1;
16562 : }
16563 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16564 0 : return 0;
16565 : }
16566 :
16567 0 : static PyObject *py_lsa_EnumAccounts_in_get_resume_handle(PyObject *obj, void *closure)
16568 : {
16569 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16570 0 : PyObject *py_resume_handle;
16571 0 : if (object->in.resume_handle == NULL) {
16572 0 : Py_RETURN_NONE;
16573 : }
16574 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
16575 0 : return py_resume_handle;
16576 : }
16577 :
16578 0 : static int py_lsa_EnumAccounts_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16579 : {
16580 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16581 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
16582 0 : if (value == NULL) {
16583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
16584 0 : return -1;
16585 : }
16586 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
16587 0 : if (object->in.resume_handle == NULL) {
16588 0 : PyErr_NoMemory();
16589 0 : return -1;
16590 : }
16591 : {
16592 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
16593 0 : if (PyLong_Check(value)) {
16594 0 : unsigned long long test_var;
16595 0 : test_var = PyLong_AsUnsignedLongLong(value);
16596 0 : if (PyErr_Occurred() != NULL) {
16597 0 : return -1;
16598 : }
16599 0 : if (test_var > uint_max) {
16600 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16601 : PyLong_Type.tp_name, uint_max, test_var);
16602 0 : return -1;
16603 : }
16604 0 : *object->in.resume_handle = test_var;
16605 : } else {
16606 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16607 : PyLong_Type.tp_name);
16608 0 : return -1;
16609 : }
16610 : }
16611 0 : return 0;
16612 : }
16613 :
16614 0 : static PyObject *py_lsa_EnumAccounts_out_get_resume_handle(PyObject *obj, void *closure)
16615 : {
16616 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16617 0 : PyObject *py_resume_handle;
16618 0 : if (object->out.resume_handle == NULL) {
16619 0 : Py_RETURN_NONE;
16620 : }
16621 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
16622 0 : return py_resume_handle;
16623 : }
16624 :
16625 0 : static int py_lsa_EnumAccounts_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16626 : {
16627 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16628 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
16629 0 : if (value == NULL) {
16630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
16631 0 : return -1;
16632 : }
16633 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
16634 0 : if (object->out.resume_handle == NULL) {
16635 0 : PyErr_NoMemory();
16636 0 : return -1;
16637 : }
16638 : {
16639 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
16640 0 : if (PyLong_Check(value)) {
16641 0 : unsigned long long test_var;
16642 0 : test_var = PyLong_AsUnsignedLongLong(value);
16643 0 : if (PyErr_Occurred() != NULL) {
16644 0 : return -1;
16645 : }
16646 0 : if (test_var > uint_max) {
16647 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16648 : PyLong_Type.tp_name, uint_max, test_var);
16649 0 : return -1;
16650 : }
16651 0 : *object->out.resume_handle = test_var;
16652 : } else {
16653 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16654 : PyLong_Type.tp_name);
16655 0 : return -1;
16656 : }
16657 : }
16658 0 : return 0;
16659 : }
16660 :
16661 0 : static PyObject *py_lsa_EnumAccounts_out_get_sids(PyObject *obj, void *closure)
16662 : {
16663 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16664 0 : PyObject *py_sids;
16665 0 : if (object->out.sids == NULL) {
16666 0 : Py_RETURN_NONE;
16667 : }
16668 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
16669 0 : return py_sids;
16670 : }
16671 :
16672 0 : static int py_lsa_EnumAccounts_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
16673 : {
16674 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16675 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
16676 0 : if (value == NULL) {
16677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
16678 0 : return -1;
16679 : }
16680 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
16681 0 : if (object->out.sids == NULL) {
16682 0 : PyErr_NoMemory();
16683 0 : return -1;
16684 : }
16685 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
16686 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16687 0 : PyErr_NoMemory();
16688 0 : return -1;
16689 : }
16690 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
16691 0 : return 0;
16692 : }
16693 :
16694 0 : static PyObject *py_lsa_EnumAccounts_in_get_num_entries(PyObject *obj, void *closure)
16695 : {
16696 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16697 0 : PyObject *py_num_entries;
16698 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_entries);
16699 0 : return py_num_entries;
16700 : }
16701 :
16702 0 : static int py_lsa_EnumAccounts_in_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
16703 : {
16704 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16705 0 : if (value == NULL) {
16706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_entries");
16707 0 : return -1;
16708 : }
16709 : {
16710 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_entries));
16711 0 : if (PyLong_Check(value)) {
16712 0 : unsigned long long test_var;
16713 0 : test_var = PyLong_AsUnsignedLongLong(value);
16714 0 : if (PyErr_Occurred() != NULL) {
16715 0 : return -1;
16716 : }
16717 0 : if (test_var > uint_max) {
16718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16719 : PyLong_Type.tp_name, uint_max, test_var);
16720 0 : return -1;
16721 : }
16722 0 : object->in.num_entries = test_var;
16723 : } else {
16724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16725 : PyLong_Type.tp_name);
16726 0 : return -1;
16727 : }
16728 : }
16729 0 : return 0;
16730 : }
16731 :
16732 0 : static PyObject *py_lsa_EnumAccounts_get_result(PyObject *obj, void *closure)
16733 : {
16734 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(obj);
16735 0 : PyObject *py_result;
16736 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16737 0 : return py_result;
16738 : }
16739 :
16740 0 : static int py_lsa_EnumAccounts_set_result(PyObject *py_obj, PyObject *value, void *closure)
16741 : {
16742 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16743 0 : if (value == NULL) {
16744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16745 0 : return -1;
16746 : }
16747 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16748 0 : return 0;
16749 : }
16750 :
16751 : static PyGetSetDef py_lsa_EnumAccounts_getsetters[] = {
16752 : {
16753 : .name = discard_const_p(char, "in_handle"),
16754 : .get = py_lsa_EnumAccounts_in_get_handle,
16755 : .set = py_lsa_EnumAccounts_in_set_handle,
16756 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16757 : },
16758 : {
16759 : .name = discard_const_p(char, "in_resume_handle"),
16760 : .get = py_lsa_EnumAccounts_in_get_resume_handle,
16761 : .set = py_lsa_EnumAccounts_in_set_resume_handle,
16762 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16763 : },
16764 : {
16765 : .name = discard_const_p(char, "out_resume_handle"),
16766 : .get = py_lsa_EnumAccounts_out_get_resume_handle,
16767 : .set = py_lsa_EnumAccounts_out_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_sids"),
16772 : .get = py_lsa_EnumAccounts_out_get_sids,
16773 : .set = py_lsa_EnumAccounts_out_set_sids,
16774 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
16775 : },
16776 : {
16777 : .name = discard_const_p(char, "in_num_entries"),
16778 : .get = py_lsa_EnumAccounts_in_get_num_entries,
16779 : .set = py_lsa_EnumAccounts_in_set_num_entries,
16780 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16781 : },
16782 : {
16783 : .name = discard_const_p(char, "result"),
16784 : .get = py_lsa_EnumAccounts_get_result,
16785 : .set = py_lsa_EnumAccounts_set_result,
16786 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16787 : },
16788 : { .name = NULL }
16789 : };
16790 :
16791 0 : static PyObject *py_lsa_EnumAccounts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16792 : {
16793 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccounts, type);
16794 0 : struct lsa_EnumAccounts *_self = (struct lsa_EnumAccounts *)pytalloc_get_ptr(self);
16795 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16796 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16797 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
16798 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
16799 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
16800 0 : return self;
16801 : }
16802 :
16803 0 : static PyObject *py_lsa_EnumAccounts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16804 : {
16805 :
16806 :
16807 0 : return PyLong_FromLong(11);
16808 : }
16809 :
16810 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16811 : {
16812 0 : const struct ndr_interface_call *call = NULL;
16813 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16814 0 : PyObject *ret = NULL;
16815 0 : struct ndr_push *push = NULL;
16816 0 : DATA_BLOB blob;
16817 0 : enum ndr_err_code err;
16818 :
16819 0 : if (ndr_table_lsarpc.num_calls < 12) {
16820 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_pack");
16821 0 : return NULL;
16822 : }
16823 0 : call = &ndr_table_lsarpc.calls[11];
16824 :
16825 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16826 0 : if (push == NULL) {
16827 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16828 0 : return NULL;
16829 : }
16830 :
16831 0 : push->flags |= ndr_push_flags;
16832 :
16833 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16834 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16835 0 : TALLOC_FREE(push);
16836 0 : PyErr_SetNdrError(err);
16837 0 : return NULL;
16838 : }
16839 0 : blob = ndr_push_blob(push);
16840 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16841 0 : TALLOC_FREE(push);
16842 0 : return ret;
16843 : }
16844 :
16845 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16846 : {
16847 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16848 0 : PyObject *bigendian_obj = NULL;
16849 0 : PyObject *ndr64_obj = NULL;
16850 0 : libndr_flags ndr_push_flags = 0;
16851 :
16852 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16853 : discard_const_p(char *, kwnames),
16854 : &bigendian_obj,
16855 : &ndr64_obj)) {
16856 0 : return NULL;
16857 : }
16858 :
16859 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16860 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16861 : }
16862 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16863 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16864 : }
16865 :
16866 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16867 : }
16868 :
16869 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16870 : {
16871 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16872 0 : PyObject *bigendian_obj = NULL;
16873 0 : PyObject *ndr64_obj = NULL;
16874 0 : libndr_flags ndr_push_flags = 0;
16875 :
16876 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16877 : discard_const_p(char *, kwnames),
16878 : &bigendian_obj,
16879 : &ndr64_obj)) {
16880 0 : return NULL;
16881 : }
16882 :
16883 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16884 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16885 : }
16886 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16887 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16888 : }
16889 :
16890 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16891 : }
16892 :
16893 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16894 : {
16895 0 : const struct ndr_interface_call *call = NULL;
16896 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
16897 0 : struct ndr_pull *pull = NULL;
16898 0 : enum ndr_err_code err;
16899 :
16900 0 : if (ndr_table_lsarpc.num_calls < 12) {
16901 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_unpack");
16902 0 : return NULL;
16903 : }
16904 0 : call = &ndr_table_lsarpc.calls[11];
16905 :
16906 0 : pull = ndr_pull_init_blob(blob, object);
16907 0 : if (pull == NULL) {
16908 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16909 0 : return NULL;
16910 : }
16911 :
16912 0 : pull->flags |= ndr_pull_flags;
16913 :
16914 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16915 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16916 0 : TALLOC_FREE(pull);
16917 0 : PyErr_SetNdrError(err);
16918 0 : return NULL;
16919 : }
16920 0 : if (!allow_remaining) {
16921 0 : uint32_t highest_ofs;
16922 :
16923 0 : if (pull->offset > pull->relative_highest_offset) {
16924 0 : highest_ofs = pull->offset;
16925 : } else {
16926 0 : highest_ofs = pull->relative_highest_offset;
16927 : }
16928 0 : if (highest_ofs < pull->data_size) {
16929 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16930 : "not all bytes consumed ofs[%u] size[%u]",
16931 : highest_ofs, pull->data_size);
16932 0 : TALLOC_FREE(pull);
16933 0 : PyErr_SetNdrError(err);
16934 0 : return NULL;
16935 : }
16936 : }
16937 :
16938 0 : TALLOC_FREE(pull);
16939 0 : Py_RETURN_NONE;
16940 : }
16941 :
16942 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16943 : {
16944 0 : DATA_BLOB blob;
16945 0 : Py_ssize_t blob_length = 0;
16946 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16947 0 : PyObject *bigendian_obj = NULL;
16948 0 : PyObject *ndr64_obj = NULL;
16949 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16950 0 : PyObject *allow_remaining_obj = NULL;
16951 0 : bool allow_remaining = false;
16952 :
16953 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16954 : discard_const_p(char *, kwnames),
16955 : &blob.data, &blob_length,
16956 : &bigendian_obj,
16957 : &ndr64_obj,
16958 : &allow_remaining_obj)) {
16959 0 : return NULL;
16960 : }
16961 0 : blob.length = blob_length;
16962 :
16963 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16964 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16965 : }
16966 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16967 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16968 : }
16969 :
16970 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16971 0 : allow_remaining = true;
16972 : }
16973 :
16974 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16975 : }
16976 :
16977 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16978 : {
16979 0 : DATA_BLOB blob;
16980 0 : Py_ssize_t blob_length = 0;
16981 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16982 0 : PyObject *bigendian_obj = NULL;
16983 0 : PyObject *ndr64_obj = NULL;
16984 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16985 0 : PyObject *allow_remaining_obj = NULL;
16986 0 : bool allow_remaining = false;
16987 :
16988 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16989 : discard_const_p(char *, kwnames),
16990 : &blob.data, &blob_length,
16991 : &bigendian_obj,
16992 : &ndr64_obj,
16993 : &allow_remaining_obj)) {
16994 0 : return NULL;
16995 : }
16996 0 : blob.length = blob_length;
16997 :
16998 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16999 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17000 : }
17001 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17002 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17003 : }
17004 :
17005 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17006 0 : allow_remaining = true;
17007 : }
17008 :
17009 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17010 : }
17011 :
17012 0 : static PyObject *py_lsa_EnumAccounts_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17013 : {
17014 0 : const struct ndr_interface_call *call = NULL;
17015 0 : struct lsa_EnumAccounts *object = (struct lsa_EnumAccounts *)pytalloc_get_ptr(py_obj);
17016 0 : PyObject *ret;
17017 0 : char *retstr;
17018 :
17019 0 : if (ndr_table_lsarpc.num_calls < 12) {
17020 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_print");
17021 0 : return NULL;
17022 : }
17023 0 : call = &ndr_table_lsarpc.calls[11];
17024 :
17025 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17026 0 : ret = PyUnicode_FromString(retstr);
17027 0 : TALLOC_FREE(retstr);
17028 :
17029 0 : return ret;
17030 : }
17031 :
17032 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17033 : {
17034 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_in", NDR_IN);
17035 : }
17036 :
17037 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17038 : {
17039 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_out", NDR_OUT);
17040 : }
17041 :
17042 : static PyMethodDef py_lsa_EnumAccounts_methods[] = {
17043 : { "opnum", (PyCFunction)py_lsa_EnumAccounts_ndr_opnum, METH_NOARGS|METH_CLASS,
17044 : "lsa.EnumAccounts.opnum() -> 11 (0x0b) " },
17045 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17046 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17047 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17048 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17049 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17050 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17051 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17052 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17053 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17054 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17055 : { NULL, NULL, 0, NULL }
17056 : };
17057 :
17058 :
17059 : static PyTypeObject lsa_EnumAccounts_Type = {
17060 : PyVarObject_HEAD_INIT(NULL, 0)
17061 : .tp_name = "lsa.EnumAccounts",
17062 : .tp_getset = py_lsa_EnumAccounts_getsetters,
17063 : .tp_methods = py_lsa_EnumAccounts_methods,
17064 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17065 : .tp_new = py_lsa_EnumAccounts_new,
17066 : };
17067 :
17068 0 : static bool pack_py_lsa_EnumAccounts_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccounts *r)
17069 : {
17070 0 : PyObject *py_handle;
17071 0 : PyObject *py_resume_handle;
17072 0 : PyObject *py_num_entries;
17073 0 : const char *kwnames[] = {
17074 : "handle", "resume_handle", "num_entries", NULL
17075 : };
17076 :
17077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumAccounts", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_num_entries)) {
17078 0 : return false;
17079 : }
17080 :
17081 0 : if (py_handle == NULL) {
17082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
17083 0 : return false;
17084 : }
17085 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17086 0 : if (r->in.handle == NULL) {
17087 0 : PyErr_NoMemory();
17088 0 : return false;
17089 : }
17090 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17091 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17092 0 : PyErr_NoMemory();
17093 0 : return false;
17094 : }
17095 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17096 0 : if (py_resume_handle == NULL) {
17097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
17098 0 : return false;
17099 : }
17100 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
17101 0 : if (r->in.resume_handle == NULL) {
17102 0 : PyErr_NoMemory();
17103 0 : return false;
17104 : }
17105 : {
17106 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
17107 0 : if (PyLong_Check(py_resume_handle)) {
17108 0 : unsigned long long test_var;
17109 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
17110 0 : if (PyErr_Occurred() != NULL) {
17111 0 : return false;
17112 : }
17113 0 : if (test_var > uint_max) {
17114 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17115 : PyLong_Type.tp_name, uint_max, test_var);
17116 0 : return false;
17117 : }
17118 0 : *r->in.resume_handle = test_var;
17119 : } else {
17120 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17121 : PyLong_Type.tp_name);
17122 0 : return false;
17123 : }
17124 : }
17125 0 : if (py_num_entries == NULL) {
17126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.num_entries");
17127 0 : return false;
17128 : }
17129 : {
17130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_entries));
17131 0 : if (PyLong_Check(py_num_entries)) {
17132 0 : unsigned long long test_var;
17133 0 : test_var = PyLong_AsUnsignedLongLong(py_num_entries);
17134 0 : if (PyErr_Occurred() != NULL) {
17135 0 : return false;
17136 : }
17137 0 : if (test_var > uint_max) {
17138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17139 : PyLong_Type.tp_name, uint_max, test_var);
17140 0 : return false;
17141 : }
17142 0 : r->in.num_entries = test_var;
17143 : } else {
17144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17145 : PyLong_Type.tp_name);
17146 0 : return false;
17147 : }
17148 : }
17149 0 : return true;
17150 : }
17151 :
17152 0 : static PyObject *unpack_py_lsa_EnumAccounts_args_out(struct lsa_EnumAccounts *r)
17153 : {
17154 0 : PyObject *result;
17155 0 : PyObject *py_resume_handle;
17156 0 : PyObject *py_sids;
17157 0 : result = PyTuple_New(2);
17158 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
17159 0 : PyTuple_SetItem(result, 0, py_resume_handle);
17160 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
17161 0 : PyTuple_SetItem(result, 1, py_sids);
17162 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17163 0 : PyErr_SetNTSTATUS(r->out.result);
17164 0 : return NULL;
17165 : }
17166 :
17167 0 : return result;
17168 : }
17169 :
17170 :
17171 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_policy_handle(PyObject *obj, void *closure)
17172 : {
17173 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17174 0 : PyObject *py_policy_handle;
17175 0 : if (object->in.policy_handle == NULL) {
17176 0 : Py_RETURN_NONE;
17177 : }
17178 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
17179 0 : return py_policy_handle;
17180 : }
17181 :
17182 0 : static int py_lsa_CreateTrustedDomain_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
17183 : {
17184 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17185 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
17186 0 : if (value == NULL) {
17187 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
17188 0 : return -1;
17189 : }
17190 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
17191 0 : if (object->in.policy_handle == NULL) {
17192 0 : PyErr_NoMemory();
17193 0 : return -1;
17194 : }
17195 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17196 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17197 0 : PyErr_NoMemory();
17198 0 : return -1;
17199 : }
17200 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17201 0 : return 0;
17202 : }
17203 :
17204 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_info(PyObject *obj, void *closure)
17205 : {
17206 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17207 0 : PyObject *py_info;
17208 0 : if (object->in.info == NULL) {
17209 0 : Py_RETURN_NONE;
17210 : }
17211 0 : py_info = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->in.info, object->in.info);
17212 0 : return py_info;
17213 : }
17214 :
17215 0 : static int py_lsa_CreateTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
17216 : {
17217 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17218 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
17219 0 : if (value == NULL) {
17220 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
17221 0 : return -1;
17222 : }
17223 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
17224 0 : if (object->in.info == NULL) {
17225 0 : PyErr_NoMemory();
17226 0 : return -1;
17227 : }
17228 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, value, return -1;);
17229 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17230 0 : PyErr_NoMemory();
17231 0 : return -1;
17232 : }
17233 0 : object->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(value);
17234 0 : return 0;
17235 : }
17236 :
17237 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
17238 : {
17239 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17240 0 : PyObject *py_access_mask;
17241 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
17242 0 : return py_access_mask;
17243 : }
17244 :
17245 0 : static int py_lsa_CreateTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
17246 : {
17247 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17248 0 : if (value == NULL) {
17249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
17250 0 : return -1;
17251 : }
17252 : {
17253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
17254 0 : if (PyLong_Check(value)) {
17255 0 : unsigned long long test_var;
17256 0 : test_var = PyLong_AsUnsignedLongLong(value);
17257 0 : if (PyErr_Occurred() != NULL) {
17258 0 : return -1;
17259 : }
17260 0 : if (test_var > uint_max) {
17261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17262 : PyLong_Type.tp_name, uint_max, test_var);
17263 0 : return -1;
17264 : }
17265 0 : object->in.access_mask = test_var;
17266 : } else {
17267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17268 : PyLong_Type.tp_name);
17269 0 : return -1;
17270 : }
17271 : }
17272 0 : return 0;
17273 : }
17274 :
17275 0 : static PyObject *py_lsa_CreateTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
17276 : {
17277 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17278 0 : PyObject *py_trustdom_handle;
17279 0 : if (object->out.trustdom_handle == NULL) {
17280 0 : Py_RETURN_NONE;
17281 : }
17282 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
17283 0 : return py_trustdom_handle;
17284 : }
17285 :
17286 0 : static int py_lsa_CreateTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
17287 : {
17288 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
17290 0 : if (value == NULL) {
17291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
17292 0 : return -1;
17293 : }
17294 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
17295 0 : if (object->out.trustdom_handle == NULL) {
17296 0 : PyErr_NoMemory();
17297 0 : return -1;
17298 : }
17299 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17300 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17301 0 : PyErr_NoMemory();
17302 0 : return -1;
17303 : }
17304 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17305 0 : return 0;
17306 : }
17307 :
17308 0 : static PyObject *py_lsa_CreateTrustedDomain_get_result(PyObject *obj, void *closure)
17309 : {
17310 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(obj);
17311 0 : PyObject *py_result;
17312 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17313 0 : return py_result;
17314 : }
17315 :
17316 0 : static int py_lsa_CreateTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
17317 : {
17318 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17319 0 : if (value == NULL) {
17320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17321 0 : return -1;
17322 : }
17323 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17324 0 : return 0;
17325 : }
17326 :
17327 : static PyGetSetDef py_lsa_CreateTrustedDomain_getsetters[] = {
17328 : {
17329 : .name = discard_const_p(char, "in_policy_handle"),
17330 : .get = py_lsa_CreateTrustedDomain_in_get_policy_handle,
17331 : .set = py_lsa_CreateTrustedDomain_in_set_policy_handle,
17332 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17333 : },
17334 : {
17335 : .name = discard_const_p(char, "in_info"),
17336 : .get = py_lsa_CreateTrustedDomain_in_get_info,
17337 : .set = py_lsa_CreateTrustedDomain_in_set_info,
17338 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
17339 : },
17340 : {
17341 : .name = discard_const_p(char, "in_access_mask"),
17342 : .get = py_lsa_CreateTrustedDomain_in_get_access_mask,
17343 : .set = py_lsa_CreateTrustedDomain_in_set_access_mask,
17344 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
17345 : },
17346 : {
17347 : .name = discard_const_p(char, "out_trustdom_handle"),
17348 : .get = py_lsa_CreateTrustedDomain_out_get_trustdom_handle,
17349 : .set = py_lsa_CreateTrustedDomain_out_set_trustdom_handle,
17350 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17351 : },
17352 : {
17353 : .name = discard_const_p(char, "result"),
17354 : .get = py_lsa_CreateTrustedDomain_get_result,
17355 : .set = py_lsa_CreateTrustedDomain_set_result,
17356 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17357 : },
17358 : { .name = NULL }
17359 : };
17360 :
17361 0 : static PyObject *py_lsa_CreateTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17362 : {
17363 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomain, type);
17364 0 : struct lsa_CreateTrustedDomain *_self = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(self);
17365 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17366 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
17367 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_DomainInfo);
17368 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
17369 0 : return self;
17370 : }
17371 :
17372 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17373 : {
17374 :
17375 :
17376 0 : return PyLong_FromLong(12);
17377 : }
17378 :
17379 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17380 : {
17381 0 : const struct ndr_interface_call *call = NULL;
17382 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17383 0 : PyObject *ret = NULL;
17384 0 : struct ndr_push *push = NULL;
17385 0 : DATA_BLOB blob;
17386 0 : enum ndr_err_code err;
17387 :
17388 0 : if (ndr_table_lsarpc.num_calls < 13) {
17389 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_pack");
17390 0 : return NULL;
17391 : }
17392 0 : call = &ndr_table_lsarpc.calls[12];
17393 :
17394 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17395 0 : if (push == NULL) {
17396 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17397 0 : return NULL;
17398 : }
17399 :
17400 0 : push->flags |= ndr_push_flags;
17401 :
17402 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17403 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17404 0 : TALLOC_FREE(push);
17405 0 : PyErr_SetNdrError(err);
17406 0 : return NULL;
17407 : }
17408 0 : blob = ndr_push_blob(push);
17409 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17410 0 : TALLOC_FREE(push);
17411 0 : return ret;
17412 : }
17413 :
17414 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17415 : {
17416 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17417 0 : PyObject *bigendian_obj = NULL;
17418 0 : PyObject *ndr64_obj = NULL;
17419 0 : libndr_flags ndr_push_flags = 0;
17420 :
17421 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17422 : discard_const_p(char *, kwnames),
17423 : &bigendian_obj,
17424 : &ndr64_obj)) {
17425 0 : return NULL;
17426 : }
17427 :
17428 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17429 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17430 : }
17431 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17432 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17433 : }
17434 :
17435 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17436 : }
17437 :
17438 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17439 : {
17440 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17441 0 : PyObject *bigendian_obj = NULL;
17442 0 : PyObject *ndr64_obj = NULL;
17443 0 : libndr_flags ndr_push_flags = 0;
17444 :
17445 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17446 : discard_const_p(char *, kwnames),
17447 : &bigendian_obj,
17448 : &ndr64_obj)) {
17449 0 : return NULL;
17450 : }
17451 :
17452 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17453 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17454 : }
17455 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17456 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17457 : }
17458 :
17459 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17460 : }
17461 :
17462 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17463 : {
17464 0 : const struct ndr_interface_call *call = NULL;
17465 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17466 0 : struct ndr_pull *pull = NULL;
17467 0 : enum ndr_err_code err;
17468 :
17469 0 : if (ndr_table_lsarpc.num_calls < 13) {
17470 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_unpack");
17471 0 : return NULL;
17472 : }
17473 0 : call = &ndr_table_lsarpc.calls[12];
17474 :
17475 0 : pull = ndr_pull_init_blob(blob, object);
17476 0 : if (pull == NULL) {
17477 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17478 0 : return NULL;
17479 : }
17480 :
17481 0 : pull->flags |= ndr_pull_flags;
17482 :
17483 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17484 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17485 0 : TALLOC_FREE(pull);
17486 0 : PyErr_SetNdrError(err);
17487 0 : return NULL;
17488 : }
17489 0 : if (!allow_remaining) {
17490 0 : uint32_t highest_ofs;
17491 :
17492 0 : if (pull->offset > pull->relative_highest_offset) {
17493 0 : highest_ofs = pull->offset;
17494 : } else {
17495 0 : highest_ofs = pull->relative_highest_offset;
17496 : }
17497 0 : if (highest_ofs < pull->data_size) {
17498 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17499 : "not all bytes consumed ofs[%u] size[%u]",
17500 : highest_ofs, pull->data_size);
17501 0 : TALLOC_FREE(pull);
17502 0 : PyErr_SetNdrError(err);
17503 0 : return NULL;
17504 : }
17505 : }
17506 :
17507 0 : TALLOC_FREE(pull);
17508 0 : Py_RETURN_NONE;
17509 : }
17510 :
17511 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17512 : {
17513 0 : DATA_BLOB blob;
17514 0 : Py_ssize_t blob_length = 0;
17515 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17516 0 : PyObject *bigendian_obj = NULL;
17517 0 : PyObject *ndr64_obj = NULL;
17518 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17519 0 : PyObject *allow_remaining_obj = NULL;
17520 0 : bool allow_remaining = false;
17521 :
17522 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17523 : discard_const_p(char *, kwnames),
17524 : &blob.data, &blob_length,
17525 : &bigendian_obj,
17526 : &ndr64_obj,
17527 : &allow_remaining_obj)) {
17528 0 : return NULL;
17529 : }
17530 0 : blob.length = blob_length;
17531 :
17532 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17533 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17534 : }
17535 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17536 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17537 : }
17538 :
17539 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17540 0 : allow_remaining = true;
17541 : }
17542 :
17543 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17544 : }
17545 :
17546 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17547 : {
17548 0 : DATA_BLOB blob;
17549 0 : Py_ssize_t blob_length = 0;
17550 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17551 0 : PyObject *bigendian_obj = NULL;
17552 0 : PyObject *ndr64_obj = NULL;
17553 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17554 0 : PyObject *allow_remaining_obj = NULL;
17555 0 : bool allow_remaining = false;
17556 :
17557 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17558 : discard_const_p(char *, kwnames),
17559 : &blob.data, &blob_length,
17560 : &bigendian_obj,
17561 : &ndr64_obj,
17562 : &allow_remaining_obj)) {
17563 0 : return NULL;
17564 : }
17565 0 : blob.length = blob_length;
17566 :
17567 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17568 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17569 : }
17570 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17571 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17572 : }
17573 :
17574 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17575 0 : allow_remaining = true;
17576 : }
17577 :
17578 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17579 : }
17580 :
17581 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17582 : {
17583 0 : const struct ndr_interface_call *call = NULL;
17584 0 : struct lsa_CreateTrustedDomain *object = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(py_obj);
17585 0 : PyObject *ret;
17586 0 : char *retstr;
17587 :
17588 0 : if (ndr_table_lsarpc.num_calls < 13) {
17589 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_print");
17590 0 : return NULL;
17591 : }
17592 0 : call = &ndr_table_lsarpc.calls[12];
17593 :
17594 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17595 0 : ret = PyUnicode_FromString(retstr);
17596 0 : TALLOC_FREE(retstr);
17597 :
17598 0 : return ret;
17599 : }
17600 :
17601 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17602 : {
17603 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_in", NDR_IN);
17604 : }
17605 :
17606 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17607 : {
17608 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_out", NDR_OUT);
17609 : }
17610 :
17611 : static PyMethodDef py_lsa_CreateTrustedDomain_methods[] = {
17612 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
17613 : "lsa.CreateTrustedDomain.opnum() -> 12 (0x0c) " },
17614 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17615 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17616 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17617 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17618 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17619 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17620 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17621 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17622 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17623 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17624 : { NULL, NULL, 0, NULL }
17625 : };
17626 :
17627 :
17628 : static PyTypeObject lsa_CreateTrustedDomain_Type = {
17629 : PyVarObject_HEAD_INIT(NULL, 0)
17630 : .tp_name = "lsa.CreateTrustedDomain",
17631 : .tp_getset = py_lsa_CreateTrustedDomain_getsetters,
17632 : .tp_methods = py_lsa_CreateTrustedDomain_methods,
17633 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17634 : .tp_new = py_lsa_CreateTrustedDomain_new,
17635 : };
17636 :
17637 0 : static bool pack_py_lsa_CreateTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomain *r)
17638 : {
17639 0 : PyObject *py_policy_handle;
17640 0 : PyObject *py_info;
17641 0 : PyObject *py_access_mask;
17642 0 : const char *kwnames[] = {
17643 : "policy_handle", "info", "access_mask", NULL
17644 : };
17645 :
17646 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateTrustedDomain", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_access_mask)) {
17647 0 : return false;
17648 : }
17649 :
17650 0 : if (py_policy_handle == NULL) {
17651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
17652 0 : return false;
17653 : }
17654 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
17655 0 : if (r->in.policy_handle == NULL) {
17656 0 : PyErr_NoMemory();
17657 0 : return false;
17658 : }
17659 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
17660 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
17661 0 : PyErr_NoMemory();
17662 0 : return false;
17663 : }
17664 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
17665 0 : if (py_info == NULL) {
17666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
17667 0 : return false;
17668 : }
17669 0 : r->in.info = talloc_ptrtype(r, r->in.info);
17670 0 : if (r->in.info == NULL) {
17671 0 : PyErr_NoMemory();
17672 0 : return false;
17673 : }
17674 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, py_info, return false;);
17675 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
17676 0 : PyErr_NoMemory();
17677 0 : return false;
17678 : }
17679 0 : r->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_info);
17680 0 : if (py_access_mask == NULL) {
17681 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
17682 0 : return false;
17683 : }
17684 : {
17685 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
17686 0 : if (PyLong_Check(py_access_mask)) {
17687 0 : unsigned long long test_var;
17688 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
17689 0 : if (PyErr_Occurred() != NULL) {
17690 0 : return false;
17691 : }
17692 0 : if (test_var > uint_max) {
17693 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17694 : PyLong_Type.tp_name, uint_max, test_var);
17695 0 : return false;
17696 : }
17697 0 : r->in.access_mask = test_var;
17698 : } else {
17699 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17700 : PyLong_Type.tp_name);
17701 0 : return false;
17702 : }
17703 : }
17704 0 : return true;
17705 : }
17706 :
17707 0 : static PyObject *unpack_py_lsa_CreateTrustedDomain_args_out(struct lsa_CreateTrustedDomain *r)
17708 : {
17709 0 : PyObject *result;
17710 0 : PyObject *py_trustdom_handle;
17711 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
17712 0 : result = py_trustdom_handle;
17713 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17714 0 : PyErr_SetNTSTATUS(r->out.result);
17715 0 : return NULL;
17716 : }
17717 :
17718 0 : return result;
17719 : }
17720 :
17721 :
17722 0 : static PyObject *py_lsa_EnumTrustDom_in_get_handle(PyObject *obj, void *closure)
17723 : {
17724 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17725 0 : PyObject *py_handle;
17726 0 : if (object->in.handle == NULL) {
17727 0 : Py_RETURN_NONE;
17728 : }
17729 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17730 0 : return py_handle;
17731 : }
17732 :
17733 0 : static int py_lsa_EnumTrustDom_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17734 : {
17735 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17736 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17737 0 : if (value == NULL) {
17738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
17739 0 : return -1;
17740 : }
17741 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17742 0 : if (object->in.handle == NULL) {
17743 0 : PyErr_NoMemory();
17744 0 : return -1;
17745 : }
17746 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17747 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17748 0 : PyErr_NoMemory();
17749 0 : return -1;
17750 : }
17751 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17752 0 : return 0;
17753 : }
17754 :
17755 0 : static PyObject *py_lsa_EnumTrustDom_in_get_resume_handle(PyObject *obj, void *closure)
17756 : {
17757 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17758 0 : PyObject *py_resume_handle;
17759 0 : if (object->in.resume_handle == NULL) {
17760 0 : Py_RETURN_NONE;
17761 : }
17762 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
17763 0 : return py_resume_handle;
17764 : }
17765 :
17766 0 : static int py_lsa_EnumTrustDom_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17767 : {
17768 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17769 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
17770 0 : if (value == NULL) {
17771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
17772 0 : return -1;
17773 : }
17774 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
17775 0 : if (object->in.resume_handle == NULL) {
17776 0 : PyErr_NoMemory();
17777 0 : return -1;
17778 : }
17779 : {
17780 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
17781 0 : if (PyLong_Check(value)) {
17782 0 : unsigned long long test_var;
17783 0 : test_var = PyLong_AsUnsignedLongLong(value);
17784 0 : if (PyErr_Occurred() != NULL) {
17785 0 : return -1;
17786 : }
17787 0 : if (test_var > uint_max) {
17788 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17789 : PyLong_Type.tp_name, uint_max, test_var);
17790 0 : return -1;
17791 : }
17792 0 : *object->in.resume_handle = test_var;
17793 : } else {
17794 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17795 : PyLong_Type.tp_name);
17796 0 : return -1;
17797 : }
17798 : }
17799 0 : return 0;
17800 : }
17801 :
17802 0 : static PyObject *py_lsa_EnumTrustDom_out_get_resume_handle(PyObject *obj, void *closure)
17803 : {
17804 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17805 0 : PyObject *py_resume_handle;
17806 0 : if (object->out.resume_handle == NULL) {
17807 0 : Py_RETURN_NONE;
17808 : }
17809 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
17810 0 : return py_resume_handle;
17811 : }
17812 :
17813 0 : static int py_lsa_EnumTrustDom_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17814 : {
17815 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17816 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
17817 0 : if (value == NULL) {
17818 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
17819 0 : return -1;
17820 : }
17821 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
17822 0 : if (object->out.resume_handle == NULL) {
17823 0 : PyErr_NoMemory();
17824 0 : return -1;
17825 : }
17826 : {
17827 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
17828 0 : if (PyLong_Check(value)) {
17829 0 : unsigned long long test_var;
17830 0 : test_var = PyLong_AsUnsignedLongLong(value);
17831 0 : if (PyErr_Occurred() != NULL) {
17832 0 : return -1;
17833 : }
17834 0 : if (test_var > uint_max) {
17835 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17836 : PyLong_Type.tp_name, uint_max, test_var);
17837 0 : return -1;
17838 : }
17839 0 : *object->out.resume_handle = test_var;
17840 : } else {
17841 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17842 : PyLong_Type.tp_name);
17843 0 : return -1;
17844 : }
17845 : }
17846 0 : return 0;
17847 : }
17848 :
17849 0 : static PyObject *py_lsa_EnumTrustDom_out_get_domains(PyObject *obj, void *closure)
17850 : {
17851 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17852 0 : PyObject *py_domains;
17853 0 : if (object->out.domains == NULL) {
17854 0 : Py_RETURN_NONE;
17855 : }
17856 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, object->out.domains, object->out.domains);
17857 0 : return py_domains;
17858 : }
17859 :
17860 0 : static int py_lsa_EnumTrustDom_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
17861 : {
17862 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17863 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
17864 0 : if (value == NULL) {
17865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
17866 0 : return -1;
17867 : }
17868 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
17869 0 : if (object->out.domains == NULL) {
17870 0 : PyErr_NoMemory();
17871 0 : return -1;
17872 : }
17873 0 : PY_CHECK_TYPE(&lsa_DomainList_Type, value, return -1;);
17874 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17875 0 : PyErr_NoMemory();
17876 0 : return -1;
17877 : }
17878 0 : object->out.domains = (struct lsa_DomainList *)pytalloc_get_ptr(value);
17879 0 : return 0;
17880 : }
17881 :
17882 0 : static PyObject *py_lsa_EnumTrustDom_in_get_max_size(PyObject *obj, void *closure)
17883 : {
17884 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17885 0 : PyObject *py_max_size;
17886 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
17887 0 : return py_max_size;
17888 : }
17889 :
17890 0 : static int py_lsa_EnumTrustDom_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
17891 : {
17892 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17893 0 : if (value == NULL) {
17894 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
17895 0 : return -1;
17896 : }
17897 : {
17898 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
17899 0 : if (PyLong_Check(value)) {
17900 0 : unsigned long long test_var;
17901 0 : test_var = PyLong_AsUnsignedLongLong(value);
17902 0 : if (PyErr_Occurred() != NULL) {
17903 0 : return -1;
17904 : }
17905 0 : if (test_var > uint_max) {
17906 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17907 : PyLong_Type.tp_name, uint_max, test_var);
17908 0 : return -1;
17909 : }
17910 0 : object->in.max_size = test_var;
17911 : } else {
17912 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17913 : PyLong_Type.tp_name);
17914 0 : return -1;
17915 : }
17916 : }
17917 0 : return 0;
17918 : }
17919 :
17920 0 : static PyObject *py_lsa_EnumTrustDom_get_result(PyObject *obj, void *closure)
17921 : {
17922 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(obj);
17923 0 : PyObject *py_result;
17924 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17925 0 : return py_result;
17926 : }
17927 :
17928 0 : static int py_lsa_EnumTrustDom_set_result(PyObject *py_obj, PyObject *value, void *closure)
17929 : {
17930 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
17931 0 : if (value == NULL) {
17932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17933 0 : return -1;
17934 : }
17935 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17936 0 : return 0;
17937 : }
17938 :
17939 : static PyGetSetDef py_lsa_EnumTrustDom_getsetters[] = {
17940 : {
17941 : .name = discard_const_p(char, "in_handle"),
17942 : .get = py_lsa_EnumTrustDom_in_get_handle,
17943 : .set = py_lsa_EnumTrustDom_in_set_handle,
17944 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17945 : },
17946 : {
17947 : .name = discard_const_p(char, "in_resume_handle"),
17948 : .get = py_lsa_EnumTrustDom_in_get_resume_handle,
17949 : .set = py_lsa_EnumTrustDom_in_set_resume_handle,
17950 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17951 : },
17952 : {
17953 : .name = discard_const_p(char, "out_resume_handle"),
17954 : .get = py_lsa_EnumTrustDom_out_get_resume_handle,
17955 : .set = py_lsa_EnumTrustDom_out_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_domains"),
17960 : .get = py_lsa_EnumTrustDom_out_get_domains,
17961 : .set = py_lsa_EnumTrustDom_out_set_domains,
17962 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainList")
17963 : },
17964 : {
17965 : .name = discard_const_p(char, "in_max_size"),
17966 : .get = py_lsa_EnumTrustDom_in_get_max_size,
17967 : .set = py_lsa_EnumTrustDom_in_set_max_size,
17968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
17969 : },
17970 : {
17971 : .name = discard_const_p(char, "result"),
17972 : .get = py_lsa_EnumTrustDom_get_result,
17973 : .set = py_lsa_EnumTrustDom_set_result,
17974 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17975 : },
17976 : { .name = NULL }
17977 : };
17978 :
17979 0 : static PyObject *py_lsa_EnumTrustDom_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17980 : {
17981 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustDom, type);
17982 0 : struct lsa_EnumTrustDom *_self = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(self);
17983 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17984 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17985 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
17986 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
17987 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainList);
17988 0 : return self;
17989 : }
17990 :
17991 0 : static PyObject *py_lsa_EnumTrustDom_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17992 : {
17993 :
17994 :
17995 0 : return PyLong_FromLong(13);
17996 : }
17997 :
17998 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17999 : {
18000 0 : const struct ndr_interface_call *call = NULL;
18001 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18002 0 : PyObject *ret = NULL;
18003 0 : struct ndr_push *push = NULL;
18004 0 : DATA_BLOB blob;
18005 0 : enum ndr_err_code err;
18006 :
18007 0 : if (ndr_table_lsarpc.num_calls < 14) {
18008 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_pack");
18009 0 : return NULL;
18010 : }
18011 0 : call = &ndr_table_lsarpc.calls[13];
18012 :
18013 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18014 0 : if (push == NULL) {
18015 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18016 0 : return NULL;
18017 : }
18018 :
18019 0 : push->flags |= ndr_push_flags;
18020 :
18021 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18022 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18023 0 : TALLOC_FREE(push);
18024 0 : PyErr_SetNdrError(err);
18025 0 : return NULL;
18026 : }
18027 0 : blob = ndr_push_blob(push);
18028 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18029 0 : TALLOC_FREE(push);
18030 0 : return ret;
18031 : }
18032 :
18033 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18034 : {
18035 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18036 0 : PyObject *bigendian_obj = NULL;
18037 0 : PyObject *ndr64_obj = NULL;
18038 0 : libndr_flags ndr_push_flags = 0;
18039 :
18040 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18041 : discard_const_p(char *, kwnames),
18042 : &bigendian_obj,
18043 : &ndr64_obj)) {
18044 0 : return NULL;
18045 : }
18046 :
18047 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18048 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18049 : }
18050 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18051 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18052 : }
18053 :
18054 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18055 : }
18056 :
18057 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18058 : {
18059 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18060 0 : PyObject *bigendian_obj = NULL;
18061 0 : PyObject *ndr64_obj = NULL;
18062 0 : libndr_flags ndr_push_flags = 0;
18063 :
18064 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18065 : discard_const_p(char *, kwnames),
18066 : &bigendian_obj,
18067 : &ndr64_obj)) {
18068 0 : return NULL;
18069 : }
18070 :
18071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18072 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18073 : }
18074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18075 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18076 : }
18077 :
18078 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18079 : }
18080 :
18081 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18082 : {
18083 0 : const struct ndr_interface_call *call = NULL;
18084 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18085 0 : struct ndr_pull *pull = NULL;
18086 0 : enum ndr_err_code err;
18087 :
18088 0 : if (ndr_table_lsarpc.num_calls < 14) {
18089 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_unpack");
18090 0 : return NULL;
18091 : }
18092 0 : call = &ndr_table_lsarpc.calls[13];
18093 :
18094 0 : pull = ndr_pull_init_blob(blob, object);
18095 0 : if (pull == NULL) {
18096 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18097 0 : return NULL;
18098 : }
18099 :
18100 0 : pull->flags |= ndr_pull_flags;
18101 :
18102 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18103 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18104 0 : TALLOC_FREE(pull);
18105 0 : PyErr_SetNdrError(err);
18106 0 : return NULL;
18107 : }
18108 0 : if (!allow_remaining) {
18109 0 : uint32_t highest_ofs;
18110 :
18111 0 : if (pull->offset > pull->relative_highest_offset) {
18112 0 : highest_ofs = pull->offset;
18113 : } else {
18114 0 : highest_ofs = pull->relative_highest_offset;
18115 : }
18116 0 : if (highest_ofs < pull->data_size) {
18117 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18118 : "not all bytes consumed ofs[%u] size[%u]",
18119 : highest_ofs, pull->data_size);
18120 0 : TALLOC_FREE(pull);
18121 0 : PyErr_SetNdrError(err);
18122 0 : return NULL;
18123 : }
18124 : }
18125 :
18126 0 : TALLOC_FREE(pull);
18127 0 : Py_RETURN_NONE;
18128 : }
18129 :
18130 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18131 : {
18132 0 : DATA_BLOB blob;
18133 0 : Py_ssize_t blob_length = 0;
18134 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18135 0 : PyObject *bigendian_obj = NULL;
18136 0 : PyObject *ndr64_obj = NULL;
18137 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18138 0 : PyObject *allow_remaining_obj = NULL;
18139 0 : bool allow_remaining = false;
18140 :
18141 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18142 : discard_const_p(char *, kwnames),
18143 : &blob.data, &blob_length,
18144 : &bigendian_obj,
18145 : &ndr64_obj,
18146 : &allow_remaining_obj)) {
18147 0 : return NULL;
18148 : }
18149 0 : blob.length = blob_length;
18150 :
18151 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18152 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18153 : }
18154 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18155 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18156 : }
18157 :
18158 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18159 0 : allow_remaining = true;
18160 : }
18161 :
18162 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18163 : }
18164 :
18165 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18166 : {
18167 0 : DATA_BLOB blob;
18168 0 : Py_ssize_t blob_length = 0;
18169 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18170 0 : PyObject *bigendian_obj = NULL;
18171 0 : PyObject *ndr64_obj = NULL;
18172 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18173 0 : PyObject *allow_remaining_obj = NULL;
18174 0 : bool allow_remaining = false;
18175 :
18176 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18177 : discard_const_p(char *, kwnames),
18178 : &blob.data, &blob_length,
18179 : &bigendian_obj,
18180 : &ndr64_obj,
18181 : &allow_remaining_obj)) {
18182 0 : return NULL;
18183 : }
18184 0 : blob.length = blob_length;
18185 :
18186 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18187 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18188 : }
18189 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18190 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18191 : }
18192 :
18193 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18194 0 : allow_remaining = true;
18195 : }
18196 :
18197 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18198 : }
18199 :
18200 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18201 : {
18202 0 : const struct ndr_interface_call *call = NULL;
18203 0 : struct lsa_EnumTrustDom *object = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(py_obj);
18204 0 : PyObject *ret;
18205 0 : char *retstr;
18206 :
18207 0 : if (ndr_table_lsarpc.num_calls < 14) {
18208 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_print");
18209 0 : return NULL;
18210 : }
18211 0 : call = &ndr_table_lsarpc.calls[13];
18212 :
18213 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18214 0 : ret = PyUnicode_FromString(retstr);
18215 0 : TALLOC_FREE(retstr);
18216 :
18217 0 : return ret;
18218 : }
18219 :
18220 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18221 : {
18222 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_in", NDR_IN);
18223 : }
18224 :
18225 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18226 : {
18227 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_out", NDR_OUT);
18228 : }
18229 :
18230 : static PyMethodDef py_lsa_EnumTrustDom_methods[] = {
18231 : { "opnum", (PyCFunction)py_lsa_EnumTrustDom_ndr_opnum, METH_NOARGS|METH_CLASS,
18232 : "lsa.EnumTrustDom.opnum() -> 13 (0x0d) " },
18233 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18234 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18235 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18236 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18237 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18238 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18239 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18240 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18241 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18242 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18243 : { NULL, NULL, 0, NULL }
18244 : };
18245 :
18246 :
18247 : static PyTypeObject lsa_EnumTrustDom_Type = {
18248 : PyVarObject_HEAD_INIT(NULL, 0)
18249 : .tp_name = "lsa.EnumTrustDom",
18250 : .tp_getset = py_lsa_EnumTrustDom_getsetters,
18251 : .tp_methods = py_lsa_EnumTrustDom_methods,
18252 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18253 : .tp_new = py_lsa_EnumTrustDom_new,
18254 : };
18255 :
18256 0 : static bool pack_py_lsa_EnumTrustDom_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustDom *r)
18257 : {
18258 0 : PyObject *py_handle;
18259 0 : PyObject *py_resume_handle;
18260 0 : PyObject *py_max_size;
18261 0 : const char *kwnames[] = {
18262 : "handle", "resume_handle", "max_size", NULL
18263 : };
18264 :
18265 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustDom", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
18266 0 : return false;
18267 : }
18268 :
18269 0 : if (py_handle == NULL) {
18270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
18271 0 : return false;
18272 : }
18273 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
18274 0 : if (r->in.handle == NULL) {
18275 0 : PyErr_NoMemory();
18276 0 : return false;
18277 : }
18278 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
18279 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
18280 0 : PyErr_NoMemory();
18281 0 : return false;
18282 : }
18283 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
18284 0 : if (py_resume_handle == NULL) {
18285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
18286 0 : return false;
18287 : }
18288 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
18289 0 : if (r->in.resume_handle == NULL) {
18290 0 : PyErr_NoMemory();
18291 0 : return false;
18292 : }
18293 : {
18294 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
18295 0 : if (PyLong_Check(py_resume_handle)) {
18296 0 : unsigned long long test_var;
18297 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
18298 0 : if (PyErr_Occurred() != NULL) {
18299 0 : return false;
18300 : }
18301 0 : if (test_var > uint_max) {
18302 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18303 : PyLong_Type.tp_name, uint_max, test_var);
18304 0 : return false;
18305 : }
18306 0 : *r->in.resume_handle = test_var;
18307 : } else {
18308 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18309 : PyLong_Type.tp_name);
18310 0 : return false;
18311 : }
18312 : }
18313 0 : if (py_max_size == NULL) {
18314 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
18315 0 : return false;
18316 : }
18317 : {
18318 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
18319 0 : if (PyLong_Check(py_max_size)) {
18320 0 : unsigned long long test_var;
18321 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
18322 0 : if (PyErr_Occurred() != NULL) {
18323 0 : return false;
18324 : }
18325 0 : if (test_var > uint_max) {
18326 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18327 : PyLong_Type.tp_name, uint_max, test_var);
18328 0 : return false;
18329 : }
18330 0 : r->in.max_size = test_var;
18331 : } else {
18332 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18333 : PyLong_Type.tp_name);
18334 0 : return false;
18335 : }
18336 : }
18337 0 : return true;
18338 : }
18339 :
18340 0 : static PyObject *unpack_py_lsa_EnumTrustDom_args_out(struct lsa_EnumTrustDom *r)
18341 : {
18342 0 : PyObject *result;
18343 0 : PyObject *py_resume_handle;
18344 0 : PyObject *py_domains;
18345 0 : result = PyTuple_New(2);
18346 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
18347 0 : PyTuple_SetItem(result, 0, py_resume_handle);
18348 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, r->out.domains, r->out.domains);
18349 0 : PyTuple_SetItem(result, 1, py_domains);
18350 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18351 0 : PyErr_SetNTSTATUS(r->out.result);
18352 0 : return NULL;
18353 : }
18354 :
18355 0 : return result;
18356 : }
18357 :
18358 :
18359 0 : static PyObject *py_lsa_LookupNames_in_get_handle(PyObject *obj, void *closure)
18360 : {
18361 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18362 0 : PyObject *py_handle;
18363 0 : if (object->in.handle == NULL) {
18364 0 : Py_RETURN_NONE;
18365 : }
18366 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18367 0 : return py_handle;
18368 : }
18369 :
18370 0 : static int py_lsa_LookupNames_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18371 : {
18372 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18373 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18374 0 : if (value == NULL) {
18375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
18376 0 : return -1;
18377 : }
18378 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
18379 0 : if (object->in.handle == NULL) {
18380 0 : PyErr_NoMemory();
18381 0 : return -1;
18382 : }
18383 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18384 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18385 0 : PyErr_NoMemory();
18386 0 : return -1;
18387 : }
18388 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
18389 0 : return 0;
18390 : }
18391 :
18392 0 : static PyObject *py_lsa_LookupNames_in_get_num_names(PyObject *obj, void *closure)
18393 : {
18394 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18395 0 : PyObject *py_num_names;
18396 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
18397 0 : return py_num_names;
18398 : }
18399 :
18400 0 : static int py_lsa_LookupNames_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
18401 : {
18402 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18403 0 : if (value == NULL) {
18404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
18405 0 : return -1;
18406 : }
18407 : {
18408 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
18409 0 : if (PyLong_Check(value)) {
18410 0 : unsigned long long test_var;
18411 0 : test_var = PyLong_AsUnsignedLongLong(value);
18412 0 : if (PyErr_Occurred() != NULL) {
18413 0 : return -1;
18414 : }
18415 0 : if (test_var > uint_max) {
18416 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18417 : PyLong_Type.tp_name, uint_max, test_var);
18418 0 : return -1;
18419 : }
18420 0 : object->in.num_names = test_var;
18421 : } else {
18422 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18423 : PyLong_Type.tp_name);
18424 0 : return -1;
18425 : }
18426 : }
18427 0 : return 0;
18428 : }
18429 :
18430 0 : static PyObject *py_lsa_LookupNames_in_get_names(PyObject *obj, void *closure)
18431 : {
18432 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18433 0 : PyObject *py_names;
18434 0 : py_names = PyList_New(object->in.num_names);
18435 0 : if (py_names == NULL) {
18436 0 : return NULL;
18437 : }
18438 : {
18439 : int names_cntr_0;
18440 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
18441 0 : PyObject *py_names_0;
18442 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
18443 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
18444 : }
18445 : }
18446 0 : return py_names;
18447 : }
18448 :
18449 0 : static int py_lsa_LookupNames_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
18450 : {
18451 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18452 0 : if (value == NULL) {
18453 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
18454 0 : return -1;
18455 : }
18456 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
18457 : {
18458 0 : int names_cntr_0;
18459 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
18460 0 : if (!object->in.names) { return -1; }
18461 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
18462 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
18463 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
18464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
18465 0 : return -1;
18466 : }
18467 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
18468 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
18469 0 : PyErr_NoMemory();
18470 0 : return -1;
18471 : }
18472 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
18473 : }
18474 : }
18475 0 : return 0;
18476 : }
18477 :
18478 0 : static PyObject *py_lsa_LookupNames_out_get_domains(PyObject *obj, void *closure)
18479 : {
18480 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18481 0 : PyObject *py_domains;
18482 0 : if (object->out.domains == NULL) {
18483 0 : Py_RETURN_NONE;
18484 : }
18485 0 : if (*object->out.domains == NULL) {
18486 0 : py_domains = Py_None;
18487 0 : Py_INCREF(py_domains);
18488 : } else {
18489 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
18490 : }
18491 0 : return py_domains;
18492 : }
18493 :
18494 0 : static int py_lsa_LookupNames_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
18495 : {
18496 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18497 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
18498 0 : if (value == NULL) {
18499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
18500 0 : return -1;
18501 : }
18502 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
18503 0 : if (object->out.domains == NULL) {
18504 0 : PyErr_NoMemory();
18505 0 : return -1;
18506 : }
18507 0 : if (value == Py_None) {
18508 0 : *object->out.domains = NULL;
18509 : } else {
18510 0 : *object->out.domains = NULL;
18511 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
18512 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18513 0 : PyErr_NoMemory();
18514 0 : return -1;
18515 : }
18516 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
18517 : }
18518 0 : return 0;
18519 : }
18520 :
18521 0 : static PyObject *py_lsa_LookupNames_in_get_sids(PyObject *obj, void *closure)
18522 : {
18523 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18524 0 : PyObject *py_sids;
18525 0 : if (object->in.sids == NULL) {
18526 0 : Py_RETURN_NONE;
18527 : }
18528 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->in.sids, object->in.sids);
18529 0 : return py_sids;
18530 : }
18531 :
18532 0 : static int py_lsa_LookupNames_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
18533 : {
18534 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18535 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
18536 0 : if (value == NULL) {
18537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
18538 0 : return -1;
18539 : }
18540 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
18541 0 : if (object->in.sids == NULL) {
18542 0 : PyErr_NoMemory();
18543 0 : return -1;
18544 : }
18545 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
18546 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18547 0 : PyErr_NoMemory();
18548 0 : return -1;
18549 : }
18550 0 : object->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
18551 0 : return 0;
18552 : }
18553 :
18554 0 : static PyObject *py_lsa_LookupNames_out_get_sids(PyObject *obj, void *closure)
18555 : {
18556 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18557 0 : PyObject *py_sids;
18558 0 : if (object->out.sids == NULL) {
18559 0 : Py_RETURN_NONE;
18560 : }
18561 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->out.sids, object->out.sids);
18562 0 : return py_sids;
18563 : }
18564 :
18565 0 : static int py_lsa_LookupNames_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
18566 : {
18567 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18568 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
18569 0 : if (value == NULL) {
18570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
18571 0 : return -1;
18572 : }
18573 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
18574 0 : if (object->out.sids == NULL) {
18575 0 : PyErr_NoMemory();
18576 0 : return -1;
18577 : }
18578 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
18579 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18580 0 : PyErr_NoMemory();
18581 0 : return -1;
18582 : }
18583 0 : object->out.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
18584 0 : return 0;
18585 : }
18586 :
18587 0 : static PyObject *py_lsa_LookupNames_in_get_level(PyObject *obj, void *closure)
18588 : {
18589 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18590 0 : PyObject *py_level;
18591 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
18592 0 : return py_level;
18593 : }
18594 :
18595 0 : static int py_lsa_LookupNames_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
18596 : {
18597 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18598 0 : if (value == NULL) {
18599 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
18600 0 : return -1;
18601 : }
18602 : {
18603 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
18604 0 : if (PyLong_Check(value)) {
18605 0 : unsigned long long test_var;
18606 0 : test_var = PyLong_AsUnsignedLongLong(value);
18607 0 : if (PyErr_Occurred() != NULL) {
18608 0 : return -1;
18609 : }
18610 0 : if (test_var > uint_max) {
18611 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18612 : PyLong_Type.tp_name, uint_max, test_var);
18613 0 : return -1;
18614 : }
18615 0 : object->in.level = test_var;
18616 : } else {
18617 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18618 : PyLong_Type.tp_name);
18619 0 : return -1;
18620 : }
18621 : }
18622 0 : return 0;
18623 : }
18624 :
18625 0 : static PyObject *py_lsa_LookupNames_in_get_count(PyObject *obj, void *closure)
18626 : {
18627 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18628 0 : PyObject *py_count;
18629 0 : if (object->in.count == NULL) {
18630 0 : Py_RETURN_NONE;
18631 : }
18632 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
18633 0 : return py_count;
18634 : }
18635 :
18636 0 : static int py_lsa_LookupNames_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
18637 : {
18638 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18639 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
18640 0 : if (value == NULL) {
18641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
18642 0 : return -1;
18643 : }
18644 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
18645 0 : if (object->in.count == NULL) {
18646 0 : PyErr_NoMemory();
18647 0 : return -1;
18648 : }
18649 : {
18650 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
18651 0 : if (PyLong_Check(value)) {
18652 0 : unsigned long long test_var;
18653 0 : test_var = PyLong_AsUnsignedLongLong(value);
18654 0 : if (PyErr_Occurred() != NULL) {
18655 0 : return -1;
18656 : }
18657 0 : if (test_var > uint_max) {
18658 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18659 : PyLong_Type.tp_name, uint_max, test_var);
18660 0 : return -1;
18661 : }
18662 0 : *object->in.count = test_var;
18663 : } else {
18664 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18665 : PyLong_Type.tp_name);
18666 0 : return -1;
18667 : }
18668 : }
18669 0 : return 0;
18670 : }
18671 :
18672 0 : static PyObject *py_lsa_LookupNames_out_get_count(PyObject *obj, void *closure)
18673 : {
18674 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18675 0 : PyObject *py_count;
18676 0 : if (object->out.count == NULL) {
18677 0 : Py_RETURN_NONE;
18678 : }
18679 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
18680 0 : return py_count;
18681 : }
18682 :
18683 0 : static int py_lsa_LookupNames_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
18684 : {
18685 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18686 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
18687 0 : if (value == NULL) {
18688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
18689 0 : return -1;
18690 : }
18691 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
18692 0 : if (object->out.count == NULL) {
18693 0 : PyErr_NoMemory();
18694 0 : return -1;
18695 : }
18696 : {
18697 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
18698 0 : if (PyLong_Check(value)) {
18699 0 : unsigned long long test_var;
18700 0 : test_var = PyLong_AsUnsignedLongLong(value);
18701 0 : if (PyErr_Occurred() != NULL) {
18702 0 : return -1;
18703 : }
18704 0 : if (test_var > uint_max) {
18705 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18706 : PyLong_Type.tp_name, uint_max, test_var);
18707 0 : return -1;
18708 : }
18709 0 : *object->out.count = test_var;
18710 : } else {
18711 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18712 : PyLong_Type.tp_name);
18713 0 : return -1;
18714 : }
18715 : }
18716 0 : return 0;
18717 : }
18718 :
18719 0 : static PyObject *py_lsa_LookupNames_get_result(PyObject *obj, void *closure)
18720 : {
18721 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(obj);
18722 0 : PyObject *py_result;
18723 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18724 0 : return py_result;
18725 : }
18726 :
18727 0 : static int py_lsa_LookupNames_set_result(PyObject *py_obj, PyObject *value, void *closure)
18728 : {
18729 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18730 0 : if (value == NULL) {
18731 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18732 0 : return -1;
18733 : }
18734 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18735 0 : return 0;
18736 : }
18737 :
18738 : static PyGetSetDef py_lsa_LookupNames_getsetters[] = {
18739 : {
18740 : .name = discard_const_p(char, "in_handle"),
18741 : .get = py_lsa_LookupNames_in_get_handle,
18742 : .set = py_lsa_LookupNames_in_set_handle,
18743 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18744 : },
18745 : {
18746 : .name = discard_const_p(char, "in_num_names"),
18747 : .get = py_lsa_LookupNames_in_get_num_names,
18748 : .set = py_lsa_LookupNames_in_set_num_names,
18749 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18750 : },
18751 : {
18752 : .name = discard_const_p(char, "in_names"),
18753 : .get = py_lsa_LookupNames_in_get_names,
18754 : .set = py_lsa_LookupNames_in_set_names,
18755 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
18756 : },
18757 : {
18758 : .name = discard_const_p(char, "out_domains"),
18759 : .get = py_lsa_LookupNames_out_get_domains,
18760 : .set = py_lsa_LookupNames_out_set_domains,
18761 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
18762 : },
18763 : {
18764 : .name = discard_const_p(char, "in_sids"),
18765 : .get = py_lsa_LookupNames_in_get_sids,
18766 : .set = py_lsa_LookupNames_in_set_sids,
18767 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
18768 : },
18769 : {
18770 : .name = discard_const_p(char, "out_sids"),
18771 : .get = py_lsa_LookupNames_out_get_sids,
18772 : .set = py_lsa_LookupNames_out_set_sids,
18773 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
18774 : },
18775 : {
18776 : .name = discard_const_p(char, "in_level"),
18777 : .get = py_lsa_LookupNames_in_get_level,
18778 : .set = py_lsa_LookupNames_in_set_level,
18779 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
18780 : },
18781 : {
18782 : .name = discard_const_p(char, "in_count"),
18783 : .get = py_lsa_LookupNames_in_get_count,
18784 : .set = py_lsa_LookupNames_in_set_count,
18785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18786 : },
18787 : {
18788 : .name = discard_const_p(char, "out_count"),
18789 : .get = py_lsa_LookupNames_out_get_count,
18790 : .set = py_lsa_LookupNames_out_set_count,
18791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18792 : },
18793 : {
18794 : .name = discard_const_p(char, "result"),
18795 : .get = py_lsa_LookupNames_get_result,
18796 : .set = py_lsa_LookupNames_set_result,
18797 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18798 : },
18799 : { .name = NULL }
18800 : };
18801 :
18802 0 : static PyObject *py_lsa_LookupNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18803 : {
18804 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames, type);
18805 0 : struct lsa_LookupNames *_self = (struct lsa_LookupNames *)pytalloc_get_ptr(self);
18806 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18807 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
18808 : /* a pointer to a NULL pointer */
18809 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
18810 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
18811 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
18812 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
18813 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
18814 0 : return self;
18815 : }
18816 :
18817 0 : static PyObject *py_lsa_LookupNames_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18818 : {
18819 :
18820 :
18821 0 : return PyLong_FromLong(14);
18822 : }
18823 :
18824 0 : static PyObject *py_lsa_LookupNames_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18825 : {
18826 0 : const struct ndr_interface_call *call = NULL;
18827 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18828 0 : PyObject *ret = NULL;
18829 0 : struct ndr_push *push = NULL;
18830 0 : DATA_BLOB blob;
18831 0 : enum ndr_err_code err;
18832 :
18833 0 : if (ndr_table_lsarpc.num_calls < 15) {
18834 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_pack");
18835 0 : return NULL;
18836 : }
18837 0 : call = &ndr_table_lsarpc.calls[14];
18838 :
18839 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18840 0 : if (push == NULL) {
18841 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18842 0 : return NULL;
18843 : }
18844 :
18845 0 : push->flags |= ndr_push_flags;
18846 :
18847 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18848 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18849 0 : TALLOC_FREE(push);
18850 0 : PyErr_SetNdrError(err);
18851 0 : return NULL;
18852 : }
18853 0 : blob = ndr_push_blob(push);
18854 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18855 0 : TALLOC_FREE(push);
18856 0 : return ret;
18857 : }
18858 :
18859 0 : static PyObject *py_lsa_LookupNames_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18860 : {
18861 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18862 0 : PyObject *bigendian_obj = NULL;
18863 0 : PyObject *ndr64_obj = NULL;
18864 0 : libndr_flags ndr_push_flags = 0;
18865 :
18866 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18867 : discard_const_p(char *, kwnames),
18868 : &bigendian_obj,
18869 : &ndr64_obj)) {
18870 0 : return NULL;
18871 : }
18872 :
18873 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18874 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18875 : }
18876 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18877 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18878 : }
18879 :
18880 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18881 : }
18882 :
18883 0 : static PyObject *py_lsa_LookupNames_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18884 : {
18885 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18886 0 : PyObject *bigendian_obj = NULL;
18887 0 : PyObject *ndr64_obj = NULL;
18888 0 : libndr_flags ndr_push_flags = 0;
18889 :
18890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18891 : discard_const_p(char *, kwnames),
18892 : &bigendian_obj,
18893 : &ndr64_obj)) {
18894 0 : return NULL;
18895 : }
18896 :
18897 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18898 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18899 : }
18900 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18901 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18902 : }
18903 :
18904 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18905 : }
18906 :
18907 0 : static PyObject *py_lsa_LookupNames_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18908 : {
18909 0 : const struct ndr_interface_call *call = NULL;
18910 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
18911 0 : struct ndr_pull *pull = NULL;
18912 0 : enum ndr_err_code err;
18913 :
18914 0 : if (ndr_table_lsarpc.num_calls < 15) {
18915 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_unpack");
18916 0 : return NULL;
18917 : }
18918 0 : call = &ndr_table_lsarpc.calls[14];
18919 :
18920 0 : pull = ndr_pull_init_blob(blob, object);
18921 0 : if (pull == NULL) {
18922 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18923 0 : return NULL;
18924 : }
18925 :
18926 0 : pull->flags |= ndr_pull_flags;
18927 :
18928 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18929 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18930 0 : TALLOC_FREE(pull);
18931 0 : PyErr_SetNdrError(err);
18932 0 : return NULL;
18933 : }
18934 0 : if (!allow_remaining) {
18935 0 : uint32_t highest_ofs;
18936 :
18937 0 : if (pull->offset > pull->relative_highest_offset) {
18938 0 : highest_ofs = pull->offset;
18939 : } else {
18940 0 : highest_ofs = pull->relative_highest_offset;
18941 : }
18942 0 : if (highest_ofs < pull->data_size) {
18943 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18944 : "not all bytes consumed ofs[%u] size[%u]",
18945 : highest_ofs, pull->data_size);
18946 0 : TALLOC_FREE(pull);
18947 0 : PyErr_SetNdrError(err);
18948 0 : return NULL;
18949 : }
18950 : }
18951 :
18952 0 : TALLOC_FREE(pull);
18953 0 : Py_RETURN_NONE;
18954 : }
18955 :
18956 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18957 : {
18958 0 : DATA_BLOB blob;
18959 0 : Py_ssize_t blob_length = 0;
18960 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18961 0 : PyObject *bigendian_obj = NULL;
18962 0 : PyObject *ndr64_obj = NULL;
18963 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18964 0 : PyObject *allow_remaining_obj = NULL;
18965 0 : bool allow_remaining = false;
18966 :
18967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18968 : discard_const_p(char *, kwnames),
18969 : &blob.data, &blob_length,
18970 : &bigendian_obj,
18971 : &ndr64_obj,
18972 : &allow_remaining_obj)) {
18973 0 : return NULL;
18974 : }
18975 0 : blob.length = blob_length;
18976 :
18977 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18978 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18979 : }
18980 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18981 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18982 : }
18983 :
18984 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18985 0 : allow_remaining = true;
18986 : }
18987 :
18988 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18989 : }
18990 :
18991 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18992 : {
18993 0 : DATA_BLOB blob;
18994 0 : Py_ssize_t blob_length = 0;
18995 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18996 0 : PyObject *bigendian_obj = NULL;
18997 0 : PyObject *ndr64_obj = NULL;
18998 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18999 0 : PyObject *allow_remaining_obj = NULL;
19000 0 : bool allow_remaining = false;
19001 :
19002 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19003 : discard_const_p(char *, kwnames),
19004 : &blob.data, &blob_length,
19005 : &bigendian_obj,
19006 : &ndr64_obj,
19007 : &allow_remaining_obj)) {
19008 0 : return NULL;
19009 : }
19010 0 : blob.length = blob_length;
19011 :
19012 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19013 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19014 : }
19015 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19016 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19017 : }
19018 :
19019 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19020 0 : allow_remaining = true;
19021 : }
19022 :
19023 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19024 : }
19025 :
19026 0 : static PyObject *py_lsa_LookupNames_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19027 : {
19028 0 : const struct ndr_interface_call *call = NULL;
19029 0 : struct lsa_LookupNames *object = (struct lsa_LookupNames *)pytalloc_get_ptr(py_obj);
19030 0 : PyObject *ret;
19031 0 : char *retstr;
19032 :
19033 0 : if (ndr_table_lsarpc.num_calls < 15) {
19034 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_print");
19035 0 : return NULL;
19036 : }
19037 0 : call = &ndr_table_lsarpc.calls[14];
19038 :
19039 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19040 0 : ret = PyUnicode_FromString(retstr);
19041 0 : TALLOC_FREE(retstr);
19042 :
19043 0 : return ret;
19044 : }
19045 :
19046 0 : static PyObject *py_lsa_LookupNames_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19047 : {
19048 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_in", NDR_IN);
19049 : }
19050 :
19051 0 : static PyObject *py_lsa_LookupNames_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19052 : {
19053 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_out", NDR_OUT);
19054 : }
19055 :
19056 : static PyMethodDef py_lsa_LookupNames_methods[] = {
19057 : { "opnum", (PyCFunction)py_lsa_LookupNames_ndr_opnum, METH_NOARGS|METH_CLASS,
19058 : "lsa.LookupNames.opnum() -> 14 (0x0e) " },
19059 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19060 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19061 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19062 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19063 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19064 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19065 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19066 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19067 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19068 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19069 : { NULL, NULL, 0, NULL }
19070 : };
19071 :
19072 :
19073 : static PyTypeObject lsa_LookupNames_Type = {
19074 : PyVarObject_HEAD_INIT(NULL, 0)
19075 : .tp_name = "lsa.LookupNames",
19076 : .tp_getset = py_lsa_LookupNames_getsetters,
19077 : .tp_methods = py_lsa_LookupNames_methods,
19078 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19079 : .tp_new = py_lsa_LookupNames_new,
19080 : };
19081 :
19082 1 : static bool pack_py_lsa_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames *r)
19083 : {
19084 0 : PyObject *py_handle;
19085 0 : PyObject *py_names;
19086 0 : PyObject *py_sids;
19087 0 : PyObject *py_level;
19088 0 : PyObject *py_count;
19089 1 : const char *kwnames[] = {
19090 : "handle", "names", "sids", "level", "count", NULL
19091 : };
19092 :
19093 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupNames", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count)) {
19094 0 : return false;
19095 : }
19096 :
19097 1 : if (py_handle == NULL) {
19098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19099 0 : return false;
19100 : }
19101 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19102 1 : if (r->in.handle == NULL) {
19103 0 : PyErr_NoMemory();
19104 0 : return false;
19105 : }
19106 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19107 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19108 0 : PyErr_NoMemory();
19109 0 : return false;
19110 : }
19111 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19112 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
19113 1 : r->in.num_names = PyList_GET_SIZE(py_names);
19114 1 : if (py_names == NULL) {
19115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
19116 0 : return false;
19117 : }
19118 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
19119 : {
19120 0 : int names_cntr_0;
19121 1 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
19122 1 : if (!r->in.names) { return false; }
19123 1 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
19124 3 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
19125 2 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
19126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
19127 0 : return false;
19128 : }
19129 2 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
19130 2 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
19131 0 : PyErr_NoMemory();
19132 0 : return false;
19133 : }
19134 2 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
19135 : }
19136 : }
19137 1 : if (py_sids == NULL) {
19138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
19139 0 : return false;
19140 : }
19141 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
19142 1 : if (r->in.sids == NULL) {
19143 0 : PyErr_NoMemory();
19144 0 : return false;
19145 : }
19146 1 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, py_sids, return false;);
19147 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
19148 0 : PyErr_NoMemory();
19149 0 : return false;
19150 : }
19151 1 : r->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_sids);
19152 1 : if (py_level == NULL) {
19153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
19154 0 : return false;
19155 : }
19156 : {
19157 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
19158 1 : if (PyLong_Check(py_level)) {
19159 0 : unsigned long long test_var;
19160 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
19161 1 : if (PyErr_Occurred() != NULL) {
19162 0 : return false;
19163 : }
19164 1 : if (test_var > uint_max) {
19165 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19166 : PyLong_Type.tp_name, uint_max, test_var);
19167 0 : return false;
19168 : }
19169 1 : r->in.level = test_var;
19170 : } else {
19171 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19172 : PyLong_Type.tp_name);
19173 0 : return false;
19174 : }
19175 : }
19176 1 : if (py_count == NULL) {
19177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
19178 0 : return false;
19179 : }
19180 1 : r->in.count = talloc_ptrtype(r, r->in.count);
19181 1 : if (r->in.count == NULL) {
19182 0 : PyErr_NoMemory();
19183 0 : return false;
19184 : }
19185 : {
19186 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
19187 1 : if (PyLong_Check(py_count)) {
19188 0 : unsigned long long test_var;
19189 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
19190 1 : if (PyErr_Occurred() != NULL) {
19191 0 : return false;
19192 : }
19193 1 : if (test_var > uint_max) {
19194 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19195 : PyLong_Type.tp_name, uint_max, test_var);
19196 0 : return false;
19197 : }
19198 1 : *r->in.count = test_var;
19199 : } else {
19200 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19201 : PyLong_Type.tp_name);
19202 0 : return false;
19203 : }
19204 : }
19205 1 : return true;
19206 : }
19207 :
19208 1 : static PyObject *unpack_py_lsa_LookupNames_args_out(struct lsa_LookupNames *r)
19209 : {
19210 0 : PyObject *result;
19211 0 : PyObject *py_domains;
19212 0 : PyObject *py_sids;
19213 0 : PyObject *py_count;
19214 1 : result = PyTuple_New(3);
19215 1 : if (*r->out.domains == NULL) {
19216 0 : py_domains = Py_None;
19217 0 : Py_INCREF(py_domains);
19218 : } else {
19219 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
19220 : }
19221 1 : PyTuple_SetItem(result, 0, py_domains);
19222 1 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, r->out.sids, r->out.sids);
19223 1 : PyTuple_SetItem(result, 1, py_sids);
19224 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
19225 1 : PyTuple_SetItem(result, 2, py_count);
19226 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
19227 0 : PyErr_SetNTSTATUS(r->out.result);
19228 0 : return NULL;
19229 : }
19230 :
19231 1 : return result;
19232 : }
19233 :
19234 :
19235 0 : static PyObject *py_lsa_LookupSids_in_get_handle(PyObject *obj, void *closure)
19236 : {
19237 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19238 0 : PyObject *py_handle;
19239 0 : if (object->in.handle == NULL) {
19240 0 : Py_RETURN_NONE;
19241 : }
19242 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
19243 0 : return py_handle;
19244 : }
19245 :
19246 0 : static int py_lsa_LookupSids_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
19247 : {
19248 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19249 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
19250 0 : if (value == NULL) {
19251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
19252 0 : return -1;
19253 : }
19254 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
19255 0 : if (object->in.handle == NULL) {
19256 0 : PyErr_NoMemory();
19257 0 : return -1;
19258 : }
19259 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19260 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19261 0 : PyErr_NoMemory();
19262 0 : return -1;
19263 : }
19264 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
19265 0 : return 0;
19266 : }
19267 :
19268 0 : static PyObject *py_lsa_LookupSids_in_get_sids(PyObject *obj, void *closure)
19269 : {
19270 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19271 0 : PyObject *py_sids;
19272 0 : if (object->in.sids == NULL) {
19273 0 : Py_RETURN_NONE;
19274 : }
19275 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
19276 0 : return py_sids;
19277 : }
19278 :
19279 0 : static int py_lsa_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
19280 : {
19281 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19282 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
19283 0 : if (value == NULL) {
19284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
19285 0 : return -1;
19286 : }
19287 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
19288 0 : if (object->in.sids == NULL) {
19289 0 : PyErr_NoMemory();
19290 0 : return -1;
19291 : }
19292 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
19293 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19294 0 : PyErr_NoMemory();
19295 0 : return -1;
19296 : }
19297 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
19298 0 : return 0;
19299 : }
19300 :
19301 0 : static PyObject *py_lsa_LookupSids_out_get_domains(PyObject *obj, void *closure)
19302 : {
19303 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19304 0 : PyObject *py_domains;
19305 0 : if (object->out.domains == NULL) {
19306 0 : Py_RETURN_NONE;
19307 : }
19308 0 : if (*object->out.domains == NULL) {
19309 0 : py_domains = Py_None;
19310 0 : Py_INCREF(py_domains);
19311 : } else {
19312 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
19313 : }
19314 0 : return py_domains;
19315 : }
19316 :
19317 0 : static int py_lsa_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
19318 : {
19319 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19320 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
19321 0 : if (value == NULL) {
19322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
19323 0 : return -1;
19324 : }
19325 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
19326 0 : if (object->out.domains == NULL) {
19327 0 : PyErr_NoMemory();
19328 0 : return -1;
19329 : }
19330 0 : if (value == Py_None) {
19331 0 : *object->out.domains = NULL;
19332 : } else {
19333 0 : *object->out.domains = NULL;
19334 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
19335 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19336 0 : PyErr_NoMemory();
19337 0 : return -1;
19338 : }
19339 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
19340 : }
19341 0 : return 0;
19342 : }
19343 :
19344 0 : static PyObject *py_lsa_LookupSids_in_get_names(PyObject *obj, void *closure)
19345 : {
19346 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19347 0 : PyObject *py_names;
19348 0 : if (object->in.names == NULL) {
19349 0 : Py_RETURN_NONE;
19350 : }
19351 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->in.names, object->in.names);
19352 0 : return py_names;
19353 : }
19354 :
19355 0 : static int py_lsa_LookupSids_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
19356 : {
19357 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19358 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
19359 0 : if (value == NULL) {
19360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
19361 0 : return -1;
19362 : }
19363 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
19364 0 : if (object->in.names == NULL) {
19365 0 : PyErr_NoMemory();
19366 0 : return -1;
19367 : }
19368 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
19369 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19370 0 : PyErr_NoMemory();
19371 0 : return -1;
19372 : }
19373 0 : object->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
19374 0 : return 0;
19375 : }
19376 :
19377 0 : static PyObject *py_lsa_LookupSids_out_get_names(PyObject *obj, void *closure)
19378 : {
19379 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19380 0 : PyObject *py_names;
19381 0 : if (object->out.names == NULL) {
19382 0 : Py_RETURN_NONE;
19383 : }
19384 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->out.names, object->out.names);
19385 0 : return py_names;
19386 : }
19387 :
19388 0 : static int py_lsa_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
19389 : {
19390 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19391 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
19392 0 : if (value == NULL) {
19393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
19394 0 : return -1;
19395 : }
19396 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
19397 0 : if (object->out.names == NULL) {
19398 0 : PyErr_NoMemory();
19399 0 : return -1;
19400 : }
19401 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
19402 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19403 0 : PyErr_NoMemory();
19404 0 : return -1;
19405 : }
19406 0 : object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
19407 0 : return 0;
19408 : }
19409 :
19410 0 : static PyObject *py_lsa_LookupSids_in_get_level(PyObject *obj, void *closure)
19411 : {
19412 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19413 0 : PyObject *py_level;
19414 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
19415 0 : return py_level;
19416 : }
19417 :
19418 0 : static int py_lsa_LookupSids_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
19419 : {
19420 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19421 0 : if (value == NULL) {
19422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
19423 0 : return -1;
19424 : }
19425 : {
19426 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
19427 0 : if (PyLong_Check(value)) {
19428 0 : unsigned long long test_var;
19429 0 : test_var = PyLong_AsUnsignedLongLong(value);
19430 0 : if (PyErr_Occurred() != NULL) {
19431 0 : return -1;
19432 : }
19433 0 : if (test_var > uint_max) {
19434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19435 : PyLong_Type.tp_name, uint_max, test_var);
19436 0 : return -1;
19437 : }
19438 0 : object->in.level = test_var;
19439 : } else {
19440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19441 : PyLong_Type.tp_name);
19442 0 : return -1;
19443 : }
19444 : }
19445 0 : return 0;
19446 : }
19447 :
19448 0 : static PyObject *py_lsa_LookupSids_in_get_count(PyObject *obj, void *closure)
19449 : {
19450 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19451 0 : PyObject *py_count;
19452 0 : if (object->in.count == NULL) {
19453 0 : Py_RETURN_NONE;
19454 : }
19455 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
19456 0 : return py_count;
19457 : }
19458 :
19459 0 : static int py_lsa_LookupSids_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
19460 : {
19461 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19462 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
19463 0 : if (value == NULL) {
19464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
19465 0 : return -1;
19466 : }
19467 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
19468 0 : if (object->in.count == NULL) {
19469 0 : PyErr_NoMemory();
19470 0 : return -1;
19471 : }
19472 : {
19473 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
19474 0 : if (PyLong_Check(value)) {
19475 0 : unsigned long long test_var;
19476 0 : test_var = PyLong_AsUnsignedLongLong(value);
19477 0 : if (PyErr_Occurred() != NULL) {
19478 0 : return -1;
19479 : }
19480 0 : if (test_var > uint_max) {
19481 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19482 : PyLong_Type.tp_name, uint_max, test_var);
19483 0 : return -1;
19484 : }
19485 0 : *object->in.count = test_var;
19486 : } else {
19487 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19488 : PyLong_Type.tp_name);
19489 0 : return -1;
19490 : }
19491 : }
19492 0 : return 0;
19493 : }
19494 :
19495 0 : static PyObject *py_lsa_LookupSids_out_get_count(PyObject *obj, void *closure)
19496 : {
19497 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19498 0 : PyObject *py_count;
19499 0 : if (object->out.count == NULL) {
19500 0 : Py_RETURN_NONE;
19501 : }
19502 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
19503 0 : return py_count;
19504 : }
19505 :
19506 0 : static int py_lsa_LookupSids_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
19507 : {
19508 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19509 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
19510 0 : if (value == NULL) {
19511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
19512 0 : return -1;
19513 : }
19514 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
19515 0 : if (object->out.count == NULL) {
19516 0 : PyErr_NoMemory();
19517 0 : return -1;
19518 : }
19519 : {
19520 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
19521 0 : if (PyLong_Check(value)) {
19522 0 : unsigned long long test_var;
19523 0 : test_var = PyLong_AsUnsignedLongLong(value);
19524 0 : if (PyErr_Occurred() != NULL) {
19525 0 : return -1;
19526 : }
19527 0 : if (test_var > uint_max) {
19528 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19529 : PyLong_Type.tp_name, uint_max, test_var);
19530 0 : return -1;
19531 : }
19532 0 : *object->out.count = test_var;
19533 : } else {
19534 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19535 : PyLong_Type.tp_name);
19536 0 : return -1;
19537 : }
19538 : }
19539 0 : return 0;
19540 : }
19541 :
19542 0 : static PyObject *py_lsa_LookupSids_get_result(PyObject *obj, void *closure)
19543 : {
19544 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(obj);
19545 0 : PyObject *py_result;
19546 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19547 0 : return py_result;
19548 : }
19549 :
19550 0 : static int py_lsa_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
19551 : {
19552 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19553 0 : if (value == NULL) {
19554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
19555 0 : return -1;
19556 : }
19557 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19558 0 : return 0;
19559 : }
19560 :
19561 : static PyGetSetDef py_lsa_LookupSids_getsetters[] = {
19562 : {
19563 : .name = discard_const_p(char, "in_handle"),
19564 : .get = py_lsa_LookupSids_in_get_handle,
19565 : .set = py_lsa_LookupSids_in_set_handle,
19566 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
19567 : },
19568 : {
19569 : .name = discard_const_p(char, "in_sids"),
19570 : .get = py_lsa_LookupSids_in_get_sids,
19571 : .set = py_lsa_LookupSids_in_set_sids,
19572 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
19573 : },
19574 : {
19575 : .name = discard_const_p(char, "out_domains"),
19576 : .get = py_lsa_LookupSids_out_get_domains,
19577 : .set = py_lsa_LookupSids_out_set_domains,
19578 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
19579 : },
19580 : {
19581 : .name = discard_const_p(char, "in_names"),
19582 : .get = py_lsa_LookupSids_in_get_names,
19583 : .set = py_lsa_LookupSids_in_set_names,
19584 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
19585 : },
19586 : {
19587 : .name = discard_const_p(char, "out_names"),
19588 : .get = py_lsa_LookupSids_out_get_names,
19589 : .set = py_lsa_LookupSids_out_set_names,
19590 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
19591 : },
19592 : {
19593 : .name = discard_const_p(char, "in_level"),
19594 : .get = py_lsa_LookupSids_in_get_level,
19595 : .set = py_lsa_LookupSids_in_set_level,
19596 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
19597 : },
19598 : {
19599 : .name = discard_const_p(char, "in_count"),
19600 : .get = py_lsa_LookupSids_in_get_count,
19601 : .set = py_lsa_LookupSids_in_set_count,
19602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19603 : },
19604 : {
19605 : .name = discard_const_p(char, "out_count"),
19606 : .get = py_lsa_LookupSids_out_get_count,
19607 : .set = py_lsa_LookupSids_out_set_count,
19608 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19609 : },
19610 : {
19611 : .name = discard_const_p(char, "result"),
19612 : .get = py_lsa_LookupSids_get_result,
19613 : .set = py_lsa_LookupSids_set_result,
19614 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
19615 : },
19616 : { .name = NULL }
19617 : };
19618 :
19619 0 : static PyObject *py_lsa_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19620 : {
19621 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids, type);
19622 0 : struct lsa_LookupSids *_self = (struct lsa_LookupSids *)pytalloc_get_ptr(self);
19623 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19624 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19625 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
19626 : /* a pointer to a NULL pointer */
19627 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
19628 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
19629 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
19630 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
19631 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
19632 0 : return self;
19633 : }
19634 :
19635 0 : static PyObject *py_lsa_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19636 : {
19637 :
19638 :
19639 0 : return PyLong_FromLong(15);
19640 : }
19641 :
19642 0 : static PyObject *py_lsa_LookupSids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19643 : {
19644 0 : const struct ndr_interface_call *call = NULL;
19645 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19646 0 : PyObject *ret = NULL;
19647 0 : struct ndr_push *push = NULL;
19648 0 : DATA_BLOB blob;
19649 0 : enum ndr_err_code err;
19650 :
19651 0 : if (ndr_table_lsarpc.num_calls < 16) {
19652 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_pack");
19653 0 : return NULL;
19654 : }
19655 0 : call = &ndr_table_lsarpc.calls[15];
19656 :
19657 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19658 0 : if (push == NULL) {
19659 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19660 0 : return NULL;
19661 : }
19662 :
19663 0 : push->flags |= ndr_push_flags;
19664 :
19665 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19666 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19667 0 : TALLOC_FREE(push);
19668 0 : PyErr_SetNdrError(err);
19669 0 : return NULL;
19670 : }
19671 0 : blob = ndr_push_blob(push);
19672 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19673 0 : TALLOC_FREE(push);
19674 0 : return ret;
19675 : }
19676 :
19677 0 : static PyObject *py_lsa_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19678 : {
19679 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19680 0 : PyObject *bigendian_obj = NULL;
19681 0 : PyObject *ndr64_obj = NULL;
19682 0 : libndr_flags ndr_push_flags = 0;
19683 :
19684 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19685 : discard_const_p(char *, kwnames),
19686 : &bigendian_obj,
19687 : &ndr64_obj)) {
19688 0 : return NULL;
19689 : }
19690 :
19691 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19692 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19693 : }
19694 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19695 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19696 : }
19697 :
19698 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19699 : }
19700 :
19701 0 : static PyObject *py_lsa_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19702 : {
19703 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19704 0 : PyObject *bigendian_obj = NULL;
19705 0 : PyObject *ndr64_obj = NULL;
19706 0 : libndr_flags ndr_push_flags = 0;
19707 :
19708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19709 : discard_const_p(char *, kwnames),
19710 : &bigendian_obj,
19711 : &ndr64_obj)) {
19712 0 : return NULL;
19713 : }
19714 :
19715 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19716 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19717 : }
19718 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19719 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19720 : }
19721 :
19722 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19723 : }
19724 :
19725 0 : static PyObject *py_lsa_LookupSids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19726 : {
19727 0 : const struct ndr_interface_call *call = NULL;
19728 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19729 0 : struct ndr_pull *pull = NULL;
19730 0 : enum ndr_err_code err;
19731 :
19732 0 : if (ndr_table_lsarpc.num_calls < 16) {
19733 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_unpack");
19734 0 : return NULL;
19735 : }
19736 0 : call = &ndr_table_lsarpc.calls[15];
19737 :
19738 0 : pull = ndr_pull_init_blob(blob, object);
19739 0 : if (pull == NULL) {
19740 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19741 0 : return NULL;
19742 : }
19743 :
19744 0 : pull->flags |= ndr_pull_flags;
19745 :
19746 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19747 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19748 0 : TALLOC_FREE(pull);
19749 0 : PyErr_SetNdrError(err);
19750 0 : return NULL;
19751 : }
19752 0 : if (!allow_remaining) {
19753 0 : uint32_t highest_ofs;
19754 :
19755 0 : if (pull->offset > pull->relative_highest_offset) {
19756 0 : highest_ofs = pull->offset;
19757 : } else {
19758 0 : highest_ofs = pull->relative_highest_offset;
19759 : }
19760 0 : if (highest_ofs < pull->data_size) {
19761 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19762 : "not all bytes consumed ofs[%u] size[%u]",
19763 : highest_ofs, pull->data_size);
19764 0 : TALLOC_FREE(pull);
19765 0 : PyErr_SetNdrError(err);
19766 0 : return NULL;
19767 : }
19768 : }
19769 :
19770 0 : TALLOC_FREE(pull);
19771 0 : Py_RETURN_NONE;
19772 : }
19773 :
19774 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19775 : {
19776 0 : DATA_BLOB blob;
19777 0 : Py_ssize_t blob_length = 0;
19778 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19779 0 : PyObject *bigendian_obj = NULL;
19780 0 : PyObject *ndr64_obj = NULL;
19781 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19782 0 : PyObject *allow_remaining_obj = NULL;
19783 0 : bool allow_remaining = false;
19784 :
19785 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19786 : discard_const_p(char *, kwnames),
19787 : &blob.data, &blob_length,
19788 : &bigendian_obj,
19789 : &ndr64_obj,
19790 : &allow_remaining_obj)) {
19791 0 : return NULL;
19792 : }
19793 0 : blob.length = blob_length;
19794 :
19795 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19796 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19797 : }
19798 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19799 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19800 : }
19801 :
19802 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19803 0 : allow_remaining = true;
19804 : }
19805 :
19806 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19807 : }
19808 :
19809 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19810 : {
19811 0 : DATA_BLOB blob;
19812 0 : Py_ssize_t blob_length = 0;
19813 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19814 0 : PyObject *bigendian_obj = NULL;
19815 0 : PyObject *ndr64_obj = NULL;
19816 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19817 0 : PyObject *allow_remaining_obj = NULL;
19818 0 : bool allow_remaining = false;
19819 :
19820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19821 : discard_const_p(char *, kwnames),
19822 : &blob.data, &blob_length,
19823 : &bigendian_obj,
19824 : &ndr64_obj,
19825 : &allow_remaining_obj)) {
19826 0 : return NULL;
19827 : }
19828 0 : blob.length = blob_length;
19829 :
19830 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19831 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19832 : }
19833 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19834 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19835 : }
19836 :
19837 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19838 0 : allow_remaining = true;
19839 : }
19840 :
19841 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19842 : }
19843 :
19844 0 : static PyObject *py_lsa_LookupSids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19845 : {
19846 0 : const struct ndr_interface_call *call = NULL;
19847 0 : struct lsa_LookupSids *object = (struct lsa_LookupSids *)pytalloc_get_ptr(py_obj);
19848 0 : PyObject *ret;
19849 0 : char *retstr;
19850 :
19851 0 : if (ndr_table_lsarpc.num_calls < 16) {
19852 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_print");
19853 0 : return NULL;
19854 : }
19855 0 : call = &ndr_table_lsarpc.calls[15];
19856 :
19857 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19858 0 : ret = PyUnicode_FromString(retstr);
19859 0 : TALLOC_FREE(retstr);
19860 :
19861 0 : return ret;
19862 : }
19863 :
19864 0 : static PyObject *py_lsa_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19865 : {
19866 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_in", NDR_IN);
19867 : }
19868 :
19869 0 : static PyObject *py_lsa_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19870 : {
19871 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_out", NDR_OUT);
19872 : }
19873 :
19874 : static PyMethodDef py_lsa_LookupSids_methods[] = {
19875 : { "opnum", (PyCFunction)py_lsa_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
19876 : "lsa.LookupSids.opnum() -> 15 (0x0f) " },
19877 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19878 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19879 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19880 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19881 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19882 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19883 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19884 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19885 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19886 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19887 : { NULL, NULL, 0, NULL }
19888 : };
19889 :
19890 :
19891 : static PyTypeObject lsa_LookupSids_Type = {
19892 : PyVarObject_HEAD_INIT(NULL, 0)
19893 : .tp_name = "lsa.LookupSids",
19894 : .tp_getset = py_lsa_LookupSids_getsetters,
19895 : .tp_methods = py_lsa_LookupSids_methods,
19896 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19897 : .tp_new = py_lsa_LookupSids_new,
19898 : };
19899 :
19900 1 : static bool pack_py_lsa_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids *r)
19901 : {
19902 0 : PyObject *py_handle;
19903 0 : PyObject *py_sids;
19904 0 : PyObject *py_names;
19905 0 : PyObject *py_level;
19906 0 : PyObject *py_count;
19907 1 : const char *kwnames[] = {
19908 : "handle", "sids", "names", "level", "count", NULL
19909 : };
19910 :
19911 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupSids", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count)) {
19912 0 : return false;
19913 : }
19914 :
19915 1 : if (py_handle == NULL) {
19916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
19917 0 : return false;
19918 : }
19919 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19920 1 : if (r->in.handle == NULL) {
19921 0 : PyErr_NoMemory();
19922 0 : return false;
19923 : }
19924 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19925 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19926 0 : PyErr_NoMemory();
19927 0 : return false;
19928 : }
19929 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19930 1 : if (py_sids == NULL) {
19931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
19932 0 : return false;
19933 : }
19934 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
19935 1 : if (r->in.sids == NULL) {
19936 0 : PyErr_NoMemory();
19937 0 : return false;
19938 : }
19939 1 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
19940 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
19941 0 : PyErr_NoMemory();
19942 0 : return false;
19943 : }
19944 1 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
19945 1 : if (py_names == NULL) {
19946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
19947 0 : return false;
19948 : }
19949 1 : r->in.names = talloc_ptrtype(r, r->in.names);
19950 1 : if (r->in.names == NULL) {
19951 0 : PyErr_NoMemory();
19952 0 : return false;
19953 : }
19954 1 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, py_names, return false;);
19955 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
19956 0 : PyErr_NoMemory();
19957 0 : return false;
19958 : }
19959 1 : r->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_names);
19960 1 : if (py_level == NULL) {
19961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
19962 0 : return false;
19963 : }
19964 : {
19965 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
19966 1 : if (PyLong_Check(py_level)) {
19967 0 : unsigned long long test_var;
19968 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
19969 1 : if (PyErr_Occurred() != NULL) {
19970 0 : return false;
19971 : }
19972 1 : if (test_var > uint_max) {
19973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19974 : PyLong_Type.tp_name, uint_max, test_var);
19975 0 : return false;
19976 : }
19977 1 : r->in.level = test_var;
19978 : } else {
19979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19980 : PyLong_Type.tp_name);
19981 0 : return false;
19982 : }
19983 : }
19984 1 : if (py_count == NULL) {
19985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
19986 0 : return false;
19987 : }
19988 1 : r->in.count = talloc_ptrtype(r, r->in.count);
19989 1 : if (r->in.count == NULL) {
19990 0 : PyErr_NoMemory();
19991 0 : return false;
19992 : }
19993 : {
19994 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
19995 1 : if (PyLong_Check(py_count)) {
19996 0 : unsigned long long test_var;
19997 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
19998 1 : if (PyErr_Occurred() != NULL) {
19999 0 : return false;
20000 : }
20001 1 : if (test_var > uint_max) {
20002 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20003 : PyLong_Type.tp_name, uint_max, test_var);
20004 0 : return false;
20005 : }
20006 1 : *r->in.count = test_var;
20007 : } else {
20008 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20009 : PyLong_Type.tp_name);
20010 0 : return false;
20011 : }
20012 : }
20013 1 : return true;
20014 : }
20015 :
20016 1 : static PyObject *unpack_py_lsa_LookupSids_args_out(struct lsa_LookupSids *r)
20017 : {
20018 0 : PyObject *result;
20019 0 : PyObject *py_domains;
20020 0 : PyObject *py_names;
20021 0 : PyObject *py_count;
20022 1 : result = PyTuple_New(3);
20023 1 : if (*r->out.domains == NULL) {
20024 0 : py_domains = Py_None;
20025 0 : Py_INCREF(py_domains);
20026 : } else {
20027 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
20028 : }
20029 1 : PyTuple_SetItem(result, 0, py_domains);
20030 1 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, r->out.names, r->out.names);
20031 1 : PyTuple_SetItem(result, 1, py_names);
20032 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
20033 1 : PyTuple_SetItem(result, 2, py_count);
20034 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
20035 0 : PyErr_SetNTSTATUS(r->out.result);
20036 0 : return NULL;
20037 : }
20038 :
20039 1 : return result;
20040 : }
20041 :
20042 :
20043 0 : static PyObject *py_lsa_CreateSecret_in_get_handle(PyObject *obj, void *closure)
20044 : {
20045 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20046 0 : PyObject *py_handle;
20047 0 : if (object->in.handle == NULL) {
20048 0 : Py_RETURN_NONE;
20049 : }
20050 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20051 0 : return py_handle;
20052 : }
20053 :
20054 0 : static int py_lsa_CreateSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20055 : {
20056 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20057 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20058 0 : if (value == NULL) {
20059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20060 0 : return -1;
20061 : }
20062 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20063 0 : if (object->in.handle == NULL) {
20064 0 : PyErr_NoMemory();
20065 0 : return -1;
20066 : }
20067 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20068 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20069 0 : PyErr_NoMemory();
20070 0 : return -1;
20071 : }
20072 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20073 0 : return 0;
20074 : }
20075 :
20076 0 : static PyObject *py_lsa_CreateSecret_in_get_name(PyObject *obj, void *closure)
20077 : {
20078 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20079 0 : PyObject *py_name;
20080 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
20081 0 : return py_name;
20082 : }
20083 :
20084 0 : static int py_lsa_CreateSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
20085 : {
20086 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20087 0 : if (value == NULL) {
20088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
20089 0 : return -1;
20090 : }
20091 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
20092 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20093 0 : PyErr_NoMemory();
20094 0 : return -1;
20095 : }
20096 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
20097 0 : return 0;
20098 : }
20099 :
20100 0 : static PyObject *py_lsa_CreateSecret_in_get_access_mask(PyObject *obj, void *closure)
20101 : {
20102 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20103 0 : PyObject *py_access_mask;
20104 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
20105 0 : return py_access_mask;
20106 : }
20107 :
20108 0 : static int py_lsa_CreateSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
20109 : {
20110 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20111 0 : if (value == NULL) {
20112 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
20113 0 : return -1;
20114 : }
20115 : {
20116 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
20117 0 : if (PyLong_Check(value)) {
20118 0 : unsigned long long test_var;
20119 0 : test_var = PyLong_AsUnsignedLongLong(value);
20120 0 : if (PyErr_Occurred() != NULL) {
20121 0 : return -1;
20122 : }
20123 0 : if (test_var > uint_max) {
20124 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20125 : PyLong_Type.tp_name, uint_max, test_var);
20126 0 : return -1;
20127 : }
20128 0 : object->in.access_mask = test_var;
20129 : } else {
20130 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20131 : PyLong_Type.tp_name);
20132 0 : return -1;
20133 : }
20134 : }
20135 0 : return 0;
20136 : }
20137 :
20138 0 : static PyObject *py_lsa_CreateSecret_out_get_sec_handle(PyObject *obj, void *closure)
20139 : {
20140 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20141 0 : PyObject *py_sec_handle;
20142 0 : if (object->out.sec_handle == NULL) {
20143 0 : Py_RETURN_NONE;
20144 : }
20145 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
20146 0 : return py_sec_handle;
20147 : }
20148 :
20149 0 : static int py_lsa_CreateSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
20150 : {
20151 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20152 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
20153 0 : if (value == NULL) {
20154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sec_handle");
20155 0 : return -1;
20156 : }
20157 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
20158 0 : if (object->out.sec_handle == NULL) {
20159 0 : PyErr_NoMemory();
20160 0 : return -1;
20161 : }
20162 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20163 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20164 0 : PyErr_NoMemory();
20165 0 : return -1;
20166 : }
20167 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20168 0 : return 0;
20169 : }
20170 :
20171 0 : static PyObject *py_lsa_CreateSecret_get_result(PyObject *obj, void *closure)
20172 : {
20173 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(obj);
20174 0 : PyObject *py_result;
20175 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20176 0 : return py_result;
20177 : }
20178 :
20179 0 : static int py_lsa_CreateSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
20180 : {
20181 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20182 0 : if (value == NULL) {
20183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20184 0 : return -1;
20185 : }
20186 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20187 0 : return 0;
20188 : }
20189 :
20190 : static PyGetSetDef py_lsa_CreateSecret_getsetters[] = {
20191 : {
20192 : .name = discard_const_p(char, "in_handle"),
20193 : .get = py_lsa_CreateSecret_in_get_handle,
20194 : .set = py_lsa_CreateSecret_in_set_handle,
20195 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20196 : },
20197 : {
20198 : .name = discard_const_p(char, "in_name"),
20199 : .get = py_lsa_CreateSecret_in_get_name,
20200 : .set = py_lsa_CreateSecret_in_set_name,
20201 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
20202 : },
20203 : {
20204 : .name = discard_const_p(char, "in_access_mask"),
20205 : .get = py_lsa_CreateSecret_in_get_access_mask,
20206 : .set = py_lsa_CreateSecret_in_set_access_mask,
20207 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
20208 : },
20209 : {
20210 : .name = discard_const_p(char, "out_sec_handle"),
20211 : .get = py_lsa_CreateSecret_out_get_sec_handle,
20212 : .set = py_lsa_CreateSecret_out_set_sec_handle,
20213 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20214 : },
20215 : {
20216 : .name = discard_const_p(char, "result"),
20217 : .get = py_lsa_CreateSecret_get_result,
20218 : .set = py_lsa_CreateSecret_set_result,
20219 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20220 : },
20221 : { .name = NULL }
20222 : };
20223 :
20224 0 : static PyObject *py_lsa_CreateSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20225 : {
20226 0 : PyObject *self = pytalloc_new(struct lsa_CreateSecret, type);
20227 0 : struct lsa_CreateSecret *_self = (struct lsa_CreateSecret *)pytalloc_get_ptr(self);
20228 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20229 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20230 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
20231 0 : return self;
20232 : }
20233 :
20234 0 : static PyObject *py_lsa_CreateSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20235 : {
20236 :
20237 :
20238 0 : return PyLong_FromLong(16);
20239 : }
20240 :
20241 0 : static PyObject *py_lsa_CreateSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20242 : {
20243 0 : const struct ndr_interface_call *call = NULL;
20244 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20245 0 : PyObject *ret = NULL;
20246 0 : struct ndr_push *push = NULL;
20247 0 : DATA_BLOB blob;
20248 0 : enum ndr_err_code err;
20249 :
20250 0 : if (ndr_table_lsarpc.num_calls < 17) {
20251 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_pack");
20252 0 : return NULL;
20253 : }
20254 0 : call = &ndr_table_lsarpc.calls[16];
20255 :
20256 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20257 0 : if (push == NULL) {
20258 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20259 0 : return NULL;
20260 : }
20261 :
20262 0 : push->flags |= ndr_push_flags;
20263 :
20264 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20265 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20266 0 : TALLOC_FREE(push);
20267 0 : PyErr_SetNdrError(err);
20268 0 : return NULL;
20269 : }
20270 0 : blob = ndr_push_blob(push);
20271 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20272 0 : TALLOC_FREE(push);
20273 0 : return ret;
20274 : }
20275 :
20276 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20277 : {
20278 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20279 0 : PyObject *bigendian_obj = NULL;
20280 0 : PyObject *ndr64_obj = NULL;
20281 0 : libndr_flags ndr_push_flags = 0;
20282 :
20283 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20284 : discard_const_p(char *, kwnames),
20285 : &bigendian_obj,
20286 : &ndr64_obj)) {
20287 0 : return NULL;
20288 : }
20289 :
20290 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20291 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20292 : }
20293 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20294 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20295 : }
20296 :
20297 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20298 : }
20299 :
20300 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20301 : {
20302 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20303 0 : PyObject *bigendian_obj = NULL;
20304 0 : PyObject *ndr64_obj = NULL;
20305 0 : libndr_flags ndr_push_flags = 0;
20306 :
20307 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20308 : discard_const_p(char *, kwnames),
20309 : &bigendian_obj,
20310 : &ndr64_obj)) {
20311 0 : return NULL;
20312 : }
20313 :
20314 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20315 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20316 : }
20317 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20318 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20319 : }
20320 :
20321 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20322 : }
20323 :
20324 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20325 : {
20326 0 : const struct ndr_interface_call *call = NULL;
20327 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20328 0 : struct ndr_pull *pull = NULL;
20329 0 : enum ndr_err_code err;
20330 :
20331 0 : if (ndr_table_lsarpc.num_calls < 17) {
20332 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_unpack");
20333 0 : return NULL;
20334 : }
20335 0 : call = &ndr_table_lsarpc.calls[16];
20336 :
20337 0 : pull = ndr_pull_init_blob(blob, object);
20338 0 : if (pull == NULL) {
20339 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20340 0 : return NULL;
20341 : }
20342 :
20343 0 : pull->flags |= ndr_pull_flags;
20344 :
20345 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20346 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20347 0 : TALLOC_FREE(pull);
20348 0 : PyErr_SetNdrError(err);
20349 0 : return NULL;
20350 : }
20351 0 : if (!allow_remaining) {
20352 0 : uint32_t highest_ofs;
20353 :
20354 0 : if (pull->offset > pull->relative_highest_offset) {
20355 0 : highest_ofs = pull->offset;
20356 : } else {
20357 0 : highest_ofs = pull->relative_highest_offset;
20358 : }
20359 0 : if (highest_ofs < pull->data_size) {
20360 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20361 : "not all bytes consumed ofs[%u] size[%u]",
20362 : highest_ofs, pull->data_size);
20363 0 : TALLOC_FREE(pull);
20364 0 : PyErr_SetNdrError(err);
20365 0 : return NULL;
20366 : }
20367 : }
20368 :
20369 0 : TALLOC_FREE(pull);
20370 0 : Py_RETURN_NONE;
20371 : }
20372 :
20373 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20374 : {
20375 0 : DATA_BLOB blob;
20376 0 : Py_ssize_t blob_length = 0;
20377 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20378 0 : PyObject *bigendian_obj = NULL;
20379 0 : PyObject *ndr64_obj = NULL;
20380 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20381 0 : PyObject *allow_remaining_obj = NULL;
20382 0 : bool allow_remaining = false;
20383 :
20384 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20385 : discard_const_p(char *, kwnames),
20386 : &blob.data, &blob_length,
20387 : &bigendian_obj,
20388 : &ndr64_obj,
20389 : &allow_remaining_obj)) {
20390 0 : return NULL;
20391 : }
20392 0 : blob.length = blob_length;
20393 :
20394 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20395 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20396 : }
20397 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20398 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20399 : }
20400 :
20401 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20402 0 : allow_remaining = true;
20403 : }
20404 :
20405 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20406 : }
20407 :
20408 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20409 : {
20410 0 : DATA_BLOB blob;
20411 0 : Py_ssize_t blob_length = 0;
20412 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20413 0 : PyObject *bigendian_obj = NULL;
20414 0 : PyObject *ndr64_obj = NULL;
20415 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20416 0 : PyObject *allow_remaining_obj = NULL;
20417 0 : bool allow_remaining = false;
20418 :
20419 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20420 : discard_const_p(char *, kwnames),
20421 : &blob.data, &blob_length,
20422 : &bigendian_obj,
20423 : &ndr64_obj,
20424 : &allow_remaining_obj)) {
20425 0 : return NULL;
20426 : }
20427 0 : blob.length = blob_length;
20428 :
20429 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20430 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20431 : }
20432 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20433 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20434 : }
20435 :
20436 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20437 0 : allow_remaining = true;
20438 : }
20439 :
20440 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20441 : }
20442 :
20443 0 : static PyObject *py_lsa_CreateSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20444 : {
20445 0 : const struct ndr_interface_call *call = NULL;
20446 0 : struct lsa_CreateSecret *object = (struct lsa_CreateSecret *)pytalloc_get_ptr(py_obj);
20447 0 : PyObject *ret;
20448 0 : char *retstr;
20449 :
20450 0 : if (ndr_table_lsarpc.num_calls < 17) {
20451 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_print");
20452 0 : return NULL;
20453 : }
20454 0 : call = &ndr_table_lsarpc.calls[16];
20455 :
20456 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20457 0 : ret = PyUnicode_FromString(retstr);
20458 0 : TALLOC_FREE(retstr);
20459 :
20460 0 : return ret;
20461 : }
20462 :
20463 0 : static PyObject *py_lsa_CreateSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20464 : {
20465 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_in", NDR_IN);
20466 : }
20467 :
20468 0 : static PyObject *py_lsa_CreateSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20469 : {
20470 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_out", NDR_OUT);
20471 : }
20472 :
20473 : static PyMethodDef py_lsa_CreateSecret_methods[] = {
20474 : { "opnum", (PyCFunction)py_lsa_CreateSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
20475 : "lsa.CreateSecret.opnum() -> 16 (0x10) " },
20476 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20477 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20478 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20479 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20480 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20481 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20482 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20483 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20484 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20485 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20486 : { NULL, NULL, 0, NULL }
20487 : };
20488 :
20489 :
20490 : static PyTypeObject lsa_CreateSecret_Type = {
20491 : PyVarObject_HEAD_INIT(NULL, 0)
20492 : .tp_name = "lsa.CreateSecret",
20493 : .tp_getset = py_lsa_CreateSecret_getsetters,
20494 : .tp_methods = py_lsa_CreateSecret_methods,
20495 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20496 : .tp_new = py_lsa_CreateSecret_new,
20497 : };
20498 :
20499 2 : static bool pack_py_lsa_CreateSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateSecret *r)
20500 : {
20501 0 : PyObject *py_handle;
20502 0 : PyObject *py_name;
20503 0 : PyObject *py_access_mask;
20504 2 : const char *kwnames[] = {
20505 : "handle", "name", "access_mask", NULL
20506 : };
20507 :
20508 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
20509 0 : return false;
20510 : }
20511 :
20512 2 : if (py_handle == NULL) {
20513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
20514 0 : return false;
20515 : }
20516 2 : r->in.handle = talloc_ptrtype(r, r->in.handle);
20517 2 : if (r->in.handle == NULL) {
20518 0 : PyErr_NoMemory();
20519 0 : return false;
20520 : }
20521 2 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
20522 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
20523 0 : PyErr_NoMemory();
20524 0 : return false;
20525 : }
20526 2 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
20527 2 : if (py_name == NULL) {
20528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
20529 0 : return false;
20530 : }
20531 2 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
20532 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
20533 0 : PyErr_NoMemory();
20534 0 : return false;
20535 : }
20536 2 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
20537 2 : if (py_access_mask == NULL) {
20538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
20539 0 : return false;
20540 : }
20541 : {
20542 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
20543 2 : if (PyLong_Check(py_access_mask)) {
20544 0 : unsigned long long test_var;
20545 2 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
20546 2 : if (PyErr_Occurred() != NULL) {
20547 0 : return false;
20548 : }
20549 2 : if (test_var > uint_max) {
20550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20551 : PyLong_Type.tp_name, uint_max, test_var);
20552 0 : return false;
20553 : }
20554 2 : r->in.access_mask = test_var;
20555 : } else {
20556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20557 : PyLong_Type.tp_name);
20558 0 : return false;
20559 : }
20560 : }
20561 2 : return true;
20562 : }
20563 :
20564 2 : static PyObject *unpack_py_lsa_CreateSecret_args_out(struct lsa_CreateSecret *r)
20565 : {
20566 0 : PyObject *result;
20567 0 : PyObject *py_sec_handle;
20568 2 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
20569 2 : result = py_sec_handle;
20570 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
20571 0 : PyErr_SetNTSTATUS(r->out.result);
20572 0 : return NULL;
20573 : }
20574 :
20575 2 : return result;
20576 : }
20577 :
20578 :
20579 0 : static PyObject *py_lsa_OpenAccount_in_get_handle(PyObject *obj, void *closure)
20580 : {
20581 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20582 0 : PyObject *py_handle;
20583 0 : if (object->in.handle == NULL) {
20584 0 : Py_RETURN_NONE;
20585 : }
20586 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20587 0 : return py_handle;
20588 : }
20589 :
20590 0 : static int py_lsa_OpenAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20591 : {
20592 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20593 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20594 0 : if (value == NULL) {
20595 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
20596 0 : return -1;
20597 : }
20598 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20599 0 : if (object->in.handle == NULL) {
20600 0 : PyErr_NoMemory();
20601 0 : return -1;
20602 : }
20603 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20604 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20605 0 : PyErr_NoMemory();
20606 0 : return -1;
20607 : }
20608 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20609 0 : return 0;
20610 : }
20611 :
20612 0 : static PyObject *py_lsa_OpenAccount_in_get_sid(PyObject *obj, void *closure)
20613 : {
20614 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20615 0 : PyObject *py_sid;
20616 0 : if (object->in.sid == NULL) {
20617 0 : Py_RETURN_NONE;
20618 : }
20619 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
20620 0 : return py_sid;
20621 : }
20622 :
20623 0 : static int py_lsa_OpenAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
20624 : {
20625 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20626 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
20627 0 : if (value == NULL) {
20628 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
20629 0 : return -1;
20630 : }
20631 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
20632 0 : if (object->in.sid == NULL) {
20633 0 : PyErr_NoMemory();
20634 0 : return -1;
20635 : }
20636 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
20637 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20638 0 : PyErr_NoMemory();
20639 0 : return -1;
20640 : }
20641 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
20642 0 : return 0;
20643 : }
20644 :
20645 0 : static PyObject *py_lsa_OpenAccount_in_get_access_mask(PyObject *obj, void *closure)
20646 : {
20647 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20648 0 : PyObject *py_access_mask;
20649 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
20650 0 : return py_access_mask;
20651 : }
20652 :
20653 0 : static int py_lsa_OpenAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
20654 : {
20655 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20656 0 : if (value == NULL) {
20657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
20658 0 : return -1;
20659 : }
20660 : {
20661 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
20662 0 : if (PyLong_Check(value)) {
20663 0 : unsigned long long test_var;
20664 0 : test_var = PyLong_AsUnsignedLongLong(value);
20665 0 : if (PyErr_Occurred() != NULL) {
20666 0 : return -1;
20667 : }
20668 0 : if (test_var > uint_max) {
20669 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20670 : PyLong_Type.tp_name, uint_max, test_var);
20671 0 : return -1;
20672 : }
20673 0 : object->in.access_mask = test_var;
20674 : } else {
20675 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20676 : PyLong_Type.tp_name);
20677 0 : return -1;
20678 : }
20679 : }
20680 0 : return 0;
20681 : }
20682 :
20683 0 : static PyObject *py_lsa_OpenAccount_out_get_acct_handle(PyObject *obj, void *closure)
20684 : {
20685 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20686 0 : PyObject *py_acct_handle;
20687 0 : if (object->out.acct_handle == NULL) {
20688 0 : Py_RETURN_NONE;
20689 : }
20690 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
20691 0 : return py_acct_handle;
20692 : }
20693 :
20694 0 : static int py_lsa_OpenAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
20695 : {
20696 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20697 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
20698 0 : if (value == NULL) {
20699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.acct_handle");
20700 0 : return -1;
20701 : }
20702 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
20703 0 : if (object->out.acct_handle == NULL) {
20704 0 : PyErr_NoMemory();
20705 0 : return -1;
20706 : }
20707 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20708 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20709 0 : PyErr_NoMemory();
20710 0 : return -1;
20711 : }
20712 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20713 0 : return 0;
20714 : }
20715 :
20716 0 : static PyObject *py_lsa_OpenAccount_get_result(PyObject *obj, void *closure)
20717 : {
20718 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(obj);
20719 0 : PyObject *py_result;
20720 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20721 0 : return py_result;
20722 : }
20723 :
20724 0 : static int py_lsa_OpenAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
20725 : {
20726 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20727 0 : if (value == NULL) {
20728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20729 0 : return -1;
20730 : }
20731 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20732 0 : return 0;
20733 : }
20734 :
20735 : static PyGetSetDef py_lsa_OpenAccount_getsetters[] = {
20736 : {
20737 : .name = discard_const_p(char, "in_handle"),
20738 : .get = py_lsa_OpenAccount_in_get_handle,
20739 : .set = py_lsa_OpenAccount_in_set_handle,
20740 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20741 : },
20742 : {
20743 : .name = discard_const_p(char, "in_sid"),
20744 : .get = py_lsa_OpenAccount_in_get_sid,
20745 : .set = py_lsa_OpenAccount_in_set_sid,
20746 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
20747 : },
20748 : {
20749 : .name = discard_const_p(char, "in_access_mask"),
20750 : .get = py_lsa_OpenAccount_in_get_access_mask,
20751 : .set = py_lsa_OpenAccount_in_set_access_mask,
20752 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
20753 : },
20754 : {
20755 : .name = discard_const_p(char, "out_acct_handle"),
20756 : .get = py_lsa_OpenAccount_out_get_acct_handle,
20757 : .set = py_lsa_OpenAccount_out_set_acct_handle,
20758 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20759 : },
20760 : {
20761 : .name = discard_const_p(char, "result"),
20762 : .get = py_lsa_OpenAccount_get_result,
20763 : .set = py_lsa_OpenAccount_set_result,
20764 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20765 : },
20766 : { .name = NULL }
20767 : };
20768 :
20769 0 : static PyObject *py_lsa_OpenAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20770 : {
20771 0 : PyObject *self = pytalloc_new(struct lsa_OpenAccount, type);
20772 0 : struct lsa_OpenAccount *_self = (struct lsa_OpenAccount *)pytalloc_get_ptr(self);
20773 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20774 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20775 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
20776 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
20777 0 : return self;
20778 : }
20779 :
20780 0 : static PyObject *py_lsa_OpenAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20781 : {
20782 :
20783 :
20784 0 : return PyLong_FromLong(17);
20785 : }
20786 :
20787 0 : static PyObject *py_lsa_OpenAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20788 : {
20789 0 : const struct ndr_interface_call *call = NULL;
20790 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20791 0 : PyObject *ret = NULL;
20792 0 : struct ndr_push *push = NULL;
20793 0 : DATA_BLOB blob;
20794 0 : enum ndr_err_code err;
20795 :
20796 0 : if (ndr_table_lsarpc.num_calls < 18) {
20797 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_pack");
20798 0 : return NULL;
20799 : }
20800 0 : call = &ndr_table_lsarpc.calls[17];
20801 :
20802 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20803 0 : if (push == NULL) {
20804 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20805 0 : return NULL;
20806 : }
20807 :
20808 0 : push->flags |= ndr_push_flags;
20809 :
20810 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20811 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20812 0 : TALLOC_FREE(push);
20813 0 : PyErr_SetNdrError(err);
20814 0 : return NULL;
20815 : }
20816 0 : blob = ndr_push_blob(push);
20817 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20818 0 : TALLOC_FREE(push);
20819 0 : return ret;
20820 : }
20821 :
20822 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20823 : {
20824 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20825 0 : PyObject *bigendian_obj = NULL;
20826 0 : PyObject *ndr64_obj = NULL;
20827 0 : libndr_flags ndr_push_flags = 0;
20828 :
20829 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20830 : discard_const_p(char *, kwnames),
20831 : &bigendian_obj,
20832 : &ndr64_obj)) {
20833 0 : return NULL;
20834 : }
20835 :
20836 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20837 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20838 : }
20839 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20840 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20841 : }
20842 :
20843 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20844 : }
20845 :
20846 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20847 : {
20848 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20849 0 : PyObject *bigendian_obj = NULL;
20850 0 : PyObject *ndr64_obj = NULL;
20851 0 : libndr_flags ndr_push_flags = 0;
20852 :
20853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20854 : discard_const_p(char *, kwnames),
20855 : &bigendian_obj,
20856 : &ndr64_obj)) {
20857 0 : return NULL;
20858 : }
20859 :
20860 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20861 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20862 : }
20863 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20864 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20865 : }
20866 :
20867 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20868 : }
20869 :
20870 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20871 : {
20872 0 : const struct ndr_interface_call *call = NULL;
20873 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20874 0 : struct ndr_pull *pull = NULL;
20875 0 : enum ndr_err_code err;
20876 :
20877 0 : if (ndr_table_lsarpc.num_calls < 18) {
20878 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_unpack");
20879 0 : return NULL;
20880 : }
20881 0 : call = &ndr_table_lsarpc.calls[17];
20882 :
20883 0 : pull = ndr_pull_init_blob(blob, object);
20884 0 : if (pull == NULL) {
20885 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20886 0 : return NULL;
20887 : }
20888 :
20889 0 : pull->flags |= ndr_pull_flags;
20890 :
20891 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20892 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20893 0 : TALLOC_FREE(pull);
20894 0 : PyErr_SetNdrError(err);
20895 0 : return NULL;
20896 : }
20897 0 : if (!allow_remaining) {
20898 0 : uint32_t highest_ofs;
20899 :
20900 0 : if (pull->offset > pull->relative_highest_offset) {
20901 0 : highest_ofs = pull->offset;
20902 : } else {
20903 0 : highest_ofs = pull->relative_highest_offset;
20904 : }
20905 0 : if (highest_ofs < pull->data_size) {
20906 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20907 : "not all bytes consumed ofs[%u] size[%u]",
20908 : highest_ofs, pull->data_size);
20909 0 : TALLOC_FREE(pull);
20910 0 : PyErr_SetNdrError(err);
20911 0 : return NULL;
20912 : }
20913 : }
20914 :
20915 0 : TALLOC_FREE(pull);
20916 0 : Py_RETURN_NONE;
20917 : }
20918 :
20919 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20920 : {
20921 0 : DATA_BLOB blob;
20922 0 : Py_ssize_t blob_length = 0;
20923 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20924 0 : PyObject *bigendian_obj = NULL;
20925 0 : PyObject *ndr64_obj = NULL;
20926 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20927 0 : PyObject *allow_remaining_obj = NULL;
20928 0 : bool allow_remaining = false;
20929 :
20930 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20931 : discard_const_p(char *, kwnames),
20932 : &blob.data, &blob_length,
20933 : &bigendian_obj,
20934 : &ndr64_obj,
20935 : &allow_remaining_obj)) {
20936 0 : return NULL;
20937 : }
20938 0 : blob.length = blob_length;
20939 :
20940 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20941 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20942 : }
20943 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20944 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20945 : }
20946 :
20947 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20948 0 : allow_remaining = true;
20949 : }
20950 :
20951 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20952 : }
20953 :
20954 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20955 : {
20956 0 : DATA_BLOB blob;
20957 0 : Py_ssize_t blob_length = 0;
20958 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20959 0 : PyObject *bigendian_obj = NULL;
20960 0 : PyObject *ndr64_obj = NULL;
20961 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20962 0 : PyObject *allow_remaining_obj = NULL;
20963 0 : bool allow_remaining = false;
20964 :
20965 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20966 : discard_const_p(char *, kwnames),
20967 : &blob.data, &blob_length,
20968 : &bigendian_obj,
20969 : &ndr64_obj,
20970 : &allow_remaining_obj)) {
20971 0 : return NULL;
20972 : }
20973 0 : blob.length = blob_length;
20974 :
20975 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20976 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20977 : }
20978 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20979 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20980 : }
20981 :
20982 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20983 0 : allow_remaining = true;
20984 : }
20985 :
20986 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20987 : }
20988 :
20989 0 : static PyObject *py_lsa_OpenAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20990 : {
20991 0 : const struct ndr_interface_call *call = NULL;
20992 0 : struct lsa_OpenAccount *object = (struct lsa_OpenAccount *)pytalloc_get_ptr(py_obj);
20993 0 : PyObject *ret;
20994 0 : char *retstr;
20995 :
20996 0 : if (ndr_table_lsarpc.num_calls < 18) {
20997 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_print");
20998 0 : return NULL;
20999 : }
21000 0 : call = &ndr_table_lsarpc.calls[17];
21001 :
21002 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21003 0 : ret = PyUnicode_FromString(retstr);
21004 0 : TALLOC_FREE(retstr);
21005 :
21006 0 : return ret;
21007 : }
21008 :
21009 0 : static PyObject *py_lsa_OpenAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21010 : {
21011 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_in", NDR_IN);
21012 : }
21013 :
21014 0 : static PyObject *py_lsa_OpenAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21015 : {
21016 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_out", NDR_OUT);
21017 : }
21018 :
21019 : static PyMethodDef py_lsa_OpenAccount_methods[] = {
21020 : { "opnum", (PyCFunction)py_lsa_OpenAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21021 : "lsa.OpenAccount.opnum() -> 17 (0x11) " },
21022 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21023 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21024 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21025 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21026 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21027 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21028 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21029 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21030 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21031 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21032 : { NULL, NULL, 0, NULL }
21033 : };
21034 :
21035 :
21036 : static PyTypeObject lsa_OpenAccount_Type = {
21037 : PyVarObject_HEAD_INIT(NULL, 0)
21038 : .tp_name = "lsa.OpenAccount",
21039 : .tp_getset = py_lsa_OpenAccount_getsetters,
21040 : .tp_methods = py_lsa_OpenAccount_methods,
21041 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21042 : .tp_new = py_lsa_OpenAccount_new,
21043 : };
21044 :
21045 0 : static bool pack_py_lsa_OpenAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenAccount *r)
21046 : {
21047 0 : PyObject *py_handle;
21048 0 : PyObject *py_sid;
21049 0 : PyObject *py_access_mask;
21050 0 : const char *kwnames[] = {
21051 : "handle", "sid", "access_mask", NULL
21052 : };
21053 :
21054 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
21055 0 : return false;
21056 : }
21057 :
21058 0 : if (py_handle == NULL) {
21059 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21060 0 : return false;
21061 : }
21062 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21063 0 : if (r->in.handle == NULL) {
21064 0 : PyErr_NoMemory();
21065 0 : return false;
21066 : }
21067 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21068 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21069 0 : PyErr_NoMemory();
21070 0 : return false;
21071 : }
21072 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21073 0 : if (py_sid == NULL) {
21074 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
21075 0 : return false;
21076 : }
21077 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
21078 0 : if (r->in.sid == NULL) {
21079 0 : PyErr_NoMemory();
21080 0 : return false;
21081 : }
21082 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
21083 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
21084 0 : PyErr_NoMemory();
21085 0 : return false;
21086 : }
21087 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
21088 0 : if (py_access_mask == NULL) {
21089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
21090 0 : return false;
21091 : }
21092 : {
21093 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
21094 0 : if (PyLong_Check(py_access_mask)) {
21095 0 : unsigned long long test_var;
21096 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
21097 0 : if (PyErr_Occurred() != NULL) {
21098 0 : return false;
21099 : }
21100 0 : if (test_var > uint_max) {
21101 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21102 : PyLong_Type.tp_name, uint_max, test_var);
21103 0 : return false;
21104 : }
21105 0 : r->in.access_mask = test_var;
21106 : } else {
21107 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21108 : PyLong_Type.tp_name);
21109 0 : return false;
21110 : }
21111 : }
21112 0 : return true;
21113 : }
21114 :
21115 0 : static PyObject *unpack_py_lsa_OpenAccount_args_out(struct lsa_OpenAccount *r)
21116 : {
21117 0 : PyObject *result;
21118 0 : PyObject *py_acct_handle;
21119 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
21120 0 : result = py_acct_handle;
21121 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21122 0 : PyErr_SetNTSTATUS(r->out.result);
21123 0 : return NULL;
21124 : }
21125 :
21126 0 : return result;
21127 : }
21128 :
21129 :
21130 0 : static PyObject *py_lsa_EnumPrivsAccount_in_get_handle(PyObject *obj, void *closure)
21131 : {
21132 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21133 0 : PyObject *py_handle;
21134 0 : if (object->in.handle == NULL) {
21135 0 : Py_RETURN_NONE;
21136 : }
21137 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21138 0 : return py_handle;
21139 : }
21140 :
21141 0 : static int py_lsa_EnumPrivsAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21142 : {
21143 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21144 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21145 0 : if (value == NULL) {
21146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
21147 0 : return -1;
21148 : }
21149 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21150 0 : if (object->in.handle == NULL) {
21151 0 : PyErr_NoMemory();
21152 0 : return -1;
21153 : }
21154 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21155 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21156 0 : PyErr_NoMemory();
21157 0 : return -1;
21158 : }
21159 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21160 0 : return 0;
21161 : }
21162 :
21163 0 : static PyObject *py_lsa_EnumPrivsAccount_out_get_privs(PyObject *obj, void *closure)
21164 : {
21165 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21166 0 : PyObject *py_privs;
21167 0 : if (object->out.privs == NULL) {
21168 0 : Py_RETURN_NONE;
21169 : }
21170 0 : if (*object->out.privs == NULL) {
21171 0 : py_privs = Py_None;
21172 0 : Py_INCREF(py_privs);
21173 : } else {
21174 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *object->out.privs, *object->out.privs);
21175 : }
21176 0 : return py_privs;
21177 : }
21178 :
21179 0 : static int py_lsa_EnumPrivsAccount_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
21180 : {
21181 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21182 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
21183 0 : if (value == NULL) {
21184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.privs");
21185 0 : return -1;
21186 : }
21187 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
21188 0 : if (object->out.privs == NULL) {
21189 0 : PyErr_NoMemory();
21190 0 : return -1;
21191 : }
21192 0 : if (value == Py_None) {
21193 0 : *object->out.privs = NULL;
21194 : } else {
21195 0 : *object->out.privs = NULL;
21196 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
21197 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21198 0 : PyErr_NoMemory();
21199 0 : return -1;
21200 : }
21201 0 : *object->out.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
21202 : }
21203 0 : return 0;
21204 : }
21205 :
21206 0 : static PyObject *py_lsa_EnumPrivsAccount_get_result(PyObject *obj, void *closure)
21207 : {
21208 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(obj);
21209 0 : PyObject *py_result;
21210 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21211 0 : return py_result;
21212 : }
21213 :
21214 0 : static int py_lsa_EnumPrivsAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
21215 : {
21216 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21217 0 : if (value == NULL) {
21218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21219 0 : return -1;
21220 : }
21221 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21222 0 : return 0;
21223 : }
21224 :
21225 : static PyGetSetDef py_lsa_EnumPrivsAccount_getsetters[] = {
21226 : {
21227 : .name = discard_const_p(char, "in_handle"),
21228 : .get = py_lsa_EnumPrivsAccount_in_get_handle,
21229 : .set = py_lsa_EnumPrivsAccount_in_set_handle,
21230 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21231 : },
21232 : {
21233 : .name = discard_const_p(char, "out_privs"),
21234 : .get = py_lsa_EnumPrivsAccount_out_get_privs,
21235 : .set = py_lsa_EnumPrivsAccount_out_set_privs,
21236 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
21237 : },
21238 : {
21239 : .name = discard_const_p(char, "result"),
21240 : .get = py_lsa_EnumPrivsAccount_get_result,
21241 : .set = py_lsa_EnumPrivsAccount_set_result,
21242 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21243 : },
21244 : { .name = NULL }
21245 : };
21246 :
21247 0 : static PyObject *py_lsa_EnumPrivsAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21248 : {
21249 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivsAccount, type);
21250 0 : struct lsa_EnumPrivsAccount *_self = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(self);
21251 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21252 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21253 : /* a pointer to a NULL pointer */
21254 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet *);
21255 0 : return self;
21256 : }
21257 :
21258 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21259 : {
21260 :
21261 :
21262 0 : return PyLong_FromLong(18);
21263 : }
21264 :
21265 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21266 : {
21267 0 : const struct ndr_interface_call *call = NULL;
21268 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21269 0 : PyObject *ret = NULL;
21270 0 : struct ndr_push *push = NULL;
21271 0 : DATA_BLOB blob;
21272 0 : enum ndr_err_code err;
21273 :
21274 0 : if (ndr_table_lsarpc.num_calls < 19) {
21275 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_pack");
21276 0 : return NULL;
21277 : }
21278 0 : call = &ndr_table_lsarpc.calls[18];
21279 :
21280 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21281 0 : if (push == NULL) {
21282 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21283 0 : return NULL;
21284 : }
21285 :
21286 0 : push->flags |= ndr_push_flags;
21287 :
21288 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21289 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21290 0 : TALLOC_FREE(push);
21291 0 : PyErr_SetNdrError(err);
21292 0 : return NULL;
21293 : }
21294 0 : blob = ndr_push_blob(push);
21295 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21296 0 : TALLOC_FREE(push);
21297 0 : return ret;
21298 : }
21299 :
21300 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21301 : {
21302 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21303 0 : PyObject *bigendian_obj = NULL;
21304 0 : PyObject *ndr64_obj = NULL;
21305 0 : libndr_flags ndr_push_flags = 0;
21306 :
21307 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21308 : discard_const_p(char *, kwnames),
21309 : &bigendian_obj,
21310 : &ndr64_obj)) {
21311 0 : return NULL;
21312 : }
21313 :
21314 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21315 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21316 : }
21317 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21318 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21319 : }
21320 :
21321 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21322 : }
21323 :
21324 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21325 : {
21326 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21327 0 : PyObject *bigendian_obj = NULL;
21328 0 : PyObject *ndr64_obj = NULL;
21329 0 : libndr_flags ndr_push_flags = 0;
21330 :
21331 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21332 : discard_const_p(char *, kwnames),
21333 : &bigendian_obj,
21334 : &ndr64_obj)) {
21335 0 : return NULL;
21336 : }
21337 :
21338 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21339 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21340 : }
21341 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21342 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21343 : }
21344 :
21345 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21346 : }
21347 :
21348 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21349 : {
21350 0 : const struct ndr_interface_call *call = NULL;
21351 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21352 0 : struct ndr_pull *pull = NULL;
21353 0 : enum ndr_err_code err;
21354 :
21355 0 : if (ndr_table_lsarpc.num_calls < 19) {
21356 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_unpack");
21357 0 : return NULL;
21358 : }
21359 0 : call = &ndr_table_lsarpc.calls[18];
21360 :
21361 0 : pull = ndr_pull_init_blob(blob, object);
21362 0 : if (pull == NULL) {
21363 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21364 0 : return NULL;
21365 : }
21366 :
21367 0 : pull->flags |= ndr_pull_flags;
21368 :
21369 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21370 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21371 0 : TALLOC_FREE(pull);
21372 0 : PyErr_SetNdrError(err);
21373 0 : return NULL;
21374 : }
21375 0 : if (!allow_remaining) {
21376 0 : uint32_t highest_ofs;
21377 :
21378 0 : if (pull->offset > pull->relative_highest_offset) {
21379 0 : highest_ofs = pull->offset;
21380 : } else {
21381 0 : highest_ofs = pull->relative_highest_offset;
21382 : }
21383 0 : if (highest_ofs < pull->data_size) {
21384 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21385 : "not all bytes consumed ofs[%u] size[%u]",
21386 : highest_ofs, pull->data_size);
21387 0 : TALLOC_FREE(pull);
21388 0 : PyErr_SetNdrError(err);
21389 0 : return NULL;
21390 : }
21391 : }
21392 :
21393 0 : TALLOC_FREE(pull);
21394 0 : Py_RETURN_NONE;
21395 : }
21396 :
21397 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21398 : {
21399 0 : DATA_BLOB blob;
21400 0 : Py_ssize_t blob_length = 0;
21401 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21402 0 : PyObject *bigendian_obj = NULL;
21403 0 : PyObject *ndr64_obj = NULL;
21404 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21405 0 : PyObject *allow_remaining_obj = NULL;
21406 0 : bool allow_remaining = false;
21407 :
21408 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21409 : discard_const_p(char *, kwnames),
21410 : &blob.data, &blob_length,
21411 : &bigendian_obj,
21412 : &ndr64_obj,
21413 : &allow_remaining_obj)) {
21414 0 : return NULL;
21415 : }
21416 0 : blob.length = blob_length;
21417 :
21418 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21419 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21420 : }
21421 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21422 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21423 : }
21424 :
21425 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21426 0 : allow_remaining = true;
21427 : }
21428 :
21429 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21430 : }
21431 :
21432 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21433 : {
21434 0 : DATA_BLOB blob;
21435 0 : Py_ssize_t blob_length = 0;
21436 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21437 0 : PyObject *bigendian_obj = NULL;
21438 0 : PyObject *ndr64_obj = NULL;
21439 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21440 0 : PyObject *allow_remaining_obj = NULL;
21441 0 : bool allow_remaining = false;
21442 :
21443 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21444 : discard_const_p(char *, kwnames),
21445 : &blob.data, &blob_length,
21446 : &bigendian_obj,
21447 : &ndr64_obj,
21448 : &allow_remaining_obj)) {
21449 0 : return NULL;
21450 : }
21451 0 : blob.length = blob_length;
21452 :
21453 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21454 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21455 : }
21456 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21457 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21458 : }
21459 :
21460 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21461 0 : allow_remaining = true;
21462 : }
21463 :
21464 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21465 : }
21466 :
21467 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21468 : {
21469 0 : const struct ndr_interface_call *call = NULL;
21470 0 : struct lsa_EnumPrivsAccount *object = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(py_obj);
21471 0 : PyObject *ret;
21472 0 : char *retstr;
21473 :
21474 0 : if (ndr_table_lsarpc.num_calls < 19) {
21475 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_print");
21476 0 : return NULL;
21477 : }
21478 0 : call = &ndr_table_lsarpc.calls[18];
21479 :
21480 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21481 0 : ret = PyUnicode_FromString(retstr);
21482 0 : TALLOC_FREE(retstr);
21483 :
21484 0 : return ret;
21485 : }
21486 :
21487 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21488 : {
21489 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_in", NDR_IN);
21490 : }
21491 :
21492 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21493 : {
21494 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_out", NDR_OUT);
21495 : }
21496 :
21497 : static PyMethodDef py_lsa_EnumPrivsAccount_methods[] = {
21498 : { "opnum", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21499 : "lsa.EnumPrivsAccount.opnum() -> 18 (0x12) " },
21500 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21501 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21502 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21503 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21504 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21505 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21506 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21507 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21508 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21509 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21510 : { NULL, NULL, 0, NULL }
21511 : };
21512 :
21513 :
21514 : static PyTypeObject lsa_EnumPrivsAccount_Type = {
21515 : PyVarObject_HEAD_INIT(NULL, 0)
21516 : .tp_name = "lsa.EnumPrivsAccount",
21517 : .tp_getset = py_lsa_EnumPrivsAccount_getsetters,
21518 : .tp_methods = py_lsa_EnumPrivsAccount_methods,
21519 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21520 : .tp_new = py_lsa_EnumPrivsAccount_new,
21521 : };
21522 :
21523 0 : static bool pack_py_lsa_EnumPrivsAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivsAccount *r)
21524 : {
21525 0 : PyObject *py_handle;
21526 0 : const char *kwnames[] = {
21527 : "handle", NULL
21528 : };
21529 :
21530 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_EnumPrivsAccount", discard_const_p(char *, kwnames), &py_handle)) {
21531 0 : return false;
21532 : }
21533 :
21534 0 : if (py_handle == NULL) {
21535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21536 0 : return false;
21537 : }
21538 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21539 0 : if (r->in.handle == NULL) {
21540 0 : PyErr_NoMemory();
21541 0 : return false;
21542 : }
21543 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21544 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21545 0 : PyErr_NoMemory();
21546 0 : return false;
21547 : }
21548 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21549 0 : return true;
21550 : }
21551 :
21552 0 : static PyObject *unpack_py_lsa_EnumPrivsAccount_args_out(struct lsa_EnumPrivsAccount *r)
21553 : {
21554 0 : PyObject *result;
21555 0 : PyObject *py_privs;
21556 0 : if (*r->out.privs == NULL) {
21557 0 : py_privs = Py_None;
21558 0 : Py_INCREF(py_privs);
21559 : } else {
21560 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *r->out.privs, *r->out.privs);
21561 : }
21562 0 : result = py_privs;
21563 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21564 0 : PyErr_SetNTSTATUS(r->out.result);
21565 0 : return NULL;
21566 : }
21567 :
21568 0 : return result;
21569 : }
21570 :
21571 :
21572 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_handle(PyObject *obj, void *closure)
21573 : {
21574 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21575 0 : PyObject *py_handle;
21576 0 : if (object->in.handle == NULL) {
21577 0 : Py_RETURN_NONE;
21578 : }
21579 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21580 0 : return py_handle;
21581 : }
21582 :
21583 0 : static int py_lsa_AddPrivilegesToAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21584 : {
21585 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21586 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21587 0 : if (value == NULL) {
21588 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
21589 0 : return -1;
21590 : }
21591 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21592 0 : if (object->in.handle == NULL) {
21593 0 : PyErr_NoMemory();
21594 0 : return -1;
21595 : }
21596 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21597 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21598 0 : PyErr_NoMemory();
21599 0 : return -1;
21600 : }
21601 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21602 0 : return 0;
21603 : }
21604 :
21605 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_privs(PyObject *obj, void *closure)
21606 : {
21607 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21608 0 : PyObject *py_privs;
21609 0 : if (object->in.privs == NULL) {
21610 0 : Py_RETURN_NONE;
21611 : }
21612 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
21613 0 : return py_privs;
21614 : }
21615 :
21616 0 : static int py_lsa_AddPrivilegesToAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
21617 : {
21618 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21619 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
21620 0 : if (value == NULL) {
21621 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.privs");
21622 0 : return -1;
21623 : }
21624 0 : object->in.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.privs);
21625 0 : if (object->in.privs == NULL) {
21626 0 : PyErr_NoMemory();
21627 0 : return -1;
21628 : }
21629 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
21630 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21631 0 : PyErr_NoMemory();
21632 0 : return -1;
21633 : }
21634 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
21635 0 : return 0;
21636 : }
21637 :
21638 0 : static PyObject *py_lsa_AddPrivilegesToAccount_get_result(PyObject *obj, void *closure)
21639 : {
21640 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(obj);
21641 0 : PyObject *py_result;
21642 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21643 0 : return py_result;
21644 : }
21645 :
21646 0 : static int py_lsa_AddPrivilegesToAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
21647 : {
21648 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21649 0 : if (value == NULL) {
21650 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21651 0 : return -1;
21652 : }
21653 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21654 0 : return 0;
21655 : }
21656 :
21657 : static PyGetSetDef py_lsa_AddPrivilegesToAccount_getsetters[] = {
21658 : {
21659 : .name = discard_const_p(char, "in_handle"),
21660 : .get = py_lsa_AddPrivilegesToAccount_in_get_handle,
21661 : .set = py_lsa_AddPrivilegesToAccount_in_set_handle,
21662 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21663 : },
21664 : {
21665 : .name = discard_const_p(char, "in_privs"),
21666 : .get = py_lsa_AddPrivilegesToAccount_in_get_privs,
21667 : .set = py_lsa_AddPrivilegesToAccount_in_set_privs,
21668 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
21669 : },
21670 : {
21671 : .name = discard_const_p(char, "result"),
21672 : .get = py_lsa_AddPrivilegesToAccount_get_result,
21673 : .set = py_lsa_AddPrivilegesToAccount_set_result,
21674 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21675 : },
21676 : { .name = NULL }
21677 : };
21678 :
21679 0 : static PyObject *py_lsa_AddPrivilegesToAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21680 : {
21681 0 : PyObject *self = pytalloc_new(struct lsa_AddPrivilegesToAccount, type);
21682 0 : struct lsa_AddPrivilegesToAccount *_self = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(self);
21683 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21684 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21685 0 : _self->in.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet);
21686 0 : return self;
21687 : }
21688 :
21689 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21690 : {
21691 :
21692 :
21693 0 : return PyLong_FromLong(19);
21694 : }
21695 :
21696 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21697 : {
21698 0 : const struct ndr_interface_call *call = NULL;
21699 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21700 0 : PyObject *ret = NULL;
21701 0 : struct ndr_push *push = NULL;
21702 0 : DATA_BLOB blob;
21703 0 : enum ndr_err_code err;
21704 :
21705 0 : if (ndr_table_lsarpc.num_calls < 20) {
21706 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_pack");
21707 0 : return NULL;
21708 : }
21709 0 : call = &ndr_table_lsarpc.calls[19];
21710 :
21711 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21712 0 : if (push == NULL) {
21713 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21714 0 : return NULL;
21715 : }
21716 :
21717 0 : push->flags |= ndr_push_flags;
21718 :
21719 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21720 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21721 0 : TALLOC_FREE(push);
21722 0 : PyErr_SetNdrError(err);
21723 0 : return NULL;
21724 : }
21725 0 : blob = ndr_push_blob(push);
21726 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21727 0 : TALLOC_FREE(push);
21728 0 : return ret;
21729 : }
21730 :
21731 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21732 : {
21733 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21734 0 : PyObject *bigendian_obj = NULL;
21735 0 : PyObject *ndr64_obj = NULL;
21736 0 : libndr_flags ndr_push_flags = 0;
21737 :
21738 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21739 : discard_const_p(char *, kwnames),
21740 : &bigendian_obj,
21741 : &ndr64_obj)) {
21742 0 : return NULL;
21743 : }
21744 :
21745 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21746 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21747 : }
21748 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21749 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21750 : }
21751 :
21752 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21753 : }
21754 :
21755 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21756 : {
21757 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21758 0 : PyObject *bigendian_obj = NULL;
21759 0 : PyObject *ndr64_obj = NULL;
21760 0 : libndr_flags ndr_push_flags = 0;
21761 :
21762 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21763 : discard_const_p(char *, kwnames),
21764 : &bigendian_obj,
21765 : &ndr64_obj)) {
21766 0 : return NULL;
21767 : }
21768 :
21769 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21770 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21771 : }
21772 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21773 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21774 : }
21775 :
21776 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21777 : }
21778 :
21779 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21780 : {
21781 0 : const struct ndr_interface_call *call = NULL;
21782 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21783 0 : struct ndr_pull *pull = NULL;
21784 0 : enum ndr_err_code err;
21785 :
21786 0 : if (ndr_table_lsarpc.num_calls < 20) {
21787 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_unpack");
21788 0 : return NULL;
21789 : }
21790 0 : call = &ndr_table_lsarpc.calls[19];
21791 :
21792 0 : pull = ndr_pull_init_blob(blob, object);
21793 0 : if (pull == NULL) {
21794 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21795 0 : return NULL;
21796 : }
21797 :
21798 0 : pull->flags |= ndr_pull_flags;
21799 :
21800 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21801 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21802 0 : TALLOC_FREE(pull);
21803 0 : PyErr_SetNdrError(err);
21804 0 : return NULL;
21805 : }
21806 0 : if (!allow_remaining) {
21807 0 : uint32_t highest_ofs;
21808 :
21809 0 : if (pull->offset > pull->relative_highest_offset) {
21810 0 : highest_ofs = pull->offset;
21811 : } else {
21812 0 : highest_ofs = pull->relative_highest_offset;
21813 : }
21814 0 : if (highest_ofs < pull->data_size) {
21815 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21816 : "not all bytes consumed ofs[%u] size[%u]",
21817 : highest_ofs, pull->data_size);
21818 0 : TALLOC_FREE(pull);
21819 0 : PyErr_SetNdrError(err);
21820 0 : return NULL;
21821 : }
21822 : }
21823 :
21824 0 : TALLOC_FREE(pull);
21825 0 : Py_RETURN_NONE;
21826 : }
21827 :
21828 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21829 : {
21830 0 : DATA_BLOB blob;
21831 0 : Py_ssize_t blob_length = 0;
21832 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21833 0 : PyObject *bigendian_obj = NULL;
21834 0 : PyObject *ndr64_obj = NULL;
21835 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21836 0 : PyObject *allow_remaining_obj = NULL;
21837 0 : bool allow_remaining = false;
21838 :
21839 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21840 : discard_const_p(char *, kwnames),
21841 : &blob.data, &blob_length,
21842 : &bigendian_obj,
21843 : &ndr64_obj,
21844 : &allow_remaining_obj)) {
21845 0 : return NULL;
21846 : }
21847 0 : blob.length = blob_length;
21848 :
21849 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21850 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21851 : }
21852 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21853 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21854 : }
21855 :
21856 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21857 0 : allow_remaining = true;
21858 : }
21859 :
21860 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21861 : }
21862 :
21863 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21864 : {
21865 0 : DATA_BLOB blob;
21866 0 : Py_ssize_t blob_length = 0;
21867 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21868 0 : PyObject *bigendian_obj = NULL;
21869 0 : PyObject *ndr64_obj = NULL;
21870 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21871 0 : PyObject *allow_remaining_obj = NULL;
21872 0 : bool allow_remaining = false;
21873 :
21874 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21875 : discard_const_p(char *, kwnames),
21876 : &blob.data, &blob_length,
21877 : &bigendian_obj,
21878 : &ndr64_obj,
21879 : &allow_remaining_obj)) {
21880 0 : return NULL;
21881 : }
21882 0 : blob.length = blob_length;
21883 :
21884 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21885 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21886 : }
21887 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21888 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21889 : }
21890 :
21891 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21892 0 : allow_remaining = true;
21893 : }
21894 :
21895 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21896 : }
21897 :
21898 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21899 : {
21900 0 : const struct ndr_interface_call *call = NULL;
21901 0 : struct lsa_AddPrivilegesToAccount *object = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(py_obj);
21902 0 : PyObject *ret;
21903 0 : char *retstr;
21904 :
21905 0 : if (ndr_table_lsarpc.num_calls < 20) {
21906 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_print");
21907 0 : return NULL;
21908 : }
21909 0 : call = &ndr_table_lsarpc.calls[19];
21910 :
21911 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21912 0 : ret = PyUnicode_FromString(retstr);
21913 0 : TALLOC_FREE(retstr);
21914 :
21915 0 : return ret;
21916 : }
21917 :
21918 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21919 : {
21920 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_in", NDR_IN);
21921 : }
21922 :
21923 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21924 : {
21925 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_out", NDR_OUT);
21926 : }
21927 :
21928 : static PyMethodDef py_lsa_AddPrivilegesToAccount_methods[] = {
21929 : { "opnum", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
21930 : "lsa.AddPrivilegesToAccount.opnum() -> 19 (0x13) " },
21931 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21932 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21933 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21934 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21935 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21936 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21937 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21938 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21939 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21940 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21941 : { NULL, NULL, 0, NULL }
21942 : };
21943 :
21944 :
21945 : static PyTypeObject lsa_AddPrivilegesToAccount_Type = {
21946 : PyVarObject_HEAD_INIT(NULL, 0)
21947 : .tp_name = "lsa.AddPrivilegesToAccount",
21948 : .tp_getset = py_lsa_AddPrivilegesToAccount_getsetters,
21949 : .tp_methods = py_lsa_AddPrivilegesToAccount_methods,
21950 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21951 : .tp_new = py_lsa_AddPrivilegesToAccount_new,
21952 : };
21953 :
21954 0 : static bool pack_py_lsa_AddPrivilegesToAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddPrivilegesToAccount *r)
21955 : {
21956 0 : PyObject *py_handle;
21957 0 : PyObject *py_privs;
21958 0 : const char *kwnames[] = {
21959 : "handle", "privs", NULL
21960 : };
21961 :
21962 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_AddPrivilegesToAccount", discard_const_p(char *, kwnames), &py_handle, &py_privs)) {
21963 0 : return false;
21964 : }
21965 :
21966 0 : if (py_handle == NULL) {
21967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
21968 0 : return false;
21969 : }
21970 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21971 0 : if (r->in.handle == NULL) {
21972 0 : PyErr_NoMemory();
21973 0 : return false;
21974 : }
21975 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21976 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21977 0 : PyErr_NoMemory();
21978 0 : return false;
21979 : }
21980 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21981 0 : if (py_privs == NULL) {
21982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.privs");
21983 0 : return false;
21984 : }
21985 0 : r->in.privs = talloc_ptrtype(r, r->in.privs);
21986 0 : if (r->in.privs == NULL) {
21987 0 : PyErr_NoMemory();
21988 0 : return false;
21989 : }
21990 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
21991 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
21992 0 : PyErr_NoMemory();
21993 0 : return false;
21994 : }
21995 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
21996 0 : return true;
21997 : }
21998 :
21999 0 : static PyObject *unpack_py_lsa_AddPrivilegesToAccount_args_out(struct lsa_AddPrivilegesToAccount *r)
22000 : {
22001 0 : PyObject *result;
22002 0 : result = Py_None;
22003 0 : Py_INCREF(result);
22004 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22005 0 : PyErr_SetNTSTATUS(r->out.result);
22006 0 : return NULL;
22007 : }
22008 :
22009 0 : return result;
22010 : }
22011 :
22012 :
22013 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_handle(PyObject *obj, void *closure)
22014 : {
22015 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22016 0 : PyObject *py_handle;
22017 0 : if (object->in.handle == NULL) {
22018 0 : Py_RETURN_NONE;
22019 : }
22020 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22021 0 : return py_handle;
22022 : }
22023 :
22024 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22025 : {
22026 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22027 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22028 0 : if (value == NULL) {
22029 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22030 0 : return -1;
22031 : }
22032 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22033 0 : if (object->in.handle == NULL) {
22034 0 : PyErr_NoMemory();
22035 0 : return -1;
22036 : }
22037 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22038 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22039 0 : PyErr_NoMemory();
22040 0 : return -1;
22041 : }
22042 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22043 0 : return 0;
22044 : }
22045 :
22046 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_remove_all(PyObject *obj, void *closure)
22047 : {
22048 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22049 0 : PyObject *py_remove_all;
22050 0 : py_remove_all = PyLong_FromLong((uint16_t)object->in.remove_all);
22051 0 : return py_remove_all;
22052 : }
22053 :
22054 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
22055 : {
22056 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22057 0 : if (value == NULL) {
22058 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.remove_all");
22059 0 : return -1;
22060 : }
22061 : {
22062 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
22063 0 : if (PyLong_Check(value)) {
22064 0 : unsigned long long test_var;
22065 0 : test_var = PyLong_AsUnsignedLongLong(value);
22066 0 : if (PyErr_Occurred() != NULL) {
22067 0 : return -1;
22068 : }
22069 0 : if (test_var > uint_max) {
22070 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22071 : PyLong_Type.tp_name, uint_max, test_var);
22072 0 : return -1;
22073 : }
22074 0 : object->in.remove_all = test_var;
22075 : } else {
22076 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22077 : PyLong_Type.tp_name);
22078 0 : return -1;
22079 : }
22080 : }
22081 0 : return 0;
22082 : }
22083 :
22084 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_privs(PyObject *obj, void *closure)
22085 : {
22086 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22087 0 : PyObject *py_privs;
22088 0 : if (object->in.privs == NULL) {
22089 0 : Py_RETURN_NONE;
22090 : }
22091 0 : if (object->in.privs == NULL) {
22092 0 : py_privs = Py_None;
22093 0 : Py_INCREF(py_privs);
22094 : } else {
22095 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
22096 : }
22097 0 : return py_privs;
22098 : }
22099 :
22100 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
22101 : {
22102 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
22104 0 : if (value == NULL) {
22105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.privs");
22106 0 : return -1;
22107 : }
22108 0 : if (value == Py_None) {
22109 0 : object->in.privs = NULL;
22110 : } else {
22111 0 : object->in.privs = NULL;
22112 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
22113 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22114 0 : PyErr_NoMemory();
22115 0 : return -1;
22116 : }
22117 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
22118 : }
22119 0 : return 0;
22120 : }
22121 :
22122 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_get_result(PyObject *obj, void *closure)
22123 : {
22124 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(obj);
22125 0 : PyObject *py_result;
22126 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22127 0 : return py_result;
22128 : }
22129 :
22130 0 : static int py_lsa_RemovePrivilegesFromAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22131 : {
22132 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22133 0 : if (value == NULL) {
22134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22135 0 : return -1;
22136 : }
22137 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22138 0 : return 0;
22139 : }
22140 :
22141 : static PyGetSetDef py_lsa_RemovePrivilegesFromAccount_getsetters[] = {
22142 : {
22143 : .name = discard_const_p(char, "in_handle"),
22144 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_handle,
22145 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_handle,
22146 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22147 : },
22148 : {
22149 : .name = discard_const_p(char, "in_remove_all"),
22150 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_remove_all,
22151 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_remove_all,
22152 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
22153 : },
22154 : {
22155 : .name = discard_const_p(char, "in_privs"),
22156 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_privs,
22157 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_privs,
22158 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
22159 : },
22160 : {
22161 : .name = discard_const_p(char, "result"),
22162 : .get = py_lsa_RemovePrivilegesFromAccount_get_result,
22163 : .set = py_lsa_RemovePrivilegesFromAccount_set_result,
22164 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22165 : },
22166 : { .name = NULL }
22167 : };
22168 :
22169 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22170 : {
22171 0 : PyObject *self = pytalloc_new(struct lsa_RemovePrivilegesFromAccount, type);
22172 0 : struct lsa_RemovePrivilegesFromAccount *_self = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(self);
22173 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22174 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22175 0 : return self;
22176 : }
22177 :
22178 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22179 : {
22180 :
22181 :
22182 0 : return PyLong_FromLong(20);
22183 : }
22184 :
22185 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22186 : {
22187 0 : const struct ndr_interface_call *call = NULL;
22188 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22189 0 : PyObject *ret = NULL;
22190 0 : struct ndr_push *push = NULL;
22191 0 : DATA_BLOB blob;
22192 0 : enum ndr_err_code err;
22193 :
22194 0 : if (ndr_table_lsarpc.num_calls < 21) {
22195 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_pack");
22196 0 : return NULL;
22197 : }
22198 0 : call = &ndr_table_lsarpc.calls[20];
22199 :
22200 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22201 0 : if (push == NULL) {
22202 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22203 0 : return NULL;
22204 : }
22205 :
22206 0 : push->flags |= ndr_push_flags;
22207 :
22208 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22209 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22210 0 : TALLOC_FREE(push);
22211 0 : PyErr_SetNdrError(err);
22212 0 : return NULL;
22213 : }
22214 0 : blob = ndr_push_blob(push);
22215 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22216 0 : TALLOC_FREE(push);
22217 0 : return ret;
22218 : }
22219 :
22220 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22221 : {
22222 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22223 0 : PyObject *bigendian_obj = NULL;
22224 0 : PyObject *ndr64_obj = NULL;
22225 0 : libndr_flags ndr_push_flags = 0;
22226 :
22227 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22228 : discard_const_p(char *, kwnames),
22229 : &bigendian_obj,
22230 : &ndr64_obj)) {
22231 0 : return NULL;
22232 : }
22233 :
22234 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22235 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22236 : }
22237 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22238 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22239 : }
22240 :
22241 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22242 : }
22243 :
22244 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22245 : {
22246 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22247 0 : PyObject *bigendian_obj = NULL;
22248 0 : PyObject *ndr64_obj = NULL;
22249 0 : libndr_flags ndr_push_flags = 0;
22250 :
22251 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22252 : discard_const_p(char *, kwnames),
22253 : &bigendian_obj,
22254 : &ndr64_obj)) {
22255 0 : return NULL;
22256 : }
22257 :
22258 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22259 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22260 : }
22261 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22262 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22263 : }
22264 :
22265 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22266 : }
22267 :
22268 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
22269 : {
22270 0 : const struct ndr_interface_call *call = NULL;
22271 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22272 0 : struct ndr_pull *pull = NULL;
22273 0 : enum ndr_err_code err;
22274 :
22275 0 : if (ndr_table_lsarpc.num_calls < 21) {
22276 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_unpack");
22277 0 : return NULL;
22278 : }
22279 0 : call = &ndr_table_lsarpc.calls[20];
22280 :
22281 0 : pull = ndr_pull_init_blob(blob, object);
22282 0 : if (pull == NULL) {
22283 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22284 0 : return NULL;
22285 : }
22286 :
22287 0 : pull->flags |= ndr_pull_flags;
22288 :
22289 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22290 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22291 0 : TALLOC_FREE(pull);
22292 0 : PyErr_SetNdrError(err);
22293 0 : return NULL;
22294 : }
22295 0 : if (!allow_remaining) {
22296 0 : uint32_t highest_ofs;
22297 :
22298 0 : if (pull->offset > pull->relative_highest_offset) {
22299 0 : highest_ofs = pull->offset;
22300 : } else {
22301 0 : highest_ofs = pull->relative_highest_offset;
22302 : }
22303 0 : if (highest_ofs < pull->data_size) {
22304 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22305 : "not all bytes consumed ofs[%u] size[%u]",
22306 : highest_ofs, pull->data_size);
22307 0 : TALLOC_FREE(pull);
22308 0 : PyErr_SetNdrError(err);
22309 0 : return NULL;
22310 : }
22311 : }
22312 :
22313 0 : TALLOC_FREE(pull);
22314 0 : Py_RETURN_NONE;
22315 : }
22316 :
22317 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22318 : {
22319 0 : DATA_BLOB blob;
22320 0 : Py_ssize_t blob_length = 0;
22321 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22322 0 : PyObject *bigendian_obj = NULL;
22323 0 : PyObject *ndr64_obj = NULL;
22324 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22325 0 : PyObject *allow_remaining_obj = NULL;
22326 0 : bool allow_remaining = false;
22327 :
22328 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22329 : discard_const_p(char *, kwnames),
22330 : &blob.data, &blob_length,
22331 : &bigendian_obj,
22332 : &ndr64_obj,
22333 : &allow_remaining_obj)) {
22334 0 : return NULL;
22335 : }
22336 0 : blob.length = blob_length;
22337 :
22338 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22339 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22340 : }
22341 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22342 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22343 : }
22344 :
22345 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22346 0 : allow_remaining = true;
22347 : }
22348 :
22349 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22350 : }
22351 :
22352 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22353 : {
22354 0 : DATA_BLOB blob;
22355 0 : Py_ssize_t blob_length = 0;
22356 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22357 0 : PyObject *bigendian_obj = NULL;
22358 0 : PyObject *ndr64_obj = NULL;
22359 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22360 0 : PyObject *allow_remaining_obj = NULL;
22361 0 : bool allow_remaining = false;
22362 :
22363 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22364 : discard_const_p(char *, kwnames),
22365 : &blob.data, &blob_length,
22366 : &bigendian_obj,
22367 : &ndr64_obj,
22368 : &allow_remaining_obj)) {
22369 0 : return NULL;
22370 : }
22371 0 : blob.length = blob_length;
22372 :
22373 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22374 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22375 : }
22376 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22377 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22378 : }
22379 :
22380 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22381 0 : allow_remaining = true;
22382 : }
22383 :
22384 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22385 : }
22386 :
22387 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22388 : {
22389 0 : const struct ndr_interface_call *call = NULL;
22390 0 : struct lsa_RemovePrivilegesFromAccount *object = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(py_obj);
22391 0 : PyObject *ret;
22392 0 : char *retstr;
22393 :
22394 0 : if (ndr_table_lsarpc.num_calls < 21) {
22395 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_print");
22396 0 : return NULL;
22397 : }
22398 0 : call = &ndr_table_lsarpc.calls[20];
22399 :
22400 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22401 0 : ret = PyUnicode_FromString(retstr);
22402 0 : TALLOC_FREE(retstr);
22403 :
22404 0 : return ret;
22405 : }
22406 :
22407 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22408 : {
22409 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_in", NDR_IN);
22410 : }
22411 :
22412 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22413 : {
22414 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_out", NDR_OUT);
22415 : }
22416 :
22417 : static PyMethodDef py_lsa_RemovePrivilegesFromAccount_methods[] = {
22418 : { "opnum", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22419 : "lsa.RemovePrivilegesFromAccount.opnum() -> 20 (0x14) " },
22420 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22421 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22422 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22423 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22424 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22425 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22426 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22427 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22428 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22429 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22430 : { NULL, NULL, 0, NULL }
22431 : };
22432 :
22433 :
22434 : static PyTypeObject lsa_RemovePrivilegesFromAccount_Type = {
22435 : PyVarObject_HEAD_INIT(NULL, 0)
22436 : .tp_name = "lsa.RemovePrivilegesFromAccount",
22437 : .tp_getset = py_lsa_RemovePrivilegesFromAccount_getsetters,
22438 : .tp_methods = py_lsa_RemovePrivilegesFromAccount_methods,
22439 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22440 : .tp_new = py_lsa_RemovePrivilegesFromAccount_new,
22441 : };
22442 :
22443 0 : static bool pack_py_lsa_RemovePrivilegesFromAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemovePrivilegesFromAccount *r)
22444 : {
22445 0 : PyObject *py_handle;
22446 0 : PyObject *py_remove_all;
22447 0 : PyObject *py_privs;
22448 0 : const char *kwnames[] = {
22449 : "handle", "remove_all", "privs", NULL
22450 : };
22451 :
22452 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RemovePrivilegesFromAccount", discard_const_p(char *, kwnames), &py_handle, &py_remove_all, &py_privs)) {
22453 0 : return false;
22454 : }
22455 :
22456 0 : if (py_handle == NULL) {
22457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
22458 0 : return false;
22459 : }
22460 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22461 0 : if (r->in.handle == NULL) {
22462 0 : PyErr_NoMemory();
22463 0 : return false;
22464 : }
22465 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22466 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22467 0 : PyErr_NoMemory();
22468 0 : return false;
22469 : }
22470 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22471 0 : if (py_remove_all == NULL) {
22472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.remove_all");
22473 0 : return false;
22474 : }
22475 : {
22476 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
22477 0 : if (PyLong_Check(py_remove_all)) {
22478 0 : unsigned long long test_var;
22479 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
22480 0 : if (PyErr_Occurred() != NULL) {
22481 0 : return false;
22482 : }
22483 0 : if (test_var > uint_max) {
22484 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22485 : PyLong_Type.tp_name, uint_max, test_var);
22486 0 : return false;
22487 : }
22488 0 : r->in.remove_all = test_var;
22489 : } else {
22490 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22491 : PyLong_Type.tp_name);
22492 0 : return false;
22493 : }
22494 : }
22495 0 : if (py_privs == NULL) {
22496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.privs");
22497 0 : return false;
22498 : }
22499 0 : if (py_privs == Py_None) {
22500 0 : r->in.privs = NULL;
22501 : } else {
22502 0 : r->in.privs = NULL;
22503 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
22504 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
22505 0 : PyErr_NoMemory();
22506 0 : return false;
22507 : }
22508 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
22509 : }
22510 0 : return true;
22511 : }
22512 :
22513 0 : static PyObject *unpack_py_lsa_RemovePrivilegesFromAccount_args_out(struct lsa_RemovePrivilegesFromAccount *r)
22514 : {
22515 0 : PyObject *result;
22516 0 : result = Py_None;
22517 0 : Py_INCREF(result);
22518 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22519 0 : PyErr_SetNTSTATUS(r->out.result);
22520 0 : return NULL;
22521 : }
22522 :
22523 0 : return result;
22524 : }
22525 :
22526 :
22527 0 : static PyObject *py_lsa_GetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
22528 : {
22529 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22530 0 : PyObject *py_handle;
22531 0 : if (object->in.handle == NULL) {
22532 0 : Py_RETURN_NONE;
22533 : }
22534 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22535 0 : return py_handle;
22536 : }
22537 :
22538 0 : static int py_lsa_GetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22539 : {
22540 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22541 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22542 0 : if (value == NULL) {
22543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22544 0 : return -1;
22545 : }
22546 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22547 0 : if (object->in.handle == NULL) {
22548 0 : PyErr_NoMemory();
22549 0 : return -1;
22550 : }
22551 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22552 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22553 0 : PyErr_NoMemory();
22554 0 : return -1;
22555 : }
22556 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22557 0 : return 0;
22558 : }
22559 :
22560 0 : static PyObject *py_lsa_GetSystemAccessAccount_out_get_access_mask(PyObject *obj, void *closure)
22561 : {
22562 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22563 0 : PyObject *py_access_mask;
22564 0 : if (object->out.access_mask == NULL) {
22565 0 : Py_RETURN_NONE;
22566 : }
22567 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)*object->out.access_mask);
22568 0 : return py_access_mask;
22569 : }
22570 :
22571 0 : static int py_lsa_GetSystemAccessAccount_out_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
22572 : {
22573 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22574 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.access_mask));
22575 0 : if (value == NULL) {
22576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.access_mask");
22577 0 : return -1;
22578 : }
22579 0 : object->out.access_mask = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.access_mask);
22580 0 : if (object->out.access_mask == NULL) {
22581 0 : PyErr_NoMemory();
22582 0 : return -1;
22583 : }
22584 : {
22585 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.access_mask));
22586 0 : if (PyLong_Check(value)) {
22587 0 : unsigned long long test_var;
22588 0 : test_var = PyLong_AsUnsignedLongLong(value);
22589 0 : if (PyErr_Occurred() != NULL) {
22590 0 : return -1;
22591 : }
22592 0 : if (test_var > uint_max) {
22593 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22594 : PyLong_Type.tp_name, uint_max, test_var);
22595 0 : return -1;
22596 : }
22597 0 : *object->out.access_mask = test_var;
22598 : } else {
22599 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22600 : PyLong_Type.tp_name);
22601 0 : return -1;
22602 : }
22603 : }
22604 0 : return 0;
22605 : }
22606 :
22607 0 : static PyObject *py_lsa_GetSystemAccessAccount_get_result(PyObject *obj, void *closure)
22608 : {
22609 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(obj);
22610 0 : PyObject *py_result;
22611 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22612 0 : return py_result;
22613 : }
22614 :
22615 0 : static int py_lsa_GetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22616 : {
22617 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22618 0 : if (value == NULL) {
22619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22620 0 : return -1;
22621 : }
22622 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22623 0 : return 0;
22624 : }
22625 :
22626 : static PyGetSetDef py_lsa_GetSystemAccessAccount_getsetters[] = {
22627 : {
22628 : .name = discard_const_p(char, "in_handle"),
22629 : .get = py_lsa_GetSystemAccessAccount_in_get_handle,
22630 : .set = py_lsa_GetSystemAccessAccount_in_set_handle,
22631 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22632 : },
22633 : {
22634 : .name = discard_const_p(char, "out_access_mask"),
22635 : .get = py_lsa_GetSystemAccessAccount_out_get_access_mask,
22636 : .set = py_lsa_GetSystemAccessAccount_out_set_access_mask,
22637 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
22638 : },
22639 : {
22640 : .name = discard_const_p(char, "result"),
22641 : .get = py_lsa_GetSystemAccessAccount_get_result,
22642 : .set = py_lsa_GetSystemAccessAccount_set_result,
22643 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22644 : },
22645 : { .name = NULL }
22646 : };
22647 :
22648 0 : static PyObject *py_lsa_GetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22649 : {
22650 0 : PyObject *self = pytalloc_new(struct lsa_GetSystemAccessAccount, type);
22651 0 : struct lsa_GetSystemAccessAccount *_self = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(self);
22652 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22653 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22654 0 : _self->out.access_mask = talloc_zero(mem_ctx, uint32_t);
22655 0 : return self;
22656 : }
22657 :
22658 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22659 : {
22660 :
22661 :
22662 0 : return PyLong_FromLong(23);
22663 : }
22664 :
22665 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22666 : {
22667 0 : const struct ndr_interface_call *call = NULL;
22668 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22669 0 : PyObject *ret = NULL;
22670 0 : struct ndr_push *push = NULL;
22671 0 : DATA_BLOB blob;
22672 0 : enum ndr_err_code err;
22673 :
22674 0 : if (ndr_table_lsarpc.num_calls < 24) {
22675 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_pack");
22676 0 : return NULL;
22677 : }
22678 0 : call = &ndr_table_lsarpc.calls[23];
22679 :
22680 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22681 0 : if (push == NULL) {
22682 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22683 0 : return NULL;
22684 : }
22685 :
22686 0 : push->flags |= ndr_push_flags;
22687 :
22688 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22689 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22690 0 : TALLOC_FREE(push);
22691 0 : PyErr_SetNdrError(err);
22692 0 : return NULL;
22693 : }
22694 0 : blob = ndr_push_blob(push);
22695 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22696 0 : TALLOC_FREE(push);
22697 0 : return ret;
22698 : }
22699 :
22700 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22701 : {
22702 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22703 0 : PyObject *bigendian_obj = NULL;
22704 0 : PyObject *ndr64_obj = NULL;
22705 0 : libndr_flags ndr_push_flags = 0;
22706 :
22707 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22708 : discard_const_p(char *, kwnames),
22709 : &bigendian_obj,
22710 : &ndr64_obj)) {
22711 0 : return NULL;
22712 : }
22713 :
22714 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22715 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22716 : }
22717 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22718 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22719 : }
22720 :
22721 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22722 : }
22723 :
22724 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22725 : {
22726 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22727 0 : PyObject *bigendian_obj = NULL;
22728 0 : PyObject *ndr64_obj = NULL;
22729 0 : libndr_flags ndr_push_flags = 0;
22730 :
22731 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22732 : discard_const_p(char *, kwnames),
22733 : &bigendian_obj,
22734 : &ndr64_obj)) {
22735 0 : return NULL;
22736 : }
22737 :
22738 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22739 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22740 : }
22741 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22742 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22743 : }
22744 :
22745 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22746 : }
22747 :
22748 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
22749 : {
22750 0 : const struct ndr_interface_call *call = NULL;
22751 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22752 0 : struct ndr_pull *pull = NULL;
22753 0 : enum ndr_err_code err;
22754 :
22755 0 : if (ndr_table_lsarpc.num_calls < 24) {
22756 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_unpack");
22757 0 : return NULL;
22758 : }
22759 0 : call = &ndr_table_lsarpc.calls[23];
22760 :
22761 0 : pull = ndr_pull_init_blob(blob, object);
22762 0 : if (pull == NULL) {
22763 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22764 0 : return NULL;
22765 : }
22766 :
22767 0 : pull->flags |= ndr_pull_flags;
22768 :
22769 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22770 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22771 0 : TALLOC_FREE(pull);
22772 0 : PyErr_SetNdrError(err);
22773 0 : return NULL;
22774 : }
22775 0 : if (!allow_remaining) {
22776 0 : uint32_t highest_ofs;
22777 :
22778 0 : if (pull->offset > pull->relative_highest_offset) {
22779 0 : highest_ofs = pull->offset;
22780 : } else {
22781 0 : highest_ofs = pull->relative_highest_offset;
22782 : }
22783 0 : if (highest_ofs < pull->data_size) {
22784 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22785 : "not all bytes consumed ofs[%u] size[%u]",
22786 : highest_ofs, pull->data_size);
22787 0 : TALLOC_FREE(pull);
22788 0 : PyErr_SetNdrError(err);
22789 0 : return NULL;
22790 : }
22791 : }
22792 :
22793 0 : TALLOC_FREE(pull);
22794 0 : Py_RETURN_NONE;
22795 : }
22796 :
22797 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22798 : {
22799 0 : DATA_BLOB blob;
22800 0 : Py_ssize_t blob_length = 0;
22801 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22802 0 : PyObject *bigendian_obj = NULL;
22803 0 : PyObject *ndr64_obj = NULL;
22804 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22805 0 : PyObject *allow_remaining_obj = NULL;
22806 0 : bool allow_remaining = false;
22807 :
22808 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22809 : discard_const_p(char *, kwnames),
22810 : &blob.data, &blob_length,
22811 : &bigendian_obj,
22812 : &ndr64_obj,
22813 : &allow_remaining_obj)) {
22814 0 : return NULL;
22815 : }
22816 0 : blob.length = blob_length;
22817 :
22818 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22819 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22820 : }
22821 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22822 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22823 : }
22824 :
22825 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22826 0 : allow_remaining = true;
22827 : }
22828 :
22829 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22830 : }
22831 :
22832 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22833 : {
22834 0 : DATA_BLOB blob;
22835 0 : Py_ssize_t blob_length = 0;
22836 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22837 0 : PyObject *bigendian_obj = NULL;
22838 0 : PyObject *ndr64_obj = NULL;
22839 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22840 0 : PyObject *allow_remaining_obj = NULL;
22841 0 : bool allow_remaining = false;
22842 :
22843 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22844 : discard_const_p(char *, kwnames),
22845 : &blob.data, &blob_length,
22846 : &bigendian_obj,
22847 : &ndr64_obj,
22848 : &allow_remaining_obj)) {
22849 0 : return NULL;
22850 : }
22851 0 : blob.length = blob_length;
22852 :
22853 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22854 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22855 : }
22856 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22857 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22858 : }
22859 :
22860 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22861 0 : allow_remaining = true;
22862 : }
22863 :
22864 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22865 : }
22866 :
22867 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22868 : {
22869 0 : const struct ndr_interface_call *call = NULL;
22870 0 : struct lsa_GetSystemAccessAccount *object = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22871 0 : PyObject *ret;
22872 0 : char *retstr;
22873 :
22874 0 : if (ndr_table_lsarpc.num_calls < 24) {
22875 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_print");
22876 0 : return NULL;
22877 : }
22878 0 : call = &ndr_table_lsarpc.calls[23];
22879 :
22880 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22881 0 : ret = PyUnicode_FromString(retstr);
22882 0 : TALLOC_FREE(retstr);
22883 :
22884 0 : return ret;
22885 : }
22886 :
22887 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22888 : {
22889 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_in", NDR_IN);
22890 : }
22891 :
22892 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22893 : {
22894 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_out", NDR_OUT);
22895 : }
22896 :
22897 : static PyMethodDef py_lsa_GetSystemAccessAccount_methods[] = {
22898 : { "opnum", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22899 : "lsa.GetSystemAccessAccount.opnum() -> 23 (0x17) " },
22900 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22901 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22902 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22903 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22904 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22905 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22906 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22907 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22908 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22909 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22910 : { NULL, NULL, 0, NULL }
22911 : };
22912 :
22913 :
22914 : static PyTypeObject lsa_GetSystemAccessAccount_Type = {
22915 : PyVarObject_HEAD_INIT(NULL, 0)
22916 : .tp_name = "lsa.GetSystemAccessAccount",
22917 : .tp_getset = py_lsa_GetSystemAccessAccount_getsetters,
22918 : .tp_methods = py_lsa_GetSystemAccessAccount_methods,
22919 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22920 : .tp_new = py_lsa_GetSystemAccessAccount_new,
22921 : };
22922 :
22923 0 : static bool pack_py_lsa_GetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetSystemAccessAccount *r)
22924 : {
22925 0 : PyObject *py_handle;
22926 0 : const char *kwnames[] = {
22927 : "handle", NULL
22928 : };
22929 :
22930 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_GetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle)) {
22931 0 : return false;
22932 : }
22933 :
22934 0 : if (py_handle == NULL) {
22935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
22936 0 : return false;
22937 : }
22938 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22939 0 : if (r->in.handle == NULL) {
22940 0 : PyErr_NoMemory();
22941 0 : return false;
22942 : }
22943 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22944 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22945 0 : PyErr_NoMemory();
22946 0 : return false;
22947 : }
22948 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22949 0 : return true;
22950 : }
22951 :
22952 0 : static PyObject *unpack_py_lsa_GetSystemAccessAccount_args_out(struct lsa_GetSystemAccessAccount *r)
22953 : {
22954 0 : PyObject *result;
22955 0 : PyObject *py_access_mask;
22956 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)*r->out.access_mask);
22957 0 : result = py_access_mask;
22958 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22959 0 : PyErr_SetNTSTATUS(r->out.result);
22960 0 : return NULL;
22961 : }
22962 :
22963 0 : return result;
22964 : }
22965 :
22966 :
22967 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
22968 : {
22969 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
22970 0 : PyObject *py_handle;
22971 0 : if (object->in.handle == NULL) {
22972 0 : Py_RETURN_NONE;
22973 : }
22974 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22975 0 : return py_handle;
22976 : }
22977 :
22978 0 : static int py_lsa_SetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22979 : {
22980 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
22981 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22982 0 : if (value == NULL) {
22983 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
22984 0 : return -1;
22985 : }
22986 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22987 0 : if (object->in.handle == NULL) {
22988 0 : PyErr_NoMemory();
22989 0 : return -1;
22990 : }
22991 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22992 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22993 0 : PyErr_NoMemory();
22994 0 : return -1;
22995 : }
22996 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22997 0 : return 0;
22998 : }
22999 :
23000 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_access_mask(PyObject *obj, void *closure)
23001 : {
23002 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
23003 0 : PyObject *py_access_mask;
23004 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
23005 0 : return py_access_mask;
23006 : }
23007 :
23008 0 : static int py_lsa_SetSystemAccessAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
23009 : {
23010 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23011 0 : if (value == NULL) {
23012 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
23013 0 : return -1;
23014 : }
23015 : {
23016 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
23017 0 : if (PyLong_Check(value)) {
23018 0 : unsigned long long test_var;
23019 0 : test_var = PyLong_AsUnsignedLongLong(value);
23020 0 : if (PyErr_Occurred() != NULL) {
23021 0 : return -1;
23022 : }
23023 0 : if (test_var > uint_max) {
23024 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23025 : PyLong_Type.tp_name, uint_max, test_var);
23026 0 : return -1;
23027 : }
23028 0 : object->in.access_mask = test_var;
23029 : } else {
23030 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23031 : PyLong_Type.tp_name);
23032 0 : return -1;
23033 : }
23034 : }
23035 0 : return 0;
23036 : }
23037 :
23038 0 : static PyObject *py_lsa_SetSystemAccessAccount_get_result(PyObject *obj, void *closure)
23039 : {
23040 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(obj);
23041 0 : PyObject *py_result;
23042 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23043 0 : return py_result;
23044 : }
23045 :
23046 0 : static int py_lsa_SetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
23047 : {
23048 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23049 0 : if (value == NULL) {
23050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23051 0 : return -1;
23052 : }
23053 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23054 0 : return 0;
23055 : }
23056 :
23057 : static PyGetSetDef py_lsa_SetSystemAccessAccount_getsetters[] = {
23058 : {
23059 : .name = discard_const_p(char, "in_handle"),
23060 : .get = py_lsa_SetSystemAccessAccount_in_get_handle,
23061 : .set = py_lsa_SetSystemAccessAccount_in_set_handle,
23062 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23063 : },
23064 : {
23065 : .name = discard_const_p(char, "in_access_mask"),
23066 : .get = py_lsa_SetSystemAccessAccount_in_get_access_mask,
23067 : .set = py_lsa_SetSystemAccessAccount_in_set_access_mask,
23068 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
23069 : },
23070 : {
23071 : .name = discard_const_p(char, "result"),
23072 : .get = py_lsa_SetSystemAccessAccount_get_result,
23073 : .set = py_lsa_SetSystemAccessAccount_set_result,
23074 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23075 : },
23076 : { .name = NULL }
23077 : };
23078 :
23079 0 : static PyObject *py_lsa_SetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23080 : {
23081 0 : PyObject *self = pytalloc_new(struct lsa_SetSystemAccessAccount, type);
23082 0 : struct lsa_SetSystemAccessAccount *_self = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(self);
23083 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23084 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23085 0 : return self;
23086 : }
23087 :
23088 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23089 : {
23090 :
23091 :
23092 0 : return PyLong_FromLong(24);
23093 : }
23094 :
23095 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23096 : {
23097 0 : const struct ndr_interface_call *call = NULL;
23098 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23099 0 : PyObject *ret = NULL;
23100 0 : struct ndr_push *push = NULL;
23101 0 : DATA_BLOB blob;
23102 0 : enum ndr_err_code err;
23103 :
23104 0 : if (ndr_table_lsarpc.num_calls < 25) {
23105 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_pack");
23106 0 : return NULL;
23107 : }
23108 0 : call = &ndr_table_lsarpc.calls[24];
23109 :
23110 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23111 0 : if (push == NULL) {
23112 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23113 0 : return NULL;
23114 : }
23115 :
23116 0 : push->flags |= ndr_push_flags;
23117 :
23118 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23119 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23120 0 : TALLOC_FREE(push);
23121 0 : PyErr_SetNdrError(err);
23122 0 : return NULL;
23123 : }
23124 0 : blob = ndr_push_blob(push);
23125 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23126 0 : TALLOC_FREE(push);
23127 0 : return ret;
23128 : }
23129 :
23130 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23131 : {
23132 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23133 0 : PyObject *bigendian_obj = NULL;
23134 0 : PyObject *ndr64_obj = NULL;
23135 0 : libndr_flags ndr_push_flags = 0;
23136 :
23137 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23138 : discard_const_p(char *, kwnames),
23139 : &bigendian_obj,
23140 : &ndr64_obj)) {
23141 0 : return NULL;
23142 : }
23143 :
23144 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23145 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23146 : }
23147 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23148 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23149 : }
23150 :
23151 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23152 : }
23153 :
23154 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23155 : {
23156 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23157 0 : PyObject *bigendian_obj = NULL;
23158 0 : PyObject *ndr64_obj = NULL;
23159 0 : libndr_flags ndr_push_flags = 0;
23160 :
23161 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23162 : discard_const_p(char *, kwnames),
23163 : &bigendian_obj,
23164 : &ndr64_obj)) {
23165 0 : return NULL;
23166 : }
23167 :
23168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23169 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23170 : }
23171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23172 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23173 : }
23174 :
23175 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23176 : }
23177 :
23178 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
23179 : {
23180 0 : const struct ndr_interface_call *call = NULL;
23181 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23182 0 : struct ndr_pull *pull = NULL;
23183 0 : enum ndr_err_code err;
23184 :
23185 0 : if (ndr_table_lsarpc.num_calls < 25) {
23186 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_unpack");
23187 0 : return NULL;
23188 : }
23189 0 : call = &ndr_table_lsarpc.calls[24];
23190 :
23191 0 : pull = ndr_pull_init_blob(blob, object);
23192 0 : if (pull == NULL) {
23193 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23194 0 : return NULL;
23195 : }
23196 :
23197 0 : pull->flags |= ndr_pull_flags;
23198 :
23199 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23200 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23201 0 : TALLOC_FREE(pull);
23202 0 : PyErr_SetNdrError(err);
23203 0 : return NULL;
23204 : }
23205 0 : if (!allow_remaining) {
23206 0 : uint32_t highest_ofs;
23207 :
23208 0 : if (pull->offset > pull->relative_highest_offset) {
23209 0 : highest_ofs = pull->offset;
23210 : } else {
23211 0 : highest_ofs = pull->relative_highest_offset;
23212 : }
23213 0 : if (highest_ofs < pull->data_size) {
23214 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23215 : "not all bytes consumed ofs[%u] size[%u]",
23216 : highest_ofs, pull->data_size);
23217 0 : TALLOC_FREE(pull);
23218 0 : PyErr_SetNdrError(err);
23219 0 : return NULL;
23220 : }
23221 : }
23222 :
23223 0 : TALLOC_FREE(pull);
23224 0 : Py_RETURN_NONE;
23225 : }
23226 :
23227 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23228 : {
23229 0 : DATA_BLOB blob;
23230 0 : Py_ssize_t blob_length = 0;
23231 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23232 0 : PyObject *bigendian_obj = NULL;
23233 0 : PyObject *ndr64_obj = NULL;
23234 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23235 0 : PyObject *allow_remaining_obj = NULL;
23236 0 : bool allow_remaining = false;
23237 :
23238 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23239 : discard_const_p(char *, kwnames),
23240 : &blob.data, &blob_length,
23241 : &bigendian_obj,
23242 : &ndr64_obj,
23243 : &allow_remaining_obj)) {
23244 0 : return NULL;
23245 : }
23246 0 : blob.length = blob_length;
23247 :
23248 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23249 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23250 : }
23251 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23252 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23253 : }
23254 :
23255 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23256 0 : allow_remaining = true;
23257 : }
23258 :
23259 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23260 : }
23261 :
23262 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23263 : {
23264 0 : DATA_BLOB blob;
23265 0 : Py_ssize_t blob_length = 0;
23266 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23267 0 : PyObject *bigendian_obj = NULL;
23268 0 : PyObject *ndr64_obj = NULL;
23269 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23270 0 : PyObject *allow_remaining_obj = NULL;
23271 0 : bool allow_remaining = false;
23272 :
23273 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23274 : discard_const_p(char *, kwnames),
23275 : &blob.data, &blob_length,
23276 : &bigendian_obj,
23277 : &ndr64_obj,
23278 : &allow_remaining_obj)) {
23279 0 : return NULL;
23280 : }
23281 0 : blob.length = blob_length;
23282 :
23283 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23284 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23285 : }
23286 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23287 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23288 : }
23289 :
23290 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23291 0 : allow_remaining = true;
23292 : }
23293 :
23294 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23295 : }
23296 :
23297 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23298 : {
23299 0 : const struct ndr_interface_call *call = NULL;
23300 0 : struct lsa_SetSystemAccessAccount *object = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(py_obj);
23301 0 : PyObject *ret;
23302 0 : char *retstr;
23303 :
23304 0 : if (ndr_table_lsarpc.num_calls < 25) {
23305 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_print");
23306 0 : return NULL;
23307 : }
23308 0 : call = &ndr_table_lsarpc.calls[24];
23309 :
23310 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23311 0 : ret = PyUnicode_FromString(retstr);
23312 0 : TALLOC_FREE(retstr);
23313 :
23314 0 : return ret;
23315 : }
23316 :
23317 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23318 : {
23319 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_in", NDR_IN);
23320 : }
23321 :
23322 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23323 : {
23324 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_out", NDR_OUT);
23325 : }
23326 :
23327 : static PyMethodDef py_lsa_SetSystemAccessAccount_methods[] = {
23328 : { "opnum", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
23329 : "lsa.SetSystemAccessAccount.opnum() -> 24 (0x18) " },
23330 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23331 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23332 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23333 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23334 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23335 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23336 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23337 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23338 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23339 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23340 : { NULL, NULL, 0, NULL }
23341 : };
23342 :
23343 :
23344 : static PyTypeObject lsa_SetSystemAccessAccount_Type = {
23345 : PyVarObject_HEAD_INIT(NULL, 0)
23346 : .tp_name = "lsa.SetSystemAccessAccount",
23347 : .tp_getset = py_lsa_SetSystemAccessAccount_getsetters,
23348 : .tp_methods = py_lsa_SetSystemAccessAccount_methods,
23349 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23350 : .tp_new = py_lsa_SetSystemAccessAccount_new,
23351 : };
23352 :
23353 0 : static bool pack_py_lsa_SetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSystemAccessAccount *r)
23354 : {
23355 0 : PyObject *py_handle;
23356 0 : PyObject *py_access_mask;
23357 0 : const char *kwnames[] = {
23358 : "handle", "access_mask", NULL
23359 : };
23360 :
23361 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_SetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle, &py_access_mask)) {
23362 0 : return false;
23363 : }
23364 :
23365 0 : if (py_handle == NULL) {
23366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23367 0 : return false;
23368 : }
23369 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23370 0 : if (r->in.handle == NULL) {
23371 0 : PyErr_NoMemory();
23372 0 : return false;
23373 : }
23374 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23375 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23376 0 : PyErr_NoMemory();
23377 0 : return false;
23378 : }
23379 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23380 0 : if (py_access_mask == NULL) {
23381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
23382 0 : return false;
23383 : }
23384 : {
23385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
23386 0 : if (PyLong_Check(py_access_mask)) {
23387 0 : unsigned long long test_var;
23388 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
23389 0 : if (PyErr_Occurred() != NULL) {
23390 0 : return false;
23391 : }
23392 0 : if (test_var > uint_max) {
23393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23394 : PyLong_Type.tp_name, uint_max, test_var);
23395 0 : return false;
23396 : }
23397 0 : r->in.access_mask = test_var;
23398 : } else {
23399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23400 : PyLong_Type.tp_name);
23401 0 : return false;
23402 : }
23403 : }
23404 0 : return true;
23405 : }
23406 :
23407 0 : static PyObject *unpack_py_lsa_SetSystemAccessAccount_args_out(struct lsa_SetSystemAccessAccount *r)
23408 : {
23409 0 : PyObject *result;
23410 0 : result = Py_None;
23411 0 : Py_INCREF(result);
23412 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23413 0 : PyErr_SetNTSTATUS(r->out.result);
23414 0 : return NULL;
23415 : }
23416 :
23417 0 : return result;
23418 : }
23419 :
23420 :
23421 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_handle(PyObject *obj, void *closure)
23422 : {
23423 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23424 0 : PyObject *py_handle;
23425 0 : if (object->in.handle == NULL) {
23426 0 : Py_RETURN_NONE;
23427 : }
23428 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23429 0 : return py_handle;
23430 : }
23431 :
23432 0 : static int py_lsa_OpenTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23433 : {
23434 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23435 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23436 0 : if (value == NULL) {
23437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
23438 0 : return -1;
23439 : }
23440 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23441 0 : if (object->in.handle == NULL) {
23442 0 : PyErr_NoMemory();
23443 0 : return -1;
23444 : }
23445 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23446 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23447 0 : PyErr_NoMemory();
23448 0 : return -1;
23449 : }
23450 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23451 0 : return 0;
23452 : }
23453 :
23454 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_sid(PyObject *obj, void *closure)
23455 : {
23456 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23457 0 : PyObject *py_sid;
23458 0 : if (object->in.sid == NULL) {
23459 0 : Py_RETURN_NONE;
23460 : }
23461 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
23462 0 : return py_sid;
23463 : }
23464 :
23465 0 : static int py_lsa_OpenTrustedDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
23466 : {
23467 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23468 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
23469 0 : if (value == NULL) {
23470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
23471 0 : return -1;
23472 : }
23473 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
23474 0 : if (object->in.sid == NULL) {
23475 0 : PyErr_NoMemory();
23476 0 : return -1;
23477 : }
23478 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
23479 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23480 0 : PyErr_NoMemory();
23481 0 : return -1;
23482 : }
23483 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
23484 0 : return 0;
23485 : }
23486 :
23487 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
23488 : {
23489 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23490 0 : PyObject *py_access_mask;
23491 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
23492 0 : return py_access_mask;
23493 : }
23494 :
23495 0 : static int py_lsa_OpenTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
23496 : {
23497 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23498 0 : if (value == NULL) {
23499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
23500 0 : return -1;
23501 : }
23502 : {
23503 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
23504 0 : if (PyLong_Check(value)) {
23505 0 : unsigned long long test_var;
23506 0 : test_var = PyLong_AsUnsignedLongLong(value);
23507 0 : if (PyErr_Occurred() != NULL) {
23508 0 : return -1;
23509 : }
23510 0 : if (test_var > uint_max) {
23511 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23512 : PyLong_Type.tp_name, uint_max, test_var);
23513 0 : return -1;
23514 : }
23515 0 : object->in.access_mask = test_var;
23516 : } else {
23517 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23518 : PyLong_Type.tp_name);
23519 0 : return -1;
23520 : }
23521 : }
23522 0 : return 0;
23523 : }
23524 :
23525 0 : static PyObject *py_lsa_OpenTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
23526 : {
23527 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23528 0 : PyObject *py_trustdom_handle;
23529 0 : if (object->out.trustdom_handle == NULL) {
23530 0 : Py_RETURN_NONE;
23531 : }
23532 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
23533 0 : return py_trustdom_handle;
23534 : }
23535 :
23536 0 : static int py_lsa_OpenTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
23537 : {
23538 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23539 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
23540 0 : if (value == NULL) {
23541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
23542 0 : return -1;
23543 : }
23544 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
23545 0 : if (object->out.trustdom_handle == NULL) {
23546 0 : PyErr_NoMemory();
23547 0 : return -1;
23548 : }
23549 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23550 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23551 0 : PyErr_NoMemory();
23552 0 : return -1;
23553 : }
23554 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
23555 0 : return 0;
23556 : }
23557 :
23558 0 : static PyObject *py_lsa_OpenTrustedDomain_get_result(PyObject *obj, void *closure)
23559 : {
23560 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(obj);
23561 0 : PyObject *py_result;
23562 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23563 0 : return py_result;
23564 : }
23565 :
23566 0 : static int py_lsa_OpenTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
23567 : {
23568 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23569 0 : if (value == NULL) {
23570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23571 0 : return -1;
23572 : }
23573 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23574 0 : return 0;
23575 : }
23576 :
23577 : static PyGetSetDef py_lsa_OpenTrustedDomain_getsetters[] = {
23578 : {
23579 : .name = discard_const_p(char, "in_handle"),
23580 : .get = py_lsa_OpenTrustedDomain_in_get_handle,
23581 : .set = py_lsa_OpenTrustedDomain_in_set_handle,
23582 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23583 : },
23584 : {
23585 : .name = discard_const_p(char, "in_sid"),
23586 : .get = py_lsa_OpenTrustedDomain_in_get_sid,
23587 : .set = py_lsa_OpenTrustedDomain_in_set_sid,
23588 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
23589 : },
23590 : {
23591 : .name = discard_const_p(char, "in_access_mask"),
23592 : .get = py_lsa_OpenTrustedDomain_in_get_access_mask,
23593 : .set = py_lsa_OpenTrustedDomain_in_set_access_mask,
23594 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
23595 : },
23596 : {
23597 : .name = discard_const_p(char, "out_trustdom_handle"),
23598 : .get = py_lsa_OpenTrustedDomain_out_get_trustdom_handle,
23599 : .set = py_lsa_OpenTrustedDomain_out_set_trustdom_handle,
23600 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23601 : },
23602 : {
23603 : .name = discard_const_p(char, "result"),
23604 : .get = py_lsa_OpenTrustedDomain_get_result,
23605 : .set = py_lsa_OpenTrustedDomain_set_result,
23606 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23607 : },
23608 : { .name = NULL }
23609 : };
23610 :
23611 0 : static PyObject *py_lsa_OpenTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23612 : {
23613 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomain, type);
23614 0 : struct lsa_OpenTrustedDomain *_self = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(self);
23615 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23616 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23617 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
23618 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
23619 0 : return self;
23620 : }
23621 :
23622 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23623 : {
23624 :
23625 :
23626 0 : return PyLong_FromLong(25);
23627 : }
23628 :
23629 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23630 : {
23631 0 : const struct ndr_interface_call *call = NULL;
23632 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23633 0 : PyObject *ret = NULL;
23634 0 : struct ndr_push *push = NULL;
23635 0 : DATA_BLOB blob;
23636 0 : enum ndr_err_code err;
23637 :
23638 0 : if (ndr_table_lsarpc.num_calls < 26) {
23639 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_pack");
23640 0 : return NULL;
23641 : }
23642 0 : call = &ndr_table_lsarpc.calls[25];
23643 :
23644 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23645 0 : if (push == NULL) {
23646 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23647 0 : return NULL;
23648 : }
23649 :
23650 0 : push->flags |= ndr_push_flags;
23651 :
23652 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23653 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23654 0 : TALLOC_FREE(push);
23655 0 : PyErr_SetNdrError(err);
23656 0 : return NULL;
23657 : }
23658 0 : blob = ndr_push_blob(push);
23659 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23660 0 : TALLOC_FREE(push);
23661 0 : return ret;
23662 : }
23663 :
23664 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23665 : {
23666 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23667 0 : PyObject *bigendian_obj = NULL;
23668 0 : PyObject *ndr64_obj = NULL;
23669 0 : libndr_flags ndr_push_flags = 0;
23670 :
23671 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23672 : discard_const_p(char *, kwnames),
23673 : &bigendian_obj,
23674 : &ndr64_obj)) {
23675 0 : return NULL;
23676 : }
23677 :
23678 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23679 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23680 : }
23681 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23682 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23683 : }
23684 :
23685 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23686 : }
23687 :
23688 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23689 : {
23690 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23691 0 : PyObject *bigendian_obj = NULL;
23692 0 : PyObject *ndr64_obj = NULL;
23693 0 : libndr_flags ndr_push_flags = 0;
23694 :
23695 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23696 : discard_const_p(char *, kwnames),
23697 : &bigendian_obj,
23698 : &ndr64_obj)) {
23699 0 : return NULL;
23700 : }
23701 :
23702 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23703 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23704 : }
23705 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23706 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23707 : }
23708 :
23709 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23710 : }
23711 :
23712 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
23713 : {
23714 0 : const struct ndr_interface_call *call = NULL;
23715 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23716 0 : struct ndr_pull *pull = NULL;
23717 0 : enum ndr_err_code err;
23718 :
23719 0 : if (ndr_table_lsarpc.num_calls < 26) {
23720 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_unpack");
23721 0 : return NULL;
23722 : }
23723 0 : call = &ndr_table_lsarpc.calls[25];
23724 :
23725 0 : pull = ndr_pull_init_blob(blob, object);
23726 0 : if (pull == NULL) {
23727 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23728 0 : return NULL;
23729 : }
23730 :
23731 0 : pull->flags |= ndr_pull_flags;
23732 :
23733 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23734 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23735 0 : TALLOC_FREE(pull);
23736 0 : PyErr_SetNdrError(err);
23737 0 : return NULL;
23738 : }
23739 0 : if (!allow_remaining) {
23740 0 : uint32_t highest_ofs;
23741 :
23742 0 : if (pull->offset > pull->relative_highest_offset) {
23743 0 : highest_ofs = pull->offset;
23744 : } else {
23745 0 : highest_ofs = pull->relative_highest_offset;
23746 : }
23747 0 : if (highest_ofs < pull->data_size) {
23748 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23749 : "not all bytes consumed ofs[%u] size[%u]",
23750 : highest_ofs, pull->data_size);
23751 0 : TALLOC_FREE(pull);
23752 0 : PyErr_SetNdrError(err);
23753 0 : return NULL;
23754 : }
23755 : }
23756 :
23757 0 : TALLOC_FREE(pull);
23758 0 : Py_RETURN_NONE;
23759 : }
23760 :
23761 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23762 : {
23763 0 : DATA_BLOB blob;
23764 0 : Py_ssize_t blob_length = 0;
23765 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23766 0 : PyObject *bigendian_obj = NULL;
23767 0 : PyObject *ndr64_obj = NULL;
23768 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23769 0 : PyObject *allow_remaining_obj = NULL;
23770 0 : bool allow_remaining = false;
23771 :
23772 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23773 : discard_const_p(char *, kwnames),
23774 : &blob.data, &blob_length,
23775 : &bigendian_obj,
23776 : &ndr64_obj,
23777 : &allow_remaining_obj)) {
23778 0 : return NULL;
23779 : }
23780 0 : blob.length = blob_length;
23781 :
23782 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23783 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23784 : }
23785 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23786 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23787 : }
23788 :
23789 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23790 0 : allow_remaining = true;
23791 : }
23792 :
23793 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23794 : }
23795 :
23796 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23797 : {
23798 0 : DATA_BLOB blob;
23799 0 : Py_ssize_t blob_length = 0;
23800 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23801 0 : PyObject *bigendian_obj = NULL;
23802 0 : PyObject *ndr64_obj = NULL;
23803 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23804 0 : PyObject *allow_remaining_obj = NULL;
23805 0 : bool allow_remaining = false;
23806 :
23807 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23808 : discard_const_p(char *, kwnames),
23809 : &blob.data, &blob_length,
23810 : &bigendian_obj,
23811 : &ndr64_obj,
23812 : &allow_remaining_obj)) {
23813 0 : return NULL;
23814 : }
23815 0 : blob.length = blob_length;
23816 :
23817 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23818 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23819 : }
23820 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23821 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23822 : }
23823 :
23824 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23825 0 : allow_remaining = true;
23826 : }
23827 :
23828 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23829 : }
23830 :
23831 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23832 : {
23833 0 : const struct ndr_interface_call *call = NULL;
23834 0 : struct lsa_OpenTrustedDomain *object = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(py_obj);
23835 0 : PyObject *ret;
23836 0 : char *retstr;
23837 :
23838 0 : if (ndr_table_lsarpc.num_calls < 26) {
23839 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_print");
23840 0 : return NULL;
23841 : }
23842 0 : call = &ndr_table_lsarpc.calls[25];
23843 :
23844 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23845 0 : ret = PyUnicode_FromString(retstr);
23846 0 : TALLOC_FREE(retstr);
23847 :
23848 0 : return ret;
23849 : }
23850 :
23851 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23852 : {
23853 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_in", NDR_IN);
23854 : }
23855 :
23856 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23857 : {
23858 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_out", NDR_OUT);
23859 : }
23860 :
23861 : static PyMethodDef py_lsa_OpenTrustedDomain_methods[] = {
23862 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
23863 : "lsa.OpenTrustedDomain.opnum() -> 25 (0x19) " },
23864 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23865 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23866 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23867 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23868 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23869 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23870 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23871 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23872 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23873 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23874 : { NULL, NULL, 0, NULL }
23875 : };
23876 :
23877 :
23878 : static PyTypeObject lsa_OpenTrustedDomain_Type = {
23879 : PyVarObject_HEAD_INIT(NULL, 0)
23880 : .tp_name = "lsa.OpenTrustedDomain",
23881 : .tp_getset = py_lsa_OpenTrustedDomain_getsetters,
23882 : .tp_methods = py_lsa_OpenTrustedDomain_methods,
23883 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23884 : .tp_new = py_lsa_OpenTrustedDomain_new,
23885 : };
23886 :
23887 0 : static bool pack_py_lsa_OpenTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomain *r)
23888 : {
23889 0 : PyObject *py_handle;
23890 0 : PyObject *py_sid;
23891 0 : PyObject *py_access_mask;
23892 0 : const char *kwnames[] = {
23893 : "handle", "sid", "access_mask", NULL
23894 : };
23895 :
23896 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
23897 0 : return false;
23898 : }
23899 :
23900 0 : if (py_handle == NULL) {
23901 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
23902 0 : return false;
23903 : }
23904 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23905 0 : if (r->in.handle == NULL) {
23906 0 : PyErr_NoMemory();
23907 0 : return false;
23908 : }
23909 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23910 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23911 0 : PyErr_NoMemory();
23912 0 : return false;
23913 : }
23914 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23915 0 : if (py_sid == NULL) {
23916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
23917 0 : return false;
23918 : }
23919 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
23920 0 : if (r->in.sid == NULL) {
23921 0 : PyErr_NoMemory();
23922 0 : return false;
23923 : }
23924 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
23925 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
23926 0 : PyErr_NoMemory();
23927 0 : return false;
23928 : }
23929 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
23930 0 : if (py_access_mask == NULL) {
23931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
23932 0 : return false;
23933 : }
23934 : {
23935 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
23936 0 : if (PyLong_Check(py_access_mask)) {
23937 0 : unsigned long long test_var;
23938 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
23939 0 : if (PyErr_Occurred() != NULL) {
23940 0 : return false;
23941 : }
23942 0 : if (test_var > uint_max) {
23943 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23944 : PyLong_Type.tp_name, uint_max, test_var);
23945 0 : return false;
23946 : }
23947 0 : r->in.access_mask = test_var;
23948 : } else {
23949 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23950 : PyLong_Type.tp_name);
23951 0 : return false;
23952 : }
23953 : }
23954 0 : return true;
23955 : }
23956 :
23957 0 : static PyObject *unpack_py_lsa_OpenTrustedDomain_args_out(struct lsa_OpenTrustedDomain *r)
23958 : {
23959 0 : PyObject *result;
23960 0 : PyObject *py_trustdom_handle;
23961 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
23962 0 : result = py_trustdom_handle;
23963 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23964 0 : PyErr_SetNTSTATUS(r->out.result);
23965 0 : return NULL;
23966 : }
23967 :
23968 0 : return result;
23969 : }
23970 :
23971 :
23972 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle(PyObject *obj, void *closure)
23973 : {
23974 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
23975 0 : PyObject *py_trustdom_handle;
23976 0 : if (object->in.trustdom_handle == NULL) {
23977 0 : Py_RETURN_NONE;
23978 : }
23979 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
23980 0 : return py_trustdom_handle;
23981 : }
23982 :
23983 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
23984 : {
23985 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
23986 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
23987 0 : if (value == NULL) {
23988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trustdom_handle");
23989 0 : return -1;
23990 : }
23991 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
23992 0 : if (object->in.trustdom_handle == NULL) {
23993 0 : PyErr_NoMemory();
23994 0 : return -1;
23995 : }
23996 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23997 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23998 0 : PyErr_NoMemory();
23999 0 : return -1;
24000 : }
24001 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24002 0 : return 0;
24003 : }
24004 :
24005 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
24006 : {
24007 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24008 0 : PyObject *py_level;
24009 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
24010 0 : return py_level;
24011 : }
24012 :
24013 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
24014 : {
24015 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24016 0 : if (value == NULL) {
24017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
24018 0 : return -1;
24019 : }
24020 : {
24021 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
24022 0 : if (PyLong_Check(value)) {
24023 0 : unsigned long long test_var;
24024 0 : test_var = PyLong_AsUnsignedLongLong(value);
24025 0 : if (PyErr_Occurred() != NULL) {
24026 0 : return -1;
24027 : }
24028 0 : if (test_var > uint_max) {
24029 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24030 : PyLong_Type.tp_name, uint_max, test_var);
24031 0 : return -1;
24032 : }
24033 0 : object->in.level = test_var;
24034 : } else {
24035 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24036 : PyLong_Type.tp_name);
24037 0 : return -1;
24038 : }
24039 : }
24040 0 : return 0;
24041 : }
24042 :
24043 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_out_get_info(PyObject *obj, void *closure)
24044 : {
24045 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24046 0 : PyObject *py_info;
24047 0 : if (object->out.info == NULL) {
24048 0 : Py_RETURN_NONE;
24049 : }
24050 0 : if (*object->out.info == NULL) {
24051 0 : py_info = Py_None;
24052 0 : Py_INCREF(py_info);
24053 : } else {
24054 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
24055 0 : if (py_info == NULL) {
24056 0 : return NULL;
24057 : }
24058 : }
24059 0 : return py_info;
24060 : }
24061 :
24062 0 : static int py_lsa_QueryTrustedDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
24063 : {
24064 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24065 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
24066 0 : if (value == NULL) {
24067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
24068 0 : return -1;
24069 : }
24070 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
24071 0 : if (object->out.info == NULL) {
24072 0 : PyErr_NoMemory();
24073 0 : return -1;
24074 : }
24075 0 : if (value == Py_None) {
24076 0 : *object->out.info = NULL;
24077 : } else {
24078 0 : *object->out.info = NULL;
24079 : {
24080 0 : union lsa_TrustedDomainInfo *info_switch_2;
24081 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");
24082 0 : if (info_switch_2 == NULL) {
24083 0 : return -1;
24084 : }
24085 0 : *object->out.info = info_switch_2;
24086 : }
24087 : }
24088 0 : return 0;
24089 : }
24090 :
24091 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_get_result(PyObject *obj, void *closure)
24092 : {
24093 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(obj);
24094 0 : PyObject *py_result;
24095 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24096 0 : return py_result;
24097 : }
24098 :
24099 0 : static int py_lsa_QueryTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
24100 : {
24101 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24102 0 : if (value == NULL) {
24103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24104 0 : return -1;
24105 : }
24106 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24107 0 : return 0;
24108 : }
24109 :
24110 : static PyGetSetDef py_lsa_QueryTrustedDomainInfo_getsetters[] = {
24111 : {
24112 : .name = discard_const_p(char, "in_trustdom_handle"),
24113 : .get = py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle,
24114 : .set = py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle,
24115 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24116 : },
24117 : {
24118 : .name = discard_const_p(char, "in_level"),
24119 : .get = py_lsa_QueryTrustedDomainInfo_in_get_level,
24120 : .set = py_lsa_QueryTrustedDomainInfo_in_set_level,
24121 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
24122 : },
24123 : {
24124 : .name = discard_const_p(char, "out_info"),
24125 : .get = py_lsa_QueryTrustedDomainInfo_out_get_info,
24126 : .set = py_lsa_QueryTrustedDomainInfo_out_set_info,
24127 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
24128 : },
24129 : {
24130 : .name = discard_const_p(char, "result"),
24131 : .get = py_lsa_QueryTrustedDomainInfo_get_result,
24132 : .set = py_lsa_QueryTrustedDomainInfo_set_result,
24133 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24134 : },
24135 : { .name = NULL }
24136 : };
24137 :
24138 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24139 : {
24140 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfo, type);
24141 0 : struct lsa_QueryTrustedDomainInfo *_self = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(self);
24142 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24143 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
24144 : /* a pointer to a NULL pointer */
24145 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
24146 0 : return self;
24147 : }
24148 :
24149 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24150 : {
24151 :
24152 :
24153 0 : return PyLong_FromLong(26);
24154 : }
24155 :
24156 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24157 : {
24158 0 : const struct ndr_interface_call *call = NULL;
24159 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24160 0 : PyObject *ret = NULL;
24161 0 : struct ndr_push *push = NULL;
24162 0 : DATA_BLOB blob;
24163 0 : enum ndr_err_code err;
24164 :
24165 0 : if (ndr_table_lsarpc.num_calls < 27) {
24166 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_pack");
24167 0 : return NULL;
24168 : }
24169 0 : call = &ndr_table_lsarpc.calls[26];
24170 :
24171 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24172 0 : if (push == NULL) {
24173 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24174 0 : return NULL;
24175 : }
24176 :
24177 0 : push->flags |= ndr_push_flags;
24178 :
24179 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24180 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24181 0 : TALLOC_FREE(push);
24182 0 : PyErr_SetNdrError(err);
24183 0 : return NULL;
24184 : }
24185 0 : blob = ndr_push_blob(push);
24186 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24187 0 : TALLOC_FREE(push);
24188 0 : return ret;
24189 : }
24190 :
24191 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24192 : {
24193 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24194 0 : PyObject *bigendian_obj = NULL;
24195 0 : PyObject *ndr64_obj = NULL;
24196 0 : libndr_flags ndr_push_flags = 0;
24197 :
24198 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24199 : discard_const_p(char *, kwnames),
24200 : &bigendian_obj,
24201 : &ndr64_obj)) {
24202 0 : return NULL;
24203 : }
24204 :
24205 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24206 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24207 : }
24208 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24209 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24210 : }
24211 :
24212 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24213 : }
24214 :
24215 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24216 : {
24217 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24218 0 : PyObject *bigendian_obj = NULL;
24219 0 : PyObject *ndr64_obj = NULL;
24220 0 : libndr_flags ndr_push_flags = 0;
24221 :
24222 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24223 : discard_const_p(char *, kwnames),
24224 : &bigendian_obj,
24225 : &ndr64_obj)) {
24226 0 : return NULL;
24227 : }
24228 :
24229 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24230 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24231 : }
24232 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24233 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24234 : }
24235 :
24236 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24237 : }
24238 :
24239 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
24240 : {
24241 0 : const struct ndr_interface_call *call = NULL;
24242 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24243 0 : struct ndr_pull *pull = NULL;
24244 0 : enum ndr_err_code err;
24245 :
24246 0 : if (ndr_table_lsarpc.num_calls < 27) {
24247 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_unpack");
24248 0 : return NULL;
24249 : }
24250 0 : call = &ndr_table_lsarpc.calls[26];
24251 :
24252 0 : pull = ndr_pull_init_blob(blob, object);
24253 0 : if (pull == NULL) {
24254 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24255 0 : return NULL;
24256 : }
24257 :
24258 0 : pull->flags |= ndr_pull_flags;
24259 :
24260 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24261 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24262 0 : TALLOC_FREE(pull);
24263 0 : PyErr_SetNdrError(err);
24264 0 : return NULL;
24265 : }
24266 0 : if (!allow_remaining) {
24267 0 : uint32_t highest_ofs;
24268 :
24269 0 : if (pull->offset > pull->relative_highest_offset) {
24270 0 : highest_ofs = pull->offset;
24271 : } else {
24272 0 : highest_ofs = pull->relative_highest_offset;
24273 : }
24274 0 : if (highest_ofs < pull->data_size) {
24275 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24276 : "not all bytes consumed ofs[%u] size[%u]",
24277 : highest_ofs, pull->data_size);
24278 0 : TALLOC_FREE(pull);
24279 0 : PyErr_SetNdrError(err);
24280 0 : return NULL;
24281 : }
24282 : }
24283 :
24284 0 : TALLOC_FREE(pull);
24285 0 : Py_RETURN_NONE;
24286 : }
24287 :
24288 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24289 : {
24290 0 : DATA_BLOB blob;
24291 0 : Py_ssize_t blob_length = 0;
24292 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24293 0 : PyObject *bigendian_obj = NULL;
24294 0 : PyObject *ndr64_obj = NULL;
24295 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24296 0 : PyObject *allow_remaining_obj = NULL;
24297 0 : bool allow_remaining = false;
24298 :
24299 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24300 : discard_const_p(char *, kwnames),
24301 : &blob.data, &blob_length,
24302 : &bigendian_obj,
24303 : &ndr64_obj,
24304 : &allow_remaining_obj)) {
24305 0 : return NULL;
24306 : }
24307 0 : blob.length = blob_length;
24308 :
24309 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24310 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24311 : }
24312 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24313 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24314 : }
24315 :
24316 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24317 0 : allow_remaining = true;
24318 : }
24319 :
24320 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24321 : }
24322 :
24323 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24324 : {
24325 0 : DATA_BLOB blob;
24326 0 : Py_ssize_t blob_length = 0;
24327 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24328 0 : PyObject *bigendian_obj = NULL;
24329 0 : PyObject *ndr64_obj = NULL;
24330 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24331 0 : PyObject *allow_remaining_obj = NULL;
24332 0 : bool allow_remaining = false;
24333 :
24334 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24335 : discard_const_p(char *, kwnames),
24336 : &blob.data, &blob_length,
24337 : &bigendian_obj,
24338 : &ndr64_obj,
24339 : &allow_remaining_obj)) {
24340 0 : return NULL;
24341 : }
24342 0 : blob.length = blob_length;
24343 :
24344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24345 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24346 : }
24347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24348 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24349 : }
24350 :
24351 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24352 0 : allow_remaining = true;
24353 : }
24354 :
24355 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24356 : }
24357 :
24358 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24359 : {
24360 0 : const struct ndr_interface_call *call = NULL;
24361 0 : struct lsa_QueryTrustedDomainInfo *object = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
24362 0 : PyObject *ret;
24363 0 : char *retstr;
24364 :
24365 0 : if (ndr_table_lsarpc.num_calls < 27) {
24366 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_print");
24367 0 : return NULL;
24368 : }
24369 0 : call = &ndr_table_lsarpc.calls[26];
24370 :
24371 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24372 0 : ret = PyUnicode_FromString(retstr);
24373 0 : TALLOC_FREE(retstr);
24374 :
24375 0 : return ret;
24376 : }
24377 :
24378 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24379 : {
24380 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_in", NDR_IN);
24381 : }
24382 :
24383 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24384 : {
24385 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_out", NDR_OUT);
24386 : }
24387 :
24388 : static PyMethodDef py_lsa_QueryTrustedDomainInfo_methods[] = {
24389 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
24390 : "lsa.QueryTrustedDomainInfo.opnum() -> 26 (0x1a) " },
24391 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24392 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24393 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24394 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24395 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24396 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24397 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24398 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24399 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24400 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24401 : { NULL, NULL, 0, NULL }
24402 : };
24403 :
24404 :
24405 : static PyTypeObject lsa_QueryTrustedDomainInfo_Type = {
24406 : PyVarObject_HEAD_INIT(NULL, 0)
24407 : .tp_name = "lsa.QueryTrustedDomainInfo",
24408 : .tp_getset = py_lsa_QueryTrustedDomainInfo_getsetters,
24409 : .tp_methods = py_lsa_QueryTrustedDomainInfo_methods,
24410 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24411 : .tp_new = py_lsa_QueryTrustedDomainInfo_new,
24412 : };
24413 :
24414 0 : static bool pack_py_lsa_QueryTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfo *r)
24415 : {
24416 0 : PyObject *py_trustdom_handle;
24417 0 : PyObject *py_level;
24418 0 : const char *kwnames[] = {
24419 : "trustdom_handle", "level", NULL
24420 : };
24421 :
24422 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryTrustedDomainInfo", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level)) {
24423 0 : return false;
24424 : }
24425 :
24426 0 : if (py_trustdom_handle == NULL) {
24427 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trustdom_handle");
24428 0 : return false;
24429 : }
24430 0 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
24431 0 : if (r->in.trustdom_handle == NULL) {
24432 0 : PyErr_NoMemory();
24433 0 : return false;
24434 : }
24435 0 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
24436 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
24437 0 : PyErr_NoMemory();
24438 0 : return false;
24439 : }
24440 0 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
24441 0 : if (py_level == NULL) {
24442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
24443 0 : return false;
24444 : }
24445 : {
24446 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
24447 0 : if (PyLong_Check(py_level)) {
24448 0 : unsigned long long test_var;
24449 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
24450 0 : if (PyErr_Occurred() != NULL) {
24451 0 : return false;
24452 : }
24453 0 : if (test_var > uint_max) {
24454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24455 : PyLong_Type.tp_name, uint_max, test_var);
24456 0 : return false;
24457 : }
24458 0 : r->in.level = test_var;
24459 : } else {
24460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24461 : PyLong_Type.tp_name);
24462 0 : return false;
24463 : }
24464 : }
24465 0 : return true;
24466 : }
24467 :
24468 0 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfo_args_out(struct lsa_QueryTrustedDomainInfo *r)
24469 : {
24470 0 : PyObject *result;
24471 0 : PyObject *py_info;
24472 0 : if (*r->out.info == NULL) {
24473 0 : py_info = Py_None;
24474 0 : Py_INCREF(py_info);
24475 : } else {
24476 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
24477 0 : if (py_info == NULL) {
24478 0 : return NULL;
24479 : }
24480 : }
24481 0 : result = py_info;
24482 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
24483 0 : PyErr_SetNTSTATUS(r->out.result);
24484 0 : return NULL;
24485 : }
24486 :
24487 0 : return result;
24488 : }
24489 :
24490 :
24491 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle(PyObject *obj, void *closure)
24492 : {
24493 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24494 0 : PyObject *py_trustdom_handle;
24495 0 : if (object->in.trustdom_handle == NULL) {
24496 0 : Py_RETURN_NONE;
24497 : }
24498 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
24499 0 : return py_trustdom_handle;
24500 : }
24501 :
24502 0 : static int py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
24503 : {
24504 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24505 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
24506 0 : if (value == NULL) {
24507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trustdom_handle");
24508 0 : return -1;
24509 : }
24510 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
24511 0 : if (object->in.trustdom_handle == NULL) {
24512 0 : PyErr_NoMemory();
24513 0 : return -1;
24514 : }
24515 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24516 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24517 0 : PyErr_NoMemory();
24518 0 : return -1;
24519 : }
24520 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24521 0 : return 0;
24522 : }
24523 :
24524 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_level(PyObject *obj, void *closure)
24525 : {
24526 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24527 0 : PyObject *py_level;
24528 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
24529 0 : return py_level;
24530 : }
24531 :
24532 0 : static int py_lsa_SetInformationTrustedDomain_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
24533 : {
24534 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24535 0 : if (value == NULL) {
24536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
24537 0 : return -1;
24538 : }
24539 : {
24540 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
24541 0 : if (PyLong_Check(value)) {
24542 0 : unsigned long long test_var;
24543 0 : test_var = PyLong_AsUnsignedLongLong(value);
24544 0 : if (PyErr_Occurred() != NULL) {
24545 0 : return -1;
24546 : }
24547 0 : if (test_var > uint_max) {
24548 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24549 : PyLong_Type.tp_name, uint_max, test_var);
24550 0 : return -1;
24551 : }
24552 0 : object->in.level = test_var;
24553 : } else {
24554 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24555 : PyLong_Type.tp_name);
24556 0 : return -1;
24557 : }
24558 : }
24559 0 : return 0;
24560 : }
24561 :
24562 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_info(PyObject *obj, void *closure)
24563 : {
24564 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24565 0 : PyObject *py_info;
24566 0 : if (object->in.info == NULL) {
24567 0 : Py_RETURN_NONE;
24568 : }
24569 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
24570 0 : if (py_info == NULL) {
24571 0 : return NULL;
24572 : }
24573 0 : return py_info;
24574 : }
24575 :
24576 0 : static int py_lsa_SetInformationTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
24577 : {
24578 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24579 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
24580 0 : if (value == NULL) {
24581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
24582 0 : return -1;
24583 : }
24584 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
24585 0 : if (object->in.info == NULL) {
24586 0 : PyErr_NoMemory();
24587 0 : return -1;
24588 : }
24589 : {
24590 0 : union lsa_TrustedDomainInfo *info_switch_1;
24591 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");
24592 0 : if (info_switch_1 == NULL) {
24593 0 : return -1;
24594 : }
24595 0 : object->in.info = info_switch_1;
24596 : }
24597 0 : return 0;
24598 : }
24599 :
24600 0 : static PyObject *py_lsa_SetInformationTrustedDomain_get_result(PyObject *obj, void *closure)
24601 : {
24602 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(obj);
24603 0 : PyObject *py_result;
24604 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24605 0 : return py_result;
24606 : }
24607 :
24608 0 : static int py_lsa_SetInformationTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
24609 : {
24610 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24611 0 : if (value == NULL) {
24612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24613 0 : return -1;
24614 : }
24615 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24616 0 : return 0;
24617 : }
24618 :
24619 : static PyGetSetDef py_lsa_SetInformationTrustedDomain_getsetters[] = {
24620 : {
24621 : .name = discard_const_p(char, "in_trustdom_handle"),
24622 : .get = py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle,
24623 : .set = py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle,
24624 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24625 : },
24626 : {
24627 : .name = discard_const_p(char, "in_level"),
24628 : .get = py_lsa_SetInformationTrustedDomain_in_get_level,
24629 : .set = py_lsa_SetInformationTrustedDomain_in_set_level,
24630 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
24631 : },
24632 : {
24633 : .name = discard_const_p(char, "in_info"),
24634 : .get = py_lsa_SetInformationTrustedDomain_in_get_info,
24635 : .set = py_lsa_SetInformationTrustedDomain_in_set_info,
24636 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
24637 : },
24638 : {
24639 : .name = discard_const_p(char, "result"),
24640 : .get = py_lsa_SetInformationTrustedDomain_get_result,
24641 : .set = py_lsa_SetInformationTrustedDomain_set_result,
24642 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24643 : },
24644 : { .name = NULL }
24645 : };
24646 :
24647 0 : static PyObject *py_lsa_SetInformationTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24648 : {
24649 0 : PyObject *self = pytalloc_new(struct lsa_SetInformationTrustedDomain, type);
24650 0 : struct lsa_SetInformationTrustedDomain *_self = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(self);
24651 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24652 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
24653 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
24654 0 : return self;
24655 : }
24656 :
24657 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24658 : {
24659 :
24660 :
24661 0 : return PyLong_FromLong(27);
24662 : }
24663 :
24664 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24665 : {
24666 0 : const struct ndr_interface_call *call = NULL;
24667 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24668 0 : PyObject *ret = NULL;
24669 0 : struct ndr_push *push = NULL;
24670 0 : DATA_BLOB blob;
24671 0 : enum ndr_err_code err;
24672 :
24673 0 : if (ndr_table_lsarpc.num_calls < 28) {
24674 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_pack");
24675 0 : return NULL;
24676 : }
24677 0 : call = &ndr_table_lsarpc.calls[27];
24678 :
24679 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24680 0 : if (push == NULL) {
24681 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24682 0 : return NULL;
24683 : }
24684 :
24685 0 : push->flags |= ndr_push_flags;
24686 :
24687 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24688 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24689 0 : TALLOC_FREE(push);
24690 0 : PyErr_SetNdrError(err);
24691 0 : return NULL;
24692 : }
24693 0 : blob = ndr_push_blob(push);
24694 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24695 0 : TALLOC_FREE(push);
24696 0 : return ret;
24697 : }
24698 :
24699 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24700 : {
24701 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24702 0 : PyObject *bigendian_obj = NULL;
24703 0 : PyObject *ndr64_obj = NULL;
24704 0 : libndr_flags ndr_push_flags = 0;
24705 :
24706 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24707 : discard_const_p(char *, kwnames),
24708 : &bigendian_obj,
24709 : &ndr64_obj)) {
24710 0 : return NULL;
24711 : }
24712 :
24713 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24714 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24715 : }
24716 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24717 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24718 : }
24719 :
24720 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24721 : }
24722 :
24723 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24724 : {
24725 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24726 0 : PyObject *bigendian_obj = NULL;
24727 0 : PyObject *ndr64_obj = NULL;
24728 0 : libndr_flags ndr_push_flags = 0;
24729 :
24730 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24731 : discard_const_p(char *, kwnames),
24732 : &bigendian_obj,
24733 : &ndr64_obj)) {
24734 0 : return NULL;
24735 : }
24736 :
24737 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24738 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24739 : }
24740 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24741 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24742 : }
24743 :
24744 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24745 : }
24746 :
24747 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
24748 : {
24749 0 : const struct ndr_interface_call *call = NULL;
24750 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24751 0 : struct ndr_pull *pull = NULL;
24752 0 : enum ndr_err_code err;
24753 :
24754 0 : if (ndr_table_lsarpc.num_calls < 28) {
24755 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_unpack");
24756 0 : return NULL;
24757 : }
24758 0 : call = &ndr_table_lsarpc.calls[27];
24759 :
24760 0 : pull = ndr_pull_init_blob(blob, object);
24761 0 : if (pull == NULL) {
24762 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24763 0 : return NULL;
24764 : }
24765 :
24766 0 : pull->flags |= ndr_pull_flags;
24767 :
24768 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24769 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24770 0 : TALLOC_FREE(pull);
24771 0 : PyErr_SetNdrError(err);
24772 0 : return NULL;
24773 : }
24774 0 : if (!allow_remaining) {
24775 0 : uint32_t highest_ofs;
24776 :
24777 0 : if (pull->offset > pull->relative_highest_offset) {
24778 0 : highest_ofs = pull->offset;
24779 : } else {
24780 0 : highest_ofs = pull->relative_highest_offset;
24781 : }
24782 0 : if (highest_ofs < pull->data_size) {
24783 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24784 : "not all bytes consumed ofs[%u] size[%u]",
24785 : highest_ofs, pull->data_size);
24786 0 : TALLOC_FREE(pull);
24787 0 : PyErr_SetNdrError(err);
24788 0 : return NULL;
24789 : }
24790 : }
24791 :
24792 0 : TALLOC_FREE(pull);
24793 0 : Py_RETURN_NONE;
24794 : }
24795 :
24796 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24797 : {
24798 0 : DATA_BLOB blob;
24799 0 : Py_ssize_t blob_length = 0;
24800 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24801 0 : PyObject *bigendian_obj = NULL;
24802 0 : PyObject *ndr64_obj = NULL;
24803 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24804 0 : PyObject *allow_remaining_obj = NULL;
24805 0 : bool allow_remaining = false;
24806 :
24807 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24808 : discard_const_p(char *, kwnames),
24809 : &blob.data, &blob_length,
24810 : &bigendian_obj,
24811 : &ndr64_obj,
24812 : &allow_remaining_obj)) {
24813 0 : return NULL;
24814 : }
24815 0 : blob.length = blob_length;
24816 :
24817 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24818 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24819 : }
24820 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24821 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24822 : }
24823 :
24824 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24825 0 : allow_remaining = true;
24826 : }
24827 :
24828 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24829 : }
24830 :
24831 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24832 : {
24833 0 : DATA_BLOB blob;
24834 0 : Py_ssize_t blob_length = 0;
24835 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24836 0 : PyObject *bigendian_obj = NULL;
24837 0 : PyObject *ndr64_obj = NULL;
24838 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24839 0 : PyObject *allow_remaining_obj = NULL;
24840 0 : bool allow_remaining = false;
24841 :
24842 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24843 : discard_const_p(char *, kwnames),
24844 : &blob.data, &blob_length,
24845 : &bigendian_obj,
24846 : &ndr64_obj,
24847 : &allow_remaining_obj)) {
24848 0 : return NULL;
24849 : }
24850 0 : blob.length = blob_length;
24851 :
24852 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24853 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24854 : }
24855 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24856 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24857 : }
24858 :
24859 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24860 0 : allow_remaining = true;
24861 : }
24862 :
24863 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24864 : }
24865 :
24866 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24867 : {
24868 0 : const struct ndr_interface_call *call = NULL;
24869 0 : struct lsa_SetInformationTrustedDomain *object = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(py_obj);
24870 0 : PyObject *ret;
24871 0 : char *retstr;
24872 :
24873 0 : if (ndr_table_lsarpc.num_calls < 28) {
24874 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_print");
24875 0 : return NULL;
24876 : }
24877 0 : call = &ndr_table_lsarpc.calls[27];
24878 :
24879 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24880 0 : ret = PyUnicode_FromString(retstr);
24881 0 : TALLOC_FREE(retstr);
24882 :
24883 0 : return ret;
24884 : }
24885 :
24886 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24887 : {
24888 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_in", NDR_IN);
24889 : }
24890 :
24891 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24892 : {
24893 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_out", NDR_OUT);
24894 : }
24895 :
24896 : static PyMethodDef py_lsa_SetInformationTrustedDomain_methods[] = {
24897 : { "opnum", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
24898 : "lsa.SetInformationTrustedDomain.opnum() -> 27 (0x1b) " },
24899 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24900 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24901 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24902 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24903 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24904 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24905 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24906 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24907 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24908 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24909 : { NULL, NULL, 0, NULL }
24910 : };
24911 :
24912 :
24913 : static PyTypeObject lsa_SetInformationTrustedDomain_Type = {
24914 : PyVarObject_HEAD_INIT(NULL, 0)
24915 : .tp_name = "lsa.SetInformationTrustedDomain",
24916 : .tp_getset = py_lsa_SetInformationTrustedDomain_getsetters,
24917 : .tp_methods = py_lsa_SetInformationTrustedDomain_methods,
24918 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24919 : .tp_new = py_lsa_SetInformationTrustedDomain_new,
24920 : };
24921 :
24922 22 : static bool pack_py_lsa_SetInformationTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInformationTrustedDomain *r)
24923 : {
24924 0 : PyObject *py_trustdom_handle;
24925 0 : PyObject *py_level;
24926 0 : PyObject *py_info;
24927 22 : const char *kwnames[] = {
24928 : "trustdom_handle", "level", "info", NULL
24929 : };
24930 :
24931 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInformationTrustedDomain", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level, &py_info)) {
24932 0 : return false;
24933 : }
24934 :
24935 22 : if (py_trustdom_handle == NULL) {
24936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trustdom_handle");
24937 0 : return false;
24938 : }
24939 22 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
24940 22 : if (r->in.trustdom_handle == NULL) {
24941 0 : PyErr_NoMemory();
24942 0 : return false;
24943 : }
24944 22 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
24945 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
24946 0 : PyErr_NoMemory();
24947 0 : return false;
24948 : }
24949 22 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
24950 22 : if (py_level == NULL) {
24951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
24952 0 : return false;
24953 : }
24954 : {
24955 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
24956 22 : if (PyLong_Check(py_level)) {
24957 0 : unsigned long long test_var;
24958 22 : test_var = PyLong_AsUnsignedLongLong(py_level);
24959 22 : if (PyErr_Occurred() != NULL) {
24960 0 : return false;
24961 : }
24962 22 : if (test_var > uint_max) {
24963 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24964 : PyLong_Type.tp_name, uint_max, test_var);
24965 0 : return false;
24966 : }
24967 22 : r->in.level = test_var;
24968 : } else {
24969 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24970 : PyLong_Type.tp_name);
24971 0 : return false;
24972 : }
24973 : }
24974 22 : if (py_info == NULL) {
24975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
24976 0 : return false;
24977 : }
24978 22 : r->in.info = talloc_ptrtype(r, r->in.info);
24979 22 : if (r->in.info == NULL) {
24980 0 : PyErr_NoMemory();
24981 0 : return false;
24982 : }
24983 : {
24984 0 : union lsa_TrustedDomainInfo *info_switch_1;
24985 22 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
24986 22 : if (info_switch_1 == NULL) {
24987 0 : return false;
24988 : }
24989 22 : r->in.info = info_switch_1;
24990 : }
24991 22 : return true;
24992 : }
24993 :
24994 22 : static PyObject *unpack_py_lsa_SetInformationTrustedDomain_args_out(struct lsa_SetInformationTrustedDomain *r)
24995 : {
24996 0 : PyObject *result;
24997 22 : result = Py_None;
24998 12 : Py_INCREF(result);
24999 22 : if (NT_STATUS_IS_ERR(r->out.result)) {
25000 0 : PyErr_SetNTSTATUS(r->out.result);
25001 0 : return NULL;
25002 : }
25003 :
25004 22 : return result;
25005 : }
25006 :
25007 :
25008 0 : static PyObject *py_lsa_OpenSecret_in_get_handle(PyObject *obj, void *closure)
25009 : {
25010 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25011 0 : PyObject *py_handle;
25012 0 : if (object->in.handle == NULL) {
25013 0 : Py_RETURN_NONE;
25014 : }
25015 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
25016 0 : return py_handle;
25017 : }
25018 :
25019 0 : static int py_lsa_OpenSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
25020 : {
25021 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25022 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
25023 0 : if (value == NULL) {
25024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
25025 0 : return -1;
25026 : }
25027 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
25028 0 : if (object->in.handle == NULL) {
25029 0 : PyErr_NoMemory();
25030 0 : return -1;
25031 : }
25032 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25033 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25034 0 : PyErr_NoMemory();
25035 0 : return -1;
25036 : }
25037 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
25038 0 : return 0;
25039 : }
25040 :
25041 0 : static PyObject *py_lsa_OpenSecret_in_get_name(PyObject *obj, void *closure)
25042 : {
25043 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25044 0 : PyObject *py_name;
25045 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
25046 0 : return py_name;
25047 : }
25048 :
25049 0 : static int py_lsa_OpenSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
25050 : {
25051 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25052 0 : if (value == NULL) {
25053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
25054 0 : return -1;
25055 : }
25056 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
25057 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25058 0 : PyErr_NoMemory();
25059 0 : return -1;
25060 : }
25061 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
25062 0 : return 0;
25063 : }
25064 :
25065 0 : static PyObject *py_lsa_OpenSecret_in_get_access_mask(PyObject *obj, void *closure)
25066 : {
25067 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25068 0 : PyObject *py_access_mask;
25069 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
25070 0 : return py_access_mask;
25071 : }
25072 :
25073 0 : static int py_lsa_OpenSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
25074 : {
25075 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25076 0 : if (value == NULL) {
25077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
25078 0 : return -1;
25079 : }
25080 : {
25081 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
25082 0 : if (PyLong_Check(value)) {
25083 0 : unsigned long long test_var;
25084 0 : test_var = PyLong_AsUnsignedLongLong(value);
25085 0 : if (PyErr_Occurred() != NULL) {
25086 0 : return -1;
25087 : }
25088 0 : if (test_var > uint_max) {
25089 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25090 : PyLong_Type.tp_name, uint_max, test_var);
25091 0 : return -1;
25092 : }
25093 0 : object->in.access_mask = test_var;
25094 : } else {
25095 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25096 : PyLong_Type.tp_name);
25097 0 : return -1;
25098 : }
25099 : }
25100 0 : return 0;
25101 : }
25102 :
25103 0 : static PyObject *py_lsa_OpenSecret_out_get_sec_handle(PyObject *obj, void *closure)
25104 : {
25105 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25106 0 : PyObject *py_sec_handle;
25107 0 : if (object->out.sec_handle == NULL) {
25108 0 : Py_RETURN_NONE;
25109 : }
25110 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
25111 0 : return py_sec_handle;
25112 : }
25113 :
25114 0 : static int py_lsa_OpenSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
25115 : {
25116 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25117 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
25118 0 : if (value == NULL) {
25119 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sec_handle");
25120 0 : return -1;
25121 : }
25122 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
25123 0 : if (object->out.sec_handle == NULL) {
25124 0 : PyErr_NoMemory();
25125 0 : return -1;
25126 : }
25127 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25128 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25129 0 : PyErr_NoMemory();
25130 0 : return -1;
25131 : }
25132 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25133 0 : return 0;
25134 : }
25135 :
25136 0 : static PyObject *py_lsa_OpenSecret_get_result(PyObject *obj, void *closure)
25137 : {
25138 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(obj);
25139 0 : PyObject *py_result;
25140 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25141 0 : return py_result;
25142 : }
25143 :
25144 0 : static int py_lsa_OpenSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
25145 : {
25146 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25147 0 : if (value == NULL) {
25148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25149 0 : return -1;
25150 : }
25151 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25152 0 : return 0;
25153 : }
25154 :
25155 : static PyGetSetDef py_lsa_OpenSecret_getsetters[] = {
25156 : {
25157 : .name = discard_const_p(char, "in_handle"),
25158 : .get = py_lsa_OpenSecret_in_get_handle,
25159 : .set = py_lsa_OpenSecret_in_set_handle,
25160 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25161 : },
25162 : {
25163 : .name = discard_const_p(char, "in_name"),
25164 : .get = py_lsa_OpenSecret_in_get_name,
25165 : .set = py_lsa_OpenSecret_in_set_name,
25166 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
25167 : },
25168 : {
25169 : .name = discard_const_p(char, "in_access_mask"),
25170 : .get = py_lsa_OpenSecret_in_get_access_mask,
25171 : .set = py_lsa_OpenSecret_in_set_access_mask,
25172 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
25173 : },
25174 : {
25175 : .name = discard_const_p(char, "out_sec_handle"),
25176 : .get = py_lsa_OpenSecret_out_get_sec_handle,
25177 : .set = py_lsa_OpenSecret_out_set_sec_handle,
25178 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25179 : },
25180 : {
25181 : .name = discard_const_p(char, "result"),
25182 : .get = py_lsa_OpenSecret_get_result,
25183 : .set = py_lsa_OpenSecret_set_result,
25184 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25185 : },
25186 : { .name = NULL }
25187 : };
25188 :
25189 0 : static PyObject *py_lsa_OpenSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25190 : {
25191 0 : PyObject *self = pytalloc_new(struct lsa_OpenSecret, type);
25192 0 : struct lsa_OpenSecret *_self = (struct lsa_OpenSecret *)pytalloc_get_ptr(self);
25193 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25194 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
25195 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
25196 0 : return self;
25197 : }
25198 :
25199 0 : static PyObject *py_lsa_OpenSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25200 : {
25201 :
25202 :
25203 0 : return PyLong_FromLong(28);
25204 : }
25205 :
25206 0 : static PyObject *py_lsa_OpenSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25207 : {
25208 0 : const struct ndr_interface_call *call = NULL;
25209 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25210 0 : PyObject *ret = NULL;
25211 0 : struct ndr_push *push = NULL;
25212 0 : DATA_BLOB blob;
25213 0 : enum ndr_err_code err;
25214 :
25215 0 : if (ndr_table_lsarpc.num_calls < 29) {
25216 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_pack");
25217 0 : return NULL;
25218 : }
25219 0 : call = &ndr_table_lsarpc.calls[28];
25220 :
25221 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25222 0 : if (push == NULL) {
25223 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25224 0 : return NULL;
25225 : }
25226 :
25227 0 : push->flags |= ndr_push_flags;
25228 :
25229 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25230 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25231 0 : TALLOC_FREE(push);
25232 0 : PyErr_SetNdrError(err);
25233 0 : return NULL;
25234 : }
25235 0 : blob = ndr_push_blob(push);
25236 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25237 0 : TALLOC_FREE(push);
25238 0 : return ret;
25239 : }
25240 :
25241 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25242 : {
25243 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25244 0 : PyObject *bigendian_obj = NULL;
25245 0 : PyObject *ndr64_obj = NULL;
25246 0 : libndr_flags ndr_push_flags = 0;
25247 :
25248 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25249 : discard_const_p(char *, kwnames),
25250 : &bigendian_obj,
25251 : &ndr64_obj)) {
25252 0 : return NULL;
25253 : }
25254 :
25255 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25256 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25257 : }
25258 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25259 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25260 : }
25261 :
25262 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25263 : }
25264 :
25265 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25266 : {
25267 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25268 0 : PyObject *bigendian_obj = NULL;
25269 0 : PyObject *ndr64_obj = NULL;
25270 0 : libndr_flags ndr_push_flags = 0;
25271 :
25272 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25273 : discard_const_p(char *, kwnames),
25274 : &bigendian_obj,
25275 : &ndr64_obj)) {
25276 0 : return NULL;
25277 : }
25278 :
25279 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25280 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25281 : }
25282 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25283 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25284 : }
25285 :
25286 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25287 : }
25288 :
25289 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
25290 : {
25291 0 : const struct ndr_interface_call *call = NULL;
25292 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25293 0 : struct ndr_pull *pull = NULL;
25294 0 : enum ndr_err_code err;
25295 :
25296 0 : if (ndr_table_lsarpc.num_calls < 29) {
25297 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_unpack");
25298 0 : return NULL;
25299 : }
25300 0 : call = &ndr_table_lsarpc.calls[28];
25301 :
25302 0 : pull = ndr_pull_init_blob(blob, object);
25303 0 : if (pull == NULL) {
25304 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25305 0 : return NULL;
25306 : }
25307 :
25308 0 : pull->flags |= ndr_pull_flags;
25309 :
25310 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25311 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25312 0 : TALLOC_FREE(pull);
25313 0 : PyErr_SetNdrError(err);
25314 0 : return NULL;
25315 : }
25316 0 : if (!allow_remaining) {
25317 0 : uint32_t highest_ofs;
25318 :
25319 0 : if (pull->offset > pull->relative_highest_offset) {
25320 0 : highest_ofs = pull->offset;
25321 : } else {
25322 0 : highest_ofs = pull->relative_highest_offset;
25323 : }
25324 0 : if (highest_ofs < pull->data_size) {
25325 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25326 : "not all bytes consumed ofs[%u] size[%u]",
25327 : highest_ofs, pull->data_size);
25328 0 : TALLOC_FREE(pull);
25329 0 : PyErr_SetNdrError(err);
25330 0 : return NULL;
25331 : }
25332 : }
25333 :
25334 0 : TALLOC_FREE(pull);
25335 0 : Py_RETURN_NONE;
25336 : }
25337 :
25338 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25339 : {
25340 0 : DATA_BLOB blob;
25341 0 : Py_ssize_t blob_length = 0;
25342 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25343 0 : PyObject *bigendian_obj = NULL;
25344 0 : PyObject *ndr64_obj = NULL;
25345 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25346 0 : PyObject *allow_remaining_obj = NULL;
25347 0 : bool allow_remaining = false;
25348 :
25349 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25350 : discard_const_p(char *, kwnames),
25351 : &blob.data, &blob_length,
25352 : &bigendian_obj,
25353 : &ndr64_obj,
25354 : &allow_remaining_obj)) {
25355 0 : return NULL;
25356 : }
25357 0 : blob.length = blob_length;
25358 :
25359 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25360 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25361 : }
25362 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25363 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25364 : }
25365 :
25366 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25367 0 : allow_remaining = true;
25368 : }
25369 :
25370 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25371 : }
25372 :
25373 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25374 : {
25375 0 : DATA_BLOB blob;
25376 0 : Py_ssize_t blob_length = 0;
25377 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25378 0 : PyObject *bigendian_obj = NULL;
25379 0 : PyObject *ndr64_obj = NULL;
25380 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25381 0 : PyObject *allow_remaining_obj = NULL;
25382 0 : bool allow_remaining = false;
25383 :
25384 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25385 : discard_const_p(char *, kwnames),
25386 : &blob.data, &blob_length,
25387 : &bigendian_obj,
25388 : &ndr64_obj,
25389 : &allow_remaining_obj)) {
25390 0 : return NULL;
25391 : }
25392 0 : blob.length = blob_length;
25393 :
25394 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25395 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25396 : }
25397 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25398 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25399 : }
25400 :
25401 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25402 0 : allow_remaining = true;
25403 : }
25404 :
25405 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25406 : }
25407 :
25408 0 : static PyObject *py_lsa_OpenSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25409 : {
25410 0 : const struct ndr_interface_call *call = NULL;
25411 0 : struct lsa_OpenSecret *object = (struct lsa_OpenSecret *)pytalloc_get_ptr(py_obj);
25412 0 : PyObject *ret;
25413 0 : char *retstr;
25414 :
25415 0 : if (ndr_table_lsarpc.num_calls < 29) {
25416 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_print");
25417 0 : return NULL;
25418 : }
25419 0 : call = &ndr_table_lsarpc.calls[28];
25420 :
25421 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25422 0 : ret = PyUnicode_FromString(retstr);
25423 0 : TALLOC_FREE(retstr);
25424 :
25425 0 : return ret;
25426 : }
25427 :
25428 0 : static PyObject *py_lsa_OpenSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25429 : {
25430 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_in", NDR_IN);
25431 : }
25432 :
25433 0 : static PyObject *py_lsa_OpenSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25434 : {
25435 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_out", NDR_OUT);
25436 : }
25437 :
25438 : static PyMethodDef py_lsa_OpenSecret_methods[] = {
25439 : { "opnum", (PyCFunction)py_lsa_OpenSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
25440 : "lsa.OpenSecret.opnum() -> 28 (0x1c) " },
25441 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25442 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25443 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25444 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25445 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25446 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25447 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25448 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25449 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25450 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25451 : { NULL, NULL, 0, NULL }
25452 : };
25453 :
25454 :
25455 : static PyTypeObject lsa_OpenSecret_Type = {
25456 : PyVarObject_HEAD_INIT(NULL, 0)
25457 : .tp_name = "lsa.OpenSecret",
25458 : .tp_getset = py_lsa_OpenSecret_getsetters,
25459 : .tp_methods = py_lsa_OpenSecret_methods,
25460 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25461 : .tp_new = py_lsa_OpenSecret_new,
25462 : };
25463 :
25464 1 : static bool pack_py_lsa_OpenSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenSecret *r)
25465 : {
25466 0 : PyObject *py_handle;
25467 0 : PyObject *py_name;
25468 0 : PyObject *py_access_mask;
25469 1 : const char *kwnames[] = {
25470 : "handle", "name", "access_mask", NULL
25471 : };
25472 :
25473 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
25474 0 : return false;
25475 : }
25476 :
25477 1 : if (py_handle == NULL) {
25478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
25479 0 : return false;
25480 : }
25481 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
25482 1 : if (r->in.handle == NULL) {
25483 0 : PyErr_NoMemory();
25484 0 : return false;
25485 : }
25486 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
25487 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
25488 0 : PyErr_NoMemory();
25489 0 : return false;
25490 : }
25491 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
25492 1 : if (py_name == NULL) {
25493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
25494 0 : return false;
25495 : }
25496 1 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
25497 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
25498 0 : PyErr_NoMemory();
25499 0 : return false;
25500 : }
25501 1 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
25502 1 : if (py_access_mask == NULL) {
25503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
25504 0 : return false;
25505 : }
25506 : {
25507 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
25508 1 : if (PyLong_Check(py_access_mask)) {
25509 0 : unsigned long long test_var;
25510 1 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
25511 1 : if (PyErr_Occurred() != NULL) {
25512 0 : return false;
25513 : }
25514 1 : if (test_var > uint_max) {
25515 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25516 : PyLong_Type.tp_name, uint_max, test_var);
25517 0 : return false;
25518 : }
25519 1 : r->in.access_mask = test_var;
25520 : } else {
25521 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25522 : PyLong_Type.tp_name);
25523 0 : return false;
25524 : }
25525 : }
25526 1 : return true;
25527 : }
25528 :
25529 1 : static PyObject *unpack_py_lsa_OpenSecret_args_out(struct lsa_OpenSecret *r)
25530 : {
25531 0 : PyObject *result;
25532 0 : PyObject *py_sec_handle;
25533 1 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
25534 1 : result = py_sec_handle;
25535 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
25536 0 : PyErr_SetNTSTATUS(r->out.result);
25537 0 : return NULL;
25538 : }
25539 :
25540 1 : return result;
25541 : }
25542 :
25543 :
25544 0 : static PyObject *py_lsa_SetSecret_in_get_sec_handle(PyObject *obj, void *closure)
25545 : {
25546 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25547 0 : PyObject *py_sec_handle;
25548 0 : if (object->in.sec_handle == NULL) {
25549 0 : Py_RETURN_NONE;
25550 : }
25551 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
25552 0 : return py_sec_handle;
25553 : }
25554 :
25555 0 : static int py_lsa_SetSecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
25556 : {
25557 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25558 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
25559 0 : if (value == NULL) {
25560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_handle");
25561 0 : return -1;
25562 : }
25563 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
25564 0 : if (object->in.sec_handle == NULL) {
25565 0 : PyErr_NoMemory();
25566 0 : return -1;
25567 : }
25568 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25569 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25570 0 : PyErr_NoMemory();
25571 0 : return -1;
25572 : }
25573 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25574 0 : return 0;
25575 : }
25576 :
25577 0 : static PyObject *py_lsa_SetSecret_in_get_new_val(PyObject *obj, void *closure)
25578 : {
25579 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25580 0 : PyObject *py_new_val;
25581 0 : if (object->in.new_val == NULL) {
25582 0 : Py_RETURN_NONE;
25583 : }
25584 0 : if (object->in.new_val == NULL) {
25585 0 : py_new_val = Py_None;
25586 0 : Py_INCREF(py_new_val);
25587 : } else {
25588 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.new_val, object->in.new_val);
25589 : }
25590 0 : return py_new_val;
25591 : }
25592 :
25593 0 : static int py_lsa_SetSecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
25594 : {
25595 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25596 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
25597 0 : if (value == NULL) {
25598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_val");
25599 0 : return -1;
25600 : }
25601 0 : if (value == Py_None) {
25602 0 : object->in.new_val = NULL;
25603 : } else {
25604 0 : object->in.new_val = NULL;
25605 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
25606 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25607 0 : PyErr_NoMemory();
25608 0 : return -1;
25609 : }
25610 0 : object->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
25611 : }
25612 0 : return 0;
25613 : }
25614 :
25615 0 : static PyObject *py_lsa_SetSecret_in_get_old_val(PyObject *obj, void *closure)
25616 : {
25617 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25618 0 : PyObject *py_old_val;
25619 0 : if (object->in.old_val == NULL) {
25620 0 : Py_RETURN_NONE;
25621 : }
25622 0 : if (object->in.old_val == NULL) {
25623 0 : py_old_val = Py_None;
25624 0 : Py_INCREF(py_old_val);
25625 : } else {
25626 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.old_val, object->in.old_val);
25627 : }
25628 0 : return py_old_val;
25629 : }
25630 :
25631 0 : static int py_lsa_SetSecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
25632 : {
25633 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25634 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
25635 0 : if (value == NULL) {
25636 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_val");
25637 0 : return -1;
25638 : }
25639 0 : if (value == Py_None) {
25640 0 : object->in.old_val = NULL;
25641 : } else {
25642 0 : object->in.old_val = NULL;
25643 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
25644 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25645 0 : PyErr_NoMemory();
25646 0 : return -1;
25647 : }
25648 0 : object->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
25649 : }
25650 0 : return 0;
25651 : }
25652 :
25653 0 : static PyObject *py_lsa_SetSecret_get_result(PyObject *obj, void *closure)
25654 : {
25655 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(obj);
25656 0 : PyObject *py_result;
25657 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25658 0 : return py_result;
25659 : }
25660 :
25661 0 : static int py_lsa_SetSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
25662 : {
25663 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25664 0 : if (value == NULL) {
25665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25666 0 : return -1;
25667 : }
25668 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25669 0 : return 0;
25670 : }
25671 :
25672 : static PyGetSetDef py_lsa_SetSecret_getsetters[] = {
25673 : {
25674 : .name = discard_const_p(char, "in_sec_handle"),
25675 : .get = py_lsa_SetSecret_in_get_sec_handle,
25676 : .set = py_lsa_SetSecret_in_set_sec_handle,
25677 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25678 : },
25679 : {
25680 : .name = discard_const_p(char, "in_new_val"),
25681 : .get = py_lsa_SetSecret_in_get_new_val,
25682 : .set = py_lsa_SetSecret_in_set_new_val,
25683 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
25684 : },
25685 : {
25686 : .name = discard_const_p(char, "in_old_val"),
25687 : .get = py_lsa_SetSecret_in_get_old_val,
25688 : .set = py_lsa_SetSecret_in_set_old_val,
25689 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
25690 : },
25691 : {
25692 : .name = discard_const_p(char, "result"),
25693 : .get = py_lsa_SetSecret_get_result,
25694 : .set = py_lsa_SetSecret_set_result,
25695 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25696 : },
25697 : { .name = NULL }
25698 : };
25699 :
25700 0 : static PyObject *py_lsa_SetSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25701 : {
25702 0 : PyObject *self = pytalloc_new(struct lsa_SetSecret, type);
25703 0 : struct lsa_SetSecret *_self = (struct lsa_SetSecret *)pytalloc_get_ptr(self);
25704 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25705 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
25706 0 : return self;
25707 : }
25708 :
25709 0 : static PyObject *py_lsa_SetSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25710 : {
25711 :
25712 :
25713 0 : return PyLong_FromLong(29);
25714 : }
25715 :
25716 0 : static PyObject *py_lsa_SetSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25717 : {
25718 0 : const struct ndr_interface_call *call = NULL;
25719 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25720 0 : PyObject *ret = NULL;
25721 0 : struct ndr_push *push = NULL;
25722 0 : DATA_BLOB blob;
25723 0 : enum ndr_err_code err;
25724 :
25725 0 : if (ndr_table_lsarpc.num_calls < 30) {
25726 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_pack");
25727 0 : return NULL;
25728 : }
25729 0 : call = &ndr_table_lsarpc.calls[29];
25730 :
25731 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25732 0 : if (push == NULL) {
25733 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25734 0 : return NULL;
25735 : }
25736 :
25737 0 : push->flags |= ndr_push_flags;
25738 :
25739 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25740 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25741 0 : TALLOC_FREE(push);
25742 0 : PyErr_SetNdrError(err);
25743 0 : return NULL;
25744 : }
25745 0 : blob = ndr_push_blob(push);
25746 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25747 0 : TALLOC_FREE(push);
25748 0 : return ret;
25749 : }
25750 :
25751 0 : static PyObject *py_lsa_SetSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25752 : {
25753 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25754 0 : PyObject *bigendian_obj = NULL;
25755 0 : PyObject *ndr64_obj = NULL;
25756 0 : libndr_flags ndr_push_flags = 0;
25757 :
25758 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25759 : discard_const_p(char *, kwnames),
25760 : &bigendian_obj,
25761 : &ndr64_obj)) {
25762 0 : return NULL;
25763 : }
25764 :
25765 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25766 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25767 : }
25768 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25769 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25770 : }
25771 :
25772 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25773 : }
25774 :
25775 0 : static PyObject *py_lsa_SetSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25776 : {
25777 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25778 0 : PyObject *bigendian_obj = NULL;
25779 0 : PyObject *ndr64_obj = NULL;
25780 0 : libndr_flags ndr_push_flags = 0;
25781 :
25782 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25783 : discard_const_p(char *, kwnames),
25784 : &bigendian_obj,
25785 : &ndr64_obj)) {
25786 0 : return NULL;
25787 : }
25788 :
25789 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25790 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25791 : }
25792 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25793 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25794 : }
25795 :
25796 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25797 : }
25798 :
25799 0 : static PyObject *py_lsa_SetSecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
25800 : {
25801 0 : const struct ndr_interface_call *call = NULL;
25802 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25803 0 : struct ndr_pull *pull = NULL;
25804 0 : enum ndr_err_code err;
25805 :
25806 0 : if (ndr_table_lsarpc.num_calls < 30) {
25807 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_unpack");
25808 0 : return NULL;
25809 : }
25810 0 : call = &ndr_table_lsarpc.calls[29];
25811 :
25812 0 : pull = ndr_pull_init_blob(blob, object);
25813 0 : if (pull == NULL) {
25814 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25815 0 : return NULL;
25816 : }
25817 :
25818 0 : pull->flags |= ndr_pull_flags;
25819 :
25820 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25821 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25822 0 : TALLOC_FREE(pull);
25823 0 : PyErr_SetNdrError(err);
25824 0 : return NULL;
25825 : }
25826 0 : if (!allow_remaining) {
25827 0 : uint32_t highest_ofs;
25828 :
25829 0 : if (pull->offset > pull->relative_highest_offset) {
25830 0 : highest_ofs = pull->offset;
25831 : } else {
25832 0 : highest_ofs = pull->relative_highest_offset;
25833 : }
25834 0 : if (highest_ofs < pull->data_size) {
25835 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25836 : "not all bytes consumed ofs[%u] size[%u]",
25837 : highest_ofs, pull->data_size);
25838 0 : TALLOC_FREE(pull);
25839 0 : PyErr_SetNdrError(err);
25840 0 : return NULL;
25841 : }
25842 : }
25843 :
25844 0 : TALLOC_FREE(pull);
25845 0 : Py_RETURN_NONE;
25846 : }
25847 :
25848 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25849 : {
25850 0 : DATA_BLOB blob;
25851 0 : Py_ssize_t blob_length = 0;
25852 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25853 0 : PyObject *bigendian_obj = NULL;
25854 0 : PyObject *ndr64_obj = NULL;
25855 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25856 0 : PyObject *allow_remaining_obj = NULL;
25857 0 : bool allow_remaining = false;
25858 :
25859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25860 : discard_const_p(char *, kwnames),
25861 : &blob.data, &blob_length,
25862 : &bigendian_obj,
25863 : &ndr64_obj,
25864 : &allow_remaining_obj)) {
25865 0 : return NULL;
25866 : }
25867 0 : blob.length = blob_length;
25868 :
25869 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25870 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25871 : }
25872 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25873 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25874 : }
25875 :
25876 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25877 0 : allow_remaining = true;
25878 : }
25879 :
25880 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25881 : }
25882 :
25883 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25884 : {
25885 0 : DATA_BLOB blob;
25886 0 : Py_ssize_t blob_length = 0;
25887 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25888 0 : PyObject *bigendian_obj = NULL;
25889 0 : PyObject *ndr64_obj = NULL;
25890 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25891 0 : PyObject *allow_remaining_obj = NULL;
25892 0 : bool allow_remaining = false;
25893 :
25894 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25895 : discard_const_p(char *, kwnames),
25896 : &blob.data, &blob_length,
25897 : &bigendian_obj,
25898 : &ndr64_obj,
25899 : &allow_remaining_obj)) {
25900 0 : return NULL;
25901 : }
25902 0 : blob.length = blob_length;
25903 :
25904 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25905 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25906 : }
25907 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25908 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25909 : }
25910 :
25911 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25912 0 : allow_remaining = true;
25913 : }
25914 :
25915 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25916 : }
25917 :
25918 0 : static PyObject *py_lsa_SetSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25919 : {
25920 0 : const struct ndr_interface_call *call = NULL;
25921 0 : struct lsa_SetSecret *object = (struct lsa_SetSecret *)pytalloc_get_ptr(py_obj);
25922 0 : PyObject *ret;
25923 0 : char *retstr;
25924 :
25925 0 : if (ndr_table_lsarpc.num_calls < 30) {
25926 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_print");
25927 0 : return NULL;
25928 : }
25929 0 : call = &ndr_table_lsarpc.calls[29];
25930 :
25931 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25932 0 : ret = PyUnicode_FromString(retstr);
25933 0 : TALLOC_FREE(retstr);
25934 :
25935 0 : return ret;
25936 : }
25937 :
25938 0 : static PyObject *py_lsa_SetSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25939 : {
25940 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_in", NDR_IN);
25941 : }
25942 :
25943 0 : static PyObject *py_lsa_SetSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25944 : {
25945 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_out", NDR_OUT);
25946 : }
25947 :
25948 : static PyMethodDef py_lsa_SetSecret_methods[] = {
25949 : { "opnum", (PyCFunction)py_lsa_SetSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
25950 : "lsa.SetSecret.opnum() -> 29 (0x1d) " },
25951 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25952 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25953 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25954 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25955 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25956 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25957 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25958 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25959 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25960 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25961 : { NULL, NULL, 0, NULL }
25962 : };
25963 :
25964 :
25965 : static PyTypeObject lsa_SetSecret_Type = {
25966 : PyVarObject_HEAD_INIT(NULL, 0)
25967 : .tp_name = "lsa.SetSecret",
25968 : .tp_getset = py_lsa_SetSecret_getsetters,
25969 : .tp_methods = py_lsa_SetSecret_methods,
25970 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25971 : .tp_new = py_lsa_SetSecret_new,
25972 : };
25973 :
25974 0 : static bool pack_py_lsa_SetSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecret *r)
25975 : {
25976 0 : PyObject *py_sec_handle;
25977 0 : PyObject *py_new_val;
25978 0 : PyObject *py_old_val;
25979 0 : const char *kwnames[] = {
25980 : "sec_handle", "new_val", "old_val", NULL
25981 : };
25982 :
25983 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_old_val)) {
25984 0 : return false;
25985 : }
25986 :
25987 0 : if (py_sec_handle == NULL) {
25988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_handle");
25989 0 : return false;
25990 : }
25991 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
25992 0 : if (r->in.sec_handle == NULL) {
25993 0 : PyErr_NoMemory();
25994 0 : return false;
25995 : }
25996 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
25997 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
25998 0 : PyErr_NoMemory();
25999 0 : return false;
26000 : }
26001 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
26002 0 : if (py_new_val == NULL) {
26003 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_val");
26004 0 : return false;
26005 : }
26006 0 : if (py_new_val == Py_None) {
26007 0 : r->in.new_val = NULL;
26008 : } else {
26009 0 : r->in.new_val = NULL;
26010 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_new_val, return false;);
26011 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
26012 0 : PyErr_NoMemory();
26013 0 : return false;
26014 : }
26015 0 : r->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_new_val);
26016 : }
26017 0 : if (py_old_val == NULL) {
26018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_val");
26019 0 : return false;
26020 : }
26021 0 : if (py_old_val == Py_None) {
26022 0 : r->in.old_val = NULL;
26023 : } else {
26024 0 : r->in.old_val = NULL;
26025 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_old_val, return false;);
26026 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
26027 0 : PyErr_NoMemory();
26028 0 : return false;
26029 : }
26030 0 : r->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_old_val);
26031 : }
26032 0 : return true;
26033 : }
26034 :
26035 0 : static PyObject *unpack_py_lsa_SetSecret_args_out(struct lsa_SetSecret *r)
26036 : {
26037 0 : PyObject *result;
26038 0 : result = Py_None;
26039 0 : Py_INCREF(result);
26040 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26041 0 : PyErr_SetNTSTATUS(r->out.result);
26042 0 : return NULL;
26043 : }
26044 :
26045 0 : return result;
26046 : }
26047 :
26048 :
26049 0 : static PyObject *py_lsa_QuerySecret_in_get_sec_handle(PyObject *obj, void *closure)
26050 : {
26051 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26052 0 : PyObject *py_sec_handle;
26053 0 : if (object->in.sec_handle == NULL) {
26054 0 : Py_RETURN_NONE;
26055 : }
26056 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
26057 0 : return py_sec_handle;
26058 : }
26059 :
26060 0 : static int py_lsa_QuerySecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
26061 : {
26062 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26063 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
26064 0 : if (value == NULL) {
26065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_handle");
26066 0 : return -1;
26067 : }
26068 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
26069 0 : if (object->in.sec_handle == NULL) {
26070 0 : PyErr_NoMemory();
26071 0 : return -1;
26072 : }
26073 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26074 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26075 0 : PyErr_NoMemory();
26076 0 : return -1;
26077 : }
26078 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26079 0 : return 0;
26080 : }
26081 :
26082 0 : static PyObject *py_lsa_QuerySecret_in_get_new_val(PyObject *obj, void *closure)
26083 : {
26084 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26085 0 : PyObject *py_new_val;
26086 0 : if (object->in.new_val == NULL) {
26087 0 : Py_RETURN_NONE;
26088 : }
26089 0 : if (object->in.new_val == NULL) {
26090 0 : py_new_val = Py_None;
26091 0 : Py_INCREF(py_new_val);
26092 : } else {
26093 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.new_val, object->in.new_val);
26094 : }
26095 0 : return py_new_val;
26096 : }
26097 :
26098 0 : static int py_lsa_QuerySecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
26099 : {
26100 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26101 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
26102 0 : if (value == NULL) {
26103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_val");
26104 0 : return -1;
26105 : }
26106 0 : if (value == Py_None) {
26107 0 : object->in.new_val = NULL;
26108 : } else {
26109 0 : object->in.new_val = NULL;
26110 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26111 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26112 0 : PyErr_NoMemory();
26113 0 : return -1;
26114 : }
26115 0 : object->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26116 : }
26117 0 : return 0;
26118 : }
26119 :
26120 0 : static PyObject *py_lsa_QuerySecret_out_get_new_val(PyObject *obj, void *closure)
26121 : {
26122 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26123 0 : PyObject *py_new_val;
26124 0 : if (object->out.new_val == NULL) {
26125 0 : Py_RETURN_NONE;
26126 : }
26127 0 : if (object->out.new_val == NULL) {
26128 0 : py_new_val = Py_None;
26129 0 : Py_INCREF(py_new_val);
26130 : } else {
26131 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.new_val, object->out.new_val);
26132 : }
26133 0 : return py_new_val;
26134 : }
26135 :
26136 0 : static int py_lsa_QuerySecret_out_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
26137 : {
26138 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26139 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_val));
26140 0 : if (value == NULL) {
26141 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_val");
26142 0 : return -1;
26143 : }
26144 0 : if (value == Py_None) {
26145 0 : object->out.new_val = NULL;
26146 : } else {
26147 0 : object->out.new_val = NULL;
26148 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26149 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26150 0 : PyErr_NoMemory();
26151 0 : return -1;
26152 : }
26153 0 : object->out.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26154 : }
26155 0 : return 0;
26156 : }
26157 :
26158 0 : static PyObject *py_lsa_QuerySecret_in_get_new_mtime(PyObject *obj, void *closure)
26159 : {
26160 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26161 0 : PyObject *py_new_mtime;
26162 0 : if (object->in.new_mtime == NULL) {
26163 0 : Py_RETURN_NONE;
26164 : }
26165 0 : if (object->in.new_mtime == NULL) {
26166 0 : py_new_mtime = Py_None;
26167 0 : Py_INCREF(py_new_mtime);
26168 : } else {
26169 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->in.new_mtime);
26170 : }
26171 0 : return py_new_mtime;
26172 : }
26173 :
26174 0 : static int py_lsa_QuerySecret_in_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
26175 : {
26176 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26177 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_mtime));
26178 0 : if (value == NULL) {
26179 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_mtime");
26180 0 : return -1;
26181 : }
26182 0 : if (value == Py_None) {
26183 0 : object->in.new_mtime = NULL;
26184 : } else {
26185 0 : object->in.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_mtime);
26186 0 : if (object->in.new_mtime == NULL) {
26187 0 : PyErr_NoMemory();
26188 0 : return -1;
26189 : }
26190 : {
26191 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.new_mtime));
26192 0 : if (PyLong_Check(value)) {
26193 0 : unsigned long long test_var;
26194 0 : test_var = PyLong_AsUnsignedLongLong(value);
26195 0 : if (PyErr_Occurred() != NULL) {
26196 0 : return -1;
26197 : }
26198 0 : if (test_var > uint_max) {
26199 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26200 : PyLong_Type.tp_name, uint_max, test_var);
26201 0 : return -1;
26202 : }
26203 0 : *object->in.new_mtime = test_var;
26204 : } else {
26205 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26206 : PyLong_Type.tp_name);
26207 0 : return -1;
26208 : }
26209 : }
26210 : }
26211 0 : return 0;
26212 : }
26213 :
26214 0 : static PyObject *py_lsa_QuerySecret_out_get_new_mtime(PyObject *obj, void *closure)
26215 : {
26216 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26217 0 : PyObject *py_new_mtime;
26218 0 : if (object->out.new_mtime == NULL) {
26219 0 : Py_RETURN_NONE;
26220 : }
26221 0 : if (object->out.new_mtime == NULL) {
26222 0 : py_new_mtime = Py_None;
26223 0 : Py_INCREF(py_new_mtime);
26224 : } else {
26225 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->out.new_mtime);
26226 : }
26227 0 : return py_new_mtime;
26228 : }
26229 :
26230 0 : static int py_lsa_QuerySecret_out_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
26231 : {
26232 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26233 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_mtime));
26234 0 : if (value == NULL) {
26235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.new_mtime");
26236 0 : return -1;
26237 : }
26238 0 : if (value == Py_None) {
26239 0 : object->out.new_mtime = NULL;
26240 : } else {
26241 0 : object->out.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_mtime);
26242 0 : if (object->out.new_mtime == NULL) {
26243 0 : PyErr_NoMemory();
26244 0 : return -1;
26245 : }
26246 : {
26247 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.new_mtime));
26248 0 : if (PyLong_Check(value)) {
26249 0 : unsigned long long test_var;
26250 0 : test_var = PyLong_AsUnsignedLongLong(value);
26251 0 : if (PyErr_Occurred() != NULL) {
26252 0 : return -1;
26253 : }
26254 0 : if (test_var > uint_max) {
26255 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26256 : PyLong_Type.tp_name, uint_max, test_var);
26257 0 : return -1;
26258 : }
26259 0 : *object->out.new_mtime = test_var;
26260 : } else {
26261 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26262 : PyLong_Type.tp_name);
26263 0 : return -1;
26264 : }
26265 : }
26266 : }
26267 0 : return 0;
26268 : }
26269 :
26270 0 : static PyObject *py_lsa_QuerySecret_in_get_old_val(PyObject *obj, void *closure)
26271 : {
26272 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26273 0 : PyObject *py_old_val;
26274 0 : if (object->in.old_val == NULL) {
26275 0 : Py_RETURN_NONE;
26276 : }
26277 0 : if (object->in.old_val == NULL) {
26278 0 : py_old_val = Py_None;
26279 0 : Py_INCREF(py_old_val);
26280 : } else {
26281 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.old_val, object->in.old_val);
26282 : }
26283 0 : return py_old_val;
26284 : }
26285 :
26286 0 : static int py_lsa_QuerySecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
26287 : {
26288 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
26290 0 : if (value == NULL) {
26291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_val");
26292 0 : return -1;
26293 : }
26294 0 : if (value == Py_None) {
26295 0 : object->in.old_val = NULL;
26296 : } else {
26297 0 : object->in.old_val = NULL;
26298 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26299 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26300 0 : PyErr_NoMemory();
26301 0 : return -1;
26302 : }
26303 0 : object->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26304 : }
26305 0 : return 0;
26306 : }
26307 :
26308 0 : static PyObject *py_lsa_QuerySecret_out_get_old_val(PyObject *obj, void *closure)
26309 : {
26310 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26311 0 : PyObject *py_old_val;
26312 0 : if (object->out.old_val == NULL) {
26313 0 : Py_RETURN_NONE;
26314 : }
26315 0 : if (object->out.old_val == NULL) {
26316 0 : py_old_val = Py_None;
26317 0 : Py_INCREF(py_old_val);
26318 : } else {
26319 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.old_val, object->out.old_val);
26320 : }
26321 0 : return py_old_val;
26322 : }
26323 :
26324 0 : static int py_lsa_QuerySecret_out_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
26325 : {
26326 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26327 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_val));
26328 0 : if (value == NULL) {
26329 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_val");
26330 0 : return -1;
26331 : }
26332 0 : if (value == Py_None) {
26333 0 : object->out.old_val = NULL;
26334 : } else {
26335 0 : object->out.old_val = NULL;
26336 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
26337 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26338 0 : PyErr_NoMemory();
26339 0 : return -1;
26340 : }
26341 0 : object->out.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
26342 : }
26343 0 : return 0;
26344 : }
26345 :
26346 0 : static PyObject *py_lsa_QuerySecret_in_get_old_mtime(PyObject *obj, void *closure)
26347 : {
26348 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26349 0 : PyObject *py_old_mtime;
26350 0 : if (object->in.old_mtime == NULL) {
26351 0 : Py_RETURN_NONE;
26352 : }
26353 0 : if (object->in.old_mtime == NULL) {
26354 0 : py_old_mtime = Py_None;
26355 0 : Py_INCREF(py_old_mtime);
26356 : } else {
26357 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->in.old_mtime);
26358 : }
26359 0 : return py_old_mtime;
26360 : }
26361 :
26362 0 : static int py_lsa_QuerySecret_in_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
26363 : {
26364 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26365 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_mtime));
26366 0 : if (value == NULL) {
26367 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_mtime");
26368 0 : return -1;
26369 : }
26370 0 : if (value == Py_None) {
26371 0 : object->in.old_mtime = NULL;
26372 : } else {
26373 0 : object->in.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.old_mtime);
26374 0 : if (object->in.old_mtime == NULL) {
26375 0 : PyErr_NoMemory();
26376 0 : return -1;
26377 : }
26378 : {
26379 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.old_mtime));
26380 0 : if (PyLong_Check(value)) {
26381 0 : unsigned long long test_var;
26382 0 : test_var = PyLong_AsUnsignedLongLong(value);
26383 0 : if (PyErr_Occurred() != NULL) {
26384 0 : return -1;
26385 : }
26386 0 : if (test_var > uint_max) {
26387 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26388 : PyLong_Type.tp_name, uint_max, test_var);
26389 0 : return -1;
26390 : }
26391 0 : *object->in.old_mtime = test_var;
26392 : } else {
26393 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26394 : PyLong_Type.tp_name);
26395 0 : return -1;
26396 : }
26397 : }
26398 : }
26399 0 : return 0;
26400 : }
26401 :
26402 0 : static PyObject *py_lsa_QuerySecret_out_get_old_mtime(PyObject *obj, void *closure)
26403 : {
26404 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26405 0 : PyObject *py_old_mtime;
26406 0 : if (object->out.old_mtime == NULL) {
26407 0 : Py_RETURN_NONE;
26408 : }
26409 0 : if (object->out.old_mtime == NULL) {
26410 0 : py_old_mtime = Py_None;
26411 0 : Py_INCREF(py_old_mtime);
26412 : } else {
26413 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->out.old_mtime);
26414 : }
26415 0 : return py_old_mtime;
26416 : }
26417 :
26418 0 : static int py_lsa_QuerySecret_out_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
26419 : {
26420 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26421 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_mtime));
26422 0 : if (value == NULL) {
26423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.old_mtime");
26424 0 : return -1;
26425 : }
26426 0 : if (value == Py_None) {
26427 0 : object->out.old_mtime = NULL;
26428 : } else {
26429 0 : object->out.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_mtime);
26430 0 : if (object->out.old_mtime == NULL) {
26431 0 : PyErr_NoMemory();
26432 0 : return -1;
26433 : }
26434 : {
26435 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.old_mtime));
26436 0 : if (PyLong_Check(value)) {
26437 0 : unsigned long long test_var;
26438 0 : test_var = PyLong_AsUnsignedLongLong(value);
26439 0 : if (PyErr_Occurred() != NULL) {
26440 0 : return -1;
26441 : }
26442 0 : if (test_var > uint_max) {
26443 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26444 : PyLong_Type.tp_name, uint_max, test_var);
26445 0 : return -1;
26446 : }
26447 0 : *object->out.old_mtime = test_var;
26448 : } else {
26449 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26450 : PyLong_Type.tp_name);
26451 0 : return -1;
26452 : }
26453 : }
26454 : }
26455 0 : return 0;
26456 : }
26457 :
26458 0 : static PyObject *py_lsa_QuerySecret_get_result(PyObject *obj, void *closure)
26459 : {
26460 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(obj);
26461 0 : PyObject *py_result;
26462 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26463 0 : return py_result;
26464 : }
26465 :
26466 0 : static int py_lsa_QuerySecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
26467 : {
26468 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26469 0 : if (value == NULL) {
26470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26471 0 : return -1;
26472 : }
26473 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26474 0 : return 0;
26475 : }
26476 :
26477 : static PyGetSetDef py_lsa_QuerySecret_getsetters[] = {
26478 : {
26479 : .name = discard_const_p(char, "in_sec_handle"),
26480 : .get = py_lsa_QuerySecret_in_get_sec_handle,
26481 : .set = py_lsa_QuerySecret_in_set_sec_handle,
26482 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26483 : },
26484 : {
26485 : .name = discard_const_p(char, "in_new_val"),
26486 : .get = py_lsa_QuerySecret_in_get_new_val,
26487 : .set = py_lsa_QuerySecret_in_set_new_val,
26488 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26489 : },
26490 : {
26491 : .name = discard_const_p(char, "out_new_val"),
26492 : .get = py_lsa_QuerySecret_out_get_new_val,
26493 : .set = py_lsa_QuerySecret_out_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, "in_new_mtime"),
26498 : .get = py_lsa_QuerySecret_in_get_new_mtime,
26499 : .set = py_lsa_QuerySecret_in_set_new_mtime,
26500 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26501 : },
26502 : {
26503 : .name = discard_const_p(char, "out_new_mtime"),
26504 : .get = py_lsa_QuerySecret_out_get_new_mtime,
26505 : .set = py_lsa_QuerySecret_out_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, "in_old_val"),
26510 : .get = py_lsa_QuerySecret_in_get_old_val,
26511 : .set = py_lsa_QuerySecret_in_set_old_val,
26512 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
26513 : },
26514 : {
26515 : .name = discard_const_p(char, "out_old_val"),
26516 : .get = py_lsa_QuerySecret_out_get_old_val,
26517 : .set = py_lsa_QuerySecret_out_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, "in_old_mtime"),
26522 : .get = py_lsa_QuerySecret_in_get_old_mtime,
26523 : .set = py_lsa_QuerySecret_in_set_old_mtime,
26524 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
26525 : },
26526 : {
26527 : .name = discard_const_p(char, "out_old_mtime"),
26528 : .get = py_lsa_QuerySecret_out_get_old_mtime,
26529 : .set = py_lsa_QuerySecret_out_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, "result"),
26534 : .get = py_lsa_QuerySecret_get_result,
26535 : .set = py_lsa_QuerySecret_set_result,
26536 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26537 : },
26538 : { .name = NULL }
26539 : };
26540 :
26541 0 : static PyObject *py_lsa_QuerySecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26542 : {
26543 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecret, type);
26544 0 : struct lsa_QuerySecret *_self = (struct lsa_QuerySecret *)pytalloc_get_ptr(self);
26545 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26546 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
26547 0 : return self;
26548 : }
26549 :
26550 0 : static PyObject *py_lsa_QuerySecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26551 : {
26552 :
26553 :
26554 0 : return PyLong_FromLong(30);
26555 : }
26556 :
26557 0 : static PyObject *py_lsa_QuerySecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26558 : {
26559 0 : const struct ndr_interface_call *call = NULL;
26560 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26561 0 : PyObject *ret = NULL;
26562 0 : struct ndr_push *push = NULL;
26563 0 : DATA_BLOB blob;
26564 0 : enum ndr_err_code err;
26565 :
26566 0 : if (ndr_table_lsarpc.num_calls < 31) {
26567 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_pack");
26568 0 : return NULL;
26569 : }
26570 0 : call = &ndr_table_lsarpc.calls[30];
26571 :
26572 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26573 0 : if (push == NULL) {
26574 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26575 0 : return NULL;
26576 : }
26577 :
26578 0 : push->flags |= ndr_push_flags;
26579 :
26580 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26581 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26582 0 : TALLOC_FREE(push);
26583 0 : PyErr_SetNdrError(err);
26584 0 : return NULL;
26585 : }
26586 0 : blob = ndr_push_blob(push);
26587 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26588 0 : TALLOC_FREE(push);
26589 0 : return ret;
26590 : }
26591 :
26592 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26593 : {
26594 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26595 0 : PyObject *bigendian_obj = NULL;
26596 0 : PyObject *ndr64_obj = NULL;
26597 0 : libndr_flags ndr_push_flags = 0;
26598 :
26599 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26600 : discard_const_p(char *, kwnames),
26601 : &bigendian_obj,
26602 : &ndr64_obj)) {
26603 0 : return NULL;
26604 : }
26605 :
26606 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26607 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26608 : }
26609 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26610 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26611 : }
26612 :
26613 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26614 : }
26615 :
26616 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26617 : {
26618 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26619 0 : PyObject *bigendian_obj = NULL;
26620 0 : PyObject *ndr64_obj = NULL;
26621 0 : libndr_flags ndr_push_flags = 0;
26622 :
26623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26624 : discard_const_p(char *, kwnames),
26625 : &bigendian_obj,
26626 : &ndr64_obj)) {
26627 0 : return NULL;
26628 : }
26629 :
26630 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26631 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26632 : }
26633 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26634 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26635 : }
26636 :
26637 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26638 : }
26639 :
26640 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
26641 : {
26642 0 : const struct ndr_interface_call *call = NULL;
26643 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26644 0 : struct ndr_pull *pull = NULL;
26645 0 : enum ndr_err_code err;
26646 :
26647 0 : if (ndr_table_lsarpc.num_calls < 31) {
26648 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_unpack");
26649 0 : return NULL;
26650 : }
26651 0 : call = &ndr_table_lsarpc.calls[30];
26652 :
26653 0 : pull = ndr_pull_init_blob(blob, object);
26654 0 : if (pull == NULL) {
26655 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26656 0 : return NULL;
26657 : }
26658 :
26659 0 : pull->flags |= ndr_pull_flags;
26660 :
26661 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26662 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26663 0 : TALLOC_FREE(pull);
26664 0 : PyErr_SetNdrError(err);
26665 0 : return NULL;
26666 : }
26667 0 : if (!allow_remaining) {
26668 0 : uint32_t highest_ofs;
26669 :
26670 0 : if (pull->offset > pull->relative_highest_offset) {
26671 0 : highest_ofs = pull->offset;
26672 : } else {
26673 0 : highest_ofs = pull->relative_highest_offset;
26674 : }
26675 0 : if (highest_ofs < pull->data_size) {
26676 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26677 : "not all bytes consumed ofs[%u] size[%u]",
26678 : highest_ofs, pull->data_size);
26679 0 : TALLOC_FREE(pull);
26680 0 : PyErr_SetNdrError(err);
26681 0 : return NULL;
26682 : }
26683 : }
26684 :
26685 0 : TALLOC_FREE(pull);
26686 0 : Py_RETURN_NONE;
26687 : }
26688 :
26689 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26690 : {
26691 0 : DATA_BLOB blob;
26692 0 : Py_ssize_t blob_length = 0;
26693 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26694 0 : PyObject *bigendian_obj = NULL;
26695 0 : PyObject *ndr64_obj = NULL;
26696 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26697 0 : PyObject *allow_remaining_obj = NULL;
26698 0 : bool allow_remaining = false;
26699 :
26700 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26701 : discard_const_p(char *, kwnames),
26702 : &blob.data, &blob_length,
26703 : &bigendian_obj,
26704 : &ndr64_obj,
26705 : &allow_remaining_obj)) {
26706 0 : return NULL;
26707 : }
26708 0 : blob.length = blob_length;
26709 :
26710 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26711 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26712 : }
26713 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26714 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26715 : }
26716 :
26717 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26718 0 : allow_remaining = true;
26719 : }
26720 :
26721 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26722 : }
26723 :
26724 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26725 : {
26726 0 : DATA_BLOB blob;
26727 0 : Py_ssize_t blob_length = 0;
26728 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26729 0 : PyObject *bigendian_obj = NULL;
26730 0 : PyObject *ndr64_obj = NULL;
26731 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26732 0 : PyObject *allow_remaining_obj = NULL;
26733 0 : bool allow_remaining = false;
26734 :
26735 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26736 : discard_const_p(char *, kwnames),
26737 : &blob.data, &blob_length,
26738 : &bigendian_obj,
26739 : &ndr64_obj,
26740 : &allow_remaining_obj)) {
26741 0 : return NULL;
26742 : }
26743 0 : blob.length = blob_length;
26744 :
26745 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26746 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26747 : }
26748 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26749 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26750 : }
26751 :
26752 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26753 0 : allow_remaining = true;
26754 : }
26755 :
26756 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26757 : }
26758 :
26759 0 : static PyObject *py_lsa_QuerySecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26760 : {
26761 0 : const struct ndr_interface_call *call = NULL;
26762 0 : struct lsa_QuerySecret *object = (struct lsa_QuerySecret *)pytalloc_get_ptr(py_obj);
26763 0 : PyObject *ret;
26764 0 : char *retstr;
26765 :
26766 0 : if (ndr_table_lsarpc.num_calls < 31) {
26767 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_print");
26768 0 : return NULL;
26769 : }
26770 0 : call = &ndr_table_lsarpc.calls[30];
26771 :
26772 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26773 0 : ret = PyUnicode_FromString(retstr);
26774 0 : TALLOC_FREE(retstr);
26775 :
26776 0 : return ret;
26777 : }
26778 :
26779 0 : static PyObject *py_lsa_QuerySecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26780 : {
26781 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_in", NDR_IN);
26782 : }
26783 :
26784 0 : static PyObject *py_lsa_QuerySecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26785 : {
26786 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_out", NDR_OUT);
26787 : }
26788 :
26789 : static PyMethodDef py_lsa_QuerySecret_methods[] = {
26790 : { "opnum", (PyCFunction)py_lsa_QuerySecret_ndr_opnum, METH_NOARGS|METH_CLASS,
26791 : "lsa.QuerySecret.opnum() -> 30 (0x1e) " },
26792 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26793 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26794 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26795 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26796 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26797 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26798 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26799 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26800 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26801 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26802 : { NULL, NULL, 0, NULL }
26803 : };
26804 :
26805 :
26806 : static PyTypeObject lsa_QuerySecret_Type = {
26807 : PyVarObject_HEAD_INIT(NULL, 0)
26808 : .tp_name = "lsa.QuerySecret",
26809 : .tp_getset = py_lsa_QuerySecret_getsetters,
26810 : .tp_methods = py_lsa_QuerySecret_methods,
26811 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26812 : .tp_new = py_lsa_QuerySecret_new,
26813 : };
26814 :
26815 0 : static bool pack_py_lsa_QuerySecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecret *r)
26816 : {
26817 0 : PyObject *py_sec_handle;
26818 0 : PyObject *py_new_val;
26819 0 : PyObject *py_new_mtime;
26820 0 : PyObject *py_old_val;
26821 0 : PyObject *py_old_mtime;
26822 0 : const char *kwnames[] = {
26823 : "sec_handle", "new_val", "new_mtime", "old_val", "old_mtime", NULL
26824 : };
26825 :
26826 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)) {
26827 0 : return false;
26828 : }
26829 :
26830 0 : if (py_sec_handle == NULL) {
26831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_handle");
26832 0 : return false;
26833 : }
26834 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
26835 0 : if (r->in.sec_handle == NULL) {
26836 0 : PyErr_NoMemory();
26837 0 : return false;
26838 : }
26839 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
26840 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
26841 0 : PyErr_NoMemory();
26842 0 : return false;
26843 : }
26844 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
26845 0 : if (py_new_val == NULL) {
26846 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_val");
26847 0 : return false;
26848 : }
26849 0 : if (py_new_val == Py_None) {
26850 0 : r->in.new_val = NULL;
26851 : } else {
26852 0 : r->in.new_val = NULL;
26853 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_new_val, return false;);
26854 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
26855 0 : PyErr_NoMemory();
26856 0 : return false;
26857 : }
26858 0 : r->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_new_val);
26859 : }
26860 0 : if (py_new_mtime == NULL) {
26861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_mtime");
26862 0 : return false;
26863 : }
26864 0 : if (py_new_mtime == Py_None) {
26865 0 : r->in.new_mtime = NULL;
26866 : } else {
26867 0 : r->in.new_mtime = talloc_ptrtype(r, r->in.new_mtime);
26868 0 : if (r->in.new_mtime == NULL) {
26869 0 : PyErr_NoMemory();
26870 0 : return false;
26871 : }
26872 : {
26873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.new_mtime));
26874 0 : if (PyLong_Check(py_new_mtime)) {
26875 0 : unsigned long long test_var;
26876 0 : test_var = PyLong_AsUnsignedLongLong(py_new_mtime);
26877 0 : if (PyErr_Occurred() != NULL) {
26878 0 : return false;
26879 : }
26880 0 : if (test_var > uint_max) {
26881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26882 : PyLong_Type.tp_name, uint_max, test_var);
26883 0 : return false;
26884 : }
26885 0 : *r->in.new_mtime = test_var;
26886 : } else {
26887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26888 : PyLong_Type.tp_name);
26889 0 : return false;
26890 : }
26891 : }
26892 : }
26893 0 : if (py_old_val == NULL) {
26894 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_val");
26895 0 : return false;
26896 : }
26897 0 : if (py_old_val == Py_None) {
26898 0 : r->in.old_val = NULL;
26899 : } else {
26900 0 : r->in.old_val = NULL;
26901 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_old_val, return false;);
26902 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
26903 0 : PyErr_NoMemory();
26904 0 : return false;
26905 : }
26906 0 : r->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_old_val);
26907 : }
26908 0 : if (py_old_mtime == NULL) {
26909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_mtime");
26910 0 : return false;
26911 : }
26912 0 : if (py_old_mtime == Py_None) {
26913 0 : r->in.old_mtime = NULL;
26914 : } else {
26915 0 : r->in.old_mtime = talloc_ptrtype(r, r->in.old_mtime);
26916 0 : if (r->in.old_mtime == NULL) {
26917 0 : PyErr_NoMemory();
26918 0 : return false;
26919 : }
26920 : {
26921 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.old_mtime));
26922 0 : if (PyLong_Check(py_old_mtime)) {
26923 0 : unsigned long long test_var;
26924 0 : test_var = PyLong_AsUnsignedLongLong(py_old_mtime);
26925 0 : if (PyErr_Occurred() != NULL) {
26926 0 : return false;
26927 : }
26928 0 : if (test_var > uint_max) {
26929 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26930 : PyLong_Type.tp_name, uint_max, test_var);
26931 0 : return false;
26932 : }
26933 0 : *r->in.old_mtime = test_var;
26934 : } else {
26935 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26936 : PyLong_Type.tp_name);
26937 0 : return false;
26938 : }
26939 : }
26940 : }
26941 0 : return true;
26942 : }
26943 :
26944 0 : static PyObject *unpack_py_lsa_QuerySecret_args_out(struct lsa_QuerySecret *r)
26945 : {
26946 0 : PyObject *result;
26947 0 : PyObject *py_new_val;
26948 0 : PyObject *py_new_mtime;
26949 0 : PyObject *py_old_val;
26950 0 : PyObject *py_old_mtime;
26951 0 : result = PyTuple_New(4);
26952 0 : if (r->out.new_val == NULL) {
26953 0 : py_new_val = Py_None;
26954 0 : Py_INCREF(py_new_val);
26955 : } else {
26956 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.new_val, r->out.new_val);
26957 : }
26958 0 : PyTuple_SetItem(result, 0, py_new_val);
26959 0 : if (r->out.new_mtime == NULL) {
26960 0 : py_new_mtime = Py_None;
26961 0 : Py_INCREF(py_new_mtime);
26962 : } else {
26963 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*r->out.new_mtime);
26964 : }
26965 0 : PyTuple_SetItem(result, 1, py_new_mtime);
26966 0 : if (r->out.old_val == NULL) {
26967 0 : py_old_val = Py_None;
26968 0 : Py_INCREF(py_old_val);
26969 : } else {
26970 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.old_val, r->out.old_val);
26971 : }
26972 0 : PyTuple_SetItem(result, 2, py_old_val);
26973 0 : if (r->out.old_mtime == NULL) {
26974 0 : py_old_mtime = Py_None;
26975 0 : Py_INCREF(py_old_mtime);
26976 : } else {
26977 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*r->out.old_mtime);
26978 : }
26979 0 : PyTuple_SetItem(result, 3, py_old_mtime);
26980 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26981 0 : PyErr_SetNTSTATUS(r->out.result);
26982 0 : return NULL;
26983 : }
26984 :
26985 0 : return result;
26986 : }
26987 :
26988 :
26989 0 : static PyObject *py_lsa_LookupPrivValue_in_get_handle(PyObject *obj, void *closure)
26990 : {
26991 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
26992 0 : PyObject *py_handle;
26993 0 : if (object->in.handle == NULL) {
26994 0 : Py_RETURN_NONE;
26995 : }
26996 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26997 0 : return py_handle;
26998 : }
26999 :
27000 0 : static int py_lsa_LookupPrivValue_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27001 : {
27002 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27003 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27004 0 : if (value == NULL) {
27005 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27006 0 : return -1;
27007 : }
27008 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27009 0 : if (object->in.handle == NULL) {
27010 0 : PyErr_NoMemory();
27011 0 : return -1;
27012 : }
27013 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27014 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27015 0 : PyErr_NoMemory();
27016 0 : return -1;
27017 : }
27018 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27019 0 : return 0;
27020 : }
27021 :
27022 0 : static PyObject *py_lsa_LookupPrivValue_in_get_name(PyObject *obj, void *closure)
27023 : {
27024 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27025 0 : PyObject *py_name;
27026 0 : if (object->in.name == NULL) {
27027 0 : Py_RETURN_NONE;
27028 : }
27029 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
27030 0 : return py_name;
27031 : }
27032 :
27033 0 : static int py_lsa_LookupPrivValue_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
27034 : {
27035 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27036 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
27037 0 : if (value == NULL) {
27038 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
27039 0 : return -1;
27040 : }
27041 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
27042 0 : if (object->in.name == NULL) {
27043 0 : PyErr_NoMemory();
27044 0 : return -1;
27045 : }
27046 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
27047 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27048 0 : PyErr_NoMemory();
27049 0 : return -1;
27050 : }
27051 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
27052 0 : return 0;
27053 : }
27054 :
27055 0 : static PyObject *py_lsa_LookupPrivValue_out_get_luid(PyObject *obj, void *closure)
27056 : {
27057 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27058 0 : PyObject *py_luid;
27059 0 : if (object->out.luid == NULL) {
27060 0 : Py_RETURN_NONE;
27061 : }
27062 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->out.luid, object->out.luid);
27063 0 : return py_luid;
27064 : }
27065 :
27066 0 : static int py_lsa_LookupPrivValue_out_set_luid(PyObject *py_obj, PyObject *value, void *closure)
27067 : {
27068 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27069 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.luid));
27070 0 : if (value == NULL) {
27071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.luid");
27072 0 : return -1;
27073 : }
27074 0 : object->out.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.luid);
27075 0 : if (object->out.luid == NULL) {
27076 0 : PyErr_NoMemory();
27077 0 : return -1;
27078 : }
27079 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
27080 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27081 0 : PyErr_NoMemory();
27082 0 : return -1;
27083 : }
27084 0 : object->out.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
27085 0 : return 0;
27086 : }
27087 :
27088 0 : static PyObject *py_lsa_LookupPrivValue_get_result(PyObject *obj, void *closure)
27089 : {
27090 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(obj);
27091 0 : PyObject *py_result;
27092 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27093 0 : return py_result;
27094 : }
27095 :
27096 0 : static int py_lsa_LookupPrivValue_set_result(PyObject *py_obj, PyObject *value, void *closure)
27097 : {
27098 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27099 0 : if (value == NULL) {
27100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27101 0 : return -1;
27102 : }
27103 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27104 0 : return 0;
27105 : }
27106 :
27107 : static PyGetSetDef py_lsa_LookupPrivValue_getsetters[] = {
27108 : {
27109 : .name = discard_const_p(char, "in_handle"),
27110 : .get = py_lsa_LookupPrivValue_in_get_handle,
27111 : .set = py_lsa_LookupPrivValue_in_set_handle,
27112 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27113 : },
27114 : {
27115 : .name = discard_const_p(char, "in_name"),
27116 : .get = py_lsa_LookupPrivValue_in_get_name,
27117 : .set = py_lsa_LookupPrivValue_in_set_name,
27118 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
27119 : },
27120 : {
27121 : .name = discard_const_p(char, "out_luid"),
27122 : .get = py_lsa_LookupPrivValue_out_get_luid,
27123 : .set = py_lsa_LookupPrivValue_out_set_luid,
27124 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
27125 : },
27126 : {
27127 : .name = discard_const_p(char, "result"),
27128 : .get = py_lsa_LookupPrivValue_get_result,
27129 : .set = py_lsa_LookupPrivValue_set_result,
27130 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27131 : },
27132 : { .name = NULL }
27133 : };
27134 :
27135 0 : static PyObject *py_lsa_LookupPrivValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27136 : {
27137 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivValue, type);
27138 0 : struct lsa_LookupPrivValue *_self = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(self);
27139 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27140 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27141 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
27142 0 : _self->out.luid = talloc_zero(mem_ctx, struct lsa_LUID);
27143 0 : return self;
27144 : }
27145 :
27146 0 : static PyObject *py_lsa_LookupPrivValue_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27147 : {
27148 :
27149 :
27150 0 : return PyLong_FromLong(31);
27151 : }
27152 :
27153 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27154 : {
27155 0 : const struct ndr_interface_call *call = NULL;
27156 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27157 0 : PyObject *ret = NULL;
27158 0 : struct ndr_push *push = NULL;
27159 0 : DATA_BLOB blob;
27160 0 : enum ndr_err_code err;
27161 :
27162 0 : if (ndr_table_lsarpc.num_calls < 32) {
27163 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_pack");
27164 0 : return NULL;
27165 : }
27166 0 : call = &ndr_table_lsarpc.calls[31];
27167 :
27168 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27169 0 : if (push == NULL) {
27170 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27171 0 : return NULL;
27172 : }
27173 :
27174 0 : push->flags |= ndr_push_flags;
27175 :
27176 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27177 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27178 0 : TALLOC_FREE(push);
27179 0 : PyErr_SetNdrError(err);
27180 0 : return NULL;
27181 : }
27182 0 : blob = ndr_push_blob(push);
27183 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27184 0 : TALLOC_FREE(push);
27185 0 : return ret;
27186 : }
27187 :
27188 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27189 : {
27190 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27191 0 : PyObject *bigendian_obj = NULL;
27192 0 : PyObject *ndr64_obj = NULL;
27193 0 : libndr_flags ndr_push_flags = 0;
27194 :
27195 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27196 : discard_const_p(char *, kwnames),
27197 : &bigendian_obj,
27198 : &ndr64_obj)) {
27199 0 : return NULL;
27200 : }
27201 :
27202 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27203 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27204 : }
27205 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27206 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27207 : }
27208 :
27209 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27210 : }
27211 :
27212 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27213 : {
27214 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27215 0 : PyObject *bigendian_obj = NULL;
27216 0 : PyObject *ndr64_obj = NULL;
27217 0 : libndr_flags ndr_push_flags = 0;
27218 :
27219 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27220 : discard_const_p(char *, kwnames),
27221 : &bigendian_obj,
27222 : &ndr64_obj)) {
27223 0 : return NULL;
27224 : }
27225 :
27226 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27227 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27228 : }
27229 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27230 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27231 : }
27232 :
27233 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27234 : }
27235 :
27236 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27237 : {
27238 0 : const struct ndr_interface_call *call = NULL;
27239 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27240 0 : struct ndr_pull *pull = NULL;
27241 0 : enum ndr_err_code err;
27242 :
27243 0 : if (ndr_table_lsarpc.num_calls < 32) {
27244 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_unpack");
27245 0 : return NULL;
27246 : }
27247 0 : call = &ndr_table_lsarpc.calls[31];
27248 :
27249 0 : pull = ndr_pull_init_blob(blob, object);
27250 0 : if (pull == NULL) {
27251 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27252 0 : return NULL;
27253 : }
27254 :
27255 0 : pull->flags |= ndr_pull_flags;
27256 :
27257 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27258 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27259 0 : TALLOC_FREE(pull);
27260 0 : PyErr_SetNdrError(err);
27261 0 : return NULL;
27262 : }
27263 0 : if (!allow_remaining) {
27264 0 : uint32_t highest_ofs;
27265 :
27266 0 : if (pull->offset > pull->relative_highest_offset) {
27267 0 : highest_ofs = pull->offset;
27268 : } else {
27269 0 : highest_ofs = pull->relative_highest_offset;
27270 : }
27271 0 : if (highest_ofs < pull->data_size) {
27272 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27273 : "not all bytes consumed ofs[%u] size[%u]",
27274 : highest_ofs, pull->data_size);
27275 0 : TALLOC_FREE(pull);
27276 0 : PyErr_SetNdrError(err);
27277 0 : return NULL;
27278 : }
27279 : }
27280 :
27281 0 : TALLOC_FREE(pull);
27282 0 : Py_RETURN_NONE;
27283 : }
27284 :
27285 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27286 : {
27287 0 : DATA_BLOB blob;
27288 0 : Py_ssize_t blob_length = 0;
27289 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27290 0 : PyObject *bigendian_obj = NULL;
27291 0 : PyObject *ndr64_obj = NULL;
27292 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27293 0 : PyObject *allow_remaining_obj = NULL;
27294 0 : bool allow_remaining = false;
27295 :
27296 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27297 : discard_const_p(char *, kwnames),
27298 : &blob.data, &blob_length,
27299 : &bigendian_obj,
27300 : &ndr64_obj,
27301 : &allow_remaining_obj)) {
27302 0 : return NULL;
27303 : }
27304 0 : blob.length = blob_length;
27305 :
27306 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27307 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27308 : }
27309 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27310 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27311 : }
27312 :
27313 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27314 0 : allow_remaining = true;
27315 : }
27316 :
27317 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27318 : }
27319 :
27320 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27321 : {
27322 0 : DATA_BLOB blob;
27323 0 : Py_ssize_t blob_length = 0;
27324 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27325 0 : PyObject *bigendian_obj = NULL;
27326 0 : PyObject *ndr64_obj = NULL;
27327 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27328 0 : PyObject *allow_remaining_obj = NULL;
27329 0 : bool allow_remaining = false;
27330 :
27331 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27332 : discard_const_p(char *, kwnames),
27333 : &blob.data, &blob_length,
27334 : &bigendian_obj,
27335 : &ndr64_obj,
27336 : &allow_remaining_obj)) {
27337 0 : return NULL;
27338 : }
27339 0 : blob.length = blob_length;
27340 :
27341 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27342 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27343 : }
27344 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27345 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27346 : }
27347 :
27348 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27349 0 : allow_remaining = true;
27350 : }
27351 :
27352 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27353 : }
27354 :
27355 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27356 : {
27357 0 : const struct ndr_interface_call *call = NULL;
27358 0 : struct lsa_LookupPrivValue *object = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(py_obj);
27359 0 : PyObject *ret;
27360 0 : char *retstr;
27361 :
27362 0 : if (ndr_table_lsarpc.num_calls < 32) {
27363 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_print");
27364 0 : return NULL;
27365 : }
27366 0 : call = &ndr_table_lsarpc.calls[31];
27367 :
27368 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27369 0 : ret = PyUnicode_FromString(retstr);
27370 0 : TALLOC_FREE(retstr);
27371 :
27372 0 : return ret;
27373 : }
27374 :
27375 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27376 : {
27377 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_in", NDR_IN);
27378 : }
27379 :
27380 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27381 : {
27382 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_out", NDR_OUT);
27383 : }
27384 :
27385 : static PyMethodDef py_lsa_LookupPrivValue_methods[] = {
27386 : { "opnum", (PyCFunction)py_lsa_LookupPrivValue_ndr_opnum, METH_NOARGS|METH_CLASS,
27387 : "lsa.LookupPrivValue.opnum() -> 31 (0x1f) " },
27388 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27389 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27390 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27391 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27392 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27393 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27394 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27395 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27396 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27397 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27398 : { NULL, NULL, 0, NULL }
27399 : };
27400 :
27401 :
27402 : static PyTypeObject lsa_LookupPrivValue_Type = {
27403 : PyVarObject_HEAD_INIT(NULL, 0)
27404 : .tp_name = "lsa.LookupPrivValue",
27405 : .tp_getset = py_lsa_LookupPrivValue_getsetters,
27406 : .tp_methods = py_lsa_LookupPrivValue_methods,
27407 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27408 : .tp_new = py_lsa_LookupPrivValue_new,
27409 : };
27410 :
27411 0 : static bool pack_py_lsa_LookupPrivValue_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivValue *r)
27412 : {
27413 0 : PyObject *py_handle;
27414 0 : PyObject *py_name;
27415 0 : const char *kwnames[] = {
27416 : "handle", "name", NULL
27417 : };
27418 :
27419 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivValue", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
27420 0 : return false;
27421 : }
27422 :
27423 0 : if (py_handle == NULL) {
27424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27425 0 : return false;
27426 : }
27427 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27428 0 : if (r->in.handle == NULL) {
27429 0 : PyErr_NoMemory();
27430 0 : return false;
27431 : }
27432 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27433 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27434 0 : PyErr_NoMemory();
27435 0 : return false;
27436 : }
27437 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27438 0 : if (py_name == NULL) {
27439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
27440 0 : return false;
27441 : }
27442 0 : r->in.name = talloc_ptrtype(r, r->in.name);
27443 0 : if (r->in.name == NULL) {
27444 0 : PyErr_NoMemory();
27445 0 : return false;
27446 : }
27447 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
27448 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
27449 0 : PyErr_NoMemory();
27450 0 : return false;
27451 : }
27452 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
27453 0 : return true;
27454 : }
27455 :
27456 0 : static PyObject *unpack_py_lsa_LookupPrivValue_args_out(struct lsa_LookupPrivValue *r)
27457 : {
27458 0 : PyObject *result;
27459 0 : PyObject *py_luid;
27460 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, r->out.luid, r->out.luid);
27461 0 : result = py_luid;
27462 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27463 0 : PyErr_SetNTSTATUS(r->out.result);
27464 0 : return NULL;
27465 : }
27466 :
27467 0 : return result;
27468 : }
27469 :
27470 :
27471 0 : static PyObject *py_lsa_LookupPrivName_in_get_handle(PyObject *obj, void *closure)
27472 : {
27473 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27474 0 : PyObject *py_handle;
27475 0 : if (object->in.handle == NULL) {
27476 0 : Py_RETURN_NONE;
27477 : }
27478 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27479 0 : return py_handle;
27480 : }
27481 :
27482 0 : static int py_lsa_LookupPrivName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27483 : {
27484 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27485 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27486 0 : if (value == NULL) {
27487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27488 0 : return -1;
27489 : }
27490 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27491 0 : if (object->in.handle == NULL) {
27492 0 : PyErr_NoMemory();
27493 0 : return -1;
27494 : }
27495 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27496 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27497 0 : PyErr_NoMemory();
27498 0 : return -1;
27499 : }
27500 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27501 0 : return 0;
27502 : }
27503 :
27504 0 : static PyObject *py_lsa_LookupPrivName_in_get_luid(PyObject *obj, void *closure)
27505 : {
27506 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27507 0 : PyObject *py_luid;
27508 0 : if (object->in.luid == NULL) {
27509 0 : Py_RETURN_NONE;
27510 : }
27511 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->in.luid, object->in.luid);
27512 0 : return py_luid;
27513 : }
27514 :
27515 0 : static int py_lsa_LookupPrivName_in_set_luid(PyObject *py_obj, PyObject *value, void *closure)
27516 : {
27517 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27518 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.luid));
27519 0 : if (value == NULL) {
27520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.luid");
27521 0 : return -1;
27522 : }
27523 0 : object->in.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.luid);
27524 0 : if (object->in.luid == NULL) {
27525 0 : PyErr_NoMemory();
27526 0 : return -1;
27527 : }
27528 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
27529 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27530 0 : PyErr_NoMemory();
27531 0 : return -1;
27532 : }
27533 0 : object->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
27534 0 : return 0;
27535 : }
27536 :
27537 0 : static PyObject *py_lsa_LookupPrivName_out_get_name(PyObject *obj, void *closure)
27538 : {
27539 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27540 0 : PyObject *py_name;
27541 0 : if (object->out.name == NULL) {
27542 0 : Py_RETURN_NONE;
27543 : }
27544 0 : if (*object->out.name == NULL) {
27545 0 : py_name = Py_None;
27546 0 : Py_INCREF(py_name);
27547 : } else {
27548 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.name, *object->out.name);
27549 : }
27550 0 : return py_name;
27551 : }
27552 :
27553 0 : static int py_lsa_LookupPrivName_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
27554 : {
27555 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27556 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
27557 0 : if (value == NULL) {
27558 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.name");
27559 0 : return -1;
27560 : }
27561 0 : object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
27562 0 : if (object->out.name == NULL) {
27563 0 : PyErr_NoMemory();
27564 0 : return -1;
27565 : }
27566 0 : if (value == Py_None) {
27567 0 : *object->out.name = NULL;
27568 : } else {
27569 0 : *object->out.name = NULL;
27570 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
27571 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27572 0 : PyErr_NoMemory();
27573 0 : return -1;
27574 : }
27575 0 : *object->out.name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
27576 : }
27577 0 : return 0;
27578 : }
27579 :
27580 0 : static PyObject *py_lsa_LookupPrivName_get_result(PyObject *obj, void *closure)
27581 : {
27582 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(obj);
27583 0 : PyObject *py_result;
27584 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27585 0 : return py_result;
27586 : }
27587 :
27588 0 : static int py_lsa_LookupPrivName_set_result(PyObject *py_obj, PyObject *value, void *closure)
27589 : {
27590 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27591 0 : if (value == NULL) {
27592 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27593 0 : return -1;
27594 : }
27595 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27596 0 : return 0;
27597 : }
27598 :
27599 : static PyGetSetDef py_lsa_LookupPrivName_getsetters[] = {
27600 : {
27601 : .name = discard_const_p(char, "in_handle"),
27602 : .get = py_lsa_LookupPrivName_in_get_handle,
27603 : .set = py_lsa_LookupPrivName_in_set_handle,
27604 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27605 : },
27606 : {
27607 : .name = discard_const_p(char, "in_luid"),
27608 : .get = py_lsa_LookupPrivName_in_get_luid,
27609 : .set = py_lsa_LookupPrivName_in_set_luid,
27610 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
27611 : },
27612 : {
27613 : .name = discard_const_p(char, "out_name"),
27614 : .get = py_lsa_LookupPrivName_out_get_name,
27615 : .set = py_lsa_LookupPrivName_out_set_name,
27616 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
27617 : },
27618 : {
27619 : .name = discard_const_p(char, "result"),
27620 : .get = py_lsa_LookupPrivName_get_result,
27621 : .set = py_lsa_LookupPrivName_set_result,
27622 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27623 : },
27624 : { .name = NULL }
27625 : };
27626 :
27627 0 : static PyObject *py_lsa_LookupPrivName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27628 : {
27629 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivName, type);
27630 0 : struct lsa_LookupPrivName *_self = (struct lsa_LookupPrivName *)pytalloc_get_ptr(self);
27631 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27632 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
27633 0 : _self->in.luid = talloc_zero(mem_ctx, struct lsa_LUID);
27634 : /* a pointer to a NULL pointer */
27635 0 : _self->out.name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
27636 0 : return self;
27637 : }
27638 :
27639 0 : static PyObject *py_lsa_LookupPrivName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27640 : {
27641 :
27642 :
27643 0 : return PyLong_FromLong(32);
27644 : }
27645 :
27646 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27647 : {
27648 0 : const struct ndr_interface_call *call = NULL;
27649 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27650 0 : PyObject *ret = NULL;
27651 0 : struct ndr_push *push = NULL;
27652 0 : DATA_BLOB blob;
27653 0 : enum ndr_err_code err;
27654 :
27655 0 : if (ndr_table_lsarpc.num_calls < 33) {
27656 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_pack");
27657 0 : return NULL;
27658 : }
27659 0 : call = &ndr_table_lsarpc.calls[32];
27660 :
27661 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27662 0 : if (push == NULL) {
27663 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27664 0 : return NULL;
27665 : }
27666 :
27667 0 : push->flags |= ndr_push_flags;
27668 :
27669 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27670 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27671 0 : TALLOC_FREE(push);
27672 0 : PyErr_SetNdrError(err);
27673 0 : return NULL;
27674 : }
27675 0 : blob = ndr_push_blob(push);
27676 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27677 0 : TALLOC_FREE(push);
27678 0 : return ret;
27679 : }
27680 :
27681 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27682 : {
27683 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27684 0 : PyObject *bigendian_obj = NULL;
27685 0 : PyObject *ndr64_obj = NULL;
27686 0 : libndr_flags ndr_push_flags = 0;
27687 :
27688 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27689 : discard_const_p(char *, kwnames),
27690 : &bigendian_obj,
27691 : &ndr64_obj)) {
27692 0 : return NULL;
27693 : }
27694 :
27695 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27696 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27697 : }
27698 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27699 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27700 : }
27701 :
27702 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27703 : }
27704 :
27705 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27706 : {
27707 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27708 0 : PyObject *bigendian_obj = NULL;
27709 0 : PyObject *ndr64_obj = NULL;
27710 0 : libndr_flags ndr_push_flags = 0;
27711 :
27712 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27713 : discard_const_p(char *, kwnames),
27714 : &bigendian_obj,
27715 : &ndr64_obj)) {
27716 0 : return NULL;
27717 : }
27718 :
27719 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27720 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27721 : }
27722 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27723 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27724 : }
27725 :
27726 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27727 : }
27728 :
27729 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27730 : {
27731 0 : const struct ndr_interface_call *call = NULL;
27732 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27733 0 : struct ndr_pull *pull = NULL;
27734 0 : enum ndr_err_code err;
27735 :
27736 0 : if (ndr_table_lsarpc.num_calls < 33) {
27737 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_unpack");
27738 0 : return NULL;
27739 : }
27740 0 : call = &ndr_table_lsarpc.calls[32];
27741 :
27742 0 : pull = ndr_pull_init_blob(blob, object);
27743 0 : if (pull == NULL) {
27744 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27745 0 : return NULL;
27746 : }
27747 :
27748 0 : pull->flags |= ndr_pull_flags;
27749 :
27750 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27751 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27752 0 : TALLOC_FREE(pull);
27753 0 : PyErr_SetNdrError(err);
27754 0 : return NULL;
27755 : }
27756 0 : if (!allow_remaining) {
27757 0 : uint32_t highest_ofs;
27758 :
27759 0 : if (pull->offset > pull->relative_highest_offset) {
27760 0 : highest_ofs = pull->offset;
27761 : } else {
27762 0 : highest_ofs = pull->relative_highest_offset;
27763 : }
27764 0 : if (highest_ofs < pull->data_size) {
27765 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27766 : "not all bytes consumed ofs[%u] size[%u]",
27767 : highest_ofs, pull->data_size);
27768 0 : TALLOC_FREE(pull);
27769 0 : PyErr_SetNdrError(err);
27770 0 : return NULL;
27771 : }
27772 : }
27773 :
27774 0 : TALLOC_FREE(pull);
27775 0 : Py_RETURN_NONE;
27776 : }
27777 :
27778 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27779 : {
27780 0 : DATA_BLOB blob;
27781 0 : Py_ssize_t blob_length = 0;
27782 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27783 0 : PyObject *bigendian_obj = NULL;
27784 0 : PyObject *ndr64_obj = NULL;
27785 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27786 0 : PyObject *allow_remaining_obj = NULL;
27787 0 : bool allow_remaining = false;
27788 :
27789 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27790 : discard_const_p(char *, kwnames),
27791 : &blob.data, &blob_length,
27792 : &bigendian_obj,
27793 : &ndr64_obj,
27794 : &allow_remaining_obj)) {
27795 0 : return NULL;
27796 : }
27797 0 : blob.length = blob_length;
27798 :
27799 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27800 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27801 : }
27802 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27803 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27804 : }
27805 :
27806 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27807 0 : allow_remaining = true;
27808 : }
27809 :
27810 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27811 : }
27812 :
27813 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27814 : {
27815 0 : DATA_BLOB blob;
27816 0 : Py_ssize_t blob_length = 0;
27817 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27818 0 : PyObject *bigendian_obj = NULL;
27819 0 : PyObject *ndr64_obj = NULL;
27820 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27821 0 : PyObject *allow_remaining_obj = NULL;
27822 0 : bool allow_remaining = false;
27823 :
27824 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27825 : discard_const_p(char *, kwnames),
27826 : &blob.data, &blob_length,
27827 : &bigendian_obj,
27828 : &ndr64_obj,
27829 : &allow_remaining_obj)) {
27830 0 : return NULL;
27831 : }
27832 0 : blob.length = blob_length;
27833 :
27834 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27835 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27836 : }
27837 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27838 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27839 : }
27840 :
27841 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27842 0 : allow_remaining = true;
27843 : }
27844 :
27845 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27846 : }
27847 :
27848 0 : static PyObject *py_lsa_LookupPrivName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27849 : {
27850 0 : const struct ndr_interface_call *call = NULL;
27851 0 : struct lsa_LookupPrivName *object = (struct lsa_LookupPrivName *)pytalloc_get_ptr(py_obj);
27852 0 : PyObject *ret;
27853 0 : char *retstr;
27854 :
27855 0 : if (ndr_table_lsarpc.num_calls < 33) {
27856 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_print");
27857 0 : return NULL;
27858 : }
27859 0 : call = &ndr_table_lsarpc.calls[32];
27860 :
27861 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27862 0 : ret = PyUnicode_FromString(retstr);
27863 0 : TALLOC_FREE(retstr);
27864 :
27865 0 : return ret;
27866 : }
27867 :
27868 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27869 : {
27870 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_in", NDR_IN);
27871 : }
27872 :
27873 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27874 : {
27875 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_out", NDR_OUT);
27876 : }
27877 :
27878 : static PyMethodDef py_lsa_LookupPrivName_methods[] = {
27879 : { "opnum", (PyCFunction)py_lsa_LookupPrivName_ndr_opnum, METH_NOARGS|METH_CLASS,
27880 : "lsa.LookupPrivName.opnum() -> 32 (0x20) " },
27881 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27882 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27883 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27884 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27885 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27886 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27887 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27888 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27889 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27890 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27891 : { NULL, NULL, 0, NULL }
27892 : };
27893 :
27894 :
27895 : static PyTypeObject lsa_LookupPrivName_Type = {
27896 : PyVarObject_HEAD_INIT(NULL, 0)
27897 : .tp_name = "lsa.LookupPrivName",
27898 : .tp_getset = py_lsa_LookupPrivName_getsetters,
27899 : .tp_methods = py_lsa_LookupPrivName_methods,
27900 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27901 : .tp_new = py_lsa_LookupPrivName_new,
27902 : };
27903 :
27904 0 : static bool pack_py_lsa_LookupPrivName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivName *r)
27905 : {
27906 0 : PyObject *py_handle;
27907 0 : PyObject *py_luid;
27908 0 : const char *kwnames[] = {
27909 : "handle", "luid", NULL
27910 : };
27911 :
27912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivName", discard_const_p(char *, kwnames), &py_handle, &py_luid)) {
27913 0 : return false;
27914 : }
27915 :
27916 0 : if (py_handle == NULL) {
27917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
27918 0 : return false;
27919 : }
27920 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
27921 0 : if (r->in.handle == NULL) {
27922 0 : PyErr_NoMemory();
27923 0 : return false;
27924 : }
27925 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
27926 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
27927 0 : PyErr_NoMemory();
27928 0 : return false;
27929 : }
27930 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
27931 0 : if (py_luid == NULL) {
27932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.luid");
27933 0 : return false;
27934 : }
27935 0 : r->in.luid = talloc_ptrtype(r, r->in.luid);
27936 0 : if (r->in.luid == NULL) {
27937 0 : PyErr_NoMemory();
27938 0 : return false;
27939 : }
27940 0 : PY_CHECK_TYPE(&lsa_LUID_Type, py_luid, return false;);
27941 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_luid)) == NULL) {
27942 0 : PyErr_NoMemory();
27943 0 : return false;
27944 : }
27945 0 : r->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(py_luid);
27946 0 : return true;
27947 : }
27948 :
27949 0 : static PyObject *unpack_py_lsa_LookupPrivName_args_out(struct lsa_LookupPrivName *r)
27950 : {
27951 0 : PyObject *result;
27952 0 : PyObject *py_name;
27953 0 : if (*r->out.name == NULL) {
27954 0 : py_name = Py_None;
27955 0 : Py_INCREF(py_name);
27956 : } else {
27957 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.name, *r->out.name);
27958 : }
27959 0 : result = py_name;
27960 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27961 0 : PyErr_SetNTSTATUS(r->out.result);
27962 0 : return NULL;
27963 : }
27964 :
27965 0 : return result;
27966 : }
27967 :
27968 :
27969 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_handle(PyObject *obj, void *closure)
27970 : {
27971 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
27972 0 : PyObject *py_handle;
27973 0 : if (object->in.handle == NULL) {
27974 0 : Py_RETURN_NONE;
27975 : }
27976 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
27977 0 : return py_handle;
27978 : }
27979 :
27980 0 : static int py_lsa_LookupPrivDisplayName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
27981 : {
27982 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
27983 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
27984 0 : if (value == NULL) {
27985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
27986 0 : return -1;
27987 : }
27988 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
27989 0 : if (object->in.handle == NULL) {
27990 0 : PyErr_NoMemory();
27991 0 : return -1;
27992 : }
27993 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27994 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27995 0 : PyErr_NoMemory();
27996 0 : return -1;
27997 : }
27998 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
27999 0 : return 0;
28000 : }
28001 :
28002 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_name(PyObject *obj, void *closure)
28003 : {
28004 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28005 0 : PyObject *py_name;
28006 0 : if (object->in.name == NULL) {
28007 0 : Py_RETURN_NONE;
28008 : }
28009 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
28010 0 : return py_name;
28011 : }
28012 :
28013 0 : static int py_lsa_LookupPrivDisplayName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
28014 : {
28015 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28016 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
28017 0 : if (value == NULL) {
28018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
28019 0 : return -1;
28020 : }
28021 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
28022 0 : if (object->in.name == NULL) {
28023 0 : PyErr_NoMemory();
28024 0 : return -1;
28025 : }
28026 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
28027 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28028 0 : PyErr_NoMemory();
28029 0 : return -1;
28030 : }
28031 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
28032 0 : return 0;
28033 : }
28034 :
28035 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id(PyObject *obj, void *closure)
28036 : {
28037 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28038 0 : PyObject *py_language_id;
28039 0 : py_language_id = PyLong_FromLong((uint16_t)object->in.language_id);
28040 0 : return py_language_id;
28041 : }
28042 :
28043 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id(PyObject *py_obj, PyObject *value, void *closure)
28044 : {
28045 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28046 0 : if (value == NULL) {
28047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.language_id");
28048 0 : return -1;
28049 : }
28050 : {
28051 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id));
28052 0 : if (PyLong_Check(value)) {
28053 0 : unsigned long long test_var;
28054 0 : test_var = PyLong_AsUnsignedLongLong(value);
28055 0 : if (PyErr_Occurred() != NULL) {
28056 0 : return -1;
28057 : }
28058 0 : if (test_var > uint_max) {
28059 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28060 : PyLong_Type.tp_name, uint_max, test_var);
28061 0 : return -1;
28062 : }
28063 0 : object->in.language_id = test_var;
28064 : } else {
28065 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28066 : PyLong_Type.tp_name);
28067 0 : return -1;
28068 : }
28069 : }
28070 0 : return 0;
28071 : }
28072 :
28073 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id_sys(PyObject *obj, void *closure)
28074 : {
28075 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28076 0 : PyObject *py_language_id_sys;
28077 0 : py_language_id_sys = PyLong_FromLong((uint16_t)object->in.language_id_sys);
28078 0 : return py_language_id_sys;
28079 : }
28080 :
28081 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id_sys(PyObject *py_obj, PyObject *value, void *closure)
28082 : {
28083 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28084 0 : if (value == NULL) {
28085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.language_id_sys");
28086 0 : return -1;
28087 : }
28088 : {
28089 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id_sys));
28090 0 : if (PyLong_Check(value)) {
28091 0 : unsigned long long test_var;
28092 0 : test_var = PyLong_AsUnsignedLongLong(value);
28093 0 : if (PyErr_Occurred() != NULL) {
28094 0 : return -1;
28095 : }
28096 0 : if (test_var > uint_max) {
28097 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28098 : PyLong_Type.tp_name, uint_max, test_var);
28099 0 : return -1;
28100 : }
28101 0 : object->in.language_id_sys = test_var;
28102 : } else {
28103 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28104 : PyLong_Type.tp_name);
28105 0 : return -1;
28106 : }
28107 : }
28108 0 : return 0;
28109 : }
28110 :
28111 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_disp_name(PyObject *obj, void *closure)
28112 : {
28113 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28114 0 : PyObject *py_disp_name;
28115 0 : if (object->out.disp_name == NULL) {
28116 0 : Py_RETURN_NONE;
28117 : }
28118 0 : if (*object->out.disp_name == NULL) {
28119 0 : py_disp_name = Py_None;
28120 0 : Py_INCREF(py_disp_name);
28121 : } else {
28122 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.disp_name, *object->out.disp_name);
28123 : }
28124 0 : return py_disp_name;
28125 : }
28126 :
28127 0 : static int py_lsa_LookupPrivDisplayName_out_set_disp_name(PyObject *py_obj, PyObject *value, void *closure)
28128 : {
28129 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28130 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.disp_name));
28131 0 : if (value == NULL) {
28132 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.disp_name");
28133 0 : return -1;
28134 : }
28135 0 : object->out.disp_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.disp_name);
28136 0 : if (object->out.disp_name == NULL) {
28137 0 : PyErr_NoMemory();
28138 0 : return -1;
28139 : }
28140 0 : if (value == Py_None) {
28141 0 : *object->out.disp_name = NULL;
28142 : } else {
28143 0 : *object->out.disp_name = NULL;
28144 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
28145 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28146 0 : PyErr_NoMemory();
28147 0 : return -1;
28148 : }
28149 0 : *object->out.disp_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
28150 : }
28151 0 : return 0;
28152 : }
28153 :
28154 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_returned_language_id(PyObject *obj, void *closure)
28155 : {
28156 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28157 0 : PyObject *py_returned_language_id;
28158 0 : if (object->out.returned_language_id == NULL) {
28159 0 : Py_RETURN_NONE;
28160 : }
28161 0 : py_returned_language_id = PyLong_FromLong((uint16_t)*object->out.returned_language_id);
28162 0 : return py_returned_language_id;
28163 : }
28164 :
28165 0 : static int py_lsa_LookupPrivDisplayName_out_set_returned_language_id(PyObject *py_obj, PyObject *value, void *closure)
28166 : {
28167 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28168 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_language_id));
28169 0 : if (value == NULL) {
28170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_language_id");
28171 0 : return -1;
28172 : }
28173 0 : object->out.returned_language_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_language_id);
28174 0 : if (object->out.returned_language_id == NULL) {
28175 0 : PyErr_NoMemory();
28176 0 : return -1;
28177 : }
28178 : {
28179 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_language_id));
28180 0 : if (PyLong_Check(value)) {
28181 0 : unsigned long long test_var;
28182 0 : test_var = PyLong_AsUnsignedLongLong(value);
28183 0 : if (PyErr_Occurred() != NULL) {
28184 0 : return -1;
28185 : }
28186 0 : if (test_var > uint_max) {
28187 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28188 : PyLong_Type.tp_name, uint_max, test_var);
28189 0 : return -1;
28190 : }
28191 0 : *object->out.returned_language_id = test_var;
28192 : } else {
28193 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28194 : PyLong_Type.tp_name);
28195 0 : return -1;
28196 : }
28197 : }
28198 0 : return 0;
28199 : }
28200 :
28201 0 : static PyObject *py_lsa_LookupPrivDisplayName_get_result(PyObject *obj, void *closure)
28202 : {
28203 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(obj);
28204 0 : PyObject *py_result;
28205 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28206 0 : return py_result;
28207 : }
28208 :
28209 0 : static int py_lsa_LookupPrivDisplayName_set_result(PyObject *py_obj, PyObject *value, void *closure)
28210 : {
28211 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28212 0 : if (value == NULL) {
28213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28214 0 : return -1;
28215 : }
28216 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28217 0 : return 0;
28218 : }
28219 :
28220 : static PyGetSetDef py_lsa_LookupPrivDisplayName_getsetters[] = {
28221 : {
28222 : .name = discard_const_p(char, "in_handle"),
28223 : .get = py_lsa_LookupPrivDisplayName_in_get_handle,
28224 : .set = py_lsa_LookupPrivDisplayName_in_set_handle,
28225 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28226 : },
28227 : {
28228 : .name = discard_const_p(char, "in_name"),
28229 : .get = py_lsa_LookupPrivDisplayName_in_get_name,
28230 : .set = py_lsa_LookupPrivDisplayName_in_set_name,
28231 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
28232 : },
28233 : {
28234 : .name = discard_const_p(char, "in_language_id"),
28235 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id,
28236 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id,
28237 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28238 : },
28239 : {
28240 : .name = discard_const_p(char, "in_language_id_sys"),
28241 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id_sys,
28242 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id_sys,
28243 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28244 : },
28245 : {
28246 : .name = discard_const_p(char, "out_disp_name"),
28247 : .get = py_lsa_LookupPrivDisplayName_out_get_disp_name,
28248 : .set = py_lsa_LookupPrivDisplayName_out_set_disp_name,
28249 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
28250 : },
28251 : {
28252 : .name = discard_const_p(char, "out_returned_language_id"),
28253 : .get = py_lsa_LookupPrivDisplayName_out_get_returned_language_id,
28254 : .set = py_lsa_LookupPrivDisplayName_out_set_returned_language_id,
28255 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
28256 : },
28257 : {
28258 : .name = discard_const_p(char, "result"),
28259 : .get = py_lsa_LookupPrivDisplayName_get_result,
28260 : .set = py_lsa_LookupPrivDisplayName_set_result,
28261 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28262 : },
28263 : { .name = NULL }
28264 : };
28265 :
28266 0 : static PyObject *py_lsa_LookupPrivDisplayName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28267 : {
28268 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivDisplayName, type);
28269 0 : struct lsa_LookupPrivDisplayName *_self = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(self);
28270 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28271 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28272 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
28273 : /* a pointer to a NULL pointer */
28274 0 : _self->out.disp_name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
28275 0 : _self->out.returned_language_id = talloc_zero(mem_ctx, uint16_t);
28276 0 : return self;
28277 : }
28278 :
28279 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28280 : {
28281 :
28282 :
28283 0 : return PyLong_FromLong(33);
28284 : }
28285 :
28286 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28287 : {
28288 0 : const struct ndr_interface_call *call = NULL;
28289 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28290 0 : PyObject *ret = NULL;
28291 0 : struct ndr_push *push = NULL;
28292 0 : DATA_BLOB blob;
28293 0 : enum ndr_err_code err;
28294 :
28295 0 : if (ndr_table_lsarpc.num_calls < 34) {
28296 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_pack");
28297 0 : return NULL;
28298 : }
28299 0 : call = &ndr_table_lsarpc.calls[33];
28300 :
28301 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28302 0 : if (push == NULL) {
28303 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28304 0 : return NULL;
28305 : }
28306 :
28307 0 : push->flags |= ndr_push_flags;
28308 :
28309 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28310 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28311 0 : TALLOC_FREE(push);
28312 0 : PyErr_SetNdrError(err);
28313 0 : return NULL;
28314 : }
28315 0 : blob = ndr_push_blob(push);
28316 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28317 0 : TALLOC_FREE(push);
28318 0 : return ret;
28319 : }
28320 :
28321 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28322 : {
28323 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28324 0 : PyObject *bigendian_obj = NULL;
28325 0 : PyObject *ndr64_obj = NULL;
28326 0 : libndr_flags ndr_push_flags = 0;
28327 :
28328 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28329 : discard_const_p(char *, kwnames),
28330 : &bigendian_obj,
28331 : &ndr64_obj)) {
28332 0 : return NULL;
28333 : }
28334 :
28335 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28336 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28337 : }
28338 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28339 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28340 : }
28341 :
28342 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28343 : }
28344 :
28345 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28346 : {
28347 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28348 0 : PyObject *bigendian_obj = NULL;
28349 0 : PyObject *ndr64_obj = NULL;
28350 0 : libndr_flags ndr_push_flags = 0;
28351 :
28352 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28353 : discard_const_p(char *, kwnames),
28354 : &bigendian_obj,
28355 : &ndr64_obj)) {
28356 0 : return NULL;
28357 : }
28358 :
28359 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28360 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28361 : }
28362 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28363 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28364 : }
28365 :
28366 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28367 : }
28368 :
28369 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
28370 : {
28371 0 : const struct ndr_interface_call *call = NULL;
28372 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28373 0 : struct ndr_pull *pull = NULL;
28374 0 : enum ndr_err_code err;
28375 :
28376 0 : if (ndr_table_lsarpc.num_calls < 34) {
28377 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_unpack");
28378 0 : return NULL;
28379 : }
28380 0 : call = &ndr_table_lsarpc.calls[33];
28381 :
28382 0 : pull = ndr_pull_init_blob(blob, object);
28383 0 : if (pull == NULL) {
28384 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28385 0 : return NULL;
28386 : }
28387 :
28388 0 : pull->flags |= ndr_pull_flags;
28389 :
28390 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28391 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28392 0 : TALLOC_FREE(pull);
28393 0 : PyErr_SetNdrError(err);
28394 0 : return NULL;
28395 : }
28396 0 : if (!allow_remaining) {
28397 0 : uint32_t highest_ofs;
28398 :
28399 0 : if (pull->offset > pull->relative_highest_offset) {
28400 0 : highest_ofs = pull->offset;
28401 : } else {
28402 0 : highest_ofs = pull->relative_highest_offset;
28403 : }
28404 0 : if (highest_ofs < pull->data_size) {
28405 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28406 : "not all bytes consumed ofs[%u] size[%u]",
28407 : highest_ofs, pull->data_size);
28408 0 : TALLOC_FREE(pull);
28409 0 : PyErr_SetNdrError(err);
28410 0 : return NULL;
28411 : }
28412 : }
28413 :
28414 0 : TALLOC_FREE(pull);
28415 0 : Py_RETURN_NONE;
28416 : }
28417 :
28418 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28419 : {
28420 0 : DATA_BLOB blob;
28421 0 : Py_ssize_t blob_length = 0;
28422 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28423 0 : PyObject *bigendian_obj = NULL;
28424 0 : PyObject *ndr64_obj = NULL;
28425 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28426 0 : PyObject *allow_remaining_obj = NULL;
28427 0 : bool allow_remaining = false;
28428 :
28429 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28430 : discard_const_p(char *, kwnames),
28431 : &blob.data, &blob_length,
28432 : &bigendian_obj,
28433 : &ndr64_obj,
28434 : &allow_remaining_obj)) {
28435 0 : return NULL;
28436 : }
28437 0 : blob.length = blob_length;
28438 :
28439 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28440 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28441 : }
28442 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28443 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28444 : }
28445 :
28446 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28447 0 : allow_remaining = true;
28448 : }
28449 :
28450 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28451 : }
28452 :
28453 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28454 : {
28455 0 : DATA_BLOB blob;
28456 0 : Py_ssize_t blob_length = 0;
28457 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28458 0 : PyObject *bigendian_obj = NULL;
28459 0 : PyObject *ndr64_obj = NULL;
28460 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28461 0 : PyObject *allow_remaining_obj = NULL;
28462 0 : bool allow_remaining = false;
28463 :
28464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28465 : discard_const_p(char *, kwnames),
28466 : &blob.data, &blob_length,
28467 : &bigendian_obj,
28468 : &ndr64_obj,
28469 : &allow_remaining_obj)) {
28470 0 : return NULL;
28471 : }
28472 0 : blob.length = blob_length;
28473 :
28474 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28475 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28476 : }
28477 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28478 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28479 : }
28480 :
28481 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28482 0 : allow_remaining = true;
28483 : }
28484 :
28485 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28486 : }
28487 :
28488 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28489 : {
28490 0 : const struct ndr_interface_call *call = NULL;
28491 0 : struct lsa_LookupPrivDisplayName *object = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(py_obj);
28492 0 : PyObject *ret;
28493 0 : char *retstr;
28494 :
28495 0 : if (ndr_table_lsarpc.num_calls < 34) {
28496 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_print");
28497 0 : return NULL;
28498 : }
28499 0 : call = &ndr_table_lsarpc.calls[33];
28500 :
28501 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28502 0 : ret = PyUnicode_FromString(retstr);
28503 0 : TALLOC_FREE(retstr);
28504 :
28505 0 : return ret;
28506 : }
28507 :
28508 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28509 : {
28510 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_in", NDR_IN);
28511 : }
28512 :
28513 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28514 : {
28515 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_out", NDR_OUT);
28516 : }
28517 :
28518 : static PyMethodDef py_lsa_LookupPrivDisplayName_methods[] = {
28519 : { "opnum", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_opnum, METH_NOARGS|METH_CLASS,
28520 : "lsa.LookupPrivDisplayName.opnum() -> 33 (0x21) " },
28521 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28522 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28523 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28524 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28525 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28526 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28527 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28528 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28529 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28530 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28531 : { NULL, NULL, 0, NULL }
28532 : };
28533 :
28534 :
28535 : static PyTypeObject lsa_LookupPrivDisplayName_Type = {
28536 : PyVarObject_HEAD_INIT(NULL, 0)
28537 : .tp_name = "lsa.LookupPrivDisplayName",
28538 : .tp_getset = py_lsa_LookupPrivDisplayName_getsetters,
28539 : .tp_methods = py_lsa_LookupPrivDisplayName_methods,
28540 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28541 : .tp_new = py_lsa_LookupPrivDisplayName_new,
28542 : };
28543 :
28544 0 : static bool pack_py_lsa_LookupPrivDisplayName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivDisplayName *r)
28545 : {
28546 0 : PyObject *py_handle;
28547 0 : PyObject *py_name;
28548 0 : PyObject *py_language_id;
28549 0 : PyObject *py_language_id_sys;
28550 0 : const char *kwnames[] = {
28551 : "handle", "name", "language_id", "language_id_sys", NULL
28552 : };
28553 :
28554 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)) {
28555 0 : return false;
28556 : }
28557 :
28558 0 : if (py_handle == NULL) {
28559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
28560 0 : return false;
28561 : }
28562 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28563 0 : if (r->in.handle == NULL) {
28564 0 : PyErr_NoMemory();
28565 0 : return false;
28566 : }
28567 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28568 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28569 0 : PyErr_NoMemory();
28570 0 : return false;
28571 : }
28572 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28573 0 : if (py_name == NULL) {
28574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
28575 0 : return false;
28576 : }
28577 0 : r->in.name = talloc_ptrtype(r, r->in.name);
28578 0 : if (r->in.name == NULL) {
28579 0 : PyErr_NoMemory();
28580 0 : return false;
28581 : }
28582 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
28583 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
28584 0 : PyErr_NoMemory();
28585 0 : return false;
28586 : }
28587 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
28588 0 : if (py_language_id == NULL) {
28589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.language_id");
28590 0 : return false;
28591 : }
28592 : {
28593 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id));
28594 0 : if (PyLong_Check(py_language_id)) {
28595 0 : unsigned long long test_var;
28596 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id);
28597 0 : if (PyErr_Occurred() != NULL) {
28598 0 : return false;
28599 : }
28600 0 : if (test_var > uint_max) {
28601 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28602 : PyLong_Type.tp_name, uint_max, test_var);
28603 0 : return false;
28604 : }
28605 0 : r->in.language_id = test_var;
28606 : } else {
28607 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28608 : PyLong_Type.tp_name);
28609 0 : return false;
28610 : }
28611 : }
28612 0 : if (py_language_id_sys == NULL) {
28613 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.language_id_sys");
28614 0 : return false;
28615 : }
28616 : {
28617 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id_sys));
28618 0 : if (PyLong_Check(py_language_id_sys)) {
28619 0 : unsigned long long test_var;
28620 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id_sys);
28621 0 : if (PyErr_Occurred() != NULL) {
28622 0 : return false;
28623 : }
28624 0 : if (test_var > uint_max) {
28625 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28626 : PyLong_Type.tp_name, uint_max, test_var);
28627 0 : return false;
28628 : }
28629 0 : r->in.language_id_sys = test_var;
28630 : } else {
28631 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28632 : PyLong_Type.tp_name);
28633 0 : return false;
28634 : }
28635 : }
28636 0 : return true;
28637 : }
28638 :
28639 0 : static PyObject *unpack_py_lsa_LookupPrivDisplayName_args_out(struct lsa_LookupPrivDisplayName *r)
28640 : {
28641 0 : PyObject *result;
28642 0 : PyObject *py_disp_name;
28643 0 : PyObject *py_returned_language_id;
28644 0 : result = PyTuple_New(2);
28645 0 : if (*r->out.disp_name == NULL) {
28646 0 : py_disp_name = Py_None;
28647 0 : Py_INCREF(py_disp_name);
28648 : } else {
28649 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.disp_name, *r->out.disp_name);
28650 : }
28651 0 : PyTuple_SetItem(result, 0, py_disp_name);
28652 0 : py_returned_language_id = PyLong_FromLong((uint16_t)*r->out.returned_language_id);
28653 0 : PyTuple_SetItem(result, 1, py_returned_language_id);
28654 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28655 0 : PyErr_SetNTSTATUS(r->out.result);
28656 0 : return NULL;
28657 : }
28658 :
28659 0 : return result;
28660 : }
28661 :
28662 :
28663 0 : static PyObject *py_lsa_DeleteObject_in_get_handle(PyObject *obj, void *closure)
28664 : {
28665 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28666 0 : PyObject *py_handle;
28667 0 : if (object->in.handle == NULL) {
28668 0 : Py_RETURN_NONE;
28669 : }
28670 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28671 0 : return py_handle;
28672 : }
28673 :
28674 0 : static int py_lsa_DeleteObject_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28675 : {
28676 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28677 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28678 0 : if (value == NULL) {
28679 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
28680 0 : return -1;
28681 : }
28682 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28683 0 : if (object->in.handle == NULL) {
28684 0 : PyErr_NoMemory();
28685 0 : return -1;
28686 : }
28687 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28688 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28689 0 : PyErr_NoMemory();
28690 0 : return -1;
28691 : }
28692 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28693 0 : return 0;
28694 : }
28695 :
28696 0 : static PyObject *py_lsa_DeleteObject_out_get_handle(PyObject *obj, void *closure)
28697 : {
28698 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28699 0 : PyObject *py_handle;
28700 0 : if (object->out.handle == NULL) {
28701 0 : Py_RETURN_NONE;
28702 : }
28703 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
28704 0 : return py_handle;
28705 : }
28706 :
28707 0 : static int py_lsa_DeleteObject_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28708 : {
28709 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28710 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
28711 0 : if (value == NULL) {
28712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
28713 0 : return -1;
28714 : }
28715 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
28716 0 : if (object->out.handle == NULL) {
28717 0 : PyErr_NoMemory();
28718 0 : return -1;
28719 : }
28720 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28721 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28722 0 : PyErr_NoMemory();
28723 0 : return -1;
28724 : }
28725 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28726 0 : return 0;
28727 : }
28728 :
28729 0 : static PyObject *py_lsa_DeleteObject_get_result(PyObject *obj, void *closure)
28730 : {
28731 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(obj);
28732 0 : PyObject *py_result;
28733 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28734 0 : return py_result;
28735 : }
28736 :
28737 0 : static int py_lsa_DeleteObject_set_result(PyObject *py_obj, PyObject *value, void *closure)
28738 : {
28739 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28740 0 : if (value == NULL) {
28741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28742 0 : return -1;
28743 : }
28744 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28745 0 : return 0;
28746 : }
28747 :
28748 : static PyGetSetDef py_lsa_DeleteObject_getsetters[] = {
28749 : {
28750 : .name = discard_const_p(char, "in_handle"),
28751 : .get = py_lsa_DeleteObject_in_get_handle,
28752 : .set = py_lsa_DeleteObject_in_set_handle,
28753 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28754 : },
28755 : {
28756 : .name = discard_const_p(char, "out_handle"),
28757 : .get = py_lsa_DeleteObject_out_get_handle,
28758 : .set = py_lsa_DeleteObject_out_set_handle,
28759 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28760 : },
28761 : {
28762 : .name = discard_const_p(char, "result"),
28763 : .get = py_lsa_DeleteObject_get_result,
28764 : .set = py_lsa_DeleteObject_set_result,
28765 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28766 : },
28767 : { .name = NULL }
28768 : };
28769 :
28770 0 : static PyObject *py_lsa_DeleteObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28771 : {
28772 0 : PyObject *self = pytalloc_new(struct lsa_DeleteObject, type);
28773 0 : struct lsa_DeleteObject *_self = (struct lsa_DeleteObject *)pytalloc_get_ptr(self);
28774 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28775 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28776 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
28777 0 : return self;
28778 : }
28779 :
28780 0 : static PyObject *py_lsa_DeleteObject_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28781 : {
28782 :
28783 :
28784 0 : return PyLong_FromLong(34);
28785 : }
28786 :
28787 0 : static PyObject *py_lsa_DeleteObject_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28788 : {
28789 0 : const struct ndr_interface_call *call = NULL;
28790 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28791 0 : PyObject *ret = NULL;
28792 0 : struct ndr_push *push = NULL;
28793 0 : DATA_BLOB blob;
28794 0 : enum ndr_err_code err;
28795 :
28796 0 : if (ndr_table_lsarpc.num_calls < 35) {
28797 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_pack");
28798 0 : return NULL;
28799 : }
28800 0 : call = &ndr_table_lsarpc.calls[34];
28801 :
28802 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28803 0 : if (push == NULL) {
28804 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28805 0 : return NULL;
28806 : }
28807 :
28808 0 : push->flags |= ndr_push_flags;
28809 :
28810 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28811 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28812 0 : TALLOC_FREE(push);
28813 0 : PyErr_SetNdrError(err);
28814 0 : return NULL;
28815 : }
28816 0 : blob = ndr_push_blob(push);
28817 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28818 0 : TALLOC_FREE(push);
28819 0 : return ret;
28820 : }
28821 :
28822 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28823 : {
28824 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28825 0 : PyObject *bigendian_obj = NULL;
28826 0 : PyObject *ndr64_obj = NULL;
28827 0 : libndr_flags ndr_push_flags = 0;
28828 :
28829 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28830 : discard_const_p(char *, kwnames),
28831 : &bigendian_obj,
28832 : &ndr64_obj)) {
28833 0 : return NULL;
28834 : }
28835 :
28836 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28837 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28838 : }
28839 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28840 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28841 : }
28842 :
28843 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28844 : }
28845 :
28846 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28847 : {
28848 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28849 0 : PyObject *bigendian_obj = NULL;
28850 0 : PyObject *ndr64_obj = NULL;
28851 0 : libndr_flags ndr_push_flags = 0;
28852 :
28853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28854 : discard_const_p(char *, kwnames),
28855 : &bigendian_obj,
28856 : &ndr64_obj)) {
28857 0 : return NULL;
28858 : }
28859 :
28860 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28861 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28862 : }
28863 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28864 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28865 : }
28866 :
28867 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28868 : }
28869 :
28870 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
28871 : {
28872 0 : const struct ndr_interface_call *call = NULL;
28873 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28874 0 : struct ndr_pull *pull = NULL;
28875 0 : enum ndr_err_code err;
28876 :
28877 0 : if (ndr_table_lsarpc.num_calls < 35) {
28878 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_unpack");
28879 0 : return NULL;
28880 : }
28881 0 : call = &ndr_table_lsarpc.calls[34];
28882 :
28883 0 : pull = ndr_pull_init_blob(blob, object);
28884 0 : if (pull == NULL) {
28885 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28886 0 : return NULL;
28887 : }
28888 :
28889 0 : pull->flags |= ndr_pull_flags;
28890 :
28891 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28892 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28893 0 : TALLOC_FREE(pull);
28894 0 : PyErr_SetNdrError(err);
28895 0 : return NULL;
28896 : }
28897 0 : if (!allow_remaining) {
28898 0 : uint32_t highest_ofs;
28899 :
28900 0 : if (pull->offset > pull->relative_highest_offset) {
28901 0 : highest_ofs = pull->offset;
28902 : } else {
28903 0 : highest_ofs = pull->relative_highest_offset;
28904 : }
28905 0 : if (highest_ofs < pull->data_size) {
28906 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28907 : "not all bytes consumed ofs[%u] size[%u]",
28908 : highest_ofs, pull->data_size);
28909 0 : TALLOC_FREE(pull);
28910 0 : PyErr_SetNdrError(err);
28911 0 : return NULL;
28912 : }
28913 : }
28914 :
28915 0 : TALLOC_FREE(pull);
28916 0 : Py_RETURN_NONE;
28917 : }
28918 :
28919 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28920 : {
28921 0 : DATA_BLOB blob;
28922 0 : Py_ssize_t blob_length = 0;
28923 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28924 0 : PyObject *bigendian_obj = NULL;
28925 0 : PyObject *ndr64_obj = NULL;
28926 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28927 0 : PyObject *allow_remaining_obj = NULL;
28928 0 : bool allow_remaining = false;
28929 :
28930 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28931 : discard_const_p(char *, kwnames),
28932 : &blob.data, &blob_length,
28933 : &bigendian_obj,
28934 : &ndr64_obj,
28935 : &allow_remaining_obj)) {
28936 0 : return NULL;
28937 : }
28938 0 : blob.length = blob_length;
28939 :
28940 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28941 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28942 : }
28943 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28944 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28945 : }
28946 :
28947 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28948 0 : allow_remaining = true;
28949 : }
28950 :
28951 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28952 : }
28953 :
28954 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28955 : {
28956 0 : DATA_BLOB blob;
28957 0 : Py_ssize_t blob_length = 0;
28958 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28959 0 : PyObject *bigendian_obj = NULL;
28960 0 : PyObject *ndr64_obj = NULL;
28961 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28962 0 : PyObject *allow_remaining_obj = NULL;
28963 0 : bool allow_remaining = false;
28964 :
28965 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28966 : discard_const_p(char *, kwnames),
28967 : &blob.data, &blob_length,
28968 : &bigendian_obj,
28969 : &ndr64_obj,
28970 : &allow_remaining_obj)) {
28971 0 : return NULL;
28972 : }
28973 0 : blob.length = blob_length;
28974 :
28975 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28976 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28977 : }
28978 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28979 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28980 : }
28981 :
28982 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28983 0 : allow_remaining = true;
28984 : }
28985 :
28986 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28987 : }
28988 :
28989 0 : static PyObject *py_lsa_DeleteObject_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28990 : {
28991 0 : const struct ndr_interface_call *call = NULL;
28992 0 : struct lsa_DeleteObject *object = (struct lsa_DeleteObject *)pytalloc_get_ptr(py_obj);
28993 0 : PyObject *ret;
28994 0 : char *retstr;
28995 :
28996 0 : if (ndr_table_lsarpc.num_calls < 35) {
28997 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_print");
28998 0 : return NULL;
28999 : }
29000 0 : call = &ndr_table_lsarpc.calls[34];
29001 :
29002 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29003 0 : ret = PyUnicode_FromString(retstr);
29004 0 : TALLOC_FREE(retstr);
29005 :
29006 0 : return ret;
29007 : }
29008 :
29009 0 : static PyObject *py_lsa_DeleteObject_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29010 : {
29011 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_in", NDR_IN);
29012 : }
29013 :
29014 0 : static PyObject *py_lsa_DeleteObject_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29015 : {
29016 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_out", NDR_OUT);
29017 : }
29018 :
29019 : static PyMethodDef py_lsa_DeleteObject_methods[] = {
29020 : { "opnum", (PyCFunction)py_lsa_DeleteObject_ndr_opnum, METH_NOARGS|METH_CLASS,
29021 : "lsa.DeleteObject.opnum() -> 34 (0x22) " },
29022 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29023 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29024 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29025 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29026 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29027 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29028 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29029 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29030 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteObject_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29031 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteObject_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29032 : { NULL, NULL, 0, NULL }
29033 : };
29034 :
29035 :
29036 : static PyTypeObject lsa_DeleteObject_Type = {
29037 : PyVarObject_HEAD_INIT(NULL, 0)
29038 : .tp_name = "lsa.DeleteObject",
29039 : .tp_getset = py_lsa_DeleteObject_getsetters,
29040 : .tp_methods = py_lsa_DeleteObject_methods,
29041 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29042 : .tp_new = py_lsa_DeleteObject_new,
29043 : };
29044 :
29045 1 : static bool pack_py_lsa_DeleteObject_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteObject *r)
29046 : {
29047 0 : PyObject *py_handle;
29048 1 : const char *kwnames[] = {
29049 : "handle", NULL
29050 : };
29051 :
29052 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_DeleteObject", discard_const_p(char *, kwnames), &py_handle)) {
29053 0 : return false;
29054 : }
29055 :
29056 1 : if (py_handle == NULL) {
29057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
29058 0 : return false;
29059 : }
29060 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29061 1 : if (r->in.handle == NULL) {
29062 0 : PyErr_NoMemory();
29063 0 : return false;
29064 : }
29065 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29066 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29067 0 : PyErr_NoMemory();
29068 0 : return false;
29069 : }
29070 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29071 1 : return true;
29072 : }
29073 :
29074 1 : static PyObject *unpack_py_lsa_DeleteObject_args_out(struct lsa_DeleteObject *r)
29075 : {
29076 0 : PyObject *result;
29077 0 : PyObject *py_handle;
29078 1 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
29079 1 : result = py_handle;
29080 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
29081 0 : PyErr_SetNTSTATUS(r->out.result);
29082 0 : return NULL;
29083 : }
29084 :
29085 1 : return result;
29086 : }
29087 :
29088 :
29089 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_handle(PyObject *obj, void *closure)
29090 : {
29091 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29092 0 : PyObject *py_handle;
29093 0 : if (object->in.handle == NULL) {
29094 0 : Py_RETURN_NONE;
29095 : }
29096 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29097 0 : return py_handle;
29098 : }
29099 :
29100 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29101 : {
29102 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29104 0 : if (value == NULL) {
29105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
29106 0 : return -1;
29107 : }
29108 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29109 0 : if (object->in.handle == NULL) {
29110 0 : PyErr_NoMemory();
29111 0 : return -1;
29112 : }
29113 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29115 0 : PyErr_NoMemory();
29116 0 : return -1;
29117 : }
29118 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29119 0 : return 0;
29120 : }
29121 :
29122 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_name(PyObject *obj, void *closure)
29123 : {
29124 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29125 0 : PyObject *py_name;
29126 0 : if (object->in.name == NULL) {
29127 0 : Py_RETURN_NONE;
29128 : }
29129 0 : if (object->in.name == NULL) {
29130 0 : py_name = Py_None;
29131 0 : Py_INCREF(py_name);
29132 : } else {
29133 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
29134 : }
29135 0 : return py_name;
29136 : }
29137 :
29138 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
29139 : {
29140 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29141 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
29142 0 : if (value == NULL) {
29143 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
29144 0 : return -1;
29145 : }
29146 0 : if (value == Py_None) {
29147 0 : object->in.name = NULL;
29148 : } else {
29149 0 : object->in.name = NULL;
29150 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
29151 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29152 0 : PyErr_NoMemory();
29153 0 : return -1;
29154 : }
29155 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
29156 : }
29157 0 : return 0;
29158 : }
29159 :
29160 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_out_get_sids(PyObject *obj, void *closure)
29161 : {
29162 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29163 0 : PyObject *py_sids;
29164 0 : if (object->out.sids == NULL) {
29165 0 : Py_RETURN_NONE;
29166 : }
29167 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
29168 0 : return py_sids;
29169 : }
29170 :
29171 0 : static int py_lsa_EnumAccountsWithUserRight_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
29172 : {
29173 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29174 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
29175 0 : if (value == NULL) {
29176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
29177 0 : return -1;
29178 : }
29179 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
29180 0 : if (object->out.sids == NULL) {
29181 0 : PyErr_NoMemory();
29182 0 : return -1;
29183 : }
29184 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
29185 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29186 0 : PyErr_NoMemory();
29187 0 : return -1;
29188 : }
29189 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
29190 0 : return 0;
29191 : }
29192 :
29193 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_get_result(PyObject *obj, void *closure)
29194 : {
29195 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(obj);
29196 0 : PyObject *py_result;
29197 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29198 0 : return py_result;
29199 : }
29200 :
29201 0 : static int py_lsa_EnumAccountsWithUserRight_set_result(PyObject *py_obj, PyObject *value, void *closure)
29202 : {
29203 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29204 0 : if (value == NULL) {
29205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29206 0 : return -1;
29207 : }
29208 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29209 0 : return 0;
29210 : }
29211 :
29212 : static PyGetSetDef py_lsa_EnumAccountsWithUserRight_getsetters[] = {
29213 : {
29214 : .name = discard_const_p(char, "in_handle"),
29215 : .get = py_lsa_EnumAccountsWithUserRight_in_get_handle,
29216 : .set = py_lsa_EnumAccountsWithUserRight_in_set_handle,
29217 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29218 : },
29219 : {
29220 : .name = discard_const_p(char, "in_name"),
29221 : .get = py_lsa_EnumAccountsWithUserRight_in_get_name,
29222 : .set = py_lsa_EnumAccountsWithUserRight_in_set_name,
29223 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
29224 : },
29225 : {
29226 : .name = discard_const_p(char, "out_sids"),
29227 : .get = py_lsa_EnumAccountsWithUserRight_out_get_sids,
29228 : .set = py_lsa_EnumAccountsWithUserRight_out_set_sids,
29229 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
29230 : },
29231 : {
29232 : .name = discard_const_p(char, "result"),
29233 : .get = py_lsa_EnumAccountsWithUserRight_get_result,
29234 : .set = py_lsa_EnumAccountsWithUserRight_set_result,
29235 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29236 : },
29237 : { .name = NULL }
29238 : };
29239 :
29240 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29241 : {
29242 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountsWithUserRight, type);
29243 0 : struct lsa_EnumAccountsWithUserRight *_self = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(self);
29244 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29245 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29246 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
29247 0 : return self;
29248 : }
29249 :
29250 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29251 : {
29252 :
29253 :
29254 0 : return PyLong_FromLong(35);
29255 : }
29256 :
29257 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29258 : {
29259 0 : const struct ndr_interface_call *call = NULL;
29260 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29261 0 : PyObject *ret = NULL;
29262 0 : struct ndr_push *push = NULL;
29263 0 : DATA_BLOB blob;
29264 0 : enum ndr_err_code err;
29265 :
29266 0 : if (ndr_table_lsarpc.num_calls < 36) {
29267 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_pack");
29268 0 : return NULL;
29269 : }
29270 0 : call = &ndr_table_lsarpc.calls[35];
29271 :
29272 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29273 0 : if (push == NULL) {
29274 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29275 0 : return NULL;
29276 : }
29277 :
29278 0 : push->flags |= ndr_push_flags;
29279 :
29280 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29281 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29282 0 : TALLOC_FREE(push);
29283 0 : PyErr_SetNdrError(err);
29284 0 : return NULL;
29285 : }
29286 0 : blob = ndr_push_blob(push);
29287 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29288 0 : TALLOC_FREE(push);
29289 0 : return ret;
29290 : }
29291 :
29292 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29293 : {
29294 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29295 0 : PyObject *bigendian_obj = NULL;
29296 0 : PyObject *ndr64_obj = NULL;
29297 0 : libndr_flags ndr_push_flags = 0;
29298 :
29299 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29300 : discard_const_p(char *, kwnames),
29301 : &bigendian_obj,
29302 : &ndr64_obj)) {
29303 0 : return NULL;
29304 : }
29305 :
29306 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29307 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29308 : }
29309 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29310 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29311 : }
29312 :
29313 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29314 : }
29315 :
29316 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29317 : {
29318 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29319 0 : PyObject *bigendian_obj = NULL;
29320 0 : PyObject *ndr64_obj = NULL;
29321 0 : libndr_flags ndr_push_flags = 0;
29322 :
29323 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29324 : discard_const_p(char *, kwnames),
29325 : &bigendian_obj,
29326 : &ndr64_obj)) {
29327 0 : return NULL;
29328 : }
29329 :
29330 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29331 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29332 : }
29333 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29334 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29335 : }
29336 :
29337 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29338 : }
29339 :
29340 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29341 : {
29342 0 : const struct ndr_interface_call *call = NULL;
29343 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29344 0 : struct ndr_pull *pull = NULL;
29345 0 : enum ndr_err_code err;
29346 :
29347 0 : if (ndr_table_lsarpc.num_calls < 36) {
29348 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_unpack");
29349 0 : return NULL;
29350 : }
29351 0 : call = &ndr_table_lsarpc.calls[35];
29352 :
29353 0 : pull = ndr_pull_init_blob(blob, object);
29354 0 : if (pull == NULL) {
29355 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29356 0 : return NULL;
29357 : }
29358 :
29359 0 : pull->flags |= ndr_pull_flags;
29360 :
29361 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29362 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29363 0 : TALLOC_FREE(pull);
29364 0 : PyErr_SetNdrError(err);
29365 0 : return NULL;
29366 : }
29367 0 : if (!allow_remaining) {
29368 0 : uint32_t highest_ofs;
29369 :
29370 0 : if (pull->offset > pull->relative_highest_offset) {
29371 0 : highest_ofs = pull->offset;
29372 : } else {
29373 0 : highest_ofs = pull->relative_highest_offset;
29374 : }
29375 0 : if (highest_ofs < pull->data_size) {
29376 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29377 : "not all bytes consumed ofs[%u] size[%u]",
29378 : highest_ofs, pull->data_size);
29379 0 : TALLOC_FREE(pull);
29380 0 : PyErr_SetNdrError(err);
29381 0 : return NULL;
29382 : }
29383 : }
29384 :
29385 0 : TALLOC_FREE(pull);
29386 0 : Py_RETURN_NONE;
29387 : }
29388 :
29389 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29390 : {
29391 0 : DATA_BLOB blob;
29392 0 : Py_ssize_t blob_length = 0;
29393 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29394 0 : PyObject *bigendian_obj = NULL;
29395 0 : PyObject *ndr64_obj = NULL;
29396 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29397 0 : PyObject *allow_remaining_obj = NULL;
29398 0 : bool allow_remaining = false;
29399 :
29400 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29401 : discard_const_p(char *, kwnames),
29402 : &blob.data, &blob_length,
29403 : &bigendian_obj,
29404 : &ndr64_obj,
29405 : &allow_remaining_obj)) {
29406 0 : return NULL;
29407 : }
29408 0 : blob.length = blob_length;
29409 :
29410 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29411 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29412 : }
29413 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29414 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29415 : }
29416 :
29417 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29418 0 : allow_remaining = true;
29419 : }
29420 :
29421 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29422 : }
29423 :
29424 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29425 : {
29426 0 : DATA_BLOB blob;
29427 0 : Py_ssize_t blob_length = 0;
29428 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29429 0 : PyObject *bigendian_obj = NULL;
29430 0 : PyObject *ndr64_obj = NULL;
29431 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29432 0 : PyObject *allow_remaining_obj = NULL;
29433 0 : bool allow_remaining = false;
29434 :
29435 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29436 : discard_const_p(char *, kwnames),
29437 : &blob.data, &blob_length,
29438 : &bigendian_obj,
29439 : &ndr64_obj,
29440 : &allow_remaining_obj)) {
29441 0 : return NULL;
29442 : }
29443 0 : blob.length = blob_length;
29444 :
29445 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29446 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29447 : }
29448 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29449 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29450 : }
29451 :
29452 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29453 0 : allow_remaining = true;
29454 : }
29455 :
29456 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29457 : }
29458 :
29459 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29460 : {
29461 0 : const struct ndr_interface_call *call = NULL;
29462 0 : struct lsa_EnumAccountsWithUserRight *object = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(py_obj);
29463 0 : PyObject *ret;
29464 0 : char *retstr;
29465 :
29466 0 : if (ndr_table_lsarpc.num_calls < 36) {
29467 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_print");
29468 0 : return NULL;
29469 : }
29470 0 : call = &ndr_table_lsarpc.calls[35];
29471 :
29472 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29473 0 : ret = PyUnicode_FromString(retstr);
29474 0 : TALLOC_FREE(retstr);
29475 :
29476 0 : return ret;
29477 : }
29478 :
29479 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29480 : {
29481 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_in", NDR_IN);
29482 : }
29483 :
29484 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29485 : {
29486 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_out", NDR_OUT);
29487 : }
29488 :
29489 : static PyMethodDef py_lsa_EnumAccountsWithUserRight_methods[] = {
29490 : { "opnum", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_opnum, METH_NOARGS|METH_CLASS,
29491 : "lsa.EnumAccountsWithUserRight.opnum() -> 35 (0x23) " },
29492 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29493 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29494 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29495 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29496 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29497 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29498 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29499 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29500 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29501 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29502 : { NULL, NULL, 0, NULL }
29503 : };
29504 :
29505 :
29506 : static PyTypeObject lsa_EnumAccountsWithUserRight_Type = {
29507 : PyVarObject_HEAD_INIT(NULL, 0)
29508 : .tp_name = "lsa.EnumAccountsWithUserRight",
29509 : .tp_getset = py_lsa_EnumAccountsWithUserRight_getsetters,
29510 : .tp_methods = py_lsa_EnumAccountsWithUserRight_methods,
29511 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29512 : .tp_new = py_lsa_EnumAccountsWithUserRight_new,
29513 : };
29514 :
29515 0 : static bool pack_py_lsa_EnumAccountsWithUserRight_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountsWithUserRight *r)
29516 : {
29517 0 : PyObject *py_handle;
29518 0 : PyObject *py_name;
29519 0 : const char *kwnames[] = {
29520 : "handle", "name", NULL
29521 : };
29522 :
29523 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountsWithUserRight", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
29524 0 : return false;
29525 : }
29526 :
29527 0 : if (py_handle == NULL) {
29528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
29529 0 : return false;
29530 : }
29531 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29532 0 : if (r->in.handle == NULL) {
29533 0 : PyErr_NoMemory();
29534 0 : return false;
29535 : }
29536 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29537 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29538 0 : PyErr_NoMemory();
29539 0 : return false;
29540 : }
29541 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29542 0 : if (py_name == NULL) {
29543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
29544 0 : return false;
29545 : }
29546 0 : if (py_name == Py_None) {
29547 0 : r->in.name = NULL;
29548 : } else {
29549 0 : r->in.name = NULL;
29550 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
29551 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
29552 0 : PyErr_NoMemory();
29553 0 : return false;
29554 : }
29555 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
29556 : }
29557 0 : return true;
29558 : }
29559 :
29560 0 : static PyObject *unpack_py_lsa_EnumAccountsWithUserRight_args_out(struct lsa_EnumAccountsWithUserRight *r)
29561 : {
29562 0 : PyObject *result;
29563 0 : PyObject *py_sids;
29564 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
29565 0 : result = py_sids;
29566 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29567 0 : PyErr_SetNTSTATUS(r->out.result);
29568 0 : return NULL;
29569 : }
29570 :
29571 0 : return result;
29572 : }
29573 :
29574 :
29575 0 : static PyObject *py_lsa_EnumAccountRights_in_get_handle(PyObject *obj, void *closure)
29576 : {
29577 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29578 0 : PyObject *py_handle;
29579 0 : if (object->in.handle == NULL) {
29580 0 : Py_RETURN_NONE;
29581 : }
29582 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29583 0 : return py_handle;
29584 : }
29585 :
29586 0 : static int py_lsa_EnumAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29587 : {
29588 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29589 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29590 0 : if (value == NULL) {
29591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
29592 0 : return -1;
29593 : }
29594 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29595 0 : if (object->in.handle == NULL) {
29596 0 : PyErr_NoMemory();
29597 0 : return -1;
29598 : }
29599 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29600 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29601 0 : PyErr_NoMemory();
29602 0 : return -1;
29603 : }
29604 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29605 0 : return 0;
29606 : }
29607 :
29608 0 : static PyObject *py_lsa_EnumAccountRights_in_get_sid(PyObject *obj, void *closure)
29609 : {
29610 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29611 0 : PyObject *py_sid;
29612 0 : if (object->in.sid == NULL) {
29613 0 : Py_RETURN_NONE;
29614 : }
29615 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
29616 0 : return py_sid;
29617 : }
29618 :
29619 0 : static int py_lsa_EnumAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
29620 : {
29621 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29622 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
29623 0 : if (value == NULL) {
29624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
29625 0 : return -1;
29626 : }
29627 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
29628 0 : if (object->in.sid == NULL) {
29629 0 : PyErr_NoMemory();
29630 0 : return -1;
29631 : }
29632 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
29633 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29634 0 : PyErr_NoMemory();
29635 0 : return -1;
29636 : }
29637 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
29638 0 : return 0;
29639 : }
29640 :
29641 0 : static PyObject *py_lsa_EnumAccountRights_out_get_rights(PyObject *obj, void *closure)
29642 : {
29643 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29644 0 : PyObject *py_rights;
29645 0 : if (object->out.rights == NULL) {
29646 0 : Py_RETURN_NONE;
29647 : }
29648 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->out.rights, object->out.rights);
29649 0 : return py_rights;
29650 : }
29651 :
29652 0 : static int py_lsa_EnumAccountRights_out_set_rights(PyObject *py_obj, PyObject *value, void *closure)
29653 : {
29654 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29655 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rights));
29656 0 : if (value == NULL) {
29657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rights");
29658 0 : return -1;
29659 : }
29660 0 : object->out.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rights);
29661 0 : if (object->out.rights == NULL) {
29662 0 : PyErr_NoMemory();
29663 0 : return -1;
29664 : }
29665 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
29666 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29667 0 : PyErr_NoMemory();
29668 0 : return -1;
29669 : }
29670 0 : object->out.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
29671 0 : return 0;
29672 : }
29673 :
29674 0 : static PyObject *py_lsa_EnumAccountRights_get_result(PyObject *obj, void *closure)
29675 : {
29676 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(obj);
29677 0 : PyObject *py_result;
29678 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29679 0 : return py_result;
29680 : }
29681 :
29682 0 : static int py_lsa_EnumAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
29683 : {
29684 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29685 0 : if (value == NULL) {
29686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29687 0 : return -1;
29688 : }
29689 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29690 0 : return 0;
29691 : }
29692 :
29693 : static PyGetSetDef py_lsa_EnumAccountRights_getsetters[] = {
29694 : {
29695 : .name = discard_const_p(char, "in_handle"),
29696 : .get = py_lsa_EnumAccountRights_in_get_handle,
29697 : .set = py_lsa_EnumAccountRights_in_set_handle,
29698 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29699 : },
29700 : {
29701 : .name = discard_const_p(char, "in_sid"),
29702 : .get = py_lsa_EnumAccountRights_in_get_sid,
29703 : .set = py_lsa_EnumAccountRights_in_set_sid,
29704 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
29705 : },
29706 : {
29707 : .name = discard_const_p(char, "out_rights"),
29708 : .get = py_lsa_EnumAccountRights_out_get_rights,
29709 : .set = py_lsa_EnumAccountRights_out_set_rights,
29710 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
29711 : },
29712 : {
29713 : .name = discard_const_p(char, "result"),
29714 : .get = py_lsa_EnumAccountRights_get_result,
29715 : .set = py_lsa_EnumAccountRights_set_result,
29716 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29717 : },
29718 : { .name = NULL }
29719 : };
29720 :
29721 0 : static PyObject *py_lsa_EnumAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29722 : {
29723 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountRights, type);
29724 0 : struct lsa_EnumAccountRights *_self = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(self);
29725 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29726 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29727 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
29728 0 : _self->out.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
29729 0 : return self;
29730 : }
29731 :
29732 0 : static PyObject *py_lsa_EnumAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29733 : {
29734 :
29735 :
29736 0 : return PyLong_FromLong(36);
29737 : }
29738 :
29739 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29740 : {
29741 0 : const struct ndr_interface_call *call = NULL;
29742 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29743 0 : PyObject *ret = NULL;
29744 0 : struct ndr_push *push = NULL;
29745 0 : DATA_BLOB blob;
29746 0 : enum ndr_err_code err;
29747 :
29748 0 : if (ndr_table_lsarpc.num_calls < 37) {
29749 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_pack");
29750 0 : return NULL;
29751 : }
29752 0 : call = &ndr_table_lsarpc.calls[36];
29753 :
29754 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29755 0 : if (push == NULL) {
29756 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29757 0 : return NULL;
29758 : }
29759 :
29760 0 : push->flags |= ndr_push_flags;
29761 :
29762 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29763 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29764 0 : TALLOC_FREE(push);
29765 0 : PyErr_SetNdrError(err);
29766 0 : return NULL;
29767 : }
29768 0 : blob = ndr_push_blob(push);
29769 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29770 0 : TALLOC_FREE(push);
29771 0 : return ret;
29772 : }
29773 :
29774 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29775 : {
29776 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29777 0 : PyObject *bigendian_obj = NULL;
29778 0 : PyObject *ndr64_obj = NULL;
29779 0 : libndr_flags ndr_push_flags = 0;
29780 :
29781 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29782 : discard_const_p(char *, kwnames),
29783 : &bigendian_obj,
29784 : &ndr64_obj)) {
29785 0 : return NULL;
29786 : }
29787 :
29788 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29789 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29790 : }
29791 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29792 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29793 : }
29794 :
29795 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29796 : }
29797 :
29798 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29799 : {
29800 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29801 0 : PyObject *bigendian_obj = NULL;
29802 0 : PyObject *ndr64_obj = NULL;
29803 0 : libndr_flags ndr_push_flags = 0;
29804 :
29805 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29806 : discard_const_p(char *, kwnames),
29807 : &bigendian_obj,
29808 : &ndr64_obj)) {
29809 0 : return NULL;
29810 : }
29811 :
29812 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29813 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29814 : }
29815 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29816 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29817 : }
29818 :
29819 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29820 : }
29821 :
29822 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29823 : {
29824 0 : const struct ndr_interface_call *call = NULL;
29825 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29826 0 : struct ndr_pull *pull = NULL;
29827 0 : enum ndr_err_code err;
29828 :
29829 0 : if (ndr_table_lsarpc.num_calls < 37) {
29830 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_unpack");
29831 0 : return NULL;
29832 : }
29833 0 : call = &ndr_table_lsarpc.calls[36];
29834 :
29835 0 : pull = ndr_pull_init_blob(blob, object);
29836 0 : if (pull == NULL) {
29837 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29838 0 : return NULL;
29839 : }
29840 :
29841 0 : pull->flags |= ndr_pull_flags;
29842 :
29843 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29844 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29845 0 : TALLOC_FREE(pull);
29846 0 : PyErr_SetNdrError(err);
29847 0 : return NULL;
29848 : }
29849 0 : if (!allow_remaining) {
29850 0 : uint32_t highest_ofs;
29851 :
29852 0 : if (pull->offset > pull->relative_highest_offset) {
29853 0 : highest_ofs = pull->offset;
29854 : } else {
29855 0 : highest_ofs = pull->relative_highest_offset;
29856 : }
29857 0 : if (highest_ofs < pull->data_size) {
29858 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29859 : "not all bytes consumed ofs[%u] size[%u]",
29860 : highest_ofs, pull->data_size);
29861 0 : TALLOC_FREE(pull);
29862 0 : PyErr_SetNdrError(err);
29863 0 : return NULL;
29864 : }
29865 : }
29866 :
29867 0 : TALLOC_FREE(pull);
29868 0 : Py_RETURN_NONE;
29869 : }
29870 :
29871 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29872 : {
29873 0 : DATA_BLOB blob;
29874 0 : Py_ssize_t blob_length = 0;
29875 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29876 0 : PyObject *bigendian_obj = NULL;
29877 0 : PyObject *ndr64_obj = NULL;
29878 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29879 0 : PyObject *allow_remaining_obj = NULL;
29880 0 : bool allow_remaining = false;
29881 :
29882 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29883 : discard_const_p(char *, kwnames),
29884 : &blob.data, &blob_length,
29885 : &bigendian_obj,
29886 : &ndr64_obj,
29887 : &allow_remaining_obj)) {
29888 0 : return NULL;
29889 : }
29890 0 : blob.length = blob_length;
29891 :
29892 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29893 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29894 : }
29895 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29896 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29897 : }
29898 :
29899 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29900 0 : allow_remaining = true;
29901 : }
29902 :
29903 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29904 : }
29905 :
29906 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29907 : {
29908 0 : DATA_BLOB blob;
29909 0 : Py_ssize_t blob_length = 0;
29910 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29911 0 : PyObject *bigendian_obj = NULL;
29912 0 : PyObject *ndr64_obj = NULL;
29913 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29914 0 : PyObject *allow_remaining_obj = NULL;
29915 0 : bool allow_remaining = false;
29916 :
29917 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29918 : discard_const_p(char *, kwnames),
29919 : &blob.data, &blob_length,
29920 : &bigendian_obj,
29921 : &ndr64_obj,
29922 : &allow_remaining_obj)) {
29923 0 : return NULL;
29924 : }
29925 0 : blob.length = blob_length;
29926 :
29927 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29928 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29929 : }
29930 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29931 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29932 : }
29933 :
29934 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29935 0 : allow_remaining = true;
29936 : }
29937 :
29938 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29939 : }
29940 :
29941 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29942 : {
29943 0 : const struct ndr_interface_call *call = NULL;
29944 0 : struct lsa_EnumAccountRights *object = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(py_obj);
29945 0 : PyObject *ret;
29946 0 : char *retstr;
29947 :
29948 0 : if (ndr_table_lsarpc.num_calls < 37) {
29949 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_print");
29950 0 : return NULL;
29951 : }
29952 0 : call = &ndr_table_lsarpc.calls[36];
29953 :
29954 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29955 0 : ret = PyUnicode_FromString(retstr);
29956 0 : TALLOC_FREE(retstr);
29957 :
29958 0 : return ret;
29959 : }
29960 :
29961 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29962 : {
29963 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_in", NDR_IN);
29964 : }
29965 :
29966 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29967 : {
29968 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_out", NDR_OUT);
29969 : }
29970 :
29971 : static PyMethodDef py_lsa_EnumAccountRights_methods[] = {
29972 : { "opnum", (PyCFunction)py_lsa_EnumAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
29973 : "lsa.EnumAccountRights.opnum() -> 36 (0x24) " },
29974 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29975 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29976 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29977 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29978 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29979 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29980 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29981 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29982 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29983 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29984 : { NULL, NULL, 0, NULL }
29985 : };
29986 :
29987 :
29988 : static PyTypeObject lsa_EnumAccountRights_Type = {
29989 : PyVarObject_HEAD_INIT(NULL, 0)
29990 : .tp_name = "lsa.EnumAccountRights",
29991 : .tp_getset = py_lsa_EnumAccountRights_getsetters,
29992 : .tp_methods = py_lsa_EnumAccountRights_methods,
29993 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29994 : .tp_new = py_lsa_EnumAccountRights_new,
29995 : };
29996 :
29997 0 : static bool pack_py_lsa_EnumAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountRights *r)
29998 : {
29999 0 : PyObject *py_handle;
30000 0 : PyObject *py_sid;
30001 0 : const char *kwnames[] = {
30002 : "handle", "sid", NULL
30003 : };
30004 :
30005 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid)) {
30006 0 : return false;
30007 : }
30008 :
30009 0 : if (py_handle == NULL) {
30010 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30011 0 : return false;
30012 : }
30013 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30014 0 : if (r->in.handle == NULL) {
30015 0 : PyErr_NoMemory();
30016 0 : return false;
30017 : }
30018 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30019 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30020 0 : PyErr_NoMemory();
30021 0 : return false;
30022 : }
30023 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30024 0 : if (py_sid == NULL) {
30025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
30026 0 : return false;
30027 : }
30028 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
30029 0 : if (r->in.sid == NULL) {
30030 0 : PyErr_NoMemory();
30031 0 : return false;
30032 : }
30033 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
30034 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
30035 0 : PyErr_NoMemory();
30036 0 : return false;
30037 : }
30038 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
30039 0 : return true;
30040 : }
30041 :
30042 0 : static PyObject *unpack_py_lsa_EnumAccountRights_args_out(struct lsa_EnumAccountRights *r)
30043 : {
30044 0 : PyObject *result;
30045 0 : PyObject *py_rights;
30046 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, r->out.rights, r->out.rights);
30047 0 : result = py_rights;
30048 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30049 0 : PyErr_SetNTSTATUS(r->out.result);
30050 0 : return NULL;
30051 : }
30052 :
30053 0 : return result;
30054 : }
30055 :
30056 :
30057 0 : static PyObject *py_lsa_AddAccountRights_in_get_handle(PyObject *obj, void *closure)
30058 : {
30059 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30060 0 : PyObject *py_handle;
30061 0 : if (object->in.handle == NULL) {
30062 0 : Py_RETURN_NONE;
30063 : }
30064 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30065 0 : return py_handle;
30066 : }
30067 :
30068 0 : static int py_lsa_AddAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30069 : {
30070 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30071 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30072 0 : if (value == NULL) {
30073 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30074 0 : return -1;
30075 : }
30076 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30077 0 : if (object->in.handle == NULL) {
30078 0 : PyErr_NoMemory();
30079 0 : return -1;
30080 : }
30081 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30082 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30083 0 : PyErr_NoMemory();
30084 0 : return -1;
30085 : }
30086 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30087 0 : return 0;
30088 : }
30089 :
30090 0 : static PyObject *py_lsa_AddAccountRights_in_get_sid(PyObject *obj, void *closure)
30091 : {
30092 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30093 0 : PyObject *py_sid;
30094 0 : if (object->in.sid == NULL) {
30095 0 : Py_RETURN_NONE;
30096 : }
30097 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30098 0 : return py_sid;
30099 : }
30100 :
30101 0 : static int py_lsa_AddAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30102 : {
30103 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30104 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30105 0 : if (value == NULL) {
30106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30107 0 : return -1;
30108 : }
30109 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30110 0 : if (object->in.sid == NULL) {
30111 0 : PyErr_NoMemory();
30112 0 : return -1;
30113 : }
30114 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30115 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30116 0 : PyErr_NoMemory();
30117 0 : return -1;
30118 : }
30119 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30120 0 : return 0;
30121 : }
30122 :
30123 0 : static PyObject *py_lsa_AddAccountRights_in_get_rights(PyObject *obj, void *closure)
30124 : {
30125 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30126 0 : PyObject *py_rights;
30127 0 : if (object->in.rights == NULL) {
30128 0 : Py_RETURN_NONE;
30129 : }
30130 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
30131 0 : return py_rights;
30132 : }
30133 :
30134 0 : static int py_lsa_AddAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
30135 : {
30136 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30137 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
30138 0 : if (value == NULL) {
30139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rights");
30140 0 : return -1;
30141 : }
30142 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
30143 0 : if (object->in.rights == NULL) {
30144 0 : PyErr_NoMemory();
30145 0 : return -1;
30146 : }
30147 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
30148 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30149 0 : PyErr_NoMemory();
30150 0 : return -1;
30151 : }
30152 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
30153 0 : return 0;
30154 : }
30155 :
30156 0 : static PyObject *py_lsa_AddAccountRights_get_result(PyObject *obj, void *closure)
30157 : {
30158 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(obj);
30159 0 : PyObject *py_result;
30160 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30161 0 : return py_result;
30162 : }
30163 :
30164 0 : static int py_lsa_AddAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
30165 : {
30166 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30167 0 : if (value == NULL) {
30168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30169 0 : return -1;
30170 : }
30171 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30172 0 : return 0;
30173 : }
30174 :
30175 : static PyGetSetDef py_lsa_AddAccountRights_getsetters[] = {
30176 : {
30177 : .name = discard_const_p(char, "in_handle"),
30178 : .get = py_lsa_AddAccountRights_in_get_handle,
30179 : .set = py_lsa_AddAccountRights_in_set_handle,
30180 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30181 : },
30182 : {
30183 : .name = discard_const_p(char, "in_sid"),
30184 : .get = py_lsa_AddAccountRights_in_get_sid,
30185 : .set = py_lsa_AddAccountRights_in_set_sid,
30186 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30187 : },
30188 : {
30189 : .name = discard_const_p(char, "in_rights"),
30190 : .get = py_lsa_AddAccountRights_in_get_rights,
30191 : .set = py_lsa_AddAccountRights_in_set_rights,
30192 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
30193 : },
30194 : {
30195 : .name = discard_const_p(char, "result"),
30196 : .get = py_lsa_AddAccountRights_get_result,
30197 : .set = py_lsa_AddAccountRights_set_result,
30198 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30199 : },
30200 : { .name = NULL }
30201 : };
30202 :
30203 0 : static PyObject *py_lsa_AddAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30204 : {
30205 0 : PyObject *self = pytalloc_new(struct lsa_AddAccountRights, type);
30206 0 : struct lsa_AddAccountRights *_self = (struct lsa_AddAccountRights *)pytalloc_get_ptr(self);
30207 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30208 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30209 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30210 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
30211 0 : return self;
30212 : }
30213 :
30214 0 : static PyObject *py_lsa_AddAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30215 : {
30216 :
30217 :
30218 0 : return PyLong_FromLong(37);
30219 : }
30220 :
30221 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30222 : {
30223 0 : const struct ndr_interface_call *call = NULL;
30224 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30225 0 : PyObject *ret = NULL;
30226 0 : struct ndr_push *push = NULL;
30227 0 : DATA_BLOB blob;
30228 0 : enum ndr_err_code err;
30229 :
30230 0 : if (ndr_table_lsarpc.num_calls < 38) {
30231 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_pack");
30232 0 : return NULL;
30233 : }
30234 0 : call = &ndr_table_lsarpc.calls[37];
30235 :
30236 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30237 0 : if (push == NULL) {
30238 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30239 0 : return NULL;
30240 : }
30241 :
30242 0 : push->flags |= ndr_push_flags;
30243 :
30244 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30245 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30246 0 : TALLOC_FREE(push);
30247 0 : PyErr_SetNdrError(err);
30248 0 : return NULL;
30249 : }
30250 0 : blob = ndr_push_blob(push);
30251 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30252 0 : TALLOC_FREE(push);
30253 0 : return ret;
30254 : }
30255 :
30256 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30257 : {
30258 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30259 0 : PyObject *bigendian_obj = NULL;
30260 0 : PyObject *ndr64_obj = NULL;
30261 0 : libndr_flags ndr_push_flags = 0;
30262 :
30263 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30264 : discard_const_p(char *, kwnames),
30265 : &bigendian_obj,
30266 : &ndr64_obj)) {
30267 0 : return NULL;
30268 : }
30269 :
30270 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30271 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30272 : }
30273 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30274 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30275 : }
30276 :
30277 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30278 : }
30279 :
30280 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30281 : {
30282 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30283 0 : PyObject *bigendian_obj = NULL;
30284 0 : PyObject *ndr64_obj = NULL;
30285 0 : libndr_flags ndr_push_flags = 0;
30286 :
30287 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30288 : discard_const_p(char *, kwnames),
30289 : &bigendian_obj,
30290 : &ndr64_obj)) {
30291 0 : return NULL;
30292 : }
30293 :
30294 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30295 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30296 : }
30297 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30298 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30299 : }
30300 :
30301 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30302 : }
30303 :
30304 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30305 : {
30306 0 : const struct ndr_interface_call *call = NULL;
30307 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30308 0 : struct ndr_pull *pull = NULL;
30309 0 : enum ndr_err_code err;
30310 :
30311 0 : if (ndr_table_lsarpc.num_calls < 38) {
30312 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_unpack");
30313 0 : return NULL;
30314 : }
30315 0 : call = &ndr_table_lsarpc.calls[37];
30316 :
30317 0 : pull = ndr_pull_init_blob(blob, object);
30318 0 : if (pull == NULL) {
30319 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30320 0 : return NULL;
30321 : }
30322 :
30323 0 : pull->flags |= ndr_pull_flags;
30324 :
30325 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30326 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30327 0 : TALLOC_FREE(pull);
30328 0 : PyErr_SetNdrError(err);
30329 0 : return NULL;
30330 : }
30331 0 : if (!allow_remaining) {
30332 0 : uint32_t highest_ofs;
30333 :
30334 0 : if (pull->offset > pull->relative_highest_offset) {
30335 0 : highest_ofs = pull->offset;
30336 : } else {
30337 0 : highest_ofs = pull->relative_highest_offset;
30338 : }
30339 0 : if (highest_ofs < pull->data_size) {
30340 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30341 : "not all bytes consumed ofs[%u] size[%u]",
30342 : highest_ofs, pull->data_size);
30343 0 : TALLOC_FREE(pull);
30344 0 : PyErr_SetNdrError(err);
30345 0 : return NULL;
30346 : }
30347 : }
30348 :
30349 0 : TALLOC_FREE(pull);
30350 0 : Py_RETURN_NONE;
30351 : }
30352 :
30353 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30354 : {
30355 0 : DATA_BLOB blob;
30356 0 : Py_ssize_t blob_length = 0;
30357 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30358 0 : PyObject *bigendian_obj = NULL;
30359 0 : PyObject *ndr64_obj = NULL;
30360 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30361 0 : PyObject *allow_remaining_obj = NULL;
30362 0 : bool allow_remaining = false;
30363 :
30364 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30365 : discard_const_p(char *, kwnames),
30366 : &blob.data, &blob_length,
30367 : &bigendian_obj,
30368 : &ndr64_obj,
30369 : &allow_remaining_obj)) {
30370 0 : return NULL;
30371 : }
30372 0 : blob.length = blob_length;
30373 :
30374 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30375 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30376 : }
30377 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30378 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30379 : }
30380 :
30381 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30382 0 : allow_remaining = true;
30383 : }
30384 :
30385 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30386 : }
30387 :
30388 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30389 : {
30390 0 : DATA_BLOB blob;
30391 0 : Py_ssize_t blob_length = 0;
30392 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30393 0 : PyObject *bigendian_obj = NULL;
30394 0 : PyObject *ndr64_obj = NULL;
30395 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30396 0 : PyObject *allow_remaining_obj = NULL;
30397 0 : bool allow_remaining = false;
30398 :
30399 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30400 : discard_const_p(char *, kwnames),
30401 : &blob.data, &blob_length,
30402 : &bigendian_obj,
30403 : &ndr64_obj,
30404 : &allow_remaining_obj)) {
30405 0 : return NULL;
30406 : }
30407 0 : blob.length = blob_length;
30408 :
30409 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30410 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30411 : }
30412 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30413 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30414 : }
30415 :
30416 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30417 0 : allow_remaining = true;
30418 : }
30419 :
30420 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30421 : }
30422 :
30423 0 : static PyObject *py_lsa_AddAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30424 : {
30425 0 : const struct ndr_interface_call *call = NULL;
30426 0 : struct lsa_AddAccountRights *object = (struct lsa_AddAccountRights *)pytalloc_get_ptr(py_obj);
30427 0 : PyObject *ret;
30428 0 : char *retstr;
30429 :
30430 0 : if (ndr_table_lsarpc.num_calls < 38) {
30431 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_print");
30432 0 : return NULL;
30433 : }
30434 0 : call = &ndr_table_lsarpc.calls[37];
30435 :
30436 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30437 0 : ret = PyUnicode_FromString(retstr);
30438 0 : TALLOC_FREE(retstr);
30439 :
30440 0 : return ret;
30441 : }
30442 :
30443 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30444 : {
30445 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_in", NDR_IN);
30446 : }
30447 :
30448 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30449 : {
30450 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_out", NDR_OUT);
30451 : }
30452 :
30453 : static PyMethodDef py_lsa_AddAccountRights_methods[] = {
30454 : { "opnum", (PyCFunction)py_lsa_AddAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
30455 : "lsa.AddAccountRights.opnum() -> 37 (0x25) " },
30456 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30457 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30458 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30459 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30460 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30461 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30462 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30463 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30464 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30465 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30466 : { NULL, NULL, 0, NULL }
30467 : };
30468 :
30469 :
30470 : static PyTypeObject lsa_AddAccountRights_Type = {
30471 : PyVarObject_HEAD_INIT(NULL, 0)
30472 : .tp_name = "lsa.AddAccountRights",
30473 : .tp_getset = py_lsa_AddAccountRights_getsetters,
30474 : .tp_methods = py_lsa_AddAccountRights_methods,
30475 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30476 : .tp_new = py_lsa_AddAccountRights_new,
30477 : };
30478 :
30479 0 : static bool pack_py_lsa_AddAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddAccountRights *r)
30480 : {
30481 0 : PyObject *py_handle;
30482 0 : PyObject *py_sid;
30483 0 : PyObject *py_rights;
30484 0 : const char *kwnames[] = {
30485 : "handle", "sid", "rights", NULL
30486 : };
30487 :
30488 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_AddAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_rights)) {
30489 0 : return false;
30490 : }
30491 :
30492 0 : if (py_handle == NULL) {
30493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
30494 0 : return false;
30495 : }
30496 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30497 0 : if (r->in.handle == NULL) {
30498 0 : PyErr_NoMemory();
30499 0 : return false;
30500 : }
30501 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30502 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30503 0 : PyErr_NoMemory();
30504 0 : return false;
30505 : }
30506 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30507 0 : if (py_sid == NULL) {
30508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
30509 0 : return false;
30510 : }
30511 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
30512 0 : if (r->in.sid == NULL) {
30513 0 : PyErr_NoMemory();
30514 0 : return false;
30515 : }
30516 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
30517 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
30518 0 : PyErr_NoMemory();
30519 0 : return false;
30520 : }
30521 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
30522 0 : if (py_rights == NULL) {
30523 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rights");
30524 0 : return false;
30525 : }
30526 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
30527 0 : if (r->in.rights == NULL) {
30528 0 : PyErr_NoMemory();
30529 0 : return false;
30530 : }
30531 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
30532 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
30533 0 : PyErr_NoMemory();
30534 0 : return false;
30535 : }
30536 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
30537 0 : return true;
30538 : }
30539 :
30540 0 : static PyObject *unpack_py_lsa_AddAccountRights_args_out(struct lsa_AddAccountRights *r)
30541 : {
30542 0 : PyObject *result;
30543 0 : result = Py_None;
30544 0 : Py_INCREF(result);
30545 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30546 0 : PyErr_SetNTSTATUS(r->out.result);
30547 0 : return NULL;
30548 : }
30549 :
30550 0 : return result;
30551 : }
30552 :
30553 :
30554 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_handle(PyObject *obj, void *closure)
30555 : {
30556 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30557 0 : PyObject *py_handle;
30558 0 : if (object->in.handle == NULL) {
30559 0 : Py_RETURN_NONE;
30560 : }
30561 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30562 0 : return py_handle;
30563 : }
30564 :
30565 0 : static int py_lsa_RemoveAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30566 : {
30567 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30568 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30569 0 : if (value == NULL) {
30570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
30571 0 : return -1;
30572 : }
30573 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30574 0 : if (object->in.handle == NULL) {
30575 0 : PyErr_NoMemory();
30576 0 : return -1;
30577 : }
30578 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30579 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30580 0 : PyErr_NoMemory();
30581 0 : return -1;
30582 : }
30583 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30584 0 : return 0;
30585 : }
30586 :
30587 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_sid(PyObject *obj, void *closure)
30588 : {
30589 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30590 0 : PyObject *py_sid;
30591 0 : if (object->in.sid == NULL) {
30592 0 : Py_RETURN_NONE;
30593 : }
30594 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30595 0 : return py_sid;
30596 : }
30597 :
30598 0 : static int py_lsa_RemoveAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30599 : {
30600 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30601 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30602 0 : if (value == NULL) {
30603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30604 0 : return -1;
30605 : }
30606 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30607 0 : if (object->in.sid == NULL) {
30608 0 : PyErr_NoMemory();
30609 0 : return -1;
30610 : }
30611 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30612 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30613 0 : PyErr_NoMemory();
30614 0 : return -1;
30615 : }
30616 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30617 0 : return 0;
30618 : }
30619 :
30620 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_remove_all(PyObject *obj, void *closure)
30621 : {
30622 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30623 0 : PyObject *py_remove_all;
30624 0 : py_remove_all = PyLong_FromLong((uint16_t)object->in.remove_all);
30625 0 : return py_remove_all;
30626 : }
30627 :
30628 0 : static int py_lsa_RemoveAccountRights_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
30629 : {
30630 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30631 0 : if (value == NULL) {
30632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.remove_all");
30633 0 : return -1;
30634 : }
30635 : {
30636 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
30637 0 : if (PyLong_Check(value)) {
30638 0 : unsigned long long test_var;
30639 0 : test_var = PyLong_AsUnsignedLongLong(value);
30640 0 : if (PyErr_Occurred() != NULL) {
30641 0 : return -1;
30642 : }
30643 0 : if (test_var > uint_max) {
30644 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
30645 : PyLong_Type.tp_name, uint_max, test_var);
30646 0 : return -1;
30647 : }
30648 0 : object->in.remove_all = test_var;
30649 : } else {
30650 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
30651 : PyLong_Type.tp_name);
30652 0 : return -1;
30653 : }
30654 : }
30655 0 : return 0;
30656 : }
30657 :
30658 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_rights(PyObject *obj, void *closure)
30659 : {
30660 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30661 0 : PyObject *py_rights;
30662 0 : if (object->in.rights == NULL) {
30663 0 : Py_RETURN_NONE;
30664 : }
30665 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
30666 0 : return py_rights;
30667 : }
30668 :
30669 0 : static int py_lsa_RemoveAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
30670 : {
30671 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30672 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
30673 0 : if (value == NULL) {
30674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rights");
30675 0 : return -1;
30676 : }
30677 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
30678 0 : if (object->in.rights == NULL) {
30679 0 : PyErr_NoMemory();
30680 0 : return -1;
30681 : }
30682 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
30683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30684 0 : PyErr_NoMemory();
30685 0 : return -1;
30686 : }
30687 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
30688 0 : return 0;
30689 : }
30690 :
30691 0 : static PyObject *py_lsa_RemoveAccountRights_get_result(PyObject *obj, void *closure)
30692 : {
30693 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(obj);
30694 0 : PyObject *py_result;
30695 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30696 0 : return py_result;
30697 : }
30698 :
30699 0 : static int py_lsa_RemoveAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
30700 : {
30701 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30702 0 : if (value == NULL) {
30703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30704 0 : return -1;
30705 : }
30706 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30707 0 : return 0;
30708 : }
30709 :
30710 : static PyGetSetDef py_lsa_RemoveAccountRights_getsetters[] = {
30711 : {
30712 : .name = discard_const_p(char, "in_handle"),
30713 : .get = py_lsa_RemoveAccountRights_in_get_handle,
30714 : .set = py_lsa_RemoveAccountRights_in_set_handle,
30715 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30716 : },
30717 : {
30718 : .name = discard_const_p(char, "in_sid"),
30719 : .get = py_lsa_RemoveAccountRights_in_get_sid,
30720 : .set = py_lsa_RemoveAccountRights_in_set_sid,
30721 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30722 : },
30723 : {
30724 : .name = discard_const_p(char, "in_remove_all"),
30725 : .get = py_lsa_RemoveAccountRights_in_get_remove_all,
30726 : .set = py_lsa_RemoveAccountRights_in_set_remove_all,
30727 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
30728 : },
30729 : {
30730 : .name = discard_const_p(char, "in_rights"),
30731 : .get = py_lsa_RemoveAccountRights_in_get_rights,
30732 : .set = py_lsa_RemoveAccountRights_in_set_rights,
30733 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
30734 : },
30735 : {
30736 : .name = discard_const_p(char, "result"),
30737 : .get = py_lsa_RemoveAccountRights_get_result,
30738 : .set = py_lsa_RemoveAccountRights_set_result,
30739 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30740 : },
30741 : { .name = NULL }
30742 : };
30743 :
30744 0 : static PyObject *py_lsa_RemoveAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30745 : {
30746 0 : PyObject *self = pytalloc_new(struct lsa_RemoveAccountRights, type);
30747 0 : struct lsa_RemoveAccountRights *_self = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(self);
30748 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30749 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30750 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30751 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
30752 0 : return self;
30753 : }
30754 :
30755 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30756 : {
30757 :
30758 :
30759 0 : return PyLong_FromLong(38);
30760 : }
30761 :
30762 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30763 : {
30764 0 : const struct ndr_interface_call *call = NULL;
30765 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30766 0 : PyObject *ret = NULL;
30767 0 : struct ndr_push *push = NULL;
30768 0 : DATA_BLOB blob;
30769 0 : enum ndr_err_code err;
30770 :
30771 0 : if (ndr_table_lsarpc.num_calls < 39) {
30772 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_pack");
30773 0 : return NULL;
30774 : }
30775 0 : call = &ndr_table_lsarpc.calls[38];
30776 :
30777 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30778 0 : if (push == NULL) {
30779 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30780 0 : return NULL;
30781 : }
30782 :
30783 0 : push->flags |= ndr_push_flags;
30784 :
30785 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30786 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30787 0 : TALLOC_FREE(push);
30788 0 : PyErr_SetNdrError(err);
30789 0 : return NULL;
30790 : }
30791 0 : blob = ndr_push_blob(push);
30792 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30793 0 : TALLOC_FREE(push);
30794 0 : return ret;
30795 : }
30796 :
30797 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30798 : {
30799 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30800 0 : PyObject *bigendian_obj = NULL;
30801 0 : PyObject *ndr64_obj = NULL;
30802 0 : libndr_flags ndr_push_flags = 0;
30803 :
30804 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30805 : discard_const_p(char *, kwnames),
30806 : &bigendian_obj,
30807 : &ndr64_obj)) {
30808 0 : return NULL;
30809 : }
30810 :
30811 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30812 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30813 : }
30814 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30815 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30816 : }
30817 :
30818 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30819 : }
30820 :
30821 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30822 : {
30823 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30824 0 : PyObject *bigendian_obj = NULL;
30825 0 : PyObject *ndr64_obj = NULL;
30826 0 : libndr_flags ndr_push_flags = 0;
30827 :
30828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30829 : discard_const_p(char *, kwnames),
30830 : &bigendian_obj,
30831 : &ndr64_obj)) {
30832 0 : return NULL;
30833 : }
30834 :
30835 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30836 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30837 : }
30838 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30839 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30840 : }
30841 :
30842 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30843 : }
30844 :
30845 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30846 : {
30847 0 : const struct ndr_interface_call *call = NULL;
30848 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30849 0 : struct ndr_pull *pull = NULL;
30850 0 : enum ndr_err_code err;
30851 :
30852 0 : if (ndr_table_lsarpc.num_calls < 39) {
30853 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_unpack");
30854 0 : return NULL;
30855 : }
30856 0 : call = &ndr_table_lsarpc.calls[38];
30857 :
30858 0 : pull = ndr_pull_init_blob(blob, object);
30859 0 : if (pull == NULL) {
30860 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30861 0 : return NULL;
30862 : }
30863 :
30864 0 : pull->flags |= ndr_pull_flags;
30865 :
30866 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30867 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30868 0 : TALLOC_FREE(pull);
30869 0 : PyErr_SetNdrError(err);
30870 0 : return NULL;
30871 : }
30872 0 : if (!allow_remaining) {
30873 0 : uint32_t highest_ofs;
30874 :
30875 0 : if (pull->offset > pull->relative_highest_offset) {
30876 0 : highest_ofs = pull->offset;
30877 : } else {
30878 0 : highest_ofs = pull->relative_highest_offset;
30879 : }
30880 0 : if (highest_ofs < pull->data_size) {
30881 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30882 : "not all bytes consumed ofs[%u] size[%u]",
30883 : highest_ofs, pull->data_size);
30884 0 : TALLOC_FREE(pull);
30885 0 : PyErr_SetNdrError(err);
30886 0 : return NULL;
30887 : }
30888 : }
30889 :
30890 0 : TALLOC_FREE(pull);
30891 0 : Py_RETURN_NONE;
30892 : }
30893 :
30894 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30895 : {
30896 0 : DATA_BLOB blob;
30897 0 : Py_ssize_t blob_length = 0;
30898 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30899 0 : PyObject *bigendian_obj = NULL;
30900 0 : PyObject *ndr64_obj = NULL;
30901 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30902 0 : PyObject *allow_remaining_obj = NULL;
30903 0 : bool allow_remaining = false;
30904 :
30905 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30906 : discard_const_p(char *, kwnames),
30907 : &blob.data, &blob_length,
30908 : &bigendian_obj,
30909 : &ndr64_obj,
30910 : &allow_remaining_obj)) {
30911 0 : return NULL;
30912 : }
30913 0 : blob.length = blob_length;
30914 :
30915 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30916 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30917 : }
30918 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30919 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30920 : }
30921 :
30922 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30923 0 : allow_remaining = true;
30924 : }
30925 :
30926 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30927 : }
30928 :
30929 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30930 : {
30931 0 : DATA_BLOB blob;
30932 0 : Py_ssize_t blob_length = 0;
30933 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30934 0 : PyObject *bigendian_obj = NULL;
30935 0 : PyObject *ndr64_obj = NULL;
30936 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30937 0 : PyObject *allow_remaining_obj = NULL;
30938 0 : bool allow_remaining = false;
30939 :
30940 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30941 : discard_const_p(char *, kwnames),
30942 : &blob.data, &blob_length,
30943 : &bigendian_obj,
30944 : &ndr64_obj,
30945 : &allow_remaining_obj)) {
30946 0 : return NULL;
30947 : }
30948 0 : blob.length = blob_length;
30949 :
30950 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30951 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30952 : }
30953 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30954 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30955 : }
30956 :
30957 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30958 0 : allow_remaining = true;
30959 : }
30960 :
30961 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30962 : }
30963 :
30964 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30965 : {
30966 0 : const struct ndr_interface_call *call = NULL;
30967 0 : struct lsa_RemoveAccountRights *object = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(py_obj);
30968 0 : PyObject *ret;
30969 0 : char *retstr;
30970 :
30971 0 : if (ndr_table_lsarpc.num_calls < 39) {
30972 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_print");
30973 0 : return NULL;
30974 : }
30975 0 : call = &ndr_table_lsarpc.calls[38];
30976 :
30977 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30978 0 : ret = PyUnicode_FromString(retstr);
30979 0 : TALLOC_FREE(retstr);
30980 :
30981 0 : return ret;
30982 : }
30983 :
30984 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30985 : {
30986 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_in", NDR_IN);
30987 : }
30988 :
30989 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30990 : {
30991 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_out", NDR_OUT);
30992 : }
30993 :
30994 : static PyMethodDef py_lsa_RemoveAccountRights_methods[] = {
30995 : { "opnum", (PyCFunction)py_lsa_RemoveAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
30996 : "lsa.RemoveAccountRights.opnum() -> 38 (0x26) " },
30997 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30998 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30999 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31000 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31001 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31002 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31003 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31004 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31005 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31006 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31007 : { NULL, NULL, 0, NULL }
31008 : };
31009 :
31010 :
31011 : static PyTypeObject lsa_RemoveAccountRights_Type = {
31012 : PyVarObject_HEAD_INIT(NULL, 0)
31013 : .tp_name = "lsa.RemoveAccountRights",
31014 : .tp_getset = py_lsa_RemoveAccountRights_getsetters,
31015 : .tp_methods = py_lsa_RemoveAccountRights_methods,
31016 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31017 : .tp_new = py_lsa_RemoveAccountRights_new,
31018 : };
31019 :
31020 0 : static bool pack_py_lsa_RemoveAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemoveAccountRights *r)
31021 : {
31022 0 : PyObject *py_handle;
31023 0 : PyObject *py_sid;
31024 0 : PyObject *py_remove_all;
31025 0 : PyObject *py_rights;
31026 0 : const char *kwnames[] = {
31027 : "handle", "sid", "remove_all", "rights", NULL
31028 : };
31029 :
31030 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_RemoveAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_remove_all, &py_rights)) {
31031 0 : return false;
31032 : }
31033 :
31034 0 : if (py_handle == NULL) {
31035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31036 0 : return false;
31037 : }
31038 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31039 0 : if (r->in.handle == NULL) {
31040 0 : PyErr_NoMemory();
31041 0 : return false;
31042 : }
31043 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31044 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31045 0 : PyErr_NoMemory();
31046 0 : return false;
31047 : }
31048 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31049 0 : if (py_sid == NULL) {
31050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
31051 0 : return false;
31052 : }
31053 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
31054 0 : if (r->in.sid == NULL) {
31055 0 : PyErr_NoMemory();
31056 0 : return false;
31057 : }
31058 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
31059 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
31060 0 : PyErr_NoMemory();
31061 0 : return false;
31062 : }
31063 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
31064 0 : if (py_remove_all == NULL) {
31065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.remove_all");
31066 0 : return false;
31067 : }
31068 : {
31069 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
31070 0 : if (PyLong_Check(py_remove_all)) {
31071 0 : unsigned long long test_var;
31072 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
31073 0 : if (PyErr_Occurred() != NULL) {
31074 0 : return false;
31075 : }
31076 0 : if (test_var > uint_max) {
31077 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31078 : PyLong_Type.tp_name, uint_max, test_var);
31079 0 : return false;
31080 : }
31081 0 : r->in.remove_all = test_var;
31082 : } else {
31083 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31084 : PyLong_Type.tp_name);
31085 0 : return false;
31086 : }
31087 : }
31088 0 : if (py_rights == NULL) {
31089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rights");
31090 0 : return false;
31091 : }
31092 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
31093 0 : if (r->in.rights == NULL) {
31094 0 : PyErr_NoMemory();
31095 0 : return false;
31096 : }
31097 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
31098 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
31099 0 : PyErr_NoMemory();
31100 0 : return false;
31101 : }
31102 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
31103 0 : return true;
31104 : }
31105 :
31106 0 : static PyObject *unpack_py_lsa_RemoveAccountRights_args_out(struct lsa_RemoveAccountRights *r)
31107 : {
31108 0 : PyObject *result;
31109 0 : result = Py_None;
31110 0 : Py_INCREF(result);
31111 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31112 0 : PyErr_SetNTSTATUS(r->out.result);
31113 0 : return NULL;
31114 : }
31115 :
31116 0 : return result;
31117 : }
31118 :
31119 :
31120 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_handle(PyObject *obj, void *closure)
31121 : {
31122 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31123 0 : PyObject *py_handle;
31124 0 : if (object->in.handle == NULL) {
31125 0 : Py_RETURN_NONE;
31126 : }
31127 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31128 0 : return py_handle;
31129 : }
31130 :
31131 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31132 : {
31133 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31134 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31135 0 : if (value == NULL) {
31136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
31137 0 : return -1;
31138 : }
31139 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31140 0 : if (object->in.handle == NULL) {
31141 0 : PyErr_NoMemory();
31142 0 : return -1;
31143 : }
31144 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31145 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31146 0 : PyErr_NoMemory();
31147 0 : return -1;
31148 : }
31149 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31150 0 : return 0;
31151 : }
31152 :
31153 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid(PyObject *obj, void *closure)
31154 : {
31155 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31156 0 : PyObject *py_dom_sid;
31157 0 : if (object->in.dom_sid == NULL) {
31158 0 : Py_RETURN_NONE;
31159 : }
31160 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
31161 0 : return py_dom_sid;
31162 : }
31163 :
31164 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
31165 : {
31166 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31167 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
31168 0 : if (value == NULL) {
31169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
31170 0 : return -1;
31171 : }
31172 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
31173 0 : if (object->in.dom_sid == NULL) {
31174 0 : PyErr_NoMemory();
31175 0 : return -1;
31176 : }
31177 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31178 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31179 0 : PyErr_NoMemory();
31180 0 : return -1;
31181 : }
31182 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
31183 0 : return 0;
31184 : }
31185 :
31186 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_level(PyObject *obj, void *closure)
31187 : {
31188 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31189 0 : PyObject *py_level;
31190 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
31191 0 : return py_level;
31192 : }
31193 :
31194 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
31195 : {
31196 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31197 0 : if (value == NULL) {
31198 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
31199 0 : return -1;
31200 : }
31201 : {
31202 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
31203 0 : if (PyLong_Check(value)) {
31204 0 : unsigned long long test_var;
31205 0 : test_var = PyLong_AsUnsignedLongLong(value);
31206 0 : if (PyErr_Occurred() != NULL) {
31207 0 : return -1;
31208 : }
31209 0 : if (test_var > uint_max) {
31210 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31211 : PyLong_Type.tp_name, uint_max, test_var);
31212 0 : return -1;
31213 : }
31214 0 : object->in.level = test_var;
31215 : } else {
31216 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31217 : PyLong_Type.tp_name);
31218 0 : return -1;
31219 : }
31220 : }
31221 0 : return 0;
31222 : }
31223 :
31224 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_out_get_info(PyObject *obj, void *closure)
31225 : {
31226 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31227 0 : PyObject *py_info;
31228 0 : if (object->out.info == NULL) {
31229 0 : Py_RETURN_NONE;
31230 : }
31231 0 : if (*object->out.info == NULL) {
31232 0 : py_info = Py_None;
31233 0 : Py_INCREF(py_info);
31234 : } else {
31235 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
31236 0 : if (py_info == NULL) {
31237 0 : return NULL;
31238 : }
31239 : }
31240 0 : return py_info;
31241 : }
31242 :
31243 0 : static int py_lsa_QueryTrustedDomainInfoBySid_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
31244 : {
31245 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31246 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
31247 0 : if (value == NULL) {
31248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
31249 0 : return -1;
31250 : }
31251 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
31252 0 : if (object->out.info == NULL) {
31253 0 : PyErr_NoMemory();
31254 0 : return -1;
31255 : }
31256 0 : if (value == Py_None) {
31257 0 : *object->out.info = NULL;
31258 : } else {
31259 0 : *object->out.info = NULL;
31260 : {
31261 0 : union lsa_TrustedDomainInfo *info_switch_2;
31262 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");
31263 0 : if (info_switch_2 == NULL) {
31264 0 : return -1;
31265 : }
31266 0 : *object->out.info = info_switch_2;
31267 : }
31268 : }
31269 0 : return 0;
31270 : }
31271 :
31272 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_get_result(PyObject *obj, void *closure)
31273 : {
31274 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(obj);
31275 0 : PyObject *py_result;
31276 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31277 0 : return py_result;
31278 : }
31279 :
31280 0 : static int py_lsa_QueryTrustedDomainInfoBySid_set_result(PyObject *py_obj, PyObject *value, void *closure)
31281 : {
31282 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31283 0 : if (value == NULL) {
31284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31285 0 : return -1;
31286 : }
31287 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31288 0 : return 0;
31289 : }
31290 :
31291 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoBySid_getsetters[] = {
31292 : {
31293 : .name = discard_const_p(char, "in_handle"),
31294 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_handle,
31295 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_handle,
31296 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31297 : },
31298 : {
31299 : .name = discard_const_p(char, "in_dom_sid"),
31300 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid,
31301 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid,
31302 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31303 : },
31304 : {
31305 : .name = discard_const_p(char, "in_level"),
31306 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_level,
31307 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_level,
31308 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
31309 : },
31310 : {
31311 : .name = discard_const_p(char, "out_info"),
31312 : .get = py_lsa_QueryTrustedDomainInfoBySid_out_get_info,
31313 : .set = py_lsa_QueryTrustedDomainInfoBySid_out_set_info,
31314 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
31315 : },
31316 : {
31317 : .name = discard_const_p(char, "result"),
31318 : .get = py_lsa_QueryTrustedDomainInfoBySid_get_result,
31319 : .set = py_lsa_QueryTrustedDomainInfoBySid_set_result,
31320 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31321 : },
31322 : { .name = NULL }
31323 : };
31324 :
31325 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31326 : {
31327 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoBySid, type);
31328 0 : struct lsa_QueryTrustedDomainInfoBySid *_self = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(self);
31329 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31330 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31331 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
31332 : /* a pointer to a NULL pointer */
31333 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
31334 0 : return self;
31335 : }
31336 :
31337 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31338 : {
31339 :
31340 :
31341 0 : return PyLong_FromLong(39);
31342 : }
31343 :
31344 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31345 : {
31346 0 : const struct ndr_interface_call *call = NULL;
31347 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31348 0 : PyObject *ret = NULL;
31349 0 : struct ndr_push *push = NULL;
31350 0 : DATA_BLOB blob;
31351 0 : enum ndr_err_code err;
31352 :
31353 0 : if (ndr_table_lsarpc.num_calls < 40) {
31354 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_pack");
31355 0 : return NULL;
31356 : }
31357 0 : call = &ndr_table_lsarpc.calls[39];
31358 :
31359 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31360 0 : if (push == NULL) {
31361 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31362 0 : return NULL;
31363 : }
31364 :
31365 0 : push->flags |= ndr_push_flags;
31366 :
31367 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31368 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31369 0 : TALLOC_FREE(push);
31370 0 : PyErr_SetNdrError(err);
31371 0 : return NULL;
31372 : }
31373 0 : blob = ndr_push_blob(push);
31374 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31375 0 : TALLOC_FREE(push);
31376 0 : return ret;
31377 : }
31378 :
31379 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31380 : {
31381 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31382 0 : PyObject *bigendian_obj = NULL;
31383 0 : PyObject *ndr64_obj = NULL;
31384 0 : libndr_flags ndr_push_flags = 0;
31385 :
31386 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31387 : discard_const_p(char *, kwnames),
31388 : &bigendian_obj,
31389 : &ndr64_obj)) {
31390 0 : return NULL;
31391 : }
31392 :
31393 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31394 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31395 : }
31396 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31397 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31398 : }
31399 :
31400 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31401 : }
31402 :
31403 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31404 : {
31405 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31406 0 : PyObject *bigendian_obj = NULL;
31407 0 : PyObject *ndr64_obj = NULL;
31408 0 : libndr_flags ndr_push_flags = 0;
31409 :
31410 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31411 : discard_const_p(char *, kwnames),
31412 : &bigendian_obj,
31413 : &ndr64_obj)) {
31414 0 : return NULL;
31415 : }
31416 :
31417 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31418 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31419 : }
31420 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31421 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31422 : }
31423 :
31424 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31425 : }
31426 :
31427 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31428 : {
31429 0 : const struct ndr_interface_call *call = NULL;
31430 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31431 0 : struct ndr_pull *pull = NULL;
31432 0 : enum ndr_err_code err;
31433 :
31434 0 : if (ndr_table_lsarpc.num_calls < 40) {
31435 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack");
31436 0 : return NULL;
31437 : }
31438 0 : call = &ndr_table_lsarpc.calls[39];
31439 :
31440 0 : pull = ndr_pull_init_blob(blob, object);
31441 0 : if (pull == NULL) {
31442 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31443 0 : return NULL;
31444 : }
31445 :
31446 0 : pull->flags |= ndr_pull_flags;
31447 :
31448 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31449 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31450 0 : TALLOC_FREE(pull);
31451 0 : PyErr_SetNdrError(err);
31452 0 : return NULL;
31453 : }
31454 0 : if (!allow_remaining) {
31455 0 : uint32_t highest_ofs;
31456 :
31457 0 : if (pull->offset > pull->relative_highest_offset) {
31458 0 : highest_ofs = pull->offset;
31459 : } else {
31460 0 : highest_ofs = pull->relative_highest_offset;
31461 : }
31462 0 : if (highest_ofs < pull->data_size) {
31463 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31464 : "not all bytes consumed ofs[%u] size[%u]",
31465 : highest_ofs, pull->data_size);
31466 0 : TALLOC_FREE(pull);
31467 0 : PyErr_SetNdrError(err);
31468 0 : return NULL;
31469 : }
31470 : }
31471 :
31472 0 : TALLOC_FREE(pull);
31473 0 : Py_RETURN_NONE;
31474 : }
31475 :
31476 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31477 : {
31478 0 : DATA_BLOB blob;
31479 0 : Py_ssize_t blob_length = 0;
31480 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31481 0 : PyObject *bigendian_obj = NULL;
31482 0 : PyObject *ndr64_obj = NULL;
31483 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31484 0 : PyObject *allow_remaining_obj = NULL;
31485 0 : bool allow_remaining = false;
31486 :
31487 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31488 : discard_const_p(char *, kwnames),
31489 : &blob.data, &blob_length,
31490 : &bigendian_obj,
31491 : &ndr64_obj,
31492 : &allow_remaining_obj)) {
31493 0 : return NULL;
31494 : }
31495 0 : blob.length = blob_length;
31496 :
31497 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31498 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31499 : }
31500 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31501 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31502 : }
31503 :
31504 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31505 0 : allow_remaining = true;
31506 : }
31507 :
31508 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31509 : }
31510 :
31511 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31512 : {
31513 0 : DATA_BLOB blob;
31514 0 : Py_ssize_t blob_length = 0;
31515 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31516 0 : PyObject *bigendian_obj = NULL;
31517 0 : PyObject *ndr64_obj = NULL;
31518 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31519 0 : PyObject *allow_remaining_obj = NULL;
31520 0 : bool allow_remaining = false;
31521 :
31522 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31523 : discard_const_p(char *, kwnames),
31524 : &blob.data, &blob_length,
31525 : &bigendian_obj,
31526 : &ndr64_obj,
31527 : &allow_remaining_obj)) {
31528 0 : return NULL;
31529 : }
31530 0 : blob.length = blob_length;
31531 :
31532 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31533 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31534 : }
31535 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31536 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31537 : }
31538 :
31539 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31540 0 : allow_remaining = true;
31541 : }
31542 :
31543 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31544 : }
31545 :
31546 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31547 : {
31548 0 : const struct ndr_interface_call *call = NULL;
31549 0 : struct lsa_QueryTrustedDomainInfoBySid *object = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(py_obj);
31550 0 : PyObject *ret;
31551 0 : char *retstr;
31552 :
31553 0 : if (ndr_table_lsarpc.num_calls < 40) {
31554 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_print");
31555 0 : return NULL;
31556 : }
31557 0 : call = &ndr_table_lsarpc.calls[39];
31558 :
31559 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31560 0 : ret = PyUnicode_FromString(retstr);
31561 0 : TALLOC_FREE(retstr);
31562 :
31563 0 : return ret;
31564 : }
31565 :
31566 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31567 : {
31568 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_in", NDR_IN);
31569 : }
31570 :
31571 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31572 : {
31573 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_out", NDR_OUT);
31574 : }
31575 :
31576 : static PyMethodDef py_lsa_QueryTrustedDomainInfoBySid_methods[] = {
31577 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum, METH_NOARGS|METH_CLASS,
31578 : "lsa.QueryTrustedDomainInfoBySid.opnum() -> 39 (0x27) " },
31579 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31580 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31581 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31582 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31583 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31584 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31585 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31586 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31587 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31588 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31589 : { NULL, NULL, 0, NULL }
31590 : };
31591 :
31592 :
31593 : static PyTypeObject lsa_QueryTrustedDomainInfoBySid_Type = {
31594 : PyVarObject_HEAD_INIT(NULL, 0)
31595 : .tp_name = "lsa.QueryTrustedDomainInfoBySid",
31596 : .tp_getset = py_lsa_QueryTrustedDomainInfoBySid_getsetters,
31597 : .tp_methods = py_lsa_QueryTrustedDomainInfoBySid_methods,
31598 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31599 : .tp_new = py_lsa_QueryTrustedDomainInfoBySid_new,
31600 : };
31601 :
31602 1 : static bool pack_py_lsa_QueryTrustedDomainInfoBySid_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoBySid *r)
31603 : {
31604 0 : PyObject *py_handle;
31605 0 : PyObject *py_dom_sid;
31606 0 : PyObject *py_level;
31607 1 : const char *kwnames[] = {
31608 : "handle", "dom_sid", "level", NULL
31609 : };
31610 :
31611 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoBySid", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level)) {
31612 0 : return false;
31613 : }
31614 :
31615 1 : if (py_handle == NULL) {
31616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
31617 0 : return false;
31618 : }
31619 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31620 1 : if (r->in.handle == NULL) {
31621 0 : PyErr_NoMemory();
31622 0 : return false;
31623 : }
31624 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31625 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31626 0 : PyErr_NoMemory();
31627 0 : return false;
31628 : }
31629 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31630 1 : if (py_dom_sid == NULL) {
31631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
31632 0 : return false;
31633 : }
31634 1 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
31635 1 : if (r->in.dom_sid == NULL) {
31636 0 : PyErr_NoMemory();
31637 0 : return false;
31638 : }
31639 1 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
31640 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
31641 0 : PyErr_NoMemory();
31642 0 : return false;
31643 : }
31644 1 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
31645 1 : if (py_level == NULL) {
31646 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
31647 0 : return false;
31648 : }
31649 : {
31650 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
31651 1 : if (PyLong_Check(py_level)) {
31652 0 : unsigned long long test_var;
31653 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
31654 1 : if (PyErr_Occurred() != NULL) {
31655 0 : return false;
31656 : }
31657 1 : if (test_var > uint_max) {
31658 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31659 : PyLong_Type.tp_name, uint_max, test_var);
31660 0 : return false;
31661 : }
31662 1 : r->in.level = test_var;
31663 : } else {
31664 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31665 : PyLong_Type.tp_name);
31666 0 : return false;
31667 : }
31668 : }
31669 1 : return true;
31670 : }
31671 :
31672 1 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out(struct lsa_QueryTrustedDomainInfoBySid *r)
31673 : {
31674 0 : PyObject *result;
31675 0 : PyObject *py_info;
31676 1 : if (*r->out.info == NULL) {
31677 1 : py_info = Py_None;
31678 1 : Py_INCREF(py_info);
31679 : } else {
31680 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
31681 0 : if (py_info == NULL) {
31682 0 : return NULL;
31683 : }
31684 : }
31685 1 : result = py_info;
31686 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
31687 1 : PyErr_SetNTSTATUS(r->out.result);
31688 1 : return NULL;
31689 : }
31690 :
31691 0 : return result;
31692 : }
31693 :
31694 :
31695 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_handle(PyObject *obj, void *closure)
31696 : {
31697 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31698 0 : PyObject *py_handle;
31699 0 : if (object->in.handle == NULL) {
31700 0 : Py_RETURN_NONE;
31701 : }
31702 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31703 0 : return py_handle;
31704 : }
31705 :
31706 0 : static int py_lsa_SetTrustedDomainInfo_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31707 : {
31708 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31709 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31710 0 : if (value == NULL) {
31711 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
31712 0 : return -1;
31713 : }
31714 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31715 0 : if (object->in.handle == NULL) {
31716 0 : PyErr_NoMemory();
31717 0 : return -1;
31718 : }
31719 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31720 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31721 0 : PyErr_NoMemory();
31722 0 : return -1;
31723 : }
31724 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31725 0 : return 0;
31726 : }
31727 :
31728 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_dom_sid(PyObject *obj, void *closure)
31729 : {
31730 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31731 0 : PyObject *py_dom_sid;
31732 0 : if (object->in.dom_sid == NULL) {
31733 0 : Py_RETURN_NONE;
31734 : }
31735 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
31736 0 : return py_dom_sid;
31737 : }
31738 :
31739 0 : static int py_lsa_SetTrustedDomainInfo_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
31740 : {
31741 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31742 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
31743 0 : if (value == NULL) {
31744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
31745 0 : return -1;
31746 : }
31747 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
31748 0 : if (object->in.dom_sid == NULL) {
31749 0 : PyErr_NoMemory();
31750 0 : return -1;
31751 : }
31752 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31753 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31754 0 : PyErr_NoMemory();
31755 0 : return -1;
31756 : }
31757 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
31758 0 : return 0;
31759 : }
31760 :
31761 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
31762 : {
31763 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31764 0 : PyObject *py_level;
31765 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
31766 0 : return py_level;
31767 : }
31768 :
31769 0 : static int py_lsa_SetTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
31770 : {
31771 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31772 0 : if (value == NULL) {
31773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
31774 0 : return -1;
31775 : }
31776 : {
31777 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
31778 0 : if (PyLong_Check(value)) {
31779 0 : unsigned long long test_var;
31780 0 : test_var = PyLong_AsUnsignedLongLong(value);
31781 0 : if (PyErr_Occurred() != NULL) {
31782 0 : return -1;
31783 : }
31784 0 : if (test_var > uint_max) {
31785 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31786 : PyLong_Type.tp_name, uint_max, test_var);
31787 0 : return -1;
31788 : }
31789 0 : object->in.level = test_var;
31790 : } else {
31791 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31792 : PyLong_Type.tp_name);
31793 0 : return -1;
31794 : }
31795 : }
31796 0 : return 0;
31797 : }
31798 :
31799 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_info(PyObject *obj, void *closure)
31800 : {
31801 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31802 0 : PyObject *py_info;
31803 0 : if (object->in.info == NULL) {
31804 0 : Py_RETURN_NONE;
31805 : }
31806 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
31807 0 : if (py_info == NULL) {
31808 0 : return NULL;
31809 : }
31810 0 : return py_info;
31811 : }
31812 :
31813 0 : static int py_lsa_SetTrustedDomainInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
31814 : {
31815 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31816 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
31817 0 : if (value == NULL) {
31818 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
31819 0 : return -1;
31820 : }
31821 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
31822 0 : if (object->in.info == NULL) {
31823 0 : PyErr_NoMemory();
31824 0 : return -1;
31825 : }
31826 : {
31827 0 : union lsa_TrustedDomainInfo *info_switch_1;
31828 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");
31829 0 : if (info_switch_1 == NULL) {
31830 0 : return -1;
31831 : }
31832 0 : object->in.info = info_switch_1;
31833 : }
31834 0 : return 0;
31835 : }
31836 :
31837 0 : static PyObject *py_lsa_SetTrustedDomainInfo_get_result(PyObject *obj, void *closure)
31838 : {
31839 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(obj);
31840 0 : PyObject *py_result;
31841 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31842 0 : return py_result;
31843 : }
31844 :
31845 0 : static int py_lsa_SetTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
31846 : {
31847 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31848 0 : if (value == NULL) {
31849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31850 0 : return -1;
31851 : }
31852 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31853 0 : return 0;
31854 : }
31855 :
31856 : static PyGetSetDef py_lsa_SetTrustedDomainInfo_getsetters[] = {
31857 : {
31858 : .name = discard_const_p(char, "in_handle"),
31859 : .get = py_lsa_SetTrustedDomainInfo_in_get_handle,
31860 : .set = py_lsa_SetTrustedDomainInfo_in_set_handle,
31861 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31862 : },
31863 : {
31864 : .name = discard_const_p(char, "in_dom_sid"),
31865 : .get = py_lsa_SetTrustedDomainInfo_in_get_dom_sid,
31866 : .set = py_lsa_SetTrustedDomainInfo_in_set_dom_sid,
31867 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31868 : },
31869 : {
31870 : .name = discard_const_p(char, "in_level"),
31871 : .get = py_lsa_SetTrustedDomainInfo_in_get_level,
31872 : .set = py_lsa_SetTrustedDomainInfo_in_set_level,
31873 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
31874 : },
31875 : {
31876 : .name = discard_const_p(char, "in_info"),
31877 : .get = py_lsa_SetTrustedDomainInfo_in_get_info,
31878 : .set = py_lsa_SetTrustedDomainInfo_in_set_info,
31879 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
31880 : },
31881 : {
31882 : .name = discard_const_p(char, "result"),
31883 : .get = py_lsa_SetTrustedDomainInfo_get_result,
31884 : .set = py_lsa_SetTrustedDomainInfo_set_result,
31885 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31886 : },
31887 : { .name = NULL }
31888 : };
31889 :
31890 0 : static PyObject *py_lsa_SetTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31891 : {
31892 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfo, type);
31893 0 : struct lsa_SetTrustedDomainInfo *_self = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(self);
31894 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31895 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31896 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
31897 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
31898 0 : return self;
31899 : }
31900 :
31901 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31902 : {
31903 :
31904 :
31905 0 : return PyLong_FromLong(40);
31906 : }
31907 :
31908 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31909 : {
31910 0 : const struct ndr_interface_call *call = NULL;
31911 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31912 0 : PyObject *ret = NULL;
31913 0 : struct ndr_push *push = NULL;
31914 0 : DATA_BLOB blob;
31915 0 : enum ndr_err_code err;
31916 :
31917 0 : if (ndr_table_lsarpc.num_calls < 41) {
31918 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_pack");
31919 0 : return NULL;
31920 : }
31921 0 : call = &ndr_table_lsarpc.calls[40];
31922 :
31923 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31924 0 : if (push == NULL) {
31925 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31926 0 : return NULL;
31927 : }
31928 :
31929 0 : push->flags |= ndr_push_flags;
31930 :
31931 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31932 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31933 0 : TALLOC_FREE(push);
31934 0 : PyErr_SetNdrError(err);
31935 0 : return NULL;
31936 : }
31937 0 : blob = ndr_push_blob(push);
31938 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31939 0 : TALLOC_FREE(push);
31940 0 : return ret;
31941 : }
31942 :
31943 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31944 : {
31945 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31946 0 : PyObject *bigendian_obj = NULL;
31947 0 : PyObject *ndr64_obj = NULL;
31948 0 : libndr_flags ndr_push_flags = 0;
31949 :
31950 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31951 : discard_const_p(char *, kwnames),
31952 : &bigendian_obj,
31953 : &ndr64_obj)) {
31954 0 : return NULL;
31955 : }
31956 :
31957 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31958 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31959 : }
31960 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31961 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31962 : }
31963 :
31964 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31965 : }
31966 :
31967 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31968 : {
31969 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31970 0 : PyObject *bigendian_obj = NULL;
31971 0 : PyObject *ndr64_obj = NULL;
31972 0 : libndr_flags ndr_push_flags = 0;
31973 :
31974 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31975 : discard_const_p(char *, kwnames),
31976 : &bigendian_obj,
31977 : &ndr64_obj)) {
31978 0 : return NULL;
31979 : }
31980 :
31981 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31982 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31983 : }
31984 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31985 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31986 : }
31987 :
31988 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31989 : }
31990 :
31991 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31992 : {
31993 0 : const struct ndr_interface_call *call = NULL;
31994 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
31995 0 : struct ndr_pull *pull = NULL;
31996 0 : enum ndr_err_code err;
31997 :
31998 0 : if (ndr_table_lsarpc.num_calls < 41) {
31999 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_unpack");
32000 0 : return NULL;
32001 : }
32002 0 : call = &ndr_table_lsarpc.calls[40];
32003 :
32004 0 : pull = ndr_pull_init_blob(blob, object);
32005 0 : if (pull == NULL) {
32006 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32007 0 : return NULL;
32008 : }
32009 :
32010 0 : pull->flags |= ndr_pull_flags;
32011 :
32012 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32013 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32014 0 : TALLOC_FREE(pull);
32015 0 : PyErr_SetNdrError(err);
32016 0 : return NULL;
32017 : }
32018 0 : if (!allow_remaining) {
32019 0 : uint32_t highest_ofs;
32020 :
32021 0 : if (pull->offset > pull->relative_highest_offset) {
32022 0 : highest_ofs = pull->offset;
32023 : } else {
32024 0 : highest_ofs = pull->relative_highest_offset;
32025 : }
32026 0 : if (highest_ofs < pull->data_size) {
32027 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32028 : "not all bytes consumed ofs[%u] size[%u]",
32029 : highest_ofs, pull->data_size);
32030 0 : TALLOC_FREE(pull);
32031 0 : PyErr_SetNdrError(err);
32032 0 : return NULL;
32033 : }
32034 : }
32035 :
32036 0 : TALLOC_FREE(pull);
32037 0 : Py_RETURN_NONE;
32038 : }
32039 :
32040 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32041 : {
32042 0 : DATA_BLOB blob;
32043 0 : Py_ssize_t blob_length = 0;
32044 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32045 0 : PyObject *bigendian_obj = NULL;
32046 0 : PyObject *ndr64_obj = NULL;
32047 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32048 0 : PyObject *allow_remaining_obj = NULL;
32049 0 : bool allow_remaining = false;
32050 :
32051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32052 : discard_const_p(char *, kwnames),
32053 : &blob.data, &blob_length,
32054 : &bigendian_obj,
32055 : &ndr64_obj,
32056 : &allow_remaining_obj)) {
32057 0 : return NULL;
32058 : }
32059 0 : blob.length = blob_length;
32060 :
32061 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32062 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32063 : }
32064 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32065 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32066 : }
32067 :
32068 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32069 0 : allow_remaining = true;
32070 : }
32071 :
32072 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32073 : }
32074 :
32075 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32076 : {
32077 0 : DATA_BLOB blob;
32078 0 : Py_ssize_t blob_length = 0;
32079 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32080 0 : PyObject *bigendian_obj = NULL;
32081 0 : PyObject *ndr64_obj = NULL;
32082 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32083 0 : PyObject *allow_remaining_obj = NULL;
32084 0 : bool allow_remaining = false;
32085 :
32086 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32087 : discard_const_p(char *, kwnames),
32088 : &blob.data, &blob_length,
32089 : &bigendian_obj,
32090 : &ndr64_obj,
32091 : &allow_remaining_obj)) {
32092 0 : return NULL;
32093 : }
32094 0 : blob.length = blob_length;
32095 :
32096 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32097 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32098 : }
32099 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32100 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32101 : }
32102 :
32103 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32104 0 : allow_remaining = true;
32105 : }
32106 :
32107 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32108 : }
32109 :
32110 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32111 : {
32112 0 : const struct ndr_interface_call *call = NULL;
32113 0 : struct lsa_SetTrustedDomainInfo *object = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(py_obj);
32114 0 : PyObject *ret;
32115 0 : char *retstr;
32116 :
32117 0 : if (ndr_table_lsarpc.num_calls < 41) {
32118 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_print");
32119 0 : return NULL;
32120 : }
32121 0 : call = &ndr_table_lsarpc.calls[40];
32122 :
32123 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32124 0 : ret = PyUnicode_FromString(retstr);
32125 0 : TALLOC_FREE(retstr);
32126 :
32127 0 : return ret;
32128 : }
32129 :
32130 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32131 : {
32132 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_in", NDR_IN);
32133 : }
32134 :
32135 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32136 : {
32137 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_out", NDR_OUT);
32138 : }
32139 :
32140 : static PyMethodDef py_lsa_SetTrustedDomainInfo_methods[] = {
32141 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
32142 : "lsa.SetTrustedDomainInfo.opnum() -> 40 (0x28) " },
32143 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32144 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32145 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32146 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32147 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32148 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32149 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32150 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32151 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32152 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32153 : { NULL, NULL, 0, NULL }
32154 : };
32155 :
32156 :
32157 : static PyTypeObject lsa_SetTrustedDomainInfo_Type = {
32158 : PyVarObject_HEAD_INIT(NULL, 0)
32159 : .tp_name = "lsa.SetTrustedDomainInfo",
32160 : .tp_getset = py_lsa_SetTrustedDomainInfo_getsetters,
32161 : .tp_methods = py_lsa_SetTrustedDomainInfo_methods,
32162 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32163 : .tp_new = py_lsa_SetTrustedDomainInfo_new,
32164 : };
32165 :
32166 0 : static bool pack_py_lsa_SetTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfo *r)
32167 : {
32168 0 : PyObject *py_handle;
32169 0 : PyObject *py_dom_sid;
32170 0 : PyObject *py_level;
32171 0 : PyObject *py_info;
32172 0 : const char *kwnames[] = {
32173 : "handle", "dom_sid", "level", "info", NULL
32174 : };
32175 :
32176 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfo", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level, &py_info)) {
32177 0 : return false;
32178 : }
32179 :
32180 0 : if (py_handle == NULL) {
32181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
32182 0 : return false;
32183 : }
32184 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32185 0 : if (r->in.handle == NULL) {
32186 0 : PyErr_NoMemory();
32187 0 : return false;
32188 : }
32189 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32190 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32191 0 : PyErr_NoMemory();
32192 0 : return false;
32193 : }
32194 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32195 0 : if (py_dom_sid == NULL) {
32196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
32197 0 : return false;
32198 : }
32199 0 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
32200 0 : if (r->in.dom_sid == NULL) {
32201 0 : PyErr_NoMemory();
32202 0 : return false;
32203 : }
32204 0 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
32205 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
32206 0 : PyErr_NoMemory();
32207 0 : return false;
32208 : }
32209 0 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
32210 0 : if (py_level == NULL) {
32211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
32212 0 : return false;
32213 : }
32214 : {
32215 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
32216 0 : if (PyLong_Check(py_level)) {
32217 0 : unsigned long long test_var;
32218 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
32219 0 : if (PyErr_Occurred() != NULL) {
32220 0 : return false;
32221 : }
32222 0 : if (test_var > uint_max) {
32223 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32224 : PyLong_Type.tp_name, uint_max, test_var);
32225 0 : return false;
32226 : }
32227 0 : r->in.level = test_var;
32228 : } else {
32229 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32230 : PyLong_Type.tp_name);
32231 0 : return false;
32232 : }
32233 : }
32234 0 : if (py_info == NULL) {
32235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
32236 0 : return false;
32237 : }
32238 0 : r->in.info = talloc_ptrtype(r, r->in.info);
32239 0 : if (r->in.info == NULL) {
32240 0 : PyErr_NoMemory();
32241 0 : return false;
32242 : }
32243 : {
32244 0 : union lsa_TrustedDomainInfo *info_switch_1;
32245 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
32246 0 : if (info_switch_1 == NULL) {
32247 0 : return false;
32248 : }
32249 0 : r->in.info = info_switch_1;
32250 : }
32251 0 : return true;
32252 : }
32253 :
32254 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfo_args_out(struct lsa_SetTrustedDomainInfo *r)
32255 : {
32256 0 : PyObject *result;
32257 0 : result = Py_None;
32258 0 : Py_INCREF(result);
32259 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32260 0 : PyErr_SetNTSTATUS(r->out.result);
32261 0 : return NULL;
32262 : }
32263 :
32264 0 : return result;
32265 : }
32266 :
32267 :
32268 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_handle(PyObject *obj, void *closure)
32269 : {
32270 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32271 0 : PyObject *py_handle;
32272 0 : if (object->in.handle == NULL) {
32273 0 : Py_RETURN_NONE;
32274 : }
32275 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32276 0 : return py_handle;
32277 : }
32278 :
32279 0 : static int py_lsa_DeleteTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32280 : {
32281 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32282 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32283 0 : if (value == NULL) {
32284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
32285 0 : return -1;
32286 : }
32287 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32288 0 : if (object->in.handle == NULL) {
32289 0 : PyErr_NoMemory();
32290 0 : return -1;
32291 : }
32292 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32293 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32294 0 : PyErr_NoMemory();
32295 0 : return -1;
32296 : }
32297 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32298 0 : return 0;
32299 : }
32300 :
32301 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_dom_sid(PyObject *obj, void *closure)
32302 : {
32303 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32304 0 : PyObject *py_dom_sid;
32305 0 : if (object->in.dom_sid == NULL) {
32306 0 : Py_RETURN_NONE;
32307 : }
32308 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
32309 0 : return py_dom_sid;
32310 : }
32311 :
32312 0 : static int py_lsa_DeleteTrustedDomain_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
32313 : {
32314 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32315 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
32316 0 : if (value == NULL) {
32317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.dom_sid");
32318 0 : return -1;
32319 : }
32320 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
32321 0 : if (object->in.dom_sid == NULL) {
32322 0 : PyErr_NoMemory();
32323 0 : return -1;
32324 : }
32325 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
32326 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32327 0 : PyErr_NoMemory();
32328 0 : return -1;
32329 : }
32330 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
32331 0 : return 0;
32332 : }
32333 :
32334 0 : static PyObject *py_lsa_DeleteTrustedDomain_get_result(PyObject *obj, void *closure)
32335 : {
32336 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(obj);
32337 0 : PyObject *py_result;
32338 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32339 0 : return py_result;
32340 : }
32341 :
32342 0 : static int py_lsa_DeleteTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
32343 : {
32344 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32345 0 : if (value == NULL) {
32346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32347 0 : return -1;
32348 : }
32349 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32350 0 : return 0;
32351 : }
32352 :
32353 : static PyGetSetDef py_lsa_DeleteTrustedDomain_getsetters[] = {
32354 : {
32355 : .name = discard_const_p(char, "in_handle"),
32356 : .get = py_lsa_DeleteTrustedDomain_in_get_handle,
32357 : .set = py_lsa_DeleteTrustedDomain_in_set_handle,
32358 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32359 : },
32360 : {
32361 : .name = discard_const_p(char, "in_dom_sid"),
32362 : .get = py_lsa_DeleteTrustedDomain_in_get_dom_sid,
32363 : .set = py_lsa_DeleteTrustedDomain_in_set_dom_sid,
32364 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
32365 : },
32366 : {
32367 : .name = discard_const_p(char, "result"),
32368 : .get = py_lsa_DeleteTrustedDomain_get_result,
32369 : .set = py_lsa_DeleteTrustedDomain_set_result,
32370 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32371 : },
32372 : { .name = NULL }
32373 : };
32374 :
32375 0 : static PyObject *py_lsa_DeleteTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32376 : {
32377 0 : PyObject *self = pytalloc_new(struct lsa_DeleteTrustedDomain, type);
32378 0 : struct lsa_DeleteTrustedDomain *_self = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(self);
32379 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32380 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32381 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
32382 0 : return self;
32383 : }
32384 :
32385 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32386 : {
32387 :
32388 :
32389 0 : return PyLong_FromLong(41);
32390 : }
32391 :
32392 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32393 : {
32394 0 : const struct ndr_interface_call *call = NULL;
32395 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32396 0 : PyObject *ret = NULL;
32397 0 : struct ndr_push *push = NULL;
32398 0 : DATA_BLOB blob;
32399 0 : enum ndr_err_code err;
32400 :
32401 0 : if (ndr_table_lsarpc.num_calls < 42) {
32402 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_pack");
32403 0 : return NULL;
32404 : }
32405 0 : call = &ndr_table_lsarpc.calls[41];
32406 :
32407 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32408 0 : if (push == NULL) {
32409 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32410 0 : return NULL;
32411 : }
32412 :
32413 0 : push->flags |= ndr_push_flags;
32414 :
32415 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32416 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32417 0 : TALLOC_FREE(push);
32418 0 : PyErr_SetNdrError(err);
32419 0 : return NULL;
32420 : }
32421 0 : blob = ndr_push_blob(push);
32422 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32423 0 : TALLOC_FREE(push);
32424 0 : return ret;
32425 : }
32426 :
32427 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32428 : {
32429 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32430 0 : PyObject *bigendian_obj = NULL;
32431 0 : PyObject *ndr64_obj = NULL;
32432 0 : libndr_flags ndr_push_flags = 0;
32433 :
32434 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32435 : discard_const_p(char *, kwnames),
32436 : &bigendian_obj,
32437 : &ndr64_obj)) {
32438 0 : return NULL;
32439 : }
32440 :
32441 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32442 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32443 : }
32444 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32445 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32446 : }
32447 :
32448 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32449 : }
32450 :
32451 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32452 : {
32453 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32454 0 : PyObject *bigendian_obj = NULL;
32455 0 : PyObject *ndr64_obj = NULL;
32456 0 : libndr_flags ndr_push_flags = 0;
32457 :
32458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32459 : discard_const_p(char *, kwnames),
32460 : &bigendian_obj,
32461 : &ndr64_obj)) {
32462 0 : return NULL;
32463 : }
32464 :
32465 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32466 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32467 : }
32468 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32469 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32470 : }
32471 :
32472 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32473 : }
32474 :
32475 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
32476 : {
32477 0 : const struct ndr_interface_call *call = NULL;
32478 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32479 0 : struct ndr_pull *pull = NULL;
32480 0 : enum ndr_err_code err;
32481 :
32482 0 : if (ndr_table_lsarpc.num_calls < 42) {
32483 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_unpack");
32484 0 : return NULL;
32485 : }
32486 0 : call = &ndr_table_lsarpc.calls[41];
32487 :
32488 0 : pull = ndr_pull_init_blob(blob, object);
32489 0 : if (pull == NULL) {
32490 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32491 0 : return NULL;
32492 : }
32493 :
32494 0 : pull->flags |= ndr_pull_flags;
32495 :
32496 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32497 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32498 0 : TALLOC_FREE(pull);
32499 0 : PyErr_SetNdrError(err);
32500 0 : return NULL;
32501 : }
32502 0 : if (!allow_remaining) {
32503 0 : uint32_t highest_ofs;
32504 :
32505 0 : if (pull->offset > pull->relative_highest_offset) {
32506 0 : highest_ofs = pull->offset;
32507 : } else {
32508 0 : highest_ofs = pull->relative_highest_offset;
32509 : }
32510 0 : if (highest_ofs < pull->data_size) {
32511 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32512 : "not all bytes consumed ofs[%u] size[%u]",
32513 : highest_ofs, pull->data_size);
32514 0 : TALLOC_FREE(pull);
32515 0 : PyErr_SetNdrError(err);
32516 0 : return NULL;
32517 : }
32518 : }
32519 :
32520 0 : TALLOC_FREE(pull);
32521 0 : Py_RETURN_NONE;
32522 : }
32523 :
32524 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32525 : {
32526 0 : DATA_BLOB blob;
32527 0 : Py_ssize_t blob_length = 0;
32528 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32529 0 : PyObject *bigendian_obj = NULL;
32530 0 : PyObject *ndr64_obj = NULL;
32531 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32532 0 : PyObject *allow_remaining_obj = NULL;
32533 0 : bool allow_remaining = false;
32534 :
32535 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32536 : discard_const_p(char *, kwnames),
32537 : &blob.data, &blob_length,
32538 : &bigendian_obj,
32539 : &ndr64_obj,
32540 : &allow_remaining_obj)) {
32541 0 : return NULL;
32542 : }
32543 0 : blob.length = blob_length;
32544 :
32545 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32546 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32547 : }
32548 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32549 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32550 : }
32551 :
32552 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32553 0 : allow_remaining = true;
32554 : }
32555 :
32556 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32557 : }
32558 :
32559 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32560 : {
32561 0 : DATA_BLOB blob;
32562 0 : Py_ssize_t blob_length = 0;
32563 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32564 0 : PyObject *bigendian_obj = NULL;
32565 0 : PyObject *ndr64_obj = NULL;
32566 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32567 0 : PyObject *allow_remaining_obj = NULL;
32568 0 : bool allow_remaining = false;
32569 :
32570 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32571 : discard_const_p(char *, kwnames),
32572 : &blob.data, &blob_length,
32573 : &bigendian_obj,
32574 : &ndr64_obj,
32575 : &allow_remaining_obj)) {
32576 0 : return NULL;
32577 : }
32578 0 : blob.length = blob_length;
32579 :
32580 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32581 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32582 : }
32583 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32584 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32585 : }
32586 :
32587 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32588 0 : allow_remaining = true;
32589 : }
32590 :
32591 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32592 : }
32593 :
32594 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32595 : {
32596 0 : const struct ndr_interface_call *call = NULL;
32597 0 : struct lsa_DeleteTrustedDomain *object = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(py_obj);
32598 0 : PyObject *ret;
32599 0 : char *retstr;
32600 :
32601 0 : if (ndr_table_lsarpc.num_calls < 42) {
32602 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_print");
32603 0 : return NULL;
32604 : }
32605 0 : call = &ndr_table_lsarpc.calls[41];
32606 :
32607 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32608 0 : ret = PyUnicode_FromString(retstr);
32609 0 : TALLOC_FREE(retstr);
32610 :
32611 0 : return ret;
32612 : }
32613 :
32614 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32615 : {
32616 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_in", NDR_IN);
32617 : }
32618 :
32619 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32620 : {
32621 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_out", NDR_OUT);
32622 : }
32623 :
32624 : static PyMethodDef py_lsa_DeleteTrustedDomain_methods[] = {
32625 : { "opnum", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
32626 : "lsa.DeleteTrustedDomain.opnum() -> 41 (0x29) " },
32627 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32628 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32629 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32630 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32631 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32632 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32633 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32634 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32635 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32636 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32637 : { NULL, NULL, 0, NULL }
32638 : };
32639 :
32640 :
32641 : static PyTypeObject lsa_DeleteTrustedDomain_Type = {
32642 : PyVarObject_HEAD_INIT(NULL, 0)
32643 : .tp_name = "lsa.DeleteTrustedDomain",
32644 : .tp_getset = py_lsa_DeleteTrustedDomain_getsetters,
32645 : .tp_methods = py_lsa_DeleteTrustedDomain_methods,
32646 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32647 : .tp_new = py_lsa_DeleteTrustedDomain_new,
32648 : };
32649 :
32650 1 : static bool pack_py_lsa_DeleteTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteTrustedDomain *r)
32651 : {
32652 0 : PyObject *py_handle;
32653 0 : PyObject *py_dom_sid;
32654 1 : const char *kwnames[] = {
32655 : "handle", "dom_sid", NULL
32656 : };
32657 :
32658 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_DeleteTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid)) {
32659 0 : return false;
32660 : }
32661 :
32662 1 : if (py_handle == NULL) {
32663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
32664 0 : return false;
32665 : }
32666 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32667 1 : if (r->in.handle == NULL) {
32668 0 : PyErr_NoMemory();
32669 0 : return false;
32670 : }
32671 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32672 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32673 0 : PyErr_NoMemory();
32674 0 : return false;
32675 : }
32676 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32677 1 : if (py_dom_sid == NULL) {
32678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.dom_sid");
32679 0 : return false;
32680 : }
32681 1 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
32682 1 : if (r->in.dom_sid == NULL) {
32683 0 : PyErr_NoMemory();
32684 0 : return false;
32685 : }
32686 1 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
32687 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
32688 0 : PyErr_NoMemory();
32689 0 : return false;
32690 : }
32691 1 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
32692 1 : return true;
32693 : }
32694 :
32695 1 : static PyObject *unpack_py_lsa_DeleteTrustedDomain_args_out(struct lsa_DeleteTrustedDomain *r)
32696 : {
32697 0 : PyObject *result;
32698 1 : result = Py_None;
32699 0 : Py_INCREF(result);
32700 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
32701 0 : PyErr_SetNTSTATUS(r->out.result);
32702 0 : return NULL;
32703 : }
32704 :
32705 1 : return result;
32706 : }
32707 :
32708 :
32709 0 : static PyObject *py_lsa_StorePrivateData_in_get_handle(PyObject *obj, void *closure)
32710 : {
32711 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32712 0 : PyObject *py_handle;
32713 0 : if (object->in.handle == NULL) {
32714 0 : Py_RETURN_NONE;
32715 : }
32716 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32717 0 : return py_handle;
32718 : }
32719 :
32720 0 : static int py_lsa_StorePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32721 : {
32722 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32723 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32724 0 : if (value == NULL) {
32725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
32726 0 : return -1;
32727 : }
32728 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32729 0 : if (object->in.handle == NULL) {
32730 0 : PyErr_NoMemory();
32731 0 : return -1;
32732 : }
32733 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32734 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32735 0 : PyErr_NoMemory();
32736 0 : return -1;
32737 : }
32738 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32739 0 : return 0;
32740 : }
32741 :
32742 0 : static PyObject *py_lsa_StorePrivateData_in_get_name(PyObject *obj, void *closure)
32743 : {
32744 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32745 0 : PyObject *py_name;
32746 0 : if (object->in.name == NULL) {
32747 0 : Py_RETURN_NONE;
32748 : }
32749 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
32750 0 : return py_name;
32751 : }
32752 :
32753 0 : static int py_lsa_StorePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
32754 : {
32755 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32756 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
32757 0 : if (value == NULL) {
32758 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
32759 0 : return -1;
32760 : }
32761 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
32762 0 : if (object->in.name == NULL) {
32763 0 : PyErr_NoMemory();
32764 0 : return -1;
32765 : }
32766 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
32767 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32768 0 : PyErr_NoMemory();
32769 0 : return -1;
32770 : }
32771 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
32772 0 : return 0;
32773 : }
32774 :
32775 0 : static PyObject *py_lsa_StorePrivateData_in_get_val(PyObject *obj, void *closure)
32776 : {
32777 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32778 0 : PyObject *py_val;
32779 0 : if (object->in.val == NULL) {
32780 0 : Py_RETURN_NONE;
32781 : }
32782 0 : if (object->in.val == NULL) {
32783 0 : py_val = Py_None;
32784 0 : Py_INCREF(py_val);
32785 : } else {
32786 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.val, object->in.val);
32787 : }
32788 0 : return py_val;
32789 : }
32790 :
32791 0 : static int py_lsa_StorePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
32792 : {
32793 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32794 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
32795 0 : if (value == NULL) {
32796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.val");
32797 0 : return -1;
32798 : }
32799 0 : if (value == Py_None) {
32800 0 : object->in.val = NULL;
32801 : } else {
32802 0 : object->in.val = NULL;
32803 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
32804 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32805 0 : PyErr_NoMemory();
32806 0 : return -1;
32807 : }
32808 0 : object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
32809 : }
32810 0 : return 0;
32811 : }
32812 :
32813 0 : static PyObject *py_lsa_StorePrivateData_get_result(PyObject *obj, void *closure)
32814 : {
32815 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(obj);
32816 0 : PyObject *py_result;
32817 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32818 0 : return py_result;
32819 : }
32820 :
32821 0 : static int py_lsa_StorePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
32822 : {
32823 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32824 0 : if (value == NULL) {
32825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32826 0 : return -1;
32827 : }
32828 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32829 0 : return 0;
32830 : }
32831 :
32832 : static PyGetSetDef py_lsa_StorePrivateData_getsetters[] = {
32833 : {
32834 : .name = discard_const_p(char, "in_handle"),
32835 : .get = py_lsa_StorePrivateData_in_get_handle,
32836 : .set = py_lsa_StorePrivateData_in_set_handle,
32837 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32838 : },
32839 : {
32840 : .name = discard_const_p(char, "in_name"),
32841 : .get = py_lsa_StorePrivateData_in_get_name,
32842 : .set = py_lsa_StorePrivateData_in_set_name,
32843 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
32844 : },
32845 : {
32846 : .name = discard_const_p(char, "in_val"),
32847 : .get = py_lsa_StorePrivateData_in_get_val,
32848 : .set = py_lsa_StorePrivateData_in_set_val,
32849 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
32850 : },
32851 : {
32852 : .name = discard_const_p(char, "result"),
32853 : .get = py_lsa_StorePrivateData_get_result,
32854 : .set = py_lsa_StorePrivateData_set_result,
32855 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32856 : },
32857 : { .name = NULL }
32858 : };
32859 :
32860 0 : static PyObject *py_lsa_StorePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32861 : {
32862 0 : PyObject *self = pytalloc_new(struct lsa_StorePrivateData, type);
32863 0 : struct lsa_StorePrivateData *_self = (struct lsa_StorePrivateData *)pytalloc_get_ptr(self);
32864 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32865 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32866 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
32867 0 : return self;
32868 : }
32869 :
32870 0 : static PyObject *py_lsa_StorePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32871 : {
32872 :
32873 :
32874 0 : return PyLong_FromLong(42);
32875 : }
32876 :
32877 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32878 : {
32879 0 : const struct ndr_interface_call *call = NULL;
32880 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32881 0 : PyObject *ret = NULL;
32882 0 : struct ndr_push *push = NULL;
32883 0 : DATA_BLOB blob;
32884 0 : enum ndr_err_code err;
32885 :
32886 0 : if (ndr_table_lsarpc.num_calls < 43) {
32887 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_pack");
32888 0 : return NULL;
32889 : }
32890 0 : call = &ndr_table_lsarpc.calls[42];
32891 :
32892 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32893 0 : if (push == NULL) {
32894 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32895 0 : return NULL;
32896 : }
32897 :
32898 0 : push->flags |= ndr_push_flags;
32899 :
32900 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32901 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32902 0 : TALLOC_FREE(push);
32903 0 : PyErr_SetNdrError(err);
32904 0 : return NULL;
32905 : }
32906 0 : blob = ndr_push_blob(push);
32907 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32908 0 : TALLOC_FREE(push);
32909 0 : return ret;
32910 : }
32911 :
32912 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32913 : {
32914 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32915 0 : PyObject *bigendian_obj = NULL;
32916 0 : PyObject *ndr64_obj = NULL;
32917 0 : libndr_flags ndr_push_flags = 0;
32918 :
32919 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32920 : discard_const_p(char *, kwnames),
32921 : &bigendian_obj,
32922 : &ndr64_obj)) {
32923 0 : return NULL;
32924 : }
32925 :
32926 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32927 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32928 : }
32929 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32930 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32931 : }
32932 :
32933 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32934 : }
32935 :
32936 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32937 : {
32938 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32939 0 : PyObject *bigendian_obj = NULL;
32940 0 : PyObject *ndr64_obj = NULL;
32941 0 : libndr_flags ndr_push_flags = 0;
32942 :
32943 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32944 : discard_const_p(char *, kwnames),
32945 : &bigendian_obj,
32946 : &ndr64_obj)) {
32947 0 : return NULL;
32948 : }
32949 :
32950 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32951 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32952 : }
32953 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32954 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32955 : }
32956 :
32957 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32958 : }
32959 :
32960 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
32961 : {
32962 0 : const struct ndr_interface_call *call = NULL;
32963 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
32964 0 : struct ndr_pull *pull = NULL;
32965 0 : enum ndr_err_code err;
32966 :
32967 0 : if (ndr_table_lsarpc.num_calls < 43) {
32968 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_unpack");
32969 0 : return NULL;
32970 : }
32971 0 : call = &ndr_table_lsarpc.calls[42];
32972 :
32973 0 : pull = ndr_pull_init_blob(blob, object);
32974 0 : if (pull == NULL) {
32975 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32976 0 : return NULL;
32977 : }
32978 :
32979 0 : pull->flags |= ndr_pull_flags;
32980 :
32981 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32982 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32983 0 : TALLOC_FREE(pull);
32984 0 : PyErr_SetNdrError(err);
32985 0 : return NULL;
32986 : }
32987 0 : if (!allow_remaining) {
32988 0 : uint32_t highest_ofs;
32989 :
32990 0 : if (pull->offset > pull->relative_highest_offset) {
32991 0 : highest_ofs = pull->offset;
32992 : } else {
32993 0 : highest_ofs = pull->relative_highest_offset;
32994 : }
32995 0 : if (highest_ofs < pull->data_size) {
32996 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32997 : "not all bytes consumed ofs[%u] size[%u]",
32998 : highest_ofs, pull->data_size);
32999 0 : TALLOC_FREE(pull);
33000 0 : PyErr_SetNdrError(err);
33001 0 : return NULL;
33002 : }
33003 : }
33004 :
33005 0 : TALLOC_FREE(pull);
33006 0 : Py_RETURN_NONE;
33007 : }
33008 :
33009 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33010 : {
33011 0 : DATA_BLOB blob;
33012 0 : Py_ssize_t blob_length = 0;
33013 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33014 0 : PyObject *bigendian_obj = NULL;
33015 0 : PyObject *ndr64_obj = NULL;
33016 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33017 0 : PyObject *allow_remaining_obj = NULL;
33018 0 : bool allow_remaining = false;
33019 :
33020 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33021 : discard_const_p(char *, kwnames),
33022 : &blob.data, &blob_length,
33023 : &bigendian_obj,
33024 : &ndr64_obj,
33025 : &allow_remaining_obj)) {
33026 0 : return NULL;
33027 : }
33028 0 : blob.length = blob_length;
33029 :
33030 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33031 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33032 : }
33033 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33034 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33035 : }
33036 :
33037 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33038 0 : allow_remaining = true;
33039 : }
33040 :
33041 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33042 : }
33043 :
33044 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33045 : {
33046 0 : DATA_BLOB blob;
33047 0 : Py_ssize_t blob_length = 0;
33048 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33049 0 : PyObject *bigendian_obj = NULL;
33050 0 : PyObject *ndr64_obj = NULL;
33051 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33052 0 : PyObject *allow_remaining_obj = NULL;
33053 0 : bool allow_remaining = false;
33054 :
33055 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33056 : discard_const_p(char *, kwnames),
33057 : &blob.data, &blob_length,
33058 : &bigendian_obj,
33059 : &ndr64_obj,
33060 : &allow_remaining_obj)) {
33061 0 : return NULL;
33062 : }
33063 0 : blob.length = blob_length;
33064 :
33065 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33066 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33067 : }
33068 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33069 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33070 : }
33071 :
33072 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33073 0 : allow_remaining = true;
33074 : }
33075 :
33076 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33077 : }
33078 :
33079 0 : static PyObject *py_lsa_StorePrivateData_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33080 : {
33081 0 : const struct ndr_interface_call *call = NULL;
33082 0 : struct lsa_StorePrivateData *object = (struct lsa_StorePrivateData *)pytalloc_get_ptr(py_obj);
33083 0 : PyObject *ret;
33084 0 : char *retstr;
33085 :
33086 0 : if (ndr_table_lsarpc.num_calls < 43) {
33087 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_print");
33088 0 : return NULL;
33089 : }
33090 0 : call = &ndr_table_lsarpc.calls[42];
33091 :
33092 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33093 0 : ret = PyUnicode_FromString(retstr);
33094 0 : TALLOC_FREE(retstr);
33095 :
33096 0 : return ret;
33097 : }
33098 :
33099 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33100 : {
33101 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_in", NDR_IN);
33102 : }
33103 :
33104 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33105 : {
33106 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_out", NDR_OUT);
33107 : }
33108 :
33109 : static PyMethodDef py_lsa_StorePrivateData_methods[] = {
33110 : { "opnum", (PyCFunction)py_lsa_StorePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
33111 : "lsa.StorePrivateData.opnum() -> 42 (0x2a) " },
33112 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33113 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33114 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33115 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33116 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33117 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33118 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33119 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33120 : { "__ndr_print_in__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33121 : { "__ndr_print_out__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33122 : { NULL, NULL, 0, NULL }
33123 : };
33124 :
33125 :
33126 : static PyTypeObject lsa_StorePrivateData_Type = {
33127 : PyVarObject_HEAD_INIT(NULL, 0)
33128 : .tp_name = "lsa.StorePrivateData",
33129 : .tp_getset = py_lsa_StorePrivateData_getsetters,
33130 : .tp_methods = py_lsa_StorePrivateData_methods,
33131 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33132 : .tp_new = py_lsa_StorePrivateData_new,
33133 : };
33134 :
33135 0 : static bool pack_py_lsa_StorePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_StorePrivateData *r)
33136 : {
33137 0 : PyObject *py_handle;
33138 0 : PyObject *py_name;
33139 0 : PyObject *py_val;
33140 0 : const char *kwnames[] = {
33141 : "handle", "name", "val", NULL
33142 : };
33143 :
33144 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_StorePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
33145 0 : return false;
33146 : }
33147 :
33148 0 : if (py_handle == NULL) {
33149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
33150 0 : return false;
33151 : }
33152 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33153 0 : if (r->in.handle == NULL) {
33154 0 : PyErr_NoMemory();
33155 0 : return false;
33156 : }
33157 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33158 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33159 0 : PyErr_NoMemory();
33160 0 : return false;
33161 : }
33162 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33163 0 : if (py_name == NULL) {
33164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
33165 0 : return false;
33166 : }
33167 0 : r->in.name = talloc_ptrtype(r, r->in.name);
33168 0 : if (r->in.name == NULL) {
33169 0 : PyErr_NoMemory();
33170 0 : return false;
33171 : }
33172 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
33173 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
33174 0 : PyErr_NoMemory();
33175 0 : return false;
33176 : }
33177 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
33178 0 : if (py_val == NULL) {
33179 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.val");
33180 0 : return false;
33181 : }
33182 0 : if (py_val == Py_None) {
33183 0 : r->in.val = NULL;
33184 : } else {
33185 0 : r->in.val = NULL;
33186 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
33187 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
33188 0 : PyErr_NoMemory();
33189 0 : return false;
33190 : }
33191 0 : r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
33192 : }
33193 0 : return true;
33194 : }
33195 :
33196 0 : static PyObject *unpack_py_lsa_StorePrivateData_args_out(struct lsa_StorePrivateData *r)
33197 : {
33198 0 : PyObject *result;
33199 0 : result = Py_None;
33200 0 : Py_INCREF(result);
33201 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33202 0 : PyErr_SetNTSTATUS(r->out.result);
33203 0 : return NULL;
33204 : }
33205 :
33206 0 : return result;
33207 : }
33208 :
33209 :
33210 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_handle(PyObject *obj, void *closure)
33211 : {
33212 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33213 0 : PyObject *py_handle;
33214 0 : if (object->in.handle == NULL) {
33215 0 : Py_RETURN_NONE;
33216 : }
33217 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
33218 0 : return py_handle;
33219 : }
33220 :
33221 0 : static int py_lsa_RetrievePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33222 : {
33223 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33224 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
33225 0 : if (value == NULL) {
33226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
33227 0 : return -1;
33228 : }
33229 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
33230 0 : if (object->in.handle == NULL) {
33231 0 : PyErr_NoMemory();
33232 0 : return -1;
33233 : }
33234 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33235 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33236 0 : PyErr_NoMemory();
33237 0 : return -1;
33238 : }
33239 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33240 0 : return 0;
33241 : }
33242 :
33243 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_name(PyObject *obj, void *closure)
33244 : {
33245 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33246 0 : PyObject *py_name;
33247 0 : if (object->in.name == NULL) {
33248 0 : Py_RETURN_NONE;
33249 : }
33250 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
33251 0 : return py_name;
33252 : }
33253 :
33254 0 : static int py_lsa_RetrievePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
33255 : {
33256 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33257 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
33258 0 : if (value == NULL) {
33259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
33260 0 : return -1;
33261 : }
33262 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
33263 0 : if (object->in.name == NULL) {
33264 0 : PyErr_NoMemory();
33265 0 : return -1;
33266 : }
33267 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
33268 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33269 0 : PyErr_NoMemory();
33270 0 : return -1;
33271 : }
33272 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
33273 0 : return 0;
33274 : }
33275 :
33276 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_val(PyObject *obj, void *closure)
33277 : {
33278 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33279 0 : PyObject *py_val;
33280 0 : if (object->in.val == NULL) {
33281 0 : Py_RETURN_NONE;
33282 : }
33283 0 : if (*object->in.val == NULL) {
33284 0 : py_val = Py_None;
33285 0 : Py_INCREF(py_val);
33286 : } else {
33287 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->in.val, *object->in.val);
33288 : }
33289 0 : return py_val;
33290 : }
33291 :
33292 0 : static int py_lsa_RetrievePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
33293 : {
33294 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33295 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
33296 0 : if (value == NULL) {
33297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.val");
33298 0 : return -1;
33299 : }
33300 0 : object->in.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.val);
33301 0 : if (object->in.val == NULL) {
33302 0 : PyErr_NoMemory();
33303 0 : return -1;
33304 : }
33305 0 : if (value == Py_None) {
33306 0 : *object->in.val = NULL;
33307 : } else {
33308 0 : *object->in.val = NULL;
33309 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
33310 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33311 0 : PyErr_NoMemory();
33312 0 : return -1;
33313 : }
33314 0 : *object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
33315 : }
33316 0 : return 0;
33317 : }
33318 :
33319 0 : static PyObject *py_lsa_RetrievePrivateData_out_get_val(PyObject *obj, void *closure)
33320 : {
33321 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33322 0 : PyObject *py_val;
33323 0 : if (object->out.val == NULL) {
33324 0 : Py_RETURN_NONE;
33325 : }
33326 0 : if (*object->out.val == NULL) {
33327 0 : py_val = Py_None;
33328 0 : Py_INCREF(py_val);
33329 : } else {
33330 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->out.val, *object->out.val);
33331 : }
33332 0 : return py_val;
33333 : }
33334 :
33335 0 : static int py_lsa_RetrievePrivateData_out_set_val(PyObject *py_obj, PyObject *value, void *closure)
33336 : {
33337 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33338 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.val));
33339 0 : if (value == NULL) {
33340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.val");
33341 0 : return -1;
33342 : }
33343 0 : object->out.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.val);
33344 0 : if (object->out.val == NULL) {
33345 0 : PyErr_NoMemory();
33346 0 : return -1;
33347 : }
33348 0 : if (value == Py_None) {
33349 0 : *object->out.val = NULL;
33350 : } else {
33351 0 : *object->out.val = NULL;
33352 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
33353 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33354 0 : PyErr_NoMemory();
33355 0 : return -1;
33356 : }
33357 0 : *object->out.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
33358 : }
33359 0 : return 0;
33360 : }
33361 :
33362 0 : static PyObject *py_lsa_RetrievePrivateData_get_result(PyObject *obj, void *closure)
33363 : {
33364 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(obj);
33365 0 : PyObject *py_result;
33366 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33367 0 : return py_result;
33368 : }
33369 :
33370 0 : static int py_lsa_RetrievePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
33371 : {
33372 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33373 0 : if (value == NULL) {
33374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33375 0 : return -1;
33376 : }
33377 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33378 0 : return 0;
33379 : }
33380 :
33381 : static PyGetSetDef py_lsa_RetrievePrivateData_getsetters[] = {
33382 : {
33383 : .name = discard_const_p(char, "in_handle"),
33384 : .get = py_lsa_RetrievePrivateData_in_get_handle,
33385 : .set = py_lsa_RetrievePrivateData_in_set_handle,
33386 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33387 : },
33388 : {
33389 : .name = discard_const_p(char, "in_name"),
33390 : .get = py_lsa_RetrievePrivateData_in_get_name,
33391 : .set = py_lsa_RetrievePrivateData_in_set_name,
33392 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
33393 : },
33394 : {
33395 : .name = discard_const_p(char, "in_val"),
33396 : .get = py_lsa_RetrievePrivateData_in_get_val,
33397 : .set = py_lsa_RetrievePrivateData_in_set_val,
33398 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
33399 : },
33400 : {
33401 : .name = discard_const_p(char, "out_val"),
33402 : .get = py_lsa_RetrievePrivateData_out_get_val,
33403 : .set = py_lsa_RetrievePrivateData_out_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, "result"),
33408 : .get = py_lsa_RetrievePrivateData_get_result,
33409 : .set = py_lsa_RetrievePrivateData_set_result,
33410 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33411 : },
33412 : { .name = NULL }
33413 : };
33414 :
33415 0 : static PyObject *py_lsa_RetrievePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33416 : {
33417 0 : PyObject *self = pytalloc_new(struct lsa_RetrievePrivateData, type);
33418 0 : struct lsa_RetrievePrivateData *_self = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(self);
33419 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33420 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
33421 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
33422 : /* a pointer to a NULL pointer */
33423 0 : _self->in.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
33424 0 : _self->out.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
33425 0 : return self;
33426 : }
33427 :
33428 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33429 : {
33430 :
33431 :
33432 0 : return PyLong_FromLong(43);
33433 : }
33434 :
33435 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
33436 : {
33437 0 : const struct ndr_interface_call *call = NULL;
33438 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33439 0 : PyObject *ret = NULL;
33440 0 : struct ndr_push *push = NULL;
33441 0 : DATA_BLOB blob;
33442 0 : enum ndr_err_code err;
33443 :
33444 0 : if (ndr_table_lsarpc.num_calls < 44) {
33445 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_pack");
33446 0 : return NULL;
33447 : }
33448 0 : call = &ndr_table_lsarpc.calls[43];
33449 :
33450 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33451 0 : if (push == NULL) {
33452 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33453 0 : return NULL;
33454 : }
33455 :
33456 0 : push->flags |= ndr_push_flags;
33457 :
33458 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33459 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33460 0 : TALLOC_FREE(push);
33461 0 : PyErr_SetNdrError(err);
33462 0 : return NULL;
33463 : }
33464 0 : blob = ndr_push_blob(push);
33465 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33466 0 : TALLOC_FREE(push);
33467 0 : return ret;
33468 : }
33469 :
33470 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33471 : {
33472 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33473 0 : PyObject *bigendian_obj = NULL;
33474 0 : PyObject *ndr64_obj = NULL;
33475 0 : libndr_flags ndr_push_flags = 0;
33476 :
33477 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33478 : discard_const_p(char *, kwnames),
33479 : &bigendian_obj,
33480 : &ndr64_obj)) {
33481 0 : return NULL;
33482 : }
33483 :
33484 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33485 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33486 : }
33487 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33488 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33489 : }
33490 :
33491 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33492 : }
33493 :
33494 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33495 : {
33496 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33497 0 : PyObject *bigendian_obj = NULL;
33498 0 : PyObject *ndr64_obj = NULL;
33499 0 : libndr_flags ndr_push_flags = 0;
33500 :
33501 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33502 : discard_const_p(char *, kwnames),
33503 : &bigendian_obj,
33504 : &ndr64_obj)) {
33505 0 : return NULL;
33506 : }
33507 :
33508 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33509 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33510 : }
33511 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33512 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33513 : }
33514 :
33515 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33516 : }
33517 :
33518 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
33519 : {
33520 0 : const struct ndr_interface_call *call = NULL;
33521 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33522 0 : struct ndr_pull *pull = NULL;
33523 0 : enum ndr_err_code err;
33524 :
33525 0 : if (ndr_table_lsarpc.num_calls < 44) {
33526 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_unpack");
33527 0 : return NULL;
33528 : }
33529 0 : call = &ndr_table_lsarpc.calls[43];
33530 :
33531 0 : pull = ndr_pull_init_blob(blob, object);
33532 0 : if (pull == NULL) {
33533 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33534 0 : return NULL;
33535 : }
33536 :
33537 0 : pull->flags |= ndr_pull_flags;
33538 :
33539 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33540 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33541 0 : TALLOC_FREE(pull);
33542 0 : PyErr_SetNdrError(err);
33543 0 : return NULL;
33544 : }
33545 0 : if (!allow_remaining) {
33546 0 : uint32_t highest_ofs;
33547 :
33548 0 : if (pull->offset > pull->relative_highest_offset) {
33549 0 : highest_ofs = pull->offset;
33550 : } else {
33551 0 : highest_ofs = pull->relative_highest_offset;
33552 : }
33553 0 : if (highest_ofs < pull->data_size) {
33554 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33555 : "not all bytes consumed ofs[%u] size[%u]",
33556 : highest_ofs, pull->data_size);
33557 0 : TALLOC_FREE(pull);
33558 0 : PyErr_SetNdrError(err);
33559 0 : return NULL;
33560 : }
33561 : }
33562 :
33563 0 : TALLOC_FREE(pull);
33564 0 : Py_RETURN_NONE;
33565 : }
33566 :
33567 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33568 : {
33569 0 : DATA_BLOB blob;
33570 0 : Py_ssize_t blob_length = 0;
33571 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33572 0 : PyObject *bigendian_obj = NULL;
33573 0 : PyObject *ndr64_obj = NULL;
33574 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33575 0 : PyObject *allow_remaining_obj = NULL;
33576 0 : bool allow_remaining = false;
33577 :
33578 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33579 : discard_const_p(char *, kwnames),
33580 : &blob.data, &blob_length,
33581 : &bigendian_obj,
33582 : &ndr64_obj,
33583 : &allow_remaining_obj)) {
33584 0 : return NULL;
33585 : }
33586 0 : blob.length = blob_length;
33587 :
33588 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33589 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33590 : }
33591 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33592 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33593 : }
33594 :
33595 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33596 0 : allow_remaining = true;
33597 : }
33598 :
33599 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33600 : }
33601 :
33602 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33603 : {
33604 0 : DATA_BLOB blob;
33605 0 : Py_ssize_t blob_length = 0;
33606 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33607 0 : PyObject *bigendian_obj = NULL;
33608 0 : PyObject *ndr64_obj = NULL;
33609 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33610 0 : PyObject *allow_remaining_obj = NULL;
33611 0 : bool allow_remaining = false;
33612 :
33613 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33614 : discard_const_p(char *, kwnames),
33615 : &blob.data, &blob_length,
33616 : &bigendian_obj,
33617 : &ndr64_obj,
33618 : &allow_remaining_obj)) {
33619 0 : return NULL;
33620 : }
33621 0 : blob.length = blob_length;
33622 :
33623 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33624 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33625 : }
33626 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33627 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33628 : }
33629 :
33630 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33631 0 : allow_remaining = true;
33632 : }
33633 :
33634 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33635 : }
33636 :
33637 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33638 : {
33639 0 : const struct ndr_interface_call *call = NULL;
33640 0 : struct lsa_RetrievePrivateData *object = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(py_obj);
33641 0 : PyObject *ret;
33642 0 : char *retstr;
33643 :
33644 0 : if (ndr_table_lsarpc.num_calls < 44) {
33645 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_print");
33646 0 : return NULL;
33647 : }
33648 0 : call = &ndr_table_lsarpc.calls[43];
33649 :
33650 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33651 0 : ret = PyUnicode_FromString(retstr);
33652 0 : TALLOC_FREE(retstr);
33653 :
33654 0 : return ret;
33655 : }
33656 :
33657 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33658 : {
33659 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_in", NDR_IN);
33660 : }
33661 :
33662 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33663 : {
33664 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_out", NDR_OUT);
33665 : }
33666 :
33667 : static PyMethodDef py_lsa_RetrievePrivateData_methods[] = {
33668 : { "opnum", (PyCFunction)py_lsa_RetrievePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
33669 : "lsa.RetrievePrivateData.opnum() -> 43 (0x2b) " },
33670 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33671 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33672 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33673 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33674 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33675 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33676 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33677 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33678 : { "__ndr_print_in__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33679 : { "__ndr_print_out__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33680 : { NULL, NULL, 0, NULL }
33681 : };
33682 :
33683 :
33684 : static PyTypeObject lsa_RetrievePrivateData_Type = {
33685 : PyVarObject_HEAD_INIT(NULL, 0)
33686 : .tp_name = "lsa.RetrievePrivateData",
33687 : .tp_getset = py_lsa_RetrievePrivateData_getsetters,
33688 : .tp_methods = py_lsa_RetrievePrivateData_methods,
33689 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33690 : .tp_new = py_lsa_RetrievePrivateData_new,
33691 : };
33692 :
33693 0 : static bool pack_py_lsa_RetrievePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_RetrievePrivateData *r)
33694 : {
33695 0 : PyObject *py_handle;
33696 0 : PyObject *py_name;
33697 0 : PyObject *py_val;
33698 0 : const char *kwnames[] = {
33699 : "handle", "name", "val", NULL
33700 : };
33701 :
33702 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RetrievePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
33703 0 : return false;
33704 : }
33705 :
33706 0 : if (py_handle == NULL) {
33707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
33708 0 : return false;
33709 : }
33710 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33711 0 : if (r->in.handle == NULL) {
33712 0 : PyErr_NoMemory();
33713 0 : return false;
33714 : }
33715 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33716 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33717 0 : PyErr_NoMemory();
33718 0 : return false;
33719 : }
33720 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33721 0 : if (py_name == NULL) {
33722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
33723 0 : return false;
33724 : }
33725 0 : r->in.name = talloc_ptrtype(r, r->in.name);
33726 0 : if (r->in.name == NULL) {
33727 0 : PyErr_NoMemory();
33728 0 : return false;
33729 : }
33730 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
33731 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
33732 0 : PyErr_NoMemory();
33733 0 : return false;
33734 : }
33735 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
33736 0 : if (py_val == NULL) {
33737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.val");
33738 0 : return false;
33739 : }
33740 0 : r->in.val = talloc_ptrtype(r, r->in.val);
33741 0 : if (r->in.val == NULL) {
33742 0 : PyErr_NoMemory();
33743 0 : return false;
33744 : }
33745 0 : if (py_val == Py_None) {
33746 0 : *r->in.val = NULL;
33747 : } else {
33748 0 : *r->in.val = NULL;
33749 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
33750 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
33751 0 : PyErr_NoMemory();
33752 0 : return false;
33753 : }
33754 0 : *r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
33755 : }
33756 0 : return true;
33757 : }
33758 :
33759 0 : static PyObject *unpack_py_lsa_RetrievePrivateData_args_out(struct lsa_RetrievePrivateData *r)
33760 : {
33761 0 : PyObject *result;
33762 0 : PyObject *py_val;
33763 0 : if (*r->out.val == NULL) {
33764 0 : py_val = Py_None;
33765 0 : Py_INCREF(py_val);
33766 : } else {
33767 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *r->out.val, *r->out.val);
33768 : }
33769 0 : result = py_val;
33770 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33771 0 : PyErr_SetNTSTATUS(r->out.result);
33772 0 : return NULL;
33773 : }
33774 :
33775 0 : return result;
33776 : }
33777 :
33778 :
33779 0 : static PyObject *py_lsa_OpenPolicy2_in_get_system_name(PyObject *obj, void *closure)
33780 : {
33781 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33782 0 : PyObject *py_system_name;
33783 0 : if (object->in.system_name == NULL) {
33784 0 : Py_RETURN_NONE;
33785 : }
33786 0 : if (object->in.system_name == NULL) {
33787 0 : py_system_name = Py_None;
33788 0 : Py_INCREF(py_system_name);
33789 : } else {
33790 0 : if (object->in.system_name == NULL) {
33791 0 : py_system_name = Py_None;
33792 0 : Py_INCREF(py_system_name);
33793 : } else {
33794 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
33795 : }
33796 : }
33797 0 : return py_system_name;
33798 : }
33799 :
33800 0 : static int py_lsa_OpenPolicy2_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
33801 : {
33802 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33803 0 : if (value == NULL) {
33804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
33805 0 : return -1;
33806 : }
33807 0 : if (value == Py_None) {
33808 0 : object->in.system_name = NULL;
33809 : } else {
33810 0 : object->in.system_name = NULL;
33811 : {
33812 0 : const char *test_str;
33813 0 : const char *talloc_str;
33814 0 : PyObject *unicode = NULL;
33815 0 : if (PyUnicode_Check(value)) {
33816 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
33817 0 : if (unicode == NULL) {
33818 0 : return -1;
33819 : }
33820 0 : test_str = PyBytes_AS_STRING(unicode);
33821 0 : } else if (PyBytes_Check(value)) {
33822 0 : test_str = PyBytes_AS_STRING(value);
33823 : } else {
33824 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
33825 0 : return -1;
33826 : }
33827 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
33828 0 : if (unicode != NULL) {
33829 0 : Py_DECREF(unicode);
33830 : }
33831 0 : if (talloc_str == NULL) {
33832 0 : PyErr_NoMemory();
33833 0 : return -1;
33834 : }
33835 0 : object->in.system_name = talloc_str;
33836 : }
33837 : }
33838 0 : return 0;
33839 : }
33840 :
33841 0 : static PyObject *py_lsa_OpenPolicy2_in_get_attr(PyObject *obj, void *closure)
33842 : {
33843 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33844 0 : PyObject *py_attr;
33845 0 : if (object->in.attr == NULL) {
33846 0 : Py_RETURN_NONE;
33847 : }
33848 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
33849 0 : return py_attr;
33850 : }
33851 :
33852 0 : static int py_lsa_OpenPolicy2_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
33853 : {
33854 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33855 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
33856 0 : if (value == NULL) {
33857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.attr");
33858 0 : return -1;
33859 : }
33860 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
33861 0 : if (object->in.attr == NULL) {
33862 0 : PyErr_NoMemory();
33863 0 : return -1;
33864 : }
33865 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
33866 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33867 0 : PyErr_NoMemory();
33868 0 : return -1;
33869 : }
33870 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
33871 0 : return 0;
33872 : }
33873 :
33874 0 : static PyObject *py_lsa_OpenPolicy2_in_get_access_mask(PyObject *obj, void *closure)
33875 : {
33876 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33877 0 : PyObject *py_access_mask;
33878 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
33879 0 : return py_access_mask;
33880 : }
33881 :
33882 0 : static int py_lsa_OpenPolicy2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
33883 : {
33884 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33885 0 : if (value == NULL) {
33886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
33887 0 : return -1;
33888 : }
33889 : {
33890 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
33891 0 : if (PyLong_Check(value)) {
33892 0 : unsigned long long test_var;
33893 0 : test_var = PyLong_AsUnsignedLongLong(value);
33894 0 : if (PyErr_Occurred() != NULL) {
33895 0 : return -1;
33896 : }
33897 0 : if (test_var > uint_max) {
33898 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33899 : PyLong_Type.tp_name, uint_max, test_var);
33900 0 : return -1;
33901 : }
33902 0 : object->in.access_mask = test_var;
33903 : } else {
33904 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33905 : PyLong_Type.tp_name);
33906 0 : return -1;
33907 : }
33908 : }
33909 0 : return 0;
33910 : }
33911 :
33912 0 : static PyObject *py_lsa_OpenPolicy2_out_get_handle(PyObject *obj, void *closure)
33913 : {
33914 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33915 0 : PyObject *py_handle;
33916 0 : if (object->out.handle == NULL) {
33917 0 : Py_RETURN_NONE;
33918 : }
33919 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
33920 0 : return py_handle;
33921 : }
33922 :
33923 0 : static int py_lsa_OpenPolicy2_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33924 : {
33925 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33926 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
33927 0 : if (value == NULL) {
33928 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
33929 0 : return -1;
33930 : }
33931 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
33932 0 : if (object->out.handle == NULL) {
33933 0 : PyErr_NoMemory();
33934 0 : return -1;
33935 : }
33936 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33937 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33938 0 : PyErr_NoMemory();
33939 0 : return -1;
33940 : }
33941 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33942 0 : return 0;
33943 : }
33944 :
33945 0 : static PyObject *py_lsa_OpenPolicy2_get_result(PyObject *obj, void *closure)
33946 : {
33947 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(obj);
33948 0 : PyObject *py_result;
33949 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33950 0 : return py_result;
33951 : }
33952 :
33953 0 : static int py_lsa_OpenPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
33954 : {
33955 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
33956 0 : if (value == NULL) {
33957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33958 0 : return -1;
33959 : }
33960 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33961 0 : return 0;
33962 : }
33963 :
33964 : static PyGetSetDef py_lsa_OpenPolicy2_getsetters[] = {
33965 : {
33966 : .name = discard_const_p(char, "in_system_name"),
33967 : .get = py_lsa_OpenPolicy2_in_get_system_name,
33968 : .set = py_lsa_OpenPolicy2_in_set_system_name,
33969 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
33970 : },
33971 : {
33972 : .name = discard_const_p(char, "in_attr"),
33973 : .get = py_lsa_OpenPolicy2_in_get_attr,
33974 : .set = py_lsa_OpenPolicy2_in_set_attr,
33975 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
33976 : },
33977 : {
33978 : .name = discard_const_p(char, "in_access_mask"),
33979 : .get = py_lsa_OpenPolicy2_in_get_access_mask,
33980 : .set = py_lsa_OpenPolicy2_in_set_access_mask,
33981 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
33982 : },
33983 : {
33984 : .name = discard_const_p(char, "out_handle"),
33985 : .get = py_lsa_OpenPolicy2_out_get_handle,
33986 : .set = py_lsa_OpenPolicy2_out_set_handle,
33987 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33988 : },
33989 : {
33990 : .name = discard_const_p(char, "result"),
33991 : .get = py_lsa_OpenPolicy2_get_result,
33992 : .set = py_lsa_OpenPolicy2_set_result,
33993 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33994 : },
33995 : { .name = NULL }
33996 : };
33997 :
33998 0 : static PyObject *py_lsa_OpenPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33999 : {
34000 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy2, type);
34001 0 : struct lsa_OpenPolicy2 *_self = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(self);
34002 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34003 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
34004 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
34005 0 : return self;
34006 : }
34007 :
34008 0 : static PyObject *py_lsa_OpenPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34009 : {
34010 :
34011 :
34012 0 : return PyLong_FromLong(44);
34013 : }
34014 :
34015 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34016 : {
34017 0 : const struct ndr_interface_call *call = NULL;
34018 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34019 0 : PyObject *ret = NULL;
34020 0 : struct ndr_push *push = NULL;
34021 0 : DATA_BLOB blob;
34022 0 : enum ndr_err_code err;
34023 :
34024 0 : if (ndr_table_lsarpc.num_calls < 45) {
34025 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_pack");
34026 0 : return NULL;
34027 : }
34028 0 : call = &ndr_table_lsarpc.calls[44];
34029 :
34030 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34031 0 : if (push == NULL) {
34032 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34033 0 : return NULL;
34034 : }
34035 :
34036 0 : push->flags |= ndr_push_flags;
34037 :
34038 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34039 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34040 0 : TALLOC_FREE(push);
34041 0 : PyErr_SetNdrError(err);
34042 0 : return NULL;
34043 : }
34044 0 : blob = ndr_push_blob(push);
34045 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34046 0 : TALLOC_FREE(push);
34047 0 : return ret;
34048 : }
34049 :
34050 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34051 : {
34052 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34053 0 : PyObject *bigendian_obj = NULL;
34054 0 : PyObject *ndr64_obj = NULL;
34055 0 : libndr_flags ndr_push_flags = 0;
34056 :
34057 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34058 : discard_const_p(char *, kwnames),
34059 : &bigendian_obj,
34060 : &ndr64_obj)) {
34061 0 : return NULL;
34062 : }
34063 :
34064 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34065 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34066 : }
34067 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34068 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34069 : }
34070 :
34071 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34072 : }
34073 :
34074 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34075 : {
34076 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34077 0 : PyObject *bigendian_obj = NULL;
34078 0 : PyObject *ndr64_obj = NULL;
34079 0 : libndr_flags ndr_push_flags = 0;
34080 :
34081 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34082 : discard_const_p(char *, kwnames),
34083 : &bigendian_obj,
34084 : &ndr64_obj)) {
34085 0 : return NULL;
34086 : }
34087 :
34088 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34089 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34090 : }
34091 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34092 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34093 : }
34094 :
34095 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34096 : }
34097 :
34098 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
34099 : {
34100 0 : const struct ndr_interface_call *call = NULL;
34101 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34102 0 : struct ndr_pull *pull = NULL;
34103 0 : enum ndr_err_code err;
34104 :
34105 0 : if (ndr_table_lsarpc.num_calls < 45) {
34106 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_unpack");
34107 0 : return NULL;
34108 : }
34109 0 : call = &ndr_table_lsarpc.calls[44];
34110 :
34111 0 : pull = ndr_pull_init_blob(blob, object);
34112 0 : if (pull == NULL) {
34113 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34114 0 : return NULL;
34115 : }
34116 :
34117 0 : pull->flags |= ndr_pull_flags;
34118 :
34119 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34120 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34121 0 : TALLOC_FREE(pull);
34122 0 : PyErr_SetNdrError(err);
34123 0 : return NULL;
34124 : }
34125 0 : if (!allow_remaining) {
34126 0 : uint32_t highest_ofs;
34127 :
34128 0 : if (pull->offset > pull->relative_highest_offset) {
34129 0 : highest_ofs = pull->offset;
34130 : } else {
34131 0 : highest_ofs = pull->relative_highest_offset;
34132 : }
34133 0 : if (highest_ofs < pull->data_size) {
34134 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34135 : "not all bytes consumed ofs[%u] size[%u]",
34136 : highest_ofs, pull->data_size);
34137 0 : TALLOC_FREE(pull);
34138 0 : PyErr_SetNdrError(err);
34139 0 : return NULL;
34140 : }
34141 : }
34142 :
34143 0 : TALLOC_FREE(pull);
34144 0 : Py_RETURN_NONE;
34145 : }
34146 :
34147 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34148 : {
34149 0 : DATA_BLOB blob;
34150 0 : Py_ssize_t blob_length = 0;
34151 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34152 0 : PyObject *bigendian_obj = NULL;
34153 0 : PyObject *ndr64_obj = NULL;
34154 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34155 0 : PyObject *allow_remaining_obj = NULL;
34156 0 : bool allow_remaining = false;
34157 :
34158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34159 : discard_const_p(char *, kwnames),
34160 : &blob.data, &blob_length,
34161 : &bigendian_obj,
34162 : &ndr64_obj,
34163 : &allow_remaining_obj)) {
34164 0 : return NULL;
34165 : }
34166 0 : blob.length = blob_length;
34167 :
34168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34169 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34170 : }
34171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34172 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34173 : }
34174 :
34175 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34176 0 : allow_remaining = true;
34177 : }
34178 :
34179 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34180 : }
34181 :
34182 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34183 : {
34184 0 : DATA_BLOB blob;
34185 0 : Py_ssize_t blob_length = 0;
34186 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34187 0 : PyObject *bigendian_obj = NULL;
34188 0 : PyObject *ndr64_obj = NULL;
34189 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34190 0 : PyObject *allow_remaining_obj = NULL;
34191 0 : bool allow_remaining = false;
34192 :
34193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34194 : discard_const_p(char *, kwnames),
34195 : &blob.data, &blob_length,
34196 : &bigendian_obj,
34197 : &ndr64_obj,
34198 : &allow_remaining_obj)) {
34199 0 : return NULL;
34200 : }
34201 0 : blob.length = blob_length;
34202 :
34203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34204 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34205 : }
34206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34207 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34208 : }
34209 :
34210 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34211 0 : allow_remaining = true;
34212 : }
34213 :
34214 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34215 : }
34216 :
34217 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34218 : {
34219 0 : const struct ndr_interface_call *call = NULL;
34220 0 : struct lsa_OpenPolicy2 *object = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(py_obj);
34221 0 : PyObject *ret;
34222 0 : char *retstr;
34223 :
34224 0 : if (ndr_table_lsarpc.num_calls < 45) {
34225 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_print");
34226 0 : return NULL;
34227 : }
34228 0 : call = &ndr_table_lsarpc.calls[44];
34229 :
34230 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34231 0 : ret = PyUnicode_FromString(retstr);
34232 0 : TALLOC_FREE(retstr);
34233 :
34234 0 : return ret;
34235 : }
34236 :
34237 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34238 : {
34239 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_in", NDR_IN);
34240 : }
34241 :
34242 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34243 : {
34244 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_out", NDR_OUT);
34245 : }
34246 :
34247 : static PyMethodDef py_lsa_OpenPolicy2_methods[] = {
34248 : { "opnum", (PyCFunction)py_lsa_OpenPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
34249 : "lsa.OpenPolicy2.opnum() -> 44 (0x2c) " },
34250 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34251 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34252 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34253 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34254 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34255 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34256 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34257 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34258 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34259 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34260 : { NULL, NULL, 0, NULL }
34261 : };
34262 :
34263 :
34264 : static PyTypeObject lsa_OpenPolicy2_Type = {
34265 : PyVarObject_HEAD_INIT(NULL, 0)
34266 : .tp_name = "lsa.OpenPolicy2",
34267 : .tp_getset = py_lsa_OpenPolicy2_getsetters,
34268 : .tp_methods = py_lsa_OpenPolicy2_methods,
34269 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34270 : .tp_new = py_lsa_OpenPolicy2_new,
34271 : };
34272 :
34273 234 : static bool pack_py_lsa_OpenPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy2 *r)
34274 : {
34275 2 : PyObject *py_system_name;
34276 2 : PyObject *py_attr;
34277 2 : PyObject *py_access_mask;
34278 234 : const char *kwnames[] = {
34279 : "system_name", "attr", "access_mask", NULL
34280 : };
34281 :
34282 234 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy2", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
34283 0 : return false;
34284 : }
34285 :
34286 234 : if (py_system_name == NULL) {
34287 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
34288 0 : return false;
34289 : }
34290 234 : if (py_system_name == Py_None) {
34291 0 : r->in.system_name = NULL;
34292 : } else {
34293 234 : r->in.system_name = NULL;
34294 : {
34295 2 : const char *test_str;
34296 2 : const char *talloc_str;
34297 234 : PyObject *unicode = NULL;
34298 234 : if (PyUnicode_Check(py_system_name)) {
34299 234 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
34300 234 : if (unicode == NULL) {
34301 0 : return false;
34302 : }
34303 234 : test_str = PyBytes_AS_STRING(unicode);
34304 0 : } else if (PyBytes_Check(py_system_name)) {
34305 0 : test_str = PyBytes_AS_STRING(py_system_name);
34306 : } else {
34307 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
34308 0 : return false;
34309 : }
34310 234 : talloc_str = talloc_strdup(r, test_str);
34311 234 : if (unicode != NULL) {
34312 128 : Py_DECREF(unicode);
34313 : }
34314 234 : if (talloc_str == NULL) {
34315 0 : PyErr_NoMemory();
34316 0 : return false;
34317 : }
34318 234 : r->in.system_name = talloc_str;
34319 : }
34320 : }
34321 234 : if (py_attr == NULL) {
34322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.attr");
34323 0 : return false;
34324 : }
34325 234 : r->in.attr = talloc_ptrtype(r, r->in.attr);
34326 234 : if (r->in.attr == NULL) {
34327 0 : PyErr_NoMemory();
34328 0 : return false;
34329 : }
34330 234 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
34331 234 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
34332 0 : PyErr_NoMemory();
34333 0 : return false;
34334 : }
34335 234 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
34336 234 : if (py_access_mask == NULL) {
34337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
34338 0 : return false;
34339 : }
34340 : {
34341 234 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
34342 234 : if (PyLong_Check(py_access_mask)) {
34343 2 : unsigned long long test_var;
34344 234 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
34345 234 : if (PyErr_Occurred() != NULL) {
34346 0 : return false;
34347 : }
34348 234 : if (test_var > uint_max) {
34349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34350 : PyLong_Type.tp_name, uint_max, test_var);
34351 0 : return false;
34352 : }
34353 234 : r->in.access_mask = test_var;
34354 : } else {
34355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34356 : PyLong_Type.tp_name);
34357 0 : return false;
34358 : }
34359 : }
34360 234 : return true;
34361 : }
34362 :
34363 234 : static PyObject *unpack_py_lsa_OpenPolicy2_args_out(struct lsa_OpenPolicy2 *r)
34364 : {
34365 2 : PyObject *result;
34366 2 : PyObject *py_handle;
34367 234 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
34368 234 : result = py_handle;
34369 234 : if (NT_STATUS_IS_ERR(r->out.result)) {
34370 0 : PyErr_SetNTSTATUS(r->out.result);
34371 0 : return NULL;
34372 : }
34373 :
34374 232 : return result;
34375 : }
34376 :
34377 :
34378 0 : static PyObject *py_lsa_GetUserName_in_get_system_name(PyObject *obj, void *closure)
34379 : {
34380 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34381 0 : PyObject *py_system_name;
34382 0 : if (object->in.system_name == NULL) {
34383 0 : Py_RETURN_NONE;
34384 : }
34385 0 : if (object->in.system_name == NULL) {
34386 0 : py_system_name = Py_None;
34387 0 : Py_INCREF(py_system_name);
34388 : } else {
34389 0 : if (object->in.system_name == NULL) {
34390 0 : py_system_name = Py_None;
34391 0 : Py_INCREF(py_system_name);
34392 : } else {
34393 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
34394 : }
34395 : }
34396 0 : return py_system_name;
34397 : }
34398 :
34399 30 : static int py_lsa_GetUserName_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
34400 : {
34401 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34402 30 : if (value == NULL) {
34403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
34404 0 : return -1;
34405 : }
34406 30 : if (value == Py_None) {
34407 0 : object->in.system_name = NULL;
34408 : } else {
34409 30 : object->in.system_name = NULL;
34410 : {
34411 0 : const char *test_str;
34412 0 : const char *talloc_str;
34413 30 : PyObject *unicode = NULL;
34414 30 : if (PyUnicode_Check(value)) {
34415 30 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
34416 30 : if (unicode == NULL) {
34417 0 : return -1;
34418 : }
34419 30 : test_str = PyBytes_AS_STRING(unicode);
34420 0 : } else if (PyBytes_Check(value)) {
34421 0 : test_str = PyBytes_AS_STRING(value);
34422 : } else {
34423 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
34424 0 : return -1;
34425 : }
34426 30 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
34427 30 : if (unicode != NULL) {
34428 20 : Py_DECREF(unicode);
34429 : }
34430 30 : if (talloc_str == NULL) {
34431 0 : PyErr_NoMemory();
34432 0 : return -1;
34433 : }
34434 30 : object->in.system_name = talloc_str;
34435 : }
34436 : }
34437 30 : return 0;
34438 : }
34439 :
34440 0 : static PyObject *py_lsa_GetUserName_in_get_account_name(PyObject *obj, void *closure)
34441 : {
34442 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34443 0 : PyObject *py_account_name;
34444 0 : if (object->in.account_name == NULL) {
34445 0 : Py_RETURN_NONE;
34446 : }
34447 0 : if (*object->in.account_name == NULL) {
34448 0 : py_account_name = Py_None;
34449 0 : Py_INCREF(py_account_name);
34450 : } else {
34451 0 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.account_name, *object->in.account_name);
34452 : }
34453 0 : return py_account_name;
34454 : }
34455 :
34456 30 : static int py_lsa_GetUserName_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
34457 : {
34458 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34459 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name));
34460 30 : if (value == NULL) {
34461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
34462 0 : return -1;
34463 : }
34464 30 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
34465 30 : if (object->in.account_name == NULL) {
34466 0 : PyErr_NoMemory();
34467 0 : return -1;
34468 : }
34469 30 : if (value == Py_None) {
34470 30 : *object->in.account_name = NULL;
34471 : } else {
34472 0 : *object->in.account_name = NULL;
34473 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34474 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34475 0 : PyErr_NoMemory();
34476 0 : return -1;
34477 : }
34478 0 : *object->in.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
34479 : }
34480 30 : return 0;
34481 : }
34482 :
34483 294 : static PyObject *py_lsa_GetUserName_out_get_account_name(PyObject *obj, void *closure)
34484 : {
34485 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34486 0 : PyObject *py_account_name;
34487 294 : if (object->out.account_name == NULL) {
34488 0 : Py_RETURN_NONE;
34489 : }
34490 294 : if (*object->out.account_name == NULL) {
34491 0 : py_account_name = Py_None;
34492 0 : Py_INCREF(py_account_name);
34493 : } else {
34494 294 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.account_name, *object->out.account_name);
34495 : }
34496 294 : return py_account_name;
34497 : }
34498 :
34499 0 : static int py_lsa_GetUserName_out_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
34500 : {
34501 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34502 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.account_name));
34503 0 : if (value == NULL) {
34504 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.account_name");
34505 0 : return -1;
34506 : }
34507 0 : object->out.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.account_name);
34508 0 : if (object->out.account_name == NULL) {
34509 0 : PyErr_NoMemory();
34510 0 : return -1;
34511 : }
34512 0 : if (value == Py_None) {
34513 0 : *object->out.account_name = NULL;
34514 : } else {
34515 0 : *object->out.account_name = NULL;
34516 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34517 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34518 0 : PyErr_NoMemory();
34519 0 : return -1;
34520 : }
34521 0 : *object->out.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
34522 : }
34523 0 : return 0;
34524 : }
34525 :
34526 0 : static PyObject *py_lsa_GetUserName_in_get_authority_name(PyObject *obj, void *closure)
34527 : {
34528 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34529 0 : PyObject *py_authority_name;
34530 0 : if (object->in.authority_name == NULL) {
34531 0 : Py_RETURN_NONE;
34532 : }
34533 0 : if (object->in.authority_name == NULL) {
34534 0 : py_authority_name = Py_None;
34535 0 : Py_INCREF(py_authority_name);
34536 : } else {
34537 0 : if (*object->in.authority_name == NULL) {
34538 0 : py_authority_name = Py_None;
34539 0 : Py_INCREF(py_authority_name);
34540 : } else {
34541 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.authority_name, *object->in.authority_name);
34542 : }
34543 : }
34544 : {
34545 0 : PyObject *py_authority_name_level_0 = py_authority_name;
34546 0 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
34547 0 : Py_XDECREF(py_authority_name_level_0);
34548 : }
34549 0 : return py_authority_name;
34550 : }
34551 :
34552 30 : static int py_lsa_GetUserName_in_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
34553 : {
34554 30 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34555 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.authority_name));
34556 30 : if (value == NULL) {
34557 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.authority_name");
34558 0 : return -1;
34559 : }
34560 30 : if (value == Py_None) {
34561 0 : object->in.authority_name = NULL;
34562 : } else {
34563 30 : object->in.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.authority_name);
34564 30 : if (object->in.authority_name == NULL) {
34565 0 : PyErr_NoMemory();
34566 0 : return -1;
34567 : }
34568 30 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
34569 30 : if (value == NULL) {
34570 0 : return -1;
34571 : }
34572 30 : if (value == Py_None) {
34573 30 : *object->in.authority_name = NULL;
34574 : } else {
34575 0 : *object->in.authority_name = NULL;
34576 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34577 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34578 0 : PyErr_NoMemory();
34579 0 : return -1;
34580 : }
34581 0 : *object->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
34582 : }
34583 : }
34584 30 : return 0;
34585 : }
34586 :
34587 294 : static PyObject *py_lsa_GetUserName_out_get_authority_name(PyObject *obj, void *closure)
34588 : {
34589 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34590 0 : PyObject *py_authority_name;
34591 294 : if (object->out.authority_name == NULL) {
34592 0 : Py_RETURN_NONE;
34593 : }
34594 294 : if (object->out.authority_name == NULL) {
34595 0 : py_authority_name = Py_None;
34596 0 : Py_INCREF(py_authority_name);
34597 : } else {
34598 294 : if (*object->out.authority_name == NULL) {
34599 0 : py_authority_name = Py_None;
34600 0 : Py_INCREF(py_authority_name);
34601 : } else {
34602 294 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.authority_name, *object->out.authority_name);
34603 : }
34604 : }
34605 : {
34606 294 : PyObject *py_authority_name_level_0 = py_authority_name;
34607 294 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
34608 294 : Py_XDECREF(py_authority_name_level_0);
34609 : }
34610 294 : return py_authority_name;
34611 : }
34612 :
34613 0 : static int py_lsa_GetUserName_out_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
34614 : {
34615 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34616 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authority_name));
34617 0 : if (value == NULL) {
34618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.authority_name");
34619 0 : return -1;
34620 : }
34621 0 : if (value == Py_None) {
34622 0 : object->out.authority_name = NULL;
34623 : } else {
34624 0 : object->out.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authority_name);
34625 0 : if (object->out.authority_name == NULL) {
34626 0 : PyErr_NoMemory();
34627 0 : return -1;
34628 : }
34629 0 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
34630 0 : if (value == NULL) {
34631 0 : return -1;
34632 : }
34633 0 : if (value == Py_None) {
34634 0 : *object->out.authority_name = NULL;
34635 : } else {
34636 0 : *object->out.authority_name = NULL;
34637 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34638 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34639 0 : PyErr_NoMemory();
34640 0 : return -1;
34641 : }
34642 0 : *object->out.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
34643 : }
34644 : }
34645 0 : return 0;
34646 : }
34647 :
34648 294 : static PyObject *py_lsa_GetUserName_get_result(PyObject *obj, void *closure)
34649 : {
34650 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(obj);
34651 0 : PyObject *py_result;
34652 294 : py_result = PyErr_FromNTSTATUS(object->out.result);
34653 294 : return py_result;
34654 : }
34655 :
34656 0 : static int py_lsa_GetUserName_set_result(PyObject *py_obj, PyObject *value, void *closure)
34657 : {
34658 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34659 0 : if (value == NULL) {
34660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34661 0 : return -1;
34662 : }
34663 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34664 0 : return 0;
34665 : }
34666 :
34667 : static PyGetSetDef py_lsa_GetUserName_getsetters[] = {
34668 : {
34669 : .name = discard_const_p(char, "in_system_name"),
34670 : .get = py_lsa_GetUserName_in_get_system_name,
34671 : .set = py_lsa_GetUserName_in_set_system_name,
34672 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
34673 : },
34674 : {
34675 : .name = discard_const_p(char, "in_account_name"),
34676 : .get = py_lsa_GetUserName_in_get_account_name,
34677 : .set = py_lsa_GetUserName_in_set_account_name,
34678 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34679 : },
34680 : {
34681 : .name = discard_const_p(char, "out_account_name"),
34682 : .get = py_lsa_GetUserName_out_get_account_name,
34683 : .set = py_lsa_GetUserName_out_set_account_name,
34684 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34685 : },
34686 : {
34687 : .name = discard_const_p(char, "in_authority_name"),
34688 : .get = py_lsa_GetUserName_in_get_authority_name,
34689 : .set = py_lsa_GetUserName_in_set_authority_name,
34690 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34691 : },
34692 : {
34693 : .name = discard_const_p(char, "out_authority_name"),
34694 : .get = py_lsa_GetUserName_out_get_authority_name,
34695 : .set = py_lsa_GetUserName_out_set_authority_name,
34696 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34697 : },
34698 : {
34699 : .name = discard_const_p(char, "result"),
34700 : .get = py_lsa_GetUserName_get_result,
34701 : .set = py_lsa_GetUserName_set_result,
34702 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34703 : },
34704 : { .name = NULL }
34705 : };
34706 :
34707 30 : static PyObject *py_lsa_GetUserName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34708 : {
34709 30 : PyObject *self = pytalloc_new(struct lsa_GetUserName, type);
34710 30 : struct lsa_GetUserName *_self = (struct lsa_GetUserName *)pytalloc_get_ptr(self);
34711 30 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34712 : /* a pointer to a NULL pointer */
34713 30 : _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String *);
34714 30 : _self->out.account_name = talloc_zero(mem_ctx, struct lsa_String *);
34715 30 : return self;
34716 : }
34717 :
34718 294 : static PyObject *py_lsa_GetUserName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34719 : {
34720 :
34721 :
34722 294 : return PyLong_FromLong(45);
34723 : }
34724 :
34725 294 : static PyObject *py_lsa_GetUserName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34726 : {
34727 294 : const struct ndr_interface_call *call = NULL;
34728 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34729 294 : PyObject *ret = NULL;
34730 294 : struct ndr_push *push = NULL;
34731 0 : DATA_BLOB blob;
34732 0 : enum ndr_err_code err;
34733 :
34734 294 : if (ndr_table_lsarpc.num_calls < 46) {
34735 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_pack");
34736 0 : return NULL;
34737 : }
34738 294 : call = &ndr_table_lsarpc.calls[45];
34739 :
34740 294 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34741 294 : if (push == NULL) {
34742 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34743 0 : return NULL;
34744 : }
34745 :
34746 294 : push->flags |= ndr_push_flags;
34747 :
34748 294 : err = call->ndr_push(push, ndr_inout_flags, object);
34749 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34750 0 : TALLOC_FREE(push);
34751 0 : PyErr_SetNdrError(err);
34752 0 : return NULL;
34753 : }
34754 294 : blob = ndr_push_blob(push);
34755 294 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34756 294 : TALLOC_FREE(push);
34757 294 : return ret;
34758 : }
34759 :
34760 294 : static PyObject *py_lsa_GetUserName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34761 : {
34762 294 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34763 294 : PyObject *bigendian_obj = NULL;
34764 294 : PyObject *ndr64_obj = NULL;
34765 294 : libndr_flags ndr_push_flags = 0;
34766 :
34767 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34768 : discard_const_p(char *, kwnames),
34769 : &bigendian_obj,
34770 : &ndr64_obj)) {
34771 0 : return NULL;
34772 : }
34773 :
34774 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34775 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34776 : }
34777 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34778 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34779 : }
34780 :
34781 294 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34782 : }
34783 :
34784 0 : static PyObject *py_lsa_GetUserName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34785 : {
34786 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34787 0 : PyObject *bigendian_obj = NULL;
34788 0 : PyObject *ndr64_obj = NULL;
34789 0 : libndr_flags ndr_push_flags = 0;
34790 :
34791 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34792 : discard_const_p(char *, kwnames),
34793 : &bigendian_obj,
34794 : &ndr64_obj)) {
34795 0 : return NULL;
34796 : }
34797 :
34798 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34799 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34800 : }
34801 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34802 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34803 : }
34804 :
34805 0 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34806 : }
34807 :
34808 294 : static PyObject *py_lsa_GetUserName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
34809 : {
34810 294 : const struct ndr_interface_call *call = NULL;
34811 294 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34812 294 : struct ndr_pull *pull = NULL;
34813 0 : enum ndr_err_code err;
34814 :
34815 294 : if (ndr_table_lsarpc.num_calls < 46) {
34816 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_unpack");
34817 0 : return NULL;
34818 : }
34819 294 : call = &ndr_table_lsarpc.calls[45];
34820 :
34821 294 : pull = ndr_pull_init_blob(blob, object);
34822 294 : if (pull == NULL) {
34823 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34824 0 : return NULL;
34825 : }
34826 :
34827 294 : pull->flags |= ndr_pull_flags;
34828 :
34829 294 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34830 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34831 0 : TALLOC_FREE(pull);
34832 0 : PyErr_SetNdrError(err);
34833 0 : return NULL;
34834 : }
34835 294 : if (!allow_remaining) {
34836 0 : uint32_t highest_ofs;
34837 :
34838 294 : if (pull->offset > pull->relative_highest_offset) {
34839 294 : highest_ofs = pull->offset;
34840 : } else {
34841 0 : highest_ofs = pull->relative_highest_offset;
34842 : }
34843 294 : if (highest_ofs < pull->data_size) {
34844 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34845 : "not all bytes consumed ofs[%u] size[%u]",
34846 : highest_ofs, pull->data_size);
34847 0 : TALLOC_FREE(pull);
34848 0 : PyErr_SetNdrError(err);
34849 0 : return NULL;
34850 : }
34851 : }
34852 :
34853 294 : TALLOC_FREE(pull);
34854 294 : Py_RETURN_NONE;
34855 : }
34856 :
34857 0 : static PyObject *py_lsa_GetUserName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34858 : {
34859 0 : DATA_BLOB blob;
34860 0 : Py_ssize_t blob_length = 0;
34861 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34862 0 : PyObject *bigendian_obj = NULL;
34863 0 : PyObject *ndr64_obj = NULL;
34864 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34865 0 : PyObject *allow_remaining_obj = NULL;
34866 0 : bool allow_remaining = false;
34867 :
34868 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34869 : discard_const_p(char *, kwnames),
34870 : &blob.data, &blob_length,
34871 : &bigendian_obj,
34872 : &ndr64_obj,
34873 : &allow_remaining_obj)) {
34874 0 : return NULL;
34875 : }
34876 0 : blob.length = blob_length;
34877 :
34878 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34879 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34880 : }
34881 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34882 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34883 : }
34884 :
34885 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34886 0 : allow_remaining = true;
34887 : }
34888 :
34889 0 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34890 : }
34891 :
34892 294 : static PyObject *py_lsa_GetUserName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34893 : {
34894 0 : DATA_BLOB blob;
34895 294 : Py_ssize_t blob_length = 0;
34896 294 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34897 294 : PyObject *bigendian_obj = NULL;
34898 294 : PyObject *ndr64_obj = NULL;
34899 294 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34900 294 : PyObject *allow_remaining_obj = NULL;
34901 294 : bool allow_remaining = false;
34902 :
34903 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34904 : discard_const_p(char *, kwnames),
34905 : &blob.data, &blob_length,
34906 : &bigendian_obj,
34907 : &ndr64_obj,
34908 : &allow_remaining_obj)) {
34909 0 : return NULL;
34910 : }
34911 294 : blob.length = blob_length;
34912 :
34913 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34914 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34915 : }
34916 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34917 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34918 : }
34919 :
34920 294 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34921 0 : allow_remaining = true;
34922 : }
34923 :
34924 294 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34925 : }
34926 :
34927 0 : static PyObject *py_lsa_GetUserName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34928 : {
34929 0 : const struct ndr_interface_call *call = NULL;
34930 0 : struct lsa_GetUserName *object = (struct lsa_GetUserName *)pytalloc_get_ptr(py_obj);
34931 0 : PyObject *ret;
34932 0 : char *retstr;
34933 :
34934 0 : if (ndr_table_lsarpc.num_calls < 46) {
34935 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_print");
34936 0 : return NULL;
34937 : }
34938 0 : call = &ndr_table_lsarpc.calls[45];
34939 :
34940 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34941 0 : ret = PyUnicode_FromString(retstr);
34942 0 : TALLOC_FREE(retstr);
34943 :
34944 0 : return ret;
34945 : }
34946 :
34947 0 : static PyObject *py_lsa_GetUserName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34948 : {
34949 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_in", NDR_IN);
34950 : }
34951 :
34952 0 : static PyObject *py_lsa_GetUserName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34953 : {
34954 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_out", NDR_OUT);
34955 : }
34956 :
34957 : static PyMethodDef py_lsa_GetUserName_methods[] = {
34958 : { "opnum", (PyCFunction)py_lsa_GetUserName_ndr_opnum, METH_NOARGS|METH_CLASS,
34959 : "lsa.GetUserName.opnum() -> 45 (0x2d) " },
34960 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34961 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34962 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34963 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34964 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34965 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34966 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34967 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34968 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetUserName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34969 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetUserName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34970 : { NULL, NULL, 0, NULL }
34971 : };
34972 :
34973 :
34974 : static PyTypeObject lsa_GetUserName_Type = {
34975 : PyVarObject_HEAD_INIT(NULL, 0)
34976 : .tp_name = "lsa.GetUserName",
34977 : .tp_getset = py_lsa_GetUserName_getsetters,
34978 : .tp_methods = py_lsa_GetUserName_methods,
34979 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34980 : .tp_new = py_lsa_GetUserName_new,
34981 : };
34982 :
34983 12 : static bool pack_py_lsa_GetUserName_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetUserName *r)
34984 : {
34985 0 : PyObject *py_system_name;
34986 0 : PyObject *py_account_name;
34987 0 : PyObject *py_authority_name;
34988 12 : const char *kwnames[] = {
34989 : "system_name", "account_name", "authority_name", NULL
34990 : };
34991 :
34992 12 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_GetUserName", discard_const_p(char *, kwnames), &py_system_name, &py_account_name, &py_authority_name)) {
34993 0 : return false;
34994 : }
34995 :
34996 12 : if (py_system_name == NULL) {
34997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
34998 0 : return false;
34999 : }
35000 12 : if (py_system_name == Py_None) {
35001 12 : r->in.system_name = NULL;
35002 : } else {
35003 0 : r->in.system_name = NULL;
35004 : {
35005 0 : const char *test_str;
35006 0 : const char *talloc_str;
35007 0 : PyObject *unicode = NULL;
35008 0 : if (PyUnicode_Check(py_system_name)) {
35009 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
35010 0 : if (unicode == NULL) {
35011 0 : return false;
35012 : }
35013 0 : test_str = PyBytes_AS_STRING(unicode);
35014 0 : } else if (PyBytes_Check(py_system_name)) {
35015 0 : test_str = PyBytes_AS_STRING(py_system_name);
35016 : } else {
35017 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
35018 0 : return false;
35019 : }
35020 0 : talloc_str = talloc_strdup(r, test_str);
35021 0 : if (unicode != NULL) {
35022 0 : Py_DECREF(unicode);
35023 : }
35024 0 : if (talloc_str == NULL) {
35025 0 : PyErr_NoMemory();
35026 0 : return false;
35027 : }
35028 0 : r->in.system_name = talloc_str;
35029 : }
35030 : }
35031 12 : if (py_account_name == NULL) {
35032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
35033 0 : return false;
35034 : }
35035 12 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
35036 12 : if (r->in.account_name == NULL) {
35037 0 : PyErr_NoMemory();
35038 0 : return false;
35039 : }
35040 12 : if (py_account_name == Py_None) {
35041 12 : *r->in.account_name = NULL;
35042 : } else {
35043 0 : *r->in.account_name = NULL;
35044 0 : PY_CHECK_TYPE(&lsa_String_Type, py_account_name, return false;);
35045 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
35046 0 : PyErr_NoMemory();
35047 0 : return false;
35048 : }
35049 0 : *r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
35050 : }
35051 12 : if (py_authority_name == NULL) {
35052 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.authority_name");
35053 0 : return false;
35054 : }
35055 12 : if (py_authority_name == Py_None) {
35056 12 : r->in.authority_name = NULL;
35057 : } else {
35058 0 : r->in.authority_name = talloc_ptrtype(r, r->in.authority_name);
35059 0 : if (r->in.authority_name == NULL) {
35060 0 : PyErr_NoMemory();
35061 0 : return false;
35062 : }
35063 0 : py_authority_name = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, py_authority_name);
35064 0 : if (py_authority_name == NULL) {
35065 0 : return false;
35066 : }
35067 0 : if (py_authority_name == Py_None) {
35068 0 : *r->in.authority_name = NULL;
35069 : } else {
35070 0 : *r->in.authority_name = NULL;
35071 0 : PY_CHECK_TYPE(&lsa_String_Type, py_authority_name, return false;);
35072 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_authority_name)) == NULL) {
35073 0 : PyErr_NoMemory();
35074 0 : return false;
35075 : }
35076 0 : *r->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(py_authority_name);
35077 : }
35078 : }
35079 12 : return true;
35080 : }
35081 :
35082 12 : static PyObject *unpack_py_lsa_GetUserName_args_out(struct lsa_GetUserName *r)
35083 : {
35084 0 : PyObject *result;
35085 0 : PyObject *py_account_name;
35086 0 : PyObject *py_authority_name;
35087 12 : result = PyTuple_New(2);
35088 12 : if (*r->out.account_name == NULL) {
35089 0 : py_account_name = Py_None;
35090 0 : Py_INCREF(py_account_name);
35091 : } else {
35092 12 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.account_name, *r->out.account_name);
35093 : }
35094 12 : PyTuple_SetItem(result, 0, py_account_name);
35095 12 : if (r->out.authority_name == NULL) {
35096 12 : py_authority_name = Py_None;
35097 9 : Py_INCREF(py_authority_name);
35098 : } else {
35099 0 : if (*r->out.authority_name == NULL) {
35100 0 : py_authority_name = Py_None;
35101 0 : Py_INCREF(py_authority_name);
35102 : } else {
35103 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.authority_name, *r->out.authority_name);
35104 : }
35105 : }
35106 : {
35107 12 : PyObject *py_authority_name_level_0 = py_authority_name;
35108 12 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
35109 12 : Py_XDECREF(py_authority_name_level_0);
35110 : }
35111 12 : PyTuple_SetItem(result, 1, py_authority_name);
35112 12 : if (NT_STATUS_IS_ERR(r->out.result)) {
35113 0 : PyErr_SetNTSTATUS(r->out.result);
35114 0 : return NULL;
35115 : }
35116 :
35117 12 : return result;
35118 : }
35119 :
35120 :
35121 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
35122 : {
35123 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35124 0 : PyObject *py_handle;
35125 0 : if (object->in.handle == NULL) {
35126 0 : Py_RETURN_NONE;
35127 : }
35128 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
35129 0 : return py_handle;
35130 : }
35131 :
35132 0 : static int py_lsa_QueryInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
35133 : {
35134 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35135 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
35136 0 : if (value == NULL) {
35137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
35138 0 : return -1;
35139 : }
35140 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
35141 0 : if (object->in.handle == NULL) {
35142 0 : PyErr_NoMemory();
35143 0 : return -1;
35144 : }
35145 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35146 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35147 0 : PyErr_NoMemory();
35148 0 : return -1;
35149 : }
35150 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
35151 0 : return 0;
35152 : }
35153 :
35154 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_level(PyObject *obj, void *closure)
35155 : {
35156 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35157 0 : PyObject *py_level;
35158 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35159 0 : return py_level;
35160 : }
35161 :
35162 0 : static int py_lsa_QueryInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35163 : {
35164 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35165 0 : if (value == NULL) {
35166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35167 0 : return -1;
35168 : }
35169 : {
35170 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35171 0 : if (PyLong_Check(value)) {
35172 0 : unsigned long long test_var;
35173 0 : test_var = PyLong_AsUnsignedLongLong(value);
35174 0 : if (PyErr_Occurred() != NULL) {
35175 0 : return -1;
35176 : }
35177 0 : if (test_var > uint_max) {
35178 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35179 : PyLong_Type.tp_name, uint_max, test_var);
35180 0 : return -1;
35181 : }
35182 0 : object->in.level = test_var;
35183 : } else {
35184 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35185 : PyLong_Type.tp_name);
35186 0 : return -1;
35187 : }
35188 : }
35189 0 : return 0;
35190 : }
35191 :
35192 0 : static PyObject *py_lsa_QueryInfoPolicy2_out_get_info(PyObject *obj, void *closure)
35193 : {
35194 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35195 0 : PyObject *py_info;
35196 0 : if (object->out.info == NULL) {
35197 0 : Py_RETURN_NONE;
35198 : }
35199 0 : if (*object->out.info == NULL) {
35200 0 : py_info = Py_None;
35201 0 : Py_INCREF(py_info);
35202 : } else {
35203 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
35204 0 : if (py_info == NULL) {
35205 0 : return NULL;
35206 : }
35207 : }
35208 0 : return py_info;
35209 : }
35210 :
35211 0 : static int py_lsa_QueryInfoPolicy2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
35212 : {
35213 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35214 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
35215 0 : if (value == NULL) {
35216 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
35217 0 : return -1;
35218 : }
35219 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
35220 0 : if (object->out.info == NULL) {
35221 0 : PyErr_NoMemory();
35222 0 : return -1;
35223 : }
35224 0 : if (value == Py_None) {
35225 0 : *object->out.info = NULL;
35226 : } else {
35227 0 : *object->out.info = NULL;
35228 : {
35229 0 : union lsa_PolicyInformation *info_switch_2;
35230 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");
35231 0 : if (info_switch_2 == NULL) {
35232 0 : return -1;
35233 : }
35234 0 : *object->out.info = info_switch_2;
35235 : }
35236 : }
35237 0 : return 0;
35238 : }
35239 :
35240 0 : static PyObject *py_lsa_QueryInfoPolicy2_get_result(PyObject *obj, void *closure)
35241 : {
35242 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(obj);
35243 0 : PyObject *py_result;
35244 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35245 0 : return py_result;
35246 : }
35247 :
35248 0 : static int py_lsa_QueryInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
35249 : {
35250 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35251 0 : if (value == NULL) {
35252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35253 0 : return -1;
35254 : }
35255 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35256 0 : return 0;
35257 : }
35258 :
35259 : static PyGetSetDef py_lsa_QueryInfoPolicy2_getsetters[] = {
35260 : {
35261 : .name = discard_const_p(char, "in_handle"),
35262 : .get = py_lsa_QueryInfoPolicy2_in_get_handle,
35263 : .set = py_lsa_QueryInfoPolicy2_in_set_handle,
35264 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35265 : },
35266 : {
35267 : .name = discard_const_p(char, "in_level"),
35268 : .get = py_lsa_QueryInfoPolicy2_in_get_level,
35269 : .set = py_lsa_QueryInfoPolicy2_in_set_level,
35270 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
35271 : },
35272 : {
35273 : .name = discard_const_p(char, "out_info"),
35274 : .get = py_lsa_QueryInfoPolicy2_out_get_info,
35275 : .set = py_lsa_QueryInfoPolicy2_out_set_info,
35276 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
35277 : },
35278 : {
35279 : .name = discard_const_p(char, "result"),
35280 : .get = py_lsa_QueryInfoPolicy2_get_result,
35281 : .set = py_lsa_QueryInfoPolicy2_set_result,
35282 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35283 : },
35284 : { .name = NULL }
35285 : };
35286 :
35287 0 : static PyObject *py_lsa_QueryInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35288 : {
35289 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy2, type);
35290 0 : struct lsa_QueryInfoPolicy2 *_self = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(self);
35291 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35292 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
35293 : /* a pointer to a NULL pointer */
35294 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
35295 0 : return self;
35296 : }
35297 :
35298 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35299 : {
35300 :
35301 :
35302 0 : return PyLong_FromLong(46);
35303 : }
35304 :
35305 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35306 : {
35307 0 : const struct ndr_interface_call *call = NULL;
35308 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35309 0 : PyObject *ret = NULL;
35310 0 : struct ndr_push *push = NULL;
35311 0 : DATA_BLOB blob;
35312 0 : enum ndr_err_code err;
35313 :
35314 0 : if (ndr_table_lsarpc.num_calls < 47) {
35315 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_pack");
35316 0 : return NULL;
35317 : }
35318 0 : call = &ndr_table_lsarpc.calls[46];
35319 :
35320 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35321 0 : if (push == NULL) {
35322 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35323 0 : return NULL;
35324 : }
35325 :
35326 0 : push->flags |= ndr_push_flags;
35327 :
35328 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35329 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35330 0 : TALLOC_FREE(push);
35331 0 : PyErr_SetNdrError(err);
35332 0 : return NULL;
35333 : }
35334 0 : blob = ndr_push_blob(push);
35335 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35336 0 : TALLOC_FREE(push);
35337 0 : return ret;
35338 : }
35339 :
35340 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35341 : {
35342 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35343 0 : PyObject *bigendian_obj = NULL;
35344 0 : PyObject *ndr64_obj = NULL;
35345 0 : libndr_flags ndr_push_flags = 0;
35346 :
35347 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35348 : discard_const_p(char *, kwnames),
35349 : &bigendian_obj,
35350 : &ndr64_obj)) {
35351 0 : return NULL;
35352 : }
35353 :
35354 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35355 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35356 : }
35357 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35358 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35359 : }
35360 :
35361 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35362 : }
35363 :
35364 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35365 : {
35366 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35367 0 : PyObject *bigendian_obj = NULL;
35368 0 : PyObject *ndr64_obj = NULL;
35369 0 : libndr_flags ndr_push_flags = 0;
35370 :
35371 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35372 : discard_const_p(char *, kwnames),
35373 : &bigendian_obj,
35374 : &ndr64_obj)) {
35375 0 : return NULL;
35376 : }
35377 :
35378 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35379 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35380 : }
35381 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35382 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35383 : }
35384 :
35385 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35386 : }
35387 :
35388 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
35389 : {
35390 0 : const struct ndr_interface_call *call = NULL;
35391 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35392 0 : struct ndr_pull *pull = NULL;
35393 0 : enum ndr_err_code err;
35394 :
35395 0 : if (ndr_table_lsarpc.num_calls < 47) {
35396 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_unpack");
35397 0 : return NULL;
35398 : }
35399 0 : call = &ndr_table_lsarpc.calls[46];
35400 :
35401 0 : pull = ndr_pull_init_blob(blob, object);
35402 0 : if (pull == NULL) {
35403 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35404 0 : return NULL;
35405 : }
35406 :
35407 0 : pull->flags |= ndr_pull_flags;
35408 :
35409 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35410 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35411 0 : TALLOC_FREE(pull);
35412 0 : PyErr_SetNdrError(err);
35413 0 : return NULL;
35414 : }
35415 0 : if (!allow_remaining) {
35416 0 : uint32_t highest_ofs;
35417 :
35418 0 : if (pull->offset > pull->relative_highest_offset) {
35419 0 : highest_ofs = pull->offset;
35420 : } else {
35421 0 : highest_ofs = pull->relative_highest_offset;
35422 : }
35423 0 : if (highest_ofs < pull->data_size) {
35424 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35425 : "not all bytes consumed ofs[%u] size[%u]",
35426 : highest_ofs, pull->data_size);
35427 0 : TALLOC_FREE(pull);
35428 0 : PyErr_SetNdrError(err);
35429 0 : return NULL;
35430 : }
35431 : }
35432 :
35433 0 : TALLOC_FREE(pull);
35434 0 : Py_RETURN_NONE;
35435 : }
35436 :
35437 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35438 : {
35439 0 : DATA_BLOB blob;
35440 0 : Py_ssize_t blob_length = 0;
35441 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35442 0 : PyObject *bigendian_obj = NULL;
35443 0 : PyObject *ndr64_obj = NULL;
35444 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35445 0 : PyObject *allow_remaining_obj = NULL;
35446 0 : bool allow_remaining = false;
35447 :
35448 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35449 : discard_const_p(char *, kwnames),
35450 : &blob.data, &blob_length,
35451 : &bigendian_obj,
35452 : &ndr64_obj,
35453 : &allow_remaining_obj)) {
35454 0 : return NULL;
35455 : }
35456 0 : blob.length = blob_length;
35457 :
35458 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35459 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35460 : }
35461 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35462 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35463 : }
35464 :
35465 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35466 0 : allow_remaining = true;
35467 : }
35468 :
35469 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35470 : }
35471 :
35472 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35473 : {
35474 0 : DATA_BLOB blob;
35475 0 : Py_ssize_t blob_length = 0;
35476 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35477 0 : PyObject *bigendian_obj = NULL;
35478 0 : PyObject *ndr64_obj = NULL;
35479 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35480 0 : PyObject *allow_remaining_obj = NULL;
35481 0 : bool allow_remaining = false;
35482 :
35483 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35484 : discard_const_p(char *, kwnames),
35485 : &blob.data, &blob_length,
35486 : &bigendian_obj,
35487 : &ndr64_obj,
35488 : &allow_remaining_obj)) {
35489 0 : return NULL;
35490 : }
35491 0 : blob.length = blob_length;
35492 :
35493 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35494 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35495 : }
35496 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35497 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35498 : }
35499 :
35500 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35501 0 : allow_remaining = true;
35502 : }
35503 :
35504 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35505 : }
35506 :
35507 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
35508 : {
35509 0 : const struct ndr_interface_call *call = NULL;
35510 0 : struct lsa_QueryInfoPolicy2 *object = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35511 0 : PyObject *ret;
35512 0 : char *retstr;
35513 :
35514 0 : if (ndr_table_lsarpc.num_calls < 47) {
35515 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_print");
35516 0 : return NULL;
35517 : }
35518 0 : call = &ndr_table_lsarpc.calls[46];
35519 :
35520 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35521 0 : ret = PyUnicode_FromString(retstr);
35522 0 : TALLOC_FREE(retstr);
35523 :
35524 0 : return ret;
35525 : }
35526 :
35527 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35528 : {
35529 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_in", NDR_IN);
35530 : }
35531 :
35532 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35533 : {
35534 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_out", NDR_OUT);
35535 : }
35536 :
35537 : static PyMethodDef py_lsa_QueryInfoPolicy2_methods[] = {
35538 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
35539 : "lsa.QueryInfoPolicy2.opnum() -> 46 (0x2e) " },
35540 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35541 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35542 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35543 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35544 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35545 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35546 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35547 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35548 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35549 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35550 : { NULL, NULL, 0, NULL }
35551 : };
35552 :
35553 :
35554 : static PyTypeObject lsa_QueryInfoPolicy2_Type = {
35555 : PyVarObject_HEAD_INIT(NULL, 0)
35556 : .tp_name = "lsa.QueryInfoPolicy2",
35557 : .tp_getset = py_lsa_QueryInfoPolicy2_getsetters,
35558 : .tp_methods = py_lsa_QueryInfoPolicy2_methods,
35559 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
35560 : .tp_new = py_lsa_QueryInfoPolicy2_new,
35561 : };
35562 :
35563 223 : static bool pack_py_lsa_QueryInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy2 *r)
35564 : {
35565 2 : PyObject *py_handle;
35566 2 : PyObject *py_level;
35567 223 : const char *kwnames[] = {
35568 : "handle", "level", NULL
35569 : };
35570 :
35571 223 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
35572 0 : return false;
35573 : }
35574 :
35575 223 : if (py_handle == NULL) {
35576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
35577 0 : return false;
35578 : }
35579 223 : r->in.handle = talloc_ptrtype(r, r->in.handle);
35580 223 : if (r->in.handle == NULL) {
35581 0 : PyErr_NoMemory();
35582 0 : return false;
35583 : }
35584 223 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
35585 223 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
35586 0 : PyErr_NoMemory();
35587 0 : return false;
35588 : }
35589 223 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
35590 223 : if (py_level == NULL) {
35591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
35592 0 : return false;
35593 : }
35594 : {
35595 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
35596 223 : if (PyLong_Check(py_level)) {
35597 2 : unsigned long long test_var;
35598 223 : test_var = PyLong_AsUnsignedLongLong(py_level);
35599 223 : if (PyErr_Occurred() != NULL) {
35600 0 : return false;
35601 : }
35602 223 : if (test_var > uint_max) {
35603 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35604 : PyLong_Type.tp_name, uint_max, test_var);
35605 0 : return false;
35606 : }
35607 223 : r->in.level = test_var;
35608 : } else {
35609 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35610 : PyLong_Type.tp_name);
35611 0 : return false;
35612 : }
35613 : }
35614 223 : return true;
35615 : }
35616 :
35617 223 : static PyObject *unpack_py_lsa_QueryInfoPolicy2_args_out(struct lsa_QueryInfoPolicy2 *r)
35618 : {
35619 2 : PyObject *result;
35620 2 : PyObject *py_info;
35621 223 : if (*r->out.info == NULL) {
35622 0 : py_info = Py_None;
35623 0 : Py_INCREF(py_info);
35624 : } else {
35625 223 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
35626 223 : if (py_info == NULL) {
35627 0 : return NULL;
35628 : }
35629 : }
35630 223 : result = py_info;
35631 223 : if (NT_STATUS_IS_ERR(r->out.result)) {
35632 0 : PyErr_SetNTSTATUS(r->out.result);
35633 0 : return NULL;
35634 : }
35635 :
35636 221 : return result;
35637 : }
35638 :
35639 :
35640 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
35641 : {
35642 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35643 0 : PyObject *py_handle;
35644 0 : if (object->in.handle == NULL) {
35645 0 : Py_RETURN_NONE;
35646 : }
35647 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
35648 0 : return py_handle;
35649 : }
35650 :
35651 0 : static int py_lsa_SetInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
35652 : {
35653 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35654 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
35655 0 : if (value == NULL) {
35656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
35657 0 : return -1;
35658 : }
35659 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
35660 0 : if (object->in.handle == NULL) {
35661 0 : PyErr_NoMemory();
35662 0 : return -1;
35663 : }
35664 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35665 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35666 0 : PyErr_NoMemory();
35667 0 : return -1;
35668 : }
35669 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
35670 0 : return 0;
35671 : }
35672 :
35673 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_level(PyObject *obj, void *closure)
35674 : {
35675 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35676 0 : PyObject *py_level;
35677 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35678 0 : return py_level;
35679 : }
35680 :
35681 0 : static int py_lsa_SetInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35682 : {
35683 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35684 0 : if (value == NULL) {
35685 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35686 0 : return -1;
35687 : }
35688 : {
35689 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35690 0 : if (PyLong_Check(value)) {
35691 0 : unsigned long long test_var;
35692 0 : test_var = PyLong_AsUnsignedLongLong(value);
35693 0 : if (PyErr_Occurred() != NULL) {
35694 0 : return -1;
35695 : }
35696 0 : if (test_var > uint_max) {
35697 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35698 : PyLong_Type.tp_name, uint_max, test_var);
35699 0 : return -1;
35700 : }
35701 0 : object->in.level = test_var;
35702 : } else {
35703 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35704 : PyLong_Type.tp_name);
35705 0 : return -1;
35706 : }
35707 : }
35708 0 : return 0;
35709 : }
35710 :
35711 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_info(PyObject *obj, void *closure)
35712 : {
35713 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35714 0 : PyObject *py_info;
35715 0 : if (object->in.info == NULL) {
35716 0 : Py_RETURN_NONE;
35717 : }
35718 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
35719 0 : if (py_info == NULL) {
35720 0 : return NULL;
35721 : }
35722 0 : return py_info;
35723 : }
35724 :
35725 0 : static int py_lsa_SetInfoPolicy2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
35726 : {
35727 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35728 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
35729 0 : if (value == NULL) {
35730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
35731 0 : return -1;
35732 : }
35733 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
35734 0 : if (object->in.info == NULL) {
35735 0 : PyErr_NoMemory();
35736 0 : return -1;
35737 : }
35738 : {
35739 0 : union lsa_PolicyInformation *info_switch_1;
35740 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");
35741 0 : if (info_switch_1 == NULL) {
35742 0 : return -1;
35743 : }
35744 0 : object->in.info = info_switch_1;
35745 : }
35746 0 : return 0;
35747 : }
35748 :
35749 0 : static PyObject *py_lsa_SetInfoPolicy2_get_result(PyObject *obj, void *closure)
35750 : {
35751 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(obj);
35752 0 : PyObject *py_result;
35753 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35754 0 : return py_result;
35755 : }
35756 :
35757 0 : static int py_lsa_SetInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
35758 : {
35759 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35760 0 : if (value == NULL) {
35761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35762 0 : return -1;
35763 : }
35764 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35765 0 : return 0;
35766 : }
35767 :
35768 : static PyGetSetDef py_lsa_SetInfoPolicy2_getsetters[] = {
35769 : {
35770 : .name = discard_const_p(char, "in_handle"),
35771 : .get = py_lsa_SetInfoPolicy2_in_get_handle,
35772 : .set = py_lsa_SetInfoPolicy2_in_set_handle,
35773 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35774 : },
35775 : {
35776 : .name = discard_const_p(char, "in_level"),
35777 : .get = py_lsa_SetInfoPolicy2_in_get_level,
35778 : .set = py_lsa_SetInfoPolicy2_in_set_level,
35779 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
35780 : },
35781 : {
35782 : .name = discard_const_p(char, "in_info"),
35783 : .get = py_lsa_SetInfoPolicy2_in_get_info,
35784 : .set = py_lsa_SetInfoPolicy2_in_set_info,
35785 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
35786 : },
35787 : {
35788 : .name = discard_const_p(char, "result"),
35789 : .get = py_lsa_SetInfoPolicy2_get_result,
35790 : .set = py_lsa_SetInfoPolicy2_set_result,
35791 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35792 : },
35793 : { .name = NULL }
35794 : };
35795 :
35796 0 : static PyObject *py_lsa_SetInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35797 : {
35798 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy2, type);
35799 0 : struct lsa_SetInfoPolicy2 *_self = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(self);
35800 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35801 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
35802 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
35803 0 : return self;
35804 : }
35805 :
35806 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35807 : {
35808 :
35809 :
35810 0 : return PyLong_FromLong(47);
35811 : }
35812 :
35813 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35814 : {
35815 0 : const struct ndr_interface_call *call = NULL;
35816 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35817 0 : PyObject *ret = NULL;
35818 0 : struct ndr_push *push = NULL;
35819 0 : DATA_BLOB blob;
35820 0 : enum ndr_err_code err;
35821 :
35822 0 : if (ndr_table_lsarpc.num_calls < 48) {
35823 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_pack");
35824 0 : return NULL;
35825 : }
35826 0 : call = &ndr_table_lsarpc.calls[47];
35827 :
35828 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35829 0 : if (push == NULL) {
35830 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35831 0 : return NULL;
35832 : }
35833 :
35834 0 : push->flags |= ndr_push_flags;
35835 :
35836 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35837 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35838 0 : TALLOC_FREE(push);
35839 0 : PyErr_SetNdrError(err);
35840 0 : return NULL;
35841 : }
35842 0 : blob = ndr_push_blob(push);
35843 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35844 0 : TALLOC_FREE(push);
35845 0 : return ret;
35846 : }
35847 :
35848 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35849 : {
35850 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35851 0 : PyObject *bigendian_obj = NULL;
35852 0 : PyObject *ndr64_obj = NULL;
35853 0 : libndr_flags ndr_push_flags = 0;
35854 :
35855 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35856 : discard_const_p(char *, kwnames),
35857 : &bigendian_obj,
35858 : &ndr64_obj)) {
35859 0 : return NULL;
35860 : }
35861 :
35862 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35863 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35864 : }
35865 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35866 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35867 : }
35868 :
35869 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35870 : }
35871 :
35872 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35873 : {
35874 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35875 0 : PyObject *bigendian_obj = NULL;
35876 0 : PyObject *ndr64_obj = NULL;
35877 0 : libndr_flags ndr_push_flags = 0;
35878 :
35879 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35880 : discard_const_p(char *, kwnames),
35881 : &bigendian_obj,
35882 : &ndr64_obj)) {
35883 0 : return NULL;
35884 : }
35885 :
35886 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35887 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35888 : }
35889 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35890 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35891 : }
35892 :
35893 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35894 : }
35895 :
35896 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
35897 : {
35898 0 : const struct ndr_interface_call *call = NULL;
35899 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
35900 0 : struct ndr_pull *pull = NULL;
35901 0 : enum ndr_err_code err;
35902 :
35903 0 : if (ndr_table_lsarpc.num_calls < 48) {
35904 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_unpack");
35905 0 : return NULL;
35906 : }
35907 0 : call = &ndr_table_lsarpc.calls[47];
35908 :
35909 0 : pull = ndr_pull_init_blob(blob, object);
35910 0 : if (pull == NULL) {
35911 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35912 0 : return NULL;
35913 : }
35914 :
35915 0 : pull->flags |= ndr_pull_flags;
35916 :
35917 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35918 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35919 0 : TALLOC_FREE(pull);
35920 0 : PyErr_SetNdrError(err);
35921 0 : return NULL;
35922 : }
35923 0 : if (!allow_remaining) {
35924 0 : uint32_t highest_ofs;
35925 :
35926 0 : if (pull->offset > pull->relative_highest_offset) {
35927 0 : highest_ofs = pull->offset;
35928 : } else {
35929 0 : highest_ofs = pull->relative_highest_offset;
35930 : }
35931 0 : if (highest_ofs < pull->data_size) {
35932 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35933 : "not all bytes consumed ofs[%u] size[%u]",
35934 : highest_ofs, pull->data_size);
35935 0 : TALLOC_FREE(pull);
35936 0 : PyErr_SetNdrError(err);
35937 0 : return NULL;
35938 : }
35939 : }
35940 :
35941 0 : TALLOC_FREE(pull);
35942 0 : Py_RETURN_NONE;
35943 : }
35944 :
35945 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35946 : {
35947 0 : DATA_BLOB blob;
35948 0 : Py_ssize_t blob_length = 0;
35949 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35950 0 : PyObject *bigendian_obj = NULL;
35951 0 : PyObject *ndr64_obj = NULL;
35952 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35953 0 : PyObject *allow_remaining_obj = NULL;
35954 0 : bool allow_remaining = false;
35955 :
35956 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35957 : discard_const_p(char *, kwnames),
35958 : &blob.data, &blob_length,
35959 : &bigendian_obj,
35960 : &ndr64_obj,
35961 : &allow_remaining_obj)) {
35962 0 : return NULL;
35963 : }
35964 0 : blob.length = blob_length;
35965 :
35966 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35967 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35968 : }
35969 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35970 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35971 : }
35972 :
35973 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35974 0 : allow_remaining = true;
35975 : }
35976 :
35977 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35978 : }
35979 :
35980 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35981 : {
35982 0 : DATA_BLOB blob;
35983 0 : Py_ssize_t blob_length = 0;
35984 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35985 0 : PyObject *bigendian_obj = NULL;
35986 0 : PyObject *ndr64_obj = NULL;
35987 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35988 0 : PyObject *allow_remaining_obj = NULL;
35989 0 : bool allow_remaining = false;
35990 :
35991 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35992 : discard_const_p(char *, kwnames),
35993 : &blob.data, &blob_length,
35994 : &bigendian_obj,
35995 : &ndr64_obj,
35996 : &allow_remaining_obj)) {
35997 0 : return NULL;
35998 : }
35999 0 : blob.length = blob_length;
36000 :
36001 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36002 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36003 : }
36004 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36005 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36006 : }
36007 :
36008 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36009 0 : allow_remaining = true;
36010 : }
36011 :
36012 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36013 : }
36014 :
36015 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36016 : {
36017 0 : const struct ndr_interface_call *call = NULL;
36018 0 : struct lsa_SetInfoPolicy2 *object = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(py_obj);
36019 0 : PyObject *ret;
36020 0 : char *retstr;
36021 :
36022 0 : if (ndr_table_lsarpc.num_calls < 48) {
36023 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_print");
36024 0 : return NULL;
36025 : }
36026 0 : call = &ndr_table_lsarpc.calls[47];
36027 :
36028 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36029 0 : ret = PyUnicode_FromString(retstr);
36030 0 : TALLOC_FREE(retstr);
36031 :
36032 0 : return ret;
36033 : }
36034 :
36035 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36036 : {
36037 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_in", NDR_IN);
36038 : }
36039 :
36040 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36041 : {
36042 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_out", NDR_OUT);
36043 : }
36044 :
36045 : static PyMethodDef py_lsa_SetInfoPolicy2_methods[] = {
36046 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
36047 : "lsa.SetInfoPolicy2.opnum() -> 47 (0x2f) " },
36048 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36049 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36050 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36051 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36052 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36053 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36054 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36055 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36056 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36057 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36058 : { NULL, NULL, 0, NULL }
36059 : };
36060 :
36061 :
36062 : static PyTypeObject lsa_SetInfoPolicy2_Type = {
36063 : PyVarObject_HEAD_INIT(NULL, 0)
36064 : .tp_name = "lsa.SetInfoPolicy2",
36065 : .tp_getset = py_lsa_SetInfoPolicy2_getsetters,
36066 : .tp_methods = py_lsa_SetInfoPolicy2_methods,
36067 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36068 : .tp_new = py_lsa_SetInfoPolicy2_new,
36069 : };
36070 :
36071 0 : static bool pack_py_lsa_SetInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy2 *r)
36072 : {
36073 0 : PyObject *py_handle;
36074 0 : PyObject *py_level;
36075 0 : PyObject *py_info;
36076 0 : const char *kwnames[] = {
36077 : "handle", "level", "info", NULL
36078 : };
36079 :
36080 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
36081 0 : return false;
36082 : }
36083 :
36084 0 : if (py_handle == NULL) {
36085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
36086 0 : return false;
36087 : }
36088 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
36089 0 : if (r->in.handle == NULL) {
36090 0 : PyErr_NoMemory();
36091 0 : return false;
36092 : }
36093 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
36094 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
36095 0 : PyErr_NoMemory();
36096 0 : return false;
36097 : }
36098 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
36099 0 : if (py_level == NULL) {
36100 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36101 0 : return false;
36102 : }
36103 : {
36104 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36105 0 : if (PyLong_Check(py_level)) {
36106 0 : unsigned long long test_var;
36107 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
36108 0 : if (PyErr_Occurred() != NULL) {
36109 0 : return false;
36110 : }
36111 0 : if (test_var > uint_max) {
36112 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36113 : PyLong_Type.tp_name, uint_max, test_var);
36114 0 : return false;
36115 : }
36116 0 : r->in.level = test_var;
36117 : } else {
36118 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36119 : PyLong_Type.tp_name);
36120 0 : return false;
36121 : }
36122 : }
36123 0 : if (py_info == NULL) {
36124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
36125 0 : return false;
36126 : }
36127 0 : r->in.info = talloc_ptrtype(r, r->in.info);
36128 0 : if (r->in.info == NULL) {
36129 0 : PyErr_NoMemory();
36130 0 : return false;
36131 : }
36132 : {
36133 0 : union lsa_PolicyInformation *info_switch_1;
36134 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
36135 0 : if (info_switch_1 == NULL) {
36136 0 : return false;
36137 : }
36138 0 : r->in.info = info_switch_1;
36139 : }
36140 0 : return true;
36141 : }
36142 :
36143 0 : static PyObject *unpack_py_lsa_SetInfoPolicy2_args_out(struct lsa_SetInfoPolicy2 *r)
36144 : {
36145 0 : PyObject *result;
36146 0 : result = Py_None;
36147 0 : Py_INCREF(result);
36148 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
36149 0 : PyErr_SetNTSTATUS(r->out.result);
36150 0 : return NULL;
36151 : }
36152 :
36153 0 : return result;
36154 : }
36155 :
36156 :
36157 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
36158 : {
36159 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36160 0 : PyObject *py_handle;
36161 0 : if (object->in.handle == NULL) {
36162 0 : Py_RETURN_NONE;
36163 : }
36164 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36165 0 : return py_handle;
36166 : }
36167 :
36168 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36169 : {
36170 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36171 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36172 0 : if (value == NULL) {
36173 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
36174 0 : return -1;
36175 : }
36176 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36177 0 : if (object->in.handle == NULL) {
36178 0 : PyErr_NoMemory();
36179 0 : return -1;
36180 : }
36181 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36182 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36183 0 : PyErr_NoMemory();
36184 0 : return -1;
36185 : }
36186 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36187 0 : return 0;
36188 : }
36189 :
36190 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
36191 : {
36192 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36193 0 : PyObject *py_trusted_domain;
36194 0 : if (object->in.trusted_domain == NULL) {
36195 0 : Py_RETURN_NONE;
36196 : }
36197 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
36198 0 : return py_trusted_domain;
36199 : }
36200 :
36201 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
36202 : {
36203 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36204 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
36205 0 : if (value == NULL) {
36206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain");
36207 0 : return -1;
36208 : }
36209 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
36210 0 : if (object->in.trusted_domain == NULL) {
36211 0 : PyErr_NoMemory();
36212 0 : return -1;
36213 : }
36214 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
36215 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36216 0 : PyErr_NoMemory();
36217 0 : return -1;
36218 : }
36219 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
36220 0 : return 0;
36221 : }
36222 :
36223 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
36224 : {
36225 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36226 0 : PyObject *py_level;
36227 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
36228 0 : return py_level;
36229 : }
36230 :
36231 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36232 : {
36233 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36234 0 : if (value == NULL) {
36235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
36236 0 : return -1;
36237 : }
36238 : {
36239 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36240 0 : if (PyLong_Check(value)) {
36241 0 : unsigned long long test_var;
36242 0 : test_var = PyLong_AsUnsignedLongLong(value);
36243 0 : if (PyErr_Occurred() != NULL) {
36244 0 : return -1;
36245 : }
36246 0 : if (test_var > uint_max) {
36247 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36248 : PyLong_Type.tp_name, uint_max, test_var);
36249 0 : return -1;
36250 : }
36251 0 : object->in.level = test_var;
36252 : } else {
36253 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36254 : PyLong_Type.tp_name);
36255 0 : return -1;
36256 : }
36257 : }
36258 0 : return 0;
36259 : }
36260 :
36261 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_out_get_info(PyObject *obj, void *closure)
36262 : {
36263 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36264 0 : PyObject *py_info;
36265 0 : if (object->out.info == NULL) {
36266 0 : Py_RETURN_NONE;
36267 : }
36268 0 : if (*object->out.info == NULL) {
36269 0 : py_info = Py_None;
36270 0 : Py_INCREF(py_info);
36271 : } else {
36272 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
36273 0 : if (py_info == NULL) {
36274 0 : return NULL;
36275 : }
36276 : }
36277 0 : return py_info;
36278 : }
36279 :
36280 0 : static int py_lsa_QueryTrustedDomainInfoByName_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
36281 : {
36282 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36283 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
36284 0 : if (value == NULL) {
36285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
36286 0 : return -1;
36287 : }
36288 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
36289 0 : if (object->out.info == NULL) {
36290 0 : PyErr_NoMemory();
36291 0 : return -1;
36292 : }
36293 0 : if (value == Py_None) {
36294 0 : *object->out.info = NULL;
36295 : } else {
36296 0 : *object->out.info = NULL;
36297 : {
36298 0 : union lsa_TrustedDomainInfo *info_switch_2;
36299 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");
36300 0 : if (info_switch_2 == NULL) {
36301 0 : return -1;
36302 : }
36303 0 : *object->out.info = info_switch_2;
36304 : }
36305 : }
36306 0 : return 0;
36307 : }
36308 :
36309 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
36310 : {
36311 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36312 0 : PyObject *py_result;
36313 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36314 0 : return py_result;
36315 : }
36316 :
36317 0 : static int py_lsa_QueryTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
36318 : {
36319 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36320 0 : if (value == NULL) {
36321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36322 0 : return -1;
36323 : }
36324 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36325 0 : return 0;
36326 : }
36327 :
36328 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoByName_getsetters[] = {
36329 : {
36330 : .name = discard_const_p(char, "in_handle"),
36331 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_handle,
36332 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_handle,
36333 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36334 : },
36335 : {
36336 : .name = discard_const_p(char, "in_trusted_domain"),
36337 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain,
36338 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain,
36339 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
36340 : },
36341 : {
36342 : .name = discard_const_p(char, "in_level"),
36343 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_level,
36344 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_level,
36345 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
36346 : },
36347 : {
36348 : .name = discard_const_p(char, "out_info"),
36349 : .get = py_lsa_QueryTrustedDomainInfoByName_out_get_info,
36350 : .set = py_lsa_QueryTrustedDomainInfoByName_out_set_info,
36351 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
36352 : },
36353 : {
36354 : .name = discard_const_p(char, "result"),
36355 : .get = py_lsa_QueryTrustedDomainInfoByName_get_result,
36356 : .set = py_lsa_QueryTrustedDomainInfoByName_set_result,
36357 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36358 : },
36359 : { .name = NULL }
36360 : };
36361 :
36362 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36363 : {
36364 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoByName, type);
36365 0 : struct lsa_QueryTrustedDomainInfoByName *_self = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(self);
36366 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36367 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
36368 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
36369 : /* a pointer to a NULL pointer */
36370 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
36371 0 : return self;
36372 : }
36373 :
36374 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36375 : {
36376 :
36377 :
36378 0 : return PyLong_FromLong(48);
36379 : }
36380 :
36381 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36382 : {
36383 0 : const struct ndr_interface_call *call = NULL;
36384 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36385 0 : PyObject *ret = NULL;
36386 0 : struct ndr_push *push = NULL;
36387 0 : DATA_BLOB blob;
36388 0 : enum ndr_err_code err;
36389 :
36390 0 : if (ndr_table_lsarpc.num_calls < 49) {
36391 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_pack");
36392 0 : return NULL;
36393 : }
36394 0 : call = &ndr_table_lsarpc.calls[48];
36395 :
36396 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36397 0 : if (push == NULL) {
36398 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36399 0 : return NULL;
36400 : }
36401 :
36402 0 : push->flags |= ndr_push_flags;
36403 :
36404 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36405 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36406 0 : TALLOC_FREE(push);
36407 0 : PyErr_SetNdrError(err);
36408 0 : return NULL;
36409 : }
36410 0 : blob = ndr_push_blob(push);
36411 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36412 0 : TALLOC_FREE(push);
36413 0 : return ret;
36414 : }
36415 :
36416 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36417 : {
36418 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36419 0 : PyObject *bigendian_obj = NULL;
36420 0 : PyObject *ndr64_obj = NULL;
36421 0 : libndr_flags ndr_push_flags = 0;
36422 :
36423 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36424 : discard_const_p(char *, kwnames),
36425 : &bigendian_obj,
36426 : &ndr64_obj)) {
36427 0 : return NULL;
36428 : }
36429 :
36430 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36431 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36432 : }
36433 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36434 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36435 : }
36436 :
36437 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36438 : }
36439 :
36440 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36441 : {
36442 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36443 0 : PyObject *bigendian_obj = NULL;
36444 0 : PyObject *ndr64_obj = NULL;
36445 0 : libndr_flags ndr_push_flags = 0;
36446 :
36447 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36448 : discard_const_p(char *, kwnames),
36449 : &bigendian_obj,
36450 : &ndr64_obj)) {
36451 0 : return NULL;
36452 : }
36453 :
36454 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36455 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36456 : }
36457 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36458 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36459 : }
36460 :
36461 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36462 : }
36463 :
36464 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
36465 : {
36466 0 : const struct ndr_interface_call *call = NULL;
36467 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36468 0 : struct ndr_pull *pull = NULL;
36469 0 : enum ndr_err_code err;
36470 :
36471 0 : if (ndr_table_lsarpc.num_calls < 49) {
36472 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_unpack");
36473 0 : return NULL;
36474 : }
36475 0 : call = &ndr_table_lsarpc.calls[48];
36476 :
36477 0 : pull = ndr_pull_init_blob(blob, object);
36478 0 : if (pull == NULL) {
36479 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36480 0 : return NULL;
36481 : }
36482 :
36483 0 : pull->flags |= ndr_pull_flags;
36484 :
36485 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36486 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36487 0 : TALLOC_FREE(pull);
36488 0 : PyErr_SetNdrError(err);
36489 0 : return NULL;
36490 : }
36491 0 : if (!allow_remaining) {
36492 0 : uint32_t highest_ofs;
36493 :
36494 0 : if (pull->offset > pull->relative_highest_offset) {
36495 0 : highest_ofs = pull->offset;
36496 : } else {
36497 0 : highest_ofs = pull->relative_highest_offset;
36498 : }
36499 0 : if (highest_ofs < pull->data_size) {
36500 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36501 : "not all bytes consumed ofs[%u] size[%u]",
36502 : highest_ofs, pull->data_size);
36503 0 : TALLOC_FREE(pull);
36504 0 : PyErr_SetNdrError(err);
36505 0 : return NULL;
36506 : }
36507 : }
36508 :
36509 0 : TALLOC_FREE(pull);
36510 0 : Py_RETURN_NONE;
36511 : }
36512 :
36513 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36514 : {
36515 0 : DATA_BLOB blob;
36516 0 : Py_ssize_t blob_length = 0;
36517 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36518 0 : PyObject *bigendian_obj = NULL;
36519 0 : PyObject *ndr64_obj = NULL;
36520 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36521 0 : PyObject *allow_remaining_obj = NULL;
36522 0 : bool allow_remaining = false;
36523 :
36524 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36525 : discard_const_p(char *, kwnames),
36526 : &blob.data, &blob_length,
36527 : &bigendian_obj,
36528 : &ndr64_obj,
36529 : &allow_remaining_obj)) {
36530 0 : return NULL;
36531 : }
36532 0 : blob.length = blob_length;
36533 :
36534 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36535 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36536 : }
36537 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36538 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36539 : }
36540 :
36541 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36542 0 : allow_remaining = true;
36543 : }
36544 :
36545 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36546 : }
36547 :
36548 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36549 : {
36550 0 : DATA_BLOB blob;
36551 0 : Py_ssize_t blob_length = 0;
36552 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36553 0 : PyObject *bigendian_obj = NULL;
36554 0 : PyObject *ndr64_obj = NULL;
36555 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36556 0 : PyObject *allow_remaining_obj = NULL;
36557 0 : bool allow_remaining = false;
36558 :
36559 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36560 : discard_const_p(char *, kwnames),
36561 : &blob.data, &blob_length,
36562 : &bigendian_obj,
36563 : &ndr64_obj,
36564 : &allow_remaining_obj)) {
36565 0 : return NULL;
36566 : }
36567 0 : blob.length = blob_length;
36568 :
36569 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36570 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36571 : }
36572 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36573 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36574 : }
36575 :
36576 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36577 0 : allow_remaining = true;
36578 : }
36579 :
36580 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36581 : }
36582 :
36583 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36584 : {
36585 0 : const struct ndr_interface_call *call = NULL;
36586 0 : struct lsa_QueryTrustedDomainInfoByName *object = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36587 0 : PyObject *ret;
36588 0 : char *retstr;
36589 :
36590 0 : if (ndr_table_lsarpc.num_calls < 49) {
36591 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_print");
36592 0 : return NULL;
36593 : }
36594 0 : call = &ndr_table_lsarpc.calls[48];
36595 :
36596 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36597 0 : ret = PyUnicode_FromString(retstr);
36598 0 : TALLOC_FREE(retstr);
36599 :
36600 0 : return ret;
36601 : }
36602 :
36603 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36604 : {
36605 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_in", NDR_IN);
36606 : }
36607 :
36608 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36609 : {
36610 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_out", NDR_OUT);
36611 : }
36612 :
36613 : static PyMethodDef py_lsa_QueryTrustedDomainInfoByName_methods[] = {
36614 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
36615 : "lsa.QueryTrustedDomainInfoByName.opnum() -> 48 (0x30) " },
36616 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36617 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36618 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36619 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36620 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36621 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36622 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36623 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36624 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36625 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36626 : { NULL, NULL, 0, NULL }
36627 : };
36628 :
36629 :
36630 : static PyTypeObject lsa_QueryTrustedDomainInfoByName_Type = {
36631 : PyVarObject_HEAD_INIT(NULL, 0)
36632 : .tp_name = "lsa.QueryTrustedDomainInfoByName",
36633 : .tp_getset = py_lsa_QueryTrustedDomainInfoByName_getsetters,
36634 : .tp_methods = py_lsa_QueryTrustedDomainInfoByName_methods,
36635 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36636 : .tp_new = py_lsa_QueryTrustedDomainInfoByName_new,
36637 : };
36638 :
36639 190 : static bool pack_py_lsa_QueryTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoByName *r)
36640 : {
36641 0 : PyObject *py_handle;
36642 0 : PyObject *py_trusted_domain;
36643 0 : PyObject *py_level;
36644 190 : const char *kwnames[] = {
36645 : "handle", "trusted_domain", "level", NULL
36646 : };
36647 :
36648 190 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level)) {
36649 0 : return false;
36650 : }
36651 :
36652 190 : if (py_handle == NULL) {
36653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
36654 0 : return false;
36655 : }
36656 190 : r->in.handle = talloc_ptrtype(r, r->in.handle);
36657 190 : if (r->in.handle == NULL) {
36658 0 : PyErr_NoMemory();
36659 0 : return false;
36660 : }
36661 190 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
36662 190 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
36663 0 : PyErr_NoMemory();
36664 0 : return false;
36665 : }
36666 190 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
36667 190 : if (py_trusted_domain == NULL) {
36668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain");
36669 0 : return false;
36670 : }
36671 190 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
36672 190 : if (r->in.trusted_domain == NULL) {
36673 0 : PyErr_NoMemory();
36674 0 : return false;
36675 : }
36676 190 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
36677 190 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
36678 0 : PyErr_NoMemory();
36679 0 : return false;
36680 : }
36681 190 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
36682 190 : if (py_level == NULL) {
36683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36684 0 : return false;
36685 : }
36686 : {
36687 190 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36688 190 : if (PyLong_Check(py_level)) {
36689 0 : unsigned long long test_var;
36690 190 : test_var = PyLong_AsUnsignedLongLong(py_level);
36691 190 : if (PyErr_Occurred() != NULL) {
36692 0 : return false;
36693 : }
36694 190 : if (test_var > uint_max) {
36695 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36696 : PyLong_Type.tp_name, uint_max, test_var);
36697 0 : return false;
36698 : }
36699 190 : r->in.level = test_var;
36700 : } else {
36701 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36702 : PyLong_Type.tp_name);
36703 0 : return false;
36704 : }
36705 : }
36706 190 : return true;
36707 : }
36708 :
36709 190 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoByName_args_out(struct lsa_QueryTrustedDomainInfoByName *r)
36710 : {
36711 0 : PyObject *result;
36712 0 : PyObject *py_info;
36713 190 : if (*r->out.info == NULL) {
36714 46 : py_info = Py_None;
36715 24 : Py_INCREF(py_info);
36716 : } else {
36717 144 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
36718 144 : if (py_info == NULL) {
36719 0 : return NULL;
36720 : }
36721 : }
36722 190 : result = py_info;
36723 190 : if (NT_STATUS_IS_ERR(r->out.result)) {
36724 46 : PyErr_SetNTSTATUS(r->out.result);
36725 46 : return NULL;
36726 : }
36727 :
36728 144 : return result;
36729 : }
36730 :
36731 :
36732 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
36733 : {
36734 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36735 0 : PyObject *py_handle;
36736 0 : if (object->in.handle == NULL) {
36737 0 : Py_RETURN_NONE;
36738 : }
36739 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36740 0 : return py_handle;
36741 : }
36742 :
36743 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36744 : {
36745 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36746 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36747 0 : if (value == NULL) {
36748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
36749 0 : return -1;
36750 : }
36751 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36752 0 : if (object->in.handle == NULL) {
36753 0 : PyErr_NoMemory();
36754 0 : return -1;
36755 : }
36756 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36757 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36758 0 : PyErr_NoMemory();
36759 0 : return -1;
36760 : }
36761 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36762 0 : return 0;
36763 : }
36764 :
36765 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
36766 : {
36767 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36768 0 : PyObject *py_trusted_domain;
36769 0 : if (object->in.trusted_domain == NULL) {
36770 0 : Py_RETURN_NONE;
36771 : }
36772 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
36773 0 : return py_trusted_domain;
36774 : }
36775 :
36776 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
36777 : {
36778 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36779 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
36780 0 : if (value == NULL) {
36781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain");
36782 0 : return -1;
36783 : }
36784 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
36785 0 : if (object->in.trusted_domain == NULL) {
36786 0 : PyErr_NoMemory();
36787 0 : return -1;
36788 : }
36789 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
36790 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36791 0 : PyErr_NoMemory();
36792 0 : return -1;
36793 : }
36794 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
36795 0 : return 0;
36796 : }
36797 :
36798 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
36799 : {
36800 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36801 0 : PyObject *py_level;
36802 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
36803 0 : return py_level;
36804 : }
36805 :
36806 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36807 : {
36808 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36809 0 : if (value == NULL) {
36810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
36811 0 : return -1;
36812 : }
36813 : {
36814 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36815 0 : if (PyLong_Check(value)) {
36816 0 : unsigned long long test_var;
36817 0 : test_var = PyLong_AsUnsignedLongLong(value);
36818 0 : if (PyErr_Occurred() != NULL) {
36819 0 : return -1;
36820 : }
36821 0 : if (test_var > uint_max) {
36822 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36823 : PyLong_Type.tp_name, uint_max, test_var);
36824 0 : return -1;
36825 : }
36826 0 : object->in.level = test_var;
36827 : } else {
36828 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36829 : PyLong_Type.tp_name);
36830 0 : return -1;
36831 : }
36832 : }
36833 0 : return 0;
36834 : }
36835 :
36836 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_info(PyObject *obj, void *closure)
36837 : {
36838 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36839 0 : PyObject *py_info;
36840 0 : if (object->in.info == NULL) {
36841 0 : Py_RETURN_NONE;
36842 : }
36843 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
36844 0 : if (py_info == NULL) {
36845 0 : return NULL;
36846 : }
36847 0 : return py_info;
36848 : }
36849 :
36850 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
36851 : {
36852 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36853 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
36854 0 : if (value == NULL) {
36855 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
36856 0 : return -1;
36857 : }
36858 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
36859 0 : if (object->in.info == NULL) {
36860 0 : PyErr_NoMemory();
36861 0 : return -1;
36862 : }
36863 : {
36864 0 : union lsa_TrustedDomainInfo *info_switch_1;
36865 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");
36866 0 : if (info_switch_1 == NULL) {
36867 0 : return -1;
36868 : }
36869 0 : object->in.info = info_switch_1;
36870 : }
36871 0 : return 0;
36872 : }
36873 :
36874 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
36875 : {
36876 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(obj);
36877 0 : PyObject *py_result;
36878 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36879 0 : return py_result;
36880 : }
36881 :
36882 0 : static int py_lsa_SetTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
36883 : {
36884 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36885 0 : if (value == NULL) {
36886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36887 0 : return -1;
36888 : }
36889 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36890 0 : return 0;
36891 : }
36892 :
36893 : static PyGetSetDef py_lsa_SetTrustedDomainInfoByName_getsetters[] = {
36894 : {
36895 : .name = discard_const_p(char, "in_handle"),
36896 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_handle,
36897 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_handle,
36898 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36899 : },
36900 : {
36901 : .name = discard_const_p(char, "in_trusted_domain"),
36902 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain,
36903 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain,
36904 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
36905 : },
36906 : {
36907 : .name = discard_const_p(char, "in_level"),
36908 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_level,
36909 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_level,
36910 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
36911 : },
36912 : {
36913 : .name = discard_const_p(char, "in_info"),
36914 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_info,
36915 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_info,
36916 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
36917 : },
36918 : {
36919 : .name = discard_const_p(char, "result"),
36920 : .get = py_lsa_SetTrustedDomainInfoByName_get_result,
36921 : .set = py_lsa_SetTrustedDomainInfoByName_set_result,
36922 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36923 : },
36924 : { .name = NULL }
36925 : };
36926 :
36927 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36928 : {
36929 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfoByName, type);
36930 0 : struct lsa_SetTrustedDomainInfoByName *_self = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(self);
36931 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36932 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
36933 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
36934 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
36935 0 : return self;
36936 : }
36937 :
36938 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36939 : {
36940 :
36941 :
36942 0 : return PyLong_FromLong(49);
36943 : }
36944 :
36945 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36946 : {
36947 0 : const struct ndr_interface_call *call = NULL;
36948 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
36949 0 : PyObject *ret = NULL;
36950 0 : struct ndr_push *push = NULL;
36951 0 : DATA_BLOB blob;
36952 0 : enum ndr_err_code err;
36953 :
36954 0 : if (ndr_table_lsarpc.num_calls < 50) {
36955 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_pack");
36956 0 : return NULL;
36957 : }
36958 0 : call = &ndr_table_lsarpc.calls[49];
36959 :
36960 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36961 0 : if (push == NULL) {
36962 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36963 0 : return NULL;
36964 : }
36965 :
36966 0 : push->flags |= ndr_push_flags;
36967 :
36968 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36969 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36970 0 : TALLOC_FREE(push);
36971 0 : PyErr_SetNdrError(err);
36972 0 : return NULL;
36973 : }
36974 0 : blob = ndr_push_blob(push);
36975 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36976 0 : TALLOC_FREE(push);
36977 0 : return ret;
36978 : }
36979 :
36980 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36981 : {
36982 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36983 0 : PyObject *bigendian_obj = NULL;
36984 0 : PyObject *ndr64_obj = NULL;
36985 0 : libndr_flags ndr_push_flags = 0;
36986 :
36987 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36988 : discard_const_p(char *, kwnames),
36989 : &bigendian_obj,
36990 : &ndr64_obj)) {
36991 0 : return NULL;
36992 : }
36993 :
36994 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36995 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36996 : }
36997 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36998 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36999 : }
37000 :
37001 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37002 : }
37003 :
37004 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37005 : {
37006 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37007 0 : PyObject *bigendian_obj = NULL;
37008 0 : PyObject *ndr64_obj = NULL;
37009 0 : libndr_flags ndr_push_flags = 0;
37010 :
37011 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37012 : discard_const_p(char *, kwnames),
37013 : &bigendian_obj,
37014 : &ndr64_obj)) {
37015 0 : return NULL;
37016 : }
37017 :
37018 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37019 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37020 : }
37021 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37022 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37023 : }
37024 :
37025 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37026 : }
37027 :
37028 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37029 : {
37030 0 : const struct ndr_interface_call *call = NULL;
37031 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
37032 0 : struct ndr_pull *pull = NULL;
37033 0 : enum ndr_err_code err;
37034 :
37035 0 : if (ndr_table_lsarpc.num_calls < 50) {
37036 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_unpack");
37037 0 : return NULL;
37038 : }
37039 0 : call = &ndr_table_lsarpc.calls[49];
37040 :
37041 0 : pull = ndr_pull_init_blob(blob, object);
37042 0 : if (pull == NULL) {
37043 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37044 0 : return NULL;
37045 : }
37046 :
37047 0 : pull->flags |= ndr_pull_flags;
37048 :
37049 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37050 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37051 0 : TALLOC_FREE(pull);
37052 0 : PyErr_SetNdrError(err);
37053 0 : return NULL;
37054 : }
37055 0 : if (!allow_remaining) {
37056 0 : uint32_t highest_ofs;
37057 :
37058 0 : if (pull->offset > pull->relative_highest_offset) {
37059 0 : highest_ofs = pull->offset;
37060 : } else {
37061 0 : highest_ofs = pull->relative_highest_offset;
37062 : }
37063 0 : if (highest_ofs < pull->data_size) {
37064 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37065 : "not all bytes consumed ofs[%u] size[%u]",
37066 : highest_ofs, pull->data_size);
37067 0 : TALLOC_FREE(pull);
37068 0 : PyErr_SetNdrError(err);
37069 0 : return NULL;
37070 : }
37071 : }
37072 :
37073 0 : TALLOC_FREE(pull);
37074 0 : Py_RETURN_NONE;
37075 : }
37076 :
37077 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37078 : {
37079 0 : DATA_BLOB blob;
37080 0 : Py_ssize_t blob_length = 0;
37081 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37082 0 : PyObject *bigendian_obj = NULL;
37083 0 : PyObject *ndr64_obj = NULL;
37084 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37085 0 : PyObject *allow_remaining_obj = NULL;
37086 0 : bool allow_remaining = false;
37087 :
37088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37089 : discard_const_p(char *, kwnames),
37090 : &blob.data, &blob_length,
37091 : &bigendian_obj,
37092 : &ndr64_obj,
37093 : &allow_remaining_obj)) {
37094 0 : return NULL;
37095 : }
37096 0 : blob.length = blob_length;
37097 :
37098 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37099 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37100 : }
37101 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37102 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37103 : }
37104 :
37105 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37106 0 : allow_remaining = true;
37107 : }
37108 :
37109 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37110 : }
37111 :
37112 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37113 : {
37114 0 : DATA_BLOB blob;
37115 0 : Py_ssize_t blob_length = 0;
37116 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37117 0 : PyObject *bigendian_obj = NULL;
37118 0 : PyObject *ndr64_obj = NULL;
37119 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37120 0 : PyObject *allow_remaining_obj = NULL;
37121 0 : bool allow_remaining = false;
37122 :
37123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37124 : discard_const_p(char *, kwnames),
37125 : &blob.data, &blob_length,
37126 : &bigendian_obj,
37127 : &ndr64_obj,
37128 : &allow_remaining_obj)) {
37129 0 : return NULL;
37130 : }
37131 0 : blob.length = blob_length;
37132 :
37133 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37134 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37135 : }
37136 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37137 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37138 : }
37139 :
37140 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37141 0 : allow_remaining = true;
37142 : }
37143 :
37144 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37145 : }
37146 :
37147 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37148 : {
37149 0 : const struct ndr_interface_call *call = NULL;
37150 0 : struct lsa_SetTrustedDomainInfoByName *object = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(py_obj);
37151 0 : PyObject *ret;
37152 0 : char *retstr;
37153 :
37154 0 : if (ndr_table_lsarpc.num_calls < 50) {
37155 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_print");
37156 0 : return NULL;
37157 : }
37158 0 : call = &ndr_table_lsarpc.calls[49];
37159 :
37160 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37161 0 : ret = PyUnicode_FromString(retstr);
37162 0 : TALLOC_FREE(retstr);
37163 :
37164 0 : return ret;
37165 : }
37166 :
37167 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37168 : {
37169 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_in", NDR_IN);
37170 : }
37171 :
37172 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37173 : {
37174 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_out", NDR_OUT);
37175 : }
37176 :
37177 : static PyMethodDef py_lsa_SetTrustedDomainInfoByName_methods[] = {
37178 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
37179 : "lsa.SetTrustedDomainInfoByName.opnum() -> 49 (0x31) " },
37180 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37181 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37182 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37183 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37184 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37185 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37186 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37187 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37188 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37189 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37190 : { NULL, NULL, 0, NULL }
37191 : };
37192 :
37193 :
37194 : static PyTypeObject lsa_SetTrustedDomainInfoByName_Type = {
37195 : PyVarObject_HEAD_INIT(NULL, 0)
37196 : .tp_name = "lsa.SetTrustedDomainInfoByName",
37197 : .tp_getset = py_lsa_SetTrustedDomainInfoByName_getsetters,
37198 : .tp_methods = py_lsa_SetTrustedDomainInfoByName_methods,
37199 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37200 : .tp_new = py_lsa_SetTrustedDomainInfoByName_new,
37201 : };
37202 :
37203 0 : static bool pack_py_lsa_SetTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfoByName *r)
37204 : {
37205 0 : PyObject *py_handle;
37206 0 : PyObject *py_trusted_domain;
37207 0 : PyObject *py_level;
37208 0 : PyObject *py_info;
37209 0 : const char *kwnames[] = {
37210 : "handle", "trusted_domain", "level", "info", NULL
37211 : };
37212 :
37213 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level, &py_info)) {
37214 0 : return false;
37215 : }
37216 :
37217 0 : if (py_handle == NULL) {
37218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
37219 0 : return false;
37220 : }
37221 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37222 0 : if (r->in.handle == NULL) {
37223 0 : PyErr_NoMemory();
37224 0 : return false;
37225 : }
37226 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37227 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37228 0 : PyErr_NoMemory();
37229 0 : return false;
37230 : }
37231 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37232 0 : if (py_trusted_domain == NULL) {
37233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain");
37234 0 : return false;
37235 : }
37236 0 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
37237 0 : if (r->in.trusted_domain == NULL) {
37238 0 : PyErr_NoMemory();
37239 0 : return false;
37240 : }
37241 0 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
37242 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
37243 0 : PyErr_NoMemory();
37244 0 : return false;
37245 : }
37246 0 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
37247 0 : if (py_level == NULL) {
37248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
37249 0 : return false;
37250 : }
37251 : {
37252 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
37253 0 : if (PyLong_Check(py_level)) {
37254 0 : unsigned long long test_var;
37255 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
37256 0 : if (PyErr_Occurred() != NULL) {
37257 0 : return false;
37258 : }
37259 0 : if (test_var > uint_max) {
37260 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37261 : PyLong_Type.tp_name, uint_max, test_var);
37262 0 : return false;
37263 : }
37264 0 : r->in.level = test_var;
37265 : } else {
37266 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37267 : PyLong_Type.tp_name);
37268 0 : return false;
37269 : }
37270 : }
37271 0 : if (py_info == NULL) {
37272 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
37273 0 : return false;
37274 : }
37275 0 : r->in.info = talloc_ptrtype(r, r->in.info);
37276 0 : if (r->in.info == NULL) {
37277 0 : PyErr_NoMemory();
37278 0 : return false;
37279 : }
37280 : {
37281 0 : union lsa_TrustedDomainInfo *info_switch_1;
37282 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
37283 0 : if (info_switch_1 == NULL) {
37284 0 : return false;
37285 : }
37286 0 : r->in.info = info_switch_1;
37287 : }
37288 0 : return true;
37289 : }
37290 :
37291 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfoByName_args_out(struct lsa_SetTrustedDomainInfoByName *r)
37292 : {
37293 0 : PyObject *result;
37294 0 : result = Py_None;
37295 0 : Py_INCREF(result);
37296 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37297 0 : PyErr_SetNTSTATUS(r->out.result);
37298 0 : return NULL;
37299 : }
37300 :
37301 0 : return result;
37302 : }
37303 :
37304 :
37305 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_handle(PyObject *obj, void *closure)
37306 : {
37307 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37308 0 : PyObject *py_handle;
37309 0 : if (object->in.handle == NULL) {
37310 0 : Py_RETURN_NONE;
37311 : }
37312 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
37313 0 : return py_handle;
37314 : }
37315 :
37316 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
37317 : {
37318 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37319 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
37320 0 : if (value == NULL) {
37321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
37322 0 : return -1;
37323 : }
37324 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
37325 0 : if (object->in.handle == NULL) {
37326 0 : PyErr_NoMemory();
37327 0 : return -1;
37328 : }
37329 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37330 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37331 0 : PyErr_NoMemory();
37332 0 : return -1;
37333 : }
37334 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
37335 0 : return 0;
37336 : }
37337 :
37338 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_resume_handle(PyObject *obj, void *closure)
37339 : {
37340 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37341 0 : PyObject *py_resume_handle;
37342 0 : if (object->in.resume_handle == NULL) {
37343 0 : Py_RETURN_NONE;
37344 : }
37345 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
37346 0 : return py_resume_handle;
37347 : }
37348 :
37349 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
37350 : {
37351 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37352 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
37353 0 : if (value == NULL) {
37354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
37355 0 : return -1;
37356 : }
37357 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
37358 0 : if (object->in.resume_handle == NULL) {
37359 0 : PyErr_NoMemory();
37360 0 : return -1;
37361 : }
37362 : {
37363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
37364 0 : if (PyLong_Check(value)) {
37365 0 : unsigned long long test_var;
37366 0 : test_var = PyLong_AsUnsignedLongLong(value);
37367 0 : if (PyErr_Occurred() != NULL) {
37368 0 : return -1;
37369 : }
37370 0 : if (test_var > uint_max) {
37371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37372 : PyLong_Type.tp_name, uint_max, test_var);
37373 0 : return -1;
37374 : }
37375 0 : *object->in.resume_handle = test_var;
37376 : } else {
37377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37378 : PyLong_Type.tp_name);
37379 0 : return -1;
37380 : }
37381 : }
37382 0 : return 0;
37383 : }
37384 :
37385 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_resume_handle(PyObject *obj, void *closure)
37386 : {
37387 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37388 0 : PyObject *py_resume_handle;
37389 0 : if (object->out.resume_handle == NULL) {
37390 0 : Py_RETURN_NONE;
37391 : }
37392 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
37393 0 : return py_resume_handle;
37394 : }
37395 :
37396 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
37397 : {
37398 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37399 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
37400 0 : if (value == NULL) {
37401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
37402 0 : return -1;
37403 : }
37404 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
37405 0 : if (object->out.resume_handle == NULL) {
37406 0 : PyErr_NoMemory();
37407 0 : return -1;
37408 : }
37409 : {
37410 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
37411 0 : if (PyLong_Check(value)) {
37412 0 : unsigned long long test_var;
37413 0 : test_var = PyLong_AsUnsignedLongLong(value);
37414 0 : if (PyErr_Occurred() != NULL) {
37415 0 : return -1;
37416 : }
37417 0 : if (test_var > uint_max) {
37418 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37419 : PyLong_Type.tp_name, uint_max, test_var);
37420 0 : return -1;
37421 : }
37422 0 : *object->out.resume_handle = test_var;
37423 : } else {
37424 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37425 : PyLong_Type.tp_name);
37426 0 : return -1;
37427 : }
37428 : }
37429 0 : return 0;
37430 : }
37431 :
37432 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_domains(PyObject *obj, void *closure)
37433 : {
37434 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37435 0 : PyObject *py_domains;
37436 0 : if (object->out.domains == NULL) {
37437 0 : Py_RETURN_NONE;
37438 : }
37439 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, object->out.domains, object->out.domains);
37440 0 : return py_domains;
37441 : }
37442 :
37443 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
37444 : {
37445 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37446 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
37447 0 : if (value == NULL) {
37448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
37449 0 : return -1;
37450 : }
37451 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
37452 0 : if (object->out.domains == NULL) {
37453 0 : PyErr_NoMemory();
37454 0 : return -1;
37455 : }
37456 0 : PY_CHECK_TYPE(&lsa_DomainListEx_Type, value, return -1;);
37457 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37458 0 : PyErr_NoMemory();
37459 0 : return -1;
37460 : }
37461 0 : object->out.domains = (struct lsa_DomainListEx *)pytalloc_get_ptr(value);
37462 0 : return 0;
37463 : }
37464 :
37465 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_max_size(PyObject *obj, void *closure)
37466 : {
37467 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37468 0 : PyObject *py_max_size;
37469 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
37470 0 : return py_max_size;
37471 : }
37472 :
37473 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
37474 : {
37475 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37476 0 : if (value == NULL) {
37477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
37478 0 : return -1;
37479 : }
37480 : {
37481 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
37482 0 : if (PyLong_Check(value)) {
37483 0 : unsigned long long test_var;
37484 0 : test_var = PyLong_AsUnsignedLongLong(value);
37485 0 : if (PyErr_Occurred() != NULL) {
37486 0 : return -1;
37487 : }
37488 0 : if (test_var > uint_max) {
37489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37490 : PyLong_Type.tp_name, uint_max, test_var);
37491 0 : return -1;
37492 : }
37493 0 : object->in.max_size = test_var;
37494 : } else {
37495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37496 : PyLong_Type.tp_name);
37497 0 : return -1;
37498 : }
37499 : }
37500 0 : return 0;
37501 : }
37502 :
37503 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_get_result(PyObject *obj, void *closure)
37504 : {
37505 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(obj);
37506 0 : PyObject *py_result;
37507 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37508 0 : return py_result;
37509 : }
37510 :
37511 0 : static int py_lsa_EnumTrustedDomainsEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
37512 : {
37513 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37514 0 : if (value == NULL) {
37515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37516 0 : return -1;
37517 : }
37518 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37519 0 : return 0;
37520 : }
37521 :
37522 : static PyGetSetDef py_lsa_EnumTrustedDomainsEx_getsetters[] = {
37523 : {
37524 : .name = discard_const_p(char, "in_handle"),
37525 : .get = py_lsa_EnumTrustedDomainsEx_in_get_handle,
37526 : .set = py_lsa_EnumTrustedDomainsEx_in_set_handle,
37527 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37528 : },
37529 : {
37530 : .name = discard_const_p(char, "in_resume_handle"),
37531 : .get = py_lsa_EnumTrustedDomainsEx_in_get_resume_handle,
37532 : .set = py_lsa_EnumTrustedDomainsEx_in_set_resume_handle,
37533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37534 : },
37535 : {
37536 : .name = discard_const_p(char, "out_resume_handle"),
37537 : .get = py_lsa_EnumTrustedDomainsEx_out_get_resume_handle,
37538 : .set = py_lsa_EnumTrustedDomainsEx_out_set_resume_handle,
37539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37540 : },
37541 : {
37542 : .name = discard_const_p(char, "out_domains"),
37543 : .get = py_lsa_EnumTrustedDomainsEx_out_get_domains,
37544 : .set = py_lsa_EnumTrustedDomainsEx_out_set_domains,
37545 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainListEx")
37546 : },
37547 : {
37548 : .name = discard_const_p(char, "in_max_size"),
37549 : .get = py_lsa_EnumTrustedDomainsEx_in_get_max_size,
37550 : .set = py_lsa_EnumTrustedDomainsEx_in_set_max_size,
37551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
37552 : },
37553 : {
37554 : .name = discard_const_p(char, "result"),
37555 : .get = py_lsa_EnumTrustedDomainsEx_get_result,
37556 : .set = py_lsa_EnumTrustedDomainsEx_set_result,
37557 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37558 : },
37559 : { .name = NULL }
37560 : };
37561 :
37562 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37563 : {
37564 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustedDomainsEx, type);
37565 0 : struct lsa_EnumTrustedDomainsEx *_self = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(self);
37566 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37567 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
37568 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
37569 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
37570 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainListEx);
37571 0 : return self;
37572 : }
37573 :
37574 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37575 : {
37576 :
37577 :
37578 0 : return PyLong_FromLong(50);
37579 : }
37580 :
37581 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37582 : {
37583 0 : const struct ndr_interface_call *call = NULL;
37584 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37585 0 : PyObject *ret = NULL;
37586 0 : struct ndr_push *push = NULL;
37587 0 : DATA_BLOB blob;
37588 0 : enum ndr_err_code err;
37589 :
37590 0 : if (ndr_table_lsarpc.num_calls < 51) {
37591 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_pack");
37592 0 : return NULL;
37593 : }
37594 0 : call = &ndr_table_lsarpc.calls[50];
37595 :
37596 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37597 0 : if (push == NULL) {
37598 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37599 0 : return NULL;
37600 : }
37601 :
37602 0 : push->flags |= ndr_push_flags;
37603 :
37604 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37605 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37606 0 : TALLOC_FREE(push);
37607 0 : PyErr_SetNdrError(err);
37608 0 : return NULL;
37609 : }
37610 0 : blob = ndr_push_blob(push);
37611 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37612 0 : TALLOC_FREE(push);
37613 0 : return ret;
37614 : }
37615 :
37616 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37617 : {
37618 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37619 0 : PyObject *bigendian_obj = NULL;
37620 0 : PyObject *ndr64_obj = NULL;
37621 0 : libndr_flags ndr_push_flags = 0;
37622 :
37623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37624 : discard_const_p(char *, kwnames),
37625 : &bigendian_obj,
37626 : &ndr64_obj)) {
37627 0 : return NULL;
37628 : }
37629 :
37630 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37631 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37632 : }
37633 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37634 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37635 : }
37636 :
37637 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37638 : }
37639 :
37640 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37641 : {
37642 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37643 0 : PyObject *bigendian_obj = NULL;
37644 0 : PyObject *ndr64_obj = NULL;
37645 0 : libndr_flags ndr_push_flags = 0;
37646 :
37647 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37648 : discard_const_p(char *, kwnames),
37649 : &bigendian_obj,
37650 : &ndr64_obj)) {
37651 0 : return NULL;
37652 : }
37653 :
37654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37655 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37656 : }
37657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37658 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37659 : }
37660 :
37661 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37662 : }
37663 :
37664 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37665 : {
37666 0 : const struct ndr_interface_call *call = NULL;
37667 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37668 0 : struct ndr_pull *pull = NULL;
37669 0 : enum ndr_err_code err;
37670 :
37671 0 : if (ndr_table_lsarpc.num_calls < 51) {
37672 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_unpack");
37673 0 : return NULL;
37674 : }
37675 0 : call = &ndr_table_lsarpc.calls[50];
37676 :
37677 0 : pull = ndr_pull_init_blob(blob, object);
37678 0 : if (pull == NULL) {
37679 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37680 0 : return NULL;
37681 : }
37682 :
37683 0 : pull->flags |= ndr_pull_flags;
37684 :
37685 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37686 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37687 0 : TALLOC_FREE(pull);
37688 0 : PyErr_SetNdrError(err);
37689 0 : return NULL;
37690 : }
37691 0 : if (!allow_remaining) {
37692 0 : uint32_t highest_ofs;
37693 :
37694 0 : if (pull->offset > pull->relative_highest_offset) {
37695 0 : highest_ofs = pull->offset;
37696 : } else {
37697 0 : highest_ofs = pull->relative_highest_offset;
37698 : }
37699 0 : if (highest_ofs < pull->data_size) {
37700 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37701 : "not all bytes consumed ofs[%u] size[%u]",
37702 : highest_ofs, pull->data_size);
37703 0 : TALLOC_FREE(pull);
37704 0 : PyErr_SetNdrError(err);
37705 0 : return NULL;
37706 : }
37707 : }
37708 :
37709 0 : TALLOC_FREE(pull);
37710 0 : Py_RETURN_NONE;
37711 : }
37712 :
37713 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37714 : {
37715 0 : DATA_BLOB blob;
37716 0 : Py_ssize_t blob_length = 0;
37717 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37718 0 : PyObject *bigendian_obj = NULL;
37719 0 : PyObject *ndr64_obj = NULL;
37720 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37721 0 : PyObject *allow_remaining_obj = NULL;
37722 0 : bool allow_remaining = false;
37723 :
37724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37725 : discard_const_p(char *, kwnames),
37726 : &blob.data, &blob_length,
37727 : &bigendian_obj,
37728 : &ndr64_obj,
37729 : &allow_remaining_obj)) {
37730 0 : return NULL;
37731 : }
37732 0 : blob.length = blob_length;
37733 :
37734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37735 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37736 : }
37737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37738 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37739 : }
37740 :
37741 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37742 0 : allow_remaining = true;
37743 : }
37744 :
37745 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37746 : }
37747 :
37748 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37749 : {
37750 0 : DATA_BLOB blob;
37751 0 : Py_ssize_t blob_length = 0;
37752 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37753 0 : PyObject *bigendian_obj = NULL;
37754 0 : PyObject *ndr64_obj = NULL;
37755 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37756 0 : PyObject *allow_remaining_obj = NULL;
37757 0 : bool allow_remaining = false;
37758 :
37759 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37760 : discard_const_p(char *, kwnames),
37761 : &blob.data, &blob_length,
37762 : &bigendian_obj,
37763 : &ndr64_obj,
37764 : &allow_remaining_obj)) {
37765 0 : return NULL;
37766 : }
37767 0 : blob.length = blob_length;
37768 :
37769 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37770 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37771 : }
37772 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37773 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37774 : }
37775 :
37776 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37777 0 : allow_remaining = true;
37778 : }
37779 :
37780 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37781 : }
37782 :
37783 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37784 : {
37785 0 : const struct ndr_interface_call *call = NULL;
37786 0 : struct lsa_EnumTrustedDomainsEx *object = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(py_obj);
37787 0 : PyObject *ret;
37788 0 : char *retstr;
37789 :
37790 0 : if (ndr_table_lsarpc.num_calls < 51) {
37791 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_print");
37792 0 : return NULL;
37793 : }
37794 0 : call = &ndr_table_lsarpc.calls[50];
37795 :
37796 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37797 0 : ret = PyUnicode_FromString(retstr);
37798 0 : TALLOC_FREE(retstr);
37799 :
37800 0 : return ret;
37801 : }
37802 :
37803 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37804 : {
37805 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_in", NDR_IN);
37806 : }
37807 :
37808 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37809 : {
37810 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_out", NDR_OUT);
37811 : }
37812 :
37813 : static PyMethodDef py_lsa_EnumTrustedDomainsEx_methods[] = {
37814 : { "opnum", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_opnum, METH_NOARGS|METH_CLASS,
37815 : "lsa.EnumTrustedDomainsEx.opnum() -> 50 (0x32) " },
37816 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37817 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37818 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37819 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37820 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37821 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37822 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37823 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37824 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37825 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37826 : { NULL, NULL, 0, NULL }
37827 : };
37828 :
37829 :
37830 : static PyTypeObject lsa_EnumTrustedDomainsEx_Type = {
37831 : PyVarObject_HEAD_INIT(NULL, 0)
37832 : .tp_name = "lsa.EnumTrustedDomainsEx",
37833 : .tp_getset = py_lsa_EnumTrustedDomainsEx_getsetters,
37834 : .tp_methods = py_lsa_EnumTrustedDomainsEx_methods,
37835 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37836 : .tp_new = py_lsa_EnumTrustedDomainsEx_new,
37837 : };
37838 :
37839 0 : static bool pack_py_lsa_EnumTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustedDomainsEx *r)
37840 : {
37841 0 : PyObject *py_handle;
37842 0 : PyObject *py_resume_handle;
37843 0 : PyObject *py_max_size;
37844 0 : const char *kwnames[] = {
37845 : "handle", "resume_handle", "max_size", NULL
37846 : };
37847 :
37848 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustedDomainsEx", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
37849 0 : return false;
37850 : }
37851 :
37852 0 : if (py_handle == NULL) {
37853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
37854 0 : return false;
37855 : }
37856 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37857 0 : if (r->in.handle == NULL) {
37858 0 : PyErr_NoMemory();
37859 0 : return false;
37860 : }
37861 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37862 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37863 0 : PyErr_NoMemory();
37864 0 : return false;
37865 : }
37866 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37867 0 : if (py_resume_handle == NULL) {
37868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
37869 0 : return false;
37870 : }
37871 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
37872 0 : if (r->in.resume_handle == NULL) {
37873 0 : PyErr_NoMemory();
37874 0 : return false;
37875 : }
37876 : {
37877 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
37878 0 : if (PyLong_Check(py_resume_handle)) {
37879 0 : unsigned long long test_var;
37880 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
37881 0 : if (PyErr_Occurred() != NULL) {
37882 0 : return false;
37883 : }
37884 0 : if (test_var > uint_max) {
37885 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37886 : PyLong_Type.tp_name, uint_max, test_var);
37887 0 : return false;
37888 : }
37889 0 : *r->in.resume_handle = test_var;
37890 : } else {
37891 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37892 : PyLong_Type.tp_name);
37893 0 : return false;
37894 : }
37895 : }
37896 0 : if (py_max_size == NULL) {
37897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
37898 0 : return false;
37899 : }
37900 : {
37901 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
37902 0 : if (PyLong_Check(py_max_size)) {
37903 0 : unsigned long long test_var;
37904 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
37905 0 : if (PyErr_Occurred() != NULL) {
37906 0 : return false;
37907 : }
37908 0 : if (test_var > uint_max) {
37909 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37910 : PyLong_Type.tp_name, uint_max, test_var);
37911 0 : return false;
37912 : }
37913 0 : r->in.max_size = test_var;
37914 : } else {
37915 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37916 : PyLong_Type.tp_name);
37917 0 : return false;
37918 : }
37919 : }
37920 0 : return true;
37921 : }
37922 :
37923 0 : static PyObject *unpack_py_lsa_EnumTrustedDomainsEx_args_out(struct lsa_EnumTrustedDomainsEx *r)
37924 : {
37925 0 : PyObject *result;
37926 0 : PyObject *py_resume_handle;
37927 0 : PyObject *py_domains;
37928 0 : result = PyTuple_New(2);
37929 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
37930 0 : PyTuple_SetItem(result, 0, py_resume_handle);
37931 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, r->out.domains, r->out.domains);
37932 0 : PyTuple_SetItem(result, 1, py_domains);
37933 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37934 0 : PyErr_SetNTSTATUS(r->out.result);
37935 0 : return NULL;
37936 : }
37937 :
37938 0 : return result;
37939 : }
37940 :
37941 :
37942 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_policy_handle(PyObject *obj, void *closure)
37943 : {
37944 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
37945 0 : PyObject *py_policy_handle;
37946 0 : if (object->in.policy_handle == NULL) {
37947 0 : Py_RETURN_NONE;
37948 : }
37949 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
37950 0 : return py_policy_handle;
37951 : }
37952 :
37953 0 : static int py_lsa_CreateTrustedDomainEx_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
37954 : {
37955 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
37956 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
37957 0 : if (value == NULL) {
37958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
37959 0 : return -1;
37960 : }
37961 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
37962 0 : if (object->in.policy_handle == NULL) {
37963 0 : PyErr_NoMemory();
37964 0 : return -1;
37965 : }
37966 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37967 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37968 0 : PyErr_NoMemory();
37969 0 : return -1;
37970 : }
37971 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
37972 0 : return 0;
37973 : }
37974 :
37975 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_info(PyObject *obj, void *closure)
37976 : {
37977 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
37978 0 : PyObject *py_info;
37979 0 : if (object->in.info == NULL) {
37980 0 : Py_RETURN_NONE;
37981 : }
37982 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
37983 0 : return py_info;
37984 : }
37985 :
37986 0 : static int py_lsa_CreateTrustedDomainEx_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
37987 : {
37988 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
37989 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
37990 0 : if (value == NULL) {
37991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
37992 0 : return -1;
37993 : }
37994 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
37995 0 : if (object->in.info == NULL) {
37996 0 : PyErr_NoMemory();
37997 0 : return -1;
37998 : }
37999 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
38000 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38001 0 : PyErr_NoMemory();
38002 0 : return -1;
38003 : }
38004 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
38005 0 : return 0;
38006 : }
38007 :
38008 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_auth_info(PyObject *obj, void *closure)
38009 : {
38010 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38011 0 : PyObject *py_auth_info;
38012 0 : if (object->in.auth_info == NULL) {
38013 0 : Py_RETURN_NONE;
38014 : }
38015 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, object->in.auth_info, object->in.auth_info);
38016 0 : return py_auth_info;
38017 : }
38018 :
38019 0 : static int py_lsa_CreateTrustedDomainEx_in_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
38020 : {
38021 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38022 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info));
38023 0 : if (value == NULL) {
38024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.auth_info");
38025 0 : return -1;
38026 : }
38027 0 : object->in.auth_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info);
38028 0 : if (object->in.auth_info == NULL) {
38029 0 : PyErr_NoMemory();
38030 0 : return -1;
38031 : }
38032 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
38033 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38034 0 : PyErr_NoMemory();
38035 0 : return -1;
38036 : }
38037 0 : object->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
38038 0 : return 0;
38039 : }
38040 :
38041 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_access_mask(PyObject *obj, void *closure)
38042 : {
38043 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38044 0 : PyObject *py_access_mask;
38045 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
38046 0 : return py_access_mask;
38047 : }
38048 :
38049 0 : static int py_lsa_CreateTrustedDomainEx_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
38050 : {
38051 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38052 0 : if (value == NULL) {
38053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
38054 0 : return -1;
38055 : }
38056 : {
38057 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
38058 0 : if (PyLong_Check(value)) {
38059 0 : unsigned long long test_var;
38060 0 : test_var = PyLong_AsUnsignedLongLong(value);
38061 0 : if (PyErr_Occurred() != NULL) {
38062 0 : return -1;
38063 : }
38064 0 : if (test_var > uint_max) {
38065 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38066 : PyLong_Type.tp_name, uint_max, test_var);
38067 0 : return -1;
38068 : }
38069 0 : object->in.access_mask = test_var;
38070 : } else {
38071 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38072 : PyLong_Type.tp_name);
38073 0 : return -1;
38074 : }
38075 : }
38076 0 : return 0;
38077 : }
38078 :
38079 0 : static PyObject *py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle(PyObject *obj, void *closure)
38080 : {
38081 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38082 0 : PyObject *py_trustdom_handle;
38083 0 : if (object->out.trustdom_handle == NULL) {
38084 0 : Py_RETURN_NONE;
38085 : }
38086 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
38087 0 : return py_trustdom_handle;
38088 : }
38089 :
38090 0 : static int py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
38091 : {
38092 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38093 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
38094 0 : if (value == NULL) {
38095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
38096 0 : return -1;
38097 : }
38098 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
38099 0 : if (object->out.trustdom_handle == NULL) {
38100 0 : PyErr_NoMemory();
38101 0 : return -1;
38102 : }
38103 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38104 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38105 0 : PyErr_NoMemory();
38106 0 : return -1;
38107 : }
38108 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
38109 0 : return 0;
38110 : }
38111 :
38112 0 : static PyObject *py_lsa_CreateTrustedDomainEx_get_result(PyObject *obj, void *closure)
38113 : {
38114 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(obj);
38115 0 : PyObject *py_result;
38116 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38117 0 : return py_result;
38118 : }
38119 :
38120 0 : static int py_lsa_CreateTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
38121 : {
38122 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38123 0 : if (value == NULL) {
38124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38125 0 : return -1;
38126 : }
38127 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38128 0 : return 0;
38129 : }
38130 :
38131 : static PyGetSetDef py_lsa_CreateTrustedDomainEx_getsetters[] = {
38132 : {
38133 : .name = discard_const_p(char, "in_policy_handle"),
38134 : .get = py_lsa_CreateTrustedDomainEx_in_get_policy_handle,
38135 : .set = py_lsa_CreateTrustedDomainEx_in_set_policy_handle,
38136 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38137 : },
38138 : {
38139 : .name = discard_const_p(char, "in_info"),
38140 : .get = py_lsa_CreateTrustedDomainEx_in_get_info,
38141 : .set = py_lsa_CreateTrustedDomainEx_in_set_info,
38142 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
38143 : },
38144 : {
38145 : .name = discard_const_p(char, "in_auth_info"),
38146 : .get = py_lsa_CreateTrustedDomainEx_in_get_auth_info,
38147 : .set = py_lsa_CreateTrustedDomainEx_in_set_auth_info,
38148 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
38149 : },
38150 : {
38151 : .name = discard_const_p(char, "in_access_mask"),
38152 : .get = py_lsa_CreateTrustedDomainEx_in_get_access_mask,
38153 : .set = py_lsa_CreateTrustedDomainEx_in_set_access_mask,
38154 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
38155 : },
38156 : {
38157 : .name = discard_const_p(char, "out_trustdom_handle"),
38158 : .get = py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle,
38159 : .set = py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle,
38160 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38161 : },
38162 : {
38163 : .name = discard_const_p(char, "result"),
38164 : .get = py_lsa_CreateTrustedDomainEx_get_result,
38165 : .set = py_lsa_CreateTrustedDomainEx_set_result,
38166 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38167 : },
38168 : { .name = NULL }
38169 : };
38170 :
38171 0 : static PyObject *py_lsa_CreateTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38172 : {
38173 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx, type);
38174 0 : struct lsa_CreateTrustedDomainEx *_self = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(self);
38175 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38176 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
38177 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
38178 0 : _self->in.auth_info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfo);
38179 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
38180 0 : return self;
38181 : }
38182 :
38183 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38184 : {
38185 :
38186 :
38187 0 : return PyLong_FromLong(51);
38188 : }
38189 :
38190 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38191 : {
38192 0 : const struct ndr_interface_call *call = NULL;
38193 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38194 0 : PyObject *ret = NULL;
38195 0 : struct ndr_push *push = NULL;
38196 0 : DATA_BLOB blob;
38197 0 : enum ndr_err_code err;
38198 :
38199 0 : if (ndr_table_lsarpc.num_calls < 52) {
38200 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_pack");
38201 0 : return NULL;
38202 : }
38203 0 : call = &ndr_table_lsarpc.calls[51];
38204 :
38205 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38206 0 : if (push == NULL) {
38207 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38208 0 : return NULL;
38209 : }
38210 :
38211 0 : push->flags |= ndr_push_flags;
38212 :
38213 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38214 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38215 0 : TALLOC_FREE(push);
38216 0 : PyErr_SetNdrError(err);
38217 0 : return NULL;
38218 : }
38219 0 : blob = ndr_push_blob(push);
38220 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38221 0 : TALLOC_FREE(push);
38222 0 : return ret;
38223 : }
38224 :
38225 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38226 : {
38227 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38228 0 : PyObject *bigendian_obj = NULL;
38229 0 : PyObject *ndr64_obj = NULL;
38230 0 : libndr_flags ndr_push_flags = 0;
38231 :
38232 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38233 : discard_const_p(char *, kwnames),
38234 : &bigendian_obj,
38235 : &ndr64_obj)) {
38236 0 : return NULL;
38237 : }
38238 :
38239 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38240 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38241 : }
38242 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38243 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38244 : }
38245 :
38246 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38247 : }
38248 :
38249 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38250 : {
38251 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38252 0 : PyObject *bigendian_obj = NULL;
38253 0 : PyObject *ndr64_obj = NULL;
38254 0 : libndr_flags ndr_push_flags = 0;
38255 :
38256 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38257 : discard_const_p(char *, kwnames),
38258 : &bigendian_obj,
38259 : &ndr64_obj)) {
38260 0 : return NULL;
38261 : }
38262 :
38263 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38264 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38265 : }
38266 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38267 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38268 : }
38269 :
38270 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38271 : }
38272 :
38273 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38274 : {
38275 0 : const struct ndr_interface_call *call = NULL;
38276 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38277 0 : struct ndr_pull *pull = NULL;
38278 0 : enum ndr_err_code err;
38279 :
38280 0 : if (ndr_table_lsarpc.num_calls < 52) {
38281 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_unpack");
38282 0 : return NULL;
38283 : }
38284 0 : call = &ndr_table_lsarpc.calls[51];
38285 :
38286 0 : pull = ndr_pull_init_blob(blob, object);
38287 0 : if (pull == NULL) {
38288 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38289 0 : return NULL;
38290 : }
38291 :
38292 0 : pull->flags |= ndr_pull_flags;
38293 :
38294 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38295 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38296 0 : TALLOC_FREE(pull);
38297 0 : PyErr_SetNdrError(err);
38298 0 : return NULL;
38299 : }
38300 0 : if (!allow_remaining) {
38301 0 : uint32_t highest_ofs;
38302 :
38303 0 : if (pull->offset > pull->relative_highest_offset) {
38304 0 : highest_ofs = pull->offset;
38305 : } else {
38306 0 : highest_ofs = pull->relative_highest_offset;
38307 : }
38308 0 : if (highest_ofs < pull->data_size) {
38309 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38310 : "not all bytes consumed ofs[%u] size[%u]",
38311 : highest_ofs, pull->data_size);
38312 0 : TALLOC_FREE(pull);
38313 0 : PyErr_SetNdrError(err);
38314 0 : return NULL;
38315 : }
38316 : }
38317 :
38318 0 : TALLOC_FREE(pull);
38319 0 : Py_RETURN_NONE;
38320 : }
38321 :
38322 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38323 : {
38324 0 : DATA_BLOB blob;
38325 0 : Py_ssize_t blob_length = 0;
38326 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38327 0 : PyObject *bigendian_obj = NULL;
38328 0 : PyObject *ndr64_obj = NULL;
38329 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38330 0 : PyObject *allow_remaining_obj = NULL;
38331 0 : bool allow_remaining = false;
38332 :
38333 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38334 : discard_const_p(char *, kwnames),
38335 : &blob.data, &blob_length,
38336 : &bigendian_obj,
38337 : &ndr64_obj,
38338 : &allow_remaining_obj)) {
38339 0 : return NULL;
38340 : }
38341 0 : blob.length = blob_length;
38342 :
38343 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38344 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38345 : }
38346 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38347 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38348 : }
38349 :
38350 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38351 0 : allow_remaining = true;
38352 : }
38353 :
38354 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38355 : }
38356 :
38357 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38358 : {
38359 0 : DATA_BLOB blob;
38360 0 : Py_ssize_t blob_length = 0;
38361 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38362 0 : PyObject *bigendian_obj = NULL;
38363 0 : PyObject *ndr64_obj = NULL;
38364 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38365 0 : PyObject *allow_remaining_obj = NULL;
38366 0 : bool allow_remaining = false;
38367 :
38368 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38369 : discard_const_p(char *, kwnames),
38370 : &blob.data, &blob_length,
38371 : &bigendian_obj,
38372 : &ndr64_obj,
38373 : &allow_remaining_obj)) {
38374 0 : return NULL;
38375 : }
38376 0 : blob.length = blob_length;
38377 :
38378 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38379 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38380 : }
38381 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38382 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38383 : }
38384 :
38385 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38386 0 : allow_remaining = true;
38387 : }
38388 :
38389 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38390 : }
38391 :
38392 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38393 : {
38394 0 : const struct ndr_interface_call *call = NULL;
38395 0 : struct lsa_CreateTrustedDomainEx *object = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38396 0 : PyObject *ret;
38397 0 : char *retstr;
38398 :
38399 0 : if (ndr_table_lsarpc.num_calls < 52) {
38400 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_print");
38401 0 : return NULL;
38402 : }
38403 0 : call = &ndr_table_lsarpc.calls[51];
38404 :
38405 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38406 0 : ret = PyUnicode_FromString(retstr);
38407 0 : TALLOC_FREE(retstr);
38408 :
38409 0 : return ret;
38410 : }
38411 :
38412 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38413 : {
38414 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_in", NDR_IN);
38415 : }
38416 :
38417 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38418 : {
38419 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_out", NDR_OUT);
38420 : }
38421 :
38422 : static PyMethodDef py_lsa_CreateTrustedDomainEx_methods[] = {
38423 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
38424 : "lsa.CreateTrustedDomainEx.opnum() -> 51 (0x33) " },
38425 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38426 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38427 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38428 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38429 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38430 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38431 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38432 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38433 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38434 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38435 : { NULL, NULL, 0, NULL }
38436 : };
38437 :
38438 :
38439 : static PyTypeObject lsa_CreateTrustedDomainEx_Type = {
38440 : PyVarObject_HEAD_INIT(NULL, 0)
38441 : .tp_name = "lsa.CreateTrustedDomainEx",
38442 : .tp_getset = py_lsa_CreateTrustedDomainEx_getsetters,
38443 : .tp_methods = py_lsa_CreateTrustedDomainEx_methods,
38444 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38445 : .tp_new = py_lsa_CreateTrustedDomainEx_new,
38446 : };
38447 :
38448 0 : static bool pack_py_lsa_CreateTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx *r)
38449 : {
38450 0 : PyObject *py_policy_handle;
38451 0 : PyObject *py_info;
38452 0 : PyObject *py_auth_info;
38453 0 : PyObject *py_access_mask;
38454 0 : const char *kwnames[] = {
38455 : "policy_handle", "info", "auth_info", "access_mask", NULL
38456 : };
38457 :
38458 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)) {
38459 0 : return false;
38460 : }
38461 :
38462 0 : if (py_policy_handle == NULL) {
38463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
38464 0 : return false;
38465 : }
38466 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
38467 0 : if (r->in.policy_handle == NULL) {
38468 0 : PyErr_NoMemory();
38469 0 : return false;
38470 : }
38471 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
38472 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
38473 0 : PyErr_NoMemory();
38474 0 : return false;
38475 : }
38476 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
38477 0 : if (py_info == NULL) {
38478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
38479 0 : return false;
38480 : }
38481 0 : r->in.info = talloc_ptrtype(r, r->in.info);
38482 0 : if (r->in.info == NULL) {
38483 0 : PyErr_NoMemory();
38484 0 : return false;
38485 : }
38486 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
38487 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
38488 0 : PyErr_NoMemory();
38489 0 : return false;
38490 : }
38491 0 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
38492 0 : if (py_auth_info == NULL) {
38493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.auth_info");
38494 0 : return false;
38495 : }
38496 0 : r->in.auth_info = talloc_ptrtype(r, r->in.auth_info);
38497 0 : if (r->in.auth_info == NULL) {
38498 0 : PyErr_NoMemory();
38499 0 : return false;
38500 : }
38501 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, py_auth_info, return false;);
38502 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info)) == NULL) {
38503 0 : PyErr_NoMemory();
38504 0 : return false;
38505 : }
38506 0 : r->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_auth_info);
38507 0 : if (py_access_mask == NULL) {
38508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
38509 0 : return false;
38510 : }
38511 : {
38512 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
38513 0 : if (PyLong_Check(py_access_mask)) {
38514 0 : unsigned long long test_var;
38515 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
38516 0 : if (PyErr_Occurred() != NULL) {
38517 0 : return false;
38518 : }
38519 0 : if (test_var > uint_max) {
38520 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38521 : PyLong_Type.tp_name, uint_max, test_var);
38522 0 : return false;
38523 : }
38524 0 : r->in.access_mask = test_var;
38525 : } else {
38526 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38527 : PyLong_Type.tp_name);
38528 0 : return false;
38529 : }
38530 : }
38531 0 : return true;
38532 : }
38533 :
38534 0 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx_args_out(struct lsa_CreateTrustedDomainEx *r)
38535 : {
38536 0 : PyObject *result;
38537 0 : PyObject *py_trustdom_handle;
38538 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
38539 0 : result = py_trustdom_handle;
38540 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38541 0 : PyErr_SetNTSTATUS(r->out.result);
38542 0 : return NULL;
38543 : }
38544 :
38545 0 : return result;
38546 : }
38547 :
38548 :
38549 0 : static PyObject *py_lsa_CloseTrustedDomainEx_in_get_handle(PyObject *obj, void *closure)
38550 : {
38551 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38552 0 : PyObject *py_handle;
38553 0 : if (object->in.handle == NULL) {
38554 0 : Py_RETURN_NONE;
38555 : }
38556 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38557 0 : return py_handle;
38558 : }
38559 :
38560 0 : static int py_lsa_CloseTrustedDomainEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38561 : {
38562 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38563 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
38564 0 : if (value == NULL) {
38565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
38566 0 : return -1;
38567 : }
38568 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
38569 0 : if (object->in.handle == NULL) {
38570 0 : PyErr_NoMemory();
38571 0 : return -1;
38572 : }
38573 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38574 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38575 0 : PyErr_NoMemory();
38576 0 : return -1;
38577 : }
38578 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38579 0 : return 0;
38580 : }
38581 :
38582 0 : static PyObject *py_lsa_CloseTrustedDomainEx_out_get_handle(PyObject *obj, void *closure)
38583 : {
38584 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38585 0 : PyObject *py_handle;
38586 0 : if (object->out.handle == NULL) {
38587 0 : Py_RETURN_NONE;
38588 : }
38589 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
38590 0 : return py_handle;
38591 : }
38592 :
38593 0 : static int py_lsa_CloseTrustedDomainEx_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38594 : {
38595 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38596 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
38597 0 : if (value == NULL) {
38598 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
38599 0 : return -1;
38600 : }
38601 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
38602 0 : if (object->out.handle == NULL) {
38603 0 : PyErr_NoMemory();
38604 0 : return -1;
38605 : }
38606 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38607 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38608 0 : PyErr_NoMemory();
38609 0 : return -1;
38610 : }
38611 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38612 0 : return 0;
38613 : }
38614 :
38615 0 : static PyObject *py_lsa_CloseTrustedDomainEx_get_result(PyObject *obj, void *closure)
38616 : {
38617 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(obj);
38618 0 : PyObject *py_result;
38619 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38620 0 : return py_result;
38621 : }
38622 :
38623 0 : static int py_lsa_CloseTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
38624 : {
38625 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38626 0 : if (value == NULL) {
38627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38628 0 : return -1;
38629 : }
38630 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38631 0 : return 0;
38632 : }
38633 :
38634 : static PyGetSetDef py_lsa_CloseTrustedDomainEx_getsetters[] = {
38635 : {
38636 : .name = discard_const_p(char, "in_handle"),
38637 : .get = py_lsa_CloseTrustedDomainEx_in_get_handle,
38638 : .set = py_lsa_CloseTrustedDomainEx_in_set_handle,
38639 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38640 : },
38641 : {
38642 : .name = discard_const_p(char, "out_handle"),
38643 : .get = py_lsa_CloseTrustedDomainEx_out_get_handle,
38644 : .set = py_lsa_CloseTrustedDomainEx_out_set_handle,
38645 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38646 : },
38647 : {
38648 : .name = discard_const_p(char, "result"),
38649 : .get = py_lsa_CloseTrustedDomainEx_get_result,
38650 : .set = py_lsa_CloseTrustedDomainEx_set_result,
38651 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38652 : },
38653 : { .name = NULL }
38654 : };
38655 :
38656 0 : static PyObject *py_lsa_CloseTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38657 : {
38658 0 : PyObject *self = pytalloc_new(struct lsa_CloseTrustedDomainEx, type);
38659 0 : struct lsa_CloseTrustedDomainEx *_self = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(self);
38660 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38661 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
38662 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
38663 0 : return self;
38664 : }
38665 :
38666 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38667 : {
38668 :
38669 :
38670 0 : return PyLong_FromLong(52);
38671 : }
38672 :
38673 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38674 : {
38675 0 : const struct ndr_interface_call *call = NULL;
38676 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38677 0 : PyObject *ret = NULL;
38678 0 : struct ndr_push *push = NULL;
38679 0 : DATA_BLOB blob;
38680 0 : enum ndr_err_code err;
38681 :
38682 0 : if (ndr_table_lsarpc.num_calls < 53) {
38683 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_pack");
38684 0 : return NULL;
38685 : }
38686 0 : call = &ndr_table_lsarpc.calls[52];
38687 :
38688 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38689 0 : if (push == NULL) {
38690 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38691 0 : return NULL;
38692 : }
38693 :
38694 0 : push->flags |= ndr_push_flags;
38695 :
38696 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38697 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38698 0 : TALLOC_FREE(push);
38699 0 : PyErr_SetNdrError(err);
38700 0 : return NULL;
38701 : }
38702 0 : blob = ndr_push_blob(push);
38703 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38704 0 : TALLOC_FREE(push);
38705 0 : return ret;
38706 : }
38707 :
38708 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38709 : {
38710 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38711 0 : PyObject *bigendian_obj = NULL;
38712 0 : PyObject *ndr64_obj = NULL;
38713 0 : libndr_flags ndr_push_flags = 0;
38714 :
38715 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38716 : discard_const_p(char *, kwnames),
38717 : &bigendian_obj,
38718 : &ndr64_obj)) {
38719 0 : return NULL;
38720 : }
38721 :
38722 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38723 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38724 : }
38725 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38726 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38727 : }
38728 :
38729 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38730 : }
38731 :
38732 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38733 : {
38734 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38735 0 : PyObject *bigendian_obj = NULL;
38736 0 : PyObject *ndr64_obj = NULL;
38737 0 : libndr_flags ndr_push_flags = 0;
38738 :
38739 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38740 : discard_const_p(char *, kwnames),
38741 : &bigendian_obj,
38742 : &ndr64_obj)) {
38743 0 : return NULL;
38744 : }
38745 :
38746 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38747 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38748 : }
38749 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38750 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38751 : }
38752 :
38753 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38754 : }
38755 :
38756 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38757 : {
38758 0 : const struct ndr_interface_call *call = NULL;
38759 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38760 0 : struct ndr_pull *pull = NULL;
38761 0 : enum ndr_err_code err;
38762 :
38763 0 : if (ndr_table_lsarpc.num_calls < 53) {
38764 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_unpack");
38765 0 : return NULL;
38766 : }
38767 0 : call = &ndr_table_lsarpc.calls[52];
38768 :
38769 0 : pull = ndr_pull_init_blob(blob, object);
38770 0 : if (pull == NULL) {
38771 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38772 0 : return NULL;
38773 : }
38774 :
38775 0 : pull->flags |= ndr_pull_flags;
38776 :
38777 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38778 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38779 0 : TALLOC_FREE(pull);
38780 0 : PyErr_SetNdrError(err);
38781 0 : return NULL;
38782 : }
38783 0 : if (!allow_remaining) {
38784 0 : uint32_t highest_ofs;
38785 :
38786 0 : if (pull->offset > pull->relative_highest_offset) {
38787 0 : highest_ofs = pull->offset;
38788 : } else {
38789 0 : highest_ofs = pull->relative_highest_offset;
38790 : }
38791 0 : if (highest_ofs < pull->data_size) {
38792 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38793 : "not all bytes consumed ofs[%u] size[%u]",
38794 : highest_ofs, pull->data_size);
38795 0 : TALLOC_FREE(pull);
38796 0 : PyErr_SetNdrError(err);
38797 0 : return NULL;
38798 : }
38799 : }
38800 :
38801 0 : TALLOC_FREE(pull);
38802 0 : Py_RETURN_NONE;
38803 : }
38804 :
38805 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38806 : {
38807 0 : DATA_BLOB blob;
38808 0 : Py_ssize_t blob_length = 0;
38809 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38810 0 : PyObject *bigendian_obj = NULL;
38811 0 : PyObject *ndr64_obj = NULL;
38812 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38813 0 : PyObject *allow_remaining_obj = NULL;
38814 0 : bool allow_remaining = false;
38815 :
38816 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38817 : discard_const_p(char *, kwnames),
38818 : &blob.data, &blob_length,
38819 : &bigendian_obj,
38820 : &ndr64_obj,
38821 : &allow_remaining_obj)) {
38822 0 : return NULL;
38823 : }
38824 0 : blob.length = blob_length;
38825 :
38826 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38827 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38828 : }
38829 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38830 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38831 : }
38832 :
38833 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38834 0 : allow_remaining = true;
38835 : }
38836 :
38837 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38838 : }
38839 :
38840 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38841 : {
38842 0 : DATA_BLOB blob;
38843 0 : Py_ssize_t blob_length = 0;
38844 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38845 0 : PyObject *bigendian_obj = NULL;
38846 0 : PyObject *ndr64_obj = NULL;
38847 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38848 0 : PyObject *allow_remaining_obj = NULL;
38849 0 : bool allow_remaining = false;
38850 :
38851 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38852 : discard_const_p(char *, kwnames),
38853 : &blob.data, &blob_length,
38854 : &bigendian_obj,
38855 : &ndr64_obj,
38856 : &allow_remaining_obj)) {
38857 0 : return NULL;
38858 : }
38859 0 : blob.length = blob_length;
38860 :
38861 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38862 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38863 : }
38864 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38865 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38866 : }
38867 :
38868 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38869 0 : allow_remaining = true;
38870 : }
38871 :
38872 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38873 : }
38874 :
38875 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38876 : {
38877 0 : const struct ndr_interface_call *call = NULL;
38878 0 : struct lsa_CloseTrustedDomainEx *object = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(py_obj);
38879 0 : PyObject *ret;
38880 0 : char *retstr;
38881 :
38882 0 : if (ndr_table_lsarpc.num_calls < 53) {
38883 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_print");
38884 0 : return NULL;
38885 : }
38886 0 : call = &ndr_table_lsarpc.calls[52];
38887 :
38888 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38889 0 : ret = PyUnicode_FromString(retstr);
38890 0 : TALLOC_FREE(retstr);
38891 :
38892 0 : return ret;
38893 : }
38894 :
38895 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38896 : {
38897 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_in", NDR_IN);
38898 : }
38899 :
38900 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38901 : {
38902 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_out", NDR_OUT);
38903 : }
38904 :
38905 : static PyMethodDef py_lsa_CloseTrustedDomainEx_methods[] = {
38906 : { "opnum", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
38907 : "lsa.CloseTrustedDomainEx.opnum() -> 52 (0x34) " },
38908 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38909 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38910 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38911 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38912 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38913 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38914 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38915 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38916 : { "__ndr_print_in__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38917 : { "__ndr_print_out__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38918 : { NULL, NULL, 0, NULL }
38919 : };
38920 :
38921 :
38922 : static PyTypeObject lsa_CloseTrustedDomainEx_Type = {
38923 : PyVarObject_HEAD_INIT(NULL, 0)
38924 : .tp_name = "lsa.CloseTrustedDomainEx",
38925 : .tp_getset = py_lsa_CloseTrustedDomainEx_getsetters,
38926 : .tp_methods = py_lsa_CloseTrustedDomainEx_methods,
38927 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38928 : .tp_new = py_lsa_CloseTrustedDomainEx_new,
38929 : };
38930 :
38931 0 : static bool pack_py_lsa_CloseTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CloseTrustedDomainEx *r)
38932 : {
38933 0 : PyObject *py_handle;
38934 0 : const char *kwnames[] = {
38935 : "handle", NULL
38936 : };
38937 :
38938 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_CloseTrustedDomainEx", discard_const_p(char *, kwnames), &py_handle)) {
38939 0 : return false;
38940 : }
38941 :
38942 0 : if (py_handle == NULL) {
38943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
38944 0 : return false;
38945 : }
38946 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
38947 0 : if (r->in.handle == NULL) {
38948 0 : PyErr_NoMemory();
38949 0 : return false;
38950 : }
38951 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
38952 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
38953 0 : PyErr_NoMemory();
38954 0 : return false;
38955 : }
38956 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
38957 0 : return true;
38958 : }
38959 :
38960 0 : static PyObject *unpack_py_lsa_CloseTrustedDomainEx_args_out(struct lsa_CloseTrustedDomainEx *r)
38961 : {
38962 0 : PyObject *result;
38963 0 : PyObject *py_handle;
38964 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
38965 0 : result = py_handle;
38966 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38967 0 : PyErr_SetNTSTATUS(r->out.result);
38968 0 : return NULL;
38969 : }
38970 :
38971 0 : return result;
38972 : }
38973 :
38974 :
38975 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
38976 : {
38977 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
38978 0 : PyObject *py_handle;
38979 0 : if (object->in.handle == NULL) {
38980 0 : Py_RETURN_NONE;
38981 : }
38982 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38983 0 : return py_handle;
38984 : }
38985 :
38986 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38987 : {
38988 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
38989 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
38990 0 : if (value == NULL) {
38991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
38992 0 : return -1;
38993 : }
38994 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
38995 0 : if (object->in.handle == NULL) {
38996 0 : PyErr_NoMemory();
38997 0 : return -1;
38998 : }
38999 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39000 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39001 0 : PyErr_NoMemory();
39002 0 : return -1;
39003 : }
39004 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39005 0 : return 0;
39006 : }
39007 :
39008 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
39009 : {
39010 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39011 0 : PyObject *py_level;
39012 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
39013 0 : return py_level;
39014 : }
39015 :
39016 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
39017 : {
39018 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39019 0 : if (value == NULL) {
39020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
39021 0 : return -1;
39022 : }
39023 : {
39024 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
39025 0 : if (PyLong_Check(value)) {
39026 0 : unsigned long long test_var;
39027 0 : test_var = PyLong_AsUnsignedLongLong(value);
39028 0 : if (PyErr_Occurred() != NULL) {
39029 0 : return -1;
39030 : }
39031 0 : if (test_var > uint_max) {
39032 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39033 : PyLong_Type.tp_name, uint_max, test_var);
39034 0 : return -1;
39035 : }
39036 0 : object->in.level = test_var;
39037 : } else {
39038 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39039 : PyLong_Type.tp_name);
39040 0 : return -1;
39041 : }
39042 : }
39043 0 : return 0;
39044 : }
39045 :
39046 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_out_get_info(PyObject *obj, void *closure)
39047 : {
39048 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39049 0 : PyObject *py_info;
39050 0 : if (object->out.info == NULL) {
39051 0 : Py_RETURN_NONE;
39052 : }
39053 0 : if (*object->out.info == NULL) {
39054 0 : py_info = Py_None;
39055 0 : Py_INCREF(py_info);
39056 : } else {
39057 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_DomainInformationPolicy");
39058 0 : if (py_info == NULL) {
39059 0 : return NULL;
39060 : }
39061 : }
39062 0 : return py_info;
39063 : }
39064 :
39065 0 : static int py_lsa_QueryDomainInformationPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
39066 : {
39067 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39068 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
39069 0 : if (value == NULL) {
39070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
39071 0 : return -1;
39072 : }
39073 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
39074 0 : if (object->out.info == NULL) {
39075 0 : PyErr_NoMemory();
39076 0 : return -1;
39077 : }
39078 0 : if (value == Py_None) {
39079 0 : *object->out.info = NULL;
39080 : } else {
39081 0 : *object->out.info = NULL;
39082 : {
39083 0 : union lsa_DomainInformationPolicy *info_switch_2;
39084 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");
39085 0 : if (info_switch_2 == NULL) {
39086 0 : return -1;
39087 : }
39088 0 : *object->out.info = info_switch_2;
39089 : }
39090 : }
39091 0 : return 0;
39092 : }
39093 :
39094 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_get_result(PyObject *obj, void *closure)
39095 : {
39096 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(obj);
39097 0 : PyObject *py_result;
39098 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39099 0 : return py_result;
39100 : }
39101 :
39102 0 : static int py_lsa_QueryDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
39103 : {
39104 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39105 0 : if (value == NULL) {
39106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39107 0 : return -1;
39108 : }
39109 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39110 0 : return 0;
39111 : }
39112 :
39113 : static PyGetSetDef py_lsa_QueryDomainInformationPolicy_getsetters[] = {
39114 : {
39115 : .name = discard_const_p(char, "in_handle"),
39116 : .get = py_lsa_QueryDomainInformationPolicy_in_get_handle,
39117 : .set = py_lsa_QueryDomainInformationPolicy_in_set_handle,
39118 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39119 : },
39120 : {
39121 : .name = discard_const_p(char, "in_level"),
39122 : .get = py_lsa_QueryDomainInformationPolicy_in_get_level,
39123 : .set = py_lsa_QueryDomainInformationPolicy_in_set_level,
39124 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39125 : },
39126 : {
39127 : .name = discard_const_p(char, "out_info"),
39128 : .get = py_lsa_QueryDomainInformationPolicy_out_get_info,
39129 : .set = py_lsa_QueryDomainInformationPolicy_out_set_info,
39130 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
39131 : },
39132 : {
39133 : .name = discard_const_p(char, "result"),
39134 : .get = py_lsa_QueryDomainInformationPolicy_get_result,
39135 : .set = py_lsa_QueryDomainInformationPolicy_set_result,
39136 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39137 : },
39138 : { .name = NULL }
39139 : };
39140 :
39141 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39142 : {
39143 0 : PyObject *self = pytalloc_new(struct lsa_QueryDomainInformationPolicy, type);
39144 0 : struct lsa_QueryDomainInformationPolicy *_self = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(self);
39145 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39146 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
39147 : /* a pointer to a NULL pointer */
39148 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy *);
39149 0 : return self;
39150 : }
39151 :
39152 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39153 : {
39154 :
39155 :
39156 0 : return PyLong_FromLong(53);
39157 : }
39158 :
39159 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39160 : {
39161 0 : const struct ndr_interface_call *call = NULL;
39162 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39163 0 : PyObject *ret = NULL;
39164 0 : struct ndr_push *push = NULL;
39165 0 : DATA_BLOB blob;
39166 0 : enum ndr_err_code err;
39167 :
39168 0 : if (ndr_table_lsarpc.num_calls < 54) {
39169 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_pack");
39170 0 : return NULL;
39171 : }
39172 0 : call = &ndr_table_lsarpc.calls[53];
39173 :
39174 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39175 0 : if (push == NULL) {
39176 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39177 0 : return NULL;
39178 : }
39179 :
39180 0 : push->flags |= ndr_push_flags;
39181 :
39182 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39183 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39184 0 : TALLOC_FREE(push);
39185 0 : PyErr_SetNdrError(err);
39186 0 : return NULL;
39187 : }
39188 0 : blob = ndr_push_blob(push);
39189 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39190 0 : TALLOC_FREE(push);
39191 0 : return ret;
39192 : }
39193 :
39194 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39195 : {
39196 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39197 0 : PyObject *bigendian_obj = NULL;
39198 0 : PyObject *ndr64_obj = NULL;
39199 0 : libndr_flags ndr_push_flags = 0;
39200 :
39201 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39202 : discard_const_p(char *, kwnames),
39203 : &bigendian_obj,
39204 : &ndr64_obj)) {
39205 0 : return NULL;
39206 : }
39207 :
39208 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39209 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39210 : }
39211 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39212 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39213 : }
39214 :
39215 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39216 : }
39217 :
39218 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39219 : {
39220 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39221 0 : PyObject *bigendian_obj = NULL;
39222 0 : PyObject *ndr64_obj = NULL;
39223 0 : libndr_flags ndr_push_flags = 0;
39224 :
39225 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39226 : discard_const_p(char *, kwnames),
39227 : &bigendian_obj,
39228 : &ndr64_obj)) {
39229 0 : return NULL;
39230 : }
39231 :
39232 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39233 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39234 : }
39235 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39236 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39237 : }
39238 :
39239 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39240 : }
39241 :
39242 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
39243 : {
39244 0 : const struct ndr_interface_call *call = NULL;
39245 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39246 0 : struct ndr_pull *pull = NULL;
39247 0 : enum ndr_err_code err;
39248 :
39249 0 : if (ndr_table_lsarpc.num_calls < 54) {
39250 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_unpack");
39251 0 : return NULL;
39252 : }
39253 0 : call = &ndr_table_lsarpc.calls[53];
39254 :
39255 0 : pull = ndr_pull_init_blob(blob, object);
39256 0 : if (pull == NULL) {
39257 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39258 0 : return NULL;
39259 : }
39260 :
39261 0 : pull->flags |= ndr_pull_flags;
39262 :
39263 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39264 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39265 0 : TALLOC_FREE(pull);
39266 0 : PyErr_SetNdrError(err);
39267 0 : return NULL;
39268 : }
39269 0 : if (!allow_remaining) {
39270 0 : uint32_t highest_ofs;
39271 :
39272 0 : if (pull->offset > pull->relative_highest_offset) {
39273 0 : highest_ofs = pull->offset;
39274 : } else {
39275 0 : highest_ofs = pull->relative_highest_offset;
39276 : }
39277 0 : if (highest_ofs < pull->data_size) {
39278 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39279 : "not all bytes consumed ofs[%u] size[%u]",
39280 : highest_ofs, pull->data_size);
39281 0 : TALLOC_FREE(pull);
39282 0 : PyErr_SetNdrError(err);
39283 0 : return NULL;
39284 : }
39285 : }
39286 :
39287 0 : TALLOC_FREE(pull);
39288 0 : Py_RETURN_NONE;
39289 : }
39290 :
39291 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39292 : {
39293 0 : DATA_BLOB blob;
39294 0 : Py_ssize_t blob_length = 0;
39295 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39296 0 : PyObject *bigendian_obj = NULL;
39297 0 : PyObject *ndr64_obj = NULL;
39298 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39299 0 : PyObject *allow_remaining_obj = NULL;
39300 0 : bool allow_remaining = false;
39301 :
39302 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39303 : discard_const_p(char *, kwnames),
39304 : &blob.data, &blob_length,
39305 : &bigendian_obj,
39306 : &ndr64_obj,
39307 : &allow_remaining_obj)) {
39308 0 : return NULL;
39309 : }
39310 0 : blob.length = blob_length;
39311 :
39312 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39313 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39314 : }
39315 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39316 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39317 : }
39318 :
39319 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39320 0 : allow_remaining = true;
39321 : }
39322 :
39323 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39324 : }
39325 :
39326 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39327 : {
39328 0 : DATA_BLOB blob;
39329 0 : Py_ssize_t blob_length = 0;
39330 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39331 0 : PyObject *bigendian_obj = NULL;
39332 0 : PyObject *ndr64_obj = NULL;
39333 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39334 0 : PyObject *allow_remaining_obj = NULL;
39335 0 : bool allow_remaining = false;
39336 :
39337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39338 : discard_const_p(char *, kwnames),
39339 : &blob.data, &blob_length,
39340 : &bigendian_obj,
39341 : &ndr64_obj,
39342 : &allow_remaining_obj)) {
39343 0 : return NULL;
39344 : }
39345 0 : blob.length = blob_length;
39346 :
39347 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39348 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39349 : }
39350 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39351 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39352 : }
39353 :
39354 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39355 0 : allow_remaining = true;
39356 : }
39357 :
39358 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39359 : }
39360 :
39361 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39362 : {
39363 0 : const struct ndr_interface_call *call = NULL;
39364 0 : struct lsa_QueryDomainInformationPolicy *object = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39365 0 : PyObject *ret;
39366 0 : char *retstr;
39367 :
39368 0 : if (ndr_table_lsarpc.num_calls < 54) {
39369 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_print");
39370 0 : return NULL;
39371 : }
39372 0 : call = &ndr_table_lsarpc.calls[53];
39373 :
39374 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39375 0 : ret = PyUnicode_FromString(retstr);
39376 0 : TALLOC_FREE(retstr);
39377 :
39378 0 : return ret;
39379 : }
39380 :
39381 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39382 : {
39383 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_in", NDR_IN);
39384 : }
39385 :
39386 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39387 : {
39388 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_out", NDR_OUT);
39389 : }
39390 :
39391 : static PyMethodDef py_lsa_QueryDomainInformationPolicy_methods[] = {
39392 : { "opnum", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
39393 : "lsa.QueryDomainInformationPolicy.opnum() -> 53 (0x35) " },
39394 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39395 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39396 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39397 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39398 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39399 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39400 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39401 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39402 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39403 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39404 : { NULL, NULL, 0, NULL }
39405 : };
39406 :
39407 :
39408 : static PyTypeObject lsa_QueryDomainInformationPolicy_Type = {
39409 : PyVarObject_HEAD_INIT(NULL, 0)
39410 : .tp_name = "lsa.QueryDomainInformationPolicy",
39411 : .tp_getset = py_lsa_QueryDomainInformationPolicy_getsetters,
39412 : .tp_methods = py_lsa_QueryDomainInformationPolicy_methods,
39413 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39414 : .tp_new = py_lsa_QueryDomainInformationPolicy_new,
39415 : };
39416 :
39417 0 : static bool pack_py_lsa_QueryDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryDomainInformationPolicy *r)
39418 : {
39419 0 : PyObject *py_handle;
39420 0 : PyObject *py_level;
39421 0 : const char *kwnames[] = {
39422 : "handle", "level", NULL
39423 : };
39424 :
39425 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
39426 0 : return false;
39427 : }
39428 :
39429 0 : if (py_handle == NULL) {
39430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
39431 0 : return false;
39432 : }
39433 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
39434 0 : if (r->in.handle == NULL) {
39435 0 : PyErr_NoMemory();
39436 0 : return false;
39437 : }
39438 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
39439 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
39440 0 : PyErr_NoMemory();
39441 0 : return false;
39442 : }
39443 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
39444 0 : if (py_level == NULL) {
39445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39446 0 : return false;
39447 : }
39448 : {
39449 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39450 0 : if (PyLong_Check(py_level)) {
39451 0 : unsigned long long test_var;
39452 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39453 0 : if (PyErr_Occurred() != NULL) {
39454 0 : return false;
39455 : }
39456 0 : if (test_var > uint_max) {
39457 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39458 : PyLong_Type.tp_name, uint_max, test_var);
39459 0 : return false;
39460 : }
39461 0 : r->in.level = test_var;
39462 : } else {
39463 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39464 : PyLong_Type.tp_name);
39465 0 : return false;
39466 : }
39467 : }
39468 0 : return true;
39469 : }
39470 :
39471 0 : static PyObject *unpack_py_lsa_QueryDomainInformationPolicy_args_out(struct lsa_QueryDomainInformationPolicy *r)
39472 : {
39473 0 : PyObject *result;
39474 0 : PyObject *py_info;
39475 0 : if (*r->out.info == NULL) {
39476 0 : py_info = Py_None;
39477 0 : Py_INCREF(py_info);
39478 : } else {
39479 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_DomainInformationPolicy");
39480 0 : if (py_info == NULL) {
39481 0 : return NULL;
39482 : }
39483 : }
39484 0 : result = py_info;
39485 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39486 0 : PyErr_SetNTSTATUS(r->out.result);
39487 0 : return NULL;
39488 : }
39489 :
39490 0 : return result;
39491 : }
39492 :
39493 :
39494 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
39495 : {
39496 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39497 0 : PyObject *py_handle;
39498 0 : if (object->in.handle == NULL) {
39499 0 : Py_RETURN_NONE;
39500 : }
39501 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
39502 0 : return py_handle;
39503 : }
39504 :
39505 0 : static int py_lsa_SetDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
39506 : {
39507 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39508 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
39509 0 : if (value == NULL) {
39510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
39511 0 : return -1;
39512 : }
39513 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
39514 0 : if (object->in.handle == NULL) {
39515 0 : PyErr_NoMemory();
39516 0 : return -1;
39517 : }
39518 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39519 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39520 0 : PyErr_NoMemory();
39521 0 : return -1;
39522 : }
39523 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39524 0 : return 0;
39525 : }
39526 :
39527 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
39528 : {
39529 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39530 0 : PyObject *py_level;
39531 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
39532 0 : return py_level;
39533 : }
39534 :
39535 0 : static int py_lsa_SetDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
39536 : {
39537 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39538 0 : if (value == NULL) {
39539 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
39540 0 : return -1;
39541 : }
39542 : {
39543 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
39544 0 : if (PyLong_Check(value)) {
39545 0 : unsigned long long test_var;
39546 0 : test_var = PyLong_AsUnsignedLongLong(value);
39547 0 : if (PyErr_Occurred() != NULL) {
39548 0 : return -1;
39549 : }
39550 0 : if (test_var > uint_max) {
39551 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39552 : PyLong_Type.tp_name, uint_max, test_var);
39553 0 : return -1;
39554 : }
39555 0 : object->in.level = test_var;
39556 : } else {
39557 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39558 : PyLong_Type.tp_name);
39559 0 : return -1;
39560 : }
39561 : }
39562 0 : return 0;
39563 : }
39564 :
39565 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_info(PyObject *obj, void *closure)
39566 : {
39567 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39568 0 : PyObject *py_info;
39569 0 : if (object->in.info == NULL) {
39570 0 : Py_RETURN_NONE;
39571 : }
39572 0 : if (object->in.info == NULL) {
39573 0 : py_info = Py_None;
39574 0 : Py_INCREF(py_info);
39575 : } else {
39576 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, object->in.info, object->in.level, object->in.info, "union lsa_DomainInformationPolicy");
39577 0 : if (py_info == NULL) {
39578 0 : return NULL;
39579 : }
39580 : }
39581 0 : return py_info;
39582 : }
39583 :
39584 0 : static int py_lsa_SetDomainInformationPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
39585 : {
39586 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
39588 0 : if (value == NULL) {
39589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
39590 0 : return -1;
39591 : }
39592 0 : if (value == Py_None) {
39593 0 : object->in.info = NULL;
39594 : } else {
39595 0 : object->in.info = NULL;
39596 : {
39597 0 : union lsa_DomainInformationPolicy *info_switch_1;
39598 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");
39599 0 : if (info_switch_1 == NULL) {
39600 0 : return -1;
39601 : }
39602 0 : object->in.info = info_switch_1;
39603 : }
39604 : }
39605 0 : return 0;
39606 : }
39607 :
39608 0 : static PyObject *py_lsa_SetDomainInformationPolicy_get_result(PyObject *obj, void *closure)
39609 : {
39610 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(obj);
39611 0 : PyObject *py_result;
39612 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39613 0 : return py_result;
39614 : }
39615 :
39616 0 : static int py_lsa_SetDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
39617 : {
39618 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39619 0 : if (value == NULL) {
39620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39621 0 : return -1;
39622 : }
39623 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39624 0 : return 0;
39625 : }
39626 :
39627 : static PyGetSetDef py_lsa_SetDomainInformationPolicy_getsetters[] = {
39628 : {
39629 : .name = discard_const_p(char, "in_handle"),
39630 : .get = py_lsa_SetDomainInformationPolicy_in_get_handle,
39631 : .set = py_lsa_SetDomainInformationPolicy_in_set_handle,
39632 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39633 : },
39634 : {
39635 : .name = discard_const_p(char, "in_level"),
39636 : .get = py_lsa_SetDomainInformationPolicy_in_get_level,
39637 : .set = py_lsa_SetDomainInformationPolicy_in_set_level,
39638 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39639 : },
39640 : {
39641 : .name = discard_const_p(char, "in_info"),
39642 : .get = py_lsa_SetDomainInformationPolicy_in_get_info,
39643 : .set = py_lsa_SetDomainInformationPolicy_in_set_info,
39644 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
39645 : },
39646 : {
39647 : .name = discard_const_p(char, "result"),
39648 : .get = py_lsa_SetDomainInformationPolicy_get_result,
39649 : .set = py_lsa_SetDomainInformationPolicy_set_result,
39650 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39651 : },
39652 : { .name = NULL }
39653 : };
39654 :
39655 0 : static PyObject *py_lsa_SetDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39656 : {
39657 0 : PyObject *self = pytalloc_new(struct lsa_SetDomainInformationPolicy, type);
39658 0 : struct lsa_SetDomainInformationPolicy *_self = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(self);
39659 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39660 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
39661 0 : return self;
39662 : }
39663 :
39664 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39665 : {
39666 :
39667 :
39668 0 : return PyLong_FromLong(54);
39669 : }
39670 :
39671 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39672 : {
39673 0 : const struct ndr_interface_call *call = NULL;
39674 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39675 0 : PyObject *ret = NULL;
39676 0 : struct ndr_push *push = NULL;
39677 0 : DATA_BLOB blob;
39678 0 : enum ndr_err_code err;
39679 :
39680 0 : if (ndr_table_lsarpc.num_calls < 55) {
39681 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_pack");
39682 0 : return NULL;
39683 : }
39684 0 : call = &ndr_table_lsarpc.calls[54];
39685 :
39686 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39687 0 : if (push == NULL) {
39688 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39689 0 : return NULL;
39690 : }
39691 :
39692 0 : push->flags |= ndr_push_flags;
39693 :
39694 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39695 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39696 0 : TALLOC_FREE(push);
39697 0 : PyErr_SetNdrError(err);
39698 0 : return NULL;
39699 : }
39700 0 : blob = ndr_push_blob(push);
39701 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39702 0 : TALLOC_FREE(push);
39703 0 : return ret;
39704 : }
39705 :
39706 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39707 : {
39708 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39709 0 : PyObject *bigendian_obj = NULL;
39710 0 : PyObject *ndr64_obj = NULL;
39711 0 : libndr_flags ndr_push_flags = 0;
39712 :
39713 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39714 : discard_const_p(char *, kwnames),
39715 : &bigendian_obj,
39716 : &ndr64_obj)) {
39717 0 : return NULL;
39718 : }
39719 :
39720 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39721 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39722 : }
39723 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39724 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39725 : }
39726 :
39727 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39728 : }
39729 :
39730 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39731 : {
39732 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39733 0 : PyObject *bigendian_obj = NULL;
39734 0 : PyObject *ndr64_obj = NULL;
39735 0 : libndr_flags ndr_push_flags = 0;
39736 :
39737 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39738 : discard_const_p(char *, kwnames),
39739 : &bigendian_obj,
39740 : &ndr64_obj)) {
39741 0 : return NULL;
39742 : }
39743 :
39744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39745 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39746 : }
39747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39748 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39749 : }
39750 :
39751 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39752 : }
39753 :
39754 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
39755 : {
39756 0 : const struct ndr_interface_call *call = NULL;
39757 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39758 0 : struct ndr_pull *pull = NULL;
39759 0 : enum ndr_err_code err;
39760 :
39761 0 : if (ndr_table_lsarpc.num_calls < 55) {
39762 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_unpack");
39763 0 : return NULL;
39764 : }
39765 0 : call = &ndr_table_lsarpc.calls[54];
39766 :
39767 0 : pull = ndr_pull_init_blob(blob, object);
39768 0 : if (pull == NULL) {
39769 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39770 0 : return NULL;
39771 : }
39772 :
39773 0 : pull->flags |= ndr_pull_flags;
39774 :
39775 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39776 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39777 0 : TALLOC_FREE(pull);
39778 0 : PyErr_SetNdrError(err);
39779 0 : return NULL;
39780 : }
39781 0 : if (!allow_remaining) {
39782 0 : uint32_t highest_ofs;
39783 :
39784 0 : if (pull->offset > pull->relative_highest_offset) {
39785 0 : highest_ofs = pull->offset;
39786 : } else {
39787 0 : highest_ofs = pull->relative_highest_offset;
39788 : }
39789 0 : if (highest_ofs < pull->data_size) {
39790 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39791 : "not all bytes consumed ofs[%u] size[%u]",
39792 : highest_ofs, pull->data_size);
39793 0 : TALLOC_FREE(pull);
39794 0 : PyErr_SetNdrError(err);
39795 0 : return NULL;
39796 : }
39797 : }
39798 :
39799 0 : TALLOC_FREE(pull);
39800 0 : Py_RETURN_NONE;
39801 : }
39802 :
39803 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39804 : {
39805 0 : DATA_BLOB blob;
39806 0 : Py_ssize_t blob_length = 0;
39807 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39808 0 : PyObject *bigendian_obj = NULL;
39809 0 : PyObject *ndr64_obj = NULL;
39810 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39811 0 : PyObject *allow_remaining_obj = NULL;
39812 0 : bool allow_remaining = false;
39813 :
39814 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39815 : discard_const_p(char *, kwnames),
39816 : &blob.data, &blob_length,
39817 : &bigendian_obj,
39818 : &ndr64_obj,
39819 : &allow_remaining_obj)) {
39820 0 : return NULL;
39821 : }
39822 0 : blob.length = blob_length;
39823 :
39824 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39825 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39826 : }
39827 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39828 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39829 : }
39830 :
39831 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39832 0 : allow_remaining = true;
39833 : }
39834 :
39835 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39836 : }
39837 :
39838 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39839 : {
39840 0 : DATA_BLOB blob;
39841 0 : Py_ssize_t blob_length = 0;
39842 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39843 0 : PyObject *bigendian_obj = NULL;
39844 0 : PyObject *ndr64_obj = NULL;
39845 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39846 0 : PyObject *allow_remaining_obj = NULL;
39847 0 : bool allow_remaining = false;
39848 :
39849 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39850 : discard_const_p(char *, kwnames),
39851 : &blob.data, &blob_length,
39852 : &bigendian_obj,
39853 : &ndr64_obj,
39854 : &allow_remaining_obj)) {
39855 0 : return NULL;
39856 : }
39857 0 : blob.length = blob_length;
39858 :
39859 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39860 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39861 : }
39862 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39863 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39864 : }
39865 :
39866 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39867 0 : allow_remaining = true;
39868 : }
39869 :
39870 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39871 : }
39872 :
39873 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39874 : {
39875 0 : const struct ndr_interface_call *call = NULL;
39876 0 : struct lsa_SetDomainInformationPolicy *object = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(py_obj);
39877 0 : PyObject *ret;
39878 0 : char *retstr;
39879 :
39880 0 : if (ndr_table_lsarpc.num_calls < 55) {
39881 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_print");
39882 0 : return NULL;
39883 : }
39884 0 : call = &ndr_table_lsarpc.calls[54];
39885 :
39886 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39887 0 : ret = PyUnicode_FromString(retstr);
39888 0 : TALLOC_FREE(retstr);
39889 :
39890 0 : return ret;
39891 : }
39892 :
39893 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39894 : {
39895 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_in", NDR_IN);
39896 : }
39897 :
39898 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39899 : {
39900 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_out", NDR_OUT);
39901 : }
39902 :
39903 : static PyMethodDef py_lsa_SetDomainInformationPolicy_methods[] = {
39904 : { "opnum", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
39905 : "lsa.SetDomainInformationPolicy.opnum() -> 54 (0x36) " },
39906 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39907 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39908 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39909 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39910 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39911 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39912 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39913 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39914 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39915 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39916 : { NULL, NULL, 0, NULL }
39917 : };
39918 :
39919 :
39920 : static PyTypeObject lsa_SetDomainInformationPolicy_Type = {
39921 : PyVarObject_HEAD_INIT(NULL, 0)
39922 : .tp_name = "lsa.SetDomainInformationPolicy",
39923 : .tp_getset = py_lsa_SetDomainInformationPolicy_getsetters,
39924 : .tp_methods = py_lsa_SetDomainInformationPolicy_methods,
39925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39926 : .tp_new = py_lsa_SetDomainInformationPolicy_new,
39927 : };
39928 :
39929 0 : static bool pack_py_lsa_SetDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetDomainInformationPolicy *r)
39930 : {
39931 0 : PyObject *py_handle;
39932 0 : PyObject *py_level;
39933 0 : PyObject *py_info;
39934 0 : const char *kwnames[] = {
39935 : "handle", "level", "info", NULL
39936 : };
39937 :
39938 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
39939 0 : return false;
39940 : }
39941 :
39942 0 : if (py_handle == NULL) {
39943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
39944 0 : return false;
39945 : }
39946 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
39947 0 : if (r->in.handle == NULL) {
39948 0 : PyErr_NoMemory();
39949 0 : return false;
39950 : }
39951 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
39952 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
39953 0 : PyErr_NoMemory();
39954 0 : return false;
39955 : }
39956 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
39957 0 : if (py_level == NULL) {
39958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39959 0 : return false;
39960 : }
39961 : {
39962 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39963 0 : if (PyLong_Check(py_level)) {
39964 0 : unsigned long long test_var;
39965 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39966 0 : if (PyErr_Occurred() != NULL) {
39967 0 : return false;
39968 : }
39969 0 : if (test_var > uint_max) {
39970 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39971 : PyLong_Type.tp_name, uint_max, test_var);
39972 0 : return false;
39973 : }
39974 0 : r->in.level = test_var;
39975 : } else {
39976 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39977 : PyLong_Type.tp_name);
39978 0 : return false;
39979 : }
39980 : }
39981 0 : if (py_info == NULL) {
39982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
39983 0 : return false;
39984 : }
39985 0 : if (py_info == Py_None) {
39986 0 : r->in.info = NULL;
39987 : } else {
39988 0 : r->in.info = NULL;
39989 : {
39990 0 : union lsa_DomainInformationPolicy *info_switch_1;
39991 0 : info_switch_1 = (union lsa_DomainInformationPolicy *)pyrpc_export_union(&lsa_DomainInformationPolicy_Type, r, r->in.level, py_info, "union lsa_DomainInformationPolicy");
39992 0 : if (info_switch_1 == NULL) {
39993 0 : return false;
39994 : }
39995 0 : r->in.info = info_switch_1;
39996 : }
39997 : }
39998 0 : return true;
39999 : }
40000 :
40001 0 : static PyObject *unpack_py_lsa_SetDomainInformationPolicy_args_out(struct lsa_SetDomainInformationPolicy *r)
40002 : {
40003 0 : PyObject *result;
40004 0 : result = Py_None;
40005 0 : Py_INCREF(result);
40006 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40007 0 : PyErr_SetNTSTATUS(r->out.result);
40008 0 : return NULL;
40009 : }
40010 :
40011 0 : return result;
40012 : }
40013 :
40014 :
40015 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_handle(PyObject *obj, void *closure)
40016 : {
40017 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40018 0 : PyObject *py_handle;
40019 0 : if (object->in.handle == NULL) {
40020 0 : Py_RETURN_NONE;
40021 : }
40022 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40023 0 : return py_handle;
40024 : }
40025 :
40026 0 : static int py_lsa_OpenTrustedDomainByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40027 : {
40028 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40029 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40030 0 : if (value == NULL) {
40031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
40032 0 : return -1;
40033 : }
40034 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40035 0 : if (object->in.handle == NULL) {
40036 0 : PyErr_NoMemory();
40037 0 : return -1;
40038 : }
40039 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40040 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40041 0 : PyErr_NoMemory();
40042 0 : return -1;
40043 : }
40044 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40045 0 : return 0;
40046 : }
40047 :
40048 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_name(PyObject *obj, void *closure)
40049 : {
40050 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40051 0 : PyObject *py_name;
40052 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
40053 0 : return py_name;
40054 : }
40055 :
40056 0 : static int py_lsa_OpenTrustedDomainByName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
40057 : {
40058 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40059 0 : if (value == NULL) {
40060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
40061 0 : return -1;
40062 : }
40063 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
40064 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40065 0 : PyErr_NoMemory();
40066 0 : return -1;
40067 : }
40068 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
40069 0 : return 0;
40070 : }
40071 :
40072 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_access_mask(PyObject *obj, void *closure)
40073 : {
40074 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40075 0 : PyObject *py_access_mask;
40076 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
40077 0 : return py_access_mask;
40078 : }
40079 :
40080 0 : static int py_lsa_OpenTrustedDomainByName_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
40081 : {
40082 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40083 0 : if (value == NULL) {
40084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
40085 0 : return -1;
40086 : }
40087 : {
40088 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
40089 0 : if (PyLong_Check(value)) {
40090 0 : unsigned long long test_var;
40091 0 : test_var = PyLong_AsUnsignedLongLong(value);
40092 0 : if (PyErr_Occurred() != NULL) {
40093 0 : return -1;
40094 : }
40095 0 : if (test_var > uint_max) {
40096 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40097 : PyLong_Type.tp_name, uint_max, test_var);
40098 0 : return -1;
40099 : }
40100 0 : object->in.access_mask = test_var;
40101 : } else {
40102 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40103 : PyLong_Type.tp_name);
40104 0 : return -1;
40105 : }
40106 : }
40107 0 : return 0;
40108 : }
40109 :
40110 0 : static PyObject *py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle(PyObject *obj, void *closure)
40111 : {
40112 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40113 0 : PyObject *py_trustdom_handle;
40114 0 : if (object->out.trustdom_handle == NULL) {
40115 0 : Py_RETURN_NONE;
40116 : }
40117 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
40118 0 : return py_trustdom_handle;
40119 : }
40120 :
40121 0 : static int py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
40122 : {
40123 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40124 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
40125 0 : if (value == NULL) {
40126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
40127 0 : return -1;
40128 : }
40129 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
40130 0 : if (object->out.trustdom_handle == NULL) {
40131 0 : PyErr_NoMemory();
40132 0 : return -1;
40133 : }
40134 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40135 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40136 0 : PyErr_NoMemory();
40137 0 : return -1;
40138 : }
40139 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
40140 0 : return 0;
40141 : }
40142 :
40143 0 : static PyObject *py_lsa_OpenTrustedDomainByName_get_result(PyObject *obj, void *closure)
40144 : {
40145 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(obj);
40146 0 : PyObject *py_result;
40147 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40148 0 : return py_result;
40149 : }
40150 :
40151 0 : static int py_lsa_OpenTrustedDomainByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
40152 : {
40153 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40154 0 : if (value == NULL) {
40155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40156 0 : return -1;
40157 : }
40158 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40159 0 : return 0;
40160 : }
40161 :
40162 : static PyGetSetDef py_lsa_OpenTrustedDomainByName_getsetters[] = {
40163 : {
40164 : .name = discard_const_p(char, "in_handle"),
40165 : .get = py_lsa_OpenTrustedDomainByName_in_get_handle,
40166 : .set = py_lsa_OpenTrustedDomainByName_in_set_handle,
40167 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40168 : },
40169 : {
40170 : .name = discard_const_p(char, "in_name"),
40171 : .get = py_lsa_OpenTrustedDomainByName_in_get_name,
40172 : .set = py_lsa_OpenTrustedDomainByName_in_set_name,
40173 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
40174 : },
40175 : {
40176 : .name = discard_const_p(char, "in_access_mask"),
40177 : .get = py_lsa_OpenTrustedDomainByName_in_get_access_mask,
40178 : .set = py_lsa_OpenTrustedDomainByName_in_set_access_mask,
40179 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
40180 : },
40181 : {
40182 : .name = discard_const_p(char, "out_trustdom_handle"),
40183 : .get = py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle,
40184 : .set = py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle,
40185 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40186 : },
40187 : {
40188 : .name = discard_const_p(char, "result"),
40189 : .get = py_lsa_OpenTrustedDomainByName_get_result,
40190 : .set = py_lsa_OpenTrustedDomainByName_set_result,
40191 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40192 : },
40193 : { .name = NULL }
40194 : };
40195 :
40196 0 : static PyObject *py_lsa_OpenTrustedDomainByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40197 : {
40198 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomainByName, type);
40199 0 : struct lsa_OpenTrustedDomainByName *_self = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(self);
40200 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40201 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
40202 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
40203 0 : return self;
40204 : }
40205 :
40206 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40207 : {
40208 :
40209 :
40210 0 : return PyLong_FromLong(55);
40211 : }
40212 :
40213 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40214 : {
40215 0 : const struct ndr_interface_call *call = NULL;
40216 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40217 0 : PyObject *ret = NULL;
40218 0 : struct ndr_push *push = NULL;
40219 0 : DATA_BLOB blob;
40220 0 : enum ndr_err_code err;
40221 :
40222 0 : if (ndr_table_lsarpc.num_calls < 56) {
40223 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_pack");
40224 0 : return NULL;
40225 : }
40226 0 : call = &ndr_table_lsarpc.calls[55];
40227 :
40228 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40229 0 : if (push == NULL) {
40230 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40231 0 : return NULL;
40232 : }
40233 :
40234 0 : push->flags |= ndr_push_flags;
40235 :
40236 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40237 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40238 0 : TALLOC_FREE(push);
40239 0 : PyErr_SetNdrError(err);
40240 0 : return NULL;
40241 : }
40242 0 : blob = ndr_push_blob(push);
40243 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40244 0 : TALLOC_FREE(push);
40245 0 : return ret;
40246 : }
40247 :
40248 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40249 : {
40250 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40251 0 : PyObject *bigendian_obj = NULL;
40252 0 : PyObject *ndr64_obj = NULL;
40253 0 : libndr_flags ndr_push_flags = 0;
40254 :
40255 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40256 : discard_const_p(char *, kwnames),
40257 : &bigendian_obj,
40258 : &ndr64_obj)) {
40259 0 : return NULL;
40260 : }
40261 :
40262 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40263 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40264 : }
40265 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40266 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40267 : }
40268 :
40269 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40270 : }
40271 :
40272 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40273 : {
40274 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40275 0 : PyObject *bigendian_obj = NULL;
40276 0 : PyObject *ndr64_obj = NULL;
40277 0 : libndr_flags ndr_push_flags = 0;
40278 :
40279 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40280 : discard_const_p(char *, kwnames),
40281 : &bigendian_obj,
40282 : &ndr64_obj)) {
40283 0 : return NULL;
40284 : }
40285 :
40286 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40287 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40288 : }
40289 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40290 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40291 : }
40292 :
40293 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40294 : }
40295 :
40296 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
40297 : {
40298 0 : const struct ndr_interface_call *call = NULL;
40299 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40300 0 : struct ndr_pull *pull = NULL;
40301 0 : enum ndr_err_code err;
40302 :
40303 0 : if (ndr_table_lsarpc.num_calls < 56) {
40304 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_unpack");
40305 0 : return NULL;
40306 : }
40307 0 : call = &ndr_table_lsarpc.calls[55];
40308 :
40309 0 : pull = ndr_pull_init_blob(blob, object);
40310 0 : if (pull == NULL) {
40311 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40312 0 : return NULL;
40313 : }
40314 :
40315 0 : pull->flags |= ndr_pull_flags;
40316 :
40317 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40318 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40319 0 : TALLOC_FREE(pull);
40320 0 : PyErr_SetNdrError(err);
40321 0 : return NULL;
40322 : }
40323 0 : if (!allow_remaining) {
40324 0 : uint32_t highest_ofs;
40325 :
40326 0 : if (pull->offset > pull->relative_highest_offset) {
40327 0 : highest_ofs = pull->offset;
40328 : } else {
40329 0 : highest_ofs = pull->relative_highest_offset;
40330 : }
40331 0 : if (highest_ofs < pull->data_size) {
40332 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40333 : "not all bytes consumed ofs[%u] size[%u]",
40334 : highest_ofs, pull->data_size);
40335 0 : TALLOC_FREE(pull);
40336 0 : PyErr_SetNdrError(err);
40337 0 : return NULL;
40338 : }
40339 : }
40340 :
40341 0 : TALLOC_FREE(pull);
40342 0 : Py_RETURN_NONE;
40343 : }
40344 :
40345 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40346 : {
40347 0 : DATA_BLOB blob;
40348 0 : Py_ssize_t blob_length = 0;
40349 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40350 0 : PyObject *bigendian_obj = NULL;
40351 0 : PyObject *ndr64_obj = NULL;
40352 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40353 0 : PyObject *allow_remaining_obj = NULL;
40354 0 : bool allow_remaining = false;
40355 :
40356 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40357 : discard_const_p(char *, kwnames),
40358 : &blob.data, &blob_length,
40359 : &bigendian_obj,
40360 : &ndr64_obj,
40361 : &allow_remaining_obj)) {
40362 0 : return NULL;
40363 : }
40364 0 : blob.length = blob_length;
40365 :
40366 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40367 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40368 : }
40369 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40370 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40371 : }
40372 :
40373 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40374 0 : allow_remaining = true;
40375 : }
40376 :
40377 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40378 : }
40379 :
40380 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40381 : {
40382 0 : DATA_BLOB blob;
40383 0 : Py_ssize_t blob_length = 0;
40384 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40385 0 : PyObject *bigendian_obj = NULL;
40386 0 : PyObject *ndr64_obj = NULL;
40387 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40388 0 : PyObject *allow_remaining_obj = NULL;
40389 0 : bool allow_remaining = false;
40390 :
40391 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40392 : discard_const_p(char *, kwnames),
40393 : &blob.data, &blob_length,
40394 : &bigendian_obj,
40395 : &ndr64_obj,
40396 : &allow_remaining_obj)) {
40397 0 : return NULL;
40398 : }
40399 0 : blob.length = blob_length;
40400 :
40401 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40402 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40403 : }
40404 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40405 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40406 : }
40407 :
40408 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40409 0 : allow_remaining = true;
40410 : }
40411 :
40412 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40413 : }
40414 :
40415 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40416 : {
40417 0 : const struct ndr_interface_call *call = NULL;
40418 0 : struct lsa_OpenTrustedDomainByName *object = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(py_obj);
40419 0 : PyObject *ret;
40420 0 : char *retstr;
40421 :
40422 0 : if (ndr_table_lsarpc.num_calls < 56) {
40423 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_print");
40424 0 : return NULL;
40425 : }
40426 0 : call = &ndr_table_lsarpc.calls[55];
40427 :
40428 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40429 0 : ret = PyUnicode_FromString(retstr);
40430 0 : TALLOC_FREE(retstr);
40431 :
40432 0 : return ret;
40433 : }
40434 :
40435 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40436 : {
40437 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_in", NDR_IN);
40438 : }
40439 :
40440 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40441 : {
40442 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_out", NDR_OUT);
40443 : }
40444 :
40445 : static PyMethodDef py_lsa_OpenTrustedDomainByName_methods[] = {
40446 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_opnum, METH_NOARGS|METH_CLASS,
40447 : "lsa.OpenTrustedDomainByName.opnum() -> 55 (0x37) " },
40448 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40449 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40450 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40451 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40452 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40453 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40454 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40455 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40456 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40457 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40458 : { NULL, NULL, 0, NULL }
40459 : };
40460 :
40461 :
40462 : static PyTypeObject lsa_OpenTrustedDomainByName_Type = {
40463 : PyVarObject_HEAD_INIT(NULL, 0)
40464 : .tp_name = "lsa.OpenTrustedDomainByName",
40465 : .tp_getset = py_lsa_OpenTrustedDomainByName_getsetters,
40466 : .tp_methods = py_lsa_OpenTrustedDomainByName_methods,
40467 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40468 : .tp_new = py_lsa_OpenTrustedDomainByName_new,
40469 : };
40470 :
40471 0 : static bool pack_py_lsa_OpenTrustedDomainByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomainByName *r)
40472 : {
40473 0 : PyObject *py_handle;
40474 0 : PyObject *py_name;
40475 0 : PyObject *py_access_mask;
40476 0 : const char *kwnames[] = {
40477 : "handle", "name", "access_mask", NULL
40478 : };
40479 :
40480 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomainByName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
40481 0 : return false;
40482 : }
40483 :
40484 0 : if (py_handle == NULL) {
40485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
40486 0 : return false;
40487 : }
40488 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
40489 0 : if (r->in.handle == NULL) {
40490 0 : PyErr_NoMemory();
40491 0 : return false;
40492 : }
40493 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
40494 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
40495 0 : PyErr_NoMemory();
40496 0 : return false;
40497 : }
40498 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
40499 0 : if (py_name == NULL) {
40500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
40501 0 : return false;
40502 : }
40503 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
40504 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
40505 0 : PyErr_NoMemory();
40506 0 : return false;
40507 : }
40508 0 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
40509 0 : if (py_access_mask == NULL) {
40510 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
40511 0 : return false;
40512 : }
40513 : {
40514 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
40515 0 : if (PyLong_Check(py_access_mask)) {
40516 0 : unsigned long long test_var;
40517 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
40518 0 : if (PyErr_Occurred() != NULL) {
40519 0 : return false;
40520 : }
40521 0 : if (test_var > uint_max) {
40522 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40523 : PyLong_Type.tp_name, uint_max, test_var);
40524 0 : return false;
40525 : }
40526 0 : r->in.access_mask = test_var;
40527 : } else {
40528 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40529 : PyLong_Type.tp_name);
40530 0 : return false;
40531 : }
40532 : }
40533 0 : return true;
40534 : }
40535 :
40536 0 : static PyObject *unpack_py_lsa_OpenTrustedDomainByName_args_out(struct lsa_OpenTrustedDomainByName *r)
40537 : {
40538 0 : PyObject *result;
40539 0 : PyObject *py_trustdom_handle;
40540 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
40541 0 : result = py_trustdom_handle;
40542 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40543 0 : PyErr_SetNTSTATUS(r->out.result);
40544 0 : return NULL;
40545 : }
40546 :
40547 0 : return result;
40548 : }
40549 :
40550 :
40551 0 : static PyObject *py_lsa_LookupSids2_in_get_handle(PyObject *obj, void *closure)
40552 : {
40553 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40554 0 : PyObject *py_handle;
40555 0 : if (object->in.handle == NULL) {
40556 0 : Py_RETURN_NONE;
40557 : }
40558 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40559 0 : return py_handle;
40560 : }
40561 :
40562 0 : static int py_lsa_LookupSids2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40563 : {
40564 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40565 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40566 0 : if (value == NULL) {
40567 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
40568 0 : return -1;
40569 : }
40570 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40571 0 : if (object->in.handle == NULL) {
40572 0 : PyErr_NoMemory();
40573 0 : return -1;
40574 : }
40575 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40576 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40577 0 : PyErr_NoMemory();
40578 0 : return -1;
40579 : }
40580 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40581 0 : return 0;
40582 : }
40583 :
40584 0 : static PyObject *py_lsa_LookupSids2_in_get_sids(PyObject *obj, void *closure)
40585 : {
40586 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40587 0 : PyObject *py_sids;
40588 0 : if (object->in.sids == NULL) {
40589 0 : Py_RETURN_NONE;
40590 : }
40591 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
40592 0 : return py_sids;
40593 : }
40594 :
40595 0 : static int py_lsa_LookupSids2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
40596 : {
40597 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40598 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
40599 0 : if (value == NULL) {
40600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
40601 0 : return -1;
40602 : }
40603 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
40604 0 : if (object->in.sids == NULL) {
40605 0 : PyErr_NoMemory();
40606 0 : return -1;
40607 : }
40608 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
40609 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40610 0 : PyErr_NoMemory();
40611 0 : return -1;
40612 : }
40613 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
40614 0 : return 0;
40615 : }
40616 :
40617 0 : static PyObject *py_lsa_LookupSids2_out_get_domains(PyObject *obj, void *closure)
40618 : {
40619 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40620 0 : PyObject *py_domains;
40621 0 : if (object->out.domains == NULL) {
40622 0 : Py_RETURN_NONE;
40623 : }
40624 0 : if (*object->out.domains == NULL) {
40625 0 : py_domains = Py_None;
40626 0 : Py_INCREF(py_domains);
40627 : } else {
40628 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
40629 : }
40630 0 : return py_domains;
40631 : }
40632 :
40633 0 : static int py_lsa_LookupSids2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
40634 : {
40635 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40636 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
40637 0 : if (value == NULL) {
40638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
40639 0 : return -1;
40640 : }
40641 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
40642 0 : if (object->out.domains == NULL) {
40643 0 : PyErr_NoMemory();
40644 0 : return -1;
40645 : }
40646 0 : if (value == Py_None) {
40647 0 : *object->out.domains = NULL;
40648 : } else {
40649 0 : *object->out.domains = NULL;
40650 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
40651 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40652 0 : PyErr_NoMemory();
40653 0 : return -1;
40654 : }
40655 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
40656 : }
40657 0 : return 0;
40658 : }
40659 :
40660 0 : static PyObject *py_lsa_LookupSids2_in_get_names(PyObject *obj, void *closure)
40661 : {
40662 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40663 0 : PyObject *py_names;
40664 0 : if (object->in.names == NULL) {
40665 0 : Py_RETURN_NONE;
40666 : }
40667 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
40668 0 : return py_names;
40669 : }
40670 :
40671 0 : static int py_lsa_LookupSids2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
40672 : {
40673 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40674 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
40675 0 : if (value == NULL) {
40676 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
40677 0 : return -1;
40678 : }
40679 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
40680 0 : if (object->in.names == NULL) {
40681 0 : PyErr_NoMemory();
40682 0 : return -1;
40683 : }
40684 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
40685 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40686 0 : PyErr_NoMemory();
40687 0 : return -1;
40688 : }
40689 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
40690 0 : return 0;
40691 : }
40692 :
40693 0 : static PyObject *py_lsa_LookupSids2_out_get_names(PyObject *obj, void *closure)
40694 : {
40695 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40696 0 : PyObject *py_names;
40697 0 : if (object->out.names == NULL) {
40698 0 : Py_RETURN_NONE;
40699 : }
40700 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
40701 0 : return py_names;
40702 : }
40703 :
40704 0 : static int py_lsa_LookupSids2_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
40705 : {
40706 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40707 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
40708 0 : if (value == NULL) {
40709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
40710 0 : return -1;
40711 : }
40712 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
40713 0 : if (object->out.names == NULL) {
40714 0 : PyErr_NoMemory();
40715 0 : return -1;
40716 : }
40717 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
40718 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40719 0 : PyErr_NoMemory();
40720 0 : return -1;
40721 : }
40722 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
40723 0 : return 0;
40724 : }
40725 :
40726 0 : static PyObject *py_lsa_LookupSids2_in_get_level(PyObject *obj, void *closure)
40727 : {
40728 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40729 0 : PyObject *py_level;
40730 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
40731 0 : return py_level;
40732 : }
40733 :
40734 0 : static int py_lsa_LookupSids2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
40735 : {
40736 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40737 0 : if (value == NULL) {
40738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
40739 0 : return -1;
40740 : }
40741 : {
40742 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
40743 0 : if (PyLong_Check(value)) {
40744 0 : unsigned long long test_var;
40745 0 : test_var = PyLong_AsUnsignedLongLong(value);
40746 0 : if (PyErr_Occurred() != NULL) {
40747 0 : return -1;
40748 : }
40749 0 : if (test_var > uint_max) {
40750 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40751 : PyLong_Type.tp_name, uint_max, test_var);
40752 0 : return -1;
40753 : }
40754 0 : object->in.level = test_var;
40755 : } else {
40756 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40757 : PyLong_Type.tp_name);
40758 0 : return -1;
40759 : }
40760 : }
40761 0 : return 0;
40762 : }
40763 :
40764 0 : static PyObject *py_lsa_LookupSids2_in_get_count(PyObject *obj, void *closure)
40765 : {
40766 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40767 0 : PyObject *py_count;
40768 0 : if (object->in.count == NULL) {
40769 0 : Py_RETURN_NONE;
40770 : }
40771 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
40772 0 : return py_count;
40773 : }
40774 :
40775 0 : static int py_lsa_LookupSids2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
40776 : {
40777 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40778 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
40779 0 : if (value == NULL) {
40780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
40781 0 : return -1;
40782 : }
40783 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
40784 0 : if (object->in.count == NULL) {
40785 0 : PyErr_NoMemory();
40786 0 : return -1;
40787 : }
40788 : {
40789 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
40790 0 : if (PyLong_Check(value)) {
40791 0 : unsigned long long test_var;
40792 0 : test_var = PyLong_AsUnsignedLongLong(value);
40793 0 : if (PyErr_Occurred() != NULL) {
40794 0 : return -1;
40795 : }
40796 0 : if (test_var > uint_max) {
40797 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40798 : PyLong_Type.tp_name, uint_max, test_var);
40799 0 : return -1;
40800 : }
40801 0 : *object->in.count = test_var;
40802 : } else {
40803 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40804 : PyLong_Type.tp_name);
40805 0 : return -1;
40806 : }
40807 : }
40808 0 : return 0;
40809 : }
40810 :
40811 0 : static PyObject *py_lsa_LookupSids2_out_get_count(PyObject *obj, void *closure)
40812 : {
40813 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40814 0 : PyObject *py_count;
40815 0 : if (object->out.count == NULL) {
40816 0 : Py_RETURN_NONE;
40817 : }
40818 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
40819 0 : return py_count;
40820 : }
40821 :
40822 0 : static int py_lsa_LookupSids2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
40823 : {
40824 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40825 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
40826 0 : if (value == NULL) {
40827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
40828 0 : return -1;
40829 : }
40830 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
40831 0 : if (object->out.count == NULL) {
40832 0 : PyErr_NoMemory();
40833 0 : return -1;
40834 : }
40835 : {
40836 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
40837 0 : if (PyLong_Check(value)) {
40838 0 : unsigned long long test_var;
40839 0 : test_var = PyLong_AsUnsignedLongLong(value);
40840 0 : if (PyErr_Occurred() != NULL) {
40841 0 : return -1;
40842 : }
40843 0 : if (test_var > uint_max) {
40844 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40845 : PyLong_Type.tp_name, uint_max, test_var);
40846 0 : return -1;
40847 : }
40848 0 : *object->out.count = test_var;
40849 : } else {
40850 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40851 : PyLong_Type.tp_name);
40852 0 : return -1;
40853 : }
40854 : }
40855 0 : return 0;
40856 : }
40857 :
40858 0 : static PyObject *py_lsa_LookupSids2_in_get_lookup_options(PyObject *obj, void *closure)
40859 : {
40860 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40861 0 : PyObject *py_lookup_options;
40862 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
40863 0 : return py_lookup_options;
40864 : }
40865 :
40866 0 : static int py_lsa_LookupSids2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
40867 : {
40868 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40869 0 : if (value == NULL) {
40870 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
40871 0 : return -1;
40872 : }
40873 : {
40874 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
40875 0 : if (PyLong_Check(value)) {
40876 0 : unsigned long long test_var;
40877 0 : test_var = PyLong_AsUnsignedLongLong(value);
40878 0 : if (PyErr_Occurred() != NULL) {
40879 0 : return -1;
40880 : }
40881 0 : if (test_var > uint_max) {
40882 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40883 : PyLong_Type.tp_name, uint_max, test_var);
40884 0 : return -1;
40885 : }
40886 0 : object->in.lookup_options = test_var;
40887 : } else {
40888 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40889 : PyLong_Type.tp_name);
40890 0 : return -1;
40891 : }
40892 : }
40893 0 : return 0;
40894 : }
40895 :
40896 0 : static PyObject *py_lsa_LookupSids2_in_get_client_revision(PyObject *obj, void *closure)
40897 : {
40898 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40899 0 : PyObject *py_client_revision;
40900 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
40901 0 : return py_client_revision;
40902 : }
40903 :
40904 0 : static int py_lsa_LookupSids2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
40905 : {
40906 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40907 0 : if (value == NULL) {
40908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
40909 0 : return -1;
40910 : }
40911 : {
40912 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
40913 0 : if (PyLong_Check(value)) {
40914 0 : unsigned long long test_var;
40915 0 : test_var = PyLong_AsUnsignedLongLong(value);
40916 0 : if (PyErr_Occurred() != NULL) {
40917 0 : return -1;
40918 : }
40919 0 : if (test_var > uint_max) {
40920 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40921 : PyLong_Type.tp_name, uint_max, test_var);
40922 0 : return -1;
40923 : }
40924 0 : object->in.client_revision = test_var;
40925 : } else {
40926 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40927 : PyLong_Type.tp_name);
40928 0 : return -1;
40929 : }
40930 : }
40931 0 : return 0;
40932 : }
40933 :
40934 0 : static PyObject *py_lsa_LookupSids2_get_result(PyObject *obj, void *closure)
40935 : {
40936 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(obj);
40937 0 : PyObject *py_result;
40938 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40939 0 : return py_result;
40940 : }
40941 :
40942 0 : static int py_lsa_LookupSids2_set_result(PyObject *py_obj, PyObject *value, void *closure)
40943 : {
40944 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
40945 0 : if (value == NULL) {
40946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40947 0 : return -1;
40948 : }
40949 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40950 0 : return 0;
40951 : }
40952 :
40953 : static PyGetSetDef py_lsa_LookupSids2_getsetters[] = {
40954 : {
40955 : .name = discard_const_p(char, "in_handle"),
40956 : .get = py_lsa_LookupSids2_in_get_handle,
40957 : .set = py_lsa_LookupSids2_in_set_handle,
40958 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40959 : },
40960 : {
40961 : .name = discard_const_p(char, "in_sids"),
40962 : .get = py_lsa_LookupSids2_in_get_sids,
40963 : .set = py_lsa_LookupSids2_in_set_sids,
40964 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
40965 : },
40966 : {
40967 : .name = discard_const_p(char, "out_domains"),
40968 : .get = py_lsa_LookupSids2_out_get_domains,
40969 : .set = py_lsa_LookupSids2_out_set_domains,
40970 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
40971 : },
40972 : {
40973 : .name = discard_const_p(char, "in_names"),
40974 : .get = py_lsa_LookupSids2_in_get_names,
40975 : .set = py_lsa_LookupSids2_in_set_names,
40976 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
40977 : },
40978 : {
40979 : .name = discard_const_p(char, "out_names"),
40980 : .get = py_lsa_LookupSids2_out_get_names,
40981 : .set = py_lsa_LookupSids2_out_set_names,
40982 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
40983 : },
40984 : {
40985 : .name = discard_const_p(char, "in_level"),
40986 : .get = py_lsa_LookupSids2_in_get_level,
40987 : .set = py_lsa_LookupSids2_in_set_level,
40988 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
40989 : },
40990 : {
40991 : .name = discard_const_p(char, "in_count"),
40992 : .get = py_lsa_LookupSids2_in_get_count,
40993 : .set = py_lsa_LookupSids2_in_set_count,
40994 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40995 : },
40996 : {
40997 : .name = discard_const_p(char, "out_count"),
40998 : .get = py_lsa_LookupSids2_out_get_count,
40999 : .set = py_lsa_LookupSids2_out_set_count,
41000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41001 : },
41002 : {
41003 : .name = discard_const_p(char, "in_lookup_options"),
41004 : .get = py_lsa_LookupSids2_in_get_lookup_options,
41005 : .set = py_lsa_LookupSids2_in_set_lookup_options,
41006 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
41007 : },
41008 : {
41009 : .name = discard_const_p(char, "in_client_revision"),
41010 : .get = py_lsa_LookupSids2_in_get_client_revision,
41011 : .set = py_lsa_LookupSids2_in_set_client_revision,
41012 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
41013 : },
41014 : {
41015 : .name = discard_const_p(char, "result"),
41016 : .get = py_lsa_LookupSids2_get_result,
41017 : .set = py_lsa_LookupSids2_set_result,
41018 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
41019 : },
41020 : { .name = NULL }
41021 : };
41022 :
41023 0 : static PyObject *py_lsa_LookupSids2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41024 : {
41025 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids2, type);
41026 0 : struct lsa_LookupSids2 *_self = (struct lsa_LookupSids2 *)pytalloc_get_ptr(self);
41027 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41028 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
41029 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
41030 : /* a pointer to a NULL pointer */
41031 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
41032 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
41033 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
41034 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
41035 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
41036 0 : return self;
41037 : }
41038 :
41039 0 : static PyObject *py_lsa_LookupSids2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41040 : {
41041 :
41042 :
41043 0 : return PyLong_FromLong(57);
41044 : }
41045 :
41046 0 : static PyObject *py_lsa_LookupSids2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41047 : {
41048 0 : const struct ndr_interface_call *call = NULL;
41049 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41050 0 : PyObject *ret = NULL;
41051 0 : struct ndr_push *push = NULL;
41052 0 : DATA_BLOB blob;
41053 0 : enum ndr_err_code err;
41054 :
41055 0 : if (ndr_table_lsarpc.num_calls < 58) {
41056 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_pack");
41057 0 : return NULL;
41058 : }
41059 0 : call = &ndr_table_lsarpc.calls[57];
41060 :
41061 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41062 0 : if (push == NULL) {
41063 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41064 0 : return NULL;
41065 : }
41066 :
41067 0 : push->flags |= ndr_push_flags;
41068 :
41069 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41070 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41071 0 : TALLOC_FREE(push);
41072 0 : PyErr_SetNdrError(err);
41073 0 : return NULL;
41074 : }
41075 0 : blob = ndr_push_blob(push);
41076 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41077 0 : TALLOC_FREE(push);
41078 0 : return ret;
41079 : }
41080 :
41081 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41082 : {
41083 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41084 0 : PyObject *bigendian_obj = NULL;
41085 0 : PyObject *ndr64_obj = NULL;
41086 0 : libndr_flags ndr_push_flags = 0;
41087 :
41088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41089 : discard_const_p(char *, kwnames),
41090 : &bigendian_obj,
41091 : &ndr64_obj)) {
41092 0 : return NULL;
41093 : }
41094 :
41095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41096 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41097 : }
41098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41099 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41100 : }
41101 :
41102 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41103 : }
41104 :
41105 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41106 : {
41107 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41108 0 : PyObject *bigendian_obj = NULL;
41109 0 : PyObject *ndr64_obj = NULL;
41110 0 : libndr_flags ndr_push_flags = 0;
41111 :
41112 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41113 : discard_const_p(char *, kwnames),
41114 : &bigendian_obj,
41115 : &ndr64_obj)) {
41116 0 : return NULL;
41117 : }
41118 :
41119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41120 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41121 : }
41122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41123 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41124 : }
41125 :
41126 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41127 : }
41128 :
41129 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41130 : {
41131 0 : const struct ndr_interface_call *call = NULL;
41132 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41133 0 : struct ndr_pull *pull = NULL;
41134 0 : enum ndr_err_code err;
41135 :
41136 0 : if (ndr_table_lsarpc.num_calls < 58) {
41137 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_unpack");
41138 0 : return NULL;
41139 : }
41140 0 : call = &ndr_table_lsarpc.calls[57];
41141 :
41142 0 : pull = ndr_pull_init_blob(blob, object);
41143 0 : if (pull == NULL) {
41144 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41145 0 : return NULL;
41146 : }
41147 :
41148 0 : pull->flags |= ndr_pull_flags;
41149 :
41150 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41151 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41152 0 : TALLOC_FREE(pull);
41153 0 : PyErr_SetNdrError(err);
41154 0 : return NULL;
41155 : }
41156 0 : if (!allow_remaining) {
41157 0 : uint32_t highest_ofs;
41158 :
41159 0 : if (pull->offset > pull->relative_highest_offset) {
41160 0 : highest_ofs = pull->offset;
41161 : } else {
41162 0 : highest_ofs = pull->relative_highest_offset;
41163 : }
41164 0 : if (highest_ofs < pull->data_size) {
41165 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41166 : "not all bytes consumed ofs[%u] size[%u]",
41167 : highest_ofs, pull->data_size);
41168 0 : TALLOC_FREE(pull);
41169 0 : PyErr_SetNdrError(err);
41170 0 : return NULL;
41171 : }
41172 : }
41173 :
41174 0 : TALLOC_FREE(pull);
41175 0 : Py_RETURN_NONE;
41176 : }
41177 :
41178 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41179 : {
41180 0 : DATA_BLOB blob;
41181 0 : Py_ssize_t blob_length = 0;
41182 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41183 0 : PyObject *bigendian_obj = NULL;
41184 0 : PyObject *ndr64_obj = NULL;
41185 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41186 0 : PyObject *allow_remaining_obj = NULL;
41187 0 : bool allow_remaining = false;
41188 :
41189 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41190 : discard_const_p(char *, kwnames),
41191 : &blob.data, &blob_length,
41192 : &bigendian_obj,
41193 : &ndr64_obj,
41194 : &allow_remaining_obj)) {
41195 0 : return NULL;
41196 : }
41197 0 : blob.length = blob_length;
41198 :
41199 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41200 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41201 : }
41202 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41203 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41204 : }
41205 :
41206 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41207 0 : allow_remaining = true;
41208 : }
41209 :
41210 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41211 : }
41212 :
41213 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41214 : {
41215 0 : DATA_BLOB blob;
41216 0 : Py_ssize_t blob_length = 0;
41217 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41218 0 : PyObject *bigendian_obj = NULL;
41219 0 : PyObject *ndr64_obj = NULL;
41220 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41221 0 : PyObject *allow_remaining_obj = NULL;
41222 0 : bool allow_remaining = false;
41223 :
41224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41225 : discard_const_p(char *, kwnames),
41226 : &blob.data, &blob_length,
41227 : &bigendian_obj,
41228 : &ndr64_obj,
41229 : &allow_remaining_obj)) {
41230 0 : return NULL;
41231 : }
41232 0 : blob.length = blob_length;
41233 :
41234 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41235 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41236 : }
41237 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41238 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41239 : }
41240 :
41241 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41242 0 : allow_remaining = true;
41243 : }
41244 :
41245 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41246 : }
41247 :
41248 0 : static PyObject *py_lsa_LookupSids2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41249 : {
41250 0 : const struct ndr_interface_call *call = NULL;
41251 0 : struct lsa_LookupSids2 *object = (struct lsa_LookupSids2 *)pytalloc_get_ptr(py_obj);
41252 0 : PyObject *ret;
41253 0 : char *retstr;
41254 :
41255 0 : if (ndr_table_lsarpc.num_calls < 58) {
41256 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_print");
41257 0 : return NULL;
41258 : }
41259 0 : call = &ndr_table_lsarpc.calls[57];
41260 :
41261 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41262 0 : ret = PyUnicode_FromString(retstr);
41263 0 : TALLOC_FREE(retstr);
41264 :
41265 0 : return ret;
41266 : }
41267 :
41268 0 : static PyObject *py_lsa_LookupSids2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41269 : {
41270 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_in", NDR_IN);
41271 : }
41272 :
41273 0 : static PyObject *py_lsa_LookupSids2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41274 : {
41275 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_out", NDR_OUT);
41276 : }
41277 :
41278 : static PyMethodDef py_lsa_LookupSids2_methods[] = {
41279 : { "opnum", (PyCFunction)py_lsa_LookupSids2_ndr_opnum, METH_NOARGS|METH_CLASS,
41280 : "lsa.LookupSids2.opnum() -> 57 (0x39) " },
41281 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41282 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41283 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41284 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41285 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41286 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41287 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41288 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41289 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41290 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41291 : { NULL, NULL, 0, NULL }
41292 : };
41293 :
41294 :
41295 : static PyTypeObject lsa_LookupSids2_Type = {
41296 : PyVarObject_HEAD_INIT(NULL, 0)
41297 : .tp_name = "lsa.LookupSids2",
41298 : .tp_getset = py_lsa_LookupSids2_getsetters,
41299 : .tp_methods = py_lsa_LookupSids2_methods,
41300 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41301 : .tp_new = py_lsa_LookupSids2_new,
41302 : };
41303 :
41304 0 : static bool pack_py_lsa_LookupSids2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids2 *r)
41305 : {
41306 0 : PyObject *py_handle;
41307 0 : PyObject *py_sids;
41308 0 : PyObject *py_names;
41309 0 : PyObject *py_level;
41310 0 : PyObject *py_count;
41311 0 : PyObject *py_lookup_options;
41312 0 : PyObject *py_client_revision;
41313 0 : const char *kwnames[] = {
41314 : "handle", "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
41315 : };
41316 :
41317 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)) {
41318 0 : return false;
41319 : }
41320 :
41321 0 : if (py_handle == NULL) {
41322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
41323 0 : return false;
41324 : }
41325 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
41326 0 : if (r->in.handle == NULL) {
41327 0 : PyErr_NoMemory();
41328 0 : return false;
41329 : }
41330 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
41331 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
41332 0 : PyErr_NoMemory();
41333 0 : return false;
41334 : }
41335 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
41336 0 : if (py_sids == NULL) {
41337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
41338 0 : return false;
41339 : }
41340 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
41341 0 : if (r->in.sids == NULL) {
41342 0 : PyErr_NoMemory();
41343 0 : return false;
41344 : }
41345 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
41346 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
41347 0 : PyErr_NoMemory();
41348 0 : return false;
41349 : }
41350 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
41351 0 : if (py_names == NULL) {
41352 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
41353 0 : return false;
41354 : }
41355 0 : r->in.names = talloc_ptrtype(r, r->in.names);
41356 0 : if (r->in.names == NULL) {
41357 0 : PyErr_NoMemory();
41358 0 : return false;
41359 : }
41360 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
41361 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
41362 0 : PyErr_NoMemory();
41363 0 : return false;
41364 : }
41365 0 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
41366 0 : if (py_level == NULL) {
41367 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
41368 0 : return false;
41369 : }
41370 : {
41371 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
41372 0 : if (PyLong_Check(py_level)) {
41373 0 : unsigned long long test_var;
41374 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
41375 0 : if (PyErr_Occurred() != NULL) {
41376 0 : return false;
41377 : }
41378 0 : if (test_var > uint_max) {
41379 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41380 : PyLong_Type.tp_name, uint_max, test_var);
41381 0 : return false;
41382 : }
41383 0 : r->in.level = test_var;
41384 : } else {
41385 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41386 : PyLong_Type.tp_name);
41387 0 : return false;
41388 : }
41389 : }
41390 0 : if (py_count == NULL) {
41391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
41392 0 : return false;
41393 : }
41394 0 : r->in.count = talloc_ptrtype(r, r->in.count);
41395 0 : if (r->in.count == NULL) {
41396 0 : PyErr_NoMemory();
41397 0 : return false;
41398 : }
41399 : {
41400 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
41401 0 : if (PyLong_Check(py_count)) {
41402 0 : unsigned long long test_var;
41403 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
41404 0 : if (PyErr_Occurred() != NULL) {
41405 0 : return false;
41406 : }
41407 0 : if (test_var > uint_max) {
41408 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41409 : PyLong_Type.tp_name, uint_max, test_var);
41410 0 : return false;
41411 : }
41412 0 : *r->in.count = test_var;
41413 : } else {
41414 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41415 : PyLong_Type.tp_name);
41416 0 : return false;
41417 : }
41418 : }
41419 0 : if (py_lookup_options == NULL) {
41420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
41421 0 : return false;
41422 : }
41423 : {
41424 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
41425 0 : if (PyLong_Check(py_lookup_options)) {
41426 0 : unsigned long long test_var;
41427 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
41428 0 : if (PyErr_Occurred() != NULL) {
41429 0 : return false;
41430 : }
41431 0 : if (test_var > uint_max) {
41432 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41433 : PyLong_Type.tp_name, uint_max, test_var);
41434 0 : return false;
41435 : }
41436 0 : r->in.lookup_options = test_var;
41437 : } else {
41438 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41439 : PyLong_Type.tp_name);
41440 0 : return false;
41441 : }
41442 : }
41443 0 : if (py_client_revision == NULL) {
41444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
41445 0 : return false;
41446 : }
41447 : {
41448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
41449 0 : if (PyLong_Check(py_client_revision)) {
41450 0 : unsigned long long test_var;
41451 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
41452 0 : if (PyErr_Occurred() != NULL) {
41453 0 : return false;
41454 : }
41455 0 : if (test_var > uint_max) {
41456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41457 : PyLong_Type.tp_name, uint_max, test_var);
41458 0 : return false;
41459 : }
41460 0 : r->in.client_revision = test_var;
41461 : } else {
41462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41463 : PyLong_Type.tp_name);
41464 0 : return false;
41465 : }
41466 : }
41467 0 : return true;
41468 : }
41469 :
41470 0 : static PyObject *unpack_py_lsa_LookupSids2_args_out(struct lsa_LookupSids2 *r)
41471 : {
41472 0 : PyObject *result;
41473 0 : PyObject *py_domains;
41474 0 : PyObject *py_names;
41475 0 : PyObject *py_count;
41476 0 : result = PyTuple_New(3);
41477 0 : if (*r->out.domains == NULL) {
41478 0 : py_domains = Py_None;
41479 0 : Py_INCREF(py_domains);
41480 : } else {
41481 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
41482 : }
41483 0 : PyTuple_SetItem(result, 0, py_domains);
41484 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
41485 0 : PyTuple_SetItem(result, 1, py_names);
41486 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
41487 0 : PyTuple_SetItem(result, 2, py_count);
41488 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41489 0 : PyErr_SetNTSTATUS(r->out.result);
41490 0 : return NULL;
41491 : }
41492 :
41493 0 : return result;
41494 : }
41495 :
41496 :
41497 0 : static PyObject *py_lsa_LookupNames2_in_get_handle(PyObject *obj, void *closure)
41498 : {
41499 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41500 0 : PyObject *py_handle;
41501 0 : if (object->in.handle == NULL) {
41502 0 : Py_RETURN_NONE;
41503 : }
41504 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
41505 0 : return py_handle;
41506 : }
41507 :
41508 0 : static int py_lsa_LookupNames2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
41509 : {
41510 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41511 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
41512 0 : if (value == NULL) {
41513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
41514 0 : return -1;
41515 : }
41516 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
41517 0 : if (object->in.handle == NULL) {
41518 0 : PyErr_NoMemory();
41519 0 : return -1;
41520 : }
41521 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41522 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41523 0 : PyErr_NoMemory();
41524 0 : return -1;
41525 : }
41526 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
41527 0 : return 0;
41528 : }
41529 :
41530 0 : static PyObject *py_lsa_LookupNames2_in_get_num_names(PyObject *obj, void *closure)
41531 : {
41532 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41533 0 : PyObject *py_num_names;
41534 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
41535 0 : return py_num_names;
41536 : }
41537 :
41538 0 : static int py_lsa_LookupNames2_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
41539 : {
41540 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41541 0 : if (value == NULL) {
41542 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
41543 0 : return -1;
41544 : }
41545 : {
41546 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
41547 0 : if (PyLong_Check(value)) {
41548 0 : unsigned long long test_var;
41549 0 : test_var = PyLong_AsUnsignedLongLong(value);
41550 0 : if (PyErr_Occurred() != NULL) {
41551 0 : return -1;
41552 : }
41553 0 : if (test_var > uint_max) {
41554 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41555 : PyLong_Type.tp_name, uint_max, test_var);
41556 0 : return -1;
41557 : }
41558 0 : object->in.num_names = test_var;
41559 : } else {
41560 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41561 : PyLong_Type.tp_name);
41562 0 : return -1;
41563 : }
41564 : }
41565 0 : return 0;
41566 : }
41567 :
41568 0 : static PyObject *py_lsa_LookupNames2_in_get_names(PyObject *obj, void *closure)
41569 : {
41570 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41571 0 : PyObject *py_names;
41572 0 : py_names = PyList_New(object->in.num_names);
41573 0 : if (py_names == NULL) {
41574 0 : return NULL;
41575 : }
41576 : {
41577 : int names_cntr_0;
41578 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
41579 0 : PyObject *py_names_0;
41580 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
41581 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
41582 : }
41583 : }
41584 0 : return py_names;
41585 : }
41586 :
41587 0 : static int py_lsa_LookupNames2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
41588 : {
41589 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41590 0 : if (value == NULL) {
41591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
41592 0 : return -1;
41593 : }
41594 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
41595 : {
41596 0 : int names_cntr_0;
41597 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
41598 0 : if (!object->in.names) { return -1; }
41599 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
41600 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
41601 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
41602 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
41603 0 : return -1;
41604 : }
41605 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
41606 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
41607 0 : PyErr_NoMemory();
41608 0 : return -1;
41609 : }
41610 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
41611 : }
41612 : }
41613 0 : return 0;
41614 : }
41615 :
41616 0 : static PyObject *py_lsa_LookupNames2_out_get_domains(PyObject *obj, void *closure)
41617 : {
41618 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41619 0 : PyObject *py_domains;
41620 0 : if (object->out.domains == NULL) {
41621 0 : Py_RETURN_NONE;
41622 : }
41623 0 : if (*object->out.domains == NULL) {
41624 0 : py_domains = Py_None;
41625 0 : Py_INCREF(py_domains);
41626 : } else {
41627 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
41628 : }
41629 0 : return py_domains;
41630 : }
41631 :
41632 0 : static int py_lsa_LookupNames2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
41633 : {
41634 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41635 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
41636 0 : if (value == NULL) {
41637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
41638 0 : return -1;
41639 : }
41640 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
41641 0 : if (object->out.domains == NULL) {
41642 0 : PyErr_NoMemory();
41643 0 : return -1;
41644 : }
41645 0 : if (value == Py_None) {
41646 0 : *object->out.domains = NULL;
41647 : } else {
41648 0 : *object->out.domains = NULL;
41649 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
41650 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41651 0 : PyErr_NoMemory();
41652 0 : return -1;
41653 : }
41654 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
41655 : }
41656 0 : return 0;
41657 : }
41658 :
41659 0 : static PyObject *py_lsa_LookupNames2_in_get_sids(PyObject *obj, void *closure)
41660 : {
41661 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41662 0 : PyObject *py_sids;
41663 0 : if (object->in.sids == NULL) {
41664 0 : Py_RETURN_NONE;
41665 : }
41666 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->in.sids, object->in.sids);
41667 0 : return py_sids;
41668 : }
41669 :
41670 0 : static int py_lsa_LookupNames2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
41671 : {
41672 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41673 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
41674 0 : if (value == NULL) {
41675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
41676 0 : return -1;
41677 : }
41678 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
41679 0 : if (object->in.sids == NULL) {
41680 0 : PyErr_NoMemory();
41681 0 : return -1;
41682 : }
41683 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
41684 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41685 0 : PyErr_NoMemory();
41686 0 : return -1;
41687 : }
41688 0 : object->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
41689 0 : return 0;
41690 : }
41691 :
41692 0 : static PyObject *py_lsa_LookupNames2_out_get_sids(PyObject *obj, void *closure)
41693 : {
41694 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41695 0 : PyObject *py_sids;
41696 0 : if (object->out.sids == NULL) {
41697 0 : Py_RETURN_NONE;
41698 : }
41699 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->out.sids, object->out.sids);
41700 0 : return py_sids;
41701 : }
41702 :
41703 0 : static int py_lsa_LookupNames2_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
41704 : {
41705 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41706 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
41707 0 : if (value == NULL) {
41708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
41709 0 : return -1;
41710 : }
41711 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
41712 0 : if (object->out.sids == NULL) {
41713 0 : PyErr_NoMemory();
41714 0 : return -1;
41715 : }
41716 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
41717 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41718 0 : PyErr_NoMemory();
41719 0 : return -1;
41720 : }
41721 0 : object->out.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
41722 0 : return 0;
41723 : }
41724 :
41725 0 : static PyObject *py_lsa_LookupNames2_in_get_level(PyObject *obj, void *closure)
41726 : {
41727 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41728 0 : PyObject *py_level;
41729 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
41730 0 : return py_level;
41731 : }
41732 :
41733 0 : static int py_lsa_LookupNames2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
41734 : {
41735 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41736 0 : if (value == NULL) {
41737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
41738 0 : return -1;
41739 : }
41740 : {
41741 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
41742 0 : if (PyLong_Check(value)) {
41743 0 : unsigned long long test_var;
41744 0 : test_var = PyLong_AsUnsignedLongLong(value);
41745 0 : if (PyErr_Occurred() != NULL) {
41746 0 : return -1;
41747 : }
41748 0 : if (test_var > uint_max) {
41749 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41750 : PyLong_Type.tp_name, uint_max, test_var);
41751 0 : return -1;
41752 : }
41753 0 : object->in.level = test_var;
41754 : } else {
41755 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41756 : PyLong_Type.tp_name);
41757 0 : return -1;
41758 : }
41759 : }
41760 0 : return 0;
41761 : }
41762 :
41763 0 : static PyObject *py_lsa_LookupNames2_in_get_count(PyObject *obj, void *closure)
41764 : {
41765 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41766 0 : PyObject *py_count;
41767 0 : if (object->in.count == NULL) {
41768 0 : Py_RETURN_NONE;
41769 : }
41770 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
41771 0 : return py_count;
41772 : }
41773 :
41774 0 : static int py_lsa_LookupNames2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
41775 : {
41776 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41777 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
41778 0 : if (value == NULL) {
41779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
41780 0 : return -1;
41781 : }
41782 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
41783 0 : if (object->in.count == NULL) {
41784 0 : PyErr_NoMemory();
41785 0 : return -1;
41786 : }
41787 : {
41788 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
41789 0 : if (PyLong_Check(value)) {
41790 0 : unsigned long long test_var;
41791 0 : test_var = PyLong_AsUnsignedLongLong(value);
41792 0 : if (PyErr_Occurred() != NULL) {
41793 0 : return -1;
41794 : }
41795 0 : if (test_var > uint_max) {
41796 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41797 : PyLong_Type.tp_name, uint_max, test_var);
41798 0 : return -1;
41799 : }
41800 0 : *object->in.count = test_var;
41801 : } else {
41802 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41803 : PyLong_Type.tp_name);
41804 0 : return -1;
41805 : }
41806 : }
41807 0 : return 0;
41808 : }
41809 :
41810 0 : static PyObject *py_lsa_LookupNames2_out_get_count(PyObject *obj, void *closure)
41811 : {
41812 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41813 0 : PyObject *py_count;
41814 0 : if (object->out.count == NULL) {
41815 0 : Py_RETURN_NONE;
41816 : }
41817 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
41818 0 : return py_count;
41819 : }
41820 :
41821 0 : static int py_lsa_LookupNames2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
41822 : {
41823 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41824 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
41825 0 : if (value == NULL) {
41826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
41827 0 : return -1;
41828 : }
41829 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
41830 0 : if (object->out.count == NULL) {
41831 0 : PyErr_NoMemory();
41832 0 : return -1;
41833 : }
41834 : {
41835 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
41836 0 : if (PyLong_Check(value)) {
41837 0 : unsigned long long test_var;
41838 0 : test_var = PyLong_AsUnsignedLongLong(value);
41839 0 : if (PyErr_Occurred() != NULL) {
41840 0 : return -1;
41841 : }
41842 0 : if (test_var > uint_max) {
41843 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41844 : PyLong_Type.tp_name, uint_max, test_var);
41845 0 : return -1;
41846 : }
41847 0 : *object->out.count = test_var;
41848 : } else {
41849 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41850 : PyLong_Type.tp_name);
41851 0 : return -1;
41852 : }
41853 : }
41854 0 : return 0;
41855 : }
41856 :
41857 0 : static PyObject *py_lsa_LookupNames2_in_get_lookup_options(PyObject *obj, void *closure)
41858 : {
41859 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41860 0 : PyObject *py_lookup_options;
41861 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
41862 0 : return py_lookup_options;
41863 : }
41864 :
41865 0 : static int py_lsa_LookupNames2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
41866 : {
41867 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41868 0 : if (value == NULL) {
41869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
41870 0 : return -1;
41871 : }
41872 : {
41873 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
41874 0 : if (PyLong_Check(value)) {
41875 0 : unsigned long long test_var;
41876 0 : test_var = PyLong_AsUnsignedLongLong(value);
41877 0 : if (PyErr_Occurred() != NULL) {
41878 0 : return -1;
41879 : }
41880 0 : if (test_var > uint_max) {
41881 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41882 : PyLong_Type.tp_name, uint_max, test_var);
41883 0 : return -1;
41884 : }
41885 0 : object->in.lookup_options = test_var;
41886 : } else {
41887 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41888 : PyLong_Type.tp_name);
41889 0 : return -1;
41890 : }
41891 : }
41892 0 : return 0;
41893 : }
41894 :
41895 0 : static PyObject *py_lsa_LookupNames2_in_get_client_revision(PyObject *obj, void *closure)
41896 : {
41897 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41898 0 : PyObject *py_client_revision;
41899 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
41900 0 : return py_client_revision;
41901 : }
41902 :
41903 0 : static int py_lsa_LookupNames2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
41904 : {
41905 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41906 0 : if (value == NULL) {
41907 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
41908 0 : return -1;
41909 : }
41910 : {
41911 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
41912 0 : if (PyLong_Check(value)) {
41913 0 : unsigned long long test_var;
41914 0 : test_var = PyLong_AsUnsignedLongLong(value);
41915 0 : if (PyErr_Occurred() != NULL) {
41916 0 : return -1;
41917 : }
41918 0 : if (test_var > uint_max) {
41919 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41920 : PyLong_Type.tp_name, uint_max, test_var);
41921 0 : return -1;
41922 : }
41923 0 : object->in.client_revision = test_var;
41924 : } else {
41925 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41926 : PyLong_Type.tp_name);
41927 0 : return -1;
41928 : }
41929 : }
41930 0 : return 0;
41931 : }
41932 :
41933 0 : static PyObject *py_lsa_LookupNames2_get_result(PyObject *obj, void *closure)
41934 : {
41935 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(obj);
41936 0 : PyObject *py_result;
41937 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
41938 0 : return py_result;
41939 : }
41940 :
41941 0 : static int py_lsa_LookupNames2_set_result(PyObject *py_obj, PyObject *value, void *closure)
41942 : {
41943 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
41944 0 : if (value == NULL) {
41945 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
41946 0 : return -1;
41947 : }
41948 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
41949 0 : return 0;
41950 : }
41951 :
41952 : static PyGetSetDef py_lsa_LookupNames2_getsetters[] = {
41953 : {
41954 : .name = discard_const_p(char, "in_handle"),
41955 : .get = py_lsa_LookupNames2_in_get_handle,
41956 : .set = py_lsa_LookupNames2_in_set_handle,
41957 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
41958 : },
41959 : {
41960 : .name = discard_const_p(char, "in_num_names"),
41961 : .get = py_lsa_LookupNames2_in_get_num_names,
41962 : .set = py_lsa_LookupNames2_in_set_num_names,
41963 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41964 : },
41965 : {
41966 : .name = discard_const_p(char, "in_names"),
41967 : .get = py_lsa_LookupNames2_in_get_names,
41968 : .set = py_lsa_LookupNames2_in_set_names,
41969 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
41970 : },
41971 : {
41972 : .name = discard_const_p(char, "out_domains"),
41973 : .get = py_lsa_LookupNames2_out_get_domains,
41974 : .set = py_lsa_LookupNames2_out_set_domains,
41975 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
41976 : },
41977 : {
41978 : .name = discard_const_p(char, "in_sids"),
41979 : .get = py_lsa_LookupNames2_in_get_sids,
41980 : .set = py_lsa_LookupNames2_in_set_sids,
41981 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
41982 : },
41983 : {
41984 : .name = discard_const_p(char, "out_sids"),
41985 : .get = py_lsa_LookupNames2_out_get_sids,
41986 : .set = py_lsa_LookupNames2_out_set_sids,
41987 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
41988 : },
41989 : {
41990 : .name = discard_const_p(char, "in_level"),
41991 : .get = py_lsa_LookupNames2_in_get_level,
41992 : .set = py_lsa_LookupNames2_in_set_level,
41993 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
41994 : },
41995 : {
41996 : .name = discard_const_p(char, "in_count"),
41997 : .get = py_lsa_LookupNames2_in_get_count,
41998 : .set = py_lsa_LookupNames2_in_set_count,
41999 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42000 : },
42001 : {
42002 : .name = discard_const_p(char, "out_count"),
42003 : .get = py_lsa_LookupNames2_out_get_count,
42004 : .set = py_lsa_LookupNames2_out_set_count,
42005 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42006 : },
42007 : {
42008 : .name = discard_const_p(char, "in_lookup_options"),
42009 : .get = py_lsa_LookupNames2_in_get_lookup_options,
42010 : .set = py_lsa_LookupNames2_in_set_lookup_options,
42011 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
42012 : },
42013 : {
42014 : .name = discard_const_p(char, "in_client_revision"),
42015 : .get = py_lsa_LookupNames2_in_get_client_revision,
42016 : .set = py_lsa_LookupNames2_in_set_client_revision,
42017 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
42018 : },
42019 : {
42020 : .name = discard_const_p(char, "result"),
42021 : .get = py_lsa_LookupNames2_get_result,
42022 : .set = py_lsa_LookupNames2_set_result,
42023 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42024 : },
42025 : { .name = NULL }
42026 : };
42027 :
42028 0 : static PyObject *py_lsa_LookupNames2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42029 : {
42030 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames2, type);
42031 0 : struct lsa_LookupNames2 *_self = (struct lsa_LookupNames2 *)pytalloc_get_ptr(self);
42032 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42033 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
42034 : /* a pointer to a NULL pointer */
42035 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
42036 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
42037 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
42038 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
42039 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
42040 0 : return self;
42041 : }
42042 :
42043 0 : static PyObject *py_lsa_LookupNames2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42044 : {
42045 :
42046 :
42047 0 : return PyLong_FromLong(58);
42048 : }
42049 :
42050 0 : static PyObject *py_lsa_LookupNames2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42051 : {
42052 0 : const struct ndr_interface_call *call = NULL;
42053 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42054 0 : PyObject *ret = NULL;
42055 0 : struct ndr_push *push = NULL;
42056 0 : DATA_BLOB blob;
42057 0 : enum ndr_err_code err;
42058 :
42059 0 : if (ndr_table_lsarpc.num_calls < 59) {
42060 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_pack");
42061 0 : return NULL;
42062 : }
42063 0 : call = &ndr_table_lsarpc.calls[58];
42064 :
42065 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42066 0 : if (push == NULL) {
42067 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42068 0 : return NULL;
42069 : }
42070 :
42071 0 : push->flags |= ndr_push_flags;
42072 :
42073 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42074 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42075 0 : TALLOC_FREE(push);
42076 0 : PyErr_SetNdrError(err);
42077 0 : return NULL;
42078 : }
42079 0 : blob = ndr_push_blob(push);
42080 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42081 0 : TALLOC_FREE(push);
42082 0 : return ret;
42083 : }
42084 :
42085 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42086 : {
42087 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42088 0 : PyObject *bigendian_obj = NULL;
42089 0 : PyObject *ndr64_obj = NULL;
42090 0 : libndr_flags ndr_push_flags = 0;
42091 :
42092 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42093 : discard_const_p(char *, kwnames),
42094 : &bigendian_obj,
42095 : &ndr64_obj)) {
42096 0 : return NULL;
42097 : }
42098 :
42099 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42100 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42101 : }
42102 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42103 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42104 : }
42105 :
42106 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42107 : }
42108 :
42109 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42110 : {
42111 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42112 0 : PyObject *bigendian_obj = NULL;
42113 0 : PyObject *ndr64_obj = NULL;
42114 0 : libndr_flags ndr_push_flags = 0;
42115 :
42116 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42117 : discard_const_p(char *, kwnames),
42118 : &bigendian_obj,
42119 : &ndr64_obj)) {
42120 0 : return NULL;
42121 : }
42122 :
42123 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42124 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42125 : }
42126 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42127 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42128 : }
42129 :
42130 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42131 : }
42132 :
42133 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42134 : {
42135 0 : const struct ndr_interface_call *call = NULL;
42136 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42137 0 : struct ndr_pull *pull = NULL;
42138 0 : enum ndr_err_code err;
42139 :
42140 0 : if (ndr_table_lsarpc.num_calls < 59) {
42141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_unpack");
42142 0 : return NULL;
42143 : }
42144 0 : call = &ndr_table_lsarpc.calls[58];
42145 :
42146 0 : pull = ndr_pull_init_blob(blob, object);
42147 0 : if (pull == NULL) {
42148 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42149 0 : return NULL;
42150 : }
42151 :
42152 0 : pull->flags |= ndr_pull_flags;
42153 :
42154 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42155 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42156 0 : TALLOC_FREE(pull);
42157 0 : PyErr_SetNdrError(err);
42158 0 : return NULL;
42159 : }
42160 0 : if (!allow_remaining) {
42161 0 : uint32_t highest_ofs;
42162 :
42163 0 : if (pull->offset > pull->relative_highest_offset) {
42164 0 : highest_ofs = pull->offset;
42165 : } else {
42166 0 : highest_ofs = pull->relative_highest_offset;
42167 : }
42168 0 : if (highest_ofs < pull->data_size) {
42169 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42170 : "not all bytes consumed ofs[%u] size[%u]",
42171 : highest_ofs, pull->data_size);
42172 0 : TALLOC_FREE(pull);
42173 0 : PyErr_SetNdrError(err);
42174 0 : return NULL;
42175 : }
42176 : }
42177 :
42178 0 : TALLOC_FREE(pull);
42179 0 : Py_RETURN_NONE;
42180 : }
42181 :
42182 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42183 : {
42184 0 : DATA_BLOB blob;
42185 0 : Py_ssize_t blob_length = 0;
42186 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42187 0 : PyObject *bigendian_obj = NULL;
42188 0 : PyObject *ndr64_obj = NULL;
42189 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42190 0 : PyObject *allow_remaining_obj = NULL;
42191 0 : bool allow_remaining = false;
42192 :
42193 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42194 : discard_const_p(char *, kwnames),
42195 : &blob.data, &blob_length,
42196 : &bigendian_obj,
42197 : &ndr64_obj,
42198 : &allow_remaining_obj)) {
42199 0 : return NULL;
42200 : }
42201 0 : blob.length = blob_length;
42202 :
42203 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42204 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42205 : }
42206 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42207 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42208 : }
42209 :
42210 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42211 0 : allow_remaining = true;
42212 : }
42213 :
42214 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42215 : }
42216 :
42217 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42218 : {
42219 0 : DATA_BLOB blob;
42220 0 : Py_ssize_t blob_length = 0;
42221 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42222 0 : PyObject *bigendian_obj = NULL;
42223 0 : PyObject *ndr64_obj = NULL;
42224 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42225 0 : PyObject *allow_remaining_obj = NULL;
42226 0 : bool allow_remaining = false;
42227 :
42228 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42229 : discard_const_p(char *, kwnames),
42230 : &blob.data, &blob_length,
42231 : &bigendian_obj,
42232 : &ndr64_obj,
42233 : &allow_remaining_obj)) {
42234 0 : return NULL;
42235 : }
42236 0 : blob.length = blob_length;
42237 :
42238 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42239 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42240 : }
42241 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42242 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42243 : }
42244 :
42245 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42246 0 : allow_remaining = true;
42247 : }
42248 :
42249 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42250 : }
42251 :
42252 0 : static PyObject *py_lsa_LookupNames2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42253 : {
42254 0 : const struct ndr_interface_call *call = NULL;
42255 0 : struct lsa_LookupNames2 *object = (struct lsa_LookupNames2 *)pytalloc_get_ptr(py_obj);
42256 0 : PyObject *ret;
42257 0 : char *retstr;
42258 :
42259 0 : if (ndr_table_lsarpc.num_calls < 59) {
42260 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_print");
42261 0 : return NULL;
42262 : }
42263 0 : call = &ndr_table_lsarpc.calls[58];
42264 :
42265 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42266 0 : ret = PyUnicode_FromString(retstr);
42267 0 : TALLOC_FREE(retstr);
42268 :
42269 0 : return ret;
42270 : }
42271 :
42272 0 : static PyObject *py_lsa_LookupNames2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42273 : {
42274 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_in", NDR_IN);
42275 : }
42276 :
42277 0 : static PyObject *py_lsa_LookupNames2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42278 : {
42279 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_out", NDR_OUT);
42280 : }
42281 :
42282 : static PyMethodDef py_lsa_LookupNames2_methods[] = {
42283 : { "opnum", (PyCFunction)py_lsa_LookupNames2_ndr_opnum, METH_NOARGS|METH_CLASS,
42284 : "lsa.LookupNames2.opnum() -> 58 (0x3a) " },
42285 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42286 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42287 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42288 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42289 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42290 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42291 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42292 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42293 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42294 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42295 : { NULL, NULL, 0, NULL }
42296 : };
42297 :
42298 :
42299 : static PyTypeObject lsa_LookupNames2_Type = {
42300 : PyVarObject_HEAD_INIT(NULL, 0)
42301 : .tp_name = "lsa.LookupNames2",
42302 : .tp_getset = py_lsa_LookupNames2_getsetters,
42303 : .tp_methods = py_lsa_LookupNames2_methods,
42304 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42305 : .tp_new = py_lsa_LookupNames2_new,
42306 : };
42307 :
42308 0 : static bool pack_py_lsa_LookupNames2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames2 *r)
42309 : {
42310 0 : PyObject *py_handle;
42311 0 : PyObject *py_names;
42312 0 : PyObject *py_sids;
42313 0 : PyObject *py_level;
42314 0 : PyObject *py_count;
42315 0 : PyObject *py_lookup_options;
42316 0 : PyObject *py_client_revision;
42317 0 : const char *kwnames[] = {
42318 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
42319 : };
42320 :
42321 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)) {
42322 0 : return false;
42323 : }
42324 :
42325 0 : if (py_handle == NULL) {
42326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
42327 0 : return false;
42328 : }
42329 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
42330 0 : if (r->in.handle == NULL) {
42331 0 : PyErr_NoMemory();
42332 0 : return false;
42333 : }
42334 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
42335 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
42336 0 : PyErr_NoMemory();
42337 0 : return false;
42338 : }
42339 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
42340 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
42341 0 : r->in.num_names = PyList_GET_SIZE(py_names);
42342 0 : if (py_names == NULL) {
42343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
42344 0 : return false;
42345 : }
42346 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
42347 : {
42348 0 : int names_cntr_0;
42349 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
42350 0 : if (!r->in.names) { return false; }
42351 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
42352 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
42353 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
42354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
42355 0 : return false;
42356 : }
42357 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
42358 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
42359 0 : PyErr_NoMemory();
42360 0 : return false;
42361 : }
42362 0 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
42363 : }
42364 : }
42365 0 : if (py_sids == NULL) {
42366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
42367 0 : return false;
42368 : }
42369 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
42370 0 : if (r->in.sids == NULL) {
42371 0 : PyErr_NoMemory();
42372 0 : return false;
42373 : }
42374 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, py_sids, return false;);
42375 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
42376 0 : PyErr_NoMemory();
42377 0 : return false;
42378 : }
42379 0 : r->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_sids);
42380 0 : if (py_level == NULL) {
42381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
42382 0 : return false;
42383 : }
42384 : {
42385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
42386 0 : if (PyLong_Check(py_level)) {
42387 0 : unsigned long long test_var;
42388 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
42389 0 : if (PyErr_Occurred() != NULL) {
42390 0 : return false;
42391 : }
42392 0 : if (test_var > uint_max) {
42393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42394 : PyLong_Type.tp_name, uint_max, test_var);
42395 0 : return false;
42396 : }
42397 0 : r->in.level = test_var;
42398 : } else {
42399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42400 : PyLong_Type.tp_name);
42401 0 : return false;
42402 : }
42403 : }
42404 0 : if (py_count == NULL) {
42405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
42406 0 : return false;
42407 : }
42408 0 : r->in.count = talloc_ptrtype(r, r->in.count);
42409 0 : if (r->in.count == NULL) {
42410 0 : PyErr_NoMemory();
42411 0 : return false;
42412 : }
42413 : {
42414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
42415 0 : if (PyLong_Check(py_count)) {
42416 0 : unsigned long long test_var;
42417 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
42418 0 : if (PyErr_Occurred() != NULL) {
42419 0 : return false;
42420 : }
42421 0 : if (test_var > uint_max) {
42422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42423 : PyLong_Type.tp_name, uint_max, test_var);
42424 0 : return false;
42425 : }
42426 0 : *r->in.count = test_var;
42427 : } else {
42428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42429 : PyLong_Type.tp_name);
42430 0 : return false;
42431 : }
42432 : }
42433 0 : if (py_lookup_options == NULL) {
42434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
42435 0 : return false;
42436 : }
42437 : {
42438 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
42439 0 : if (PyLong_Check(py_lookup_options)) {
42440 0 : unsigned long long test_var;
42441 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
42442 0 : if (PyErr_Occurred() != NULL) {
42443 0 : return false;
42444 : }
42445 0 : if (test_var > uint_max) {
42446 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42447 : PyLong_Type.tp_name, uint_max, test_var);
42448 0 : return false;
42449 : }
42450 0 : r->in.lookup_options = test_var;
42451 : } else {
42452 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42453 : PyLong_Type.tp_name);
42454 0 : return false;
42455 : }
42456 : }
42457 0 : if (py_client_revision == NULL) {
42458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
42459 0 : return false;
42460 : }
42461 : {
42462 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
42463 0 : if (PyLong_Check(py_client_revision)) {
42464 0 : unsigned long long test_var;
42465 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
42466 0 : if (PyErr_Occurred() != NULL) {
42467 0 : return false;
42468 : }
42469 0 : if (test_var > uint_max) {
42470 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42471 : PyLong_Type.tp_name, uint_max, test_var);
42472 0 : return false;
42473 : }
42474 0 : r->in.client_revision = test_var;
42475 : } else {
42476 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42477 : PyLong_Type.tp_name);
42478 0 : return false;
42479 : }
42480 : }
42481 0 : return true;
42482 : }
42483 :
42484 0 : static PyObject *unpack_py_lsa_LookupNames2_args_out(struct lsa_LookupNames2 *r)
42485 : {
42486 0 : PyObject *result;
42487 0 : PyObject *py_domains;
42488 0 : PyObject *py_sids;
42489 0 : PyObject *py_count;
42490 0 : result = PyTuple_New(3);
42491 0 : if (*r->out.domains == NULL) {
42492 0 : py_domains = Py_None;
42493 0 : Py_INCREF(py_domains);
42494 : } else {
42495 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
42496 : }
42497 0 : PyTuple_SetItem(result, 0, py_domains);
42498 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, r->out.sids, r->out.sids);
42499 0 : PyTuple_SetItem(result, 1, py_sids);
42500 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
42501 0 : PyTuple_SetItem(result, 2, py_count);
42502 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42503 0 : PyErr_SetNTSTATUS(r->out.result);
42504 0 : return NULL;
42505 : }
42506 :
42507 0 : return result;
42508 : }
42509 :
42510 :
42511 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_policy_handle(PyObject *obj, void *closure)
42512 : {
42513 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42514 0 : PyObject *py_policy_handle;
42515 0 : if (object->in.policy_handle == NULL) {
42516 0 : Py_RETURN_NONE;
42517 : }
42518 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
42519 0 : return py_policy_handle;
42520 : }
42521 :
42522 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
42523 : {
42524 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42525 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
42526 0 : if (value == NULL) {
42527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.policy_handle");
42528 0 : return -1;
42529 : }
42530 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
42531 0 : if (object->in.policy_handle == NULL) {
42532 0 : PyErr_NoMemory();
42533 0 : return -1;
42534 : }
42535 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42536 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42537 0 : PyErr_NoMemory();
42538 0 : return -1;
42539 : }
42540 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42541 0 : return 0;
42542 : }
42543 :
42544 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_info(PyObject *obj, void *closure)
42545 : {
42546 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42547 0 : PyObject *py_info;
42548 0 : if (object->in.info == NULL) {
42549 0 : Py_RETURN_NONE;
42550 : }
42551 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
42552 0 : return py_info;
42553 : }
42554 :
42555 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
42556 : {
42557 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42558 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
42559 0 : if (value == NULL) {
42560 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
42561 0 : return -1;
42562 : }
42563 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
42564 0 : if (object->in.info == NULL) {
42565 0 : PyErr_NoMemory();
42566 0 : return -1;
42567 : }
42568 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
42569 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42570 0 : PyErr_NoMemory();
42571 0 : return -1;
42572 : }
42573 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
42574 0 : return 0;
42575 : }
42576 :
42577 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal(PyObject *obj, void *closure)
42578 : {
42579 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42580 0 : PyObject *py_auth_info_internal;
42581 0 : if (object->in.auth_info_internal == NULL) {
42582 0 : Py_RETURN_NONE;
42583 : }
42584 0 : py_auth_info_internal = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, object->in.auth_info_internal, object->in.auth_info_internal);
42585 0 : return py_auth_info_internal;
42586 : }
42587 :
42588 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal(PyObject *py_obj, PyObject *value, void *closure)
42589 : {
42590 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42591 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info_internal));
42592 0 : if (value == NULL) {
42593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.auth_info_internal");
42594 0 : return -1;
42595 : }
42596 0 : object->in.auth_info_internal = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info_internal);
42597 0 : if (object->in.auth_info_internal == NULL) {
42598 0 : PyErr_NoMemory();
42599 0 : return -1;
42600 : }
42601 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
42602 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42603 0 : PyErr_NoMemory();
42604 0 : return -1;
42605 : }
42606 0 : object->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
42607 0 : return 0;
42608 : }
42609 :
42610 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_access_mask(PyObject *obj, void *closure)
42611 : {
42612 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42613 0 : PyObject *py_access_mask;
42614 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
42615 0 : return py_access_mask;
42616 : }
42617 :
42618 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
42619 : {
42620 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42621 0 : if (value == NULL) {
42622 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
42623 0 : return -1;
42624 : }
42625 : {
42626 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
42627 0 : if (PyLong_Check(value)) {
42628 0 : unsigned long long test_var;
42629 0 : test_var = PyLong_AsUnsignedLongLong(value);
42630 0 : if (PyErr_Occurred() != NULL) {
42631 0 : return -1;
42632 : }
42633 0 : if (test_var > uint_max) {
42634 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42635 : PyLong_Type.tp_name, uint_max, test_var);
42636 0 : return -1;
42637 : }
42638 0 : object->in.access_mask = test_var;
42639 : } else {
42640 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42641 : PyLong_Type.tp_name);
42642 0 : return -1;
42643 : }
42644 : }
42645 0 : return 0;
42646 : }
42647 :
42648 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle(PyObject *obj, void *closure)
42649 : {
42650 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42651 0 : PyObject *py_trustdom_handle;
42652 0 : if (object->out.trustdom_handle == NULL) {
42653 0 : Py_RETURN_NONE;
42654 : }
42655 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
42656 0 : return py_trustdom_handle;
42657 : }
42658 :
42659 0 : static int py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
42660 : {
42661 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42662 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
42663 0 : if (value == NULL) {
42664 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.trustdom_handle");
42665 0 : return -1;
42666 : }
42667 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
42668 0 : if (object->out.trustdom_handle == NULL) {
42669 0 : PyErr_NoMemory();
42670 0 : return -1;
42671 : }
42672 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42673 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42674 0 : PyErr_NoMemory();
42675 0 : return -1;
42676 : }
42677 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42678 0 : return 0;
42679 : }
42680 :
42681 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_get_result(PyObject *obj, void *closure)
42682 : {
42683 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(obj);
42684 0 : PyObject *py_result;
42685 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42686 0 : return py_result;
42687 : }
42688 :
42689 0 : static int py_lsa_CreateTrustedDomainEx2_set_result(PyObject *py_obj, PyObject *value, void *closure)
42690 : {
42691 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42692 0 : if (value == NULL) {
42693 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42694 0 : return -1;
42695 : }
42696 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42697 0 : return 0;
42698 : }
42699 :
42700 : static PyGetSetDef py_lsa_CreateTrustedDomainEx2_getsetters[] = {
42701 : {
42702 : .name = discard_const_p(char, "in_policy_handle"),
42703 : .get = py_lsa_CreateTrustedDomainEx2_in_get_policy_handle,
42704 : .set = py_lsa_CreateTrustedDomainEx2_in_set_policy_handle,
42705 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42706 : },
42707 : {
42708 : .name = discard_const_p(char, "in_info"),
42709 : .get = py_lsa_CreateTrustedDomainEx2_in_get_info,
42710 : .set = py_lsa_CreateTrustedDomainEx2_in_set_info,
42711 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
42712 : },
42713 : {
42714 : .name = discard_const_p(char, "in_auth_info_internal"),
42715 : .get = py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal,
42716 : .set = py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal,
42717 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
42718 : },
42719 : {
42720 : .name = discard_const_p(char, "in_access_mask"),
42721 : .get = py_lsa_CreateTrustedDomainEx2_in_get_access_mask,
42722 : .set = py_lsa_CreateTrustedDomainEx2_in_set_access_mask,
42723 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
42724 : },
42725 : {
42726 : .name = discard_const_p(char, "out_trustdom_handle"),
42727 : .get = py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle,
42728 : .set = py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle,
42729 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42730 : },
42731 : {
42732 : .name = discard_const_p(char, "result"),
42733 : .get = py_lsa_CreateTrustedDomainEx2_get_result,
42734 : .set = py_lsa_CreateTrustedDomainEx2_set_result,
42735 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42736 : },
42737 : { .name = NULL }
42738 : };
42739 :
42740 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42741 : {
42742 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx2, type);
42743 0 : struct lsa_CreateTrustedDomainEx2 *_self = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(self);
42744 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42745 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
42746 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
42747 0 : _self->in.auth_info_internal = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfoInternal);
42748 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
42749 0 : return self;
42750 : }
42751 :
42752 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42753 : {
42754 :
42755 :
42756 0 : return PyLong_FromLong(59);
42757 : }
42758 :
42759 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42760 : {
42761 0 : const struct ndr_interface_call *call = NULL;
42762 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42763 0 : PyObject *ret = NULL;
42764 0 : struct ndr_push *push = NULL;
42765 0 : DATA_BLOB blob;
42766 0 : enum ndr_err_code err;
42767 :
42768 0 : if (ndr_table_lsarpc.num_calls < 60) {
42769 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_pack");
42770 0 : return NULL;
42771 : }
42772 0 : call = &ndr_table_lsarpc.calls[59];
42773 :
42774 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42775 0 : if (push == NULL) {
42776 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42777 0 : return NULL;
42778 : }
42779 :
42780 0 : push->flags |= ndr_push_flags;
42781 :
42782 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42783 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42784 0 : TALLOC_FREE(push);
42785 0 : PyErr_SetNdrError(err);
42786 0 : return NULL;
42787 : }
42788 0 : blob = ndr_push_blob(push);
42789 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42790 0 : TALLOC_FREE(push);
42791 0 : return ret;
42792 : }
42793 :
42794 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42795 : {
42796 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42797 0 : PyObject *bigendian_obj = NULL;
42798 0 : PyObject *ndr64_obj = NULL;
42799 0 : libndr_flags ndr_push_flags = 0;
42800 :
42801 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42802 : discard_const_p(char *, kwnames),
42803 : &bigendian_obj,
42804 : &ndr64_obj)) {
42805 0 : return NULL;
42806 : }
42807 :
42808 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42809 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42810 : }
42811 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42812 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42813 : }
42814 :
42815 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42816 : }
42817 :
42818 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42819 : {
42820 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42821 0 : PyObject *bigendian_obj = NULL;
42822 0 : PyObject *ndr64_obj = NULL;
42823 0 : libndr_flags ndr_push_flags = 0;
42824 :
42825 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42826 : discard_const_p(char *, kwnames),
42827 : &bigendian_obj,
42828 : &ndr64_obj)) {
42829 0 : return NULL;
42830 : }
42831 :
42832 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42833 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42834 : }
42835 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42836 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42837 : }
42838 :
42839 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42840 : }
42841 :
42842 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42843 : {
42844 0 : const struct ndr_interface_call *call = NULL;
42845 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42846 0 : struct ndr_pull *pull = NULL;
42847 0 : enum ndr_err_code err;
42848 :
42849 0 : if (ndr_table_lsarpc.num_calls < 60) {
42850 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_unpack");
42851 0 : return NULL;
42852 : }
42853 0 : call = &ndr_table_lsarpc.calls[59];
42854 :
42855 0 : pull = ndr_pull_init_blob(blob, object);
42856 0 : if (pull == NULL) {
42857 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42858 0 : return NULL;
42859 : }
42860 :
42861 0 : pull->flags |= ndr_pull_flags;
42862 :
42863 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42864 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42865 0 : TALLOC_FREE(pull);
42866 0 : PyErr_SetNdrError(err);
42867 0 : return NULL;
42868 : }
42869 0 : if (!allow_remaining) {
42870 0 : uint32_t highest_ofs;
42871 :
42872 0 : if (pull->offset > pull->relative_highest_offset) {
42873 0 : highest_ofs = pull->offset;
42874 : } else {
42875 0 : highest_ofs = pull->relative_highest_offset;
42876 : }
42877 0 : if (highest_ofs < pull->data_size) {
42878 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42879 : "not all bytes consumed ofs[%u] size[%u]",
42880 : highest_ofs, pull->data_size);
42881 0 : TALLOC_FREE(pull);
42882 0 : PyErr_SetNdrError(err);
42883 0 : return NULL;
42884 : }
42885 : }
42886 :
42887 0 : TALLOC_FREE(pull);
42888 0 : Py_RETURN_NONE;
42889 : }
42890 :
42891 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42892 : {
42893 0 : DATA_BLOB blob;
42894 0 : Py_ssize_t blob_length = 0;
42895 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42896 0 : PyObject *bigendian_obj = NULL;
42897 0 : PyObject *ndr64_obj = NULL;
42898 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42899 0 : PyObject *allow_remaining_obj = NULL;
42900 0 : bool allow_remaining = false;
42901 :
42902 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42903 : discard_const_p(char *, kwnames),
42904 : &blob.data, &blob_length,
42905 : &bigendian_obj,
42906 : &ndr64_obj,
42907 : &allow_remaining_obj)) {
42908 0 : return NULL;
42909 : }
42910 0 : blob.length = blob_length;
42911 :
42912 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42913 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42914 : }
42915 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42916 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42917 : }
42918 :
42919 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42920 0 : allow_remaining = true;
42921 : }
42922 :
42923 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42924 : }
42925 :
42926 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42927 : {
42928 0 : DATA_BLOB blob;
42929 0 : Py_ssize_t blob_length = 0;
42930 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42931 0 : PyObject *bigendian_obj = NULL;
42932 0 : PyObject *ndr64_obj = NULL;
42933 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42934 0 : PyObject *allow_remaining_obj = NULL;
42935 0 : bool allow_remaining = false;
42936 :
42937 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42938 : discard_const_p(char *, kwnames),
42939 : &blob.data, &blob_length,
42940 : &bigendian_obj,
42941 : &ndr64_obj,
42942 : &allow_remaining_obj)) {
42943 0 : return NULL;
42944 : }
42945 0 : blob.length = blob_length;
42946 :
42947 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42948 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42949 : }
42950 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42951 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42952 : }
42953 :
42954 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42955 0 : allow_remaining = true;
42956 : }
42957 :
42958 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42959 : }
42960 :
42961 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42962 : {
42963 0 : const struct ndr_interface_call *call = NULL;
42964 0 : struct lsa_CreateTrustedDomainEx2 *object = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(py_obj);
42965 0 : PyObject *ret;
42966 0 : char *retstr;
42967 :
42968 0 : if (ndr_table_lsarpc.num_calls < 60) {
42969 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_print");
42970 0 : return NULL;
42971 : }
42972 0 : call = &ndr_table_lsarpc.calls[59];
42973 :
42974 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42975 0 : ret = PyUnicode_FromString(retstr);
42976 0 : TALLOC_FREE(retstr);
42977 :
42978 0 : return ret;
42979 : }
42980 :
42981 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42982 : {
42983 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_in", NDR_IN);
42984 : }
42985 :
42986 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42987 : {
42988 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_out", NDR_OUT);
42989 : }
42990 :
42991 : static PyMethodDef py_lsa_CreateTrustedDomainEx2_methods[] = {
42992 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_opnum, METH_NOARGS|METH_CLASS,
42993 : "lsa.CreateTrustedDomainEx2.opnum() -> 59 (0x3b) " },
42994 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42995 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42996 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42997 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42998 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42999 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43000 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43001 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43002 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43003 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43004 : { NULL, NULL, 0, NULL }
43005 : };
43006 :
43007 :
43008 : static PyTypeObject lsa_CreateTrustedDomainEx2_Type = {
43009 : PyVarObject_HEAD_INIT(NULL, 0)
43010 : .tp_name = "lsa.CreateTrustedDomainEx2",
43011 : .tp_getset = py_lsa_CreateTrustedDomainEx2_getsetters,
43012 : .tp_methods = py_lsa_CreateTrustedDomainEx2_methods,
43013 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43014 : .tp_new = py_lsa_CreateTrustedDomainEx2_new,
43015 : };
43016 :
43017 23 : static bool pack_py_lsa_CreateTrustedDomainEx2_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx2 *r)
43018 : {
43019 0 : PyObject *py_policy_handle;
43020 0 : PyObject *py_info;
43021 0 : PyObject *py_auth_info_internal;
43022 0 : PyObject *py_access_mask;
43023 23 : const char *kwnames[] = {
43024 : "policy_handle", "info", "auth_info_internal", "access_mask", NULL
43025 : };
43026 :
43027 23 : 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)) {
43028 0 : return false;
43029 : }
43030 :
43031 23 : if (py_policy_handle == NULL) {
43032 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.policy_handle");
43033 0 : return false;
43034 : }
43035 23 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
43036 23 : if (r->in.policy_handle == NULL) {
43037 0 : PyErr_NoMemory();
43038 0 : return false;
43039 : }
43040 23 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
43041 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
43042 0 : PyErr_NoMemory();
43043 0 : return false;
43044 : }
43045 23 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
43046 23 : if (py_info == NULL) {
43047 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
43048 0 : return false;
43049 : }
43050 23 : r->in.info = talloc_ptrtype(r, r->in.info);
43051 23 : if (r->in.info == NULL) {
43052 0 : PyErr_NoMemory();
43053 0 : return false;
43054 : }
43055 23 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
43056 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
43057 0 : PyErr_NoMemory();
43058 0 : return false;
43059 : }
43060 23 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
43061 23 : if (py_auth_info_internal == NULL) {
43062 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.auth_info_internal");
43063 0 : return false;
43064 : }
43065 23 : r->in.auth_info_internal = talloc_ptrtype(r, r->in.auth_info_internal);
43066 23 : if (r->in.auth_info_internal == NULL) {
43067 0 : PyErr_NoMemory();
43068 0 : return false;
43069 : }
43070 23 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, py_auth_info_internal, return false;);
43071 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info_internal)) == NULL) {
43072 0 : PyErr_NoMemory();
43073 0 : return false;
43074 : }
43075 23 : r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_auth_info_internal);
43076 23 : if (py_access_mask == NULL) {
43077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
43078 0 : return false;
43079 : }
43080 : {
43081 23 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
43082 23 : if (PyLong_Check(py_access_mask)) {
43083 0 : unsigned long long test_var;
43084 23 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
43085 23 : if (PyErr_Occurred() != NULL) {
43086 0 : return false;
43087 : }
43088 23 : if (test_var > uint_max) {
43089 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43090 : PyLong_Type.tp_name, uint_max, test_var);
43091 0 : return false;
43092 : }
43093 23 : r->in.access_mask = test_var;
43094 : } else {
43095 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43096 : PyLong_Type.tp_name);
43097 0 : return false;
43098 : }
43099 : }
43100 23 : return true;
43101 : }
43102 :
43103 23 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx2_args_out(struct lsa_CreateTrustedDomainEx2 *r)
43104 : {
43105 0 : PyObject *result;
43106 0 : PyObject *py_trustdom_handle;
43107 23 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
43108 23 : result = py_trustdom_handle;
43109 23 : if (NT_STATUS_IS_ERR(r->out.result)) {
43110 0 : PyErr_SetNTSTATUS(r->out.result);
43111 0 : return NULL;
43112 : }
43113 :
43114 23 : return result;
43115 : }
43116 :
43117 :
43118 0 : static PyObject *py_lsa_LookupNames3_in_get_handle(PyObject *obj, void *closure)
43119 : {
43120 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43121 0 : PyObject *py_handle;
43122 0 : if (object->in.handle == NULL) {
43123 0 : Py_RETURN_NONE;
43124 : }
43125 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
43126 0 : return py_handle;
43127 : }
43128 :
43129 0 : static int py_lsa_LookupNames3_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
43130 : {
43131 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43132 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
43133 0 : if (value == NULL) {
43134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
43135 0 : return -1;
43136 : }
43137 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
43138 0 : if (object->in.handle == NULL) {
43139 0 : PyErr_NoMemory();
43140 0 : return -1;
43141 : }
43142 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
43143 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43144 0 : PyErr_NoMemory();
43145 0 : return -1;
43146 : }
43147 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
43148 0 : return 0;
43149 : }
43150 :
43151 0 : static PyObject *py_lsa_LookupNames3_in_get_num_names(PyObject *obj, void *closure)
43152 : {
43153 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43154 0 : PyObject *py_num_names;
43155 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
43156 0 : return py_num_names;
43157 : }
43158 :
43159 0 : static int py_lsa_LookupNames3_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
43160 : {
43161 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43162 0 : if (value == NULL) {
43163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
43164 0 : return -1;
43165 : }
43166 : {
43167 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
43168 0 : if (PyLong_Check(value)) {
43169 0 : unsigned long long test_var;
43170 0 : test_var = PyLong_AsUnsignedLongLong(value);
43171 0 : if (PyErr_Occurred() != NULL) {
43172 0 : return -1;
43173 : }
43174 0 : if (test_var > uint_max) {
43175 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43176 : PyLong_Type.tp_name, uint_max, test_var);
43177 0 : return -1;
43178 : }
43179 0 : object->in.num_names = test_var;
43180 : } else {
43181 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43182 : PyLong_Type.tp_name);
43183 0 : return -1;
43184 : }
43185 : }
43186 0 : return 0;
43187 : }
43188 :
43189 0 : static PyObject *py_lsa_LookupNames3_in_get_names(PyObject *obj, void *closure)
43190 : {
43191 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43192 0 : PyObject *py_names;
43193 0 : py_names = PyList_New(object->in.num_names);
43194 0 : if (py_names == NULL) {
43195 0 : return NULL;
43196 : }
43197 : {
43198 : int names_cntr_0;
43199 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
43200 0 : PyObject *py_names_0;
43201 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
43202 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
43203 : }
43204 : }
43205 0 : return py_names;
43206 : }
43207 :
43208 0 : static int py_lsa_LookupNames3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
43209 : {
43210 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43211 0 : if (value == NULL) {
43212 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
43213 0 : return -1;
43214 : }
43215 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
43216 : {
43217 0 : int names_cntr_0;
43218 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
43219 0 : if (!object->in.names) { return -1; }
43220 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
43221 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
43222 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
43223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
43224 0 : return -1;
43225 : }
43226 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
43227 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
43228 0 : PyErr_NoMemory();
43229 0 : return -1;
43230 : }
43231 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
43232 : }
43233 : }
43234 0 : return 0;
43235 : }
43236 :
43237 0 : static PyObject *py_lsa_LookupNames3_out_get_domains(PyObject *obj, void *closure)
43238 : {
43239 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43240 0 : PyObject *py_domains;
43241 0 : if (object->out.domains == NULL) {
43242 0 : Py_RETURN_NONE;
43243 : }
43244 0 : if (*object->out.domains == NULL) {
43245 0 : py_domains = Py_None;
43246 0 : Py_INCREF(py_domains);
43247 : } else {
43248 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
43249 : }
43250 0 : return py_domains;
43251 : }
43252 :
43253 0 : static int py_lsa_LookupNames3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
43254 : {
43255 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43256 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
43257 0 : if (value == NULL) {
43258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
43259 0 : return -1;
43260 : }
43261 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
43262 0 : if (object->out.domains == NULL) {
43263 0 : PyErr_NoMemory();
43264 0 : return -1;
43265 : }
43266 0 : if (value == Py_None) {
43267 0 : *object->out.domains = NULL;
43268 : } else {
43269 0 : *object->out.domains = NULL;
43270 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
43271 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43272 0 : PyErr_NoMemory();
43273 0 : return -1;
43274 : }
43275 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
43276 : }
43277 0 : return 0;
43278 : }
43279 :
43280 0 : static PyObject *py_lsa_LookupNames3_in_get_sids(PyObject *obj, void *closure)
43281 : {
43282 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43283 0 : PyObject *py_sids;
43284 0 : if (object->in.sids == NULL) {
43285 0 : Py_RETURN_NONE;
43286 : }
43287 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
43288 0 : return py_sids;
43289 : }
43290 :
43291 0 : static int py_lsa_LookupNames3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
43292 : {
43293 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43294 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
43295 0 : if (value == NULL) {
43296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
43297 0 : return -1;
43298 : }
43299 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
43300 0 : if (object->in.sids == NULL) {
43301 0 : PyErr_NoMemory();
43302 0 : return -1;
43303 : }
43304 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
43305 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43306 0 : PyErr_NoMemory();
43307 0 : return -1;
43308 : }
43309 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
43310 0 : return 0;
43311 : }
43312 :
43313 0 : static PyObject *py_lsa_LookupNames3_out_get_sids(PyObject *obj, void *closure)
43314 : {
43315 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43316 0 : PyObject *py_sids;
43317 0 : if (object->out.sids == NULL) {
43318 0 : Py_RETURN_NONE;
43319 : }
43320 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
43321 0 : return py_sids;
43322 : }
43323 :
43324 0 : static int py_lsa_LookupNames3_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
43325 : {
43326 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43327 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
43328 0 : if (value == NULL) {
43329 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
43330 0 : return -1;
43331 : }
43332 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
43333 0 : if (object->out.sids == NULL) {
43334 0 : PyErr_NoMemory();
43335 0 : return -1;
43336 : }
43337 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
43338 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43339 0 : PyErr_NoMemory();
43340 0 : return -1;
43341 : }
43342 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
43343 0 : return 0;
43344 : }
43345 :
43346 0 : static PyObject *py_lsa_LookupNames3_in_get_level(PyObject *obj, void *closure)
43347 : {
43348 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43349 0 : PyObject *py_level;
43350 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
43351 0 : return py_level;
43352 : }
43353 :
43354 0 : static int py_lsa_LookupNames3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
43355 : {
43356 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43357 0 : if (value == NULL) {
43358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
43359 0 : return -1;
43360 : }
43361 : {
43362 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
43363 0 : if (PyLong_Check(value)) {
43364 0 : unsigned long long test_var;
43365 0 : test_var = PyLong_AsUnsignedLongLong(value);
43366 0 : if (PyErr_Occurred() != NULL) {
43367 0 : return -1;
43368 : }
43369 0 : if (test_var > uint_max) {
43370 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43371 : PyLong_Type.tp_name, uint_max, test_var);
43372 0 : return -1;
43373 : }
43374 0 : object->in.level = test_var;
43375 : } else {
43376 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43377 : PyLong_Type.tp_name);
43378 0 : return -1;
43379 : }
43380 : }
43381 0 : return 0;
43382 : }
43383 :
43384 0 : static PyObject *py_lsa_LookupNames3_in_get_count(PyObject *obj, void *closure)
43385 : {
43386 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43387 0 : PyObject *py_count;
43388 0 : if (object->in.count == NULL) {
43389 0 : Py_RETURN_NONE;
43390 : }
43391 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
43392 0 : return py_count;
43393 : }
43394 :
43395 0 : static int py_lsa_LookupNames3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
43396 : {
43397 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43398 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
43399 0 : if (value == NULL) {
43400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
43401 0 : return -1;
43402 : }
43403 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
43404 0 : if (object->in.count == NULL) {
43405 0 : PyErr_NoMemory();
43406 0 : return -1;
43407 : }
43408 : {
43409 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
43410 0 : if (PyLong_Check(value)) {
43411 0 : unsigned long long test_var;
43412 0 : test_var = PyLong_AsUnsignedLongLong(value);
43413 0 : if (PyErr_Occurred() != NULL) {
43414 0 : return -1;
43415 : }
43416 0 : if (test_var > uint_max) {
43417 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43418 : PyLong_Type.tp_name, uint_max, test_var);
43419 0 : return -1;
43420 : }
43421 0 : *object->in.count = test_var;
43422 : } else {
43423 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43424 : PyLong_Type.tp_name);
43425 0 : return -1;
43426 : }
43427 : }
43428 0 : return 0;
43429 : }
43430 :
43431 0 : static PyObject *py_lsa_LookupNames3_out_get_count(PyObject *obj, void *closure)
43432 : {
43433 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43434 0 : PyObject *py_count;
43435 0 : if (object->out.count == NULL) {
43436 0 : Py_RETURN_NONE;
43437 : }
43438 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
43439 0 : return py_count;
43440 : }
43441 :
43442 0 : static int py_lsa_LookupNames3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
43443 : {
43444 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43445 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
43446 0 : if (value == NULL) {
43447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
43448 0 : return -1;
43449 : }
43450 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
43451 0 : if (object->out.count == NULL) {
43452 0 : PyErr_NoMemory();
43453 0 : return -1;
43454 : }
43455 : {
43456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
43457 0 : if (PyLong_Check(value)) {
43458 0 : unsigned long long test_var;
43459 0 : test_var = PyLong_AsUnsignedLongLong(value);
43460 0 : if (PyErr_Occurred() != NULL) {
43461 0 : return -1;
43462 : }
43463 0 : if (test_var > uint_max) {
43464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43465 : PyLong_Type.tp_name, uint_max, test_var);
43466 0 : return -1;
43467 : }
43468 0 : *object->out.count = test_var;
43469 : } else {
43470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43471 : PyLong_Type.tp_name);
43472 0 : return -1;
43473 : }
43474 : }
43475 0 : return 0;
43476 : }
43477 :
43478 0 : static PyObject *py_lsa_LookupNames3_in_get_lookup_options(PyObject *obj, void *closure)
43479 : {
43480 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43481 0 : PyObject *py_lookup_options;
43482 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
43483 0 : return py_lookup_options;
43484 : }
43485 :
43486 0 : static int py_lsa_LookupNames3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
43487 : {
43488 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43489 0 : if (value == NULL) {
43490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
43491 0 : return -1;
43492 : }
43493 : {
43494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
43495 0 : if (PyLong_Check(value)) {
43496 0 : unsigned long long test_var;
43497 0 : test_var = PyLong_AsUnsignedLongLong(value);
43498 0 : if (PyErr_Occurred() != NULL) {
43499 0 : return -1;
43500 : }
43501 0 : if (test_var > uint_max) {
43502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43503 : PyLong_Type.tp_name, uint_max, test_var);
43504 0 : return -1;
43505 : }
43506 0 : object->in.lookup_options = test_var;
43507 : } else {
43508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43509 : PyLong_Type.tp_name);
43510 0 : return -1;
43511 : }
43512 : }
43513 0 : return 0;
43514 : }
43515 :
43516 0 : static PyObject *py_lsa_LookupNames3_in_get_client_revision(PyObject *obj, void *closure)
43517 : {
43518 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43519 0 : PyObject *py_client_revision;
43520 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
43521 0 : return py_client_revision;
43522 : }
43523 :
43524 0 : static int py_lsa_LookupNames3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
43525 : {
43526 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43527 0 : if (value == NULL) {
43528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
43529 0 : return -1;
43530 : }
43531 : {
43532 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
43533 0 : if (PyLong_Check(value)) {
43534 0 : unsigned long long test_var;
43535 0 : test_var = PyLong_AsUnsignedLongLong(value);
43536 0 : if (PyErr_Occurred() != NULL) {
43537 0 : return -1;
43538 : }
43539 0 : if (test_var > uint_max) {
43540 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43541 : PyLong_Type.tp_name, uint_max, test_var);
43542 0 : return -1;
43543 : }
43544 0 : object->in.client_revision = test_var;
43545 : } else {
43546 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43547 : PyLong_Type.tp_name);
43548 0 : return -1;
43549 : }
43550 : }
43551 0 : return 0;
43552 : }
43553 :
43554 0 : static PyObject *py_lsa_LookupNames3_get_result(PyObject *obj, void *closure)
43555 : {
43556 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(obj);
43557 0 : PyObject *py_result;
43558 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43559 0 : return py_result;
43560 : }
43561 :
43562 0 : static int py_lsa_LookupNames3_set_result(PyObject *py_obj, PyObject *value, void *closure)
43563 : {
43564 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43565 0 : if (value == NULL) {
43566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43567 0 : return -1;
43568 : }
43569 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43570 0 : return 0;
43571 : }
43572 :
43573 : static PyGetSetDef py_lsa_LookupNames3_getsetters[] = {
43574 : {
43575 : .name = discard_const_p(char, "in_handle"),
43576 : .get = py_lsa_LookupNames3_in_get_handle,
43577 : .set = py_lsa_LookupNames3_in_set_handle,
43578 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
43579 : },
43580 : {
43581 : .name = discard_const_p(char, "in_num_names"),
43582 : .get = py_lsa_LookupNames3_in_get_num_names,
43583 : .set = py_lsa_LookupNames3_in_set_num_names,
43584 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43585 : },
43586 : {
43587 : .name = discard_const_p(char, "in_names"),
43588 : .get = py_lsa_LookupNames3_in_get_names,
43589 : .set = py_lsa_LookupNames3_in_set_names,
43590 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
43591 : },
43592 : {
43593 : .name = discard_const_p(char, "out_domains"),
43594 : .get = py_lsa_LookupNames3_out_get_domains,
43595 : .set = py_lsa_LookupNames3_out_set_domains,
43596 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
43597 : },
43598 : {
43599 : .name = discard_const_p(char, "in_sids"),
43600 : .get = py_lsa_LookupNames3_in_get_sids,
43601 : .set = py_lsa_LookupNames3_in_set_sids,
43602 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
43603 : },
43604 : {
43605 : .name = discard_const_p(char, "out_sids"),
43606 : .get = py_lsa_LookupNames3_out_get_sids,
43607 : .set = py_lsa_LookupNames3_out_set_sids,
43608 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
43609 : },
43610 : {
43611 : .name = discard_const_p(char, "in_level"),
43612 : .get = py_lsa_LookupNames3_in_get_level,
43613 : .set = py_lsa_LookupNames3_in_set_level,
43614 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
43615 : },
43616 : {
43617 : .name = discard_const_p(char, "in_count"),
43618 : .get = py_lsa_LookupNames3_in_get_count,
43619 : .set = py_lsa_LookupNames3_in_set_count,
43620 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43621 : },
43622 : {
43623 : .name = discard_const_p(char, "out_count"),
43624 : .get = py_lsa_LookupNames3_out_get_count,
43625 : .set = py_lsa_LookupNames3_out_set_count,
43626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43627 : },
43628 : {
43629 : .name = discard_const_p(char, "in_lookup_options"),
43630 : .get = py_lsa_LookupNames3_in_get_lookup_options,
43631 : .set = py_lsa_LookupNames3_in_set_lookup_options,
43632 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
43633 : },
43634 : {
43635 : .name = discard_const_p(char, "in_client_revision"),
43636 : .get = py_lsa_LookupNames3_in_get_client_revision,
43637 : .set = py_lsa_LookupNames3_in_set_client_revision,
43638 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
43639 : },
43640 : {
43641 : .name = discard_const_p(char, "result"),
43642 : .get = py_lsa_LookupNames3_get_result,
43643 : .set = py_lsa_LookupNames3_set_result,
43644 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43645 : },
43646 : { .name = NULL }
43647 : };
43648 :
43649 0 : static PyObject *py_lsa_LookupNames3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43650 : {
43651 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames3, type);
43652 0 : struct lsa_LookupNames3 *_self = (struct lsa_LookupNames3 *)pytalloc_get_ptr(self);
43653 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43654 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
43655 : /* a pointer to a NULL pointer */
43656 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
43657 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
43658 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
43659 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
43660 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
43661 0 : return self;
43662 : }
43663 :
43664 0 : static PyObject *py_lsa_LookupNames3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43665 : {
43666 :
43667 :
43668 0 : return PyLong_FromLong(68);
43669 : }
43670 :
43671 0 : static PyObject *py_lsa_LookupNames3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43672 : {
43673 0 : const struct ndr_interface_call *call = NULL;
43674 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43675 0 : PyObject *ret = NULL;
43676 0 : struct ndr_push *push = NULL;
43677 0 : DATA_BLOB blob;
43678 0 : enum ndr_err_code err;
43679 :
43680 0 : if (ndr_table_lsarpc.num_calls < 69) {
43681 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_pack");
43682 0 : return NULL;
43683 : }
43684 0 : call = &ndr_table_lsarpc.calls[68];
43685 :
43686 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43687 0 : if (push == NULL) {
43688 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43689 0 : return NULL;
43690 : }
43691 :
43692 0 : push->flags |= ndr_push_flags;
43693 :
43694 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43695 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43696 0 : TALLOC_FREE(push);
43697 0 : PyErr_SetNdrError(err);
43698 0 : return NULL;
43699 : }
43700 0 : blob = ndr_push_blob(push);
43701 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43702 0 : TALLOC_FREE(push);
43703 0 : return ret;
43704 : }
43705 :
43706 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43707 : {
43708 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43709 0 : PyObject *bigendian_obj = NULL;
43710 0 : PyObject *ndr64_obj = NULL;
43711 0 : libndr_flags ndr_push_flags = 0;
43712 :
43713 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43714 : discard_const_p(char *, kwnames),
43715 : &bigendian_obj,
43716 : &ndr64_obj)) {
43717 0 : return NULL;
43718 : }
43719 :
43720 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43721 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43722 : }
43723 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43724 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43725 : }
43726 :
43727 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43728 : }
43729 :
43730 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43731 : {
43732 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43733 0 : PyObject *bigendian_obj = NULL;
43734 0 : PyObject *ndr64_obj = NULL;
43735 0 : libndr_flags ndr_push_flags = 0;
43736 :
43737 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43738 : discard_const_p(char *, kwnames),
43739 : &bigendian_obj,
43740 : &ndr64_obj)) {
43741 0 : return NULL;
43742 : }
43743 :
43744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43745 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43746 : }
43747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43748 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43749 : }
43750 :
43751 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43752 : }
43753 :
43754 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
43755 : {
43756 0 : const struct ndr_interface_call *call = NULL;
43757 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43758 0 : struct ndr_pull *pull = NULL;
43759 0 : enum ndr_err_code err;
43760 :
43761 0 : if (ndr_table_lsarpc.num_calls < 69) {
43762 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_unpack");
43763 0 : return NULL;
43764 : }
43765 0 : call = &ndr_table_lsarpc.calls[68];
43766 :
43767 0 : pull = ndr_pull_init_blob(blob, object);
43768 0 : if (pull == NULL) {
43769 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43770 0 : return NULL;
43771 : }
43772 :
43773 0 : pull->flags |= ndr_pull_flags;
43774 :
43775 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43776 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43777 0 : TALLOC_FREE(pull);
43778 0 : PyErr_SetNdrError(err);
43779 0 : return NULL;
43780 : }
43781 0 : if (!allow_remaining) {
43782 0 : uint32_t highest_ofs;
43783 :
43784 0 : if (pull->offset > pull->relative_highest_offset) {
43785 0 : highest_ofs = pull->offset;
43786 : } else {
43787 0 : highest_ofs = pull->relative_highest_offset;
43788 : }
43789 0 : if (highest_ofs < pull->data_size) {
43790 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43791 : "not all bytes consumed ofs[%u] size[%u]",
43792 : highest_ofs, pull->data_size);
43793 0 : TALLOC_FREE(pull);
43794 0 : PyErr_SetNdrError(err);
43795 0 : return NULL;
43796 : }
43797 : }
43798 :
43799 0 : TALLOC_FREE(pull);
43800 0 : Py_RETURN_NONE;
43801 : }
43802 :
43803 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43804 : {
43805 0 : DATA_BLOB blob;
43806 0 : Py_ssize_t blob_length = 0;
43807 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43808 0 : PyObject *bigendian_obj = NULL;
43809 0 : PyObject *ndr64_obj = NULL;
43810 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43811 0 : PyObject *allow_remaining_obj = NULL;
43812 0 : bool allow_remaining = false;
43813 :
43814 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43815 : discard_const_p(char *, kwnames),
43816 : &blob.data, &blob_length,
43817 : &bigendian_obj,
43818 : &ndr64_obj,
43819 : &allow_remaining_obj)) {
43820 0 : return NULL;
43821 : }
43822 0 : blob.length = blob_length;
43823 :
43824 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43825 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43826 : }
43827 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43828 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43829 : }
43830 :
43831 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43832 0 : allow_remaining = true;
43833 : }
43834 :
43835 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43836 : }
43837 :
43838 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43839 : {
43840 0 : DATA_BLOB blob;
43841 0 : Py_ssize_t blob_length = 0;
43842 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43843 0 : PyObject *bigendian_obj = NULL;
43844 0 : PyObject *ndr64_obj = NULL;
43845 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43846 0 : PyObject *allow_remaining_obj = NULL;
43847 0 : bool allow_remaining = false;
43848 :
43849 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43850 : discard_const_p(char *, kwnames),
43851 : &blob.data, &blob_length,
43852 : &bigendian_obj,
43853 : &ndr64_obj,
43854 : &allow_remaining_obj)) {
43855 0 : return NULL;
43856 : }
43857 0 : blob.length = blob_length;
43858 :
43859 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43860 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43861 : }
43862 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43863 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43864 : }
43865 :
43866 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43867 0 : allow_remaining = true;
43868 : }
43869 :
43870 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43871 : }
43872 :
43873 0 : static PyObject *py_lsa_LookupNames3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43874 : {
43875 0 : const struct ndr_interface_call *call = NULL;
43876 0 : struct lsa_LookupNames3 *object = (struct lsa_LookupNames3 *)pytalloc_get_ptr(py_obj);
43877 0 : PyObject *ret;
43878 0 : char *retstr;
43879 :
43880 0 : if (ndr_table_lsarpc.num_calls < 69) {
43881 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_print");
43882 0 : return NULL;
43883 : }
43884 0 : call = &ndr_table_lsarpc.calls[68];
43885 :
43886 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43887 0 : ret = PyUnicode_FromString(retstr);
43888 0 : TALLOC_FREE(retstr);
43889 :
43890 0 : return ret;
43891 : }
43892 :
43893 0 : static PyObject *py_lsa_LookupNames3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43894 : {
43895 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_in", NDR_IN);
43896 : }
43897 :
43898 0 : static PyObject *py_lsa_LookupNames3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43899 : {
43900 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_out", NDR_OUT);
43901 : }
43902 :
43903 : static PyMethodDef py_lsa_LookupNames3_methods[] = {
43904 : { "opnum", (PyCFunction)py_lsa_LookupNames3_ndr_opnum, METH_NOARGS|METH_CLASS,
43905 : "lsa.LookupNames3.opnum() -> 68 (0x44) " },
43906 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43907 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43908 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43909 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43910 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43911 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43912 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43913 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43914 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43915 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43916 : { NULL, NULL, 0, NULL }
43917 : };
43918 :
43919 :
43920 : static PyTypeObject lsa_LookupNames3_Type = {
43921 : PyVarObject_HEAD_INIT(NULL, 0)
43922 : .tp_name = "lsa.LookupNames3",
43923 : .tp_getset = py_lsa_LookupNames3_getsetters,
43924 : .tp_methods = py_lsa_LookupNames3_methods,
43925 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43926 : .tp_new = py_lsa_LookupNames3_new,
43927 : };
43928 :
43929 0 : static bool pack_py_lsa_LookupNames3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames3 *r)
43930 : {
43931 0 : PyObject *py_handle;
43932 0 : PyObject *py_names;
43933 0 : PyObject *py_sids;
43934 0 : PyObject *py_level;
43935 0 : PyObject *py_count;
43936 0 : PyObject *py_lookup_options;
43937 0 : PyObject *py_client_revision;
43938 0 : const char *kwnames[] = {
43939 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
43940 : };
43941 :
43942 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)) {
43943 0 : return false;
43944 : }
43945 :
43946 0 : if (py_handle == NULL) {
43947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
43948 0 : return false;
43949 : }
43950 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
43951 0 : if (r->in.handle == NULL) {
43952 0 : PyErr_NoMemory();
43953 0 : return false;
43954 : }
43955 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
43956 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
43957 0 : PyErr_NoMemory();
43958 0 : return false;
43959 : }
43960 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
43961 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43962 0 : r->in.num_names = PyList_GET_SIZE(py_names);
43963 0 : if (py_names == NULL) {
43964 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
43965 0 : return false;
43966 : }
43967 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43968 : {
43969 0 : int names_cntr_0;
43970 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
43971 0 : if (!r->in.names) { return false; }
43972 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
43973 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
43974 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
43975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
43976 0 : return false;
43977 : }
43978 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
43979 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
43980 0 : PyErr_NoMemory();
43981 0 : return false;
43982 : }
43983 0 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
43984 : }
43985 : }
43986 0 : if (py_sids == NULL) {
43987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
43988 0 : return false;
43989 : }
43990 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
43991 0 : if (r->in.sids == NULL) {
43992 0 : PyErr_NoMemory();
43993 0 : return false;
43994 : }
43995 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
43996 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
43997 0 : PyErr_NoMemory();
43998 0 : return false;
43999 : }
44000 0 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
44001 0 : if (py_level == NULL) {
44002 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
44003 0 : return false;
44004 : }
44005 : {
44006 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
44007 0 : if (PyLong_Check(py_level)) {
44008 0 : unsigned long long test_var;
44009 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
44010 0 : if (PyErr_Occurred() != NULL) {
44011 0 : return false;
44012 : }
44013 0 : if (test_var > uint_max) {
44014 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44015 : PyLong_Type.tp_name, uint_max, test_var);
44016 0 : return false;
44017 : }
44018 0 : r->in.level = test_var;
44019 : } else {
44020 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44021 : PyLong_Type.tp_name);
44022 0 : return false;
44023 : }
44024 : }
44025 0 : if (py_count == NULL) {
44026 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
44027 0 : return false;
44028 : }
44029 0 : r->in.count = talloc_ptrtype(r, r->in.count);
44030 0 : if (r->in.count == NULL) {
44031 0 : PyErr_NoMemory();
44032 0 : return false;
44033 : }
44034 : {
44035 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
44036 0 : if (PyLong_Check(py_count)) {
44037 0 : unsigned long long test_var;
44038 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
44039 0 : if (PyErr_Occurred() != NULL) {
44040 0 : return false;
44041 : }
44042 0 : if (test_var > uint_max) {
44043 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44044 : PyLong_Type.tp_name, uint_max, test_var);
44045 0 : return false;
44046 : }
44047 0 : *r->in.count = test_var;
44048 : } else {
44049 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44050 : PyLong_Type.tp_name);
44051 0 : return false;
44052 : }
44053 : }
44054 0 : if (py_lookup_options == NULL) {
44055 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
44056 0 : return false;
44057 : }
44058 : {
44059 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
44060 0 : if (PyLong_Check(py_lookup_options)) {
44061 0 : unsigned long long test_var;
44062 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
44063 0 : if (PyErr_Occurred() != NULL) {
44064 0 : return false;
44065 : }
44066 0 : if (test_var > uint_max) {
44067 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44068 : PyLong_Type.tp_name, uint_max, test_var);
44069 0 : return false;
44070 : }
44071 0 : r->in.lookup_options = test_var;
44072 : } else {
44073 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44074 : PyLong_Type.tp_name);
44075 0 : return false;
44076 : }
44077 : }
44078 0 : if (py_client_revision == NULL) {
44079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
44080 0 : return false;
44081 : }
44082 : {
44083 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
44084 0 : if (PyLong_Check(py_client_revision)) {
44085 0 : unsigned long long test_var;
44086 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
44087 0 : if (PyErr_Occurred() != NULL) {
44088 0 : return false;
44089 : }
44090 0 : if (test_var > uint_max) {
44091 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44092 : PyLong_Type.tp_name, uint_max, test_var);
44093 0 : return false;
44094 : }
44095 0 : r->in.client_revision = test_var;
44096 : } else {
44097 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44098 : PyLong_Type.tp_name);
44099 0 : return false;
44100 : }
44101 : }
44102 0 : return true;
44103 : }
44104 :
44105 0 : static PyObject *unpack_py_lsa_LookupNames3_args_out(struct lsa_LookupNames3 *r)
44106 : {
44107 0 : PyObject *result;
44108 0 : PyObject *py_domains;
44109 0 : PyObject *py_sids;
44110 0 : PyObject *py_count;
44111 0 : result = PyTuple_New(3);
44112 0 : if (*r->out.domains == NULL) {
44113 0 : py_domains = Py_None;
44114 0 : Py_INCREF(py_domains);
44115 : } else {
44116 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
44117 : }
44118 0 : PyTuple_SetItem(result, 0, py_domains);
44119 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
44120 0 : PyTuple_SetItem(result, 1, py_sids);
44121 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
44122 0 : PyTuple_SetItem(result, 2, py_count);
44123 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
44124 0 : PyErr_SetNTSTATUS(r->out.result);
44125 0 : return NULL;
44126 : }
44127 :
44128 0 : return result;
44129 : }
44130 :
44131 :
44132 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
44133 : {
44134 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44135 0 : PyObject *py_handle;
44136 0 : if (object->in.handle == NULL) {
44137 0 : Py_RETURN_NONE;
44138 : }
44139 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
44140 0 : return py_handle;
44141 : }
44142 :
44143 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
44144 : {
44145 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44146 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
44147 0 : if (value == NULL) {
44148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
44149 0 : return -1;
44150 : }
44151 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
44152 0 : if (object->in.handle == NULL) {
44153 0 : PyErr_NoMemory();
44154 0 : return -1;
44155 : }
44156 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44157 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44158 0 : PyErr_NoMemory();
44159 0 : return -1;
44160 : }
44161 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
44162 0 : return 0;
44163 : }
44164 :
44165 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
44166 : {
44167 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44168 0 : PyObject *py_trusted_domain_name;
44169 0 : if (object->in.trusted_domain_name == NULL) {
44170 0 : Py_RETURN_NONE;
44171 : }
44172 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
44173 0 : return py_trusted_domain_name;
44174 : }
44175 :
44176 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44177 : {
44178 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44179 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
44180 0 : if (value == NULL) {
44181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
44182 0 : return -1;
44183 : }
44184 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
44185 0 : if (object->in.trusted_domain_name == NULL) {
44186 0 : PyErr_NoMemory();
44187 0 : return -1;
44188 : }
44189 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
44190 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44191 0 : PyErr_NoMemory();
44192 0 : return -1;
44193 : }
44194 0 : object->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
44195 0 : return 0;
44196 : }
44197 :
44198 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
44199 : {
44200 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44201 0 : PyObject *py_highest_record_type;
44202 0 : py_highest_record_type = PyLong_FromLong((uint16_t)object->in.highest_record_type);
44203 0 : return py_highest_record_type;
44204 : }
44205 :
44206 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
44207 : {
44208 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44209 0 : if (value == NULL) {
44210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.highest_record_type");
44211 0 : return -1;
44212 : }
44213 : {
44214 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
44215 0 : if (PyLong_Check(value)) {
44216 0 : unsigned long long test_var;
44217 0 : test_var = PyLong_AsUnsignedLongLong(value);
44218 0 : if (PyErr_Occurred() != NULL) {
44219 0 : return -1;
44220 : }
44221 0 : if (test_var > uint_max) {
44222 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44223 : PyLong_Type.tp_name, uint_max, test_var);
44224 0 : return -1;
44225 : }
44226 0 : object->in.highest_record_type = test_var;
44227 : } else {
44228 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44229 : PyLong_Type.tp_name);
44230 0 : return -1;
44231 : }
44232 : }
44233 0 : return 0;
44234 : }
44235 :
44236 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
44237 : {
44238 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44239 0 : PyObject *py_forest_trust_info;
44240 0 : if (object->out.forest_trust_info == NULL) {
44241 0 : Py_RETURN_NONE;
44242 : }
44243 0 : if (*object->out.forest_trust_info == NULL) {
44244 0 : py_forest_trust_info = Py_None;
44245 0 : Py_INCREF(py_forest_trust_info);
44246 : } else {
44247 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
44248 : }
44249 0 : return py_forest_trust_info;
44250 : }
44251 :
44252 0 : static int py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
44253 : {
44254 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44255 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
44256 0 : if (value == NULL) {
44257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.forest_trust_info");
44258 0 : return -1;
44259 : }
44260 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
44261 0 : if (object->out.forest_trust_info == NULL) {
44262 0 : PyErr_NoMemory();
44263 0 : return -1;
44264 : }
44265 0 : if (value == Py_None) {
44266 0 : *object->out.forest_trust_info = NULL;
44267 : } else {
44268 0 : *object->out.forest_trust_info = NULL;
44269 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
44270 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44271 0 : PyErr_NoMemory();
44272 0 : return -1;
44273 : }
44274 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
44275 : }
44276 0 : return 0;
44277 : }
44278 :
44279 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_get_result(PyObject *obj, void *closure)
44280 : {
44281 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(obj);
44282 0 : PyObject *py_result;
44283 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44284 0 : return py_result;
44285 : }
44286 :
44287 0 : static int py_lsa_lsaRQueryForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
44288 : {
44289 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44290 0 : if (value == NULL) {
44291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44292 0 : return -1;
44293 : }
44294 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44295 0 : return 0;
44296 : }
44297 :
44298 : static PyGetSetDef py_lsa_lsaRQueryForestTrustInformation_getsetters[] = {
44299 : {
44300 : .name = discard_const_p(char, "in_handle"),
44301 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_handle,
44302 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_handle,
44303 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44304 : },
44305 : {
44306 : .name = discard_const_p(char, "in_trusted_domain_name"),
44307 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name,
44308 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name,
44309 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
44310 : },
44311 : {
44312 : .name = discard_const_p(char, "in_highest_record_type"),
44313 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type,
44314 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type,
44315 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
44316 : },
44317 : {
44318 : .name = discard_const_p(char, "out_forest_trust_info"),
44319 : .get = py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info,
44320 : .set = py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info,
44321 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
44322 : },
44323 : {
44324 : .name = discard_const_p(char, "result"),
44325 : .get = py_lsa_lsaRQueryForestTrustInformation_get_result,
44326 : .set = py_lsa_lsaRQueryForestTrustInformation_set_result,
44327 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44328 : },
44329 : { .name = NULL }
44330 : };
44331 :
44332 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44333 : {
44334 0 : PyObject *self = pytalloc_new(struct lsa_lsaRQueryForestTrustInformation, type);
44335 0 : struct lsa_lsaRQueryForestTrustInformation *_self = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(self);
44336 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44337 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
44338 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_String);
44339 : /* a pointer to a NULL pointer */
44340 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
44341 0 : return self;
44342 : }
44343 :
44344 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44345 : {
44346 :
44347 :
44348 0 : return PyLong_FromLong(73);
44349 : }
44350 :
44351 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44352 : {
44353 0 : const struct ndr_interface_call *call = NULL;
44354 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44355 0 : PyObject *ret = NULL;
44356 0 : struct ndr_push *push = NULL;
44357 0 : DATA_BLOB blob;
44358 0 : enum ndr_err_code err;
44359 :
44360 0 : if (ndr_table_lsarpc.num_calls < 74) {
44361 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_pack");
44362 0 : return NULL;
44363 : }
44364 0 : call = &ndr_table_lsarpc.calls[73];
44365 :
44366 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44367 0 : if (push == NULL) {
44368 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44369 0 : return NULL;
44370 : }
44371 :
44372 0 : push->flags |= ndr_push_flags;
44373 :
44374 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44375 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44376 0 : TALLOC_FREE(push);
44377 0 : PyErr_SetNdrError(err);
44378 0 : return NULL;
44379 : }
44380 0 : blob = ndr_push_blob(push);
44381 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44382 0 : TALLOC_FREE(push);
44383 0 : return ret;
44384 : }
44385 :
44386 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44387 : {
44388 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44389 0 : PyObject *bigendian_obj = NULL;
44390 0 : PyObject *ndr64_obj = NULL;
44391 0 : libndr_flags ndr_push_flags = 0;
44392 :
44393 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44394 : discard_const_p(char *, kwnames),
44395 : &bigendian_obj,
44396 : &ndr64_obj)) {
44397 0 : return NULL;
44398 : }
44399 :
44400 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44401 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44402 : }
44403 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44404 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44405 : }
44406 :
44407 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44408 : }
44409 :
44410 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44411 : {
44412 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44413 0 : PyObject *bigendian_obj = NULL;
44414 0 : PyObject *ndr64_obj = NULL;
44415 0 : libndr_flags ndr_push_flags = 0;
44416 :
44417 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44418 : discard_const_p(char *, kwnames),
44419 : &bigendian_obj,
44420 : &ndr64_obj)) {
44421 0 : return NULL;
44422 : }
44423 :
44424 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44425 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44426 : }
44427 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44428 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44429 : }
44430 :
44431 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44432 : }
44433 :
44434 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
44435 : {
44436 0 : const struct ndr_interface_call *call = NULL;
44437 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44438 0 : struct ndr_pull *pull = NULL;
44439 0 : enum ndr_err_code err;
44440 :
44441 0 : if (ndr_table_lsarpc.num_calls < 74) {
44442 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_unpack");
44443 0 : return NULL;
44444 : }
44445 0 : call = &ndr_table_lsarpc.calls[73];
44446 :
44447 0 : pull = ndr_pull_init_blob(blob, object);
44448 0 : if (pull == NULL) {
44449 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44450 0 : return NULL;
44451 : }
44452 :
44453 0 : pull->flags |= ndr_pull_flags;
44454 :
44455 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44456 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44457 0 : TALLOC_FREE(pull);
44458 0 : PyErr_SetNdrError(err);
44459 0 : return NULL;
44460 : }
44461 0 : if (!allow_remaining) {
44462 0 : uint32_t highest_ofs;
44463 :
44464 0 : if (pull->offset > pull->relative_highest_offset) {
44465 0 : highest_ofs = pull->offset;
44466 : } else {
44467 0 : highest_ofs = pull->relative_highest_offset;
44468 : }
44469 0 : if (highest_ofs < pull->data_size) {
44470 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44471 : "not all bytes consumed ofs[%u] size[%u]",
44472 : highest_ofs, pull->data_size);
44473 0 : TALLOC_FREE(pull);
44474 0 : PyErr_SetNdrError(err);
44475 0 : return NULL;
44476 : }
44477 : }
44478 :
44479 0 : TALLOC_FREE(pull);
44480 0 : Py_RETURN_NONE;
44481 : }
44482 :
44483 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44484 : {
44485 0 : DATA_BLOB blob;
44486 0 : Py_ssize_t blob_length = 0;
44487 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44488 0 : PyObject *bigendian_obj = NULL;
44489 0 : PyObject *ndr64_obj = NULL;
44490 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44491 0 : PyObject *allow_remaining_obj = NULL;
44492 0 : bool allow_remaining = false;
44493 :
44494 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44495 : discard_const_p(char *, kwnames),
44496 : &blob.data, &blob_length,
44497 : &bigendian_obj,
44498 : &ndr64_obj,
44499 : &allow_remaining_obj)) {
44500 0 : return NULL;
44501 : }
44502 0 : blob.length = blob_length;
44503 :
44504 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44505 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44506 : }
44507 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44508 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44509 : }
44510 :
44511 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44512 0 : allow_remaining = true;
44513 : }
44514 :
44515 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44516 : }
44517 :
44518 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44519 : {
44520 0 : DATA_BLOB blob;
44521 0 : Py_ssize_t blob_length = 0;
44522 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44523 0 : PyObject *bigendian_obj = NULL;
44524 0 : PyObject *ndr64_obj = NULL;
44525 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44526 0 : PyObject *allow_remaining_obj = NULL;
44527 0 : bool allow_remaining = false;
44528 :
44529 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44530 : discard_const_p(char *, kwnames),
44531 : &blob.data, &blob_length,
44532 : &bigendian_obj,
44533 : &ndr64_obj,
44534 : &allow_remaining_obj)) {
44535 0 : return NULL;
44536 : }
44537 0 : blob.length = blob_length;
44538 :
44539 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44540 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44541 : }
44542 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44543 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44544 : }
44545 :
44546 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44547 0 : allow_remaining = true;
44548 : }
44549 :
44550 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44551 : }
44552 :
44553 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
44554 : {
44555 0 : const struct ndr_interface_call *call = NULL;
44556 0 : struct lsa_lsaRQueryForestTrustInformation *object = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(py_obj);
44557 0 : PyObject *ret;
44558 0 : char *retstr;
44559 :
44560 0 : if (ndr_table_lsarpc.num_calls < 74) {
44561 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_print");
44562 0 : return NULL;
44563 : }
44564 0 : call = &ndr_table_lsarpc.calls[73];
44565 :
44566 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44567 0 : ret = PyUnicode_FromString(retstr);
44568 0 : TALLOC_FREE(retstr);
44569 :
44570 0 : return ret;
44571 : }
44572 :
44573 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44574 : {
44575 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_in", NDR_IN);
44576 : }
44577 :
44578 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44579 : {
44580 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_out", NDR_OUT);
44581 : }
44582 :
44583 : static PyMethodDef py_lsa_lsaRQueryForestTrustInformation_methods[] = {
44584 : { "opnum", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
44585 : "lsa.lsaRQueryForestTrustInformation.opnum() -> 73 (0x49) " },
44586 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44587 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44588 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44589 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44590 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44591 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44592 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44593 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44594 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44595 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44596 : { NULL, NULL, 0, NULL }
44597 : };
44598 :
44599 :
44600 : static PyTypeObject lsa_lsaRQueryForestTrustInformation_Type = {
44601 : PyVarObject_HEAD_INIT(NULL, 0)
44602 : .tp_name = "lsa.lsaRQueryForestTrustInformation",
44603 : .tp_getset = py_lsa_lsaRQueryForestTrustInformation_getsetters,
44604 : .tp_methods = py_lsa_lsaRQueryForestTrustInformation_methods,
44605 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44606 : .tp_new = py_lsa_lsaRQueryForestTrustInformation_new,
44607 : };
44608 :
44609 124 : static bool pack_py_lsa_lsaRQueryForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation *r)
44610 : {
44611 0 : PyObject *py_handle;
44612 0 : PyObject *py_trusted_domain_name;
44613 0 : PyObject *py_highest_record_type;
44614 124 : const char *kwnames[] = {
44615 : "handle", "trusted_domain_name", "highest_record_type", NULL
44616 : };
44617 :
44618 124 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
44619 0 : return false;
44620 : }
44621 :
44622 124 : if (py_handle == NULL) {
44623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
44624 0 : return false;
44625 : }
44626 124 : r->in.handle = talloc_ptrtype(r, r->in.handle);
44627 124 : if (r->in.handle == NULL) {
44628 0 : PyErr_NoMemory();
44629 0 : return false;
44630 : }
44631 124 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
44632 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
44633 0 : PyErr_NoMemory();
44634 0 : return false;
44635 : }
44636 124 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
44637 124 : if (py_trusted_domain_name == NULL) {
44638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
44639 0 : return false;
44640 : }
44641 124 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
44642 124 : if (r->in.trusted_domain_name == NULL) {
44643 0 : PyErr_NoMemory();
44644 0 : return false;
44645 : }
44646 124 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain_name, return false;);
44647 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
44648 0 : PyErr_NoMemory();
44649 0 : return false;
44650 : }
44651 124 : r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
44652 124 : if (py_highest_record_type == NULL) {
44653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.highest_record_type");
44654 0 : return false;
44655 : }
44656 : {
44657 124 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
44658 124 : if (PyLong_Check(py_highest_record_type)) {
44659 0 : unsigned long long test_var;
44660 124 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
44661 124 : if (PyErr_Occurred() != NULL) {
44662 0 : return false;
44663 : }
44664 124 : if (test_var > uint_max) {
44665 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44666 : PyLong_Type.tp_name, uint_max, test_var);
44667 0 : return false;
44668 : }
44669 124 : r->in.highest_record_type = test_var;
44670 : } else {
44671 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44672 : PyLong_Type.tp_name);
44673 0 : return false;
44674 : }
44675 : }
44676 124 : return true;
44677 : }
44678 :
44679 124 : static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation_args_out(struct lsa_lsaRQueryForestTrustInformation *r)
44680 : {
44681 0 : PyObject *result;
44682 0 : PyObject *py_forest_trust_info;
44683 124 : if (*r->out.forest_trust_info == NULL) {
44684 0 : py_forest_trust_info = Py_None;
44685 0 : Py_INCREF(py_forest_trust_info);
44686 : } else {
44687 124 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
44688 : }
44689 124 : result = py_forest_trust_info;
44690 124 : if (NT_STATUS_IS_ERR(r->out.result)) {
44691 0 : PyErr_SetNTSTATUS(r->out.result);
44692 0 : return NULL;
44693 : }
44694 :
44695 124 : return result;
44696 : }
44697 :
44698 :
44699 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
44700 : {
44701 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44702 0 : PyObject *py_handle;
44703 0 : if (object->in.handle == NULL) {
44704 0 : Py_RETURN_NONE;
44705 : }
44706 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
44707 0 : return py_handle;
44708 : }
44709 :
44710 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
44711 : {
44712 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44713 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
44714 0 : if (value == NULL) {
44715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
44716 0 : return -1;
44717 : }
44718 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
44719 0 : if (object->in.handle == NULL) {
44720 0 : PyErr_NoMemory();
44721 0 : return -1;
44722 : }
44723 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44724 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44725 0 : PyErr_NoMemory();
44726 0 : return -1;
44727 : }
44728 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
44729 0 : return 0;
44730 : }
44731 :
44732 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
44733 : {
44734 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44735 0 : PyObject *py_trusted_domain_name;
44736 0 : if (object->in.trusted_domain_name == NULL) {
44737 0 : Py_RETURN_NONE;
44738 : }
44739 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
44740 0 : return py_trusted_domain_name;
44741 : }
44742 :
44743 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44744 : {
44745 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44746 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
44747 0 : if (value == NULL) {
44748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.trusted_domain_name");
44749 0 : return -1;
44750 : }
44751 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
44752 0 : if (object->in.trusted_domain_name == NULL) {
44753 0 : PyErr_NoMemory();
44754 0 : return -1;
44755 : }
44756 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
44757 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44758 0 : PyErr_NoMemory();
44759 0 : return -1;
44760 : }
44761 0 : object->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
44762 0 : return 0;
44763 : }
44764 :
44765 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
44766 : {
44767 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44768 0 : PyObject *py_highest_record_type;
44769 0 : py_highest_record_type = PyLong_FromLong((uint16_t)object->in.highest_record_type);
44770 0 : return py_highest_record_type;
44771 : }
44772 :
44773 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
44774 : {
44775 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44776 0 : if (value == NULL) {
44777 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.highest_record_type");
44778 0 : return -1;
44779 : }
44780 : {
44781 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
44782 0 : if (PyLong_Check(value)) {
44783 0 : unsigned long long test_var;
44784 0 : test_var = PyLong_AsUnsignedLongLong(value);
44785 0 : if (PyErr_Occurred() != NULL) {
44786 0 : return -1;
44787 : }
44788 0 : if (test_var > uint_max) {
44789 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44790 : PyLong_Type.tp_name, uint_max, test_var);
44791 0 : return -1;
44792 : }
44793 0 : object->in.highest_record_type = test_var;
44794 : } else {
44795 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44796 : PyLong_Type.tp_name);
44797 0 : return -1;
44798 : }
44799 : }
44800 0 : return 0;
44801 : }
44802 :
44803 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info(PyObject *obj, void *closure)
44804 : {
44805 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44806 0 : PyObject *py_forest_trust_info;
44807 0 : if (object->in.forest_trust_info == NULL) {
44808 0 : Py_RETURN_NONE;
44809 : }
44810 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, object->in.forest_trust_info, object->in.forest_trust_info);
44811 0 : return py_forest_trust_info;
44812 : }
44813 :
44814 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
44815 : {
44816 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44817 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.forest_trust_info));
44818 0 : if (value == NULL) {
44819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.forest_trust_info");
44820 0 : return -1;
44821 : }
44822 0 : object->in.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.forest_trust_info);
44823 0 : if (object->in.forest_trust_info == NULL) {
44824 0 : PyErr_NoMemory();
44825 0 : return -1;
44826 : }
44827 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
44828 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44829 0 : PyErr_NoMemory();
44830 0 : return -1;
44831 : }
44832 0 : object->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
44833 0 : return 0;
44834 : }
44835 :
44836 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_check_only(PyObject *obj, void *closure)
44837 : {
44838 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44839 0 : PyObject *py_check_only;
44840 0 : py_check_only = PyLong_FromLong((uint16_t)object->in.check_only);
44841 0 : return py_check_only;
44842 : }
44843 :
44844 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_check_only(PyObject *py_obj, PyObject *value, void *closure)
44845 : {
44846 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44847 0 : if (value == NULL) {
44848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.check_only");
44849 0 : return -1;
44850 : }
44851 : {
44852 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.check_only));
44853 0 : if (PyLong_Check(value)) {
44854 0 : unsigned long long test_var;
44855 0 : test_var = PyLong_AsUnsignedLongLong(value);
44856 0 : if (PyErr_Occurred() != NULL) {
44857 0 : return -1;
44858 : }
44859 0 : if (test_var > uint_max) {
44860 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44861 : PyLong_Type.tp_name, uint_max, test_var);
44862 0 : return -1;
44863 : }
44864 0 : object->in.check_only = test_var;
44865 : } else {
44866 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44867 : PyLong_Type.tp_name);
44868 0 : return -1;
44869 : }
44870 : }
44871 0 : return 0;
44872 : }
44873 :
44874 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_out_get_collision_info(PyObject *obj, void *closure)
44875 : {
44876 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44877 0 : PyObject *py_collision_info;
44878 0 : if (object->out.collision_info == NULL) {
44879 0 : Py_RETURN_NONE;
44880 : }
44881 0 : if (*object->out.collision_info == NULL) {
44882 0 : py_collision_info = Py_None;
44883 0 : Py_INCREF(py_collision_info);
44884 : } else {
44885 0 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *object->out.collision_info, *object->out.collision_info);
44886 : }
44887 0 : return py_collision_info;
44888 : }
44889 :
44890 0 : static int py_lsa_lsaRSetForestTrustInformation_out_set_collision_info(PyObject *py_obj, PyObject *value, void *closure)
44891 : {
44892 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44893 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.collision_info));
44894 0 : if (value == NULL) {
44895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.collision_info");
44896 0 : return -1;
44897 : }
44898 0 : object->out.collision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.collision_info);
44899 0 : if (object->out.collision_info == NULL) {
44900 0 : PyErr_NoMemory();
44901 0 : return -1;
44902 : }
44903 0 : if (value == Py_None) {
44904 0 : *object->out.collision_info = NULL;
44905 : } else {
44906 0 : *object->out.collision_info = NULL;
44907 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionInfo_Type, value, return -1;);
44908 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44909 0 : PyErr_NoMemory();
44910 0 : return -1;
44911 : }
44912 0 : *object->out.collision_info = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(value);
44913 : }
44914 0 : return 0;
44915 : }
44916 :
44917 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_get_result(PyObject *obj, void *closure)
44918 : {
44919 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(obj);
44920 0 : PyObject *py_result;
44921 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44922 0 : return py_result;
44923 : }
44924 :
44925 0 : static int py_lsa_lsaRSetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
44926 : {
44927 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
44928 0 : if (value == NULL) {
44929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44930 0 : return -1;
44931 : }
44932 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44933 0 : return 0;
44934 : }
44935 :
44936 : static PyGetSetDef py_lsa_lsaRSetForestTrustInformation_getsetters[] = {
44937 : {
44938 : .name = discard_const_p(char, "in_handle"),
44939 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_handle,
44940 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_handle,
44941 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44942 : },
44943 : {
44944 : .name = discard_const_p(char, "in_trusted_domain_name"),
44945 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name,
44946 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name,
44947 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
44948 : },
44949 : {
44950 : .name = discard_const_p(char, "in_highest_record_type"),
44951 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type,
44952 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type,
44953 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
44954 : },
44955 : {
44956 : .name = discard_const_p(char, "in_forest_trust_info"),
44957 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info,
44958 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info,
44959 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
44960 : },
44961 : {
44962 : .name = discard_const_p(char, "in_check_only"),
44963 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_check_only,
44964 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_check_only,
44965 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
44966 : },
44967 : {
44968 : .name = discard_const_p(char, "out_collision_info"),
44969 : .get = py_lsa_lsaRSetForestTrustInformation_out_get_collision_info,
44970 : .set = py_lsa_lsaRSetForestTrustInformation_out_set_collision_info,
44971 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionInfo")
44972 : },
44973 : {
44974 : .name = discard_const_p(char, "result"),
44975 : .get = py_lsa_lsaRSetForestTrustInformation_get_result,
44976 : .set = py_lsa_lsaRSetForestTrustInformation_set_result,
44977 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44978 : },
44979 : { .name = NULL }
44980 : };
44981 :
44982 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44983 : {
44984 0 : PyObject *self = pytalloc_new(struct lsa_lsaRSetForestTrustInformation, type);
44985 0 : struct lsa_lsaRSetForestTrustInformation *_self = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(self);
44986 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44987 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
44988 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_StringLarge);
44989 0 : _self->in.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation);
44990 : /* a pointer to a NULL pointer */
44991 0 : _self->out.collision_info = talloc_zero(mem_ctx, struct lsa_ForestTrustCollisionInfo *);
44992 0 : return self;
44993 : }
44994 :
44995 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44996 : {
44997 :
44998 :
44999 0 : return PyLong_FromLong(74);
45000 : }
45001 :
45002 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
45003 : {
45004 0 : const struct ndr_interface_call *call = NULL;
45005 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45006 0 : PyObject *ret = NULL;
45007 0 : struct ndr_push *push = NULL;
45008 0 : DATA_BLOB blob;
45009 0 : enum ndr_err_code err;
45010 :
45011 0 : if (ndr_table_lsarpc.num_calls < 75) {
45012 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_pack");
45013 0 : return NULL;
45014 : }
45015 0 : call = &ndr_table_lsarpc.calls[74];
45016 :
45017 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45018 0 : if (push == NULL) {
45019 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45020 0 : return NULL;
45021 : }
45022 :
45023 0 : push->flags |= ndr_push_flags;
45024 :
45025 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45026 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45027 0 : TALLOC_FREE(push);
45028 0 : PyErr_SetNdrError(err);
45029 0 : return NULL;
45030 : }
45031 0 : blob = ndr_push_blob(push);
45032 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45033 0 : TALLOC_FREE(push);
45034 0 : return ret;
45035 : }
45036 :
45037 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45038 : {
45039 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45040 0 : PyObject *bigendian_obj = NULL;
45041 0 : PyObject *ndr64_obj = NULL;
45042 0 : libndr_flags ndr_push_flags = 0;
45043 :
45044 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45045 : discard_const_p(char *, kwnames),
45046 : &bigendian_obj,
45047 : &ndr64_obj)) {
45048 0 : return NULL;
45049 : }
45050 :
45051 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45052 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45053 : }
45054 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45055 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45056 : }
45057 :
45058 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45059 : }
45060 :
45061 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45062 : {
45063 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45064 0 : PyObject *bigendian_obj = NULL;
45065 0 : PyObject *ndr64_obj = NULL;
45066 0 : libndr_flags ndr_push_flags = 0;
45067 :
45068 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45069 : discard_const_p(char *, kwnames),
45070 : &bigendian_obj,
45071 : &ndr64_obj)) {
45072 0 : return NULL;
45073 : }
45074 :
45075 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45076 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45077 : }
45078 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45079 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45080 : }
45081 :
45082 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45083 : }
45084 :
45085 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
45086 : {
45087 0 : const struct ndr_interface_call *call = NULL;
45088 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45089 0 : struct ndr_pull *pull = NULL;
45090 0 : enum ndr_err_code err;
45091 :
45092 0 : if (ndr_table_lsarpc.num_calls < 75) {
45093 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_unpack");
45094 0 : return NULL;
45095 : }
45096 0 : call = &ndr_table_lsarpc.calls[74];
45097 :
45098 0 : pull = ndr_pull_init_blob(blob, object);
45099 0 : if (pull == NULL) {
45100 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45101 0 : return NULL;
45102 : }
45103 :
45104 0 : pull->flags |= ndr_pull_flags;
45105 :
45106 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45107 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45108 0 : TALLOC_FREE(pull);
45109 0 : PyErr_SetNdrError(err);
45110 0 : return NULL;
45111 : }
45112 0 : if (!allow_remaining) {
45113 0 : uint32_t highest_ofs;
45114 :
45115 0 : if (pull->offset > pull->relative_highest_offset) {
45116 0 : highest_ofs = pull->offset;
45117 : } else {
45118 0 : highest_ofs = pull->relative_highest_offset;
45119 : }
45120 0 : if (highest_ofs < pull->data_size) {
45121 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45122 : "not all bytes consumed ofs[%u] size[%u]",
45123 : highest_ofs, pull->data_size);
45124 0 : TALLOC_FREE(pull);
45125 0 : PyErr_SetNdrError(err);
45126 0 : return NULL;
45127 : }
45128 : }
45129 :
45130 0 : TALLOC_FREE(pull);
45131 0 : Py_RETURN_NONE;
45132 : }
45133 :
45134 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45135 : {
45136 0 : DATA_BLOB blob;
45137 0 : Py_ssize_t blob_length = 0;
45138 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45139 0 : PyObject *bigendian_obj = NULL;
45140 0 : PyObject *ndr64_obj = NULL;
45141 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45142 0 : PyObject *allow_remaining_obj = NULL;
45143 0 : bool allow_remaining = false;
45144 :
45145 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45146 : discard_const_p(char *, kwnames),
45147 : &blob.data, &blob_length,
45148 : &bigendian_obj,
45149 : &ndr64_obj,
45150 : &allow_remaining_obj)) {
45151 0 : return NULL;
45152 : }
45153 0 : blob.length = blob_length;
45154 :
45155 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45156 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45157 : }
45158 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45159 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45160 : }
45161 :
45162 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45163 0 : allow_remaining = true;
45164 : }
45165 :
45166 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45167 : }
45168 :
45169 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45170 : {
45171 0 : DATA_BLOB blob;
45172 0 : Py_ssize_t blob_length = 0;
45173 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45174 0 : PyObject *bigendian_obj = NULL;
45175 0 : PyObject *ndr64_obj = NULL;
45176 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45177 0 : PyObject *allow_remaining_obj = NULL;
45178 0 : bool allow_remaining = false;
45179 :
45180 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45181 : discard_const_p(char *, kwnames),
45182 : &blob.data, &blob_length,
45183 : &bigendian_obj,
45184 : &ndr64_obj,
45185 : &allow_remaining_obj)) {
45186 0 : return NULL;
45187 : }
45188 0 : blob.length = blob_length;
45189 :
45190 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45191 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45192 : }
45193 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45194 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45195 : }
45196 :
45197 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45198 0 : allow_remaining = true;
45199 : }
45200 :
45201 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45202 : }
45203 :
45204 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45205 : {
45206 0 : const struct ndr_interface_call *call = NULL;
45207 0 : struct lsa_lsaRSetForestTrustInformation *object = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(py_obj);
45208 0 : PyObject *ret;
45209 0 : char *retstr;
45210 :
45211 0 : if (ndr_table_lsarpc.num_calls < 75) {
45212 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_print");
45213 0 : return NULL;
45214 : }
45215 0 : call = &ndr_table_lsarpc.calls[74];
45216 :
45217 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45218 0 : ret = PyUnicode_FromString(retstr);
45219 0 : TALLOC_FREE(retstr);
45220 :
45221 0 : return ret;
45222 : }
45223 :
45224 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45225 : {
45226 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_in", NDR_IN);
45227 : }
45228 :
45229 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45230 : {
45231 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_out", NDR_OUT);
45232 : }
45233 :
45234 : static PyMethodDef py_lsa_lsaRSetForestTrustInformation_methods[] = {
45235 : { "opnum", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
45236 : "lsa.lsaRSetForestTrustInformation.opnum() -> 74 (0x4a) " },
45237 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45238 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45239 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45240 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45241 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45242 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45243 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45244 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45245 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45246 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45247 : { NULL, NULL, 0, NULL }
45248 : };
45249 :
45250 :
45251 : static PyTypeObject lsa_lsaRSetForestTrustInformation_Type = {
45252 : PyVarObject_HEAD_INIT(NULL, 0)
45253 : .tp_name = "lsa.lsaRSetForestTrustInformation",
45254 : .tp_getset = py_lsa_lsaRSetForestTrustInformation_getsetters,
45255 : .tp_methods = py_lsa_lsaRSetForestTrustInformation_methods,
45256 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45257 : .tp_new = py_lsa_lsaRSetForestTrustInformation_new,
45258 : };
45259 :
45260 68 : static bool pack_py_lsa_lsaRSetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation *r)
45261 : {
45262 0 : PyObject *py_handle;
45263 0 : PyObject *py_trusted_domain_name;
45264 0 : PyObject *py_highest_record_type;
45265 0 : PyObject *py_forest_trust_info;
45266 0 : PyObject *py_check_only;
45267 68 : const char *kwnames[] = {
45268 : "handle", "trusted_domain_name", "highest_record_type", "forest_trust_info", "check_only", NULL
45269 : };
45270 :
45271 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)) {
45272 0 : return false;
45273 : }
45274 :
45275 68 : if (py_handle == NULL) {
45276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
45277 0 : return false;
45278 : }
45279 68 : r->in.handle = talloc_ptrtype(r, r->in.handle);
45280 68 : if (r->in.handle == NULL) {
45281 0 : PyErr_NoMemory();
45282 0 : return false;
45283 : }
45284 68 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
45285 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
45286 0 : PyErr_NoMemory();
45287 0 : return false;
45288 : }
45289 68 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
45290 68 : if (py_trusted_domain_name == NULL) {
45291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.trusted_domain_name");
45292 0 : return false;
45293 : }
45294 68 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
45295 68 : if (r->in.trusted_domain_name == NULL) {
45296 0 : PyErr_NoMemory();
45297 0 : return false;
45298 : }
45299 68 : PY_CHECK_TYPE(&lsa_StringLarge_Type, py_trusted_domain_name, return false;);
45300 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
45301 0 : PyErr_NoMemory();
45302 0 : return false;
45303 : }
45304 68 : r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
45305 68 : if (py_highest_record_type == NULL) {
45306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.highest_record_type");
45307 0 : return false;
45308 : }
45309 : {
45310 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
45311 68 : if (PyLong_Check(py_highest_record_type)) {
45312 0 : unsigned long long test_var;
45313 68 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
45314 68 : if (PyErr_Occurred() != NULL) {
45315 0 : return false;
45316 : }
45317 68 : if (test_var > uint_max) {
45318 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45319 : PyLong_Type.tp_name, uint_max, test_var);
45320 0 : return false;
45321 : }
45322 68 : r->in.highest_record_type = test_var;
45323 : } else {
45324 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45325 : PyLong_Type.tp_name);
45326 0 : return false;
45327 : }
45328 : }
45329 68 : if (py_forest_trust_info == NULL) {
45330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.forest_trust_info");
45331 0 : return false;
45332 : }
45333 68 : r->in.forest_trust_info = talloc_ptrtype(r, r->in.forest_trust_info);
45334 68 : if (r->in.forest_trust_info == NULL) {
45335 0 : PyErr_NoMemory();
45336 0 : return false;
45337 : }
45338 68 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, py_forest_trust_info, return false;);
45339 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_forest_trust_info)) == NULL) {
45340 0 : PyErr_NoMemory();
45341 0 : return false;
45342 : }
45343 68 : r->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_forest_trust_info);
45344 68 : if (py_check_only == NULL) {
45345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.check_only");
45346 0 : return false;
45347 : }
45348 : {
45349 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.check_only));
45350 68 : if (PyLong_Check(py_check_only)) {
45351 0 : unsigned long long test_var;
45352 68 : test_var = PyLong_AsUnsignedLongLong(py_check_only);
45353 68 : if (PyErr_Occurred() != NULL) {
45354 0 : return false;
45355 : }
45356 68 : if (test_var > uint_max) {
45357 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45358 : PyLong_Type.tp_name, uint_max, test_var);
45359 0 : return false;
45360 : }
45361 68 : r->in.check_only = test_var;
45362 : } else {
45363 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45364 : PyLong_Type.tp_name);
45365 0 : return false;
45366 : }
45367 : }
45368 68 : return true;
45369 : }
45370 :
45371 68 : static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation_args_out(struct lsa_lsaRSetForestTrustInformation *r)
45372 : {
45373 0 : PyObject *result;
45374 0 : PyObject *py_collision_info;
45375 68 : if (*r->out.collision_info == NULL) {
45376 52 : py_collision_info = Py_None;
45377 26 : Py_INCREF(py_collision_info);
45378 : } else {
45379 16 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
45380 : }
45381 68 : result = py_collision_info;
45382 68 : if (NT_STATUS_IS_ERR(r->out.result)) {
45383 0 : PyErr_SetNTSTATUS(r->out.result);
45384 0 : return NULL;
45385 : }
45386 :
45387 68 : return result;
45388 : }
45389 :
45390 :
45391 0 : static PyObject *py_lsa_LookupSids3_in_get_sids(PyObject *obj, void *closure)
45392 : {
45393 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45394 0 : PyObject *py_sids;
45395 0 : if (object->in.sids == NULL) {
45396 0 : Py_RETURN_NONE;
45397 : }
45398 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
45399 0 : return py_sids;
45400 : }
45401 :
45402 0 : static int py_lsa_LookupSids3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
45403 : {
45404 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45405 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
45406 0 : if (value == NULL) {
45407 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
45408 0 : return -1;
45409 : }
45410 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
45411 0 : if (object->in.sids == NULL) {
45412 0 : PyErr_NoMemory();
45413 0 : return -1;
45414 : }
45415 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
45416 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45417 0 : PyErr_NoMemory();
45418 0 : return -1;
45419 : }
45420 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
45421 0 : return 0;
45422 : }
45423 :
45424 0 : static PyObject *py_lsa_LookupSids3_out_get_domains(PyObject *obj, void *closure)
45425 : {
45426 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45427 0 : PyObject *py_domains;
45428 0 : if (object->out.domains == NULL) {
45429 0 : Py_RETURN_NONE;
45430 : }
45431 0 : if (*object->out.domains == NULL) {
45432 0 : py_domains = Py_None;
45433 0 : Py_INCREF(py_domains);
45434 : } else {
45435 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
45436 : }
45437 0 : return py_domains;
45438 : }
45439 :
45440 0 : static int py_lsa_LookupSids3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
45441 : {
45442 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45443 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
45444 0 : if (value == NULL) {
45445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
45446 0 : return -1;
45447 : }
45448 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
45449 0 : if (object->out.domains == NULL) {
45450 0 : PyErr_NoMemory();
45451 0 : return -1;
45452 : }
45453 0 : if (value == Py_None) {
45454 0 : *object->out.domains = NULL;
45455 : } else {
45456 0 : *object->out.domains = NULL;
45457 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
45458 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45459 0 : PyErr_NoMemory();
45460 0 : return -1;
45461 : }
45462 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
45463 : }
45464 0 : return 0;
45465 : }
45466 :
45467 0 : static PyObject *py_lsa_LookupSids3_in_get_names(PyObject *obj, void *closure)
45468 : {
45469 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45470 0 : PyObject *py_names;
45471 0 : if (object->in.names == NULL) {
45472 0 : Py_RETURN_NONE;
45473 : }
45474 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
45475 0 : return py_names;
45476 : }
45477 :
45478 0 : static int py_lsa_LookupSids3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
45479 : {
45480 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45481 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
45482 0 : if (value == NULL) {
45483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
45484 0 : return -1;
45485 : }
45486 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
45487 0 : if (object->in.names == NULL) {
45488 0 : PyErr_NoMemory();
45489 0 : return -1;
45490 : }
45491 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
45492 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45493 0 : PyErr_NoMemory();
45494 0 : return -1;
45495 : }
45496 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
45497 0 : return 0;
45498 : }
45499 :
45500 0 : static PyObject *py_lsa_LookupSids3_out_get_names(PyObject *obj, void *closure)
45501 : {
45502 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45503 0 : PyObject *py_names;
45504 0 : if (object->out.names == NULL) {
45505 0 : Py_RETURN_NONE;
45506 : }
45507 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
45508 0 : return py_names;
45509 : }
45510 :
45511 0 : static int py_lsa_LookupSids3_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
45512 : {
45513 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45514 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
45515 0 : if (value == NULL) {
45516 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
45517 0 : return -1;
45518 : }
45519 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
45520 0 : if (object->out.names == NULL) {
45521 0 : PyErr_NoMemory();
45522 0 : return -1;
45523 : }
45524 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
45525 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45526 0 : PyErr_NoMemory();
45527 0 : return -1;
45528 : }
45529 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
45530 0 : return 0;
45531 : }
45532 :
45533 0 : static PyObject *py_lsa_LookupSids3_in_get_level(PyObject *obj, void *closure)
45534 : {
45535 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45536 0 : PyObject *py_level;
45537 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
45538 0 : return py_level;
45539 : }
45540 :
45541 0 : static int py_lsa_LookupSids3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
45542 : {
45543 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45544 0 : if (value == NULL) {
45545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
45546 0 : return -1;
45547 : }
45548 : {
45549 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
45550 0 : if (PyLong_Check(value)) {
45551 0 : unsigned long long test_var;
45552 0 : test_var = PyLong_AsUnsignedLongLong(value);
45553 0 : if (PyErr_Occurred() != NULL) {
45554 0 : return -1;
45555 : }
45556 0 : if (test_var > uint_max) {
45557 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45558 : PyLong_Type.tp_name, uint_max, test_var);
45559 0 : return -1;
45560 : }
45561 0 : object->in.level = test_var;
45562 : } else {
45563 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45564 : PyLong_Type.tp_name);
45565 0 : return -1;
45566 : }
45567 : }
45568 0 : return 0;
45569 : }
45570 :
45571 0 : static PyObject *py_lsa_LookupSids3_in_get_count(PyObject *obj, void *closure)
45572 : {
45573 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45574 0 : PyObject *py_count;
45575 0 : if (object->in.count == NULL) {
45576 0 : Py_RETURN_NONE;
45577 : }
45578 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
45579 0 : return py_count;
45580 : }
45581 :
45582 0 : static int py_lsa_LookupSids3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
45583 : {
45584 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45585 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
45586 0 : if (value == NULL) {
45587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
45588 0 : return -1;
45589 : }
45590 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
45591 0 : if (object->in.count == NULL) {
45592 0 : PyErr_NoMemory();
45593 0 : return -1;
45594 : }
45595 : {
45596 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
45597 0 : if (PyLong_Check(value)) {
45598 0 : unsigned long long test_var;
45599 0 : test_var = PyLong_AsUnsignedLongLong(value);
45600 0 : if (PyErr_Occurred() != NULL) {
45601 0 : return -1;
45602 : }
45603 0 : if (test_var > uint_max) {
45604 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45605 : PyLong_Type.tp_name, uint_max, test_var);
45606 0 : return -1;
45607 : }
45608 0 : *object->in.count = test_var;
45609 : } else {
45610 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45611 : PyLong_Type.tp_name);
45612 0 : return -1;
45613 : }
45614 : }
45615 0 : return 0;
45616 : }
45617 :
45618 0 : static PyObject *py_lsa_LookupSids3_out_get_count(PyObject *obj, void *closure)
45619 : {
45620 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45621 0 : PyObject *py_count;
45622 0 : if (object->out.count == NULL) {
45623 0 : Py_RETURN_NONE;
45624 : }
45625 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
45626 0 : return py_count;
45627 : }
45628 :
45629 0 : static int py_lsa_LookupSids3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
45630 : {
45631 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45632 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
45633 0 : if (value == NULL) {
45634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
45635 0 : return -1;
45636 : }
45637 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
45638 0 : if (object->out.count == NULL) {
45639 0 : PyErr_NoMemory();
45640 0 : return -1;
45641 : }
45642 : {
45643 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
45644 0 : if (PyLong_Check(value)) {
45645 0 : unsigned long long test_var;
45646 0 : test_var = PyLong_AsUnsignedLongLong(value);
45647 0 : if (PyErr_Occurred() != NULL) {
45648 0 : return -1;
45649 : }
45650 0 : if (test_var > uint_max) {
45651 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45652 : PyLong_Type.tp_name, uint_max, test_var);
45653 0 : return -1;
45654 : }
45655 0 : *object->out.count = test_var;
45656 : } else {
45657 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45658 : PyLong_Type.tp_name);
45659 0 : return -1;
45660 : }
45661 : }
45662 0 : return 0;
45663 : }
45664 :
45665 0 : static PyObject *py_lsa_LookupSids3_in_get_lookup_options(PyObject *obj, void *closure)
45666 : {
45667 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45668 0 : PyObject *py_lookup_options;
45669 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
45670 0 : return py_lookup_options;
45671 : }
45672 :
45673 0 : static int py_lsa_LookupSids3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
45674 : {
45675 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45676 0 : if (value == NULL) {
45677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
45678 0 : return -1;
45679 : }
45680 : {
45681 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
45682 0 : if (PyLong_Check(value)) {
45683 0 : unsigned long long test_var;
45684 0 : test_var = PyLong_AsUnsignedLongLong(value);
45685 0 : if (PyErr_Occurred() != NULL) {
45686 0 : return -1;
45687 : }
45688 0 : if (test_var > uint_max) {
45689 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45690 : PyLong_Type.tp_name, uint_max, test_var);
45691 0 : return -1;
45692 : }
45693 0 : object->in.lookup_options = test_var;
45694 : } else {
45695 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45696 : PyLong_Type.tp_name);
45697 0 : return -1;
45698 : }
45699 : }
45700 0 : return 0;
45701 : }
45702 :
45703 0 : static PyObject *py_lsa_LookupSids3_in_get_client_revision(PyObject *obj, void *closure)
45704 : {
45705 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45706 0 : PyObject *py_client_revision;
45707 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
45708 0 : return py_client_revision;
45709 : }
45710 :
45711 0 : static int py_lsa_LookupSids3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
45712 : {
45713 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45714 0 : if (value == NULL) {
45715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
45716 0 : return -1;
45717 : }
45718 : {
45719 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
45720 0 : if (PyLong_Check(value)) {
45721 0 : unsigned long long test_var;
45722 0 : test_var = PyLong_AsUnsignedLongLong(value);
45723 0 : if (PyErr_Occurred() != NULL) {
45724 0 : return -1;
45725 : }
45726 0 : if (test_var > uint_max) {
45727 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45728 : PyLong_Type.tp_name, uint_max, test_var);
45729 0 : return -1;
45730 : }
45731 0 : object->in.client_revision = test_var;
45732 : } else {
45733 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45734 : PyLong_Type.tp_name);
45735 0 : return -1;
45736 : }
45737 : }
45738 0 : return 0;
45739 : }
45740 :
45741 0 : static PyObject *py_lsa_LookupSids3_get_result(PyObject *obj, void *closure)
45742 : {
45743 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(obj);
45744 0 : PyObject *py_result;
45745 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45746 0 : return py_result;
45747 : }
45748 :
45749 0 : static int py_lsa_LookupSids3_set_result(PyObject *py_obj, PyObject *value, void *closure)
45750 : {
45751 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45752 0 : if (value == NULL) {
45753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45754 0 : return -1;
45755 : }
45756 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45757 0 : return 0;
45758 : }
45759 :
45760 : static PyGetSetDef py_lsa_LookupSids3_getsetters[] = {
45761 : {
45762 : .name = discard_const_p(char, "in_sids"),
45763 : .get = py_lsa_LookupSids3_in_get_sids,
45764 : .set = py_lsa_LookupSids3_in_set_sids,
45765 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
45766 : },
45767 : {
45768 : .name = discard_const_p(char, "out_domains"),
45769 : .get = py_lsa_LookupSids3_out_get_domains,
45770 : .set = py_lsa_LookupSids3_out_set_domains,
45771 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
45772 : },
45773 : {
45774 : .name = discard_const_p(char, "in_names"),
45775 : .get = py_lsa_LookupSids3_in_get_names,
45776 : .set = py_lsa_LookupSids3_in_set_names,
45777 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
45778 : },
45779 : {
45780 : .name = discard_const_p(char, "out_names"),
45781 : .get = py_lsa_LookupSids3_out_get_names,
45782 : .set = py_lsa_LookupSids3_out_set_names,
45783 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
45784 : },
45785 : {
45786 : .name = discard_const_p(char, "in_level"),
45787 : .get = py_lsa_LookupSids3_in_get_level,
45788 : .set = py_lsa_LookupSids3_in_set_level,
45789 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
45790 : },
45791 : {
45792 : .name = discard_const_p(char, "in_count"),
45793 : .get = py_lsa_LookupSids3_in_get_count,
45794 : .set = py_lsa_LookupSids3_in_set_count,
45795 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45796 : },
45797 : {
45798 : .name = discard_const_p(char, "out_count"),
45799 : .get = py_lsa_LookupSids3_out_get_count,
45800 : .set = py_lsa_LookupSids3_out_set_count,
45801 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
45802 : },
45803 : {
45804 : .name = discard_const_p(char, "in_lookup_options"),
45805 : .get = py_lsa_LookupSids3_in_get_lookup_options,
45806 : .set = py_lsa_LookupSids3_in_set_lookup_options,
45807 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
45808 : },
45809 : {
45810 : .name = discard_const_p(char, "in_client_revision"),
45811 : .get = py_lsa_LookupSids3_in_get_client_revision,
45812 : .set = py_lsa_LookupSids3_in_set_client_revision,
45813 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
45814 : },
45815 : {
45816 : .name = discard_const_p(char, "result"),
45817 : .get = py_lsa_LookupSids3_get_result,
45818 : .set = py_lsa_LookupSids3_set_result,
45819 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
45820 : },
45821 : { .name = NULL }
45822 : };
45823 :
45824 0 : static PyObject *py_lsa_LookupSids3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45825 : {
45826 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids3, type);
45827 0 : struct lsa_LookupSids3 *_self = (struct lsa_LookupSids3 *)pytalloc_get_ptr(self);
45828 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45829 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
45830 : /* a pointer to a NULL pointer */
45831 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
45832 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
45833 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
45834 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
45835 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
45836 0 : return self;
45837 : }
45838 :
45839 0 : static PyObject *py_lsa_LookupSids3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45840 : {
45841 :
45842 :
45843 0 : return PyLong_FromLong(76);
45844 : }
45845 :
45846 0 : static PyObject *py_lsa_LookupSids3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
45847 : {
45848 0 : const struct ndr_interface_call *call = NULL;
45849 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45850 0 : PyObject *ret = NULL;
45851 0 : struct ndr_push *push = NULL;
45852 0 : DATA_BLOB blob;
45853 0 : enum ndr_err_code err;
45854 :
45855 0 : if (ndr_table_lsarpc.num_calls < 77) {
45856 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_pack");
45857 0 : return NULL;
45858 : }
45859 0 : call = &ndr_table_lsarpc.calls[76];
45860 :
45861 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45862 0 : if (push == NULL) {
45863 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45864 0 : return NULL;
45865 : }
45866 :
45867 0 : push->flags |= ndr_push_flags;
45868 :
45869 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45870 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45871 0 : TALLOC_FREE(push);
45872 0 : PyErr_SetNdrError(err);
45873 0 : return NULL;
45874 : }
45875 0 : blob = ndr_push_blob(push);
45876 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45877 0 : TALLOC_FREE(push);
45878 0 : return ret;
45879 : }
45880 :
45881 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45882 : {
45883 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45884 0 : PyObject *bigendian_obj = NULL;
45885 0 : PyObject *ndr64_obj = NULL;
45886 0 : libndr_flags ndr_push_flags = 0;
45887 :
45888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45889 : discard_const_p(char *, kwnames),
45890 : &bigendian_obj,
45891 : &ndr64_obj)) {
45892 0 : return NULL;
45893 : }
45894 :
45895 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45896 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45897 : }
45898 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45899 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45900 : }
45901 :
45902 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45903 : }
45904 :
45905 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45906 : {
45907 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45908 0 : PyObject *bigendian_obj = NULL;
45909 0 : PyObject *ndr64_obj = NULL;
45910 0 : libndr_flags ndr_push_flags = 0;
45911 :
45912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45913 : discard_const_p(char *, kwnames),
45914 : &bigendian_obj,
45915 : &ndr64_obj)) {
45916 0 : return NULL;
45917 : }
45918 :
45919 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45920 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45921 : }
45922 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45923 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45924 : }
45925 :
45926 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45927 : }
45928 :
45929 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
45930 : {
45931 0 : const struct ndr_interface_call *call = NULL;
45932 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
45933 0 : struct ndr_pull *pull = NULL;
45934 0 : enum ndr_err_code err;
45935 :
45936 0 : if (ndr_table_lsarpc.num_calls < 77) {
45937 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_unpack");
45938 0 : return NULL;
45939 : }
45940 0 : call = &ndr_table_lsarpc.calls[76];
45941 :
45942 0 : pull = ndr_pull_init_blob(blob, object);
45943 0 : if (pull == NULL) {
45944 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45945 0 : return NULL;
45946 : }
45947 :
45948 0 : pull->flags |= ndr_pull_flags;
45949 :
45950 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45951 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45952 0 : TALLOC_FREE(pull);
45953 0 : PyErr_SetNdrError(err);
45954 0 : return NULL;
45955 : }
45956 0 : if (!allow_remaining) {
45957 0 : uint32_t highest_ofs;
45958 :
45959 0 : if (pull->offset > pull->relative_highest_offset) {
45960 0 : highest_ofs = pull->offset;
45961 : } else {
45962 0 : highest_ofs = pull->relative_highest_offset;
45963 : }
45964 0 : if (highest_ofs < pull->data_size) {
45965 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45966 : "not all bytes consumed ofs[%u] size[%u]",
45967 : highest_ofs, pull->data_size);
45968 0 : TALLOC_FREE(pull);
45969 0 : PyErr_SetNdrError(err);
45970 0 : return NULL;
45971 : }
45972 : }
45973 :
45974 0 : TALLOC_FREE(pull);
45975 0 : Py_RETURN_NONE;
45976 : }
45977 :
45978 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45979 : {
45980 0 : DATA_BLOB blob;
45981 0 : Py_ssize_t blob_length = 0;
45982 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45983 0 : PyObject *bigendian_obj = NULL;
45984 0 : PyObject *ndr64_obj = NULL;
45985 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45986 0 : PyObject *allow_remaining_obj = NULL;
45987 0 : bool allow_remaining = false;
45988 :
45989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45990 : discard_const_p(char *, kwnames),
45991 : &blob.data, &blob_length,
45992 : &bigendian_obj,
45993 : &ndr64_obj,
45994 : &allow_remaining_obj)) {
45995 0 : return NULL;
45996 : }
45997 0 : blob.length = blob_length;
45998 :
45999 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46000 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46001 : }
46002 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46003 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46004 : }
46005 :
46006 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46007 0 : allow_remaining = true;
46008 : }
46009 :
46010 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46011 : }
46012 :
46013 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46014 : {
46015 0 : DATA_BLOB blob;
46016 0 : Py_ssize_t blob_length = 0;
46017 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46018 0 : PyObject *bigendian_obj = NULL;
46019 0 : PyObject *ndr64_obj = NULL;
46020 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46021 0 : PyObject *allow_remaining_obj = NULL;
46022 0 : bool allow_remaining = false;
46023 :
46024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46025 : discard_const_p(char *, kwnames),
46026 : &blob.data, &blob_length,
46027 : &bigendian_obj,
46028 : &ndr64_obj,
46029 : &allow_remaining_obj)) {
46030 0 : return NULL;
46031 : }
46032 0 : blob.length = blob_length;
46033 :
46034 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46035 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46036 : }
46037 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46038 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46039 : }
46040 :
46041 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46042 0 : allow_remaining = true;
46043 : }
46044 :
46045 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46046 : }
46047 :
46048 0 : static PyObject *py_lsa_LookupSids3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46049 : {
46050 0 : const struct ndr_interface_call *call = NULL;
46051 0 : struct lsa_LookupSids3 *object = (struct lsa_LookupSids3 *)pytalloc_get_ptr(py_obj);
46052 0 : PyObject *ret;
46053 0 : char *retstr;
46054 :
46055 0 : if (ndr_table_lsarpc.num_calls < 77) {
46056 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_print");
46057 0 : return NULL;
46058 : }
46059 0 : call = &ndr_table_lsarpc.calls[76];
46060 :
46061 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46062 0 : ret = PyUnicode_FromString(retstr);
46063 0 : TALLOC_FREE(retstr);
46064 :
46065 0 : return ret;
46066 : }
46067 :
46068 0 : static PyObject *py_lsa_LookupSids3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46069 : {
46070 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_in", NDR_IN);
46071 : }
46072 :
46073 0 : static PyObject *py_lsa_LookupSids3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46074 : {
46075 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_out", NDR_OUT);
46076 : }
46077 :
46078 : static PyMethodDef py_lsa_LookupSids3_methods[] = {
46079 : { "opnum", (PyCFunction)py_lsa_LookupSids3_ndr_opnum, METH_NOARGS|METH_CLASS,
46080 : "lsa.LookupSids3.opnum() -> 76 (0x4c) " },
46081 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46082 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46083 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46084 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46085 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46086 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46087 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46088 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46089 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46090 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46091 : { NULL, NULL, 0, NULL }
46092 : };
46093 :
46094 :
46095 : static PyTypeObject lsa_LookupSids3_Type = {
46096 : PyVarObject_HEAD_INIT(NULL, 0)
46097 : .tp_name = "lsa.LookupSids3",
46098 : .tp_getset = py_lsa_LookupSids3_getsetters,
46099 : .tp_methods = py_lsa_LookupSids3_methods,
46100 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46101 : .tp_new = py_lsa_LookupSids3_new,
46102 : };
46103 :
46104 9 : static bool pack_py_lsa_LookupSids3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids3 *r)
46105 : {
46106 0 : PyObject *py_sids;
46107 0 : PyObject *py_names;
46108 0 : PyObject *py_level;
46109 0 : PyObject *py_count;
46110 0 : PyObject *py_lookup_options;
46111 0 : PyObject *py_client_revision;
46112 9 : const char *kwnames[] = {
46113 : "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
46114 : };
46115 :
46116 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)) {
46117 0 : return false;
46118 : }
46119 :
46120 9 : if (py_sids == NULL) {
46121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
46122 0 : return false;
46123 : }
46124 9 : r->in.sids = talloc_ptrtype(r, r->in.sids);
46125 9 : if (r->in.sids == NULL) {
46126 0 : PyErr_NoMemory();
46127 0 : return false;
46128 : }
46129 9 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
46130 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
46131 0 : PyErr_NoMemory();
46132 0 : return false;
46133 : }
46134 9 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
46135 9 : if (py_names == NULL) {
46136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
46137 0 : return false;
46138 : }
46139 9 : r->in.names = talloc_ptrtype(r, r->in.names);
46140 9 : if (r->in.names == NULL) {
46141 0 : PyErr_NoMemory();
46142 0 : return false;
46143 : }
46144 9 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
46145 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
46146 0 : PyErr_NoMemory();
46147 0 : return false;
46148 : }
46149 9 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
46150 9 : if (py_level == NULL) {
46151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
46152 0 : return false;
46153 : }
46154 : {
46155 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
46156 9 : if (PyLong_Check(py_level)) {
46157 0 : unsigned long long test_var;
46158 9 : test_var = PyLong_AsUnsignedLongLong(py_level);
46159 9 : if (PyErr_Occurred() != NULL) {
46160 0 : return false;
46161 : }
46162 9 : if (test_var > uint_max) {
46163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46164 : PyLong_Type.tp_name, uint_max, test_var);
46165 0 : return false;
46166 : }
46167 9 : r->in.level = test_var;
46168 : } else {
46169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46170 : PyLong_Type.tp_name);
46171 0 : return false;
46172 : }
46173 : }
46174 9 : if (py_count == NULL) {
46175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
46176 0 : return false;
46177 : }
46178 9 : r->in.count = talloc_ptrtype(r, r->in.count);
46179 9 : if (r->in.count == NULL) {
46180 0 : PyErr_NoMemory();
46181 0 : return false;
46182 : }
46183 : {
46184 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
46185 9 : if (PyLong_Check(py_count)) {
46186 0 : unsigned long long test_var;
46187 9 : test_var = PyLong_AsUnsignedLongLong(py_count);
46188 9 : if (PyErr_Occurred() != NULL) {
46189 0 : return false;
46190 : }
46191 9 : if (test_var > uint_max) {
46192 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46193 : PyLong_Type.tp_name, uint_max, test_var);
46194 0 : return false;
46195 : }
46196 9 : *r->in.count = test_var;
46197 : } else {
46198 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46199 : PyLong_Type.tp_name);
46200 0 : return false;
46201 : }
46202 : }
46203 9 : if (py_lookup_options == NULL) {
46204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
46205 0 : return false;
46206 : }
46207 : {
46208 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
46209 9 : if (PyLong_Check(py_lookup_options)) {
46210 0 : unsigned long long test_var;
46211 9 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
46212 9 : if (PyErr_Occurred() != NULL) {
46213 0 : return false;
46214 : }
46215 9 : if (test_var > uint_max) {
46216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46217 : PyLong_Type.tp_name, uint_max, test_var);
46218 0 : return false;
46219 : }
46220 9 : r->in.lookup_options = test_var;
46221 : } else {
46222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46223 : PyLong_Type.tp_name);
46224 0 : return false;
46225 : }
46226 : }
46227 9 : if (py_client_revision == NULL) {
46228 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
46229 0 : return false;
46230 : }
46231 : {
46232 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
46233 9 : if (PyLong_Check(py_client_revision)) {
46234 0 : unsigned long long test_var;
46235 9 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
46236 9 : if (PyErr_Occurred() != NULL) {
46237 0 : return false;
46238 : }
46239 9 : if (test_var > uint_max) {
46240 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46241 : PyLong_Type.tp_name, uint_max, test_var);
46242 0 : return false;
46243 : }
46244 9 : r->in.client_revision = test_var;
46245 : } else {
46246 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46247 : PyLong_Type.tp_name);
46248 0 : return false;
46249 : }
46250 : }
46251 9 : return true;
46252 : }
46253 :
46254 8 : static PyObject *unpack_py_lsa_LookupSids3_args_out(struct lsa_LookupSids3 *r)
46255 : {
46256 0 : PyObject *result;
46257 0 : PyObject *py_domains;
46258 0 : PyObject *py_names;
46259 0 : PyObject *py_count;
46260 8 : result = PyTuple_New(3);
46261 8 : if (*r->out.domains == NULL) {
46262 0 : py_domains = Py_None;
46263 0 : Py_INCREF(py_domains);
46264 : } else {
46265 8 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
46266 : }
46267 8 : PyTuple_SetItem(result, 0, py_domains);
46268 8 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
46269 8 : PyTuple_SetItem(result, 1, py_names);
46270 8 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
46271 8 : PyTuple_SetItem(result, 2, py_count);
46272 8 : if (NT_STATUS_IS_ERR(r->out.result)) {
46273 0 : PyErr_SetNTSTATUS(r->out.result);
46274 0 : return NULL;
46275 : }
46276 :
46277 8 : return result;
46278 : }
46279 :
46280 :
46281 0 : static PyObject *py_lsa_LookupNames4_in_get_num_names(PyObject *obj, void *closure)
46282 : {
46283 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46284 0 : PyObject *py_num_names;
46285 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
46286 0 : return py_num_names;
46287 : }
46288 :
46289 0 : static int py_lsa_LookupNames4_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
46290 : {
46291 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46292 0 : if (value == NULL) {
46293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
46294 0 : return -1;
46295 : }
46296 : {
46297 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
46298 0 : if (PyLong_Check(value)) {
46299 0 : unsigned long long test_var;
46300 0 : test_var = PyLong_AsUnsignedLongLong(value);
46301 0 : if (PyErr_Occurred() != NULL) {
46302 0 : return -1;
46303 : }
46304 0 : if (test_var > uint_max) {
46305 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46306 : PyLong_Type.tp_name, uint_max, test_var);
46307 0 : return -1;
46308 : }
46309 0 : object->in.num_names = test_var;
46310 : } else {
46311 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46312 : PyLong_Type.tp_name);
46313 0 : return -1;
46314 : }
46315 : }
46316 0 : return 0;
46317 : }
46318 :
46319 0 : static PyObject *py_lsa_LookupNames4_in_get_names(PyObject *obj, void *closure)
46320 : {
46321 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46322 0 : PyObject *py_names;
46323 0 : py_names = PyList_New(object->in.num_names);
46324 0 : if (py_names == NULL) {
46325 0 : return NULL;
46326 : }
46327 : {
46328 : int names_cntr_0;
46329 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
46330 0 : PyObject *py_names_0;
46331 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
46332 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
46333 : }
46334 : }
46335 0 : return py_names;
46336 : }
46337 :
46338 0 : static int py_lsa_LookupNames4_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
46339 : {
46340 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46341 0 : if (value == NULL) {
46342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
46343 0 : return -1;
46344 : }
46345 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
46346 : {
46347 0 : int names_cntr_0;
46348 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
46349 0 : if (!object->in.names) { return -1; }
46350 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
46351 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
46352 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
46353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
46354 0 : return -1;
46355 : }
46356 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
46357 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
46358 0 : PyErr_NoMemory();
46359 0 : return -1;
46360 : }
46361 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
46362 : }
46363 : }
46364 0 : return 0;
46365 : }
46366 :
46367 0 : static PyObject *py_lsa_LookupNames4_out_get_domains(PyObject *obj, void *closure)
46368 : {
46369 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46370 0 : PyObject *py_domains;
46371 0 : if (object->out.domains == NULL) {
46372 0 : Py_RETURN_NONE;
46373 : }
46374 0 : if (*object->out.domains == NULL) {
46375 0 : py_domains = Py_None;
46376 0 : Py_INCREF(py_domains);
46377 : } else {
46378 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
46379 : }
46380 0 : return py_domains;
46381 : }
46382 :
46383 0 : static int py_lsa_LookupNames4_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
46384 : {
46385 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46386 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
46387 0 : if (value == NULL) {
46388 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domains");
46389 0 : return -1;
46390 : }
46391 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
46392 0 : if (object->out.domains == NULL) {
46393 0 : PyErr_NoMemory();
46394 0 : return -1;
46395 : }
46396 0 : if (value == Py_None) {
46397 0 : *object->out.domains = NULL;
46398 : } else {
46399 0 : *object->out.domains = NULL;
46400 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
46401 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46402 0 : PyErr_NoMemory();
46403 0 : return -1;
46404 : }
46405 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
46406 : }
46407 0 : return 0;
46408 : }
46409 :
46410 0 : static PyObject *py_lsa_LookupNames4_in_get_sids(PyObject *obj, void *closure)
46411 : {
46412 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46413 0 : PyObject *py_sids;
46414 0 : if (object->in.sids == NULL) {
46415 0 : Py_RETURN_NONE;
46416 : }
46417 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
46418 0 : return py_sids;
46419 : }
46420 :
46421 0 : static int py_lsa_LookupNames4_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
46422 : {
46423 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46424 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
46425 0 : if (value == NULL) {
46426 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
46427 0 : return -1;
46428 : }
46429 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
46430 0 : if (object->in.sids == NULL) {
46431 0 : PyErr_NoMemory();
46432 0 : return -1;
46433 : }
46434 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
46435 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46436 0 : PyErr_NoMemory();
46437 0 : return -1;
46438 : }
46439 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
46440 0 : return 0;
46441 : }
46442 :
46443 0 : static PyObject *py_lsa_LookupNames4_out_get_sids(PyObject *obj, void *closure)
46444 : {
46445 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46446 0 : PyObject *py_sids;
46447 0 : if (object->out.sids == NULL) {
46448 0 : Py_RETURN_NONE;
46449 : }
46450 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
46451 0 : return py_sids;
46452 : }
46453 :
46454 0 : static int py_lsa_LookupNames4_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
46455 : {
46456 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46457 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
46458 0 : if (value == NULL) {
46459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
46460 0 : return -1;
46461 : }
46462 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
46463 0 : if (object->out.sids == NULL) {
46464 0 : PyErr_NoMemory();
46465 0 : return -1;
46466 : }
46467 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
46468 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46469 0 : PyErr_NoMemory();
46470 0 : return -1;
46471 : }
46472 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
46473 0 : return 0;
46474 : }
46475 :
46476 0 : static PyObject *py_lsa_LookupNames4_in_get_level(PyObject *obj, void *closure)
46477 : {
46478 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46479 0 : PyObject *py_level;
46480 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
46481 0 : return py_level;
46482 : }
46483 :
46484 0 : static int py_lsa_LookupNames4_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
46485 : {
46486 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46487 0 : if (value == NULL) {
46488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
46489 0 : return -1;
46490 : }
46491 : {
46492 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
46493 0 : if (PyLong_Check(value)) {
46494 0 : unsigned long long test_var;
46495 0 : test_var = PyLong_AsUnsignedLongLong(value);
46496 0 : if (PyErr_Occurred() != NULL) {
46497 0 : return -1;
46498 : }
46499 0 : if (test_var > uint_max) {
46500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46501 : PyLong_Type.tp_name, uint_max, test_var);
46502 0 : return -1;
46503 : }
46504 0 : object->in.level = test_var;
46505 : } else {
46506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46507 : PyLong_Type.tp_name);
46508 0 : return -1;
46509 : }
46510 : }
46511 0 : return 0;
46512 : }
46513 :
46514 0 : static PyObject *py_lsa_LookupNames4_in_get_count(PyObject *obj, void *closure)
46515 : {
46516 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46517 0 : PyObject *py_count;
46518 0 : if (object->in.count == NULL) {
46519 0 : Py_RETURN_NONE;
46520 : }
46521 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->in.count);
46522 0 : return py_count;
46523 : }
46524 :
46525 0 : static int py_lsa_LookupNames4_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
46526 : {
46527 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46528 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
46529 0 : if (value == NULL) {
46530 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.count");
46531 0 : return -1;
46532 : }
46533 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
46534 0 : if (object->in.count == NULL) {
46535 0 : PyErr_NoMemory();
46536 0 : return -1;
46537 : }
46538 : {
46539 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
46540 0 : if (PyLong_Check(value)) {
46541 0 : unsigned long long test_var;
46542 0 : test_var = PyLong_AsUnsignedLongLong(value);
46543 0 : if (PyErr_Occurred() != NULL) {
46544 0 : return -1;
46545 : }
46546 0 : if (test_var > uint_max) {
46547 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46548 : PyLong_Type.tp_name, uint_max, test_var);
46549 0 : return -1;
46550 : }
46551 0 : *object->in.count = test_var;
46552 : } else {
46553 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46554 : PyLong_Type.tp_name);
46555 0 : return -1;
46556 : }
46557 : }
46558 0 : return 0;
46559 : }
46560 :
46561 0 : static PyObject *py_lsa_LookupNames4_out_get_count(PyObject *obj, void *closure)
46562 : {
46563 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46564 0 : PyObject *py_count;
46565 0 : if (object->out.count == NULL) {
46566 0 : Py_RETURN_NONE;
46567 : }
46568 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*object->out.count);
46569 0 : return py_count;
46570 : }
46571 :
46572 0 : static int py_lsa_LookupNames4_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
46573 : {
46574 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46575 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
46576 0 : if (value == NULL) {
46577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.count");
46578 0 : return -1;
46579 : }
46580 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
46581 0 : if (object->out.count == NULL) {
46582 0 : PyErr_NoMemory();
46583 0 : return -1;
46584 : }
46585 : {
46586 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
46587 0 : if (PyLong_Check(value)) {
46588 0 : unsigned long long test_var;
46589 0 : test_var = PyLong_AsUnsignedLongLong(value);
46590 0 : if (PyErr_Occurred() != NULL) {
46591 0 : return -1;
46592 : }
46593 0 : if (test_var > uint_max) {
46594 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46595 : PyLong_Type.tp_name, uint_max, test_var);
46596 0 : return -1;
46597 : }
46598 0 : *object->out.count = test_var;
46599 : } else {
46600 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46601 : PyLong_Type.tp_name);
46602 0 : return -1;
46603 : }
46604 : }
46605 0 : return 0;
46606 : }
46607 :
46608 0 : static PyObject *py_lsa_LookupNames4_in_get_lookup_options(PyObject *obj, void *closure)
46609 : {
46610 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46611 0 : PyObject *py_lookup_options;
46612 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)object->in.lookup_options);
46613 0 : return py_lookup_options;
46614 : }
46615 :
46616 0 : static int py_lsa_LookupNames4_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
46617 : {
46618 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46619 0 : if (value == NULL) {
46620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lookup_options");
46621 0 : return -1;
46622 : }
46623 : {
46624 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
46625 0 : if (PyLong_Check(value)) {
46626 0 : unsigned long long test_var;
46627 0 : test_var = PyLong_AsUnsignedLongLong(value);
46628 0 : if (PyErr_Occurred() != NULL) {
46629 0 : return -1;
46630 : }
46631 0 : if (test_var > uint_max) {
46632 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46633 : PyLong_Type.tp_name, uint_max, test_var);
46634 0 : return -1;
46635 : }
46636 0 : object->in.lookup_options = test_var;
46637 : } else {
46638 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46639 : PyLong_Type.tp_name);
46640 0 : return -1;
46641 : }
46642 : }
46643 0 : return 0;
46644 : }
46645 :
46646 0 : static PyObject *py_lsa_LookupNames4_in_get_client_revision(PyObject *obj, void *closure)
46647 : {
46648 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46649 0 : PyObject *py_client_revision;
46650 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_revision);
46651 0 : return py_client_revision;
46652 : }
46653 :
46654 0 : static int py_lsa_LookupNames4_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
46655 : {
46656 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46657 0 : if (value == NULL) {
46658 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_revision");
46659 0 : return -1;
46660 : }
46661 : {
46662 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
46663 0 : if (PyLong_Check(value)) {
46664 0 : unsigned long long test_var;
46665 0 : test_var = PyLong_AsUnsignedLongLong(value);
46666 0 : if (PyErr_Occurred() != NULL) {
46667 0 : return -1;
46668 : }
46669 0 : if (test_var > uint_max) {
46670 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46671 : PyLong_Type.tp_name, uint_max, test_var);
46672 0 : return -1;
46673 : }
46674 0 : object->in.client_revision = test_var;
46675 : } else {
46676 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46677 : PyLong_Type.tp_name);
46678 0 : return -1;
46679 : }
46680 : }
46681 0 : return 0;
46682 : }
46683 :
46684 0 : static PyObject *py_lsa_LookupNames4_get_result(PyObject *obj, void *closure)
46685 : {
46686 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(obj);
46687 0 : PyObject *py_result;
46688 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
46689 0 : return py_result;
46690 : }
46691 :
46692 0 : static int py_lsa_LookupNames4_set_result(PyObject *py_obj, PyObject *value, void *closure)
46693 : {
46694 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46695 0 : if (value == NULL) {
46696 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
46697 0 : return -1;
46698 : }
46699 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
46700 0 : return 0;
46701 : }
46702 :
46703 : static PyGetSetDef py_lsa_LookupNames4_getsetters[] = {
46704 : {
46705 : .name = discard_const_p(char, "in_num_names"),
46706 : .get = py_lsa_LookupNames4_in_get_num_names,
46707 : .set = py_lsa_LookupNames4_in_set_num_names,
46708 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46709 : },
46710 : {
46711 : .name = discard_const_p(char, "in_names"),
46712 : .get = py_lsa_LookupNames4_in_get_names,
46713 : .set = py_lsa_LookupNames4_in_set_names,
46714 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
46715 : },
46716 : {
46717 : .name = discard_const_p(char, "out_domains"),
46718 : .get = py_lsa_LookupNames4_out_get_domains,
46719 : .set = py_lsa_LookupNames4_out_set_domains,
46720 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
46721 : },
46722 : {
46723 : .name = discard_const_p(char, "in_sids"),
46724 : .get = py_lsa_LookupNames4_in_get_sids,
46725 : .set = py_lsa_LookupNames4_in_set_sids,
46726 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
46727 : },
46728 : {
46729 : .name = discard_const_p(char, "out_sids"),
46730 : .get = py_lsa_LookupNames4_out_get_sids,
46731 : .set = py_lsa_LookupNames4_out_set_sids,
46732 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
46733 : },
46734 : {
46735 : .name = discard_const_p(char, "in_level"),
46736 : .get = py_lsa_LookupNames4_in_get_level,
46737 : .set = py_lsa_LookupNames4_in_set_level,
46738 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
46739 : },
46740 : {
46741 : .name = discard_const_p(char, "in_count"),
46742 : .get = py_lsa_LookupNames4_in_get_count,
46743 : .set = py_lsa_LookupNames4_in_set_count,
46744 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46745 : },
46746 : {
46747 : .name = discard_const_p(char, "out_count"),
46748 : .get = py_lsa_LookupNames4_out_get_count,
46749 : .set = py_lsa_LookupNames4_out_set_count,
46750 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46751 : },
46752 : {
46753 : .name = discard_const_p(char, "in_lookup_options"),
46754 : .get = py_lsa_LookupNames4_in_get_lookup_options,
46755 : .set = py_lsa_LookupNames4_in_set_lookup_options,
46756 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
46757 : },
46758 : {
46759 : .name = discard_const_p(char, "in_client_revision"),
46760 : .get = py_lsa_LookupNames4_in_get_client_revision,
46761 : .set = py_lsa_LookupNames4_in_set_client_revision,
46762 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
46763 : },
46764 : {
46765 : .name = discard_const_p(char, "result"),
46766 : .get = py_lsa_LookupNames4_get_result,
46767 : .set = py_lsa_LookupNames4_set_result,
46768 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
46769 : },
46770 : { .name = NULL }
46771 : };
46772 :
46773 0 : static PyObject *py_lsa_LookupNames4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46774 : {
46775 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames4, type);
46776 0 : struct lsa_LookupNames4 *_self = (struct lsa_LookupNames4 *)pytalloc_get_ptr(self);
46777 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46778 : /* a pointer to a NULL pointer */
46779 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
46780 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
46781 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
46782 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
46783 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
46784 0 : return self;
46785 : }
46786 :
46787 0 : static PyObject *py_lsa_LookupNames4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46788 : {
46789 :
46790 :
46791 0 : return PyLong_FromLong(77);
46792 : }
46793 :
46794 0 : static PyObject *py_lsa_LookupNames4_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
46795 : {
46796 0 : const struct ndr_interface_call *call = NULL;
46797 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46798 0 : PyObject *ret = NULL;
46799 0 : struct ndr_push *push = NULL;
46800 0 : DATA_BLOB blob;
46801 0 : enum ndr_err_code err;
46802 :
46803 0 : if (ndr_table_lsarpc.num_calls < 78) {
46804 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_pack");
46805 0 : return NULL;
46806 : }
46807 0 : call = &ndr_table_lsarpc.calls[77];
46808 :
46809 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46810 0 : if (push == NULL) {
46811 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46812 0 : return NULL;
46813 : }
46814 :
46815 0 : push->flags |= ndr_push_flags;
46816 :
46817 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46818 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46819 0 : TALLOC_FREE(push);
46820 0 : PyErr_SetNdrError(err);
46821 0 : return NULL;
46822 : }
46823 0 : blob = ndr_push_blob(push);
46824 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46825 0 : TALLOC_FREE(push);
46826 0 : return ret;
46827 : }
46828 :
46829 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46830 : {
46831 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46832 0 : PyObject *bigendian_obj = NULL;
46833 0 : PyObject *ndr64_obj = NULL;
46834 0 : libndr_flags ndr_push_flags = 0;
46835 :
46836 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46837 : discard_const_p(char *, kwnames),
46838 : &bigendian_obj,
46839 : &ndr64_obj)) {
46840 0 : return NULL;
46841 : }
46842 :
46843 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46844 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46845 : }
46846 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46847 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46848 : }
46849 :
46850 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46851 : }
46852 :
46853 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46854 : {
46855 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46856 0 : PyObject *bigendian_obj = NULL;
46857 0 : PyObject *ndr64_obj = NULL;
46858 0 : libndr_flags ndr_push_flags = 0;
46859 :
46860 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46861 : discard_const_p(char *, kwnames),
46862 : &bigendian_obj,
46863 : &ndr64_obj)) {
46864 0 : return NULL;
46865 : }
46866 :
46867 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46868 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46869 : }
46870 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46871 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46872 : }
46873 :
46874 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46875 : }
46876 :
46877 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
46878 : {
46879 0 : const struct ndr_interface_call *call = NULL;
46880 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
46881 0 : struct ndr_pull *pull = NULL;
46882 0 : enum ndr_err_code err;
46883 :
46884 0 : if (ndr_table_lsarpc.num_calls < 78) {
46885 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_unpack");
46886 0 : return NULL;
46887 : }
46888 0 : call = &ndr_table_lsarpc.calls[77];
46889 :
46890 0 : pull = ndr_pull_init_blob(blob, object);
46891 0 : if (pull == NULL) {
46892 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46893 0 : return NULL;
46894 : }
46895 :
46896 0 : pull->flags |= ndr_pull_flags;
46897 :
46898 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46899 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46900 0 : TALLOC_FREE(pull);
46901 0 : PyErr_SetNdrError(err);
46902 0 : return NULL;
46903 : }
46904 0 : if (!allow_remaining) {
46905 0 : uint32_t highest_ofs;
46906 :
46907 0 : if (pull->offset > pull->relative_highest_offset) {
46908 0 : highest_ofs = pull->offset;
46909 : } else {
46910 0 : highest_ofs = pull->relative_highest_offset;
46911 : }
46912 0 : if (highest_ofs < pull->data_size) {
46913 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46914 : "not all bytes consumed ofs[%u] size[%u]",
46915 : highest_ofs, pull->data_size);
46916 0 : TALLOC_FREE(pull);
46917 0 : PyErr_SetNdrError(err);
46918 0 : return NULL;
46919 : }
46920 : }
46921 :
46922 0 : TALLOC_FREE(pull);
46923 0 : Py_RETURN_NONE;
46924 : }
46925 :
46926 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46927 : {
46928 0 : DATA_BLOB blob;
46929 0 : Py_ssize_t blob_length = 0;
46930 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46931 0 : PyObject *bigendian_obj = NULL;
46932 0 : PyObject *ndr64_obj = NULL;
46933 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46934 0 : PyObject *allow_remaining_obj = NULL;
46935 0 : bool allow_remaining = false;
46936 :
46937 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46938 : discard_const_p(char *, kwnames),
46939 : &blob.data, &blob_length,
46940 : &bigendian_obj,
46941 : &ndr64_obj,
46942 : &allow_remaining_obj)) {
46943 0 : return NULL;
46944 : }
46945 0 : blob.length = blob_length;
46946 :
46947 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46948 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46949 : }
46950 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46951 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46952 : }
46953 :
46954 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46955 0 : allow_remaining = true;
46956 : }
46957 :
46958 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46959 : }
46960 :
46961 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46962 : {
46963 0 : DATA_BLOB blob;
46964 0 : Py_ssize_t blob_length = 0;
46965 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46966 0 : PyObject *bigendian_obj = NULL;
46967 0 : PyObject *ndr64_obj = NULL;
46968 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46969 0 : PyObject *allow_remaining_obj = NULL;
46970 0 : bool allow_remaining = false;
46971 :
46972 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46973 : discard_const_p(char *, kwnames),
46974 : &blob.data, &blob_length,
46975 : &bigendian_obj,
46976 : &ndr64_obj,
46977 : &allow_remaining_obj)) {
46978 0 : return NULL;
46979 : }
46980 0 : blob.length = blob_length;
46981 :
46982 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46983 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46984 : }
46985 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46986 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46987 : }
46988 :
46989 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46990 0 : allow_remaining = true;
46991 : }
46992 :
46993 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46994 : }
46995 :
46996 0 : static PyObject *py_lsa_LookupNames4_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46997 : {
46998 0 : const struct ndr_interface_call *call = NULL;
46999 0 : struct lsa_LookupNames4 *object = (struct lsa_LookupNames4 *)pytalloc_get_ptr(py_obj);
47000 0 : PyObject *ret;
47001 0 : char *retstr;
47002 :
47003 0 : if (ndr_table_lsarpc.num_calls < 78) {
47004 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_print");
47005 0 : return NULL;
47006 : }
47007 0 : call = &ndr_table_lsarpc.calls[77];
47008 :
47009 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47010 0 : ret = PyUnicode_FromString(retstr);
47011 0 : TALLOC_FREE(retstr);
47012 :
47013 0 : return ret;
47014 : }
47015 :
47016 0 : static PyObject *py_lsa_LookupNames4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47017 : {
47018 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_in", NDR_IN);
47019 : }
47020 :
47021 0 : static PyObject *py_lsa_LookupNames4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47022 : {
47023 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_out", NDR_OUT);
47024 : }
47025 :
47026 : static PyMethodDef py_lsa_LookupNames4_methods[] = {
47027 : { "opnum", (PyCFunction)py_lsa_LookupNames4_ndr_opnum, METH_NOARGS|METH_CLASS,
47028 : "lsa.LookupNames4.opnum() -> 77 (0x4d) " },
47029 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47030 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47031 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47032 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47033 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47034 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47035 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47036 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47037 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47038 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47039 : { NULL, NULL, 0, NULL }
47040 : };
47041 :
47042 :
47043 : static PyTypeObject lsa_LookupNames4_Type = {
47044 : PyVarObject_HEAD_INIT(NULL, 0)
47045 : .tp_name = "lsa.LookupNames4",
47046 : .tp_getset = py_lsa_LookupNames4_getsetters,
47047 : .tp_methods = py_lsa_LookupNames4_methods,
47048 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47049 : .tp_new = py_lsa_LookupNames4_new,
47050 : };
47051 :
47052 7 : static bool pack_py_lsa_LookupNames4_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames4 *r)
47053 : {
47054 0 : PyObject *py_names;
47055 0 : PyObject *py_sids;
47056 0 : PyObject *py_level;
47057 0 : PyObject *py_count;
47058 0 : PyObject *py_lookup_options;
47059 0 : PyObject *py_client_revision;
47060 7 : const char *kwnames[] = {
47061 : "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
47062 : };
47063 :
47064 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)) {
47065 0 : return false;
47066 : }
47067 :
47068 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
47069 7 : r->in.num_names = PyList_GET_SIZE(py_names);
47070 7 : if (py_names == NULL) {
47071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
47072 0 : return false;
47073 : }
47074 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
47075 : {
47076 0 : int names_cntr_0;
47077 7 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
47078 7 : if (!r->in.names) { return false; }
47079 7 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
47080 15 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
47081 8 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
47082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
47083 0 : return false;
47084 : }
47085 8 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
47086 8 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
47087 0 : PyErr_NoMemory();
47088 0 : return false;
47089 : }
47090 8 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
47091 : }
47092 : }
47093 7 : if (py_sids == NULL) {
47094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
47095 0 : return false;
47096 : }
47097 7 : r->in.sids = talloc_ptrtype(r, r->in.sids);
47098 7 : if (r->in.sids == NULL) {
47099 0 : PyErr_NoMemory();
47100 0 : return false;
47101 : }
47102 7 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
47103 7 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
47104 0 : PyErr_NoMemory();
47105 0 : return false;
47106 : }
47107 7 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
47108 7 : if (py_level == NULL) {
47109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
47110 0 : return false;
47111 : }
47112 : {
47113 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
47114 7 : if (PyLong_Check(py_level)) {
47115 0 : unsigned long long test_var;
47116 7 : test_var = PyLong_AsUnsignedLongLong(py_level);
47117 7 : if (PyErr_Occurred() != NULL) {
47118 0 : return false;
47119 : }
47120 7 : if (test_var > uint_max) {
47121 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47122 : PyLong_Type.tp_name, uint_max, test_var);
47123 0 : return false;
47124 : }
47125 7 : r->in.level = test_var;
47126 : } else {
47127 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47128 : PyLong_Type.tp_name);
47129 0 : return false;
47130 : }
47131 : }
47132 7 : if (py_count == NULL) {
47133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.count");
47134 0 : return false;
47135 : }
47136 7 : r->in.count = talloc_ptrtype(r, r->in.count);
47137 7 : if (r->in.count == NULL) {
47138 0 : PyErr_NoMemory();
47139 0 : return false;
47140 : }
47141 : {
47142 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
47143 7 : if (PyLong_Check(py_count)) {
47144 0 : unsigned long long test_var;
47145 7 : test_var = PyLong_AsUnsignedLongLong(py_count);
47146 7 : if (PyErr_Occurred() != NULL) {
47147 0 : return false;
47148 : }
47149 7 : if (test_var > uint_max) {
47150 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47151 : PyLong_Type.tp_name, uint_max, test_var);
47152 0 : return false;
47153 : }
47154 7 : *r->in.count = test_var;
47155 : } else {
47156 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47157 : PyLong_Type.tp_name);
47158 0 : return false;
47159 : }
47160 : }
47161 7 : if (py_lookup_options == NULL) {
47162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lookup_options");
47163 0 : return false;
47164 : }
47165 : {
47166 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
47167 7 : if (PyLong_Check(py_lookup_options)) {
47168 0 : unsigned long long test_var;
47169 7 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
47170 7 : if (PyErr_Occurred() != NULL) {
47171 0 : return false;
47172 : }
47173 7 : if (test_var > uint_max) {
47174 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47175 : PyLong_Type.tp_name, uint_max, test_var);
47176 0 : return false;
47177 : }
47178 7 : r->in.lookup_options = test_var;
47179 : } else {
47180 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47181 : PyLong_Type.tp_name);
47182 0 : return false;
47183 : }
47184 : }
47185 7 : if (py_client_revision == NULL) {
47186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_revision");
47187 0 : return false;
47188 : }
47189 : {
47190 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
47191 7 : if (PyLong_Check(py_client_revision)) {
47192 0 : unsigned long long test_var;
47193 7 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
47194 7 : if (PyErr_Occurred() != NULL) {
47195 0 : return false;
47196 : }
47197 7 : if (test_var > uint_max) {
47198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47199 : PyLong_Type.tp_name, uint_max, test_var);
47200 0 : return false;
47201 : }
47202 7 : r->in.client_revision = test_var;
47203 : } else {
47204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47205 : PyLong_Type.tp_name);
47206 0 : return false;
47207 : }
47208 : }
47209 7 : return true;
47210 : }
47211 :
47212 6 : static PyObject *unpack_py_lsa_LookupNames4_args_out(struct lsa_LookupNames4 *r)
47213 : {
47214 0 : PyObject *result;
47215 0 : PyObject *py_domains;
47216 0 : PyObject *py_sids;
47217 0 : PyObject *py_count;
47218 6 : result = PyTuple_New(3);
47219 6 : if (*r->out.domains == NULL) {
47220 0 : py_domains = Py_None;
47221 0 : Py_INCREF(py_domains);
47222 : } else {
47223 6 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
47224 : }
47225 6 : PyTuple_SetItem(result, 0, py_domains);
47226 6 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
47227 6 : PyTuple_SetItem(result, 1, py_sids);
47228 6 : py_count = PyLong_FromUnsignedLongLong((uint32_t)*r->out.count);
47229 6 : PyTuple_SetItem(result, 2, py_count);
47230 6 : if (NT_STATUS_IS_ERR(r->out.result)) {
47231 0 : PyErr_SetNTSTATUS(r->out.result);
47232 0 : return NULL;
47233 : }
47234 :
47235 6 : return result;
47236 : }
47237 :
47238 : const struct PyNdrRpcMethodDef py_ndr_lsarpc_methods[] = {
47239 : { "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 },
47240 : { "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 },
47241 : { "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 },
47242 : { "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 },
47243 : { "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 },
47244 : { "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 },
47245 : { "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 },
47246 : { "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 },
47247 : { "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 },
47248 : { "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 },
47249 : { "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 },
47250 : { "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 },
47251 : { "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 },
47252 : { "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 },
47253 : { "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 },
47254 : { "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 },
47255 : { "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 },
47256 : { "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 },
47257 : { "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 },
47258 : { "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 },
47259 : { "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 },
47260 : { "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 },
47261 : { "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 },
47262 : { "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 },
47263 : { "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 },
47264 : { "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 },
47265 : { "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 },
47266 : { "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 },
47267 : { "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 },
47268 : { "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 },
47269 : { "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 },
47270 : { "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 },
47271 : { "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 },
47272 : { "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 },
47273 : { "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 },
47274 : { "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 },
47275 : { "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 },
47276 : { "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 },
47277 : { "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 },
47278 : { "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 },
47279 : { "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 },
47280 : { "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 },
47281 : { "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 },
47282 : { "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 },
47283 : { "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 },
47284 : { "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 },
47285 : { "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 },
47286 : { "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 },
47287 : { "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 },
47288 : { "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 },
47289 : { "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 },
47290 : { "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 },
47291 : { "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 },
47292 : { "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 },
47293 : { "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 },
47294 : { "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 },
47295 : { "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 },
47296 : { "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 },
47297 : { "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 },
47298 : { "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 },
47299 : {0}
47300 : };
47301 :
47302 262 : static PyObject *interface_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47303 : {
47304 262 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_lsarpc);
47305 : }
47306 :
47307 : #define PY_DOC_LSARPC "Local Security Authority"
47308 : static PyTypeObject lsarpc_InterfaceType = {
47309 : PyVarObject_HEAD_INIT(NULL, 0)
47310 : .tp_name = "lsa.lsarpc",
47311 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
47312 : .tp_doc = "lsarpc(binding, lp_ctx=None, credentials=None) -> connection\n"
47313 : "\n"
47314 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
47315 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
47316 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_LSARPC,
47317 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47318 : .tp_new = interface_lsarpc_new,
47319 : };
47320 :
47321 30 : static PyObject *syntax_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47322 : {
47323 30 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_lsarpc.syntax_id);
47324 : }
47325 :
47326 : #define PY_DOC_LSARPC_SYNTAX "Local Security Authority"
47327 : static PyTypeObject lsarpc_SyntaxType = {
47328 : PyVarObject_HEAD_INIT(NULL, 0)
47329 : .tp_name = "lsa.lsarpc_abstract_syntax",
47330 : .tp_doc = "lsarpc_abstract_syntax()\n"PY_DOC_LSARPC_SYNTAX,
47331 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47332 : .tp_new = syntax_lsarpc_new,
47333 : };
47334 :
47335 : static PyMethodDef lsa_methods[] = {
47336 : { NULL, NULL, 0, NULL }
47337 : };
47338 :
47339 : static struct PyModuleDef moduledef = {
47340 : PyModuleDef_HEAD_INIT,
47341 : .m_name = "lsa",
47342 : .m_doc = "lsa DCE/RPC",
47343 : .m_size = -1,
47344 : .m_methods = lsa_methods,
47345 : };
47346 7406 : MODULE_INIT_FUNC(lsa)
47347 : {
47348 7406 : PyObject *m = NULL;
47349 7406 : PyObject *dep_samba_dcerpc_misc = NULL;
47350 7406 : PyObject *dep_samba_dcerpc_security = NULL;
47351 7406 : PyObject *dep_talloc = NULL;
47352 7406 : PyObject *dep_samba_dcerpc_base = NULL;
47353 :
47354 7406 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
47355 7406 : if (dep_samba_dcerpc_misc == NULL)
47356 0 : goto out;
47357 :
47358 7406 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
47359 7406 : if (dep_samba_dcerpc_security == NULL)
47360 0 : goto out;
47361 :
47362 7406 : dep_talloc = PyImport_ImportModule("talloc");
47363 7406 : if (dep_talloc == NULL)
47364 0 : goto out;
47365 :
47366 7406 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
47367 7406 : if (dep_samba_dcerpc_base == NULL)
47368 0 : goto out;
47369 :
47370 7406 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
47371 7406 : if (BaseObject_Type == NULL)
47372 0 : goto out;
47373 :
47374 7406 : security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
47375 7406 : if (security_descriptor_Type == NULL)
47376 0 : goto out;
47377 :
47378 7406 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
47379 7406 : if (dom_sid_Type == NULL)
47380 0 : goto out;
47381 :
47382 7406 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
47383 7406 : if (GUID_Type == NULL)
47384 0 : goto out;
47385 :
47386 7406 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
47387 7406 : if (policy_handle_Type == NULL)
47388 0 : goto out;
47389 :
47390 7406 : sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
47391 7406 : if (sec_desc_buf_Type == NULL)
47392 0 : goto out;
47393 :
47394 7406 : ndr_pointer_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ndr_pointer");
47395 7406 : if (ndr_pointer_Type == NULL)
47396 0 : goto out;
47397 :
47398 7406 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
47399 7406 : if (ClientConnection_Type == NULL)
47400 0 : goto out;
47401 :
47402 7406 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
47403 7406 : if (ndr_syntax_id_Type == NULL)
47404 0 : goto out;
47405 :
47406 7406 : lsa_String_Type.tp_base = BaseObject_Type;
47407 7406 : lsa_String_Type.tp_basicsize = pytalloc_BaseObject_size();
47408 :
47409 7406 : lsa_StringLarge_Type.tp_base = BaseObject_Type;
47410 7406 : lsa_StringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
47411 :
47412 7406 : lsa_Strings_Type.tp_base = BaseObject_Type;
47413 7406 : lsa_Strings_Type.tp_basicsize = pytalloc_BaseObject_size();
47414 :
47415 7406 : lsa_AsciiString_Type.tp_base = BaseObject_Type;
47416 7406 : lsa_AsciiString_Type.tp_basicsize = pytalloc_BaseObject_size();
47417 :
47418 7406 : lsa_AsciiStringLarge_Type.tp_base = BaseObject_Type;
47419 7406 : lsa_AsciiStringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
47420 :
47421 7406 : lsa_BinaryString_Type.tp_base = BaseObject_Type;
47422 7406 : lsa_BinaryString_Type.tp_basicsize = pytalloc_BaseObject_size();
47423 :
47424 7406 : lsa_LUID_Type.tp_base = BaseObject_Type;
47425 7406 : lsa_LUID_Type.tp_basicsize = pytalloc_BaseObject_size();
47426 :
47427 7406 : lsa_PrivEntry_Type.tp_base = BaseObject_Type;
47428 7406 : lsa_PrivEntry_Type.tp_basicsize = pytalloc_BaseObject_size();
47429 :
47430 7406 : lsa_PrivArray_Type.tp_base = BaseObject_Type;
47431 7406 : lsa_PrivArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47432 :
47433 7406 : lsa_QosInfo_Type.tp_base = BaseObject_Type;
47434 7406 : lsa_QosInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47435 :
47436 7406 : lsa_ObjectAttribute_Type.tp_base = BaseObject_Type;
47437 7406 : lsa_ObjectAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47438 :
47439 7406 : lsa_AuditLogInfo_Type.tp_base = BaseObject_Type;
47440 7406 : lsa_AuditLogInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47441 :
47442 7406 : lsa_AuditEventsInfo_Type.tp_base = BaseObject_Type;
47443 7406 : lsa_AuditEventsInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47444 :
47445 7406 : lsa_DomainInfo_Type.tp_base = BaseObject_Type;
47446 7406 : lsa_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47447 :
47448 7406 : lsa_PDAccountInfo_Type.tp_base = BaseObject_Type;
47449 7406 : lsa_PDAccountInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47450 :
47451 7406 : lsa_ServerRole_Type.tp_base = BaseObject_Type;
47452 7406 : lsa_ServerRole_Type.tp_basicsize = pytalloc_BaseObject_size();
47453 :
47454 7406 : lsa_ReplicaSourceInfo_Type.tp_base = BaseObject_Type;
47455 7406 : lsa_ReplicaSourceInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47456 :
47457 7406 : lsa_DefaultQuotaInfo_Type.tp_base = BaseObject_Type;
47458 7406 : lsa_DefaultQuotaInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47459 :
47460 7406 : lsa_ModificationInfo_Type.tp_base = BaseObject_Type;
47461 7406 : lsa_ModificationInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47462 :
47463 7406 : lsa_AuditFullSetInfo_Type.tp_base = BaseObject_Type;
47464 7406 : lsa_AuditFullSetInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47465 :
47466 7406 : lsa_AuditFullQueryInfo_Type.tp_base = BaseObject_Type;
47467 7406 : lsa_AuditFullQueryInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47468 :
47469 7406 : lsa_DnsDomainInfo_Type.tp_base = BaseObject_Type;
47470 7406 : lsa_DnsDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47471 :
47472 7406 : lsa_PolicyInformation_Type.tp_base = BaseObject_Type;
47473 7406 : lsa_PolicyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47474 :
47475 7406 : lsa_SidPtr_Type.tp_base = BaseObject_Type;
47476 7406 : lsa_SidPtr_Type.tp_basicsize = pytalloc_BaseObject_size();
47477 :
47478 7406 : lsa_SidArray_Type.tp_base = BaseObject_Type;
47479 7406 : lsa_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47480 :
47481 7406 : lsa_DomainList_Type.tp_base = BaseObject_Type;
47482 7406 : lsa_DomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
47483 :
47484 7406 : lsa_TranslatedSid_Type.tp_base = BaseObject_Type;
47485 7406 : lsa_TranslatedSid_Type.tp_basicsize = pytalloc_BaseObject_size();
47486 :
47487 7406 : lsa_TransSidArray_Type.tp_base = BaseObject_Type;
47488 7406 : lsa_TransSidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47489 :
47490 7406 : lsa_RefDomainList_Type.tp_base = BaseObject_Type;
47491 7406 : lsa_RefDomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
47492 :
47493 7406 : lsa_TranslatedName_Type.tp_base = BaseObject_Type;
47494 7406 : lsa_TranslatedName_Type.tp_basicsize = pytalloc_BaseObject_size();
47495 :
47496 7406 : lsa_TransNameArray_Type.tp_base = BaseObject_Type;
47497 7406 : lsa_TransNameArray_Type.tp_basicsize = pytalloc_BaseObject_size();
47498 :
47499 7406 : lsa_LUIDAttribute_Type.tp_base = BaseObject_Type;
47500 7406 : lsa_LUIDAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47501 :
47502 7406 : lsa_PrivilegeSet_Type.tp_base = BaseObject_Type;
47503 7406 : lsa_PrivilegeSet_Type.tp_basicsize = pytalloc_BaseObject_size();
47504 :
47505 7406 : lsa_DATA_BUF_Type.tp_base = BaseObject_Type;
47506 7406 : lsa_DATA_BUF_Type.tp_basicsize = pytalloc_BaseObject_size();
47507 :
47508 7406 : lsa_DATA_BUF2_Type.tp_base = BaseObject_Type;
47509 7406 : lsa_DATA_BUF2_Type.tp_basicsize = pytalloc_BaseObject_size();
47510 :
47511 7406 : lsa_TrustDomainInfoName_Type.tp_base = BaseObject_Type;
47512 7406 : lsa_TrustDomainInfoName_Type.tp_basicsize = pytalloc_BaseObject_size();
47513 :
47514 7406 : lsa_TrustDomainInfoControllers_Type.tp_base = BaseObject_Type;
47515 7406 : lsa_TrustDomainInfoControllers_Type.tp_basicsize = pytalloc_BaseObject_size();
47516 :
47517 7406 : lsa_TrustDomainInfoPosixOffset_Type.tp_base = BaseObject_Type;
47518 7406 : lsa_TrustDomainInfoPosixOffset_Type.tp_basicsize = pytalloc_BaseObject_size();
47519 :
47520 7406 : lsa_TrustDomainInfoPassword_Type.tp_base = BaseObject_Type;
47521 7406 : lsa_TrustDomainInfoPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
47522 :
47523 7406 : lsa_TrustDomainInfoBasic_Type.tp_base = BaseObject_Type;
47524 7406 : lsa_TrustDomainInfoBasic_Type.tp_basicsize = pytalloc_BaseObject_size();
47525 :
47526 7406 : lsa_TrustDomainInfoInfoEx_Type.tp_base = BaseObject_Type;
47527 7406 : lsa_TrustDomainInfoInfoEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47528 :
47529 7406 : lsa_TrustDomainInfoBuffer_Type.tp_base = BaseObject_Type;
47530 7406 : lsa_TrustDomainInfoBuffer_Type.tp_basicsize = pytalloc_BaseObject_size();
47531 :
47532 7406 : lsa_TrustDomainInfoAuthInfo_Type.tp_base = BaseObject_Type;
47533 7406 : lsa_TrustDomainInfoAuthInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47534 :
47535 7406 : lsa_TrustDomainInfoFullInfo_Type.tp_base = BaseObject_Type;
47536 7406 : lsa_TrustDomainInfoFullInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47537 :
47538 7406 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_base = BaseObject_Type;
47539 7406 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
47540 :
47541 7406 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_base = BaseObject_Type;
47542 7406 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
47543 :
47544 7406 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_base = BaseObject_Type;
47545 7406 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
47546 :
47547 7406 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_base = BaseObject_Type;
47548 7406 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
47549 :
47550 7406 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_base = BaseObject_Type;
47551 7406 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_basicsize = pytalloc_BaseObject_size();
47552 :
47553 7406 : lsa_TrustedDomainInfo_Type.tp_base = BaseObject_Type;
47554 7406 : lsa_TrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47555 :
47556 7406 : lsa_DATA_BUF_PTR_Type.tp_base = BaseObject_Type;
47557 7406 : lsa_DATA_BUF_PTR_Type.tp_basicsize = pytalloc_BaseObject_size();
47558 :
47559 7406 : lsa_RightAttribute_Type.tp_base = BaseObject_Type;
47560 7406 : lsa_RightAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
47561 :
47562 7406 : lsa_RightSet_Type.tp_base = BaseObject_Type;
47563 7406 : lsa_RightSet_Type.tp_basicsize = pytalloc_BaseObject_size();
47564 :
47565 7406 : lsa_DomainListEx_Type.tp_base = BaseObject_Type;
47566 7406 : lsa_DomainListEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47567 :
47568 7406 : lsa_DomainInfoKerberos_Type.tp_base = BaseObject_Type;
47569 7406 : lsa_DomainInfoKerberos_Type.tp_basicsize = pytalloc_BaseObject_size();
47570 :
47571 7406 : lsa_DomainInfoEfs_Type.tp_base = BaseObject_Type;
47572 7406 : lsa_DomainInfoEfs_Type.tp_basicsize = pytalloc_BaseObject_size();
47573 :
47574 7406 : lsa_DomainInformationPolicy_Type.tp_base = BaseObject_Type;
47575 7406 : lsa_DomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47576 :
47577 7406 : lsa_TranslatedName2_Type.tp_base = BaseObject_Type;
47578 7406 : lsa_TranslatedName2_Type.tp_basicsize = pytalloc_BaseObject_size();
47579 :
47580 7406 : lsa_TransNameArray2_Type.tp_base = BaseObject_Type;
47581 7406 : lsa_TransNameArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
47582 :
47583 7406 : lsa_TranslatedSid2_Type.tp_base = BaseObject_Type;
47584 7406 : lsa_TranslatedSid2_Type.tp_basicsize = pytalloc_BaseObject_size();
47585 :
47586 7406 : lsa_TransSidArray2_Type.tp_base = BaseObject_Type;
47587 7406 : lsa_TransSidArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
47588 :
47589 7406 : lsa_TranslatedSid3_Type.tp_base = BaseObject_Type;
47590 7406 : lsa_TranslatedSid3_Type.tp_basicsize = pytalloc_BaseObject_size();
47591 :
47592 7406 : lsa_TransSidArray3_Type.tp_base = BaseObject_Type;
47593 7406 : lsa_TransSidArray3_Type.tp_basicsize = pytalloc_BaseObject_size();
47594 :
47595 7406 : lsa_ForestTrustBinaryData_Type.tp_base = BaseObject_Type;
47596 7406 : lsa_ForestTrustBinaryData_Type.tp_basicsize = pytalloc_BaseObject_size();
47597 :
47598 7406 : lsa_ForestTrustDomainInfo_Type.tp_base = BaseObject_Type;
47599 7406 : lsa_ForestTrustDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47600 :
47601 7406 : lsa_ForestTrustData_Type.tp_base = BaseObject_Type;
47602 7406 : lsa_ForestTrustData_Type.tp_basicsize = pytalloc_BaseObject_size();
47603 :
47604 7406 : lsa_ForestTrustRecord_Type.tp_base = BaseObject_Type;
47605 7406 : lsa_ForestTrustRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
47606 :
47607 7406 : lsa_ForestTrustInformation_Type.tp_base = BaseObject_Type;
47608 7406 : lsa_ForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47609 :
47610 7406 : lsa_ForestTrustCollisionRecord_Type.tp_base = BaseObject_Type;
47611 7406 : lsa_ForestTrustCollisionRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
47612 :
47613 7406 : lsa_ForestTrustCollisionInfo_Type.tp_base = BaseObject_Type;
47614 7406 : lsa_ForestTrustCollisionInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47615 :
47616 7406 : lsa_Close_Type.tp_base = BaseObject_Type;
47617 7406 : lsa_Close_Type.tp_basicsize = pytalloc_BaseObject_size();
47618 :
47619 7406 : lsa_Delete_Type.tp_base = BaseObject_Type;
47620 7406 : lsa_Delete_Type.tp_basicsize = pytalloc_BaseObject_size();
47621 :
47622 7406 : lsa_EnumPrivs_Type.tp_base = BaseObject_Type;
47623 7406 : lsa_EnumPrivs_Type.tp_basicsize = pytalloc_BaseObject_size();
47624 :
47625 7406 : lsa_QuerySecurity_Type.tp_base = BaseObject_Type;
47626 7406 : lsa_QuerySecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
47627 :
47628 7406 : lsa_SetSecObj_Type.tp_base = BaseObject_Type;
47629 7406 : lsa_SetSecObj_Type.tp_basicsize = pytalloc_BaseObject_size();
47630 :
47631 7406 : lsa_OpenPolicy_Type.tp_base = BaseObject_Type;
47632 7406 : lsa_OpenPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47633 :
47634 7406 : lsa_QueryInfoPolicy_Type.tp_base = BaseObject_Type;
47635 7406 : lsa_QueryInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47636 :
47637 7406 : lsa_SetInfoPolicy_Type.tp_base = BaseObject_Type;
47638 7406 : lsa_SetInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47639 :
47640 7406 : lsa_CreateAccount_Type.tp_base = BaseObject_Type;
47641 7406 : lsa_CreateAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47642 :
47643 7406 : lsa_EnumAccounts_Type.tp_base = BaseObject_Type;
47644 7406 : lsa_EnumAccounts_Type.tp_basicsize = pytalloc_BaseObject_size();
47645 :
47646 7406 : lsa_CreateTrustedDomain_Type.tp_base = BaseObject_Type;
47647 7406 : lsa_CreateTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47648 :
47649 7406 : lsa_EnumTrustDom_Type.tp_base = BaseObject_Type;
47650 7406 : lsa_EnumTrustDom_Type.tp_basicsize = pytalloc_BaseObject_size();
47651 :
47652 7406 : lsa_LookupNames_Type.tp_base = BaseObject_Type;
47653 7406 : lsa_LookupNames_Type.tp_basicsize = pytalloc_BaseObject_size();
47654 :
47655 7406 : lsa_LookupSids_Type.tp_base = BaseObject_Type;
47656 7406 : lsa_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size();
47657 :
47658 7406 : lsa_CreateSecret_Type.tp_base = BaseObject_Type;
47659 7406 : lsa_CreateSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47660 :
47661 7406 : lsa_OpenAccount_Type.tp_base = BaseObject_Type;
47662 7406 : lsa_OpenAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47663 :
47664 7406 : lsa_EnumPrivsAccount_Type.tp_base = BaseObject_Type;
47665 7406 : lsa_EnumPrivsAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47666 :
47667 7406 : lsa_AddPrivilegesToAccount_Type.tp_base = BaseObject_Type;
47668 7406 : lsa_AddPrivilegesToAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47669 :
47670 7406 : lsa_RemovePrivilegesFromAccount_Type.tp_base = BaseObject_Type;
47671 7406 : lsa_RemovePrivilegesFromAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47672 :
47673 7406 : lsa_GetSystemAccessAccount_Type.tp_base = BaseObject_Type;
47674 7406 : lsa_GetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47675 :
47676 7406 : lsa_SetSystemAccessAccount_Type.tp_base = BaseObject_Type;
47677 7406 : lsa_SetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
47678 :
47679 7406 : lsa_OpenTrustedDomain_Type.tp_base = BaseObject_Type;
47680 7406 : lsa_OpenTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47681 :
47682 7406 : lsa_QueryTrustedDomainInfo_Type.tp_base = BaseObject_Type;
47683 7406 : lsa_QueryTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47684 :
47685 7406 : lsa_SetInformationTrustedDomain_Type.tp_base = BaseObject_Type;
47686 7406 : lsa_SetInformationTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47687 :
47688 7406 : lsa_OpenSecret_Type.tp_base = BaseObject_Type;
47689 7406 : lsa_OpenSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47690 :
47691 7406 : lsa_SetSecret_Type.tp_base = BaseObject_Type;
47692 7406 : lsa_SetSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47693 :
47694 7406 : lsa_QuerySecret_Type.tp_base = BaseObject_Type;
47695 7406 : lsa_QuerySecret_Type.tp_basicsize = pytalloc_BaseObject_size();
47696 :
47697 7406 : lsa_LookupPrivValue_Type.tp_base = BaseObject_Type;
47698 7406 : lsa_LookupPrivValue_Type.tp_basicsize = pytalloc_BaseObject_size();
47699 :
47700 7406 : lsa_LookupPrivName_Type.tp_base = BaseObject_Type;
47701 7406 : lsa_LookupPrivName_Type.tp_basicsize = pytalloc_BaseObject_size();
47702 :
47703 7406 : lsa_LookupPrivDisplayName_Type.tp_base = BaseObject_Type;
47704 7406 : lsa_LookupPrivDisplayName_Type.tp_basicsize = pytalloc_BaseObject_size();
47705 :
47706 7406 : lsa_DeleteObject_Type.tp_base = BaseObject_Type;
47707 7406 : lsa_DeleteObject_Type.tp_basicsize = pytalloc_BaseObject_size();
47708 :
47709 7406 : lsa_EnumAccountsWithUserRight_Type.tp_base = BaseObject_Type;
47710 7406 : lsa_EnumAccountsWithUserRight_Type.tp_basicsize = pytalloc_BaseObject_size();
47711 :
47712 7406 : lsa_EnumAccountRights_Type.tp_base = BaseObject_Type;
47713 7406 : lsa_EnumAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47714 :
47715 7406 : lsa_AddAccountRights_Type.tp_base = BaseObject_Type;
47716 7406 : lsa_AddAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47717 :
47718 7406 : lsa_RemoveAccountRights_Type.tp_base = BaseObject_Type;
47719 7406 : lsa_RemoveAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
47720 :
47721 7406 : lsa_QueryTrustedDomainInfoBySid_Type.tp_base = BaseObject_Type;
47722 7406 : lsa_QueryTrustedDomainInfoBySid_Type.tp_basicsize = pytalloc_BaseObject_size();
47723 :
47724 7406 : lsa_SetTrustedDomainInfo_Type.tp_base = BaseObject_Type;
47725 7406 : lsa_SetTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
47726 :
47727 7406 : lsa_DeleteTrustedDomain_Type.tp_base = BaseObject_Type;
47728 7406 : lsa_DeleteTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
47729 :
47730 7406 : lsa_StorePrivateData_Type.tp_base = BaseObject_Type;
47731 7406 : lsa_StorePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
47732 :
47733 7406 : lsa_RetrievePrivateData_Type.tp_base = BaseObject_Type;
47734 7406 : lsa_RetrievePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
47735 :
47736 7406 : lsa_OpenPolicy2_Type.tp_base = BaseObject_Type;
47737 7406 : lsa_OpenPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47738 :
47739 7406 : lsa_GetUserName_Type.tp_base = BaseObject_Type;
47740 7406 : lsa_GetUserName_Type.tp_basicsize = pytalloc_BaseObject_size();
47741 :
47742 7406 : lsa_QueryInfoPolicy2_Type.tp_base = BaseObject_Type;
47743 7406 : lsa_QueryInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47744 :
47745 7406 : lsa_SetInfoPolicy2_Type.tp_base = BaseObject_Type;
47746 7406 : lsa_SetInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
47747 :
47748 7406 : lsa_QueryTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
47749 7406 : lsa_QueryTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47750 :
47751 7406 : lsa_SetTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
47752 7406 : lsa_SetTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47753 :
47754 7406 : lsa_EnumTrustedDomainsEx_Type.tp_base = BaseObject_Type;
47755 7406 : lsa_EnumTrustedDomainsEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47756 :
47757 7406 : lsa_CreateTrustedDomainEx_Type.tp_base = BaseObject_Type;
47758 7406 : lsa_CreateTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47759 :
47760 7406 : lsa_CloseTrustedDomainEx_Type.tp_base = BaseObject_Type;
47761 7406 : lsa_CloseTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
47762 :
47763 7406 : lsa_QueryDomainInformationPolicy_Type.tp_base = BaseObject_Type;
47764 7406 : lsa_QueryDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47765 :
47766 7406 : lsa_SetDomainInformationPolicy_Type.tp_base = BaseObject_Type;
47767 7406 : lsa_SetDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
47768 :
47769 7406 : lsa_OpenTrustedDomainByName_Type.tp_base = BaseObject_Type;
47770 7406 : lsa_OpenTrustedDomainByName_Type.tp_basicsize = pytalloc_BaseObject_size();
47771 :
47772 7406 : lsa_LookupSids2_Type.tp_base = BaseObject_Type;
47773 7406 : lsa_LookupSids2_Type.tp_basicsize = pytalloc_BaseObject_size();
47774 :
47775 7406 : lsa_LookupNames2_Type.tp_base = BaseObject_Type;
47776 7406 : lsa_LookupNames2_Type.tp_basicsize = pytalloc_BaseObject_size();
47777 :
47778 7406 : lsa_CreateTrustedDomainEx2_Type.tp_base = BaseObject_Type;
47779 7406 : lsa_CreateTrustedDomainEx2_Type.tp_basicsize = pytalloc_BaseObject_size();
47780 :
47781 7406 : lsa_LookupNames3_Type.tp_base = BaseObject_Type;
47782 7406 : lsa_LookupNames3_Type.tp_basicsize = pytalloc_BaseObject_size();
47783 :
47784 7406 : lsa_lsaRQueryForestTrustInformation_Type.tp_base = BaseObject_Type;
47785 7406 : lsa_lsaRQueryForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47786 :
47787 7406 : lsa_lsaRSetForestTrustInformation_Type.tp_base = BaseObject_Type;
47788 7406 : lsa_lsaRSetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
47789 :
47790 7406 : lsa_LookupSids3_Type.tp_base = BaseObject_Type;
47791 7406 : lsa_LookupSids3_Type.tp_basicsize = pytalloc_BaseObject_size();
47792 :
47793 7406 : lsa_LookupNames4_Type.tp_base = BaseObject_Type;
47794 7406 : lsa_LookupNames4_Type.tp_basicsize = pytalloc_BaseObject_size();
47795 :
47796 7406 : lsarpc_InterfaceType.tp_base = ClientConnection_Type;
47797 :
47798 7406 : lsarpc_SyntaxType.tp_base = ndr_syntax_id_Type;
47799 7406 : lsarpc_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
47800 :
47801 7406 : if (PyType_Ready(&lsa_String_Type) < 0)
47802 0 : goto out;
47803 7406 : if (PyType_Ready(&lsa_StringLarge_Type) < 0)
47804 0 : goto out;
47805 7406 : if (PyType_Ready(&lsa_Strings_Type) < 0)
47806 0 : goto out;
47807 7406 : if (PyType_Ready(&lsa_AsciiString_Type) < 0)
47808 0 : goto out;
47809 7406 : if (PyType_Ready(&lsa_AsciiStringLarge_Type) < 0)
47810 0 : goto out;
47811 7406 : if (PyType_Ready(&lsa_BinaryString_Type) < 0)
47812 0 : goto out;
47813 7406 : if (PyType_Ready(&lsa_LUID_Type) < 0)
47814 0 : goto out;
47815 7406 : if (PyType_Ready(&lsa_PrivEntry_Type) < 0)
47816 0 : goto out;
47817 7406 : if (PyType_Ready(&lsa_PrivArray_Type) < 0)
47818 0 : goto out;
47819 7406 : if (PyType_Ready(&lsa_QosInfo_Type) < 0)
47820 0 : goto out;
47821 7406 : if (PyType_Ready(&lsa_ObjectAttribute_Type) < 0)
47822 0 : goto out;
47823 7406 : if (PyType_Ready(&lsa_AuditLogInfo_Type) < 0)
47824 0 : goto out;
47825 7406 : if (PyType_Ready(&lsa_AuditEventsInfo_Type) < 0)
47826 0 : goto out;
47827 7406 : if (PyType_Ready(&lsa_DomainInfo_Type) < 0)
47828 0 : goto out;
47829 7406 : if (PyType_Ready(&lsa_PDAccountInfo_Type) < 0)
47830 0 : goto out;
47831 7406 : if (PyType_Ready(&lsa_ServerRole_Type) < 0)
47832 0 : goto out;
47833 7406 : if (PyType_Ready(&lsa_ReplicaSourceInfo_Type) < 0)
47834 0 : goto out;
47835 7406 : if (PyType_Ready(&lsa_DefaultQuotaInfo_Type) < 0)
47836 0 : goto out;
47837 7406 : if (PyType_Ready(&lsa_ModificationInfo_Type) < 0)
47838 0 : goto out;
47839 7406 : if (PyType_Ready(&lsa_AuditFullSetInfo_Type) < 0)
47840 0 : goto out;
47841 7406 : if (PyType_Ready(&lsa_AuditFullQueryInfo_Type) < 0)
47842 0 : goto out;
47843 7406 : if (PyType_Ready(&lsa_DnsDomainInfo_Type) < 0)
47844 0 : goto out;
47845 7406 : if (PyType_Ready(&lsa_PolicyInformation_Type) < 0)
47846 0 : goto out;
47847 7406 : if (PyType_Ready(&lsa_SidPtr_Type) < 0)
47848 0 : goto out;
47849 7406 : if (PyType_Ready(&lsa_SidArray_Type) < 0)
47850 0 : goto out;
47851 7406 : if (PyType_Ready(&lsa_DomainList_Type) < 0)
47852 0 : goto out;
47853 7406 : if (PyType_Ready(&lsa_TranslatedSid_Type) < 0)
47854 0 : goto out;
47855 7406 : if (PyType_Ready(&lsa_TransSidArray_Type) < 0)
47856 0 : goto out;
47857 7406 : if (PyType_Ready(&lsa_RefDomainList_Type) < 0)
47858 0 : goto out;
47859 7406 : if (PyType_Ready(&lsa_TranslatedName_Type) < 0)
47860 0 : goto out;
47861 7406 : if (PyType_Ready(&lsa_TransNameArray_Type) < 0)
47862 0 : goto out;
47863 7406 : if (PyType_Ready(&lsa_LUIDAttribute_Type) < 0)
47864 0 : goto out;
47865 7406 : if (PyType_Ready(&lsa_PrivilegeSet_Type) < 0)
47866 0 : goto out;
47867 7406 : if (PyType_Ready(&lsa_DATA_BUF_Type) < 0)
47868 0 : goto out;
47869 7406 : if (PyType_Ready(&lsa_DATA_BUF2_Type) < 0)
47870 0 : goto out;
47871 7406 : if (PyType_Ready(&lsa_TrustDomainInfoName_Type) < 0)
47872 0 : goto out;
47873 7406 : if (PyType_Ready(&lsa_TrustDomainInfoControllers_Type) < 0)
47874 0 : goto out;
47875 7406 : if (PyType_Ready(&lsa_TrustDomainInfoPosixOffset_Type) < 0)
47876 0 : goto out;
47877 7406 : if (PyType_Ready(&lsa_TrustDomainInfoPassword_Type) < 0)
47878 0 : goto out;
47879 7406 : if (PyType_Ready(&lsa_TrustDomainInfoBasic_Type) < 0)
47880 0 : goto out;
47881 7406 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx_Type) < 0)
47882 0 : goto out;
47883 7406 : if (PyType_Ready(&lsa_TrustDomainInfoBuffer_Type) < 0)
47884 0 : goto out;
47885 7406 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfo_Type) < 0)
47886 0 : goto out;
47887 7406 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo_Type) < 0)
47888 0 : goto out;
47889 7406 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternal_Type) < 0)
47890 0 : goto out;
47891 7406 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternal_Type) < 0)
47892 0 : goto out;
47893 7406 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx2Internal_Type) < 0)
47894 0 : goto out;
47895 7406 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo2Internal_Type) < 0)
47896 0 : goto out;
47897 7406 : if (PyType_Ready(&lsa_TrustDomainInfoSupportedEncTypes_Type) < 0)
47898 0 : goto out;
47899 7406 : if (PyType_Ready(&lsa_TrustedDomainInfo_Type) < 0)
47900 0 : goto out;
47901 7406 : if (PyType_Ready(&lsa_DATA_BUF_PTR_Type) < 0)
47902 0 : goto out;
47903 7406 : if (PyType_Ready(&lsa_RightAttribute_Type) < 0)
47904 0 : goto out;
47905 7406 : if (PyType_Ready(&lsa_RightSet_Type) < 0)
47906 0 : goto out;
47907 7406 : if (PyType_Ready(&lsa_DomainListEx_Type) < 0)
47908 0 : goto out;
47909 7406 : if (PyType_Ready(&lsa_DomainInfoKerberos_Type) < 0)
47910 0 : goto out;
47911 7406 : if (PyType_Ready(&lsa_DomainInfoEfs_Type) < 0)
47912 0 : goto out;
47913 7406 : if (PyType_Ready(&lsa_DomainInformationPolicy_Type) < 0)
47914 0 : goto out;
47915 7406 : if (PyType_Ready(&lsa_TranslatedName2_Type) < 0)
47916 0 : goto out;
47917 7406 : if (PyType_Ready(&lsa_TransNameArray2_Type) < 0)
47918 0 : goto out;
47919 7406 : if (PyType_Ready(&lsa_TranslatedSid2_Type) < 0)
47920 0 : goto out;
47921 7406 : if (PyType_Ready(&lsa_TransSidArray2_Type) < 0)
47922 0 : goto out;
47923 7406 : if (PyType_Ready(&lsa_TranslatedSid3_Type) < 0)
47924 0 : goto out;
47925 7406 : if (PyType_Ready(&lsa_TransSidArray3_Type) < 0)
47926 0 : goto out;
47927 7406 : if (PyType_Ready(&lsa_ForestTrustBinaryData_Type) < 0)
47928 0 : goto out;
47929 7406 : if (PyType_Ready(&lsa_ForestTrustDomainInfo_Type) < 0)
47930 0 : goto out;
47931 7406 : if (PyType_Ready(&lsa_ForestTrustData_Type) < 0)
47932 0 : goto out;
47933 7406 : if (PyType_Ready(&lsa_ForestTrustRecord_Type) < 0)
47934 0 : goto out;
47935 7406 : if (PyType_Ready(&lsa_ForestTrustInformation_Type) < 0)
47936 0 : goto out;
47937 7406 : if (PyType_Ready(&lsa_ForestTrustCollisionRecord_Type) < 0)
47938 0 : goto out;
47939 7406 : if (PyType_Ready(&lsa_ForestTrustCollisionInfo_Type) < 0)
47940 0 : goto out;
47941 7406 : if (PyType_Ready(&lsa_Close_Type) < 0)
47942 0 : goto out;
47943 7406 : if (PyType_Ready(&lsa_Delete_Type) < 0)
47944 0 : goto out;
47945 7406 : if (PyType_Ready(&lsa_EnumPrivs_Type) < 0)
47946 0 : goto out;
47947 7406 : if (PyType_Ready(&lsa_QuerySecurity_Type) < 0)
47948 0 : goto out;
47949 7406 : if (PyType_Ready(&lsa_SetSecObj_Type) < 0)
47950 0 : goto out;
47951 7406 : if (PyType_Ready(&lsa_OpenPolicy_Type) < 0)
47952 0 : goto out;
47953 7406 : if (PyType_Ready(&lsa_QueryInfoPolicy_Type) < 0)
47954 0 : goto out;
47955 7406 : if (PyType_Ready(&lsa_SetInfoPolicy_Type) < 0)
47956 0 : goto out;
47957 7406 : if (PyType_Ready(&lsa_CreateAccount_Type) < 0)
47958 0 : goto out;
47959 7406 : if (PyType_Ready(&lsa_EnumAccounts_Type) < 0)
47960 0 : goto out;
47961 7406 : if (PyType_Ready(&lsa_CreateTrustedDomain_Type) < 0)
47962 0 : goto out;
47963 7406 : if (PyType_Ready(&lsa_EnumTrustDom_Type) < 0)
47964 0 : goto out;
47965 7406 : if (PyType_Ready(&lsa_LookupNames_Type) < 0)
47966 0 : goto out;
47967 7406 : if (PyType_Ready(&lsa_LookupSids_Type) < 0)
47968 0 : goto out;
47969 7406 : if (PyType_Ready(&lsa_CreateSecret_Type) < 0)
47970 0 : goto out;
47971 7406 : if (PyType_Ready(&lsa_OpenAccount_Type) < 0)
47972 0 : goto out;
47973 7406 : if (PyType_Ready(&lsa_EnumPrivsAccount_Type) < 0)
47974 0 : goto out;
47975 7406 : if (PyType_Ready(&lsa_AddPrivilegesToAccount_Type) < 0)
47976 0 : goto out;
47977 7406 : if (PyType_Ready(&lsa_RemovePrivilegesFromAccount_Type) < 0)
47978 0 : goto out;
47979 7406 : if (PyType_Ready(&lsa_GetSystemAccessAccount_Type) < 0)
47980 0 : goto out;
47981 7406 : if (PyType_Ready(&lsa_SetSystemAccessAccount_Type) < 0)
47982 0 : goto out;
47983 7406 : if (PyType_Ready(&lsa_OpenTrustedDomain_Type) < 0)
47984 0 : goto out;
47985 7406 : if (PyType_Ready(&lsa_QueryTrustedDomainInfo_Type) < 0)
47986 0 : goto out;
47987 7406 : if (PyType_Ready(&lsa_SetInformationTrustedDomain_Type) < 0)
47988 0 : goto out;
47989 7406 : if (PyType_Ready(&lsa_OpenSecret_Type) < 0)
47990 0 : goto out;
47991 7406 : if (PyType_Ready(&lsa_SetSecret_Type) < 0)
47992 0 : goto out;
47993 7406 : if (PyType_Ready(&lsa_QuerySecret_Type) < 0)
47994 0 : goto out;
47995 7406 : if (PyType_Ready(&lsa_LookupPrivValue_Type) < 0)
47996 0 : goto out;
47997 7406 : if (PyType_Ready(&lsa_LookupPrivName_Type) < 0)
47998 0 : goto out;
47999 7406 : if (PyType_Ready(&lsa_LookupPrivDisplayName_Type) < 0)
48000 0 : goto out;
48001 7406 : if (PyType_Ready(&lsa_DeleteObject_Type) < 0)
48002 0 : goto out;
48003 7406 : if (PyType_Ready(&lsa_EnumAccountsWithUserRight_Type) < 0)
48004 0 : goto out;
48005 7406 : if (PyType_Ready(&lsa_EnumAccountRights_Type) < 0)
48006 0 : goto out;
48007 7406 : if (PyType_Ready(&lsa_AddAccountRights_Type) < 0)
48008 0 : goto out;
48009 7406 : if (PyType_Ready(&lsa_RemoveAccountRights_Type) < 0)
48010 0 : goto out;
48011 7406 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoBySid_Type) < 0)
48012 0 : goto out;
48013 7406 : if (PyType_Ready(&lsa_SetTrustedDomainInfo_Type) < 0)
48014 0 : goto out;
48015 7406 : if (PyType_Ready(&lsa_DeleteTrustedDomain_Type) < 0)
48016 0 : goto out;
48017 7406 : if (PyType_Ready(&lsa_StorePrivateData_Type) < 0)
48018 0 : goto out;
48019 7406 : if (PyType_Ready(&lsa_RetrievePrivateData_Type) < 0)
48020 0 : goto out;
48021 7406 : if (PyType_Ready(&lsa_OpenPolicy2_Type) < 0)
48022 0 : goto out;
48023 7406 : if (PyType_Ready(&lsa_GetUserName_Type) < 0)
48024 0 : goto out;
48025 7406 : if (PyType_Ready(&lsa_QueryInfoPolicy2_Type) < 0)
48026 0 : goto out;
48027 7406 : if (PyType_Ready(&lsa_SetInfoPolicy2_Type) < 0)
48028 0 : goto out;
48029 7406 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoByName_Type) < 0)
48030 0 : goto out;
48031 7406 : if (PyType_Ready(&lsa_SetTrustedDomainInfoByName_Type) < 0)
48032 0 : goto out;
48033 7406 : if (PyType_Ready(&lsa_EnumTrustedDomainsEx_Type) < 0)
48034 0 : goto out;
48035 7406 : if (PyType_Ready(&lsa_CreateTrustedDomainEx_Type) < 0)
48036 0 : goto out;
48037 7406 : if (PyType_Ready(&lsa_CloseTrustedDomainEx_Type) < 0)
48038 0 : goto out;
48039 7406 : if (PyType_Ready(&lsa_QueryDomainInformationPolicy_Type) < 0)
48040 0 : goto out;
48041 7406 : if (PyType_Ready(&lsa_SetDomainInformationPolicy_Type) < 0)
48042 0 : goto out;
48043 7406 : if (PyType_Ready(&lsa_OpenTrustedDomainByName_Type) < 0)
48044 0 : goto out;
48045 7406 : if (PyType_Ready(&lsa_LookupSids2_Type) < 0)
48046 0 : goto out;
48047 7406 : if (PyType_Ready(&lsa_LookupNames2_Type) < 0)
48048 0 : goto out;
48049 7406 : if (PyType_Ready(&lsa_CreateTrustedDomainEx2_Type) < 0)
48050 0 : goto out;
48051 7406 : if (PyType_Ready(&lsa_LookupNames3_Type) < 0)
48052 0 : goto out;
48053 7406 : if (PyType_Ready(&lsa_lsaRQueryForestTrustInformation_Type) < 0)
48054 0 : goto out;
48055 7406 : if (PyType_Ready(&lsa_lsaRSetForestTrustInformation_Type) < 0)
48056 0 : goto out;
48057 7406 : if (PyType_Ready(&lsa_LookupSids3_Type) < 0)
48058 0 : goto out;
48059 7406 : if (PyType_Ready(&lsa_LookupNames4_Type) < 0)
48060 0 : goto out;
48061 7406 : if (PyType_Ready(&lsarpc_InterfaceType) < 0)
48062 0 : goto out;
48063 7406 : if (PyType_Ready(&lsarpc_SyntaxType) < 0)
48064 0 : goto out;
48065 7406 : if (!PyInterface_AddNdrRpcMethods(&lsarpc_InterfaceType, py_ndr_lsarpc_methods))
48066 0 : return NULL;
48067 :
48068 : #ifdef PY_STRING_PATCH
48069 7406 : PY_STRING_PATCH(&lsa_String_Type);
48070 : #endif
48071 : #ifdef PY_STRINGLARGE_PATCH
48072 : PY_STRINGLARGE_PATCH(&lsa_StringLarge_Type);
48073 : #endif
48074 : #ifdef PY_STRINGS_PATCH
48075 : PY_STRINGS_PATCH(&lsa_Strings_Type);
48076 : #endif
48077 : #ifdef PY_ASCIISTRING_PATCH
48078 : PY_ASCIISTRING_PATCH(&lsa_AsciiString_Type);
48079 : #endif
48080 : #ifdef PY_ASCIISTRINGLARGE_PATCH
48081 : PY_ASCIISTRINGLARGE_PATCH(&lsa_AsciiStringLarge_Type);
48082 : #endif
48083 : #ifdef PY_BINARYSTRING_PATCH
48084 : PY_BINARYSTRING_PATCH(&lsa_BinaryString_Type);
48085 : #endif
48086 : #ifdef PY_LUID_PATCH
48087 : PY_LUID_PATCH(&lsa_LUID_Type);
48088 : #endif
48089 : #ifdef PY_PRIVENTRY_PATCH
48090 : PY_PRIVENTRY_PATCH(&lsa_PrivEntry_Type);
48091 : #endif
48092 : #ifdef PY_PRIVARRAY_PATCH
48093 : PY_PRIVARRAY_PATCH(&lsa_PrivArray_Type);
48094 : #endif
48095 : #ifdef PY_QOSINFO_PATCH
48096 : PY_QOSINFO_PATCH(&lsa_QosInfo_Type);
48097 : #endif
48098 : #ifdef PY_OBJECTATTRIBUTE_PATCH
48099 : PY_OBJECTATTRIBUTE_PATCH(&lsa_ObjectAttribute_Type);
48100 : #endif
48101 : #ifdef PY_AUDITLOGINFO_PATCH
48102 : PY_AUDITLOGINFO_PATCH(&lsa_AuditLogInfo_Type);
48103 : #endif
48104 : #ifdef PY_AUDITEVENTSINFO_PATCH
48105 : PY_AUDITEVENTSINFO_PATCH(&lsa_AuditEventsInfo_Type);
48106 : #endif
48107 : #ifdef PY_DOMAININFO_PATCH
48108 : PY_DOMAININFO_PATCH(&lsa_DomainInfo_Type);
48109 : #endif
48110 : #ifdef PY_PDACCOUNTINFO_PATCH
48111 : PY_PDACCOUNTINFO_PATCH(&lsa_PDAccountInfo_Type);
48112 : #endif
48113 : #ifdef PY_SERVERROLE_PATCH
48114 : PY_SERVERROLE_PATCH(&lsa_ServerRole_Type);
48115 : #endif
48116 : #ifdef PY_REPLICASOURCEINFO_PATCH
48117 : PY_REPLICASOURCEINFO_PATCH(&lsa_ReplicaSourceInfo_Type);
48118 : #endif
48119 : #ifdef PY_DEFAULTQUOTAINFO_PATCH
48120 : PY_DEFAULTQUOTAINFO_PATCH(&lsa_DefaultQuotaInfo_Type);
48121 : #endif
48122 : #ifdef PY_MODIFICATIONINFO_PATCH
48123 : PY_MODIFICATIONINFO_PATCH(&lsa_ModificationInfo_Type);
48124 : #endif
48125 : #ifdef PY_AUDITFULLSETINFO_PATCH
48126 : PY_AUDITFULLSETINFO_PATCH(&lsa_AuditFullSetInfo_Type);
48127 : #endif
48128 : #ifdef PY_AUDITFULLQUERYINFO_PATCH
48129 : PY_AUDITFULLQUERYINFO_PATCH(&lsa_AuditFullQueryInfo_Type);
48130 : #endif
48131 : #ifdef PY_DNSDOMAININFO_PATCH
48132 : PY_DNSDOMAININFO_PATCH(&lsa_DnsDomainInfo_Type);
48133 : #endif
48134 : #ifdef PY_POLICYINFORMATION_PATCH
48135 : PY_POLICYINFORMATION_PATCH(&lsa_PolicyInformation_Type);
48136 : #endif
48137 : #ifdef PY_SIDPTR_PATCH
48138 : PY_SIDPTR_PATCH(&lsa_SidPtr_Type);
48139 : #endif
48140 : #ifdef PY_SIDARRAY_PATCH
48141 : PY_SIDARRAY_PATCH(&lsa_SidArray_Type);
48142 : #endif
48143 : #ifdef PY_DOMAINLIST_PATCH
48144 : PY_DOMAINLIST_PATCH(&lsa_DomainList_Type);
48145 : #endif
48146 : #ifdef PY_TRANSLATEDSID_PATCH
48147 : PY_TRANSLATEDSID_PATCH(&lsa_TranslatedSid_Type);
48148 : #endif
48149 : #ifdef PY_TRANSSIDARRAY_PATCH
48150 : PY_TRANSSIDARRAY_PATCH(&lsa_TransSidArray_Type);
48151 : #endif
48152 : #ifdef PY_REFDOMAINLIST_PATCH
48153 : PY_REFDOMAINLIST_PATCH(&lsa_RefDomainList_Type);
48154 : #endif
48155 : #ifdef PY_TRANSLATEDNAME_PATCH
48156 : PY_TRANSLATEDNAME_PATCH(&lsa_TranslatedName_Type);
48157 : #endif
48158 : #ifdef PY_TRANSNAMEARRAY_PATCH
48159 : PY_TRANSNAMEARRAY_PATCH(&lsa_TransNameArray_Type);
48160 : #endif
48161 : #ifdef PY_LUIDATTRIBUTE_PATCH
48162 : PY_LUIDATTRIBUTE_PATCH(&lsa_LUIDAttribute_Type);
48163 : #endif
48164 : #ifdef PY_PRIVILEGESET_PATCH
48165 : PY_PRIVILEGESET_PATCH(&lsa_PrivilegeSet_Type);
48166 : #endif
48167 : #ifdef PY_DATA_BUF_PATCH
48168 : PY_DATA_BUF_PATCH(&lsa_DATA_BUF_Type);
48169 : #endif
48170 : #ifdef PY_DATA_BUF2_PATCH
48171 : PY_DATA_BUF2_PATCH(&lsa_DATA_BUF2_Type);
48172 : #endif
48173 : #ifdef PY_TRUSTDOMAININFONAME_PATCH
48174 : PY_TRUSTDOMAININFONAME_PATCH(&lsa_TrustDomainInfoName_Type);
48175 : #endif
48176 : #ifdef PY_TRUSTDOMAININFOCONTROLLERS_PATCH
48177 : PY_TRUSTDOMAININFOCONTROLLERS_PATCH(&lsa_TrustDomainInfoControllers_Type);
48178 : #endif
48179 : #ifdef PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH
48180 : PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH(&lsa_TrustDomainInfoPosixOffset_Type);
48181 : #endif
48182 : #ifdef PY_TRUSTDOMAININFOPASSWORD_PATCH
48183 : PY_TRUSTDOMAININFOPASSWORD_PATCH(&lsa_TrustDomainInfoPassword_Type);
48184 : #endif
48185 : #ifdef PY_TRUSTDOMAININFOBASIC_PATCH
48186 : PY_TRUSTDOMAININFOBASIC_PATCH(&lsa_TrustDomainInfoBasic_Type);
48187 : #endif
48188 : #ifdef PY_TRUSTDOMAININFOINFOEX_PATCH
48189 : PY_TRUSTDOMAININFOINFOEX_PATCH(&lsa_TrustDomainInfoInfoEx_Type);
48190 : #endif
48191 : #ifdef PY_TRUSTDOMAININFOBUFFER_PATCH
48192 : PY_TRUSTDOMAININFOBUFFER_PATCH(&lsa_TrustDomainInfoBuffer_Type);
48193 : #endif
48194 : #ifdef PY_TRUSTDOMAININFOAUTHINFO_PATCH
48195 : PY_TRUSTDOMAININFOAUTHINFO_PATCH(&lsa_TrustDomainInfoAuthInfo_Type);
48196 : #endif
48197 : #ifdef PY_TRUSTDOMAININFOFULLINFO_PATCH
48198 : PY_TRUSTDOMAININFOFULLINFO_PATCH(&lsa_TrustDomainInfoFullInfo_Type);
48199 : #endif
48200 : #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH
48201 : PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH(&lsa_TrustDomainInfoAuthInfoInternal_Type);
48202 : #endif
48203 : #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH
48204 : PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH(&lsa_TrustDomainInfoFullInfoInternal_Type);
48205 : #endif
48206 : #ifdef PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH
48207 : PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH(&lsa_TrustDomainInfoInfoEx2Internal_Type);
48208 : #endif
48209 : #ifdef PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH
48210 : PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH(&lsa_TrustDomainInfoFullInfo2Internal_Type);
48211 : #endif
48212 : #ifdef PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH
48213 : PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH(&lsa_TrustDomainInfoSupportedEncTypes_Type);
48214 : #endif
48215 : #ifdef PY_TRUSTEDDOMAININFO_PATCH
48216 : PY_TRUSTEDDOMAININFO_PATCH(&lsa_TrustedDomainInfo_Type);
48217 : #endif
48218 : #ifdef PY_DATA_BUF_PTR_PATCH
48219 : PY_DATA_BUF_PTR_PATCH(&lsa_DATA_BUF_PTR_Type);
48220 : #endif
48221 : #ifdef PY_RIGHTATTRIBUTE_PATCH
48222 : PY_RIGHTATTRIBUTE_PATCH(&lsa_RightAttribute_Type);
48223 : #endif
48224 : #ifdef PY_RIGHTSET_PATCH
48225 : PY_RIGHTSET_PATCH(&lsa_RightSet_Type);
48226 : #endif
48227 : #ifdef PY_DOMAINLISTEX_PATCH
48228 : PY_DOMAINLISTEX_PATCH(&lsa_DomainListEx_Type);
48229 : #endif
48230 : #ifdef PY_DOMAININFOKERBEROS_PATCH
48231 : PY_DOMAININFOKERBEROS_PATCH(&lsa_DomainInfoKerberos_Type);
48232 : #endif
48233 : #ifdef PY_DOMAININFOEFS_PATCH
48234 : PY_DOMAININFOEFS_PATCH(&lsa_DomainInfoEfs_Type);
48235 : #endif
48236 : #ifdef PY_DOMAININFORMATIONPOLICY_PATCH
48237 : PY_DOMAININFORMATIONPOLICY_PATCH(&lsa_DomainInformationPolicy_Type);
48238 : #endif
48239 : #ifdef PY_TRANSLATEDNAME2_PATCH
48240 : PY_TRANSLATEDNAME2_PATCH(&lsa_TranslatedName2_Type);
48241 : #endif
48242 : #ifdef PY_TRANSNAMEARRAY2_PATCH
48243 : PY_TRANSNAMEARRAY2_PATCH(&lsa_TransNameArray2_Type);
48244 : #endif
48245 : #ifdef PY_TRANSLATEDSID2_PATCH
48246 : PY_TRANSLATEDSID2_PATCH(&lsa_TranslatedSid2_Type);
48247 : #endif
48248 : #ifdef PY_TRANSSIDARRAY2_PATCH
48249 : PY_TRANSSIDARRAY2_PATCH(&lsa_TransSidArray2_Type);
48250 : #endif
48251 : #ifdef PY_TRANSLATEDSID3_PATCH
48252 : PY_TRANSLATEDSID3_PATCH(&lsa_TranslatedSid3_Type);
48253 : #endif
48254 : #ifdef PY_TRANSSIDARRAY3_PATCH
48255 : PY_TRANSSIDARRAY3_PATCH(&lsa_TransSidArray3_Type);
48256 : #endif
48257 : #ifdef PY_FORESTTRUSTBINARYDATA_PATCH
48258 : PY_FORESTTRUSTBINARYDATA_PATCH(&lsa_ForestTrustBinaryData_Type);
48259 : #endif
48260 : #ifdef PY_FORESTTRUSTDOMAININFO_PATCH
48261 : PY_FORESTTRUSTDOMAININFO_PATCH(&lsa_ForestTrustDomainInfo_Type);
48262 : #endif
48263 : #ifdef PY_FORESTTRUSTDATA_PATCH
48264 : PY_FORESTTRUSTDATA_PATCH(&lsa_ForestTrustData_Type);
48265 : #endif
48266 : #ifdef PY_FORESTTRUSTRECORD_PATCH
48267 : PY_FORESTTRUSTRECORD_PATCH(&lsa_ForestTrustRecord_Type);
48268 : #endif
48269 : #ifdef PY_FORESTTRUSTINFORMATION_PATCH
48270 : PY_FORESTTRUSTINFORMATION_PATCH(&lsa_ForestTrustInformation_Type);
48271 : #endif
48272 : #ifdef PY_FORESTTRUSTCOLLISIONRECORD_PATCH
48273 : PY_FORESTTRUSTCOLLISIONRECORD_PATCH(&lsa_ForestTrustCollisionRecord_Type);
48274 : #endif
48275 : #ifdef PY_FORESTTRUSTCOLLISIONINFO_PATCH
48276 : PY_FORESTTRUSTCOLLISIONINFO_PATCH(&lsa_ForestTrustCollisionInfo_Type);
48277 : #endif
48278 : #ifdef PY_CLOSE_PATCH
48279 : PY_CLOSE_PATCH(&lsa_Close_Type);
48280 : #endif
48281 : #ifdef PY_DELETE_PATCH
48282 : PY_DELETE_PATCH(&lsa_Delete_Type);
48283 : #endif
48284 : #ifdef PY_ENUMPRIVS_PATCH
48285 : PY_ENUMPRIVS_PATCH(&lsa_EnumPrivs_Type);
48286 : #endif
48287 : #ifdef PY_QUERYSECURITY_PATCH
48288 : PY_QUERYSECURITY_PATCH(&lsa_QuerySecurity_Type);
48289 : #endif
48290 : #ifdef PY_SETSECOBJ_PATCH
48291 : PY_SETSECOBJ_PATCH(&lsa_SetSecObj_Type);
48292 : #endif
48293 : #ifdef PY_OPENPOLICY_PATCH
48294 : PY_OPENPOLICY_PATCH(&lsa_OpenPolicy_Type);
48295 : #endif
48296 : #ifdef PY_QUERYINFOPOLICY_PATCH
48297 : PY_QUERYINFOPOLICY_PATCH(&lsa_QueryInfoPolicy_Type);
48298 : #endif
48299 : #ifdef PY_SETINFOPOLICY_PATCH
48300 : PY_SETINFOPOLICY_PATCH(&lsa_SetInfoPolicy_Type);
48301 : #endif
48302 : #ifdef PY_CREATEACCOUNT_PATCH
48303 : PY_CREATEACCOUNT_PATCH(&lsa_CreateAccount_Type);
48304 : #endif
48305 : #ifdef PY_ENUMACCOUNTS_PATCH
48306 : PY_ENUMACCOUNTS_PATCH(&lsa_EnumAccounts_Type);
48307 : #endif
48308 : #ifdef PY_CREATETRUSTEDDOMAIN_PATCH
48309 : PY_CREATETRUSTEDDOMAIN_PATCH(&lsa_CreateTrustedDomain_Type);
48310 : #endif
48311 : #ifdef PY_ENUMTRUSTDOM_PATCH
48312 : PY_ENUMTRUSTDOM_PATCH(&lsa_EnumTrustDom_Type);
48313 : #endif
48314 : #ifdef PY_LOOKUPNAMES_PATCH
48315 : PY_LOOKUPNAMES_PATCH(&lsa_LookupNames_Type);
48316 : #endif
48317 : #ifdef PY_LOOKUPSIDS_PATCH
48318 : PY_LOOKUPSIDS_PATCH(&lsa_LookupSids_Type);
48319 : #endif
48320 : #ifdef PY_CREATESECRET_PATCH
48321 : PY_CREATESECRET_PATCH(&lsa_CreateSecret_Type);
48322 : #endif
48323 : #ifdef PY_OPENACCOUNT_PATCH
48324 : PY_OPENACCOUNT_PATCH(&lsa_OpenAccount_Type);
48325 : #endif
48326 : #ifdef PY_ENUMPRIVSACCOUNT_PATCH
48327 : PY_ENUMPRIVSACCOUNT_PATCH(&lsa_EnumPrivsAccount_Type);
48328 : #endif
48329 : #ifdef PY_ADDPRIVILEGESTOACCOUNT_PATCH
48330 : PY_ADDPRIVILEGESTOACCOUNT_PATCH(&lsa_AddPrivilegesToAccount_Type);
48331 : #endif
48332 : #ifdef PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH
48333 : PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH(&lsa_RemovePrivilegesFromAccount_Type);
48334 : #endif
48335 : #ifdef PY_GETSYSTEMACCESSACCOUNT_PATCH
48336 : PY_GETSYSTEMACCESSACCOUNT_PATCH(&lsa_GetSystemAccessAccount_Type);
48337 : #endif
48338 : #ifdef PY_SETSYSTEMACCESSACCOUNT_PATCH
48339 : PY_SETSYSTEMACCESSACCOUNT_PATCH(&lsa_SetSystemAccessAccount_Type);
48340 : #endif
48341 : #ifdef PY_OPENTRUSTEDDOMAIN_PATCH
48342 : PY_OPENTRUSTEDDOMAIN_PATCH(&lsa_OpenTrustedDomain_Type);
48343 : #endif
48344 : #ifdef PY_QUERYTRUSTEDDOMAININFO_PATCH
48345 : PY_QUERYTRUSTEDDOMAININFO_PATCH(&lsa_QueryTrustedDomainInfo_Type);
48346 : #endif
48347 : #ifdef PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH
48348 : PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH(&lsa_SetInformationTrustedDomain_Type);
48349 : #endif
48350 : #ifdef PY_OPENSECRET_PATCH
48351 : PY_OPENSECRET_PATCH(&lsa_OpenSecret_Type);
48352 : #endif
48353 : #ifdef PY_SETSECRET_PATCH
48354 : PY_SETSECRET_PATCH(&lsa_SetSecret_Type);
48355 : #endif
48356 : #ifdef PY_QUERYSECRET_PATCH
48357 : PY_QUERYSECRET_PATCH(&lsa_QuerySecret_Type);
48358 : #endif
48359 : #ifdef PY_LOOKUPPRIVVALUE_PATCH
48360 : PY_LOOKUPPRIVVALUE_PATCH(&lsa_LookupPrivValue_Type);
48361 : #endif
48362 : #ifdef PY_LOOKUPPRIVNAME_PATCH
48363 : PY_LOOKUPPRIVNAME_PATCH(&lsa_LookupPrivName_Type);
48364 : #endif
48365 : #ifdef PY_LOOKUPPRIVDISPLAYNAME_PATCH
48366 : PY_LOOKUPPRIVDISPLAYNAME_PATCH(&lsa_LookupPrivDisplayName_Type);
48367 : #endif
48368 : #ifdef PY_DELETEOBJECT_PATCH
48369 : PY_DELETEOBJECT_PATCH(&lsa_DeleteObject_Type);
48370 : #endif
48371 : #ifdef PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH
48372 : PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH(&lsa_EnumAccountsWithUserRight_Type);
48373 : #endif
48374 : #ifdef PY_ENUMACCOUNTRIGHTS_PATCH
48375 : PY_ENUMACCOUNTRIGHTS_PATCH(&lsa_EnumAccountRights_Type);
48376 : #endif
48377 : #ifdef PY_ADDACCOUNTRIGHTS_PATCH
48378 : PY_ADDACCOUNTRIGHTS_PATCH(&lsa_AddAccountRights_Type);
48379 : #endif
48380 : #ifdef PY_REMOVEACCOUNTRIGHTS_PATCH
48381 : PY_REMOVEACCOUNTRIGHTS_PATCH(&lsa_RemoveAccountRights_Type);
48382 : #endif
48383 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH
48384 : PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH(&lsa_QueryTrustedDomainInfoBySid_Type);
48385 : #endif
48386 : #ifdef PY_SETTRUSTEDDOMAININFO_PATCH
48387 : PY_SETTRUSTEDDOMAININFO_PATCH(&lsa_SetTrustedDomainInfo_Type);
48388 : #endif
48389 : #ifdef PY_DELETETRUSTEDDOMAIN_PATCH
48390 : PY_DELETETRUSTEDDOMAIN_PATCH(&lsa_DeleteTrustedDomain_Type);
48391 : #endif
48392 : #ifdef PY_STOREPRIVATEDATA_PATCH
48393 : PY_STOREPRIVATEDATA_PATCH(&lsa_StorePrivateData_Type);
48394 : #endif
48395 : #ifdef PY_RETRIEVEPRIVATEDATA_PATCH
48396 : PY_RETRIEVEPRIVATEDATA_PATCH(&lsa_RetrievePrivateData_Type);
48397 : #endif
48398 : #ifdef PY_OPENPOLICY2_PATCH
48399 : PY_OPENPOLICY2_PATCH(&lsa_OpenPolicy2_Type);
48400 : #endif
48401 : #ifdef PY_GETUSERNAME_PATCH
48402 : PY_GETUSERNAME_PATCH(&lsa_GetUserName_Type);
48403 : #endif
48404 : #ifdef PY_QUERYINFOPOLICY2_PATCH
48405 : PY_QUERYINFOPOLICY2_PATCH(&lsa_QueryInfoPolicy2_Type);
48406 : #endif
48407 : #ifdef PY_SETINFOPOLICY2_PATCH
48408 : PY_SETINFOPOLICY2_PATCH(&lsa_SetInfoPolicy2_Type);
48409 : #endif
48410 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH
48411 : PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_QueryTrustedDomainInfoByName_Type);
48412 : #endif
48413 : #ifdef PY_SETTRUSTEDDOMAININFOBYNAME_PATCH
48414 : PY_SETTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_SetTrustedDomainInfoByName_Type);
48415 : #endif
48416 : #ifdef PY_ENUMTRUSTEDDOMAINSEX_PATCH
48417 : PY_ENUMTRUSTEDDOMAINSEX_PATCH(&lsa_EnumTrustedDomainsEx_Type);
48418 : #endif
48419 : #ifdef PY_CREATETRUSTEDDOMAINEX_PATCH
48420 : PY_CREATETRUSTEDDOMAINEX_PATCH(&lsa_CreateTrustedDomainEx_Type);
48421 : #endif
48422 : #ifdef PY_CLOSETRUSTEDDOMAINEX_PATCH
48423 : PY_CLOSETRUSTEDDOMAINEX_PATCH(&lsa_CloseTrustedDomainEx_Type);
48424 : #endif
48425 : #ifdef PY_QUERYDOMAININFORMATIONPOLICY_PATCH
48426 : PY_QUERYDOMAININFORMATIONPOLICY_PATCH(&lsa_QueryDomainInformationPolicy_Type);
48427 : #endif
48428 : #ifdef PY_SETDOMAININFORMATIONPOLICY_PATCH
48429 : PY_SETDOMAININFORMATIONPOLICY_PATCH(&lsa_SetDomainInformationPolicy_Type);
48430 : #endif
48431 : #ifdef PY_OPENTRUSTEDDOMAINBYNAME_PATCH
48432 : PY_OPENTRUSTEDDOMAINBYNAME_PATCH(&lsa_OpenTrustedDomainByName_Type);
48433 : #endif
48434 : #ifdef PY_LOOKUPSIDS2_PATCH
48435 : PY_LOOKUPSIDS2_PATCH(&lsa_LookupSids2_Type);
48436 : #endif
48437 : #ifdef PY_LOOKUPNAMES2_PATCH
48438 : PY_LOOKUPNAMES2_PATCH(&lsa_LookupNames2_Type);
48439 : #endif
48440 : #ifdef PY_CREATETRUSTEDDOMAINEX2_PATCH
48441 : PY_CREATETRUSTEDDOMAINEX2_PATCH(&lsa_CreateTrustedDomainEx2_Type);
48442 : #endif
48443 : #ifdef PY_LOOKUPNAMES3_PATCH
48444 : PY_LOOKUPNAMES3_PATCH(&lsa_LookupNames3_Type);
48445 : #endif
48446 : #ifdef PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH
48447 : PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRQueryForestTrustInformation_Type);
48448 : #endif
48449 : #ifdef PY_LSARSETFORESTTRUSTINFORMATION_PATCH
48450 : PY_LSARSETFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRSetForestTrustInformation_Type);
48451 : #endif
48452 : #ifdef PY_LOOKUPSIDS3_PATCH
48453 : PY_LOOKUPSIDS3_PATCH(&lsa_LookupSids3_Type);
48454 : #endif
48455 : #ifdef PY_LOOKUPNAMES4_PATCH
48456 : PY_LOOKUPNAMES4_PATCH(&lsa_LookupNames4_Type);
48457 : #endif
48458 : #ifdef PY_LSARPC_PATCH
48459 : PY_LSARPC_PATCH(&lsarpc_InterfaceType);
48460 : #endif
48461 : #ifdef PY_LSARPC_ABSTRACT_SYNTAX_PATCH
48462 : PY_LSARPC_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
48463 : #endif
48464 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
48465 : PY_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
48466 : #endif
48467 :
48468 7406 : m = PyModule_Create(&moduledef);
48469 7406 : if (m == NULL)
48470 0 : goto out;
48471 :
48472 7406 : 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)));
48473 7406 : 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)));
48474 7406 : 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)));
48475 7406 : PyModule_AddObject(m, "LSA_POLICY_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_LOOKUP_NAMES)));
48476 7406 : 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)));
48477 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_VIEW)));
48478 7406 : 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)));
48479 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS)));
48480 7406 : 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)));
48481 7406 : PyModule_AddObject(m, "LSA_SECRET_READ", PyLong_FromLong((LSA_SECRET_QUERY_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
48482 7406 : PyModule_AddObject(m, "LSA_SECRET_WRITE", PyLong_FromLong((LSA_SECRET_SET_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
48483 7406 : PyModule_AddObject(m, "LSA_SECRET_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS)));
48484 7406 : 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)));
48485 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_READ", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|STANDARD_RIGHTS_READ_ACCESS)));
48486 7406 : 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)));
48487 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_EXECUTE", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|LSA_TRUSTED_QUERY_POSIX|STANDARD_RIGHTS_READ_ACCESS)));
48488 7406 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_MULTIPLIER", PyLong_FromUnsignedLongLong(60));
48489 7406 : PyModule_AddObject(m, "LSA_REF_DOMAIN_LIST_MULTIPLIER", PyLong_FromUnsignedLongLong(32));
48490 7406 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER", PyLong_FromUnsignedLongLong(82));
48491 7406 : PyModule_AddObject(m, "LSA_TLN_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_NEW|LSA_TLN_DISABLED_ADMIN|LSA_TLN_DISABLED_CONFLICT)));
48492 7406 : PyModule_AddObject(m, "LSA_SID_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SID_DISABLED_ADMIN|LSA_SID_DISABLED_CONFLICT)));
48493 7406 : PyModule_AddObject(m, "LSA_NB_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)(LSA_NB_DISABLED_ADMIN|LSA_NB_DISABLED_CONFLICT)));
48494 7406 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_NO_DNS", PyLong_FromUnsignedLongLong(0x00000001));
48495 7406 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_DNS", PyLong_FromUnsignedLongLong(0x00000002));
48496 7406 : PyModule_AddObject(m, "LSA_LOOKUP_OPTIONS_NO_ISOLATED", PyLong_FromUnsignedLongLong(0x80000000));
48497 7406 : PyModule_AddObject(m, "LSA_POLICY_VIEW_LOCAL_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_LOCAL_INFORMATION));
48498 7406 : PyModule_AddObject(m, "LSA_POLICY_VIEW_AUDIT_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_VIEW_AUDIT_INFORMATION));
48499 7406 : PyModule_AddObject(m, "LSA_POLICY_GET_PRIVATE_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_GET_PRIVATE_INFORMATION));
48500 7406 : PyModule_AddObject(m, "LSA_POLICY_TRUST_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_TRUST_ADMIN));
48501 7406 : PyModule_AddObject(m, "LSA_POLICY_CREATE_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_ACCOUNT));
48502 7406 : PyModule_AddObject(m, "LSA_POLICY_CREATE_SECRET", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_SECRET));
48503 7406 : PyModule_AddObject(m, "LSA_POLICY_CREATE_PRIVILEGE", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_CREATE_PRIVILEGE));
48504 7406 : PyModule_AddObject(m, "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS));
48505 7406 : PyModule_AddObject(m, "LSA_POLICY_SET_AUDIT_REQUIREMENTS", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SET_AUDIT_REQUIREMENTS));
48506 7406 : PyModule_AddObject(m, "LSA_POLICY_AUDIT_LOG_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_AUDIT_LOG_ADMIN));
48507 7406 : PyModule_AddObject(m, "LSA_POLICY_SERVER_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_SERVER_ADMIN));
48508 7406 : PyModule_AddObject(m, "LSA_POLICY_LOOKUP_NAMES", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_LOOKUP_NAMES));
48509 7406 : PyModule_AddObject(m, "LSA_POLICY_NOTIFICATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_NOTIFICATION));
48510 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_VIEW", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_VIEW));
48511 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_PRIVILEGES", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_PRIVILEGES));
48512 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_QUOTAS", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_QUOTAS));
48513 7406 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS", PyLong_FromUnsignedLongLong((uint32_t)LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS));
48514 7406 : PyModule_AddObject(m, "LSA_SECRET_SET_VALUE", PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_SET_VALUE));
48515 7406 : PyModule_AddObject(m, "LSA_SECRET_QUERY_VALUE", PyLong_FromUnsignedLongLong((uint32_t)LSA_SECRET_QUERY_VALUE));
48516 7406 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_DOMAIN_NAME", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_DOMAIN_NAME));
48517 7406 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_CONTROLLERS));
48518 7406 : PyModule_AddObject(m, "LSA_TRUSTED_SET_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_CONTROLLERS));
48519 7406 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_POSIX", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_POSIX));
48520 7406 : PyModule_AddObject(m, "LSA_TRUSTED_SET_POSIX", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_POSIX));
48521 7406 : PyModule_AddObject(m, "LSA_TRUSTED_SET_AUTH", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_SET_AUTH));
48522 7406 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_AUTH", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUSTED_QUERY_AUTH));
48523 7406 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_NONE", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_NONE));
48524 7406 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_SUCCESS", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_SUCCESS));
48525 7406 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_FAILURE));
48526 7406 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_ALL", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_ALL));
48527 7406 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)LSA_AUDIT_POLICY_CLEAR));
48528 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SYSTEM", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SYSTEM));
48529 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_LOGON", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_LOGON));
48530 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS));
48531 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS));
48532 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_PROCCESS_TRACKING", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_PROCCESS_TRACKING));
48533 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES));
48534 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT));
48535 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS));
48536 7406 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_LOGON", PyLong_FromLong((uint16_t)LSA_AUDIT_CATEGORY_ACCOUNT_LOGON));
48537 7406 : PyModule_AddObject(m, "LSA_ROLE_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_BACKUP));
48538 7406 : PyModule_AddObject(m, "LSA_ROLE_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)LSA_ROLE_PRIMARY));
48539 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_LOG", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_LOG));
48540 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_EVENTS", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_EVENTS));
48541 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DOMAIN));
48542 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_PD", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_PD));
48543 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_ACCOUNT_DOMAIN));
48544 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_ROLE", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_ROLE));
48545 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_REPLICA", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_REPLICA));
48546 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_QUOTA", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_QUOTA));
48547 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_MOD", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_MOD));
48548 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_SET", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_SET));
48549 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_QUERY", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_AUDIT_FULL_QUERY));
48550 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DNS));
48551 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS_INT", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_DNS_INT));
48552 7406 : PyModule_AddObject(m, "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)LSA_POLICY_INFO_L_ACCOUNT_DOMAIN));
48553 7406 : PyModule_AddObject(m, "SID_NAME_USE_NONE", PyLong_FromLong((uint16_t)SID_NAME_USE_NONE));
48554 7406 : PyModule_AddObject(m, "SID_NAME_USER", PyLong_FromLong((uint16_t)SID_NAME_USER));
48555 7406 : PyModule_AddObject(m, "SID_NAME_DOM_GRP", PyLong_FromLong((uint16_t)SID_NAME_DOM_GRP));
48556 7406 : PyModule_AddObject(m, "SID_NAME_DOMAIN", PyLong_FromLong((uint16_t)SID_NAME_DOMAIN));
48557 7406 : PyModule_AddObject(m, "SID_NAME_ALIAS", PyLong_FromLong((uint16_t)SID_NAME_ALIAS));
48558 7406 : PyModule_AddObject(m, "SID_NAME_WKN_GRP", PyLong_FromLong((uint16_t)SID_NAME_WKN_GRP));
48559 7406 : PyModule_AddObject(m, "SID_NAME_DELETED", PyLong_FromLong((uint16_t)SID_NAME_DELETED));
48560 7406 : PyModule_AddObject(m, "SID_NAME_INVALID", PyLong_FromLong((uint16_t)SID_NAME_INVALID));
48561 7406 : PyModule_AddObject(m, "SID_NAME_UNKNOWN", PyLong_FromLong((uint16_t)SID_NAME_UNKNOWN));
48562 7406 : PyModule_AddObject(m, "SID_NAME_COMPUTER", PyLong_FromLong((uint16_t)SID_NAME_COMPUTER));
48563 7406 : PyModule_AddObject(m, "SID_NAME_LABEL", PyLong_FromLong((uint16_t)SID_NAME_LABEL));
48564 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_ALL", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_ALL));
48565 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_DOMAINS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_DOMAINS_ONLY));
48566 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY));
48567 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY));
48568 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY));
48569 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2));
48570 7406 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC", PyLong_FromLong((uint16_t)LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC));
48571 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_NAME", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_NAME));
48572 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS));
48573 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET));
48574 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_PASSWORD", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_PASSWORD));
48575 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_BASIC", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_BASIC));
48576 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX));
48577 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO));
48578 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO));
48579 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL));
48580 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL));
48581 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL));
48582 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL));
48583 7406 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES", PyLong_FromLong((uint16_t)LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES));
48584 7406 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_INBOUND", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_INBOUND));
48585 7406 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_OUTBOUND", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_DIRECTION_OUTBOUND));
48586 7406 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DOWNLEVEL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DOWNLEVEL));
48587 7406 : PyModule_AddObject(m, "LSA_TRUST_TYPE_UPLEVEL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_UPLEVEL));
48588 7406 : PyModule_AddObject(m, "LSA_TRUST_TYPE_MIT", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_MIT));
48589 7406 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DCE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_TYPE_DCE));
48590 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE));
48591 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY));
48592 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN));
48593 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE));
48594 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION));
48595 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_WITHIN_FOREST));
48596 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL));
48597 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION));
48598 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION));
48599 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_PIM_TRUST", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_PIM_TRUST));
48600 7406 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION));
48601 7406 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NONE", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NONE));
48602 7406 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NT4OWF", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_NT4OWF));
48603 7406 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_CLEAR));
48604 7406 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_VERSION", PyLong_FromUnsignedLongLong((uint32_t)TRUST_AUTH_TYPE_VERSION));
48605 7406 : PyModule_AddObject(m, "LSA_POLICY_KERBEROS_VALIDATE_CLIENT", PyLong_FromUnsignedLongLong((uint32_t)LSA_POLICY_KERBEROS_VALIDATE_CLIENT));
48606 7406 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_EFS", PyLong_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_EFS));
48607 7406 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_KERBEROS", PyLong_FromLong((uint16_t)LSA_DOMAIN_INFO_POLICY_KERBEROS));
48608 7406 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES", PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES));
48609 7406 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL));
48610 7406 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_1", PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_1));
48611 7406 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_2", PyLong_FromUnsignedLongLong((uint32_t)LSA_CLIENT_REVISION_2));
48612 7406 : PyModule_AddObject(m, "LSA_TLN_DISABLED_NEW", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_NEW));
48613 7406 : PyModule_AddObject(m, "LSA_TLN_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_ADMIN));
48614 7406 : PyModule_AddObject(m, "LSA_TLN_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_TLN_DISABLED_CONFLICT));
48615 7406 : PyModule_AddObject(m, "LSA_SID_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_ADMIN));
48616 7406 : PyModule_AddObject(m, "LSA_SID_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_SID_DISABLED_CONFLICT));
48617 7406 : PyModule_AddObject(m, "LSA_NB_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_ADMIN));
48618 7406 : PyModule_AddObject(m, "LSA_NB_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)LSA_NB_DISABLED_CONFLICT));
48619 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME));
48620 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX));
48621 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_DOMAIN_INFO", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_DOMAIN_INFO));
48622 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_RECORD_TYPE_LAST", PyLong_FromLong((uint16_t)LSA_FOREST_TRUST_RECORD_TYPE_LAST));
48623 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_TDO", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_TDO));
48624 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_XREF", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_XREF));
48625 7406 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_OTHER", PyLong_FromUnsignedLongLong((uint32_t)LSA_FOREST_TRUST_COLLISION_OTHER));
48626 6169 : Py_INCREF((PyObject *)(void *)&lsa_String_Type);
48627 7406 : PyModule_AddObject(m, "String", (PyObject *)(void *)&lsa_String_Type);
48628 6169 : Py_INCREF((PyObject *)(void *)&lsa_StringLarge_Type);
48629 7406 : PyModule_AddObject(m, "StringLarge", (PyObject *)(void *)&lsa_StringLarge_Type);
48630 6169 : Py_INCREF((PyObject *)(void *)&lsa_Strings_Type);
48631 7406 : PyModule_AddObject(m, "Strings", (PyObject *)(void *)&lsa_Strings_Type);
48632 6169 : Py_INCREF((PyObject *)(void *)&lsa_AsciiString_Type);
48633 7406 : PyModule_AddObject(m, "AsciiString", (PyObject *)(void *)&lsa_AsciiString_Type);
48634 6169 : Py_INCREF((PyObject *)(void *)&lsa_AsciiStringLarge_Type);
48635 7406 : PyModule_AddObject(m, "AsciiStringLarge", (PyObject *)(void *)&lsa_AsciiStringLarge_Type);
48636 6169 : Py_INCREF((PyObject *)(void *)&lsa_BinaryString_Type);
48637 7406 : PyModule_AddObject(m, "BinaryString", (PyObject *)(void *)&lsa_BinaryString_Type);
48638 6169 : Py_INCREF((PyObject *)(void *)&lsa_LUID_Type);
48639 7406 : PyModule_AddObject(m, "LUID", (PyObject *)(void *)&lsa_LUID_Type);
48640 6169 : Py_INCREF((PyObject *)(void *)&lsa_PrivEntry_Type);
48641 7406 : PyModule_AddObject(m, "PrivEntry", (PyObject *)(void *)&lsa_PrivEntry_Type);
48642 6169 : Py_INCREF((PyObject *)(void *)&lsa_PrivArray_Type);
48643 7406 : PyModule_AddObject(m, "PrivArray", (PyObject *)(void *)&lsa_PrivArray_Type);
48644 6169 : Py_INCREF((PyObject *)(void *)&lsa_QosInfo_Type);
48645 7406 : PyModule_AddObject(m, "QosInfo", (PyObject *)(void *)&lsa_QosInfo_Type);
48646 6169 : Py_INCREF((PyObject *)(void *)&lsa_ObjectAttribute_Type);
48647 7406 : PyModule_AddObject(m, "ObjectAttribute", (PyObject *)(void *)&lsa_ObjectAttribute_Type);
48648 6169 : Py_INCREF((PyObject *)(void *)&lsa_AuditLogInfo_Type);
48649 7406 : PyModule_AddObject(m, "AuditLogInfo", (PyObject *)(void *)&lsa_AuditLogInfo_Type);
48650 6169 : Py_INCREF((PyObject *)(void *)&lsa_AuditEventsInfo_Type);
48651 7406 : PyModule_AddObject(m, "AuditEventsInfo", (PyObject *)(void *)&lsa_AuditEventsInfo_Type);
48652 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfo_Type);
48653 7406 : PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&lsa_DomainInfo_Type);
48654 6169 : Py_INCREF((PyObject *)(void *)&lsa_PDAccountInfo_Type);
48655 7406 : PyModule_AddObject(m, "PDAccountInfo", (PyObject *)(void *)&lsa_PDAccountInfo_Type);
48656 6169 : Py_INCREF((PyObject *)(void *)&lsa_ServerRole_Type);
48657 7406 : PyModule_AddObject(m, "ServerRole", (PyObject *)(void *)&lsa_ServerRole_Type);
48658 6169 : Py_INCREF((PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
48659 7406 : PyModule_AddObject(m, "ReplicaSourceInfo", (PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
48660 6169 : Py_INCREF((PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
48661 7406 : PyModule_AddObject(m, "DefaultQuotaInfo", (PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
48662 6169 : Py_INCREF((PyObject *)(void *)&lsa_ModificationInfo_Type);
48663 7406 : PyModule_AddObject(m, "ModificationInfo", (PyObject *)(void *)&lsa_ModificationInfo_Type);
48664 6169 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
48665 7406 : PyModule_AddObject(m, "AuditFullSetInfo", (PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
48666 6169 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
48667 7406 : PyModule_AddObject(m, "AuditFullQueryInfo", (PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
48668 6169 : Py_INCREF((PyObject *)(void *)&lsa_DnsDomainInfo_Type);
48669 7406 : PyModule_AddObject(m, "DnsDomainInfo", (PyObject *)(void *)&lsa_DnsDomainInfo_Type);
48670 6169 : Py_INCREF((PyObject *)(void *)&lsa_PolicyInformation_Type);
48671 7406 : PyModule_AddObject(m, "PolicyInformation", (PyObject *)(void *)&lsa_PolicyInformation_Type);
48672 6169 : Py_INCREF((PyObject *)(void *)&lsa_SidPtr_Type);
48673 7406 : PyModule_AddObject(m, "SidPtr", (PyObject *)(void *)&lsa_SidPtr_Type);
48674 6169 : Py_INCREF((PyObject *)(void *)&lsa_SidArray_Type);
48675 7406 : PyModule_AddObject(m, "SidArray", (PyObject *)(void *)&lsa_SidArray_Type);
48676 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainList_Type);
48677 7406 : PyModule_AddObject(m, "DomainList", (PyObject *)(void *)&lsa_DomainList_Type);
48678 6169 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid_Type);
48679 7406 : PyModule_AddObject(m, "TranslatedSid", (PyObject *)(void *)&lsa_TranslatedSid_Type);
48680 6169 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray_Type);
48681 7406 : PyModule_AddObject(m, "TransSidArray", (PyObject *)(void *)&lsa_TransSidArray_Type);
48682 6169 : Py_INCREF((PyObject *)(void *)&lsa_RefDomainList_Type);
48683 7406 : PyModule_AddObject(m, "RefDomainList", (PyObject *)(void *)&lsa_RefDomainList_Type);
48684 6169 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName_Type);
48685 7406 : PyModule_AddObject(m, "TranslatedName", (PyObject *)(void *)&lsa_TranslatedName_Type);
48686 6169 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray_Type);
48687 7406 : PyModule_AddObject(m, "TransNameArray", (PyObject *)(void *)&lsa_TransNameArray_Type);
48688 6169 : Py_INCREF((PyObject *)(void *)&lsa_LUIDAttribute_Type);
48689 7406 : PyModule_AddObject(m, "LUIDAttribute", (PyObject *)(void *)&lsa_LUIDAttribute_Type);
48690 6169 : Py_INCREF((PyObject *)(void *)&lsa_PrivilegeSet_Type);
48691 7406 : PyModule_AddObject(m, "PrivilegeSet", (PyObject *)(void *)&lsa_PrivilegeSet_Type);
48692 6169 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_Type);
48693 7406 : PyModule_AddObject(m, "DATA_BUF", (PyObject *)(void *)&lsa_DATA_BUF_Type);
48694 6169 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF2_Type);
48695 7406 : PyModule_AddObject(m, "DATA_BUF2", (PyObject *)(void *)&lsa_DATA_BUF2_Type);
48696 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
48697 7406 : PyModule_AddObject(m, "TrustDomainInfoName", (PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
48698 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
48699 7406 : PyModule_AddObject(m, "TrustDomainInfoControllers", (PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
48700 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
48701 7406 : PyModule_AddObject(m, "TrustDomainInfoPosixOffset", (PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
48702 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
48703 7406 : PyModule_AddObject(m, "TrustDomainInfoPassword", (PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
48704 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
48705 7406 : PyModule_AddObject(m, "TrustDomainInfoBasic", (PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
48706 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
48707 7406 : PyModule_AddObject(m, "TrustDomainInfoInfoEx", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
48708 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
48709 7406 : PyModule_AddObject(m, "TrustDomainInfoBuffer", (PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
48710 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
48711 7406 : PyModule_AddObject(m, "TrustDomainInfoAuthInfo", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
48712 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
48713 7406 : PyModule_AddObject(m, "TrustDomainInfoFullInfo", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
48714 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
48715 7406 : PyModule_AddObject(m, "TrustDomainInfoAuthInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
48716 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
48717 7406 : PyModule_AddObject(m, "TrustDomainInfoFullInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
48718 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
48719 7406 : PyModule_AddObject(m, "TrustDomainInfoInfoEx2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
48720 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
48721 7406 : PyModule_AddObject(m, "TrustDomainInfoFullInfo2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
48722 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
48723 7406 : PyModule_AddObject(m, "TrustDomainInfoSupportedEncTypes", (PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
48724 6169 : Py_INCREF((PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
48725 7406 : PyModule_AddObject(m, "TrustedDomainInfo", (PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
48726 6169 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
48727 7406 : PyModule_AddObject(m, "DATA_BUF_PTR", (PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
48728 6169 : Py_INCREF((PyObject *)(void *)&lsa_RightAttribute_Type);
48729 7406 : PyModule_AddObject(m, "RightAttribute", (PyObject *)(void *)&lsa_RightAttribute_Type);
48730 6169 : Py_INCREF((PyObject *)(void *)&lsa_RightSet_Type);
48731 7406 : PyModule_AddObject(m, "RightSet", (PyObject *)(void *)&lsa_RightSet_Type);
48732 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainListEx_Type);
48733 7406 : PyModule_AddObject(m, "DomainListEx", (PyObject *)(void *)&lsa_DomainListEx_Type);
48734 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
48735 7406 : PyModule_AddObject(m, "DomainInfoKerberos", (PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
48736 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoEfs_Type);
48737 7406 : PyModule_AddObject(m, "DomainInfoEfs", (PyObject *)(void *)&lsa_DomainInfoEfs_Type);
48738 6169 : Py_INCREF((PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
48739 7406 : PyModule_AddObject(m, "DomainInformationPolicy", (PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
48740 6169 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName2_Type);
48741 7406 : PyModule_AddObject(m, "TranslatedName2", (PyObject *)(void *)&lsa_TranslatedName2_Type);
48742 6169 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray2_Type);
48743 7406 : PyModule_AddObject(m, "TransNameArray2", (PyObject *)(void *)&lsa_TransNameArray2_Type);
48744 6169 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid2_Type);
48745 7406 : PyModule_AddObject(m, "TranslatedSid2", (PyObject *)(void *)&lsa_TranslatedSid2_Type);
48746 6169 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray2_Type);
48747 7406 : PyModule_AddObject(m, "TransSidArray2", (PyObject *)(void *)&lsa_TransSidArray2_Type);
48748 6169 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid3_Type);
48749 7406 : PyModule_AddObject(m, "TranslatedSid3", (PyObject *)(void *)&lsa_TranslatedSid3_Type);
48750 6169 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray3_Type);
48751 7406 : PyModule_AddObject(m, "TransSidArray3", (PyObject *)(void *)&lsa_TransSidArray3_Type);
48752 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
48753 7406 : PyModule_AddObject(m, "ForestTrustBinaryData", (PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
48754 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
48755 7406 : PyModule_AddObject(m, "ForestTrustDomainInfo", (PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
48756 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustData_Type);
48757 7406 : PyModule_AddObject(m, "ForestTrustData", (PyObject *)(void *)&lsa_ForestTrustData_Type);
48758 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustRecord_Type);
48759 7406 : PyModule_AddObject(m, "ForestTrustRecord", (PyObject *)(void *)&lsa_ForestTrustRecord_Type);
48760 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustInformation_Type);
48761 7406 : PyModule_AddObject(m, "ForestTrustInformation", (PyObject *)(void *)&lsa_ForestTrustInformation_Type);
48762 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
48763 7406 : PyModule_AddObject(m, "ForestTrustCollisionRecord", (PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
48764 6169 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
48765 7406 : PyModule_AddObject(m, "ForestTrustCollisionInfo", (PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
48766 6169 : Py_INCREF((PyObject *)(void *)&lsa_Close_Type);
48767 7406 : PyModule_AddObject(m, "Close", (PyObject *)(void *)&lsa_Close_Type);
48768 6169 : Py_INCREF((PyObject *)(void *)&lsa_Delete_Type);
48769 7406 : PyModule_AddObject(m, "Delete", (PyObject *)(void *)&lsa_Delete_Type);
48770 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivs_Type);
48771 7406 : PyModule_AddObject(m, "EnumPrivs", (PyObject *)(void *)&lsa_EnumPrivs_Type);
48772 6169 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecurity_Type);
48773 7406 : PyModule_AddObject(m, "QuerySecurity", (PyObject *)(void *)&lsa_QuerySecurity_Type);
48774 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetSecObj_Type);
48775 7406 : PyModule_AddObject(m, "SetSecObj", (PyObject *)(void *)&lsa_SetSecObj_Type);
48776 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy_Type);
48777 7406 : PyModule_AddObject(m, "OpenPolicy", (PyObject *)(void *)&lsa_OpenPolicy_Type);
48778 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
48779 7406 : PyModule_AddObject(m, "QueryInfoPolicy", (PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
48780 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy_Type);
48781 7406 : PyModule_AddObject(m, "SetInfoPolicy", (PyObject *)(void *)&lsa_SetInfoPolicy_Type);
48782 6169 : Py_INCREF((PyObject *)(void *)&lsa_CreateAccount_Type);
48783 7406 : PyModule_AddObject(m, "CreateAccount", (PyObject *)(void *)&lsa_CreateAccount_Type);
48784 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccounts_Type);
48785 7406 : PyModule_AddObject(m, "EnumAccounts", (PyObject *)(void *)&lsa_EnumAccounts_Type);
48786 6169 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
48787 7406 : PyModule_AddObject(m, "CreateTrustedDomain", (PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
48788 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustDom_Type);
48789 7406 : PyModule_AddObject(m, "EnumTrustDom", (PyObject *)(void *)&lsa_EnumTrustDom_Type);
48790 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames_Type);
48791 7406 : PyModule_AddObject(m, "LookupNames", (PyObject *)(void *)&lsa_LookupNames_Type);
48792 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids_Type);
48793 7406 : PyModule_AddObject(m, "LookupSids", (PyObject *)(void *)&lsa_LookupSids_Type);
48794 6169 : Py_INCREF((PyObject *)(void *)&lsa_CreateSecret_Type);
48795 7406 : PyModule_AddObject(m, "CreateSecret", (PyObject *)(void *)&lsa_CreateSecret_Type);
48796 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenAccount_Type);
48797 7406 : PyModule_AddObject(m, "OpenAccount", (PyObject *)(void *)&lsa_OpenAccount_Type);
48798 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
48799 7406 : PyModule_AddObject(m, "EnumPrivsAccount", (PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
48800 6169 : Py_INCREF((PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
48801 7406 : PyModule_AddObject(m, "AddPrivilegesToAccount", (PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
48802 6169 : Py_INCREF((PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
48803 7406 : PyModule_AddObject(m, "RemovePrivilegesFromAccount", (PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
48804 6169 : Py_INCREF((PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
48805 7406 : PyModule_AddObject(m, "GetSystemAccessAccount", (PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
48806 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
48807 7406 : PyModule_AddObject(m, "SetSystemAccessAccount", (PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
48808 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
48809 7406 : PyModule_AddObject(m, "OpenTrustedDomain", (PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
48810 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
48811 7406 : PyModule_AddObject(m, "QueryTrustedDomainInfo", (PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
48812 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
48813 7406 : PyModule_AddObject(m, "SetInformationTrustedDomain", (PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
48814 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenSecret_Type);
48815 7406 : PyModule_AddObject(m, "OpenSecret", (PyObject *)(void *)&lsa_OpenSecret_Type);
48816 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetSecret_Type);
48817 7406 : PyModule_AddObject(m, "SetSecret", (PyObject *)(void *)&lsa_SetSecret_Type);
48818 6169 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecret_Type);
48819 7406 : PyModule_AddObject(m, "QuerySecret", (PyObject *)(void *)&lsa_QuerySecret_Type);
48820 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivValue_Type);
48821 7406 : PyModule_AddObject(m, "LookupPrivValue", (PyObject *)(void *)&lsa_LookupPrivValue_Type);
48822 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivName_Type);
48823 7406 : PyModule_AddObject(m, "LookupPrivName", (PyObject *)(void *)&lsa_LookupPrivName_Type);
48824 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
48825 7406 : PyModule_AddObject(m, "LookupPrivDisplayName", (PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
48826 6169 : Py_INCREF((PyObject *)(void *)&lsa_DeleteObject_Type);
48827 7406 : PyModule_AddObject(m, "DeleteObject", (PyObject *)(void *)&lsa_DeleteObject_Type);
48828 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
48829 7406 : PyModule_AddObject(m, "EnumAccountsWithUserRight", (PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
48830 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountRights_Type);
48831 7406 : PyModule_AddObject(m, "EnumAccountRights", (PyObject *)(void *)&lsa_EnumAccountRights_Type);
48832 6169 : Py_INCREF((PyObject *)(void *)&lsa_AddAccountRights_Type);
48833 7406 : PyModule_AddObject(m, "AddAccountRights", (PyObject *)(void *)&lsa_AddAccountRights_Type);
48834 6169 : Py_INCREF((PyObject *)(void *)&lsa_RemoveAccountRights_Type);
48835 7406 : PyModule_AddObject(m, "RemoveAccountRights", (PyObject *)(void *)&lsa_RemoveAccountRights_Type);
48836 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
48837 7406 : PyModule_AddObject(m, "QueryTrustedDomainInfoBySid", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
48838 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
48839 7406 : PyModule_AddObject(m, "SetTrustedDomainInfo", (PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
48840 6169 : Py_INCREF((PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
48841 7406 : PyModule_AddObject(m, "DeleteTrustedDomain", (PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
48842 6169 : Py_INCREF((PyObject *)(void *)&lsa_StorePrivateData_Type);
48843 7406 : PyModule_AddObject(m, "StorePrivateData", (PyObject *)(void *)&lsa_StorePrivateData_Type);
48844 6169 : Py_INCREF((PyObject *)(void *)&lsa_RetrievePrivateData_Type);
48845 7406 : PyModule_AddObject(m, "RetrievePrivateData", (PyObject *)(void *)&lsa_RetrievePrivateData_Type);
48846 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy2_Type);
48847 7406 : PyModule_AddObject(m, "OpenPolicy2", (PyObject *)(void *)&lsa_OpenPolicy2_Type);
48848 6169 : Py_INCREF((PyObject *)(void *)&lsa_GetUserName_Type);
48849 7406 : PyModule_AddObject(m, "GetUserName", (PyObject *)(void *)&lsa_GetUserName_Type);
48850 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
48851 7406 : PyModule_AddObject(m, "QueryInfoPolicy2", (PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
48852 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
48853 7406 : PyModule_AddObject(m, "SetInfoPolicy2", (PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
48854 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
48855 7406 : PyModule_AddObject(m, "QueryTrustedDomainInfoByName", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
48856 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
48857 7406 : PyModule_AddObject(m, "SetTrustedDomainInfoByName", (PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
48858 6169 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
48859 7406 : PyModule_AddObject(m, "EnumTrustedDomainsEx", (PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
48860 6169 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
48861 7406 : PyModule_AddObject(m, "CreateTrustedDomainEx", (PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
48862 6169 : Py_INCREF((PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
48863 7406 : PyModule_AddObject(m, "CloseTrustedDomainEx", (PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
48864 6169 : Py_INCREF((PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
48865 7406 : PyModule_AddObject(m, "QueryDomainInformationPolicy", (PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
48866 6169 : Py_INCREF((PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
48867 7406 : PyModule_AddObject(m, "SetDomainInformationPolicy", (PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
48868 6169 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
48869 7406 : PyModule_AddObject(m, "OpenTrustedDomainByName", (PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
48870 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids2_Type);
48871 7406 : PyModule_AddObject(m, "LookupSids2", (PyObject *)(void *)&lsa_LookupSids2_Type);
48872 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames2_Type);
48873 7406 : PyModule_AddObject(m, "LookupNames2", (PyObject *)(void *)&lsa_LookupNames2_Type);
48874 6169 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
48875 7406 : PyModule_AddObject(m, "CreateTrustedDomainEx2", (PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
48876 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames3_Type);
48877 7406 : PyModule_AddObject(m, "LookupNames3", (PyObject *)(void *)&lsa_LookupNames3_Type);
48878 6169 : Py_INCREF((PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
48879 7406 : PyModule_AddObject(m, "lsaRQueryForestTrustInformation", (PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
48880 6169 : Py_INCREF((PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
48881 7406 : PyModule_AddObject(m, "lsaRSetForestTrustInformation", (PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
48882 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids3_Type);
48883 7406 : PyModule_AddObject(m, "LookupSids3", (PyObject *)(void *)&lsa_LookupSids3_Type);
48884 6169 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames4_Type);
48885 7406 : PyModule_AddObject(m, "LookupNames4", (PyObject *)(void *)&lsa_LookupNames4_Type);
48886 6169 : Py_INCREF((PyObject *)(void *)&lsarpc_InterfaceType);
48887 7406 : PyModule_AddObject(m, "lsarpc", (PyObject *)(void *)&lsarpc_InterfaceType);
48888 6169 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
48889 7406 : PyModule_AddObject(m, "lsarpc_abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
48890 6169 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
48891 7406 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
48892 : #ifdef PY_MOD_LSA_PATCH
48893 : PY_MOD_LSA_PATCH(m);
48894 : #endif
48895 7406 : out:
48896 7406 : Py_XDECREF(dep_samba_dcerpc_misc);
48897 7406 : Py_XDECREF(dep_samba_dcerpc_security);
48898 7406 : Py_XDECREF(dep_talloc);
48899 7406 : Py_XDECREF(dep_samba_dcerpc_base);
48900 7214 : return m;
48901 :
48902 : }
|