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 28043 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 28043 : switch (var_size) {
35 40 : case 8:
36 40 : return UINT64_MAX;
37 2373 : case 4:
38 2373 : return UINT32_MAX;
39 0 : case 2:
40 0 : return UINT16_MAX;
41 25630 : case 1:
42 25630 : 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_TrustDomainInfoAuthInfoInternalAES_Type;
113 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternalAES_Type;
114 : static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type;
115 : static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type;
116 : static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type;
117 : static PyTypeObject lsa_TrustedDomainInfo_Type;
118 : static PyTypeObject lsa_DATA_BUF_PTR_Type;
119 : static PyTypeObject lsa_RightAttribute_Type;
120 : static PyTypeObject lsa_RightSet_Type;
121 : static PyTypeObject lsa_DomainListEx_Type;
122 : static PyTypeObject lsa_DomainInfoQoS_Type;
123 : static PyTypeObject lsa_DomainInfoKerberos_Type;
124 : static PyTypeObject lsa_DomainInfoEfs_Type;
125 : static PyTypeObject lsa_DomainInformationPolicy_Type;
126 : static PyTypeObject lsa_TranslatedName2_Type;
127 : static PyTypeObject lsa_TransNameArray2_Type;
128 : static PyTypeObject lsa_TranslatedSid2_Type;
129 : static PyTypeObject lsa_TransSidArray2_Type;
130 : static PyTypeObject lsa_TranslatedSid3_Type;
131 : static PyTypeObject lsa_TransSidArray3_Type;
132 : static PyTypeObject lsa_ForestTrustBinaryData_Type;
133 : static PyTypeObject lsa_ForestTrustDomainInfo_Type;
134 : static PyTypeObject lsa_ForestTrustData_Type;
135 : static PyTypeObject lsa_ForestTrustRecord_Type;
136 : static PyTypeObject lsa_ForestTrustInformation_Type;
137 : static PyTypeObject lsa_ForestTrustCollisionRecord_Type;
138 : static PyTypeObject lsa_ForestTrustCollisionInfo_Type;
139 : static PyTypeObject lsa_revision_info1_Type;
140 : static PyTypeObject lsa_revision_info_Type;
141 : static PyTypeObject lsa_ForestTrustData2_Type;
142 : static PyTypeObject lsa_ForestTrustRecord2_Type;
143 : static PyTypeObject lsa_ForestTrustInformation2_Type;
144 : static PyTypeObject lsarpc_InterfaceType;
145 : static PyTypeObject lsa_Close_Type;
146 : static PyTypeObject lsa_Delete_Type;
147 : static PyTypeObject lsa_EnumPrivs_Type;
148 : static PyTypeObject lsa_QuerySecurity_Type;
149 : static PyTypeObject lsa_SetSecObj_Type;
150 : static PyTypeObject lsa_OpenPolicy_Type;
151 : static PyTypeObject lsa_QueryInfoPolicy_Type;
152 : static PyTypeObject lsa_SetInfoPolicy_Type;
153 : static PyTypeObject lsa_CreateAccount_Type;
154 : static PyTypeObject lsa_EnumAccounts_Type;
155 : static PyTypeObject lsa_CreateTrustedDomain_Type;
156 : static PyTypeObject lsa_EnumTrustDom_Type;
157 : static PyTypeObject lsa_LookupNames_Type;
158 : static PyTypeObject lsa_LookupSids_Type;
159 : static PyTypeObject lsa_CreateSecret_Type;
160 : static PyTypeObject lsa_OpenAccount_Type;
161 : static PyTypeObject lsa_EnumPrivsAccount_Type;
162 : static PyTypeObject lsa_AddPrivilegesToAccount_Type;
163 : static PyTypeObject lsa_RemovePrivilegesFromAccount_Type;
164 : static PyTypeObject lsa_GetSystemAccessAccount_Type;
165 : static PyTypeObject lsa_SetSystemAccessAccount_Type;
166 : static PyTypeObject lsa_OpenTrustedDomain_Type;
167 : static PyTypeObject lsa_QueryTrustedDomainInfo_Type;
168 : static PyTypeObject lsa_SetInformationTrustedDomain_Type;
169 : static PyTypeObject lsa_OpenSecret_Type;
170 : static PyTypeObject lsa_SetSecret_Type;
171 : static PyTypeObject lsa_QuerySecret_Type;
172 : static PyTypeObject lsa_LookupPrivValue_Type;
173 : static PyTypeObject lsa_LookupPrivName_Type;
174 : static PyTypeObject lsa_LookupPrivDisplayName_Type;
175 : static PyTypeObject lsa_DeleteObject_Type;
176 : static PyTypeObject lsa_EnumAccountsWithUserRight_Type;
177 : static PyTypeObject lsa_EnumAccountRights_Type;
178 : static PyTypeObject lsa_AddAccountRights_Type;
179 : static PyTypeObject lsa_RemoveAccountRights_Type;
180 : static PyTypeObject lsa_QueryTrustedDomainInfoBySid_Type;
181 : static PyTypeObject lsa_SetTrustedDomainInfo_Type;
182 : static PyTypeObject lsa_DeleteTrustedDomain_Type;
183 : static PyTypeObject lsa_StorePrivateData_Type;
184 : static PyTypeObject lsa_RetrievePrivateData_Type;
185 : static PyTypeObject lsa_OpenPolicy2_Type;
186 : static PyTypeObject lsa_GetUserName_Type;
187 : static PyTypeObject lsa_QueryInfoPolicy2_Type;
188 : static PyTypeObject lsa_SetInfoPolicy2_Type;
189 : static PyTypeObject lsa_QueryTrustedDomainInfoByName_Type;
190 : static PyTypeObject lsa_SetTrustedDomainInfoByName_Type;
191 : static PyTypeObject lsa_EnumTrustedDomainsEx_Type;
192 : static PyTypeObject lsa_CreateTrustedDomainEx_Type;
193 : static PyTypeObject lsa_CloseTrustedDomainEx_Type;
194 : static PyTypeObject lsa_QueryDomainInformationPolicy_Type;
195 : static PyTypeObject lsa_SetDomainInformationPolicy_Type;
196 : static PyTypeObject lsa_OpenTrustedDomainByName_Type;
197 : static PyTypeObject lsa_LookupSids2_Type;
198 : static PyTypeObject lsa_LookupNames2_Type;
199 : static PyTypeObject lsa_CreateTrustedDomainEx2_Type;
200 : static PyTypeObject lsa_LookupNames3_Type;
201 : static PyTypeObject lsa_lsaRQueryForestTrustInformation_Type;
202 : static PyTypeObject lsa_lsaRSetForestTrustInformation_Type;
203 : static PyTypeObject lsa_LookupSids3_Type;
204 : static PyTypeObject lsa_LookupNames4_Type;
205 : static PyTypeObject lsa_CreateTrustedDomainEx3_Type;
206 : static PyTypeObject lsa_OpenPolicy3_Type;
207 : static PyTypeObject lsa_lsaRQueryForestTrustInformation2_Type;
208 : static PyTypeObject lsa_lsaRSetForestTrustInformation2_Type;
209 :
210 : static PyTypeObject *BaseObject_Type;
211 : static PyTypeObject *security_descriptor_Type;
212 : static PyTypeObject *dom_sid_Type;
213 : static PyTypeObject *GUID_Type;
214 : static PyTypeObject *policy_handle_Type;
215 : static PyTypeObject *sec_desc_buf_Type;
216 : static PyTypeObject *ndr_pointer_Type;
217 : static PyTypeObject *ClientConnection_Type;
218 : static PyTypeObject *ndr_syntax_id_Type;
219 : #include "librpc/ndr/py_lsa.c"
220 :
221 :
222 302 : static PyObject *py_lsa_String_get_length(PyObject *obj, void *closure)
223 : {
224 302 : struct lsa_String *object = pytalloc_get_ptr(obj);
225 4 : PyObject *py_length;
226 302 : py_length = PyLong_FromLong((uint16_t)(object->length));
227 302 : return py_length;
228 : }
229 :
230 0 : static int py_lsa_String_set_length(PyObject *py_obj, PyObject *value, void *closure)
231 : {
232 0 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
233 0 : if (value == NULL) {
234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
235 0 : return -1;
236 : }
237 : {
238 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
239 0 : if (PyLong_Check(value)) {
240 0 : unsigned long long test_var;
241 0 : test_var = PyLong_AsUnsignedLongLong(value);
242 0 : if (PyErr_Occurred() != NULL) {
243 0 : return -1;
244 : }
245 0 : if (test_var > uint_max) {
246 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
247 : PyLong_Type.tp_name, uint_max, test_var);
248 0 : return -1;
249 : }
250 0 : object->length = test_var;
251 : } else {
252 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
253 : PyLong_Type.tp_name);
254 0 : return -1;
255 : }
256 : }
257 0 : return 0;
258 : }
259 :
260 4 : static PyObject *py_lsa_String_get_size(PyObject *obj, void *closure)
261 : {
262 4 : struct lsa_String *object = pytalloc_get_ptr(obj);
263 4 : PyObject *py_size;
264 4 : py_size = PyLong_FromLong((uint16_t)(object->size));
265 4 : return py_size;
266 : }
267 :
268 0 : static int py_lsa_String_set_size(PyObject *py_obj, PyObject *value, void *closure)
269 : {
270 0 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
271 0 : if (value == NULL) {
272 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
273 0 : return -1;
274 : }
275 : {
276 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
277 0 : if (PyLong_Check(value)) {
278 0 : unsigned long long test_var;
279 0 : test_var = PyLong_AsUnsignedLongLong(value);
280 0 : if (PyErr_Occurred() != NULL) {
281 0 : return -1;
282 : }
283 0 : if (test_var > uint_max) {
284 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
285 : PyLong_Type.tp_name, uint_max, test_var);
286 0 : return -1;
287 : }
288 0 : object->size = test_var;
289 : } else {
290 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
291 : PyLong_Type.tp_name);
292 0 : return -1;
293 : }
294 : }
295 0 : return 0;
296 : }
297 :
298 206 : static PyObject *py_lsa_String_get_string(PyObject *obj, void *closure)
299 : {
300 206 : struct lsa_String *object = pytalloc_get_ptr(obj);
301 4 : PyObject *py_string;
302 206 : if (object->string == NULL) {
303 1 : Py_RETURN_NONE;
304 : }
305 205 : if (object->string == NULL) {
306 0 : py_string = Py_None;
307 0 : Py_INCREF(py_string);
308 : } else {
309 205 : if (object->string == NULL) {
310 0 : py_string = Py_None;
311 0 : Py_INCREF(py_string);
312 : } else {
313 205 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
314 : }
315 : }
316 205 : return py_string;
317 : }
318 :
319 983 : static int py_lsa_String_set_string(PyObject *py_obj, PyObject *value, void *closure)
320 : {
321 983 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
322 983 : if (value == NULL) {
323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
324 0 : return -1;
325 : }
326 983 : if (value == Py_None) {
327 0 : object->string = NULL;
328 : } else {
329 983 : object->string = NULL;
330 : {
331 0 : const char *test_str;
332 0 : const char *talloc_str;
333 983 : PyObject *unicode = NULL;
334 983 : if (PyUnicode_Check(value)) {
335 983 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
336 983 : if (unicode == NULL) {
337 0 : return -1;
338 : }
339 983 : test_str = PyBytes_AS_STRING(unicode);
340 0 : } else if (PyBytes_Check(value)) {
341 0 : test_str = PyBytes_AS_STRING(value);
342 : } else {
343 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
344 0 : return -1;
345 : }
346 983 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
347 983 : if (unicode != NULL) {
348 535 : Py_DECREF(unicode);
349 : }
350 983 : if (talloc_str == NULL) {
351 0 : PyErr_NoMemory();
352 0 : return -1;
353 : }
354 983 : object->string = talloc_str;
355 : }
356 : }
357 983 : return 0;
358 : }
359 :
360 : static PyGetSetDef py_lsa_String_getsetters[] = {
361 : {
362 : .name = discard_const_p(char, "length"),
363 : .get = py_lsa_String_get_length,
364 : .set = py_lsa_String_set_length,
365 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
366 : },
367 : {
368 : .name = discard_const_p(char, "size"),
369 : .get = py_lsa_String_get_size,
370 : .set = py_lsa_String_set_size,
371 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
372 : },
373 : {
374 : .name = discard_const_p(char, "string"),
375 : .get = py_lsa_String_get_string,
376 : .set = py_lsa_String_set_string,
377 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
378 : },
379 : { .name = NULL }
380 : };
381 :
382 386 : static PyObject *py_lsa_String_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
383 : {
384 386 : return pytalloc_new(struct lsa_String, type);
385 : }
386 :
387 1 : static PyObject *py_lsa_String_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
388 : {
389 1 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
390 1 : PyObject *ret = NULL;
391 1 : DATA_BLOB blob;
392 1 : enum ndr_err_code err;
393 1 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
394 1 : if (tmp_ctx == NULL) {
395 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
396 0 : return NULL;
397 : }
398 1 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_String);
399 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
400 0 : TALLOC_FREE(tmp_ctx);
401 0 : PyErr_SetNdrError(err);
402 0 : return NULL;
403 : }
404 :
405 1 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
406 1 : TALLOC_FREE(tmp_ctx);
407 1 : return ret;
408 : }
409 :
410 1 : static PyObject *py_lsa_String_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
411 : {
412 1 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
413 1 : DATA_BLOB blob = {.data = NULL, .length = 0};
414 1 : Py_ssize_t blob_length = 0;
415 1 : enum ndr_err_code err;
416 1 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
417 1 : PyObject *allow_remaining_obj = NULL;
418 1 : bool allow_remaining = false;
419 :
420 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
421 : discard_const_p(char *, kwnames),
422 : &blob.data, &blob_length,
423 : &allow_remaining_obj)) {
424 0 : return NULL;
425 : }
426 1 : blob.length = blob_length;
427 :
428 1 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
429 0 : allow_remaining = true;
430 : }
431 :
432 0 : if (allow_remaining) {
433 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
434 : } else {
435 1 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_String);
436 : }
437 1 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
438 0 : PyErr_SetNdrError(err);
439 0 : return NULL;
440 : }
441 :
442 1 : Py_RETURN_NONE;
443 : }
444 :
445 0 : static PyObject *py_lsa_String_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
446 : {
447 0 : struct lsa_String *object = pytalloc_get_ptr(py_obj);
448 0 : PyObject *ret;
449 0 : char *retstr;
450 :
451 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_String, "lsa_String", object);
452 0 : ret = PyUnicode_FromString(retstr);
453 0 : talloc_free(retstr);
454 :
455 0 : return ret;
456 : }
457 :
458 : static PyMethodDef py_lsa_String_methods[] = {
459 : { "__ndr_pack__", (PyCFunction)py_lsa_String_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
460 : { "__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" },
461 : { "__ndr_print__", (PyCFunction)py_lsa_String_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
462 : { NULL, NULL, 0, NULL }
463 : };
464 :
465 :
466 : static PyTypeObject lsa_String_Type = {
467 : PyVarObject_HEAD_INIT(NULL, 0)
468 : .tp_name = "lsa.String",
469 : .tp_getset = py_lsa_String_getsetters,
470 : .tp_methods = py_lsa_String_methods,
471 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
472 : .tp_new = py_lsa_String_new,
473 : };
474 :
475 :
476 0 : static PyObject *py_lsa_StringLarge_get_length(PyObject *obj, void *closure)
477 : {
478 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(obj);
479 0 : PyObject *py_length;
480 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
481 0 : return py_length;
482 : }
483 :
484 0 : static int py_lsa_StringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
485 : {
486 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
487 0 : if (value == NULL) {
488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
489 0 : return -1;
490 : }
491 : {
492 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
493 0 : if (PyLong_Check(value)) {
494 0 : unsigned long long test_var;
495 0 : test_var = PyLong_AsUnsignedLongLong(value);
496 0 : if (PyErr_Occurred() != NULL) {
497 0 : return -1;
498 : }
499 0 : if (test_var > uint_max) {
500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
501 : PyLong_Type.tp_name, uint_max, test_var);
502 0 : return -1;
503 : }
504 0 : object->length = test_var;
505 : } else {
506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
507 : PyLong_Type.tp_name);
508 0 : return -1;
509 : }
510 : }
511 0 : return 0;
512 : }
513 :
514 0 : static PyObject *py_lsa_StringLarge_get_size(PyObject *obj, void *closure)
515 : {
516 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(obj);
517 0 : PyObject *py_size;
518 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
519 0 : return py_size;
520 : }
521 :
522 0 : static int py_lsa_StringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
523 : {
524 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
525 0 : if (value == NULL) {
526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
527 0 : return -1;
528 : }
529 : {
530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
531 0 : if (PyLong_Check(value)) {
532 0 : unsigned long long test_var;
533 0 : test_var = PyLong_AsUnsignedLongLong(value);
534 0 : if (PyErr_Occurred() != NULL) {
535 0 : return -1;
536 : }
537 0 : if (test_var > uint_max) {
538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
539 : PyLong_Type.tp_name, uint_max, test_var);
540 0 : return -1;
541 : }
542 0 : object->size = test_var;
543 : } else {
544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
545 : PyLong_Type.tp_name);
546 0 : return -1;
547 : }
548 : }
549 0 : return 0;
550 : }
551 :
552 3657 : static PyObject *py_lsa_StringLarge_get_string(PyObject *obj, void *closure)
553 : {
554 3657 : struct lsa_StringLarge *object = pytalloc_get_ptr(obj);
555 24 : PyObject *py_string;
556 3657 : if (object->string == NULL) {
557 0 : Py_RETURN_NONE;
558 : }
559 3657 : if (object->string == NULL) {
560 0 : py_string = Py_None;
561 0 : Py_INCREF(py_string);
562 : } else {
563 3657 : if (object->string == NULL) {
564 0 : py_string = Py_None;
565 0 : Py_INCREF(py_string);
566 : } else {
567 3657 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
568 : }
569 : }
570 3657 : return py_string;
571 : }
572 :
573 58 : static int py_lsa_StringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
574 : {
575 58 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
576 58 : if (value == NULL) {
577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
578 0 : return -1;
579 : }
580 58 : if (value == Py_None) {
581 0 : object->string = NULL;
582 : } else {
583 58 : object->string = NULL;
584 : {
585 0 : const char *test_str;
586 0 : const char *talloc_str;
587 58 : PyObject *unicode = NULL;
588 58 : if (PyUnicode_Check(value)) {
589 58 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
590 58 : if (unicode == NULL) {
591 0 : return -1;
592 : }
593 58 : test_str = PyBytes_AS_STRING(unicode);
594 0 : } else if (PyBytes_Check(value)) {
595 0 : test_str = PyBytes_AS_STRING(value);
596 : } else {
597 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
598 0 : return -1;
599 : }
600 58 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
601 58 : if (unicode != NULL) {
602 28 : Py_DECREF(unicode);
603 : }
604 58 : if (talloc_str == NULL) {
605 0 : PyErr_NoMemory();
606 0 : return -1;
607 : }
608 58 : object->string = talloc_str;
609 : }
610 : }
611 58 : return 0;
612 : }
613 :
614 : static PyGetSetDef py_lsa_StringLarge_getsetters[] = {
615 : {
616 : .name = discard_const_p(char, "length"),
617 : .get = py_lsa_StringLarge_get_length,
618 : .set = py_lsa_StringLarge_set_length,
619 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
620 : },
621 : {
622 : .name = discard_const_p(char, "size"),
623 : .get = py_lsa_StringLarge_get_size,
624 : .set = py_lsa_StringLarge_set_size,
625 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
626 : },
627 : {
628 : .name = discard_const_p(char, "string"),
629 : .get = py_lsa_StringLarge_get_string,
630 : .set = py_lsa_StringLarge_set_string,
631 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
632 : },
633 : { .name = NULL }
634 : };
635 :
636 0 : static PyObject *py_lsa_StringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
637 : {
638 0 : return pytalloc_new(struct lsa_StringLarge, type);
639 : }
640 :
641 0 : static PyObject *py_lsa_StringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
642 : {
643 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
644 0 : PyObject *ret = NULL;
645 0 : DATA_BLOB blob;
646 0 : enum ndr_err_code err;
647 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
648 0 : if (tmp_ctx == NULL) {
649 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
650 0 : return NULL;
651 : }
652 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
653 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
654 0 : TALLOC_FREE(tmp_ctx);
655 0 : PyErr_SetNdrError(err);
656 0 : return NULL;
657 : }
658 :
659 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
660 0 : TALLOC_FREE(tmp_ctx);
661 0 : return ret;
662 : }
663 :
664 0 : static PyObject *py_lsa_StringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
665 : {
666 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
667 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
668 0 : Py_ssize_t blob_length = 0;
669 0 : enum ndr_err_code err;
670 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
671 0 : PyObject *allow_remaining_obj = NULL;
672 0 : bool allow_remaining = false;
673 :
674 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
675 : discard_const_p(char *, kwnames),
676 : &blob.data, &blob_length,
677 : &allow_remaining_obj)) {
678 0 : return NULL;
679 : }
680 0 : blob.length = blob_length;
681 :
682 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
683 0 : allow_remaining = true;
684 : }
685 :
686 0 : if (allow_remaining) {
687 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
688 : } else {
689 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_StringLarge);
690 : }
691 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
692 0 : PyErr_SetNdrError(err);
693 0 : return NULL;
694 : }
695 :
696 0 : Py_RETURN_NONE;
697 : }
698 :
699 0 : static PyObject *py_lsa_StringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
700 : {
701 0 : struct lsa_StringLarge *object = pytalloc_get_ptr(py_obj);
702 0 : PyObject *ret;
703 0 : char *retstr;
704 :
705 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_StringLarge, "lsa_StringLarge", object);
706 0 : ret = PyUnicode_FromString(retstr);
707 0 : talloc_free(retstr);
708 :
709 0 : return ret;
710 : }
711 :
712 : static PyMethodDef py_lsa_StringLarge_methods[] = {
713 : { "__ndr_pack__", (PyCFunction)py_lsa_StringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
714 : { "__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" },
715 : { "__ndr_print__", (PyCFunction)py_lsa_StringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
716 : { NULL, NULL, 0, NULL }
717 : };
718 :
719 :
720 : static PyTypeObject lsa_StringLarge_Type = {
721 : PyVarObject_HEAD_INIT(NULL, 0)
722 : .tp_name = "lsa.StringLarge",
723 : .tp_getset = py_lsa_StringLarge_getsetters,
724 : .tp_methods = py_lsa_StringLarge_methods,
725 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
726 : .tp_new = py_lsa_StringLarge_new,
727 : };
728 :
729 :
730 0 : static PyObject *py_lsa_Strings_get_count(PyObject *obj, void *closure)
731 : {
732 0 : struct lsa_Strings *object = pytalloc_get_ptr(obj);
733 0 : PyObject *py_count;
734 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
735 0 : return py_count;
736 : }
737 :
738 0 : static int py_lsa_Strings_set_count(PyObject *py_obj, PyObject *value, void *closure)
739 : {
740 0 : struct lsa_Strings *object = pytalloc_get_ptr(py_obj);
741 0 : if (value == NULL) {
742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
743 0 : return -1;
744 : }
745 : {
746 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
747 0 : if (PyLong_Check(value)) {
748 0 : unsigned long long test_var;
749 0 : test_var = PyLong_AsUnsignedLongLong(value);
750 0 : if (PyErr_Occurred() != NULL) {
751 0 : return -1;
752 : }
753 0 : if (test_var > uint_max) {
754 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
755 : PyLong_Type.tp_name, uint_max, test_var);
756 0 : return -1;
757 : }
758 0 : object->count = test_var;
759 : } else {
760 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
761 : PyLong_Type.tp_name);
762 0 : return -1;
763 : }
764 : }
765 0 : return 0;
766 : }
767 :
768 0 : static PyObject *py_lsa_Strings_get_names(PyObject *obj, void *closure)
769 : {
770 0 : struct lsa_Strings *object = pytalloc_get_ptr(obj);
771 0 : PyObject *py_names;
772 0 : if (object->names == NULL) {
773 0 : Py_RETURN_NONE;
774 : }
775 0 : if (object->names == NULL) {
776 0 : py_names = Py_None;
777 0 : Py_INCREF(py_names);
778 : } else {
779 0 : py_names = PyList_New(object->count);
780 0 : if (py_names == NULL) {
781 0 : return NULL;
782 : }
783 : {
784 : int names_cntr_1;
785 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
786 0 : PyObject *py_names_1;
787 0 : py_names_1 = pytalloc_reference_ex(&lsa_String_Type, object->names, &(object->names)[names_cntr_1]);
788 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
789 : }
790 : }
791 : }
792 0 : return py_names;
793 : }
794 :
795 0 : static int py_lsa_Strings_set_names(PyObject *py_obj, PyObject *value, void *closure)
796 : {
797 0 : struct lsa_Strings *object = pytalloc_get_ptr(py_obj);
798 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
799 0 : if (value == NULL) {
800 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
801 0 : return -1;
802 : }
803 0 : if (value == Py_None) {
804 0 : object->names = NULL;
805 : } else {
806 0 : object->names = NULL;
807 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
808 : {
809 0 : int names_cntr_1;
810 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
811 0 : if (!object->names) { return -1; }
812 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
813 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
814 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
815 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_1]");
816 0 : return -1;
817 : }
818 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
819 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
820 0 : PyErr_NoMemory();
821 0 : return -1;
822 : }
823 0 : (object->names)[names_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
824 : }
825 : }
826 : }
827 0 : return 0;
828 : }
829 :
830 : static PyGetSetDef py_lsa_Strings_getsetters[] = {
831 : {
832 : .name = discard_const_p(char, "count"),
833 : .get = py_lsa_Strings_get_count,
834 : .set = py_lsa_Strings_set_count,
835 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
836 : },
837 : {
838 : .name = discard_const_p(char, "names"),
839 : .get = py_lsa_Strings_get_names,
840 : .set = py_lsa_Strings_set_names,
841 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
842 : },
843 : { .name = NULL }
844 : };
845 :
846 0 : static PyObject *py_lsa_Strings_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
847 : {
848 0 : return pytalloc_new(struct lsa_Strings, type);
849 : }
850 :
851 0 : static PyObject *py_lsa_Strings_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
852 : {
853 0 : struct lsa_Strings *object = pytalloc_get_ptr(py_obj);
854 0 : PyObject *ret = NULL;
855 0 : DATA_BLOB blob;
856 0 : enum ndr_err_code err;
857 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
858 0 : if (tmp_ctx == NULL) {
859 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
860 0 : return NULL;
861 : }
862 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_Strings);
863 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
864 0 : TALLOC_FREE(tmp_ctx);
865 0 : PyErr_SetNdrError(err);
866 0 : return NULL;
867 : }
868 :
869 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
870 0 : TALLOC_FREE(tmp_ctx);
871 0 : return ret;
872 : }
873 :
874 0 : static PyObject *py_lsa_Strings_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
875 : {
876 0 : struct lsa_Strings *object = pytalloc_get_ptr(py_obj);
877 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
878 0 : Py_ssize_t blob_length = 0;
879 0 : enum ndr_err_code err;
880 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
881 0 : PyObject *allow_remaining_obj = NULL;
882 0 : bool allow_remaining = false;
883 :
884 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
885 : discard_const_p(char *, kwnames),
886 : &blob.data, &blob_length,
887 : &allow_remaining_obj)) {
888 0 : return NULL;
889 : }
890 0 : blob.length = blob_length;
891 :
892 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
893 0 : allow_remaining = true;
894 : }
895 :
896 0 : if (allow_remaining) {
897 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
898 : } else {
899 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_Strings);
900 : }
901 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
902 0 : PyErr_SetNdrError(err);
903 0 : return NULL;
904 : }
905 :
906 0 : Py_RETURN_NONE;
907 : }
908 :
909 0 : static PyObject *py_lsa_Strings_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
910 : {
911 0 : struct lsa_Strings *object = pytalloc_get_ptr(py_obj);
912 0 : PyObject *ret;
913 0 : char *retstr;
914 :
915 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_Strings, "lsa_Strings", object);
916 0 : ret = PyUnicode_FromString(retstr);
917 0 : talloc_free(retstr);
918 :
919 0 : return ret;
920 : }
921 :
922 : static PyMethodDef py_lsa_Strings_methods[] = {
923 : { "__ndr_pack__", (PyCFunction)py_lsa_Strings_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
924 : { "__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" },
925 : { "__ndr_print__", (PyCFunction)py_lsa_Strings_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
926 : { NULL, NULL, 0, NULL }
927 : };
928 :
929 :
930 : static PyTypeObject lsa_Strings_Type = {
931 : PyVarObject_HEAD_INIT(NULL, 0)
932 : .tp_name = "lsa.Strings",
933 : .tp_getset = py_lsa_Strings_getsetters,
934 : .tp_methods = py_lsa_Strings_methods,
935 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
936 : .tp_new = py_lsa_Strings_new,
937 : };
938 :
939 :
940 0 : static PyObject *py_lsa_AsciiString_get_length(PyObject *obj, void *closure)
941 : {
942 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(obj);
943 0 : PyObject *py_length;
944 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
945 0 : return py_length;
946 : }
947 :
948 0 : static int py_lsa_AsciiString_set_length(PyObject *py_obj, PyObject *value, void *closure)
949 : {
950 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
951 0 : if (value == NULL) {
952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
953 0 : return -1;
954 : }
955 : {
956 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
957 0 : if (PyLong_Check(value)) {
958 0 : unsigned long long test_var;
959 0 : test_var = PyLong_AsUnsignedLongLong(value);
960 0 : if (PyErr_Occurred() != NULL) {
961 0 : return -1;
962 : }
963 0 : if (test_var > uint_max) {
964 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
965 : PyLong_Type.tp_name, uint_max, test_var);
966 0 : return -1;
967 : }
968 0 : object->length = test_var;
969 : } else {
970 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
971 : PyLong_Type.tp_name);
972 0 : return -1;
973 : }
974 : }
975 0 : return 0;
976 : }
977 :
978 0 : static PyObject *py_lsa_AsciiString_get_size(PyObject *obj, void *closure)
979 : {
980 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(obj);
981 0 : PyObject *py_size;
982 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
983 0 : return py_size;
984 : }
985 :
986 0 : static int py_lsa_AsciiString_set_size(PyObject *py_obj, PyObject *value, void *closure)
987 : {
988 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
989 0 : if (value == NULL) {
990 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
991 0 : return -1;
992 : }
993 : {
994 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
995 0 : if (PyLong_Check(value)) {
996 0 : unsigned long long test_var;
997 0 : test_var = PyLong_AsUnsignedLongLong(value);
998 0 : if (PyErr_Occurred() != NULL) {
999 0 : return -1;
1000 : }
1001 0 : if (test_var > uint_max) {
1002 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1003 : PyLong_Type.tp_name, uint_max, test_var);
1004 0 : return -1;
1005 : }
1006 0 : object->size = test_var;
1007 : } else {
1008 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1009 : PyLong_Type.tp_name);
1010 0 : return -1;
1011 : }
1012 : }
1013 0 : return 0;
1014 : }
1015 :
1016 0 : static PyObject *py_lsa_AsciiString_get_string(PyObject *obj, void *closure)
1017 : {
1018 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(obj);
1019 0 : PyObject *py_string;
1020 0 : if (object->string == NULL) {
1021 0 : Py_RETURN_NONE;
1022 : }
1023 0 : if (object->string == NULL) {
1024 0 : py_string = Py_None;
1025 0 : Py_INCREF(py_string);
1026 : } else {
1027 0 : if (object->string == NULL) {
1028 0 : py_string = Py_None;
1029 0 : Py_INCREF(py_string);
1030 : } else {
1031 0 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1032 : }
1033 : }
1034 0 : return py_string;
1035 : }
1036 :
1037 0 : static int py_lsa_AsciiString_set_string(PyObject *py_obj, PyObject *value, void *closure)
1038 : {
1039 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
1040 0 : if (value == NULL) {
1041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
1042 0 : return -1;
1043 : }
1044 0 : if (value == Py_None) {
1045 0 : object->string = NULL;
1046 : } else {
1047 0 : object->string = NULL;
1048 : {
1049 0 : const char *test_str;
1050 0 : const char *talloc_str;
1051 0 : PyObject *unicode = NULL;
1052 0 : if (PyUnicode_Check(value)) {
1053 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1054 0 : if (unicode == NULL) {
1055 0 : return -1;
1056 : }
1057 0 : test_str = PyBytes_AS_STRING(unicode);
1058 0 : } else if (PyBytes_Check(value)) {
1059 0 : test_str = PyBytes_AS_STRING(value);
1060 : } else {
1061 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1062 0 : return -1;
1063 : }
1064 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1065 0 : if (unicode != NULL) {
1066 0 : Py_DECREF(unicode);
1067 : }
1068 0 : if (talloc_str == NULL) {
1069 0 : PyErr_NoMemory();
1070 0 : return -1;
1071 : }
1072 0 : object->string = talloc_str;
1073 : }
1074 : }
1075 0 : return 0;
1076 : }
1077 :
1078 : static PyGetSetDef py_lsa_AsciiString_getsetters[] = {
1079 : {
1080 : .name = discard_const_p(char, "length"),
1081 : .get = py_lsa_AsciiString_get_length,
1082 : .set = py_lsa_AsciiString_set_length,
1083 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1084 : },
1085 : {
1086 : .name = discard_const_p(char, "size"),
1087 : .get = py_lsa_AsciiString_get_size,
1088 : .set = py_lsa_AsciiString_set_size,
1089 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1090 : },
1091 : {
1092 : .name = discard_const_p(char, "string"),
1093 : .get = py_lsa_AsciiString_get_string,
1094 : .set = py_lsa_AsciiString_set_string,
1095 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1096 : },
1097 : { .name = NULL }
1098 : };
1099 :
1100 0 : static PyObject *py_lsa_AsciiString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1101 : {
1102 0 : return pytalloc_new(struct lsa_AsciiString, type);
1103 : }
1104 :
1105 0 : static PyObject *py_lsa_AsciiString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1106 : {
1107 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
1108 0 : PyObject *ret = NULL;
1109 0 : DATA_BLOB blob;
1110 0 : enum ndr_err_code err;
1111 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1112 0 : if (tmp_ctx == NULL) {
1113 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1114 0 : return NULL;
1115 : }
1116 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiString);
1117 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1118 0 : TALLOC_FREE(tmp_ctx);
1119 0 : PyErr_SetNdrError(err);
1120 0 : return NULL;
1121 : }
1122 :
1123 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1124 0 : TALLOC_FREE(tmp_ctx);
1125 0 : return ret;
1126 : }
1127 :
1128 0 : static PyObject *py_lsa_AsciiString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1129 : {
1130 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
1131 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1132 0 : Py_ssize_t blob_length = 0;
1133 0 : enum ndr_err_code err;
1134 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1135 0 : PyObject *allow_remaining_obj = NULL;
1136 0 : bool allow_remaining = false;
1137 :
1138 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1139 : discard_const_p(char *, kwnames),
1140 : &blob.data, &blob_length,
1141 : &allow_remaining_obj)) {
1142 0 : return NULL;
1143 : }
1144 0 : blob.length = blob_length;
1145 :
1146 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1147 0 : allow_remaining = true;
1148 : }
1149 :
1150 0 : if (allow_remaining) {
1151 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1152 : } else {
1153 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiString);
1154 : }
1155 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1156 0 : PyErr_SetNdrError(err);
1157 0 : return NULL;
1158 : }
1159 :
1160 0 : Py_RETURN_NONE;
1161 : }
1162 :
1163 0 : static PyObject *py_lsa_AsciiString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1164 : {
1165 0 : struct lsa_AsciiString *object = pytalloc_get_ptr(py_obj);
1166 0 : PyObject *ret;
1167 0 : char *retstr;
1168 :
1169 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiString, "lsa_AsciiString", object);
1170 0 : ret = PyUnicode_FromString(retstr);
1171 0 : talloc_free(retstr);
1172 :
1173 0 : return ret;
1174 : }
1175 :
1176 : static PyMethodDef py_lsa_AsciiString_methods[] = {
1177 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1178 : { "__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" },
1179 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1180 : { NULL, NULL, 0, NULL }
1181 : };
1182 :
1183 :
1184 : static PyTypeObject lsa_AsciiString_Type = {
1185 : PyVarObject_HEAD_INIT(NULL, 0)
1186 : .tp_name = "lsa.AsciiString",
1187 : .tp_getset = py_lsa_AsciiString_getsetters,
1188 : .tp_methods = py_lsa_AsciiString_methods,
1189 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1190 : .tp_new = py_lsa_AsciiString_new,
1191 : };
1192 :
1193 :
1194 0 : static PyObject *py_lsa_AsciiStringLarge_get_length(PyObject *obj, void *closure)
1195 : {
1196 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(obj);
1197 0 : PyObject *py_length;
1198 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
1199 0 : return py_length;
1200 : }
1201 :
1202 0 : static int py_lsa_AsciiStringLarge_set_length(PyObject *py_obj, PyObject *value, void *closure)
1203 : {
1204 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1205 0 : if (value == NULL) {
1206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
1207 0 : return -1;
1208 : }
1209 : {
1210 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1211 0 : if (PyLong_Check(value)) {
1212 0 : unsigned long long test_var;
1213 0 : test_var = PyLong_AsUnsignedLongLong(value);
1214 0 : if (PyErr_Occurred() != NULL) {
1215 0 : return -1;
1216 : }
1217 0 : if (test_var > uint_max) {
1218 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1219 : PyLong_Type.tp_name, uint_max, test_var);
1220 0 : return -1;
1221 : }
1222 0 : object->length = test_var;
1223 : } else {
1224 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1225 : PyLong_Type.tp_name);
1226 0 : return -1;
1227 : }
1228 : }
1229 0 : return 0;
1230 : }
1231 :
1232 0 : static PyObject *py_lsa_AsciiStringLarge_get_size(PyObject *obj, void *closure)
1233 : {
1234 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(obj);
1235 0 : PyObject *py_size;
1236 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
1237 0 : return py_size;
1238 : }
1239 :
1240 0 : static int py_lsa_AsciiStringLarge_set_size(PyObject *py_obj, PyObject *value, void *closure)
1241 : {
1242 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1243 0 : if (value == NULL) {
1244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
1245 0 : return -1;
1246 : }
1247 : {
1248 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1249 0 : if (PyLong_Check(value)) {
1250 0 : unsigned long long test_var;
1251 0 : test_var = PyLong_AsUnsignedLongLong(value);
1252 0 : if (PyErr_Occurred() != NULL) {
1253 0 : return -1;
1254 : }
1255 0 : if (test_var > uint_max) {
1256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1257 : PyLong_Type.tp_name, uint_max, test_var);
1258 0 : return -1;
1259 : }
1260 0 : object->size = test_var;
1261 : } else {
1262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1263 : PyLong_Type.tp_name);
1264 0 : return -1;
1265 : }
1266 : }
1267 0 : return 0;
1268 : }
1269 :
1270 181 : static PyObject *py_lsa_AsciiStringLarge_get_string(PyObject *obj, void *closure)
1271 : {
1272 181 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(obj);
1273 0 : PyObject *py_string;
1274 181 : if (object->string == NULL) {
1275 0 : Py_RETURN_NONE;
1276 : }
1277 181 : if (object->string == NULL) {
1278 0 : py_string = Py_None;
1279 0 : Py_INCREF(py_string);
1280 : } else {
1281 181 : if (object->string == NULL) {
1282 0 : py_string = Py_None;
1283 0 : Py_INCREF(py_string);
1284 : } else {
1285 181 : py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
1286 : }
1287 : }
1288 181 : return py_string;
1289 : }
1290 :
1291 0 : static int py_lsa_AsciiStringLarge_set_string(PyObject *py_obj, PyObject *value, void *closure)
1292 : {
1293 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1294 0 : if (value == NULL) {
1295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
1296 0 : return -1;
1297 : }
1298 0 : if (value == Py_None) {
1299 0 : object->string = NULL;
1300 : } else {
1301 0 : object->string = NULL;
1302 : {
1303 0 : const char *test_str;
1304 0 : const char *talloc_str;
1305 0 : PyObject *unicode = NULL;
1306 0 : if (PyUnicode_Check(value)) {
1307 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
1308 0 : if (unicode == NULL) {
1309 0 : return -1;
1310 : }
1311 0 : test_str = PyBytes_AS_STRING(unicode);
1312 0 : } else if (PyBytes_Check(value)) {
1313 0 : test_str = PyBytes_AS_STRING(value);
1314 : } else {
1315 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
1316 0 : return -1;
1317 : }
1318 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
1319 0 : if (unicode != NULL) {
1320 0 : Py_DECREF(unicode);
1321 : }
1322 0 : if (talloc_str == NULL) {
1323 0 : PyErr_NoMemory();
1324 0 : return -1;
1325 : }
1326 0 : object->string = talloc_str;
1327 : }
1328 : }
1329 0 : return 0;
1330 : }
1331 :
1332 : static PyGetSetDef py_lsa_AsciiStringLarge_getsetters[] = {
1333 : {
1334 : .name = discard_const_p(char, "length"),
1335 : .get = py_lsa_AsciiStringLarge_get_length,
1336 : .set = py_lsa_AsciiStringLarge_set_length,
1337 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1338 : },
1339 : {
1340 : .name = discard_const_p(char, "size"),
1341 : .get = py_lsa_AsciiStringLarge_get_size,
1342 : .set = py_lsa_AsciiStringLarge_set_size,
1343 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1344 : },
1345 : {
1346 : .name = discard_const_p(char, "string"),
1347 : .get = py_lsa_AsciiStringLarge_get_string,
1348 : .set = py_lsa_AsciiStringLarge_set_string,
1349 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
1350 : },
1351 : { .name = NULL }
1352 : };
1353 :
1354 0 : static PyObject *py_lsa_AsciiStringLarge_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1355 : {
1356 0 : return pytalloc_new(struct lsa_AsciiStringLarge, type);
1357 : }
1358 :
1359 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1360 : {
1361 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1362 0 : PyObject *ret = NULL;
1363 0 : DATA_BLOB blob;
1364 0 : enum ndr_err_code err;
1365 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1366 0 : if (tmp_ctx == NULL) {
1367 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1368 0 : return NULL;
1369 : }
1370 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_AsciiStringLarge);
1371 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1372 0 : TALLOC_FREE(tmp_ctx);
1373 0 : PyErr_SetNdrError(err);
1374 0 : return NULL;
1375 : }
1376 :
1377 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1378 0 : TALLOC_FREE(tmp_ctx);
1379 0 : return ret;
1380 : }
1381 :
1382 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1383 : {
1384 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1385 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1386 0 : Py_ssize_t blob_length = 0;
1387 0 : enum ndr_err_code err;
1388 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1389 0 : PyObject *allow_remaining_obj = NULL;
1390 0 : bool allow_remaining = false;
1391 :
1392 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1393 : discard_const_p(char *, kwnames),
1394 : &blob.data, &blob_length,
1395 : &allow_remaining_obj)) {
1396 0 : return NULL;
1397 : }
1398 0 : blob.length = blob_length;
1399 :
1400 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1401 0 : allow_remaining = true;
1402 : }
1403 :
1404 0 : if (allow_remaining) {
1405 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1406 : } else {
1407 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_AsciiStringLarge);
1408 : }
1409 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1410 0 : PyErr_SetNdrError(err);
1411 0 : return NULL;
1412 : }
1413 :
1414 0 : Py_RETURN_NONE;
1415 : }
1416 :
1417 0 : static PyObject *py_lsa_AsciiStringLarge_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1418 : {
1419 0 : struct lsa_AsciiStringLarge *object = pytalloc_get_ptr(py_obj);
1420 0 : PyObject *ret;
1421 0 : char *retstr;
1422 :
1423 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_AsciiStringLarge, "lsa_AsciiStringLarge", object);
1424 0 : ret = PyUnicode_FromString(retstr);
1425 0 : talloc_free(retstr);
1426 :
1427 0 : return ret;
1428 : }
1429 :
1430 : static PyMethodDef py_lsa_AsciiStringLarge_methods[] = {
1431 : { "__ndr_pack__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1432 : { "__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" },
1433 : { "__ndr_print__", (PyCFunction)py_lsa_AsciiStringLarge_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1434 : { NULL, NULL, 0, NULL }
1435 : };
1436 :
1437 :
1438 : static PyTypeObject lsa_AsciiStringLarge_Type = {
1439 : PyVarObject_HEAD_INIT(NULL, 0)
1440 : .tp_name = "lsa.AsciiStringLarge",
1441 : .tp_getset = py_lsa_AsciiStringLarge_getsetters,
1442 : .tp_methods = py_lsa_AsciiStringLarge_methods,
1443 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1444 : .tp_new = py_lsa_AsciiStringLarge_new,
1445 : };
1446 :
1447 :
1448 0 : static PyObject *py_lsa_BinaryString_get_length(PyObject *obj, void *closure)
1449 : {
1450 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(obj);
1451 0 : PyObject *py_length;
1452 0 : py_length = PyLong_FromLong((uint16_t)(object->length));
1453 0 : return py_length;
1454 : }
1455 :
1456 0 : static int py_lsa_BinaryString_set_length(PyObject *py_obj, PyObject *value, void *closure)
1457 : {
1458 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1459 0 : if (value == NULL) {
1460 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
1461 0 : return -1;
1462 : }
1463 : {
1464 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
1465 0 : if (PyLong_Check(value)) {
1466 0 : unsigned long long test_var;
1467 0 : test_var = PyLong_AsUnsignedLongLong(value);
1468 0 : if (PyErr_Occurred() != NULL) {
1469 0 : return -1;
1470 : }
1471 0 : if (test_var > uint_max) {
1472 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1473 : PyLong_Type.tp_name, uint_max, test_var);
1474 0 : return -1;
1475 : }
1476 0 : object->length = test_var;
1477 : } else {
1478 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1479 : PyLong_Type.tp_name);
1480 0 : return -1;
1481 : }
1482 : }
1483 0 : return 0;
1484 : }
1485 :
1486 0 : static PyObject *py_lsa_BinaryString_get_size(PyObject *obj, void *closure)
1487 : {
1488 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(obj);
1489 0 : PyObject *py_size;
1490 0 : py_size = PyLong_FromLong((uint16_t)(object->size));
1491 0 : return py_size;
1492 : }
1493 :
1494 0 : static int py_lsa_BinaryString_set_size(PyObject *py_obj, PyObject *value, void *closure)
1495 : {
1496 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1497 0 : if (value == NULL) {
1498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
1499 0 : return -1;
1500 : }
1501 : {
1502 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
1503 0 : if (PyLong_Check(value)) {
1504 0 : unsigned long long test_var;
1505 0 : test_var = PyLong_AsUnsignedLongLong(value);
1506 0 : if (PyErr_Occurred() != NULL) {
1507 0 : return -1;
1508 : }
1509 0 : if (test_var > uint_max) {
1510 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1511 : PyLong_Type.tp_name, uint_max, test_var);
1512 0 : return -1;
1513 : }
1514 0 : object->size = test_var;
1515 : } else {
1516 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1517 : PyLong_Type.tp_name);
1518 0 : return -1;
1519 : }
1520 : }
1521 0 : return 0;
1522 : }
1523 :
1524 0 : static PyObject *py_lsa_BinaryString_get_array(PyObject *obj, void *closure)
1525 : {
1526 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(obj);
1527 0 : PyObject *py_array;
1528 0 : if (object->array == NULL) {
1529 0 : Py_RETURN_NONE;
1530 : }
1531 0 : if (object->array == NULL) {
1532 0 : py_array = Py_None;
1533 0 : Py_INCREF(py_array);
1534 : } else {
1535 0 : py_array = PyList_New(object->length / 2);
1536 0 : if (py_array == NULL) {
1537 0 : return NULL;
1538 : }
1539 : {
1540 : int array_cntr_1;
1541 0 : for (array_cntr_1 = 0; array_cntr_1 < (object->length / 2); array_cntr_1++) {
1542 0 : PyObject *py_array_1;
1543 0 : py_array_1 = PyLong_FromLong((uint16_t)((object->array)[array_cntr_1]));
1544 0 : PyList_SetItem(py_array, array_cntr_1, py_array_1);
1545 : }
1546 : }
1547 : }
1548 0 : return py_array;
1549 : }
1550 :
1551 0 : static int py_lsa_BinaryString_set_array(PyObject *py_obj, PyObject *value, void *closure)
1552 : {
1553 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
1555 0 : if (value == NULL) {
1556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->array");
1557 0 : return -1;
1558 : }
1559 0 : if (value == Py_None) {
1560 0 : object->array = NULL;
1561 : } else {
1562 0 : object->array = NULL;
1563 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1564 : {
1565 0 : int array_cntr_1;
1566 0 : object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
1567 0 : if (!object->array) { return -1; }
1568 0 : talloc_set_name_const(object->array, "ARRAY: object->array");
1569 0 : for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
1570 0 : if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
1571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->array)[array_cntr_1]");
1572 0 : return -1;
1573 : }
1574 : {
1575 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->array)[array_cntr_1]));
1576 0 : if (PyLong_Check(PyList_GET_ITEM(value, array_cntr_1))) {
1577 0 : unsigned long long test_var;
1578 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, array_cntr_1));
1579 0 : if (PyErr_Occurred() != NULL) {
1580 0 : return -1;
1581 : }
1582 0 : if (test_var > uint_max) {
1583 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1584 : PyLong_Type.tp_name, uint_max, test_var);
1585 0 : return -1;
1586 : }
1587 0 : (object->array)[array_cntr_1] = test_var;
1588 : } else {
1589 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1590 : PyLong_Type.tp_name);
1591 0 : return -1;
1592 : }
1593 : }
1594 : }
1595 : }
1596 : }
1597 0 : return 0;
1598 : }
1599 :
1600 : static PyGetSetDef py_lsa_BinaryString_getsetters[] = {
1601 : {
1602 : .name = discard_const_p(char, "length"),
1603 : .get = py_lsa_BinaryString_get_length,
1604 : .set = py_lsa_BinaryString_set_length,
1605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1606 : },
1607 : {
1608 : .name = discard_const_p(char, "size"),
1609 : .get = py_lsa_BinaryString_get_size,
1610 : .set = py_lsa_BinaryString_set_size,
1611 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1612 : },
1613 : {
1614 : .name = discard_const_p(char, "array"),
1615 : .get = py_lsa_BinaryString_get_array,
1616 : .set = py_lsa_BinaryString_set_array,
1617 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1618 : },
1619 : { .name = NULL }
1620 : };
1621 :
1622 0 : static PyObject *py_lsa_BinaryString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1623 : {
1624 0 : return pytalloc_new(struct lsa_BinaryString, type);
1625 : }
1626 :
1627 0 : static PyObject *py_lsa_BinaryString_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1628 : {
1629 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1630 0 : PyObject *ret = NULL;
1631 0 : DATA_BLOB blob;
1632 0 : enum ndr_err_code err;
1633 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
1634 0 : if (tmp_ctx == NULL) {
1635 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
1636 0 : return NULL;
1637 : }
1638 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_BinaryString);
1639 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1640 0 : TALLOC_FREE(tmp_ctx);
1641 0 : PyErr_SetNdrError(err);
1642 0 : return NULL;
1643 : }
1644 :
1645 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
1646 0 : TALLOC_FREE(tmp_ctx);
1647 0 : return ret;
1648 : }
1649 :
1650 0 : static PyObject *py_lsa_BinaryString_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
1651 : {
1652 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1653 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
1654 0 : Py_ssize_t blob_length = 0;
1655 0 : enum ndr_err_code err;
1656 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
1657 0 : PyObject *allow_remaining_obj = NULL;
1658 0 : bool allow_remaining = false;
1659 :
1660 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
1661 : discard_const_p(char *, kwnames),
1662 : &blob.data, &blob_length,
1663 : &allow_remaining_obj)) {
1664 0 : return NULL;
1665 : }
1666 0 : blob.length = blob_length;
1667 :
1668 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
1669 0 : allow_remaining = true;
1670 : }
1671 :
1672 0 : if (allow_remaining) {
1673 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1674 : } else {
1675 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_BinaryString);
1676 : }
1677 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
1678 0 : PyErr_SetNdrError(err);
1679 0 : return NULL;
1680 : }
1681 :
1682 0 : Py_RETURN_NONE;
1683 : }
1684 :
1685 0 : static PyObject *py_lsa_BinaryString_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
1686 : {
1687 0 : struct lsa_BinaryString *object = pytalloc_get_ptr(py_obj);
1688 0 : PyObject *ret;
1689 0 : char *retstr;
1690 :
1691 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_BinaryString, "lsa_BinaryString", object);
1692 0 : ret = PyUnicode_FromString(retstr);
1693 0 : talloc_free(retstr);
1694 :
1695 0 : return ret;
1696 : }
1697 :
1698 : static PyMethodDef py_lsa_BinaryString_methods[] = {
1699 : { "__ndr_pack__", (PyCFunction)py_lsa_BinaryString_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
1700 : { "__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" },
1701 : { "__ndr_print__", (PyCFunction)py_lsa_BinaryString_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
1702 : { NULL, NULL, 0, NULL }
1703 : };
1704 :
1705 :
1706 : static PyTypeObject lsa_BinaryString_Type = {
1707 : PyVarObject_HEAD_INIT(NULL, 0)
1708 : .tp_name = "lsa.BinaryString",
1709 : .tp_getset = py_lsa_BinaryString_getsetters,
1710 : .tp_methods = py_lsa_BinaryString_methods,
1711 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1712 : .tp_new = py_lsa_BinaryString_new,
1713 : };
1714 :
1715 :
1716 0 : static PyObject *py_lsa_LUID_get_low(PyObject *obj, void *closure)
1717 : {
1718 0 : struct lsa_LUID *object = pytalloc_get_ptr(obj);
1719 0 : PyObject *py_low;
1720 0 : py_low = PyLong_FromUnsignedLongLong((uint32_t)(object->low));
1721 0 : return py_low;
1722 : }
1723 :
1724 0 : static int py_lsa_LUID_set_low(PyObject *py_obj, PyObject *value, void *closure)
1725 : {
1726 0 : struct lsa_LUID *object = pytalloc_get_ptr(py_obj);
1727 0 : if (value == NULL) {
1728 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->low");
1729 0 : return -1;
1730 : }
1731 : {
1732 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->low));
1733 0 : if (PyLong_Check(value)) {
1734 0 : unsigned long long test_var;
1735 0 : test_var = PyLong_AsUnsignedLongLong(value);
1736 0 : if (PyErr_Occurred() != NULL) {
1737 0 : return -1;
1738 : }
1739 0 : if (test_var > uint_max) {
1740 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1741 : PyLong_Type.tp_name, uint_max, test_var);
1742 0 : return -1;
1743 : }
1744 0 : object->low = test_var;
1745 : } else {
1746 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1747 : PyLong_Type.tp_name);
1748 0 : return -1;
1749 : }
1750 : }
1751 0 : return 0;
1752 : }
1753 :
1754 0 : static PyObject *py_lsa_LUID_get_high(PyObject *obj, void *closure)
1755 : {
1756 0 : struct lsa_LUID *object = pytalloc_get_ptr(obj);
1757 0 : PyObject *py_high;
1758 0 : py_high = PyLong_FromUnsignedLongLong((uint32_t)(object->high));
1759 0 : return py_high;
1760 : }
1761 :
1762 0 : static int py_lsa_LUID_set_high(PyObject *py_obj, PyObject *value, void *closure)
1763 : {
1764 0 : struct lsa_LUID *object = pytalloc_get_ptr(py_obj);
1765 0 : if (value == NULL) {
1766 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->high");
1767 0 : return -1;
1768 : }
1769 : {
1770 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high));
1771 0 : if (PyLong_Check(value)) {
1772 0 : unsigned long long test_var;
1773 0 : test_var = PyLong_AsUnsignedLongLong(value);
1774 0 : if (PyErr_Occurred() != NULL) {
1775 0 : return -1;
1776 : }
1777 0 : if (test_var > uint_max) {
1778 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1779 : PyLong_Type.tp_name, uint_max, test_var);
1780 0 : return -1;
1781 : }
1782 0 : object->high = test_var;
1783 : } else {
1784 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1785 : PyLong_Type.tp_name);
1786 0 : return -1;
1787 : }
1788 : }
1789 0 : return 0;
1790 : }
1791 :
1792 : static PyGetSetDef py_lsa_LUID_getsetters[] = {
1793 : {
1794 : .name = discard_const_p(char, "low"),
1795 : .get = py_lsa_LUID_get_low,
1796 : .set = py_lsa_LUID_set_low,
1797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1798 : },
1799 : {
1800 : .name = discard_const_p(char, "high"),
1801 : .get = py_lsa_LUID_get_high,
1802 : .set = py_lsa_LUID_set_high,
1803 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1804 : },
1805 : { .name = NULL }
1806 : };
1807 :
1808 0 : static PyObject *py_lsa_LUID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1809 : {
1810 0 : return pytalloc_new(struct lsa_LUID, type);
1811 : }
1812 :
1813 :
1814 : static PyTypeObject lsa_LUID_Type = {
1815 : PyVarObject_HEAD_INIT(NULL, 0)
1816 : .tp_name = "lsa.LUID",
1817 : .tp_getset = py_lsa_LUID_getsetters,
1818 : .tp_methods = NULL,
1819 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1820 : .tp_new = py_lsa_LUID_new,
1821 : };
1822 :
1823 :
1824 0 : static PyObject *py_lsa_PrivEntry_get_name(PyObject *obj, void *closure)
1825 : {
1826 0 : struct lsa_PrivEntry *object = pytalloc_get_ptr(obj);
1827 0 : PyObject *py_name;
1828 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
1829 0 : return py_name;
1830 : }
1831 :
1832 0 : static int py_lsa_PrivEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
1833 : {
1834 0 : struct lsa_PrivEntry *object = pytalloc_get_ptr(py_obj);
1835 0 : if (value == NULL) {
1836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
1837 0 : return -1;
1838 : }
1839 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
1840 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1841 0 : PyErr_NoMemory();
1842 0 : return -1;
1843 : }
1844 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
1845 0 : return 0;
1846 : }
1847 :
1848 0 : static PyObject *py_lsa_PrivEntry_get_luid(PyObject *obj, void *closure)
1849 : {
1850 0 : struct lsa_PrivEntry *object = pytalloc_get_ptr(obj);
1851 0 : PyObject *py_luid;
1852 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
1853 0 : return py_luid;
1854 : }
1855 :
1856 0 : static int py_lsa_PrivEntry_set_luid(PyObject *py_obj, PyObject *value, void *closure)
1857 : {
1858 0 : struct lsa_PrivEntry *object = pytalloc_get_ptr(py_obj);
1859 0 : if (value == NULL) {
1860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->luid");
1861 0 : return -1;
1862 : }
1863 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
1864 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1865 0 : PyErr_NoMemory();
1866 0 : return -1;
1867 : }
1868 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
1869 0 : return 0;
1870 : }
1871 :
1872 : static PyGetSetDef py_lsa_PrivEntry_getsetters[] = {
1873 : {
1874 : .name = discard_const_p(char, "name"),
1875 : .get = py_lsa_PrivEntry_get_name,
1876 : .set = py_lsa_PrivEntry_set_name,
1877 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
1878 : },
1879 : {
1880 : .name = discard_const_p(char, "luid"),
1881 : .get = py_lsa_PrivEntry_get_luid,
1882 : .set = py_lsa_PrivEntry_set_luid,
1883 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
1884 : },
1885 : { .name = NULL }
1886 : };
1887 :
1888 0 : static PyObject *py_lsa_PrivEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1889 : {
1890 0 : return pytalloc_new(struct lsa_PrivEntry, type);
1891 : }
1892 :
1893 :
1894 : static PyTypeObject lsa_PrivEntry_Type = {
1895 : PyVarObject_HEAD_INIT(NULL, 0)
1896 : .tp_name = "lsa.PrivEntry",
1897 : .tp_getset = py_lsa_PrivEntry_getsetters,
1898 : .tp_methods = NULL,
1899 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1900 : .tp_new = py_lsa_PrivEntry_new,
1901 : };
1902 :
1903 :
1904 0 : static PyObject *py_lsa_PrivArray_get_count(PyObject *obj, void *closure)
1905 : {
1906 0 : struct lsa_PrivArray *object = pytalloc_get_ptr(obj);
1907 0 : PyObject *py_count;
1908 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
1909 0 : return py_count;
1910 : }
1911 :
1912 0 : static int py_lsa_PrivArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1913 : {
1914 0 : struct lsa_PrivArray *object = pytalloc_get_ptr(py_obj);
1915 0 : if (value == NULL) {
1916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
1917 0 : return -1;
1918 : }
1919 : {
1920 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
1921 0 : if (PyLong_Check(value)) {
1922 0 : unsigned long long test_var;
1923 0 : test_var = PyLong_AsUnsignedLongLong(value);
1924 0 : if (PyErr_Occurred() != NULL) {
1925 0 : return -1;
1926 : }
1927 0 : if (test_var > uint_max) {
1928 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1929 : PyLong_Type.tp_name, uint_max, test_var);
1930 0 : return -1;
1931 : }
1932 0 : object->count = test_var;
1933 : } else {
1934 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1935 : PyLong_Type.tp_name);
1936 0 : return -1;
1937 : }
1938 : }
1939 0 : return 0;
1940 : }
1941 :
1942 0 : static PyObject *py_lsa_PrivArray_get_privs(PyObject *obj, void *closure)
1943 : {
1944 0 : struct lsa_PrivArray *object = pytalloc_get_ptr(obj);
1945 0 : PyObject *py_privs;
1946 0 : if (object->privs == NULL) {
1947 0 : Py_RETURN_NONE;
1948 : }
1949 0 : if (object->privs == NULL) {
1950 0 : py_privs = Py_None;
1951 0 : Py_INCREF(py_privs);
1952 : } else {
1953 0 : py_privs = PyList_New(object->count);
1954 0 : if (py_privs == NULL) {
1955 0 : return NULL;
1956 : }
1957 : {
1958 : int privs_cntr_1;
1959 0 : for (privs_cntr_1 = 0; privs_cntr_1 < (object->count); privs_cntr_1++) {
1960 0 : PyObject *py_privs_1;
1961 0 : py_privs_1 = pytalloc_reference_ex(&lsa_PrivEntry_Type, object->privs, &(object->privs)[privs_cntr_1]);
1962 0 : PyList_SetItem(py_privs, privs_cntr_1, py_privs_1);
1963 : }
1964 : }
1965 : }
1966 0 : return py_privs;
1967 : }
1968 :
1969 0 : static int py_lsa_PrivArray_set_privs(PyObject *py_obj, PyObject *value, void *closure)
1970 : {
1971 0 : struct lsa_PrivArray *object = pytalloc_get_ptr(py_obj);
1972 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->privs));
1973 0 : if (value == NULL) {
1974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->privs");
1975 0 : return -1;
1976 : }
1977 0 : if (value == Py_None) {
1978 0 : object->privs = NULL;
1979 : } else {
1980 0 : object->privs = NULL;
1981 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1982 : {
1983 0 : int privs_cntr_1;
1984 0 : object->privs = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->privs, PyList_GET_SIZE(value));
1985 0 : if (!object->privs) { return -1; }
1986 0 : talloc_set_name_const(object->privs, "ARRAY: object->privs");
1987 0 : for (privs_cntr_1 = 0; privs_cntr_1 < PyList_GET_SIZE(value); privs_cntr_1++) {
1988 0 : if (PyList_GET_ITEM(value, privs_cntr_1) == NULL) {
1989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->privs)[privs_cntr_1]");
1990 0 : return -1;
1991 : }
1992 0 : PY_CHECK_TYPE(&lsa_PrivEntry_Type, PyList_GET_ITEM(value, privs_cntr_1), return -1;);
1993 0 : if (talloc_reference(object->privs, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, privs_cntr_1))) == NULL) {
1994 0 : PyErr_NoMemory();
1995 0 : return -1;
1996 : }
1997 0 : (object->privs)[privs_cntr_1] = *(struct lsa_PrivEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, privs_cntr_1));
1998 : }
1999 : }
2000 : }
2001 0 : return 0;
2002 : }
2003 :
2004 : static PyGetSetDef py_lsa_PrivArray_getsetters[] = {
2005 : {
2006 : .name = discard_const_p(char, "count"),
2007 : .get = py_lsa_PrivArray_get_count,
2008 : .set = py_lsa_PrivArray_set_count,
2009 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2010 : },
2011 : {
2012 : .name = discard_const_p(char, "privs"),
2013 : .get = py_lsa_PrivArray_get_privs,
2014 : .set = py_lsa_PrivArray_set_privs,
2015 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivEntry")
2016 : },
2017 : { .name = NULL }
2018 : };
2019 :
2020 0 : static PyObject *py_lsa_PrivArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2021 : {
2022 0 : return pytalloc_new(struct lsa_PrivArray, type);
2023 : }
2024 :
2025 :
2026 : static PyTypeObject lsa_PrivArray_Type = {
2027 : PyVarObject_HEAD_INIT(NULL, 0)
2028 : .tp_name = "lsa.PrivArray",
2029 : .tp_getset = py_lsa_PrivArray_getsetters,
2030 : .tp_methods = NULL,
2031 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2032 : .tp_new = py_lsa_PrivArray_new,
2033 : };
2034 :
2035 :
2036 0 : static PyObject *py_lsa_QosInfo_get_len(PyObject *obj, void *closure)
2037 : {
2038 0 : struct lsa_QosInfo *object = pytalloc_get_ptr(obj);
2039 0 : PyObject *py_len;
2040 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)(object->len));
2041 0 : return py_len;
2042 : }
2043 :
2044 223 : static int py_lsa_QosInfo_set_len(PyObject *py_obj, PyObject *value, void *closure)
2045 : {
2046 223 : struct lsa_QosInfo *object = pytalloc_get_ptr(py_obj);
2047 223 : if (value == NULL) {
2048 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->len");
2049 0 : return -1;
2050 : }
2051 : {
2052 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2053 223 : if (PyLong_Check(value)) {
2054 2 : unsigned long long test_var;
2055 223 : test_var = PyLong_AsUnsignedLongLong(value);
2056 223 : if (PyErr_Occurred() != NULL) {
2057 0 : return -1;
2058 : }
2059 223 : if (test_var > uint_max) {
2060 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2061 : PyLong_Type.tp_name, uint_max, test_var);
2062 0 : return -1;
2063 : }
2064 223 : object->len = test_var;
2065 : } else {
2066 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2067 : PyLong_Type.tp_name);
2068 0 : return -1;
2069 : }
2070 : }
2071 223 : return 0;
2072 : }
2073 :
2074 0 : static PyObject *py_lsa_QosInfo_get_impersonation_level(PyObject *obj, void *closure)
2075 : {
2076 0 : struct lsa_QosInfo *object = pytalloc_get_ptr(obj);
2077 0 : PyObject *py_impersonation_level;
2078 0 : py_impersonation_level = PyLong_FromLong((uint16_t)(object->impersonation_level));
2079 0 : return py_impersonation_level;
2080 : }
2081 :
2082 223 : static int py_lsa_QosInfo_set_impersonation_level(PyObject *py_obj, PyObject *value, void *closure)
2083 : {
2084 223 : struct lsa_QosInfo *object = pytalloc_get_ptr(py_obj);
2085 223 : if (value == NULL) {
2086 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->impersonation_level");
2087 0 : return -1;
2088 : }
2089 : {
2090 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->impersonation_level));
2091 223 : if (PyLong_Check(value)) {
2092 2 : unsigned long long test_var;
2093 223 : test_var = PyLong_AsUnsignedLongLong(value);
2094 223 : if (PyErr_Occurred() != NULL) {
2095 0 : return -1;
2096 : }
2097 223 : if (test_var > uint_max) {
2098 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2099 : PyLong_Type.tp_name, uint_max, test_var);
2100 0 : return -1;
2101 : }
2102 223 : object->impersonation_level = test_var;
2103 : } else {
2104 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2105 : PyLong_Type.tp_name);
2106 0 : return -1;
2107 : }
2108 : }
2109 223 : return 0;
2110 : }
2111 :
2112 0 : static PyObject *py_lsa_QosInfo_get_context_mode(PyObject *obj, void *closure)
2113 : {
2114 0 : struct lsa_QosInfo *object = pytalloc_get_ptr(obj);
2115 0 : PyObject *py_context_mode;
2116 0 : py_context_mode = PyLong_FromLong((uint16_t)(object->context_mode));
2117 0 : return py_context_mode;
2118 : }
2119 :
2120 223 : static int py_lsa_QosInfo_set_context_mode(PyObject *py_obj, PyObject *value, void *closure)
2121 : {
2122 223 : struct lsa_QosInfo *object = pytalloc_get_ptr(py_obj);
2123 223 : if (value == NULL) {
2124 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->context_mode");
2125 0 : return -1;
2126 : }
2127 : {
2128 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->context_mode));
2129 223 : if (PyLong_Check(value)) {
2130 2 : unsigned long long test_var;
2131 223 : test_var = PyLong_AsUnsignedLongLong(value);
2132 223 : if (PyErr_Occurred() != NULL) {
2133 0 : return -1;
2134 : }
2135 223 : if (test_var > uint_max) {
2136 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2137 : PyLong_Type.tp_name, uint_max, test_var);
2138 0 : return -1;
2139 : }
2140 223 : object->context_mode = test_var;
2141 : } else {
2142 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2143 : PyLong_Type.tp_name);
2144 0 : return -1;
2145 : }
2146 : }
2147 223 : return 0;
2148 : }
2149 :
2150 0 : static PyObject *py_lsa_QosInfo_get_effective_only(PyObject *obj, void *closure)
2151 : {
2152 0 : struct lsa_QosInfo *object = pytalloc_get_ptr(obj);
2153 0 : PyObject *py_effective_only;
2154 0 : py_effective_only = PyLong_FromLong((uint16_t)(object->effective_only));
2155 0 : return py_effective_only;
2156 : }
2157 :
2158 223 : static int py_lsa_QosInfo_set_effective_only(PyObject *py_obj, PyObject *value, void *closure)
2159 : {
2160 223 : struct lsa_QosInfo *object = pytalloc_get_ptr(py_obj);
2161 223 : if (value == NULL) {
2162 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->effective_only");
2163 0 : return -1;
2164 : }
2165 : {
2166 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->effective_only));
2167 223 : if (PyLong_Check(value)) {
2168 2 : unsigned long long test_var;
2169 223 : test_var = PyLong_AsUnsignedLongLong(value);
2170 223 : if (PyErr_Occurred() != NULL) {
2171 0 : return -1;
2172 : }
2173 223 : if (test_var > uint_max) {
2174 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2175 : PyLong_Type.tp_name, uint_max, test_var);
2176 0 : return -1;
2177 : }
2178 223 : object->effective_only = test_var;
2179 : } else {
2180 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2181 : PyLong_Type.tp_name);
2182 0 : return -1;
2183 : }
2184 : }
2185 223 : return 0;
2186 : }
2187 :
2188 : static PyGetSetDef py_lsa_QosInfo_getsetters[] = {
2189 : {
2190 : .name = discard_const_p(char, "len"),
2191 : .get = py_lsa_QosInfo_get_len,
2192 : .set = py_lsa_QosInfo_set_len,
2193 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2194 : },
2195 : {
2196 : .name = discard_const_p(char, "impersonation_level"),
2197 : .get = py_lsa_QosInfo_get_impersonation_level,
2198 : .set = py_lsa_QosInfo_set_impersonation_level,
2199 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecurityImpersonationLevel")
2200 : },
2201 : {
2202 : .name = discard_const_p(char, "context_mode"),
2203 : .get = py_lsa_QosInfo_get_context_mode,
2204 : .set = py_lsa_QosInfo_set_context_mode,
2205 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2206 : },
2207 : {
2208 : .name = discard_const_p(char, "effective_only"),
2209 : .get = py_lsa_QosInfo_get_effective_only,
2210 : .set = py_lsa_QosInfo_set_effective_only,
2211 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2212 : },
2213 : { .name = NULL }
2214 : };
2215 :
2216 227 : static PyObject *py_lsa_QosInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2217 : {
2218 227 : return pytalloc_new(struct lsa_QosInfo, type);
2219 : }
2220 :
2221 :
2222 : static PyTypeObject lsa_QosInfo_Type = {
2223 : PyVarObject_HEAD_INIT(NULL, 0)
2224 : .tp_name = "lsa.QosInfo",
2225 : .tp_getset = py_lsa_QosInfo_getsetters,
2226 : .tp_methods = NULL,
2227 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2228 : .tp_new = py_lsa_QosInfo_new,
2229 : };
2230 :
2231 :
2232 0 : static PyObject *py_lsa_ObjectAttribute_get_len(PyObject *obj, void *closure)
2233 : {
2234 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2235 0 : PyObject *py_len;
2236 0 : py_len = PyLong_FromUnsignedLongLong((uint32_t)(object->len));
2237 0 : return py_len;
2238 : }
2239 :
2240 0 : static int py_lsa_ObjectAttribute_set_len(PyObject *py_obj, PyObject *value, void *closure)
2241 : {
2242 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2243 0 : if (value == NULL) {
2244 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->len");
2245 0 : return -1;
2246 : }
2247 : {
2248 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->len));
2249 0 : if (PyLong_Check(value)) {
2250 0 : unsigned long long test_var;
2251 0 : test_var = PyLong_AsUnsignedLongLong(value);
2252 0 : if (PyErr_Occurred() != NULL) {
2253 0 : return -1;
2254 : }
2255 0 : if (test_var > uint_max) {
2256 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2257 : PyLong_Type.tp_name, uint_max, test_var);
2258 0 : return -1;
2259 : }
2260 0 : object->len = test_var;
2261 : } else {
2262 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2263 : PyLong_Type.tp_name);
2264 0 : return -1;
2265 : }
2266 : }
2267 0 : return 0;
2268 : }
2269 :
2270 0 : static PyObject *py_lsa_ObjectAttribute_get_root_dir(PyObject *obj, void *closure)
2271 : {
2272 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2273 0 : PyObject *py_root_dir;
2274 0 : if (object->root_dir == NULL) {
2275 0 : Py_RETURN_NONE;
2276 : }
2277 0 : if (object->root_dir == NULL) {
2278 0 : py_root_dir = Py_None;
2279 0 : Py_INCREF(py_root_dir);
2280 : } else {
2281 0 : py_root_dir = PyLong_FromLong((uint16_t)(*object->root_dir));
2282 : }
2283 0 : return py_root_dir;
2284 : }
2285 :
2286 0 : static int py_lsa_ObjectAttribute_set_root_dir(PyObject *py_obj, PyObject *value, void *closure)
2287 : {
2288 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->root_dir));
2290 0 : if (value == NULL) {
2291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->root_dir");
2292 0 : return -1;
2293 : }
2294 0 : if (value == Py_None) {
2295 0 : object->root_dir = NULL;
2296 : } else {
2297 0 : object->root_dir = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->root_dir);
2298 0 : if (object->root_dir == NULL) {
2299 0 : PyErr_NoMemory();
2300 0 : return -1;
2301 : }
2302 : {
2303 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->root_dir));
2304 0 : if (PyLong_Check(value)) {
2305 0 : unsigned long long test_var;
2306 0 : test_var = PyLong_AsUnsignedLongLong(value);
2307 0 : if (PyErr_Occurred() != NULL) {
2308 0 : return -1;
2309 : }
2310 0 : if (test_var > uint_max) {
2311 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2312 : PyLong_Type.tp_name, uint_max, test_var);
2313 0 : return -1;
2314 : }
2315 0 : *object->root_dir = test_var;
2316 : } else {
2317 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2318 : PyLong_Type.tp_name);
2319 0 : return -1;
2320 : }
2321 : }
2322 : }
2323 0 : return 0;
2324 : }
2325 :
2326 0 : static PyObject *py_lsa_ObjectAttribute_get_object_name(PyObject *obj, void *closure)
2327 : {
2328 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2329 0 : PyObject *py_object_name;
2330 0 : if (object->object_name == NULL) {
2331 0 : Py_RETURN_NONE;
2332 : }
2333 0 : if (object->object_name == NULL) {
2334 0 : py_object_name = Py_None;
2335 0 : Py_INCREF(py_object_name);
2336 : } else {
2337 0 : if (object->object_name == NULL) {
2338 0 : py_object_name = Py_None;
2339 0 : Py_INCREF(py_object_name);
2340 : } else {
2341 0 : py_object_name = PyUnicode_Decode(object->object_name, strlen(object->object_name), "utf-8", "ignore");
2342 : }
2343 : }
2344 0 : return py_object_name;
2345 : }
2346 :
2347 0 : static int py_lsa_ObjectAttribute_set_object_name(PyObject *py_obj, PyObject *value, void *closure)
2348 : {
2349 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2350 0 : if (value == NULL) {
2351 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->object_name");
2352 0 : return -1;
2353 : }
2354 0 : if (value == Py_None) {
2355 0 : object->object_name = NULL;
2356 : } else {
2357 0 : object->object_name = NULL;
2358 : {
2359 0 : const char *test_str;
2360 0 : const char *talloc_str;
2361 0 : PyObject *unicode = NULL;
2362 0 : if (PyUnicode_Check(value)) {
2363 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
2364 0 : if (unicode == NULL) {
2365 0 : return -1;
2366 : }
2367 0 : test_str = PyBytes_AS_STRING(unicode);
2368 0 : } else if (PyBytes_Check(value)) {
2369 0 : test_str = PyBytes_AS_STRING(value);
2370 : } else {
2371 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
2372 0 : return -1;
2373 : }
2374 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
2375 0 : if (unicode != NULL) {
2376 0 : Py_DECREF(unicode);
2377 : }
2378 0 : if (talloc_str == NULL) {
2379 0 : PyErr_NoMemory();
2380 0 : return -1;
2381 : }
2382 0 : object->object_name = talloc_str;
2383 : }
2384 : }
2385 0 : return 0;
2386 : }
2387 :
2388 0 : static PyObject *py_lsa_ObjectAttribute_get_attributes(PyObject *obj, void *closure)
2389 : {
2390 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2391 0 : PyObject *py_attributes;
2392 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
2393 0 : return py_attributes;
2394 : }
2395 :
2396 0 : static int py_lsa_ObjectAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2397 : {
2398 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2399 0 : if (value == NULL) {
2400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
2401 0 : return -1;
2402 : }
2403 : {
2404 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2405 0 : if (PyLong_Check(value)) {
2406 0 : unsigned long long test_var;
2407 0 : test_var = PyLong_AsUnsignedLongLong(value);
2408 0 : if (PyErr_Occurred() != NULL) {
2409 0 : return -1;
2410 : }
2411 0 : if (test_var > uint_max) {
2412 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2413 : PyLong_Type.tp_name, uint_max, test_var);
2414 0 : return -1;
2415 : }
2416 0 : object->attributes = test_var;
2417 : } else {
2418 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2419 : PyLong_Type.tp_name);
2420 0 : return -1;
2421 : }
2422 : }
2423 0 : return 0;
2424 : }
2425 :
2426 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_desc(PyObject *obj, void *closure)
2427 : {
2428 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2429 0 : PyObject *py_sec_desc;
2430 0 : if (object->sec_desc == NULL) {
2431 0 : Py_RETURN_NONE;
2432 : }
2433 0 : if (object->sec_desc == NULL) {
2434 0 : py_sec_desc = Py_None;
2435 0 : Py_INCREF(py_sec_desc);
2436 : } else {
2437 0 : py_sec_desc = pytalloc_reference_ex(security_descriptor_Type, object->sec_desc, object->sec_desc);
2438 : }
2439 0 : return py_sec_desc;
2440 : }
2441 :
2442 0 : static int py_lsa_ObjectAttribute_set_sec_desc(PyObject *py_obj, PyObject *value, void *closure)
2443 : {
2444 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2445 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_desc));
2446 0 : if (value == NULL) {
2447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sec_desc");
2448 0 : return -1;
2449 : }
2450 0 : if (value == Py_None) {
2451 0 : object->sec_desc = NULL;
2452 : } else {
2453 0 : object->sec_desc = NULL;
2454 0 : PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
2455 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2456 0 : PyErr_NoMemory();
2457 0 : return -1;
2458 : }
2459 0 : object->sec_desc = (struct security_descriptor *)pytalloc_get_ptr(value);
2460 : }
2461 0 : return 0;
2462 : }
2463 :
2464 0 : static PyObject *py_lsa_ObjectAttribute_get_sec_qos(PyObject *obj, void *closure)
2465 : {
2466 0 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(obj);
2467 0 : PyObject *py_sec_qos;
2468 0 : if (object->sec_qos == NULL) {
2469 0 : Py_RETURN_NONE;
2470 : }
2471 0 : if (object->sec_qos == NULL) {
2472 0 : py_sec_qos = Py_None;
2473 0 : Py_INCREF(py_sec_qos);
2474 : } else {
2475 0 : py_sec_qos = pytalloc_reference_ex(&lsa_QosInfo_Type, object->sec_qos, object->sec_qos);
2476 : }
2477 0 : return py_sec_qos;
2478 : }
2479 :
2480 227 : static int py_lsa_ObjectAttribute_set_sec_qos(PyObject *py_obj, PyObject *value, void *closure)
2481 : {
2482 227 : struct lsa_ObjectAttribute *object = pytalloc_get_ptr(py_obj);
2483 227 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sec_qos));
2484 227 : if (value == NULL) {
2485 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sec_qos");
2486 0 : return -1;
2487 : }
2488 227 : if (value == Py_None) {
2489 0 : object->sec_qos = NULL;
2490 : } else {
2491 227 : object->sec_qos = NULL;
2492 227 : PY_CHECK_TYPE(&lsa_QosInfo_Type, value, return -1;);
2493 227 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2494 0 : PyErr_NoMemory();
2495 0 : return -1;
2496 : }
2497 227 : object->sec_qos = (struct lsa_QosInfo *)pytalloc_get_ptr(value);
2498 : }
2499 225 : return 0;
2500 : }
2501 :
2502 : static PyGetSetDef py_lsa_ObjectAttribute_getsetters[] = {
2503 : {
2504 : .name = discard_const_p(char, "len"),
2505 : .get = py_lsa_ObjectAttribute_get_len,
2506 : .set = py_lsa_ObjectAttribute_set_len,
2507 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
2508 : },
2509 : {
2510 : .name = discard_const_p(char, "root_dir"),
2511 : .get = py_lsa_ObjectAttribute_get_root_dir,
2512 : .set = py_lsa_ObjectAttribute_set_root_dir,
2513 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2514 : },
2515 : {
2516 : .name = discard_const_p(char, "object_name"),
2517 : .get = py_lsa_ObjectAttribute_get_object_name,
2518 : .set = py_lsa_ObjectAttribute_set_object_name,
2519 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2520 : },
2521 : {
2522 : .name = discard_const_p(char, "attributes"),
2523 : .get = py_lsa_ObjectAttribute_get_attributes,
2524 : .set = py_lsa_ObjectAttribute_set_attributes,
2525 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2526 : },
2527 : {
2528 : .name = discard_const_p(char, "sec_desc"),
2529 : .get = py_lsa_ObjectAttribute_get_sec_desc,
2530 : .set = py_lsa_ObjectAttribute_set_sec_desc,
2531 : .doc = discard_const_p(char, "PIDL-generated element of base type security_descriptor")
2532 : },
2533 : {
2534 : .name = discard_const_p(char, "sec_qos"),
2535 : .get = py_lsa_ObjectAttribute_get_sec_qos,
2536 : .set = py_lsa_ObjectAttribute_set_sec_qos,
2537 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_QosInfo")
2538 : },
2539 : { .name = NULL }
2540 : };
2541 :
2542 235 : static PyObject *py_lsa_ObjectAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2543 : {
2544 235 : return pytalloc_new(struct lsa_ObjectAttribute, type);
2545 : }
2546 :
2547 :
2548 : static PyTypeObject lsa_ObjectAttribute_Type = {
2549 : PyVarObject_HEAD_INIT(NULL, 0)
2550 : .tp_name = "lsa.ObjectAttribute",
2551 : .tp_getset = py_lsa_ObjectAttribute_getsetters,
2552 : .tp_methods = NULL,
2553 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2554 : .tp_new = py_lsa_ObjectAttribute_new,
2555 : };
2556 :
2557 :
2558 0 : static PyObject *py_lsa_AuditLogInfo_get_percent_full(PyObject *obj, void *closure)
2559 : {
2560 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2561 0 : PyObject *py_percent_full;
2562 0 : py_percent_full = PyLong_FromUnsignedLongLong((uint32_t)(object->percent_full));
2563 0 : return py_percent_full;
2564 : }
2565 :
2566 0 : static int py_lsa_AuditLogInfo_set_percent_full(PyObject *py_obj, PyObject *value, void *closure)
2567 : {
2568 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2569 0 : if (value == NULL) {
2570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->percent_full");
2571 0 : return -1;
2572 : }
2573 : {
2574 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->percent_full));
2575 0 : if (PyLong_Check(value)) {
2576 0 : unsigned long long test_var;
2577 0 : test_var = PyLong_AsUnsignedLongLong(value);
2578 0 : if (PyErr_Occurred() != NULL) {
2579 0 : return -1;
2580 : }
2581 0 : if (test_var > uint_max) {
2582 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2583 : PyLong_Type.tp_name, uint_max, test_var);
2584 0 : return -1;
2585 : }
2586 0 : object->percent_full = test_var;
2587 : } else {
2588 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2589 : PyLong_Type.tp_name);
2590 0 : return -1;
2591 : }
2592 : }
2593 0 : return 0;
2594 : }
2595 :
2596 0 : static PyObject *py_lsa_AuditLogInfo_get_maximum_log_size(PyObject *obj, void *closure)
2597 : {
2598 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2599 0 : PyObject *py_maximum_log_size;
2600 0 : py_maximum_log_size = PyLong_FromUnsignedLongLong((uint32_t)(object->maximum_log_size));
2601 0 : return py_maximum_log_size;
2602 : }
2603 :
2604 0 : static int py_lsa_AuditLogInfo_set_maximum_log_size(PyObject *py_obj, PyObject *value, void *closure)
2605 : {
2606 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2607 0 : if (value == NULL) {
2608 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->maximum_log_size");
2609 0 : return -1;
2610 : }
2611 : {
2612 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->maximum_log_size));
2613 0 : if (PyLong_Check(value)) {
2614 0 : unsigned long long test_var;
2615 0 : test_var = PyLong_AsUnsignedLongLong(value);
2616 0 : if (PyErr_Occurred() != NULL) {
2617 0 : return -1;
2618 : }
2619 0 : if (test_var > uint_max) {
2620 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2621 : PyLong_Type.tp_name, uint_max, test_var);
2622 0 : return -1;
2623 : }
2624 0 : object->maximum_log_size = test_var;
2625 : } else {
2626 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2627 : PyLong_Type.tp_name);
2628 0 : return -1;
2629 : }
2630 : }
2631 0 : return 0;
2632 : }
2633 :
2634 0 : static PyObject *py_lsa_AuditLogInfo_get_retention_time(PyObject *obj, void *closure)
2635 : {
2636 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2637 0 : PyObject *py_retention_time;
2638 0 : py_retention_time = PyLong_FromUnsignedLongLong(object->retention_time);
2639 0 : return py_retention_time;
2640 : }
2641 :
2642 0 : static int py_lsa_AuditLogInfo_set_retention_time(PyObject *py_obj, PyObject *value, void *closure)
2643 : {
2644 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2645 0 : if (value == NULL) {
2646 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->retention_time");
2647 0 : return -1;
2648 : }
2649 : {
2650 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->retention_time));
2651 0 : if (PyLong_Check(value)) {
2652 0 : unsigned long long test_var;
2653 0 : test_var = PyLong_AsUnsignedLongLong(value);
2654 0 : if (PyErr_Occurred() != NULL) {
2655 0 : return -1;
2656 : }
2657 0 : if (test_var > uint_max) {
2658 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2659 : PyLong_Type.tp_name, uint_max, test_var);
2660 0 : return -1;
2661 : }
2662 0 : object->retention_time = test_var;
2663 : } else {
2664 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2665 : PyLong_Type.tp_name);
2666 0 : return -1;
2667 : }
2668 : }
2669 0 : return 0;
2670 : }
2671 :
2672 0 : static PyObject *py_lsa_AuditLogInfo_get_shutdown_in_progress(PyObject *obj, void *closure)
2673 : {
2674 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2675 0 : PyObject *py_shutdown_in_progress;
2676 0 : py_shutdown_in_progress = PyLong_FromLong((uint16_t)(object->shutdown_in_progress));
2677 0 : return py_shutdown_in_progress;
2678 : }
2679 :
2680 0 : static int py_lsa_AuditLogInfo_set_shutdown_in_progress(PyObject *py_obj, PyObject *value, void *closure)
2681 : {
2682 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2683 0 : if (value == NULL) {
2684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->shutdown_in_progress");
2685 0 : return -1;
2686 : }
2687 : {
2688 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_in_progress));
2689 0 : if (PyLong_Check(value)) {
2690 0 : unsigned long long test_var;
2691 0 : test_var = PyLong_AsUnsignedLongLong(value);
2692 0 : if (PyErr_Occurred() != NULL) {
2693 0 : return -1;
2694 : }
2695 0 : if (test_var > uint_max) {
2696 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2697 : PyLong_Type.tp_name, uint_max, test_var);
2698 0 : return -1;
2699 : }
2700 0 : object->shutdown_in_progress = test_var;
2701 : } else {
2702 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2703 : PyLong_Type.tp_name);
2704 0 : return -1;
2705 : }
2706 : }
2707 0 : return 0;
2708 : }
2709 :
2710 0 : static PyObject *py_lsa_AuditLogInfo_get_time_to_shutdown(PyObject *obj, void *closure)
2711 : {
2712 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2713 0 : PyObject *py_time_to_shutdown;
2714 0 : py_time_to_shutdown = PyLong_FromUnsignedLongLong(object->time_to_shutdown);
2715 0 : return py_time_to_shutdown;
2716 : }
2717 :
2718 0 : static int py_lsa_AuditLogInfo_set_time_to_shutdown(PyObject *py_obj, PyObject *value, void *closure)
2719 : {
2720 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2721 0 : if (value == NULL) {
2722 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time_to_shutdown");
2723 0 : return -1;
2724 : }
2725 : {
2726 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time_to_shutdown));
2727 0 : if (PyLong_Check(value)) {
2728 0 : unsigned long long test_var;
2729 0 : test_var = PyLong_AsUnsignedLongLong(value);
2730 0 : if (PyErr_Occurred() != NULL) {
2731 0 : return -1;
2732 : }
2733 0 : if (test_var > uint_max) {
2734 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2735 : PyLong_Type.tp_name, uint_max, test_var);
2736 0 : return -1;
2737 : }
2738 0 : object->time_to_shutdown = test_var;
2739 : } else {
2740 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2741 : PyLong_Type.tp_name);
2742 0 : return -1;
2743 : }
2744 : }
2745 0 : return 0;
2746 : }
2747 :
2748 0 : static PyObject *py_lsa_AuditLogInfo_get_next_audit_record(PyObject *obj, void *closure)
2749 : {
2750 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(obj);
2751 0 : PyObject *py_next_audit_record;
2752 0 : py_next_audit_record = PyLong_FromUnsignedLongLong((uint32_t)(object->next_audit_record));
2753 0 : return py_next_audit_record;
2754 : }
2755 :
2756 0 : static int py_lsa_AuditLogInfo_set_next_audit_record(PyObject *py_obj, PyObject *value, void *closure)
2757 : {
2758 0 : struct lsa_AuditLogInfo *object = pytalloc_get_ptr(py_obj);
2759 0 : if (value == NULL) {
2760 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->next_audit_record");
2761 0 : return -1;
2762 : }
2763 : {
2764 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->next_audit_record));
2765 0 : if (PyLong_Check(value)) {
2766 0 : unsigned long long test_var;
2767 0 : test_var = PyLong_AsUnsignedLongLong(value);
2768 0 : if (PyErr_Occurred() != NULL) {
2769 0 : return -1;
2770 : }
2771 0 : if (test_var > uint_max) {
2772 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2773 : PyLong_Type.tp_name, uint_max, test_var);
2774 0 : return -1;
2775 : }
2776 0 : object->next_audit_record = test_var;
2777 : } else {
2778 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2779 : PyLong_Type.tp_name);
2780 0 : return -1;
2781 : }
2782 : }
2783 0 : return 0;
2784 : }
2785 :
2786 : static PyGetSetDef py_lsa_AuditLogInfo_getsetters[] = {
2787 : {
2788 : .name = discard_const_p(char, "percent_full"),
2789 : .get = py_lsa_AuditLogInfo_get_percent_full,
2790 : .set = py_lsa_AuditLogInfo_set_percent_full,
2791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2792 : },
2793 : {
2794 : .name = discard_const_p(char, "maximum_log_size"),
2795 : .get = py_lsa_AuditLogInfo_get_maximum_log_size,
2796 : .set = py_lsa_AuditLogInfo_set_maximum_log_size,
2797 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2798 : },
2799 : {
2800 : .name = discard_const_p(char, "retention_time"),
2801 : .get = py_lsa_AuditLogInfo_get_retention_time,
2802 : .set = py_lsa_AuditLogInfo_set_retention_time,
2803 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2804 : },
2805 : {
2806 : .name = discard_const_p(char, "shutdown_in_progress"),
2807 : .get = py_lsa_AuditLogInfo_get_shutdown_in_progress,
2808 : .set = py_lsa_AuditLogInfo_set_shutdown_in_progress,
2809 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
2810 : },
2811 : {
2812 : .name = discard_const_p(char, "time_to_shutdown"),
2813 : .get = py_lsa_AuditLogInfo_get_time_to_shutdown,
2814 : .set = py_lsa_AuditLogInfo_set_time_to_shutdown,
2815 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2816 : },
2817 : {
2818 : .name = discard_const_p(char, "next_audit_record"),
2819 : .get = py_lsa_AuditLogInfo_get_next_audit_record,
2820 : .set = py_lsa_AuditLogInfo_set_next_audit_record,
2821 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2822 : },
2823 : { .name = NULL }
2824 : };
2825 :
2826 0 : static PyObject *py_lsa_AuditLogInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2827 : {
2828 0 : return pytalloc_new(struct lsa_AuditLogInfo, type);
2829 : }
2830 :
2831 :
2832 : static PyTypeObject lsa_AuditLogInfo_Type = {
2833 : PyVarObject_HEAD_INIT(NULL, 0)
2834 : .tp_name = "lsa.AuditLogInfo",
2835 : .tp_getset = py_lsa_AuditLogInfo_getsetters,
2836 : .tp_methods = NULL,
2837 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2838 : .tp_new = py_lsa_AuditLogInfo_new,
2839 : };
2840 :
2841 :
2842 0 : static PyObject *py_lsa_AuditEventsInfo_get_auditing_mode(PyObject *obj, void *closure)
2843 : {
2844 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(obj);
2845 0 : PyObject *py_auditing_mode;
2846 0 : py_auditing_mode = PyLong_FromUnsignedLongLong((uint32_t)(object->auditing_mode));
2847 0 : return py_auditing_mode;
2848 : }
2849 :
2850 0 : static int py_lsa_AuditEventsInfo_set_auditing_mode(PyObject *py_obj, PyObject *value, void *closure)
2851 : {
2852 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(py_obj);
2853 0 : if (value == NULL) {
2854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auditing_mode");
2855 0 : return -1;
2856 : }
2857 : {
2858 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auditing_mode));
2859 0 : if (PyLong_Check(value)) {
2860 0 : unsigned long long test_var;
2861 0 : test_var = PyLong_AsUnsignedLongLong(value);
2862 0 : if (PyErr_Occurred() != NULL) {
2863 0 : return -1;
2864 : }
2865 0 : if (test_var > uint_max) {
2866 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2867 : PyLong_Type.tp_name, uint_max, test_var);
2868 0 : return -1;
2869 : }
2870 0 : object->auditing_mode = test_var;
2871 : } else {
2872 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2873 : PyLong_Type.tp_name);
2874 0 : return -1;
2875 : }
2876 : }
2877 0 : return 0;
2878 : }
2879 :
2880 0 : static PyObject *py_lsa_AuditEventsInfo_get_settings(PyObject *obj, void *closure)
2881 : {
2882 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(obj);
2883 0 : PyObject *py_settings;
2884 0 : if (object->settings == NULL) {
2885 0 : Py_RETURN_NONE;
2886 : }
2887 0 : if (object->settings == NULL) {
2888 0 : py_settings = Py_None;
2889 0 : Py_INCREF(py_settings);
2890 : } else {
2891 0 : py_settings = PyList_New(object->count);
2892 0 : if (py_settings == NULL) {
2893 0 : return NULL;
2894 : }
2895 : {
2896 : int settings_cntr_1;
2897 0 : for (settings_cntr_1 = 0; settings_cntr_1 < (object->count); settings_cntr_1++) {
2898 0 : PyObject *py_settings_1;
2899 0 : py_settings_1 = PyLong_FromUnsignedLongLong((uint32_t)((object->settings)[settings_cntr_1]));
2900 0 : PyList_SetItem(py_settings, settings_cntr_1, py_settings_1);
2901 : }
2902 : }
2903 : }
2904 0 : return py_settings;
2905 : }
2906 :
2907 0 : static int py_lsa_AuditEventsInfo_set_settings(PyObject *py_obj, PyObject *value, void *closure)
2908 : {
2909 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(py_obj);
2910 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->settings));
2911 0 : if (value == NULL) {
2912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->settings");
2913 0 : return -1;
2914 : }
2915 0 : if (value == Py_None) {
2916 0 : object->settings = NULL;
2917 : } else {
2918 0 : object->settings = NULL;
2919 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2920 : {
2921 0 : int settings_cntr_1;
2922 0 : object->settings = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->settings, PyList_GET_SIZE(value));
2923 0 : if (!object->settings) { return -1; }
2924 0 : talloc_set_name_const(object->settings, "ARRAY: object->settings");
2925 0 : for (settings_cntr_1 = 0; settings_cntr_1 < PyList_GET_SIZE(value); settings_cntr_1++) {
2926 0 : if (PyList_GET_ITEM(value, settings_cntr_1) == NULL) {
2927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->settings)[settings_cntr_1]");
2928 0 : return -1;
2929 : }
2930 : {
2931 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->settings)[settings_cntr_1]));
2932 0 : if (PyLong_Check(PyList_GET_ITEM(value, settings_cntr_1))) {
2933 0 : unsigned long long test_var;
2934 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, settings_cntr_1));
2935 0 : if (PyErr_Occurred() != NULL) {
2936 0 : return -1;
2937 : }
2938 0 : if (test_var > uint_max) {
2939 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2940 : PyLong_Type.tp_name, uint_max, test_var);
2941 0 : return -1;
2942 : }
2943 0 : (object->settings)[settings_cntr_1] = test_var;
2944 : } else {
2945 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2946 : PyLong_Type.tp_name);
2947 0 : return -1;
2948 : }
2949 : }
2950 : }
2951 : }
2952 : }
2953 0 : return 0;
2954 : }
2955 :
2956 0 : static PyObject *py_lsa_AuditEventsInfo_get_count(PyObject *obj, void *closure)
2957 : {
2958 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(obj);
2959 0 : PyObject *py_count;
2960 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
2961 0 : return py_count;
2962 : }
2963 :
2964 0 : static int py_lsa_AuditEventsInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
2965 : {
2966 0 : struct lsa_AuditEventsInfo *object = pytalloc_get_ptr(py_obj);
2967 0 : if (value == NULL) {
2968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
2969 0 : return -1;
2970 : }
2971 : {
2972 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2973 0 : if (PyLong_Check(value)) {
2974 0 : unsigned long long test_var;
2975 0 : test_var = PyLong_AsUnsignedLongLong(value);
2976 0 : if (PyErr_Occurred() != NULL) {
2977 0 : return -1;
2978 : }
2979 0 : if (test_var > uint_max) {
2980 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2981 : PyLong_Type.tp_name, uint_max, test_var);
2982 0 : return -1;
2983 : }
2984 0 : object->count = test_var;
2985 : } else {
2986 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2987 : PyLong_Type.tp_name);
2988 0 : return -1;
2989 : }
2990 : }
2991 0 : return 0;
2992 : }
2993 :
2994 : static PyGetSetDef py_lsa_AuditEventsInfo_getsetters[] = {
2995 : {
2996 : .name = discard_const_p(char, "auditing_mode"),
2997 : .get = py_lsa_AuditEventsInfo_get_auditing_mode,
2998 : .set = py_lsa_AuditEventsInfo_set_auditing_mode,
2999 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3000 : },
3001 : {
3002 : .name = discard_const_p(char, "settings"),
3003 : .get = py_lsa_AuditEventsInfo_get_settings,
3004 : .set = py_lsa_AuditEventsInfo_set_settings,
3005 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAuditPolicy")
3006 : },
3007 : {
3008 : .name = discard_const_p(char, "count"),
3009 : .get = py_lsa_AuditEventsInfo_get_count,
3010 : .set = py_lsa_AuditEventsInfo_set_count,
3011 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3012 : },
3013 : { .name = NULL }
3014 : };
3015 :
3016 0 : static PyObject *py_lsa_AuditEventsInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3017 : {
3018 0 : return pytalloc_new(struct lsa_AuditEventsInfo, type);
3019 : }
3020 :
3021 :
3022 : static PyTypeObject lsa_AuditEventsInfo_Type = {
3023 : PyVarObject_HEAD_INIT(NULL, 0)
3024 : .tp_name = "lsa.AuditEventsInfo",
3025 : .tp_getset = py_lsa_AuditEventsInfo_getsetters,
3026 : .tp_methods = NULL,
3027 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3028 : .tp_new = py_lsa_AuditEventsInfo_new,
3029 : };
3030 :
3031 :
3032 0 : static PyObject *py_lsa_DomainInfo_get_name(PyObject *obj, void *closure)
3033 : {
3034 0 : struct lsa_DomainInfo *object = pytalloc_get_ptr(obj);
3035 0 : PyObject *py_name;
3036 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3037 0 : return py_name;
3038 : }
3039 :
3040 0 : static int py_lsa_DomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3041 : {
3042 0 : struct lsa_DomainInfo *object = pytalloc_get_ptr(py_obj);
3043 0 : if (value == NULL) {
3044 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
3045 0 : return -1;
3046 : }
3047 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3048 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3049 0 : PyErr_NoMemory();
3050 0 : return -1;
3051 : }
3052 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3053 0 : return 0;
3054 : }
3055 :
3056 0 : static PyObject *py_lsa_DomainInfo_get_sid(PyObject *obj, void *closure)
3057 : {
3058 0 : struct lsa_DomainInfo *object = pytalloc_get_ptr(obj);
3059 0 : PyObject *py_sid;
3060 0 : if (object->sid == NULL) {
3061 0 : Py_RETURN_NONE;
3062 : }
3063 0 : if (object->sid == NULL) {
3064 0 : py_sid = Py_None;
3065 0 : Py_INCREF(py_sid);
3066 : } else {
3067 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3068 : }
3069 0 : return py_sid;
3070 : }
3071 :
3072 0 : static int py_lsa_DomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3073 : {
3074 0 : struct lsa_DomainInfo *object = pytalloc_get_ptr(py_obj);
3075 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
3076 0 : if (value == NULL) {
3077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
3078 0 : return -1;
3079 : }
3080 0 : if (value == Py_None) {
3081 0 : object->sid = NULL;
3082 : } else {
3083 0 : object->sid = NULL;
3084 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
3085 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3086 0 : PyErr_NoMemory();
3087 0 : return -1;
3088 : }
3089 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
3090 : }
3091 0 : return 0;
3092 : }
3093 :
3094 : static PyGetSetDef py_lsa_DomainInfo_getsetters[] = {
3095 : {
3096 : .name = discard_const_p(char, "name"),
3097 : .get = py_lsa_DomainInfo_get_name,
3098 : .set = py_lsa_DomainInfo_set_name,
3099 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
3100 : },
3101 : {
3102 : .name = discard_const_p(char, "sid"),
3103 : .get = py_lsa_DomainInfo_get_sid,
3104 : .set = py_lsa_DomainInfo_set_sid,
3105 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
3106 : },
3107 : { .name = NULL }
3108 : };
3109 :
3110 0 : static PyObject *py_lsa_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3111 : {
3112 0 : return pytalloc_new(struct lsa_DomainInfo, type);
3113 : }
3114 :
3115 :
3116 : static PyTypeObject lsa_DomainInfo_Type = {
3117 : PyVarObject_HEAD_INIT(NULL, 0)
3118 : .tp_name = "lsa.DomainInfo",
3119 : .tp_getset = py_lsa_DomainInfo_getsetters,
3120 : .tp_methods = NULL,
3121 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3122 : .tp_new = py_lsa_DomainInfo_new,
3123 : };
3124 :
3125 :
3126 0 : static PyObject *py_lsa_PDAccountInfo_get_name(PyObject *obj, void *closure)
3127 : {
3128 0 : struct lsa_PDAccountInfo *object = pytalloc_get_ptr(obj);
3129 0 : PyObject *py_name;
3130 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
3131 0 : return py_name;
3132 : }
3133 :
3134 0 : static int py_lsa_PDAccountInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3135 : {
3136 0 : struct lsa_PDAccountInfo *object = pytalloc_get_ptr(py_obj);
3137 0 : if (value == NULL) {
3138 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
3139 0 : return -1;
3140 : }
3141 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3142 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3143 0 : PyErr_NoMemory();
3144 0 : return -1;
3145 : }
3146 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
3147 0 : return 0;
3148 : }
3149 :
3150 : static PyGetSetDef py_lsa_PDAccountInfo_getsetters[] = {
3151 : {
3152 : .name = discard_const_p(char, "name"),
3153 : .get = py_lsa_PDAccountInfo_get_name,
3154 : .set = py_lsa_PDAccountInfo_set_name,
3155 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3156 : },
3157 : { .name = NULL }
3158 : };
3159 :
3160 0 : static PyObject *py_lsa_PDAccountInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3161 : {
3162 0 : return pytalloc_new(struct lsa_PDAccountInfo, type);
3163 : }
3164 :
3165 :
3166 : static PyTypeObject lsa_PDAccountInfo_Type = {
3167 : PyVarObject_HEAD_INIT(NULL, 0)
3168 : .tp_name = "lsa.PDAccountInfo",
3169 : .tp_getset = py_lsa_PDAccountInfo_getsetters,
3170 : .tp_methods = NULL,
3171 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3172 : .tp_new = py_lsa_PDAccountInfo_new,
3173 : };
3174 :
3175 :
3176 0 : static PyObject *py_lsa_ServerRole_get_role(PyObject *obj, void *closure)
3177 : {
3178 0 : struct lsa_ServerRole *object = pytalloc_get_ptr(obj);
3179 0 : PyObject *py_role;
3180 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)(object->role));
3181 0 : return py_role;
3182 : }
3183 :
3184 0 : static int py_lsa_ServerRole_set_role(PyObject *py_obj, PyObject *value, void *closure)
3185 : {
3186 0 : struct lsa_ServerRole *object = pytalloc_get_ptr(py_obj);
3187 0 : if (value == NULL) {
3188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->role");
3189 0 : return -1;
3190 : }
3191 : {
3192 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
3193 0 : if (PyLong_Check(value)) {
3194 0 : unsigned long long test_var;
3195 0 : test_var = PyLong_AsUnsignedLongLong(value);
3196 0 : if (PyErr_Occurred() != NULL) {
3197 0 : return -1;
3198 : }
3199 0 : if (test_var > uint_max) {
3200 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3201 : PyLong_Type.tp_name, uint_max, test_var);
3202 0 : return -1;
3203 : }
3204 0 : object->role = test_var;
3205 : } else {
3206 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3207 : PyLong_Type.tp_name);
3208 0 : return -1;
3209 : }
3210 : }
3211 0 : return 0;
3212 : }
3213 :
3214 : static PyGetSetDef py_lsa_ServerRole_getsetters[] = {
3215 : {
3216 : .name = discard_const_p(char, "role"),
3217 : .get = py_lsa_ServerRole_get_role,
3218 : .set = py_lsa_ServerRole_set_role,
3219 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_Role")
3220 : },
3221 : { .name = NULL }
3222 : };
3223 :
3224 0 : static PyObject *py_lsa_ServerRole_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3225 : {
3226 0 : return pytalloc_new(struct lsa_ServerRole, type);
3227 : }
3228 :
3229 :
3230 : static PyTypeObject lsa_ServerRole_Type = {
3231 : PyVarObject_HEAD_INIT(NULL, 0)
3232 : .tp_name = "lsa.ServerRole",
3233 : .tp_getset = py_lsa_ServerRole_getsetters,
3234 : .tp_methods = NULL,
3235 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3236 : .tp_new = py_lsa_ServerRole_new,
3237 : };
3238 :
3239 :
3240 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_source(PyObject *obj, void *closure)
3241 : {
3242 0 : struct lsa_ReplicaSourceInfo *object = pytalloc_get_ptr(obj);
3243 0 : PyObject *py_source;
3244 0 : py_source = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->source);
3245 0 : return py_source;
3246 : }
3247 :
3248 0 : static int py_lsa_ReplicaSourceInfo_set_source(PyObject *py_obj, PyObject *value, void *closure)
3249 : {
3250 0 : struct lsa_ReplicaSourceInfo *object = pytalloc_get_ptr(py_obj);
3251 0 : if (value == NULL) {
3252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->source");
3253 0 : return -1;
3254 : }
3255 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3256 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3257 0 : PyErr_NoMemory();
3258 0 : return -1;
3259 : }
3260 0 : object->source = *(struct lsa_String *)pytalloc_get_ptr(value);
3261 0 : return 0;
3262 : }
3263 :
3264 0 : static PyObject *py_lsa_ReplicaSourceInfo_get_account(PyObject *obj, void *closure)
3265 : {
3266 0 : struct lsa_ReplicaSourceInfo *object = pytalloc_get_ptr(obj);
3267 0 : PyObject *py_account;
3268 0 : py_account = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account);
3269 0 : return py_account;
3270 : }
3271 :
3272 0 : static int py_lsa_ReplicaSourceInfo_set_account(PyObject *py_obj, PyObject *value, void *closure)
3273 : {
3274 0 : struct lsa_ReplicaSourceInfo *object = pytalloc_get_ptr(py_obj);
3275 0 : if (value == NULL) {
3276 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->account");
3277 0 : return -1;
3278 : }
3279 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
3280 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3281 0 : PyErr_NoMemory();
3282 0 : return -1;
3283 : }
3284 0 : object->account = *(struct lsa_String *)pytalloc_get_ptr(value);
3285 0 : return 0;
3286 : }
3287 :
3288 : static PyGetSetDef py_lsa_ReplicaSourceInfo_getsetters[] = {
3289 : {
3290 : .name = discard_const_p(char, "source"),
3291 : .get = py_lsa_ReplicaSourceInfo_get_source,
3292 : .set = py_lsa_ReplicaSourceInfo_set_source,
3293 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3294 : },
3295 : {
3296 : .name = discard_const_p(char, "account"),
3297 : .get = py_lsa_ReplicaSourceInfo_get_account,
3298 : .set = py_lsa_ReplicaSourceInfo_set_account,
3299 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3300 : },
3301 : { .name = NULL }
3302 : };
3303 :
3304 0 : static PyObject *py_lsa_ReplicaSourceInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3305 : {
3306 0 : return pytalloc_new(struct lsa_ReplicaSourceInfo, type);
3307 : }
3308 :
3309 :
3310 : static PyTypeObject lsa_ReplicaSourceInfo_Type = {
3311 : PyVarObject_HEAD_INIT(NULL, 0)
3312 : .tp_name = "lsa.ReplicaSourceInfo",
3313 : .tp_getset = py_lsa_ReplicaSourceInfo_getsetters,
3314 : .tp_methods = NULL,
3315 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3316 : .tp_new = py_lsa_ReplicaSourceInfo_new,
3317 : };
3318 :
3319 :
3320 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_paged_pool(PyObject *obj, void *closure)
3321 : {
3322 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3323 0 : PyObject *py_paged_pool;
3324 0 : py_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)(object->paged_pool));
3325 0 : return py_paged_pool;
3326 : }
3327 :
3328 0 : static int py_lsa_DefaultQuotaInfo_set_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3329 : {
3330 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3331 0 : if (value == NULL) {
3332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->paged_pool");
3333 0 : return -1;
3334 : }
3335 : {
3336 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paged_pool));
3337 0 : if (PyLong_Check(value)) {
3338 0 : unsigned long long test_var;
3339 0 : test_var = PyLong_AsUnsignedLongLong(value);
3340 0 : if (PyErr_Occurred() != NULL) {
3341 0 : return -1;
3342 : }
3343 0 : if (test_var > uint_max) {
3344 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3345 : PyLong_Type.tp_name, uint_max, test_var);
3346 0 : return -1;
3347 : }
3348 0 : object->paged_pool = test_var;
3349 : } else {
3350 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3351 : PyLong_Type.tp_name);
3352 0 : return -1;
3353 : }
3354 : }
3355 0 : return 0;
3356 : }
3357 :
3358 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_non_paged_pool(PyObject *obj, void *closure)
3359 : {
3360 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3361 0 : PyObject *py_non_paged_pool;
3362 0 : py_non_paged_pool = PyLong_FromUnsignedLongLong((uint32_t)(object->non_paged_pool));
3363 0 : return py_non_paged_pool;
3364 : }
3365 :
3366 0 : static int py_lsa_DefaultQuotaInfo_set_non_paged_pool(PyObject *py_obj, PyObject *value, void *closure)
3367 : {
3368 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3369 0 : if (value == NULL) {
3370 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->non_paged_pool");
3371 0 : return -1;
3372 : }
3373 : {
3374 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->non_paged_pool));
3375 0 : if (PyLong_Check(value)) {
3376 0 : unsigned long long test_var;
3377 0 : test_var = PyLong_AsUnsignedLongLong(value);
3378 0 : if (PyErr_Occurred() != NULL) {
3379 0 : return -1;
3380 : }
3381 0 : if (test_var > uint_max) {
3382 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3383 : PyLong_Type.tp_name, uint_max, test_var);
3384 0 : return -1;
3385 : }
3386 0 : object->non_paged_pool = test_var;
3387 : } else {
3388 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3389 : PyLong_Type.tp_name);
3390 0 : return -1;
3391 : }
3392 : }
3393 0 : return 0;
3394 : }
3395 :
3396 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_min_wss(PyObject *obj, void *closure)
3397 : {
3398 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3399 0 : PyObject *py_min_wss;
3400 0 : py_min_wss = PyLong_FromUnsignedLongLong((uint32_t)(object->min_wss));
3401 0 : return py_min_wss;
3402 : }
3403 :
3404 0 : static int py_lsa_DefaultQuotaInfo_set_min_wss(PyObject *py_obj, PyObject *value, void *closure)
3405 : {
3406 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3407 0 : if (value == NULL) {
3408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->min_wss");
3409 0 : return -1;
3410 : }
3411 : {
3412 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_wss));
3413 0 : if (PyLong_Check(value)) {
3414 0 : unsigned long long test_var;
3415 0 : test_var = PyLong_AsUnsignedLongLong(value);
3416 0 : if (PyErr_Occurred() != NULL) {
3417 0 : return -1;
3418 : }
3419 0 : if (test_var > uint_max) {
3420 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3421 : PyLong_Type.tp_name, uint_max, test_var);
3422 0 : return -1;
3423 : }
3424 0 : object->min_wss = test_var;
3425 : } else {
3426 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3427 : PyLong_Type.tp_name);
3428 0 : return -1;
3429 : }
3430 : }
3431 0 : return 0;
3432 : }
3433 :
3434 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_max_wss(PyObject *obj, void *closure)
3435 : {
3436 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3437 0 : PyObject *py_max_wss;
3438 0 : py_max_wss = PyLong_FromUnsignedLongLong((uint32_t)(object->max_wss));
3439 0 : return py_max_wss;
3440 : }
3441 :
3442 0 : static int py_lsa_DefaultQuotaInfo_set_max_wss(PyObject *py_obj, PyObject *value, void *closure)
3443 : {
3444 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3445 0 : if (value == NULL) {
3446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_wss");
3447 0 : return -1;
3448 : }
3449 : {
3450 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_wss));
3451 0 : if (PyLong_Check(value)) {
3452 0 : unsigned long long test_var;
3453 0 : test_var = PyLong_AsUnsignedLongLong(value);
3454 0 : if (PyErr_Occurred() != NULL) {
3455 0 : return -1;
3456 : }
3457 0 : if (test_var > uint_max) {
3458 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3459 : PyLong_Type.tp_name, uint_max, test_var);
3460 0 : return -1;
3461 : }
3462 0 : object->max_wss = test_var;
3463 : } else {
3464 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3465 : PyLong_Type.tp_name);
3466 0 : return -1;
3467 : }
3468 : }
3469 0 : return 0;
3470 : }
3471 :
3472 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_pagefile(PyObject *obj, void *closure)
3473 : {
3474 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3475 0 : PyObject *py_pagefile;
3476 0 : py_pagefile = PyLong_FromUnsignedLongLong((uint32_t)(object->pagefile));
3477 0 : return py_pagefile;
3478 : }
3479 :
3480 0 : static int py_lsa_DefaultQuotaInfo_set_pagefile(PyObject *py_obj, PyObject *value, void *closure)
3481 : {
3482 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3483 0 : if (value == NULL) {
3484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pagefile");
3485 0 : return -1;
3486 : }
3487 : {
3488 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pagefile));
3489 0 : if (PyLong_Check(value)) {
3490 0 : unsigned long long test_var;
3491 0 : test_var = PyLong_AsUnsignedLongLong(value);
3492 0 : if (PyErr_Occurred() != NULL) {
3493 0 : return -1;
3494 : }
3495 0 : if (test_var > uint_max) {
3496 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3497 : PyLong_Type.tp_name, uint_max, test_var);
3498 0 : return -1;
3499 : }
3500 0 : object->pagefile = test_var;
3501 : } else {
3502 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3503 : PyLong_Type.tp_name);
3504 0 : return -1;
3505 : }
3506 : }
3507 0 : return 0;
3508 : }
3509 :
3510 0 : static PyObject *py_lsa_DefaultQuotaInfo_get_unknown(PyObject *obj, void *closure)
3511 : {
3512 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(obj);
3513 0 : PyObject *py_unknown;
3514 0 : py_unknown = PyLong_FromUnsignedLongLong(object->unknown);
3515 0 : return py_unknown;
3516 : }
3517 :
3518 0 : static int py_lsa_DefaultQuotaInfo_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
3519 : {
3520 0 : struct lsa_DefaultQuotaInfo *object = pytalloc_get_ptr(py_obj);
3521 0 : if (value == NULL) {
3522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unknown");
3523 0 : return -1;
3524 : }
3525 : {
3526 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
3527 0 : if (PyLong_Check(value)) {
3528 0 : unsigned long long test_var;
3529 0 : test_var = PyLong_AsUnsignedLongLong(value);
3530 0 : if (PyErr_Occurred() != NULL) {
3531 0 : return -1;
3532 : }
3533 0 : if (test_var > uint_max) {
3534 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3535 : PyLong_Type.tp_name, uint_max, test_var);
3536 0 : return -1;
3537 : }
3538 0 : object->unknown = test_var;
3539 : } else {
3540 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3541 : PyLong_Type.tp_name);
3542 0 : return -1;
3543 : }
3544 : }
3545 0 : return 0;
3546 : }
3547 :
3548 : static PyGetSetDef py_lsa_DefaultQuotaInfo_getsetters[] = {
3549 : {
3550 : .name = discard_const_p(char, "paged_pool"),
3551 : .get = py_lsa_DefaultQuotaInfo_get_paged_pool,
3552 : .set = py_lsa_DefaultQuotaInfo_set_paged_pool,
3553 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3554 : },
3555 : {
3556 : .name = discard_const_p(char, "non_paged_pool"),
3557 : .get = py_lsa_DefaultQuotaInfo_get_non_paged_pool,
3558 : .set = py_lsa_DefaultQuotaInfo_set_non_paged_pool,
3559 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3560 : },
3561 : {
3562 : .name = discard_const_p(char, "min_wss"),
3563 : .get = py_lsa_DefaultQuotaInfo_get_min_wss,
3564 : .set = py_lsa_DefaultQuotaInfo_set_min_wss,
3565 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3566 : },
3567 : {
3568 : .name = discard_const_p(char, "max_wss"),
3569 : .get = py_lsa_DefaultQuotaInfo_get_max_wss,
3570 : .set = py_lsa_DefaultQuotaInfo_set_max_wss,
3571 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3572 : },
3573 : {
3574 : .name = discard_const_p(char, "pagefile"),
3575 : .get = py_lsa_DefaultQuotaInfo_get_pagefile,
3576 : .set = py_lsa_DefaultQuotaInfo_set_pagefile,
3577 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3578 : },
3579 : {
3580 : .name = discard_const_p(char, "unknown"),
3581 : .get = py_lsa_DefaultQuotaInfo_get_unknown,
3582 : .set = py_lsa_DefaultQuotaInfo_set_unknown,
3583 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3584 : },
3585 : { .name = NULL }
3586 : };
3587 :
3588 0 : static PyObject *py_lsa_DefaultQuotaInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3589 : {
3590 0 : return pytalloc_new(struct lsa_DefaultQuotaInfo, type);
3591 : }
3592 :
3593 :
3594 : static PyTypeObject lsa_DefaultQuotaInfo_Type = {
3595 : PyVarObject_HEAD_INIT(NULL, 0)
3596 : .tp_name = "lsa.DefaultQuotaInfo",
3597 : .tp_getset = py_lsa_DefaultQuotaInfo_getsetters,
3598 : .tp_methods = NULL,
3599 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3600 : .tp_new = py_lsa_DefaultQuotaInfo_new,
3601 : };
3602 :
3603 :
3604 0 : static PyObject *py_lsa_ModificationInfo_get_modified_id(PyObject *obj, void *closure)
3605 : {
3606 0 : struct lsa_ModificationInfo *object = pytalloc_get_ptr(obj);
3607 0 : PyObject *py_modified_id;
3608 0 : py_modified_id = PyLong_FromUnsignedLongLong(object->modified_id);
3609 0 : return py_modified_id;
3610 : }
3611 :
3612 0 : static int py_lsa_ModificationInfo_set_modified_id(PyObject *py_obj, PyObject *value, void *closure)
3613 : {
3614 0 : struct lsa_ModificationInfo *object = pytalloc_get_ptr(py_obj);
3615 0 : if (value == NULL) {
3616 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->modified_id");
3617 0 : return -1;
3618 : }
3619 : {
3620 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_id));
3621 0 : if (PyLong_Check(value)) {
3622 0 : unsigned long long test_var;
3623 0 : test_var = PyLong_AsUnsignedLongLong(value);
3624 0 : if (PyErr_Occurred() != NULL) {
3625 0 : return -1;
3626 : }
3627 0 : if (test_var > uint_max) {
3628 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3629 : PyLong_Type.tp_name, uint_max, test_var);
3630 0 : return -1;
3631 : }
3632 0 : object->modified_id = test_var;
3633 : } else {
3634 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3635 : PyLong_Type.tp_name);
3636 0 : return -1;
3637 : }
3638 : }
3639 0 : return 0;
3640 : }
3641 :
3642 0 : static PyObject *py_lsa_ModificationInfo_get_db_create_time(PyObject *obj, void *closure)
3643 : {
3644 0 : struct lsa_ModificationInfo *object = pytalloc_get_ptr(obj);
3645 0 : PyObject *py_db_create_time;
3646 0 : py_db_create_time = PyLong_FromUnsignedLongLong(object->db_create_time);
3647 0 : return py_db_create_time;
3648 : }
3649 :
3650 0 : static int py_lsa_ModificationInfo_set_db_create_time(PyObject *py_obj, PyObject *value, void *closure)
3651 : {
3652 0 : struct lsa_ModificationInfo *object = pytalloc_get_ptr(py_obj);
3653 0 : if (value == NULL) {
3654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->db_create_time");
3655 0 : return -1;
3656 : }
3657 : {
3658 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->db_create_time));
3659 0 : if (PyLong_Check(value)) {
3660 0 : unsigned long long test_var;
3661 0 : test_var = PyLong_AsUnsignedLongLong(value);
3662 0 : if (PyErr_Occurred() != NULL) {
3663 0 : return -1;
3664 : }
3665 0 : if (test_var > uint_max) {
3666 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3667 : PyLong_Type.tp_name, uint_max, test_var);
3668 0 : return -1;
3669 : }
3670 0 : object->db_create_time = test_var;
3671 : } else {
3672 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3673 : PyLong_Type.tp_name);
3674 0 : return -1;
3675 : }
3676 : }
3677 0 : return 0;
3678 : }
3679 :
3680 : static PyGetSetDef py_lsa_ModificationInfo_getsetters[] = {
3681 : {
3682 : .name = discard_const_p(char, "modified_id"),
3683 : .get = py_lsa_ModificationInfo_get_modified_id,
3684 : .set = py_lsa_ModificationInfo_set_modified_id,
3685 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
3686 : },
3687 : {
3688 : .name = discard_const_p(char, "db_create_time"),
3689 : .get = py_lsa_ModificationInfo_get_db_create_time,
3690 : .set = py_lsa_ModificationInfo_set_db_create_time,
3691 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
3692 : },
3693 : { .name = NULL }
3694 : };
3695 :
3696 0 : static PyObject *py_lsa_ModificationInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3697 : {
3698 0 : return pytalloc_new(struct lsa_ModificationInfo, type);
3699 : }
3700 :
3701 :
3702 : static PyTypeObject lsa_ModificationInfo_Type = {
3703 : PyVarObject_HEAD_INIT(NULL, 0)
3704 : .tp_name = "lsa.ModificationInfo",
3705 : .tp_getset = py_lsa_ModificationInfo_getsetters,
3706 : .tp_methods = NULL,
3707 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3708 : .tp_new = py_lsa_ModificationInfo_new,
3709 : };
3710 :
3711 :
3712 0 : static PyObject *py_lsa_AuditFullSetInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3713 : {
3714 0 : struct lsa_AuditFullSetInfo *object = pytalloc_get_ptr(obj);
3715 0 : PyObject *py_shutdown_on_full;
3716 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)(object->shutdown_on_full));
3717 0 : return py_shutdown_on_full;
3718 : }
3719 :
3720 0 : static int py_lsa_AuditFullSetInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3721 : {
3722 0 : struct lsa_AuditFullSetInfo *object = pytalloc_get_ptr(py_obj);
3723 0 : if (value == NULL) {
3724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->shutdown_on_full");
3725 0 : return -1;
3726 : }
3727 : {
3728 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3729 0 : if (PyLong_Check(value)) {
3730 0 : unsigned long long test_var;
3731 0 : test_var = PyLong_AsUnsignedLongLong(value);
3732 0 : if (PyErr_Occurred() != NULL) {
3733 0 : return -1;
3734 : }
3735 0 : if (test_var > uint_max) {
3736 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3737 : PyLong_Type.tp_name, uint_max, test_var);
3738 0 : return -1;
3739 : }
3740 0 : object->shutdown_on_full = test_var;
3741 : } else {
3742 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3743 : PyLong_Type.tp_name);
3744 0 : return -1;
3745 : }
3746 : }
3747 0 : return 0;
3748 : }
3749 :
3750 : static PyGetSetDef py_lsa_AuditFullSetInfo_getsetters[] = {
3751 : {
3752 : .name = discard_const_p(char, "shutdown_on_full"),
3753 : .get = py_lsa_AuditFullSetInfo_get_shutdown_on_full,
3754 : .set = py_lsa_AuditFullSetInfo_set_shutdown_on_full,
3755 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3756 : },
3757 : { .name = NULL }
3758 : };
3759 :
3760 0 : static PyObject *py_lsa_AuditFullSetInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3761 : {
3762 0 : return pytalloc_new(struct lsa_AuditFullSetInfo, type);
3763 : }
3764 :
3765 :
3766 : static PyTypeObject lsa_AuditFullSetInfo_Type = {
3767 : PyVarObject_HEAD_INIT(NULL, 0)
3768 : .tp_name = "lsa.AuditFullSetInfo",
3769 : .tp_getset = py_lsa_AuditFullSetInfo_getsetters,
3770 : .tp_methods = NULL,
3771 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3772 : .tp_new = py_lsa_AuditFullSetInfo_new,
3773 : };
3774 :
3775 :
3776 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_shutdown_on_full(PyObject *obj, void *closure)
3777 : {
3778 0 : struct lsa_AuditFullQueryInfo *object = pytalloc_get_ptr(obj);
3779 0 : PyObject *py_shutdown_on_full;
3780 0 : py_shutdown_on_full = PyLong_FromLong((uint16_t)(object->shutdown_on_full));
3781 0 : return py_shutdown_on_full;
3782 : }
3783 :
3784 0 : static int py_lsa_AuditFullQueryInfo_set_shutdown_on_full(PyObject *py_obj, PyObject *value, void *closure)
3785 : {
3786 0 : struct lsa_AuditFullQueryInfo *object = pytalloc_get_ptr(py_obj);
3787 0 : if (value == NULL) {
3788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->shutdown_on_full");
3789 0 : return -1;
3790 : }
3791 : {
3792 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->shutdown_on_full));
3793 0 : if (PyLong_Check(value)) {
3794 0 : unsigned long long test_var;
3795 0 : test_var = PyLong_AsUnsignedLongLong(value);
3796 0 : if (PyErr_Occurred() != NULL) {
3797 0 : return -1;
3798 : }
3799 0 : if (test_var > uint_max) {
3800 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3801 : PyLong_Type.tp_name, uint_max, test_var);
3802 0 : return -1;
3803 : }
3804 0 : object->shutdown_on_full = test_var;
3805 : } else {
3806 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3807 : PyLong_Type.tp_name);
3808 0 : return -1;
3809 : }
3810 : }
3811 0 : return 0;
3812 : }
3813 :
3814 0 : static PyObject *py_lsa_AuditFullQueryInfo_get_log_is_full(PyObject *obj, void *closure)
3815 : {
3816 0 : struct lsa_AuditFullQueryInfo *object = pytalloc_get_ptr(obj);
3817 0 : PyObject *py_log_is_full;
3818 0 : py_log_is_full = PyLong_FromLong((uint16_t)(object->log_is_full));
3819 0 : return py_log_is_full;
3820 : }
3821 :
3822 0 : static int py_lsa_AuditFullQueryInfo_set_log_is_full(PyObject *py_obj, PyObject *value, void *closure)
3823 : {
3824 0 : struct lsa_AuditFullQueryInfo *object = pytalloc_get_ptr(py_obj);
3825 0 : if (value == NULL) {
3826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->log_is_full");
3827 0 : return -1;
3828 : }
3829 : {
3830 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->log_is_full));
3831 0 : if (PyLong_Check(value)) {
3832 0 : unsigned long long test_var;
3833 0 : test_var = PyLong_AsUnsignedLongLong(value);
3834 0 : if (PyErr_Occurred() != NULL) {
3835 0 : return -1;
3836 : }
3837 0 : if (test_var > uint_max) {
3838 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3839 : PyLong_Type.tp_name, uint_max, test_var);
3840 0 : return -1;
3841 : }
3842 0 : object->log_is_full = test_var;
3843 : } else {
3844 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3845 : PyLong_Type.tp_name);
3846 0 : return -1;
3847 : }
3848 : }
3849 0 : return 0;
3850 : }
3851 :
3852 : static PyGetSetDef py_lsa_AuditFullQueryInfo_getsetters[] = {
3853 : {
3854 : .name = discard_const_p(char, "shutdown_on_full"),
3855 : .get = py_lsa_AuditFullQueryInfo_get_shutdown_on_full,
3856 : .set = py_lsa_AuditFullQueryInfo_set_shutdown_on_full,
3857 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3858 : },
3859 : {
3860 : .name = discard_const_p(char, "log_is_full"),
3861 : .get = py_lsa_AuditFullQueryInfo_get_log_is_full,
3862 : .set = py_lsa_AuditFullQueryInfo_set_log_is_full,
3863 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
3864 : },
3865 : { .name = NULL }
3866 : };
3867 :
3868 0 : static PyObject *py_lsa_AuditFullQueryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3869 : {
3870 0 : return pytalloc_new(struct lsa_AuditFullQueryInfo, type);
3871 : }
3872 :
3873 :
3874 : static PyTypeObject lsa_AuditFullQueryInfo_Type = {
3875 : PyVarObject_HEAD_INIT(NULL, 0)
3876 : .tp_name = "lsa.AuditFullQueryInfo",
3877 : .tp_getset = py_lsa_AuditFullQueryInfo_getsetters,
3878 : .tp_methods = NULL,
3879 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3880 : .tp_new = py_lsa_AuditFullQueryInfo_new,
3881 : };
3882 :
3883 :
3884 245 : static PyObject *py_lsa_DnsDomainInfo_get_name(PyObject *obj, void *closure)
3885 : {
3886 245 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(obj);
3887 2 : PyObject *py_name;
3888 245 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->name);
3889 245 : return py_name;
3890 : }
3891 :
3892 0 : static int py_lsa_DnsDomainInfo_set_name(PyObject *py_obj, PyObject *value, void *closure)
3893 : {
3894 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
3895 0 : if (value == NULL) {
3896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
3897 0 : return -1;
3898 : }
3899 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3900 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3901 0 : PyErr_NoMemory();
3902 0 : return -1;
3903 : }
3904 0 : object->name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3905 0 : return 0;
3906 : }
3907 :
3908 440 : static PyObject *py_lsa_DnsDomainInfo_get_dns_domain(PyObject *obj, void *closure)
3909 : {
3910 440 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(obj);
3911 6 : PyObject *py_dns_domain;
3912 440 : py_dns_domain = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain);
3913 440 : return py_dns_domain;
3914 : }
3915 :
3916 0 : static int py_lsa_DnsDomainInfo_set_dns_domain(PyObject *py_obj, PyObject *value, void *closure)
3917 : {
3918 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
3919 0 : if (value == NULL) {
3920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dns_domain");
3921 0 : return -1;
3922 : }
3923 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3924 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3925 0 : PyErr_NoMemory();
3926 0 : return -1;
3927 : }
3928 0 : object->dns_domain = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3929 0 : return 0;
3930 : }
3931 :
3932 0 : static PyObject *py_lsa_DnsDomainInfo_get_dns_forest(PyObject *obj, void *closure)
3933 : {
3934 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(obj);
3935 0 : PyObject *py_dns_forest;
3936 0 : py_dns_forest = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_forest);
3937 0 : return py_dns_forest;
3938 : }
3939 :
3940 0 : static int py_lsa_DnsDomainInfo_set_dns_forest(PyObject *py_obj, PyObject *value, void *closure)
3941 : {
3942 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
3943 0 : if (value == NULL) {
3944 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dns_forest");
3945 0 : return -1;
3946 : }
3947 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
3948 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3949 0 : PyErr_NoMemory();
3950 0 : return -1;
3951 : }
3952 0 : object->dns_forest = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
3953 0 : return 0;
3954 : }
3955 :
3956 0 : static PyObject *py_lsa_DnsDomainInfo_get_domain_guid(PyObject *obj, void *closure)
3957 : {
3958 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(obj);
3959 0 : PyObject *py_domain_guid;
3960 0 : py_domain_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->domain_guid);
3961 0 : return py_domain_guid;
3962 : }
3963 :
3964 0 : static int py_lsa_DnsDomainInfo_set_domain_guid(PyObject *py_obj, PyObject *value, void *closure)
3965 : {
3966 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
3967 0 : if (value == NULL) {
3968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_guid");
3969 0 : return -1;
3970 : }
3971 0 : PY_CHECK_TYPE(GUID_Type, value, return -1;);
3972 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3973 0 : PyErr_NoMemory();
3974 0 : return -1;
3975 : }
3976 0 : object->domain_guid = *(struct GUID *)pytalloc_get_ptr(value);
3977 0 : return 0;
3978 : }
3979 :
3980 245 : static PyObject *py_lsa_DnsDomainInfo_get_sid(PyObject *obj, void *closure)
3981 : {
3982 245 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(obj);
3983 2 : PyObject *py_sid;
3984 245 : if (object->sid == NULL) {
3985 0 : Py_RETURN_NONE;
3986 : }
3987 245 : if (object->sid == NULL) {
3988 0 : py_sid = Py_None;
3989 0 : Py_INCREF(py_sid);
3990 : } else {
3991 245 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
3992 : }
3993 245 : return py_sid;
3994 : }
3995 :
3996 0 : static int py_lsa_DnsDomainInfo_set_sid(PyObject *py_obj, PyObject *value, void *closure)
3997 : {
3998 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
3999 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
4000 0 : if (value == NULL) {
4001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
4002 0 : return -1;
4003 : }
4004 0 : if (value == Py_None) {
4005 0 : object->sid = NULL;
4006 : } else {
4007 0 : object->sid = NULL;
4008 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4009 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4010 0 : PyErr_NoMemory();
4011 0 : return -1;
4012 : }
4013 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4014 : }
4015 0 : return 0;
4016 : }
4017 :
4018 : static PyGetSetDef py_lsa_DnsDomainInfo_getsetters[] = {
4019 : {
4020 : .name = discard_const_p(char, "name"),
4021 : .get = py_lsa_DnsDomainInfo_get_name,
4022 : .set = py_lsa_DnsDomainInfo_set_name,
4023 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4024 : },
4025 : {
4026 : .name = discard_const_p(char, "dns_domain"),
4027 : .get = py_lsa_DnsDomainInfo_get_dns_domain,
4028 : .set = py_lsa_DnsDomainInfo_set_dns_domain,
4029 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4030 : },
4031 : {
4032 : .name = discard_const_p(char, "dns_forest"),
4033 : .get = py_lsa_DnsDomainInfo_get_dns_forest,
4034 : .set = py_lsa_DnsDomainInfo_set_dns_forest,
4035 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
4036 : },
4037 : {
4038 : .name = discard_const_p(char, "domain_guid"),
4039 : .get = py_lsa_DnsDomainInfo_get_domain_guid,
4040 : .set = py_lsa_DnsDomainInfo_set_domain_guid,
4041 : .doc = discard_const_p(char, "PIDL-generated element of base type GUID")
4042 : },
4043 : {
4044 : .name = discard_const_p(char, "sid"),
4045 : .get = py_lsa_DnsDomainInfo_get_sid,
4046 : .set = py_lsa_DnsDomainInfo_set_sid,
4047 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4048 : },
4049 : { .name = NULL }
4050 : };
4051 :
4052 0 : static PyObject *py_lsa_DnsDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4053 : {
4054 0 : return pytalloc_new(struct lsa_DnsDomainInfo, type);
4055 : }
4056 :
4057 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4058 : {
4059 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
4060 0 : PyObject *ret = NULL;
4061 0 : DATA_BLOB blob;
4062 0 : enum ndr_err_code err;
4063 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4064 0 : if (tmp_ctx == NULL) {
4065 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4066 0 : return NULL;
4067 : }
4068 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_DnsDomainInfo);
4069 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4070 0 : TALLOC_FREE(tmp_ctx);
4071 0 : PyErr_SetNdrError(err);
4072 0 : return NULL;
4073 : }
4074 :
4075 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4076 0 : TALLOC_FREE(tmp_ctx);
4077 0 : return ret;
4078 : }
4079 :
4080 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4081 : {
4082 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
4083 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4084 0 : Py_ssize_t blob_length = 0;
4085 0 : enum ndr_err_code err;
4086 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4087 0 : PyObject *allow_remaining_obj = NULL;
4088 0 : bool allow_remaining = false;
4089 :
4090 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4091 : discard_const_p(char *, kwnames),
4092 : &blob.data, &blob_length,
4093 : &allow_remaining_obj)) {
4094 0 : return NULL;
4095 : }
4096 0 : blob.length = blob_length;
4097 :
4098 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4099 0 : allow_remaining = true;
4100 : }
4101 :
4102 0 : if (allow_remaining) {
4103 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4104 : } else {
4105 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_DnsDomainInfo);
4106 : }
4107 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4108 0 : PyErr_SetNdrError(err);
4109 0 : return NULL;
4110 : }
4111 :
4112 0 : Py_RETURN_NONE;
4113 : }
4114 :
4115 0 : static PyObject *py_lsa_DnsDomainInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4116 : {
4117 0 : struct lsa_DnsDomainInfo *object = pytalloc_get_ptr(py_obj);
4118 0 : PyObject *ret;
4119 0 : char *retstr;
4120 :
4121 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_DnsDomainInfo, "lsa_DnsDomainInfo", object);
4122 0 : ret = PyUnicode_FromString(retstr);
4123 0 : talloc_free(retstr);
4124 :
4125 0 : return ret;
4126 : }
4127 :
4128 : static PyMethodDef py_lsa_DnsDomainInfo_methods[] = {
4129 : { "__ndr_pack__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4130 : { "__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" },
4131 : { "__ndr_print__", (PyCFunction)py_lsa_DnsDomainInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4132 : { NULL, NULL, 0, NULL }
4133 : };
4134 :
4135 :
4136 : static PyTypeObject lsa_DnsDomainInfo_Type = {
4137 : PyVarObject_HEAD_INIT(NULL, 0)
4138 : .tp_name = "lsa.DnsDomainInfo",
4139 : .tp_getset = py_lsa_DnsDomainInfo_getsetters,
4140 : .tp_methods = py_lsa_DnsDomainInfo_methods,
4141 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4142 : .tp_new = py_lsa_DnsDomainInfo_new,
4143 : };
4144 :
4145 223 : static PyObject *py_import_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, union lsa_PolicyInformation *in)
4146 : {
4147 2 : PyObject *ret;
4148 :
4149 223 : switch (level) {
4150 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4151 0 : ret = pytalloc_reference_ex(&lsa_AuditLogInfo_Type, mem_ctx, &in->audit_log);
4152 0 : return ret;
4153 :
4154 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4155 0 : ret = pytalloc_reference_ex(&lsa_AuditEventsInfo_Type, mem_ctx, &in->audit_events);
4156 0 : return ret;
4157 :
4158 0 : case LSA_POLICY_INFO_DOMAIN:
4159 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->domain);
4160 0 : return ret;
4161 :
4162 0 : case LSA_POLICY_INFO_PD:
4163 0 : ret = pytalloc_reference_ex(&lsa_PDAccountInfo_Type, mem_ctx, &in->pd);
4164 0 : return ret;
4165 :
4166 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4167 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->account_domain);
4168 0 : return ret;
4169 :
4170 0 : case LSA_POLICY_INFO_ROLE:
4171 0 : ret = pytalloc_reference_ex(&lsa_ServerRole_Type, mem_ctx, &in->role);
4172 0 : return ret;
4173 :
4174 0 : case LSA_POLICY_INFO_REPLICA:
4175 0 : ret = pytalloc_reference_ex(&lsa_ReplicaSourceInfo_Type, mem_ctx, &in->replica);
4176 0 : return ret;
4177 :
4178 0 : case LSA_POLICY_INFO_QUOTA:
4179 0 : ret = pytalloc_reference_ex(&lsa_DefaultQuotaInfo_Type, mem_ctx, &in->quota);
4180 0 : return ret;
4181 :
4182 0 : case LSA_POLICY_INFO_MOD:
4183 0 : ret = pytalloc_reference_ex(&lsa_ModificationInfo_Type, mem_ctx, &in->mod);
4184 0 : return ret;
4185 :
4186 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4187 0 : ret = pytalloc_reference_ex(&lsa_AuditFullSetInfo_Type, mem_ctx, &in->auditfullset);
4188 0 : return ret;
4189 :
4190 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4191 0 : ret = pytalloc_reference_ex(&lsa_AuditFullQueryInfo_Type, mem_ctx, &in->auditfullquery);
4192 0 : return ret;
4193 :
4194 223 : case LSA_POLICY_INFO_DNS:
4195 223 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns);
4196 223 : return ret;
4197 :
4198 0 : case LSA_POLICY_INFO_DNS_INT:
4199 0 : ret = pytalloc_reference_ex(&lsa_DnsDomainInfo_Type, mem_ctx, &in->dns_int);
4200 0 : return ret;
4201 :
4202 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4203 0 : ret = pytalloc_reference_ex(&lsa_DomainInfo_Type, mem_ctx, &in->l_account_domain);
4204 0 : return ret;
4205 :
4206 : }
4207 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
4208 0 : return NULL;
4209 : }
4210 :
4211 0 : static union lsa_PolicyInformation *py_export_lsa_PolicyInformation(TALLOC_CTX *mem_ctx, int level, PyObject *in)
4212 : {
4213 0 : union lsa_PolicyInformation *ret = talloc_zero(mem_ctx, union lsa_PolicyInformation);
4214 0 : switch (level) {
4215 0 : case LSA_POLICY_INFO_AUDIT_LOG:
4216 0 : if (in == NULL) {
4217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->audit_log");
4218 0 : talloc_free(ret); return NULL;
4219 : }
4220 0 : PY_CHECK_TYPE(&lsa_AuditLogInfo_Type, in, talloc_free(ret); return NULL;);
4221 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4222 0 : PyErr_NoMemory();
4223 0 : talloc_free(ret); return NULL;
4224 : }
4225 0 : ret->audit_log = *(struct lsa_AuditLogInfo *)pytalloc_get_ptr(in);
4226 0 : break;
4227 :
4228 0 : case LSA_POLICY_INFO_AUDIT_EVENTS:
4229 0 : if (in == NULL) {
4230 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->audit_events");
4231 0 : talloc_free(ret); return NULL;
4232 : }
4233 0 : PY_CHECK_TYPE(&lsa_AuditEventsInfo_Type, in, talloc_free(ret); return NULL;);
4234 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4235 0 : PyErr_NoMemory();
4236 0 : talloc_free(ret); return NULL;
4237 : }
4238 0 : ret->audit_events = *(struct lsa_AuditEventsInfo *)pytalloc_get_ptr(in);
4239 0 : break;
4240 :
4241 0 : case LSA_POLICY_INFO_DOMAIN:
4242 0 : if (in == NULL) {
4243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->domain");
4244 0 : talloc_free(ret); return NULL;
4245 : }
4246 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4247 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4248 0 : PyErr_NoMemory();
4249 0 : talloc_free(ret); return NULL;
4250 : }
4251 0 : ret->domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4252 0 : break;
4253 :
4254 0 : case LSA_POLICY_INFO_PD:
4255 0 : if (in == NULL) {
4256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->pd");
4257 0 : talloc_free(ret); return NULL;
4258 : }
4259 0 : PY_CHECK_TYPE(&lsa_PDAccountInfo_Type, in, talloc_free(ret); return NULL;);
4260 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4261 0 : PyErr_NoMemory();
4262 0 : talloc_free(ret); return NULL;
4263 : }
4264 0 : ret->pd = *(struct lsa_PDAccountInfo *)pytalloc_get_ptr(in);
4265 0 : break;
4266 :
4267 0 : case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
4268 0 : if (in == NULL) {
4269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->account_domain");
4270 0 : talloc_free(ret); return NULL;
4271 : }
4272 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4273 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4274 0 : PyErr_NoMemory();
4275 0 : talloc_free(ret); return NULL;
4276 : }
4277 0 : ret->account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4278 0 : break;
4279 :
4280 0 : case LSA_POLICY_INFO_ROLE:
4281 0 : if (in == NULL) {
4282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->role");
4283 0 : talloc_free(ret); return NULL;
4284 : }
4285 0 : PY_CHECK_TYPE(&lsa_ServerRole_Type, in, talloc_free(ret); return NULL;);
4286 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4287 0 : PyErr_NoMemory();
4288 0 : talloc_free(ret); return NULL;
4289 : }
4290 0 : ret->role = *(struct lsa_ServerRole *)pytalloc_get_ptr(in);
4291 0 : break;
4292 :
4293 0 : case LSA_POLICY_INFO_REPLICA:
4294 0 : if (in == NULL) {
4295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->replica");
4296 0 : talloc_free(ret); return NULL;
4297 : }
4298 0 : PY_CHECK_TYPE(&lsa_ReplicaSourceInfo_Type, in, talloc_free(ret); return NULL;);
4299 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4300 0 : PyErr_NoMemory();
4301 0 : talloc_free(ret); return NULL;
4302 : }
4303 0 : ret->replica = *(struct lsa_ReplicaSourceInfo *)pytalloc_get_ptr(in);
4304 0 : break;
4305 :
4306 0 : case LSA_POLICY_INFO_QUOTA:
4307 0 : if (in == NULL) {
4308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->quota");
4309 0 : talloc_free(ret); return NULL;
4310 : }
4311 0 : PY_CHECK_TYPE(&lsa_DefaultQuotaInfo_Type, in, talloc_free(ret); return NULL;);
4312 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4313 0 : PyErr_NoMemory();
4314 0 : talloc_free(ret); return NULL;
4315 : }
4316 0 : ret->quota = *(struct lsa_DefaultQuotaInfo *)pytalloc_get_ptr(in);
4317 0 : break;
4318 :
4319 0 : case LSA_POLICY_INFO_MOD:
4320 0 : if (in == NULL) {
4321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->mod");
4322 0 : talloc_free(ret); return NULL;
4323 : }
4324 0 : PY_CHECK_TYPE(&lsa_ModificationInfo_Type, in, talloc_free(ret); return NULL;);
4325 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4326 0 : PyErr_NoMemory();
4327 0 : talloc_free(ret); return NULL;
4328 : }
4329 0 : ret->mod = *(struct lsa_ModificationInfo *)pytalloc_get_ptr(in);
4330 0 : break;
4331 :
4332 0 : case LSA_POLICY_INFO_AUDIT_FULL_SET:
4333 0 : if (in == NULL) {
4334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auditfullset");
4335 0 : talloc_free(ret); return NULL;
4336 : }
4337 0 : PY_CHECK_TYPE(&lsa_AuditFullSetInfo_Type, in, talloc_free(ret); return NULL;);
4338 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4339 0 : PyErr_NoMemory();
4340 0 : talloc_free(ret); return NULL;
4341 : }
4342 0 : ret->auditfullset = *(struct lsa_AuditFullSetInfo *)pytalloc_get_ptr(in);
4343 0 : break;
4344 :
4345 0 : case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
4346 0 : if (in == NULL) {
4347 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auditfullquery");
4348 0 : talloc_free(ret); return NULL;
4349 : }
4350 0 : PY_CHECK_TYPE(&lsa_AuditFullQueryInfo_Type, in, talloc_free(ret); return NULL;);
4351 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4352 0 : PyErr_NoMemory();
4353 0 : talloc_free(ret); return NULL;
4354 : }
4355 0 : ret->auditfullquery = *(struct lsa_AuditFullQueryInfo *)pytalloc_get_ptr(in);
4356 0 : break;
4357 :
4358 0 : case LSA_POLICY_INFO_DNS:
4359 0 : if (in == NULL) {
4360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dns");
4361 0 : talloc_free(ret); return NULL;
4362 : }
4363 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4364 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4365 0 : PyErr_NoMemory();
4366 0 : talloc_free(ret); return NULL;
4367 : }
4368 0 : ret->dns = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4369 0 : break;
4370 :
4371 0 : case LSA_POLICY_INFO_DNS_INT:
4372 0 : if (in == NULL) {
4373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->dns_int");
4374 0 : talloc_free(ret); return NULL;
4375 : }
4376 0 : PY_CHECK_TYPE(&lsa_DnsDomainInfo_Type, in, talloc_free(ret); return NULL;);
4377 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4378 0 : PyErr_NoMemory();
4379 0 : talloc_free(ret); return NULL;
4380 : }
4381 0 : ret->dns_int = *(struct lsa_DnsDomainInfo *)pytalloc_get_ptr(in);
4382 0 : break;
4383 :
4384 0 : case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
4385 0 : if (in == NULL) {
4386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->l_account_domain");
4387 0 : talloc_free(ret); return NULL;
4388 : }
4389 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, in, talloc_free(ret); return NULL;);
4390 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
4391 0 : PyErr_NoMemory();
4392 0 : talloc_free(ret); return NULL;
4393 : }
4394 0 : ret->l_account_domain = *(struct lsa_DomainInfo *)pytalloc_get_ptr(in);
4395 0 : break;
4396 :
4397 0 : default:
4398 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
4399 0 : talloc_free(ret);
4400 0 : ret = NULL;
4401 : }
4402 :
4403 0 : return ret;
4404 : }
4405 :
4406 223 : static PyObject *py_lsa_PolicyInformation_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4407 : {
4408 223 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4409 223 : PyObject *mem_ctx_obj = NULL;
4410 223 : TALLOC_CTX *mem_ctx = NULL;
4411 223 : int level = 0;
4412 223 : PyObject *in_obj = NULL;
4413 223 : union lsa_PolicyInformation *in = NULL;
4414 :
4415 223 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
4416 : discard_const_p(char *, kwnames),
4417 : &mem_ctx_obj,
4418 : &level,
4419 : &in_obj)) {
4420 0 : return NULL;
4421 : }
4422 223 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4423 223 : if (mem_ctx == NULL) {
4424 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4425 0 : return NULL;
4426 : }
4427 223 : in = (union lsa_PolicyInformation *)pytalloc_get_ptr(in_obj);
4428 223 : if (in == NULL) {
4429 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_PolicyInformation!");
4430 0 : return NULL;
4431 : }
4432 :
4433 223 : return py_import_lsa_PolicyInformation(mem_ctx, level, in);
4434 : }
4435 :
4436 0 : static PyObject *py_lsa_PolicyInformation_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4437 : {
4438 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
4439 0 : PyObject *mem_ctx_obj = NULL;
4440 0 : TALLOC_CTX *mem_ctx = NULL;
4441 0 : int level = 0;
4442 0 : PyObject *in = NULL;
4443 0 : union lsa_PolicyInformation *out = NULL;
4444 :
4445 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
4446 : discard_const_p(char *, kwnames),
4447 : &mem_ctx_obj,
4448 : &level,
4449 : &in)) {
4450 0 : return NULL;
4451 : }
4452 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
4453 0 : if (mem_ctx == NULL) {
4454 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
4455 0 : return NULL;
4456 : }
4457 :
4458 0 : out = py_export_lsa_PolicyInformation(mem_ctx, level, in);
4459 0 : if (out == NULL) {
4460 0 : return NULL;
4461 : }
4462 :
4463 0 : return pytalloc_GenericObject_reference(out);
4464 : }
4465 :
4466 : static PyMethodDef py_lsa_PolicyInformation_methods[] = {
4467 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_import),
4468 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4469 : "T.__import__(mem_ctx, level, in) => ret." },
4470 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_PolicyInformation_export),
4471 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
4472 : "T.__export__(mem_ctx, level, in) => ret." },
4473 : { NULL, NULL, 0, NULL }
4474 : };
4475 :
4476 0 : static PyObject *py_lsa_PolicyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4477 : {
4478 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
4479 0 : return NULL;
4480 : }
4481 :
4482 :
4483 : static PyTypeObject lsa_PolicyInformation_Type = {
4484 : PyVarObject_HEAD_INIT(NULL, 0)
4485 : .tp_name = "lsa.PolicyInformation",
4486 : .tp_getset = NULL,
4487 : .tp_methods = py_lsa_PolicyInformation_methods,
4488 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4489 : .tp_new = py_lsa_PolicyInformation_new,
4490 : };
4491 :
4492 :
4493 0 : static PyObject *py_lsa_SidPtr_get_sid(PyObject *obj, void *closure)
4494 : {
4495 0 : struct lsa_SidPtr *object = pytalloc_get_ptr(obj);
4496 0 : PyObject *py_sid;
4497 0 : if (object->sid == NULL) {
4498 0 : Py_RETURN_NONE;
4499 : }
4500 0 : if (object->sid == NULL) {
4501 0 : py_sid = Py_None;
4502 0 : Py_INCREF(py_sid);
4503 : } else {
4504 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
4505 : }
4506 0 : return py_sid;
4507 : }
4508 :
4509 7 : static int py_lsa_SidPtr_set_sid(PyObject *py_obj, PyObject *value, void *closure)
4510 : {
4511 7 : struct lsa_SidPtr *object = pytalloc_get_ptr(py_obj);
4512 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
4513 7 : if (value == NULL) {
4514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
4515 0 : return -1;
4516 : }
4517 7 : if (value == Py_None) {
4518 0 : object->sid = NULL;
4519 : } else {
4520 7 : object->sid = NULL;
4521 7 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
4522 7 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4523 0 : PyErr_NoMemory();
4524 0 : return -1;
4525 : }
4526 7 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
4527 : }
4528 7 : return 0;
4529 : }
4530 :
4531 : static PyGetSetDef py_lsa_SidPtr_getsetters[] = {
4532 : {
4533 : .name = discard_const_p(char, "sid"),
4534 : .get = py_lsa_SidPtr_get_sid,
4535 : .set = py_lsa_SidPtr_set_sid,
4536 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
4537 : },
4538 : { .name = NULL }
4539 : };
4540 :
4541 7 : static PyObject *py_lsa_SidPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4542 : {
4543 7 : return pytalloc_new(struct lsa_SidPtr, type);
4544 : }
4545 :
4546 :
4547 : static PyTypeObject lsa_SidPtr_Type = {
4548 : PyVarObject_HEAD_INIT(NULL, 0)
4549 : .tp_name = "lsa.SidPtr",
4550 : .tp_getset = py_lsa_SidPtr_getsetters,
4551 : .tp_methods = NULL,
4552 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4553 : .tp_new = py_lsa_SidPtr_new,
4554 : };
4555 :
4556 :
4557 0 : static PyObject *py_lsa_SidArray_get_num_sids(PyObject *obj, void *closure)
4558 : {
4559 0 : struct lsa_SidArray *object = pytalloc_get_ptr(obj);
4560 0 : PyObject *py_num_sids;
4561 0 : py_num_sids = PyLong_FromUnsignedLongLong((uint32_t)(object->num_sids));
4562 0 : return py_num_sids;
4563 : }
4564 :
4565 6 : static int py_lsa_SidArray_set_num_sids(PyObject *py_obj, PyObject *value, void *closure)
4566 : {
4567 6 : struct lsa_SidArray *object = pytalloc_get_ptr(py_obj);
4568 6 : if (value == NULL) {
4569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_sids");
4570 0 : return -1;
4571 : }
4572 : {
4573 6 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_sids));
4574 6 : if (PyLong_Check(value)) {
4575 0 : unsigned long long test_var;
4576 6 : test_var = PyLong_AsUnsignedLongLong(value);
4577 6 : if (PyErr_Occurred() != NULL) {
4578 0 : return -1;
4579 : }
4580 6 : if (test_var > uint_max) {
4581 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4582 : PyLong_Type.tp_name, uint_max, test_var);
4583 0 : return -1;
4584 : }
4585 6 : object->num_sids = test_var;
4586 : } else {
4587 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4588 : PyLong_Type.tp_name);
4589 0 : return -1;
4590 : }
4591 : }
4592 6 : return 0;
4593 : }
4594 :
4595 0 : static PyObject *py_lsa_SidArray_get_sids(PyObject *obj, void *closure)
4596 : {
4597 0 : struct lsa_SidArray *object = pytalloc_get_ptr(obj);
4598 0 : PyObject *py_sids;
4599 0 : if (object->sids == NULL) {
4600 0 : Py_RETURN_NONE;
4601 : }
4602 0 : if (object->sids == NULL) {
4603 0 : py_sids = Py_None;
4604 0 : Py_INCREF(py_sids);
4605 : } else {
4606 0 : py_sids = PyList_New(object->num_sids);
4607 0 : if (py_sids == NULL) {
4608 0 : return NULL;
4609 : }
4610 : {
4611 : int sids_cntr_1;
4612 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->num_sids); sids_cntr_1++) {
4613 0 : PyObject *py_sids_1;
4614 0 : py_sids_1 = pytalloc_reference_ex(&lsa_SidPtr_Type, object->sids, &(object->sids)[sids_cntr_1]);
4615 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
4616 : }
4617 : }
4618 : }
4619 0 : return py_sids;
4620 : }
4621 :
4622 7 : static int py_lsa_SidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
4623 : {
4624 7 : struct lsa_SidArray *object = pytalloc_get_ptr(py_obj);
4625 7 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
4626 7 : if (value == NULL) {
4627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
4628 0 : return -1;
4629 : }
4630 7 : if (value == Py_None) {
4631 0 : object->sids = NULL;
4632 : } else {
4633 7 : object->sids = NULL;
4634 7 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4635 : {
4636 0 : int sids_cntr_1;
4637 7 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
4638 7 : if (!object->sids) { return -1; }
4639 7 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
4640 14 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
4641 7 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
4642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_1]");
4643 0 : return -1;
4644 : }
4645 7 : PY_CHECK_TYPE(&lsa_SidPtr_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
4646 7 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
4647 0 : PyErr_NoMemory();
4648 0 : return -1;
4649 : }
4650 7 : (object->sids)[sids_cntr_1] = *(struct lsa_SidPtr *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
4651 : }
4652 : }
4653 : }
4654 7 : return 0;
4655 : }
4656 :
4657 : static PyGetSetDef py_lsa_SidArray_getsetters[] = {
4658 : {
4659 : .name = discard_const_p(char, "num_sids"),
4660 : .get = py_lsa_SidArray_get_num_sids,
4661 : .set = py_lsa_SidArray_set_num_sids,
4662 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4663 : },
4664 : {
4665 : .name = discard_const_p(char, "sids"),
4666 : .get = py_lsa_SidArray_get_sids,
4667 : .set = py_lsa_SidArray_set_sids,
4668 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidPtr")
4669 : },
4670 : { .name = NULL }
4671 : };
4672 :
4673 7 : static PyObject *py_lsa_SidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4674 : {
4675 7 : return pytalloc_new(struct lsa_SidArray, type);
4676 : }
4677 :
4678 0 : static PyObject *py_lsa_SidArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4679 : {
4680 0 : struct lsa_SidArray *object = pytalloc_get_ptr(py_obj);
4681 0 : PyObject *ret = NULL;
4682 0 : DATA_BLOB blob;
4683 0 : enum ndr_err_code err;
4684 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4685 0 : if (tmp_ctx == NULL) {
4686 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4687 0 : return NULL;
4688 : }
4689 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_SidArray);
4690 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4691 0 : TALLOC_FREE(tmp_ctx);
4692 0 : PyErr_SetNdrError(err);
4693 0 : return NULL;
4694 : }
4695 :
4696 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4697 0 : TALLOC_FREE(tmp_ctx);
4698 0 : return ret;
4699 : }
4700 :
4701 0 : static PyObject *py_lsa_SidArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4702 : {
4703 0 : struct lsa_SidArray *object = pytalloc_get_ptr(py_obj);
4704 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4705 0 : Py_ssize_t blob_length = 0;
4706 0 : enum ndr_err_code err;
4707 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4708 0 : PyObject *allow_remaining_obj = NULL;
4709 0 : bool allow_remaining = false;
4710 :
4711 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4712 : discard_const_p(char *, kwnames),
4713 : &blob.data, &blob_length,
4714 : &allow_remaining_obj)) {
4715 0 : return NULL;
4716 : }
4717 0 : blob.length = blob_length;
4718 :
4719 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4720 0 : allow_remaining = true;
4721 : }
4722 :
4723 0 : if (allow_remaining) {
4724 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4725 : } else {
4726 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_SidArray);
4727 : }
4728 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4729 0 : PyErr_SetNdrError(err);
4730 0 : return NULL;
4731 : }
4732 :
4733 0 : Py_RETURN_NONE;
4734 : }
4735 :
4736 0 : static PyObject *py_lsa_SidArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4737 : {
4738 0 : struct lsa_SidArray *object = pytalloc_get_ptr(py_obj);
4739 0 : PyObject *ret;
4740 0 : char *retstr;
4741 :
4742 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_SidArray, "lsa_SidArray", object);
4743 0 : ret = PyUnicode_FromString(retstr);
4744 0 : talloc_free(retstr);
4745 :
4746 0 : return ret;
4747 : }
4748 :
4749 : static PyMethodDef py_lsa_SidArray_methods[] = {
4750 : { "__ndr_pack__", (PyCFunction)py_lsa_SidArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4751 : { "__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" },
4752 : { "__ndr_print__", (PyCFunction)py_lsa_SidArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4753 : { NULL, NULL, 0, NULL }
4754 : };
4755 :
4756 :
4757 : static PyTypeObject lsa_SidArray_Type = {
4758 : PyVarObject_HEAD_INIT(NULL, 0)
4759 : .tp_name = "lsa.SidArray",
4760 : .tp_getset = py_lsa_SidArray_getsetters,
4761 : .tp_methods = py_lsa_SidArray_methods,
4762 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4763 : .tp_new = py_lsa_SidArray_new,
4764 : };
4765 :
4766 :
4767 0 : static PyObject *py_lsa_DomainList_get_count(PyObject *obj, void *closure)
4768 : {
4769 0 : struct lsa_DomainList *object = pytalloc_get_ptr(obj);
4770 0 : PyObject *py_count;
4771 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
4772 0 : return py_count;
4773 : }
4774 :
4775 0 : static int py_lsa_DomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
4776 : {
4777 0 : struct lsa_DomainList *object = pytalloc_get_ptr(py_obj);
4778 0 : if (value == NULL) {
4779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
4780 0 : return -1;
4781 : }
4782 : {
4783 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
4784 0 : if (PyLong_Check(value)) {
4785 0 : unsigned long long test_var;
4786 0 : test_var = PyLong_AsUnsignedLongLong(value);
4787 0 : if (PyErr_Occurred() != NULL) {
4788 0 : return -1;
4789 : }
4790 0 : if (test_var > uint_max) {
4791 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4792 : PyLong_Type.tp_name, uint_max, test_var);
4793 0 : return -1;
4794 : }
4795 0 : object->count = test_var;
4796 : } else {
4797 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4798 : PyLong_Type.tp_name);
4799 0 : return -1;
4800 : }
4801 : }
4802 0 : return 0;
4803 : }
4804 :
4805 0 : static PyObject *py_lsa_DomainList_get_domains(PyObject *obj, void *closure)
4806 : {
4807 0 : struct lsa_DomainList *object = pytalloc_get_ptr(obj);
4808 0 : PyObject *py_domains;
4809 0 : if (object->domains == NULL) {
4810 0 : Py_RETURN_NONE;
4811 : }
4812 0 : if (object->domains == NULL) {
4813 0 : py_domains = Py_None;
4814 0 : Py_INCREF(py_domains);
4815 : } else {
4816 0 : py_domains = PyList_New(object->count);
4817 0 : if (py_domains == NULL) {
4818 0 : return NULL;
4819 : }
4820 : {
4821 : int domains_cntr_1;
4822 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
4823 0 : PyObject *py_domains_1;
4824 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &(object->domains)[domains_cntr_1]);
4825 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
4826 : }
4827 : }
4828 : }
4829 0 : return py_domains;
4830 : }
4831 :
4832 0 : static int py_lsa_DomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
4833 : {
4834 0 : struct lsa_DomainList *object = pytalloc_get_ptr(py_obj);
4835 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
4836 0 : if (value == NULL) {
4837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domains");
4838 0 : return -1;
4839 : }
4840 0 : if (value == Py_None) {
4841 0 : object->domains = NULL;
4842 : } else {
4843 0 : object->domains = NULL;
4844 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4845 : {
4846 0 : int domains_cntr_1;
4847 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
4848 0 : if (!object->domains) { return -1; }
4849 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
4850 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
4851 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
4852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->domains)[domains_cntr_1]");
4853 0 : return -1;
4854 : }
4855 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
4856 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
4857 0 : PyErr_NoMemory();
4858 0 : return -1;
4859 : }
4860 0 : (object->domains)[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
4861 : }
4862 : }
4863 : }
4864 0 : return 0;
4865 : }
4866 :
4867 : static PyGetSetDef py_lsa_DomainList_getsetters[] = {
4868 : {
4869 : .name = discard_const_p(char, "count"),
4870 : .get = py_lsa_DomainList_get_count,
4871 : .set = py_lsa_DomainList_set_count,
4872 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4873 : },
4874 : {
4875 : .name = discard_const_p(char, "domains"),
4876 : .get = py_lsa_DomainList_get_domains,
4877 : .set = py_lsa_DomainList_set_domains,
4878 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
4879 : },
4880 : { .name = NULL }
4881 : };
4882 :
4883 0 : static PyObject *py_lsa_DomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4884 : {
4885 0 : return pytalloc_new(struct lsa_DomainList, type);
4886 : }
4887 :
4888 :
4889 : static PyTypeObject lsa_DomainList_Type = {
4890 : PyVarObject_HEAD_INIT(NULL, 0)
4891 : .tp_name = "lsa.DomainList",
4892 : .tp_getset = py_lsa_DomainList_getsetters,
4893 : .tp_methods = NULL,
4894 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4895 : .tp_new = py_lsa_DomainList_new,
4896 : };
4897 :
4898 :
4899 0 : static PyObject *py_lsa_TranslatedSid_get_sid_type(PyObject *obj, void *closure)
4900 : {
4901 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(obj);
4902 0 : PyObject *py_sid_type;
4903 0 : py_sid_type = PyLong_FromLong((uint16_t)(object->sid_type));
4904 0 : return py_sid_type;
4905 : }
4906 :
4907 0 : static int py_lsa_TranslatedSid_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
4908 : {
4909 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(py_obj);
4910 0 : if (value == NULL) {
4911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_type");
4912 0 : return -1;
4913 : }
4914 : {
4915 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
4916 0 : if (PyLong_Check(value)) {
4917 0 : unsigned long long test_var;
4918 0 : test_var = PyLong_AsUnsignedLongLong(value);
4919 0 : if (PyErr_Occurred() != NULL) {
4920 0 : return -1;
4921 : }
4922 0 : if (test_var > uint_max) {
4923 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4924 : PyLong_Type.tp_name, uint_max, test_var);
4925 0 : return -1;
4926 : }
4927 0 : object->sid_type = test_var;
4928 : } else {
4929 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4930 : PyLong_Type.tp_name);
4931 0 : return -1;
4932 : }
4933 : }
4934 0 : return 0;
4935 : }
4936 :
4937 0 : static PyObject *py_lsa_TranslatedSid_get_rid(PyObject *obj, void *closure)
4938 : {
4939 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(obj);
4940 0 : PyObject *py_rid;
4941 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)(object->rid));
4942 0 : return py_rid;
4943 : }
4944 :
4945 0 : static int py_lsa_TranslatedSid_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4946 : {
4947 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(py_obj);
4948 0 : if (value == NULL) {
4949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rid");
4950 0 : return -1;
4951 : }
4952 : {
4953 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
4954 0 : if (PyLong_Check(value)) {
4955 0 : unsigned long long test_var;
4956 0 : test_var = PyLong_AsUnsignedLongLong(value);
4957 0 : if (PyErr_Occurred() != NULL) {
4958 0 : return -1;
4959 : }
4960 0 : if (test_var > uint_max) {
4961 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4962 : PyLong_Type.tp_name, uint_max, test_var);
4963 0 : return -1;
4964 : }
4965 0 : object->rid = test_var;
4966 : } else {
4967 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4968 : PyLong_Type.tp_name);
4969 0 : return -1;
4970 : }
4971 : }
4972 0 : return 0;
4973 : }
4974 :
4975 0 : static PyObject *py_lsa_TranslatedSid_get_sid_index(PyObject *obj, void *closure)
4976 : {
4977 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(obj);
4978 0 : PyObject *py_sid_index;
4979 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_index));
4980 0 : return py_sid_index;
4981 : }
4982 :
4983 0 : static int py_lsa_TranslatedSid_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
4984 : {
4985 0 : struct lsa_TranslatedSid *object = pytalloc_get_ptr(py_obj);
4986 0 : if (value == NULL) {
4987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_index");
4988 0 : return -1;
4989 : }
4990 : {
4991 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
4992 0 : if (PyLong_Check(value)) {
4993 0 : unsigned long long test_var;
4994 0 : test_var = PyLong_AsUnsignedLongLong(value);
4995 0 : if (PyErr_Occurred() != NULL) {
4996 0 : return -1;
4997 : }
4998 0 : if (test_var > uint_max) {
4999 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5000 : PyLong_Type.tp_name, uint_max, test_var);
5001 0 : return -1;
5002 : }
5003 0 : object->sid_index = test_var;
5004 : } else {
5005 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5006 : PyLong_Type.tp_name);
5007 0 : return -1;
5008 : }
5009 : }
5010 0 : return 0;
5011 : }
5012 :
5013 : static PyGetSetDef py_lsa_TranslatedSid_getsetters[] = {
5014 : {
5015 : .name = discard_const_p(char, "sid_type"),
5016 : .get = py_lsa_TranslatedSid_get_sid_type,
5017 : .set = py_lsa_TranslatedSid_set_sid_type,
5018 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5019 : },
5020 : {
5021 : .name = discard_const_p(char, "rid"),
5022 : .get = py_lsa_TranslatedSid_get_rid,
5023 : .set = py_lsa_TranslatedSid_set_rid,
5024 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5025 : },
5026 : {
5027 : .name = discard_const_p(char, "sid_index"),
5028 : .get = py_lsa_TranslatedSid_get_sid_index,
5029 : .set = py_lsa_TranslatedSid_set_sid_index,
5030 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5031 : },
5032 : { .name = NULL }
5033 : };
5034 :
5035 0 : static PyObject *py_lsa_TranslatedSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5036 : {
5037 0 : return pytalloc_new(struct lsa_TranslatedSid, type);
5038 : }
5039 :
5040 :
5041 : static PyTypeObject lsa_TranslatedSid_Type = {
5042 : PyVarObject_HEAD_INIT(NULL, 0)
5043 : .tp_name = "lsa.TranslatedSid",
5044 : .tp_getset = py_lsa_TranslatedSid_getsetters,
5045 : .tp_methods = NULL,
5046 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5047 : .tp_new = py_lsa_TranslatedSid_new,
5048 : };
5049 :
5050 :
5051 0 : static PyObject *py_lsa_TransSidArray_get_count(PyObject *obj, void *closure)
5052 : {
5053 0 : struct lsa_TransSidArray *object = pytalloc_get_ptr(obj);
5054 0 : PyObject *py_count;
5055 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
5056 0 : return py_count;
5057 : }
5058 :
5059 0 : static int py_lsa_TransSidArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5060 : {
5061 0 : struct lsa_TransSidArray *object = pytalloc_get_ptr(py_obj);
5062 0 : if (value == NULL) {
5063 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
5064 0 : return -1;
5065 : }
5066 : {
5067 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5068 0 : if (PyLong_Check(value)) {
5069 0 : unsigned long long test_var;
5070 0 : test_var = PyLong_AsUnsignedLongLong(value);
5071 0 : if (PyErr_Occurred() != NULL) {
5072 0 : return -1;
5073 : }
5074 0 : if (test_var > uint_max) {
5075 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5076 : PyLong_Type.tp_name, uint_max, test_var);
5077 0 : return -1;
5078 : }
5079 0 : object->count = test_var;
5080 : } else {
5081 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5082 : PyLong_Type.tp_name);
5083 0 : return -1;
5084 : }
5085 : }
5086 0 : return 0;
5087 : }
5088 :
5089 0 : static PyObject *py_lsa_TransSidArray_get_sids(PyObject *obj, void *closure)
5090 : {
5091 0 : struct lsa_TransSidArray *object = pytalloc_get_ptr(obj);
5092 0 : PyObject *py_sids;
5093 0 : if (object->sids == NULL) {
5094 0 : Py_RETURN_NONE;
5095 : }
5096 0 : if (object->sids == NULL) {
5097 0 : py_sids = Py_None;
5098 0 : Py_INCREF(py_sids);
5099 : } else {
5100 0 : py_sids = PyList_New(object->count);
5101 0 : if (py_sids == NULL) {
5102 0 : return NULL;
5103 : }
5104 : {
5105 : int sids_cntr_1;
5106 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
5107 0 : PyObject *py_sids_1;
5108 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid_Type, object->sids, &(object->sids)[sids_cntr_1]);
5109 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
5110 : }
5111 : }
5112 : }
5113 0 : return py_sids;
5114 : }
5115 :
5116 0 : static int py_lsa_TransSidArray_set_sids(PyObject *py_obj, PyObject *value, void *closure)
5117 : {
5118 0 : struct lsa_TransSidArray *object = pytalloc_get_ptr(py_obj);
5119 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
5120 0 : if (value == NULL) {
5121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
5122 0 : return -1;
5123 : }
5124 0 : if (value == Py_None) {
5125 0 : object->sids = NULL;
5126 : } else {
5127 0 : object->sids = NULL;
5128 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5129 : {
5130 0 : int sids_cntr_1;
5131 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
5132 0 : if (!object->sids) { return -1; }
5133 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
5134 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
5135 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
5136 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_1]");
5137 0 : return -1;
5138 : }
5139 0 : PY_CHECK_TYPE(&lsa_TranslatedSid_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
5140 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
5141 0 : PyErr_NoMemory();
5142 0 : return -1;
5143 : }
5144 0 : (object->sids)[sids_cntr_1] = *(struct lsa_TranslatedSid *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
5145 : }
5146 : }
5147 : }
5148 0 : return 0;
5149 : }
5150 :
5151 : static PyGetSetDef py_lsa_TransSidArray_getsetters[] = {
5152 : {
5153 : .name = discard_const_p(char, "count"),
5154 : .get = py_lsa_TransSidArray_get_count,
5155 : .set = py_lsa_TransSidArray_set_count,
5156 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5157 : },
5158 : {
5159 : .name = discard_const_p(char, "sids"),
5160 : .get = py_lsa_TransSidArray_get_sids,
5161 : .set = py_lsa_TransSidArray_set_sids,
5162 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid")
5163 : },
5164 : { .name = NULL }
5165 : };
5166 :
5167 1 : static PyObject *py_lsa_TransSidArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5168 : {
5169 1 : return pytalloc_new(struct lsa_TransSidArray, type);
5170 : }
5171 :
5172 :
5173 : static PyTypeObject lsa_TransSidArray_Type = {
5174 : PyVarObject_HEAD_INIT(NULL, 0)
5175 : .tp_name = "lsa.TransSidArray",
5176 : .tp_getset = py_lsa_TransSidArray_getsetters,
5177 : .tp_methods = NULL,
5178 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5179 : .tp_new = py_lsa_TransSidArray_new,
5180 : };
5181 :
5182 :
5183 0 : static PyObject *py_lsa_RefDomainList_get_count(PyObject *obj, void *closure)
5184 : {
5185 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(obj);
5186 0 : PyObject *py_count;
5187 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
5188 0 : return py_count;
5189 : }
5190 :
5191 0 : static int py_lsa_RefDomainList_set_count(PyObject *py_obj, PyObject *value, void *closure)
5192 : {
5193 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5194 0 : if (value == NULL) {
5195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
5196 0 : return -1;
5197 : }
5198 : {
5199 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5200 0 : if (PyLong_Check(value)) {
5201 0 : unsigned long long test_var;
5202 0 : test_var = PyLong_AsUnsignedLongLong(value);
5203 0 : if (PyErr_Occurred() != NULL) {
5204 0 : return -1;
5205 : }
5206 0 : if (test_var > uint_max) {
5207 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5208 : PyLong_Type.tp_name, uint_max, test_var);
5209 0 : return -1;
5210 : }
5211 0 : object->count = test_var;
5212 : } else {
5213 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5214 : PyLong_Type.tp_name);
5215 0 : return -1;
5216 : }
5217 : }
5218 0 : return 0;
5219 : }
5220 :
5221 0 : static PyObject *py_lsa_RefDomainList_get_domains(PyObject *obj, void *closure)
5222 : {
5223 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(obj);
5224 0 : PyObject *py_domains;
5225 0 : if (object->domains == NULL) {
5226 0 : Py_RETURN_NONE;
5227 : }
5228 0 : if (object->domains == NULL) {
5229 0 : py_domains = Py_None;
5230 0 : Py_INCREF(py_domains);
5231 : } else {
5232 0 : py_domains = PyList_New(object->count);
5233 0 : if (py_domains == NULL) {
5234 0 : return NULL;
5235 : }
5236 : {
5237 : int domains_cntr_1;
5238 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
5239 0 : PyObject *py_domains_1;
5240 0 : py_domains_1 = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->domains, &(object->domains)[domains_cntr_1]);
5241 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
5242 : }
5243 : }
5244 : }
5245 0 : return py_domains;
5246 : }
5247 :
5248 0 : static int py_lsa_RefDomainList_set_domains(PyObject *py_obj, PyObject *value, void *closure)
5249 : {
5250 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5251 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
5252 0 : if (value == NULL) {
5253 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domains");
5254 0 : return -1;
5255 : }
5256 0 : if (value == Py_None) {
5257 0 : object->domains = NULL;
5258 : } else {
5259 0 : object->domains = NULL;
5260 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5261 : {
5262 0 : int domains_cntr_1;
5263 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
5264 0 : if (!object->domains) { return -1; }
5265 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
5266 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
5267 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
5268 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->domains)[domains_cntr_1]");
5269 0 : return -1;
5270 : }
5271 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
5272 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
5273 0 : PyErr_NoMemory();
5274 0 : return -1;
5275 : }
5276 0 : (object->domains)[domains_cntr_1] = *(struct lsa_DomainInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
5277 : }
5278 : }
5279 : }
5280 0 : return 0;
5281 : }
5282 :
5283 0 : static PyObject *py_lsa_RefDomainList_get_max_size(PyObject *obj, void *closure)
5284 : {
5285 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(obj);
5286 0 : PyObject *py_max_size;
5287 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)(object->max_size));
5288 0 : return py_max_size;
5289 : }
5290 :
5291 0 : static int py_lsa_RefDomainList_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
5292 : {
5293 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5294 0 : if (value == NULL) {
5295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_size");
5296 0 : return -1;
5297 : }
5298 : {
5299 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_size));
5300 0 : if (PyLong_Check(value)) {
5301 0 : unsigned long long test_var;
5302 0 : test_var = PyLong_AsUnsignedLongLong(value);
5303 0 : if (PyErr_Occurred() != NULL) {
5304 0 : return -1;
5305 : }
5306 0 : if (test_var > uint_max) {
5307 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5308 : PyLong_Type.tp_name, uint_max, test_var);
5309 0 : return -1;
5310 : }
5311 0 : object->max_size = test_var;
5312 : } else {
5313 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5314 : PyLong_Type.tp_name);
5315 0 : return -1;
5316 : }
5317 : }
5318 0 : return 0;
5319 : }
5320 :
5321 : static PyGetSetDef py_lsa_RefDomainList_getsetters[] = {
5322 : {
5323 : .name = discard_const_p(char, "count"),
5324 : .get = py_lsa_RefDomainList_get_count,
5325 : .set = py_lsa_RefDomainList_set_count,
5326 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5327 : },
5328 : {
5329 : .name = discard_const_p(char, "domains"),
5330 : .get = py_lsa_RefDomainList_get_domains,
5331 : .set = py_lsa_RefDomainList_set_domains,
5332 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
5333 : },
5334 : {
5335 : .name = discard_const_p(char, "max_size"),
5336 : .get = py_lsa_RefDomainList_get_max_size,
5337 : .set = py_lsa_RefDomainList_set_max_size,
5338 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5339 : },
5340 : { .name = NULL }
5341 : };
5342 :
5343 0 : static PyObject *py_lsa_RefDomainList_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5344 : {
5345 0 : return pytalloc_new(struct lsa_RefDomainList, type);
5346 : }
5347 :
5348 0 : static PyObject *py_lsa_RefDomainList_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5349 : {
5350 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5351 0 : PyObject *ret = NULL;
5352 0 : DATA_BLOB blob;
5353 0 : enum ndr_err_code err;
5354 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5355 0 : if (tmp_ctx == NULL) {
5356 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5357 0 : return NULL;
5358 : }
5359 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_RefDomainList);
5360 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5361 0 : TALLOC_FREE(tmp_ctx);
5362 0 : PyErr_SetNdrError(err);
5363 0 : return NULL;
5364 : }
5365 :
5366 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5367 0 : TALLOC_FREE(tmp_ctx);
5368 0 : return ret;
5369 : }
5370 :
5371 0 : static PyObject *py_lsa_RefDomainList_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5372 : {
5373 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5374 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5375 0 : Py_ssize_t blob_length = 0;
5376 0 : enum ndr_err_code err;
5377 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5378 0 : PyObject *allow_remaining_obj = NULL;
5379 0 : bool allow_remaining = false;
5380 :
5381 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5382 : discard_const_p(char *, kwnames),
5383 : &blob.data, &blob_length,
5384 : &allow_remaining_obj)) {
5385 0 : return NULL;
5386 : }
5387 0 : blob.length = blob_length;
5388 :
5389 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5390 0 : allow_remaining = true;
5391 : }
5392 :
5393 0 : if (allow_remaining) {
5394 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5395 : } else {
5396 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_RefDomainList);
5397 : }
5398 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5399 0 : PyErr_SetNdrError(err);
5400 0 : return NULL;
5401 : }
5402 :
5403 0 : Py_RETURN_NONE;
5404 : }
5405 :
5406 0 : static PyObject *py_lsa_RefDomainList_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5407 : {
5408 0 : struct lsa_RefDomainList *object = pytalloc_get_ptr(py_obj);
5409 0 : PyObject *ret;
5410 0 : char *retstr;
5411 :
5412 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_RefDomainList, "lsa_RefDomainList", object);
5413 0 : ret = PyUnicode_FromString(retstr);
5414 0 : talloc_free(retstr);
5415 :
5416 0 : return ret;
5417 : }
5418 :
5419 : static PyMethodDef py_lsa_RefDomainList_methods[] = {
5420 : { "__ndr_pack__", (PyCFunction)py_lsa_RefDomainList_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5421 : { "__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" },
5422 : { "__ndr_print__", (PyCFunction)py_lsa_RefDomainList_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5423 : { NULL, NULL, 0, NULL }
5424 : };
5425 :
5426 :
5427 : static PyTypeObject lsa_RefDomainList_Type = {
5428 : PyVarObject_HEAD_INIT(NULL, 0)
5429 : .tp_name = "lsa.RefDomainList",
5430 : .tp_getset = py_lsa_RefDomainList_getsetters,
5431 : .tp_methods = py_lsa_RefDomainList_methods,
5432 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5433 : .tp_new = py_lsa_RefDomainList_new,
5434 : };
5435 :
5436 :
5437 0 : static PyObject *py_lsa_TranslatedName_get_sid_type(PyObject *obj, void *closure)
5438 : {
5439 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(obj);
5440 0 : PyObject *py_sid_type;
5441 0 : py_sid_type = PyLong_FromLong((uint16_t)(object->sid_type));
5442 0 : return py_sid_type;
5443 : }
5444 :
5445 0 : static int py_lsa_TranslatedName_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
5446 : {
5447 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(py_obj);
5448 0 : if (value == NULL) {
5449 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_type");
5450 0 : return -1;
5451 : }
5452 : {
5453 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
5454 0 : if (PyLong_Check(value)) {
5455 0 : unsigned long long test_var;
5456 0 : test_var = PyLong_AsUnsignedLongLong(value);
5457 0 : if (PyErr_Occurred() != NULL) {
5458 0 : return -1;
5459 : }
5460 0 : if (test_var > uint_max) {
5461 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5462 : PyLong_Type.tp_name, uint_max, test_var);
5463 0 : return -1;
5464 : }
5465 0 : object->sid_type = test_var;
5466 : } else {
5467 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5468 : PyLong_Type.tp_name);
5469 0 : return -1;
5470 : }
5471 : }
5472 0 : return 0;
5473 : }
5474 :
5475 0 : static PyObject *py_lsa_TranslatedName_get_name(PyObject *obj, void *closure)
5476 : {
5477 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(obj);
5478 0 : PyObject *py_name;
5479 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
5480 0 : return py_name;
5481 : }
5482 :
5483 0 : static int py_lsa_TranslatedName_set_name(PyObject *py_obj, PyObject *value, void *closure)
5484 : {
5485 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(py_obj);
5486 0 : if (value == NULL) {
5487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
5488 0 : return -1;
5489 : }
5490 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
5491 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5492 0 : PyErr_NoMemory();
5493 0 : return -1;
5494 : }
5495 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
5496 0 : return 0;
5497 : }
5498 :
5499 0 : static PyObject *py_lsa_TranslatedName_get_sid_index(PyObject *obj, void *closure)
5500 : {
5501 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(obj);
5502 0 : PyObject *py_sid_index;
5503 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_index));
5504 0 : return py_sid_index;
5505 : }
5506 :
5507 0 : static int py_lsa_TranslatedName_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
5508 : {
5509 0 : struct lsa_TranslatedName *object = pytalloc_get_ptr(py_obj);
5510 0 : if (value == NULL) {
5511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_index");
5512 0 : return -1;
5513 : }
5514 : {
5515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
5516 0 : if (PyLong_Check(value)) {
5517 0 : unsigned long long test_var;
5518 0 : test_var = PyLong_AsUnsignedLongLong(value);
5519 0 : if (PyErr_Occurred() != NULL) {
5520 0 : return -1;
5521 : }
5522 0 : if (test_var > uint_max) {
5523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5524 : PyLong_Type.tp_name, uint_max, test_var);
5525 0 : return -1;
5526 : }
5527 0 : object->sid_index = test_var;
5528 : } else {
5529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5530 : PyLong_Type.tp_name);
5531 0 : return -1;
5532 : }
5533 : }
5534 0 : return 0;
5535 : }
5536 :
5537 : static PyGetSetDef py_lsa_TranslatedName_getsetters[] = {
5538 : {
5539 : .name = discard_const_p(char, "sid_type"),
5540 : .get = py_lsa_TranslatedName_get_sid_type,
5541 : .set = py_lsa_TranslatedName_set_sid_type,
5542 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
5543 : },
5544 : {
5545 : .name = discard_const_p(char, "name"),
5546 : .get = py_lsa_TranslatedName_get_name,
5547 : .set = py_lsa_TranslatedName_set_name,
5548 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5549 : },
5550 : {
5551 : .name = discard_const_p(char, "sid_index"),
5552 : .get = py_lsa_TranslatedName_get_sid_index,
5553 : .set = py_lsa_TranslatedName_set_sid_index,
5554 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5555 : },
5556 : { .name = NULL }
5557 : };
5558 :
5559 0 : static PyObject *py_lsa_TranslatedName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5560 : {
5561 0 : return pytalloc_new(struct lsa_TranslatedName, type);
5562 : }
5563 :
5564 :
5565 : static PyTypeObject lsa_TranslatedName_Type = {
5566 : PyVarObject_HEAD_INIT(NULL, 0)
5567 : .tp_name = "lsa.TranslatedName",
5568 : .tp_getset = py_lsa_TranslatedName_getsetters,
5569 : .tp_methods = NULL,
5570 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5571 : .tp_new = py_lsa_TranslatedName_new,
5572 : };
5573 :
5574 :
5575 0 : static PyObject *py_lsa_TransNameArray_get_count(PyObject *obj, void *closure)
5576 : {
5577 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(obj);
5578 0 : PyObject *py_count;
5579 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
5580 0 : return py_count;
5581 : }
5582 :
5583 0 : static int py_lsa_TransNameArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5584 : {
5585 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(py_obj);
5586 0 : if (value == NULL) {
5587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
5588 0 : return -1;
5589 : }
5590 : {
5591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5592 0 : if (PyLong_Check(value)) {
5593 0 : unsigned long long test_var;
5594 0 : test_var = PyLong_AsUnsignedLongLong(value);
5595 0 : if (PyErr_Occurred() != NULL) {
5596 0 : return -1;
5597 : }
5598 0 : if (test_var > uint_max) {
5599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5600 : PyLong_Type.tp_name, uint_max, test_var);
5601 0 : return -1;
5602 : }
5603 0 : object->count = test_var;
5604 : } else {
5605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5606 : PyLong_Type.tp_name);
5607 0 : return -1;
5608 : }
5609 : }
5610 0 : return 0;
5611 : }
5612 :
5613 0 : static PyObject *py_lsa_TransNameArray_get_names(PyObject *obj, void *closure)
5614 : {
5615 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(obj);
5616 0 : PyObject *py_names;
5617 0 : if (object->names == NULL) {
5618 0 : Py_RETURN_NONE;
5619 : }
5620 0 : if (object->names == NULL) {
5621 0 : py_names = Py_None;
5622 0 : Py_INCREF(py_names);
5623 : } else {
5624 0 : py_names = PyList_New(object->count);
5625 0 : if (py_names == NULL) {
5626 0 : return NULL;
5627 : }
5628 : {
5629 : int names_cntr_1;
5630 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
5631 0 : PyObject *py_names_1;
5632 0 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName_Type, object->names, &(object->names)[names_cntr_1]);
5633 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
5634 : }
5635 : }
5636 : }
5637 0 : return py_names;
5638 : }
5639 :
5640 0 : static int py_lsa_TransNameArray_set_names(PyObject *py_obj, PyObject *value, void *closure)
5641 : {
5642 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(py_obj);
5643 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
5644 0 : if (value == NULL) {
5645 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
5646 0 : return -1;
5647 : }
5648 0 : if (value == Py_None) {
5649 0 : object->names = NULL;
5650 : } else {
5651 0 : object->names = NULL;
5652 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5653 : {
5654 0 : int names_cntr_1;
5655 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
5656 0 : if (!object->names) { return -1; }
5657 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
5658 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
5659 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
5660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_1]");
5661 0 : return -1;
5662 : }
5663 0 : PY_CHECK_TYPE(&lsa_TranslatedName_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
5664 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
5665 0 : PyErr_NoMemory();
5666 0 : return -1;
5667 : }
5668 0 : (object->names)[names_cntr_1] = *(struct lsa_TranslatedName *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
5669 : }
5670 : }
5671 : }
5672 0 : return 0;
5673 : }
5674 :
5675 : static PyGetSetDef py_lsa_TransNameArray_getsetters[] = {
5676 : {
5677 : .name = discard_const_p(char, "count"),
5678 : .get = py_lsa_TransNameArray_get_count,
5679 : .set = py_lsa_TransNameArray_set_count,
5680 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5681 : },
5682 : {
5683 : .name = discard_const_p(char, "names"),
5684 : .get = py_lsa_TransNameArray_get_names,
5685 : .set = py_lsa_TransNameArray_set_names,
5686 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName")
5687 : },
5688 : { .name = NULL }
5689 : };
5690 :
5691 1 : static PyObject *py_lsa_TransNameArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5692 : {
5693 1 : return pytalloc_new(struct lsa_TransNameArray, type);
5694 : }
5695 :
5696 0 : static PyObject *py_lsa_TransNameArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5697 : {
5698 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(py_obj);
5699 0 : PyObject *ret = NULL;
5700 0 : DATA_BLOB blob;
5701 0 : enum ndr_err_code err;
5702 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
5703 0 : if (tmp_ctx == NULL) {
5704 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
5705 0 : return NULL;
5706 : }
5707 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TransNameArray);
5708 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5709 0 : TALLOC_FREE(tmp_ctx);
5710 0 : PyErr_SetNdrError(err);
5711 0 : return NULL;
5712 : }
5713 :
5714 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
5715 0 : TALLOC_FREE(tmp_ctx);
5716 0 : return ret;
5717 : }
5718 :
5719 0 : static PyObject *py_lsa_TransNameArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5720 : {
5721 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(py_obj);
5722 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
5723 0 : Py_ssize_t blob_length = 0;
5724 0 : enum ndr_err_code err;
5725 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5726 0 : PyObject *allow_remaining_obj = NULL;
5727 0 : bool allow_remaining = false;
5728 :
5729 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
5730 : discard_const_p(char *, kwnames),
5731 : &blob.data, &blob_length,
5732 : &allow_remaining_obj)) {
5733 0 : return NULL;
5734 : }
5735 0 : blob.length = blob_length;
5736 :
5737 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5738 0 : allow_remaining = true;
5739 : }
5740 :
5741 0 : if (allow_remaining) {
5742 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5743 : } else {
5744 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TransNameArray);
5745 : }
5746 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
5747 0 : PyErr_SetNdrError(err);
5748 0 : return NULL;
5749 : }
5750 :
5751 0 : Py_RETURN_NONE;
5752 : }
5753 :
5754 0 : static PyObject *py_lsa_TransNameArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
5755 : {
5756 0 : struct lsa_TransNameArray *object = pytalloc_get_ptr(py_obj);
5757 0 : PyObject *ret;
5758 0 : char *retstr;
5759 :
5760 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TransNameArray, "lsa_TransNameArray", object);
5761 0 : ret = PyUnicode_FromString(retstr);
5762 0 : talloc_free(retstr);
5763 :
5764 0 : return ret;
5765 : }
5766 :
5767 : static PyMethodDef py_lsa_TransNameArray_methods[] = {
5768 : { "__ndr_pack__", (PyCFunction)py_lsa_TransNameArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5769 : { "__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" },
5770 : { "__ndr_print__", (PyCFunction)py_lsa_TransNameArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
5771 : { NULL, NULL, 0, NULL }
5772 : };
5773 :
5774 :
5775 : static PyTypeObject lsa_TransNameArray_Type = {
5776 : PyVarObject_HEAD_INIT(NULL, 0)
5777 : .tp_name = "lsa.TransNameArray",
5778 : .tp_getset = py_lsa_TransNameArray_getsetters,
5779 : .tp_methods = py_lsa_TransNameArray_methods,
5780 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5781 : .tp_new = py_lsa_TransNameArray_new,
5782 : };
5783 :
5784 :
5785 0 : static PyObject *py_lsa_LUIDAttribute_get_luid(PyObject *obj, void *closure)
5786 : {
5787 0 : struct lsa_LUIDAttribute *object = pytalloc_get_ptr(obj);
5788 0 : PyObject *py_luid;
5789 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, pytalloc_get_mem_ctx(obj), &object->luid);
5790 0 : return py_luid;
5791 : }
5792 :
5793 0 : static int py_lsa_LUIDAttribute_set_luid(PyObject *py_obj, PyObject *value, void *closure)
5794 : {
5795 0 : struct lsa_LUIDAttribute *object = pytalloc_get_ptr(py_obj);
5796 0 : if (value == NULL) {
5797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->luid");
5798 0 : return -1;
5799 : }
5800 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
5801 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5802 0 : PyErr_NoMemory();
5803 0 : return -1;
5804 : }
5805 0 : object->luid = *(struct lsa_LUID *)pytalloc_get_ptr(value);
5806 0 : return 0;
5807 : }
5808 :
5809 0 : static PyObject *py_lsa_LUIDAttribute_get_attribute(PyObject *obj, void *closure)
5810 : {
5811 0 : struct lsa_LUIDAttribute *object = pytalloc_get_ptr(obj);
5812 0 : PyObject *py_attribute;
5813 0 : py_attribute = PyLong_FromUnsignedLongLong((uint32_t)(object->attribute));
5814 0 : return py_attribute;
5815 : }
5816 :
5817 0 : static int py_lsa_LUIDAttribute_set_attribute(PyObject *py_obj, PyObject *value, void *closure)
5818 : {
5819 0 : struct lsa_LUIDAttribute *object = pytalloc_get_ptr(py_obj);
5820 0 : if (value == NULL) {
5821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attribute");
5822 0 : return -1;
5823 : }
5824 : {
5825 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attribute));
5826 0 : if (PyLong_Check(value)) {
5827 0 : unsigned long long test_var;
5828 0 : test_var = PyLong_AsUnsignedLongLong(value);
5829 0 : if (PyErr_Occurred() != NULL) {
5830 0 : return -1;
5831 : }
5832 0 : if (test_var > uint_max) {
5833 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5834 : PyLong_Type.tp_name, uint_max, test_var);
5835 0 : return -1;
5836 : }
5837 0 : object->attribute = test_var;
5838 : } else {
5839 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5840 : PyLong_Type.tp_name);
5841 0 : return -1;
5842 : }
5843 : }
5844 0 : return 0;
5845 : }
5846 :
5847 : static PyGetSetDef py_lsa_LUIDAttribute_getsetters[] = {
5848 : {
5849 : .name = discard_const_p(char, "luid"),
5850 : .get = py_lsa_LUIDAttribute_get_luid,
5851 : .set = py_lsa_LUIDAttribute_set_luid,
5852 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
5853 : },
5854 : {
5855 : .name = discard_const_p(char, "attribute"),
5856 : .get = py_lsa_LUIDAttribute_get_attribute,
5857 : .set = py_lsa_LUIDAttribute_set_attribute,
5858 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5859 : },
5860 : { .name = NULL }
5861 : };
5862 :
5863 0 : static PyObject *py_lsa_LUIDAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5864 : {
5865 0 : return pytalloc_new(struct lsa_LUIDAttribute, type);
5866 : }
5867 :
5868 :
5869 : static PyTypeObject lsa_LUIDAttribute_Type = {
5870 : PyVarObject_HEAD_INIT(NULL, 0)
5871 : .tp_name = "lsa.LUIDAttribute",
5872 : .tp_getset = py_lsa_LUIDAttribute_getsetters,
5873 : .tp_methods = NULL,
5874 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5875 : .tp_new = py_lsa_LUIDAttribute_new,
5876 : };
5877 :
5878 :
5879 0 : static PyObject *py_lsa_PrivilegeSet_get_count(PyObject *obj, void *closure)
5880 : {
5881 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(obj);
5882 0 : PyObject *py_count;
5883 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
5884 0 : return py_count;
5885 : }
5886 :
5887 0 : static int py_lsa_PrivilegeSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
5888 : {
5889 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(py_obj);
5890 0 : if (value == NULL) {
5891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
5892 0 : return -1;
5893 : }
5894 : {
5895 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
5896 0 : if (PyLong_Check(value)) {
5897 0 : unsigned long long test_var;
5898 0 : test_var = PyLong_AsUnsignedLongLong(value);
5899 0 : if (PyErr_Occurred() != NULL) {
5900 0 : return -1;
5901 : }
5902 0 : if (test_var > uint_max) {
5903 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5904 : PyLong_Type.tp_name, uint_max, test_var);
5905 0 : return -1;
5906 : }
5907 0 : object->count = test_var;
5908 : } else {
5909 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5910 : PyLong_Type.tp_name);
5911 0 : return -1;
5912 : }
5913 : }
5914 0 : return 0;
5915 : }
5916 :
5917 0 : static PyObject *py_lsa_PrivilegeSet_get_unknown(PyObject *obj, void *closure)
5918 : {
5919 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(obj);
5920 0 : PyObject *py_unknown;
5921 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)(object->unknown));
5922 0 : return py_unknown;
5923 : }
5924 :
5925 0 : static int py_lsa_PrivilegeSet_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
5926 : {
5927 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(py_obj);
5928 0 : if (value == NULL) {
5929 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unknown");
5930 0 : return -1;
5931 : }
5932 : {
5933 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
5934 0 : if (PyLong_Check(value)) {
5935 0 : unsigned long long test_var;
5936 0 : test_var = PyLong_AsUnsignedLongLong(value);
5937 0 : if (PyErr_Occurred() != NULL) {
5938 0 : return -1;
5939 : }
5940 0 : if (test_var > uint_max) {
5941 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5942 : PyLong_Type.tp_name, uint_max, test_var);
5943 0 : return -1;
5944 : }
5945 0 : object->unknown = test_var;
5946 : } else {
5947 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5948 : PyLong_Type.tp_name);
5949 0 : return -1;
5950 : }
5951 : }
5952 0 : return 0;
5953 : }
5954 :
5955 0 : static PyObject *py_lsa_PrivilegeSet_get_set(PyObject *obj, void *closure)
5956 : {
5957 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(obj);
5958 0 : PyObject *py_set;
5959 0 : py_set = PyList_New(object->count);
5960 0 : if (py_set == NULL) {
5961 0 : return NULL;
5962 : }
5963 : {
5964 : int set_cntr_0;
5965 0 : for (set_cntr_0 = 0; set_cntr_0 < (object->count); set_cntr_0++) {
5966 0 : PyObject *py_set_0;
5967 0 : py_set_0 = pytalloc_reference_ex(&lsa_LUIDAttribute_Type, object->set, &(object->set)[set_cntr_0]);
5968 0 : PyList_SetItem(py_set, set_cntr_0, py_set_0);
5969 : }
5970 : }
5971 0 : return py_set;
5972 : }
5973 :
5974 0 : static int py_lsa_PrivilegeSet_set_set(PyObject *py_obj, PyObject *value, void *closure)
5975 : {
5976 0 : struct lsa_PrivilegeSet *object = pytalloc_get_ptr(py_obj);
5977 0 : if (value == NULL) {
5978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->set");
5979 0 : return -1;
5980 : }
5981 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5982 : {
5983 0 : int set_cntr_0;
5984 0 : object->set = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->set, PyList_GET_SIZE(value));
5985 0 : if (!object->set) { return -1; }
5986 0 : talloc_set_name_const(object->set, "ARRAY: object->set");
5987 0 : for (set_cntr_0 = 0; set_cntr_0 < PyList_GET_SIZE(value); set_cntr_0++) {
5988 0 : if (PyList_GET_ITEM(value, set_cntr_0) == NULL) {
5989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->set)[set_cntr_0]");
5990 0 : return -1;
5991 : }
5992 0 : PY_CHECK_TYPE(&lsa_LUIDAttribute_Type, PyList_GET_ITEM(value, set_cntr_0), return -1;);
5993 0 : if (talloc_reference(object->set, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, set_cntr_0))) == NULL) {
5994 0 : PyErr_NoMemory();
5995 0 : return -1;
5996 : }
5997 0 : (object->set)[set_cntr_0] = *(struct lsa_LUIDAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, set_cntr_0));
5998 : }
5999 : }
6000 0 : return 0;
6001 : }
6002 :
6003 : static PyGetSetDef py_lsa_PrivilegeSet_getsetters[] = {
6004 : {
6005 : .name = discard_const_p(char, "count"),
6006 : .get = py_lsa_PrivilegeSet_get_count,
6007 : .set = py_lsa_PrivilegeSet_set_count,
6008 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6009 : },
6010 : {
6011 : .name = discard_const_p(char, "unknown"),
6012 : .get = py_lsa_PrivilegeSet_get_unknown,
6013 : .set = py_lsa_PrivilegeSet_set_unknown,
6014 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6015 : },
6016 : {
6017 : .name = discard_const_p(char, "set"),
6018 : .get = py_lsa_PrivilegeSet_get_set,
6019 : .set = py_lsa_PrivilegeSet_set_set,
6020 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUIDAttribute")
6021 : },
6022 : { .name = NULL }
6023 : };
6024 :
6025 0 : static PyObject *py_lsa_PrivilegeSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6026 : {
6027 0 : return pytalloc_new(struct lsa_PrivilegeSet, type);
6028 : }
6029 :
6030 :
6031 : static PyTypeObject lsa_PrivilegeSet_Type = {
6032 : PyVarObject_HEAD_INIT(NULL, 0)
6033 : .tp_name = "lsa.PrivilegeSet",
6034 : .tp_getset = py_lsa_PrivilegeSet_getsetters,
6035 : .tp_methods = NULL,
6036 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6037 : .tp_new = py_lsa_PrivilegeSet_new,
6038 : };
6039 :
6040 :
6041 0 : static PyObject *py_lsa_DATA_BUF_get_length(PyObject *obj, void *closure)
6042 : {
6043 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(obj);
6044 0 : PyObject *py_length;
6045 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)(object->length));
6046 0 : return py_length;
6047 : }
6048 :
6049 0 : static int py_lsa_DATA_BUF_set_length(PyObject *py_obj, PyObject *value, void *closure)
6050 : {
6051 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(py_obj);
6052 0 : if (value == NULL) {
6053 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
6054 0 : return -1;
6055 : }
6056 : {
6057 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
6058 0 : if (PyLong_Check(value)) {
6059 0 : unsigned long long test_var;
6060 0 : test_var = PyLong_AsUnsignedLongLong(value);
6061 0 : if (PyErr_Occurred() != NULL) {
6062 0 : return -1;
6063 : }
6064 0 : if (test_var > uint_max) {
6065 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6066 : PyLong_Type.tp_name, uint_max, test_var);
6067 0 : return -1;
6068 : }
6069 0 : object->length = test_var;
6070 : } else {
6071 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6072 : PyLong_Type.tp_name);
6073 0 : return -1;
6074 : }
6075 : }
6076 0 : return 0;
6077 : }
6078 :
6079 0 : static PyObject *py_lsa_DATA_BUF_get_size(PyObject *obj, void *closure)
6080 : {
6081 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(obj);
6082 0 : PyObject *py_size;
6083 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
6084 0 : return py_size;
6085 : }
6086 :
6087 0 : static int py_lsa_DATA_BUF_set_size(PyObject *py_obj, PyObject *value, void *closure)
6088 : {
6089 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(py_obj);
6090 0 : if (value == NULL) {
6091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
6092 0 : return -1;
6093 : }
6094 : {
6095 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6096 0 : if (PyLong_Check(value)) {
6097 0 : unsigned long long test_var;
6098 0 : test_var = PyLong_AsUnsignedLongLong(value);
6099 0 : if (PyErr_Occurred() != NULL) {
6100 0 : return -1;
6101 : }
6102 0 : if (test_var > uint_max) {
6103 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6104 : PyLong_Type.tp_name, uint_max, test_var);
6105 0 : return -1;
6106 : }
6107 0 : object->size = test_var;
6108 : } else {
6109 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6110 : PyLong_Type.tp_name);
6111 0 : return -1;
6112 : }
6113 : }
6114 0 : return 0;
6115 : }
6116 :
6117 0 : static PyObject *py_lsa_DATA_BUF_get_data(PyObject *obj, void *closure)
6118 : {
6119 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(obj);
6120 0 : PyObject *py_data;
6121 0 : if (object->data == NULL) {
6122 0 : Py_RETURN_NONE;
6123 : }
6124 0 : if (object->data == NULL) {
6125 0 : py_data = Py_None;
6126 0 : Py_INCREF(py_data);
6127 : } else {
6128 0 : py_data = PyList_New(object->length);
6129 0 : if (py_data == NULL) {
6130 0 : return NULL;
6131 : }
6132 : {
6133 : int data_cntr_1;
6134 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
6135 0 : PyObject *py_data_1;
6136 0 : py_data_1 = PyLong_FromLong((uint16_t)((object->data)[data_cntr_1]));
6137 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6138 : }
6139 : }
6140 : }
6141 0 : return py_data;
6142 : }
6143 :
6144 0 : static int py_lsa_DATA_BUF_set_data(PyObject *py_obj, PyObject *value, void *closure)
6145 : {
6146 0 : struct lsa_DATA_BUF *object = pytalloc_get_ptr(py_obj);
6147 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6148 0 : if (value == NULL) {
6149 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
6150 0 : return -1;
6151 : }
6152 0 : if (value == Py_None) {
6153 0 : object->data = NULL;
6154 : } else {
6155 0 : object->data = NULL;
6156 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6157 : {
6158 0 : int data_cntr_1;
6159 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6160 0 : if (!object->data) { return -1; }
6161 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
6162 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6163 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->data)[data_cntr_1]");
6165 0 : return -1;
6166 : }
6167 : {
6168 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->data)[data_cntr_1]));
6169 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6170 0 : unsigned long long test_var;
6171 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6172 0 : if (PyErr_Occurred() != NULL) {
6173 0 : return -1;
6174 : }
6175 0 : if (test_var > uint_max) {
6176 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6177 : PyLong_Type.tp_name, uint_max, test_var);
6178 0 : return -1;
6179 : }
6180 0 : (object->data)[data_cntr_1] = test_var;
6181 : } else {
6182 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6183 : PyLong_Type.tp_name);
6184 0 : return -1;
6185 : }
6186 : }
6187 : }
6188 : }
6189 : }
6190 0 : return 0;
6191 : }
6192 :
6193 : static PyGetSetDef py_lsa_DATA_BUF_getsetters[] = {
6194 : {
6195 : .name = discard_const_p(char, "length"),
6196 : .get = py_lsa_DATA_BUF_get_length,
6197 : .set = py_lsa_DATA_BUF_set_length,
6198 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6199 : },
6200 : {
6201 : .name = discard_const_p(char, "size"),
6202 : .get = py_lsa_DATA_BUF_get_size,
6203 : .set = py_lsa_DATA_BUF_set_size,
6204 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
6205 : },
6206 : {
6207 : .name = discard_const_p(char, "data"),
6208 : .get = py_lsa_DATA_BUF_get_data,
6209 : .set = py_lsa_DATA_BUF_set_data,
6210 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6211 : },
6212 : { .name = NULL }
6213 : };
6214 :
6215 0 : static PyObject *py_lsa_DATA_BUF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6216 : {
6217 0 : return pytalloc_new(struct lsa_DATA_BUF, type);
6218 : }
6219 :
6220 :
6221 : static PyTypeObject lsa_DATA_BUF_Type = {
6222 : PyVarObject_HEAD_INIT(NULL, 0)
6223 : .tp_name = "lsa.DATA_BUF",
6224 : .tp_getset = py_lsa_DATA_BUF_getsetters,
6225 : .tp_methods = NULL,
6226 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6227 : .tp_new = py_lsa_DATA_BUF_new,
6228 : };
6229 :
6230 :
6231 0 : static PyObject *py_lsa_DATA_BUF2_get_size(PyObject *obj, void *closure)
6232 : {
6233 0 : struct lsa_DATA_BUF2 *object = pytalloc_get_ptr(obj);
6234 0 : PyObject *py_size;
6235 0 : py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
6236 0 : return py_size;
6237 : }
6238 :
6239 24 : static int py_lsa_DATA_BUF2_set_size(PyObject *py_obj, PyObject *value, void *closure)
6240 : {
6241 24 : struct lsa_DATA_BUF2 *object = pytalloc_get_ptr(py_obj);
6242 24 : if (value == NULL) {
6243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
6244 0 : return -1;
6245 : }
6246 : {
6247 24 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
6248 24 : if (PyLong_Check(value)) {
6249 0 : unsigned long long test_var;
6250 24 : test_var = PyLong_AsUnsignedLongLong(value);
6251 24 : if (PyErr_Occurred() != NULL) {
6252 0 : return -1;
6253 : }
6254 24 : if (test_var > uint_max) {
6255 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6256 : PyLong_Type.tp_name, uint_max, test_var);
6257 0 : return -1;
6258 : }
6259 24 : object->size = test_var;
6260 : } else {
6261 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6262 : PyLong_Type.tp_name);
6263 0 : return -1;
6264 : }
6265 : }
6266 24 : return 0;
6267 : }
6268 :
6269 0 : static PyObject *py_lsa_DATA_BUF2_get_data(PyObject *obj, void *closure)
6270 : {
6271 0 : struct lsa_DATA_BUF2 *object = pytalloc_get_ptr(obj);
6272 0 : PyObject *py_data;
6273 0 : if (object->data == NULL) {
6274 0 : Py_RETURN_NONE;
6275 : }
6276 0 : if (object->data == NULL) {
6277 0 : py_data = Py_None;
6278 0 : Py_INCREF(py_data);
6279 : } else {
6280 0 : py_data = PyList_New(object->size);
6281 0 : if (py_data == NULL) {
6282 0 : return NULL;
6283 : }
6284 : {
6285 : int data_cntr_1;
6286 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->size); data_cntr_1++) {
6287 0 : PyObject *py_data_1;
6288 0 : py_data_1 = PyLong_FromLong((uint16_t)((object->data)[data_cntr_1]));
6289 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
6290 : }
6291 : }
6292 : }
6293 0 : return py_data;
6294 : }
6295 :
6296 24 : static int py_lsa_DATA_BUF2_set_data(PyObject *py_obj, PyObject *value, void *closure)
6297 : {
6298 24 : struct lsa_DATA_BUF2 *object = pytalloc_get_ptr(py_obj);
6299 24 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
6300 24 : if (value == NULL) {
6301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
6302 0 : return -1;
6303 : }
6304 24 : if (value == Py_None) {
6305 0 : object->data = NULL;
6306 : } else {
6307 24 : object->data = NULL;
6308 24 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6309 : {
6310 0 : int data_cntr_1;
6311 24 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
6312 24 : if (!object->data) { return -1; }
6313 24 : talloc_set_name_const(object->data, "ARRAY: object->data");
6314 23304 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
6315 23280 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
6316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->data)[data_cntr_1]");
6317 0 : return -1;
6318 : }
6319 : {
6320 23280 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->data)[data_cntr_1]));
6321 23280 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
6322 0 : unsigned long long test_var;
6323 23280 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
6324 23280 : if (PyErr_Occurred() != NULL) {
6325 0 : return -1;
6326 : }
6327 23280 : if (test_var > uint_max) {
6328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6329 : PyLong_Type.tp_name, uint_max, test_var);
6330 0 : return -1;
6331 : }
6332 23280 : (object->data)[data_cntr_1] = test_var;
6333 : } else {
6334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6335 : PyLong_Type.tp_name);
6336 0 : return -1;
6337 : }
6338 : }
6339 : }
6340 : }
6341 : }
6342 24 : return 0;
6343 : }
6344 :
6345 : static PyGetSetDef py_lsa_DATA_BUF2_getsetters[] = {
6346 : {
6347 : .name = discard_const_p(char, "size"),
6348 : .get = py_lsa_DATA_BUF2_get_size,
6349 : .set = py_lsa_DATA_BUF2_set_size,
6350 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6351 : },
6352 : {
6353 : .name = discard_const_p(char, "data"),
6354 : .get = py_lsa_DATA_BUF2_get_data,
6355 : .set = py_lsa_DATA_BUF2_set_data,
6356 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6357 : },
6358 : { .name = NULL }
6359 : };
6360 :
6361 24 : static PyObject *py_lsa_DATA_BUF2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6362 : {
6363 24 : return pytalloc_new(struct lsa_DATA_BUF2, type);
6364 : }
6365 :
6366 :
6367 : static PyTypeObject lsa_DATA_BUF2_Type = {
6368 : PyVarObject_HEAD_INIT(NULL, 0)
6369 : .tp_name = "lsa.DATA_BUF2",
6370 : .tp_getset = py_lsa_DATA_BUF2_getsetters,
6371 : .tp_methods = NULL,
6372 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6373 : .tp_new = py_lsa_DATA_BUF2_new,
6374 : };
6375 :
6376 :
6377 0 : static PyObject *py_lsa_TrustDomainInfoName_get_netbios_name(PyObject *obj, void *closure)
6378 : {
6379 0 : struct lsa_TrustDomainInfoName *object = pytalloc_get_ptr(obj);
6380 0 : PyObject *py_netbios_name;
6381 0 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6382 0 : return py_netbios_name;
6383 : }
6384 :
6385 0 : static int py_lsa_TrustDomainInfoName_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6386 : {
6387 0 : struct lsa_TrustDomainInfoName *object = pytalloc_get_ptr(py_obj);
6388 0 : if (value == NULL) {
6389 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->netbios_name");
6390 0 : return -1;
6391 : }
6392 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6393 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6394 0 : PyErr_NoMemory();
6395 0 : return -1;
6396 : }
6397 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6398 0 : return 0;
6399 : }
6400 :
6401 : static PyGetSetDef py_lsa_TrustDomainInfoName_getsetters[] = {
6402 : {
6403 : .name = discard_const_p(char, "netbios_name"),
6404 : .get = py_lsa_TrustDomainInfoName_get_netbios_name,
6405 : .set = py_lsa_TrustDomainInfoName_set_netbios_name,
6406 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6407 : },
6408 : { .name = NULL }
6409 : };
6410 :
6411 0 : static PyObject *py_lsa_TrustDomainInfoName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6412 : {
6413 0 : return pytalloc_new(struct lsa_TrustDomainInfoName, type);
6414 : }
6415 :
6416 :
6417 : static PyTypeObject lsa_TrustDomainInfoName_Type = {
6418 : PyVarObject_HEAD_INIT(NULL, 0)
6419 : .tp_name = "lsa.TrustDomainInfoName",
6420 : .tp_getset = py_lsa_TrustDomainInfoName_getsetters,
6421 : .tp_methods = NULL,
6422 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6423 : .tp_new = py_lsa_TrustDomainInfoName_new,
6424 : };
6425 :
6426 :
6427 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_entries(PyObject *obj, void *closure)
6428 : {
6429 0 : struct lsa_TrustDomainInfoControllers *object = pytalloc_get_ptr(obj);
6430 0 : PyObject *py_entries;
6431 0 : py_entries = PyLong_FromUnsignedLongLong((uint32_t)(object->entries));
6432 0 : return py_entries;
6433 : }
6434 :
6435 0 : static int py_lsa_TrustDomainInfoControllers_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6436 : {
6437 0 : struct lsa_TrustDomainInfoControllers *object = pytalloc_get_ptr(py_obj);
6438 0 : if (value == NULL) {
6439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->entries");
6440 0 : return -1;
6441 : }
6442 : {
6443 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->entries));
6444 0 : if (PyLong_Check(value)) {
6445 0 : unsigned long long test_var;
6446 0 : test_var = PyLong_AsUnsignedLongLong(value);
6447 0 : if (PyErr_Occurred() != NULL) {
6448 0 : return -1;
6449 : }
6450 0 : if (test_var > uint_max) {
6451 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6452 : PyLong_Type.tp_name, uint_max, test_var);
6453 0 : return -1;
6454 : }
6455 0 : object->entries = test_var;
6456 : } else {
6457 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6458 : PyLong_Type.tp_name);
6459 0 : return -1;
6460 : }
6461 : }
6462 0 : return 0;
6463 : }
6464 :
6465 0 : static PyObject *py_lsa_TrustDomainInfoControllers_get_netbios_names(PyObject *obj, void *closure)
6466 : {
6467 0 : struct lsa_TrustDomainInfoControllers *object = pytalloc_get_ptr(obj);
6468 0 : PyObject *py_netbios_names;
6469 0 : if (object->netbios_names == NULL) {
6470 0 : Py_RETURN_NONE;
6471 : }
6472 0 : if (object->netbios_names == NULL) {
6473 0 : py_netbios_names = Py_None;
6474 0 : Py_INCREF(py_netbios_names);
6475 : } else {
6476 0 : py_netbios_names = PyList_New(object->entries);
6477 0 : if (py_netbios_names == NULL) {
6478 0 : return NULL;
6479 : }
6480 : {
6481 : int netbios_names_cntr_1;
6482 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < (object->entries); netbios_names_cntr_1++) {
6483 0 : PyObject *py_netbios_names_1;
6484 0 : py_netbios_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->netbios_names, &(object->netbios_names)[netbios_names_cntr_1]);
6485 0 : PyList_SetItem(py_netbios_names, netbios_names_cntr_1, py_netbios_names_1);
6486 : }
6487 : }
6488 : }
6489 0 : return py_netbios_names;
6490 : }
6491 :
6492 0 : static int py_lsa_TrustDomainInfoControllers_set_netbios_names(PyObject *py_obj, PyObject *value, void *closure)
6493 : {
6494 0 : struct lsa_TrustDomainInfoControllers *object = pytalloc_get_ptr(py_obj);
6495 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->netbios_names));
6496 0 : if (value == NULL) {
6497 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->netbios_names");
6498 0 : return -1;
6499 : }
6500 0 : if (value == Py_None) {
6501 0 : object->netbios_names = NULL;
6502 : } else {
6503 0 : object->netbios_names = NULL;
6504 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6505 : {
6506 0 : int netbios_names_cntr_1;
6507 0 : object->netbios_names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->netbios_names, PyList_GET_SIZE(value));
6508 0 : if (!object->netbios_names) { return -1; }
6509 0 : talloc_set_name_const(object->netbios_names, "ARRAY: object->netbios_names");
6510 0 : for (netbios_names_cntr_1 = 0; netbios_names_cntr_1 < PyList_GET_SIZE(value); netbios_names_cntr_1++) {
6511 0 : if (PyList_GET_ITEM(value, netbios_names_cntr_1) == NULL) {
6512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->netbios_names)[netbios_names_cntr_1]");
6513 0 : return -1;
6514 : }
6515 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, netbios_names_cntr_1), return -1;);
6516 0 : if (talloc_reference(object->netbios_names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, netbios_names_cntr_1))) == NULL) {
6517 0 : PyErr_NoMemory();
6518 0 : return -1;
6519 : }
6520 0 : (object->netbios_names)[netbios_names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, netbios_names_cntr_1));
6521 : }
6522 : }
6523 : }
6524 0 : return 0;
6525 : }
6526 :
6527 : static PyGetSetDef py_lsa_TrustDomainInfoControllers_getsetters[] = {
6528 : {
6529 : .name = discard_const_p(char, "entries"),
6530 : .get = py_lsa_TrustDomainInfoControllers_get_entries,
6531 : .set = py_lsa_TrustDomainInfoControllers_set_entries,
6532 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6533 : },
6534 : {
6535 : .name = discard_const_p(char, "netbios_names"),
6536 : .get = py_lsa_TrustDomainInfoControllers_get_netbios_names,
6537 : .set = py_lsa_TrustDomainInfoControllers_set_netbios_names,
6538 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
6539 : },
6540 : { .name = NULL }
6541 : };
6542 :
6543 0 : static PyObject *py_lsa_TrustDomainInfoControllers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6544 : {
6545 0 : return pytalloc_new(struct lsa_TrustDomainInfoControllers, type);
6546 : }
6547 :
6548 :
6549 : static PyTypeObject lsa_TrustDomainInfoControllers_Type = {
6550 : PyVarObject_HEAD_INIT(NULL, 0)
6551 : .tp_name = "lsa.TrustDomainInfoControllers",
6552 : .tp_getset = py_lsa_TrustDomainInfoControllers_getsetters,
6553 : .tp_methods = NULL,
6554 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6555 : .tp_new = py_lsa_TrustDomainInfoControllers_new,
6556 : };
6557 :
6558 :
6559 48 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_get_posix_offset(PyObject *obj, void *closure)
6560 : {
6561 48 : struct lsa_TrustDomainInfoPosixOffset *object = pytalloc_get_ptr(obj);
6562 0 : PyObject *py_posix_offset;
6563 48 : py_posix_offset = PyLong_FromUnsignedLongLong((uint32_t)(object->posix_offset));
6564 48 : return py_posix_offset;
6565 : }
6566 :
6567 0 : static int py_lsa_TrustDomainInfoPosixOffset_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
6568 : {
6569 0 : struct lsa_TrustDomainInfoPosixOffset *object = pytalloc_get_ptr(py_obj);
6570 0 : if (value == NULL) {
6571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->posix_offset");
6572 0 : return -1;
6573 : }
6574 : {
6575 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->posix_offset));
6576 0 : if (PyLong_Check(value)) {
6577 0 : unsigned long long test_var;
6578 0 : test_var = PyLong_AsUnsignedLongLong(value);
6579 0 : if (PyErr_Occurred() != NULL) {
6580 0 : return -1;
6581 : }
6582 0 : if (test_var > uint_max) {
6583 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6584 : PyLong_Type.tp_name, uint_max, test_var);
6585 0 : return -1;
6586 : }
6587 0 : object->posix_offset = test_var;
6588 : } else {
6589 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6590 : PyLong_Type.tp_name);
6591 0 : return -1;
6592 : }
6593 : }
6594 0 : return 0;
6595 : }
6596 :
6597 : static PyGetSetDef py_lsa_TrustDomainInfoPosixOffset_getsetters[] = {
6598 : {
6599 : .name = discard_const_p(char, "posix_offset"),
6600 : .get = py_lsa_TrustDomainInfoPosixOffset_get_posix_offset,
6601 : .set = py_lsa_TrustDomainInfoPosixOffset_set_posix_offset,
6602 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
6603 : },
6604 : { .name = NULL }
6605 : };
6606 :
6607 0 : static PyObject *py_lsa_TrustDomainInfoPosixOffset_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6608 : {
6609 0 : return pytalloc_new(struct lsa_TrustDomainInfoPosixOffset, type);
6610 : }
6611 :
6612 :
6613 : static PyTypeObject lsa_TrustDomainInfoPosixOffset_Type = {
6614 : PyVarObject_HEAD_INIT(NULL, 0)
6615 : .tp_name = "lsa.TrustDomainInfoPosixOffset",
6616 : .tp_getset = py_lsa_TrustDomainInfoPosixOffset_getsetters,
6617 : .tp_methods = NULL,
6618 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6619 : .tp_new = py_lsa_TrustDomainInfoPosixOffset_new,
6620 : };
6621 :
6622 :
6623 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_password(PyObject *obj, void *closure)
6624 : {
6625 0 : struct lsa_TrustDomainInfoPassword *object = pytalloc_get_ptr(obj);
6626 0 : PyObject *py_password;
6627 0 : if (object->password == NULL) {
6628 0 : Py_RETURN_NONE;
6629 : }
6630 0 : if (object->password == NULL) {
6631 0 : py_password = Py_None;
6632 0 : Py_INCREF(py_password);
6633 : } else {
6634 0 : py_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->password, object->password);
6635 : }
6636 0 : return py_password;
6637 : }
6638 :
6639 0 : static int py_lsa_TrustDomainInfoPassword_set_password(PyObject *py_obj, PyObject *value, void *closure)
6640 : {
6641 0 : struct lsa_TrustDomainInfoPassword *object = pytalloc_get_ptr(py_obj);
6642 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->password));
6643 0 : if (value == NULL) {
6644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->password");
6645 0 : return -1;
6646 : }
6647 0 : if (value == Py_None) {
6648 0 : object->password = NULL;
6649 : } else {
6650 0 : object->password = NULL;
6651 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6652 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6653 0 : PyErr_NoMemory();
6654 0 : return -1;
6655 : }
6656 0 : object->password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6657 : }
6658 0 : return 0;
6659 : }
6660 :
6661 0 : static PyObject *py_lsa_TrustDomainInfoPassword_get_old_password(PyObject *obj, void *closure)
6662 : {
6663 0 : struct lsa_TrustDomainInfoPassword *object = pytalloc_get_ptr(obj);
6664 0 : PyObject *py_old_password;
6665 0 : if (object->old_password == NULL) {
6666 0 : Py_RETURN_NONE;
6667 : }
6668 0 : if (object->old_password == NULL) {
6669 0 : py_old_password = Py_None;
6670 0 : Py_INCREF(py_old_password);
6671 : } else {
6672 0 : py_old_password = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->old_password, object->old_password);
6673 : }
6674 0 : return py_old_password;
6675 : }
6676 :
6677 0 : static int py_lsa_TrustDomainInfoPassword_set_old_password(PyObject *py_obj, PyObject *value, void *closure)
6678 : {
6679 0 : struct lsa_TrustDomainInfoPassword *object = pytalloc_get_ptr(py_obj);
6680 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->old_password));
6681 0 : if (value == NULL) {
6682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->old_password");
6683 0 : return -1;
6684 : }
6685 0 : if (value == Py_None) {
6686 0 : object->old_password = NULL;
6687 : } else {
6688 0 : object->old_password = NULL;
6689 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
6690 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6691 0 : PyErr_NoMemory();
6692 0 : return -1;
6693 : }
6694 0 : object->old_password = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
6695 : }
6696 0 : return 0;
6697 : }
6698 :
6699 : static PyGetSetDef py_lsa_TrustDomainInfoPassword_getsetters[] = {
6700 : {
6701 : .name = discard_const_p(char, "password"),
6702 : .get = py_lsa_TrustDomainInfoPassword_get_password,
6703 : .set = py_lsa_TrustDomainInfoPassword_set_password,
6704 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6705 : },
6706 : {
6707 : .name = discard_const_p(char, "old_password"),
6708 : .get = py_lsa_TrustDomainInfoPassword_get_old_password,
6709 : .set = py_lsa_TrustDomainInfoPassword_set_old_password,
6710 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
6711 : },
6712 : { .name = NULL }
6713 : };
6714 :
6715 0 : static PyObject *py_lsa_TrustDomainInfoPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6716 : {
6717 0 : return pytalloc_new(struct lsa_TrustDomainInfoPassword, type);
6718 : }
6719 :
6720 :
6721 : static PyTypeObject lsa_TrustDomainInfoPassword_Type = {
6722 : PyVarObject_HEAD_INIT(NULL, 0)
6723 : .tp_name = "lsa.TrustDomainInfoPassword",
6724 : .tp_getset = py_lsa_TrustDomainInfoPassword_getsetters,
6725 : .tp_methods = NULL,
6726 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6727 : .tp_new = py_lsa_TrustDomainInfoPassword_new,
6728 : };
6729 :
6730 :
6731 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_netbios_name(PyObject *obj, void *closure)
6732 : {
6733 0 : struct lsa_TrustDomainInfoBasic *object = pytalloc_get_ptr(obj);
6734 0 : PyObject *py_netbios_name;
6735 0 : py_netbios_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6736 0 : return py_netbios_name;
6737 : }
6738 :
6739 0 : static int py_lsa_TrustDomainInfoBasic_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6740 : {
6741 0 : struct lsa_TrustDomainInfoBasic *object = pytalloc_get_ptr(py_obj);
6742 0 : if (value == NULL) {
6743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->netbios_name");
6744 0 : return -1;
6745 : }
6746 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
6747 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6748 0 : PyErr_NoMemory();
6749 0 : return -1;
6750 : }
6751 0 : object->netbios_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6752 0 : return 0;
6753 : }
6754 :
6755 0 : static PyObject *py_lsa_TrustDomainInfoBasic_get_sid(PyObject *obj, void *closure)
6756 : {
6757 0 : struct lsa_TrustDomainInfoBasic *object = pytalloc_get_ptr(obj);
6758 0 : PyObject *py_sid;
6759 0 : if (object->sid == NULL) {
6760 0 : Py_RETURN_NONE;
6761 : }
6762 0 : if (object->sid == NULL) {
6763 0 : py_sid = Py_None;
6764 0 : Py_INCREF(py_sid);
6765 : } else {
6766 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6767 : }
6768 0 : return py_sid;
6769 : }
6770 :
6771 0 : static int py_lsa_TrustDomainInfoBasic_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6772 : {
6773 0 : struct lsa_TrustDomainInfoBasic *object = pytalloc_get_ptr(py_obj);
6774 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6775 0 : if (value == NULL) {
6776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
6777 0 : return -1;
6778 : }
6779 0 : if (value == Py_None) {
6780 0 : object->sid = NULL;
6781 : } else {
6782 0 : object->sid = NULL;
6783 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6784 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6785 0 : PyErr_NoMemory();
6786 0 : return -1;
6787 : }
6788 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6789 : }
6790 0 : return 0;
6791 : }
6792 :
6793 : static PyGetSetDef py_lsa_TrustDomainInfoBasic_getsetters[] = {
6794 : {
6795 : .name = discard_const_p(char, "netbios_name"),
6796 : .get = py_lsa_TrustDomainInfoBasic_get_netbios_name,
6797 : .set = py_lsa_TrustDomainInfoBasic_set_netbios_name,
6798 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6799 : },
6800 : {
6801 : .name = discard_const_p(char, "sid"),
6802 : .get = py_lsa_TrustDomainInfoBasic_get_sid,
6803 : .set = py_lsa_TrustDomainInfoBasic_set_sid,
6804 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
6805 : },
6806 : { .name = NULL }
6807 : };
6808 :
6809 0 : static PyObject *py_lsa_TrustDomainInfoBasic_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6810 : {
6811 0 : return pytalloc_new(struct lsa_TrustDomainInfoBasic, type);
6812 : }
6813 :
6814 :
6815 : static PyTypeObject lsa_TrustDomainInfoBasic_Type = {
6816 : PyVarObject_HEAD_INIT(NULL, 0)
6817 : .tp_name = "lsa.TrustDomainInfoBasic",
6818 : .tp_getset = py_lsa_TrustDomainInfoBasic_getsetters,
6819 : .tp_methods = NULL,
6820 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6821 : .tp_new = py_lsa_TrustDomainInfoBasic_new,
6822 : };
6823 :
6824 :
6825 607 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_domain_name(PyObject *obj, void *closure)
6826 : {
6827 607 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6828 0 : PyObject *py_domain_name;
6829 607 : py_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
6830 607 : return py_domain_name;
6831 : }
6832 :
6833 0 : static int py_lsa_TrustDomainInfoInfoEx_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
6834 : {
6835 0 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6836 0 : if (value == NULL) {
6837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_name");
6838 0 : return -1;
6839 : }
6840 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6841 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6842 0 : PyErr_NoMemory();
6843 0 : return -1;
6844 : }
6845 0 : object->domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6846 0 : return 0;
6847 : }
6848 :
6849 191 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_netbios_name(PyObject *obj, void *closure)
6850 : {
6851 191 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6852 0 : PyObject *py_netbios_name;
6853 191 : py_netbios_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_name);
6854 191 : return py_netbios_name;
6855 : }
6856 :
6857 0 : static int py_lsa_TrustDomainInfoInfoEx_set_netbios_name(PyObject *py_obj, PyObject *value, void *closure)
6858 : {
6859 0 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6860 0 : if (value == NULL) {
6861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->netbios_name");
6862 0 : return -1;
6863 : }
6864 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
6865 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6866 0 : PyErr_NoMemory();
6867 0 : return -1;
6868 : }
6869 0 : object->netbios_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
6870 0 : return 0;
6871 : }
6872 :
6873 122 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_sid(PyObject *obj, void *closure)
6874 : {
6875 122 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6876 0 : PyObject *py_sid;
6877 122 : if (object->sid == NULL) {
6878 0 : Py_RETURN_NONE;
6879 : }
6880 122 : if (object->sid == NULL) {
6881 0 : py_sid = Py_None;
6882 0 : Py_INCREF(py_sid);
6883 : } else {
6884 122 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
6885 : }
6886 122 : return py_sid;
6887 : }
6888 :
6889 25 : static int py_lsa_TrustDomainInfoInfoEx_set_sid(PyObject *py_obj, PyObject *value, void *closure)
6890 : {
6891 25 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6892 25 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
6893 25 : if (value == NULL) {
6894 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
6895 0 : return -1;
6896 : }
6897 25 : if (value == Py_None) {
6898 0 : object->sid = NULL;
6899 : } else {
6900 25 : object->sid = NULL;
6901 25 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
6902 25 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6903 0 : PyErr_NoMemory();
6904 0 : return -1;
6905 : }
6906 25 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
6907 : }
6908 25 : return 0;
6909 : }
6910 :
6911 106 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_direction(PyObject *obj, void *closure)
6912 : {
6913 106 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6914 0 : PyObject *py_trust_direction;
6915 106 : py_trust_direction = PyLong_FromUnsignedLongLong((uint32_t)(object->trust_direction));
6916 106 : return py_trust_direction;
6917 : }
6918 :
6919 63 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_direction(PyObject *py_obj, PyObject *value, void *closure)
6920 : {
6921 63 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6922 63 : if (value == NULL) {
6923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->trust_direction");
6924 0 : return -1;
6925 : }
6926 : {
6927 63 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_direction));
6928 63 : if (PyLong_Check(value)) {
6929 0 : unsigned long long test_var;
6930 63 : test_var = PyLong_AsUnsignedLongLong(value);
6931 63 : if (PyErr_Occurred() != NULL) {
6932 0 : return -1;
6933 : }
6934 63 : if (test_var > uint_max) {
6935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6936 : PyLong_Type.tp_name, uint_max, test_var);
6937 0 : return -1;
6938 : }
6939 63 : object->trust_direction = test_var;
6940 : } else {
6941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6942 : PyLong_Type.tp_name);
6943 0 : return -1;
6944 : }
6945 : }
6946 63 : return 0;
6947 : }
6948 :
6949 24 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_type(PyObject *obj, void *closure)
6950 : {
6951 24 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6952 0 : PyObject *py_trust_type;
6953 24 : py_trust_type = PyLong_FromUnsignedLongLong((uint32_t)(object->trust_type));
6954 24 : return py_trust_type;
6955 : }
6956 :
6957 25 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_type(PyObject *py_obj, PyObject *value, void *closure)
6958 : {
6959 25 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6960 25 : if (value == NULL) {
6961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->trust_type");
6962 0 : return -1;
6963 : }
6964 : {
6965 25 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_type));
6966 25 : if (PyLong_Check(value)) {
6967 0 : unsigned long long test_var;
6968 25 : test_var = PyLong_AsUnsignedLongLong(value);
6969 25 : if (PyErr_Occurred() != NULL) {
6970 0 : return -1;
6971 : }
6972 25 : if (test_var > uint_max) {
6973 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6974 : PyLong_Type.tp_name, uint_max, test_var);
6975 0 : return -1;
6976 : }
6977 25 : object->trust_type = test_var;
6978 : } else {
6979 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6980 : PyLong_Type.tp_name);
6981 0 : return -1;
6982 : }
6983 : }
6984 25 : return 0;
6985 : }
6986 :
6987 177 : static PyObject *py_lsa_TrustDomainInfoInfoEx_get_trust_attributes(PyObject *obj, void *closure)
6988 : {
6989 177 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(obj);
6990 0 : PyObject *py_trust_attributes;
6991 177 : py_trust_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->trust_attributes));
6992 177 : return py_trust_attributes;
6993 : }
6994 :
6995 47 : static int py_lsa_TrustDomainInfoInfoEx_set_trust_attributes(PyObject *py_obj, PyObject *value, void *closure)
6996 : {
6997 47 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
6998 47 : if (value == NULL) {
6999 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->trust_attributes");
7000 0 : return -1;
7001 : }
7002 : {
7003 47 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->trust_attributes));
7004 47 : if (PyLong_Check(value)) {
7005 0 : unsigned long long test_var;
7006 47 : test_var = PyLong_AsUnsignedLongLong(value);
7007 47 : if (PyErr_Occurred() != NULL) {
7008 0 : return -1;
7009 : }
7010 47 : if (test_var > uint_max) {
7011 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7012 : PyLong_Type.tp_name, uint_max, test_var);
7013 0 : return -1;
7014 : }
7015 47 : object->trust_attributes = test_var;
7016 : } else {
7017 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7018 : PyLong_Type.tp_name);
7019 0 : return -1;
7020 : }
7021 : }
7022 47 : return 0;
7023 : }
7024 :
7025 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx_getsetters[] = {
7026 : {
7027 : .name = discard_const_p(char, "domain_name"),
7028 : .get = py_lsa_TrustDomainInfoInfoEx_get_domain_name,
7029 : .set = py_lsa_TrustDomainInfoInfoEx_set_domain_name,
7030 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7031 : },
7032 : {
7033 : .name = discard_const_p(char, "netbios_name"),
7034 : .get = py_lsa_TrustDomainInfoInfoEx_get_netbios_name,
7035 : .set = py_lsa_TrustDomainInfoInfoEx_set_netbios_name,
7036 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
7037 : },
7038 : {
7039 : .name = discard_const_p(char, "sid"),
7040 : .get = py_lsa_TrustDomainInfoInfoEx_get_sid,
7041 : .set = py_lsa_TrustDomainInfoInfoEx_set_sid,
7042 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
7043 : },
7044 : {
7045 : .name = discard_const_p(char, "trust_direction"),
7046 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_direction,
7047 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_direction,
7048 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDirection")
7049 : },
7050 : {
7051 : .name = discard_const_p(char, "trust_type"),
7052 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_type,
7053 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_type,
7054 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustType")
7055 : },
7056 : {
7057 : .name = discard_const_p(char, "trust_attributes"),
7058 : .get = py_lsa_TrustDomainInfoInfoEx_get_trust_attributes,
7059 : .set = py_lsa_TrustDomainInfoInfoEx_set_trust_attributes,
7060 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAttributes")
7061 : },
7062 : { .name = NULL }
7063 : };
7064 :
7065 25 : static PyObject *py_lsa_TrustDomainInfoInfoEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7066 : {
7067 25 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx, type);
7068 : }
7069 :
7070 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7071 : {
7072 0 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
7073 0 : PyObject *ret = NULL;
7074 0 : DATA_BLOB blob;
7075 0 : enum ndr_err_code err;
7076 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7077 0 : if (tmp_ctx == NULL) {
7078 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7079 0 : return NULL;
7080 : }
7081 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoInfoEx);
7082 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7083 0 : TALLOC_FREE(tmp_ctx);
7084 0 : PyErr_SetNdrError(err);
7085 0 : return NULL;
7086 : }
7087 :
7088 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7089 0 : TALLOC_FREE(tmp_ctx);
7090 0 : return ret;
7091 : }
7092 :
7093 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7094 : {
7095 0 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
7096 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7097 0 : Py_ssize_t blob_length = 0;
7098 0 : enum ndr_err_code err;
7099 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7100 0 : PyObject *allow_remaining_obj = NULL;
7101 0 : bool allow_remaining = false;
7102 :
7103 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7104 : discard_const_p(char *, kwnames),
7105 : &blob.data, &blob_length,
7106 : &allow_remaining_obj)) {
7107 0 : return NULL;
7108 : }
7109 0 : blob.length = blob_length;
7110 :
7111 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7112 0 : allow_remaining = true;
7113 : }
7114 :
7115 0 : if (allow_remaining) {
7116 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7117 : } else {
7118 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoInfoEx);
7119 : }
7120 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7121 0 : PyErr_SetNdrError(err);
7122 0 : return NULL;
7123 : }
7124 :
7125 0 : Py_RETURN_NONE;
7126 : }
7127 :
7128 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7129 : {
7130 0 : struct lsa_TrustDomainInfoInfoEx *object = pytalloc_get_ptr(py_obj);
7131 0 : PyObject *ret;
7132 0 : char *retstr;
7133 :
7134 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoInfoEx, "lsa_TrustDomainInfoInfoEx", object);
7135 0 : ret = PyUnicode_FromString(retstr);
7136 0 : talloc_free(retstr);
7137 :
7138 0 : return ret;
7139 : }
7140 :
7141 : static PyMethodDef py_lsa_TrustDomainInfoInfoEx_methods[] = {
7142 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7143 : { "__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" },
7144 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoInfoEx_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7145 : { NULL, NULL, 0, NULL }
7146 : };
7147 :
7148 :
7149 : static PyTypeObject lsa_TrustDomainInfoInfoEx_Type = {
7150 : PyVarObject_HEAD_INIT(NULL, 0)
7151 : .tp_name = "lsa.TrustDomainInfoInfoEx",
7152 : .tp_getset = py_lsa_TrustDomainInfoInfoEx_getsetters,
7153 : .tp_methods = py_lsa_TrustDomainInfoInfoEx_methods,
7154 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7155 : .tp_new = py_lsa_TrustDomainInfoInfoEx_new,
7156 : };
7157 :
7158 :
7159 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_last_update_time(PyObject *obj, void *closure)
7160 : {
7161 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(obj);
7162 0 : PyObject *py_last_update_time;
7163 0 : py_last_update_time = PyLong_FromUnsignedLongLong(object->last_update_time);
7164 0 : return py_last_update_time;
7165 : }
7166 :
7167 0 : static int py_lsa_TrustDomainInfoBuffer_set_last_update_time(PyObject *py_obj, PyObject *value, void *closure)
7168 : {
7169 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(py_obj);
7170 0 : if (value == NULL) {
7171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->last_update_time");
7172 0 : return -1;
7173 : }
7174 : {
7175 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_update_time));
7176 0 : if (PyLong_Check(value)) {
7177 0 : unsigned long long test_var;
7178 0 : test_var = PyLong_AsUnsignedLongLong(value);
7179 0 : if (PyErr_Occurred() != NULL) {
7180 0 : return -1;
7181 : }
7182 0 : if (test_var > uint_max) {
7183 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7184 : PyLong_Type.tp_name, uint_max, test_var);
7185 0 : return -1;
7186 : }
7187 0 : object->last_update_time = test_var;
7188 : } else {
7189 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7190 : PyLong_Type.tp_name);
7191 0 : return -1;
7192 : }
7193 : }
7194 0 : return 0;
7195 : }
7196 :
7197 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_AuthType(PyObject *obj, void *closure)
7198 : {
7199 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(obj);
7200 0 : PyObject *py_AuthType;
7201 0 : py_AuthType = PyLong_FromUnsignedLongLong((uint32_t)(object->AuthType));
7202 0 : return py_AuthType;
7203 : }
7204 :
7205 0 : static int py_lsa_TrustDomainInfoBuffer_set_AuthType(PyObject *py_obj, PyObject *value, void *closure)
7206 : {
7207 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(py_obj);
7208 0 : if (value == NULL) {
7209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->AuthType");
7210 0 : return -1;
7211 : }
7212 : {
7213 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->AuthType));
7214 0 : if (PyLong_Check(value)) {
7215 0 : unsigned long long test_var;
7216 0 : test_var = PyLong_AsUnsignedLongLong(value);
7217 0 : if (PyErr_Occurred() != NULL) {
7218 0 : return -1;
7219 : }
7220 0 : if (test_var > uint_max) {
7221 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7222 : PyLong_Type.tp_name, uint_max, test_var);
7223 0 : return -1;
7224 : }
7225 0 : object->AuthType = test_var;
7226 : } else {
7227 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7228 : PyLong_Type.tp_name);
7229 0 : return -1;
7230 : }
7231 : }
7232 0 : return 0;
7233 : }
7234 :
7235 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_get_data(PyObject *obj, void *closure)
7236 : {
7237 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(obj);
7238 0 : PyObject *py_data;
7239 0 : py_data = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->data);
7240 0 : return py_data;
7241 : }
7242 :
7243 0 : static int py_lsa_TrustDomainInfoBuffer_set_data(PyObject *py_obj, PyObject *value, void *closure)
7244 : {
7245 0 : struct lsa_TrustDomainInfoBuffer *object = pytalloc_get_ptr(py_obj);
7246 0 : if (value == NULL) {
7247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
7248 0 : return -1;
7249 : }
7250 0 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7251 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7252 0 : PyErr_NoMemory();
7253 0 : return -1;
7254 : }
7255 0 : object->data = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7256 0 : return 0;
7257 : }
7258 :
7259 : static PyGetSetDef py_lsa_TrustDomainInfoBuffer_getsetters[] = {
7260 : {
7261 : .name = discard_const_p(char, "last_update_time"),
7262 : .get = py_lsa_TrustDomainInfoBuffer_get_last_update_time,
7263 : .set = py_lsa_TrustDomainInfoBuffer_set_last_update_time,
7264 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
7265 : },
7266 : {
7267 : .name = discard_const_p(char, "AuthType"),
7268 : .get = py_lsa_TrustDomainInfoBuffer_get_AuthType,
7269 : .set = py_lsa_TrustDomainInfoBuffer_set_AuthType,
7270 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustAuthType")
7271 : },
7272 : {
7273 : .name = discard_const_p(char, "data"),
7274 : .get = py_lsa_TrustDomainInfoBuffer_get_data,
7275 : .set = py_lsa_TrustDomainInfoBuffer_set_data,
7276 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7277 : },
7278 : { .name = NULL }
7279 : };
7280 :
7281 0 : static PyObject *py_lsa_TrustDomainInfoBuffer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7282 : {
7283 0 : return pytalloc_new(struct lsa_TrustDomainInfoBuffer, type);
7284 : }
7285 :
7286 :
7287 : static PyTypeObject lsa_TrustDomainInfoBuffer_Type = {
7288 : PyVarObject_HEAD_INIT(NULL, 0)
7289 : .tp_name = "lsa.TrustDomainInfoBuffer",
7290 : .tp_getset = py_lsa_TrustDomainInfoBuffer_getsetters,
7291 : .tp_methods = NULL,
7292 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7293 : .tp_new = py_lsa_TrustDomainInfoBuffer_new,
7294 : };
7295 :
7296 :
7297 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_count(PyObject *obj, void *closure)
7298 : {
7299 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7300 0 : PyObject *py_incoming_count;
7301 0 : py_incoming_count = PyLong_FromUnsignedLongLong((uint32_t)(object->incoming_count));
7302 0 : return py_incoming_count;
7303 : }
7304 :
7305 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_count(PyObject *py_obj, PyObject *value, void *closure)
7306 : {
7307 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7308 0 : if (value == NULL) {
7309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->incoming_count");
7310 0 : return -1;
7311 : }
7312 : {
7313 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->incoming_count));
7314 0 : if (PyLong_Check(value)) {
7315 0 : unsigned long long test_var;
7316 0 : test_var = PyLong_AsUnsignedLongLong(value);
7317 0 : if (PyErr_Occurred() != NULL) {
7318 0 : return -1;
7319 : }
7320 0 : if (test_var > uint_max) {
7321 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7322 : PyLong_Type.tp_name, uint_max, test_var);
7323 0 : return -1;
7324 : }
7325 0 : object->incoming_count = test_var;
7326 : } else {
7327 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7328 : PyLong_Type.tp_name);
7329 0 : return -1;
7330 : }
7331 : }
7332 0 : return 0;
7333 : }
7334 :
7335 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info(PyObject *obj, void *closure)
7336 : {
7337 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7338 0 : PyObject *py_incoming_current_auth_info;
7339 0 : if (object->incoming_current_auth_info == NULL) {
7340 0 : Py_RETURN_NONE;
7341 : }
7342 0 : if (object->incoming_current_auth_info == NULL) {
7343 0 : py_incoming_current_auth_info = Py_None;
7344 0 : Py_INCREF(py_incoming_current_auth_info);
7345 : } else {
7346 0 : py_incoming_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_current_auth_info, object->incoming_current_auth_info);
7347 : }
7348 0 : return py_incoming_current_auth_info;
7349 : }
7350 :
7351 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7352 : {
7353 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7354 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_current_auth_info));
7355 0 : if (value == NULL) {
7356 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->incoming_current_auth_info");
7357 0 : return -1;
7358 : }
7359 0 : if (value == Py_None) {
7360 0 : object->incoming_current_auth_info = NULL;
7361 : } else {
7362 0 : object->incoming_current_auth_info = NULL;
7363 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7364 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7365 0 : PyErr_NoMemory();
7366 0 : return -1;
7367 : }
7368 0 : object->incoming_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7369 : }
7370 0 : return 0;
7371 : }
7372 :
7373 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info(PyObject *obj, void *closure)
7374 : {
7375 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7376 0 : PyObject *py_incoming_previous_auth_info;
7377 0 : if (object->incoming_previous_auth_info == NULL) {
7378 0 : Py_RETURN_NONE;
7379 : }
7380 0 : if (object->incoming_previous_auth_info == NULL) {
7381 0 : py_incoming_previous_auth_info = Py_None;
7382 0 : Py_INCREF(py_incoming_previous_auth_info);
7383 : } else {
7384 0 : py_incoming_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->incoming_previous_auth_info, object->incoming_previous_auth_info);
7385 : }
7386 0 : return py_incoming_previous_auth_info;
7387 : }
7388 :
7389 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7390 : {
7391 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->incoming_previous_auth_info));
7393 0 : if (value == NULL) {
7394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->incoming_previous_auth_info");
7395 0 : return -1;
7396 : }
7397 0 : if (value == Py_None) {
7398 0 : object->incoming_previous_auth_info = NULL;
7399 : } else {
7400 0 : object->incoming_previous_auth_info = NULL;
7401 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7402 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7403 0 : PyErr_NoMemory();
7404 0 : return -1;
7405 : }
7406 0 : object->incoming_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7407 : }
7408 0 : return 0;
7409 : }
7410 :
7411 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count(PyObject *obj, void *closure)
7412 : {
7413 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7414 0 : PyObject *py_outgoing_count;
7415 0 : py_outgoing_count = PyLong_FromUnsignedLongLong((uint32_t)(object->outgoing_count));
7416 0 : return py_outgoing_count;
7417 : }
7418 :
7419 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count(PyObject *py_obj, PyObject *value, void *closure)
7420 : {
7421 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7422 0 : if (value == NULL) {
7423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->outgoing_count");
7424 0 : return -1;
7425 : }
7426 : {
7427 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->outgoing_count));
7428 0 : if (PyLong_Check(value)) {
7429 0 : unsigned long long test_var;
7430 0 : test_var = PyLong_AsUnsignedLongLong(value);
7431 0 : if (PyErr_Occurred() != NULL) {
7432 0 : return -1;
7433 : }
7434 0 : if (test_var > uint_max) {
7435 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7436 : PyLong_Type.tp_name, uint_max, test_var);
7437 0 : return -1;
7438 : }
7439 0 : object->outgoing_count = test_var;
7440 : } else {
7441 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7442 : PyLong_Type.tp_name);
7443 0 : return -1;
7444 : }
7445 : }
7446 0 : return 0;
7447 : }
7448 :
7449 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info(PyObject *obj, void *closure)
7450 : {
7451 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7452 0 : PyObject *py_outgoing_current_auth_info;
7453 0 : if (object->outgoing_current_auth_info == NULL) {
7454 0 : Py_RETURN_NONE;
7455 : }
7456 0 : if (object->outgoing_current_auth_info == NULL) {
7457 0 : py_outgoing_current_auth_info = Py_None;
7458 0 : Py_INCREF(py_outgoing_current_auth_info);
7459 : } else {
7460 0 : py_outgoing_current_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_current_auth_info, object->outgoing_current_auth_info);
7461 : }
7462 0 : return py_outgoing_current_auth_info;
7463 : }
7464 :
7465 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7466 : {
7467 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7468 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_current_auth_info));
7469 0 : if (value == NULL) {
7470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->outgoing_current_auth_info");
7471 0 : return -1;
7472 : }
7473 0 : if (value == Py_None) {
7474 0 : object->outgoing_current_auth_info = NULL;
7475 : } else {
7476 0 : object->outgoing_current_auth_info = NULL;
7477 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7478 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7479 0 : PyErr_NoMemory();
7480 0 : return -1;
7481 : }
7482 0 : object->outgoing_current_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7483 : }
7484 0 : return 0;
7485 : }
7486 :
7487 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info(PyObject *obj, void *closure)
7488 : {
7489 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(obj);
7490 0 : PyObject *py_outgoing_previous_auth_info;
7491 0 : if (object->outgoing_previous_auth_info == NULL) {
7492 0 : Py_RETURN_NONE;
7493 : }
7494 0 : if (object->outgoing_previous_auth_info == NULL) {
7495 0 : py_outgoing_previous_auth_info = Py_None;
7496 0 : Py_INCREF(py_outgoing_previous_auth_info);
7497 : } else {
7498 0 : py_outgoing_previous_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoBuffer_Type, object->outgoing_previous_auth_info, object->outgoing_previous_auth_info);
7499 : }
7500 0 : return py_outgoing_previous_auth_info;
7501 : }
7502 :
7503 0 : static int py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7504 : {
7505 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7506 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->outgoing_previous_auth_info));
7507 0 : if (value == NULL) {
7508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->outgoing_previous_auth_info");
7509 0 : return -1;
7510 : }
7511 0 : if (value == Py_None) {
7512 0 : object->outgoing_previous_auth_info = NULL;
7513 : } else {
7514 0 : object->outgoing_previous_auth_info = NULL;
7515 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBuffer_Type, value, return -1;);
7516 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7517 0 : PyErr_NoMemory();
7518 0 : return -1;
7519 : }
7520 0 : object->outgoing_previous_auth_info = (struct lsa_TrustDomainInfoBuffer *)pytalloc_get_ptr(value);
7521 : }
7522 0 : return 0;
7523 : }
7524 :
7525 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfo_getsetters[] = {
7526 : {
7527 : .name = discard_const_p(char, "incoming_count"),
7528 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_count,
7529 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_count,
7530 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7531 : },
7532 : {
7533 : .name = discard_const_p(char, "incoming_current_auth_info"),
7534 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_current_auth_info,
7535 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_current_auth_info,
7536 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7537 : },
7538 : {
7539 : .name = discard_const_p(char, "incoming_previous_auth_info"),
7540 : .get = py_lsa_TrustDomainInfoAuthInfo_get_incoming_previous_auth_info,
7541 : .set = py_lsa_TrustDomainInfoAuthInfo_set_incoming_previous_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_count"),
7546 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_count,
7547 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_count,
7548 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7549 : },
7550 : {
7551 : .name = discard_const_p(char, "outgoing_current_auth_info"),
7552 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_current_auth_info,
7553 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_current_auth_info,
7554 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7555 : },
7556 : {
7557 : .name = discard_const_p(char, "outgoing_previous_auth_info"),
7558 : .get = py_lsa_TrustDomainInfoAuthInfo_get_outgoing_previous_auth_info,
7559 : .set = py_lsa_TrustDomainInfoAuthInfo_set_outgoing_previous_auth_info,
7560 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoBuffer")
7561 : },
7562 : { .name = NULL }
7563 : };
7564 :
7565 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7566 : {
7567 0 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfo, type);
7568 : }
7569 :
7570 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7571 : {
7572 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7573 0 : PyObject *ret = NULL;
7574 0 : DATA_BLOB blob;
7575 0 : enum ndr_err_code err;
7576 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
7577 0 : if (tmp_ctx == NULL) {
7578 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
7579 0 : return NULL;
7580 : }
7581 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_TrustDomainInfoAuthInfo);
7582 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7583 0 : TALLOC_FREE(tmp_ctx);
7584 0 : PyErr_SetNdrError(err);
7585 0 : return NULL;
7586 : }
7587 :
7588 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
7589 0 : TALLOC_FREE(tmp_ctx);
7590 0 : return ret;
7591 : }
7592 :
7593 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
7594 : {
7595 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7596 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
7597 0 : Py_ssize_t blob_length = 0;
7598 0 : enum ndr_err_code err;
7599 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
7600 0 : PyObject *allow_remaining_obj = NULL;
7601 0 : bool allow_remaining = false;
7602 :
7603 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
7604 : discard_const_p(char *, kwnames),
7605 : &blob.data, &blob_length,
7606 : &allow_remaining_obj)) {
7607 0 : return NULL;
7608 : }
7609 0 : blob.length = blob_length;
7610 :
7611 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
7612 0 : allow_remaining = true;
7613 : }
7614 :
7615 0 : if (allow_remaining) {
7616 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7617 : } else {
7618 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_TrustDomainInfoAuthInfo);
7619 : }
7620 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
7621 0 : PyErr_SetNdrError(err);
7622 0 : return NULL;
7623 : }
7624 :
7625 0 : Py_RETURN_NONE;
7626 : }
7627 :
7628 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
7629 : {
7630 0 : struct lsa_TrustDomainInfoAuthInfo *object = pytalloc_get_ptr(py_obj);
7631 0 : PyObject *ret;
7632 0 : char *retstr;
7633 :
7634 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_TrustDomainInfoAuthInfo, "lsa_TrustDomainInfoAuthInfo", object);
7635 0 : ret = PyUnicode_FromString(retstr);
7636 0 : talloc_free(retstr);
7637 :
7638 0 : return ret;
7639 : }
7640 :
7641 : static PyMethodDef py_lsa_TrustDomainInfoAuthInfo_methods[] = {
7642 : { "__ndr_pack__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
7643 : { "__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" },
7644 : { "__ndr_print__", (PyCFunction)py_lsa_TrustDomainInfoAuthInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
7645 : { NULL, NULL, 0, NULL }
7646 : };
7647 :
7648 :
7649 : static PyTypeObject lsa_TrustDomainInfoAuthInfo_Type = {
7650 : PyVarObject_HEAD_INIT(NULL, 0)
7651 : .tp_name = "lsa.TrustDomainInfoAuthInfo",
7652 : .tp_getset = py_lsa_TrustDomainInfoAuthInfo_getsetters,
7653 : .tp_methods = py_lsa_TrustDomainInfoAuthInfo_methods,
7654 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7655 : .tp_new = py_lsa_TrustDomainInfoAuthInfo_new,
7656 : };
7657 :
7658 :
7659 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_info_ex(PyObject *obj, void *closure)
7660 : {
7661 24 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(obj);
7662 0 : PyObject *py_info_ex;
7663 24 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7664 24 : return py_info_ex;
7665 : }
7666 :
7667 0 : static int py_lsa_TrustDomainInfoFullInfo_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7668 : {
7669 0 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(py_obj);
7670 0 : if (value == NULL) {
7671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info_ex");
7672 0 : return -1;
7673 : }
7674 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7675 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7676 0 : PyErr_NoMemory();
7677 0 : return -1;
7678 : }
7679 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7680 0 : return 0;
7681 : }
7682 :
7683 24 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_posix_offset(PyObject *obj, void *closure)
7684 : {
7685 24 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(obj);
7686 0 : PyObject *py_posix_offset;
7687 24 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7688 24 : return py_posix_offset;
7689 : }
7690 :
7691 0 : static int py_lsa_TrustDomainInfoFullInfo_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7692 : {
7693 0 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(py_obj);
7694 0 : if (value == NULL) {
7695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->posix_offset");
7696 0 : return -1;
7697 : }
7698 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7699 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7700 0 : PyErr_NoMemory();
7701 0 : return -1;
7702 : }
7703 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7704 0 : return 0;
7705 : }
7706 :
7707 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_get_auth_info(PyObject *obj, void *closure)
7708 : {
7709 0 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(obj);
7710 0 : PyObject *py_auth_info;
7711 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7712 0 : return py_auth_info;
7713 : }
7714 :
7715 0 : static int py_lsa_TrustDomainInfoFullInfo_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7716 : {
7717 0 : struct lsa_TrustDomainInfoFullInfo *object = pytalloc_get_ptr(py_obj);
7718 0 : if (value == NULL) {
7719 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
7720 0 : return -1;
7721 : }
7722 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
7723 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7724 0 : PyErr_NoMemory();
7725 0 : return -1;
7726 : }
7727 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
7728 0 : return 0;
7729 : }
7730 :
7731 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo_getsetters[] = {
7732 : {
7733 : .name = discard_const_p(char, "info_ex"),
7734 : .get = py_lsa_TrustDomainInfoFullInfo_get_info_ex,
7735 : .set = py_lsa_TrustDomainInfoFullInfo_set_info_ex,
7736 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7737 : },
7738 : {
7739 : .name = discard_const_p(char, "posix_offset"),
7740 : .get = py_lsa_TrustDomainInfoFullInfo_get_posix_offset,
7741 : .set = py_lsa_TrustDomainInfoFullInfo_set_posix_offset,
7742 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7743 : },
7744 : {
7745 : .name = discard_const_p(char, "auth_info"),
7746 : .get = py_lsa_TrustDomainInfoFullInfo_get_auth_info,
7747 : .set = py_lsa_TrustDomainInfoFullInfo_set_auth_info,
7748 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
7749 : },
7750 : { .name = NULL }
7751 : };
7752 :
7753 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7754 : {
7755 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo, type);
7756 : }
7757 :
7758 :
7759 : static PyTypeObject lsa_TrustDomainInfoFullInfo_Type = {
7760 : PyVarObject_HEAD_INIT(NULL, 0)
7761 : .tp_name = "lsa.TrustDomainInfoFullInfo",
7762 : .tp_getset = py_lsa_TrustDomainInfoFullInfo_getsetters,
7763 : .tp_methods = NULL,
7764 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7765 : .tp_new = py_lsa_TrustDomainInfoFullInfo_new,
7766 : };
7767 :
7768 :
7769 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob(PyObject *obj, void *closure)
7770 : {
7771 0 : struct lsa_TrustDomainInfoAuthInfoInternal *object = pytalloc_get_ptr(obj);
7772 0 : PyObject *py_auth_blob;
7773 0 : py_auth_blob = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->auth_blob);
7774 0 : return py_auth_blob;
7775 : }
7776 :
7777 1 : static int py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob(PyObject *py_obj, PyObject *value, void *closure)
7778 : {
7779 1 : struct lsa_TrustDomainInfoAuthInfoInternal *object = pytalloc_get_ptr(py_obj);
7780 1 : if (value == NULL) {
7781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_blob");
7782 0 : return -1;
7783 : }
7784 1 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
7785 1 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7786 0 : PyErr_NoMemory();
7787 0 : return -1;
7788 : }
7789 1 : object->auth_blob = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
7790 1 : return 0;
7791 : }
7792 :
7793 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfoInternal_getsetters[] = {
7794 : {
7795 : .name = discard_const_p(char, "auth_blob"),
7796 : .get = py_lsa_TrustDomainInfoAuthInfoInternal_get_auth_blob,
7797 : .set = py_lsa_TrustDomainInfoAuthInfoInternal_set_auth_blob,
7798 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
7799 : },
7800 : { .name = NULL }
7801 : };
7802 :
7803 1 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7804 : {
7805 1 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternal, type);
7806 : }
7807 :
7808 :
7809 : static PyTypeObject lsa_TrustDomainInfoAuthInfoInternal_Type = {
7810 : PyVarObject_HEAD_INIT(NULL, 0)
7811 : .tp_name = "lsa.TrustDomainInfoAuthInfoInternal",
7812 : .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternal_getsetters,
7813 : .tp_methods = NULL,
7814 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7815 : .tp_new = py_lsa_TrustDomainInfoAuthInfoInternal_new,
7816 : };
7817 :
7818 :
7819 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex(PyObject *obj, void *closure)
7820 : {
7821 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(obj);
7822 0 : PyObject *py_info_ex;
7823 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
7824 0 : return py_info_ex;
7825 : }
7826 :
7827 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
7828 : {
7829 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(py_obj);
7830 0 : if (value == NULL) {
7831 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info_ex");
7832 0 : return -1;
7833 : }
7834 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
7835 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7836 0 : PyErr_NoMemory();
7837 0 : return -1;
7838 : }
7839 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
7840 0 : return 0;
7841 : }
7842 :
7843 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset(PyObject *obj, void *closure)
7844 : {
7845 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(obj);
7846 0 : PyObject *py_posix_offset;
7847 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
7848 0 : return py_posix_offset;
7849 : }
7850 :
7851 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
7852 : {
7853 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(py_obj);
7854 0 : if (value == NULL) {
7855 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->posix_offset");
7856 0 : return -1;
7857 : }
7858 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
7859 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7860 0 : PyErr_NoMemory();
7861 0 : return -1;
7862 : }
7863 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
7864 0 : return 0;
7865 : }
7866 :
7867 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info(PyObject *obj, void *closure)
7868 : {
7869 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(obj);
7870 0 : PyObject *py_auth_info;
7871 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
7872 0 : return py_auth_info;
7873 : }
7874 :
7875 0 : static int py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
7876 : {
7877 0 : struct lsa_TrustDomainInfoFullInfoInternal *object = pytalloc_get_ptr(py_obj);
7878 0 : if (value == NULL) {
7879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
7880 0 : return -1;
7881 : }
7882 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
7883 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7884 0 : PyErr_NoMemory();
7885 0 : return -1;
7886 : }
7887 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
7888 0 : return 0;
7889 : }
7890 :
7891 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfoInternal_getsetters[] = {
7892 : {
7893 : .name = discard_const_p(char, "info_ex"),
7894 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_info_ex,
7895 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_info_ex,
7896 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
7897 : },
7898 : {
7899 : .name = discard_const_p(char, "posix_offset"),
7900 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_posix_offset,
7901 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_posix_offset,
7902 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
7903 : },
7904 : {
7905 : .name = discard_const_p(char, "auth_info"),
7906 : .get = py_lsa_TrustDomainInfoFullInfoInternal_get_auth_info,
7907 : .set = py_lsa_TrustDomainInfoFullInfoInternal_set_auth_info,
7908 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
7909 : },
7910 : { .name = NULL }
7911 : };
7912 :
7913 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7914 : {
7915 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternal, type);
7916 : }
7917 :
7918 :
7919 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternal_Type = {
7920 : PyVarObject_HEAD_INIT(NULL, 0)
7921 : .tp_name = "lsa.TrustDomainInfoFullInfoInternal",
7922 : .tp_getset = py_lsa_TrustDomainInfoFullInfoInternal_getsetters,
7923 : .tp_methods = NULL,
7924 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7925 : .tp_new = py_lsa_TrustDomainInfoFullInfoInternal_new,
7926 : };
7927 :
7928 :
7929 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternalAES_get_auth_data(PyObject *obj, void *closure)
7930 : {
7931 0 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(obj);
7932 0 : PyObject *py_auth_data;
7933 0 : py_auth_data = PyList_New(64);
7934 0 : if (py_auth_data == NULL) {
7935 0 : return NULL;
7936 : }
7937 : {
7938 : int auth_data_cntr_0;
7939 0 : for (auth_data_cntr_0 = 0; auth_data_cntr_0 < (64); auth_data_cntr_0++) {
7940 0 : PyObject *py_auth_data_0;
7941 0 : py_auth_data_0 = PyLong_FromLong((uint16_t)((object->auth_data)[auth_data_cntr_0]));
7942 0 : PyList_SetItem(py_auth_data, auth_data_cntr_0, py_auth_data_0);
7943 : }
7944 : }
7945 0 : return py_auth_data;
7946 : }
7947 :
7948 23 : static int py_lsa_TrustDomainInfoAuthInfoInternalAES_set_auth_data(PyObject *py_obj, PyObject *value, void *closure)
7949 : {
7950 23 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(py_obj);
7951 23 : if (value == NULL) {
7952 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_data");
7953 0 : return -1;
7954 : }
7955 23 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7956 : {
7957 0 : int auth_data_cntr_0;
7958 23 : if (ARRAY_SIZE(object->auth_data) != PyList_GET_SIZE(value)) {
7959 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->auth_data), PyList_GET_SIZE(value));
7960 0 : return -1;
7961 : }
7962 1495 : for (auth_data_cntr_0 = 0; auth_data_cntr_0 < PyList_GET_SIZE(value); auth_data_cntr_0++) {
7963 1472 : if (PyList_GET_ITEM(value, auth_data_cntr_0) == NULL) {
7964 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->auth_data)[auth_data_cntr_0]");
7965 0 : return -1;
7966 : }
7967 : {
7968 1472 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->auth_data)[auth_data_cntr_0]));
7969 1472 : if (PyLong_Check(PyList_GET_ITEM(value, auth_data_cntr_0))) {
7970 0 : unsigned long long test_var;
7971 1472 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, auth_data_cntr_0));
7972 1472 : if (PyErr_Occurred() != NULL) {
7973 0 : return -1;
7974 : }
7975 1472 : if (test_var > uint_max) {
7976 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7977 : PyLong_Type.tp_name, uint_max, test_var);
7978 0 : return -1;
7979 : }
7980 1472 : (object->auth_data)[auth_data_cntr_0] = test_var;
7981 : } else {
7982 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7983 : PyLong_Type.tp_name);
7984 0 : return -1;
7985 : }
7986 : }
7987 : }
7988 : }
7989 23 : return 0;
7990 : }
7991 :
7992 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternalAES_get_salt(PyObject *obj, void *closure)
7993 : {
7994 0 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(obj);
7995 0 : PyObject *py_salt;
7996 0 : py_salt = PyList_New(16);
7997 0 : if (py_salt == NULL) {
7998 0 : return NULL;
7999 : }
8000 : {
8001 : int salt_cntr_0;
8002 0 : for (salt_cntr_0 = 0; salt_cntr_0 < (16); salt_cntr_0++) {
8003 0 : PyObject *py_salt_0;
8004 0 : py_salt_0 = PyLong_FromLong((uint16_t)((object->salt)[salt_cntr_0]));
8005 0 : PyList_SetItem(py_salt, salt_cntr_0, py_salt_0);
8006 : }
8007 : }
8008 0 : return py_salt;
8009 : }
8010 :
8011 23 : static int py_lsa_TrustDomainInfoAuthInfoInternalAES_set_salt(PyObject *py_obj, PyObject *value, void *closure)
8012 : {
8013 23 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(py_obj);
8014 23 : if (value == NULL) {
8015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->salt");
8016 0 : return -1;
8017 : }
8018 23 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8019 : {
8020 0 : int salt_cntr_0;
8021 23 : if (ARRAY_SIZE(object->salt) != PyList_GET_SIZE(value)) {
8022 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->salt), PyList_GET_SIZE(value));
8023 0 : return -1;
8024 : }
8025 391 : for (salt_cntr_0 = 0; salt_cntr_0 < PyList_GET_SIZE(value); salt_cntr_0++) {
8026 368 : if (PyList_GET_ITEM(value, salt_cntr_0) == NULL) {
8027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->salt)[salt_cntr_0]");
8028 0 : return -1;
8029 : }
8030 : {
8031 368 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->salt)[salt_cntr_0]));
8032 368 : if (PyLong_Check(PyList_GET_ITEM(value, salt_cntr_0))) {
8033 0 : unsigned long long test_var;
8034 368 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, salt_cntr_0));
8035 368 : if (PyErr_Occurred() != NULL) {
8036 0 : return -1;
8037 : }
8038 368 : if (test_var > uint_max) {
8039 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8040 : PyLong_Type.tp_name, uint_max, test_var);
8041 0 : return -1;
8042 : }
8043 368 : (object->salt)[salt_cntr_0] = test_var;
8044 : } else {
8045 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8046 : PyLong_Type.tp_name);
8047 0 : return -1;
8048 : }
8049 : }
8050 : }
8051 : }
8052 23 : return 0;
8053 : }
8054 :
8055 0 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternalAES_get_cipher(PyObject *obj, void *closure)
8056 : {
8057 0 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(obj);
8058 0 : PyObject *py_cipher;
8059 0 : py_cipher = pytalloc_reference_ex(&lsa_DATA_BUF2_Type, pytalloc_get_mem_ctx(obj), &object->cipher);
8060 0 : return py_cipher;
8061 : }
8062 :
8063 23 : static int py_lsa_TrustDomainInfoAuthInfoInternalAES_set_cipher(PyObject *py_obj, PyObject *value, void *closure)
8064 : {
8065 23 : struct lsa_TrustDomainInfoAuthInfoInternalAES *object = pytalloc_get_ptr(py_obj);
8066 23 : if (value == NULL) {
8067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cipher");
8068 0 : return -1;
8069 : }
8070 23 : PY_CHECK_TYPE(&lsa_DATA_BUF2_Type, value, return -1;);
8071 23 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8072 0 : PyErr_NoMemory();
8073 0 : return -1;
8074 : }
8075 23 : object->cipher = *(struct lsa_DATA_BUF2 *)pytalloc_get_ptr(value);
8076 23 : return 0;
8077 : }
8078 :
8079 : static PyGetSetDef py_lsa_TrustDomainInfoAuthInfoInternalAES_getsetters[] = {
8080 : {
8081 : .name = discard_const_p(char, "auth_data"),
8082 : .get = py_lsa_TrustDomainInfoAuthInfoInternalAES_get_auth_data,
8083 : .set = py_lsa_TrustDomainInfoAuthInfoInternalAES_set_auth_data,
8084 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8085 : },
8086 : {
8087 : .name = discard_const_p(char, "salt"),
8088 : .get = py_lsa_TrustDomainInfoAuthInfoInternalAES_get_salt,
8089 : .set = py_lsa_TrustDomainInfoAuthInfoInternalAES_set_salt,
8090 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8091 : },
8092 : {
8093 : .name = discard_const_p(char, "cipher"),
8094 : .get = py_lsa_TrustDomainInfoAuthInfoInternalAES_get_cipher,
8095 : .set = py_lsa_TrustDomainInfoAuthInfoInternalAES_set_cipher,
8096 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF2")
8097 : },
8098 : { .name = NULL }
8099 : };
8100 :
8101 23 : static PyObject *py_lsa_TrustDomainInfoAuthInfoInternalAES_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8102 : {
8103 23 : return pytalloc_new(struct lsa_TrustDomainInfoAuthInfoInternalAES, type);
8104 : }
8105 :
8106 :
8107 : static PyTypeObject lsa_TrustDomainInfoAuthInfoInternalAES_Type = {
8108 : PyVarObject_HEAD_INIT(NULL, 0)
8109 : .tp_name = "lsa.TrustDomainInfoAuthInfoInternalAES",
8110 : .tp_getset = py_lsa_TrustDomainInfoAuthInfoInternalAES_getsetters,
8111 : .tp_methods = NULL,
8112 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8113 : .tp_new = py_lsa_TrustDomainInfoAuthInfoInternalAES_new,
8114 : };
8115 :
8116 :
8117 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternalAES_get_info_ex(PyObject *obj, void *closure)
8118 : {
8119 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(obj);
8120 0 : PyObject *py_info_ex;
8121 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
8122 0 : return py_info_ex;
8123 : }
8124 :
8125 0 : static int py_lsa_TrustDomainInfoFullInfoInternalAES_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
8126 : {
8127 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(py_obj);
8128 0 : if (value == NULL) {
8129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info_ex");
8130 0 : return -1;
8131 : }
8132 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_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->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
8138 0 : return 0;
8139 : }
8140 :
8141 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternalAES_get_posix_offset(PyObject *obj, void *closure)
8142 : {
8143 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(obj);
8144 0 : PyObject *py_posix_offset;
8145 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
8146 0 : return py_posix_offset;
8147 : }
8148 :
8149 0 : static int py_lsa_TrustDomainInfoFullInfoInternalAES_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
8150 : {
8151 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(py_obj);
8152 0 : if (value == NULL) {
8153 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->posix_offset");
8154 0 : return -1;
8155 : }
8156 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_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->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
8162 0 : return 0;
8163 : }
8164 :
8165 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternalAES_get_auth_info(PyObject *obj, void *closure)
8166 : {
8167 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(obj);
8168 0 : PyObject *py_auth_info;
8169 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
8170 0 : return py_auth_info;
8171 : }
8172 :
8173 0 : static int py_lsa_TrustDomainInfoFullInfoInternalAES_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
8174 : {
8175 0 : struct lsa_TrustDomainInfoFullInfoInternalAES *object = pytalloc_get_ptr(py_obj);
8176 0 : if (value == NULL) {
8177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
8178 0 : return -1;
8179 : }
8180 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, value, return -1;);
8181 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8182 0 : PyErr_NoMemory();
8183 0 : return -1;
8184 : }
8185 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfoInternalAES *)pytalloc_get_ptr(value);
8186 0 : return 0;
8187 : }
8188 :
8189 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfoInternalAES_getsetters[] = {
8190 : {
8191 : .name = discard_const_p(char, "info_ex"),
8192 : .get = py_lsa_TrustDomainInfoFullInfoInternalAES_get_info_ex,
8193 : .set = py_lsa_TrustDomainInfoFullInfoInternalAES_set_info_ex,
8194 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8195 : },
8196 : {
8197 : .name = discard_const_p(char, "posix_offset"),
8198 : .get = py_lsa_TrustDomainInfoFullInfoInternalAES_get_posix_offset,
8199 : .set = py_lsa_TrustDomainInfoFullInfoInternalAES_set_posix_offset,
8200 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
8201 : },
8202 : {
8203 : .name = discard_const_p(char, "auth_info"),
8204 : .get = py_lsa_TrustDomainInfoFullInfoInternalAES_get_auth_info,
8205 : .set = py_lsa_TrustDomainInfoFullInfoInternalAES_set_auth_info,
8206 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternalAES")
8207 : },
8208 : { .name = NULL }
8209 : };
8210 :
8211 0 : static PyObject *py_lsa_TrustDomainInfoFullInfoInternalAES_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8212 : {
8213 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfoInternalAES, type);
8214 : }
8215 :
8216 :
8217 : static PyTypeObject lsa_TrustDomainInfoFullInfoInternalAES_Type = {
8218 : PyVarObject_HEAD_INIT(NULL, 0)
8219 : .tp_name = "lsa.TrustDomainInfoFullInfoInternalAES",
8220 : .tp_getset = py_lsa_TrustDomainInfoFullInfoInternalAES_getsetters,
8221 : .tp_methods = NULL,
8222 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8223 : .tp_new = py_lsa_TrustDomainInfoFullInfoInternalAES_new,
8224 : };
8225 :
8226 :
8227 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex(PyObject *obj, void *closure)
8228 : {
8229 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(obj);
8230 0 : PyObject *py_info_ex;
8231 0 : py_info_ex = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, pytalloc_get_mem_ctx(obj), &object->info_ex);
8232 0 : return py_info_ex;
8233 : }
8234 :
8235 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex(PyObject *py_obj, PyObject *value, void *closure)
8236 : {
8237 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(py_obj);
8238 0 : if (value == NULL) {
8239 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info_ex");
8240 0 : return -1;
8241 : }
8242 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
8243 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8244 0 : PyErr_NoMemory();
8245 0 : return -1;
8246 : }
8247 0 : object->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
8248 0 : return 0;
8249 : }
8250 :
8251 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length(PyObject *obj, void *closure)
8252 : {
8253 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(obj);
8254 0 : PyObject *py_forest_trust_length;
8255 0 : py_forest_trust_length = PyLong_FromUnsignedLongLong((uint32_t)(object->forest_trust_length));
8256 0 : return py_forest_trust_length;
8257 : }
8258 :
8259 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length(PyObject *py_obj, PyObject *value, void *closure)
8260 : {
8261 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(py_obj);
8262 0 : if (value == NULL) {
8263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest_trust_length");
8264 0 : return -1;
8265 : }
8266 : {
8267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->forest_trust_length));
8268 0 : if (PyLong_Check(value)) {
8269 0 : unsigned long long test_var;
8270 0 : test_var = PyLong_AsUnsignedLongLong(value);
8271 0 : if (PyErr_Occurred() != NULL) {
8272 0 : return -1;
8273 : }
8274 0 : if (test_var > uint_max) {
8275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8276 : PyLong_Type.tp_name, uint_max, test_var);
8277 0 : return -1;
8278 : }
8279 0 : object->forest_trust_length = test_var;
8280 : } else {
8281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8282 : PyLong_Type.tp_name);
8283 0 : return -1;
8284 : }
8285 : }
8286 0 : return 0;
8287 : }
8288 :
8289 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data(PyObject *obj, void *closure)
8290 : {
8291 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(obj);
8292 0 : PyObject *py_forest_trust_data;
8293 0 : if (object->forest_trust_data == NULL) {
8294 0 : Py_RETURN_NONE;
8295 : }
8296 0 : if (object->forest_trust_data == NULL) {
8297 0 : py_forest_trust_data = Py_None;
8298 0 : Py_INCREF(py_forest_trust_data);
8299 : } else {
8300 0 : py_forest_trust_data = PyList_New(object->forest_trust_length);
8301 0 : if (py_forest_trust_data == NULL) {
8302 0 : return NULL;
8303 : }
8304 : {
8305 : int forest_trust_data_cntr_1;
8306 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < (object->forest_trust_length); forest_trust_data_cntr_1++) {
8307 0 : PyObject *py_forest_trust_data_1;
8308 0 : py_forest_trust_data_1 = PyLong_FromLong((uint16_t)((object->forest_trust_data)[forest_trust_data_cntr_1]));
8309 0 : PyList_SetItem(py_forest_trust_data, forest_trust_data_cntr_1, py_forest_trust_data_1);
8310 : }
8311 : }
8312 : }
8313 0 : return py_forest_trust_data;
8314 : }
8315 :
8316 0 : static int py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
8317 : {
8318 0 : struct lsa_TrustDomainInfoInfoEx2Internal *object = pytalloc_get_ptr(py_obj);
8319 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->forest_trust_data));
8320 0 : if (value == NULL) {
8321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest_trust_data");
8322 0 : return -1;
8323 : }
8324 0 : if (value == Py_None) {
8325 0 : object->forest_trust_data = NULL;
8326 : } else {
8327 0 : object->forest_trust_data = NULL;
8328 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8329 : {
8330 0 : int forest_trust_data_cntr_1;
8331 0 : object->forest_trust_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->forest_trust_data, PyList_GET_SIZE(value));
8332 0 : if (!object->forest_trust_data) { return -1; }
8333 0 : talloc_set_name_const(object->forest_trust_data, "ARRAY: object->forest_trust_data");
8334 0 : for (forest_trust_data_cntr_1 = 0; forest_trust_data_cntr_1 < PyList_GET_SIZE(value); forest_trust_data_cntr_1++) {
8335 0 : if (PyList_GET_ITEM(value, forest_trust_data_cntr_1) == NULL) {
8336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->forest_trust_data)[forest_trust_data_cntr_1]");
8337 0 : return -1;
8338 : }
8339 : {
8340 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->forest_trust_data)[forest_trust_data_cntr_1]));
8341 0 : if (PyLong_Check(PyList_GET_ITEM(value, forest_trust_data_cntr_1))) {
8342 0 : unsigned long long test_var;
8343 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, forest_trust_data_cntr_1));
8344 0 : if (PyErr_Occurred() != NULL) {
8345 0 : return -1;
8346 : }
8347 0 : if (test_var > uint_max) {
8348 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8349 : PyLong_Type.tp_name, uint_max, test_var);
8350 0 : return -1;
8351 : }
8352 0 : (object->forest_trust_data)[forest_trust_data_cntr_1] = test_var;
8353 : } else {
8354 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8355 : PyLong_Type.tp_name);
8356 0 : return -1;
8357 : }
8358 : }
8359 : }
8360 : }
8361 : }
8362 0 : return 0;
8363 : }
8364 :
8365 : static PyGetSetDef py_lsa_TrustDomainInfoInfoEx2Internal_getsetters[] = {
8366 : {
8367 : .name = discard_const_p(char, "info_ex"),
8368 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_info_ex,
8369 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_info_ex,
8370 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
8371 : },
8372 : {
8373 : .name = discard_const_p(char, "forest_trust_length"),
8374 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_length,
8375 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_length,
8376 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8377 : },
8378 : {
8379 : .name = discard_const_p(char, "forest_trust_data"),
8380 : .get = py_lsa_TrustDomainInfoInfoEx2Internal_get_forest_trust_data,
8381 : .set = py_lsa_TrustDomainInfoInfoEx2Internal_set_forest_trust_data,
8382 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8383 : },
8384 : { .name = NULL }
8385 : };
8386 :
8387 0 : static PyObject *py_lsa_TrustDomainInfoInfoEx2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8388 : {
8389 0 : return pytalloc_new(struct lsa_TrustDomainInfoInfoEx2Internal, type);
8390 : }
8391 :
8392 :
8393 : static PyTypeObject lsa_TrustDomainInfoInfoEx2Internal_Type = {
8394 : PyVarObject_HEAD_INIT(NULL, 0)
8395 : .tp_name = "lsa.TrustDomainInfoInfoEx2Internal",
8396 : .tp_getset = py_lsa_TrustDomainInfoInfoEx2Internal_getsetters,
8397 : .tp_methods = NULL,
8398 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8399 : .tp_new = py_lsa_TrustDomainInfoInfoEx2Internal_new,
8400 : };
8401 :
8402 :
8403 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_info(PyObject *obj, void *closure)
8404 : {
8405 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(obj);
8406 0 : PyObject *py_info;
8407 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, pytalloc_get_mem_ctx(obj), &object->info);
8408 0 : return py_info;
8409 : }
8410 :
8411 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_info(PyObject *py_obj, PyObject *value, void *closure)
8412 : {
8413 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(py_obj);
8414 0 : if (value == NULL) {
8415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
8416 0 : return -1;
8417 : }
8418 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, value, return -1;);
8419 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8420 0 : PyErr_NoMemory();
8421 0 : return -1;
8422 : }
8423 0 : object->info = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(value);
8424 0 : return 0;
8425 : }
8426 :
8427 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset(PyObject *obj, void *closure)
8428 : {
8429 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(obj);
8430 0 : PyObject *py_posix_offset;
8431 0 : py_posix_offset = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, pytalloc_get_mem_ctx(obj), &object->posix_offset);
8432 0 : return py_posix_offset;
8433 : }
8434 :
8435 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset(PyObject *py_obj, PyObject *value, void *closure)
8436 : {
8437 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(py_obj);
8438 0 : if (value == NULL) {
8439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->posix_offset");
8440 0 : return -1;
8441 : }
8442 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, value, return -1;);
8443 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8444 0 : PyErr_NoMemory();
8445 0 : return -1;
8446 : }
8447 0 : object->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(value);
8448 0 : return 0;
8449 : }
8450 :
8451 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info(PyObject *obj, void *closure)
8452 : {
8453 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(obj);
8454 0 : PyObject *py_auth_info;
8455 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, pytalloc_get_mem_ctx(obj), &object->auth_info);
8456 0 : return py_auth_info;
8457 : }
8458 :
8459 0 : static int py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
8460 : {
8461 0 : struct lsa_TrustDomainInfoFullInfo2Internal *object = pytalloc_get_ptr(py_obj);
8462 0 : if (value == NULL) {
8463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->auth_info");
8464 0 : return -1;
8465 : }
8466 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
8467 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8468 0 : PyErr_NoMemory();
8469 0 : return -1;
8470 : }
8471 0 : object->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
8472 0 : return 0;
8473 : }
8474 :
8475 : static PyGetSetDef py_lsa_TrustDomainInfoFullInfo2Internal_getsetters[] = {
8476 : {
8477 : .name = discard_const_p(char, "info"),
8478 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_info,
8479 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_info,
8480 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx2Internal")
8481 : },
8482 : {
8483 : .name = discard_const_p(char, "posix_offset"),
8484 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_posix_offset,
8485 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_posix_offset,
8486 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoPosixOffset")
8487 : },
8488 : {
8489 : .name = discard_const_p(char, "auth_info"),
8490 : .get = py_lsa_TrustDomainInfoFullInfo2Internal_get_auth_info,
8491 : .set = py_lsa_TrustDomainInfoFullInfo2Internal_set_auth_info,
8492 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
8493 : },
8494 : { .name = NULL }
8495 : };
8496 :
8497 0 : static PyObject *py_lsa_TrustDomainInfoFullInfo2Internal_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8498 : {
8499 0 : return pytalloc_new(struct lsa_TrustDomainInfoFullInfo2Internal, type);
8500 : }
8501 :
8502 :
8503 : static PyTypeObject lsa_TrustDomainInfoFullInfo2Internal_Type = {
8504 : PyVarObject_HEAD_INIT(NULL, 0)
8505 : .tp_name = "lsa.TrustDomainInfoFullInfo2Internal",
8506 : .tp_getset = py_lsa_TrustDomainInfoFullInfo2Internal_getsetters,
8507 : .tp_methods = NULL,
8508 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8509 : .tp_new = py_lsa_TrustDomainInfoFullInfo2Internal_new,
8510 : };
8511 :
8512 :
8513 28 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types(PyObject *obj, void *closure)
8514 : {
8515 28 : struct lsa_TrustDomainInfoSupportedEncTypes *object = pytalloc_get_ptr(obj);
8516 0 : PyObject *py_enc_types;
8517 28 : py_enc_types = PyLong_FromUnsignedLongLong((uint32_t)(object->enc_types));
8518 28 : return py_enc_types;
8519 : }
8520 :
8521 15 : static int py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types(PyObject *py_obj, PyObject *value, void *closure)
8522 : {
8523 15 : struct lsa_TrustDomainInfoSupportedEncTypes *object = pytalloc_get_ptr(py_obj);
8524 15 : if (value == NULL) {
8525 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->enc_types");
8526 0 : return -1;
8527 : }
8528 : {
8529 15 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enc_types));
8530 15 : if (PyLong_Check(value)) {
8531 0 : unsigned long long test_var;
8532 15 : test_var = PyLong_AsUnsignedLongLong(value);
8533 15 : if (PyErr_Occurred() != NULL) {
8534 0 : return -1;
8535 : }
8536 15 : if (test_var > uint_max) {
8537 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8538 : PyLong_Type.tp_name, uint_max, test_var);
8539 0 : return -1;
8540 : }
8541 15 : object->enc_types = test_var;
8542 : } else {
8543 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8544 : PyLong_Type.tp_name);
8545 0 : return -1;
8546 : }
8547 : }
8548 15 : return 0;
8549 : }
8550 :
8551 : static PyGetSetDef py_lsa_TrustDomainInfoSupportedEncTypes_getsetters[] = {
8552 : {
8553 : .name = discard_const_p(char, "enc_types"),
8554 : .get = py_lsa_TrustDomainInfoSupportedEncTypes_get_enc_types,
8555 : .set = py_lsa_TrustDomainInfoSupportedEncTypes_set_enc_types,
8556 : .doc = discard_const_p(char, "PIDL-generated element of base type kerb_EncTypes")
8557 : },
8558 : { .name = NULL }
8559 : };
8560 :
8561 11 : static PyObject *py_lsa_TrustDomainInfoSupportedEncTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8562 : {
8563 11 : return pytalloc_new(struct lsa_TrustDomainInfoSupportedEncTypes, type);
8564 : }
8565 :
8566 :
8567 : static PyTypeObject lsa_TrustDomainInfoSupportedEncTypes_Type = {
8568 : PyVarObject_HEAD_INIT(NULL, 0)
8569 : .tp_name = "lsa.TrustDomainInfoSupportedEncTypes",
8570 : .tp_getset = py_lsa_TrustDomainInfoSupportedEncTypes_getsetters,
8571 : .tp_methods = NULL,
8572 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8573 : .tp_new = py_lsa_TrustDomainInfoSupportedEncTypes_new,
8574 : };
8575 :
8576 144 : static PyObject *py_import_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, union lsa_TrustedDomainInfo *in)
8577 : {
8578 0 : PyObject *ret;
8579 :
8580 144 : switch (level) {
8581 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8582 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoName_Type, mem_ctx, &in->name);
8583 0 : return ret;
8584 :
8585 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8586 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoControllers_Type, mem_ctx, &in->controllers);
8587 0 : return ret;
8588 :
8589 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8590 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPosixOffset_Type, mem_ctx, &in->posix_offset);
8591 0 : return ret;
8592 :
8593 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8594 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoPassword_Type, mem_ctx, &in->password);
8595 0 : return ret;
8596 :
8597 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8598 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoBasic_Type, mem_ctx, &in->info_basic);
8599 0 : return ret;
8600 :
8601 96 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8602 96 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, mem_ctx, &in->info_ex);
8603 96 : return ret;
8604 :
8605 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8606 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, mem_ctx, &in->auth_info);
8607 0 : return ret;
8608 :
8609 24 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8610 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo_Type, mem_ctx, &in->full_info);
8611 24 : return ret;
8612 :
8613 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8614 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, mem_ctx, &in->auth_info_internal);
8615 0 : return ret;
8616 :
8617 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8618 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternal_Type, mem_ctx, &in->full_info_internal);
8619 0 : return ret;
8620 :
8621 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8622 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx2Internal_Type, mem_ctx, &in->info_ex2_internal);
8623 0 : return ret;
8624 :
8625 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8626 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfo2Internal_Type, mem_ctx, &in->full_info2_internal);
8627 0 : return ret;
8628 :
8629 24 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8630 24 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoSupportedEncTypes_Type, mem_ctx, &in->enc_types);
8631 24 : return ret;
8632 :
8633 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL_AES:
8634 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, mem_ctx, &in->auth_info_internal_aes);
8635 0 : return ret;
8636 :
8637 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL_AES:
8638 0 : ret = pytalloc_reference_ex(&lsa_TrustDomainInfoFullInfoInternalAES_Type, mem_ctx, &in->full_info_internal_aes);
8639 0 : return ret;
8640 :
8641 : }
8642 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
8643 0 : return NULL;
8644 : }
8645 :
8646 22 : static union lsa_TrustedDomainInfo *py_export_lsa_TrustedDomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
8647 : {
8648 22 : union lsa_TrustedDomainInfo *ret = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
8649 22 : switch (level) {
8650 0 : case LSA_TRUSTED_DOMAIN_INFO_NAME:
8651 0 : if (in == NULL) {
8652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->name");
8653 0 : talloc_free(ret); return NULL;
8654 : }
8655 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoName_Type, in, talloc_free(ret); return NULL;);
8656 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8657 0 : PyErr_NoMemory();
8658 0 : talloc_free(ret); return NULL;
8659 : }
8660 0 : ret->name = *(struct lsa_TrustDomainInfoName *)pytalloc_get_ptr(in);
8661 0 : break;
8662 :
8663 0 : case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
8664 0 : if (in == NULL) {
8665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->controllers");
8666 0 : talloc_free(ret); return NULL;
8667 : }
8668 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoControllers_Type, in, talloc_free(ret); return NULL;);
8669 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8670 0 : PyErr_NoMemory();
8671 0 : talloc_free(ret); return NULL;
8672 : }
8673 0 : ret->controllers = *(struct lsa_TrustDomainInfoControllers *)pytalloc_get_ptr(in);
8674 0 : break;
8675 :
8676 0 : case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
8677 0 : if (in == NULL) {
8678 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->posix_offset");
8679 0 : talloc_free(ret); return NULL;
8680 : }
8681 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPosixOffset_Type, in, talloc_free(ret); return NULL;);
8682 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8683 0 : PyErr_NoMemory();
8684 0 : talloc_free(ret); return NULL;
8685 : }
8686 0 : ret->posix_offset = *(struct lsa_TrustDomainInfoPosixOffset *)pytalloc_get_ptr(in);
8687 0 : break;
8688 :
8689 0 : case LSA_TRUSTED_DOMAIN_INFO_PASSWORD:
8690 0 : if (in == NULL) {
8691 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->password");
8692 0 : talloc_free(ret); return NULL;
8693 : }
8694 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoPassword_Type, in, talloc_free(ret); return NULL;);
8695 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8696 0 : PyErr_NoMemory();
8697 0 : talloc_free(ret); return NULL;
8698 : }
8699 0 : ret->password = *(struct lsa_TrustDomainInfoPassword *)pytalloc_get_ptr(in);
8700 0 : break;
8701 :
8702 0 : case LSA_TRUSTED_DOMAIN_INFO_BASIC:
8703 0 : if (in == NULL) {
8704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info_basic");
8705 0 : talloc_free(ret); return NULL;
8706 : }
8707 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoBasic_Type, in, talloc_free(ret); return NULL;);
8708 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8709 0 : PyErr_NoMemory();
8710 0 : talloc_free(ret); return NULL;
8711 : }
8712 0 : ret->info_basic = *(struct lsa_TrustDomainInfoBasic *)pytalloc_get_ptr(in);
8713 0 : break;
8714 :
8715 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX:
8716 0 : if (in == NULL) {
8717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info_ex");
8718 0 : talloc_free(ret); return NULL;
8719 : }
8720 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, in, talloc_free(ret); return NULL;);
8721 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8722 0 : PyErr_NoMemory();
8723 0 : talloc_free(ret); return NULL;
8724 : }
8725 0 : ret->info_ex = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(in);
8726 0 : break;
8727 :
8728 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO:
8729 0 : if (in == NULL) {
8730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auth_info");
8731 0 : talloc_free(ret); return NULL;
8732 : }
8733 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, in, talloc_free(ret); return NULL;);
8734 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8735 0 : PyErr_NoMemory();
8736 0 : talloc_free(ret); return NULL;
8737 : }
8738 0 : ret->auth_info = *(struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(in);
8739 0 : break;
8740 :
8741 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
8742 0 : if (in == NULL) {
8743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->full_info");
8744 0 : talloc_free(ret); return NULL;
8745 : }
8746 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo_Type, in, talloc_free(ret); return NULL;);
8747 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8748 0 : PyErr_NoMemory();
8749 0 : talloc_free(ret); return NULL;
8750 : }
8751 0 : ret->full_info = *(struct lsa_TrustDomainInfoFullInfo *)pytalloc_get_ptr(in);
8752 0 : break;
8753 :
8754 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL:
8755 0 : if (in == NULL) {
8756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auth_info_internal");
8757 0 : talloc_free(ret); return NULL;
8758 : }
8759 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, in, talloc_free(ret); return NULL;);
8760 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8761 0 : PyErr_NoMemory();
8762 0 : talloc_free(ret); return NULL;
8763 : }
8764 0 : ret->auth_info_internal = *(struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(in);
8765 0 : break;
8766 :
8767 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL:
8768 0 : if (in == NULL) {
8769 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->full_info_internal");
8770 0 : talloc_free(ret); return NULL;
8771 : }
8772 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfoInternal_Type, in, talloc_free(ret); return NULL;);
8773 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8774 0 : PyErr_NoMemory();
8775 0 : talloc_free(ret); return NULL;
8776 : }
8777 0 : ret->full_info_internal = *(struct lsa_TrustDomainInfoFullInfoInternal *)pytalloc_get_ptr(in);
8778 0 : break;
8779 :
8780 0 : case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL:
8781 0 : if (in == NULL) {
8782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info_ex2_internal");
8783 0 : talloc_free(ret); return NULL;
8784 : }
8785 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx2Internal_Type, in, talloc_free(ret); return NULL;);
8786 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8787 0 : PyErr_NoMemory();
8788 0 : talloc_free(ret); return NULL;
8789 : }
8790 0 : ret->info_ex2_internal = *(struct lsa_TrustDomainInfoInfoEx2Internal *)pytalloc_get_ptr(in);
8791 0 : break;
8792 :
8793 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
8794 0 : if (in == NULL) {
8795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->full_info2_internal");
8796 0 : talloc_free(ret); return NULL;
8797 : }
8798 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfo2Internal_Type, in, talloc_free(ret); return NULL;);
8799 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8800 0 : PyErr_NoMemory();
8801 0 : talloc_free(ret); return NULL;
8802 : }
8803 0 : ret->full_info2_internal = *(struct lsa_TrustDomainInfoFullInfo2Internal *)pytalloc_get_ptr(in);
8804 0 : break;
8805 :
8806 22 : case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
8807 22 : if (in == NULL) {
8808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->enc_types");
8809 0 : talloc_free(ret); return NULL;
8810 : }
8811 22 : PY_CHECK_TYPE(&lsa_TrustDomainInfoSupportedEncTypes_Type, in, talloc_free(ret); return NULL;);
8812 22 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8813 0 : PyErr_NoMemory();
8814 0 : talloc_free(ret); return NULL;
8815 : }
8816 22 : ret->enc_types = *(struct lsa_TrustDomainInfoSupportedEncTypes *)pytalloc_get_ptr(in);
8817 22 : break;
8818 :
8819 0 : case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL_AES:
8820 0 : if (in == NULL) {
8821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->auth_info_internal_aes");
8822 0 : talloc_free(ret); return NULL;
8823 : }
8824 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, in, talloc_free(ret); return NULL;);
8825 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8826 0 : PyErr_NoMemory();
8827 0 : talloc_free(ret); return NULL;
8828 : }
8829 0 : ret->auth_info_internal_aes = *(struct lsa_TrustDomainInfoAuthInfoInternalAES *)pytalloc_get_ptr(in);
8830 0 : break;
8831 :
8832 0 : case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL_AES:
8833 0 : if (in == NULL) {
8834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->full_info_internal_aes");
8835 0 : talloc_free(ret); return NULL;
8836 : }
8837 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoFullInfoInternalAES_Type, in, talloc_free(ret); return NULL;);
8838 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
8839 0 : PyErr_NoMemory();
8840 0 : talloc_free(ret); return NULL;
8841 : }
8842 0 : ret->full_info_internal_aes = *(struct lsa_TrustDomainInfoFullInfoInternalAES *)pytalloc_get_ptr(in);
8843 0 : break;
8844 :
8845 0 : default:
8846 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
8847 0 : talloc_free(ret);
8848 0 : ret = NULL;
8849 : }
8850 :
8851 22 : return ret;
8852 : }
8853 :
8854 144 : static PyObject *py_lsa_TrustedDomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8855 : {
8856 144 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8857 144 : PyObject *mem_ctx_obj = NULL;
8858 144 : TALLOC_CTX *mem_ctx = NULL;
8859 144 : int level = 0;
8860 144 : PyObject *in_obj = NULL;
8861 144 : union lsa_TrustedDomainInfo *in = NULL;
8862 :
8863 144 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
8864 : discard_const_p(char *, kwnames),
8865 : &mem_ctx_obj,
8866 : &level,
8867 : &in_obj)) {
8868 0 : return NULL;
8869 : }
8870 144 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8871 144 : if (mem_ctx == NULL) {
8872 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8873 0 : return NULL;
8874 : }
8875 144 : in = (union lsa_TrustedDomainInfo *)pytalloc_get_ptr(in_obj);
8876 144 : if (in == NULL) {
8877 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_TrustedDomainInfo!");
8878 0 : return NULL;
8879 : }
8880 :
8881 144 : return py_import_lsa_TrustedDomainInfo(mem_ctx, level, in);
8882 : }
8883 :
8884 22 : static PyObject *py_lsa_TrustedDomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8885 : {
8886 22 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
8887 22 : PyObject *mem_ctx_obj = NULL;
8888 22 : TALLOC_CTX *mem_ctx = NULL;
8889 22 : int level = 0;
8890 22 : PyObject *in = NULL;
8891 22 : union lsa_TrustedDomainInfo *out = NULL;
8892 :
8893 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
8894 : discard_const_p(char *, kwnames),
8895 : &mem_ctx_obj,
8896 : &level,
8897 : &in)) {
8898 0 : return NULL;
8899 : }
8900 22 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
8901 22 : if (mem_ctx == NULL) {
8902 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
8903 0 : return NULL;
8904 : }
8905 :
8906 22 : out = py_export_lsa_TrustedDomainInfo(mem_ctx, level, in);
8907 22 : if (out == NULL) {
8908 0 : return NULL;
8909 : }
8910 :
8911 22 : return pytalloc_GenericObject_reference(out);
8912 : }
8913 :
8914 : static PyMethodDef py_lsa_TrustedDomainInfo_methods[] = {
8915 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_import),
8916 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8917 : "T.__import__(mem_ctx, level, in) => ret." },
8918 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_TrustedDomainInfo_export),
8919 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
8920 : "T.__export__(mem_ctx, level, in) => ret." },
8921 : { NULL, NULL, 0, NULL }
8922 : };
8923 :
8924 0 : static PyObject *py_lsa_TrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8925 : {
8926 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
8927 0 : return NULL;
8928 : }
8929 :
8930 :
8931 : static PyTypeObject lsa_TrustedDomainInfo_Type = {
8932 : PyVarObject_HEAD_INIT(NULL, 0)
8933 : .tp_name = "lsa.TrustedDomainInfo",
8934 : .tp_getset = NULL,
8935 : .tp_methods = py_lsa_TrustedDomainInfo_methods,
8936 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8937 : .tp_new = py_lsa_TrustedDomainInfo_new,
8938 : };
8939 :
8940 :
8941 0 : static PyObject *py_lsa_DATA_BUF_PTR_get_buf(PyObject *obj, void *closure)
8942 : {
8943 0 : struct lsa_DATA_BUF_PTR *object = pytalloc_get_ptr(obj);
8944 0 : PyObject *py_buf;
8945 0 : if (object->buf == NULL) {
8946 0 : Py_RETURN_NONE;
8947 : }
8948 0 : if (object->buf == NULL) {
8949 0 : py_buf = Py_None;
8950 0 : Py_INCREF(py_buf);
8951 : } else {
8952 0 : py_buf = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->buf, object->buf);
8953 : }
8954 0 : return py_buf;
8955 : }
8956 :
8957 0 : static int py_lsa_DATA_BUF_PTR_set_buf(PyObject *py_obj, PyObject *value, void *closure)
8958 : {
8959 0 : struct lsa_DATA_BUF_PTR *object = pytalloc_get_ptr(py_obj);
8960 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buf));
8961 0 : if (value == NULL) {
8962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->buf");
8963 0 : return -1;
8964 : }
8965 0 : if (value == Py_None) {
8966 0 : object->buf = NULL;
8967 : } else {
8968 0 : object->buf = NULL;
8969 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
8970 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8971 0 : PyErr_NoMemory();
8972 0 : return -1;
8973 : }
8974 0 : object->buf = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
8975 : }
8976 0 : return 0;
8977 : }
8978 :
8979 : static PyGetSetDef py_lsa_DATA_BUF_PTR_getsetters[] = {
8980 : {
8981 : .name = discard_const_p(char, "buf"),
8982 : .get = py_lsa_DATA_BUF_PTR_get_buf,
8983 : .set = py_lsa_DATA_BUF_PTR_set_buf,
8984 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
8985 : },
8986 : { .name = NULL }
8987 : };
8988 :
8989 0 : static PyObject *py_lsa_DATA_BUF_PTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8990 : {
8991 0 : return pytalloc_new(struct lsa_DATA_BUF_PTR, type);
8992 : }
8993 :
8994 :
8995 : static PyTypeObject lsa_DATA_BUF_PTR_Type = {
8996 : PyVarObject_HEAD_INIT(NULL, 0)
8997 : .tp_name = "lsa.DATA_BUF_PTR",
8998 : .tp_getset = py_lsa_DATA_BUF_PTR_getsetters,
8999 : .tp_methods = NULL,
9000 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9001 : .tp_new = py_lsa_DATA_BUF_PTR_new,
9002 : };
9003 :
9004 :
9005 0 : static PyObject *py_lsa_RightAttribute_get_name(PyObject *obj, void *closure)
9006 : {
9007 0 : struct lsa_RightAttribute *object = pytalloc_get_ptr(obj);
9008 0 : PyObject *py_name;
9009 0 : if (object->name == NULL) {
9010 0 : Py_RETURN_NONE;
9011 : }
9012 0 : if (object->name == NULL) {
9013 0 : py_name = Py_None;
9014 0 : Py_INCREF(py_name);
9015 : } else {
9016 0 : if (object->name == NULL) {
9017 0 : py_name = Py_None;
9018 0 : Py_INCREF(py_name);
9019 : } else {
9020 0 : py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
9021 : }
9022 : }
9023 0 : return py_name;
9024 : }
9025 :
9026 0 : static int py_lsa_RightAttribute_set_name(PyObject *py_obj, PyObject *value, void *closure)
9027 : {
9028 0 : struct lsa_RightAttribute *object = pytalloc_get_ptr(py_obj);
9029 0 : if (value == NULL) {
9030 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
9031 0 : return -1;
9032 : }
9033 0 : if (value == Py_None) {
9034 0 : object->name = NULL;
9035 : } else {
9036 0 : object->name = NULL;
9037 : {
9038 0 : const char *test_str;
9039 0 : const char *talloc_str;
9040 0 : PyObject *unicode = NULL;
9041 0 : if (PyUnicode_Check(value)) {
9042 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
9043 0 : if (unicode == NULL) {
9044 0 : return -1;
9045 : }
9046 0 : test_str = PyBytes_AS_STRING(unicode);
9047 0 : } else if (PyBytes_Check(value)) {
9048 0 : test_str = PyBytes_AS_STRING(value);
9049 : } else {
9050 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
9051 0 : return -1;
9052 : }
9053 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
9054 0 : if (unicode != NULL) {
9055 0 : Py_DECREF(unicode);
9056 : }
9057 0 : if (talloc_str == NULL) {
9058 0 : PyErr_NoMemory();
9059 0 : return -1;
9060 : }
9061 0 : object->name = talloc_str;
9062 : }
9063 : }
9064 0 : return 0;
9065 : }
9066 :
9067 : static PyGetSetDef py_lsa_RightAttribute_getsetters[] = {
9068 : {
9069 : .name = discard_const_p(char, "name"),
9070 : .get = py_lsa_RightAttribute_get_name,
9071 : .set = py_lsa_RightAttribute_set_name,
9072 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
9073 : },
9074 : { .name = NULL }
9075 : };
9076 :
9077 0 : static PyObject *py_lsa_RightAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9078 : {
9079 0 : return pytalloc_new(struct lsa_RightAttribute, type);
9080 : }
9081 :
9082 :
9083 : static PyTypeObject lsa_RightAttribute_Type = {
9084 : PyVarObject_HEAD_INIT(NULL, 0)
9085 : .tp_name = "lsa.RightAttribute",
9086 : .tp_getset = py_lsa_RightAttribute_getsetters,
9087 : .tp_methods = NULL,
9088 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9089 : .tp_new = py_lsa_RightAttribute_new,
9090 : };
9091 :
9092 :
9093 0 : static PyObject *py_lsa_RightSet_get_count(PyObject *obj, void *closure)
9094 : {
9095 0 : struct lsa_RightSet *object = pytalloc_get_ptr(obj);
9096 0 : PyObject *py_count;
9097 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
9098 0 : return py_count;
9099 : }
9100 :
9101 0 : static int py_lsa_RightSet_set_count(PyObject *py_obj, PyObject *value, void *closure)
9102 : {
9103 0 : struct lsa_RightSet *object = pytalloc_get_ptr(py_obj);
9104 0 : if (value == NULL) {
9105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
9106 0 : return -1;
9107 : }
9108 : {
9109 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9110 0 : if (PyLong_Check(value)) {
9111 0 : unsigned long long test_var;
9112 0 : test_var = PyLong_AsUnsignedLongLong(value);
9113 0 : if (PyErr_Occurred() != NULL) {
9114 0 : return -1;
9115 : }
9116 0 : if (test_var > uint_max) {
9117 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9118 : PyLong_Type.tp_name, uint_max, test_var);
9119 0 : return -1;
9120 : }
9121 0 : object->count = test_var;
9122 : } else {
9123 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9124 : PyLong_Type.tp_name);
9125 0 : return -1;
9126 : }
9127 : }
9128 0 : return 0;
9129 : }
9130 :
9131 0 : static PyObject *py_lsa_RightSet_get_names(PyObject *obj, void *closure)
9132 : {
9133 0 : struct lsa_RightSet *object = pytalloc_get_ptr(obj);
9134 0 : PyObject *py_names;
9135 0 : if (object->names == NULL) {
9136 0 : Py_RETURN_NONE;
9137 : }
9138 0 : if (object->names == NULL) {
9139 0 : py_names = Py_None;
9140 0 : Py_INCREF(py_names);
9141 : } else {
9142 0 : py_names = PyList_New(object->count);
9143 0 : if (py_names == NULL) {
9144 0 : return NULL;
9145 : }
9146 : {
9147 : int names_cntr_1;
9148 0 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
9149 0 : PyObject *py_names_1;
9150 0 : py_names_1 = pytalloc_reference_ex(&lsa_StringLarge_Type, object->names, &(object->names)[names_cntr_1]);
9151 0 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
9152 : }
9153 : }
9154 : }
9155 0 : return py_names;
9156 : }
9157 :
9158 0 : static int py_lsa_RightSet_set_names(PyObject *py_obj, PyObject *value, void *closure)
9159 : {
9160 0 : struct lsa_RightSet *object = pytalloc_get_ptr(py_obj);
9161 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
9162 0 : if (value == NULL) {
9163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
9164 0 : return -1;
9165 : }
9166 0 : if (value == Py_None) {
9167 0 : object->names = NULL;
9168 : } else {
9169 0 : object->names = NULL;
9170 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9171 : {
9172 0 : int names_cntr_1;
9173 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
9174 0 : if (!object->names) { return -1; }
9175 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
9176 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
9177 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
9178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_1]");
9179 0 : return -1;
9180 : }
9181 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
9182 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
9183 0 : PyErr_NoMemory();
9184 0 : return -1;
9185 : }
9186 0 : (object->names)[names_cntr_1] = *(struct lsa_StringLarge *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
9187 : }
9188 : }
9189 : }
9190 0 : return 0;
9191 : }
9192 :
9193 : static PyGetSetDef py_lsa_RightSet_getsetters[] = {
9194 : {
9195 : .name = discard_const_p(char, "count"),
9196 : .get = py_lsa_RightSet_get_count,
9197 : .set = py_lsa_RightSet_set_count,
9198 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9199 : },
9200 : {
9201 : .name = discard_const_p(char, "names"),
9202 : .get = py_lsa_RightSet_get_names,
9203 : .set = py_lsa_RightSet_set_names,
9204 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
9205 : },
9206 : { .name = NULL }
9207 : };
9208 :
9209 0 : static PyObject *py_lsa_RightSet_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9210 : {
9211 0 : return pytalloc_new(struct lsa_RightSet, type);
9212 : }
9213 :
9214 :
9215 : static PyTypeObject lsa_RightSet_Type = {
9216 : PyVarObject_HEAD_INIT(NULL, 0)
9217 : .tp_name = "lsa.RightSet",
9218 : .tp_getset = py_lsa_RightSet_getsetters,
9219 : .tp_methods = NULL,
9220 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9221 : .tp_new = py_lsa_RightSet_new,
9222 : };
9223 :
9224 :
9225 0 : static PyObject *py_lsa_DomainListEx_get_count(PyObject *obj, void *closure)
9226 : {
9227 0 : struct lsa_DomainListEx *object = pytalloc_get_ptr(obj);
9228 0 : PyObject *py_count;
9229 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
9230 0 : return py_count;
9231 : }
9232 :
9233 0 : static int py_lsa_DomainListEx_set_count(PyObject *py_obj, PyObject *value, void *closure)
9234 : {
9235 0 : struct lsa_DomainListEx *object = pytalloc_get_ptr(py_obj);
9236 0 : if (value == NULL) {
9237 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
9238 0 : return -1;
9239 : }
9240 : {
9241 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9242 0 : if (PyLong_Check(value)) {
9243 0 : unsigned long long test_var;
9244 0 : test_var = PyLong_AsUnsignedLongLong(value);
9245 0 : if (PyErr_Occurred() != NULL) {
9246 0 : return -1;
9247 : }
9248 0 : if (test_var > uint_max) {
9249 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9250 : PyLong_Type.tp_name, uint_max, test_var);
9251 0 : return -1;
9252 : }
9253 0 : object->count = test_var;
9254 : } else {
9255 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9256 : PyLong_Type.tp_name);
9257 0 : return -1;
9258 : }
9259 : }
9260 0 : return 0;
9261 : }
9262 :
9263 0 : static PyObject *py_lsa_DomainListEx_get_domains(PyObject *obj, void *closure)
9264 : {
9265 0 : struct lsa_DomainListEx *object = pytalloc_get_ptr(obj);
9266 0 : PyObject *py_domains;
9267 0 : if (object->domains == NULL) {
9268 0 : Py_RETURN_NONE;
9269 : }
9270 0 : if (object->domains == NULL) {
9271 0 : py_domains = Py_None;
9272 0 : Py_INCREF(py_domains);
9273 : } else {
9274 0 : py_domains = PyList_New(object->count);
9275 0 : if (py_domains == NULL) {
9276 0 : return NULL;
9277 : }
9278 : {
9279 : int domains_cntr_1;
9280 0 : for (domains_cntr_1 = 0; domains_cntr_1 < (object->count); domains_cntr_1++) {
9281 0 : PyObject *py_domains_1;
9282 0 : py_domains_1 = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->domains, &(object->domains)[domains_cntr_1]);
9283 0 : PyList_SetItem(py_domains, domains_cntr_1, py_domains_1);
9284 : }
9285 : }
9286 : }
9287 0 : return py_domains;
9288 : }
9289 :
9290 0 : static int py_lsa_DomainListEx_set_domains(PyObject *py_obj, PyObject *value, void *closure)
9291 : {
9292 0 : struct lsa_DomainListEx *object = pytalloc_get_ptr(py_obj);
9293 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domains));
9294 0 : if (value == NULL) {
9295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domains");
9296 0 : return -1;
9297 : }
9298 0 : if (value == Py_None) {
9299 0 : object->domains = NULL;
9300 : } else {
9301 0 : object->domains = NULL;
9302 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9303 : {
9304 0 : int domains_cntr_1;
9305 0 : object->domains = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->domains, PyList_GET_SIZE(value));
9306 0 : if (!object->domains) { return -1; }
9307 0 : talloc_set_name_const(object->domains, "ARRAY: object->domains");
9308 0 : for (domains_cntr_1 = 0; domains_cntr_1 < PyList_GET_SIZE(value); domains_cntr_1++) {
9309 0 : if (PyList_GET_ITEM(value, domains_cntr_1) == NULL) {
9310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->domains)[domains_cntr_1]");
9311 0 : return -1;
9312 : }
9313 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, PyList_GET_ITEM(value, domains_cntr_1), return -1;);
9314 0 : if (talloc_reference(object->domains, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, domains_cntr_1))) == NULL) {
9315 0 : PyErr_NoMemory();
9316 0 : return -1;
9317 : }
9318 0 : (object->domains)[domains_cntr_1] = *(struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(PyList_GET_ITEM(value, domains_cntr_1));
9319 : }
9320 : }
9321 : }
9322 0 : return 0;
9323 : }
9324 :
9325 : static PyGetSetDef py_lsa_DomainListEx_getsetters[] = {
9326 : {
9327 : .name = discard_const_p(char, "count"),
9328 : .get = py_lsa_DomainListEx_get_count,
9329 : .set = py_lsa_DomainListEx_set_count,
9330 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9331 : },
9332 : {
9333 : .name = discard_const_p(char, "domains"),
9334 : .get = py_lsa_DomainListEx_get_domains,
9335 : .set = py_lsa_DomainListEx_set_domains,
9336 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
9337 : },
9338 : { .name = NULL }
9339 : };
9340 :
9341 0 : static PyObject *py_lsa_DomainListEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9342 : {
9343 0 : return pytalloc_new(struct lsa_DomainListEx, type);
9344 : }
9345 :
9346 :
9347 : static PyTypeObject lsa_DomainListEx_Type = {
9348 : PyVarObject_HEAD_INIT(NULL, 0)
9349 : .tp_name = "lsa.DomainListEx",
9350 : .tp_getset = py_lsa_DomainListEx_getsetters,
9351 : .tp_methods = NULL,
9352 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9353 : .tp_new = py_lsa_DomainListEx_new,
9354 : };
9355 :
9356 :
9357 0 : static PyObject *py_lsa_DomainInfoQoS_get_quality_of_service(PyObject *obj, void *closure)
9358 : {
9359 0 : struct lsa_DomainInfoQoS *object = pytalloc_get_ptr(obj);
9360 0 : PyObject *py_quality_of_service;
9361 0 : py_quality_of_service = PyLong_FromUnsignedLongLong((uint32_t)(object->quality_of_service));
9362 0 : return py_quality_of_service;
9363 : }
9364 :
9365 0 : static int py_lsa_DomainInfoQoS_set_quality_of_service(PyObject *py_obj, PyObject *value, void *closure)
9366 : {
9367 0 : struct lsa_DomainInfoQoS *object = pytalloc_get_ptr(py_obj);
9368 0 : if (value == NULL) {
9369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->quality_of_service");
9370 0 : return -1;
9371 : }
9372 : {
9373 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->quality_of_service));
9374 0 : if (PyLong_Check(value)) {
9375 0 : unsigned long long test_var;
9376 0 : test_var = PyLong_AsUnsignedLongLong(value);
9377 0 : if (PyErr_Occurred() != NULL) {
9378 0 : return -1;
9379 : }
9380 0 : if (test_var > uint_max) {
9381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9382 : PyLong_Type.tp_name, uint_max, test_var);
9383 0 : return -1;
9384 : }
9385 0 : object->quality_of_service = test_var;
9386 : } else {
9387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9388 : PyLong_Type.tp_name);
9389 0 : return -1;
9390 : }
9391 : }
9392 0 : return 0;
9393 : }
9394 :
9395 : static PyGetSetDef py_lsa_DomainInfoQoS_getsetters[] = {
9396 : {
9397 : .name = discard_const_p(char, "quality_of_service"),
9398 : .get = py_lsa_DomainInfoQoS_get_quality_of_service,
9399 : .set = py_lsa_DomainInfoQoS_set_quality_of_service,
9400 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9401 : },
9402 : { .name = NULL }
9403 : };
9404 :
9405 0 : static PyObject *py_lsa_DomainInfoQoS_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9406 : {
9407 0 : return pytalloc_new(struct lsa_DomainInfoQoS, type);
9408 : }
9409 :
9410 :
9411 : static PyTypeObject lsa_DomainInfoQoS_Type = {
9412 : PyVarObject_HEAD_INIT(NULL, 0)
9413 : .tp_name = "lsa.DomainInfoQoS",
9414 : .tp_getset = py_lsa_DomainInfoQoS_getsetters,
9415 : .tp_methods = NULL,
9416 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9417 : .tp_new = py_lsa_DomainInfoQoS_new,
9418 : };
9419 :
9420 :
9421 0 : static PyObject *py_lsa_DomainInfoKerberos_get_authentication_options(PyObject *obj, void *closure)
9422 : {
9423 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9424 0 : PyObject *py_authentication_options;
9425 0 : py_authentication_options = PyLong_FromUnsignedLongLong((uint32_t)(object->authentication_options));
9426 0 : return py_authentication_options;
9427 : }
9428 :
9429 0 : static int py_lsa_DomainInfoKerberos_set_authentication_options(PyObject *py_obj, PyObject *value, void *closure)
9430 : {
9431 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9432 0 : if (value == NULL) {
9433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->authentication_options");
9434 0 : return -1;
9435 : }
9436 : {
9437 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->authentication_options));
9438 0 : if (PyLong_Check(value)) {
9439 0 : unsigned long long test_var;
9440 0 : test_var = PyLong_AsUnsignedLongLong(value);
9441 0 : if (PyErr_Occurred() != NULL) {
9442 0 : return -1;
9443 : }
9444 0 : if (test_var > uint_max) {
9445 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9446 : PyLong_Type.tp_name, uint_max, test_var);
9447 0 : return -1;
9448 : }
9449 0 : object->authentication_options = test_var;
9450 : } else {
9451 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9452 : PyLong_Type.tp_name);
9453 0 : return -1;
9454 : }
9455 : }
9456 0 : return 0;
9457 : }
9458 :
9459 0 : static PyObject *py_lsa_DomainInfoKerberos_get_service_tkt_lifetime(PyObject *obj, void *closure)
9460 : {
9461 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9462 0 : PyObject *py_service_tkt_lifetime;
9463 0 : py_service_tkt_lifetime = PyLong_FromUnsignedLongLong(object->service_tkt_lifetime);
9464 0 : return py_service_tkt_lifetime;
9465 : }
9466 :
9467 0 : static int py_lsa_DomainInfoKerberos_set_service_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9468 : {
9469 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9470 0 : if (value == NULL) {
9471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->service_tkt_lifetime");
9472 0 : return -1;
9473 : }
9474 : {
9475 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_tkt_lifetime));
9476 0 : if (PyLong_Check(value)) {
9477 0 : unsigned long long test_var;
9478 0 : test_var = PyLong_AsUnsignedLongLong(value);
9479 0 : if (PyErr_Occurred() != NULL) {
9480 0 : return -1;
9481 : }
9482 0 : if (test_var > uint_max) {
9483 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9484 : PyLong_Type.tp_name, uint_max, test_var);
9485 0 : return -1;
9486 : }
9487 0 : object->service_tkt_lifetime = test_var;
9488 : } else {
9489 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9490 : PyLong_Type.tp_name);
9491 0 : return -1;
9492 : }
9493 : }
9494 0 : return 0;
9495 : }
9496 :
9497 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_lifetime(PyObject *obj, void *closure)
9498 : {
9499 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9500 0 : PyObject *py_user_tkt_lifetime;
9501 0 : py_user_tkt_lifetime = PyLong_FromUnsignedLongLong(object->user_tkt_lifetime);
9502 0 : return py_user_tkt_lifetime;
9503 : }
9504 :
9505 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_lifetime(PyObject *py_obj, PyObject *value, void *closure)
9506 : {
9507 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9508 0 : if (value == NULL) {
9509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_tkt_lifetime");
9510 0 : return -1;
9511 : }
9512 : {
9513 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_lifetime));
9514 0 : if (PyLong_Check(value)) {
9515 0 : unsigned long long test_var;
9516 0 : test_var = PyLong_AsUnsignedLongLong(value);
9517 0 : if (PyErr_Occurred() != NULL) {
9518 0 : return -1;
9519 : }
9520 0 : if (test_var > uint_max) {
9521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9522 : PyLong_Type.tp_name, uint_max, test_var);
9523 0 : return -1;
9524 : }
9525 0 : object->user_tkt_lifetime = test_var;
9526 : } else {
9527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9528 : PyLong_Type.tp_name);
9529 0 : return -1;
9530 : }
9531 : }
9532 0 : return 0;
9533 : }
9534 :
9535 0 : static PyObject *py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime(PyObject *obj, void *closure)
9536 : {
9537 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9538 0 : PyObject *py_user_tkt_renewaltime;
9539 0 : py_user_tkt_renewaltime = PyLong_FromUnsignedLongLong(object->user_tkt_renewaltime);
9540 0 : return py_user_tkt_renewaltime;
9541 : }
9542 :
9543 0 : static int py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime(PyObject *py_obj, PyObject *value, void *closure)
9544 : {
9545 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9546 0 : if (value == NULL) {
9547 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_tkt_renewaltime");
9548 0 : return -1;
9549 : }
9550 : {
9551 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_tkt_renewaltime));
9552 0 : if (PyLong_Check(value)) {
9553 0 : unsigned long long test_var;
9554 0 : test_var = PyLong_AsUnsignedLongLong(value);
9555 0 : if (PyErr_Occurred() != NULL) {
9556 0 : return -1;
9557 : }
9558 0 : if (test_var > uint_max) {
9559 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9560 : PyLong_Type.tp_name, uint_max, test_var);
9561 0 : return -1;
9562 : }
9563 0 : object->user_tkt_renewaltime = test_var;
9564 : } else {
9565 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9566 : PyLong_Type.tp_name);
9567 0 : return -1;
9568 : }
9569 : }
9570 0 : return 0;
9571 : }
9572 :
9573 0 : static PyObject *py_lsa_DomainInfoKerberos_get_clock_skew(PyObject *obj, void *closure)
9574 : {
9575 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9576 0 : PyObject *py_clock_skew;
9577 0 : py_clock_skew = PyLong_FromUnsignedLongLong(object->clock_skew);
9578 0 : return py_clock_skew;
9579 : }
9580 :
9581 0 : static int py_lsa_DomainInfoKerberos_set_clock_skew(PyObject *py_obj, PyObject *value, void *closure)
9582 : {
9583 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9584 0 : if (value == NULL) {
9585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->clock_skew");
9586 0 : return -1;
9587 : }
9588 : {
9589 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clock_skew));
9590 0 : if (PyLong_Check(value)) {
9591 0 : unsigned long long test_var;
9592 0 : test_var = PyLong_AsUnsignedLongLong(value);
9593 0 : if (PyErr_Occurred() != NULL) {
9594 0 : return -1;
9595 : }
9596 0 : if (test_var > uint_max) {
9597 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9598 : PyLong_Type.tp_name, uint_max, test_var);
9599 0 : return -1;
9600 : }
9601 0 : object->clock_skew = test_var;
9602 : } else {
9603 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9604 : PyLong_Type.tp_name);
9605 0 : return -1;
9606 : }
9607 : }
9608 0 : return 0;
9609 : }
9610 :
9611 0 : static PyObject *py_lsa_DomainInfoKerberos_get_reserved(PyObject *obj, void *closure)
9612 : {
9613 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(obj);
9614 0 : PyObject *py_reserved;
9615 0 : py_reserved = PyLong_FromUnsignedLongLong(object->reserved);
9616 0 : return py_reserved;
9617 : }
9618 :
9619 0 : static int py_lsa_DomainInfoKerberos_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
9620 : {
9621 0 : struct lsa_DomainInfoKerberos *object = pytalloc_get_ptr(py_obj);
9622 0 : if (value == NULL) {
9623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
9624 0 : return -1;
9625 : }
9626 : {
9627 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
9628 0 : if (PyLong_Check(value)) {
9629 0 : unsigned long long test_var;
9630 0 : test_var = PyLong_AsUnsignedLongLong(value);
9631 0 : if (PyErr_Occurred() != NULL) {
9632 0 : return -1;
9633 : }
9634 0 : if (test_var > uint_max) {
9635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9636 : PyLong_Type.tp_name, uint_max, test_var);
9637 0 : return -1;
9638 : }
9639 0 : object->reserved = test_var;
9640 : } else {
9641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9642 : PyLong_Type.tp_name);
9643 0 : return -1;
9644 : }
9645 : }
9646 0 : return 0;
9647 : }
9648 :
9649 : static PyGetSetDef py_lsa_DomainInfoKerberos_getsetters[] = {
9650 : {
9651 : .name = discard_const_p(char, "authentication_options"),
9652 : .get = py_lsa_DomainInfoKerberos_get_authentication_options,
9653 : .set = py_lsa_DomainInfoKerberos_set_authentication_options,
9654 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_krbAuthenticationOptions")
9655 : },
9656 : {
9657 : .name = discard_const_p(char, "service_tkt_lifetime"),
9658 : .get = py_lsa_DomainInfoKerberos_get_service_tkt_lifetime,
9659 : .set = py_lsa_DomainInfoKerberos_set_service_tkt_lifetime,
9660 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9661 : },
9662 : {
9663 : .name = discard_const_p(char, "user_tkt_lifetime"),
9664 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_lifetime,
9665 : .set = py_lsa_DomainInfoKerberos_set_user_tkt_lifetime,
9666 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9667 : },
9668 : {
9669 : .name = discard_const_p(char, "user_tkt_renewaltime"),
9670 : .get = py_lsa_DomainInfoKerberos_get_user_tkt_renewaltime,
9671 : .set = py_lsa_DomainInfoKerberos_set_user_tkt_renewaltime,
9672 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9673 : },
9674 : {
9675 : .name = discard_const_p(char, "clock_skew"),
9676 : .get = py_lsa_DomainInfoKerberos_get_clock_skew,
9677 : .set = py_lsa_DomainInfoKerberos_set_clock_skew,
9678 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9679 : },
9680 : {
9681 : .name = discard_const_p(char, "reserved"),
9682 : .get = py_lsa_DomainInfoKerberos_get_reserved,
9683 : .set = py_lsa_DomainInfoKerberos_set_reserved,
9684 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
9685 : },
9686 : { .name = NULL }
9687 : };
9688 :
9689 0 : static PyObject *py_lsa_DomainInfoKerberos_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9690 : {
9691 0 : return pytalloc_new(struct lsa_DomainInfoKerberos, type);
9692 : }
9693 :
9694 :
9695 : static PyTypeObject lsa_DomainInfoKerberos_Type = {
9696 : PyVarObject_HEAD_INIT(NULL, 0)
9697 : .tp_name = "lsa.DomainInfoKerberos",
9698 : .tp_getset = py_lsa_DomainInfoKerberos_getsetters,
9699 : .tp_methods = NULL,
9700 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9701 : .tp_new = py_lsa_DomainInfoKerberos_new,
9702 : };
9703 :
9704 :
9705 0 : static PyObject *py_lsa_DomainInfoEfs_get_blob_size(PyObject *obj, void *closure)
9706 : {
9707 0 : struct lsa_DomainInfoEfs *object = pytalloc_get_ptr(obj);
9708 0 : PyObject *py_blob_size;
9709 0 : py_blob_size = PyLong_FromUnsignedLongLong((uint32_t)(object->blob_size));
9710 0 : return py_blob_size;
9711 : }
9712 :
9713 0 : static int py_lsa_DomainInfoEfs_set_blob_size(PyObject *py_obj, PyObject *value, void *closure)
9714 : {
9715 0 : struct lsa_DomainInfoEfs *object = pytalloc_get_ptr(py_obj);
9716 0 : if (value == NULL) {
9717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->blob_size");
9718 0 : return -1;
9719 : }
9720 : {
9721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->blob_size));
9722 0 : if (PyLong_Check(value)) {
9723 0 : unsigned long long test_var;
9724 0 : test_var = PyLong_AsUnsignedLongLong(value);
9725 0 : if (PyErr_Occurred() != NULL) {
9726 0 : return -1;
9727 : }
9728 0 : if (test_var > uint_max) {
9729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9730 : PyLong_Type.tp_name, uint_max, test_var);
9731 0 : return -1;
9732 : }
9733 0 : object->blob_size = test_var;
9734 : } else {
9735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9736 : PyLong_Type.tp_name);
9737 0 : return -1;
9738 : }
9739 : }
9740 0 : return 0;
9741 : }
9742 :
9743 0 : static PyObject *py_lsa_DomainInfoEfs_get_efs_blob(PyObject *obj, void *closure)
9744 : {
9745 0 : struct lsa_DomainInfoEfs *object = pytalloc_get_ptr(obj);
9746 0 : PyObject *py_efs_blob;
9747 0 : if (object->efs_blob == NULL) {
9748 0 : Py_RETURN_NONE;
9749 : }
9750 0 : if (object->efs_blob == NULL) {
9751 0 : py_efs_blob = Py_None;
9752 0 : Py_INCREF(py_efs_blob);
9753 : } else {
9754 0 : py_efs_blob = PyList_New(object->blob_size);
9755 0 : if (py_efs_blob == NULL) {
9756 0 : return NULL;
9757 : }
9758 : {
9759 : int efs_blob_cntr_1;
9760 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < (object->blob_size); efs_blob_cntr_1++) {
9761 0 : PyObject *py_efs_blob_1;
9762 0 : py_efs_blob_1 = PyLong_FromLong((uint16_t)((object->efs_blob)[efs_blob_cntr_1]));
9763 0 : PyList_SetItem(py_efs_blob, efs_blob_cntr_1, py_efs_blob_1);
9764 : }
9765 : }
9766 : }
9767 0 : return py_efs_blob;
9768 : }
9769 :
9770 0 : static int py_lsa_DomainInfoEfs_set_efs_blob(PyObject *py_obj, PyObject *value, void *closure)
9771 : {
9772 0 : struct lsa_DomainInfoEfs *object = pytalloc_get_ptr(py_obj);
9773 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->efs_blob));
9774 0 : if (value == NULL) {
9775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->efs_blob");
9776 0 : return -1;
9777 : }
9778 0 : if (value == Py_None) {
9779 0 : object->efs_blob = NULL;
9780 : } else {
9781 0 : object->efs_blob = NULL;
9782 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9783 : {
9784 0 : int efs_blob_cntr_1;
9785 0 : object->efs_blob = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->efs_blob, PyList_GET_SIZE(value));
9786 0 : if (!object->efs_blob) { return -1; }
9787 0 : talloc_set_name_const(object->efs_blob, "ARRAY: object->efs_blob");
9788 0 : for (efs_blob_cntr_1 = 0; efs_blob_cntr_1 < PyList_GET_SIZE(value); efs_blob_cntr_1++) {
9789 0 : if (PyList_GET_ITEM(value, efs_blob_cntr_1) == NULL) {
9790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->efs_blob)[efs_blob_cntr_1]");
9791 0 : return -1;
9792 : }
9793 : {
9794 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->efs_blob)[efs_blob_cntr_1]));
9795 0 : if (PyLong_Check(PyList_GET_ITEM(value, efs_blob_cntr_1))) {
9796 0 : unsigned long long test_var;
9797 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, efs_blob_cntr_1));
9798 0 : if (PyErr_Occurred() != NULL) {
9799 0 : return -1;
9800 : }
9801 0 : if (test_var > uint_max) {
9802 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9803 : PyLong_Type.tp_name, uint_max, test_var);
9804 0 : return -1;
9805 : }
9806 0 : (object->efs_blob)[efs_blob_cntr_1] = test_var;
9807 : } else {
9808 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9809 : PyLong_Type.tp_name);
9810 0 : return -1;
9811 : }
9812 : }
9813 : }
9814 : }
9815 : }
9816 0 : return 0;
9817 : }
9818 :
9819 : static PyGetSetDef py_lsa_DomainInfoEfs_getsetters[] = {
9820 : {
9821 : .name = discard_const_p(char, "blob_size"),
9822 : .get = py_lsa_DomainInfoEfs_get_blob_size,
9823 : .set = py_lsa_DomainInfoEfs_set_blob_size,
9824 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9825 : },
9826 : {
9827 : .name = discard_const_p(char, "efs_blob"),
9828 : .get = py_lsa_DomainInfoEfs_get_efs_blob,
9829 : .set = py_lsa_DomainInfoEfs_set_efs_blob,
9830 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9831 : },
9832 : { .name = NULL }
9833 : };
9834 :
9835 0 : static PyObject *py_lsa_DomainInfoEfs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9836 : {
9837 0 : return pytalloc_new(struct lsa_DomainInfoEfs, type);
9838 : }
9839 :
9840 :
9841 : static PyTypeObject lsa_DomainInfoEfs_Type = {
9842 : PyVarObject_HEAD_INIT(NULL, 0)
9843 : .tp_name = "lsa.DomainInfoEfs",
9844 : .tp_getset = py_lsa_DomainInfoEfs_getsetters,
9845 : .tp_methods = NULL,
9846 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9847 : .tp_new = py_lsa_DomainInfoEfs_new,
9848 : };
9849 :
9850 0 : static PyObject *py_import_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, union lsa_DomainInformationPolicy *in)
9851 : {
9852 0 : PyObject *ret;
9853 :
9854 0 : switch (level) {
9855 0 : case LSA_DOMAIN_INFO_POLICY_QOS:
9856 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoQoS_Type, mem_ctx, &in->qos_info);
9857 0 : return ret;
9858 :
9859 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9860 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoEfs_Type, mem_ctx, &in->efs_info);
9861 0 : return ret;
9862 :
9863 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9864 0 : ret = pytalloc_reference_ex(&lsa_DomainInfoKerberos_Type, mem_ctx, &in->kerberos_info);
9865 0 : return ret;
9866 :
9867 : }
9868 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9869 0 : return NULL;
9870 : }
9871 :
9872 0 : static union lsa_DomainInformationPolicy *py_export_lsa_DomainInformationPolicy(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9873 : {
9874 0 : union lsa_DomainInformationPolicy *ret = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy);
9875 0 : switch (level) {
9876 0 : case LSA_DOMAIN_INFO_POLICY_QOS:
9877 0 : if (in == NULL) {
9878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->qos_info");
9879 0 : talloc_free(ret); return NULL;
9880 : }
9881 0 : PY_CHECK_TYPE(&lsa_DomainInfoQoS_Type, in, talloc_free(ret); return NULL;);
9882 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9883 0 : PyErr_NoMemory();
9884 0 : talloc_free(ret); return NULL;
9885 : }
9886 0 : ret->qos_info = *(struct lsa_DomainInfoQoS *)pytalloc_get_ptr(in);
9887 0 : break;
9888 :
9889 0 : case LSA_DOMAIN_INFO_POLICY_EFS:
9890 0 : if (in == NULL) {
9891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->efs_info");
9892 0 : talloc_free(ret); return NULL;
9893 : }
9894 0 : PY_CHECK_TYPE(&lsa_DomainInfoEfs_Type, in, talloc_free(ret); return NULL;);
9895 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9896 0 : PyErr_NoMemory();
9897 0 : talloc_free(ret); return NULL;
9898 : }
9899 0 : ret->efs_info = *(struct lsa_DomainInfoEfs *)pytalloc_get_ptr(in);
9900 0 : break;
9901 :
9902 0 : case LSA_DOMAIN_INFO_POLICY_KERBEROS:
9903 0 : if (in == NULL) {
9904 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->kerberos_info");
9905 0 : talloc_free(ret); return NULL;
9906 : }
9907 0 : PY_CHECK_TYPE(&lsa_DomainInfoKerberos_Type, in, talloc_free(ret); return NULL;);
9908 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9909 0 : PyErr_NoMemory();
9910 0 : talloc_free(ret); return NULL;
9911 : }
9912 0 : ret->kerberos_info = *(struct lsa_DomainInfoKerberos *)pytalloc_get_ptr(in);
9913 0 : break;
9914 :
9915 0 : default:
9916 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9917 0 : talloc_free(ret);
9918 0 : ret = NULL;
9919 : }
9920 :
9921 0 : return ret;
9922 : }
9923 :
9924 0 : static PyObject *py_lsa_DomainInformationPolicy_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9925 : {
9926 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9927 0 : PyObject *mem_ctx_obj = NULL;
9928 0 : TALLOC_CTX *mem_ctx = NULL;
9929 0 : int level = 0;
9930 0 : PyObject *in_obj = NULL;
9931 0 : union lsa_DomainInformationPolicy *in = NULL;
9932 :
9933 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9934 : discard_const_p(char *, kwnames),
9935 : &mem_ctx_obj,
9936 : &level,
9937 : &in_obj)) {
9938 0 : return NULL;
9939 : }
9940 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9941 0 : if (mem_ctx == NULL) {
9942 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9943 0 : return NULL;
9944 : }
9945 0 : in = (union lsa_DomainInformationPolicy *)pytalloc_get_ptr(in_obj);
9946 0 : if (in == NULL) {
9947 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_DomainInformationPolicy!");
9948 0 : return NULL;
9949 : }
9950 :
9951 0 : return py_import_lsa_DomainInformationPolicy(mem_ctx, level, in);
9952 : }
9953 :
9954 0 : static PyObject *py_lsa_DomainInformationPolicy_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9955 : {
9956 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9957 0 : PyObject *mem_ctx_obj = NULL;
9958 0 : TALLOC_CTX *mem_ctx = NULL;
9959 0 : int level = 0;
9960 0 : PyObject *in = NULL;
9961 0 : union lsa_DomainInformationPolicy *out = NULL;
9962 :
9963 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9964 : discard_const_p(char *, kwnames),
9965 : &mem_ctx_obj,
9966 : &level,
9967 : &in)) {
9968 0 : return NULL;
9969 : }
9970 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9971 0 : if (mem_ctx == NULL) {
9972 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9973 0 : return NULL;
9974 : }
9975 :
9976 0 : out = py_export_lsa_DomainInformationPolicy(mem_ctx, level, in);
9977 0 : if (out == NULL) {
9978 0 : return NULL;
9979 : }
9980 :
9981 0 : return pytalloc_GenericObject_reference(out);
9982 : }
9983 :
9984 : static PyMethodDef py_lsa_DomainInformationPolicy_methods[] = {
9985 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_import),
9986 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9987 : "T.__import__(mem_ctx, level, in) => ret." },
9988 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DomainInformationPolicy_export),
9989 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9990 : "T.__export__(mem_ctx, level, in) => ret." },
9991 : { NULL, NULL, 0, NULL }
9992 : };
9993 :
9994 0 : static PyObject *py_lsa_DomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9995 : {
9996 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9997 0 : return NULL;
9998 : }
9999 :
10000 :
10001 : static PyTypeObject lsa_DomainInformationPolicy_Type = {
10002 : PyVarObject_HEAD_INIT(NULL, 0)
10003 : .tp_name = "lsa.DomainInformationPolicy",
10004 : .tp_getset = NULL,
10005 : .tp_methods = py_lsa_DomainInformationPolicy_methods,
10006 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10007 : .tp_new = py_lsa_DomainInformationPolicy_new,
10008 : };
10009 :
10010 :
10011 0 : static PyObject *py_lsa_TranslatedName2_get_sid_type(PyObject *obj, void *closure)
10012 : {
10013 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(obj);
10014 0 : PyObject *py_sid_type;
10015 0 : py_sid_type = PyLong_FromLong((uint16_t)(object->sid_type));
10016 0 : return py_sid_type;
10017 : }
10018 :
10019 0 : static int py_lsa_TranslatedName2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
10020 : {
10021 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(py_obj);
10022 0 : if (value == NULL) {
10023 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_type");
10024 0 : return -1;
10025 : }
10026 : {
10027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
10028 0 : if (PyLong_Check(value)) {
10029 0 : unsigned long long test_var;
10030 0 : test_var = PyLong_AsUnsignedLongLong(value);
10031 0 : if (PyErr_Occurred() != NULL) {
10032 0 : return -1;
10033 : }
10034 0 : if (test_var > uint_max) {
10035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10036 : PyLong_Type.tp_name, uint_max, test_var);
10037 0 : return -1;
10038 : }
10039 0 : object->sid_type = test_var;
10040 : } else {
10041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10042 : PyLong_Type.tp_name);
10043 0 : return -1;
10044 : }
10045 : }
10046 0 : return 0;
10047 : }
10048 :
10049 5 : static PyObject *py_lsa_TranslatedName2_get_name(PyObject *obj, void *closure)
10050 : {
10051 5 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(obj);
10052 0 : PyObject *py_name;
10053 5 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
10054 5 : return py_name;
10055 : }
10056 :
10057 0 : static int py_lsa_TranslatedName2_set_name(PyObject *py_obj, PyObject *value, void *closure)
10058 : {
10059 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(py_obj);
10060 0 : if (value == NULL) {
10061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
10062 0 : return -1;
10063 : }
10064 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
10065 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10066 0 : PyErr_NoMemory();
10067 0 : return -1;
10068 : }
10069 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
10070 0 : return 0;
10071 : }
10072 :
10073 0 : static PyObject *py_lsa_TranslatedName2_get_sid_index(PyObject *obj, void *closure)
10074 : {
10075 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(obj);
10076 0 : PyObject *py_sid_index;
10077 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_index));
10078 0 : return py_sid_index;
10079 : }
10080 :
10081 0 : static int py_lsa_TranslatedName2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
10082 : {
10083 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(py_obj);
10084 0 : if (value == NULL) {
10085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_index");
10086 0 : return -1;
10087 : }
10088 : {
10089 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
10090 0 : if (PyLong_Check(value)) {
10091 0 : unsigned long long test_var;
10092 0 : test_var = PyLong_AsUnsignedLongLong(value);
10093 0 : if (PyErr_Occurred() != NULL) {
10094 0 : return -1;
10095 : }
10096 0 : if (test_var > uint_max) {
10097 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10098 : PyLong_Type.tp_name, uint_max, test_var);
10099 0 : return -1;
10100 : }
10101 0 : object->sid_index = test_var;
10102 : } else {
10103 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10104 : PyLong_Type.tp_name);
10105 0 : return -1;
10106 : }
10107 : }
10108 0 : return 0;
10109 : }
10110 :
10111 0 : static PyObject *py_lsa_TranslatedName2_get_unknown(PyObject *obj, void *closure)
10112 : {
10113 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(obj);
10114 0 : PyObject *py_unknown;
10115 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)(object->unknown));
10116 0 : return py_unknown;
10117 : }
10118 :
10119 0 : static int py_lsa_TranslatedName2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
10120 : {
10121 0 : struct lsa_TranslatedName2 *object = pytalloc_get_ptr(py_obj);
10122 0 : if (value == NULL) {
10123 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unknown");
10124 0 : return -1;
10125 : }
10126 : {
10127 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
10128 0 : if (PyLong_Check(value)) {
10129 0 : unsigned long long test_var;
10130 0 : test_var = PyLong_AsUnsignedLongLong(value);
10131 0 : if (PyErr_Occurred() != NULL) {
10132 0 : return -1;
10133 : }
10134 0 : if (test_var > uint_max) {
10135 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10136 : PyLong_Type.tp_name, uint_max, test_var);
10137 0 : return -1;
10138 : }
10139 0 : object->unknown = test_var;
10140 : } else {
10141 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10142 : PyLong_Type.tp_name);
10143 0 : return -1;
10144 : }
10145 : }
10146 0 : return 0;
10147 : }
10148 :
10149 : static PyGetSetDef py_lsa_TranslatedName2_getsetters[] = {
10150 : {
10151 : .name = discard_const_p(char, "sid_type"),
10152 : .get = py_lsa_TranslatedName2_get_sid_type,
10153 : .set = py_lsa_TranslatedName2_set_sid_type,
10154 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10155 : },
10156 : {
10157 : .name = discard_const_p(char, "name"),
10158 : .get = py_lsa_TranslatedName2_get_name,
10159 : .set = py_lsa_TranslatedName2_set_name,
10160 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10161 : },
10162 : {
10163 : .name = discard_const_p(char, "sid_index"),
10164 : .get = py_lsa_TranslatedName2_get_sid_index,
10165 : .set = py_lsa_TranslatedName2_set_sid_index,
10166 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10167 : },
10168 : {
10169 : .name = discard_const_p(char, "unknown"),
10170 : .get = py_lsa_TranslatedName2_get_unknown,
10171 : .set = py_lsa_TranslatedName2_set_unknown,
10172 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10173 : },
10174 : { .name = NULL }
10175 : };
10176 :
10177 0 : static PyObject *py_lsa_TranslatedName2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10178 : {
10179 0 : return pytalloc_new(struct lsa_TranslatedName2, type);
10180 : }
10181 :
10182 :
10183 : static PyTypeObject lsa_TranslatedName2_Type = {
10184 : PyVarObject_HEAD_INIT(NULL, 0)
10185 : .tp_name = "lsa.TranslatedName2",
10186 : .tp_getset = py_lsa_TranslatedName2_getsetters,
10187 : .tp_methods = NULL,
10188 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10189 : .tp_new = py_lsa_TranslatedName2_new,
10190 : };
10191 :
10192 :
10193 5 : static PyObject *py_lsa_TransNameArray2_get_count(PyObject *obj, void *closure)
10194 : {
10195 5 : struct lsa_TransNameArray2 *object = pytalloc_get_ptr(obj);
10196 0 : PyObject *py_count;
10197 5 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
10198 5 : return py_count;
10199 : }
10200 :
10201 0 : static int py_lsa_TransNameArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
10202 : {
10203 0 : struct lsa_TransNameArray2 *object = pytalloc_get_ptr(py_obj);
10204 0 : if (value == NULL) {
10205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
10206 0 : return -1;
10207 : }
10208 : {
10209 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10210 0 : if (PyLong_Check(value)) {
10211 0 : unsigned long long test_var;
10212 0 : test_var = PyLong_AsUnsignedLongLong(value);
10213 0 : if (PyErr_Occurred() != NULL) {
10214 0 : return -1;
10215 : }
10216 0 : if (test_var > uint_max) {
10217 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10218 : PyLong_Type.tp_name, uint_max, test_var);
10219 0 : return -1;
10220 : }
10221 0 : object->count = test_var;
10222 : } else {
10223 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10224 : PyLong_Type.tp_name);
10225 0 : return -1;
10226 : }
10227 : }
10228 0 : return 0;
10229 : }
10230 :
10231 5 : static PyObject *py_lsa_TransNameArray2_get_names(PyObject *obj, void *closure)
10232 : {
10233 5 : struct lsa_TransNameArray2 *object = pytalloc_get_ptr(obj);
10234 0 : PyObject *py_names;
10235 5 : if (object->names == NULL) {
10236 0 : Py_RETURN_NONE;
10237 : }
10238 5 : if (object->names == NULL) {
10239 0 : py_names = Py_None;
10240 0 : Py_INCREF(py_names);
10241 : } else {
10242 5 : py_names = PyList_New(object->count);
10243 5 : if (py_names == NULL) {
10244 0 : return NULL;
10245 : }
10246 : {
10247 : int names_cntr_1;
10248 10 : for (names_cntr_1 = 0; names_cntr_1 < (object->count); names_cntr_1++) {
10249 0 : PyObject *py_names_1;
10250 5 : py_names_1 = pytalloc_reference_ex(&lsa_TranslatedName2_Type, object->names, &(object->names)[names_cntr_1]);
10251 5 : PyList_SetItem(py_names, names_cntr_1, py_names_1);
10252 : }
10253 : }
10254 : }
10255 5 : return py_names;
10256 : }
10257 :
10258 0 : static int py_lsa_TransNameArray2_set_names(PyObject *py_obj, PyObject *value, void *closure)
10259 : {
10260 0 : struct lsa_TransNameArray2 *object = pytalloc_get_ptr(py_obj);
10261 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->names));
10262 0 : if (value == NULL) {
10263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->names");
10264 0 : return -1;
10265 : }
10266 0 : if (value == Py_None) {
10267 0 : object->names = NULL;
10268 : } else {
10269 0 : object->names = NULL;
10270 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10271 : {
10272 0 : int names_cntr_1;
10273 0 : object->names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->names, PyList_GET_SIZE(value));
10274 0 : if (!object->names) { return -1; }
10275 0 : talloc_set_name_const(object->names, "ARRAY: object->names");
10276 0 : for (names_cntr_1 = 0; names_cntr_1 < PyList_GET_SIZE(value); names_cntr_1++) {
10277 0 : if (PyList_GET_ITEM(value, names_cntr_1) == NULL) {
10278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->names)[names_cntr_1]");
10279 0 : return -1;
10280 : }
10281 0 : PY_CHECK_TYPE(&lsa_TranslatedName2_Type, PyList_GET_ITEM(value, names_cntr_1), return -1;);
10282 0 : if (talloc_reference(object->names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_1))) == NULL) {
10283 0 : PyErr_NoMemory();
10284 0 : return -1;
10285 : }
10286 0 : (object->names)[names_cntr_1] = *(struct lsa_TranslatedName2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_1));
10287 : }
10288 : }
10289 : }
10290 0 : return 0;
10291 : }
10292 :
10293 : static PyGetSetDef py_lsa_TransNameArray2_getsetters[] = {
10294 : {
10295 : .name = discard_const_p(char, "count"),
10296 : .get = py_lsa_TransNameArray2_get_count,
10297 : .set = py_lsa_TransNameArray2_set_count,
10298 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10299 : },
10300 : {
10301 : .name = discard_const_p(char, "names"),
10302 : .get = py_lsa_TransNameArray2_get_names,
10303 : .set = py_lsa_TransNameArray2_set_names,
10304 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedName2")
10305 : },
10306 : { .name = NULL }
10307 : };
10308 :
10309 5 : static PyObject *py_lsa_TransNameArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10310 : {
10311 5 : return pytalloc_new(struct lsa_TransNameArray2, type);
10312 : }
10313 :
10314 :
10315 : static PyTypeObject lsa_TransNameArray2_Type = {
10316 : PyVarObject_HEAD_INIT(NULL, 0)
10317 : .tp_name = "lsa.TransNameArray2",
10318 : .tp_getset = py_lsa_TransNameArray2_getsetters,
10319 : .tp_methods = NULL,
10320 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10321 : .tp_new = py_lsa_TransNameArray2_new,
10322 : };
10323 :
10324 :
10325 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_type(PyObject *obj, void *closure)
10326 : {
10327 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(obj);
10328 0 : PyObject *py_sid_type;
10329 0 : py_sid_type = PyLong_FromLong((uint16_t)(object->sid_type));
10330 0 : return py_sid_type;
10331 : }
10332 :
10333 0 : static int py_lsa_TranslatedSid2_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
10334 : {
10335 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(py_obj);
10336 0 : if (value == NULL) {
10337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_type");
10338 0 : return -1;
10339 : }
10340 : {
10341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
10342 0 : if (PyLong_Check(value)) {
10343 0 : unsigned long long test_var;
10344 0 : test_var = PyLong_AsUnsignedLongLong(value);
10345 0 : if (PyErr_Occurred() != NULL) {
10346 0 : return -1;
10347 : }
10348 0 : if (test_var > uint_max) {
10349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10350 : PyLong_Type.tp_name, uint_max, test_var);
10351 0 : return -1;
10352 : }
10353 0 : object->sid_type = test_var;
10354 : } else {
10355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10356 : PyLong_Type.tp_name);
10357 0 : return -1;
10358 : }
10359 : }
10360 0 : return 0;
10361 : }
10362 :
10363 0 : static PyObject *py_lsa_TranslatedSid2_get_rid(PyObject *obj, void *closure)
10364 : {
10365 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(obj);
10366 0 : PyObject *py_rid;
10367 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)(object->rid));
10368 0 : return py_rid;
10369 : }
10370 :
10371 0 : static int py_lsa_TranslatedSid2_set_rid(PyObject *py_obj, PyObject *value, void *closure)
10372 : {
10373 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(py_obj);
10374 0 : if (value == NULL) {
10375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->rid");
10376 0 : return -1;
10377 : }
10378 : {
10379 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
10380 0 : if (PyLong_Check(value)) {
10381 0 : unsigned long long test_var;
10382 0 : test_var = PyLong_AsUnsignedLongLong(value);
10383 0 : if (PyErr_Occurred() != NULL) {
10384 0 : return -1;
10385 : }
10386 0 : if (test_var > uint_max) {
10387 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10388 : PyLong_Type.tp_name, uint_max, test_var);
10389 0 : return -1;
10390 : }
10391 0 : object->rid = test_var;
10392 : } else {
10393 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10394 : PyLong_Type.tp_name);
10395 0 : return -1;
10396 : }
10397 : }
10398 0 : return 0;
10399 : }
10400 :
10401 0 : static PyObject *py_lsa_TranslatedSid2_get_sid_index(PyObject *obj, void *closure)
10402 : {
10403 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(obj);
10404 0 : PyObject *py_sid_index;
10405 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_index));
10406 0 : return py_sid_index;
10407 : }
10408 :
10409 0 : static int py_lsa_TranslatedSid2_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
10410 : {
10411 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(py_obj);
10412 0 : if (value == NULL) {
10413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_index");
10414 0 : return -1;
10415 : }
10416 : {
10417 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
10418 0 : if (PyLong_Check(value)) {
10419 0 : unsigned long long test_var;
10420 0 : test_var = PyLong_AsUnsignedLongLong(value);
10421 0 : if (PyErr_Occurred() != NULL) {
10422 0 : return -1;
10423 : }
10424 0 : if (test_var > uint_max) {
10425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10426 : PyLong_Type.tp_name, uint_max, test_var);
10427 0 : return -1;
10428 : }
10429 0 : object->sid_index = test_var;
10430 : } else {
10431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10432 : PyLong_Type.tp_name);
10433 0 : return -1;
10434 : }
10435 : }
10436 0 : return 0;
10437 : }
10438 :
10439 0 : static PyObject *py_lsa_TranslatedSid2_get_unknown(PyObject *obj, void *closure)
10440 : {
10441 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(obj);
10442 0 : PyObject *py_unknown;
10443 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)(object->unknown));
10444 0 : return py_unknown;
10445 : }
10446 :
10447 0 : static int py_lsa_TranslatedSid2_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
10448 : {
10449 0 : struct lsa_TranslatedSid2 *object = pytalloc_get_ptr(py_obj);
10450 0 : if (value == NULL) {
10451 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unknown");
10452 0 : return -1;
10453 : }
10454 : {
10455 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown));
10456 0 : if (PyLong_Check(value)) {
10457 0 : unsigned long long test_var;
10458 0 : test_var = PyLong_AsUnsignedLongLong(value);
10459 0 : if (PyErr_Occurred() != NULL) {
10460 0 : return -1;
10461 : }
10462 0 : if (test_var > uint_max) {
10463 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10464 : PyLong_Type.tp_name, uint_max, test_var);
10465 0 : return -1;
10466 : }
10467 0 : object->unknown = test_var;
10468 : } else {
10469 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10470 : PyLong_Type.tp_name);
10471 0 : return -1;
10472 : }
10473 : }
10474 0 : return 0;
10475 : }
10476 :
10477 : static PyGetSetDef py_lsa_TranslatedSid2_getsetters[] = {
10478 : {
10479 : .name = discard_const_p(char, "sid_type"),
10480 : .get = py_lsa_TranslatedSid2_get_sid_type,
10481 : .set = py_lsa_TranslatedSid2_set_sid_type,
10482 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10483 : },
10484 : {
10485 : .name = discard_const_p(char, "rid"),
10486 : .get = py_lsa_TranslatedSid2_get_rid,
10487 : .set = py_lsa_TranslatedSid2_set_rid,
10488 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10489 : },
10490 : {
10491 : .name = discard_const_p(char, "sid_index"),
10492 : .get = py_lsa_TranslatedSid2_get_sid_index,
10493 : .set = py_lsa_TranslatedSid2_set_sid_index,
10494 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10495 : },
10496 : {
10497 : .name = discard_const_p(char, "unknown"),
10498 : .get = py_lsa_TranslatedSid2_get_unknown,
10499 : .set = py_lsa_TranslatedSid2_set_unknown,
10500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10501 : },
10502 : { .name = NULL }
10503 : };
10504 :
10505 0 : static PyObject *py_lsa_TranslatedSid2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10506 : {
10507 0 : return pytalloc_new(struct lsa_TranslatedSid2, type);
10508 : }
10509 :
10510 :
10511 : static PyTypeObject lsa_TranslatedSid2_Type = {
10512 : PyVarObject_HEAD_INIT(NULL, 0)
10513 : .tp_name = "lsa.TranslatedSid2",
10514 : .tp_getset = py_lsa_TranslatedSid2_getsetters,
10515 : .tp_methods = NULL,
10516 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10517 : .tp_new = py_lsa_TranslatedSid2_new,
10518 : };
10519 :
10520 :
10521 0 : static PyObject *py_lsa_TransSidArray2_get_count(PyObject *obj, void *closure)
10522 : {
10523 0 : struct lsa_TransSidArray2 *object = pytalloc_get_ptr(obj);
10524 0 : PyObject *py_count;
10525 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
10526 0 : return py_count;
10527 : }
10528 :
10529 0 : static int py_lsa_TransSidArray2_set_count(PyObject *py_obj, PyObject *value, void *closure)
10530 : {
10531 0 : struct lsa_TransSidArray2 *object = pytalloc_get_ptr(py_obj);
10532 0 : if (value == NULL) {
10533 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
10534 0 : return -1;
10535 : }
10536 : {
10537 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10538 0 : if (PyLong_Check(value)) {
10539 0 : unsigned long long test_var;
10540 0 : test_var = PyLong_AsUnsignedLongLong(value);
10541 0 : if (PyErr_Occurred() != NULL) {
10542 0 : return -1;
10543 : }
10544 0 : if (test_var > uint_max) {
10545 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10546 : PyLong_Type.tp_name, uint_max, test_var);
10547 0 : return -1;
10548 : }
10549 0 : object->count = test_var;
10550 : } else {
10551 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10552 : PyLong_Type.tp_name);
10553 0 : return -1;
10554 : }
10555 : }
10556 0 : return 0;
10557 : }
10558 :
10559 0 : static PyObject *py_lsa_TransSidArray2_get_sids(PyObject *obj, void *closure)
10560 : {
10561 0 : struct lsa_TransSidArray2 *object = pytalloc_get_ptr(obj);
10562 0 : PyObject *py_sids;
10563 0 : if (object->sids == NULL) {
10564 0 : Py_RETURN_NONE;
10565 : }
10566 0 : if (object->sids == NULL) {
10567 0 : py_sids = Py_None;
10568 0 : Py_INCREF(py_sids);
10569 : } else {
10570 0 : py_sids = PyList_New(object->count);
10571 0 : if (py_sids == NULL) {
10572 0 : return NULL;
10573 : }
10574 : {
10575 : int sids_cntr_1;
10576 0 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10577 0 : PyObject *py_sids_1;
10578 0 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid2_Type, object->sids, &(object->sids)[sids_cntr_1]);
10579 0 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10580 : }
10581 : }
10582 : }
10583 0 : return py_sids;
10584 : }
10585 :
10586 0 : static int py_lsa_TransSidArray2_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10587 : {
10588 0 : struct lsa_TransSidArray2 *object = pytalloc_get_ptr(py_obj);
10589 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10590 0 : if (value == NULL) {
10591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
10592 0 : return -1;
10593 : }
10594 0 : if (value == Py_None) {
10595 0 : object->sids = NULL;
10596 : } else {
10597 0 : object->sids = NULL;
10598 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10599 : {
10600 0 : int sids_cntr_1;
10601 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10602 0 : if (!object->sids) { return -1; }
10603 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10604 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10605 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_1]");
10607 0 : return -1;
10608 : }
10609 0 : PY_CHECK_TYPE(&lsa_TranslatedSid2_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10610 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10611 0 : PyErr_NoMemory();
10612 0 : return -1;
10613 : }
10614 0 : (object->sids)[sids_cntr_1] = *(struct lsa_TranslatedSid2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10615 : }
10616 : }
10617 : }
10618 0 : return 0;
10619 : }
10620 :
10621 : static PyGetSetDef py_lsa_TransSidArray2_getsetters[] = {
10622 : {
10623 : .name = discard_const_p(char, "count"),
10624 : .get = py_lsa_TransSidArray2_get_count,
10625 : .set = py_lsa_TransSidArray2_set_count,
10626 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10627 : },
10628 : {
10629 : .name = discard_const_p(char, "sids"),
10630 : .get = py_lsa_TransSidArray2_get_sids,
10631 : .set = py_lsa_TransSidArray2_set_sids,
10632 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid2")
10633 : },
10634 : { .name = NULL }
10635 : };
10636 :
10637 0 : static PyObject *py_lsa_TransSidArray2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10638 : {
10639 0 : return pytalloc_new(struct lsa_TransSidArray2, type);
10640 : }
10641 :
10642 :
10643 : static PyTypeObject lsa_TransSidArray2_Type = {
10644 : PyVarObject_HEAD_INIT(NULL, 0)
10645 : .tp_name = "lsa.TransSidArray2",
10646 : .tp_getset = py_lsa_TransSidArray2_getsetters,
10647 : .tp_methods = NULL,
10648 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10649 : .tp_new = py_lsa_TransSidArray2_new,
10650 : };
10651 :
10652 :
10653 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_type(PyObject *obj, void *closure)
10654 : {
10655 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(obj);
10656 0 : PyObject *py_sid_type;
10657 0 : py_sid_type = PyLong_FromLong((uint16_t)(object->sid_type));
10658 0 : return py_sid_type;
10659 : }
10660 :
10661 0 : static int py_lsa_TranslatedSid3_set_sid_type(PyObject *py_obj, PyObject *value, void *closure)
10662 : {
10663 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(py_obj);
10664 0 : if (value == NULL) {
10665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_type");
10666 0 : return -1;
10667 : }
10668 : {
10669 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_type));
10670 0 : if (PyLong_Check(value)) {
10671 0 : unsigned long long test_var;
10672 0 : test_var = PyLong_AsUnsignedLongLong(value);
10673 0 : if (PyErr_Occurred() != NULL) {
10674 0 : return -1;
10675 : }
10676 0 : if (test_var > uint_max) {
10677 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10678 : PyLong_Type.tp_name, uint_max, test_var);
10679 0 : return -1;
10680 : }
10681 0 : object->sid_type = test_var;
10682 : } else {
10683 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10684 : PyLong_Type.tp_name);
10685 0 : return -1;
10686 : }
10687 : }
10688 0 : return 0;
10689 : }
10690 :
10691 1 : static PyObject *py_lsa_TranslatedSid3_get_sid(PyObject *obj, void *closure)
10692 : {
10693 1 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(obj);
10694 0 : PyObject *py_sid;
10695 1 : if (object->sid == NULL) {
10696 0 : Py_RETURN_NONE;
10697 : }
10698 1 : if (object->sid == NULL) {
10699 0 : py_sid = Py_None;
10700 0 : Py_INCREF(py_sid);
10701 : } else {
10702 1 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->sid, object->sid);
10703 : }
10704 1 : return py_sid;
10705 : }
10706 :
10707 0 : static int py_lsa_TranslatedSid3_set_sid(PyObject *py_obj, PyObject *value, void *closure)
10708 : {
10709 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(py_obj);
10710 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sid));
10711 0 : if (value == NULL) {
10712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid");
10713 0 : return -1;
10714 : }
10715 0 : if (value == Py_None) {
10716 0 : object->sid = NULL;
10717 : } else {
10718 0 : object->sid = NULL;
10719 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
10720 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10721 0 : PyErr_NoMemory();
10722 0 : return -1;
10723 : }
10724 0 : object->sid = (struct dom_sid *)pytalloc_get_ptr(value);
10725 : }
10726 0 : return 0;
10727 : }
10728 :
10729 0 : static PyObject *py_lsa_TranslatedSid3_get_sid_index(PyObject *obj, void *closure)
10730 : {
10731 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(obj);
10732 0 : PyObject *py_sid_index;
10733 0 : py_sid_index = PyLong_FromUnsignedLongLong((uint32_t)(object->sid_index));
10734 0 : return py_sid_index;
10735 : }
10736 :
10737 0 : static int py_lsa_TranslatedSid3_set_sid_index(PyObject *py_obj, PyObject *value, void *closure)
10738 : {
10739 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(py_obj);
10740 0 : if (value == NULL) {
10741 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sid_index");
10742 0 : return -1;
10743 : }
10744 : {
10745 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sid_index));
10746 0 : if (PyLong_Check(value)) {
10747 0 : unsigned long long test_var;
10748 0 : test_var = PyLong_AsUnsignedLongLong(value);
10749 0 : if (PyErr_Occurred() != NULL) {
10750 0 : return -1;
10751 : }
10752 0 : if (test_var > uint_max) {
10753 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10754 : PyLong_Type.tp_name, uint_max, test_var);
10755 0 : return -1;
10756 : }
10757 0 : object->sid_index = test_var;
10758 : } else {
10759 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10760 : PyLong_Type.tp_name);
10761 0 : return -1;
10762 : }
10763 : }
10764 0 : return 0;
10765 : }
10766 :
10767 0 : static PyObject *py_lsa_TranslatedSid3_get_flags(PyObject *obj, void *closure)
10768 : {
10769 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(obj);
10770 0 : PyObject *py_flags;
10771 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
10772 0 : return py_flags;
10773 : }
10774 :
10775 0 : static int py_lsa_TranslatedSid3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
10776 : {
10777 0 : struct lsa_TranslatedSid3 *object = pytalloc_get_ptr(py_obj);
10778 0 : if (value == NULL) {
10779 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
10780 0 : return -1;
10781 : }
10782 : {
10783 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
10784 0 : if (PyLong_Check(value)) {
10785 0 : unsigned long long test_var;
10786 0 : test_var = PyLong_AsUnsignedLongLong(value);
10787 0 : if (PyErr_Occurred() != NULL) {
10788 0 : return -1;
10789 : }
10790 0 : if (test_var > uint_max) {
10791 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10792 : PyLong_Type.tp_name, uint_max, test_var);
10793 0 : return -1;
10794 : }
10795 0 : object->flags = test_var;
10796 : } else {
10797 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10798 : PyLong_Type.tp_name);
10799 0 : return -1;
10800 : }
10801 : }
10802 0 : return 0;
10803 : }
10804 :
10805 : static PyGetSetDef py_lsa_TranslatedSid3_getsetters[] = {
10806 : {
10807 : .name = discard_const_p(char, "sid_type"),
10808 : .get = py_lsa_TranslatedSid3_get_sid_type,
10809 : .set = py_lsa_TranslatedSid3_set_sid_type,
10810 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidType")
10811 : },
10812 : {
10813 : .name = discard_const_p(char, "sid"),
10814 : .get = py_lsa_TranslatedSid3_get_sid,
10815 : .set = py_lsa_TranslatedSid3_set_sid,
10816 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
10817 : },
10818 : {
10819 : .name = discard_const_p(char, "sid_index"),
10820 : .get = py_lsa_TranslatedSid3_get_sid_index,
10821 : .set = py_lsa_TranslatedSid3_set_sid_index,
10822 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10823 : },
10824 : {
10825 : .name = discard_const_p(char, "flags"),
10826 : .get = py_lsa_TranslatedSid3_get_flags,
10827 : .set = py_lsa_TranslatedSid3_set_flags,
10828 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10829 : },
10830 : { .name = NULL }
10831 : };
10832 :
10833 0 : static PyObject *py_lsa_TranslatedSid3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10834 : {
10835 0 : return pytalloc_new(struct lsa_TranslatedSid3, type);
10836 : }
10837 :
10838 :
10839 : static PyTypeObject lsa_TranslatedSid3_Type = {
10840 : PyVarObject_HEAD_INIT(NULL, 0)
10841 : .tp_name = "lsa.TranslatedSid3",
10842 : .tp_getset = py_lsa_TranslatedSid3_getsetters,
10843 : .tp_methods = NULL,
10844 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10845 : .tp_new = py_lsa_TranslatedSid3_new,
10846 : };
10847 :
10848 :
10849 1 : static PyObject *py_lsa_TransSidArray3_get_count(PyObject *obj, void *closure)
10850 : {
10851 1 : struct lsa_TransSidArray3 *object = pytalloc_get_ptr(obj);
10852 0 : PyObject *py_count;
10853 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
10854 1 : return py_count;
10855 : }
10856 :
10857 0 : static int py_lsa_TransSidArray3_set_count(PyObject *py_obj, PyObject *value, void *closure)
10858 : {
10859 0 : struct lsa_TransSidArray3 *object = pytalloc_get_ptr(py_obj);
10860 0 : if (value == NULL) {
10861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
10862 0 : return -1;
10863 : }
10864 : {
10865 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10866 0 : if (PyLong_Check(value)) {
10867 0 : unsigned long long test_var;
10868 0 : test_var = PyLong_AsUnsignedLongLong(value);
10869 0 : if (PyErr_Occurred() != NULL) {
10870 0 : return -1;
10871 : }
10872 0 : if (test_var > uint_max) {
10873 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10874 : PyLong_Type.tp_name, uint_max, test_var);
10875 0 : return -1;
10876 : }
10877 0 : object->count = test_var;
10878 : } else {
10879 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10880 : PyLong_Type.tp_name);
10881 0 : return -1;
10882 : }
10883 : }
10884 0 : return 0;
10885 : }
10886 :
10887 1 : static PyObject *py_lsa_TransSidArray3_get_sids(PyObject *obj, void *closure)
10888 : {
10889 1 : struct lsa_TransSidArray3 *object = pytalloc_get_ptr(obj);
10890 0 : PyObject *py_sids;
10891 1 : if (object->sids == NULL) {
10892 0 : Py_RETURN_NONE;
10893 : }
10894 1 : if (object->sids == NULL) {
10895 0 : py_sids = Py_None;
10896 0 : Py_INCREF(py_sids);
10897 : } else {
10898 1 : py_sids = PyList_New(object->count);
10899 1 : if (py_sids == NULL) {
10900 0 : return NULL;
10901 : }
10902 : {
10903 : int sids_cntr_1;
10904 2 : for (sids_cntr_1 = 0; sids_cntr_1 < (object->count); sids_cntr_1++) {
10905 0 : PyObject *py_sids_1;
10906 1 : py_sids_1 = pytalloc_reference_ex(&lsa_TranslatedSid3_Type, object->sids, &(object->sids)[sids_cntr_1]);
10907 1 : PyList_SetItem(py_sids, sids_cntr_1, py_sids_1);
10908 : }
10909 : }
10910 : }
10911 1 : return py_sids;
10912 : }
10913 :
10914 0 : static int py_lsa_TransSidArray3_set_sids(PyObject *py_obj, PyObject *value, void *closure)
10915 : {
10916 0 : struct lsa_TransSidArray3 *object = pytalloc_get_ptr(py_obj);
10917 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->sids));
10918 0 : if (value == NULL) {
10919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sids");
10920 0 : return -1;
10921 : }
10922 0 : if (value == Py_None) {
10923 0 : object->sids = NULL;
10924 : } else {
10925 0 : object->sids = NULL;
10926 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10927 : {
10928 0 : int sids_cntr_1;
10929 0 : object->sids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->sids, PyList_GET_SIZE(value));
10930 0 : if (!object->sids) { return -1; }
10931 0 : talloc_set_name_const(object->sids, "ARRAY: object->sids");
10932 0 : for (sids_cntr_1 = 0; sids_cntr_1 < PyList_GET_SIZE(value); sids_cntr_1++) {
10933 0 : if (PyList_GET_ITEM(value, sids_cntr_1) == NULL) {
10934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->sids)[sids_cntr_1]");
10935 0 : return -1;
10936 : }
10937 0 : PY_CHECK_TYPE(&lsa_TranslatedSid3_Type, PyList_GET_ITEM(value, sids_cntr_1), return -1;);
10938 0 : if (talloc_reference(object->sids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, sids_cntr_1))) == NULL) {
10939 0 : PyErr_NoMemory();
10940 0 : return -1;
10941 : }
10942 0 : (object->sids)[sids_cntr_1] = *(struct lsa_TranslatedSid3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, sids_cntr_1));
10943 : }
10944 : }
10945 : }
10946 0 : return 0;
10947 : }
10948 :
10949 : static PyGetSetDef py_lsa_TransSidArray3_getsetters[] = {
10950 : {
10951 : .name = discard_const_p(char, "count"),
10952 : .get = py_lsa_TransSidArray3_get_count,
10953 : .set = py_lsa_TransSidArray3_set_count,
10954 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10955 : },
10956 : {
10957 : .name = discard_const_p(char, "sids"),
10958 : .get = py_lsa_TransSidArray3_get_sids,
10959 : .set = py_lsa_TransSidArray3_set_sids,
10960 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TranslatedSid3")
10961 : },
10962 : { .name = NULL }
10963 : };
10964 :
10965 6 : static PyObject *py_lsa_TransSidArray3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10966 : {
10967 6 : return pytalloc_new(struct lsa_TransSidArray3, type);
10968 : }
10969 :
10970 :
10971 : static PyTypeObject lsa_TransSidArray3_Type = {
10972 : PyVarObject_HEAD_INIT(NULL, 0)
10973 : .tp_name = "lsa.TransSidArray3",
10974 : .tp_getset = py_lsa_TransSidArray3_getsetters,
10975 : .tp_methods = NULL,
10976 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10977 : .tp_new = py_lsa_TransSidArray3_new,
10978 : };
10979 :
10980 :
10981 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_length(PyObject *obj, void *closure)
10982 : {
10983 0 : struct lsa_ForestTrustBinaryData *object = pytalloc_get_ptr(obj);
10984 0 : PyObject *py_length;
10985 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)(object->length));
10986 0 : return py_length;
10987 : }
10988 :
10989 0 : static int py_lsa_ForestTrustBinaryData_set_length(PyObject *py_obj, PyObject *value, void *closure)
10990 : {
10991 0 : struct lsa_ForestTrustBinaryData *object = pytalloc_get_ptr(py_obj);
10992 0 : if (value == NULL) {
10993 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->length");
10994 0 : return -1;
10995 : }
10996 : {
10997 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
10998 0 : if (PyLong_Check(value)) {
10999 0 : unsigned long long test_var;
11000 0 : test_var = PyLong_AsUnsignedLongLong(value);
11001 0 : if (PyErr_Occurred() != NULL) {
11002 0 : return -1;
11003 : }
11004 0 : if (test_var > uint_max) {
11005 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11006 : PyLong_Type.tp_name, uint_max, test_var);
11007 0 : return -1;
11008 : }
11009 0 : object->length = test_var;
11010 : } else {
11011 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11012 : PyLong_Type.tp_name);
11013 0 : return -1;
11014 : }
11015 : }
11016 0 : return 0;
11017 : }
11018 :
11019 0 : static PyObject *py_lsa_ForestTrustBinaryData_get_data(PyObject *obj, void *closure)
11020 : {
11021 0 : struct lsa_ForestTrustBinaryData *object = pytalloc_get_ptr(obj);
11022 0 : PyObject *py_data;
11023 0 : if (object->data == NULL) {
11024 0 : Py_RETURN_NONE;
11025 : }
11026 0 : if (object->data == NULL) {
11027 0 : py_data = Py_None;
11028 0 : Py_INCREF(py_data);
11029 : } else {
11030 0 : py_data = PyList_New(object->length);
11031 0 : if (py_data == NULL) {
11032 0 : return NULL;
11033 : }
11034 : {
11035 : int data_cntr_1;
11036 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
11037 0 : PyObject *py_data_1;
11038 0 : py_data_1 = PyLong_FromLong((uint16_t)((object->data)[data_cntr_1]));
11039 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
11040 : }
11041 : }
11042 : }
11043 0 : return py_data;
11044 : }
11045 :
11046 0 : static int py_lsa_ForestTrustBinaryData_set_data(PyObject *py_obj, PyObject *value, void *closure)
11047 : {
11048 0 : struct lsa_ForestTrustBinaryData *object = pytalloc_get_ptr(py_obj);
11049 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
11050 0 : if (value == NULL) {
11051 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
11052 0 : return -1;
11053 : }
11054 0 : if (value == Py_None) {
11055 0 : object->data = NULL;
11056 : } else {
11057 0 : object->data = NULL;
11058 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11059 : {
11060 0 : int data_cntr_1;
11061 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
11062 0 : if (!object->data) { return -1; }
11063 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
11064 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
11065 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
11066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->data)[data_cntr_1]");
11067 0 : return -1;
11068 : }
11069 : {
11070 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->data)[data_cntr_1]));
11071 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
11072 0 : unsigned long long test_var;
11073 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
11074 0 : if (PyErr_Occurred() != NULL) {
11075 0 : return -1;
11076 : }
11077 0 : if (test_var > uint_max) {
11078 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11079 : PyLong_Type.tp_name, uint_max, test_var);
11080 0 : return -1;
11081 : }
11082 0 : (object->data)[data_cntr_1] = test_var;
11083 : } else {
11084 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11085 : PyLong_Type.tp_name);
11086 0 : return -1;
11087 : }
11088 : }
11089 : }
11090 : }
11091 : }
11092 0 : return 0;
11093 : }
11094 :
11095 : static PyGetSetDef py_lsa_ForestTrustBinaryData_getsetters[] = {
11096 : {
11097 : .name = discard_const_p(char, "length"),
11098 : .get = py_lsa_ForestTrustBinaryData_get_length,
11099 : .set = py_lsa_ForestTrustBinaryData_set_length,
11100 : .doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
11101 : },
11102 : {
11103 : .name = discard_const_p(char, "data"),
11104 : .get = py_lsa_ForestTrustBinaryData_get_data,
11105 : .set = py_lsa_ForestTrustBinaryData_set_data,
11106 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
11107 : },
11108 : { .name = NULL }
11109 : };
11110 :
11111 0 : static PyObject *py_lsa_ForestTrustBinaryData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11112 : {
11113 0 : return pytalloc_new(struct lsa_ForestTrustBinaryData, type);
11114 : }
11115 :
11116 :
11117 : static PyTypeObject lsa_ForestTrustBinaryData_Type = {
11118 : PyVarObject_HEAD_INIT(NULL, 0)
11119 : .tp_name = "lsa.ForestTrustBinaryData",
11120 : .tp_getset = py_lsa_ForestTrustBinaryData_getsetters,
11121 : .tp_methods = NULL,
11122 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11123 : .tp_new = py_lsa_ForestTrustBinaryData_new,
11124 : };
11125 :
11126 :
11127 334 : static PyObject *py_lsa_ForestTrustDomainInfo_get_domain_sid(PyObject *obj, void *closure)
11128 : {
11129 334 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(obj);
11130 4 : PyObject *py_domain_sid;
11131 334 : if (object->domain_sid == NULL) {
11132 0 : Py_RETURN_NONE;
11133 : }
11134 334 : if (object->domain_sid == NULL) {
11135 0 : py_domain_sid = Py_None;
11136 0 : Py_INCREF(py_domain_sid);
11137 : } else {
11138 334 : py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
11139 : }
11140 334 : return py_domain_sid;
11141 : }
11142 :
11143 0 : static int py_lsa_ForestTrustDomainInfo_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
11144 : {
11145 0 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(py_obj);
11146 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
11147 0 : if (value == NULL) {
11148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->domain_sid");
11149 0 : return -1;
11150 : }
11151 0 : if (value == Py_None) {
11152 0 : object->domain_sid = NULL;
11153 : } else {
11154 0 : object->domain_sid = NULL;
11155 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
11156 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11157 0 : PyErr_NoMemory();
11158 0 : return -1;
11159 : }
11160 0 : object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
11161 : }
11162 0 : return 0;
11163 : }
11164 :
11165 326 : static PyObject *py_lsa_ForestTrustDomainInfo_get_dns_domain_name(PyObject *obj, void *closure)
11166 : {
11167 326 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(obj);
11168 4 : PyObject *py_dns_domain_name;
11169 326 : py_dns_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->dns_domain_name);
11170 326 : return py_dns_domain_name;
11171 : }
11172 :
11173 0 : static int py_lsa_ForestTrustDomainInfo_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
11174 : {
11175 0 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(py_obj);
11176 0 : if (value == NULL) {
11177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dns_domain_name");
11178 0 : return -1;
11179 : }
11180 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
11181 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11182 0 : PyErr_NoMemory();
11183 0 : return -1;
11184 : }
11185 0 : object->dns_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
11186 0 : return 0;
11187 : }
11188 :
11189 334 : static PyObject *py_lsa_ForestTrustDomainInfo_get_netbios_domain_name(PyObject *obj, void *closure)
11190 : {
11191 334 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(obj);
11192 4 : PyObject *py_netbios_domain_name;
11193 334 : py_netbios_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->netbios_domain_name);
11194 334 : return py_netbios_domain_name;
11195 : }
11196 :
11197 0 : static int py_lsa_ForestTrustDomainInfo_set_netbios_domain_name(PyObject *py_obj, PyObject *value, void *closure)
11198 : {
11199 0 : struct lsa_ForestTrustDomainInfo *object = pytalloc_get_ptr(py_obj);
11200 0 : if (value == NULL) {
11201 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->netbios_domain_name");
11202 0 : return -1;
11203 : }
11204 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
11205 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11206 0 : PyErr_NoMemory();
11207 0 : return -1;
11208 : }
11209 0 : object->netbios_domain_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
11210 0 : return 0;
11211 : }
11212 :
11213 : static PyGetSetDef py_lsa_ForestTrustDomainInfo_getsetters[] = {
11214 : {
11215 : .name = discard_const_p(char, "domain_sid"),
11216 : .get = py_lsa_ForestTrustDomainInfo_get_domain_sid,
11217 : .set = py_lsa_ForestTrustDomainInfo_set_domain_sid,
11218 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
11219 : },
11220 : {
11221 : .name = discard_const_p(char, "dns_domain_name"),
11222 : .get = py_lsa_ForestTrustDomainInfo_get_dns_domain_name,
11223 : .set = py_lsa_ForestTrustDomainInfo_set_dns_domain_name,
11224 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
11225 : },
11226 : {
11227 : .name = discard_const_p(char, "netbios_domain_name"),
11228 : .get = py_lsa_ForestTrustDomainInfo_get_netbios_domain_name,
11229 : .set = py_lsa_ForestTrustDomainInfo_set_netbios_domain_name,
11230 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
11231 : },
11232 : { .name = NULL }
11233 : };
11234 :
11235 0 : static PyObject *py_lsa_ForestTrustDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11236 : {
11237 0 : return pytalloc_new(struct lsa_ForestTrustDomainInfo, type);
11238 : }
11239 :
11240 :
11241 : static PyTypeObject lsa_ForestTrustDomainInfo_Type = {
11242 : PyVarObject_HEAD_INIT(NULL, 0)
11243 : .tp_name = "lsa.ForestTrustDomainInfo",
11244 : .tp_getset = py_lsa_ForestTrustDomainInfo_getsetters,
11245 : .tp_methods = NULL,
11246 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11247 : .tp_new = py_lsa_ForestTrustDomainInfo_new,
11248 : };
11249 :
11250 1982 : static PyObject *py_import_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData *in)
11251 : {
11252 12 : PyObject *ret;
11253 :
11254 1982 : switch (level) {
11255 1560 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
11256 1560 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
11257 1560 : return ret;
11258 :
11259 80 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
11260 80 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
11261 80 : return ret;
11262 :
11263 342 : case LSA_FOREST_TRUST_DOMAIN_INFO:
11264 342 : ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
11265 342 : return ret;
11266 :
11267 0 : default:
11268 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
11269 0 : return ret;
11270 :
11271 : }
11272 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11273 : return NULL;
11274 : }
11275 :
11276 0 : static union lsa_ForestTrustData *py_export_lsa_ForestTrustData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11277 : {
11278 0 : union lsa_ForestTrustData *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData);
11279 0 : switch (level) {
11280 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
11281 0 : if (in == NULL) {
11282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->top_level_name");
11283 0 : talloc_free(ret); return NULL;
11284 : }
11285 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
11286 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11287 0 : PyErr_NoMemory();
11288 0 : talloc_free(ret); return NULL;
11289 : }
11290 0 : ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
11291 0 : break;
11292 :
11293 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
11294 0 : if (in == NULL) {
11295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->top_level_name_ex");
11296 0 : talloc_free(ret); return NULL;
11297 : }
11298 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
11299 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11300 0 : PyErr_NoMemory();
11301 0 : talloc_free(ret); return NULL;
11302 : }
11303 0 : ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
11304 0 : break;
11305 :
11306 0 : case LSA_FOREST_TRUST_DOMAIN_INFO:
11307 0 : if (in == NULL) {
11308 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->domain_info");
11309 0 : talloc_free(ret); return NULL;
11310 : }
11311 0 : PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
11312 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11313 0 : PyErr_NoMemory();
11314 0 : talloc_free(ret); return NULL;
11315 : }
11316 0 : ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
11317 0 : break;
11318 :
11319 0 : default:
11320 0 : if (in == NULL) {
11321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->data");
11322 0 : talloc_free(ret); return NULL;
11323 : }
11324 0 : PY_CHECK_TYPE(&lsa_ForestTrustBinaryData_Type, in, talloc_free(ret); return NULL;);
11325 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11326 0 : PyErr_NoMemory();
11327 0 : talloc_free(ret); return NULL;
11328 : }
11329 0 : ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
11330 0 : break;
11331 :
11332 : }
11333 :
11334 0 : return ret;
11335 : }
11336 :
11337 1982 : static PyObject *py_lsa_ForestTrustData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11338 : {
11339 1982 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11340 1982 : PyObject *mem_ctx_obj = NULL;
11341 1982 : TALLOC_CTX *mem_ctx = NULL;
11342 1982 : int level = 0;
11343 1982 : PyObject *in_obj = NULL;
11344 1982 : union lsa_ForestTrustData *in = NULL;
11345 :
11346 1982 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11347 : discard_const_p(char *, kwnames),
11348 : &mem_ctx_obj,
11349 : &level,
11350 : &in_obj)) {
11351 0 : return NULL;
11352 : }
11353 1982 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11354 1982 : if (mem_ctx == NULL) {
11355 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11356 0 : return NULL;
11357 : }
11358 1982 : in = (union lsa_ForestTrustData *)pytalloc_get_ptr(in_obj);
11359 1982 : if (in == NULL) {
11360 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_ForestTrustData!");
11361 0 : return NULL;
11362 : }
11363 :
11364 1982 : return py_import_lsa_ForestTrustData(mem_ctx, level, in);
11365 : }
11366 :
11367 0 : static PyObject *py_lsa_ForestTrustData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11368 : {
11369 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11370 0 : PyObject *mem_ctx_obj = NULL;
11371 0 : TALLOC_CTX *mem_ctx = NULL;
11372 0 : int level = 0;
11373 0 : PyObject *in = NULL;
11374 0 : union lsa_ForestTrustData *out = NULL;
11375 :
11376 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11377 : discard_const_p(char *, kwnames),
11378 : &mem_ctx_obj,
11379 : &level,
11380 : &in)) {
11381 0 : return NULL;
11382 : }
11383 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11384 0 : if (mem_ctx == NULL) {
11385 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11386 0 : return NULL;
11387 : }
11388 :
11389 0 : out = py_export_lsa_ForestTrustData(mem_ctx, level, in);
11390 0 : if (out == NULL) {
11391 0 : return NULL;
11392 : }
11393 :
11394 0 : return pytalloc_GenericObject_reference(out);
11395 : }
11396 :
11397 : static PyMethodDef py_lsa_ForestTrustData_methods[] = {
11398 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_import),
11399 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11400 : "T.__import__(mem_ctx, level, in) => ret." },
11401 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData_export),
11402 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11403 : "T.__export__(mem_ctx, level, in) => ret." },
11404 : { NULL, NULL, 0, NULL }
11405 : };
11406 :
11407 0 : static PyObject *py_lsa_ForestTrustData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11408 : {
11409 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11410 0 : return NULL;
11411 : }
11412 :
11413 :
11414 : static PyTypeObject lsa_ForestTrustData_Type = {
11415 : PyVarObject_HEAD_INIT(NULL, 0)
11416 : .tp_name = "lsa.ForestTrustData",
11417 : .tp_getset = NULL,
11418 : .tp_methods = py_lsa_ForestTrustData_methods,
11419 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11420 : .tp_new = py_lsa_ForestTrustData_new,
11421 : };
11422 :
11423 :
11424 1922 : static PyObject *py_lsa_ForestTrustRecord_get_flags(PyObject *obj, void *closure)
11425 : {
11426 1922 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(obj);
11427 12 : PyObject *py_flags;
11428 1922 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
11429 1922 : return py_flags;
11430 : }
11431 :
11432 52 : static int py_lsa_ForestTrustRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11433 : {
11434 52 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(py_obj);
11435 52 : if (value == NULL) {
11436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
11437 0 : return -1;
11438 : }
11439 : {
11440 52 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11441 52 : if (PyLong_Check(value)) {
11442 0 : unsigned long long test_var;
11443 52 : test_var = PyLong_AsUnsignedLongLong(value);
11444 52 : if (PyErr_Occurred() != NULL) {
11445 0 : return -1;
11446 : }
11447 52 : if (test_var > uint_max) {
11448 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11449 : PyLong_Type.tp_name, uint_max, test_var);
11450 0 : return -1;
11451 : }
11452 52 : object->flags = test_var;
11453 : } else {
11454 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11455 : PyLong_Type.tp_name);
11456 0 : return -1;
11457 : }
11458 : }
11459 52 : return 0;
11460 : }
11461 :
11462 2866 : static PyObject *py_lsa_ForestTrustRecord_get_type(PyObject *obj, void *closure)
11463 : {
11464 2866 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(obj);
11465 20 : PyObject *py_type;
11466 2866 : py_type = PyLong_FromLong((uint16_t)(object->type));
11467 2866 : return py_type;
11468 : }
11469 :
11470 8 : static int py_lsa_ForestTrustRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11471 : {
11472 8 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(py_obj);
11473 8 : if (value == NULL) {
11474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
11475 0 : return -1;
11476 : }
11477 : {
11478 8 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11479 8 : if (PyLong_Check(value)) {
11480 0 : unsigned long long test_var;
11481 8 : test_var = PyLong_AsUnsignedLongLong(value);
11482 8 : if (PyErr_Occurred() != NULL) {
11483 0 : return -1;
11484 : }
11485 8 : if (test_var > uint_max) {
11486 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11487 : PyLong_Type.tp_name, uint_max, test_var);
11488 0 : return -1;
11489 : }
11490 8 : object->type = test_var;
11491 : } else {
11492 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11493 : PyLong_Type.tp_name);
11494 0 : return -1;
11495 : }
11496 : }
11497 8 : return 0;
11498 : }
11499 :
11500 0 : static PyObject *py_lsa_ForestTrustRecord_get_time(PyObject *obj, void *closure)
11501 : {
11502 0 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(obj);
11503 0 : PyObject *py_time;
11504 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
11505 0 : return py_time;
11506 : }
11507 :
11508 40 : static int py_lsa_ForestTrustRecord_set_time(PyObject *py_obj, PyObject *value, void *closure)
11509 : {
11510 40 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(py_obj);
11511 40 : if (value == NULL) {
11512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
11513 0 : return -1;
11514 : }
11515 : {
11516 40 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
11517 40 : if (PyLong_Check(value)) {
11518 0 : unsigned long long test_var;
11519 40 : test_var = PyLong_AsUnsignedLongLong(value);
11520 40 : if (PyErr_Occurred() != NULL) {
11521 0 : return -1;
11522 : }
11523 40 : if (test_var > uint_max) {
11524 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11525 : PyLong_Type.tp_name, uint_max, test_var);
11526 0 : return -1;
11527 : }
11528 40 : object->time = test_var;
11529 : } else {
11530 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11531 : PyLong_Type.tp_name);
11532 0 : return -1;
11533 : }
11534 : }
11535 40 : return 0;
11536 : }
11537 :
11538 1982 : static PyObject *py_lsa_ForestTrustRecord_get_forest_trust_data(PyObject *obj, void *closure)
11539 : {
11540 1982 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(obj);
11541 12 : PyObject *py_forest_trust_data;
11542 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");
11543 1982 : if (py_forest_trust_data == NULL) {
11544 0 : return NULL;
11545 : }
11546 1970 : return py_forest_trust_data;
11547 : }
11548 :
11549 0 : static int py_lsa_ForestTrustRecord_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
11550 : {
11551 0 : struct lsa_ForestTrustRecord *object = pytalloc_get_ptr(py_obj);
11552 0 : if (value == NULL) {
11553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest_trust_data");
11554 0 : return -1;
11555 : }
11556 : {
11557 0 : union lsa_ForestTrustData *forest_trust_data_switch_0;
11558 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");
11559 0 : if (forest_trust_data_switch_0 == NULL) {
11560 0 : return -1;
11561 : }
11562 0 : object->forest_trust_data = *forest_trust_data_switch_0;
11563 : }
11564 0 : return 0;
11565 : }
11566 :
11567 : static PyGetSetDef py_lsa_ForestTrustRecord_getsetters[] = {
11568 : {
11569 : .name = discard_const_p(char, "flags"),
11570 : .get = py_lsa_ForestTrustRecord_get_flags,
11571 : .set = py_lsa_ForestTrustRecord_set_flags,
11572 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11573 : },
11574 : {
11575 : .name = discard_const_p(char, "type"),
11576 : .get = py_lsa_ForestTrustRecord_get_type,
11577 : .set = py_lsa_ForestTrustRecord_set_type,
11578 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
11579 : },
11580 : {
11581 : .name = discard_const_p(char, "time"),
11582 : .get = py_lsa_ForestTrustRecord_get_time,
11583 : .set = py_lsa_ForestTrustRecord_set_time,
11584 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
11585 : },
11586 : {
11587 : .name = discard_const_p(char, "forest_trust_data"),
11588 : .get = py_lsa_ForestTrustRecord_get_forest_trust_data,
11589 : .set = py_lsa_ForestTrustRecord_set_forest_trust_data,
11590 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustData")
11591 : },
11592 : { .name = NULL }
11593 : };
11594 :
11595 8 : static PyObject *py_lsa_ForestTrustRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11596 : {
11597 8 : return pytalloc_new(struct lsa_ForestTrustRecord, type);
11598 : }
11599 :
11600 :
11601 : static PyTypeObject lsa_ForestTrustRecord_Type = {
11602 : PyVarObject_HEAD_INIT(NULL, 0)
11603 : .tp_name = "lsa.ForestTrustRecord",
11604 : .tp_getset = py_lsa_ForestTrustRecord_getsetters,
11605 : .tp_methods = NULL,
11606 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11607 : .tp_new = py_lsa_ForestTrustRecord_new,
11608 : };
11609 :
11610 :
11611 0 : static PyObject *py_lsa_ForestTrustInformation_get_count(PyObject *obj, void *closure)
11612 : {
11613 0 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(obj);
11614 0 : PyObject *py_count;
11615 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
11616 0 : return py_count;
11617 : }
11618 :
11619 64 : static int py_lsa_ForestTrustInformation_set_count(PyObject *py_obj, PyObject *value, void *closure)
11620 : {
11621 64 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(py_obj);
11622 64 : if (value == NULL) {
11623 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
11624 0 : return -1;
11625 : }
11626 : {
11627 64 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11628 64 : if (PyLong_Check(value)) {
11629 0 : unsigned long long test_var;
11630 64 : test_var = PyLong_AsUnsignedLongLong(value);
11631 64 : if (PyErr_Occurred() != NULL) {
11632 0 : return -1;
11633 : }
11634 64 : if (test_var > uint_max) {
11635 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11636 : PyLong_Type.tp_name, uint_max, test_var);
11637 0 : return -1;
11638 : }
11639 64 : object->count = test_var;
11640 : } else {
11641 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11642 : PyLong_Type.tp_name);
11643 0 : return -1;
11644 : }
11645 : }
11646 64 : return 0;
11647 : }
11648 :
11649 880 : static PyObject *py_lsa_ForestTrustInformation_get_entries(PyObject *obj, void *closure)
11650 : {
11651 880 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(obj);
11652 8 : PyObject *py_entries;
11653 880 : if (object->entries == NULL) {
11654 0 : Py_RETURN_NONE;
11655 : }
11656 880 : if (object->entries == NULL) {
11657 0 : py_entries = Py_None;
11658 0 : Py_INCREF(py_entries);
11659 : } else {
11660 880 : py_entries = PyList_New(object->count);
11661 880 : if (py_entries == NULL) {
11662 0 : return NULL;
11663 : }
11664 : {
11665 : int entries_cntr_1;
11666 6220 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11667 24 : PyObject *py_entries_1;
11668 5340 : if ((object->entries)[entries_cntr_1] == NULL) {
11669 0 : py_entries_1 = Py_None;
11670 0 : Py_INCREF(py_entries_1);
11671 : } else {
11672 5340 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord_Type, (object->entries)[entries_cntr_1], (object->entries)[entries_cntr_1]);
11673 : }
11674 5340 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11675 : }
11676 : }
11677 : }
11678 872 : return py_entries;
11679 : }
11680 :
11681 64 : static int py_lsa_ForestTrustInformation_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11682 : {
11683 64 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(py_obj);
11684 64 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11685 64 : if (value == NULL) {
11686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->entries");
11687 0 : return -1;
11688 : }
11689 64 : if (value == Py_None) {
11690 0 : object->entries = NULL;
11691 : } else {
11692 64 : object->entries = NULL;
11693 64 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11694 : {
11695 0 : int entries_cntr_1;
11696 64 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11697 64 : if (!object->entries) { return -1; }
11698 64 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11699 544 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11700 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->entries)[entries_cntr_1]");
11702 0 : return -1;
11703 : }
11704 480 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
11705 0 : (object->entries)[entries_cntr_1] = NULL;
11706 : } else {
11707 480 : (object->entries)[entries_cntr_1] = NULL;
11708 480 : PY_CHECK_TYPE(&lsa_ForestTrustRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11709 480 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11710 0 : PyErr_NoMemory();
11711 0 : return -1;
11712 : }
11713 480 : (object->entries)[entries_cntr_1] = (struct lsa_ForestTrustRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11714 : }
11715 : }
11716 : }
11717 : }
11718 64 : return 0;
11719 : }
11720 :
11721 : static PyGetSetDef py_lsa_ForestTrustInformation_getsetters[] = {
11722 : {
11723 : .name = discard_const_p(char, "count"),
11724 : .get = py_lsa_ForestTrustInformation_get_count,
11725 : .set = py_lsa_ForestTrustInformation_set_count,
11726 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11727 : },
11728 : {
11729 : .name = discard_const_p(char, "entries"),
11730 : .get = py_lsa_ForestTrustInformation_get_entries,
11731 : .set = py_lsa_ForestTrustInformation_set_entries,
11732 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecord")
11733 : },
11734 : { .name = NULL }
11735 : };
11736 :
11737 48 : static PyObject *py_lsa_ForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11738 : {
11739 48 : return pytalloc_new(struct lsa_ForestTrustInformation, type);
11740 : }
11741 :
11742 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11743 : {
11744 0 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(py_obj);
11745 0 : PyObject *ret = NULL;
11746 0 : DATA_BLOB blob;
11747 0 : enum ndr_err_code err;
11748 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
11749 0 : if (tmp_ctx == NULL) {
11750 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
11751 0 : return NULL;
11752 : }
11753 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustInformation);
11754 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11755 0 : TALLOC_FREE(tmp_ctx);
11756 0 : PyErr_SetNdrError(err);
11757 0 : return NULL;
11758 : }
11759 :
11760 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
11761 0 : TALLOC_FREE(tmp_ctx);
11762 0 : return ret;
11763 : }
11764 :
11765 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
11766 : {
11767 0 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(py_obj);
11768 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
11769 0 : Py_ssize_t blob_length = 0;
11770 0 : enum ndr_err_code err;
11771 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
11772 0 : PyObject *allow_remaining_obj = NULL;
11773 0 : bool allow_remaining = false;
11774 :
11775 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
11776 : discard_const_p(char *, kwnames),
11777 : &blob.data, &blob_length,
11778 : &allow_remaining_obj)) {
11779 0 : return NULL;
11780 : }
11781 0 : blob.length = blob_length;
11782 :
11783 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
11784 0 : allow_remaining = true;
11785 : }
11786 :
11787 0 : if (allow_remaining) {
11788 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11789 : } else {
11790 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation);
11791 : }
11792 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
11793 0 : PyErr_SetNdrError(err);
11794 0 : return NULL;
11795 : }
11796 :
11797 0 : Py_RETURN_NONE;
11798 : }
11799 :
11800 0 : static PyObject *py_lsa_ForestTrustInformation_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
11801 : {
11802 0 : struct lsa_ForestTrustInformation *object = pytalloc_get_ptr(py_obj);
11803 0 : PyObject *ret;
11804 0 : char *retstr;
11805 :
11806 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustInformation, "lsa_ForestTrustInformation", object);
11807 0 : ret = PyUnicode_FromString(retstr);
11808 0 : talloc_free(retstr);
11809 :
11810 0 : return ret;
11811 : }
11812 :
11813 : static PyMethodDef py_lsa_ForestTrustInformation_methods[] = {
11814 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
11815 : { "__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" },
11816 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustInformation_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
11817 : { NULL, NULL, 0, NULL }
11818 : };
11819 :
11820 :
11821 : static PyTypeObject lsa_ForestTrustInformation_Type = {
11822 : PyVarObject_HEAD_INIT(NULL, 0)
11823 : .tp_name = "lsa.ForestTrustInformation",
11824 : .tp_getset = py_lsa_ForestTrustInformation_getsetters,
11825 : .tp_methods = py_lsa_ForestTrustInformation_methods,
11826 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11827 : .tp_new = py_lsa_ForestTrustInformation_new,
11828 : };
11829 :
11830 :
11831 224 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_index(PyObject *obj, void *closure)
11832 : {
11833 224 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(obj);
11834 0 : PyObject *py_index;
11835 224 : py_index = PyLong_FromUnsignedLongLong((uint32_t)(object->index));
11836 224 : return py_index;
11837 : }
11838 :
11839 0 : static int py_lsa_ForestTrustCollisionRecord_set_index(PyObject *py_obj, PyObject *value, void *closure)
11840 : {
11841 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
11842 0 : if (value == NULL) {
11843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->index");
11844 0 : return -1;
11845 : }
11846 : {
11847 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->index));
11848 0 : if (PyLong_Check(value)) {
11849 0 : unsigned long long test_var;
11850 0 : test_var = PyLong_AsUnsignedLongLong(value);
11851 0 : if (PyErr_Occurred() != NULL) {
11852 0 : return -1;
11853 : }
11854 0 : if (test_var > uint_max) {
11855 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11856 : PyLong_Type.tp_name, uint_max, test_var);
11857 0 : return -1;
11858 : }
11859 0 : object->index = test_var;
11860 : } else {
11861 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11862 : PyLong_Type.tp_name);
11863 0 : return -1;
11864 : }
11865 : }
11866 0 : return 0;
11867 : }
11868 :
11869 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_type(PyObject *obj, void *closure)
11870 : {
11871 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(obj);
11872 0 : PyObject *py_type;
11873 0 : py_type = PyLong_FromUnsignedLongLong((uint32_t)(object->type));
11874 0 : return py_type;
11875 : }
11876 :
11877 0 : static int py_lsa_ForestTrustCollisionRecord_set_type(PyObject *py_obj, PyObject *value, void *closure)
11878 : {
11879 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
11880 0 : if (value == NULL) {
11881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
11882 0 : return -1;
11883 : }
11884 : {
11885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
11886 0 : if (PyLong_Check(value)) {
11887 0 : unsigned long long test_var;
11888 0 : test_var = PyLong_AsUnsignedLongLong(value);
11889 0 : if (PyErr_Occurred() != NULL) {
11890 0 : return -1;
11891 : }
11892 0 : if (test_var > uint_max) {
11893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11894 : PyLong_Type.tp_name, uint_max, test_var);
11895 0 : return -1;
11896 : }
11897 0 : object->type = test_var;
11898 : } else {
11899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11900 : PyLong_Type.tp_name);
11901 0 : return -1;
11902 : }
11903 : }
11904 0 : return 0;
11905 : }
11906 :
11907 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_flags(PyObject *obj, void *closure)
11908 : {
11909 32 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(obj);
11910 0 : PyObject *py_flags;
11911 32 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
11912 32 : return py_flags;
11913 : }
11914 :
11915 0 : static int py_lsa_ForestTrustCollisionRecord_set_flags(PyObject *py_obj, PyObject *value, void *closure)
11916 : {
11917 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
11918 0 : if (value == NULL) {
11919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
11920 0 : return -1;
11921 : }
11922 : {
11923 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
11924 0 : if (PyLong_Check(value)) {
11925 0 : unsigned long long test_var;
11926 0 : test_var = PyLong_AsUnsignedLongLong(value);
11927 0 : if (PyErr_Occurred() != NULL) {
11928 0 : return -1;
11929 : }
11930 0 : if (test_var > uint_max) {
11931 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11932 : PyLong_Type.tp_name, uint_max, test_var);
11933 0 : return -1;
11934 : }
11935 0 : object->flags = test_var;
11936 : } else {
11937 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11938 : PyLong_Type.tp_name);
11939 0 : return -1;
11940 : }
11941 : }
11942 0 : return 0;
11943 : }
11944 :
11945 32 : static PyObject *py_lsa_ForestTrustCollisionRecord_get_name(PyObject *obj, void *closure)
11946 : {
11947 32 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(obj);
11948 0 : PyObject *py_name;
11949 32 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
11950 32 : return py_name;
11951 : }
11952 :
11953 0 : static int py_lsa_ForestTrustCollisionRecord_set_name(PyObject *py_obj, PyObject *value, void *closure)
11954 : {
11955 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
11956 0 : if (value == NULL) {
11957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
11958 0 : return -1;
11959 : }
11960 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
11961 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11962 0 : PyErr_NoMemory();
11963 0 : return -1;
11964 : }
11965 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
11966 0 : return 0;
11967 : }
11968 :
11969 : static PyGetSetDef py_lsa_ForestTrustCollisionRecord_getsetters[] = {
11970 : {
11971 : .name = discard_const_p(char, "index"),
11972 : .get = py_lsa_ForestTrustCollisionRecord_get_index,
11973 : .set = py_lsa_ForestTrustCollisionRecord_set_index,
11974 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11975 : },
11976 : {
11977 : .name = discard_const_p(char, "type"),
11978 : .get = py_lsa_ForestTrustCollisionRecord_get_type,
11979 : .set = py_lsa_ForestTrustCollisionRecord_set_type,
11980 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecordType")
11981 : },
11982 : {
11983 : .name = discard_const_p(char, "flags"),
11984 : .get = py_lsa_ForestTrustCollisionRecord_get_flags,
11985 : .set = py_lsa_ForestTrustCollisionRecord_set_flags,
11986 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
11987 : },
11988 : {
11989 : .name = discard_const_p(char, "name"),
11990 : .get = py_lsa_ForestTrustCollisionRecord_get_name,
11991 : .set = py_lsa_ForestTrustCollisionRecord_set_name,
11992 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11993 : },
11994 : { .name = NULL }
11995 : };
11996 :
11997 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11998 : {
11999 0 : return pytalloc_new(struct lsa_ForestTrustCollisionRecord, type);
12000 : }
12001 :
12002 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12003 : {
12004 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
12005 0 : PyObject *ret = NULL;
12006 0 : DATA_BLOB blob;
12007 0 : enum ndr_err_code err;
12008 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
12009 0 : if (tmp_ctx == NULL) {
12010 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12011 0 : return NULL;
12012 : }
12013 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionRecord);
12014 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12015 0 : TALLOC_FREE(tmp_ctx);
12016 0 : PyErr_SetNdrError(err);
12017 0 : return NULL;
12018 : }
12019 :
12020 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12021 0 : TALLOC_FREE(tmp_ctx);
12022 0 : return ret;
12023 : }
12024 :
12025 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12026 : {
12027 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
12028 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
12029 0 : Py_ssize_t blob_length = 0;
12030 0 : enum ndr_err_code err;
12031 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
12032 0 : PyObject *allow_remaining_obj = NULL;
12033 0 : bool allow_remaining = false;
12034 :
12035 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
12036 : discard_const_p(char *, kwnames),
12037 : &blob.data, &blob_length,
12038 : &allow_remaining_obj)) {
12039 0 : return NULL;
12040 : }
12041 0 : blob.length = blob_length;
12042 :
12043 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12044 0 : allow_remaining = true;
12045 : }
12046 :
12047 0 : if (allow_remaining) {
12048 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
12049 : } else {
12050 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionRecord);
12051 : }
12052 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12053 0 : PyErr_SetNdrError(err);
12054 0 : return NULL;
12055 : }
12056 :
12057 0 : Py_RETURN_NONE;
12058 : }
12059 :
12060 0 : static PyObject *py_lsa_ForestTrustCollisionRecord_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12061 : {
12062 0 : struct lsa_ForestTrustCollisionRecord *object = pytalloc_get_ptr(py_obj);
12063 0 : PyObject *ret;
12064 0 : char *retstr;
12065 :
12066 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionRecord, "lsa_ForestTrustCollisionRecord", object);
12067 0 : ret = PyUnicode_FromString(retstr);
12068 0 : talloc_free(retstr);
12069 :
12070 0 : return ret;
12071 : }
12072 :
12073 : static PyMethodDef py_lsa_ForestTrustCollisionRecord_methods[] = {
12074 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12075 : { "__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" },
12076 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionRecord_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12077 : { NULL, NULL, 0, NULL }
12078 : };
12079 :
12080 :
12081 : static PyTypeObject lsa_ForestTrustCollisionRecord_Type = {
12082 : PyVarObject_HEAD_INIT(NULL, 0)
12083 : .tp_name = "lsa.ForestTrustCollisionRecord",
12084 : .tp_getset = py_lsa_ForestTrustCollisionRecord_getsetters,
12085 : .tp_methods = py_lsa_ForestTrustCollisionRecord_methods,
12086 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12087 : .tp_new = py_lsa_ForestTrustCollisionRecord_new,
12088 : };
12089 :
12090 :
12091 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_count(PyObject *obj, void *closure)
12092 : {
12093 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(obj);
12094 0 : PyObject *py_count;
12095 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
12096 0 : return py_count;
12097 : }
12098 :
12099 0 : static int py_lsa_ForestTrustCollisionInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
12100 : {
12101 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(py_obj);
12102 0 : if (value == NULL) {
12103 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
12104 0 : return -1;
12105 : }
12106 : {
12107 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
12108 0 : if (PyLong_Check(value)) {
12109 0 : unsigned long long test_var;
12110 0 : test_var = PyLong_AsUnsignedLongLong(value);
12111 0 : if (PyErr_Occurred() != NULL) {
12112 0 : return -1;
12113 : }
12114 0 : if (test_var > uint_max) {
12115 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12116 : PyLong_Type.tp_name, uint_max, test_var);
12117 0 : return -1;
12118 : }
12119 0 : object->count = test_var;
12120 : } else {
12121 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12122 : PyLong_Type.tp_name);
12123 0 : return -1;
12124 : }
12125 : }
12126 0 : return 0;
12127 : }
12128 :
12129 112 : static PyObject *py_lsa_ForestTrustCollisionInfo_get_entries(PyObject *obj, void *closure)
12130 : {
12131 112 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(obj);
12132 0 : PyObject *py_entries;
12133 112 : if (object->entries == NULL) {
12134 0 : Py_RETURN_NONE;
12135 : }
12136 112 : if (object->entries == NULL) {
12137 0 : py_entries = Py_None;
12138 0 : Py_INCREF(py_entries);
12139 : } else {
12140 112 : py_entries = PyList_New(object->count);
12141 112 : if (py_entries == NULL) {
12142 0 : return NULL;
12143 : }
12144 : {
12145 : int entries_cntr_1;
12146 336 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
12147 0 : PyObject *py_entries_1;
12148 224 : if ((object->entries)[entries_cntr_1] == NULL) {
12149 0 : py_entries_1 = Py_None;
12150 0 : Py_INCREF(py_entries_1);
12151 : } else {
12152 224 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustCollisionRecord_Type, (object->entries)[entries_cntr_1], (object->entries)[entries_cntr_1]);
12153 : }
12154 224 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
12155 : }
12156 : }
12157 : }
12158 112 : return py_entries;
12159 : }
12160 :
12161 0 : static int py_lsa_ForestTrustCollisionInfo_set_entries(PyObject *py_obj, PyObject *value, void *closure)
12162 : {
12163 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(py_obj);
12164 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
12165 0 : if (value == NULL) {
12166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->entries");
12167 0 : return -1;
12168 : }
12169 0 : if (value == Py_None) {
12170 0 : object->entries = NULL;
12171 : } else {
12172 0 : object->entries = NULL;
12173 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12174 : {
12175 0 : int entries_cntr_1;
12176 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
12177 0 : if (!object->entries) { return -1; }
12178 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
12179 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
12180 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
12181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->entries)[entries_cntr_1]");
12182 0 : return -1;
12183 : }
12184 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
12185 0 : (object->entries)[entries_cntr_1] = NULL;
12186 : } else {
12187 0 : (object->entries)[entries_cntr_1] = NULL;
12188 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionRecord_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
12189 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
12190 0 : PyErr_NoMemory();
12191 0 : return -1;
12192 : }
12193 0 : (object->entries)[entries_cntr_1] = (struct lsa_ForestTrustCollisionRecord *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
12194 : }
12195 : }
12196 : }
12197 : }
12198 0 : return 0;
12199 : }
12200 :
12201 : static PyGetSetDef py_lsa_ForestTrustCollisionInfo_getsetters[] = {
12202 : {
12203 : .name = discard_const_p(char, "count"),
12204 : .get = py_lsa_ForestTrustCollisionInfo_get_count,
12205 : .set = py_lsa_ForestTrustCollisionInfo_set_count,
12206 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12207 : },
12208 : {
12209 : .name = discard_const_p(char, "entries"),
12210 : .get = py_lsa_ForestTrustCollisionInfo_get_entries,
12211 : .set = py_lsa_ForestTrustCollisionInfo_set_entries,
12212 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionRecord")
12213 : },
12214 : { .name = NULL }
12215 : };
12216 :
12217 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12218 : {
12219 0 : return pytalloc_new(struct lsa_ForestTrustCollisionInfo, type);
12220 : }
12221 :
12222 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12223 : {
12224 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(py_obj);
12225 0 : PyObject *ret = NULL;
12226 0 : DATA_BLOB blob;
12227 0 : enum ndr_err_code err;
12228 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
12229 0 : if (tmp_ctx == NULL) {
12230 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
12231 0 : return NULL;
12232 : }
12233 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustCollisionInfo);
12234 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12235 0 : TALLOC_FREE(tmp_ctx);
12236 0 : PyErr_SetNdrError(err);
12237 0 : return NULL;
12238 : }
12239 :
12240 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
12241 0 : TALLOC_FREE(tmp_ctx);
12242 0 : return ret;
12243 : }
12244 :
12245 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
12246 : {
12247 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(py_obj);
12248 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
12249 0 : Py_ssize_t blob_length = 0;
12250 0 : enum ndr_err_code err;
12251 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
12252 0 : PyObject *allow_remaining_obj = NULL;
12253 0 : bool allow_remaining = false;
12254 :
12255 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
12256 : discard_const_p(char *, kwnames),
12257 : &blob.data, &blob_length,
12258 : &allow_remaining_obj)) {
12259 0 : return NULL;
12260 : }
12261 0 : blob.length = blob_length;
12262 :
12263 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
12264 0 : allow_remaining = true;
12265 : }
12266 :
12267 0 : if (allow_remaining) {
12268 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
12269 : } else {
12270 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustCollisionInfo);
12271 : }
12272 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
12273 0 : PyErr_SetNdrError(err);
12274 0 : return NULL;
12275 : }
12276 :
12277 0 : Py_RETURN_NONE;
12278 : }
12279 :
12280 0 : static PyObject *py_lsa_ForestTrustCollisionInfo_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
12281 : {
12282 0 : struct lsa_ForestTrustCollisionInfo *object = pytalloc_get_ptr(py_obj);
12283 0 : PyObject *ret;
12284 0 : char *retstr;
12285 :
12286 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustCollisionInfo, "lsa_ForestTrustCollisionInfo", object);
12287 0 : ret = PyUnicode_FromString(retstr);
12288 0 : talloc_free(retstr);
12289 :
12290 0 : return ret;
12291 : }
12292 :
12293 : static PyMethodDef py_lsa_ForestTrustCollisionInfo_methods[] = {
12294 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
12295 : { "__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" },
12296 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustCollisionInfo_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
12297 : { NULL, NULL, 0, NULL }
12298 : };
12299 :
12300 :
12301 : static PyTypeObject lsa_ForestTrustCollisionInfo_Type = {
12302 : PyVarObject_HEAD_INIT(NULL, 0)
12303 : .tp_name = "lsa.ForestTrustCollisionInfo",
12304 : .tp_getset = py_lsa_ForestTrustCollisionInfo_getsetters,
12305 : .tp_methods = py_lsa_ForestTrustCollisionInfo_methods,
12306 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12307 : .tp_new = py_lsa_ForestTrustCollisionInfo_new,
12308 : };
12309 :
12310 :
12311 23 : static PyObject *py_lsa_revision_info1_get_revision(PyObject *obj, void *closure)
12312 : {
12313 23 : struct lsa_revision_info1 *object = pytalloc_get_ptr(obj);
12314 0 : PyObject *py_revision;
12315 23 : py_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->revision));
12316 23 : return py_revision;
12317 : }
12318 :
12319 226 : static int py_lsa_revision_info1_set_revision(PyObject *py_obj, PyObject *value, void *closure)
12320 : {
12321 226 : struct lsa_revision_info1 *object = pytalloc_get_ptr(py_obj);
12322 226 : if (value == NULL) {
12323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->revision");
12324 0 : return -1;
12325 : }
12326 : {
12327 226 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->revision));
12328 226 : if (PyLong_Check(value)) {
12329 2 : unsigned long long test_var;
12330 226 : test_var = PyLong_AsUnsignedLongLong(value);
12331 226 : if (PyErr_Occurred() != NULL) {
12332 0 : return -1;
12333 : }
12334 226 : if (test_var > uint_max) {
12335 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12336 : PyLong_Type.tp_name, uint_max, test_var);
12337 0 : return -1;
12338 : }
12339 226 : object->revision = test_var;
12340 : } else {
12341 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12342 : PyLong_Type.tp_name);
12343 0 : return -1;
12344 : }
12345 : }
12346 226 : return 0;
12347 : }
12348 :
12349 23 : static PyObject *py_lsa_revision_info1_get_supported_features(PyObject *obj, void *closure)
12350 : {
12351 23 : struct lsa_revision_info1 *object = pytalloc_get_ptr(obj);
12352 0 : PyObject *py_supported_features;
12353 23 : py_supported_features = PyLong_FromUnsignedLongLong((uint32_t)(object->supported_features));
12354 23 : return py_supported_features;
12355 : }
12356 :
12357 226 : static int py_lsa_revision_info1_set_supported_features(PyObject *py_obj, PyObject *value, void *closure)
12358 : {
12359 226 : struct lsa_revision_info1 *object = pytalloc_get_ptr(py_obj);
12360 226 : if (value == NULL) {
12361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->supported_features");
12362 0 : return -1;
12363 : }
12364 : {
12365 226 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_features));
12366 226 : if (PyLong_Check(value)) {
12367 2 : unsigned long long test_var;
12368 226 : test_var = PyLong_AsUnsignedLongLong(value);
12369 226 : if (PyErr_Occurred() != NULL) {
12370 0 : return -1;
12371 : }
12372 226 : if (test_var > uint_max) {
12373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12374 : PyLong_Type.tp_name, uint_max, test_var);
12375 0 : return -1;
12376 : }
12377 226 : object->supported_features = test_var;
12378 : } else {
12379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12380 : PyLong_Type.tp_name);
12381 0 : return -1;
12382 : }
12383 : }
12384 226 : return 0;
12385 : }
12386 :
12387 : static PyGetSetDef py_lsa_revision_info1_getsetters[] = {
12388 : {
12389 : .name = discard_const_p(char, "revision"),
12390 : .get = py_lsa_revision_info1_get_revision,
12391 : .set = py_lsa_revision_info1_set_revision,
12392 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12393 : },
12394 : {
12395 : .name = discard_const_p(char, "supported_features"),
12396 : .get = py_lsa_revision_info1_get_supported_features,
12397 : .set = py_lsa_revision_info1_set_supported_features,
12398 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RevisionSupportedFeature")
12399 : },
12400 : { .name = NULL }
12401 : };
12402 :
12403 226 : static PyObject *py_lsa_revision_info1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12404 : {
12405 226 : return pytalloc_new(struct lsa_revision_info1, type);
12406 : }
12407 :
12408 :
12409 : static PyTypeObject lsa_revision_info1_Type = {
12410 : PyVarObject_HEAD_INIT(NULL, 0)
12411 : .tp_name = "lsa.revision_info1",
12412 : .tp_getset = py_lsa_revision_info1_getsetters,
12413 : .tp_methods = NULL,
12414 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12415 : .tp_new = py_lsa_revision_info1_new,
12416 : };
12417 :
12418 226 : static PyObject *py_import_lsa_revision_info(TALLOC_CTX *mem_ctx, int level, union lsa_revision_info *in)
12419 : {
12420 2 : PyObject *ret;
12421 :
12422 226 : switch (level) {
12423 226 : case 1:
12424 226 : ret = pytalloc_reference_ex(&lsa_revision_info1_Type, mem_ctx, &in->info1);
12425 226 : return ret;
12426 :
12427 : }
12428 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
12429 0 : return NULL;
12430 : }
12431 :
12432 226 : static union lsa_revision_info *py_export_lsa_revision_info(TALLOC_CTX *mem_ctx, int level, PyObject *in)
12433 : {
12434 226 : union lsa_revision_info *ret = talloc_zero(mem_ctx, union lsa_revision_info);
12435 226 : switch (level) {
12436 226 : case 1:
12437 226 : if (in == NULL) {
12438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
12439 0 : talloc_free(ret); return NULL;
12440 : }
12441 226 : PY_CHECK_TYPE(&lsa_revision_info1_Type, in, talloc_free(ret); return NULL;);
12442 226 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12443 0 : PyErr_NoMemory();
12444 0 : talloc_free(ret); return NULL;
12445 : }
12446 226 : ret->info1 = *(struct lsa_revision_info1 *)pytalloc_get_ptr(in);
12447 226 : break;
12448 :
12449 0 : default:
12450 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
12451 0 : talloc_free(ret);
12452 0 : ret = NULL;
12453 : }
12454 :
12455 224 : return ret;
12456 : }
12457 :
12458 226 : static PyObject *py_lsa_revision_info_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12459 : {
12460 226 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12461 226 : PyObject *mem_ctx_obj = NULL;
12462 226 : TALLOC_CTX *mem_ctx = NULL;
12463 226 : int level = 0;
12464 226 : PyObject *in_obj = NULL;
12465 226 : union lsa_revision_info *in = NULL;
12466 :
12467 226 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
12468 : discard_const_p(char *, kwnames),
12469 : &mem_ctx_obj,
12470 : &level,
12471 : &in_obj)) {
12472 0 : return NULL;
12473 : }
12474 226 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12475 226 : if (mem_ctx == NULL) {
12476 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12477 0 : return NULL;
12478 : }
12479 226 : in = (union lsa_revision_info *)pytalloc_get_ptr(in_obj);
12480 226 : if (in == NULL) {
12481 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_revision_info!");
12482 0 : return NULL;
12483 : }
12484 :
12485 226 : return py_import_lsa_revision_info(mem_ctx, level, in);
12486 : }
12487 :
12488 226 : static PyObject *py_lsa_revision_info_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12489 : {
12490 226 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12491 226 : PyObject *mem_ctx_obj = NULL;
12492 226 : TALLOC_CTX *mem_ctx = NULL;
12493 226 : int level = 0;
12494 226 : PyObject *in = NULL;
12495 226 : union lsa_revision_info *out = NULL;
12496 :
12497 226 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
12498 : discard_const_p(char *, kwnames),
12499 : &mem_ctx_obj,
12500 : &level,
12501 : &in)) {
12502 0 : return NULL;
12503 : }
12504 226 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12505 226 : if (mem_ctx == NULL) {
12506 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12507 0 : return NULL;
12508 : }
12509 :
12510 226 : out = py_export_lsa_revision_info(mem_ctx, level, in);
12511 226 : if (out == NULL) {
12512 0 : return NULL;
12513 : }
12514 :
12515 226 : return pytalloc_GenericObject_reference(out);
12516 : }
12517 :
12518 : static PyMethodDef py_lsa_revision_info_methods[] = {
12519 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_revision_info_import),
12520 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12521 : "T.__import__(mem_ctx, level, in) => ret." },
12522 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_revision_info_export),
12523 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12524 : "T.__export__(mem_ctx, level, in) => ret." },
12525 : { NULL, NULL, 0, NULL }
12526 : };
12527 :
12528 0 : static PyObject *py_lsa_revision_info_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12529 : {
12530 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
12531 0 : return NULL;
12532 : }
12533 :
12534 :
12535 : static PyTypeObject lsa_revision_info_Type = {
12536 : PyVarObject_HEAD_INIT(NULL, 0)
12537 : .tp_name = "lsa.revision_info",
12538 : .tp_getset = NULL,
12539 : .tp_methods = py_lsa_revision_info_methods,
12540 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12541 : .tp_new = py_lsa_revision_info_new,
12542 : };
12543 :
12544 0 : static PyObject *py_import_lsa_ForestTrustData2(TALLOC_CTX *mem_ctx, int level, union lsa_ForestTrustData2 *in)
12545 : {
12546 0 : PyObject *ret;
12547 :
12548 0 : switch (level) {
12549 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
12550 0 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name);
12551 0 : return ret;
12552 :
12553 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
12554 0 : ret = pytalloc_reference_ex(&lsa_StringLarge_Type, mem_ctx, &in->top_level_name_ex);
12555 0 : return ret;
12556 :
12557 0 : case LSA_FOREST_TRUST_DOMAIN_INFO:
12558 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->domain_info);
12559 0 : return ret;
12560 :
12561 0 : case LSA_FOREST_TRUST_BINARY_DATA:
12562 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustBinaryData_Type, mem_ctx, &in->data);
12563 0 : return ret;
12564 :
12565 0 : case LSA_FOREST_TRUST_SCANNER_INFO:
12566 0 : ret = pytalloc_reference_ex(&lsa_ForestTrustDomainInfo_Type, mem_ctx, &in->scanner_info);
12567 0 : return ret;
12568 :
12569 : }
12570 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
12571 0 : return NULL;
12572 : }
12573 :
12574 0 : static union lsa_ForestTrustData2 *py_export_lsa_ForestTrustData2(TALLOC_CTX *mem_ctx, int level, PyObject *in)
12575 : {
12576 0 : union lsa_ForestTrustData2 *ret = talloc_zero(mem_ctx, union lsa_ForestTrustData2);
12577 0 : switch (level) {
12578 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME:
12579 0 : if (in == NULL) {
12580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->top_level_name");
12581 0 : talloc_free(ret); return NULL;
12582 : }
12583 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
12584 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12585 0 : PyErr_NoMemory();
12586 0 : talloc_free(ret); return NULL;
12587 : }
12588 0 : ret->top_level_name = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
12589 0 : break;
12590 :
12591 0 : case LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX:
12592 0 : if (in == NULL) {
12593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->top_level_name_ex");
12594 0 : talloc_free(ret); return NULL;
12595 : }
12596 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, in, talloc_free(ret); return NULL;);
12597 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12598 0 : PyErr_NoMemory();
12599 0 : talloc_free(ret); return NULL;
12600 : }
12601 0 : ret->top_level_name_ex = *(struct lsa_StringLarge *)pytalloc_get_ptr(in);
12602 0 : break;
12603 :
12604 0 : case LSA_FOREST_TRUST_DOMAIN_INFO:
12605 0 : if (in == NULL) {
12606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->domain_info");
12607 0 : talloc_free(ret); return NULL;
12608 : }
12609 0 : PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
12610 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12611 0 : PyErr_NoMemory();
12612 0 : talloc_free(ret); return NULL;
12613 : }
12614 0 : ret->domain_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
12615 0 : break;
12616 :
12617 0 : case LSA_FOREST_TRUST_BINARY_DATA:
12618 0 : if (in == NULL) {
12619 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->data");
12620 0 : talloc_free(ret); return NULL;
12621 : }
12622 0 : PY_CHECK_TYPE(&lsa_ForestTrustBinaryData_Type, in, talloc_free(ret); return NULL;);
12623 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12624 0 : PyErr_NoMemory();
12625 0 : talloc_free(ret); return NULL;
12626 : }
12627 0 : ret->data = *(struct lsa_ForestTrustBinaryData *)pytalloc_get_ptr(in);
12628 0 : break;
12629 :
12630 0 : case LSA_FOREST_TRUST_SCANNER_INFO:
12631 0 : if (in == NULL) {
12632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->scanner_info");
12633 0 : talloc_free(ret); return NULL;
12634 : }
12635 0 : PY_CHECK_TYPE(&lsa_ForestTrustDomainInfo_Type, in, talloc_free(ret); return NULL;);
12636 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12637 0 : PyErr_NoMemory();
12638 0 : talloc_free(ret); return NULL;
12639 : }
12640 0 : ret->scanner_info = *(struct lsa_ForestTrustDomainInfo *)pytalloc_get_ptr(in);
12641 0 : break;
12642 :
12643 0 : default:
12644 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
12645 0 : talloc_free(ret);
12646 0 : ret = NULL;
12647 : }
12648 :
12649 0 : return ret;
12650 : }
12651 :
12652 0 : static PyObject *py_lsa_ForestTrustData2_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12653 : {
12654 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12655 0 : PyObject *mem_ctx_obj = NULL;
12656 0 : TALLOC_CTX *mem_ctx = NULL;
12657 0 : int level = 0;
12658 0 : PyObject *in_obj = NULL;
12659 0 : union lsa_ForestTrustData2 *in = NULL;
12660 :
12661 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
12662 : discard_const_p(char *, kwnames),
12663 : &mem_ctx_obj,
12664 : &level,
12665 : &in_obj)) {
12666 0 : return NULL;
12667 : }
12668 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12669 0 : if (mem_ctx == NULL) {
12670 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12671 0 : return NULL;
12672 : }
12673 0 : in = (union lsa_ForestTrustData2 *)pytalloc_get_ptr(in_obj);
12674 0 : if (in == NULL) {
12675 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union lsa_ForestTrustData2!");
12676 0 : return NULL;
12677 : }
12678 :
12679 0 : return py_import_lsa_ForestTrustData2(mem_ctx, level, in);
12680 : }
12681 :
12682 0 : static PyObject *py_lsa_ForestTrustData2_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12683 : {
12684 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12685 0 : PyObject *mem_ctx_obj = NULL;
12686 0 : TALLOC_CTX *mem_ctx = NULL;
12687 0 : int level = 0;
12688 0 : PyObject *in = NULL;
12689 0 : union lsa_ForestTrustData2 *out = NULL;
12690 :
12691 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
12692 : discard_const_p(char *, kwnames),
12693 : &mem_ctx_obj,
12694 : &level,
12695 : &in)) {
12696 0 : return NULL;
12697 : }
12698 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12699 0 : if (mem_ctx == NULL) {
12700 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12701 0 : return NULL;
12702 : }
12703 :
12704 0 : out = py_export_lsa_ForestTrustData2(mem_ctx, level, in);
12705 0 : if (out == NULL) {
12706 0 : return NULL;
12707 : }
12708 :
12709 0 : return pytalloc_GenericObject_reference(out);
12710 : }
12711 :
12712 : static PyMethodDef py_lsa_ForestTrustData2_methods[] = {
12713 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData2_import),
12714 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12715 : "T.__import__(mem_ctx, level, in) => ret." },
12716 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustData2_export),
12717 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12718 : "T.__export__(mem_ctx, level, in) => ret." },
12719 : { NULL, NULL, 0, NULL }
12720 : };
12721 :
12722 0 : static PyObject *py_lsa_ForestTrustData2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12723 : {
12724 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
12725 0 : return NULL;
12726 : }
12727 :
12728 :
12729 : static PyTypeObject lsa_ForestTrustData2_Type = {
12730 : PyVarObject_HEAD_INIT(NULL, 0)
12731 : .tp_name = "lsa.ForestTrustData2",
12732 : .tp_getset = NULL,
12733 : .tp_methods = py_lsa_ForestTrustData2_methods,
12734 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12735 : .tp_new = py_lsa_ForestTrustData2_new,
12736 : };
12737 :
12738 :
12739 0 : static PyObject *py_lsa_ForestTrustRecord2_get_flags(PyObject *obj, void *closure)
12740 : {
12741 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(obj);
12742 0 : PyObject *py_flags;
12743 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
12744 0 : return py_flags;
12745 : }
12746 :
12747 0 : static int py_lsa_ForestTrustRecord2_set_flags(PyObject *py_obj, PyObject *value, void *closure)
12748 : {
12749 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(py_obj);
12750 0 : if (value == NULL) {
12751 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
12752 0 : return -1;
12753 : }
12754 : {
12755 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
12756 0 : if (PyLong_Check(value)) {
12757 0 : unsigned long long test_var;
12758 0 : test_var = PyLong_AsUnsignedLongLong(value);
12759 0 : if (PyErr_Occurred() != NULL) {
12760 0 : return -1;
12761 : }
12762 0 : if (test_var > uint_max) {
12763 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12764 : PyLong_Type.tp_name, uint_max, test_var);
12765 0 : return -1;
12766 : }
12767 0 : object->flags = test_var;
12768 : } else {
12769 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12770 : PyLong_Type.tp_name);
12771 0 : return -1;
12772 : }
12773 : }
12774 0 : return 0;
12775 : }
12776 :
12777 0 : static PyObject *py_lsa_ForestTrustRecord2_get_type(PyObject *obj, void *closure)
12778 : {
12779 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(obj);
12780 0 : PyObject *py_type;
12781 0 : py_type = PyLong_FromLong((uint16_t)(object->type));
12782 0 : return py_type;
12783 : }
12784 :
12785 0 : static int py_lsa_ForestTrustRecord2_set_type(PyObject *py_obj, PyObject *value, void *closure)
12786 : {
12787 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(py_obj);
12788 0 : if (value == NULL) {
12789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
12790 0 : return -1;
12791 : }
12792 : {
12793 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
12794 0 : if (PyLong_Check(value)) {
12795 0 : unsigned long long test_var;
12796 0 : test_var = PyLong_AsUnsignedLongLong(value);
12797 0 : if (PyErr_Occurred() != NULL) {
12798 0 : return -1;
12799 : }
12800 0 : if (test_var > uint_max) {
12801 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12802 : PyLong_Type.tp_name, uint_max, test_var);
12803 0 : return -1;
12804 : }
12805 0 : object->type = test_var;
12806 : } else {
12807 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12808 : PyLong_Type.tp_name);
12809 0 : return -1;
12810 : }
12811 : }
12812 0 : return 0;
12813 : }
12814 :
12815 0 : static PyObject *py_lsa_ForestTrustRecord2_get_time(PyObject *obj, void *closure)
12816 : {
12817 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(obj);
12818 0 : PyObject *py_time;
12819 0 : py_time = PyLong_FromUnsignedLongLong(object->time);
12820 0 : return py_time;
12821 : }
12822 :
12823 0 : static int py_lsa_ForestTrustRecord2_set_time(PyObject *py_obj, PyObject *value, void *closure)
12824 : {
12825 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(py_obj);
12826 0 : if (value == NULL) {
12827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
12828 0 : return -1;
12829 : }
12830 : {
12831 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
12832 0 : if (PyLong_Check(value)) {
12833 0 : unsigned long long test_var;
12834 0 : test_var = PyLong_AsUnsignedLongLong(value);
12835 0 : if (PyErr_Occurred() != NULL) {
12836 0 : return -1;
12837 : }
12838 0 : if (test_var > uint_max) {
12839 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12840 : PyLong_Type.tp_name, uint_max, test_var);
12841 0 : return -1;
12842 : }
12843 0 : object->time = test_var;
12844 : } else {
12845 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12846 : PyLong_Type.tp_name);
12847 0 : return -1;
12848 : }
12849 : }
12850 0 : return 0;
12851 : }
12852 :
12853 0 : static PyObject *py_lsa_ForestTrustRecord2_get_forest_trust_data(PyObject *obj, void *closure)
12854 : {
12855 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(obj);
12856 0 : PyObject *py_forest_trust_data;
12857 0 : py_forest_trust_data = pyrpc_import_union(&lsa_ForestTrustData2_Type, pytalloc_get_mem_ctx(obj), object->type, &object->forest_trust_data, "union lsa_ForestTrustData2");
12858 0 : if (py_forest_trust_data == NULL) {
12859 0 : return NULL;
12860 : }
12861 0 : return py_forest_trust_data;
12862 : }
12863 :
12864 0 : static int py_lsa_ForestTrustRecord2_set_forest_trust_data(PyObject *py_obj, PyObject *value, void *closure)
12865 : {
12866 0 : struct lsa_ForestTrustRecord2 *object = pytalloc_get_ptr(py_obj);
12867 0 : if (value == NULL) {
12868 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->forest_trust_data");
12869 0 : return -1;
12870 : }
12871 : {
12872 0 : union lsa_ForestTrustData2 *forest_trust_data_switch_0;
12873 0 : forest_trust_data_switch_0 = (union lsa_ForestTrustData2 *)pyrpc_export_union(&lsa_ForestTrustData2_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union lsa_ForestTrustData2");
12874 0 : if (forest_trust_data_switch_0 == NULL) {
12875 0 : return -1;
12876 : }
12877 0 : object->forest_trust_data = *forest_trust_data_switch_0;
12878 : }
12879 0 : return 0;
12880 : }
12881 :
12882 : static PyGetSetDef py_lsa_ForestTrustRecord2_getsetters[] = {
12883 : {
12884 : .name = discard_const_p(char, "flags"),
12885 : .get = py_lsa_ForestTrustRecord2_get_flags,
12886 : .set = py_lsa_ForestTrustRecord2_set_flags,
12887 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordFlags")
12888 : },
12889 : {
12890 : .name = discard_const_p(char, "type"),
12891 : .get = py_lsa_ForestTrustRecord2_get_type,
12892 : .set = py_lsa_ForestTrustRecord2_set_type,
12893 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
12894 : },
12895 : {
12896 : .name = discard_const_p(char, "time"),
12897 : .get = py_lsa_ForestTrustRecord2_get_time,
12898 : .set = py_lsa_ForestTrustRecord2_set_time,
12899 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
12900 : },
12901 : {
12902 : .name = discard_const_p(char, "forest_trust_data"),
12903 : .get = py_lsa_ForestTrustRecord2_get_forest_trust_data,
12904 : .set = py_lsa_ForestTrustRecord2_set_forest_trust_data,
12905 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustData2")
12906 : },
12907 : { .name = NULL }
12908 : };
12909 :
12910 0 : static PyObject *py_lsa_ForestTrustRecord2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12911 : {
12912 0 : return pytalloc_new(struct lsa_ForestTrustRecord2, type);
12913 : }
12914 :
12915 :
12916 : static PyTypeObject lsa_ForestTrustRecord2_Type = {
12917 : PyVarObject_HEAD_INIT(NULL, 0)
12918 : .tp_name = "lsa.ForestTrustRecord2",
12919 : .tp_getset = py_lsa_ForestTrustRecord2_getsetters,
12920 : .tp_methods = NULL,
12921 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12922 : .tp_new = py_lsa_ForestTrustRecord2_new,
12923 : };
12924 :
12925 :
12926 0 : static PyObject *py_lsa_ForestTrustInformation2_get_count(PyObject *obj, void *closure)
12927 : {
12928 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(obj);
12929 0 : PyObject *py_count;
12930 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
12931 0 : return py_count;
12932 : }
12933 :
12934 0 : static int py_lsa_ForestTrustInformation2_set_count(PyObject *py_obj, PyObject *value, void *closure)
12935 : {
12936 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
12937 0 : if (value == NULL) {
12938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
12939 0 : return -1;
12940 : }
12941 : {
12942 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
12943 0 : if (PyLong_Check(value)) {
12944 0 : unsigned long long test_var;
12945 0 : test_var = PyLong_AsUnsignedLongLong(value);
12946 0 : if (PyErr_Occurred() != NULL) {
12947 0 : return -1;
12948 : }
12949 0 : if (test_var > uint_max) {
12950 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12951 : PyLong_Type.tp_name, uint_max, test_var);
12952 0 : return -1;
12953 : }
12954 0 : object->count = test_var;
12955 : } else {
12956 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12957 : PyLong_Type.tp_name);
12958 0 : return -1;
12959 : }
12960 : }
12961 0 : return 0;
12962 : }
12963 :
12964 0 : static PyObject *py_lsa_ForestTrustInformation2_get_entries(PyObject *obj, void *closure)
12965 : {
12966 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(obj);
12967 0 : PyObject *py_entries;
12968 0 : if (object->entries == NULL) {
12969 0 : Py_RETURN_NONE;
12970 : }
12971 0 : if (object->entries == NULL) {
12972 0 : py_entries = Py_None;
12973 0 : Py_INCREF(py_entries);
12974 : } else {
12975 0 : py_entries = PyList_New(object->count);
12976 0 : if (py_entries == NULL) {
12977 0 : return NULL;
12978 : }
12979 : {
12980 : int entries_cntr_1;
12981 0 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
12982 0 : PyObject *py_entries_1;
12983 0 : if ((object->entries)[entries_cntr_1] == NULL) {
12984 0 : py_entries_1 = Py_None;
12985 0 : Py_INCREF(py_entries_1);
12986 : } else {
12987 0 : py_entries_1 = pytalloc_reference_ex(&lsa_ForestTrustRecord2_Type, (object->entries)[entries_cntr_1], (object->entries)[entries_cntr_1]);
12988 : }
12989 0 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
12990 : }
12991 : }
12992 : }
12993 0 : return py_entries;
12994 : }
12995 :
12996 0 : static int py_lsa_ForestTrustInformation2_set_entries(PyObject *py_obj, PyObject *value, void *closure)
12997 : {
12998 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
12999 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
13000 0 : if (value == NULL) {
13001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->entries");
13002 0 : return -1;
13003 : }
13004 0 : if (value == Py_None) {
13005 0 : object->entries = NULL;
13006 : } else {
13007 0 : object->entries = NULL;
13008 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
13009 : {
13010 0 : int entries_cntr_1;
13011 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
13012 0 : if (!object->entries) { return -1; }
13013 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
13014 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
13015 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
13016 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->entries)[entries_cntr_1]");
13017 0 : return -1;
13018 : }
13019 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == Py_None) {
13020 0 : (object->entries)[entries_cntr_1] = NULL;
13021 : } else {
13022 0 : (object->entries)[entries_cntr_1] = NULL;
13023 0 : PY_CHECK_TYPE(&lsa_ForestTrustRecord2_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
13024 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
13025 0 : PyErr_NoMemory();
13026 0 : return -1;
13027 : }
13028 0 : (object->entries)[entries_cntr_1] = (struct lsa_ForestTrustRecord2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
13029 : }
13030 : }
13031 : }
13032 : }
13033 0 : return 0;
13034 : }
13035 :
13036 : static PyGetSetDef py_lsa_ForestTrustInformation2_getsetters[] = {
13037 : {
13038 : .name = discard_const_p(char, "count"),
13039 : .get = py_lsa_ForestTrustInformation2_get_count,
13040 : .set = py_lsa_ForestTrustInformation2_set_count,
13041 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
13042 : },
13043 : {
13044 : .name = discard_const_p(char, "entries"),
13045 : .get = py_lsa_ForestTrustInformation2_get_entries,
13046 : .set = py_lsa_ForestTrustInformation2_set_entries,
13047 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecord2")
13048 : },
13049 : { .name = NULL }
13050 : };
13051 :
13052 0 : static PyObject *py_lsa_ForestTrustInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13053 : {
13054 0 : return pytalloc_new(struct lsa_ForestTrustInformation2, type);
13055 : }
13056 :
13057 0 : static PyObject *py_lsa_ForestTrustInformation2_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13058 : {
13059 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
13060 0 : PyObject *ret = NULL;
13061 0 : DATA_BLOB blob;
13062 0 : enum ndr_err_code err;
13063 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
13064 0 : if (tmp_ctx == NULL) {
13065 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13066 0 : return NULL;
13067 : }
13068 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_lsa_ForestTrustInformation2);
13069 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13070 0 : TALLOC_FREE(tmp_ctx);
13071 0 : PyErr_SetNdrError(err);
13072 0 : return NULL;
13073 : }
13074 :
13075 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13076 0 : TALLOC_FREE(tmp_ctx);
13077 0 : return ret;
13078 : }
13079 :
13080 0 : static PyObject *py_lsa_ForestTrustInformation2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13081 : {
13082 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
13083 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
13084 0 : Py_ssize_t blob_length = 0;
13085 0 : enum ndr_err_code err;
13086 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
13087 0 : PyObject *allow_remaining_obj = NULL;
13088 0 : bool allow_remaining = false;
13089 :
13090 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
13091 : discard_const_p(char *, kwnames),
13092 : &blob.data, &blob_length,
13093 : &allow_remaining_obj)) {
13094 0 : return NULL;
13095 : }
13096 0 : blob.length = blob_length;
13097 :
13098 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13099 0 : allow_remaining = true;
13100 : }
13101 :
13102 0 : if (allow_remaining) {
13103 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation2);
13104 : } else {
13105 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_lsa_ForestTrustInformation2);
13106 : }
13107 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13108 0 : PyErr_SetNdrError(err);
13109 0 : return NULL;
13110 : }
13111 :
13112 0 : Py_RETURN_NONE;
13113 : }
13114 :
13115 0 : static PyObject *py_lsa_ForestTrustInformation2_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13116 : {
13117 0 : struct lsa_ForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
13118 0 : PyObject *ret;
13119 0 : char *retstr;
13120 :
13121 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_lsa_ForestTrustInformation2, "lsa_ForestTrustInformation2", object);
13122 0 : ret = PyUnicode_FromString(retstr);
13123 0 : talloc_free(retstr);
13124 :
13125 0 : return ret;
13126 : }
13127 :
13128 : static PyMethodDef py_lsa_ForestTrustInformation2_methods[] = {
13129 : { "__ndr_pack__", (PyCFunction)py_lsa_ForestTrustInformation2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
13130 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_ForestTrustInformation2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
13131 : { "__ndr_print__", (PyCFunction)py_lsa_ForestTrustInformation2_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
13132 : { NULL, NULL, 0, NULL }
13133 : };
13134 :
13135 :
13136 : static PyTypeObject lsa_ForestTrustInformation2_Type = {
13137 : PyVarObject_HEAD_INIT(NULL, 0)
13138 : .tp_name = "lsa.ForestTrustInformation2",
13139 : .tp_getset = py_lsa_ForestTrustInformation2_getsetters,
13140 : .tp_methods = py_lsa_ForestTrustInformation2_methods,
13141 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13142 : .tp_new = py_lsa_ForestTrustInformation2_new,
13143 : };
13144 :
13145 :
13146 :
13147 0 : static PyObject *py_lsa_Close_in_get_handle(PyObject *obj, void *closure)
13148 : {
13149 0 : struct lsa_Close *object = pytalloc_get_ptr(obj);
13150 0 : PyObject *py_handle;
13151 0 : if (object->in.handle == NULL) {
13152 0 : Py_RETURN_NONE;
13153 : }
13154 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13155 0 : return py_handle;
13156 : }
13157 :
13158 0 : static int py_lsa_Close_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13159 : {
13160 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13161 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13162 0 : if (value == NULL) {
13163 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
13164 0 : return -1;
13165 : }
13166 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13167 0 : if (object->in.handle == NULL) {
13168 0 : PyErr_NoMemory();
13169 0 : return -1;
13170 : }
13171 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13172 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13173 0 : PyErr_NoMemory();
13174 0 : return -1;
13175 : }
13176 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13177 0 : return 0;
13178 : }
13179 :
13180 0 : static PyObject *py_lsa_Close_out_get_handle(PyObject *obj, void *closure)
13181 : {
13182 0 : struct lsa_Close *object = pytalloc_get_ptr(obj);
13183 0 : PyObject *py_handle;
13184 0 : if (object->out.handle == NULL) {
13185 0 : Py_RETURN_NONE;
13186 : }
13187 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
13188 0 : return py_handle;
13189 : }
13190 :
13191 0 : static int py_lsa_Close_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13192 : {
13193 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13194 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
13195 0 : if (value == NULL) {
13196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
13197 0 : return -1;
13198 : }
13199 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
13200 0 : if (object->out.handle == NULL) {
13201 0 : PyErr_NoMemory();
13202 0 : return -1;
13203 : }
13204 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13205 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13206 0 : PyErr_NoMemory();
13207 0 : return -1;
13208 : }
13209 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13210 0 : return 0;
13211 : }
13212 :
13213 0 : static PyObject *py_lsa_Close_get_result(PyObject *obj, void *closure)
13214 : {
13215 0 : struct lsa_Close *object = pytalloc_get_ptr(obj);
13216 0 : PyObject *py_result;
13217 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13218 0 : return py_result;
13219 : }
13220 :
13221 0 : static int py_lsa_Close_set_result(PyObject *py_obj, PyObject *value, void *closure)
13222 : {
13223 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13224 0 : if (value == NULL) {
13225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
13226 0 : return -1;
13227 : }
13228 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13229 0 : return 0;
13230 : }
13231 :
13232 : static PyGetSetDef py_lsa_Close_getsetters[] = {
13233 : {
13234 : .name = discard_const_p(char, "in_handle"),
13235 : .get = py_lsa_Close_in_get_handle,
13236 : .set = py_lsa_Close_in_set_handle,
13237 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13238 : },
13239 : {
13240 : .name = discard_const_p(char, "out_handle"),
13241 : .get = py_lsa_Close_out_get_handle,
13242 : .set = py_lsa_Close_out_set_handle,
13243 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13244 : },
13245 : {
13246 : .name = discard_const_p(char, "result"),
13247 : .get = py_lsa_Close_get_result,
13248 : .set = py_lsa_Close_set_result,
13249 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13250 : },
13251 : { .name = NULL }
13252 : };
13253 :
13254 0 : static PyObject *py_lsa_Close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13255 : {
13256 0 : PyObject *self = pytalloc_new(struct lsa_Close, type);
13257 0 : struct lsa_Close *_self = (struct lsa_Close *)pytalloc_get_ptr(self);
13258 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13259 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
13260 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
13261 0 : return self;
13262 : }
13263 :
13264 0 : static PyObject *py_lsa_Close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13265 : {
13266 :
13267 :
13268 0 : return PyLong_FromLong(0);
13269 : }
13270 :
13271 0 : static PyObject *py_lsa_Close_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13272 : {
13273 0 : const struct ndr_interface_call *call = NULL;
13274 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13275 0 : PyObject *ret = NULL;
13276 0 : struct ndr_push *push = NULL;
13277 0 : DATA_BLOB blob;
13278 0 : enum ndr_err_code err;
13279 :
13280 0 : if (ndr_table_lsarpc.num_calls < 1) {
13281 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_pack");
13282 0 : return NULL;
13283 : }
13284 0 : call = &ndr_table_lsarpc.calls[0];
13285 :
13286 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13287 0 : if (push == NULL) {
13288 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13289 0 : return NULL;
13290 : }
13291 :
13292 0 : push->flags |= ndr_push_flags;
13293 :
13294 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13295 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13296 0 : TALLOC_FREE(push);
13297 0 : PyErr_SetNdrError(err);
13298 0 : return NULL;
13299 : }
13300 0 : blob = ndr_push_blob(push);
13301 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13302 0 : TALLOC_FREE(push);
13303 0 : return ret;
13304 : }
13305 :
13306 0 : static PyObject *py_lsa_Close_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13307 : {
13308 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13309 0 : PyObject *bigendian_obj = NULL;
13310 0 : PyObject *ndr64_obj = NULL;
13311 0 : libndr_flags ndr_push_flags = 0;
13312 :
13313 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13314 : discard_const_p(char *, kwnames),
13315 : &bigendian_obj,
13316 : &ndr64_obj)) {
13317 0 : return NULL;
13318 : }
13319 :
13320 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13321 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13322 : }
13323 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13324 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13325 : }
13326 :
13327 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13328 : }
13329 :
13330 0 : static PyObject *py_lsa_Close_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13331 : {
13332 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13333 0 : PyObject *bigendian_obj = NULL;
13334 0 : PyObject *ndr64_obj = NULL;
13335 0 : libndr_flags ndr_push_flags = 0;
13336 :
13337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13338 : discard_const_p(char *, kwnames),
13339 : &bigendian_obj,
13340 : &ndr64_obj)) {
13341 0 : return NULL;
13342 : }
13343 :
13344 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13345 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13346 : }
13347 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13348 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13349 : }
13350 :
13351 0 : return py_lsa_Close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13352 : }
13353 :
13354 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)
13355 : {
13356 0 : const struct ndr_interface_call *call = NULL;
13357 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13358 0 : struct ndr_pull *pull = NULL;
13359 0 : enum ndr_err_code err;
13360 :
13361 0 : if (ndr_table_lsarpc.num_calls < 1) {
13362 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_unpack");
13363 0 : return NULL;
13364 : }
13365 0 : call = &ndr_table_lsarpc.calls[0];
13366 :
13367 0 : pull = ndr_pull_init_blob(blob, object);
13368 0 : if (pull == NULL) {
13369 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13370 0 : return NULL;
13371 : }
13372 :
13373 0 : pull->flags |= ndr_pull_flags;
13374 :
13375 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13376 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13377 0 : TALLOC_FREE(pull);
13378 0 : PyErr_SetNdrError(err);
13379 0 : return NULL;
13380 : }
13381 0 : if (!allow_remaining) {
13382 0 : uint32_t highest_ofs;
13383 :
13384 0 : if (pull->offset > pull->relative_highest_offset) {
13385 0 : highest_ofs = pull->offset;
13386 : } else {
13387 0 : highest_ofs = pull->relative_highest_offset;
13388 : }
13389 0 : if (highest_ofs < pull->data_size) {
13390 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13391 : "not all bytes consumed ofs[%u] size[%u]",
13392 : highest_ofs, pull->data_size);
13393 0 : TALLOC_FREE(pull);
13394 0 : PyErr_SetNdrError(err);
13395 0 : return NULL;
13396 : }
13397 : }
13398 :
13399 0 : TALLOC_FREE(pull);
13400 0 : Py_RETURN_NONE;
13401 : }
13402 :
13403 0 : static PyObject *py_lsa_Close_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13404 : {
13405 0 : DATA_BLOB blob;
13406 0 : Py_ssize_t blob_length = 0;
13407 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13408 0 : PyObject *bigendian_obj = NULL;
13409 0 : PyObject *ndr64_obj = NULL;
13410 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13411 0 : PyObject *allow_remaining_obj = NULL;
13412 0 : bool allow_remaining = false;
13413 :
13414 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13415 : discard_const_p(char *, kwnames),
13416 : &blob.data, &blob_length,
13417 : &bigendian_obj,
13418 : &ndr64_obj,
13419 : &allow_remaining_obj)) {
13420 0 : return NULL;
13421 : }
13422 0 : blob.length = blob_length;
13423 :
13424 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13425 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13426 : }
13427 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13428 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13429 : }
13430 :
13431 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13432 0 : allow_remaining = true;
13433 : }
13434 :
13435 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13436 : }
13437 :
13438 0 : static PyObject *py_lsa_Close_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13439 : {
13440 0 : DATA_BLOB blob;
13441 0 : Py_ssize_t blob_length = 0;
13442 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13443 0 : PyObject *bigendian_obj = NULL;
13444 0 : PyObject *ndr64_obj = NULL;
13445 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13446 0 : PyObject *allow_remaining_obj = NULL;
13447 0 : bool allow_remaining = false;
13448 :
13449 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13450 : discard_const_p(char *, kwnames),
13451 : &blob.data, &blob_length,
13452 : &bigendian_obj,
13453 : &ndr64_obj,
13454 : &allow_remaining_obj)) {
13455 0 : return NULL;
13456 : }
13457 0 : blob.length = blob_length;
13458 :
13459 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13460 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13461 : }
13462 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13463 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13464 : }
13465 :
13466 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13467 0 : allow_remaining = true;
13468 : }
13469 :
13470 0 : return py_lsa_Close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13471 : }
13472 :
13473 0 : static PyObject *py_lsa_Close_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13474 : {
13475 0 : const struct ndr_interface_call *call = NULL;
13476 0 : struct lsa_Close *object = pytalloc_get_ptr(py_obj);
13477 0 : PyObject *ret;
13478 0 : char *retstr;
13479 :
13480 0 : if (ndr_table_lsarpc.num_calls < 1) {
13481 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Close_ndr_print");
13482 0 : return NULL;
13483 : }
13484 0 : call = &ndr_table_lsarpc.calls[0];
13485 :
13486 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13487 0 : ret = PyUnicode_FromString(retstr);
13488 0 : TALLOC_FREE(retstr);
13489 :
13490 0 : return ret;
13491 : }
13492 :
13493 0 : static PyObject *py_lsa_Close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13494 : {
13495 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_in", NDR_IN);
13496 : }
13497 :
13498 0 : static PyObject *py_lsa_Close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13499 : {
13500 0 : return py_lsa_Close_ndr_print(py_obj, "lsa_Close_out", NDR_OUT);
13501 : }
13502 :
13503 : static PyMethodDef py_lsa_Close_methods[] = {
13504 : { "opnum", (PyCFunction)py_lsa_Close_ndr_opnum, METH_NOARGS|METH_CLASS,
13505 : "lsa.Close.opnum() -> 0 (0x00) " },
13506 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13507 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13508 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13509 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13510 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13511 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13512 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Close_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13513 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13514 : { "__ndr_print_in__", (PyCFunction)py_lsa_Close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13515 : { "__ndr_print_out__", (PyCFunction)py_lsa_Close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13516 : { NULL, NULL, 0, NULL }
13517 : };
13518 :
13519 :
13520 : static PyTypeObject lsa_Close_Type = {
13521 : PyVarObject_HEAD_INIT(NULL, 0)
13522 : .tp_name = "lsa.Close",
13523 : .tp_getset = py_lsa_Close_getsetters,
13524 : .tp_methods = py_lsa_Close_methods,
13525 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13526 : .tp_new = py_lsa_Close_new,
13527 : };
13528 :
13529 23 : static bool pack_py_lsa_Close_args_in(PyObject *args, PyObject *kwargs, struct lsa_Close *r)
13530 : {
13531 0 : PyObject *py_handle;
13532 23 : const char *kwnames[] = {
13533 : "handle", NULL
13534 : };
13535 :
13536 23 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Close", discard_const_p(char *, kwnames), &py_handle)) {
13537 0 : return false;
13538 : }
13539 :
13540 23 : if (py_handle == NULL) {
13541 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
13542 0 : return false;
13543 : }
13544 23 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13545 23 : if (r->in.handle == NULL) {
13546 0 : PyErr_NoMemory();
13547 0 : return false;
13548 : }
13549 23 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13550 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13551 0 : PyErr_NoMemory();
13552 0 : return false;
13553 : }
13554 23 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13555 23 : return true;
13556 : }
13557 :
13558 23 : static PyObject *unpack_py_lsa_Close_args_out(struct lsa_Close *r)
13559 : {
13560 0 : PyObject *result;
13561 0 : PyObject *py_handle;
13562 23 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
13563 23 : result = py_handle;
13564 23 : if (NT_STATUS_IS_ERR(r->out.result)) {
13565 0 : PyErr_SetNTSTATUS(r->out.result);
13566 0 : return NULL;
13567 : }
13568 :
13569 23 : return result;
13570 : }
13571 :
13572 :
13573 0 : static PyObject *py_lsa_Delete_in_get_handle(PyObject *obj, void *closure)
13574 : {
13575 0 : struct lsa_Delete *object = pytalloc_get_ptr(obj);
13576 0 : PyObject *py_handle;
13577 0 : if (object->in.handle == NULL) {
13578 0 : Py_RETURN_NONE;
13579 : }
13580 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13581 0 : return py_handle;
13582 : }
13583 :
13584 0 : static int py_lsa_Delete_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13585 : {
13586 0 : struct lsa_Delete *object = pytalloc_get_ptr(py_obj);
13587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13588 0 : if (value == NULL) {
13589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
13590 0 : return -1;
13591 : }
13592 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13593 0 : if (object->in.handle == NULL) {
13594 0 : PyErr_NoMemory();
13595 0 : return -1;
13596 : }
13597 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13598 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13599 0 : PyErr_NoMemory();
13600 0 : return -1;
13601 : }
13602 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13603 0 : return 0;
13604 : }
13605 :
13606 0 : static PyObject *py_lsa_Delete_get_result(PyObject *obj, void *closure)
13607 : {
13608 0 : struct lsa_Delete *object = pytalloc_get_ptr(obj);
13609 0 : PyObject *py_result;
13610 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13611 0 : return py_result;
13612 : }
13613 :
13614 0 : static int py_lsa_Delete_set_result(PyObject *py_obj, PyObject *value, void *closure)
13615 : {
13616 0 : struct lsa_Delete *object = pytalloc_get_ptr(py_obj);
13617 0 : if (value == NULL) {
13618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
13619 0 : return -1;
13620 : }
13621 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13622 0 : return 0;
13623 : }
13624 :
13625 : static PyGetSetDef py_lsa_Delete_getsetters[] = {
13626 : {
13627 : .name = discard_const_p(char, "in_handle"),
13628 : .get = py_lsa_Delete_in_get_handle,
13629 : .set = py_lsa_Delete_in_set_handle,
13630 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13631 : },
13632 : {
13633 : .name = discard_const_p(char, "result"),
13634 : .get = py_lsa_Delete_get_result,
13635 : .set = py_lsa_Delete_set_result,
13636 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13637 : },
13638 : { .name = NULL }
13639 : };
13640 :
13641 0 : static PyObject *py_lsa_Delete_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13642 : {
13643 0 : PyObject *self = pytalloc_new(struct lsa_Delete, type);
13644 0 : struct lsa_Delete *_self = (struct lsa_Delete *)pytalloc_get_ptr(self);
13645 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13646 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
13647 0 : return self;
13648 : }
13649 :
13650 0 : static PyObject *py_lsa_Delete_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13651 : {
13652 :
13653 :
13654 0 : return PyLong_FromLong(1);
13655 : }
13656 :
13657 0 : static PyObject *py_lsa_Delete_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13658 : {
13659 0 : const struct ndr_interface_call *call = NULL;
13660 0 : struct lsa_Delete *object = pytalloc_get_ptr(py_obj);
13661 0 : PyObject *ret = NULL;
13662 0 : struct ndr_push *push = NULL;
13663 0 : DATA_BLOB blob;
13664 0 : enum ndr_err_code err;
13665 :
13666 0 : if (ndr_table_lsarpc.num_calls < 2) {
13667 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_pack");
13668 0 : return NULL;
13669 : }
13670 0 : call = &ndr_table_lsarpc.calls[1];
13671 :
13672 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13673 0 : if (push == NULL) {
13674 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13675 0 : return NULL;
13676 : }
13677 :
13678 0 : push->flags |= ndr_push_flags;
13679 :
13680 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13681 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13682 0 : TALLOC_FREE(push);
13683 0 : PyErr_SetNdrError(err);
13684 0 : return NULL;
13685 : }
13686 0 : blob = ndr_push_blob(push);
13687 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13688 0 : TALLOC_FREE(push);
13689 0 : return ret;
13690 : }
13691 :
13692 0 : static PyObject *py_lsa_Delete_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13693 : {
13694 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13695 0 : PyObject *bigendian_obj = NULL;
13696 0 : PyObject *ndr64_obj = NULL;
13697 0 : libndr_flags ndr_push_flags = 0;
13698 :
13699 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13700 : discard_const_p(char *, kwnames),
13701 : &bigendian_obj,
13702 : &ndr64_obj)) {
13703 0 : return NULL;
13704 : }
13705 :
13706 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13707 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13708 : }
13709 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13710 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13711 : }
13712 :
13713 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13714 : }
13715 :
13716 0 : static PyObject *py_lsa_Delete_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13717 : {
13718 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13719 0 : PyObject *bigendian_obj = NULL;
13720 0 : PyObject *ndr64_obj = NULL;
13721 0 : libndr_flags ndr_push_flags = 0;
13722 :
13723 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13724 : discard_const_p(char *, kwnames),
13725 : &bigendian_obj,
13726 : &ndr64_obj)) {
13727 0 : return NULL;
13728 : }
13729 :
13730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13731 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13732 : }
13733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13734 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13735 : }
13736 :
13737 0 : return py_lsa_Delete_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13738 : }
13739 :
13740 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)
13741 : {
13742 0 : const struct ndr_interface_call *call = NULL;
13743 0 : struct lsa_Delete *object = pytalloc_get_ptr(py_obj);
13744 0 : struct ndr_pull *pull = NULL;
13745 0 : enum ndr_err_code err;
13746 :
13747 0 : if (ndr_table_lsarpc.num_calls < 2) {
13748 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_unpack");
13749 0 : return NULL;
13750 : }
13751 0 : call = &ndr_table_lsarpc.calls[1];
13752 :
13753 0 : pull = ndr_pull_init_blob(blob, object);
13754 0 : if (pull == NULL) {
13755 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13756 0 : return NULL;
13757 : }
13758 :
13759 0 : pull->flags |= ndr_pull_flags;
13760 :
13761 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13762 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13763 0 : TALLOC_FREE(pull);
13764 0 : PyErr_SetNdrError(err);
13765 0 : return NULL;
13766 : }
13767 0 : if (!allow_remaining) {
13768 0 : uint32_t highest_ofs;
13769 :
13770 0 : if (pull->offset > pull->relative_highest_offset) {
13771 0 : highest_ofs = pull->offset;
13772 : } else {
13773 0 : highest_ofs = pull->relative_highest_offset;
13774 : }
13775 0 : if (highest_ofs < pull->data_size) {
13776 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13777 : "not all bytes consumed ofs[%u] size[%u]",
13778 : highest_ofs, pull->data_size);
13779 0 : TALLOC_FREE(pull);
13780 0 : PyErr_SetNdrError(err);
13781 0 : return NULL;
13782 : }
13783 : }
13784 :
13785 0 : TALLOC_FREE(pull);
13786 0 : Py_RETURN_NONE;
13787 : }
13788 :
13789 0 : static PyObject *py_lsa_Delete_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13790 : {
13791 0 : DATA_BLOB blob;
13792 0 : Py_ssize_t blob_length = 0;
13793 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13794 0 : PyObject *bigendian_obj = NULL;
13795 0 : PyObject *ndr64_obj = NULL;
13796 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13797 0 : PyObject *allow_remaining_obj = NULL;
13798 0 : bool allow_remaining = false;
13799 :
13800 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13801 : discard_const_p(char *, kwnames),
13802 : &blob.data, &blob_length,
13803 : &bigendian_obj,
13804 : &ndr64_obj,
13805 : &allow_remaining_obj)) {
13806 0 : return NULL;
13807 : }
13808 0 : blob.length = blob_length;
13809 :
13810 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13811 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13812 : }
13813 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13814 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13815 : }
13816 :
13817 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13818 0 : allow_remaining = true;
13819 : }
13820 :
13821 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13822 : }
13823 :
13824 0 : static PyObject *py_lsa_Delete_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13825 : {
13826 0 : DATA_BLOB blob;
13827 0 : Py_ssize_t blob_length = 0;
13828 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13829 0 : PyObject *bigendian_obj = NULL;
13830 0 : PyObject *ndr64_obj = NULL;
13831 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13832 0 : PyObject *allow_remaining_obj = NULL;
13833 0 : bool allow_remaining = false;
13834 :
13835 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13836 : discard_const_p(char *, kwnames),
13837 : &blob.data, &blob_length,
13838 : &bigendian_obj,
13839 : &ndr64_obj,
13840 : &allow_remaining_obj)) {
13841 0 : return NULL;
13842 : }
13843 0 : blob.length = blob_length;
13844 :
13845 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13846 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13847 : }
13848 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13849 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13850 : }
13851 :
13852 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13853 0 : allow_remaining = true;
13854 : }
13855 :
13856 0 : return py_lsa_Delete_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13857 : }
13858 :
13859 0 : static PyObject *py_lsa_Delete_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13860 : {
13861 0 : const struct ndr_interface_call *call = NULL;
13862 0 : struct lsa_Delete *object = pytalloc_get_ptr(py_obj);
13863 0 : PyObject *ret;
13864 0 : char *retstr;
13865 :
13866 0 : if (ndr_table_lsarpc.num_calls < 2) {
13867 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_Delete_ndr_print");
13868 0 : return NULL;
13869 : }
13870 0 : call = &ndr_table_lsarpc.calls[1];
13871 :
13872 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13873 0 : ret = PyUnicode_FromString(retstr);
13874 0 : TALLOC_FREE(retstr);
13875 :
13876 0 : return ret;
13877 : }
13878 :
13879 0 : static PyObject *py_lsa_Delete_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13880 : {
13881 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_in", NDR_IN);
13882 : }
13883 :
13884 0 : static PyObject *py_lsa_Delete_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13885 : {
13886 0 : return py_lsa_Delete_ndr_print(py_obj, "lsa_Delete_out", NDR_OUT);
13887 : }
13888 :
13889 : static PyMethodDef py_lsa_Delete_methods[] = {
13890 : { "opnum", (PyCFunction)py_lsa_Delete_ndr_opnum, METH_NOARGS|METH_CLASS,
13891 : "lsa.Delete.opnum() -> 1 (0x01) " },
13892 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13893 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13894 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13895 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13896 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13897 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13898 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_Delete_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13899 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13900 : { "__ndr_print_in__", (PyCFunction)py_lsa_Delete_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13901 : { "__ndr_print_out__", (PyCFunction)py_lsa_Delete_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13902 : { NULL, NULL, 0, NULL }
13903 : };
13904 :
13905 :
13906 : static PyTypeObject lsa_Delete_Type = {
13907 : PyVarObject_HEAD_INIT(NULL, 0)
13908 : .tp_name = "lsa.Delete",
13909 : .tp_getset = py_lsa_Delete_getsetters,
13910 : .tp_methods = py_lsa_Delete_methods,
13911 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13912 : .tp_new = py_lsa_Delete_new,
13913 : };
13914 :
13915 0 : static bool pack_py_lsa_Delete_args_in(PyObject *args, PyObject *kwargs, struct lsa_Delete *r)
13916 : {
13917 0 : PyObject *py_handle;
13918 0 : const char *kwnames[] = {
13919 : "handle", NULL
13920 : };
13921 :
13922 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_Delete", discard_const_p(char *, kwnames), &py_handle)) {
13923 0 : return false;
13924 : }
13925 :
13926 0 : if (py_handle == NULL) {
13927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
13928 0 : return false;
13929 : }
13930 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
13931 0 : if (r->in.handle == NULL) {
13932 0 : PyErr_NoMemory();
13933 0 : return false;
13934 : }
13935 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
13936 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
13937 0 : PyErr_NoMemory();
13938 0 : return false;
13939 : }
13940 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
13941 0 : return true;
13942 : }
13943 :
13944 0 : static PyObject *unpack_py_lsa_Delete_args_out(struct lsa_Delete *r)
13945 : {
13946 0 : PyObject *result;
13947 0 : result = Py_None;
13948 0 : Py_INCREF(result);
13949 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13950 0 : PyErr_SetNTSTATUS(r->out.result);
13951 0 : return NULL;
13952 : }
13953 :
13954 0 : return result;
13955 : }
13956 :
13957 :
13958 0 : static PyObject *py_lsa_EnumPrivs_in_get_handle(PyObject *obj, void *closure)
13959 : {
13960 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
13961 0 : PyObject *py_handle;
13962 0 : if (object->in.handle == NULL) {
13963 0 : Py_RETURN_NONE;
13964 : }
13965 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13966 0 : return py_handle;
13967 : }
13968 :
13969 0 : static int py_lsa_EnumPrivs_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13970 : {
13971 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
13972 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13973 0 : if (value == NULL) {
13974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
13975 0 : return -1;
13976 : }
13977 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13978 0 : if (object->in.handle == NULL) {
13979 0 : PyErr_NoMemory();
13980 0 : return -1;
13981 : }
13982 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13983 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13984 0 : PyErr_NoMemory();
13985 0 : return -1;
13986 : }
13987 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
13988 0 : return 0;
13989 : }
13990 :
13991 0 : static PyObject *py_lsa_EnumPrivs_in_get_resume_handle(PyObject *obj, void *closure)
13992 : {
13993 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
13994 0 : PyObject *py_resume_handle;
13995 0 : if (object->in.resume_handle == NULL) {
13996 0 : Py_RETURN_NONE;
13997 : }
13998 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.resume_handle));
13999 0 : return py_resume_handle;
14000 : }
14001 :
14002 0 : static int py_lsa_EnumPrivs_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
14003 : {
14004 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14005 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
14006 0 : if (value == NULL) {
14007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.resume_handle");
14008 0 : return -1;
14009 : }
14010 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
14011 0 : if (object->in.resume_handle == NULL) {
14012 0 : PyErr_NoMemory();
14013 0 : return -1;
14014 : }
14015 : {
14016 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
14017 0 : if (PyLong_Check(value)) {
14018 0 : unsigned long long test_var;
14019 0 : test_var = PyLong_AsUnsignedLongLong(value);
14020 0 : if (PyErr_Occurred() != NULL) {
14021 0 : return -1;
14022 : }
14023 0 : if (test_var > uint_max) {
14024 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14025 : PyLong_Type.tp_name, uint_max, test_var);
14026 0 : return -1;
14027 : }
14028 0 : *object->in.resume_handle = test_var;
14029 : } else {
14030 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14031 : PyLong_Type.tp_name);
14032 0 : return -1;
14033 : }
14034 : }
14035 0 : return 0;
14036 : }
14037 :
14038 0 : static PyObject *py_lsa_EnumPrivs_out_get_resume_handle(PyObject *obj, void *closure)
14039 : {
14040 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
14041 0 : PyObject *py_resume_handle;
14042 0 : if (object->out.resume_handle == NULL) {
14043 0 : Py_RETURN_NONE;
14044 : }
14045 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.resume_handle));
14046 0 : return py_resume_handle;
14047 : }
14048 :
14049 0 : static int py_lsa_EnumPrivs_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
14050 : {
14051 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14052 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
14053 0 : if (value == NULL) {
14054 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.resume_handle");
14055 0 : return -1;
14056 : }
14057 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
14058 0 : if (object->out.resume_handle == NULL) {
14059 0 : PyErr_NoMemory();
14060 0 : return -1;
14061 : }
14062 : {
14063 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
14064 0 : if (PyLong_Check(value)) {
14065 0 : unsigned long long test_var;
14066 0 : test_var = PyLong_AsUnsignedLongLong(value);
14067 0 : if (PyErr_Occurred() != NULL) {
14068 0 : return -1;
14069 : }
14070 0 : if (test_var > uint_max) {
14071 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14072 : PyLong_Type.tp_name, uint_max, test_var);
14073 0 : return -1;
14074 : }
14075 0 : *object->out.resume_handle = test_var;
14076 : } else {
14077 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14078 : PyLong_Type.tp_name);
14079 0 : return -1;
14080 : }
14081 : }
14082 0 : return 0;
14083 : }
14084 :
14085 0 : static PyObject *py_lsa_EnumPrivs_out_get_privs(PyObject *obj, void *closure)
14086 : {
14087 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
14088 0 : PyObject *py_privs;
14089 0 : if (object->out.privs == NULL) {
14090 0 : Py_RETURN_NONE;
14091 : }
14092 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, object->out.privs, object->out.privs);
14093 0 : return py_privs;
14094 : }
14095 :
14096 0 : static int py_lsa_EnumPrivs_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
14097 : {
14098 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14099 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
14100 0 : if (value == NULL) {
14101 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.privs");
14102 0 : return -1;
14103 : }
14104 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
14105 0 : if (object->out.privs == NULL) {
14106 0 : PyErr_NoMemory();
14107 0 : return -1;
14108 : }
14109 0 : PY_CHECK_TYPE(&lsa_PrivArray_Type, value, return -1;);
14110 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14111 0 : PyErr_NoMemory();
14112 0 : return -1;
14113 : }
14114 0 : object->out.privs = (struct lsa_PrivArray *)pytalloc_get_ptr(value);
14115 0 : return 0;
14116 : }
14117 :
14118 0 : static PyObject *py_lsa_EnumPrivs_in_get_max_count(PyObject *obj, void *closure)
14119 : {
14120 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
14121 0 : PyObject *py_max_count;
14122 0 : py_max_count = PyLong_FromUnsignedLongLong((uint32_t)(object->in.max_count));
14123 0 : return py_max_count;
14124 : }
14125 :
14126 0 : static int py_lsa_EnumPrivs_in_set_max_count(PyObject *py_obj, PyObject *value, void *closure)
14127 : {
14128 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14129 0 : if (value == NULL) {
14130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.max_count");
14131 0 : return -1;
14132 : }
14133 : {
14134 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_count));
14135 0 : if (PyLong_Check(value)) {
14136 0 : unsigned long long test_var;
14137 0 : test_var = PyLong_AsUnsignedLongLong(value);
14138 0 : if (PyErr_Occurred() != NULL) {
14139 0 : return -1;
14140 : }
14141 0 : if (test_var > uint_max) {
14142 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14143 : PyLong_Type.tp_name, uint_max, test_var);
14144 0 : return -1;
14145 : }
14146 0 : object->in.max_count = test_var;
14147 : } else {
14148 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14149 : PyLong_Type.tp_name);
14150 0 : return -1;
14151 : }
14152 : }
14153 0 : return 0;
14154 : }
14155 :
14156 0 : static PyObject *py_lsa_EnumPrivs_get_result(PyObject *obj, void *closure)
14157 : {
14158 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(obj);
14159 0 : PyObject *py_result;
14160 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14161 0 : return py_result;
14162 : }
14163 :
14164 0 : static int py_lsa_EnumPrivs_set_result(PyObject *py_obj, PyObject *value, void *closure)
14165 : {
14166 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14167 0 : if (value == NULL) {
14168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
14169 0 : return -1;
14170 : }
14171 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14172 0 : return 0;
14173 : }
14174 :
14175 : static PyGetSetDef py_lsa_EnumPrivs_getsetters[] = {
14176 : {
14177 : .name = discard_const_p(char, "in_handle"),
14178 : .get = py_lsa_EnumPrivs_in_get_handle,
14179 : .set = py_lsa_EnumPrivs_in_set_handle,
14180 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14181 : },
14182 : {
14183 : .name = discard_const_p(char, "in_resume_handle"),
14184 : .get = py_lsa_EnumPrivs_in_get_resume_handle,
14185 : .set = py_lsa_EnumPrivs_in_set_resume_handle,
14186 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14187 : },
14188 : {
14189 : .name = discard_const_p(char, "out_resume_handle"),
14190 : .get = py_lsa_EnumPrivs_out_get_resume_handle,
14191 : .set = py_lsa_EnumPrivs_out_set_resume_handle,
14192 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14193 : },
14194 : {
14195 : .name = discard_const_p(char, "out_privs"),
14196 : .get = py_lsa_EnumPrivs_out_get_privs,
14197 : .set = py_lsa_EnumPrivs_out_set_privs,
14198 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivArray")
14199 : },
14200 : {
14201 : .name = discard_const_p(char, "in_max_count"),
14202 : .get = py_lsa_EnumPrivs_in_get_max_count,
14203 : .set = py_lsa_EnumPrivs_in_set_max_count,
14204 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
14205 : },
14206 : {
14207 : .name = discard_const_p(char, "result"),
14208 : .get = py_lsa_EnumPrivs_get_result,
14209 : .set = py_lsa_EnumPrivs_set_result,
14210 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14211 : },
14212 : { .name = NULL }
14213 : };
14214 :
14215 0 : static PyObject *py_lsa_EnumPrivs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14216 : {
14217 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivs, type);
14218 0 : struct lsa_EnumPrivs *_self = (struct lsa_EnumPrivs *)pytalloc_get_ptr(self);
14219 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14220 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14221 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
14222 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
14223 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivArray);
14224 0 : return self;
14225 : }
14226 :
14227 0 : static PyObject *py_lsa_EnumPrivs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14228 : {
14229 :
14230 :
14231 0 : return PyLong_FromLong(2);
14232 : }
14233 :
14234 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14235 : {
14236 0 : const struct ndr_interface_call *call = NULL;
14237 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14238 0 : PyObject *ret = NULL;
14239 0 : struct ndr_push *push = NULL;
14240 0 : DATA_BLOB blob;
14241 0 : enum ndr_err_code err;
14242 :
14243 0 : if (ndr_table_lsarpc.num_calls < 3) {
14244 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_pack");
14245 0 : return NULL;
14246 : }
14247 0 : call = &ndr_table_lsarpc.calls[2];
14248 :
14249 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14250 0 : if (push == NULL) {
14251 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14252 0 : return NULL;
14253 : }
14254 :
14255 0 : push->flags |= ndr_push_flags;
14256 :
14257 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14258 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14259 0 : TALLOC_FREE(push);
14260 0 : PyErr_SetNdrError(err);
14261 0 : return NULL;
14262 : }
14263 0 : blob = ndr_push_blob(push);
14264 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14265 0 : TALLOC_FREE(push);
14266 0 : return ret;
14267 : }
14268 :
14269 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14270 : {
14271 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14272 0 : PyObject *bigendian_obj = NULL;
14273 0 : PyObject *ndr64_obj = NULL;
14274 0 : libndr_flags ndr_push_flags = 0;
14275 :
14276 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14277 : discard_const_p(char *, kwnames),
14278 : &bigendian_obj,
14279 : &ndr64_obj)) {
14280 0 : return NULL;
14281 : }
14282 :
14283 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14284 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14285 : }
14286 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14287 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14288 : }
14289 :
14290 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14291 : }
14292 :
14293 0 : static PyObject *py_lsa_EnumPrivs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14294 : {
14295 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14296 0 : PyObject *bigendian_obj = NULL;
14297 0 : PyObject *ndr64_obj = NULL;
14298 0 : libndr_flags ndr_push_flags = 0;
14299 :
14300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14301 : discard_const_p(char *, kwnames),
14302 : &bigendian_obj,
14303 : &ndr64_obj)) {
14304 0 : return NULL;
14305 : }
14306 :
14307 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14308 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14309 : }
14310 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14311 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14312 : }
14313 :
14314 0 : return py_lsa_EnumPrivs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14315 : }
14316 :
14317 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)
14318 : {
14319 0 : const struct ndr_interface_call *call = NULL;
14320 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14321 0 : struct ndr_pull *pull = NULL;
14322 0 : enum ndr_err_code err;
14323 :
14324 0 : if (ndr_table_lsarpc.num_calls < 3) {
14325 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_unpack");
14326 0 : return NULL;
14327 : }
14328 0 : call = &ndr_table_lsarpc.calls[2];
14329 :
14330 0 : pull = ndr_pull_init_blob(blob, object);
14331 0 : if (pull == NULL) {
14332 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14333 0 : return NULL;
14334 : }
14335 :
14336 0 : pull->flags |= ndr_pull_flags;
14337 :
14338 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14339 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14340 0 : TALLOC_FREE(pull);
14341 0 : PyErr_SetNdrError(err);
14342 0 : return NULL;
14343 : }
14344 0 : if (!allow_remaining) {
14345 0 : uint32_t highest_ofs;
14346 :
14347 0 : if (pull->offset > pull->relative_highest_offset) {
14348 0 : highest_ofs = pull->offset;
14349 : } else {
14350 0 : highest_ofs = pull->relative_highest_offset;
14351 : }
14352 0 : if (highest_ofs < pull->data_size) {
14353 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14354 : "not all bytes consumed ofs[%u] size[%u]",
14355 : highest_ofs, pull->data_size);
14356 0 : TALLOC_FREE(pull);
14357 0 : PyErr_SetNdrError(err);
14358 0 : return NULL;
14359 : }
14360 : }
14361 :
14362 0 : TALLOC_FREE(pull);
14363 0 : Py_RETURN_NONE;
14364 : }
14365 :
14366 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14367 : {
14368 0 : DATA_BLOB blob;
14369 0 : Py_ssize_t blob_length = 0;
14370 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14371 0 : PyObject *bigendian_obj = NULL;
14372 0 : PyObject *ndr64_obj = NULL;
14373 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14374 0 : PyObject *allow_remaining_obj = NULL;
14375 0 : bool allow_remaining = false;
14376 :
14377 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14378 : discard_const_p(char *, kwnames),
14379 : &blob.data, &blob_length,
14380 : &bigendian_obj,
14381 : &ndr64_obj,
14382 : &allow_remaining_obj)) {
14383 0 : return NULL;
14384 : }
14385 0 : blob.length = blob_length;
14386 :
14387 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14388 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14389 : }
14390 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14391 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14392 : }
14393 :
14394 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14395 0 : allow_remaining = true;
14396 : }
14397 :
14398 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14399 : }
14400 :
14401 0 : static PyObject *py_lsa_EnumPrivs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14402 : {
14403 0 : DATA_BLOB blob;
14404 0 : Py_ssize_t blob_length = 0;
14405 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14406 0 : PyObject *bigendian_obj = NULL;
14407 0 : PyObject *ndr64_obj = NULL;
14408 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14409 0 : PyObject *allow_remaining_obj = NULL;
14410 0 : bool allow_remaining = false;
14411 :
14412 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14413 : discard_const_p(char *, kwnames),
14414 : &blob.data, &blob_length,
14415 : &bigendian_obj,
14416 : &ndr64_obj,
14417 : &allow_remaining_obj)) {
14418 0 : return NULL;
14419 : }
14420 0 : blob.length = blob_length;
14421 :
14422 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14423 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14424 : }
14425 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14426 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14427 : }
14428 :
14429 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14430 0 : allow_remaining = true;
14431 : }
14432 :
14433 0 : return py_lsa_EnumPrivs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14434 : }
14435 :
14436 0 : static PyObject *py_lsa_EnumPrivs_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14437 : {
14438 0 : const struct ndr_interface_call *call = NULL;
14439 0 : struct lsa_EnumPrivs *object = pytalloc_get_ptr(py_obj);
14440 0 : PyObject *ret;
14441 0 : char *retstr;
14442 :
14443 0 : if (ndr_table_lsarpc.num_calls < 3) {
14444 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivs_ndr_print");
14445 0 : return NULL;
14446 : }
14447 0 : call = &ndr_table_lsarpc.calls[2];
14448 :
14449 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14450 0 : ret = PyUnicode_FromString(retstr);
14451 0 : TALLOC_FREE(retstr);
14452 :
14453 0 : return ret;
14454 : }
14455 :
14456 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14457 : {
14458 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_in", NDR_IN);
14459 : }
14460 :
14461 0 : static PyObject *py_lsa_EnumPrivs_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14462 : {
14463 0 : return py_lsa_EnumPrivs_ndr_print(py_obj, "lsa_EnumPrivs_out", NDR_OUT);
14464 : }
14465 :
14466 : static PyMethodDef py_lsa_EnumPrivs_methods[] = {
14467 : { "opnum", (PyCFunction)py_lsa_EnumPrivs_ndr_opnum, METH_NOARGS|METH_CLASS,
14468 : "lsa.EnumPrivs.opnum() -> 2 (0x02) " },
14469 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14470 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14471 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14472 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14473 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14474 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14475 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14476 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14477 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14478 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivs_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14479 : { NULL, NULL, 0, NULL }
14480 : };
14481 :
14482 :
14483 : static PyTypeObject lsa_EnumPrivs_Type = {
14484 : PyVarObject_HEAD_INIT(NULL, 0)
14485 : .tp_name = "lsa.EnumPrivs",
14486 : .tp_getset = py_lsa_EnumPrivs_getsetters,
14487 : .tp_methods = py_lsa_EnumPrivs_methods,
14488 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14489 : .tp_new = py_lsa_EnumPrivs_new,
14490 : };
14491 :
14492 0 : static bool pack_py_lsa_EnumPrivs_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivs *r)
14493 : {
14494 0 : PyObject *py_handle;
14495 0 : PyObject *py_resume_handle;
14496 0 : PyObject *py_max_count;
14497 0 : const char *kwnames[] = {
14498 : "handle", "resume_handle", "max_count", NULL
14499 : };
14500 :
14501 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumPrivs", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_count)) {
14502 0 : return false;
14503 : }
14504 :
14505 0 : if (py_handle == NULL) {
14506 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
14507 0 : return false;
14508 : }
14509 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14510 0 : if (r->in.handle == NULL) {
14511 0 : PyErr_NoMemory();
14512 0 : return false;
14513 : }
14514 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14515 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14516 0 : PyErr_NoMemory();
14517 0 : return false;
14518 : }
14519 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14520 0 : if (py_resume_handle == NULL) {
14521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.resume_handle");
14522 0 : return false;
14523 : }
14524 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
14525 0 : if (r->in.resume_handle == NULL) {
14526 0 : PyErr_NoMemory();
14527 0 : return false;
14528 : }
14529 : {
14530 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
14531 0 : if (PyLong_Check(py_resume_handle)) {
14532 0 : unsigned long long test_var;
14533 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
14534 0 : if (PyErr_Occurred() != NULL) {
14535 0 : return false;
14536 : }
14537 0 : if (test_var > uint_max) {
14538 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14539 : PyLong_Type.tp_name, uint_max, test_var);
14540 0 : return false;
14541 : }
14542 0 : *r->in.resume_handle = test_var;
14543 : } else {
14544 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14545 : PyLong_Type.tp_name);
14546 0 : return false;
14547 : }
14548 : }
14549 0 : if (py_max_count == NULL) {
14550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.max_count");
14551 0 : return false;
14552 : }
14553 : {
14554 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_count));
14555 0 : if (PyLong_Check(py_max_count)) {
14556 0 : unsigned long long test_var;
14557 0 : test_var = PyLong_AsUnsignedLongLong(py_max_count);
14558 0 : if (PyErr_Occurred() != NULL) {
14559 0 : return false;
14560 : }
14561 0 : if (test_var > uint_max) {
14562 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14563 : PyLong_Type.tp_name, uint_max, test_var);
14564 0 : return false;
14565 : }
14566 0 : r->in.max_count = test_var;
14567 : } else {
14568 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14569 : PyLong_Type.tp_name);
14570 0 : return false;
14571 : }
14572 : }
14573 0 : return true;
14574 : }
14575 :
14576 0 : static PyObject *unpack_py_lsa_EnumPrivs_args_out(struct lsa_EnumPrivs *r)
14577 : {
14578 0 : PyObject *result;
14579 0 : PyObject *py_resume_handle;
14580 0 : PyObject *py_privs;
14581 0 : result = PyTuple_New(2);
14582 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.resume_handle));
14583 0 : PyTuple_SetItem(result, 0, py_resume_handle);
14584 0 : py_privs = pytalloc_reference_ex(&lsa_PrivArray_Type, r->out.privs, r->out.privs);
14585 0 : PyTuple_SetItem(result, 1, py_privs);
14586 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14587 0 : PyErr_SetNTSTATUS(r->out.result);
14588 0 : return NULL;
14589 : }
14590 :
14591 0 : return result;
14592 : }
14593 :
14594 :
14595 0 : static PyObject *py_lsa_QuerySecurity_in_get_handle(PyObject *obj, void *closure)
14596 : {
14597 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(obj);
14598 0 : PyObject *py_handle;
14599 0 : if (object->in.handle == NULL) {
14600 0 : Py_RETURN_NONE;
14601 : }
14602 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14603 0 : return py_handle;
14604 : }
14605 :
14606 0 : static int py_lsa_QuerySecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14607 : {
14608 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14609 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14610 0 : if (value == NULL) {
14611 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
14612 0 : return -1;
14613 : }
14614 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14615 0 : if (object->in.handle == NULL) {
14616 0 : PyErr_NoMemory();
14617 0 : return -1;
14618 : }
14619 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14620 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14621 0 : PyErr_NoMemory();
14622 0 : return -1;
14623 : }
14624 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14625 0 : return 0;
14626 : }
14627 :
14628 0 : static PyObject *py_lsa_QuerySecurity_in_get_sec_info(PyObject *obj, void *closure)
14629 : {
14630 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(obj);
14631 0 : PyObject *py_sec_info;
14632 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)(object->in.sec_info));
14633 0 : return py_sec_info;
14634 : }
14635 :
14636 0 : static int py_lsa_QuerySecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
14637 : {
14638 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14639 0 : if (value == NULL) {
14640 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sec_info");
14641 0 : return -1;
14642 : }
14643 : {
14644 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
14645 0 : if (PyLong_Check(value)) {
14646 0 : unsigned long long test_var;
14647 0 : test_var = PyLong_AsUnsignedLongLong(value);
14648 0 : if (PyErr_Occurred() != NULL) {
14649 0 : return -1;
14650 : }
14651 0 : if (test_var > uint_max) {
14652 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14653 : PyLong_Type.tp_name, uint_max, test_var);
14654 0 : return -1;
14655 : }
14656 0 : object->in.sec_info = test_var;
14657 : } else {
14658 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14659 : PyLong_Type.tp_name);
14660 0 : return -1;
14661 : }
14662 : }
14663 0 : return 0;
14664 : }
14665 :
14666 0 : static PyObject *py_lsa_QuerySecurity_out_get_sdbuf(PyObject *obj, void *closure)
14667 : {
14668 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(obj);
14669 0 : PyObject *py_sdbuf;
14670 0 : if (object->out.sdbuf == NULL) {
14671 0 : Py_RETURN_NONE;
14672 : }
14673 0 : if (*object->out.sdbuf == NULL) {
14674 0 : py_sdbuf = Py_None;
14675 0 : Py_INCREF(py_sdbuf);
14676 : } else {
14677 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *object->out.sdbuf, *object->out.sdbuf);
14678 : }
14679 0 : return py_sdbuf;
14680 : }
14681 :
14682 0 : static int py_lsa_QuerySecurity_out_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
14683 : {
14684 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14685 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sdbuf));
14686 0 : if (value == NULL) {
14687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sdbuf");
14688 0 : return -1;
14689 : }
14690 0 : object->out.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sdbuf);
14691 0 : if (object->out.sdbuf == NULL) {
14692 0 : PyErr_NoMemory();
14693 0 : return -1;
14694 : }
14695 0 : if (value == Py_None) {
14696 0 : *object->out.sdbuf = NULL;
14697 : } else {
14698 0 : *object->out.sdbuf = NULL;
14699 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
14700 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14701 0 : PyErr_NoMemory();
14702 0 : return -1;
14703 : }
14704 0 : *object->out.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
14705 : }
14706 0 : return 0;
14707 : }
14708 :
14709 0 : static PyObject *py_lsa_QuerySecurity_get_result(PyObject *obj, void *closure)
14710 : {
14711 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(obj);
14712 0 : PyObject *py_result;
14713 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14714 0 : return py_result;
14715 : }
14716 :
14717 0 : static int py_lsa_QuerySecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
14718 : {
14719 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14720 0 : if (value == NULL) {
14721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
14722 0 : return -1;
14723 : }
14724 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14725 0 : return 0;
14726 : }
14727 :
14728 : static PyGetSetDef py_lsa_QuerySecurity_getsetters[] = {
14729 : {
14730 : .name = discard_const_p(char, "in_handle"),
14731 : .get = py_lsa_QuerySecurity_in_get_handle,
14732 : .set = py_lsa_QuerySecurity_in_set_handle,
14733 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14734 : },
14735 : {
14736 : .name = discard_const_p(char, "in_sec_info"),
14737 : .get = py_lsa_QuerySecurity_in_get_sec_info,
14738 : .set = py_lsa_QuerySecurity_in_set_sec_info,
14739 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
14740 : },
14741 : {
14742 : .name = discard_const_p(char, "out_sdbuf"),
14743 : .get = py_lsa_QuerySecurity_out_get_sdbuf,
14744 : .set = py_lsa_QuerySecurity_out_set_sdbuf,
14745 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
14746 : },
14747 : {
14748 : .name = discard_const_p(char, "result"),
14749 : .get = py_lsa_QuerySecurity_get_result,
14750 : .set = py_lsa_QuerySecurity_set_result,
14751 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14752 : },
14753 : { .name = NULL }
14754 : };
14755 :
14756 0 : static PyObject *py_lsa_QuerySecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14757 : {
14758 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecurity, type);
14759 0 : struct lsa_QuerySecurity *_self = (struct lsa_QuerySecurity *)pytalloc_get_ptr(self);
14760 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14761 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14762 : /* a pointer to a NULL pointer */
14763 0 : _self->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
14764 0 : return self;
14765 : }
14766 :
14767 0 : static PyObject *py_lsa_QuerySecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14768 : {
14769 :
14770 :
14771 0 : return PyLong_FromLong(3);
14772 : }
14773 :
14774 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14775 : {
14776 0 : const struct ndr_interface_call *call = NULL;
14777 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14778 0 : PyObject *ret = NULL;
14779 0 : struct ndr_push *push = NULL;
14780 0 : DATA_BLOB blob;
14781 0 : enum ndr_err_code err;
14782 :
14783 0 : if (ndr_table_lsarpc.num_calls < 4) {
14784 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_pack");
14785 0 : return NULL;
14786 : }
14787 0 : call = &ndr_table_lsarpc.calls[3];
14788 :
14789 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14790 0 : if (push == NULL) {
14791 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14792 0 : return NULL;
14793 : }
14794 :
14795 0 : push->flags |= ndr_push_flags;
14796 :
14797 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14798 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14799 0 : TALLOC_FREE(push);
14800 0 : PyErr_SetNdrError(err);
14801 0 : return NULL;
14802 : }
14803 0 : blob = ndr_push_blob(push);
14804 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14805 0 : TALLOC_FREE(push);
14806 0 : return ret;
14807 : }
14808 :
14809 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14810 : {
14811 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14812 0 : PyObject *bigendian_obj = NULL;
14813 0 : PyObject *ndr64_obj = NULL;
14814 0 : libndr_flags ndr_push_flags = 0;
14815 :
14816 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14817 : discard_const_p(char *, kwnames),
14818 : &bigendian_obj,
14819 : &ndr64_obj)) {
14820 0 : return NULL;
14821 : }
14822 :
14823 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14824 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14825 : }
14826 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14827 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14828 : }
14829 :
14830 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14831 : }
14832 :
14833 0 : static PyObject *py_lsa_QuerySecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14834 : {
14835 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14836 0 : PyObject *bigendian_obj = NULL;
14837 0 : PyObject *ndr64_obj = NULL;
14838 0 : libndr_flags ndr_push_flags = 0;
14839 :
14840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14841 : discard_const_p(char *, kwnames),
14842 : &bigendian_obj,
14843 : &ndr64_obj)) {
14844 0 : return NULL;
14845 : }
14846 :
14847 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14848 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14849 : }
14850 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14851 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14852 : }
14853 :
14854 0 : return py_lsa_QuerySecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14855 : }
14856 :
14857 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)
14858 : {
14859 0 : const struct ndr_interface_call *call = NULL;
14860 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14861 0 : struct ndr_pull *pull = NULL;
14862 0 : enum ndr_err_code err;
14863 :
14864 0 : if (ndr_table_lsarpc.num_calls < 4) {
14865 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_unpack");
14866 0 : return NULL;
14867 : }
14868 0 : call = &ndr_table_lsarpc.calls[3];
14869 :
14870 0 : pull = ndr_pull_init_blob(blob, object);
14871 0 : if (pull == NULL) {
14872 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14873 0 : return NULL;
14874 : }
14875 :
14876 0 : pull->flags |= ndr_pull_flags;
14877 :
14878 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14879 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14880 0 : TALLOC_FREE(pull);
14881 0 : PyErr_SetNdrError(err);
14882 0 : return NULL;
14883 : }
14884 0 : if (!allow_remaining) {
14885 0 : uint32_t highest_ofs;
14886 :
14887 0 : if (pull->offset > pull->relative_highest_offset) {
14888 0 : highest_ofs = pull->offset;
14889 : } else {
14890 0 : highest_ofs = pull->relative_highest_offset;
14891 : }
14892 0 : if (highest_ofs < pull->data_size) {
14893 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14894 : "not all bytes consumed ofs[%u] size[%u]",
14895 : highest_ofs, pull->data_size);
14896 0 : TALLOC_FREE(pull);
14897 0 : PyErr_SetNdrError(err);
14898 0 : return NULL;
14899 : }
14900 : }
14901 :
14902 0 : TALLOC_FREE(pull);
14903 0 : Py_RETURN_NONE;
14904 : }
14905 :
14906 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14907 : {
14908 0 : DATA_BLOB blob;
14909 0 : Py_ssize_t blob_length = 0;
14910 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14911 0 : PyObject *bigendian_obj = NULL;
14912 0 : PyObject *ndr64_obj = NULL;
14913 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14914 0 : PyObject *allow_remaining_obj = NULL;
14915 0 : bool allow_remaining = false;
14916 :
14917 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14918 : discard_const_p(char *, kwnames),
14919 : &blob.data, &blob_length,
14920 : &bigendian_obj,
14921 : &ndr64_obj,
14922 : &allow_remaining_obj)) {
14923 0 : return NULL;
14924 : }
14925 0 : blob.length = blob_length;
14926 :
14927 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14928 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14929 : }
14930 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14931 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14932 : }
14933 :
14934 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14935 0 : allow_remaining = true;
14936 : }
14937 :
14938 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14939 : }
14940 :
14941 0 : static PyObject *py_lsa_QuerySecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14942 : {
14943 0 : DATA_BLOB blob;
14944 0 : Py_ssize_t blob_length = 0;
14945 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14946 0 : PyObject *bigendian_obj = NULL;
14947 0 : PyObject *ndr64_obj = NULL;
14948 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14949 0 : PyObject *allow_remaining_obj = NULL;
14950 0 : bool allow_remaining = false;
14951 :
14952 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14953 : discard_const_p(char *, kwnames),
14954 : &blob.data, &blob_length,
14955 : &bigendian_obj,
14956 : &ndr64_obj,
14957 : &allow_remaining_obj)) {
14958 0 : return NULL;
14959 : }
14960 0 : blob.length = blob_length;
14961 :
14962 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14963 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14964 : }
14965 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14966 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14967 : }
14968 :
14969 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14970 0 : allow_remaining = true;
14971 : }
14972 :
14973 0 : return py_lsa_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14974 : }
14975 :
14976 0 : static PyObject *py_lsa_QuerySecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14977 : {
14978 0 : const struct ndr_interface_call *call = NULL;
14979 0 : struct lsa_QuerySecurity *object = pytalloc_get_ptr(py_obj);
14980 0 : PyObject *ret;
14981 0 : char *retstr;
14982 :
14983 0 : if (ndr_table_lsarpc.num_calls < 4) {
14984 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecurity_ndr_print");
14985 0 : return NULL;
14986 : }
14987 0 : call = &ndr_table_lsarpc.calls[3];
14988 :
14989 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14990 0 : ret = PyUnicode_FromString(retstr);
14991 0 : TALLOC_FREE(retstr);
14992 :
14993 0 : return ret;
14994 : }
14995 :
14996 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14997 : {
14998 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_in", NDR_IN);
14999 : }
15000 :
15001 0 : static PyObject *py_lsa_QuerySecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15002 : {
15003 0 : return py_lsa_QuerySecurity_ndr_print(py_obj, "lsa_QuerySecurity_out", NDR_OUT);
15004 : }
15005 :
15006 : static PyMethodDef py_lsa_QuerySecurity_methods[] = {
15007 : { "opnum", (PyCFunction)py_lsa_QuerySecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
15008 : "lsa.QuerySecurity.opnum() -> 3 (0x03) " },
15009 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15010 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15011 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15012 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15013 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15014 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15015 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15016 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15017 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15018 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15019 : { NULL, NULL, 0, NULL }
15020 : };
15021 :
15022 :
15023 : static PyTypeObject lsa_QuerySecurity_Type = {
15024 : PyVarObject_HEAD_INIT(NULL, 0)
15025 : .tp_name = "lsa.QuerySecurity",
15026 : .tp_getset = py_lsa_QuerySecurity_getsetters,
15027 : .tp_methods = py_lsa_QuerySecurity_methods,
15028 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15029 : .tp_new = py_lsa_QuerySecurity_new,
15030 : };
15031 :
15032 0 : static bool pack_py_lsa_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecurity *r)
15033 : {
15034 0 : PyObject *py_handle;
15035 0 : PyObject *py_sec_info;
15036 0 : const char *kwnames[] = {
15037 : "handle", "sec_info", NULL
15038 : };
15039 :
15040 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
15041 0 : return false;
15042 : }
15043 :
15044 0 : if (py_handle == NULL) {
15045 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
15046 0 : return false;
15047 : }
15048 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15049 0 : if (r->in.handle == NULL) {
15050 0 : PyErr_NoMemory();
15051 0 : return false;
15052 : }
15053 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15054 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15055 0 : PyErr_NoMemory();
15056 0 : return false;
15057 : }
15058 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15059 0 : if (py_sec_info == NULL) {
15060 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sec_info");
15061 0 : return false;
15062 : }
15063 : {
15064 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
15065 0 : if (PyLong_Check(py_sec_info)) {
15066 0 : unsigned long long test_var;
15067 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
15068 0 : if (PyErr_Occurred() != NULL) {
15069 0 : return false;
15070 : }
15071 0 : if (test_var > uint_max) {
15072 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15073 : PyLong_Type.tp_name, uint_max, test_var);
15074 0 : return false;
15075 : }
15076 0 : r->in.sec_info = test_var;
15077 : } else {
15078 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15079 : PyLong_Type.tp_name);
15080 0 : return false;
15081 : }
15082 : }
15083 0 : return true;
15084 : }
15085 :
15086 0 : static PyObject *unpack_py_lsa_QuerySecurity_args_out(struct lsa_QuerySecurity *r)
15087 : {
15088 0 : PyObject *result;
15089 0 : PyObject *py_sdbuf;
15090 0 : if (*r->out.sdbuf == NULL) {
15091 0 : py_sdbuf = Py_None;
15092 0 : Py_INCREF(py_sdbuf);
15093 : } else {
15094 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
15095 : }
15096 0 : result = py_sdbuf;
15097 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15098 0 : PyErr_SetNTSTATUS(r->out.result);
15099 0 : return NULL;
15100 : }
15101 :
15102 0 : return result;
15103 : }
15104 :
15105 :
15106 0 : static PyObject *py_lsa_SetSecObj_in_get_handle(PyObject *obj, void *closure)
15107 : {
15108 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(obj);
15109 0 : PyObject *py_handle;
15110 0 : if (object->in.handle == NULL) {
15111 0 : Py_RETURN_NONE;
15112 : }
15113 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
15114 0 : return py_handle;
15115 : }
15116 :
15117 0 : static int py_lsa_SetSecObj_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15118 : {
15119 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15120 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
15121 0 : if (value == NULL) {
15122 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
15123 0 : return -1;
15124 : }
15125 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
15126 0 : if (object->in.handle == NULL) {
15127 0 : PyErr_NoMemory();
15128 0 : return -1;
15129 : }
15130 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15131 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15132 0 : PyErr_NoMemory();
15133 0 : return -1;
15134 : }
15135 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
15136 0 : return 0;
15137 : }
15138 :
15139 0 : static PyObject *py_lsa_SetSecObj_in_get_sec_info(PyObject *obj, void *closure)
15140 : {
15141 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(obj);
15142 0 : PyObject *py_sec_info;
15143 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)(object->in.sec_info));
15144 0 : return py_sec_info;
15145 : }
15146 :
15147 0 : static int py_lsa_SetSecObj_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
15148 : {
15149 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15150 0 : if (value == NULL) {
15151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sec_info");
15152 0 : return -1;
15153 : }
15154 : {
15155 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
15156 0 : if (PyLong_Check(value)) {
15157 0 : unsigned long long test_var;
15158 0 : test_var = PyLong_AsUnsignedLongLong(value);
15159 0 : if (PyErr_Occurred() != NULL) {
15160 0 : return -1;
15161 : }
15162 0 : if (test_var > uint_max) {
15163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15164 : PyLong_Type.tp_name, uint_max, test_var);
15165 0 : return -1;
15166 : }
15167 0 : object->in.sec_info = test_var;
15168 : } else {
15169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15170 : PyLong_Type.tp_name);
15171 0 : return -1;
15172 : }
15173 : }
15174 0 : return 0;
15175 : }
15176 :
15177 0 : static PyObject *py_lsa_SetSecObj_in_get_sdbuf(PyObject *obj, void *closure)
15178 : {
15179 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(obj);
15180 0 : PyObject *py_sdbuf;
15181 0 : if (object->in.sdbuf == NULL) {
15182 0 : Py_RETURN_NONE;
15183 : }
15184 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, object->in.sdbuf, object->in.sdbuf);
15185 0 : return py_sdbuf;
15186 : }
15187 :
15188 0 : static int py_lsa_SetSecObj_in_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
15189 : {
15190 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15191 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sdbuf));
15192 0 : if (value == NULL) {
15193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sdbuf");
15194 0 : return -1;
15195 : }
15196 0 : object->in.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sdbuf);
15197 0 : if (object->in.sdbuf == NULL) {
15198 0 : PyErr_NoMemory();
15199 0 : return -1;
15200 : }
15201 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
15202 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15203 0 : PyErr_NoMemory();
15204 0 : return -1;
15205 : }
15206 0 : object->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
15207 0 : return 0;
15208 : }
15209 :
15210 0 : static PyObject *py_lsa_SetSecObj_get_result(PyObject *obj, void *closure)
15211 : {
15212 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(obj);
15213 0 : PyObject *py_result;
15214 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15215 0 : return py_result;
15216 : }
15217 :
15218 0 : static int py_lsa_SetSecObj_set_result(PyObject *py_obj, PyObject *value, void *closure)
15219 : {
15220 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15221 0 : if (value == NULL) {
15222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
15223 0 : return -1;
15224 : }
15225 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15226 0 : return 0;
15227 : }
15228 :
15229 : static PyGetSetDef py_lsa_SetSecObj_getsetters[] = {
15230 : {
15231 : .name = discard_const_p(char, "in_handle"),
15232 : .get = py_lsa_SetSecObj_in_get_handle,
15233 : .set = py_lsa_SetSecObj_in_set_handle,
15234 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15235 : },
15236 : {
15237 : .name = discard_const_p(char, "in_sec_info"),
15238 : .get = py_lsa_SetSecObj_in_get_sec_info,
15239 : .set = py_lsa_SetSecObj_in_set_sec_info,
15240 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
15241 : },
15242 : {
15243 : .name = discard_const_p(char, "in_sdbuf"),
15244 : .get = py_lsa_SetSecObj_in_get_sdbuf,
15245 : .set = py_lsa_SetSecObj_in_set_sdbuf,
15246 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
15247 : },
15248 : {
15249 : .name = discard_const_p(char, "result"),
15250 : .get = py_lsa_SetSecObj_get_result,
15251 : .set = py_lsa_SetSecObj_set_result,
15252 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15253 : },
15254 : { .name = NULL }
15255 : };
15256 :
15257 0 : static PyObject *py_lsa_SetSecObj_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15258 : {
15259 0 : PyObject *self = pytalloc_new(struct lsa_SetSecObj, type);
15260 0 : struct lsa_SetSecObj *_self = (struct lsa_SetSecObj *)pytalloc_get_ptr(self);
15261 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15262 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15263 0 : _self->in.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf);
15264 0 : return self;
15265 : }
15266 :
15267 0 : static PyObject *py_lsa_SetSecObj_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15268 : {
15269 :
15270 :
15271 0 : return PyLong_FromLong(4);
15272 : }
15273 :
15274 0 : static PyObject *py_lsa_SetSecObj_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15275 : {
15276 0 : const struct ndr_interface_call *call = NULL;
15277 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15278 0 : PyObject *ret = NULL;
15279 0 : struct ndr_push *push = NULL;
15280 0 : DATA_BLOB blob;
15281 0 : enum ndr_err_code err;
15282 :
15283 0 : if (ndr_table_lsarpc.num_calls < 5) {
15284 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_pack");
15285 0 : return NULL;
15286 : }
15287 0 : call = &ndr_table_lsarpc.calls[4];
15288 :
15289 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15290 0 : if (push == NULL) {
15291 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15292 0 : return NULL;
15293 : }
15294 :
15295 0 : push->flags |= ndr_push_flags;
15296 :
15297 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15298 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15299 0 : TALLOC_FREE(push);
15300 0 : PyErr_SetNdrError(err);
15301 0 : return NULL;
15302 : }
15303 0 : blob = ndr_push_blob(push);
15304 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15305 0 : TALLOC_FREE(push);
15306 0 : return ret;
15307 : }
15308 :
15309 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15310 : {
15311 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15312 0 : PyObject *bigendian_obj = NULL;
15313 0 : PyObject *ndr64_obj = NULL;
15314 0 : libndr_flags ndr_push_flags = 0;
15315 :
15316 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15317 : discard_const_p(char *, kwnames),
15318 : &bigendian_obj,
15319 : &ndr64_obj)) {
15320 0 : return NULL;
15321 : }
15322 :
15323 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15324 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15325 : }
15326 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15327 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15328 : }
15329 :
15330 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15331 : }
15332 :
15333 0 : static PyObject *py_lsa_SetSecObj_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15334 : {
15335 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15336 0 : PyObject *bigendian_obj = NULL;
15337 0 : PyObject *ndr64_obj = NULL;
15338 0 : libndr_flags ndr_push_flags = 0;
15339 :
15340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15341 : discard_const_p(char *, kwnames),
15342 : &bigendian_obj,
15343 : &ndr64_obj)) {
15344 0 : return NULL;
15345 : }
15346 :
15347 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15348 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15349 : }
15350 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15351 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15352 : }
15353 :
15354 0 : return py_lsa_SetSecObj_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15355 : }
15356 :
15357 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)
15358 : {
15359 0 : const struct ndr_interface_call *call = NULL;
15360 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15361 0 : struct ndr_pull *pull = NULL;
15362 0 : enum ndr_err_code err;
15363 :
15364 0 : if (ndr_table_lsarpc.num_calls < 5) {
15365 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_unpack");
15366 0 : return NULL;
15367 : }
15368 0 : call = &ndr_table_lsarpc.calls[4];
15369 :
15370 0 : pull = ndr_pull_init_blob(blob, object);
15371 0 : if (pull == NULL) {
15372 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15373 0 : return NULL;
15374 : }
15375 :
15376 0 : pull->flags |= ndr_pull_flags;
15377 :
15378 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15379 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15380 0 : TALLOC_FREE(pull);
15381 0 : PyErr_SetNdrError(err);
15382 0 : return NULL;
15383 : }
15384 0 : if (!allow_remaining) {
15385 0 : uint32_t highest_ofs;
15386 :
15387 0 : if (pull->offset > pull->relative_highest_offset) {
15388 0 : highest_ofs = pull->offset;
15389 : } else {
15390 0 : highest_ofs = pull->relative_highest_offset;
15391 : }
15392 0 : if (highest_ofs < pull->data_size) {
15393 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15394 : "not all bytes consumed ofs[%u] size[%u]",
15395 : highest_ofs, pull->data_size);
15396 0 : TALLOC_FREE(pull);
15397 0 : PyErr_SetNdrError(err);
15398 0 : return NULL;
15399 : }
15400 : }
15401 :
15402 0 : TALLOC_FREE(pull);
15403 0 : Py_RETURN_NONE;
15404 : }
15405 :
15406 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15407 : {
15408 0 : DATA_BLOB blob;
15409 0 : Py_ssize_t blob_length = 0;
15410 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15411 0 : PyObject *bigendian_obj = NULL;
15412 0 : PyObject *ndr64_obj = NULL;
15413 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15414 0 : PyObject *allow_remaining_obj = NULL;
15415 0 : bool allow_remaining = false;
15416 :
15417 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15418 : discard_const_p(char *, kwnames),
15419 : &blob.data, &blob_length,
15420 : &bigendian_obj,
15421 : &ndr64_obj,
15422 : &allow_remaining_obj)) {
15423 0 : return NULL;
15424 : }
15425 0 : blob.length = blob_length;
15426 :
15427 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15428 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15429 : }
15430 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15431 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15432 : }
15433 :
15434 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15435 0 : allow_remaining = true;
15436 : }
15437 :
15438 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15439 : }
15440 :
15441 0 : static PyObject *py_lsa_SetSecObj_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15442 : {
15443 0 : DATA_BLOB blob;
15444 0 : Py_ssize_t blob_length = 0;
15445 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15446 0 : PyObject *bigendian_obj = NULL;
15447 0 : PyObject *ndr64_obj = NULL;
15448 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15449 0 : PyObject *allow_remaining_obj = NULL;
15450 0 : bool allow_remaining = false;
15451 :
15452 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15453 : discard_const_p(char *, kwnames),
15454 : &blob.data, &blob_length,
15455 : &bigendian_obj,
15456 : &ndr64_obj,
15457 : &allow_remaining_obj)) {
15458 0 : return NULL;
15459 : }
15460 0 : blob.length = blob_length;
15461 :
15462 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15463 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15464 : }
15465 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15466 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15467 : }
15468 :
15469 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15470 0 : allow_remaining = true;
15471 : }
15472 :
15473 0 : return py_lsa_SetSecObj_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15474 : }
15475 :
15476 0 : static PyObject *py_lsa_SetSecObj_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15477 : {
15478 0 : const struct ndr_interface_call *call = NULL;
15479 0 : struct lsa_SetSecObj *object = pytalloc_get_ptr(py_obj);
15480 0 : PyObject *ret;
15481 0 : char *retstr;
15482 :
15483 0 : if (ndr_table_lsarpc.num_calls < 5) {
15484 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecObj_ndr_print");
15485 0 : return NULL;
15486 : }
15487 0 : call = &ndr_table_lsarpc.calls[4];
15488 :
15489 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15490 0 : ret = PyUnicode_FromString(retstr);
15491 0 : TALLOC_FREE(retstr);
15492 :
15493 0 : return ret;
15494 : }
15495 :
15496 0 : static PyObject *py_lsa_SetSecObj_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15497 : {
15498 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_in", NDR_IN);
15499 : }
15500 :
15501 0 : static PyObject *py_lsa_SetSecObj_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15502 : {
15503 0 : return py_lsa_SetSecObj_ndr_print(py_obj, "lsa_SetSecObj_out", NDR_OUT);
15504 : }
15505 :
15506 : static PyMethodDef py_lsa_SetSecObj_methods[] = {
15507 : { "opnum", (PyCFunction)py_lsa_SetSecObj_ndr_opnum, METH_NOARGS|METH_CLASS,
15508 : "lsa.SetSecObj.opnum() -> 4 (0x04) " },
15509 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15510 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15511 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15512 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15513 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15514 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15515 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecObj_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15516 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15517 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecObj_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15518 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecObj_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15519 : { NULL, NULL, 0, NULL }
15520 : };
15521 :
15522 :
15523 : static PyTypeObject lsa_SetSecObj_Type = {
15524 : PyVarObject_HEAD_INIT(NULL, 0)
15525 : .tp_name = "lsa.SetSecObj",
15526 : .tp_getset = py_lsa_SetSecObj_getsetters,
15527 : .tp_methods = py_lsa_SetSecObj_methods,
15528 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15529 : .tp_new = py_lsa_SetSecObj_new,
15530 : };
15531 :
15532 0 : static bool pack_py_lsa_SetSecObj_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecObj *r)
15533 : {
15534 0 : PyObject *py_handle;
15535 0 : PyObject *py_sec_info;
15536 0 : PyObject *py_sdbuf;
15537 0 : const char *kwnames[] = {
15538 : "handle", "sec_info", "sdbuf", NULL
15539 : };
15540 :
15541 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecObj", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
15542 0 : return false;
15543 : }
15544 :
15545 0 : if (py_handle == NULL) {
15546 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
15547 0 : return false;
15548 : }
15549 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15550 0 : if (r->in.handle == NULL) {
15551 0 : PyErr_NoMemory();
15552 0 : return false;
15553 : }
15554 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15555 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15556 0 : PyErr_NoMemory();
15557 0 : return false;
15558 : }
15559 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15560 0 : if (py_sec_info == NULL) {
15561 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sec_info");
15562 0 : return false;
15563 : }
15564 : {
15565 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
15566 0 : if (PyLong_Check(py_sec_info)) {
15567 0 : unsigned long long test_var;
15568 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
15569 0 : if (PyErr_Occurred() != NULL) {
15570 0 : return false;
15571 : }
15572 0 : if (test_var > uint_max) {
15573 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15574 : PyLong_Type.tp_name, uint_max, test_var);
15575 0 : return false;
15576 : }
15577 0 : r->in.sec_info = test_var;
15578 : } else {
15579 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15580 : PyLong_Type.tp_name);
15581 0 : return false;
15582 : }
15583 : }
15584 0 : if (py_sdbuf == NULL) {
15585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sdbuf");
15586 0 : return false;
15587 : }
15588 0 : r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
15589 0 : if (r->in.sdbuf == NULL) {
15590 0 : PyErr_NoMemory();
15591 0 : return false;
15592 : }
15593 0 : PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
15594 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
15595 0 : PyErr_NoMemory();
15596 0 : return false;
15597 : }
15598 0 : r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
15599 0 : return true;
15600 : }
15601 :
15602 0 : static PyObject *unpack_py_lsa_SetSecObj_args_out(struct lsa_SetSecObj *r)
15603 : {
15604 0 : PyObject *result;
15605 0 : result = Py_None;
15606 0 : Py_INCREF(result);
15607 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15608 0 : PyErr_SetNTSTATUS(r->out.result);
15609 0 : return NULL;
15610 : }
15611 :
15612 0 : return result;
15613 : }
15614 :
15615 :
15616 0 : static PyObject *py_lsa_OpenPolicy_in_get_system_name(PyObject *obj, void *closure)
15617 : {
15618 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(obj);
15619 0 : PyObject *py_system_name;
15620 0 : if (object->in.system_name == NULL) {
15621 0 : Py_RETURN_NONE;
15622 : }
15623 0 : if (object->in.system_name == NULL) {
15624 0 : py_system_name = Py_None;
15625 0 : Py_INCREF(py_system_name);
15626 : } else {
15627 0 : py_system_name = PyLong_FromLong((uint16_t)(*object->in.system_name));
15628 : }
15629 0 : return py_system_name;
15630 : }
15631 :
15632 0 : static int py_lsa_OpenPolicy_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
15633 : {
15634 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15635 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.system_name));
15636 0 : if (value == NULL) {
15637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.system_name");
15638 0 : return -1;
15639 : }
15640 0 : if (value == Py_None) {
15641 0 : object->in.system_name = NULL;
15642 : } else {
15643 0 : object->in.system_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.system_name);
15644 0 : if (object->in.system_name == NULL) {
15645 0 : PyErr_NoMemory();
15646 0 : return -1;
15647 : }
15648 : {
15649 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.system_name));
15650 0 : if (PyLong_Check(value)) {
15651 0 : unsigned long long test_var;
15652 0 : test_var = PyLong_AsUnsignedLongLong(value);
15653 0 : if (PyErr_Occurred() != NULL) {
15654 0 : return -1;
15655 : }
15656 0 : if (test_var > uint_max) {
15657 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15658 : PyLong_Type.tp_name, uint_max, test_var);
15659 0 : return -1;
15660 : }
15661 0 : *object->in.system_name = test_var;
15662 : } else {
15663 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15664 : PyLong_Type.tp_name);
15665 0 : return -1;
15666 : }
15667 : }
15668 : }
15669 0 : return 0;
15670 : }
15671 :
15672 0 : static PyObject *py_lsa_OpenPolicy_in_get_attr(PyObject *obj, void *closure)
15673 : {
15674 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(obj);
15675 0 : PyObject *py_attr;
15676 0 : if (object->in.attr == NULL) {
15677 0 : Py_RETURN_NONE;
15678 : }
15679 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
15680 0 : return py_attr;
15681 : }
15682 :
15683 0 : static int py_lsa_OpenPolicy_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
15684 : {
15685 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15686 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
15687 0 : if (value == NULL) {
15688 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.attr");
15689 0 : return -1;
15690 : }
15691 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
15692 0 : if (object->in.attr == NULL) {
15693 0 : PyErr_NoMemory();
15694 0 : return -1;
15695 : }
15696 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
15697 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15698 0 : PyErr_NoMemory();
15699 0 : return -1;
15700 : }
15701 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
15702 0 : return 0;
15703 : }
15704 :
15705 0 : static PyObject *py_lsa_OpenPolicy_in_get_access_mask(PyObject *obj, void *closure)
15706 : {
15707 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(obj);
15708 0 : PyObject *py_access_mask;
15709 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
15710 0 : return py_access_mask;
15711 : }
15712 :
15713 0 : static int py_lsa_OpenPolicy_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
15714 : {
15715 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15716 0 : if (value == NULL) {
15717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
15718 0 : return -1;
15719 : }
15720 : {
15721 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
15722 0 : if (PyLong_Check(value)) {
15723 0 : unsigned long long test_var;
15724 0 : test_var = PyLong_AsUnsignedLongLong(value);
15725 0 : if (PyErr_Occurred() != NULL) {
15726 0 : return -1;
15727 : }
15728 0 : if (test_var > uint_max) {
15729 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15730 : PyLong_Type.tp_name, uint_max, test_var);
15731 0 : return -1;
15732 : }
15733 0 : object->in.access_mask = test_var;
15734 : } else {
15735 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15736 : PyLong_Type.tp_name);
15737 0 : return -1;
15738 : }
15739 : }
15740 0 : return 0;
15741 : }
15742 :
15743 0 : static PyObject *py_lsa_OpenPolicy_out_get_handle(PyObject *obj, void *closure)
15744 : {
15745 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(obj);
15746 0 : PyObject *py_handle;
15747 0 : if (object->out.handle == NULL) {
15748 0 : Py_RETURN_NONE;
15749 : }
15750 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
15751 0 : return py_handle;
15752 : }
15753 :
15754 0 : static int py_lsa_OpenPolicy_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
15755 : {
15756 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
15758 0 : if (value == NULL) {
15759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
15760 0 : return -1;
15761 : }
15762 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
15763 0 : if (object->out.handle == NULL) {
15764 0 : PyErr_NoMemory();
15765 0 : return -1;
15766 : }
15767 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15768 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15769 0 : PyErr_NoMemory();
15770 0 : return -1;
15771 : }
15772 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
15773 0 : return 0;
15774 : }
15775 :
15776 0 : static PyObject *py_lsa_OpenPolicy_get_result(PyObject *obj, void *closure)
15777 : {
15778 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(obj);
15779 0 : PyObject *py_result;
15780 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15781 0 : return py_result;
15782 : }
15783 :
15784 0 : static int py_lsa_OpenPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
15785 : {
15786 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15787 0 : if (value == NULL) {
15788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
15789 0 : return -1;
15790 : }
15791 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15792 0 : return 0;
15793 : }
15794 :
15795 : static PyGetSetDef py_lsa_OpenPolicy_getsetters[] = {
15796 : {
15797 : .name = discard_const_p(char, "in_system_name"),
15798 : .get = py_lsa_OpenPolicy_in_get_system_name,
15799 : .set = py_lsa_OpenPolicy_in_set_system_name,
15800 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
15801 : },
15802 : {
15803 : .name = discard_const_p(char, "in_attr"),
15804 : .get = py_lsa_OpenPolicy_in_get_attr,
15805 : .set = py_lsa_OpenPolicy_in_set_attr,
15806 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
15807 : },
15808 : {
15809 : .name = discard_const_p(char, "in_access_mask"),
15810 : .get = py_lsa_OpenPolicy_in_get_access_mask,
15811 : .set = py_lsa_OpenPolicy_in_set_access_mask,
15812 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
15813 : },
15814 : {
15815 : .name = discard_const_p(char, "out_handle"),
15816 : .get = py_lsa_OpenPolicy_out_get_handle,
15817 : .set = py_lsa_OpenPolicy_out_set_handle,
15818 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15819 : },
15820 : {
15821 : .name = discard_const_p(char, "result"),
15822 : .get = py_lsa_OpenPolicy_get_result,
15823 : .set = py_lsa_OpenPolicy_set_result,
15824 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15825 : },
15826 : { .name = NULL }
15827 : };
15828 :
15829 0 : static PyObject *py_lsa_OpenPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15830 : {
15831 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy, type);
15832 0 : struct lsa_OpenPolicy *_self = (struct lsa_OpenPolicy *)pytalloc_get_ptr(self);
15833 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15834 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
15835 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
15836 0 : return self;
15837 : }
15838 :
15839 0 : static PyObject *py_lsa_OpenPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15840 : {
15841 :
15842 :
15843 0 : return PyLong_FromLong(6);
15844 : }
15845 :
15846 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15847 : {
15848 0 : const struct ndr_interface_call *call = NULL;
15849 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15850 0 : PyObject *ret = NULL;
15851 0 : struct ndr_push *push = NULL;
15852 0 : DATA_BLOB blob;
15853 0 : enum ndr_err_code err;
15854 :
15855 0 : if (ndr_table_lsarpc.num_calls < 7) {
15856 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_pack");
15857 0 : return NULL;
15858 : }
15859 0 : call = &ndr_table_lsarpc.calls[6];
15860 :
15861 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15862 0 : if (push == NULL) {
15863 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15864 0 : return NULL;
15865 : }
15866 :
15867 0 : push->flags |= ndr_push_flags;
15868 :
15869 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15870 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15871 0 : TALLOC_FREE(push);
15872 0 : PyErr_SetNdrError(err);
15873 0 : return NULL;
15874 : }
15875 0 : blob = ndr_push_blob(push);
15876 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15877 0 : TALLOC_FREE(push);
15878 0 : return ret;
15879 : }
15880 :
15881 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15882 : {
15883 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15884 0 : PyObject *bigendian_obj = NULL;
15885 0 : PyObject *ndr64_obj = NULL;
15886 0 : libndr_flags ndr_push_flags = 0;
15887 :
15888 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15889 : discard_const_p(char *, kwnames),
15890 : &bigendian_obj,
15891 : &ndr64_obj)) {
15892 0 : return NULL;
15893 : }
15894 :
15895 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15896 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15897 : }
15898 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15899 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15900 : }
15901 :
15902 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15903 : }
15904 :
15905 0 : static PyObject *py_lsa_OpenPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15906 : {
15907 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15908 0 : PyObject *bigendian_obj = NULL;
15909 0 : PyObject *ndr64_obj = NULL;
15910 0 : libndr_flags ndr_push_flags = 0;
15911 :
15912 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15913 : discard_const_p(char *, kwnames),
15914 : &bigendian_obj,
15915 : &ndr64_obj)) {
15916 0 : return NULL;
15917 : }
15918 :
15919 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15920 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15921 : }
15922 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15923 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15924 : }
15925 :
15926 0 : return py_lsa_OpenPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15927 : }
15928 :
15929 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)
15930 : {
15931 0 : const struct ndr_interface_call *call = NULL;
15932 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
15933 0 : struct ndr_pull *pull = NULL;
15934 0 : enum ndr_err_code err;
15935 :
15936 0 : if (ndr_table_lsarpc.num_calls < 7) {
15937 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_unpack");
15938 0 : return NULL;
15939 : }
15940 0 : call = &ndr_table_lsarpc.calls[6];
15941 :
15942 0 : pull = ndr_pull_init_blob(blob, object);
15943 0 : if (pull == NULL) {
15944 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15945 0 : return NULL;
15946 : }
15947 :
15948 0 : pull->flags |= ndr_pull_flags;
15949 :
15950 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15951 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15952 0 : TALLOC_FREE(pull);
15953 0 : PyErr_SetNdrError(err);
15954 0 : return NULL;
15955 : }
15956 0 : if (!allow_remaining) {
15957 0 : uint32_t highest_ofs;
15958 :
15959 0 : if (pull->offset > pull->relative_highest_offset) {
15960 0 : highest_ofs = pull->offset;
15961 : } else {
15962 0 : highest_ofs = pull->relative_highest_offset;
15963 : }
15964 0 : if (highest_ofs < pull->data_size) {
15965 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15966 : "not all bytes consumed ofs[%u] size[%u]",
15967 : highest_ofs, pull->data_size);
15968 0 : TALLOC_FREE(pull);
15969 0 : PyErr_SetNdrError(err);
15970 0 : return NULL;
15971 : }
15972 : }
15973 :
15974 0 : TALLOC_FREE(pull);
15975 0 : Py_RETURN_NONE;
15976 : }
15977 :
15978 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15979 : {
15980 0 : DATA_BLOB blob;
15981 0 : Py_ssize_t blob_length = 0;
15982 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15983 0 : PyObject *bigendian_obj = NULL;
15984 0 : PyObject *ndr64_obj = NULL;
15985 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15986 0 : PyObject *allow_remaining_obj = NULL;
15987 0 : bool allow_remaining = false;
15988 :
15989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15990 : discard_const_p(char *, kwnames),
15991 : &blob.data, &blob_length,
15992 : &bigendian_obj,
15993 : &ndr64_obj,
15994 : &allow_remaining_obj)) {
15995 0 : return NULL;
15996 : }
15997 0 : blob.length = blob_length;
15998 :
15999 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16000 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16001 : }
16002 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16003 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16004 : }
16005 :
16006 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16007 0 : allow_remaining = true;
16008 : }
16009 :
16010 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16011 : }
16012 :
16013 0 : static PyObject *py_lsa_OpenPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16014 : {
16015 0 : DATA_BLOB blob;
16016 0 : Py_ssize_t blob_length = 0;
16017 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16018 0 : PyObject *bigendian_obj = NULL;
16019 0 : PyObject *ndr64_obj = NULL;
16020 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16021 0 : PyObject *allow_remaining_obj = NULL;
16022 0 : bool allow_remaining = false;
16023 :
16024 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16025 : discard_const_p(char *, kwnames),
16026 : &blob.data, &blob_length,
16027 : &bigendian_obj,
16028 : &ndr64_obj,
16029 : &allow_remaining_obj)) {
16030 0 : return NULL;
16031 : }
16032 0 : blob.length = blob_length;
16033 :
16034 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16035 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16036 : }
16037 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16038 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16039 : }
16040 :
16041 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16042 0 : allow_remaining = true;
16043 : }
16044 :
16045 0 : return py_lsa_OpenPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16046 : }
16047 :
16048 0 : static PyObject *py_lsa_OpenPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16049 : {
16050 0 : const struct ndr_interface_call *call = NULL;
16051 0 : struct lsa_OpenPolicy *object = pytalloc_get_ptr(py_obj);
16052 0 : PyObject *ret;
16053 0 : char *retstr;
16054 :
16055 0 : if (ndr_table_lsarpc.num_calls < 7) {
16056 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy_ndr_print");
16057 0 : return NULL;
16058 : }
16059 0 : call = &ndr_table_lsarpc.calls[6];
16060 :
16061 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16062 0 : ret = PyUnicode_FromString(retstr);
16063 0 : TALLOC_FREE(retstr);
16064 :
16065 0 : return ret;
16066 : }
16067 :
16068 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16069 : {
16070 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_in", NDR_IN);
16071 : }
16072 :
16073 0 : static PyObject *py_lsa_OpenPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16074 : {
16075 0 : return py_lsa_OpenPolicy_ndr_print(py_obj, "lsa_OpenPolicy_out", NDR_OUT);
16076 : }
16077 :
16078 : static PyMethodDef py_lsa_OpenPolicy_methods[] = {
16079 : { "opnum", (PyCFunction)py_lsa_OpenPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
16080 : "lsa.OpenPolicy.opnum() -> 6 (0x06) " },
16081 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16082 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16083 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16084 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16085 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16086 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16087 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16088 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16089 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16090 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16091 : { NULL, NULL, 0, NULL }
16092 : };
16093 :
16094 :
16095 : static PyTypeObject lsa_OpenPolicy_Type = {
16096 : PyVarObject_HEAD_INIT(NULL, 0)
16097 : .tp_name = "lsa.OpenPolicy",
16098 : .tp_getset = py_lsa_OpenPolicy_getsetters,
16099 : .tp_methods = py_lsa_OpenPolicy_methods,
16100 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16101 : .tp_new = py_lsa_OpenPolicy_new,
16102 : };
16103 :
16104 0 : static bool pack_py_lsa_OpenPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy *r)
16105 : {
16106 0 : PyObject *py_system_name;
16107 0 : PyObject *py_attr;
16108 0 : PyObject *py_access_mask;
16109 0 : const char *kwnames[] = {
16110 : "system_name", "attr", "access_mask", NULL
16111 : };
16112 :
16113 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
16114 0 : return false;
16115 : }
16116 :
16117 0 : if (py_system_name == NULL) {
16118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.system_name");
16119 0 : return false;
16120 : }
16121 0 : if (py_system_name == Py_None) {
16122 0 : r->in.system_name = NULL;
16123 : } else {
16124 0 : r->in.system_name = talloc_ptrtype(r, r->in.system_name);
16125 0 : if (r->in.system_name == NULL) {
16126 0 : PyErr_NoMemory();
16127 0 : return false;
16128 : }
16129 : {
16130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name));
16131 0 : if (PyLong_Check(py_system_name)) {
16132 0 : unsigned long long test_var;
16133 0 : test_var = PyLong_AsUnsignedLongLong(py_system_name);
16134 0 : if (PyErr_Occurred() != NULL) {
16135 0 : return false;
16136 : }
16137 0 : if (test_var > uint_max) {
16138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16139 : PyLong_Type.tp_name, uint_max, test_var);
16140 0 : return false;
16141 : }
16142 0 : *r->in.system_name = test_var;
16143 : } else {
16144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16145 : PyLong_Type.tp_name);
16146 0 : return false;
16147 : }
16148 : }
16149 : }
16150 0 : if (py_attr == NULL) {
16151 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.attr");
16152 0 : return false;
16153 : }
16154 0 : r->in.attr = talloc_ptrtype(r, r->in.attr);
16155 0 : if (r->in.attr == NULL) {
16156 0 : PyErr_NoMemory();
16157 0 : return false;
16158 : }
16159 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
16160 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
16161 0 : PyErr_NoMemory();
16162 0 : return false;
16163 : }
16164 0 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
16165 0 : if (py_access_mask == NULL) {
16166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
16167 0 : return false;
16168 : }
16169 : {
16170 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
16171 0 : if (PyLong_Check(py_access_mask)) {
16172 0 : unsigned long long test_var;
16173 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
16174 0 : if (PyErr_Occurred() != NULL) {
16175 0 : return false;
16176 : }
16177 0 : if (test_var > uint_max) {
16178 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16179 : PyLong_Type.tp_name, uint_max, test_var);
16180 0 : return false;
16181 : }
16182 0 : r->in.access_mask = test_var;
16183 : } else {
16184 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16185 : PyLong_Type.tp_name);
16186 0 : return false;
16187 : }
16188 : }
16189 0 : return true;
16190 : }
16191 :
16192 0 : static PyObject *unpack_py_lsa_OpenPolicy_args_out(struct lsa_OpenPolicy *r)
16193 : {
16194 0 : PyObject *result;
16195 0 : PyObject *py_handle;
16196 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
16197 0 : result = py_handle;
16198 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
16199 0 : PyErr_SetNTSTATUS(r->out.result);
16200 0 : return NULL;
16201 : }
16202 :
16203 0 : return result;
16204 : }
16205 :
16206 :
16207 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_handle(PyObject *obj, void *closure)
16208 : {
16209 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(obj);
16210 0 : PyObject *py_handle;
16211 0 : if (object->in.handle == NULL) {
16212 0 : Py_RETURN_NONE;
16213 : }
16214 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
16215 0 : return py_handle;
16216 : }
16217 :
16218 0 : static int py_lsa_QueryInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16219 : {
16220 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16221 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16222 0 : if (value == NULL) {
16223 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
16224 0 : return -1;
16225 : }
16226 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16227 0 : if (object->in.handle == NULL) {
16228 0 : PyErr_NoMemory();
16229 0 : return -1;
16230 : }
16231 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16232 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16233 0 : PyErr_NoMemory();
16234 0 : return -1;
16235 : }
16236 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16237 0 : return 0;
16238 : }
16239 :
16240 0 : static PyObject *py_lsa_QueryInfoPolicy_in_get_level(PyObject *obj, void *closure)
16241 : {
16242 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(obj);
16243 0 : PyObject *py_level;
16244 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
16245 0 : return py_level;
16246 : }
16247 :
16248 0 : static int py_lsa_QueryInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
16249 : {
16250 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16251 0 : if (value == NULL) {
16252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
16253 0 : return -1;
16254 : }
16255 : {
16256 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
16257 0 : if (PyLong_Check(value)) {
16258 0 : unsigned long long test_var;
16259 0 : test_var = PyLong_AsUnsignedLongLong(value);
16260 0 : if (PyErr_Occurred() != NULL) {
16261 0 : return -1;
16262 : }
16263 0 : if (test_var > uint_max) {
16264 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16265 : PyLong_Type.tp_name, uint_max, test_var);
16266 0 : return -1;
16267 : }
16268 0 : object->in.level = test_var;
16269 : } else {
16270 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16271 : PyLong_Type.tp_name);
16272 0 : return -1;
16273 : }
16274 : }
16275 0 : return 0;
16276 : }
16277 :
16278 0 : static PyObject *py_lsa_QueryInfoPolicy_out_get_info(PyObject *obj, void *closure)
16279 : {
16280 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(obj);
16281 0 : PyObject *py_info;
16282 0 : if (object->out.info == NULL) {
16283 0 : Py_RETURN_NONE;
16284 : }
16285 0 : if (*object->out.info == NULL) {
16286 0 : py_info = Py_None;
16287 0 : Py_INCREF(py_info);
16288 : } else {
16289 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
16290 0 : if (py_info == NULL) {
16291 0 : return NULL;
16292 : }
16293 : }
16294 0 : return py_info;
16295 : }
16296 :
16297 0 : static int py_lsa_QueryInfoPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
16298 : {
16299 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16300 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
16301 0 : if (value == NULL) {
16302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
16303 0 : return -1;
16304 : }
16305 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
16306 0 : if (object->out.info == NULL) {
16307 0 : PyErr_NoMemory();
16308 0 : return -1;
16309 : }
16310 0 : if (value == Py_None) {
16311 0 : *object->out.info = NULL;
16312 : } else {
16313 0 : *object->out.info = NULL;
16314 : {
16315 0 : union lsa_PolicyInformation *info_switch_2;
16316 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");
16317 0 : if (info_switch_2 == NULL) {
16318 0 : return -1;
16319 : }
16320 0 : *object->out.info = info_switch_2;
16321 : }
16322 : }
16323 0 : return 0;
16324 : }
16325 :
16326 0 : static PyObject *py_lsa_QueryInfoPolicy_get_result(PyObject *obj, void *closure)
16327 : {
16328 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(obj);
16329 0 : PyObject *py_result;
16330 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16331 0 : return py_result;
16332 : }
16333 :
16334 0 : static int py_lsa_QueryInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
16335 : {
16336 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16337 0 : if (value == NULL) {
16338 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
16339 0 : return -1;
16340 : }
16341 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16342 0 : return 0;
16343 : }
16344 :
16345 : static PyGetSetDef py_lsa_QueryInfoPolicy_getsetters[] = {
16346 : {
16347 : .name = discard_const_p(char, "in_handle"),
16348 : .get = py_lsa_QueryInfoPolicy_in_get_handle,
16349 : .set = py_lsa_QueryInfoPolicy_in_set_handle,
16350 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16351 : },
16352 : {
16353 : .name = discard_const_p(char, "in_level"),
16354 : .get = py_lsa_QueryInfoPolicy_in_get_level,
16355 : .set = py_lsa_QueryInfoPolicy_in_set_level,
16356 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
16357 : },
16358 : {
16359 : .name = discard_const_p(char, "out_info"),
16360 : .get = py_lsa_QueryInfoPolicy_out_get_info,
16361 : .set = py_lsa_QueryInfoPolicy_out_set_info,
16362 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
16363 : },
16364 : {
16365 : .name = discard_const_p(char, "result"),
16366 : .get = py_lsa_QueryInfoPolicy_get_result,
16367 : .set = py_lsa_QueryInfoPolicy_set_result,
16368 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16369 : },
16370 : { .name = NULL }
16371 : };
16372 :
16373 0 : static PyObject *py_lsa_QueryInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16374 : {
16375 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy, type);
16376 0 : struct lsa_QueryInfoPolicy *_self = (struct lsa_QueryInfoPolicy *)pytalloc_get_ptr(self);
16377 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16378 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16379 : /* a pointer to a NULL pointer */
16380 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
16381 0 : return self;
16382 : }
16383 :
16384 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16385 : {
16386 :
16387 :
16388 0 : return PyLong_FromLong(7);
16389 : }
16390 :
16391 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16392 : {
16393 0 : const struct ndr_interface_call *call = NULL;
16394 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16395 0 : PyObject *ret = NULL;
16396 0 : struct ndr_push *push = NULL;
16397 0 : DATA_BLOB blob;
16398 0 : enum ndr_err_code err;
16399 :
16400 0 : if (ndr_table_lsarpc.num_calls < 8) {
16401 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_pack");
16402 0 : return NULL;
16403 : }
16404 0 : call = &ndr_table_lsarpc.calls[7];
16405 :
16406 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16407 0 : if (push == NULL) {
16408 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16409 0 : return NULL;
16410 : }
16411 :
16412 0 : push->flags |= ndr_push_flags;
16413 :
16414 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16415 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16416 0 : TALLOC_FREE(push);
16417 0 : PyErr_SetNdrError(err);
16418 0 : return NULL;
16419 : }
16420 0 : blob = ndr_push_blob(push);
16421 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16422 0 : TALLOC_FREE(push);
16423 0 : return ret;
16424 : }
16425 :
16426 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16427 : {
16428 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16429 0 : PyObject *bigendian_obj = NULL;
16430 0 : PyObject *ndr64_obj = NULL;
16431 0 : libndr_flags ndr_push_flags = 0;
16432 :
16433 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16434 : discard_const_p(char *, kwnames),
16435 : &bigendian_obj,
16436 : &ndr64_obj)) {
16437 0 : return NULL;
16438 : }
16439 :
16440 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16441 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16442 : }
16443 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16444 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16445 : }
16446 :
16447 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16448 : }
16449 :
16450 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16451 : {
16452 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16453 0 : PyObject *bigendian_obj = NULL;
16454 0 : PyObject *ndr64_obj = NULL;
16455 0 : libndr_flags ndr_push_flags = 0;
16456 :
16457 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16458 : discard_const_p(char *, kwnames),
16459 : &bigendian_obj,
16460 : &ndr64_obj)) {
16461 0 : return NULL;
16462 : }
16463 :
16464 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16465 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16466 : }
16467 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16468 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16469 : }
16470 :
16471 0 : return py_lsa_QueryInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16472 : }
16473 :
16474 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)
16475 : {
16476 0 : const struct ndr_interface_call *call = NULL;
16477 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16478 0 : struct ndr_pull *pull = NULL;
16479 0 : enum ndr_err_code err;
16480 :
16481 0 : if (ndr_table_lsarpc.num_calls < 8) {
16482 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_unpack");
16483 0 : return NULL;
16484 : }
16485 0 : call = &ndr_table_lsarpc.calls[7];
16486 :
16487 0 : pull = ndr_pull_init_blob(blob, object);
16488 0 : if (pull == NULL) {
16489 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16490 0 : return NULL;
16491 : }
16492 :
16493 0 : pull->flags |= ndr_pull_flags;
16494 :
16495 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16496 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16497 0 : TALLOC_FREE(pull);
16498 0 : PyErr_SetNdrError(err);
16499 0 : return NULL;
16500 : }
16501 0 : if (!allow_remaining) {
16502 0 : uint32_t highest_ofs;
16503 :
16504 0 : if (pull->offset > pull->relative_highest_offset) {
16505 0 : highest_ofs = pull->offset;
16506 : } else {
16507 0 : highest_ofs = pull->relative_highest_offset;
16508 : }
16509 0 : if (highest_ofs < pull->data_size) {
16510 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16511 : "not all bytes consumed ofs[%u] size[%u]",
16512 : highest_ofs, pull->data_size);
16513 0 : TALLOC_FREE(pull);
16514 0 : PyErr_SetNdrError(err);
16515 0 : return NULL;
16516 : }
16517 : }
16518 :
16519 0 : TALLOC_FREE(pull);
16520 0 : Py_RETURN_NONE;
16521 : }
16522 :
16523 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16524 : {
16525 0 : DATA_BLOB blob;
16526 0 : Py_ssize_t blob_length = 0;
16527 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16528 0 : PyObject *bigendian_obj = NULL;
16529 0 : PyObject *ndr64_obj = NULL;
16530 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16531 0 : PyObject *allow_remaining_obj = NULL;
16532 0 : bool allow_remaining = false;
16533 :
16534 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16535 : discard_const_p(char *, kwnames),
16536 : &blob.data, &blob_length,
16537 : &bigendian_obj,
16538 : &ndr64_obj,
16539 : &allow_remaining_obj)) {
16540 0 : return NULL;
16541 : }
16542 0 : blob.length = blob_length;
16543 :
16544 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16545 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16546 : }
16547 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16548 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16549 : }
16550 :
16551 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16552 0 : allow_remaining = true;
16553 : }
16554 :
16555 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16556 : }
16557 :
16558 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16559 : {
16560 0 : DATA_BLOB blob;
16561 0 : Py_ssize_t blob_length = 0;
16562 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16563 0 : PyObject *bigendian_obj = NULL;
16564 0 : PyObject *ndr64_obj = NULL;
16565 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16566 0 : PyObject *allow_remaining_obj = NULL;
16567 0 : bool allow_remaining = false;
16568 :
16569 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16570 : discard_const_p(char *, kwnames),
16571 : &blob.data, &blob_length,
16572 : &bigendian_obj,
16573 : &ndr64_obj,
16574 : &allow_remaining_obj)) {
16575 0 : return NULL;
16576 : }
16577 0 : blob.length = blob_length;
16578 :
16579 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16580 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16581 : }
16582 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16583 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16584 : }
16585 :
16586 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16587 0 : allow_remaining = true;
16588 : }
16589 :
16590 0 : return py_lsa_QueryInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16591 : }
16592 :
16593 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16594 : {
16595 0 : const struct ndr_interface_call *call = NULL;
16596 0 : struct lsa_QueryInfoPolicy *object = pytalloc_get_ptr(py_obj);
16597 0 : PyObject *ret;
16598 0 : char *retstr;
16599 :
16600 0 : if (ndr_table_lsarpc.num_calls < 8) {
16601 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy_ndr_print");
16602 0 : return NULL;
16603 : }
16604 0 : call = &ndr_table_lsarpc.calls[7];
16605 :
16606 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16607 0 : ret = PyUnicode_FromString(retstr);
16608 0 : TALLOC_FREE(retstr);
16609 :
16610 0 : return ret;
16611 : }
16612 :
16613 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16614 : {
16615 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_in", NDR_IN);
16616 : }
16617 :
16618 0 : static PyObject *py_lsa_QueryInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16619 : {
16620 0 : return py_lsa_QueryInfoPolicy_ndr_print(py_obj, "lsa_QueryInfoPolicy_out", NDR_OUT);
16621 : }
16622 :
16623 : static PyMethodDef py_lsa_QueryInfoPolicy_methods[] = {
16624 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
16625 : "lsa.QueryInfoPolicy.opnum() -> 7 (0x07) " },
16626 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16627 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16628 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16629 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16630 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16631 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16632 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16633 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16634 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16635 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16636 : { NULL, NULL, 0, NULL }
16637 : };
16638 :
16639 :
16640 : static PyTypeObject lsa_QueryInfoPolicy_Type = {
16641 : PyVarObject_HEAD_INIT(NULL, 0)
16642 : .tp_name = "lsa.QueryInfoPolicy",
16643 : .tp_getset = py_lsa_QueryInfoPolicy_getsetters,
16644 : .tp_methods = py_lsa_QueryInfoPolicy_methods,
16645 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16646 : .tp_new = py_lsa_QueryInfoPolicy_new,
16647 : };
16648 :
16649 0 : static bool pack_py_lsa_QueryInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy *r)
16650 : {
16651 0 : PyObject *py_handle;
16652 0 : PyObject *py_level;
16653 0 : const char *kwnames[] = {
16654 : "handle", "level", NULL
16655 : };
16656 :
16657 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
16658 0 : return false;
16659 : }
16660 :
16661 0 : if (py_handle == NULL) {
16662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
16663 0 : return false;
16664 : }
16665 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
16666 0 : if (r->in.handle == NULL) {
16667 0 : PyErr_NoMemory();
16668 0 : return false;
16669 : }
16670 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
16671 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
16672 0 : PyErr_NoMemory();
16673 0 : return false;
16674 : }
16675 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
16676 0 : if (py_level == NULL) {
16677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
16678 0 : return false;
16679 : }
16680 : {
16681 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
16682 0 : if (PyLong_Check(py_level)) {
16683 0 : unsigned long long test_var;
16684 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
16685 0 : if (PyErr_Occurred() != NULL) {
16686 0 : return false;
16687 : }
16688 0 : if (test_var > uint_max) {
16689 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16690 : PyLong_Type.tp_name, uint_max, test_var);
16691 0 : return false;
16692 : }
16693 0 : r->in.level = test_var;
16694 : } else {
16695 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16696 : PyLong_Type.tp_name);
16697 0 : return false;
16698 : }
16699 : }
16700 0 : return true;
16701 : }
16702 :
16703 0 : static PyObject *unpack_py_lsa_QueryInfoPolicy_args_out(struct lsa_QueryInfoPolicy *r)
16704 : {
16705 0 : PyObject *result;
16706 0 : PyObject *py_info;
16707 0 : if (*r->out.info == NULL) {
16708 0 : py_info = Py_None;
16709 0 : Py_INCREF(py_info);
16710 : } else {
16711 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
16712 0 : if (py_info == NULL) {
16713 0 : return NULL;
16714 : }
16715 : }
16716 0 : result = py_info;
16717 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
16718 0 : PyErr_SetNTSTATUS(r->out.result);
16719 0 : return NULL;
16720 : }
16721 :
16722 0 : return result;
16723 : }
16724 :
16725 :
16726 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_handle(PyObject *obj, void *closure)
16727 : {
16728 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(obj);
16729 0 : PyObject *py_handle;
16730 0 : if (object->in.handle == NULL) {
16731 0 : Py_RETURN_NONE;
16732 : }
16733 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
16734 0 : return py_handle;
16735 : }
16736 :
16737 0 : static int py_lsa_SetInfoPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
16738 : {
16739 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16740 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
16741 0 : if (value == NULL) {
16742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
16743 0 : return -1;
16744 : }
16745 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
16746 0 : if (object->in.handle == NULL) {
16747 0 : PyErr_NoMemory();
16748 0 : return -1;
16749 : }
16750 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16751 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16752 0 : PyErr_NoMemory();
16753 0 : return -1;
16754 : }
16755 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
16756 0 : return 0;
16757 : }
16758 :
16759 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_level(PyObject *obj, void *closure)
16760 : {
16761 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(obj);
16762 0 : PyObject *py_level;
16763 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
16764 0 : return py_level;
16765 : }
16766 :
16767 0 : static int py_lsa_SetInfoPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
16768 : {
16769 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16770 0 : if (value == NULL) {
16771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
16772 0 : return -1;
16773 : }
16774 : {
16775 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
16776 0 : if (PyLong_Check(value)) {
16777 0 : unsigned long long test_var;
16778 0 : test_var = PyLong_AsUnsignedLongLong(value);
16779 0 : if (PyErr_Occurred() != NULL) {
16780 0 : return -1;
16781 : }
16782 0 : if (test_var > uint_max) {
16783 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16784 : PyLong_Type.tp_name, uint_max, test_var);
16785 0 : return -1;
16786 : }
16787 0 : object->in.level = test_var;
16788 : } else {
16789 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16790 : PyLong_Type.tp_name);
16791 0 : return -1;
16792 : }
16793 : }
16794 0 : return 0;
16795 : }
16796 :
16797 0 : static PyObject *py_lsa_SetInfoPolicy_in_get_info(PyObject *obj, void *closure)
16798 : {
16799 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(obj);
16800 0 : PyObject *py_info;
16801 0 : if (object->in.info == NULL) {
16802 0 : Py_RETURN_NONE;
16803 : }
16804 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
16805 0 : if (py_info == NULL) {
16806 0 : return NULL;
16807 : }
16808 0 : return py_info;
16809 : }
16810 :
16811 0 : static int py_lsa_SetInfoPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
16812 : {
16813 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16814 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
16815 0 : if (value == NULL) {
16816 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
16817 0 : return -1;
16818 : }
16819 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
16820 0 : if (object->in.info == NULL) {
16821 0 : PyErr_NoMemory();
16822 0 : return -1;
16823 : }
16824 : {
16825 0 : union lsa_PolicyInformation *info_switch_1;
16826 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");
16827 0 : if (info_switch_1 == NULL) {
16828 0 : return -1;
16829 : }
16830 0 : object->in.info = info_switch_1;
16831 : }
16832 0 : return 0;
16833 : }
16834 :
16835 0 : static PyObject *py_lsa_SetInfoPolicy_get_result(PyObject *obj, void *closure)
16836 : {
16837 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(obj);
16838 0 : PyObject *py_result;
16839 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16840 0 : return py_result;
16841 : }
16842 :
16843 0 : static int py_lsa_SetInfoPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
16844 : {
16845 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16846 0 : if (value == NULL) {
16847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
16848 0 : return -1;
16849 : }
16850 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16851 0 : return 0;
16852 : }
16853 :
16854 : static PyGetSetDef py_lsa_SetInfoPolicy_getsetters[] = {
16855 : {
16856 : .name = discard_const_p(char, "in_handle"),
16857 : .get = py_lsa_SetInfoPolicy_in_get_handle,
16858 : .set = py_lsa_SetInfoPolicy_in_set_handle,
16859 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16860 : },
16861 : {
16862 : .name = discard_const_p(char, "in_level"),
16863 : .get = py_lsa_SetInfoPolicy_in_get_level,
16864 : .set = py_lsa_SetInfoPolicy_in_set_level,
16865 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
16866 : },
16867 : {
16868 : .name = discard_const_p(char, "in_info"),
16869 : .get = py_lsa_SetInfoPolicy_in_get_info,
16870 : .set = py_lsa_SetInfoPolicy_in_set_info,
16871 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
16872 : },
16873 : {
16874 : .name = discard_const_p(char, "result"),
16875 : .get = py_lsa_SetInfoPolicy_get_result,
16876 : .set = py_lsa_SetInfoPolicy_set_result,
16877 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16878 : },
16879 : { .name = NULL }
16880 : };
16881 :
16882 0 : static PyObject *py_lsa_SetInfoPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16883 : {
16884 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy, type);
16885 0 : struct lsa_SetInfoPolicy *_self = (struct lsa_SetInfoPolicy *)pytalloc_get_ptr(self);
16886 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16887 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
16888 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
16889 0 : return self;
16890 : }
16891 :
16892 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16893 : {
16894 :
16895 :
16896 0 : return PyLong_FromLong(8);
16897 : }
16898 :
16899 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16900 : {
16901 0 : const struct ndr_interface_call *call = NULL;
16902 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16903 0 : PyObject *ret = NULL;
16904 0 : struct ndr_push *push = NULL;
16905 0 : DATA_BLOB blob;
16906 0 : enum ndr_err_code err;
16907 :
16908 0 : if (ndr_table_lsarpc.num_calls < 9) {
16909 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_pack");
16910 0 : return NULL;
16911 : }
16912 0 : call = &ndr_table_lsarpc.calls[8];
16913 :
16914 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16915 0 : if (push == NULL) {
16916 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16917 0 : return NULL;
16918 : }
16919 :
16920 0 : push->flags |= ndr_push_flags;
16921 :
16922 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16923 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16924 0 : TALLOC_FREE(push);
16925 0 : PyErr_SetNdrError(err);
16926 0 : return NULL;
16927 : }
16928 0 : blob = ndr_push_blob(push);
16929 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16930 0 : TALLOC_FREE(push);
16931 0 : return ret;
16932 : }
16933 :
16934 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16935 : {
16936 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16937 0 : PyObject *bigendian_obj = NULL;
16938 0 : PyObject *ndr64_obj = NULL;
16939 0 : libndr_flags ndr_push_flags = 0;
16940 :
16941 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16942 : discard_const_p(char *, kwnames),
16943 : &bigendian_obj,
16944 : &ndr64_obj)) {
16945 0 : return NULL;
16946 : }
16947 :
16948 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16949 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16950 : }
16951 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16952 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16953 : }
16954 :
16955 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16956 : }
16957 :
16958 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16959 : {
16960 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16961 0 : PyObject *bigendian_obj = NULL;
16962 0 : PyObject *ndr64_obj = NULL;
16963 0 : libndr_flags ndr_push_flags = 0;
16964 :
16965 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16966 : discard_const_p(char *, kwnames),
16967 : &bigendian_obj,
16968 : &ndr64_obj)) {
16969 0 : return NULL;
16970 : }
16971 :
16972 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16973 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16974 : }
16975 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16976 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16977 : }
16978 :
16979 0 : return py_lsa_SetInfoPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16980 : }
16981 :
16982 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)
16983 : {
16984 0 : const struct ndr_interface_call *call = NULL;
16985 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
16986 0 : struct ndr_pull *pull = NULL;
16987 0 : enum ndr_err_code err;
16988 :
16989 0 : if (ndr_table_lsarpc.num_calls < 9) {
16990 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_unpack");
16991 0 : return NULL;
16992 : }
16993 0 : call = &ndr_table_lsarpc.calls[8];
16994 :
16995 0 : pull = ndr_pull_init_blob(blob, object);
16996 0 : if (pull == NULL) {
16997 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16998 0 : return NULL;
16999 : }
17000 :
17001 0 : pull->flags |= ndr_pull_flags;
17002 :
17003 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17004 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17005 0 : TALLOC_FREE(pull);
17006 0 : PyErr_SetNdrError(err);
17007 0 : return NULL;
17008 : }
17009 0 : if (!allow_remaining) {
17010 0 : uint32_t highest_ofs;
17011 :
17012 0 : if (pull->offset > pull->relative_highest_offset) {
17013 0 : highest_ofs = pull->offset;
17014 : } else {
17015 0 : highest_ofs = pull->relative_highest_offset;
17016 : }
17017 0 : if (highest_ofs < pull->data_size) {
17018 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17019 : "not all bytes consumed ofs[%u] size[%u]",
17020 : highest_ofs, pull->data_size);
17021 0 : TALLOC_FREE(pull);
17022 0 : PyErr_SetNdrError(err);
17023 0 : return NULL;
17024 : }
17025 : }
17026 :
17027 0 : TALLOC_FREE(pull);
17028 0 : Py_RETURN_NONE;
17029 : }
17030 :
17031 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17032 : {
17033 0 : DATA_BLOB blob;
17034 0 : Py_ssize_t blob_length = 0;
17035 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17036 0 : PyObject *bigendian_obj = NULL;
17037 0 : PyObject *ndr64_obj = NULL;
17038 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17039 0 : PyObject *allow_remaining_obj = NULL;
17040 0 : bool allow_remaining = false;
17041 :
17042 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17043 : discard_const_p(char *, kwnames),
17044 : &blob.data, &blob_length,
17045 : &bigendian_obj,
17046 : &ndr64_obj,
17047 : &allow_remaining_obj)) {
17048 0 : return NULL;
17049 : }
17050 0 : blob.length = blob_length;
17051 :
17052 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17053 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17054 : }
17055 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17056 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17057 : }
17058 :
17059 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17060 0 : allow_remaining = true;
17061 : }
17062 :
17063 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17064 : }
17065 :
17066 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17067 : {
17068 0 : DATA_BLOB blob;
17069 0 : Py_ssize_t blob_length = 0;
17070 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17071 0 : PyObject *bigendian_obj = NULL;
17072 0 : PyObject *ndr64_obj = NULL;
17073 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17074 0 : PyObject *allow_remaining_obj = NULL;
17075 0 : bool allow_remaining = false;
17076 :
17077 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17078 : discard_const_p(char *, kwnames),
17079 : &blob.data, &blob_length,
17080 : &bigendian_obj,
17081 : &ndr64_obj,
17082 : &allow_remaining_obj)) {
17083 0 : return NULL;
17084 : }
17085 0 : blob.length = blob_length;
17086 :
17087 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17088 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17089 : }
17090 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17091 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17092 : }
17093 :
17094 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17095 0 : allow_remaining = true;
17096 : }
17097 :
17098 0 : return py_lsa_SetInfoPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17099 : }
17100 :
17101 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17102 : {
17103 0 : const struct ndr_interface_call *call = NULL;
17104 0 : struct lsa_SetInfoPolicy *object = pytalloc_get_ptr(py_obj);
17105 0 : PyObject *ret;
17106 0 : char *retstr;
17107 :
17108 0 : if (ndr_table_lsarpc.num_calls < 9) {
17109 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy_ndr_print");
17110 0 : return NULL;
17111 : }
17112 0 : call = &ndr_table_lsarpc.calls[8];
17113 :
17114 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17115 0 : ret = PyUnicode_FromString(retstr);
17116 0 : TALLOC_FREE(retstr);
17117 :
17118 0 : return ret;
17119 : }
17120 :
17121 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17122 : {
17123 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_in", NDR_IN);
17124 : }
17125 :
17126 0 : static PyObject *py_lsa_SetInfoPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17127 : {
17128 0 : return py_lsa_SetInfoPolicy_ndr_print(py_obj, "lsa_SetInfoPolicy_out", NDR_OUT);
17129 : }
17130 :
17131 : static PyMethodDef py_lsa_SetInfoPolicy_methods[] = {
17132 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
17133 : "lsa.SetInfoPolicy.opnum() -> 8 (0x08) " },
17134 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17135 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17136 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17137 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17138 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17139 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17140 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17141 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17142 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17143 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17144 : { NULL, NULL, 0, NULL }
17145 : };
17146 :
17147 :
17148 : static PyTypeObject lsa_SetInfoPolicy_Type = {
17149 : PyVarObject_HEAD_INIT(NULL, 0)
17150 : .tp_name = "lsa.SetInfoPolicy",
17151 : .tp_getset = py_lsa_SetInfoPolicy_getsetters,
17152 : .tp_methods = py_lsa_SetInfoPolicy_methods,
17153 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17154 : .tp_new = py_lsa_SetInfoPolicy_new,
17155 : };
17156 :
17157 0 : static bool pack_py_lsa_SetInfoPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy *r)
17158 : {
17159 0 : PyObject *py_handle;
17160 0 : PyObject *py_level;
17161 0 : PyObject *py_info;
17162 0 : const char *kwnames[] = {
17163 : "handle", "level", "info", NULL
17164 : };
17165 :
17166 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
17167 0 : return false;
17168 : }
17169 :
17170 0 : if (py_handle == NULL) {
17171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
17172 0 : return false;
17173 : }
17174 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17175 0 : if (r->in.handle == NULL) {
17176 0 : PyErr_NoMemory();
17177 0 : return false;
17178 : }
17179 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17180 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17181 0 : PyErr_NoMemory();
17182 0 : return false;
17183 : }
17184 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17185 0 : if (py_level == NULL) {
17186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
17187 0 : return false;
17188 : }
17189 : {
17190 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
17191 0 : if (PyLong_Check(py_level)) {
17192 0 : unsigned long long test_var;
17193 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
17194 0 : if (PyErr_Occurred() != NULL) {
17195 0 : return false;
17196 : }
17197 0 : if (test_var > uint_max) {
17198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17199 : PyLong_Type.tp_name, uint_max, test_var);
17200 0 : return false;
17201 : }
17202 0 : r->in.level = test_var;
17203 : } else {
17204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17205 : PyLong_Type.tp_name);
17206 0 : return false;
17207 : }
17208 : }
17209 0 : if (py_info == NULL) {
17210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
17211 0 : return false;
17212 : }
17213 0 : r->in.info = talloc_ptrtype(r, r->in.info);
17214 0 : if (r->in.info == NULL) {
17215 0 : PyErr_NoMemory();
17216 0 : return false;
17217 : }
17218 : {
17219 0 : union lsa_PolicyInformation *info_switch_1;
17220 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
17221 0 : if (info_switch_1 == NULL) {
17222 0 : return false;
17223 : }
17224 0 : r->in.info = info_switch_1;
17225 : }
17226 0 : return true;
17227 : }
17228 :
17229 0 : static PyObject *unpack_py_lsa_SetInfoPolicy_args_out(struct lsa_SetInfoPolicy *r)
17230 : {
17231 0 : PyObject *result;
17232 0 : result = Py_None;
17233 0 : Py_INCREF(result);
17234 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17235 0 : PyErr_SetNTSTATUS(r->out.result);
17236 0 : return NULL;
17237 : }
17238 :
17239 0 : return result;
17240 : }
17241 :
17242 :
17243 0 : static PyObject *py_lsa_CreateAccount_in_get_handle(PyObject *obj, void *closure)
17244 : {
17245 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(obj);
17246 0 : PyObject *py_handle;
17247 0 : if (object->in.handle == NULL) {
17248 0 : Py_RETURN_NONE;
17249 : }
17250 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17251 0 : return py_handle;
17252 : }
17253 :
17254 0 : static int py_lsa_CreateAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17255 : {
17256 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17257 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17258 0 : if (value == NULL) {
17259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
17260 0 : return -1;
17261 : }
17262 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17263 0 : if (object->in.handle == NULL) {
17264 0 : PyErr_NoMemory();
17265 0 : return -1;
17266 : }
17267 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17268 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17269 0 : PyErr_NoMemory();
17270 0 : return -1;
17271 : }
17272 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17273 0 : return 0;
17274 : }
17275 :
17276 0 : static PyObject *py_lsa_CreateAccount_in_get_sid(PyObject *obj, void *closure)
17277 : {
17278 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(obj);
17279 0 : PyObject *py_sid;
17280 0 : if (object->in.sid == NULL) {
17281 0 : Py_RETURN_NONE;
17282 : }
17283 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
17284 0 : return py_sid;
17285 : }
17286 :
17287 0 : static int py_lsa_CreateAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
17288 : {
17289 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17290 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
17291 0 : if (value == NULL) {
17292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
17293 0 : return -1;
17294 : }
17295 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
17296 0 : if (object->in.sid == NULL) {
17297 0 : PyErr_NoMemory();
17298 0 : return -1;
17299 : }
17300 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
17301 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17302 0 : PyErr_NoMemory();
17303 0 : return -1;
17304 : }
17305 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
17306 0 : return 0;
17307 : }
17308 :
17309 0 : static PyObject *py_lsa_CreateAccount_in_get_access_mask(PyObject *obj, void *closure)
17310 : {
17311 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(obj);
17312 0 : PyObject *py_access_mask;
17313 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
17314 0 : return py_access_mask;
17315 : }
17316 :
17317 0 : static int py_lsa_CreateAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
17318 : {
17319 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17320 0 : if (value == NULL) {
17321 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
17322 0 : return -1;
17323 : }
17324 : {
17325 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
17326 0 : if (PyLong_Check(value)) {
17327 0 : unsigned long long test_var;
17328 0 : test_var = PyLong_AsUnsignedLongLong(value);
17329 0 : if (PyErr_Occurred() != NULL) {
17330 0 : return -1;
17331 : }
17332 0 : if (test_var > uint_max) {
17333 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17334 : PyLong_Type.tp_name, uint_max, test_var);
17335 0 : return -1;
17336 : }
17337 0 : object->in.access_mask = test_var;
17338 : } else {
17339 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17340 : PyLong_Type.tp_name);
17341 0 : return -1;
17342 : }
17343 : }
17344 0 : return 0;
17345 : }
17346 :
17347 0 : static PyObject *py_lsa_CreateAccount_out_get_acct_handle(PyObject *obj, void *closure)
17348 : {
17349 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(obj);
17350 0 : PyObject *py_acct_handle;
17351 0 : if (object->out.acct_handle == NULL) {
17352 0 : Py_RETURN_NONE;
17353 : }
17354 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
17355 0 : return py_acct_handle;
17356 : }
17357 :
17358 0 : static int py_lsa_CreateAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
17359 : {
17360 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17361 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
17362 0 : if (value == NULL) {
17363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.acct_handle");
17364 0 : return -1;
17365 : }
17366 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
17367 0 : if (object->out.acct_handle == NULL) {
17368 0 : PyErr_NoMemory();
17369 0 : return -1;
17370 : }
17371 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17372 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17373 0 : PyErr_NoMemory();
17374 0 : return -1;
17375 : }
17376 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17377 0 : return 0;
17378 : }
17379 :
17380 0 : static PyObject *py_lsa_CreateAccount_get_result(PyObject *obj, void *closure)
17381 : {
17382 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(obj);
17383 0 : PyObject *py_result;
17384 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17385 0 : return py_result;
17386 : }
17387 :
17388 0 : static int py_lsa_CreateAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
17389 : {
17390 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17391 0 : if (value == NULL) {
17392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
17393 0 : return -1;
17394 : }
17395 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17396 0 : return 0;
17397 : }
17398 :
17399 : static PyGetSetDef py_lsa_CreateAccount_getsetters[] = {
17400 : {
17401 : .name = discard_const_p(char, "in_handle"),
17402 : .get = py_lsa_CreateAccount_in_get_handle,
17403 : .set = py_lsa_CreateAccount_in_set_handle,
17404 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17405 : },
17406 : {
17407 : .name = discard_const_p(char, "in_sid"),
17408 : .get = py_lsa_CreateAccount_in_get_sid,
17409 : .set = py_lsa_CreateAccount_in_set_sid,
17410 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
17411 : },
17412 : {
17413 : .name = discard_const_p(char, "in_access_mask"),
17414 : .get = py_lsa_CreateAccount_in_get_access_mask,
17415 : .set = py_lsa_CreateAccount_in_set_access_mask,
17416 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
17417 : },
17418 : {
17419 : .name = discard_const_p(char, "out_acct_handle"),
17420 : .get = py_lsa_CreateAccount_out_get_acct_handle,
17421 : .set = py_lsa_CreateAccount_out_set_acct_handle,
17422 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17423 : },
17424 : {
17425 : .name = discard_const_p(char, "result"),
17426 : .get = py_lsa_CreateAccount_get_result,
17427 : .set = py_lsa_CreateAccount_set_result,
17428 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17429 : },
17430 : { .name = NULL }
17431 : };
17432 :
17433 0 : static PyObject *py_lsa_CreateAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17434 : {
17435 0 : PyObject *self = pytalloc_new(struct lsa_CreateAccount, type);
17436 0 : struct lsa_CreateAccount *_self = (struct lsa_CreateAccount *)pytalloc_get_ptr(self);
17437 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17438 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
17439 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
17440 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
17441 0 : return self;
17442 : }
17443 :
17444 0 : static PyObject *py_lsa_CreateAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17445 : {
17446 :
17447 :
17448 0 : return PyLong_FromLong(10);
17449 : }
17450 :
17451 0 : static PyObject *py_lsa_CreateAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17452 : {
17453 0 : const struct ndr_interface_call *call = NULL;
17454 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17455 0 : PyObject *ret = NULL;
17456 0 : struct ndr_push *push = NULL;
17457 0 : DATA_BLOB blob;
17458 0 : enum ndr_err_code err;
17459 :
17460 0 : if (ndr_table_lsarpc.num_calls < 11) {
17461 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_pack");
17462 0 : return NULL;
17463 : }
17464 0 : call = &ndr_table_lsarpc.calls[10];
17465 :
17466 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17467 0 : if (push == NULL) {
17468 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17469 0 : return NULL;
17470 : }
17471 :
17472 0 : push->flags |= ndr_push_flags;
17473 :
17474 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17475 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17476 0 : TALLOC_FREE(push);
17477 0 : PyErr_SetNdrError(err);
17478 0 : return NULL;
17479 : }
17480 0 : blob = ndr_push_blob(push);
17481 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17482 0 : TALLOC_FREE(push);
17483 0 : return ret;
17484 : }
17485 :
17486 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17487 : {
17488 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17489 0 : PyObject *bigendian_obj = NULL;
17490 0 : PyObject *ndr64_obj = NULL;
17491 0 : libndr_flags ndr_push_flags = 0;
17492 :
17493 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17494 : discard_const_p(char *, kwnames),
17495 : &bigendian_obj,
17496 : &ndr64_obj)) {
17497 0 : return NULL;
17498 : }
17499 :
17500 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17501 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17502 : }
17503 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17504 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17505 : }
17506 :
17507 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17508 : }
17509 :
17510 0 : static PyObject *py_lsa_CreateAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17511 : {
17512 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17513 0 : PyObject *bigendian_obj = NULL;
17514 0 : PyObject *ndr64_obj = NULL;
17515 0 : libndr_flags ndr_push_flags = 0;
17516 :
17517 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17518 : discard_const_p(char *, kwnames),
17519 : &bigendian_obj,
17520 : &ndr64_obj)) {
17521 0 : return NULL;
17522 : }
17523 :
17524 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17525 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17526 : }
17527 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17528 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17529 : }
17530 :
17531 0 : return py_lsa_CreateAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17532 : }
17533 :
17534 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)
17535 : {
17536 0 : const struct ndr_interface_call *call = NULL;
17537 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17538 0 : struct ndr_pull *pull = NULL;
17539 0 : enum ndr_err_code err;
17540 :
17541 0 : if (ndr_table_lsarpc.num_calls < 11) {
17542 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_unpack");
17543 0 : return NULL;
17544 : }
17545 0 : call = &ndr_table_lsarpc.calls[10];
17546 :
17547 0 : pull = ndr_pull_init_blob(blob, object);
17548 0 : if (pull == NULL) {
17549 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17550 0 : return NULL;
17551 : }
17552 :
17553 0 : pull->flags |= ndr_pull_flags;
17554 :
17555 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17556 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17557 0 : TALLOC_FREE(pull);
17558 0 : PyErr_SetNdrError(err);
17559 0 : return NULL;
17560 : }
17561 0 : if (!allow_remaining) {
17562 0 : uint32_t highest_ofs;
17563 :
17564 0 : if (pull->offset > pull->relative_highest_offset) {
17565 0 : highest_ofs = pull->offset;
17566 : } else {
17567 0 : highest_ofs = pull->relative_highest_offset;
17568 : }
17569 0 : if (highest_ofs < pull->data_size) {
17570 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17571 : "not all bytes consumed ofs[%u] size[%u]",
17572 : highest_ofs, pull->data_size);
17573 0 : TALLOC_FREE(pull);
17574 0 : PyErr_SetNdrError(err);
17575 0 : return NULL;
17576 : }
17577 : }
17578 :
17579 0 : TALLOC_FREE(pull);
17580 0 : Py_RETURN_NONE;
17581 : }
17582 :
17583 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17584 : {
17585 0 : DATA_BLOB blob;
17586 0 : Py_ssize_t blob_length = 0;
17587 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17588 0 : PyObject *bigendian_obj = NULL;
17589 0 : PyObject *ndr64_obj = NULL;
17590 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17591 0 : PyObject *allow_remaining_obj = NULL;
17592 0 : bool allow_remaining = false;
17593 :
17594 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17595 : discard_const_p(char *, kwnames),
17596 : &blob.data, &blob_length,
17597 : &bigendian_obj,
17598 : &ndr64_obj,
17599 : &allow_remaining_obj)) {
17600 0 : return NULL;
17601 : }
17602 0 : blob.length = blob_length;
17603 :
17604 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17605 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17606 : }
17607 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17608 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17609 : }
17610 :
17611 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17612 0 : allow_remaining = true;
17613 : }
17614 :
17615 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17616 : }
17617 :
17618 0 : static PyObject *py_lsa_CreateAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17619 : {
17620 0 : DATA_BLOB blob;
17621 0 : Py_ssize_t blob_length = 0;
17622 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17623 0 : PyObject *bigendian_obj = NULL;
17624 0 : PyObject *ndr64_obj = NULL;
17625 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17626 0 : PyObject *allow_remaining_obj = NULL;
17627 0 : bool allow_remaining = false;
17628 :
17629 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17630 : discard_const_p(char *, kwnames),
17631 : &blob.data, &blob_length,
17632 : &bigendian_obj,
17633 : &ndr64_obj,
17634 : &allow_remaining_obj)) {
17635 0 : return NULL;
17636 : }
17637 0 : blob.length = blob_length;
17638 :
17639 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17640 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17641 : }
17642 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17643 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17644 : }
17645 :
17646 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17647 0 : allow_remaining = true;
17648 : }
17649 :
17650 0 : return py_lsa_CreateAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17651 : }
17652 :
17653 0 : static PyObject *py_lsa_CreateAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17654 : {
17655 0 : const struct ndr_interface_call *call = NULL;
17656 0 : struct lsa_CreateAccount *object = pytalloc_get_ptr(py_obj);
17657 0 : PyObject *ret;
17658 0 : char *retstr;
17659 :
17660 0 : if (ndr_table_lsarpc.num_calls < 11) {
17661 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateAccount_ndr_print");
17662 0 : return NULL;
17663 : }
17664 0 : call = &ndr_table_lsarpc.calls[10];
17665 :
17666 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17667 0 : ret = PyUnicode_FromString(retstr);
17668 0 : TALLOC_FREE(retstr);
17669 :
17670 0 : return ret;
17671 : }
17672 :
17673 0 : static PyObject *py_lsa_CreateAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17674 : {
17675 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_in", NDR_IN);
17676 : }
17677 :
17678 0 : static PyObject *py_lsa_CreateAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17679 : {
17680 0 : return py_lsa_CreateAccount_ndr_print(py_obj, "lsa_CreateAccount_out", NDR_OUT);
17681 : }
17682 :
17683 : static PyMethodDef py_lsa_CreateAccount_methods[] = {
17684 : { "opnum", (PyCFunction)py_lsa_CreateAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
17685 : "lsa.CreateAccount.opnum() -> 10 (0x0a) " },
17686 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17687 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17688 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17689 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17690 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17691 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17692 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17693 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17694 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17695 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17696 : { NULL, NULL, 0, NULL }
17697 : };
17698 :
17699 :
17700 : static PyTypeObject lsa_CreateAccount_Type = {
17701 : PyVarObject_HEAD_INIT(NULL, 0)
17702 : .tp_name = "lsa.CreateAccount",
17703 : .tp_getset = py_lsa_CreateAccount_getsetters,
17704 : .tp_methods = py_lsa_CreateAccount_methods,
17705 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17706 : .tp_new = py_lsa_CreateAccount_new,
17707 : };
17708 :
17709 0 : static bool pack_py_lsa_CreateAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateAccount *r)
17710 : {
17711 0 : PyObject *py_handle;
17712 0 : PyObject *py_sid;
17713 0 : PyObject *py_access_mask;
17714 0 : const char *kwnames[] = {
17715 : "handle", "sid", "access_mask", NULL
17716 : };
17717 :
17718 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
17719 0 : return false;
17720 : }
17721 :
17722 0 : if (py_handle == NULL) {
17723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
17724 0 : return false;
17725 : }
17726 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
17727 0 : if (r->in.handle == NULL) {
17728 0 : PyErr_NoMemory();
17729 0 : return false;
17730 : }
17731 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
17732 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
17733 0 : PyErr_NoMemory();
17734 0 : return false;
17735 : }
17736 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
17737 0 : if (py_sid == NULL) {
17738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
17739 0 : return false;
17740 : }
17741 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
17742 0 : if (r->in.sid == NULL) {
17743 0 : PyErr_NoMemory();
17744 0 : return false;
17745 : }
17746 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
17747 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
17748 0 : PyErr_NoMemory();
17749 0 : return false;
17750 : }
17751 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
17752 0 : if (py_access_mask == NULL) {
17753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
17754 0 : return false;
17755 : }
17756 : {
17757 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
17758 0 : if (PyLong_Check(py_access_mask)) {
17759 0 : unsigned long long test_var;
17760 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
17761 0 : if (PyErr_Occurred() != NULL) {
17762 0 : return false;
17763 : }
17764 0 : if (test_var > uint_max) {
17765 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17766 : PyLong_Type.tp_name, uint_max, test_var);
17767 0 : return false;
17768 : }
17769 0 : r->in.access_mask = test_var;
17770 : } else {
17771 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17772 : PyLong_Type.tp_name);
17773 0 : return false;
17774 : }
17775 : }
17776 0 : return true;
17777 : }
17778 :
17779 0 : static PyObject *unpack_py_lsa_CreateAccount_args_out(struct lsa_CreateAccount *r)
17780 : {
17781 0 : PyObject *result;
17782 0 : PyObject *py_acct_handle;
17783 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
17784 0 : result = py_acct_handle;
17785 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
17786 0 : PyErr_SetNTSTATUS(r->out.result);
17787 0 : return NULL;
17788 : }
17789 :
17790 0 : return result;
17791 : }
17792 :
17793 :
17794 0 : static PyObject *py_lsa_EnumAccounts_in_get_handle(PyObject *obj, void *closure)
17795 : {
17796 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17797 0 : PyObject *py_handle;
17798 0 : if (object->in.handle == NULL) {
17799 0 : Py_RETURN_NONE;
17800 : }
17801 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
17802 0 : return py_handle;
17803 : }
17804 :
17805 0 : static int py_lsa_EnumAccounts_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
17806 : {
17807 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
17808 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
17809 0 : if (value == NULL) {
17810 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
17811 0 : return -1;
17812 : }
17813 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
17814 0 : if (object->in.handle == NULL) {
17815 0 : PyErr_NoMemory();
17816 0 : return -1;
17817 : }
17818 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17819 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17820 0 : PyErr_NoMemory();
17821 0 : return -1;
17822 : }
17823 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
17824 0 : return 0;
17825 : }
17826 :
17827 0 : static PyObject *py_lsa_EnumAccounts_in_get_resume_handle(PyObject *obj, void *closure)
17828 : {
17829 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17830 0 : PyObject *py_resume_handle;
17831 0 : if (object->in.resume_handle == NULL) {
17832 0 : Py_RETURN_NONE;
17833 : }
17834 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.resume_handle));
17835 0 : return py_resume_handle;
17836 : }
17837 :
17838 0 : static int py_lsa_EnumAccounts_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17839 : {
17840 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
17841 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
17842 0 : if (value == NULL) {
17843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.resume_handle");
17844 0 : return -1;
17845 : }
17846 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
17847 0 : if (object->in.resume_handle == NULL) {
17848 0 : PyErr_NoMemory();
17849 0 : return -1;
17850 : }
17851 : {
17852 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
17853 0 : if (PyLong_Check(value)) {
17854 0 : unsigned long long test_var;
17855 0 : test_var = PyLong_AsUnsignedLongLong(value);
17856 0 : if (PyErr_Occurred() != NULL) {
17857 0 : return -1;
17858 : }
17859 0 : if (test_var > uint_max) {
17860 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17861 : PyLong_Type.tp_name, uint_max, test_var);
17862 0 : return -1;
17863 : }
17864 0 : *object->in.resume_handle = test_var;
17865 : } else {
17866 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17867 : PyLong_Type.tp_name);
17868 0 : return -1;
17869 : }
17870 : }
17871 0 : return 0;
17872 : }
17873 :
17874 0 : static PyObject *py_lsa_EnumAccounts_out_get_resume_handle(PyObject *obj, void *closure)
17875 : {
17876 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17877 0 : PyObject *py_resume_handle;
17878 0 : if (object->out.resume_handle == NULL) {
17879 0 : Py_RETURN_NONE;
17880 : }
17881 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.resume_handle));
17882 0 : return py_resume_handle;
17883 : }
17884 :
17885 0 : static int py_lsa_EnumAccounts_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
17886 : {
17887 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
17888 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
17889 0 : if (value == NULL) {
17890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.resume_handle");
17891 0 : return -1;
17892 : }
17893 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
17894 0 : if (object->out.resume_handle == NULL) {
17895 0 : PyErr_NoMemory();
17896 0 : return -1;
17897 : }
17898 : {
17899 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
17900 0 : if (PyLong_Check(value)) {
17901 0 : unsigned long long test_var;
17902 0 : test_var = PyLong_AsUnsignedLongLong(value);
17903 0 : if (PyErr_Occurred() != NULL) {
17904 0 : return -1;
17905 : }
17906 0 : if (test_var > uint_max) {
17907 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17908 : PyLong_Type.tp_name, uint_max, test_var);
17909 0 : return -1;
17910 : }
17911 0 : *object->out.resume_handle = test_var;
17912 : } else {
17913 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17914 : PyLong_Type.tp_name);
17915 0 : return -1;
17916 : }
17917 : }
17918 0 : return 0;
17919 : }
17920 :
17921 0 : static PyObject *py_lsa_EnumAccounts_out_get_sids(PyObject *obj, void *closure)
17922 : {
17923 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17924 0 : PyObject *py_sids;
17925 0 : if (object->out.sids == NULL) {
17926 0 : Py_RETURN_NONE;
17927 : }
17928 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
17929 0 : return py_sids;
17930 : }
17931 :
17932 0 : static int py_lsa_EnumAccounts_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
17933 : {
17934 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
17935 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
17936 0 : if (value == NULL) {
17937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
17938 0 : return -1;
17939 : }
17940 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
17941 0 : if (object->out.sids == NULL) {
17942 0 : PyErr_NoMemory();
17943 0 : return -1;
17944 : }
17945 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
17946 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17947 0 : PyErr_NoMemory();
17948 0 : return -1;
17949 : }
17950 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
17951 0 : return 0;
17952 : }
17953 :
17954 0 : static PyObject *py_lsa_EnumAccounts_in_get_num_entries(PyObject *obj, void *closure)
17955 : {
17956 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17957 0 : PyObject *py_num_entries;
17958 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_entries));
17959 0 : return py_num_entries;
17960 : }
17961 :
17962 0 : static int py_lsa_EnumAccounts_in_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
17963 : {
17964 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
17965 0 : if (value == NULL) {
17966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_entries");
17967 0 : return -1;
17968 : }
17969 : {
17970 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_entries));
17971 0 : if (PyLong_Check(value)) {
17972 0 : unsigned long long test_var;
17973 0 : test_var = PyLong_AsUnsignedLongLong(value);
17974 0 : if (PyErr_Occurred() != NULL) {
17975 0 : return -1;
17976 : }
17977 0 : if (test_var > uint_max) {
17978 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17979 : PyLong_Type.tp_name, uint_max, test_var);
17980 0 : return -1;
17981 : }
17982 0 : object->in.num_entries = test_var;
17983 : } else {
17984 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17985 : PyLong_Type.tp_name);
17986 0 : return -1;
17987 : }
17988 : }
17989 0 : return 0;
17990 : }
17991 :
17992 0 : static PyObject *py_lsa_EnumAccounts_get_result(PyObject *obj, void *closure)
17993 : {
17994 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(obj);
17995 0 : PyObject *py_result;
17996 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17997 0 : return py_result;
17998 : }
17999 :
18000 0 : static int py_lsa_EnumAccounts_set_result(PyObject *py_obj, PyObject *value, void *closure)
18001 : {
18002 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
18003 0 : if (value == NULL) {
18004 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
18005 0 : return -1;
18006 : }
18007 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18008 0 : return 0;
18009 : }
18010 :
18011 : static PyGetSetDef py_lsa_EnumAccounts_getsetters[] = {
18012 : {
18013 : .name = discard_const_p(char, "in_handle"),
18014 : .get = py_lsa_EnumAccounts_in_get_handle,
18015 : .set = py_lsa_EnumAccounts_in_set_handle,
18016 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18017 : },
18018 : {
18019 : .name = discard_const_p(char, "in_resume_handle"),
18020 : .get = py_lsa_EnumAccounts_in_get_resume_handle,
18021 : .set = py_lsa_EnumAccounts_in_set_resume_handle,
18022 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18023 : },
18024 : {
18025 : .name = discard_const_p(char, "out_resume_handle"),
18026 : .get = py_lsa_EnumAccounts_out_get_resume_handle,
18027 : .set = py_lsa_EnumAccounts_out_set_resume_handle,
18028 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18029 : },
18030 : {
18031 : .name = discard_const_p(char, "out_sids"),
18032 : .get = py_lsa_EnumAccounts_out_get_sids,
18033 : .set = py_lsa_EnumAccounts_out_set_sids,
18034 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
18035 : },
18036 : {
18037 : .name = discard_const_p(char, "in_num_entries"),
18038 : .get = py_lsa_EnumAccounts_in_get_num_entries,
18039 : .set = py_lsa_EnumAccounts_in_set_num_entries,
18040 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18041 : },
18042 : {
18043 : .name = discard_const_p(char, "result"),
18044 : .get = py_lsa_EnumAccounts_get_result,
18045 : .set = py_lsa_EnumAccounts_set_result,
18046 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18047 : },
18048 : { .name = NULL }
18049 : };
18050 :
18051 0 : static PyObject *py_lsa_EnumAccounts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18052 : {
18053 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccounts, type);
18054 0 : struct lsa_EnumAccounts *_self = (struct lsa_EnumAccounts *)pytalloc_get_ptr(self);
18055 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18056 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
18057 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
18058 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
18059 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
18060 0 : return self;
18061 : }
18062 :
18063 0 : static PyObject *py_lsa_EnumAccounts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18064 : {
18065 :
18066 :
18067 0 : return PyLong_FromLong(11);
18068 : }
18069 :
18070 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18071 : {
18072 0 : const struct ndr_interface_call *call = NULL;
18073 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
18074 0 : PyObject *ret = NULL;
18075 0 : struct ndr_push *push = NULL;
18076 0 : DATA_BLOB blob;
18077 0 : enum ndr_err_code err;
18078 :
18079 0 : if (ndr_table_lsarpc.num_calls < 12) {
18080 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_pack");
18081 0 : return NULL;
18082 : }
18083 0 : call = &ndr_table_lsarpc.calls[11];
18084 :
18085 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18086 0 : if (push == NULL) {
18087 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18088 0 : return NULL;
18089 : }
18090 :
18091 0 : push->flags |= ndr_push_flags;
18092 :
18093 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18094 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18095 0 : TALLOC_FREE(push);
18096 0 : PyErr_SetNdrError(err);
18097 0 : return NULL;
18098 : }
18099 0 : blob = ndr_push_blob(push);
18100 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18101 0 : TALLOC_FREE(push);
18102 0 : return ret;
18103 : }
18104 :
18105 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18106 : {
18107 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18108 0 : PyObject *bigendian_obj = NULL;
18109 0 : PyObject *ndr64_obj = NULL;
18110 0 : libndr_flags ndr_push_flags = 0;
18111 :
18112 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18113 : discard_const_p(char *, kwnames),
18114 : &bigendian_obj,
18115 : &ndr64_obj)) {
18116 0 : return NULL;
18117 : }
18118 :
18119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18120 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18121 : }
18122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18123 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18124 : }
18125 :
18126 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18127 : }
18128 :
18129 0 : static PyObject *py_lsa_EnumAccounts_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18130 : {
18131 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18132 0 : PyObject *bigendian_obj = NULL;
18133 0 : PyObject *ndr64_obj = NULL;
18134 0 : libndr_flags ndr_push_flags = 0;
18135 :
18136 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18137 : discard_const_p(char *, kwnames),
18138 : &bigendian_obj,
18139 : &ndr64_obj)) {
18140 0 : return NULL;
18141 : }
18142 :
18143 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18144 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18145 : }
18146 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18147 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18148 : }
18149 :
18150 0 : return py_lsa_EnumAccounts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18151 : }
18152 :
18153 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)
18154 : {
18155 0 : const struct ndr_interface_call *call = NULL;
18156 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
18157 0 : struct ndr_pull *pull = NULL;
18158 0 : enum ndr_err_code err;
18159 :
18160 0 : if (ndr_table_lsarpc.num_calls < 12) {
18161 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_unpack");
18162 0 : return NULL;
18163 : }
18164 0 : call = &ndr_table_lsarpc.calls[11];
18165 :
18166 0 : pull = ndr_pull_init_blob(blob, object);
18167 0 : if (pull == NULL) {
18168 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18169 0 : return NULL;
18170 : }
18171 :
18172 0 : pull->flags |= ndr_pull_flags;
18173 :
18174 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18175 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18176 0 : TALLOC_FREE(pull);
18177 0 : PyErr_SetNdrError(err);
18178 0 : return NULL;
18179 : }
18180 0 : if (!allow_remaining) {
18181 0 : uint32_t highest_ofs;
18182 :
18183 0 : if (pull->offset > pull->relative_highest_offset) {
18184 0 : highest_ofs = pull->offset;
18185 : } else {
18186 0 : highest_ofs = pull->relative_highest_offset;
18187 : }
18188 0 : if (highest_ofs < pull->data_size) {
18189 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18190 : "not all bytes consumed ofs[%u] size[%u]",
18191 : highest_ofs, pull->data_size);
18192 0 : TALLOC_FREE(pull);
18193 0 : PyErr_SetNdrError(err);
18194 0 : return NULL;
18195 : }
18196 : }
18197 :
18198 0 : TALLOC_FREE(pull);
18199 0 : Py_RETURN_NONE;
18200 : }
18201 :
18202 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18203 : {
18204 0 : DATA_BLOB blob;
18205 0 : Py_ssize_t blob_length = 0;
18206 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18207 0 : PyObject *bigendian_obj = NULL;
18208 0 : PyObject *ndr64_obj = NULL;
18209 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18210 0 : PyObject *allow_remaining_obj = NULL;
18211 0 : bool allow_remaining = false;
18212 :
18213 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18214 : discard_const_p(char *, kwnames),
18215 : &blob.data, &blob_length,
18216 : &bigendian_obj,
18217 : &ndr64_obj,
18218 : &allow_remaining_obj)) {
18219 0 : return NULL;
18220 : }
18221 0 : blob.length = blob_length;
18222 :
18223 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18224 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18225 : }
18226 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18227 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18228 : }
18229 :
18230 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18231 0 : allow_remaining = true;
18232 : }
18233 :
18234 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18235 : }
18236 :
18237 0 : static PyObject *py_lsa_EnumAccounts_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18238 : {
18239 0 : DATA_BLOB blob;
18240 0 : Py_ssize_t blob_length = 0;
18241 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18242 0 : PyObject *bigendian_obj = NULL;
18243 0 : PyObject *ndr64_obj = NULL;
18244 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18245 0 : PyObject *allow_remaining_obj = NULL;
18246 0 : bool allow_remaining = false;
18247 :
18248 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18249 : discard_const_p(char *, kwnames),
18250 : &blob.data, &blob_length,
18251 : &bigendian_obj,
18252 : &ndr64_obj,
18253 : &allow_remaining_obj)) {
18254 0 : return NULL;
18255 : }
18256 0 : blob.length = blob_length;
18257 :
18258 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18259 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18260 : }
18261 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18262 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18263 : }
18264 :
18265 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18266 0 : allow_remaining = true;
18267 : }
18268 :
18269 0 : return py_lsa_EnumAccounts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18270 : }
18271 :
18272 0 : static PyObject *py_lsa_EnumAccounts_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18273 : {
18274 0 : const struct ndr_interface_call *call = NULL;
18275 0 : struct lsa_EnumAccounts *object = pytalloc_get_ptr(py_obj);
18276 0 : PyObject *ret;
18277 0 : char *retstr;
18278 :
18279 0 : if (ndr_table_lsarpc.num_calls < 12) {
18280 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccounts_ndr_print");
18281 0 : return NULL;
18282 : }
18283 0 : call = &ndr_table_lsarpc.calls[11];
18284 :
18285 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18286 0 : ret = PyUnicode_FromString(retstr);
18287 0 : TALLOC_FREE(retstr);
18288 :
18289 0 : return ret;
18290 : }
18291 :
18292 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18293 : {
18294 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_in", NDR_IN);
18295 : }
18296 :
18297 0 : static PyObject *py_lsa_EnumAccounts_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18298 : {
18299 0 : return py_lsa_EnumAccounts_ndr_print(py_obj, "lsa_EnumAccounts_out", NDR_OUT);
18300 : }
18301 :
18302 : static PyMethodDef py_lsa_EnumAccounts_methods[] = {
18303 : { "opnum", (PyCFunction)py_lsa_EnumAccounts_ndr_opnum, METH_NOARGS|METH_CLASS,
18304 : "lsa.EnumAccounts.opnum() -> 11 (0x0b) " },
18305 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18306 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18307 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18308 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18309 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18310 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18311 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccounts_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18312 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18313 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18314 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccounts_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18315 : { NULL, NULL, 0, NULL }
18316 : };
18317 :
18318 :
18319 : static PyTypeObject lsa_EnumAccounts_Type = {
18320 : PyVarObject_HEAD_INIT(NULL, 0)
18321 : .tp_name = "lsa.EnumAccounts",
18322 : .tp_getset = py_lsa_EnumAccounts_getsetters,
18323 : .tp_methods = py_lsa_EnumAccounts_methods,
18324 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18325 : .tp_new = py_lsa_EnumAccounts_new,
18326 : };
18327 :
18328 0 : static bool pack_py_lsa_EnumAccounts_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccounts *r)
18329 : {
18330 0 : PyObject *py_handle;
18331 0 : PyObject *py_resume_handle;
18332 0 : PyObject *py_num_entries;
18333 0 : const char *kwnames[] = {
18334 : "handle", "resume_handle", "num_entries", NULL
18335 : };
18336 :
18337 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumAccounts", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_num_entries)) {
18338 0 : return false;
18339 : }
18340 :
18341 0 : if (py_handle == NULL) {
18342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
18343 0 : return false;
18344 : }
18345 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
18346 0 : if (r->in.handle == NULL) {
18347 0 : PyErr_NoMemory();
18348 0 : return false;
18349 : }
18350 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
18351 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
18352 0 : PyErr_NoMemory();
18353 0 : return false;
18354 : }
18355 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
18356 0 : if (py_resume_handle == NULL) {
18357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.resume_handle");
18358 0 : return false;
18359 : }
18360 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
18361 0 : if (r->in.resume_handle == NULL) {
18362 0 : PyErr_NoMemory();
18363 0 : return false;
18364 : }
18365 : {
18366 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
18367 0 : if (PyLong_Check(py_resume_handle)) {
18368 0 : unsigned long long test_var;
18369 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
18370 0 : if (PyErr_Occurred() != NULL) {
18371 0 : return false;
18372 : }
18373 0 : if (test_var > uint_max) {
18374 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18375 : PyLong_Type.tp_name, uint_max, test_var);
18376 0 : return false;
18377 : }
18378 0 : *r->in.resume_handle = test_var;
18379 : } else {
18380 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18381 : PyLong_Type.tp_name);
18382 0 : return false;
18383 : }
18384 : }
18385 0 : if (py_num_entries == NULL) {
18386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.num_entries");
18387 0 : return false;
18388 : }
18389 : {
18390 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.num_entries));
18391 0 : if (PyLong_Check(py_num_entries)) {
18392 0 : unsigned long long test_var;
18393 0 : test_var = PyLong_AsUnsignedLongLong(py_num_entries);
18394 0 : if (PyErr_Occurred() != NULL) {
18395 0 : return false;
18396 : }
18397 0 : if (test_var > uint_max) {
18398 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18399 : PyLong_Type.tp_name, uint_max, test_var);
18400 0 : return false;
18401 : }
18402 0 : r->in.num_entries = test_var;
18403 : } else {
18404 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18405 : PyLong_Type.tp_name);
18406 0 : return false;
18407 : }
18408 : }
18409 0 : return true;
18410 : }
18411 :
18412 0 : static PyObject *unpack_py_lsa_EnumAccounts_args_out(struct lsa_EnumAccounts *r)
18413 : {
18414 0 : PyObject *result;
18415 0 : PyObject *py_resume_handle;
18416 0 : PyObject *py_sids;
18417 0 : result = PyTuple_New(2);
18418 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.resume_handle));
18419 0 : PyTuple_SetItem(result, 0, py_resume_handle);
18420 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
18421 0 : PyTuple_SetItem(result, 1, py_sids);
18422 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18423 0 : PyErr_SetNTSTATUS(r->out.result);
18424 0 : return NULL;
18425 : }
18426 :
18427 0 : return result;
18428 : }
18429 :
18430 :
18431 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_policy_handle(PyObject *obj, void *closure)
18432 : {
18433 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(obj);
18434 0 : PyObject *py_policy_handle;
18435 0 : if (object->in.policy_handle == NULL) {
18436 0 : Py_RETURN_NONE;
18437 : }
18438 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
18439 0 : return py_policy_handle;
18440 : }
18441 :
18442 0 : static int py_lsa_CreateTrustedDomain_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
18443 : {
18444 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18445 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
18446 0 : if (value == NULL) {
18447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.policy_handle");
18448 0 : return -1;
18449 : }
18450 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
18451 0 : if (object->in.policy_handle == NULL) {
18452 0 : PyErr_NoMemory();
18453 0 : return -1;
18454 : }
18455 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18456 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18457 0 : PyErr_NoMemory();
18458 0 : return -1;
18459 : }
18460 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
18461 0 : return 0;
18462 : }
18463 :
18464 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_info(PyObject *obj, void *closure)
18465 : {
18466 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(obj);
18467 0 : PyObject *py_info;
18468 0 : if (object->in.info == NULL) {
18469 0 : Py_RETURN_NONE;
18470 : }
18471 0 : py_info = pytalloc_reference_ex(&lsa_DomainInfo_Type, object->in.info, object->in.info);
18472 0 : return py_info;
18473 : }
18474 :
18475 0 : static int py_lsa_CreateTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
18476 : {
18477 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18478 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
18479 0 : if (value == NULL) {
18480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
18481 0 : return -1;
18482 : }
18483 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
18484 0 : if (object->in.info == NULL) {
18485 0 : PyErr_NoMemory();
18486 0 : return -1;
18487 : }
18488 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, value, return -1;);
18489 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18490 0 : PyErr_NoMemory();
18491 0 : return -1;
18492 : }
18493 0 : object->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(value);
18494 0 : return 0;
18495 : }
18496 :
18497 0 : static PyObject *py_lsa_CreateTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
18498 : {
18499 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(obj);
18500 0 : PyObject *py_access_mask;
18501 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
18502 0 : return py_access_mask;
18503 : }
18504 :
18505 0 : static int py_lsa_CreateTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
18506 : {
18507 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18508 0 : if (value == NULL) {
18509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
18510 0 : return -1;
18511 : }
18512 : {
18513 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
18514 0 : if (PyLong_Check(value)) {
18515 0 : unsigned long long test_var;
18516 0 : test_var = PyLong_AsUnsignedLongLong(value);
18517 0 : if (PyErr_Occurred() != NULL) {
18518 0 : return -1;
18519 : }
18520 0 : if (test_var > uint_max) {
18521 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18522 : PyLong_Type.tp_name, uint_max, test_var);
18523 0 : return -1;
18524 : }
18525 0 : object->in.access_mask = test_var;
18526 : } else {
18527 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18528 : PyLong_Type.tp_name);
18529 0 : return -1;
18530 : }
18531 : }
18532 0 : return 0;
18533 : }
18534 :
18535 0 : static PyObject *py_lsa_CreateTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
18536 : {
18537 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(obj);
18538 0 : PyObject *py_trustdom_handle;
18539 0 : if (object->out.trustdom_handle == NULL) {
18540 0 : Py_RETURN_NONE;
18541 : }
18542 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
18543 0 : return py_trustdom_handle;
18544 : }
18545 :
18546 0 : static int py_lsa_CreateTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
18547 : {
18548 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18549 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
18550 0 : if (value == NULL) {
18551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
18552 0 : return -1;
18553 : }
18554 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
18555 0 : if (object->out.trustdom_handle == NULL) {
18556 0 : PyErr_NoMemory();
18557 0 : return -1;
18558 : }
18559 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18560 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18561 0 : PyErr_NoMemory();
18562 0 : return -1;
18563 : }
18564 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
18565 0 : return 0;
18566 : }
18567 :
18568 0 : static PyObject *py_lsa_CreateTrustedDomain_get_result(PyObject *obj, void *closure)
18569 : {
18570 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(obj);
18571 0 : PyObject *py_result;
18572 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18573 0 : return py_result;
18574 : }
18575 :
18576 0 : static int py_lsa_CreateTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
18577 : {
18578 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18579 0 : if (value == NULL) {
18580 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
18581 0 : return -1;
18582 : }
18583 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18584 0 : return 0;
18585 : }
18586 :
18587 : static PyGetSetDef py_lsa_CreateTrustedDomain_getsetters[] = {
18588 : {
18589 : .name = discard_const_p(char, "in_policy_handle"),
18590 : .get = py_lsa_CreateTrustedDomain_in_get_policy_handle,
18591 : .set = py_lsa_CreateTrustedDomain_in_set_policy_handle,
18592 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18593 : },
18594 : {
18595 : .name = discard_const_p(char, "in_info"),
18596 : .get = py_lsa_CreateTrustedDomain_in_get_info,
18597 : .set = py_lsa_CreateTrustedDomain_in_set_info,
18598 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfo")
18599 : },
18600 : {
18601 : .name = discard_const_p(char, "in_access_mask"),
18602 : .get = py_lsa_CreateTrustedDomain_in_get_access_mask,
18603 : .set = py_lsa_CreateTrustedDomain_in_set_access_mask,
18604 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
18605 : },
18606 : {
18607 : .name = discard_const_p(char, "out_trustdom_handle"),
18608 : .get = py_lsa_CreateTrustedDomain_out_get_trustdom_handle,
18609 : .set = py_lsa_CreateTrustedDomain_out_set_trustdom_handle,
18610 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18611 : },
18612 : {
18613 : .name = discard_const_p(char, "result"),
18614 : .get = py_lsa_CreateTrustedDomain_get_result,
18615 : .set = py_lsa_CreateTrustedDomain_set_result,
18616 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18617 : },
18618 : { .name = NULL }
18619 : };
18620 :
18621 0 : static PyObject *py_lsa_CreateTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18622 : {
18623 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomain, type);
18624 0 : struct lsa_CreateTrustedDomain *_self = (struct lsa_CreateTrustedDomain *)pytalloc_get_ptr(self);
18625 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18626 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
18627 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_DomainInfo);
18628 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
18629 0 : return self;
18630 : }
18631 :
18632 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18633 : {
18634 :
18635 :
18636 0 : return PyLong_FromLong(12);
18637 : }
18638 :
18639 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18640 : {
18641 0 : const struct ndr_interface_call *call = NULL;
18642 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18643 0 : PyObject *ret = NULL;
18644 0 : struct ndr_push *push = NULL;
18645 0 : DATA_BLOB blob;
18646 0 : enum ndr_err_code err;
18647 :
18648 0 : if (ndr_table_lsarpc.num_calls < 13) {
18649 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_pack");
18650 0 : return NULL;
18651 : }
18652 0 : call = &ndr_table_lsarpc.calls[12];
18653 :
18654 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18655 0 : if (push == NULL) {
18656 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18657 0 : return NULL;
18658 : }
18659 :
18660 0 : push->flags |= ndr_push_flags;
18661 :
18662 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18663 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18664 0 : TALLOC_FREE(push);
18665 0 : PyErr_SetNdrError(err);
18666 0 : return NULL;
18667 : }
18668 0 : blob = ndr_push_blob(push);
18669 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18670 0 : TALLOC_FREE(push);
18671 0 : return ret;
18672 : }
18673 :
18674 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18675 : {
18676 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18677 0 : PyObject *bigendian_obj = NULL;
18678 0 : PyObject *ndr64_obj = NULL;
18679 0 : libndr_flags ndr_push_flags = 0;
18680 :
18681 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18682 : discard_const_p(char *, kwnames),
18683 : &bigendian_obj,
18684 : &ndr64_obj)) {
18685 0 : return NULL;
18686 : }
18687 :
18688 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18689 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18690 : }
18691 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18692 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18693 : }
18694 :
18695 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18696 : }
18697 :
18698 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18699 : {
18700 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18701 0 : PyObject *bigendian_obj = NULL;
18702 0 : PyObject *ndr64_obj = NULL;
18703 0 : libndr_flags ndr_push_flags = 0;
18704 :
18705 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18706 : discard_const_p(char *, kwnames),
18707 : &bigendian_obj,
18708 : &ndr64_obj)) {
18709 0 : return NULL;
18710 : }
18711 :
18712 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18713 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18714 : }
18715 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18716 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18717 : }
18718 :
18719 0 : return py_lsa_CreateTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18720 : }
18721 :
18722 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)
18723 : {
18724 0 : const struct ndr_interface_call *call = NULL;
18725 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18726 0 : struct ndr_pull *pull = NULL;
18727 0 : enum ndr_err_code err;
18728 :
18729 0 : if (ndr_table_lsarpc.num_calls < 13) {
18730 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_unpack");
18731 0 : return NULL;
18732 : }
18733 0 : call = &ndr_table_lsarpc.calls[12];
18734 :
18735 0 : pull = ndr_pull_init_blob(blob, object);
18736 0 : if (pull == NULL) {
18737 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18738 0 : return NULL;
18739 : }
18740 :
18741 0 : pull->flags |= ndr_pull_flags;
18742 :
18743 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18744 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18745 0 : TALLOC_FREE(pull);
18746 0 : PyErr_SetNdrError(err);
18747 0 : return NULL;
18748 : }
18749 0 : if (!allow_remaining) {
18750 0 : uint32_t highest_ofs;
18751 :
18752 0 : if (pull->offset > pull->relative_highest_offset) {
18753 0 : highest_ofs = pull->offset;
18754 : } else {
18755 0 : highest_ofs = pull->relative_highest_offset;
18756 : }
18757 0 : if (highest_ofs < pull->data_size) {
18758 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18759 : "not all bytes consumed ofs[%u] size[%u]",
18760 : highest_ofs, pull->data_size);
18761 0 : TALLOC_FREE(pull);
18762 0 : PyErr_SetNdrError(err);
18763 0 : return NULL;
18764 : }
18765 : }
18766 :
18767 0 : TALLOC_FREE(pull);
18768 0 : Py_RETURN_NONE;
18769 : }
18770 :
18771 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18772 : {
18773 0 : DATA_BLOB blob;
18774 0 : Py_ssize_t blob_length = 0;
18775 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18776 0 : PyObject *bigendian_obj = NULL;
18777 0 : PyObject *ndr64_obj = NULL;
18778 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18779 0 : PyObject *allow_remaining_obj = NULL;
18780 0 : bool allow_remaining = false;
18781 :
18782 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18783 : discard_const_p(char *, kwnames),
18784 : &blob.data, &blob_length,
18785 : &bigendian_obj,
18786 : &ndr64_obj,
18787 : &allow_remaining_obj)) {
18788 0 : return NULL;
18789 : }
18790 0 : blob.length = blob_length;
18791 :
18792 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18793 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18794 : }
18795 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18796 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18797 : }
18798 :
18799 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18800 0 : allow_remaining = true;
18801 : }
18802 :
18803 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18804 : }
18805 :
18806 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18807 : {
18808 0 : DATA_BLOB blob;
18809 0 : Py_ssize_t blob_length = 0;
18810 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18811 0 : PyObject *bigendian_obj = NULL;
18812 0 : PyObject *ndr64_obj = NULL;
18813 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18814 0 : PyObject *allow_remaining_obj = NULL;
18815 0 : bool allow_remaining = false;
18816 :
18817 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18818 : discard_const_p(char *, kwnames),
18819 : &blob.data, &blob_length,
18820 : &bigendian_obj,
18821 : &ndr64_obj,
18822 : &allow_remaining_obj)) {
18823 0 : return NULL;
18824 : }
18825 0 : blob.length = blob_length;
18826 :
18827 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18828 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18829 : }
18830 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18831 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18832 : }
18833 :
18834 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18835 0 : allow_remaining = true;
18836 : }
18837 :
18838 0 : return py_lsa_CreateTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18839 : }
18840 :
18841 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18842 : {
18843 0 : const struct ndr_interface_call *call = NULL;
18844 0 : struct lsa_CreateTrustedDomain *object = pytalloc_get_ptr(py_obj);
18845 0 : PyObject *ret;
18846 0 : char *retstr;
18847 :
18848 0 : if (ndr_table_lsarpc.num_calls < 13) {
18849 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomain_ndr_print");
18850 0 : return NULL;
18851 : }
18852 0 : call = &ndr_table_lsarpc.calls[12];
18853 :
18854 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18855 0 : ret = PyUnicode_FromString(retstr);
18856 0 : TALLOC_FREE(retstr);
18857 :
18858 0 : return ret;
18859 : }
18860 :
18861 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18862 : {
18863 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_in", NDR_IN);
18864 : }
18865 :
18866 0 : static PyObject *py_lsa_CreateTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18867 : {
18868 0 : return py_lsa_CreateTrustedDomain_ndr_print(py_obj, "lsa_CreateTrustedDomain_out", NDR_OUT);
18869 : }
18870 :
18871 : static PyMethodDef py_lsa_CreateTrustedDomain_methods[] = {
18872 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
18873 : "lsa.CreateTrustedDomain.opnum() -> 12 (0x0c) " },
18874 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18875 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18876 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18877 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18878 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18879 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18880 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18881 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18882 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18883 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18884 : { NULL, NULL, 0, NULL }
18885 : };
18886 :
18887 :
18888 : static PyTypeObject lsa_CreateTrustedDomain_Type = {
18889 : PyVarObject_HEAD_INIT(NULL, 0)
18890 : .tp_name = "lsa.CreateTrustedDomain",
18891 : .tp_getset = py_lsa_CreateTrustedDomain_getsetters,
18892 : .tp_methods = py_lsa_CreateTrustedDomain_methods,
18893 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18894 : .tp_new = py_lsa_CreateTrustedDomain_new,
18895 : };
18896 :
18897 0 : static bool pack_py_lsa_CreateTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomain *r)
18898 : {
18899 0 : PyObject *py_policy_handle;
18900 0 : PyObject *py_info;
18901 0 : PyObject *py_access_mask;
18902 0 : const char *kwnames[] = {
18903 : "policy_handle", "info", "access_mask", NULL
18904 : };
18905 :
18906 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateTrustedDomain", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_access_mask)) {
18907 0 : return false;
18908 : }
18909 :
18910 0 : if (py_policy_handle == NULL) {
18911 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.policy_handle");
18912 0 : return false;
18913 : }
18914 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
18915 0 : if (r->in.policy_handle == NULL) {
18916 0 : PyErr_NoMemory();
18917 0 : return false;
18918 : }
18919 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
18920 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
18921 0 : PyErr_NoMemory();
18922 0 : return false;
18923 : }
18924 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
18925 0 : if (py_info == NULL) {
18926 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
18927 0 : return false;
18928 : }
18929 0 : r->in.info = talloc_ptrtype(r, r->in.info);
18930 0 : if (r->in.info == NULL) {
18931 0 : PyErr_NoMemory();
18932 0 : return false;
18933 : }
18934 0 : PY_CHECK_TYPE(&lsa_DomainInfo_Type, py_info, return false;);
18935 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
18936 0 : PyErr_NoMemory();
18937 0 : return false;
18938 : }
18939 0 : r->in.info = (struct lsa_DomainInfo *)pytalloc_get_ptr(py_info);
18940 0 : if (py_access_mask == NULL) {
18941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
18942 0 : return false;
18943 : }
18944 : {
18945 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
18946 0 : if (PyLong_Check(py_access_mask)) {
18947 0 : unsigned long long test_var;
18948 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
18949 0 : if (PyErr_Occurred() != NULL) {
18950 0 : return false;
18951 : }
18952 0 : if (test_var > uint_max) {
18953 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18954 : PyLong_Type.tp_name, uint_max, test_var);
18955 0 : return false;
18956 : }
18957 0 : r->in.access_mask = test_var;
18958 : } else {
18959 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18960 : PyLong_Type.tp_name);
18961 0 : return false;
18962 : }
18963 : }
18964 0 : return true;
18965 : }
18966 :
18967 0 : static PyObject *unpack_py_lsa_CreateTrustedDomain_args_out(struct lsa_CreateTrustedDomain *r)
18968 : {
18969 0 : PyObject *result;
18970 0 : PyObject *py_trustdom_handle;
18971 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
18972 0 : result = py_trustdom_handle;
18973 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18974 0 : PyErr_SetNTSTATUS(r->out.result);
18975 0 : return NULL;
18976 : }
18977 :
18978 0 : return result;
18979 : }
18980 :
18981 :
18982 0 : static PyObject *py_lsa_EnumTrustDom_in_get_handle(PyObject *obj, void *closure)
18983 : {
18984 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
18985 0 : PyObject *py_handle;
18986 0 : if (object->in.handle == NULL) {
18987 0 : Py_RETURN_NONE;
18988 : }
18989 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
18990 0 : return py_handle;
18991 : }
18992 :
18993 0 : static int py_lsa_EnumTrustDom_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
18994 : {
18995 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
18996 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
18997 0 : if (value == NULL) {
18998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
18999 0 : return -1;
19000 : }
19001 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
19002 0 : if (object->in.handle == NULL) {
19003 0 : PyErr_NoMemory();
19004 0 : return -1;
19005 : }
19006 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19007 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19008 0 : PyErr_NoMemory();
19009 0 : return -1;
19010 : }
19011 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
19012 0 : return 0;
19013 : }
19014 :
19015 0 : static PyObject *py_lsa_EnumTrustDom_in_get_resume_handle(PyObject *obj, void *closure)
19016 : {
19017 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
19018 0 : PyObject *py_resume_handle;
19019 0 : if (object->in.resume_handle == NULL) {
19020 0 : Py_RETURN_NONE;
19021 : }
19022 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.resume_handle));
19023 0 : return py_resume_handle;
19024 : }
19025 :
19026 0 : static int py_lsa_EnumTrustDom_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
19027 : {
19028 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19029 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
19030 0 : if (value == NULL) {
19031 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.resume_handle");
19032 0 : return -1;
19033 : }
19034 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
19035 0 : if (object->in.resume_handle == NULL) {
19036 0 : PyErr_NoMemory();
19037 0 : return -1;
19038 : }
19039 : {
19040 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
19041 0 : if (PyLong_Check(value)) {
19042 0 : unsigned long long test_var;
19043 0 : test_var = PyLong_AsUnsignedLongLong(value);
19044 0 : if (PyErr_Occurred() != NULL) {
19045 0 : return -1;
19046 : }
19047 0 : if (test_var > uint_max) {
19048 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19049 : PyLong_Type.tp_name, uint_max, test_var);
19050 0 : return -1;
19051 : }
19052 0 : *object->in.resume_handle = test_var;
19053 : } else {
19054 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19055 : PyLong_Type.tp_name);
19056 0 : return -1;
19057 : }
19058 : }
19059 0 : return 0;
19060 : }
19061 :
19062 0 : static PyObject *py_lsa_EnumTrustDom_out_get_resume_handle(PyObject *obj, void *closure)
19063 : {
19064 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
19065 0 : PyObject *py_resume_handle;
19066 0 : if (object->out.resume_handle == NULL) {
19067 0 : Py_RETURN_NONE;
19068 : }
19069 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.resume_handle));
19070 0 : return py_resume_handle;
19071 : }
19072 :
19073 0 : static int py_lsa_EnumTrustDom_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
19074 : {
19075 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19076 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
19077 0 : if (value == NULL) {
19078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.resume_handle");
19079 0 : return -1;
19080 : }
19081 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
19082 0 : if (object->out.resume_handle == NULL) {
19083 0 : PyErr_NoMemory();
19084 0 : return -1;
19085 : }
19086 : {
19087 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
19088 0 : if (PyLong_Check(value)) {
19089 0 : unsigned long long test_var;
19090 0 : test_var = PyLong_AsUnsignedLongLong(value);
19091 0 : if (PyErr_Occurred() != NULL) {
19092 0 : return -1;
19093 : }
19094 0 : if (test_var > uint_max) {
19095 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19096 : PyLong_Type.tp_name, uint_max, test_var);
19097 0 : return -1;
19098 : }
19099 0 : *object->out.resume_handle = test_var;
19100 : } else {
19101 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19102 : PyLong_Type.tp_name);
19103 0 : return -1;
19104 : }
19105 : }
19106 0 : return 0;
19107 : }
19108 :
19109 0 : static PyObject *py_lsa_EnumTrustDom_out_get_domains(PyObject *obj, void *closure)
19110 : {
19111 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
19112 0 : PyObject *py_domains;
19113 0 : if (object->out.domains == NULL) {
19114 0 : Py_RETURN_NONE;
19115 : }
19116 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, object->out.domains, object->out.domains);
19117 0 : return py_domains;
19118 : }
19119 :
19120 0 : static int py_lsa_EnumTrustDom_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
19121 : {
19122 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19123 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
19124 0 : if (value == NULL) {
19125 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
19126 0 : return -1;
19127 : }
19128 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
19129 0 : if (object->out.domains == NULL) {
19130 0 : PyErr_NoMemory();
19131 0 : return -1;
19132 : }
19133 0 : PY_CHECK_TYPE(&lsa_DomainList_Type, value, return -1;);
19134 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19135 0 : PyErr_NoMemory();
19136 0 : return -1;
19137 : }
19138 0 : object->out.domains = (struct lsa_DomainList *)pytalloc_get_ptr(value);
19139 0 : return 0;
19140 : }
19141 :
19142 0 : static PyObject *py_lsa_EnumTrustDom_in_get_max_size(PyObject *obj, void *closure)
19143 : {
19144 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
19145 0 : PyObject *py_max_size;
19146 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.max_size));
19147 0 : return py_max_size;
19148 : }
19149 :
19150 0 : static int py_lsa_EnumTrustDom_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
19151 : {
19152 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19153 0 : if (value == NULL) {
19154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.max_size");
19155 0 : return -1;
19156 : }
19157 : {
19158 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
19159 0 : if (PyLong_Check(value)) {
19160 0 : unsigned long long test_var;
19161 0 : test_var = PyLong_AsUnsignedLongLong(value);
19162 0 : if (PyErr_Occurred() != NULL) {
19163 0 : return -1;
19164 : }
19165 0 : if (test_var > uint_max) {
19166 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19167 : PyLong_Type.tp_name, uint_max, test_var);
19168 0 : return -1;
19169 : }
19170 0 : object->in.max_size = test_var;
19171 : } else {
19172 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19173 : PyLong_Type.tp_name);
19174 0 : return -1;
19175 : }
19176 : }
19177 0 : return 0;
19178 : }
19179 :
19180 0 : static PyObject *py_lsa_EnumTrustDom_get_result(PyObject *obj, void *closure)
19181 : {
19182 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(obj);
19183 0 : PyObject *py_result;
19184 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19185 0 : return py_result;
19186 : }
19187 :
19188 0 : static int py_lsa_EnumTrustDom_set_result(PyObject *py_obj, PyObject *value, void *closure)
19189 : {
19190 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19191 0 : if (value == NULL) {
19192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
19193 0 : return -1;
19194 : }
19195 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19196 0 : return 0;
19197 : }
19198 :
19199 : static PyGetSetDef py_lsa_EnumTrustDom_getsetters[] = {
19200 : {
19201 : .name = discard_const_p(char, "in_handle"),
19202 : .get = py_lsa_EnumTrustDom_in_get_handle,
19203 : .set = py_lsa_EnumTrustDom_in_set_handle,
19204 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
19205 : },
19206 : {
19207 : .name = discard_const_p(char, "in_resume_handle"),
19208 : .get = py_lsa_EnumTrustDom_in_get_resume_handle,
19209 : .set = py_lsa_EnumTrustDom_in_set_resume_handle,
19210 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19211 : },
19212 : {
19213 : .name = discard_const_p(char, "out_resume_handle"),
19214 : .get = py_lsa_EnumTrustDom_out_get_resume_handle,
19215 : .set = py_lsa_EnumTrustDom_out_set_resume_handle,
19216 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19217 : },
19218 : {
19219 : .name = discard_const_p(char, "out_domains"),
19220 : .get = py_lsa_EnumTrustDom_out_get_domains,
19221 : .set = py_lsa_EnumTrustDom_out_set_domains,
19222 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainList")
19223 : },
19224 : {
19225 : .name = discard_const_p(char, "in_max_size"),
19226 : .get = py_lsa_EnumTrustDom_in_get_max_size,
19227 : .set = py_lsa_EnumTrustDom_in_set_max_size,
19228 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19229 : },
19230 : {
19231 : .name = discard_const_p(char, "result"),
19232 : .get = py_lsa_EnumTrustDom_get_result,
19233 : .set = py_lsa_EnumTrustDom_set_result,
19234 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
19235 : },
19236 : { .name = NULL }
19237 : };
19238 :
19239 0 : static PyObject *py_lsa_EnumTrustDom_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19240 : {
19241 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustDom, type);
19242 0 : struct lsa_EnumTrustDom *_self = (struct lsa_EnumTrustDom *)pytalloc_get_ptr(self);
19243 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19244 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
19245 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
19246 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
19247 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainList);
19248 0 : return self;
19249 : }
19250 :
19251 0 : static PyObject *py_lsa_EnumTrustDom_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19252 : {
19253 :
19254 :
19255 0 : return PyLong_FromLong(13);
19256 : }
19257 :
19258 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19259 : {
19260 0 : const struct ndr_interface_call *call = NULL;
19261 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19262 0 : PyObject *ret = NULL;
19263 0 : struct ndr_push *push = NULL;
19264 0 : DATA_BLOB blob;
19265 0 : enum ndr_err_code err;
19266 :
19267 0 : if (ndr_table_lsarpc.num_calls < 14) {
19268 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_pack");
19269 0 : return NULL;
19270 : }
19271 0 : call = &ndr_table_lsarpc.calls[13];
19272 :
19273 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19274 0 : if (push == NULL) {
19275 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19276 0 : return NULL;
19277 : }
19278 :
19279 0 : push->flags |= ndr_push_flags;
19280 :
19281 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19282 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19283 0 : TALLOC_FREE(push);
19284 0 : PyErr_SetNdrError(err);
19285 0 : return NULL;
19286 : }
19287 0 : blob = ndr_push_blob(push);
19288 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19289 0 : TALLOC_FREE(push);
19290 0 : return ret;
19291 : }
19292 :
19293 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19294 : {
19295 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19296 0 : PyObject *bigendian_obj = NULL;
19297 0 : PyObject *ndr64_obj = NULL;
19298 0 : libndr_flags ndr_push_flags = 0;
19299 :
19300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19301 : discard_const_p(char *, kwnames),
19302 : &bigendian_obj,
19303 : &ndr64_obj)) {
19304 0 : return NULL;
19305 : }
19306 :
19307 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19308 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19309 : }
19310 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19311 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19312 : }
19313 :
19314 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19315 : }
19316 :
19317 0 : static PyObject *py_lsa_EnumTrustDom_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19318 : {
19319 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19320 0 : PyObject *bigendian_obj = NULL;
19321 0 : PyObject *ndr64_obj = NULL;
19322 0 : libndr_flags ndr_push_flags = 0;
19323 :
19324 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19325 : discard_const_p(char *, kwnames),
19326 : &bigendian_obj,
19327 : &ndr64_obj)) {
19328 0 : return NULL;
19329 : }
19330 :
19331 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19332 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19333 : }
19334 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19335 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19336 : }
19337 :
19338 0 : return py_lsa_EnumTrustDom_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19339 : }
19340 :
19341 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)
19342 : {
19343 0 : const struct ndr_interface_call *call = NULL;
19344 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19345 0 : struct ndr_pull *pull = NULL;
19346 0 : enum ndr_err_code err;
19347 :
19348 0 : if (ndr_table_lsarpc.num_calls < 14) {
19349 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_unpack");
19350 0 : return NULL;
19351 : }
19352 0 : call = &ndr_table_lsarpc.calls[13];
19353 :
19354 0 : pull = ndr_pull_init_blob(blob, object);
19355 0 : if (pull == NULL) {
19356 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19357 0 : return NULL;
19358 : }
19359 :
19360 0 : pull->flags |= ndr_pull_flags;
19361 :
19362 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19363 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19364 0 : TALLOC_FREE(pull);
19365 0 : PyErr_SetNdrError(err);
19366 0 : return NULL;
19367 : }
19368 0 : if (!allow_remaining) {
19369 0 : uint32_t highest_ofs;
19370 :
19371 0 : if (pull->offset > pull->relative_highest_offset) {
19372 0 : highest_ofs = pull->offset;
19373 : } else {
19374 0 : highest_ofs = pull->relative_highest_offset;
19375 : }
19376 0 : if (highest_ofs < pull->data_size) {
19377 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19378 : "not all bytes consumed ofs[%u] size[%u]",
19379 : highest_ofs, pull->data_size);
19380 0 : TALLOC_FREE(pull);
19381 0 : PyErr_SetNdrError(err);
19382 0 : return NULL;
19383 : }
19384 : }
19385 :
19386 0 : TALLOC_FREE(pull);
19387 0 : Py_RETURN_NONE;
19388 : }
19389 :
19390 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19391 : {
19392 0 : DATA_BLOB blob;
19393 0 : Py_ssize_t blob_length = 0;
19394 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19395 0 : PyObject *bigendian_obj = NULL;
19396 0 : PyObject *ndr64_obj = NULL;
19397 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19398 0 : PyObject *allow_remaining_obj = NULL;
19399 0 : bool allow_remaining = false;
19400 :
19401 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19402 : discard_const_p(char *, kwnames),
19403 : &blob.data, &blob_length,
19404 : &bigendian_obj,
19405 : &ndr64_obj,
19406 : &allow_remaining_obj)) {
19407 0 : return NULL;
19408 : }
19409 0 : blob.length = blob_length;
19410 :
19411 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19412 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19413 : }
19414 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19415 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19416 : }
19417 :
19418 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19419 0 : allow_remaining = true;
19420 : }
19421 :
19422 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19423 : }
19424 :
19425 0 : static PyObject *py_lsa_EnumTrustDom_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19426 : {
19427 0 : DATA_BLOB blob;
19428 0 : Py_ssize_t blob_length = 0;
19429 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19430 0 : PyObject *bigendian_obj = NULL;
19431 0 : PyObject *ndr64_obj = NULL;
19432 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19433 0 : PyObject *allow_remaining_obj = NULL;
19434 0 : bool allow_remaining = false;
19435 :
19436 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19437 : discard_const_p(char *, kwnames),
19438 : &blob.data, &blob_length,
19439 : &bigendian_obj,
19440 : &ndr64_obj,
19441 : &allow_remaining_obj)) {
19442 0 : return NULL;
19443 : }
19444 0 : blob.length = blob_length;
19445 :
19446 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19447 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19448 : }
19449 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19450 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19451 : }
19452 :
19453 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19454 0 : allow_remaining = true;
19455 : }
19456 :
19457 0 : return py_lsa_EnumTrustDom_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19458 : }
19459 :
19460 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19461 : {
19462 0 : const struct ndr_interface_call *call = NULL;
19463 0 : struct lsa_EnumTrustDom *object = pytalloc_get_ptr(py_obj);
19464 0 : PyObject *ret;
19465 0 : char *retstr;
19466 :
19467 0 : if (ndr_table_lsarpc.num_calls < 14) {
19468 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustDom_ndr_print");
19469 0 : return NULL;
19470 : }
19471 0 : call = &ndr_table_lsarpc.calls[13];
19472 :
19473 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19474 0 : ret = PyUnicode_FromString(retstr);
19475 0 : TALLOC_FREE(retstr);
19476 :
19477 0 : return ret;
19478 : }
19479 :
19480 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19481 : {
19482 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_in", NDR_IN);
19483 : }
19484 :
19485 0 : static PyObject *py_lsa_EnumTrustDom_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19486 : {
19487 0 : return py_lsa_EnumTrustDom_ndr_print(py_obj, "lsa_EnumTrustDom_out", NDR_OUT);
19488 : }
19489 :
19490 : static PyMethodDef py_lsa_EnumTrustDom_methods[] = {
19491 : { "opnum", (PyCFunction)py_lsa_EnumTrustDom_ndr_opnum, METH_NOARGS|METH_CLASS,
19492 : "lsa.EnumTrustDom.opnum() -> 13 (0x0d) " },
19493 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19494 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19495 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19496 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19497 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19498 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19499 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustDom_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19500 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19501 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19502 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustDom_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19503 : { NULL, NULL, 0, NULL }
19504 : };
19505 :
19506 :
19507 : static PyTypeObject lsa_EnumTrustDom_Type = {
19508 : PyVarObject_HEAD_INIT(NULL, 0)
19509 : .tp_name = "lsa.EnumTrustDom",
19510 : .tp_getset = py_lsa_EnumTrustDom_getsetters,
19511 : .tp_methods = py_lsa_EnumTrustDom_methods,
19512 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19513 : .tp_new = py_lsa_EnumTrustDom_new,
19514 : };
19515 :
19516 0 : static bool pack_py_lsa_EnumTrustDom_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustDom *r)
19517 : {
19518 0 : PyObject *py_handle;
19519 0 : PyObject *py_resume_handle;
19520 0 : PyObject *py_max_size;
19521 0 : const char *kwnames[] = {
19522 : "handle", "resume_handle", "max_size", NULL
19523 : };
19524 :
19525 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustDom", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
19526 0 : return false;
19527 : }
19528 :
19529 0 : if (py_handle == NULL) {
19530 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
19531 0 : return false;
19532 : }
19533 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
19534 0 : if (r->in.handle == NULL) {
19535 0 : PyErr_NoMemory();
19536 0 : return false;
19537 : }
19538 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
19539 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
19540 0 : PyErr_NoMemory();
19541 0 : return false;
19542 : }
19543 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
19544 0 : if (py_resume_handle == NULL) {
19545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.resume_handle");
19546 0 : return false;
19547 : }
19548 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
19549 0 : if (r->in.resume_handle == NULL) {
19550 0 : PyErr_NoMemory();
19551 0 : return false;
19552 : }
19553 : {
19554 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
19555 0 : if (PyLong_Check(py_resume_handle)) {
19556 0 : unsigned long long test_var;
19557 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
19558 0 : if (PyErr_Occurred() != NULL) {
19559 0 : return false;
19560 : }
19561 0 : if (test_var > uint_max) {
19562 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19563 : PyLong_Type.tp_name, uint_max, test_var);
19564 0 : return false;
19565 : }
19566 0 : *r->in.resume_handle = test_var;
19567 : } else {
19568 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19569 : PyLong_Type.tp_name);
19570 0 : return false;
19571 : }
19572 : }
19573 0 : if (py_max_size == NULL) {
19574 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.max_size");
19575 0 : return false;
19576 : }
19577 : {
19578 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
19579 0 : if (PyLong_Check(py_max_size)) {
19580 0 : unsigned long long test_var;
19581 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
19582 0 : if (PyErr_Occurred() != NULL) {
19583 0 : return false;
19584 : }
19585 0 : if (test_var > uint_max) {
19586 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19587 : PyLong_Type.tp_name, uint_max, test_var);
19588 0 : return false;
19589 : }
19590 0 : r->in.max_size = test_var;
19591 : } else {
19592 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19593 : PyLong_Type.tp_name);
19594 0 : return false;
19595 : }
19596 : }
19597 0 : return true;
19598 : }
19599 :
19600 0 : static PyObject *unpack_py_lsa_EnumTrustDom_args_out(struct lsa_EnumTrustDom *r)
19601 : {
19602 0 : PyObject *result;
19603 0 : PyObject *py_resume_handle;
19604 0 : PyObject *py_domains;
19605 0 : result = PyTuple_New(2);
19606 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.resume_handle));
19607 0 : PyTuple_SetItem(result, 0, py_resume_handle);
19608 0 : py_domains = pytalloc_reference_ex(&lsa_DomainList_Type, r->out.domains, r->out.domains);
19609 0 : PyTuple_SetItem(result, 1, py_domains);
19610 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
19611 0 : PyErr_SetNTSTATUS(r->out.result);
19612 0 : return NULL;
19613 : }
19614 :
19615 0 : return result;
19616 : }
19617 :
19618 :
19619 0 : static PyObject *py_lsa_LookupNames_in_get_handle(PyObject *obj, void *closure)
19620 : {
19621 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19622 0 : PyObject *py_handle;
19623 0 : if (object->in.handle == NULL) {
19624 0 : Py_RETURN_NONE;
19625 : }
19626 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
19627 0 : return py_handle;
19628 : }
19629 :
19630 0 : static int py_lsa_LookupNames_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
19631 : {
19632 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19633 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
19634 0 : if (value == NULL) {
19635 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
19636 0 : return -1;
19637 : }
19638 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
19639 0 : if (object->in.handle == NULL) {
19640 0 : PyErr_NoMemory();
19641 0 : return -1;
19642 : }
19643 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19644 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19645 0 : PyErr_NoMemory();
19646 0 : return -1;
19647 : }
19648 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
19649 0 : return 0;
19650 : }
19651 :
19652 0 : static PyObject *py_lsa_LookupNames_in_get_num_names(PyObject *obj, void *closure)
19653 : {
19654 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19655 0 : PyObject *py_num_names;
19656 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_names));
19657 0 : return py_num_names;
19658 : }
19659 :
19660 0 : static int py_lsa_LookupNames_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
19661 : {
19662 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19663 0 : if (value == NULL) {
19664 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_names");
19665 0 : return -1;
19666 : }
19667 : {
19668 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
19669 0 : if (PyLong_Check(value)) {
19670 0 : unsigned long long test_var;
19671 0 : test_var = PyLong_AsUnsignedLongLong(value);
19672 0 : if (PyErr_Occurred() != NULL) {
19673 0 : return -1;
19674 : }
19675 0 : if (test_var > uint_max) {
19676 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19677 : PyLong_Type.tp_name, uint_max, test_var);
19678 0 : return -1;
19679 : }
19680 0 : object->in.num_names = test_var;
19681 : } else {
19682 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19683 : PyLong_Type.tp_name);
19684 0 : return -1;
19685 : }
19686 : }
19687 0 : return 0;
19688 : }
19689 :
19690 0 : static PyObject *py_lsa_LookupNames_in_get_names(PyObject *obj, void *closure)
19691 : {
19692 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19693 0 : PyObject *py_names;
19694 0 : py_names = PyList_New(object->in.num_names);
19695 0 : if (py_names == NULL) {
19696 0 : return NULL;
19697 : }
19698 : {
19699 : int names_cntr_0;
19700 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
19701 0 : PyObject *py_names_0;
19702 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &(object->in.names)[names_cntr_0]);
19703 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
19704 : }
19705 : }
19706 0 : return py_names;
19707 : }
19708 :
19709 0 : static int py_lsa_LookupNames_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
19710 : {
19711 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19712 0 : if (value == NULL) {
19713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
19714 0 : return -1;
19715 : }
19716 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
19717 : {
19718 0 : int names_cntr_0;
19719 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
19720 0 : if (!object->in.names) { return -1; }
19721 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
19722 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
19723 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
19724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.names)[names_cntr_0]");
19725 0 : return -1;
19726 : }
19727 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
19728 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
19729 0 : PyErr_NoMemory();
19730 0 : return -1;
19731 : }
19732 0 : (object->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
19733 : }
19734 : }
19735 0 : return 0;
19736 : }
19737 :
19738 0 : static PyObject *py_lsa_LookupNames_out_get_domains(PyObject *obj, void *closure)
19739 : {
19740 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19741 0 : PyObject *py_domains;
19742 0 : if (object->out.domains == NULL) {
19743 0 : Py_RETURN_NONE;
19744 : }
19745 0 : if (*object->out.domains == NULL) {
19746 0 : py_domains = Py_None;
19747 0 : Py_INCREF(py_domains);
19748 : } else {
19749 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
19750 : }
19751 0 : return py_domains;
19752 : }
19753 :
19754 0 : static int py_lsa_LookupNames_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
19755 : {
19756 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
19758 0 : if (value == NULL) {
19759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
19760 0 : return -1;
19761 : }
19762 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
19763 0 : if (object->out.domains == NULL) {
19764 0 : PyErr_NoMemory();
19765 0 : return -1;
19766 : }
19767 0 : if (value == Py_None) {
19768 0 : *object->out.domains = NULL;
19769 : } else {
19770 0 : *object->out.domains = NULL;
19771 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
19772 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19773 0 : PyErr_NoMemory();
19774 0 : return -1;
19775 : }
19776 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
19777 : }
19778 0 : return 0;
19779 : }
19780 :
19781 0 : static PyObject *py_lsa_LookupNames_in_get_sids(PyObject *obj, void *closure)
19782 : {
19783 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19784 0 : PyObject *py_sids;
19785 0 : if (object->in.sids == NULL) {
19786 0 : Py_RETURN_NONE;
19787 : }
19788 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->in.sids, object->in.sids);
19789 0 : return py_sids;
19790 : }
19791 :
19792 0 : static int py_lsa_LookupNames_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
19793 : {
19794 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19795 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
19796 0 : if (value == NULL) {
19797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
19798 0 : return -1;
19799 : }
19800 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
19801 0 : if (object->in.sids == NULL) {
19802 0 : PyErr_NoMemory();
19803 0 : return -1;
19804 : }
19805 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
19806 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19807 0 : PyErr_NoMemory();
19808 0 : return -1;
19809 : }
19810 0 : object->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
19811 0 : return 0;
19812 : }
19813 :
19814 0 : static PyObject *py_lsa_LookupNames_out_get_sids(PyObject *obj, void *closure)
19815 : {
19816 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19817 0 : PyObject *py_sids;
19818 0 : if (object->out.sids == NULL) {
19819 0 : Py_RETURN_NONE;
19820 : }
19821 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, object->out.sids, object->out.sids);
19822 0 : return py_sids;
19823 : }
19824 :
19825 0 : static int py_lsa_LookupNames_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
19826 : {
19827 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19828 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
19829 0 : if (value == NULL) {
19830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
19831 0 : return -1;
19832 : }
19833 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
19834 0 : if (object->out.sids == NULL) {
19835 0 : PyErr_NoMemory();
19836 0 : return -1;
19837 : }
19838 0 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, value, return -1;);
19839 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19840 0 : PyErr_NoMemory();
19841 0 : return -1;
19842 : }
19843 0 : object->out.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(value);
19844 0 : return 0;
19845 : }
19846 :
19847 0 : static PyObject *py_lsa_LookupNames_in_get_level(PyObject *obj, void *closure)
19848 : {
19849 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19850 0 : PyObject *py_level;
19851 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
19852 0 : return py_level;
19853 : }
19854 :
19855 0 : static int py_lsa_LookupNames_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
19856 : {
19857 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19858 0 : if (value == NULL) {
19859 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
19860 0 : return -1;
19861 : }
19862 : {
19863 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
19864 0 : if (PyLong_Check(value)) {
19865 0 : unsigned long long test_var;
19866 0 : test_var = PyLong_AsUnsignedLongLong(value);
19867 0 : if (PyErr_Occurred() != NULL) {
19868 0 : return -1;
19869 : }
19870 0 : if (test_var > uint_max) {
19871 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19872 : PyLong_Type.tp_name, uint_max, test_var);
19873 0 : return -1;
19874 : }
19875 0 : object->in.level = test_var;
19876 : } else {
19877 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19878 : PyLong_Type.tp_name);
19879 0 : return -1;
19880 : }
19881 : }
19882 0 : return 0;
19883 : }
19884 :
19885 0 : static PyObject *py_lsa_LookupNames_in_get_count(PyObject *obj, void *closure)
19886 : {
19887 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19888 0 : PyObject *py_count;
19889 0 : if (object->in.count == NULL) {
19890 0 : Py_RETURN_NONE;
19891 : }
19892 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
19893 0 : return py_count;
19894 : }
19895 :
19896 0 : static int py_lsa_LookupNames_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
19897 : {
19898 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19899 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
19900 0 : if (value == NULL) {
19901 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
19902 0 : return -1;
19903 : }
19904 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
19905 0 : if (object->in.count == NULL) {
19906 0 : PyErr_NoMemory();
19907 0 : return -1;
19908 : }
19909 : {
19910 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
19911 0 : if (PyLong_Check(value)) {
19912 0 : unsigned long long test_var;
19913 0 : test_var = PyLong_AsUnsignedLongLong(value);
19914 0 : if (PyErr_Occurred() != NULL) {
19915 0 : return -1;
19916 : }
19917 0 : if (test_var > uint_max) {
19918 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19919 : PyLong_Type.tp_name, uint_max, test_var);
19920 0 : return -1;
19921 : }
19922 0 : *object->in.count = test_var;
19923 : } else {
19924 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19925 : PyLong_Type.tp_name);
19926 0 : return -1;
19927 : }
19928 : }
19929 0 : return 0;
19930 : }
19931 :
19932 0 : static PyObject *py_lsa_LookupNames_out_get_count(PyObject *obj, void *closure)
19933 : {
19934 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19935 0 : PyObject *py_count;
19936 0 : if (object->out.count == NULL) {
19937 0 : Py_RETURN_NONE;
19938 : }
19939 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
19940 0 : return py_count;
19941 : }
19942 :
19943 0 : static int py_lsa_LookupNames_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
19944 : {
19945 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19946 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
19947 0 : if (value == NULL) {
19948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
19949 0 : return -1;
19950 : }
19951 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
19952 0 : if (object->out.count == NULL) {
19953 0 : PyErr_NoMemory();
19954 0 : return -1;
19955 : }
19956 : {
19957 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
19958 0 : if (PyLong_Check(value)) {
19959 0 : unsigned long long test_var;
19960 0 : test_var = PyLong_AsUnsignedLongLong(value);
19961 0 : if (PyErr_Occurred() != NULL) {
19962 0 : return -1;
19963 : }
19964 0 : if (test_var > uint_max) {
19965 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19966 : PyLong_Type.tp_name, uint_max, test_var);
19967 0 : return -1;
19968 : }
19969 0 : *object->out.count = test_var;
19970 : } else {
19971 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19972 : PyLong_Type.tp_name);
19973 0 : return -1;
19974 : }
19975 : }
19976 0 : return 0;
19977 : }
19978 :
19979 0 : static PyObject *py_lsa_LookupNames_get_result(PyObject *obj, void *closure)
19980 : {
19981 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(obj);
19982 0 : PyObject *py_result;
19983 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19984 0 : return py_result;
19985 : }
19986 :
19987 0 : static int py_lsa_LookupNames_set_result(PyObject *py_obj, PyObject *value, void *closure)
19988 : {
19989 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
19990 0 : if (value == NULL) {
19991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
19992 0 : return -1;
19993 : }
19994 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19995 0 : return 0;
19996 : }
19997 :
19998 : static PyGetSetDef py_lsa_LookupNames_getsetters[] = {
19999 : {
20000 : .name = discard_const_p(char, "in_handle"),
20001 : .get = py_lsa_LookupNames_in_get_handle,
20002 : .set = py_lsa_LookupNames_in_set_handle,
20003 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20004 : },
20005 : {
20006 : .name = discard_const_p(char, "in_num_names"),
20007 : .get = py_lsa_LookupNames_in_get_num_names,
20008 : .set = py_lsa_LookupNames_in_set_num_names,
20009 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20010 : },
20011 : {
20012 : .name = discard_const_p(char, "in_names"),
20013 : .get = py_lsa_LookupNames_in_get_names,
20014 : .set = py_lsa_LookupNames_in_set_names,
20015 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
20016 : },
20017 : {
20018 : .name = discard_const_p(char, "out_domains"),
20019 : .get = py_lsa_LookupNames_out_get_domains,
20020 : .set = py_lsa_LookupNames_out_set_domains,
20021 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
20022 : },
20023 : {
20024 : .name = discard_const_p(char, "in_sids"),
20025 : .get = py_lsa_LookupNames_in_get_sids,
20026 : .set = py_lsa_LookupNames_in_set_sids,
20027 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
20028 : },
20029 : {
20030 : .name = discard_const_p(char, "out_sids"),
20031 : .get = py_lsa_LookupNames_out_get_sids,
20032 : .set = py_lsa_LookupNames_out_set_sids,
20033 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray")
20034 : },
20035 : {
20036 : .name = discard_const_p(char, "in_level"),
20037 : .get = py_lsa_LookupNames_in_get_level,
20038 : .set = py_lsa_LookupNames_in_set_level,
20039 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
20040 : },
20041 : {
20042 : .name = discard_const_p(char, "in_count"),
20043 : .get = py_lsa_LookupNames_in_get_count,
20044 : .set = py_lsa_LookupNames_in_set_count,
20045 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20046 : },
20047 : {
20048 : .name = discard_const_p(char, "out_count"),
20049 : .get = py_lsa_LookupNames_out_get_count,
20050 : .set = py_lsa_LookupNames_out_set_count,
20051 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20052 : },
20053 : {
20054 : .name = discard_const_p(char, "result"),
20055 : .get = py_lsa_LookupNames_get_result,
20056 : .set = py_lsa_LookupNames_set_result,
20057 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20058 : },
20059 : { .name = NULL }
20060 : };
20061 :
20062 0 : static PyObject *py_lsa_LookupNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20063 : {
20064 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames, type);
20065 0 : struct lsa_LookupNames *_self = (struct lsa_LookupNames *)pytalloc_get_ptr(self);
20066 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20067 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20068 : /* a pointer to a NULL pointer */
20069 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
20070 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
20071 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray);
20072 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
20073 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
20074 0 : return self;
20075 : }
20076 :
20077 0 : static PyObject *py_lsa_LookupNames_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20078 : {
20079 :
20080 :
20081 0 : return PyLong_FromLong(14);
20082 : }
20083 :
20084 0 : static PyObject *py_lsa_LookupNames_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20085 : {
20086 0 : const struct ndr_interface_call *call = NULL;
20087 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
20088 0 : PyObject *ret = NULL;
20089 0 : struct ndr_push *push = NULL;
20090 0 : DATA_BLOB blob;
20091 0 : enum ndr_err_code err;
20092 :
20093 0 : if (ndr_table_lsarpc.num_calls < 15) {
20094 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_pack");
20095 0 : return NULL;
20096 : }
20097 0 : call = &ndr_table_lsarpc.calls[14];
20098 :
20099 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20100 0 : if (push == NULL) {
20101 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20102 0 : return NULL;
20103 : }
20104 :
20105 0 : push->flags |= ndr_push_flags;
20106 :
20107 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20108 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20109 0 : TALLOC_FREE(push);
20110 0 : PyErr_SetNdrError(err);
20111 0 : return NULL;
20112 : }
20113 0 : blob = ndr_push_blob(push);
20114 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20115 0 : TALLOC_FREE(push);
20116 0 : return ret;
20117 : }
20118 :
20119 0 : static PyObject *py_lsa_LookupNames_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20120 : {
20121 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20122 0 : PyObject *bigendian_obj = NULL;
20123 0 : PyObject *ndr64_obj = NULL;
20124 0 : libndr_flags ndr_push_flags = 0;
20125 :
20126 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20127 : discard_const_p(char *, kwnames),
20128 : &bigendian_obj,
20129 : &ndr64_obj)) {
20130 0 : return NULL;
20131 : }
20132 :
20133 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20134 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20135 : }
20136 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20137 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20138 : }
20139 :
20140 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20141 : }
20142 :
20143 0 : static PyObject *py_lsa_LookupNames_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20144 : {
20145 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20146 0 : PyObject *bigendian_obj = NULL;
20147 0 : PyObject *ndr64_obj = NULL;
20148 0 : libndr_flags ndr_push_flags = 0;
20149 :
20150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20151 : discard_const_p(char *, kwnames),
20152 : &bigendian_obj,
20153 : &ndr64_obj)) {
20154 0 : return NULL;
20155 : }
20156 :
20157 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20158 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20159 : }
20160 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20161 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20162 : }
20163 :
20164 0 : return py_lsa_LookupNames_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20165 : }
20166 :
20167 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)
20168 : {
20169 0 : const struct ndr_interface_call *call = NULL;
20170 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
20171 0 : struct ndr_pull *pull = NULL;
20172 0 : enum ndr_err_code err;
20173 :
20174 0 : if (ndr_table_lsarpc.num_calls < 15) {
20175 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_unpack");
20176 0 : return NULL;
20177 : }
20178 0 : call = &ndr_table_lsarpc.calls[14];
20179 :
20180 0 : pull = ndr_pull_init_blob(blob, object);
20181 0 : if (pull == NULL) {
20182 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20183 0 : return NULL;
20184 : }
20185 :
20186 0 : pull->flags |= ndr_pull_flags;
20187 :
20188 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20189 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20190 0 : TALLOC_FREE(pull);
20191 0 : PyErr_SetNdrError(err);
20192 0 : return NULL;
20193 : }
20194 0 : if (!allow_remaining) {
20195 0 : uint32_t highest_ofs;
20196 :
20197 0 : if (pull->offset > pull->relative_highest_offset) {
20198 0 : highest_ofs = pull->offset;
20199 : } else {
20200 0 : highest_ofs = pull->relative_highest_offset;
20201 : }
20202 0 : if (highest_ofs < pull->data_size) {
20203 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20204 : "not all bytes consumed ofs[%u] size[%u]",
20205 : highest_ofs, pull->data_size);
20206 0 : TALLOC_FREE(pull);
20207 0 : PyErr_SetNdrError(err);
20208 0 : return NULL;
20209 : }
20210 : }
20211 :
20212 0 : TALLOC_FREE(pull);
20213 0 : Py_RETURN_NONE;
20214 : }
20215 :
20216 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20217 : {
20218 0 : DATA_BLOB blob;
20219 0 : Py_ssize_t blob_length = 0;
20220 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20221 0 : PyObject *bigendian_obj = NULL;
20222 0 : PyObject *ndr64_obj = NULL;
20223 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20224 0 : PyObject *allow_remaining_obj = NULL;
20225 0 : bool allow_remaining = false;
20226 :
20227 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20228 : discard_const_p(char *, kwnames),
20229 : &blob.data, &blob_length,
20230 : &bigendian_obj,
20231 : &ndr64_obj,
20232 : &allow_remaining_obj)) {
20233 0 : return NULL;
20234 : }
20235 0 : blob.length = blob_length;
20236 :
20237 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20238 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20239 : }
20240 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20241 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20242 : }
20243 :
20244 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20245 0 : allow_remaining = true;
20246 : }
20247 :
20248 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20249 : }
20250 :
20251 0 : static PyObject *py_lsa_LookupNames_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20252 : {
20253 0 : DATA_BLOB blob;
20254 0 : Py_ssize_t blob_length = 0;
20255 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20256 0 : PyObject *bigendian_obj = NULL;
20257 0 : PyObject *ndr64_obj = NULL;
20258 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20259 0 : PyObject *allow_remaining_obj = NULL;
20260 0 : bool allow_remaining = false;
20261 :
20262 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20263 : discard_const_p(char *, kwnames),
20264 : &blob.data, &blob_length,
20265 : &bigendian_obj,
20266 : &ndr64_obj,
20267 : &allow_remaining_obj)) {
20268 0 : return NULL;
20269 : }
20270 0 : blob.length = blob_length;
20271 :
20272 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20273 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20274 : }
20275 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20276 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20277 : }
20278 :
20279 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20280 0 : allow_remaining = true;
20281 : }
20282 :
20283 0 : return py_lsa_LookupNames_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20284 : }
20285 :
20286 0 : static PyObject *py_lsa_LookupNames_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20287 : {
20288 0 : const struct ndr_interface_call *call = NULL;
20289 0 : struct lsa_LookupNames *object = pytalloc_get_ptr(py_obj);
20290 0 : PyObject *ret;
20291 0 : char *retstr;
20292 :
20293 0 : if (ndr_table_lsarpc.num_calls < 15) {
20294 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames_ndr_print");
20295 0 : return NULL;
20296 : }
20297 0 : call = &ndr_table_lsarpc.calls[14];
20298 :
20299 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20300 0 : ret = PyUnicode_FromString(retstr);
20301 0 : TALLOC_FREE(retstr);
20302 :
20303 0 : return ret;
20304 : }
20305 :
20306 0 : static PyObject *py_lsa_LookupNames_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20307 : {
20308 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_in", NDR_IN);
20309 : }
20310 :
20311 0 : static PyObject *py_lsa_LookupNames_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20312 : {
20313 0 : return py_lsa_LookupNames_ndr_print(py_obj, "lsa_LookupNames_out", NDR_OUT);
20314 : }
20315 :
20316 : static PyMethodDef py_lsa_LookupNames_methods[] = {
20317 : { "opnum", (PyCFunction)py_lsa_LookupNames_ndr_opnum, METH_NOARGS|METH_CLASS,
20318 : "lsa.LookupNames.opnum() -> 14 (0x0e) " },
20319 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20320 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20321 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20322 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20323 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20324 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20325 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20326 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20327 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20328 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20329 : { NULL, NULL, 0, NULL }
20330 : };
20331 :
20332 :
20333 : static PyTypeObject lsa_LookupNames_Type = {
20334 : PyVarObject_HEAD_INIT(NULL, 0)
20335 : .tp_name = "lsa.LookupNames",
20336 : .tp_getset = py_lsa_LookupNames_getsetters,
20337 : .tp_methods = py_lsa_LookupNames_methods,
20338 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20339 : .tp_new = py_lsa_LookupNames_new,
20340 : };
20341 :
20342 1 : static bool pack_py_lsa_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames *r)
20343 : {
20344 0 : PyObject *py_handle;
20345 0 : PyObject *py_names;
20346 0 : PyObject *py_sids;
20347 0 : PyObject *py_level;
20348 0 : PyObject *py_count;
20349 1 : const char *kwnames[] = {
20350 : "handle", "names", "sids", "level", "count", NULL
20351 : };
20352 :
20353 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupNames", discard_const_p(char *, kwnames), &py_handle, &py_names, &py_sids, &py_level, &py_count)) {
20354 0 : return false;
20355 : }
20356 :
20357 1 : if (py_handle == NULL) {
20358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
20359 0 : return false;
20360 : }
20361 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
20362 1 : if (r->in.handle == NULL) {
20363 0 : PyErr_NoMemory();
20364 0 : return false;
20365 : }
20366 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
20367 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
20368 0 : PyErr_NoMemory();
20369 0 : return false;
20370 : }
20371 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
20372 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
20373 1 : r->in.num_names = PyList_GET_SIZE(py_names);
20374 1 : if (py_names == NULL) {
20375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
20376 0 : return false;
20377 : }
20378 1 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
20379 : {
20380 0 : int names_cntr_0;
20381 1 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
20382 1 : if (!r->in.names) { return false; }
20383 1 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
20384 3 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
20385 2 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
20386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.names)[names_cntr_0]");
20387 0 : return false;
20388 : }
20389 2 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
20390 2 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
20391 0 : PyErr_NoMemory();
20392 0 : return false;
20393 : }
20394 2 : (r->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
20395 : }
20396 : }
20397 1 : if (py_sids == NULL) {
20398 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
20399 0 : return false;
20400 : }
20401 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
20402 1 : if (r->in.sids == NULL) {
20403 0 : PyErr_NoMemory();
20404 0 : return false;
20405 : }
20406 1 : PY_CHECK_TYPE(&lsa_TransSidArray_Type, py_sids, return false;);
20407 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
20408 0 : PyErr_NoMemory();
20409 0 : return false;
20410 : }
20411 1 : r->in.sids = (struct lsa_TransSidArray *)pytalloc_get_ptr(py_sids);
20412 1 : if (py_level == NULL) {
20413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
20414 0 : return false;
20415 : }
20416 : {
20417 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
20418 1 : if (PyLong_Check(py_level)) {
20419 0 : unsigned long long test_var;
20420 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
20421 1 : if (PyErr_Occurred() != NULL) {
20422 0 : return false;
20423 : }
20424 1 : if (test_var > uint_max) {
20425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20426 : PyLong_Type.tp_name, uint_max, test_var);
20427 0 : return false;
20428 : }
20429 1 : r->in.level = test_var;
20430 : } else {
20431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20432 : PyLong_Type.tp_name);
20433 0 : return false;
20434 : }
20435 : }
20436 1 : if (py_count == NULL) {
20437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
20438 0 : return false;
20439 : }
20440 1 : r->in.count = talloc_ptrtype(r, r->in.count);
20441 1 : if (r->in.count == NULL) {
20442 0 : PyErr_NoMemory();
20443 0 : return false;
20444 : }
20445 : {
20446 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
20447 1 : if (PyLong_Check(py_count)) {
20448 0 : unsigned long long test_var;
20449 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
20450 1 : if (PyErr_Occurred() != NULL) {
20451 0 : return false;
20452 : }
20453 1 : if (test_var > uint_max) {
20454 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20455 : PyLong_Type.tp_name, uint_max, test_var);
20456 0 : return false;
20457 : }
20458 1 : *r->in.count = test_var;
20459 : } else {
20460 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20461 : PyLong_Type.tp_name);
20462 0 : return false;
20463 : }
20464 : }
20465 1 : return true;
20466 : }
20467 :
20468 1 : static PyObject *unpack_py_lsa_LookupNames_args_out(struct lsa_LookupNames *r)
20469 : {
20470 0 : PyObject *result;
20471 0 : PyObject *py_domains;
20472 0 : PyObject *py_sids;
20473 0 : PyObject *py_count;
20474 1 : result = PyTuple_New(3);
20475 1 : if (*r->out.domains == NULL) {
20476 0 : py_domains = Py_None;
20477 0 : Py_INCREF(py_domains);
20478 : } else {
20479 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
20480 : }
20481 1 : PyTuple_SetItem(result, 0, py_domains);
20482 1 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray_Type, r->out.sids, r->out.sids);
20483 1 : PyTuple_SetItem(result, 1, py_sids);
20484 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
20485 1 : PyTuple_SetItem(result, 2, py_count);
20486 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
20487 0 : PyErr_SetNTSTATUS(r->out.result);
20488 0 : return NULL;
20489 : }
20490 :
20491 1 : return result;
20492 : }
20493 :
20494 :
20495 0 : static PyObject *py_lsa_LookupSids_in_get_handle(PyObject *obj, void *closure)
20496 : {
20497 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20498 0 : PyObject *py_handle;
20499 0 : if (object->in.handle == NULL) {
20500 0 : Py_RETURN_NONE;
20501 : }
20502 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
20503 0 : return py_handle;
20504 : }
20505 :
20506 0 : static int py_lsa_LookupSids_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
20507 : {
20508 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20509 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
20510 0 : if (value == NULL) {
20511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
20512 0 : return -1;
20513 : }
20514 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
20515 0 : if (object->in.handle == NULL) {
20516 0 : PyErr_NoMemory();
20517 0 : return -1;
20518 : }
20519 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20520 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20521 0 : PyErr_NoMemory();
20522 0 : return -1;
20523 : }
20524 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
20525 0 : return 0;
20526 : }
20527 :
20528 0 : static PyObject *py_lsa_LookupSids_in_get_sids(PyObject *obj, void *closure)
20529 : {
20530 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20531 0 : PyObject *py_sids;
20532 0 : if (object->in.sids == NULL) {
20533 0 : Py_RETURN_NONE;
20534 : }
20535 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
20536 0 : return py_sids;
20537 : }
20538 :
20539 0 : static int py_lsa_LookupSids_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
20540 : {
20541 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20542 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
20543 0 : if (value == NULL) {
20544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
20545 0 : return -1;
20546 : }
20547 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
20548 0 : if (object->in.sids == NULL) {
20549 0 : PyErr_NoMemory();
20550 0 : return -1;
20551 : }
20552 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
20553 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20554 0 : PyErr_NoMemory();
20555 0 : return -1;
20556 : }
20557 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
20558 0 : return 0;
20559 : }
20560 :
20561 0 : static PyObject *py_lsa_LookupSids_out_get_domains(PyObject *obj, void *closure)
20562 : {
20563 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20564 0 : PyObject *py_domains;
20565 0 : if (object->out.domains == NULL) {
20566 0 : Py_RETURN_NONE;
20567 : }
20568 0 : if (*object->out.domains == NULL) {
20569 0 : py_domains = Py_None;
20570 0 : Py_INCREF(py_domains);
20571 : } else {
20572 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
20573 : }
20574 0 : return py_domains;
20575 : }
20576 :
20577 0 : static int py_lsa_LookupSids_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
20578 : {
20579 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20580 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
20581 0 : if (value == NULL) {
20582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
20583 0 : return -1;
20584 : }
20585 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
20586 0 : if (object->out.domains == NULL) {
20587 0 : PyErr_NoMemory();
20588 0 : return -1;
20589 : }
20590 0 : if (value == Py_None) {
20591 0 : *object->out.domains = NULL;
20592 : } else {
20593 0 : *object->out.domains = NULL;
20594 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
20595 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20596 0 : PyErr_NoMemory();
20597 0 : return -1;
20598 : }
20599 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
20600 : }
20601 0 : return 0;
20602 : }
20603 :
20604 0 : static PyObject *py_lsa_LookupSids_in_get_names(PyObject *obj, void *closure)
20605 : {
20606 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20607 0 : PyObject *py_names;
20608 0 : if (object->in.names == NULL) {
20609 0 : Py_RETURN_NONE;
20610 : }
20611 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->in.names, object->in.names);
20612 0 : return py_names;
20613 : }
20614 :
20615 0 : static int py_lsa_LookupSids_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
20616 : {
20617 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20618 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
20619 0 : if (value == NULL) {
20620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
20621 0 : return -1;
20622 : }
20623 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
20624 0 : if (object->in.names == NULL) {
20625 0 : PyErr_NoMemory();
20626 0 : return -1;
20627 : }
20628 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
20629 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20630 0 : PyErr_NoMemory();
20631 0 : return -1;
20632 : }
20633 0 : object->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
20634 0 : return 0;
20635 : }
20636 :
20637 0 : static PyObject *py_lsa_LookupSids_out_get_names(PyObject *obj, void *closure)
20638 : {
20639 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20640 0 : PyObject *py_names;
20641 0 : if (object->out.names == NULL) {
20642 0 : Py_RETURN_NONE;
20643 : }
20644 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, object->out.names, object->out.names);
20645 0 : return py_names;
20646 : }
20647 :
20648 0 : static int py_lsa_LookupSids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
20649 : {
20650 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20651 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
20652 0 : if (value == NULL) {
20653 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.names");
20654 0 : return -1;
20655 : }
20656 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
20657 0 : if (object->out.names == NULL) {
20658 0 : PyErr_NoMemory();
20659 0 : return -1;
20660 : }
20661 0 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, value, return -1;);
20662 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20663 0 : PyErr_NoMemory();
20664 0 : return -1;
20665 : }
20666 0 : object->out.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(value);
20667 0 : return 0;
20668 : }
20669 :
20670 0 : static PyObject *py_lsa_LookupSids_in_get_level(PyObject *obj, void *closure)
20671 : {
20672 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20673 0 : PyObject *py_level;
20674 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
20675 0 : return py_level;
20676 : }
20677 :
20678 0 : static int py_lsa_LookupSids_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
20679 : {
20680 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20681 0 : if (value == NULL) {
20682 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
20683 0 : return -1;
20684 : }
20685 : {
20686 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
20687 0 : if (PyLong_Check(value)) {
20688 0 : unsigned long long test_var;
20689 0 : test_var = PyLong_AsUnsignedLongLong(value);
20690 0 : if (PyErr_Occurred() != NULL) {
20691 0 : return -1;
20692 : }
20693 0 : if (test_var > uint_max) {
20694 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20695 : PyLong_Type.tp_name, uint_max, test_var);
20696 0 : return -1;
20697 : }
20698 0 : object->in.level = test_var;
20699 : } else {
20700 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20701 : PyLong_Type.tp_name);
20702 0 : return -1;
20703 : }
20704 : }
20705 0 : return 0;
20706 : }
20707 :
20708 0 : static PyObject *py_lsa_LookupSids_in_get_count(PyObject *obj, void *closure)
20709 : {
20710 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20711 0 : PyObject *py_count;
20712 0 : if (object->in.count == NULL) {
20713 0 : Py_RETURN_NONE;
20714 : }
20715 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
20716 0 : return py_count;
20717 : }
20718 :
20719 0 : static int py_lsa_LookupSids_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
20720 : {
20721 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20722 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
20723 0 : if (value == NULL) {
20724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
20725 0 : return -1;
20726 : }
20727 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
20728 0 : if (object->in.count == NULL) {
20729 0 : PyErr_NoMemory();
20730 0 : return -1;
20731 : }
20732 : {
20733 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
20734 0 : if (PyLong_Check(value)) {
20735 0 : unsigned long long test_var;
20736 0 : test_var = PyLong_AsUnsignedLongLong(value);
20737 0 : if (PyErr_Occurred() != NULL) {
20738 0 : return -1;
20739 : }
20740 0 : if (test_var > uint_max) {
20741 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20742 : PyLong_Type.tp_name, uint_max, test_var);
20743 0 : return -1;
20744 : }
20745 0 : *object->in.count = test_var;
20746 : } else {
20747 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20748 : PyLong_Type.tp_name);
20749 0 : return -1;
20750 : }
20751 : }
20752 0 : return 0;
20753 : }
20754 :
20755 0 : static PyObject *py_lsa_LookupSids_out_get_count(PyObject *obj, void *closure)
20756 : {
20757 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20758 0 : PyObject *py_count;
20759 0 : if (object->out.count == NULL) {
20760 0 : Py_RETURN_NONE;
20761 : }
20762 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
20763 0 : return py_count;
20764 : }
20765 :
20766 0 : static int py_lsa_LookupSids_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
20767 : {
20768 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20769 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
20770 0 : if (value == NULL) {
20771 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
20772 0 : return -1;
20773 : }
20774 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
20775 0 : if (object->out.count == NULL) {
20776 0 : PyErr_NoMemory();
20777 0 : return -1;
20778 : }
20779 : {
20780 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
20781 0 : if (PyLong_Check(value)) {
20782 0 : unsigned long long test_var;
20783 0 : test_var = PyLong_AsUnsignedLongLong(value);
20784 0 : if (PyErr_Occurred() != NULL) {
20785 0 : return -1;
20786 : }
20787 0 : if (test_var > uint_max) {
20788 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20789 : PyLong_Type.tp_name, uint_max, test_var);
20790 0 : return -1;
20791 : }
20792 0 : *object->out.count = test_var;
20793 : } else {
20794 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20795 : PyLong_Type.tp_name);
20796 0 : return -1;
20797 : }
20798 : }
20799 0 : return 0;
20800 : }
20801 :
20802 0 : static PyObject *py_lsa_LookupSids_get_result(PyObject *obj, void *closure)
20803 : {
20804 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(obj);
20805 0 : PyObject *py_result;
20806 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20807 0 : return py_result;
20808 : }
20809 :
20810 0 : static int py_lsa_LookupSids_set_result(PyObject *py_obj, PyObject *value, void *closure)
20811 : {
20812 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20813 0 : if (value == NULL) {
20814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
20815 0 : return -1;
20816 : }
20817 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20818 0 : return 0;
20819 : }
20820 :
20821 : static PyGetSetDef py_lsa_LookupSids_getsetters[] = {
20822 : {
20823 : .name = discard_const_p(char, "in_handle"),
20824 : .get = py_lsa_LookupSids_in_get_handle,
20825 : .set = py_lsa_LookupSids_in_set_handle,
20826 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20827 : },
20828 : {
20829 : .name = discard_const_p(char, "in_sids"),
20830 : .get = py_lsa_LookupSids_in_get_sids,
20831 : .set = py_lsa_LookupSids_in_set_sids,
20832 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
20833 : },
20834 : {
20835 : .name = discard_const_p(char, "out_domains"),
20836 : .get = py_lsa_LookupSids_out_get_domains,
20837 : .set = py_lsa_LookupSids_out_set_domains,
20838 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
20839 : },
20840 : {
20841 : .name = discard_const_p(char, "in_names"),
20842 : .get = py_lsa_LookupSids_in_get_names,
20843 : .set = py_lsa_LookupSids_in_set_names,
20844 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
20845 : },
20846 : {
20847 : .name = discard_const_p(char, "out_names"),
20848 : .get = py_lsa_LookupSids_out_get_names,
20849 : .set = py_lsa_LookupSids_out_set_names,
20850 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray")
20851 : },
20852 : {
20853 : .name = discard_const_p(char, "in_level"),
20854 : .get = py_lsa_LookupSids_in_get_level,
20855 : .set = py_lsa_LookupSids_in_set_level,
20856 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
20857 : },
20858 : {
20859 : .name = discard_const_p(char, "in_count"),
20860 : .get = py_lsa_LookupSids_in_get_count,
20861 : .set = py_lsa_LookupSids_in_set_count,
20862 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20863 : },
20864 : {
20865 : .name = discard_const_p(char, "out_count"),
20866 : .get = py_lsa_LookupSids_out_get_count,
20867 : .set = py_lsa_LookupSids_out_set_count,
20868 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20869 : },
20870 : {
20871 : .name = discard_const_p(char, "result"),
20872 : .get = py_lsa_LookupSids_get_result,
20873 : .set = py_lsa_LookupSids_set_result,
20874 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20875 : },
20876 : { .name = NULL }
20877 : };
20878 :
20879 0 : static PyObject *py_lsa_LookupSids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20880 : {
20881 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids, type);
20882 0 : struct lsa_LookupSids *_self = (struct lsa_LookupSids *)pytalloc_get_ptr(self);
20883 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20884 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
20885 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
20886 : /* a pointer to a NULL pointer */
20887 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
20888 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
20889 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray);
20890 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
20891 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
20892 0 : return self;
20893 : }
20894 :
20895 0 : static PyObject *py_lsa_LookupSids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20896 : {
20897 :
20898 :
20899 0 : return PyLong_FromLong(15);
20900 : }
20901 :
20902 0 : static PyObject *py_lsa_LookupSids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20903 : {
20904 0 : const struct ndr_interface_call *call = NULL;
20905 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20906 0 : PyObject *ret = NULL;
20907 0 : struct ndr_push *push = NULL;
20908 0 : DATA_BLOB blob;
20909 0 : enum ndr_err_code err;
20910 :
20911 0 : if (ndr_table_lsarpc.num_calls < 16) {
20912 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_pack");
20913 0 : return NULL;
20914 : }
20915 0 : call = &ndr_table_lsarpc.calls[15];
20916 :
20917 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20918 0 : if (push == NULL) {
20919 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20920 0 : return NULL;
20921 : }
20922 :
20923 0 : push->flags |= ndr_push_flags;
20924 :
20925 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20926 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20927 0 : TALLOC_FREE(push);
20928 0 : PyErr_SetNdrError(err);
20929 0 : return NULL;
20930 : }
20931 0 : blob = ndr_push_blob(push);
20932 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20933 0 : TALLOC_FREE(push);
20934 0 : return ret;
20935 : }
20936 :
20937 0 : static PyObject *py_lsa_LookupSids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20938 : {
20939 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20940 0 : PyObject *bigendian_obj = NULL;
20941 0 : PyObject *ndr64_obj = NULL;
20942 0 : libndr_flags ndr_push_flags = 0;
20943 :
20944 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20945 : discard_const_p(char *, kwnames),
20946 : &bigendian_obj,
20947 : &ndr64_obj)) {
20948 0 : return NULL;
20949 : }
20950 :
20951 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20952 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20953 : }
20954 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20955 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20956 : }
20957 :
20958 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20959 : }
20960 :
20961 0 : static PyObject *py_lsa_LookupSids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20962 : {
20963 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20964 0 : PyObject *bigendian_obj = NULL;
20965 0 : PyObject *ndr64_obj = NULL;
20966 0 : libndr_flags ndr_push_flags = 0;
20967 :
20968 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20969 : discard_const_p(char *, kwnames),
20970 : &bigendian_obj,
20971 : &ndr64_obj)) {
20972 0 : return NULL;
20973 : }
20974 :
20975 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20976 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20977 : }
20978 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20979 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20980 : }
20981 :
20982 0 : return py_lsa_LookupSids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20983 : }
20984 :
20985 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)
20986 : {
20987 0 : const struct ndr_interface_call *call = NULL;
20988 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
20989 0 : struct ndr_pull *pull = NULL;
20990 0 : enum ndr_err_code err;
20991 :
20992 0 : if (ndr_table_lsarpc.num_calls < 16) {
20993 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_unpack");
20994 0 : return NULL;
20995 : }
20996 0 : call = &ndr_table_lsarpc.calls[15];
20997 :
20998 0 : pull = ndr_pull_init_blob(blob, object);
20999 0 : if (pull == NULL) {
21000 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21001 0 : return NULL;
21002 : }
21003 :
21004 0 : pull->flags |= ndr_pull_flags;
21005 :
21006 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21007 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21008 0 : TALLOC_FREE(pull);
21009 0 : PyErr_SetNdrError(err);
21010 0 : return NULL;
21011 : }
21012 0 : if (!allow_remaining) {
21013 0 : uint32_t highest_ofs;
21014 :
21015 0 : if (pull->offset > pull->relative_highest_offset) {
21016 0 : highest_ofs = pull->offset;
21017 : } else {
21018 0 : highest_ofs = pull->relative_highest_offset;
21019 : }
21020 0 : if (highest_ofs < pull->data_size) {
21021 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21022 : "not all bytes consumed ofs[%u] size[%u]",
21023 : highest_ofs, pull->data_size);
21024 0 : TALLOC_FREE(pull);
21025 0 : PyErr_SetNdrError(err);
21026 0 : return NULL;
21027 : }
21028 : }
21029 :
21030 0 : TALLOC_FREE(pull);
21031 0 : Py_RETURN_NONE;
21032 : }
21033 :
21034 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21035 : {
21036 0 : DATA_BLOB blob;
21037 0 : Py_ssize_t blob_length = 0;
21038 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21039 0 : PyObject *bigendian_obj = NULL;
21040 0 : PyObject *ndr64_obj = NULL;
21041 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21042 0 : PyObject *allow_remaining_obj = NULL;
21043 0 : bool allow_remaining = false;
21044 :
21045 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21046 : discard_const_p(char *, kwnames),
21047 : &blob.data, &blob_length,
21048 : &bigendian_obj,
21049 : &ndr64_obj,
21050 : &allow_remaining_obj)) {
21051 0 : return NULL;
21052 : }
21053 0 : blob.length = blob_length;
21054 :
21055 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21056 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21057 : }
21058 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21059 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21060 : }
21061 :
21062 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21063 0 : allow_remaining = true;
21064 : }
21065 :
21066 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21067 : }
21068 :
21069 0 : static PyObject *py_lsa_LookupSids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21070 : {
21071 0 : DATA_BLOB blob;
21072 0 : Py_ssize_t blob_length = 0;
21073 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21074 0 : PyObject *bigendian_obj = NULL;
21075 0 : PyObject *ndr64_obj = NULL;
21076 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21077 0 : PyObject *allow_remaining_obj = NULL;
21078 0 : bool allow_remaining = false;
21079 :
21080 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21081 : discard_const_p(char *, kwnames),
21082 : &blob.data, &blob_length,
21083 : &bigendian_obj,
21084 : &ndr64_obj,
21085 : &allow_remaining_obj)) {
21086 0 : return NULL;
21087 : }
21088 0 : blob.length = blob_length;
21089 :
21090 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21091 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21092 : }
21093 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21094 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21095 : }
21096 :
21097 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21098 0 : allow_remaining = true;
21099 : }
21100 :
21101 0 : return py_lsa_LookupSids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21102 : }
21103 :
21104 0 : static PyObject *py_lsa_LookupSids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21105 : {
21106 0 : const struct ndr_interface_call *call = NULL;
21107 0 : struct lsa_LookupSids *object = pytalloc_get_ptr(py_obj);
21108 0 : PyObject *ret;
21109 0 : char *retstr;
21110 :
21111 0 : if (ndr_table_lsarpc.num_calls < 16) {
21112 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids_ndr_print");
21113 0 : return NULL;
21114 : }
21115 0 : call = &ndr_table_lsarpc.calls[15];
21116 :
21117 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21118 0 : ret = PyUnicode_FromString(retstr);
21119 0 : TALLOC_FREE(retstr);
21120 :
21121 0 : return ret;
21122 : }
21123 :
21124 0 : static PyObject *py_lsa_LookupSids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21125 : {
21126 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_in", NDR_IN);
21127 : }
21128 :
21129 0 : static PyObject *py_lsa_LookupSids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21130 : {
21131 0 : return py_lsa_LookupSids_ndr_print(py_obj, "lsa_LookupSids_out", NDR_OUT);
21132 : }
21133 :
21134 : static PyMethodDef py_lsa_LookupSids_methods[] = {
21135 : { "opnum", (PyCFunction)py_lsa_LookupSids_ndr_opnum, METH_NOARGS|METH_CLASS,
21136 : "lsa.LookupSids.opnum() -> 15 (0x0f) " },
21137 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21138 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21139 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21140 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21141 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21142 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21143 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21144 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21145 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21146 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21147 : { NULL, NULL, 0, NULL }
21148 : };
21149 :
21150 :
21151 : static PyTypeObject lsa_LookupSids_Type = {
21152 : PyVarObject_HEAD_INIT(NULL, 0)
21153 : .tp_name = "lsa.LookupSids",
21154 : .tp_getset = py_lsa_LookupSids_getsetters,
21155 : .tp_methods = py_lsa_LookupSids_methods,
21156 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21157 : .tp_new = py_lsa_LookupSids_new,
21158 : };
21159 :
21160 1 : static bool pack_py_lsa_LookupSids_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids *r)
21161 : {
21162 0 : PyObject *py_handle;
21163 0 : PyObject *py_sids;
21164 0 : PyObject *py_names;
21165 0 : PyObject *py_level;
21166 0 : PyObject *py_count;
21167 1 : const char *kwnames[] = {
21168 : "handle", "sids", "names", "level", "count", NULL
21169 : };
21170 :
21171 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_LookupSids", discard_const_p(char *, kwnames), &py_handle, &py_sids, &py_names, &py_level, &py_count)) {
21172 0 : return false;
21173 : }
21174 :
21175 1 : if (py_handle == NULL) {
21176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
21177 0 : return false;
21178 : }
21179 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21180 1 : if (r->in.handle == NULL) {
21181 0 : PyErr_NoMemory();
21182 0 : return false;
21183 : }
21184 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21185 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21186 0 : PyErr_NoMemory();
21187 0 : return false;
21188 : }
21189 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21190 1 : if (py_sids == NULL) {
21191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
21192 0 : return false;
21193 : }
21194 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
21195 1 : if (r->in.sids == NULL) {
21196 0 : PyErr_NoMemory();
21197 0 : return false;
21198 : }
21199 1 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
21200 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
21201 0 : PyErr_NoMemory();
21202 0 : return false;
21203 : }
21204 1 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
21205 1 : if (py_names == NULL) {
21206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
21207 0 : return false;
21208 : }
21209 1 : r->in.names = talloc_ptrtype(r, r->in.names);
21210 1 : if (r->in.names == NULL) {
21211 0 : PyErr_NoMemory();
21212 0 : return false;
21213 : }
21214 1 : PY_CHECK_TYPE(&lsa_TransNameArray_Type, py_names, return false;);
21215 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
21216 0 : PyErr_NoMemory();
21217 0 : return false;
21218 : }
21219 1 : r->in.names = (struct lsa_TransNameArray *)pytalloc_get_ptr(py_names);
21220 1 : if (py_level == NULL) {
21221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
21222 0 : return false;
21223 : }
21224 : {
21225 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
21226 1 : if (PyLong_Check(py_level)) {
21227 0 : unsigned long long test_var;
21228 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
21229 1 : if (PyErr_Occurred() != NULL) {
21230 0 : return false;
21231 : }
21232 1 : if (test_var > uint_max) {
21233 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21234 : PyLong_Type.tp_name, uint_max, test_var);
21235 0 : return false;
21236 : }
21237 1 : r->in.level = test_var;
21238 : } else {
21239 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21240 : PyLong_Type.tp_name);
21241 0 : return false;
21242 : }
21243 : }
21244 1 : if (py_count == NULL) {
21245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
21246 0 : return false;
21247 : }
21248 1 : r->in.count = talloc_ptrtype(r, r->in.count);
21249 1 : if (r->in.count == NULL) {
21250 0 : PyErr_NoMemory();
21251 0 : return false;
21252 : }
21253 : {
21254 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
21255 1 : if (PyLong_Check(py_count)) {
21256 0 : unsigned long long test_var;
21257 1 : test_var = PyLong_AsUnsignedLongLong(py_count);
21258 1 : if (PyErr_Occurred() != NULL) {
21259 0 : return false;
21260 : }
21261 1 : if (test_var > uint_max) {
21262 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21263 : PyLong_Type.tp_name, uint_max, test_var);
21264 0 : return false;
21265 : }
21266 1 : *r->in.count = test_var;
21267 : } else {
21268 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21269 : PyLong_Type.tp_name);
21270 0 : return false;
21271 : }
21272 : }
21273 1 : return true;
21274 : }
21275 :
21276 1 : static PyObject *unpack_py_lsa_LookupSids_args_out(struct lsa_LookupSids *r)
21277 : {
21278 0 : PyObject *result;
21279 0 : PyObject *py_domains;
21280 0 : PyObject *py_names;
21281 0 : PyObject *py_count;
21282 1 : result = PyTuple_New(3);
21283 1 : if (*r->out.domains == NULL) {
21284 0 : py_domains = Py_None;
21285 0 : Py_INCREF(py_domains);
21286 : } else {
21287 1 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
21288 : }
21289 1 : PyTuple_SetItem(result, 0, py_domains);
21290 1 : py_names = pytalloc_reference_ex(&lsa_TransNameArray_Type, r->out.names, r->out.names);
21291 1 : PyTuple_SetItem(result, 1, py_names);
21292 1 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
21293 1 : PyTuple_SetItem(result, 2, py_count);
21294 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
21295 0 : PyErr_SetNTSTATUS(r->out.result);
21296 0 : return NULL;
21297 : }
21298 :
21299 1 : return result;
21300 : }
21301 :
21302 :
21303 0 : static PyObject *py_lsa_CreateSecret_in_get_handle(PyObject *obj, void *closure)
21304 : {
21305 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(obj);
21306 0 : PyObject *py_handle;
21307 0 : if (object->in.handle == NULL) {
21308 0 : Py_RETURN_NONE;
21309 : }
21310 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21311 0 : return py_handle;
21312 : }
21313 :
21314 0 : static int py_lsa_CreateSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21315 : {
21316 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21317 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21318 0 : if (value == NULL) {
21319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
21320 0 : return -1;
21321 : }
21322 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21323 0 : if (object->in.handle == NULL) {
21324 0 : PyErr_NoMemory();
21325 0 : return -1;
21326 : }
21327 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21328 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21329 0 : PyErr_NoMemory();
21330 0 : return -1;
21331 : }
21332 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21333 0 : return 0;
21334 : }
21335 :
21336 0 : static PyObject *py_lsa_CreateSecret_in_get_name(PyObject *obj, void *closure)
21337 : {
21338 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(obj);
21339 0 : PyObject *py_name;
21340 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
21341 0 : return py_name;
21342 : }
21343 :
21344 0 : static int py_lsa_CreateSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
21345 : {
21346 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21347 0 : if (value == NULL) {
21348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
21349 0 : return -1;
21350 : }
21351 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
21352 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21353 0 : PyErr_NoMemory();
21354 0 : return -1;
21355 : }
21356 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
21357 0 : return 0;
21358 : }
21359 :
21360 0 : static PyObject *py_lsa_CreateSecret_in_get_access_mask(PyObject *obj, void *closure)
21361 : {
21362 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(obj);
21363 0 : PyObject *py_access_mask;
21364 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
21365 0 : return py_access_mask;
21366 : }
21367 :
21368 0 : static int py_lsa_CreateSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
21369 : {
21370 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21371 0 : if (value == NULL) {
21372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
21373 0 : return -1;
21374 : }
21375 : {
21376 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
21377 0 : if (PyLong_Check(value)) {
21378 0 : unsigned long long test_var;
21379 0 : test_var = PyLong_AsUnsignedLongLong(value);
21380 0 : if (PyErr_Occurred() != NULL) {
21381 0 : return -1;
21382 : }
21383 0 : if (test_var > uint_max) {
21384 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21385 : PyLong_Type.tp_name, uint_max, test_var);
21386 0 : return -1;
21387 : }
21388 0 : object->in.access_mask = test_var;
21389 : } else {
21390 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21391 : PyLong_Type.tp_name);
21392 0 : return -1;
21393 : }
21394 : }
21395 0 : return 0;
21396 : }
21397 :
21398 0 : static PyObject *py_lsa_CreateSecret_out_get_sec_handle(PyObject *obj, void *closure)
21399 : {
21400 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(obj);
21401 0 : PyObject *py_sec_handle;
21402 0 : if (object->out.sec_handle == NULL) {
21403 0 : Py_RETURN_NONE;
21404 : }
21405 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
21406 0 : return py_sec_handle;
21407 : }
21408 :
21409 0 : static int py_lsa_CreateSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
21410 : {
21411 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21412 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
21413 0 : if (value == NULL) {
21414 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sec_handle");
21415 0 : return -1;
21416 : }
21417 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
21418 0 : if (object->out.sec_handle == NULL) {
21419 0 : PyErr_NoMemory();
21420 0 : return -1;
21421 : }
21422 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21423 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21424 0 : PyErr_NoMemory();
21425 0 : return -1;
21426 : }
21427 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
21428 0 : return 0;
21429 : }
21430 :
21431 0 : static PyObject *py_lsa_CreateSecret_get_result(PyObject *obj, void *closure)
21432 : {
21433 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(obj);
21434 0 : PyObject *py_result;
21435 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21436 0 : return py_result;
21437 : }
21438 :
21439 0 : static int py_lsa_CreateSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
21440 : {
21441 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21442 0 : if (value == NULL) {
21443 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
21444 0 : return -1;
21445 : }
21446 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21447 0 : return 0;
21448 : }
21449 :
21450 : static PyGetSetDef py_lsa_CreateSecret_getsetters[] = {
21451 : {
21452 : .name = discard_const_p(char, "in_handle"),
21453 : .get = py_lsa_CreateSecret_in_get_handle,
21454 : .set = py_lsa_CreateSecret_in_set_handle,
21455 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21456 : },
21457 : {
21458 : .name = discard_const_p(char, "in_name"),
21459 : .get = py_lsa_CreateSecret_in_get_name,
21460 : .set = py_lsa_CreateSecret_in_set_name,
21461 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
21462 : },
21463 : {
21464 : .name = discard_const_p(char, "in_access_mask"),
21465 : .get = py_lsa_CreateSecret_in_get_access_mask,
21466 : .set = py_lsa_CreateSecret_in_set_access_mask,
21467 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
21468 : },
21469 : {
21470 : .name = discard_const_p(char, "out_sec_handle"),
21471 : .get = py_lsa_CreateSecret_out_get_sec_handle,
21472 : .set = py_lsa_CreateSecret_out_set_sec_handle,
21473 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21474 : },
21475 : {
21476 : .name = discard_const_p(char, "result"),
21477 : .get = py_lsa_CreateSecret_get_result,
21478 : .set = py_lsa_CreateSecret_set_result,
21479 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21480 : },
21481 : { .name = NULL }
21482 : };
21483 :
21484 0 : static PyObject *py_lsa_CreateSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21485 : {
21486 0 : PyObject *self = pytalloc_new(struct lsa_CreateSecret, type);
21487 0 : struct lsa_CreateSecret *_self = (struct lsa_CreateSecret *)pytalloc_get_ptr(self);
21488 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21489 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
21490 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
21491 0 : return self;
21492 : }
21493 :
21494 0 : static PyObject *py_lsa_CreateSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21495 : {
21496 :
21497 :
21498 0 : return PyLong_FromLong(16);
21499 : }
21500 :
21501 0 : static PyObject *py_lsa_CreateSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21502 : {
21503 0 : const struct ndr_interface_call *call = NULL;
21504 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21505 0 : PyObject *ret = NULL;
21506 0 : struct ndr_push *push = NULL;
21507 0 : DATA_BLOB blob;
21508 0 : enum ndr_err_code err;
21509 :
21510 0 : if (ndr_table_lsarpc.num_calls < 17) {
21511 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_pack");
21512 0 : return NULL;
21513 : }
21514 0 : call = &ndr_table_lsarpc.calls[16];
21515 :
21516 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21517 0 : if (push == NULL) {
21518 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21519 0 : return NULL;
21520 : }
21521 :
21522 0 : push->flags |= ndr_push_flags;
21523 :
21524 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21525 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21526 0 : TALLOC_FREE(push);
21527 0 : PyErr_SetNdrError(err);
21528 0 : return NULL;
21529 : }
21530 0 : blob = ndr_push_blob(push);
21531 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21532 0 : TALLOC_FREE(push);
21533 0 : return ret;
21534 : }
21535 :
21536 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21537 : {
21538 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21539 0 : PyObject *bigendian_obj = NULL;
21540 0 : PyObject *ndr64_obj = NULL;
21541 0 : libndr_flags ndr_push_flags = 0;
21542 :
21543 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21544 : discard_const_p(char *, kwnames),
21545 : &bigendian_obj,
21546 : &ndr64_obj)) {
21547 0 : return NULL;
21548 : }
21549 :
21550 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21551 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21552 : }
21553 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21554 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21555 : }
21556 :
21557 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21558 : }
21559 :
21560 0 : static PyObject *py_lsa_CreateSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21561 : {
21562 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21563 0 : PyObject *bigendian_obj = NULL;
21564 0 : PyObject *ndr64_obj = NULL;
21565 0 : libndr_flags ndr_push_flags = 0;
21566 :
21567 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21568 : discard_const_p(char *, kwnames),
21569 : &bigendian_obj,
21570 : &ndr64_obj)) {
21571 0 : return NULL;
21572 : }
21573 :
21574 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21575 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21576 : }
21577 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21578 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21579 : }
21580 :
21581 0 : return py_lsa_CreateSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21582 : }
21583 :
21584 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)
21585 : {
21586 0 : const struct ndr_interface_call *call = NULL;
21587 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21588 0 : struct ndr_pull *pull = NULL;
21589 0 : enum ndr_err_code err;
21590 :
21591 0 : if (ndr_table_lsarpc.num_calls < 17) {
21592 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_unpack");
21593 0 : return NULL;
21594 : }
21595 0 : call = &ndr_table_lsarpc.calls[16];
21596 :
21597 0 : pull = ndr_pull_init_blob(blob, object);
21598 0 : if (pull == NULL) {
21599 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21600 0 : return NULL;
21601 : }
21602 :
21603 0 : pull->flags |= ndr_pull_flags;
21604 :
21605 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21606 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21607 0 : TALLOC_FREE(pull);
21608 0 : PyErr_SetNdrError(err);
21609 0 : return NULL;
21610 : }
21611 0 : if (!allow_remaining) {
21612 0 : uint32_t highest_ofs;
21613 :
21614 0 : if (pull->offset > pull->relative_highest_offset) {
21615 0 : highest_ofs = pull->offset;
21616 : } else {
21617 0 : highest_ofs = pull->relative_highest_offset;
21618 : }
21619 0 : if (highest_ofs < pull->data_size) {
21620 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21621 : "not all bytes consumed ofs[%u] size[%u]",
21622 : highest_ofs, pull->data_size);
21623 0 : TALLOC_FREE(pull);
21624 0 : PyErr_SetNdrError(err);
21625 0 : return NULL;
21626 : }
21627 : }
21628 :
21629 0 : TALLOC_FREE(pull);
21630 0 : Py_RETURN_NONE;
21631 : }
21632 :
21633 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21634 : {
21635 0 : DATA_BLOB blob;
21636 0 : Py_ssize_t blob_length = 0;
21637 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21638 0 : PyObject *bigendian_obj = NULL;
21639 0 : PyObject *ndr64_obj = NULL;
21640 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21641 0 : PyObject *allow_remaining_obj = NULL;
21642 0 : bool allow_remaining = false;
21643 :
21644 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21645 : discard_const_p(char *, kwnames),
21646 : &blob.data, &blob_length,
21647 : &bigendian_obj,
21648 : &ndr64_obj,
21649 : &allow_remaining_obj)) {
21650 0 : return NULL;
21651 : }
21652 0 : blob.length = blob_length;
21653 :
21654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21655 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21656 : }
21657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21658 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21659 : }
21660 :
21661 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21662 0 : allow_remaining = true;
21663 : }
21664 :
21665 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21666 : }
21667 :
21668 0 : static PyObject *py_lsa_CreateSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21669 : {
21670 0 : DATA_BLOB blob;
21671 0 : Py_ssize_t blob_length = 0;
21672 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21673 0 : PyObject *bigendian_obj = NULL;
21674 0 : PyObject *ndr64_obj = NULL;
21675 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21676 0 : PyObject *allow_remaining_obj = NULL;
21677 0 : bool allow_remaining = false;
21678 :
21679 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21680 : discard_const_p(char *, kwnames),
21681 : &blob.data, &blob_length,
21682 : &bigendian_obj,
21683 : &ndr64_obj,
21684 : &allow_remaining_obj)) {
21685 0 : return NULL;
21686 : }
21687 0 : blob.length = blob_length;
21688 :
21689 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21690 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21691 : }
21692 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21693 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21694 : }
21695 :
21696 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21697 0 : allow_remaining = true;
21698 : }
21699 :
21700 0 : return py_lsa_CreateSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21701 : }
21702 :
21703 0 : static PyObject *py_lsa_CreateSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21704 : {
21705 0 : const struct ndr_interface_call *call = NULL;
21706 0 : struct lsa_CreateSecret *object = pytalloc_get_ptr(py_obj);
21707 0 : PyObject *ret;
21708 0 : char *retstr;
21709 :
21710 0 : if (ndr_table_lsarpc.num_calls < 17) {
21711 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateSecret_ndr_print");
21712 0 : return NULL;
21713 : }
21714 0 : call = &ndr_table_lsarpc.calls[16];
21715 :
21716 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21717 0 : ret = PyUnicode_FromString(retstr);
21718 0 : TALLOC_FREE(retstr);
21719 :
21720 0 : return ret;
21721 : }
21722 :
21723 0 : static PyObject *py_lsa_CreateSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21724 : {
21725 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_in", NDR_IN);
21726 : }
21727 :
21728 0 : static PyObject *py_lsa_CreateSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21729 : {
21730 0 : return py_lsa_CreateSecret_ndr_print(py_obj, "lsa_CreateSecret_out", NDR_OUT);
21731 : }
21732 :
21733 : static PyMethodDef py_lsa_CreateSecret_methods[] = {
21734 : { "opnum", (PyCFunction)py_lsa_CreateSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
21735 : "lsa.CreateSecret.opnum() -> 16 (0x10) " },
21736 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21737 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21738 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21739 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21740 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21741 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21742 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21743 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21744 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21745 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21746 : { NULL, NULL, 0, NULL }
21747 : };
21748 :
21749 :
21750 : static PyTypeObject lsa_CreateSecret_Type = {
21751 : PyVarObject_HEAD_INIT(NULL, 0)
21752 : .tp_name = "lsa.CreateSecret",
21753 : .tp_getset = py_lsa_CreateSecret_getsetters,
21754 : .tp_methods = py_lsa_CreateSecret_methods,
21755 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21756 : .tp_new = py_lsa_CreateSecret_new,
21757 : };
21758 :
21759 2 : static bool pack_py_lsa_CreateSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateSecret *r)
21760 : {
21761 0 : PyObject *py_handle;
21762 0 : PyObject *py_name;
21763 0 : PyObject *py_access_mask;
21764 2 : const char *kwnames[] = {
21765 : "handle", "name", "access_mask", NULL
21766 : };
21767 :
21768 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_CreateSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
21769 0 : return false;
21770 : }
21771 :
21772 2 : if (py_handle == NULL) {
21773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
21774 0 : return false;
21775 : }
21776 2 : r->in.handle = talloc_ptrtype(r, r->in.handle);
21777 2 : if (r->in.handle == NULL) {
21778 0 : PyErr_NoMemory();
21779 0 : return false;
21780 : }
21781 2 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
21782 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
21783 0 : PyErr_NoMemory();
21784 0 : return false;
21785 : }
21786 2 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
21787 2 : if (py_name == NULL) {
21788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
21789 0 : return false;
21790 : }
21791 2 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
21792 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
21793 0 : PyErr_NoMemory();
21794 0 : return false;
21795 : }
21796 2 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
21797 2 : if (py_access_mask == NULL) {
21798 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
21799 0 : return false;
21800 : }
21801 : {
21802 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
21803 2 : if (PyLong_Check(py_access_mask)) {
21804 0 : unsigned long long test_var;
21805 2 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
21806 2 : if (PyErr_Occurred() != NULL) {
21807 0 : return false;
21808 : }
21809 2 : if (test_var > uint_max) {
21810 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21811 : PyLong_Type.tp_name, uint_max, test_var);
21812 0 : return false;
21813 : }
21814 2 : r->in.access_mask = test_var;
21815 : } else {
21816 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21817 : PyLong_Type.tp_name);
21818 0 : return false;
21819 : }
21820 : }
21821 2 : return true;
21822 : }
21823 :
21824 2 : static PyObject *unpack_py_lsa_CreateSecret_args_out(struct lsa_CreateSecret *r)
21825 : {
21826 0 : PyObject *result;
21827 0 : PyObject *py_sec_handle;
21828 2 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
21829 2 : result = py_sec_handle;
21830 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
21831 0 : PyErr_SetNTSTATUS(r->out.result);
21832 0 : return NULL;
21833 : }
21834 :
21835 2 : return result;
21836 : }
21837 :
21838 :
21839 0 : static PyObject *py_lsa_OpenAccount_in_get_handle(PyObject *obj, void *closure)
21840 : {
21841 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(obj);
21842 0 : PyObject *py_handle;
21843 0 : if (object->in.handle == NULL) {
21844 0 : Py_RETURN_NONE;
21845 : }
21846 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
21847 0 : return py_handle;
21848 : }
21849 :
21850 0 : static int py_lsa_OpenAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
21851 : {
21852 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
21853 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
21854 0 : if (value == NULL) {
21855 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
21856 0 : return -1;
21857 : }
21858 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
21859 0 : if (object->in.handle == NULL) {
21860 0 : PyErr_NoMemory();
21861 0 : return -1;
21862 : }
21863 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21864 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21865 0 : PyErr_NoMemory();
21866 0 : return -1;
21867 : }
21868 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
21869 0 : return 0;
21870 : }
21871 :
21872 0 : static PyObject *py_lsa_OpenAccount_in_get_sid(PyObject *obj, void *closure)
21873 : {
21874 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(obj);
21875 0 : PyObject *py_sid;
21876 0 : if (object->in.sid == NULL) {
21877 0 : Py_RETURN_NONE;
21878 : }
21879 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
21880 0 : return py_sid;
21881 : }
21882 :
21883 0 : static int py_lsa_OpenAccount_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
21884 : {
21885 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
21886 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
21887 0 : if (value == NULL) {
21888 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
21889 0 : return -1;
21890 : }
21891 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
21892 0 : if (object->in.sid == NULL) {
21893 0 : PyErr_NoMemory();
21894 0 : return -1;
21895 : }
21896 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
21897 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21898 0 : PyErr_NoMemory();
21899 0 : return -1;
21900 : }
21901 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
21902 0 : return 0;
21903 : }
21904 :
21905 0 : static PyObject *py_lsa_OpenAccount_in_get_access_mask(PyObject *obj, void *closure)
21906 : {
21907 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(obj);
21908 0 : PyObject *py_access_mask;
21909 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
21910 0 : return py_access_mask;
21911 : }
21912 :
21913 0 : static int py_lsa_OpenAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
21914 : {
21915 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
21916 0 : if (value == NULL) {
21917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
21918 0 : return -1;
21919 : }
21920 : {
21921 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
21922 0 : if (PyLong_Check(value)) {
21923 0 : unsigned long long test_var;
21924 0 : test_var = PyLong_AsUnsignedLongLong(value);
21925 0 : if (PyErr_Occurred() != NULL) {
21926 0 : return -1;
21927 : }
21928 0 : if (test_var > uint_max) {
21929 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21930 : PyLong_Type.tp_name, uint_max, test_var);
21931 0 : return -1;
21932 : }
21933 0 : object->in.access_mask = test_var;
21934 : } else {
21935 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21936 : PyLong_Type.tp_name);
21937 0 : return -1;
21938 : }
21939 : }
21940 0 : return 0;
21941 : }
21942 :
21943 0 : static PyObject *py_lsa_OpenAccount_out_get_acct_handle(PyObject *obj, void *closure)
21944 : {
21945 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(obj);
21946 0 : PyObject *py_acct_handle;
21947 0 : if (object->out.acct_handle == NULL) {
21948 0 : Py_RETURN_NONE;
21949 : }
21950 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, object->out.acct_handle, object->out.acct_handle);
21951 0 : return py_acct_handle;
21952 : }
21953 :
21954 0 : static int py_lsa_OpenAccount_out_set_acct_handle(PyObject *py_obj, PyObject *value, void *closure)
21955 : {
21956 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
21957 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.acct_handle));
21958 0 : if (value == NULL) {
21959 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.acct_handle");
21960 0 : return -1;
21961 : }
21962 0 : object->out.acct_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.acct_handle);
21963 0 : if (object->out.acct_handle == NULL) {
21964 0 : PyErr_NoMemory();
21965 0 : return -1;
21966 : }
21967 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21968 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21969 0 : PyErr_NoMemory();
21970 0 : return -1;
21971 : }
21972 0 : object->out.acct_handle = (struct policy_handle *)pytalloc_get_ptr(value);
21973 0 : return 0;
21974 : }
21975 :
21976 0 : static PyObject *py_lsa_OpenAccount_get_result(PyObject *obj, void *closure)
21977 : {
21978 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(obj);
21979 0 : PyObject *py_result;
21980 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21981 0 : return py_result;
21982 : }
21983 :
21984 0 : static int py_lsa_OpenAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
21985 : {
21986 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
21987 0 : if (value == NULL) {
21988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
21989 0 : return -1;
21990 : }
21991 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21992 0 : return 0;
21993 : }
21994 :
21995 : static PyGetSetDef py_lsa_OpenAccount_getsetters[] = {
21996 : {
21997 : .name = discard_const_p(char, "in_handle"),
21998 : .get = py_lsa_OpenAccount_in_get_handle,
21999 : .set = py_lsa_OpenAccount_in_set_handle,
22000 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22001 : },
22002 : {
22003 : .name = discard_const_p(char, "in_sid"),
22004 : .get = py_lsa_OpenAccount_in_get_sid,
22005 : .set = py_lsa_OpenAccount_in_set_sid,
22006 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
22007 : },
22008 : {
22009 : .name = discard_const_p(char, "in_access_mask"),
22010 : .get = py_lsa_OpenAccount_in_get_access_mask,
22011 : .set = py_lsa_OpenAccount_in_set_access_mask,
22012 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
22013 : },
22014 : {
22015 : .name = discard_const_p(char, "out_acct_handle"),
22016 : .get = py_lsa_OpenAccount_out_get_acct_handle,
22017 : .set = py_lsa_OpenAccount_out_set_acct_handle,
22018 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22019 : },
22020 : {
22021 : .name = discard_const_p(char, "result"),
22022 : .get = py_lsa_OpenAccount_get_result,
22023 : .set = py_lsa_OpenAccount_set_result,
22024 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22025 : },
22026 : { .name = NULL }
22027 : };
22028 :
22029 0 : static PyObject *py_lsa_OpenAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22030 : {
22031 0 : PyObject *self = pytalloc_new(struct lsa_OpenAccount, type);
22032 0 : struct lsa_OpenAccount *_self = (struct lsa_OpenAccount *)pytalloc_get_ptr(self);
22033 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22034 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22035 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
22036 0 : _self->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
22037 0 : return self;
22038 : }
22039 :
22040 0 : static PyObject *py_lsa_OpenAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22041 : {
22042 :
22043 :
22044 0 : return PyLong_FromLong(17);
22045 : }
22046 :
22047 0 : static PyObject *py_lsa_OpenAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22048 : {
22049 0 : const struct ndr_interface_call *call = NULL;
22050 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
22051 0 : PyObject *ret = NULL;
22052 0 : struct ndr_push *push = NULL;
22053 0 : DATA_BLOB blob;
22054 0 : enum ndr_err_code err;
22055 :
22056 0 : if (ndr_table_lsarpc.num_calls < 18) {
22057 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_pack");
22058 0 : return NULL;
22059 : }
22060 0 : call = &ndr_table_lsarpc.calls[17];
22061 :
22062 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22063 0 : if (push == NULL) {
22064 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22065 0 : return NULL;
22066 : }
22067 :
22068 0 : push->flags |= ndr_push_flags;
22069 :
22070 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22071 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22072 0 : TALLOC_FREE(push);
22073 0 : PyErr_SetNdrError(err);
22074 0 : return NULL;
22075 : }
22076 0 : blob = ndr_push_blob(push);
22077 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22078 0 : TALLOC_FREE(push);
22079 0 : return ret;
22080 : }
22081 :
22082 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22083 : {
22084 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22085 0 : PyObject *bigendian_obj = NULL;
22086 0 : PyObject *ndr64_obj = NULL;
22087 0 : libndr_flags ndr_push_flags = 0;
22088 :
22089 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22090 : discard_const_p(char *, kwnames),
22091 : &bigendian_obj,
22092 : &ndr64_obj)) {
22093 0 : return NULL;
22094 : }
22095 :
22096 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22097 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22098 : }
22099 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22100 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22101 : }
22102 :
22103 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22104 : }
22105 :
22106 0 : static PyObject *py_lsa_OpenAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22107 : {
22108 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22109 0 : PyObject *bigendian_obj = NULL;
22110 0 : PyObject *ndr64_obj = NULL;
22111 0 : libndr_flags ndr_push_flags = 0;
22112 :
22113 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22114 : discard_const_p(char *, kwnames),
22115 : &bigendian_obj,
22116 : &ndr64_obj)) {
22117 0 : return NULL;
22118 : }
22119 :
22120 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22121 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22122 : }
22123 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22124 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22125 : }
22126 :
22127 0 : return py_lsa_OpenAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22128 : }
22129 :
22130 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)
22131 : {
22132 0 : const struct ndr_interface_call *call = NULL;
22133 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
22134 0 : struct ndr_pull *pull = NULL;
22135 0 : enum ndr_err_code err;
22136 :
22137 0 : if (ndr_table_lsarpc.num_calls < 18) {
22138 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_unpack");
22139 0 : return NULL;
22140 : }
22141 0 : call = &ndr_table_lsarpc.calls[17];
22142 :
22143 0 : pull = ndr_pull_init_blob(blob, object);
22144 0 : if (pull == NULL) {
22145 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22146 0 : return NULL;
22147 : }
22148 :
22149 0 : pull->flags |= ndr_pull_flags;
22150 :
22151 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22152 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22153 0 : TALLOC_FREE(pull);
22154 0 : PyErr_SetNdrError(err);
22155 0 : return NULL;
22156 : }
22157 0 : if (!allow_remaining) {
22158 0 : uint32_t highest_ofs;
22159 :
22160 0 : if (pull->offset > pull->relative_highest_offset) {
22161 0 : highest_ofs = pull->offset;
22162 : } else {
22163 0 : highest_ofs = pull->relative_highest_offset;
22164 : }
22165 0 : if (highest_ofs < pull->data_size) {
22166 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22167 : "not all bytes consumed ofs[%u] size[%u]",
22168 : highest_ofs, pull->data_size);
22169 0 : TALLOC_FREE(pull);
22170 0 : PyErr_SetNdrError(err);
22171 0 : return NULL;
22172 : }
22173 : }
22174 :
22175 0 : TALLOC_FREE(pull);
22176 0 : Py_RETURN_NONE;
22177 : }
22178 :
22179 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22180 : {
22181 0 : DATA_BLOB blob;
22182 0 : Py_ssize_t blob_length = 0;
22183 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22184 0 : PyObject *bigendian_obj = NULL;
22185 0 : PyObject *ndr64_obj = NULL;
22186 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22187 0 : PyObject *allow_remaining_obj = NULL;
22188 0 : bool allow_remaining = false;
22189 :
22190 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22191 : discard_const_p(char *, kwnames),
22192 : &blob.data, &blob_length,
22193 : &bigendian_obj,
22194 : &ndr64_obj,
22195 : &allow_remaining_obj)) {
22196 0 : return NULL;
22197 : }
22198 0 : blob.length = blob_length;
22199 :
22200 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22201 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22202 : }
22203 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22204 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22205 : }
22206 :
22207 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22208 0 : allow_remaining = true;
22209 : }
22210 :
22211 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22212 : }
22213 :
22214 0 : static PyObject *py_lsa_OpenAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22215 : {
22216 0 : DATA_BLOB blob;
22217 0 : Py_ssize_t blob_length = 0;
22218 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22219 0 : PyObject *bigendian_obj = NULL;
22220 0 : PyObject *ndr64_obj = NULL;
22221 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22222 0 : PyObject *allow_remaining_obj = NULL;
22223 0 : bool allow_remaining = false;
22224 :
22225 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22226 : discard_const_p(char *, kwnames),
22227 : &blob.data, &blob_length,
22228 : &bigendian_obj,
22229 : &ndr64_obj,
22230 : &allow_remaining_obj)) {
22231 0 : return NULL;
22232 : }
22233 0 : blob.length = blob_length;
22234 :
22235 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22236 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22237 : }
22238 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22239 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22240 : }
22241 :
22242 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22243 0 : allow_remaining = true;
22244 : }
22245 :
22246 0 : return py_lsa_OpenAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22247 : }
22248 :
22249 0 : static PyObject *py_lsa_OpenAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22250 : {
22251 0 : const struct ndr_interface_call *call = NULL;
22252 0 : struct lsa_OpenAccount *object = pytalloc_get_ptr(py_obj);
22253 0 : PyObject *ret;
22254 0 : char *retstr;
22255 :
22256 0 : if (ndr_table_lsarpc.num_calls < 18) {
22257 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenAccount_ndr_print");
22258 0 : return NULL;
22259 : }
22260 0 : call = &ndr_table_lsarpc.calls[17];
22261 :
22262 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22263 0 : ret = PyUnicode_FromString(retstr);
22264 0 : TALLOC_FREE(retstr);
22265 :
22266 0 : return ret;
22267 : }
22268 :
22269 0 : static PyObject *py_lsa_OpenAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22270 : {
22271 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_in", NDR_IN);
22272 : }
22273 :
22274 0 : static PyObject *py_lsa_OpenAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22275 : {
22276 0 : return py_lsa_OpenAccount_ndr_print(py_obj, "lsa_OpenAccount_out", NDR_OUT);
22277 : }
22278 :
22279 : static PyMethodDef py_lsa_OpenAccount_methods[] = {
22280 : { "opnum", (PyCFunction)py_lsa_OpenAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22281 : "lsa.OpenAccount.opnum() -> 17 (0x11) " },
22282 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22283 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22284 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22285 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22286 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22287 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22288 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22289 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22290 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22291 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22292 : { NULL, NULL, 0, NULL }
22293 : };
22294 :
22295 :
22296 : static PyTypeObject lsa_OpenAccount_Type = {
22297 : PyVarObject_HEAD_INIT(NULL, 0)
22298 : .tp_name = "lsa.OpenAccount",
22299 : .tp_getset = py_lsa_OpenAccount_getsetters,
22300 : .tp_methods = py_lsa_OpenAccount_methods,
22301 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22302 : .tp_new = py_lsa_OpenAccount_new,
22303 : };
22304 :
22305 0 : static bool pack_py_lsa_OpenAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenAccount *r)
22306 : {
22307 0 : PyObject *py_handle;
22308 0 : PyObject *py_sid;
22309 0 : PyObject *py_access_mask;
22310 0 : const char *kwnames[] = {
22311 : "handle", "sid", "access_mask", NULL
22312 : };
22313 :
22314 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenAccount", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
22315 0 : return false;
22316 : }
22317 :
22318 0 : if (py_handle == NULL) {
22319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
22320 0 : return false;
22321 : }
22322 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22323 0 : if (r->in.handle == NULL) {
22324 0 : PyErr_NoMemory();
22325 0 : return false;
22326 : }
22327 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22328 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22329 0 : PyErr_NoMemory();
22330 0 : return false;
22331 : }
22332 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22333 0 : if (py_sid == NULL) {
22334 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
22335 0 : return false;
22336 : }
22337 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
22338 0 : if (r->in.sid == NULL) {
22339 0 : PyErr_NoMemory();
22340 0 : return false;
22341 : }
22342 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
22343 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
22344 0 : PyErr_NoMemory();
22345 0 : return false;
22346 : }
22347 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
22348 0 : if (py_access_mask == NULL) {
22349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
22350 0 : return false;
22351 : }
22352 : {
22353 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
22354 0 : if (PyLong_Check(py_access_mask)) {
22355 0 : unsigned long long test_var;
22356 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
22357 0 : if (PyErr_Occurred() != NULL) {
22358 0 : return false;
22359 : }
22360 0 : if (test_var > uint_max) {
22361 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22362 : PyLong_Type.tp_name, uint_max, test_var);
22363 0 : return false;
22364 : }
22365 0 : r->in.access_mask = test_var;
22366 : } else {
22367 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22368 : PyLong_Type.tp_name);
22369 0 : return false;
22370 : }
22371 : }
22372 0 : return true;
22373 : }
22374 :
22375 0 : static PyObject *unpack_py_lsa_OpenAccount_args_out(struct lsa_OpenAccount *r)
22376 : {
22377 0 : PyObject *result;
22378 0 : PyObject *py_acct_handle;
22379 0 : py_acct_handle = pytalloc_reference_ex(policy_handle_Type, r->out.acct_handle, r->out.acct_handle);
22380 0 : result = py_acct_handle;
22381 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22382 0 : PyErr_SetNTSTATUS(r->out.result);
22383 0 : return NULL;
22384 : }
22385 :
22386 0 : return result;
22387 : }
22388 :
22389 :
22390 0 : static PyObject *py_lsa_EnumPrivsAccount_in_get_handle(PyObject *obj, void *closure)
22391 : {
22392 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(obj);
22393 0 : PyObject *py_handle;
22394 0 : if (object->in.handle == NULL) {
22395 0 : Py_RETURN_NONE;
22396 : }
22397 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22398 0 : return py_handle;
22399 : }
22400 :
22401 0 : static int py_lsa_EnumPrivsAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22402 : {
22403 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22404 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22405 0 : if (value == NULL) {
22406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
22407 0 : return -1;
22408 : }
22409 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22410 0 : if (object->in.handle == NULL) {
22411 0 : PyErr_NoMemory();
22412 0 : return -1;
22413 : }
22414 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22415 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22416 0 : PyErr_NoMemory();
22417 0 : return -1;
22418 : }
22419 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22420 0 : return 0;
22421 : }
22422 :
22423 0 : static PyObject *py_lsa_EnumPrivsAccount_out_get_privs(PyObject *obj, void *closure)
22424 : {
22425 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(obj);
22426 0 : PyObject *py_privs;
22427 0 : if (object->out.privs == NULL) {
22428 0 : Py_RETURN_NONE;
22429 : }
22430 0 : if (*object->out.privs == NULL) {
22431 0 : py_privs = Py_None;
22432 0 : Py_INCREF(py_privs);
22433 : } else {
22434 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *object->out.privs, *object->out.privs);
22435 : }
22436 0 : return py_privs;
22437 : }
22438 :
22439 0 : static int py_lsa_EnumPrivsAccount_out_set_privs(PyObject *py_obj, PyObject *value, void *closure)
22440 : {
22441 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22442 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.privs));
22443 0 : if (value == NULL) {
22444 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.privs");
22445 0 : return -1;
22446 : }
22447 0 : object->out.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.privs);
22448 0 : if (object->out.privs == NULL) {
22449 0 : PyErr_NoMemory();
22450 0 : return -1;
22451 : }
22452 0 : if (value == Py_None) {
22453 0 : *object->out.privs = NULL;
22454 : } else {
22455 0 : *object->out.privs = NULL;
22456 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
22457 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22458 0 : PyErr_NoMemory();
22459 0 : return -1;
22460 : }
22461 0 : *object->out.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
22462 : }
22463 0 : return 0;
22464 : }
22465 :
22466 0 : static PyObject *py_lsa_EnumPrivsAccount_get_result(PyObject *obj, void *closure)
22467 : {
22468 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(obj);
22469 0 : PyObject *py_result;
22470 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22471 0 : return py_result;
22472 : }
22473 :
22474 0 : static int py_lsa_EnumPrivsAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22475 : {
22476 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22477 0 : if (value == NULL) {
22478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
22479 0 : return -1;
22480 : }
22481 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22482 0 : return 0;
22483 : }
22484 :
22485 : static PyGetSetDef py_lsa_EnumPrivsAccount_getsetters[] = {
22486 : {
22487 : .name = discard_const_p(char, "in_handle"),
22488 : .get = py_lsa_EnumPrivsAccount_in_get_handle,
22489 : .set = py_lsa_EnumPrivsAccount_in_set_handle,
22490 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22491 : },
22492 : {
22493 : .name = discard_const_p(char, "out_privs"),
22494 : .get = py_lsa_EnumPrivsAccount_out_get_privs,
22495 : .set = py_lsa_EnumPrivsAccount_out_set_privs,
22496 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
22497 : },
22498 : {
22499 : .name = discard_const_p(char, "result"),
22500 : .get = py_lsa_EnumPrivsAccount_get_result,
22501 : .set = py_lsa_EnumPrivsAccount_set_result,
22502 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22503 : },
22504 : { .name = NULL }
22505 : };
22506 :
22507 0 : static PyObject *py_lsa_EnumPrivsAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22508 : {
22509 0 : PyObject *self = pytalloc_new(struct lsa_EnumPrivsAccount, type);
22510 0 : struct lsa_EnumPrivsAccount *_self = (struct lsa_EnumPrivsAccount *)pytalloc_get_ptr(self);
22511 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22512 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22513 : /* a pointer to a NULL pointer */
22514 0 : _self->out.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet *);
22515 0 : return self;
22516 : }
22517 :
22518 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22519 : {
22520 :
22521 :
22522 0 : return PyLong_FromLong(18);
22523 : }
22524 :
22525 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22526 : {
22527 0 : const struct ndr_interface_call *call = NULL;
22528 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22529 0 : PyObject *ret = NULL;
22530 0 : struct ndr_push *push = NULL;
22531 0 : DATA_BLOB blob;
22532 0 : enum ndr_err_code err;
22533 :
22534 0 : if (ndr_table_lsarpc.num_calls < 19) {
22535 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_pack");
22536 0 : return NULL;
22537 : }
22538 0 : call = &ndr_table_lsarpc.calls[18];
22539 :
22540 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22541 0 : if (push == NULL) {
22542 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22543 0 : return NULL;
22544 : }
22545 :
22546 0 : push->flags |= ndr_push_flags;
22547 :
22548 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22549 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22550 0 : TALLOC_FREE(push);
22551 0 : PyErr_SetNdrError(err);
22552 0 : return NULL;
22553 : }
22554 0 : blob = ndr_push_blob(push);
22555 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22556 0 : TALLOC_FREE(push);
22557 0 : return ret;
22558 : }
22559 :
22560 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22561 : {
22562 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22563 0 : PyObject *bigendian_obj = NULL;
22564 0 : PyObject *ndr64_obj = NULL;
22565 0 : libndr_flags ndr_push_flags = 0;
22566 :
22567 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22568 : discard_const_p(char *, kwnames),
22569 : &bigendian_obj,
22570 : &ndr64_obj)) {
22571 0 : return NULL;
22572 : }
22573 :
22574 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22575 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22576 : }
22577 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22578 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22579 : }
22580 :
22581 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22582 : }
22583 :
22584 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22585 : {
22586 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22587 0 : PyObject *bigendian_obj = NULL;
22588 0 : PyObject *ndr64_obj = NULL;
22589 0 : libndr_flags ndr_push_flags = 0;
22590 :
22591 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22592 : discard_const_p(char *, kwnames),
22593 : &bigendian_obj,
22594 : &ndr64_obj)) {
22595 0 : return NULL;
22596 : }
22597 :
22598 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22599 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22600 : }
22601 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22602 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22603 : }
22604 :
22605 0 : return py_lsa_EnumPrivsAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22606 : }
22607 :
22608 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)
22609 : {
22610 0 : const struct ndr_interface_call *call = NULL;
22611 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22612 0 : struct ndr_pull *pull = NULL;
22613 0 : enum ndr_err_code err;
22614 :
22615 0 : if (ndr_table_lsarpc.num_calls < 19) {
22616 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_unpack");
22617 0 : return NULL;
22618 : }
22619 0 : call = &ndr_table_lsarpc.calls[18];
22620 :
22621 0 : pull = ndr_pull_init_blob(blob, object);
22622 0 : if (pull == NULL) {
22623 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22624 0 : return NULL;
22625 : }
22626 :
22627 0 : pull->flags |= ndr_pull_flags;
22628 :
22629 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22630 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22631 0 : TALLOC_FREE(pull);
22632 0 : PyErr_SetNdrError(err);
22633 0 : return NULL;
22634 : }
22635 0 : if (!allow_remaining) {
22636 0 : uint32_t highest_ofs;
22637 :
22638 0 : if (pull->offset > pull->relative_highest_offset) {
22639 0 : highest_ofs = pull->offset;
22640 : } else {
22641 0 : highest_ofs = pull->relative_highest_offset;
22642 : }
22643 0 : if (highest_ofs < pull->data_size) {
22644 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22645 : "not all bytes consumed ofs[%u] size[%u]",
22646 : highest_ofs, pull->data_size);
22647 0 : TALLOC_FREE(pull);
22648 0 : PyErr_SetNdrError(err);
22649 0 : return NULL;
22650 : }
22651 : }
22652 :
22653 0 : TALLOC_FREE(pull);
22654 0 : Py_RETURN_NONE;
22655 : }
22656 :
22657 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22658 : {
22659 0 : DATA_BLOB blob;
22660 0 : Py_ssize_t blob_length = 0;
22661 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22662 0 : PyObject *bigendian_obj = NULL;
22663 0 : PyObject *ndr64_obj = NULL;
22664 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22665 0 : PyObject *allow_remaining_obj = NULL;
22666 0 : bool allow_remaining = false;
22667 :
22668 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22669 : discard_const_p(char *, kwnames),
22670 : &blob.data, &blob_length,
22671 : &bigendian_obj,
22672 : &ndr64_obj,
22673 : &allow_remaining_obj)) {
22674 0 : return NULL;
22675 : }
22676 0 : blob.length = blob_length;
22677 :
22678 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22679 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22680 : }
22681 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22682 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22683 : }
22684 :
22685 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22686 0 : allow_remaining = true;
22687 : }
22688 :
22689 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22690 : }
22691 :
22692 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22693 : {
22694 0 : DATA_BLOB blob;
22695 0 : Py_ssize_t blob_length = 0;
22696 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22697 0 : PyObject *bigendian_obj = NULL;
22698 0 : PyObject *ndr64_obj = NULL;
22699 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22700 0 : PyObject *allow_remaining_obj = NULL;
22701 0 : bool allow_remaining = false;
22702 :
22703 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22704 : discard_const_p(char *, kwnames),
22705 : &blob.data, &blob_length,
22706 : &bigendian_obj,
22707 : &ndr64_obj,
22708 : &allow_remaining_obj)) {
22709 0 : return NULL;
22710 : }
22711 0 : blob.length = blob_length;
22712 :
22713 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22714 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22715 : }
22716 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22717 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22718 : }
22719 :
22720 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22721 0 : allow_remaining = true;
22722 : }
22723 :
22724 0 : return py_lsa_EnumPrivsAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22725 : }
22726 :
22727 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22728 : {
22729 0 : const struct ndr_interface_call *call = NULL;
22730 0 : struct lsa_EnumPrivsAccount *object = pytalloc_get_ptr(py_obj);
22731 0 : PyObject *ret;
22732 0 : char *retstr;
22733 :
22734 0 : if (ndr_table_lsarpc.num_calls < 19) {
22735 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumPrivsAccount_ndr_print");
22736 0 : return NULL;
22737 : }
22738 0 : call = &ndr_table_lsarpc.calls[18];
22739 :
22740 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22741 0 : ret = PyUnicode_FromString(retstr);
22742 0 : TALLOC_FREE(retstr);
22743 :
22744 0 : return ret;
22745 : }
22746 :
22747 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22748 : {
22749 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_in", NDR_IN);
22750 : }
22751 :
22752 0 : static PyObject *py_lsa_EnumPrivsAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22753 : {
22754 0 : return py_lsa_EnumPrivsAccount_ndr_print(py_obj, "lsa_EnumPrivsAccount_out", NDR_OUT);
22755 : }
22756 :
22757 : static PyMethodDef py_lsa_EnumPrivsAccount_methods[] = {
22758 : { "opnum", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
22759 : "lsa.EnumPrivsAccount.opnum() -> 18 (0x12) " },
22760 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22761 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22762 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22763 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22764 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22765 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22766 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumPrivsAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22767 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22768 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22769 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumPrivsAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22770 : { NULL, NULL, 0, NULL }
22771 : };
22772 :
22773 :
22774 : static PyTypeObject lsa_EnumPrivsAccount_Type = {
22775 : PyVarObject_HEAD_INIT(NULL, 0)
22776 : .tp_name = "lsa.EnumPrivsAccount",
22777 : .tp_getset = py_lsa_EnumPrivsAccount_getsetters,
22778 : .tp_methods = py_lsa_EnumPrivsAccount_methods,
22779 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22780 : .tp_new = py_lsa_EnumPrivsAccount_new,
22781 : };
22782 :
22783 0 : static bool pack_py_lsa_EnumPrivsAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumPrivsAccount *r)
22784 : {
22785 0 : PyObject *py_handle;
22786 0 : const char *kwnames[] = {
22787 : "handle", NULL
22788 : };
22789 :
22790 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_EnumPrivsAccount", discard_const_p(char *, kwnames), &py_handle)) {
22791 0 : return false;
22792 : }
22793 :
22794 0 : if (py_handle == NULL) {
22795 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
22796 0 : return false;
22797 : }
22798 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
22799 0 : if (r->in.handle == NULL) {
22800 0 : PyErr_NoMemory();
22801 0 : return false;
22802 : }
22803 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
22804 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
22805 0 : PyErr_NoMemory();
22806 0 : return false;
22807 : }
22808 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
22809 0 : return true;
22810 : }
22811 :
22812 0 : static PyObject *unpack_py_lsa_EnumPrivsAccount_args_out(struct lsa_EnumPrivsAccount *r)
22813 : {
22814 0 : PyObject *result;
22815 0 : PyObject *py_privs;
22816 0 : if (*r->out.privs == NULL) {
22817 0 : py_privs = Py_None;
22818 0 : Py_INCREF(py_privs);
22819 : } else {
22820 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, *r->out.privs, *r->out.privs);
22821 : }
22822 0 : result = py_privs;
22823 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
22824 0 : PyErr_SetNTSTATUS(r->out.result);
22825 0 : return NULL;
22826 : }
22827 :
22828 0 : return result;
22829 : }
22830 :
22831 :
22832 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_handle(PyObject *obj, void *closure)
22833 : {
22834 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(obj);
22835 0 : PyObject *py_handle;
22836 0 : if (object->in.handle == NULL) {
22837 0 : Py_RETURN_NONE;
22838 : }
22839 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
22840 0 : return py_handle;
22841 : }
22842 :
22843 0 : static int py_lsa_AddPrivilegesToAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
22844 : {
22845 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
22846 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
22847 0 : if (value == NULL) {
22848 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
22849 0 : return -1;
22850 : }
22851 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
22852 0 : if (object->in.handle == NULL) {
22853 0 : PyErr_NoMemory();
22854 0 : return -1;
22855 : }
22856 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22857 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22858 0 : PyErr_NoMemory();
22859 0 : return -1;
22860 : }
22861 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
22862 0 : return 0;
22863 : }
22864 :
22865 0 : static PyObject *py_lsa_AddPrivilegesToAccount_in_get_privs(PyObject *obj, void *closure)
22866 : {
22867 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(obj);
22868 0 : PyObject *py_privs;
22869 0 : if (object->in.privs == NULL) {
22870 0 : Py_RETURN_NONE;
22871 : }
22872 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
22873 0 : return py_privs;
22874 : }
22875 :
22876 0 : static int py_lsa_AddPrivilegesToAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
22877 : {
22878 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
22879 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
22880 0 : if (value == NULL) {
22881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.privs");
22882 0 : return -1;
22883 : }
22884 0 : object->in.privs = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.privs);
22885 0 : if (object->in.privs == NULL) {
22886 0 : PyErr_NoMemory();
22887 0 : return -1;
22888 : }
22889 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
22890 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22891 0 : PyErr_NoMemory();
22892 0 : return -1;
22893 : }
22894 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
22895 0 : return 0;
22896 : }
22897 :
22898 0 : static PyObject *py_lsa_AddPrivilegesToAccount_get_result(PyObject *obj, void *closure)
22899 : {
22900 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(obj);
22901 0 : PyObject *py_result;
22902 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22903 0 : return py_result;
22904 : }
22905 :
22906 0 : static int py_lsa_AddPrivilegesToAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
22907 : {
22908 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
22909 0 : if (value == NULL) {
22910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
22911 0 : return -1;
22912 : }
22913 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22914 0 : return 0;
22915 : }
22916 :
22917 : static PyGetSetDef py_lsa_AddPrivilegesToAccount_getsetters[] = {
22918 : {
22919 : .name = discard_const_p(char, "in_handle"),
22920 : .get = py_lsa_AddPrivilegesToAccount_in_get_handle,
22921 : .set = py_lsa_AddPrivilegesToAccount_in_set_handle,
22922 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22923 : },
22924 : {
22925 : .name = discard_const_p(char, "in_privs"),
22926 : .get = py_lsa_AddPrivilegesToAccount_in_get_privs,
22927 : .set = py_lsa_AddPrivilegesToAccount_in_set_privs,
22928 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
22929 : },
22930 : {
22931 : .name = discard_const_p(char, "result"),
22932 : .get = py_lsa_AddPrivilegesToAccount_get_result,
22933 : .set = py_lsa_AddPrivilegesToAccount_set_result,
22934 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22935 : },
22936 : { .name = NULL }
22937 : };
22938 :
22939 0 : static PyObject *py_lsa_AddPrivilegesToAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22940 : {
22941 0 : PyObject *self = pytalloc_new(struct lsa_AddPrivilegesToAccount, type);
22942 0 : struct lsa_AddPrivilegesToAccount *_self = (struct lsa_AddPrivilegesToAccount *)pytalloc_get_ptr(self);
22943 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22944 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
22945 0 : _self->in.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet);
22946 0 : return self;
22947 : }
22948 :
22949 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22950 : {
22951 :
22952 :
22953 0 : return PyLong_FromLong(19);
22954 : }
22955 :
22956 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22957 : {
22958 0 : const struct ndr_interface_call *call = NULL;
22959 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
22960 0 : PyObject *ret = NULL;
22961 0 : struct ndr_push *push = NULL;
22962 0 : DATA_BLOB blob;
22963 0 : enum ndr_err_code err;
22964 :
22965 0 : if (ndr_table_lsarpc.num_calls < 20) {
22966 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_pack");
22967 0 : return NULL;
22968 : }
22969 0 : call = &ndr_table_lsarpc.calls[19];
22970 :
22971 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22972 0 : if (push == NULL) {
22973 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22974 0 : return NULL;
22975 : }
22976 :
22977 0 : push->flags |= ndr_push_flags;
22978 :
22979 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22980 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22981 0 : TALLOC_FREE(push);
22982 0 : PyErr_SetNdrError(err);
22983 0 : return NULL;
22984 : }
22985 0 : blob = ndr_push_blob(push);
22986 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22987 0 : TALLOC_FREE(push);
22988 0 : return ret;
22989 : }
22990 :
22991 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22992 : {
22993 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22994 0 : PyObject *bigendian_obj = NULL;
22995 0 : PyObject *ndr64_obj = NULL;
22996 0 : libndr_flags ndr_push_flags = 0;
22997 :
22998 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22999 : discard_const_p(char *, kwnames),
23000 : &bigendian_obj,
23001 : &ndr64_obj)) {
23002 0 : return NULL;
23003 : }
23004 :
23005 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23006 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23007 : }
23008 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23009 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23010 : }
23011 :
23012 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23013 : }
23014 :
23015 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23016 : {
23017 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23018 0 : PyObject *bigendian_obj = NULL;
23019 0 : PyObject *ndr64_obj = NULL;
23020 0 : libndr_flags ndr_push_flags = 0;
23021 :
23022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23023 : discard_const_p(char *, kwnames),
23024 : &bigendian_obj,
23025 : &ndr64_obj)) {
23026 0 : return NULL;
23027 : }
23028 :
23029 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23030 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23031 : }
23032 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23033 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23034 : }
23035 :
23036 0 : return py_lsa_AddPrivilegesToAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23037 : }
23038 :
23039 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)
23040 : {
23041 0 : const struct ndr_interface_call *call = NULL;
23042 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
23043 0 : struct ndr_pull *pull = NULL;
23044 0 : enum ndr_err_code err;
23045 :
23046 0 : if (ndr_table_lsarpc.num_calls < 20) {
23047 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_unpack");
23048 0 : return NULL;
23049 : }
23050 0 : call = &ndr_table_lsarpc.calls[19];
23051 :
23052 0 : pull = ndr_pull_init_blob(blob, object);
23053 0 : if (pull == NULL) {
23054 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23055 0 : return NULL;
23056 : }
23057 :
23058 0 : pull->flags |= ndr_pull_flags;
23059 :
23060 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23061 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23062 0 : TALLOC_FREE(pull);
23063 0 : PyErr_SetNdrError(err);
23064 0 : return NULL;
23065 : }
23066 0 : if (!allow_remaining) {
23067 0 : uint32_t highest_ofs;
23068 :
23069 0 : if (pull->offset > pull->relative_highest_offset) {
23070 0 : highest_ofs = pull->offset;
23071 : } else {
23072 0 : highest_ofs = pull->relative_highest_offset;
23073 : }
23074 0 : if (highest_ofs < pull->data_size) {
23075 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23076 : "not all bytes consumed ofs[%u] size[%u]",
23077 : highest_ofs, pull->data_size);
23078 0 : TALLOC_FREE(pull);
23079 0 : PyErr_SetNdrError(err);
23080 0 : return NULL;
23081 : }
23082 : }
23083 :
23084 0 : TALLOC_FREE(pull);
23085 0 : Py_RETURN_NONE;
23086 : }
23087 :
23088 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23089 : {
23090 0 : DATA_BLOB blob;
23091 0 : Py_ssize_t blob_length = 0;
23092 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23093 0 : PyObject *bigendian_obj = NULL;
23094 0 : PyObject *ndr64_obj = NULL;
23095 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23096 0 : PyObject *allow_remaining_obj = NULL;
23097 0 : bool allow_remaining = false;
23098 :
23099 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23100 : discard_const_p(char *, kwnames),
23101 : &blob.data, &blob_length,
23102 : &bigendian_obj,
23103 : &ndr64_obj,
23104 : &allow_remaining_obj)) {
23105 0 : return NULL;
23106 : }
23107 0 : blob.length = blob_length;
23108 :
23109 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23110 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23111 : }
23112 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23113 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23114 : }
23115 :
23116 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23117 0 : allow_remaining = true;
23118 : }
23119 :
23120 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23121 : }
23122 :
23123 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23124 : {
23125 0 : DATA_BLOB blob;
23126 0 : Py_ssize_t blob_length = 0;
23127 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23128 0 : PyObject *bigendian_obj = NULL;
23129 0 : PyObject *ndr64_obj = NULL;
23130 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23131 0 : PyObject *allow_remaining_obj = NULL;
23132 0 : bool allow_remaining = false;
23133 :
23134 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23135 : discard_const_p(char *, kwnames),
23136 : &blob.data, &blob_length,
23137 : &bigendian_obj,
23138 : &ndr64_obj,
23139 : &allow_remaining_obj)) {
23140 0 : return NULL;
23141 : }
23142 0 : blob.length = blob_length;
23143 :
23144 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23145 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23146 : }
23147 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23148 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23149 : }
23150 :
23151 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23152 0 : allow_remaining = true;
23153 : }
23154 :
23155 0 : return py_lsa_AddPrivilegesToAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23156 : }
23157 :
23158 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23159 : {
23160 0 : const struct ndr_interface_call *call = NULL;
23161 0 : struct lsa_AddPrivilegesToAccount *object = pytalloc_get_ptr(py_obj);
23162 0 : PyObject *ret;
23163 0 : char *retstr;
23164 :
23165 0 : if (ndr_table_lsarpc.num_calls < 20) {
23166 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddPrivilegesToAccount_ndr_print");
23167 0 : return NULL;
23168 : }
23169 0 : call = &ndr_table_lsarpc.calls[19];
23170 :
23171 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23172 0 : ret = PyUnicode_FromString(retstr);
23173 0 : TALLOC_FREE(retstr);
23174 :
23175 0 : return ret;
23176 : }
23177 :
23178 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23179 : {
23180 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_in", NDR_IN);
23181 : }
23182 :
23183 0 : static PyObject *py_lsa_AddPrivilegesToAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23184 : {
23185 0 : return py_lsa_AddPrivilegesToAccount_ndr_print(py_obj, "lsa_AddPrivilegesToAccount_out", NDR_OUT);
23186 : }
23187 :
23188 : static PyMethodDef py_lsa_AddPrivilegesToAccount_methods[] = {
23189 : { "opnum", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
23190 : "lsa.AddPrivilegesToAccount.opnum() -> 19 (0x13) " },
23191 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23192 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23193 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23194 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23195 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23196 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23197 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddPrivilegesToAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23198 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23199 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23200 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddPrivilegesToAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23201 : { NULL, NULL, 0, NULL }
23202 : };
23203 :
23204 :
23205 : static PyTypeObject lsa_AddPrivilegesToAccount_Type = {
23206 : PyVarObject_HEAD_INIT(NULL, 0)
23207 : .tp_name = "lsa.AddPrivilegesToAccount",
23208 : .tp_getset = py_lsa_AddPrivilegesToAccount_getsetters,
23209 : .tp_methods = py_lsa_AddPrivilegesToAccount_methods,
23210 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23211 : .tp_new = py_lsa_AddPrivilegesToAccount_new,
23212 : };
23213 :
23214 0 : static bool pack_py_lsa_AddPrivilegesToAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddPrivilegesToAccount *r)
23215 : {
23216 0 : PyObject *py_handle;
23217 0 : PyObject *py_privs;
23218 0 : const char *kwnames[] = {
23219 : "handle", "privs", NULL
23220 : };
23221 :
23222 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_AddPrivilegesToAccount", discard_const_p(char *, kwnames), &py_handle, &py_privs)) {
23223 0 : return false;
23224 : }
23225 :
23226 0 : if (py_handle == NULL) {
23227 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
23228 0 : return false;
23229 : }
23230 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23231 0 : if (r->in.handle == NULL) {
23232 0 : PyErr_NoMemory();
23233 0 : return false;
23234 : }
23235 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23236 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23237 0 : PyErr_NoMemory();
23238 0 : return false;
23239 : }
23240 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23241 0 : if (py_privs == NULL) {
23242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.privs");
23243 0 : return false;
23244 : }
23245 0 : r->in.privs = talloc_ptrtype(r, r->in.privs);
23246 0 : if (r->in.privs == NULL) {
23247 0 : PyErr_NoMemory();
23248 0 : return false;
23249 : }
23250 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
23251 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
23252 0 : PyErr_NoMemory();
23253 0 : return false;
23254 : }
23255 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
23256 0 : return true;
23257 : }
23258 :
23259 0 : static PyObject *unpack_py_lsa_AddPrivilegesToAccount_args_out(struct lsa_AddPrivilegesToAccount *r)
23260 : {
23261 0 : PyObject *result;
23262 0 : result = Py_None;
23263 0 : Py_INCREF(result);
23264 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23265 0 : PyErr_SetNTSTATUS(r->out.result);
23266 0 : return NULL;
23267 : }
23268 :
23269 0 : return result;
23270 : }
23271 :
23272 :
23273 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_handle(PyObject *obj, void *closure)
23274 : {
23275 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(obj);
23276 0 : PyObject *py_handle;
23277 0 : if (object->in.handle == NULL) {
23278 0 : Py_RETURN_NONE;
23279 : }
23280 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23281 0 : return py_handle;
23282 : }
23283 :
23284 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23285 : {
23286 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23287 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23288 0 : if (value == NULL) {
23289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
23290 0 : return -1;
23291 : }
23292 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23293 0 : if (object->in.handle == NULL) {
23294 0 : PyErr_NoMemory();
23295 0 : return -1;
23296 : }
23297 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23298 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23299 0 : PyErr_NoMemory();
23300 0 : return -1;
23301 : }
23302 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23303 0 : return 0;
23304 : }
23305 :
23306 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_remove_all(PyObject *obj, void *closure)
23307 : {
23308 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(obj);
23309 0 : PyObject *py_remove_all;
23310 0 : py_remove_all = PyLong_FromLong((uint16_t)(object->in.remove_all));
23311 0 : return py_remove_all;
23312 : }
23313 :
23314 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
23315 : {
23316 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23317 0 : if (value == NULL) {
23318 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.remove_all");
23319 0 : return -1;
23320 : }
23321 : {
23322 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
23323 0 : if (PyLong_Check(value)) {
23324 0 : unsigned long long test_var;
23325 0 : test_var = PyLong_AsUnsignedLongLong(value);
23326 0 : if (PyErr_Occurred() != NULL) {
23327 0 : return -1;
23328 : }
23329 0 : if (test_var > uint_max) {
23330 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23331 : PyLong_Type.tp_name, uint_max, test_var);
23332 0 : return -1;
23333 : }
23334 0 : object->in.remove_all = test_var;
23335 : } else {
23336 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23337 : PyLong_Type.tp_name);
23338 0 : return -1;
23339 : }
23340 : }
23341 0 : return 0;
23342 : }
23343 :
23344 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_in_get_privs(PyObject *obj, void *closure)
23345 : {
23346 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(obj);
23347 0 : PyObject *py_privs;
23348 0 : if (object->in.privs == NULL) {
23349 0 : Py_RETURN_NONE;
23350 : }
23351 0 : if (object->in.privs == NULL) {
23352 0 : py_privs = Py_None;
23353 0 : Py_INCREF(py_privs);
23354 : } else {
23355 0 : py_privs = pytalloc_reference_ex(&lsa_PrivilegeSet_Type, object->in.privs, object->in.privs);
23356 : }
23357 0 : return py_privs;
23358 : }
23359 :
23360 0 : static int py_lsa_RemovePrivilegesFromAccount_in_set_privs(PyObject *py_obj, PyObject *value, void *closure)
23361 : {
23362 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23363 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.privs));
23364 0 : if (value == NULL) {
23365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.privs");
23366 0 : return -1;
23367 : }
23368 0 : if (value == Py_None) {
23369 0 : object->in.privs = NULL;
23370 : } else {
23371 0 : object->in.privs = NULL;
23372 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, value, return -1;);
23373 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23374 0 : PyErr_NoMemory();
23375 0 : return -1;
23376 : }
23377 0 : object->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(value);
23378 : }
23379 0 : return 0;
23380 : }
23381 :
23382 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_get_result(PyObject *obj, void *closure)
23383 : {
23384 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(obj);
23385 0 : PyObject *py_result;
23386 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23387 0 : return py_result;
23388 : }
23389 :
23390 0 : static int py_lsa_RemovePrivilegesFromAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
23391 : {
23392 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23393 0 : if (value == NULL) {
23394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
23395 0 : return -1;
23396 : }
23397 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23398 0 : return 0;
23399 : }
23400 :
23401 : static PyGetSetDef py_lsa_RemovePrivilegesFromAccount_getsetters[] = {
23402 : {
23403 : .name = discard_const_p(char, "in_handle"),
23404 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_handle,
23405 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_handle,
23406 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23407 : },
23408 : {
23409 : .name = discard_const_p(char, "in_remove_all"),
23410 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_remove_all,
23411 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_remove_all,
23412 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
23413 : },
23414 : {
23415 : .name = discard_const_p(char, "in_privs"),
23416 : .get = py_lsa_RemovePrivilegesFromAccount_in_get_privs,
23417 : .set = py_lsa_RemovePrivilegesFromAccount_in_set_privs,
23418 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PrivilegeSet")
23419 : },
23420 : {
23421 : .name = discard_const_p(char, "result"),
23422 : .get = py_lsa_RemovePrivilegesFromAccount_get_result,
23423 : .set = py_lsa_RemovePrivilegesFromAccount_set_result,
23424 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23425 : },
23426 : { .name = NULL }
23427 : };
23428 :
23429 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23430 : {
23431 0 : PyObject *self = pytalloc_new(struct lsa_RemovePrivilegesFromAccount, type);
23432 0 : struct lsa_RemovePrivilegesFromAccount *_self = (struct lsa_RemovePrivilegesFromAccount *)pytalloc_get_ptr(self);
23433 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23434 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23435 0 : return self;
23436 : }
23437 :
23438 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23439 : {
23440 :
23441 :
23442 0 : return PyLong_FromLong(20);
23443 : }
23444 :
23445 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23446 : {
23447 0 : const struct ndr_interface_call *call = NULL;
23448 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23449 0 : PyObject *ret = NULL;
23450 0 : struct ndr_push *push = NULL;
23451 0 : DATA_BLOB blob;
23452 0 : enum ndr_err_code err;
23453 :
23454 0 : if (ndr_table_lsarpc.num_calls < 21) {
23455 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_pack");
23456 0 : return NULL;
23457 : }
23458 0 : call = &ndr_table_lsarpc.calls[20];
23459 :
23460 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23461 0 : if (push == NULL) {
23462 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23463 0 : return NULL;
23464 : }
23465 :
23466 0 : push->flags |= ndr_push_flags;
23467 :
23468 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23469 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23470 0 : TALLOC_FREE(push);
23471 0 : PyErr_SetNdrError(err);
23472 0 : return NULL;
23473 : }
23474 0 : blob = ndr_push_blob(push);
23475 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23476 0 : TALLOC_FREE(push);
23477 0 : return ret;
23478 : }
23479 :
23480 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23481 : {
23482 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23483 0 : PyObject *bigendian_obj = NULL;
23484 0 : PyObject *ndr64_obj = NULL;
23485 0 : libndr_flags ndr_push_flags = 0;
23486 :
23487 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23488 : discard_const_p(char *, kwnames),
23489 : &bigendian_obj,
23490 : &ndr64_obj)) {
23491 0 : return NULL;
23492 : }
23493 :
23494 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23495 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23496 : }
23497 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23498 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23499 : }
23500 :
23501 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23502 : }
23503 :
23504 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23505 : {
23506 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23507 0 : PyObject *bigendian_obj = NULL;
23508 0 : PyObject *ndr64_obj = NULL;
23509 0 : libndr_flags ndr_push_flags = 0;
23510 :
23511 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23512 : discard_const_p(char *, kwnames),
23513 : &bigendian_obj,
23514 : &ndr64_obj)) {
23515 0 : return NULL;
23516 : }
23517 :
23518 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23519 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23520 : }
23521 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23522 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23523 : }
23524 :
23525 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23526 : }
23527 :
23528 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)
23529 : {
23530 0 : const struct ndr_interface_call *call = NULL;
23531 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23532 0 : struct ndr_pull *pull = NULL;
23533 0 : enum ndr_err_code err;
23534 :
23535 0 : if (ndr_table_lsarpc.num_calls < 21) {
23536 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_unpack");
23537 0 : return NULL;
23538 : }
23539 0 : call = &ndr_table_lsarpc.calls[20];
23540 :
23541 0 : pull = ndr_pull_init_blob(blob, object);
23542 0 : if (pull == NULL) {
23543 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23544 0 : return NULL;
23545 : }
23546 :
23547 0 : pull->flags |= ndr_pull_flags;
23548 :
23549 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23550 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23551 0 : TALLOC_FREE(pull);
23552 0 : PyErr_SetNdrError(err);
23553 0 : return NULL;
23554 : }
23555 0 : if (!allow_remaining) {
23556 0 : uint32_t highest_ofs;
23557 :
23558 0 : if (pull->offset > pull->relative_highest_offset) {
23559 0 : highest_ofs = pull->offset;
23560 : } else {
23561 0 : highest_ofs = pull->relative_highest_offset;
23562 : }
23563 0 : if (highest_ofs < pull->data_size) {
23564 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23565 : "not all bytes consumed ofs[%u] size[%u]",
23566 : highest_ofs, pull->data_size);
23567 0 : TALLOC_FREE(pull);
23568 0 : PyErr_SetNdrError(err);
23569 0 : return NULL;
23570 : }
23571 : }
23572 :
23573 0 : TALLOC_FREE(pull);
23574 0 : Py_RETURN_NONE;
23575 : }
23576 :
23577 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23578 : {
23579 0 : DATA_BLOB blob;
23580 0 : Py_ssize_t blob_length = 0;
23581 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23582 0 : PyObject *bigendian_obj = NULL;
23583 0 : PyObject *ndr64_obj = NULL;
23584 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23585 0 : PyObject *allow_remaining_obj = NULL;
23586 0 : bool allow_remaining = false;
23587 :
23588 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23589 : discard_const_p(char *, kwnames),
23590 : &blob.data, &blob_length,
23591 : &bigendian_obj,
23592 : &ndr64_obj,
23593 : &allow_remaining_obj)) {
23594 0 : return NULL;
23595 : }
23596 0 : blob.length = blob_length;
23597 :
23598 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23599 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23600 : }
23601 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23602 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23603 : }
23604 :
23605 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23606 0 : allow_remaining = true;
23607 : }
23608 :
23609 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23610 : }
23611 :
23612 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23613 : {
23614 0 : DATA_BLOB blob;
23615 0 : Py_ssize_t blob_length = 0;
23616 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23617 0 : PyObject *bigendian_obj = NULL;
23618 0 : PyObject *ndr64_obj = NULL;
23619 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23620 0 : PyObject *allow_remaining_obj = NULL;
23621 0 : bool allow_remaining = false;
23622 :
23623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23624 : discard_const_p(char *, kwnames),
23625 : &blob.data, &blob_length,
23626 : &bigendian_obj,
23627 : &ndr64_obj,
23628 : &allow_remaining_obj)) {
23629 0 : return NULL;
23630 : }
23631 0 : blob.length = blob_length;
23632 :
23633 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23634 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23635 : }
23636 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23637 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23638 : }
23639 :
23640 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23641 0 : allow_remaining = true;
23642 : }
23643 :
23644 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23645 : }
23646 :
23647 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23648 : {
23649 0 : const struct ndr_interface_call *call = NULL;
23650 0 : struct lsa_RemovePrivilegesFromAccount *object = pytalloc_get_ptr(py_obj);
23651 0 : PyObject *ret;
23652 0 : char *retstr;
23653 :
23654 0 : if (ndr_table_lsarpc.num_calls < 21) {
23655 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemovePrivilegesFromAccount_ndr_print");
23656 0 : return NULL;
23657 : }
23658 0 : call = &ndr_table_lsarpc.calls[20];
23659 :
23660 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23661 0 : ret = PyUnicode_FromString(retstr);
23662 0 : TALLOC_FREE(retstr);
23663 :
23664 0 : return ret;
23665 : }
23666 :
23667 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23668 : {
23669 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_in", NDR_IN);
23670 : }
23671 :
23672 0 : static PyObject *py_lsa_RemovePrivilegesFromAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23673 : {
23674 0 : return py_lsa_RemovePrivilegesFromAccount_ndr_print(py_obj, "lsa_RemovePrivilegesFromAccount_out", NDR_OUT);
23675 : }
23676 :
23677 : static PyMethodDef py_lsa_RemovePrivilegesFromAccount_methods[] = {
23678 : { "opnum", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
23679 : "lsa.RemovePrivilegesFromAccount.opnum() -> 20 (0x14) " },
23680 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23681 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23682 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23683 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23684 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23685 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23686 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemovePrivilegesFromAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23687 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23688 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23689 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemovePrivilegesFromAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23690 : { NULL, NULL, 0, NULL }
23691 : };
23692 :
23693 :
23694 : static PyTypeObject lsa_RemovePrivilegesFromAccount_Type = {
23695 : PyVarObject_HEAD_INIT(NULL, 0)
23696 : .tp_name = "lsa.RemovePrivilegesFromAccount",
23697 : .tp_getset = py_lsa_RemovePrivilegesFromAccount_getsetters,
23698 : .tp_methods = py_lsa_RemovePrivilegesFromAccount_methods,
23699 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23700 : .tp_new = py_lsa_RemovePrivilegesFromAccount_new,
23701 : };
23702 :
23703 0 : static bool pack_py_lsa_RemovePrivilegesFromAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemovePrivilegesFromAccount *r)
23704 : {
23705 0 : PyObject *py_handle;
23706 0 : PyObject *py_remove_all;
23707 0 : PyObject *py_privs;
23708 0 : const char *kwnames[] = {
23709 : "handle", "remove_all", "privs", NULL
23710 : };
23711 :
23712 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RemovePrivilegesFromAccount", discard_const_p(char *, kwnames), &py_handle, &py_remove_all, &py_privs)) {
23713 0 : return false;
23714 : }
23715 :
23716 0 : if (py_handle == NULL) {
23717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
23718 0 : return false;
23719 : }
23720 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
23721 0 : if (r->in.handle == NULL) {
23722 0 : PyErr_NoMemory();
23723 0 : return false;
23724 : }
23725 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
23726 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
23727 0 : PyErr_NoMemory();
23728 0 : return false;
23729 : }
23730 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
23731 0 : if (py_remove_all == NULL) {
23732 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.remove_all");
23733 0 : return false;
23734 : }
23735 : {
23736 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
23737 0 : if (PyLong_Check(py_remove_all)) {
23738 0 : unsigned long long test_var;
23739 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
23740 0 : if (PyErr_Occurred() != NULL) {
23741 0 : return false;
23742 : }
23743 0 : if (test_var > uint_max) {
23744 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23745 : PyLong_Type.tp_name, uint_max, test_var);
23746 0 : return false;
23747 : }
23748 0 : r->in.remove_all = test_var;
23749 : } else {
23750 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23751 : PyLong_Type.tp_name);
23752 0 : return false;
23753 : }
23754 : }
23755 0 : if (py_privs == NULL) {
23756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.privs");
23757 0 : return false;
23758 : }
23759 0 : if (py_privs == Py_None) {
23760 0 : r->in.privs = NULL;
23761 : } else {
23762 0 : r->in.privs = NULL;
23763 0 : PY_CHECK_TYPE(&lsa_PrivilegeSet_Type, py_privs, return false;);
23764 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_privs)) == NULL) {
23765 0 : PyErr_NoMemory();
23766 0 : return false;
23767 : }
23768 0 : r->in.privs = (struct lsa_PrivilegeSet *)pytalloc_get_ptr(py_privs);
23769 : }
23770 0 : return true;
23771 : }
23772 :
23773 0 : static PyObject *unpack_py_lsa_RemovePrivilegesFromAccount_args_out(struct lsa_RemovePrivilegesFromAccount *r)
23774 : {
23775 0 : PyObject *result;
23776 0 : result = Py_None;
23777 0 : Py_INCREF(result);
23778 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
23779 0 : PyErr_SetNTSTATUS(r->out.result);
23780 0 : return NULL;
23781 : }
23782 :
23783 0 : return result;
23784 : }
23785 :
23786 :
23787 0 : static PyObject *py_lsa_GetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
23788 : {
23789 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(obj);
23790 0 : PyObject *py_handle;
23791 0 : if (object->in.handle == NULL) {
23792 0 : Py_RETURN_NONE;
23793 : }
23794 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
23795 0 : return py_handle;
23796 : }
23797 :
23798 0 : static int py_lsa_GetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
23799 : {
23800 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
23801 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
23802 0 : if (value == NULL) {
23803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
23804 0 : return -1;
23805 : }
23806 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
23807 0 : if (object->in.handle == NULL) {
23808 0 : PyErr_NoMemory();
23809 0 : return -1;
23810 : }
23811 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23812 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23813 0 : PyErr_NoMemory();
23814 0 : return -1;
23815 : }
23816 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
23817 0 : return 0;
23818 : }
23819 :
23820 0 : static PyObject *py_lsa_GetSystemAccessAccount_out_get_access_mask(PyObject *obj, void *closure)
23821 : {
23822 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(obj);
23823 0 : PyObject *py_access_mask;
23824 0 : if (object->out.access_mask == NULL) {
23825 0 : Py_RETURN_NONE;
23826 : }
23827 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.access_mask));
23828 0 : return py_access_mask;
23829 : }
23830 :
23831 0 : static int py_lsa_GetSystemAccessAccount_out_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
23832 : {
23833 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
23834 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.access_mask));
23835 0 : if (value == NULL) {
23836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.access_mask");
23837 0 : return -1;
23838 : }
23839 0 : object->out.access_mask = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.access_mask);
23840 0 : if (object->out.access_mask == NULL) {
23841 0 : PyErr_NoMemory();
23842 0 : return -1;
23843 : }
23844 : {
23845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.access_mask));
23846 0 : if (PyLong_Check(value)) {
23847 0 : unsigned long long test_var;
23848 0 : test_var = PyLong_AsUnsignedLongLong(value);
23849 0 : if (PyErr_Occurred() != NULL) {
23850 0 : return -1;
23851 : }
23852 0 : if (test_var > uint_max) {
23853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23854 : PyLong_Type.tp_name, uint_max, test_var);
23855 0 : return -1;
23856 : }
23857 0 : *object->out.access_mask = test_var;
23858 : } else {
23859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23860 : PyLong_Type.tp_name);
23861 0 : return -1;
23862 : }
23863 : }
23864 0 : return 0;
23865 : }
23866 :
23867 0 : static PyObject *py_lsa_GetSystemAccessAccount_get_result(PyObject *obj, void *closure)
23868 : {
23869 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(obj);
23870 0 : PyObject *py_result;
23871 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23872 0 : return py_result;
23873 : }
23874 :
23875 0 : static int py_lsa_GetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
23876 : {
23877 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
23878 0 : if (value == NULL) {
23879 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
23880 0 : return -1;
23881 : }
23882 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23883 0 : return 0;
23884 : }
23885 :
23886 : static PyGetSetDef py_lsa_GetSystemAccessAccount_getsetters[] = {
23887 : {
23888 : .name = discard_const_p(char, "in_handle"),
23889 : .get = py_lsa_GetSystemAccessAccount_in_get_handle,
23890 : .set = py_lsa_GetSystemAccessAccount_in_set_handle,
23891 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23892 : },
23893 : {
23894 : .name = discard_const_p(char, "out_access_mask"),
23895 : .get = py_lsa_GetSystemAccessAccount_out_get_access_mask,
23896 : .set = py_lsa_GetSystemAccessAccount_out_set_access_mask,
23897 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
23898 : },
23899 : {
23900 : .name = discard_const_p(char, "result"),
23901 : .get = py_lsa_GetSystemAccessAccount_get_result,
23902 : .set = py_lsa_GetSystemAccessAccount_set_result,
23903 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23904 : },
23905 : { .name = NULL }
23906 : };
23907 :
23908 0 : static PyObject *py_lsa_GetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23909 : {
23910 0 : PyObject *self = pytalloc_new(struct lsa_GetSystemAccessAccount, type);
23911 0 : struct lsa_GetSystemAccessAccount *_self = (struct lsa_GetSystemAccessAccount *)pytalloc_get_ptr(self);
23912 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23913 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
23914 0 : _self->out.access_mask = talloc_zero(mem_ctx, uint32_t);
23915 0 : return self;
23916 : }
23917 :
23918 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23919 : {
23920 :
23921 :
23922 0 : return PyLong_FromLong(23);
23923 : }
23924 :
23925 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23926 : {
23927 0 : const struct ndr_interface_call *call = NULL;
23928 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
23929 0 : PyObject *ret = NULL;
23930 0 : struct ndr_push *push = NULL;
23931 0 : DATA_BLOB blob;
23932 0 : enum ndr_err_code err;
23933 :
23934 0 : if (ndr_table_lsarpc.num_calls < 24) {
23935 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_pack");
23936 0 : return NULL;
23937 : }
23938 0 : call = &ndr_table_lsarpc.calls[23];
23939 :
23940 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23941 0 : if (push == NULL) {
23942 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23943 0 : return NULL;
23944 : }
23945 :
23946 0 : push->flags |= ndr_push_flags;
23947 :
23948 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23949 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23950 0 : TALLOC_FREE(push);
23951 0 : PyErr_SetNdrError(err);
23952 0 : return NULL;
23953 : }
23954 0 : blob = ndr_push_blob(push);
23955 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23956 0 : TALLOC_FREE(push);
23957 0 : return ret;
23958 : }
23959 :
23960 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23961 : {
23962 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23963 0 : PyObject *bigendian_obj = NULL;
23964 0 : PyObject *ndr64_obj = NULL;
23965 0 : libndr_flags ndr_push_flags = 0;
23966 :
23967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23968 : discard_const_p(char *, kwnames),
23969 : &bigendian_obj,
23970 : &ndr64_obj)) {
23971 0 : return NULL;
23972 : }
23973 :
23974 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23975 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23976 : }
23977 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23978 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23979 : }
23980 :
23981 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23982 : }
23983 :
23984 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23985 : {
23986 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23987 0 : PyObject *bigendian_obj = NULL;
23988 0 : PyObject *ndr64_obj = NULL;
23989 0 : libndr_flags ndr_push_flags = 0;
23990 :
23991 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23992 : discard_const_p(char *, kwnames),
23993 : &bigendian_obj,
23994 : &ndr64_obj)) {
23995 0 : return NULL;
23996 : }
23997 :
23998 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23999 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24000 : }
24001 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24002 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24003 : }
24004 :
24005 0 : return py_lsa_GetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24006 : }
24007 :
24008 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)
24009 : {
24010 0 : const struct ndr_interface_call *call = NULL;
24011 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24012 0 : struct ndr_pull *pull = NULL;
24013 0 : enum ndr_err_code err;
24014 :
24015 0 : if (ndr_table_lsarpc.num_calls < 24) {
24016 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_unpack");
24017 0 : return NULL;
24018 : }
24019 0 : call = &ndr_table_lsarpc.calls[23];
24020 :
24021 0 : pull = ndr_pull_init_blob(blob, object);
24022 0 : if (pull == NULL) {
24023 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24024 0 : return NULL;
24025 : }
24026 :
24027 0 : pull->flags |= ndr_pull_flags;
24028 :
24029 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24030 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24031 0 : TALLOC_FREE(pull);
24032 0 : PyErr_SetNdrError(err);
24033 0 : return NULL;
24034 : }
24035 0 : if (!allow_remaining) {
24036 0 : uint32_t highest_ofs;
24037 :
24038 0 : if (pull->offset > pull->relative_highest_offset) {
24039 0 : highest_ofs = pull->offset;
24040 : } else {
24041 0 : highest_ofs = pull->relative_highest_offset;
24042 : }
24043 0 : if (highest_ofs < pull->data_size) {
24044 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24045 : "not all bytes consumed ofs[%u] size[%u]",
24046 : highest_ofs, pull->data_size);
24047 0 : TALLOC_FREE(pull);
24048 0 : PyErr_SetNdrError(err);
24049 0 : return NULL;
24050 : }
24051 : }
24052 :
24053 0 : TALLOC_FREE(pull);
24054 0 : Py_RETURN_NONE;
24055 : }
24056 :
24057 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24058 : {
24059 0 : DATA_BLOB blob;
24060 0 : Py_ssize_t blob_length = 0;
24061 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24062 0 : PyObject *bigendian_obj = NULL;
24063 0 : PyObject *ndr64_obj = NULL;
24064 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24065 0 : PyObject *allow_remaining_obj = NULL;
24066 0 : bool allow_remaining = false;
24067 :
24068 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24069 : discard_const_p(char *, kwnames),
24070 : &blob.data, &blob_length,
24071 : &bigendian_obj,
24072 : &ndr64_obj,
24073 : &allow_remaining_obj)) {
24074 0 : return NULL;
24075 : }
24076 0 : blob.length = blob_length;
24077 :
24078 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24079 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24080 : }
24081 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24082 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24083 : }
24084 :
24085 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24086 0 : allow_remaining = true;
24087 : }
24088 :
24089 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24090 : }
24091 :
24092 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24093 : {
24094 0 : DATA_BLOB blob;
24095 0 : Py_ssize_t blob_length = 0;
24096 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24097 0 : PyObject *bigendian_obj = NULL;
24098 0 : PyObject *ndr64_obj = NULL;
24099 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24100 0 : PyObject *allow_remaining_obj = NULL;
24101 0 : bool allow_remaining = false;
24102 :
24103 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24104 : discard_const_p(char *, kwnames),
24105 : &blob.data, &blob_length,
24106 : &bigendian_obj,
24107 : &ndr64_obj,
24108 : &allow_remaining_obj)) {
24109 0 : return NULL;
24110 : }
24111 0 : blob.length = blob_length;
24112 :
24113 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24114 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24115 : }
24116 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24117 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24118 : }
24119 :
24120 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24121 0 : allow_remaining = true;
24122 : }
24123 :
24124 0 : return py_lsa_GetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24125 : }
24126 :
24127 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24128 : {
24129 0 : const struct ndr_interface_call *call = NULL;
24130 0 : struct lsa_GetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24131 0 : PyObject *ret;
24132 0 : char *retstr;
24133 :
24134 0 : if (ndr_table_lsarpc.num_calls < 24) {
24135 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetSystemAccessAccount_ndr_print");
24136 0 : return NULL;
24137 : }
24138 0 : call = &ndr_table_lsarpc.calls[23];
24139 :
24140 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24141 0 : ret = PyUnicode_FromString(retstr);
24142 0 : TALLOC_FREE(retstr);
24143 :
24144 0 : return ret;
24145 : }
24146 :
24147 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24148 : {
24149 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_in", NDR_IN);
24150 : }
24151 :
24152 0 : static PyObject *py_lsa_GetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24153 : {
24154 0 : return py_lsa_GetSystemAccessAccount_ndr_print(py_obj, "lsa_GetSystemAccessAccount_out", NDR_OUT);
24155 : }
24156 :
24157 : static PyMethodDef py_lsa_GetSystemAccessAccount_methods[] = {
24158 : { "opnum", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
24159 : "lsa.GetSystemAccessAccount.opnum() -> 23 (0x17) " },
24160 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24161 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24162 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24163 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24164 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24165 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24166 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24167 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24168 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24169 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24170 : { NULL, NULL, 0, NULL }
24171 : };
24172 :
24173 :
24174 : static PyTypeObject lsa_GetSystemAccessAccount_Type = {
24175 : PyVarObject_HEAD_INIT(NULL, 0)
24176 : .tp_name = "lsa.GetSystemAccessAccount",
24177 : .tp_getset = py_lsa_GetSystemAccessAccount_getsetters,
24178 : .tp_methods = py_lsa_GetSystemAccessAccount_methods,
24179 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24180 : .tp_new = py_lsa_GetSystemAccessAccount_new,
24181 : };
24182 :
24183 0 : static bool pack_py_lsa_GetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetSystemAccessAccount *r)
24184 : {
24185 0 : PyObject *py_handle;
24186 0 : const char *kwnames[] = {
24187 : "handle", NULL
24188 : };
24189 :
24190 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_GetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle)) {
24191 0 : return false;
24192 : }
24193 :
24194 0 : if (py_handle == NULL) {
24195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
24196 0 : return false;
24197 : }
24198 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
24199 0 : if (r->in.handle == NULL) {
24200 0 : PyErr_NoMemory();
24201 0 : return false;
24202 : }
24203 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
24204 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
24205 0 : PyErr_NoMemory();
24206 0 : return false;
24207 : }
24208 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
24209 0 : return true;
24210 : }
24211 :
24212 0 : static PyObject *unpack_py_lsa_GetSystemAccessAccount_args_out(struct lsa_GetSystemAccessAccount *r)
24213 : {
24214 0 : PyObject *result;
24215 0 : PyObject *py_access_mask;
24216 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.access_mask));
24217 0 : result = py_access_mask;
24218 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
24219 0 : PyErr_SetNTSTATUS(r->out.result);
24220 0 : return NULL;
24221 : }
24222 :
24223 0 : return result;
24224 : }
24225 :
24226 :
24227 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_handle(PyObject *obj, void *closure)
24228 : {
24229 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(obj);
24230 0 : PyObject *py_handle;
24231 0 : if (object->in.handle == NULL) {
24232 0 : Py_RETURN_NONE;
24233 : }
24234 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
24235 0 : return py_handle;
24236 : }
24237 :
24238 0 : static int py_lsa_SetSystemAccessAccount_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
24239 : {
24240 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24241 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
24242 0 : if (value == NULL) {
24243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
24244 0 : return -1;
24245 : }
24246 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
24247 0 : if (object->in.handle == NULL) {
24248 0 : PyErr_NoMemory();
24249 0 : return -1;
24250 : }
24251 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24252 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24253 0 : PyErr_NoMemory();
24254 0 : return -1;
24255 : }
24256 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
24257 0 : return 0;
24258 : }
24259 :
24260 0 : static PyObject *py_lsa_SetSystemAccessAccount_in_get_access_mask(PyObject *obj, void *closure)
24261 : {
24262 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(obj);
24263 0 : PyObject *py_access_mask;
24264 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
24265 0 : return py_access_mask;
24266 : }
24267 :
24268 0 : static int py_lsa_SetSystemAccessAccount_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
24269 : {
24270 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24271 0 : if (value == NULL) {
24272 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
24273 0 : return -1;
24274 : }
24275 : {
24276 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
24277 0 : if (PyLong_Check(value)) {
24278 0 : unsigned long long test_var;
24279 0 : test_var = PyLong_AsUnsignedLongLong(value);
24280 0 : if (PyErr_Occurred() != NULL) {
24281 0 : return -1;
24282 : }
24283 0 : if (test_var > uint_max) {
24284 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24285 : PyLong_Type.tp_name, uint_max, test_var);
24286 0 : return -1;
24287 : }
24288 0 : object->in.access_mask = test_var;
24289 : } else {
24290 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24291 : PyLong_Type.tp_name);
24292 0 : return -1;
24293 : }
24294 : }
24295 0 : return 0;
24296 : }
24297 :
24298 0 : static PyObject *py_lsa_SetSystemAccessAccount_get_result(PyObject *obj, void *closure)
24299 : {
24300 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(obj);
24301 0 : PyObject *py_result;
24302 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24303 0 : return py_result;
24304 : }
24305 :
24306 0 : static int py_lsa_SetSystemAccessAccount_set_result(PyObject *py_obj, PyObject *value, void *closure)
24307 : {
24308 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24309 0 : if (value == NULL) {
24310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
24311 0 : return -1;
24312 : }
24313 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24314 0 : return 0;
24315 : }
24316 :
24317 : static PyGetSetDef py_lsa_SetSystemAccessAccount_getsetters[] = {
24318 : {
24319 : .name = discard_const_p(char, "in_handle"),
24320 : .get = py_lsa_SetSystemAccessAccount_in_get_handle,
24321 : .set = py_lsa_SetSystemAccessAccount_in_set_handle,
24322 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24323 : },
24324 : {
24325 : .name = discard_const_p(char, "in_access_mask"),
24326 : .get = py_lsa_SetSystemAccessAccount_in_get_access_mask,
24327 : .set = py_lsa_SetSystemAccessAccount_in_set_access_mask,
24328 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AccountAccessMask")
24329 : },
24330 : {
24331 : .name = discard_const_p(char, "result"),
24332 : .get = py_lsa_SetSystemAccessAccount_get_result,
24333 : .set = py_lsa_SetSystemAccessAccount_set_result,
24334 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24335 : },
24336 : { .name = NULL }
24337 : };
24338 :
24339 0 : static PyObject *py_lsa_SetSystemAccessAccount_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24340 : {
24341 0 : PyObject *self = pytalloc_new(struct lsa_SetSystemAccessAccount, type);
24342 0 : struct lsa_SetSystemAccessAccount *_self = (struct lsa_SetSystemAccessAccount *)pytalloc_get_ptr(self);
24343 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24344 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
24345 0 : return self;
24346 : }
24347 :
24348 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24349 : {
24350 :
24351 :
24352 0 : return PyLong_FromLong(24);
24353 : }
24354 :
24355 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24356 : {
24357 0 : const struct ndr_interface_call *call = NULL;
24358 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24359 0 : PyObject *ret = NULL;
24360 0 : struct ndr_push *push = NULL;
24361 0 : DATA_BLOB blob;
24362 0 : enum ndr_err_code err;
24363 :
24364 0 : if (ndr_table_lsarpc.num_calls < 25) {
24365 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_pack");
24366 0 : return NULL;
24367 : }
24368 0 : call = &ndr_table_lsarpc.calls[24];
24369 :
24370 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24371 0 : if (push == NULL) {
24372 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24373 0 : return NULL;
24374 : }
24375 :
24376 0 : push->flags |= ndr_push_flags;
24377 :
24378 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24379 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24380 0 : TALLOC_FREE(push);
24381 0 : PyErr_SetNdrError(err);
24382 0 : return NULL;
24383 : }
24384 0 : blob = ndr_push_blob(push);
24385 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24386 0 : TALLOC_FREE(push);
24387 0 : return ret;
24388 : }
24389 :
24390 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24391 : {
24392 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24393 0 : PyObject *bigendian_obj = NULL;
24394 0 : PyObject *ndr64_obj = NULL;
24395 0 : libndr_flags ndr_push_flags = 0;
24396 :
24397 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24398 : discard_const_p(char *, kwnames),
24399 : &bigendian_obj,
24400 : &ndr64_obj)) {
24401 0 : return NULL;
24402 : }
24403 :
24404 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24405 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24406 : }
24407 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24408 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24409 : }
24410 :
24411 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24412 : }
24413 :
24414 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24415 : {
24416 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24417 0 : PyObject *bigendian_obj = NULL;
24418 0 : PyObject *ndr64_obj = NULL;
24419 0 : libndr_flags ndr_push_flags = 0;
24420 :
24421 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24422 : discard_const_p(char *, kwnames),
24423 : &bigendian_obj,
24424 : &ndr64_obj)) {
24425 0 : return NULL;
24426 : }
24427 :
24428 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24429 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24430 : }
24431 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24432 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24433 : }
24434 :
24435 0 : return py_lsa_SetSystemAccessAccount_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24436 : }
24437 :
24438 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)
24439 : {
24440 0 : const struct ndr_interface_call *call = NULL;
24441 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24442 0 : struct ndr_pull *pull = NULL;
24443 0 : enum ndr_err_code err;
24444 :
24445 0 : if (ndr_table_lsarpc.num_calls < 25) {
24446 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_unpack");
24447 0 : return NULL;
24448 : }
24449 0 : call = &ndr_table_lsarpc.calls[24];
24450 :
24451 0 : pull = ndr_pull_init_blob(blob, object);
24452 0 : if (pull == NULL) {
24453 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24454 0 : return NULL;
24455 : }
24456 :
24457 0 : pull->flags |= ndr_pull_flags;
24458 :
24459 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24460 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24461 0 : TALLOC_FREE(pull);
24462 0 : PyErr_SetNdrError(err);
24463 0 : return NULL;
24464 : }
24465 0 : if (!allow_remaining) {
24466 0 : uint32_t highest_ofs;
24467 :
24468 0 : if (pull->offset > pull->relative_highest_offset) {
24469 0 : highest_ofs = pull->offset;
24470 : } else {
24471 0 : highest_ofs = pull->relative_highest_offset;
24472 : }
24473 0 : if (highest_ofs < pull->data_size) {
24474 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24475 : "not all bytes consumed ofs[%u] size[%u]",
24476 : highest_ofs, pull->data_size);
24477 0 : TALLOC_FREE(pull);
24478 0 : PyErr_SetNdrError(err);
24479 0 : return NULL;
24480 : }
24481 : }
24482 :
24483 0 : TALLOC_FREE(pull);
24484 0 : Py_RETURN_NONE;
24485 : }
24486 :
24487 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24488 : {
24489 0 : DATA_BLOB blob;
24490 0 : Py_ssize_t blob_length = 0;
24491 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24492 0 : PyObject *bigendian_obj = NULL;
24493 0 : PyObject *ndr64_obj = NULL;
24494 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24495 0 : PyObject *allow_remaining_obj = NULL;
24496 0 : bool allow_remaining = false;
24497 :
24498 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24499 : discard_const_p(char *, kwnames),
24500 : &blob.data, &blob_length,
24501 : &bigendian_obj,
24502 : &ndr64_obj,
24503 : &allow_remaining_obj)) {
24504 0 : return NULL;
24505 : }
24506 0 : blob.length = blob_length;
24507 :
24508 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24509 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24510 : }
24511 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24512 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24513 : }
24514 :
24515 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24516 0 : allow_remaining = true;
24517 : }
24518 :
24519 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24520 : }
24521 :
24522 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24523 : {
24524 0 : DATA_BLOB blob;
24525 0 : Py_ssize_t blob_length = 0;
24526 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24527 0 : PyObject *bigendian_obj = NULL;
24528 0 : PyObject *ndr64_obj = NULL;
24529 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24530 0 : PyObject *allow_remaining_obj = NULL;
24531 0 : bool allow_remaining = false;
24532 :
24533 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24534 : discard_const_p(char *, kwnames),
24535 : &blob.data, &blob_length,
24536 : &bigendian_obj,
24537 : &ndr64_obj,
24538 : &allow_remaining_obj)) {
24539 0 : return NULL;
24540 : }
24541 0 : blob.length = blob_length;
24542 :
24543 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24544 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24545 : }
24546 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24547 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24548 : }
24549 :
24550 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24551 0 : allow_remaining = true;
24552 : }
24553 :
24554 0 : return py_lsa_SetSystemAccessAccount_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24555 : }
24556 :
24557 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24558 : {
24559 0 : const struct ndr_interface_call *call = NULL;
24560 0 : struct lsa_SetSystemAccessAccount *object = pytalloc_get_ptr(py_obj);
24561 0 : PyObject *ret;
24562 0 : char *retstr;
24563 :
24564 0 : if (ndr_table_lsarpc.num_calls < 25) {
24565 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSystemAccessAccount_ndr_print");
24566 0 : return NULL;
24567 : }
24568 0 : call = &ndr_table_lsarpc.calls[24];
24569 :
24570 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24571 0 : ret = PyUnicode_FromString(retstr);
24572 0 : TALLOC_FREE(retstr);
24573 :
24574 0 : return ret;
24575 : }
24576 :
24577 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24578 : {
24579 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_in", NDR_IN);
24580 : }
24581 :
24582 0 : static PyObject *py_lsa_SetSystemAccessAccount_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24583 : {
24584 0 : return py_lsa_SetSystemAccessAccount_ndr_print(py_obj, "lsa_SetSystemAccessAccount_out", NDR_OUT);
24585 : }
24586 :
24587 : static PyMethodDef py_lsa_SetSystemAccessAccount_methods[] = {
24588 : { "opnum", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_opnum, METH_NOARGS|METH_CLASS,
24589 : "lsa.SetSystemAccessAccount.opnum() -> 24 (0x18) " },
24590 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24591 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24592 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24593 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24594 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24595 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24596 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSystemAccessAccount_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24597 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24598 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24599 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSystemAccessAccount_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24600 : { NULL, NULL, 0, NULL }
24601 : };
24602 :
24603 :
24604 : static PyTypeObject lsa_SetSystemAccessAccount_Type = {
24605 : PyVarObject_HEAD_INIT(NULL, 0)
24606 : .tp_name = "lsa.SetSystemAccessAccount",
24607 : .tp_getset = py_lsa_SetSystemAccessAccount_getsetters,
24608 : .tp_methods = py_lsa_SetSystemAccessAccount_methods,
24609 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24610 : .tp_new = py_lsa_SetSystemAccessAccount_new,
24611 : };
24612 :
24613 0 : static bool pack_py_lsa_SetSystemAccessAccount_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSystemAccessAccount *r)
24614 : {
24615 0 : PyObject *py_handle;
24616 0 : PyObject *py_access_mask;
24617 0 : const char *kwnames[] = {
24618 : "handle", "access_mask", NULL
24619 : };
24620 :
24621 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_SetSystemAccessAccount", discard_const_p(char *, kwnames), &py_handle, &py_access_mask)) {
24622 0 : return false;
24623 : }
24624 :
24625 0 : if (py_handle == NULL) {
24626 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
24627 0 : return false;
24628 : }
24629 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
24630 0 : if (r->in.handle == NULL) {
24631 0 : PyErr_NoMemory();
24632 0 : return false;
24633 : }
24634 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
24635 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
24636 0 : PyErr_NoMemory();
24637 0 : return false;
24638 : }
24639 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
24640 0 : if (py_access_mask == NULL) {
24641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
24642 0 : return false;
24643 : }
24644 : {
24645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
24646 0 : if (PyLong_Check(py_access_mask)) {
24647 0 : unsigned long long test_var;
24648 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
24649 0 : if (PyErr_Occurred() != NULL) {
24650 0 : return false;
24651 : }
24652 0 : if (test_var > uint_max) {
24653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24654 : PyLong_Type.tp_name, uint_max, test_var);
24655 0 : return false;
24656 : }
24657 0 : r->in.access_mask = test_var;
24658 : } else {
24659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24660 : PyLong_Type.tp_name);
24661 0 : return false;
24662 : }
24663 : }
24664 0 : return true;
24665 : }
24666 :
24667 0 : static PyObject *unpack_py_lsa_SetSystemAccessAccount_args_out(struct lsa_SetSystemAccessAccount *r)
24668 : {
24669 0 : PyObject *result;
24670 0 : result = Py_None;
24671 0 : Py_INCREF(result);
24672 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
24673 0 : PyErr_SetNTSTATUS(r->out.result);
24674 0 : return NULL;
24675 : }
24676 :
24677 0 : return result;
24678 : }
24679 :
24680 :
24681 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_handle(PyObject *obj, void *closure)
24682 : {
24683 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(obj);
24684 0 : PyObject *py_handle;
24685 0 : if (object->in.handle == NULL) {
24686 0 : Py_RETURN_NONE;
24687 : }
24688 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
24689 0 : return py_handle;
24690 : }
24691 :
24692 0 : static int py_lsa_OpenTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
24693 : {
24694 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24695 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
24696 0 : if (value == NULL) {
24697 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
24698 0 : return -1;
24699 : }
24700 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
24701 0 : if (object->in.handle == NULL) {
24702 0 : PyErr_NoMemory();
24703 0 : return -1;
24704 : }
24705 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24706 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24707 0 : PyErr_NoMemory();
24708 0 : return -1;
24709 : }
24710 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
24711 0 : return 0;
24712 : }
24713 :
24714 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_sid(PyObject *obj, void *closure)
24715 : {
24716 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(obj);
24717 0 : PyObject *py_sid;
24718 0 : if (object->in.sid == NULL) {
24719 0 : Py_RETURN_NONE;
24720 : }
24721 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
24722 0 : return py_sid;
24723 : }
24724 :
24725 0 : static int py_lsa_OpenTrustedDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
24726 : {
24727 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24728 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
24729 0 : if (value == NULL) {
24730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
24731 0 : return -1;
24732 : }
24733 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
24734 0 : if (object->in.sid == NULL) {
24735 0 : PyErr_NoMemory();
24736 0 : return -1;
24737 : }
24738 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
24739 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24740 0 : PyErr_NoMemory();
24741 0 : return -1;
24742 : }
24743 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
24744 0 : return 0;
24745 : }
24746 :
24747 0 : static PyObject *py_lsa_OpenTrustedDomain_in_get_access_mask(PyObject *obj, void *closure)
24748 : {
24749 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(obj);
24750 0 : PyObject *py_access_mask;
24751 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
24752 0 : return py_access_mask;
24753 : }
24754 :
24755 0 : static int py_lsa_OpenTrustedDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
24756 : {
24757 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24758 0 : if (value == NULL) {
24759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
24760 0 : return -1;
24761 : }
24762 : {
24763 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
24764 0 : if (PyLong_Check(value)) {
24765 0 : unsigned long long test_var;
24766 0 : test_var = PyLong_AsUnsignedLongLong(value);
24767 0 : if (PyErr_Occurred() != NULL) {
24768 0 : return -1;
24769 : }
24770 0 : if (test_var > uint_max) {
24771 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24772 : PyLong_Type.tp_name, uint_max, test_var);
24773 0 : return -1;
24774 : }
24775 0 : object->in.access_mask = test_var;
24776 : } else {
24777 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24778 : PyLong_Type.tp_name);
24779 0 : return -1;
24780 : }
24781 : }
24782 0 : return 0;
24783 : }
24784 :
24785 0 : static PyObject *py_lsa_OpenTrustedDomain_out_get_trustdom_handle(PyObject *obj, void *closure)
24786 : {
24787 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(obj);
24788 0 : PyObject *py_trustdom_handle;
24789 0 : if (object->out.trustdom_handle == NULL) {
24790 0 : Py_RETURN_NONE;
24791 : }
24792 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
24793 0 : return py_trustdom_handle;
24794 : }
24795 :
24796 0 : static int py_lsa_OpenTrustedDomain_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
24797 : {
24798 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24799 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
24800 0 : if (value == NULL) {
24801 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
24802 0 : return -1;
24803 : }
24804 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
24805 0 : if (object->out.trustdom_handle == NULL) {
24806 0 : PyErr_NoMemory();
24807 0 : return -1;
24808 : }
24809 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24810 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24811 0 : PyErr_NoMemory();
24812 0 : return -1;
24813 : }
24814 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24815 0 : return 0;
24816 : }
24817 :
24818 0 : static PyObject *py_lsa_OpenTrustedDomain_get_result(PyObject *obj, void *closure)
24819 : {
24820 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(obj);
24821 0 : PyObject *py_result;
24822 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24823 0 : return py_result;
24824 : }
24825 :
24826 0 : static int py_lsa_OpenTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
24827 : {
24828 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24829 0 : if (value == NULL) {
24830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
24831 0 : return -1;
24832 : }
24833 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24834 0 : return 0;
24835 : }
24836 :
24837 : static PyGetSetDef py_lsa_OpenTrustedDomain_getsetters[] = {
24838 : {
24839 : .name = discard_const_p(char, "in_handle"),
24840 : .get = py_lsa_OpenTrustedDomain_in_get_handle,
24841 : .set = py_lsa_OpenTrustedDomain_in_set_handle,
24842 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24843 : },
24844 : {
24845 : .name = discard_const_p(char, "in_sid"),
24846 : .get = py_lsa_OpenTrustedDomain_in_get_sid,
24847 : .set = py_lsa_OpenTrustedDomain_in_set_sid,
24848 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
24849 : },
24850 : {
24851 : .name = discard_const_p(char, "in_access_mask"),
24852 : .get = py_lsa_OpenTrustedDomain_in_get_access_mask,
24853 : .set = py_lsa_OpenTrustedDomain_in_set_access_mask,
24854 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
24855 : },
24856 : {
24857 : .name = discard_const_p(char, "out_trustdom_handle"),
24858 : .get = py_lsa_OpenTrustedDomain_out_get_trustdom_handle,
24859 : .set = py_lsa_OpenTrustedDomain_out_set_trustdom_handle,
24860 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24861 : },
24862 : {
24863 : .name = discard_const_p(char, "result"),
24864 : .get = py_lsa_OpenTrustedDomain_get_result,
24865 : .set = py_lsa_OpenTrustedDomain_set_result,
24866 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24867 : },
24868 : { .name = NULL }
24869 : };
24870 :
24871 0 : static PyObject *py_lsa_OpenTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24872 : {
24873 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomain, type);
24874 0 : struct lsa_OpenTrustedDomain *_self = (struct lsa_OpenTrustedDomain *)pytalloc_get_ptr(self);
24875 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24876 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
24877 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
24878 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
24879 0 : return self;
24880 : }
24881 :
24882 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24883 : {
24884 :
24885 :
24886 0 : return PyLong_FromLong(25);
24887 : }
24888 :
24889 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24890 : {
24891 0 : const struct ndr_interface_call *call = NULL;
24892 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24893 0 : PyObject *ret = NULL;
24894 0 : struct ndr_push *push = NULL;
24895 0 : DATA_BLOB blob;
24896 0 : enum ndr_err_code err;
24897 :
24898 0 : if (ndr_table_lsarpc.num_calls < 26) {
24899 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_pack");
24900 0 : return NULL;
24901 : }
24902 0 : call = &ndr_table_lsarpc.calls[25];
24903 :
24904 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24905 0 : if (push == NULL) {
24906 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24907 0 : return NULL;
24908 : }
24909 :
24910 0 : push->flags |= ndr_push_flags;
24911 :
24912 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24913 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24914 0 : TALLOC_FREE(push);
24915 0 : PyErr_SetNdrError(err);
24916 0 : return NULL;
24917 : }
24918 0 : blob = ndr_push_blob(push);
24919 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24920 0 : TALLOC_FREE(push);
24921 0 : return ret;
24922 : }
24923 :
24924 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24925 : {
24926 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24927 0 : PyObject *bigendian_obj = NULL;
24928 0 : PyObject *ndr64_obj = NULL;
24929 0 : libndr_flags ndr_push_flags = 0;
24930 :
24931 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24932 : discard_const_p(char *, kwnames),
24933 : &bigendian_obj,
24934 : &ndr64_obj)) {
24935 0 : return NULL;
24936 : }
24937 :
24938 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24939 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24940 : }
24941 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24942 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24943 : }
24944 :
24945 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24946 : }
24947 :
24948 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24949 : {
24950 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24951 0 : PyObject *bigendian_obj = NULL;
24952 0 : PyObject *ndr64_obj = NULL;
24953 0 : libndr_flags ndr_push_flags = 0;
24954 :
24955 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24956 : discard_const_p(char *, kwnames),
24957 : &bigendian_obj,
24958 : &ndr64_obj)) {
24959 0 : return NULL;
24960 : }
24961 :
24962 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24963 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24964 : }
24965 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24966 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24967 : }
24968 :
24969 0 : return py_lsa_OpenTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24970 : }
24971 :
24972 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)
24973 : {
24974 0 : const struct ndr_interface_call *call = NULL;
24975 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
24976 0 : struct ndr_pull *pull = NULL;
24977 0 : enum ndr_err_code err;
24978 :
24979 0 : if (ndr_table_lsarpc.num_calls < 26) {
24980 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_unpack");
24981 0 : return NULL;
24982 : }
24983 0 : call = &ndr_table_lsarpc.calls[25];
24984 :
24985 0 : pull = ndr_pull_init_blob(blob, object);
24986 0 : if (pull == NULL) {
24987 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24988 0 : return NULL;
24989 : }
24990 :
24991 0 : pull->flags |= ndr_pull_flags;
24992 :
24993 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24994 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24995 0 : TALLOC_FREE(pull);
24996 0 : PyErr_SetNdrError(err);
24997 0 : return NULL;
24998 : }
24999 0 : if (!allow_remaining) {
25000 0 : uint32_t highest_ofs;
25001 :
25002 0 : if (pull->offset > pull->relative_highest_offset) {
25003 0 : highest_ofs = pull->offset;
25004 : } else {
25005 0 : highest_ofs = pull->relative_highest_offset;
25006 : }
25007 0 : if (highest_ofs < pull->data_size) {
25008 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25009 : "not all bytes consumed ofs[%u] size[%u]",
25010 : highest_ofs, pull->data_size);
25011 0 : TALLOC_FREE(pull);
25012 0 : PyErr_SetNdrError(err);
25013 0 : return NULL;
25014 : }
25015 : }
25016 :
25017 0 : TALLOC_FREE(pull);
25018 0 : Py_RETURN_NONE;
25019 : }
25020 :
25021 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25022 : {
25023 0 : DATA_BLOB blob;
25024 0 : Py_ssize_t blob_length = 0;
25025 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25026 0 : PyObject *bigendian_obj = NULL;
25027 0 : PyObject *ndr64_obj = NULL;
25028 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25029 0 : PyObject *allow_remaining_obj = NULL;
25030 0 : bool allow_remaining = false;
25031 :
25032 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25033 : discard_const_p(char *, kwnames),
25034 : &blob.data, &blob_length,
25035 : &bigendian_obj,
25036 : &ndr64_obj,
25037 : &allow_remaining_obj)) {
25038 0 : return NULL;
25039 : }
25040 0 : blob.length = blob_length;
25041 :
25042 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25043 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25044 : }
25045 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25046 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25047 : }
25048 :
25049 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25050 0 : allow_remaining = true;
25051 : }
25052 :
25053 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25054 : }
25055 :
25056 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25057 : {
25058 0 : DATA_BLOB blob;
25059 0 : Py_ssize_t blob_length = 0;
25060 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25061 0 : PyObject *bigendian_obj = NULL;
25062 0 : PyObject *ndr64_obj = NULL;
25063 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25064 0 : PyObject *allow_remaining_obj = NULL;
25065 0 : bool allow_remaining = false;
25066 :
25067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25068 : discard_const_p(char *, kwnames),
25069 : &blob.data, &blob_length,
25070 : &bigendian_obj,
25071 : &ndr64_obj,
25072 : &allow_remaining_obj)) {
25073 0 : return NULL;
25074 : }
25075 0 : blob.length = blob_length;
25076 :
25077 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25078 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25079 : }
25080 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25081 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25082 : }
25083 :
25084 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25085 0 : allow_remaining = true;
25086 : }
25087 :
25088 0 : return py_lsa_OpenTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25089 : }
25090 :
25091 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25092 : {
25093 0 : const struct ndr_interface_call *call = NULL;
25094 0 : struct lsa_OpenTrustedDomain *object = pytalloc_get_ptr(py_obj);
25095 0 : PyObject *ret;
25096 0 : char *retstr;
25097 :
25098 0 : if (ndr_table_lsarpc.num_calls < 26) {
25099 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomain_ndr_print");
25100 0 : return NULL;
25101 : }
25102 0 : call = &ndr_table_lsarpc.calls[25];
25103 :
25104 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25105 0 : ret = PyUnicode_FromString(retstr);
25106 0 : TALLOC_FREE(retstr);
25107 :
25108 0 : return ret;
25109 : }
25110 :
25111 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25112 : {
25113 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_in", NDR_IN);
25114 : }
25115 :
25116 0 : static PyObject *py_lsa_OpenTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25117 : {
25118 0 : return py_lsa_OpenTrustedDomain_ndr_print(py_obj, "lsa_OpenTrustedDomain_out", NDR_OUT);
25119 : }
25120 :
25121 : static PyMethodDef py_lsa_OpenTrustedDomain_methods[] = {
25122 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
25123 : "lsa.OpenTrustedDomain.opnum() -> 25 (0x19) " },
25124 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25125 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25126 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25127 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25128 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25129 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25130 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25131 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25132 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25133 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25134 : { NULL, NULL, 0, NULL }
25135 : };
25136 :
25137 :
25138 : static PyTypeObject lsa_OpenTrustedDomain_Type = {
25139 : PyVarObject_HEAD_INIT(NULL, 0)
25140 : .tp_name = "lsa.OpenTrustedDomain",
25141 : .tp_getset = py_lsa_OpenTrustedDomain_getsetters,
25142 : .tp_methods = py_lsa_OpenTrustedDomain_methods,
25143 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25144 : .tp_new = py_lsa_OpenTrustedDomain_new,
25145 : };
25146 :
25147 0 : static bool pack_py_lsa_OpenTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomain *r)
25148 : {
25149 0 : PyObject *py_handle;
25150 0 : PyObject *py_sid;
25151 0 : PyObject *py_access_mask;
25152 0 : const char *kwnames[] = {
25153 : "handle", "sid", "access_mask", NULL
25154 : };
25155 :
25156 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_access_mask)) {
25157 0 : return false;
25158 : }
25159 :
25160 0 : if (py_handle == NULL) {
25161 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
25162 0 : return false;
25163 : }
25164 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
25165 0 : if (r->in.handle == NULL) {
25166 0 : PyErr_NoMemory();
25167 0 : return false;
25168 : }
25169 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
25170 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
25171 0 : PyErr_NoMemory();
25172 0 : return false;
25173 : }
25174 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
25175 0 : if (py_sid == NULL) {
25176 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
25177 0 : return false;
25178 : }
25179 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
25180 0 : if (r->in.sid == NULL) {
25181 0 : PyErr_NoMemory();
25182 0 : return false;
25183 : }
25184 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
25185 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
25186 0 : PyErr_NoMemory();
25187 0 : return false;
25188 : }
25189 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
25190 0 : if (py_access_mask == NULL) {
25191 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
25192 0 : return false;
25193 : }
25194 : {
25195 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
25196 0 : if (PyLong_Check(py_access_mask)) {
25197 0 : unsigned long long test_var;
25198 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
25199 0 : if (PyErr_Occurred() != NULL) {
25200 0 : return false;
25201 : }
25202 0 : if (test_var > uint_max) {
25203 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25204 : PyLong_Type.tp_name, uint_max, test_var);
25205 0 : return false;
25206 : }
25207 0 : r->in.access_mask = test_var;
25208 : } else {
25209 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25210 : PyLong_Type.tp_name);
25211 0 : return false;
25212 : }
25213 : }
25214 0 : return true;
25215 : }
25216 :
25217 0 : static PyObject *unpack_py_lsa_OpenTrustedDomain_args_out(struct lsa_OpenTrustedDomain *r)
25218 : {
25219 0 : PyObject *result;
25220 0 : PyObject *py_trustdom_handle;
25221 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
25222 0 : result = py_trustdom_handle;
25223 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
25224 0 : PyErr_SetNTSTATUS(r->out.result);
25225 0 : return NULL;
25226 : }
25227 :
25228 0 : return result;
25229 : }
25230 :
25231 :
25232 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle(PyObject *obj, void *closure)
25233 : {
25234 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(obj);
25235 0 : PyObject *py_trustdom_handle;
25236 0 : if (object->in.trustdom_handle == NULL) {
25237 0 : Py_RETURN_NONE;
25238 : }
25239 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
25240 0 : return py_trustdom_handle;
25241 : }
25242 :
25243 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
25244 : {
25245 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25246 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
25247 0 : if (value == NULL) {
25248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trustdom_handle");
25249 0 : return -1;
25250 : }
25251 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
25252 0 : if (object->in.trustdom_handle == NULL) {
25253 0 : PyErr_NoMemory();
25254 0 : return -1;
25255 : }
25256 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25257 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25258 0 : PyErr_NoMemory();
25259 0 : return -1;
25260 : }
25261 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25262 0 : return 0;
25263 : }
25264 :
25265 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
25266 : {
25267 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(obj);
25268 0 : PyObject *py_level;
25269 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
25270 0 : return py_level;
25271 : }
25272 :
25273 0 : static int py_lsa_QueryTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
25274 : {
25275 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25276 0 : if (value == NULL) {
25277 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
25278 0 : return -1;
25279 : }
25280 : {
25281 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
25282 0 : if (PyLong_Check(value)) {
25283 0 : unsigned long long test_var;
25284 0 : test_var = PyLong_AsUnsignedLongLong(value);
25285 0 : if (PyErr_Occurred() != NULL) {
25286 0 : return -1;
25287 : }
25288 0 : if (test_var > uint_max) {
25289 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25290 : PyLong_Type.tp_name, uint_max, test_var);
25291 0 : return -1;
25292 : }
25293 0 : object->in.level = test_var;
25294 : } else {
25295 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25296 : PyLong_Type.tp_name);
25297 0 : return -1;
25298 : }
25299 : }
25300 0 : return 0;
25301 : }
25302 :
25303 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_out_get_info(PyObject *obj, void *closure)
25304 : {
25305 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(obj);
25306 0 : PyObject *py_info;
25307 0 : if (object->out.info == NULL) {
25308 0 : Py_RETURN_NONE;
25309 : }
25310 0 : if (*object->out.info == NULL) {
25311 0 : py_info = Py_None;
25312 0 : Py_INCREF(py_info);
25313 : } else {
25314 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
25315 0 : if (py_info == NULL) {
25316 0 : return NULL;
25317 : }
25318 : }
25319 0 : return py_info;
25320 : }
25321 :
25322 0 : static int py_lsa_QueryTrustedDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
25323 : {
25324 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25325 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
25326 0 : if (value == NULL) {
25327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
25328 0 : return -1;
25329 : }
25330 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
25331 0 : if (object->out.info == NULL) {
25332 0 : PyErr_NoMemory();
25333 0 : return -1;
25334 : }
25335 0 : if (value == Py_None) {
25336 0 : *object->out.info = NULL;
25337 : } else {
25338 0 : *object->out.info = NULL;
25339 : {
25340 0 : union lsa_TrustedDomainInfo *info_switch_2;
25341 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");
25342 0 : if (info_switch_2 == NULL) {
25343 0 : return -1;
25344 : }
25345 0 : *object->out.info = info_switch_2;
25346 : }
25347 : }
25348 0 : return 0;
25349 : }
25350 :
25351 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_get_result(PyObject *obj, void *closure)
25352 : {
25353 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(obj);
25354 0 : PyObject *py_result;
25355 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25356 0 : return py_result;
25357 : }
25358 :
25359 0 : static int py_lsa_QueryTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
25360 : {
25361 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25362 0 : if (value == NULL) {
25363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
25364 0 : return -1;
25365 : }
25366 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25367 0 : return 0;
25368 : }
25369 :
25370 : static PyGetSetDef py_lsa_QueryTrustedDomainInfo_getsetters[] = {
25371 : {
25372 : .name = discard_const_p(char, "in_trustdom_handle"),
25373 : .get = py_lsa_QueryTrustedDomainInfo_in_get_trustdom_handle,
25374 : .set = py_lsa_QueryTrustedDomainInfo_in_set_trustdom_handle,
25375 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25376 : },
25377 : {
25378 : .name = discard_const_p(char, "in_level"),
25379 : .get = py_lsa_QueryTrustedDomainInfo_in_get_level,
25380 : .set = py_lsa_QueryTrustedDomainInfo_in_set_level,
25381 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
25382 : },
25383 : {
25384 : .name = discard_const_p(char, "out_info"),
25385 : .get = py_lsa_QueryTrustedDomainInfo_out_get_info,
25386 : .set = py_lsa_QueryTrustedDomainInfo_out_set_info,
25387 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
25388 : },
25389 : {
25390 : .name = discard_const_p(char, "result"),
25391 : .get = py_lsa_QueryTrustedDomainInfo_get_result,
25392 : .set = py_lsa_QueryTrustedDomainInfo_set_result,
25393 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25394 : },
25395 : { .name = NULL }
25396 : };
25397 :
25398 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25399 : {
25400 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfo, type);
25401 0 : struct lsa_QueryTrustedDomainInfo *_self = (struct lsa_QueryTrustedDomainInfo *)pytalloc_get_ptr(self);
25402 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25403 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
25404 : /* a pointer to a NULL pointer */
25405 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
25406 0 : return self;
25407 : }
25408 :
25409 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25410 : {
25411 :
25412 :
25413 0 : return PyLong_FromLong(26);
25414 : }
25415 :
25416 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25417 : {
25418 0 : const struct ndr_interface_call *call = NULL;
25419 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25420 0 : PyObject *ret = NULL;
25421 0 : struct ndr_push *push = NULL;
25422 0 : DATA_BLOB blob;
25423 0 : enum ndr_err_code err;
25424 :
25425 0 : if (ndr_table_lsarpc.num_calls < 27) {
25426 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_pack");
25427 0 : return NULL;
25428 : }
25429 0 : call = &ndr_table_lsarpc.calls[26];
25430 :
25431 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25432 0 : if (push == NULL) {
25433 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25434 0 : return NULL;
25435 : }
25436 :
25437 0 : push->flags |= ndr_push_flags;
25438 :
25439 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25440 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25441 0 : TALLOC_FREE(push);
25442 0 : PyErr_SetNdrError(err);
25443 0 : return NULL;
25444 : }
25445 0 : blob = ndr_push_blob(push);
25446 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25447 0 : TALLOC_FREE(push);
25448 0 : return ret;
25449 : }
25450 :
25451 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25452 : {
25453 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25454 0 : PyObject *bigendian_obj = NULL;
25455 0 : PyObject *ndr64_obj = NULL;
25456 0 : libndr_flags ndr_push_flags = 0;
25457 :
25458 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25459 : discard_const_p(char *, kwnames),
25460 : &bigendian_obj,
25461 : &ndr64_obj)) {
25462 0 : return NULL;
25463 : }
25464 :
25465 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25466 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25467 : }
25468 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25469 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25470 : }
25471 :
25472 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25473 : }
25474 :
25475 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25476 : {
25477 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25478 0 : PyObject *bigendian_obj = NULL;
25479 0 : PyObject *ndr64_obj = NULL;
25480 0 : libndr_flags ndr_push_flags = 0;
25481 :
25482 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25483 : discard_const_p(char *, kwnames),
25484 : &bigendian_obj,
25485 : &ndr64_obj)) {
25486 0 : return NULL;
25487 : }
25488 :
25489 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25490 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25491 : }
25492 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25493 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25494 : }
25495 :
25496 0 : return py_lsa_QueryTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25497 : }
25498 :
25499 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)
25500 : {
25501 0 : const struct ndr_interface_call *call = NULL;
25502 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25503 0 : struct ndr_pull *pull = NULL;
25504 0 : enum ndr_err_code err;
25505 :
25506 0 : if (ndr_table_lsarpc.num_calls < 27) {
25507 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_unpack");
25508 0 : return NULL;
25509 : }
25510 0 : call = &ndr_table_lsarpc.calls[26];
25511 :
25512 0 : pull = ndr_pull_init_blob(blob, object);
25513 0 : if (pull == NULL) {
25514 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25515 0 : return NULL;
25516 : }
25517 :
25518 0 : pull->flags |= ndr_pull_flags;
25519 :
25520 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25521 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25522 0 : TALLOC_FREE(pull);
25523 0 : PyErr_SetNdrError(err);
25524 0 : return NULL;
25525 : }
25526 0 : if (!allow_remaining) {
25527 0 : uint32_t highest_ofs;
25528 :
25529 0 : if (pull->offset > pull->relative_highest_offset) {
25530 0 : highest_ofs = pull->offset;
25531 : } else {
25532 0 : highest_ofs = pull->relative_highest_offset;
25533 : }
25534 0 : if (highest_ofs < pull->data_size) {
25535 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25536 : "not all bytes consumed ofs[%u] size[%u]",
25537 : highest_ofs, pull->data_size);
25538 0 : TALLOC_FREE(pull);
25539 0 : PyErr_SetNdrError(err);
25540 0 : return NULL;
25541 : }
25542 : }
25543 :
25544 0 : TALLOC_FREE(pull);
25545 0 : Py_RETURN_NONE;
25546 : }
25547 :
25548 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25549 : {
25550 0 : DATA_BLOB blob;
25551 0 : Py_ssize_t blob_length = 0;
25552 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25553 0 : PyObject *bigendian_obj = NULL;
25554 0 : PyObject *ndr64_obj = NULL;
25555 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25556 0 : PyObject *allow_remaining_obj = NULL;
25557 0 : bool allow_remaining = false;
25558 :
25559 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25560 : discard_const_p(char *, kwnames),
25561 : &blob.data, &blob_length,
25562 : &bigendian_obj,
25563 : &ndr64_obj,
25564 : &allow_remaining_obj)) {
25565 0 : return NULL;
25566 : }
25567 0 : blob.length = blob_length;
25568 :
25569 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25570 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25571 : }
25572 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25573 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25574 : }
25575 :
25576 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25577 0 : allow_remaining = true;
25578 : }
25579 :
25580 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25581 : }
25582 :
25583 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25584 : {
25585 0 : DATA_BLOB blob;
25586 0 : Py_ssize_t blob_length = 0;
25587 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25588 0 : PyObject *bigendian_obj = NULL;
25589 0 : PyObject *ndr64_obj = NULL;
25590 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25591 0 : PyObject *allow_remaining_obj = NULL;
25592 0 : bool allow_remaining = false;
25593 :
25594 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25595 : discard_const_p(char *, kwnames),
25596 : &blob.data, &blob_length,
25597 : &bigendian_obj,
25598 : &ndr64_obj,
25599 : &allow_remaining_obj)) {
25600 0 : return NULL;
25601 : }
25602 0 : blob.length = blob_length;
25603 :
25604 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25605 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25606 : }
25607 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25608 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25609 : }
25610 :
25611 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25612 0 : allow_remaining = true;
25613 : }
25614 :
25615 0 : return py_lsa_QueryTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25616 : }
25617 :
25618 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25619 : {
25620 0 : const struct ndr_interface_call *call = NULL;
25621 0 : struct lsa_QueryTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
25622 0 : PyObject *ret;
25623 0 : char *retstr;
25624 :
25625 0 : if (ndr_table_lsarpc.num_calls < 27) {
25626 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfo_ndr_print");
25627 0 : return NULL;
25628 : }
25629 0 : call = &ndr_table_lsarpc.calls[26];
25630 :
25631 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25632 0 : ret = PyUnicode_FromString(retstr);
25633 0 : TALLOC_FREE(retstr);
25634 :
25635 0 : return ret;
25636 : }
25637 :
25638 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25639 : {
25640 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_in", NDR_IN);
25641 : }
25642 :
25643 0 : static PyObject *py_lsa_QueryTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25644 : {
25645 0 : return py_lsa_QueryTrustedDomainInfo_ndr_print(py_obj, "lsa_QueryTrustedDomainInfo_out", NDR_OUT);
25646 : }
25647 :
25648 : static PyMethodDef py_lsa_QueryTrustedDomainInfo_methods[] = {
25649 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
25650 : "lsa.QueryTrustedDomainInfo.opnum() -> 26 (0x1a) " },
25651 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25652 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25653 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25654 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25655 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25656 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25657 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25658 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25659 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25660 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25661 : { NULL, NULL, 0, NULL }
25662 : };
25663 :
25664 :
25665 : static PyTypeObject lsa_QueryTrustedDomainInfo_Type = {
25666 : PyVarObject_HEAD_INIT(NULL, 0)
25667 : .tp_name = "lsa.QueryTrustedDomainInfo",
25668 : .tp_getset = py_lsa_QueryTrustedDomainInfo_getsetters,
25669 : .tp_methods = py_lsa_QueryTrustedDomainInfo_methods,
25670 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25671 : .tp_new = py_lsa_QueryTrustedDomainInfo_new,
25672 : };
25673 :
25674 0 : static bool pack_py_lsa_QueryTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfo *r)
25675 : {
25676 0 : PyObject *py_trustdom_handle;
25677 0 : PyObject *py_level;
25678 0 : const char *kwnames[] = {
25679 : "trustdom_handle", "level", NULL
25680 : };
25681 :
25682 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryTrustedDomainInfo", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level)) {
25683 0 : return false;
25684 : }
25685 :
25686 0 : if (py_trustdom_handle == NULL) {
25687 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trustdom_handle");
25688 0 : return false;
25689 : }
25690 0 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
25691 0 : if (r->in.trustdom_handle == NULL) {
25692 0 : PyErr_NoMemory();
25693 0 : return false;
25694 : }
25695 0 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
25696 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
25697 0 : PyErr_NoMemory();
25698 0 : return false;
25699 : }
25700 0 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
25701 0 : if (py_level == NULL) {
25702 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
25703 0 : return false;
25704 : }
25705 : {
25706 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
25707 0 : if (PyLong_Check(py_level)) {
25708 0 : unsigned long long test_var;
25709 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
25710 0 : if (PyErr_Occurred() != NULL) {
25711 0 : return false;
25712 : }
25713 0 : if (test_var > uint_max) {
25714 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25715 : PyLong_Type.tp_name, uint_max, test_var);
25716 0 : return false;
25717 : }
25718 0 : r->in.level = test_var;
25719 : } else {
25720 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25721 : PyLong_Type.tp_name);
25722 0 : return false;
25723 : }
25724 : }
25725 0 : return true;
25726 : }
25727 :
25728 0 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfo_args_out(struct lsa_QueryTrustedDomainInfo *r)
25729 : {
25730 0 : PyObject *result;
25731 0 : PyObject *py_info;
25732 0 : if (*r->out.info == NULL) {
25733 0 : py_info = Py_None;
25734 0 : Py_INCREF(py_info);
25735 : } else {
25736 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
25737 0 : if (py_info == NULL) {
25738 0 : return NULL;
25739 : }
25740 : }
25741 0 : result = py_info;
25742 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
25743 0 : PyErr_SetNTSTATUS(r->out.result);
25744 0 : return NULL;
25745 : }
25746 :
25747 0 : return result;
25748 : }
25749 :
25750 :
25751 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle(PyObject *obj, void *closure)
25752 : {
25753 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(obj);
25754 0 : PyObject *py_trustdom_handle;
25755 0 : if (object->in.trustdom_handle == NULL) {
25756 0 : Py_RETURN_NONE;
25757 : }
25758 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->in.trustdom_handle, object->in.trustdom_handle);
25759 0 : return py_trustdom_handle;
25760 : }
25761 :
25762 0 : static int py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
25763 : {
25764 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
25765 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trustdom_handle));
25766 0 : if (value == NULL) {
25767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trustdom_handle");
25768 0 : return -1;
25769 : }
25770 0 : object->in.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trustdom_handle);
25771 0 : if (object->in.trustdom_handle == NULL) {
25772 0 : PyErr_NoMemory();
25773 0 : return -1;
25774 : }
25775 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25776 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25777 0 : PyErr_NoMemory();
25778 0 : return -1;
25779 : }
25780 0 : object->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25781 0 : return 0;
25782 : }
25783 :
25784 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_level(PyObject *obj, void *closure)
25785 : {
25786 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(obj);
25787 0 : PyObject *py_level;
25788 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
25789 0 : return py_level;
25790 : }
25791 :
25792 0 : static int py_lsa_SetInformationTrustedDomain_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
25793 : {
25794 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
25795 0 : if (value == NULL) {
25796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
25797 0 : return -1;
25798 : }
25799 : {
25800 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
25801 0 : if (PyLong_Check(value)) {
25802 0 : unsigned long long test_var;
25803 0 : test_var = PyLong_AsUnsignedLongLong(value);
25804 0 : if (PyErr_Occurred() != NULL) {
25805 0 : return -1;
25806 : }
25807 0 : if (test_var > uint_max) {
25808 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25809 : PyLong_Type.tp_name, uint_max, test_var);
25810 0 : return -1;
25811 : }
25812 0 : object->in.level = test_var;
25813 : } else {
25814 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25815 : PyLong_Type.tp_name);
25816 0 : return -1;
25817 : }
25818 : }
25819 0 : return 0;
25820 : }
25821 :
25822 0 : static PyObject *py_lsa_SetInformationTrustedDomain_in_get_info(PyObject *obj, void *closure)
25823 : {
25824 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(obj);
25825 0 : PyObject *py_info;
25826 0 : if (object->in.info == NULL) {
25827 0 : Py_RETURN_NONE;
25828 : }
25829 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
25830 0 : if (py_info == NULL) {
25831 0 : return NULL;
25832 : }
25833 0 : return py_info;
25834 : }
25835 :
25836 0 : static int py_lsa_SetInformationTrustedDomain_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
25837 : {
25838 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
25839 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
25840 0 : if (value == NULL) {
25841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
25842 0 : return -1;
25843 : }
25844 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
25845 0 : if (object->in.info == NULL) {
25846 0 : PyErr_NoMemory();
25847 0 : return -1;
25848 : }
25849 : {
25850 0 : union lsa_TrustedDomainInfo *info_switch_1;
25851 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");
25852 0 : if (info_switch_1 == NULL) {
25853 0 : return -1;
25854 : }
25855 0 : object->in.info = info_switch_1;
25856 : }
25857 0 : return 0;
25858 : }
25859 :
25860 0 : static PyObject *py_lsa_SetInformationTrustedDomain_get_result(PyObject *obj, void *closure)
25861 : {
25862 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(obj);
25863 0 : PyObject *py_result;
25864 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25865 0 : return py_result;
25866 : }
25867 :
25868 0 : static int py_lsa_SetInformationTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
25869 : {
25870 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
25871 0 : if (value == NULL) {
25872 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
25873 0 : return -1;
25874 : }
25875 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25876 0 : return 0;
25877 : }
25878 :
25879 : static PyGetSetDef py_lsa_SetInformationTrustedDomain_getsetters[] = {
25880 : {
25881 : .name = discard_const_p(char, "in_trustdom_handle"),
25882 : .get = py_lsa_SetInformationTrustedDomain_in_get_trustdom_handle,
25883 : .set = py_lsa_SetInformationTrustedDomain_in_set_trustdom_handle,
25884 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25885 : },
25886 : {
25887 : .name = discard_const_p(char, "in_level"),
25888 : .get = py_lsa_SetInformationTrustedDomain_in_get_level,
25889 : .set = py_lsa_SetInformationTrustedDomain_in_set_level,
25890 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
25891 : },
25892 : {
25893 : .name = discard_const_p(char, "in_info"),
25894 : .get = py_lsa_SetInformationTrustedDomain_in_get_info,
25895 : .set = py_lsa_SetInformationTrustedDomain_in_set_info,
25896 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
25897 : },
25898 : {
25899 : .name = discard_const_p(char, "result"),
25900 : .get = py_lsa_SetInformationTrustedDomain_get_result,
25901 : .set = py_lsa_SetInformationTrustedDomain_set_result,
25902 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25903 : },
25904 : { .name = NULL }
25905 : };
25906 :
25907 0 : static PyObject *py_lsa_SetInformationTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25908 : {
25909 0 : PyObject *self = pytalloc_new(struct lsa_SetInformationTrustedDomain, type);
25910 0 : struct lsa_SetInformationTrustedDomain *_self = (struct lsa_SetInformationTrustedDomain *)pytalloc_get_ptr(self);
25911 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25912 0 : _self->in.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
25913 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
25914 0 : return self;
25915 : }
25916 :
25917 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25918 : {
25919 :
25920 :
25921 0 : return PyLong_FromLong(27);
25922 : }
25923 :
25924 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25925 : {
25926 0 : const struct ndr_interface_call *call = NULL;
25927 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
25928 0 : PyObject *ret = NULL;
25929 0 : struct ndr_push *push = NULL;
25930 0 : DATA_BLOB blob;
25931 0 : enum ndr_err_code err;
25932 :
25933 0 : if (ndr_table_lsarpc.num_calls < 28) {
25934 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_pack");
25935 0 : return NULL;
25936 : }
25937 0 : call = &ndr_table_lsarpc.calls[27];
25938 :
25939 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25940 0 : if (push == NULL) {
25941 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25942 0 : return NULL;
25943 : }
25944 :
25945 0 : push->flags |= ndr_push_flags;
25946 :
25947 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25948 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25949 0 : TALLOC_FREE(push);
25950 0 : PyErr_SetNdrError(err);
25951 0 : return NULL;
25952 : }
25953 0 : blob = ndr_push_blob(push);
25954 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25955 0 : TALLOC_FREE(push);
25956 0 : return ret;
25957 : }
25958 :
25959 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25960 : {
25961 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25962 0 : PyObject *bigendian_obj = NULL;
25963 0 : PyObject *ndr64_obj = NULL;
25964 0 : libndr_flags ndr_push_flags = 0;
25965 :
25966 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25967 : discard_const_p(char *, kwnames),
25968 : &bigendian_obj,
25969 : &ndr64_obj)) {
25970 0 : return NULL;
25971 : }
25972 :
25973 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25974 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25975 : }
25976 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25977 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25978 : }
25979 :
25980 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25981 : }
25982 :
25983 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25984 : {
25985 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25986 0 : PyObject *bigendian_obj = NULL;
25987 0 : PyObject *ndr64_obj = NULL;
25988 0 : libndr_flags ndr_push_flags = 0;
25989 :
25990 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25991 : discard_const_p(char *, kwnames),
25992 : &bigendian_obj,
25993 : &ndr64_obj)) {
25994 0 : return NULL;
25995 : }
25996 :
25997 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25998 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25999 : }
26000 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26001 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26002 : }
26003 :
26004 0 : return py_lsa_SetInformationTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26005 : }
26006 :
26007 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)
26008 : {
26009 0 : const struct ndr_interface_call *call = NULL;
26010 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
26011 0 : struct ndr_pull *pull = NULL;
26012 0 : enum ndr_err_code err;
26013 :
26014 0 : if (ndr_table_lsarpc.num_calls < 28) {
26015 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_unpack");
26016 0 : return NULL;
26017 : }
26018 0 : call = &ndr_table_lsarpc.calls[27];
26019 :
26020 0 : pull = ndr_pull_init_blob(blob, object);
26021 0 : if (pull == NULL) {
26022 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26023 0 : return NULL;
26024 : }
26025 :
26026 0 : pull->flags |= ndr_pull_flags;
26027 :
26028 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26029 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26030 0 : TALLOC_FREE(pull);
26031 0 : PyErr_SetNdrError(err);
26032 0 : return NULL;
26033 : }
26034 0 : if (!allow_remaining) {
26035 0 : uint32_t highest_ofs;
26036 :
26037 0 : if (pull->offset > pull->relative_highest_offset) {
26038 0 : highest_ofs = pull->offset;
26039 : } else {
26040 0 : highest_ofs = pull->relative_highest_offset;
26041 : }
26042 0 : if (highest_ofs < pull->data_size) {
26043 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26044 : "not all bytes consumed ofs[%u] size[%u]",
26045 : highest_ofs, pull->data_size);
26046 0 : TALLOC_FREE(pull);
26047 0 : PyErr_SetNdrError(err);
26048 0 : return NULL;
26049 : }
26050 : }
26051 :
26052 0 : TALLOC_FREE(pull);
26053 0 : Py_RETURN_NONE;
26054 : }
26055 :
26056 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26057 : {
26058 0 : DATA_BLOB blob;
26059 0 : Py_ssize_t blob_length = 0;
26060 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26061 0 : PyObject *bigendian_obj = NULL;
26062 0 : PyObject *ndr64_obj = NULL;
26063 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26064 0 : PyObject *allow_remaining_obj = NULL;
26065 0 : bool allow_remaining = false;
26066 :
26067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26068 : discard_const_p(char *, kwnames),
26069 : &blob.data, &blob_length,
26070 : &bigendian_obj,
26071 : &ndr64_obj,
26072 : &allow_remaining_obj)) {
26073 0 : return NULL;
26074 : }
26075 0 : blob.length = blob_length;
26076 :
26077 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26078 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26079 : }
26080 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26081 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26082 : }
26083 :
26084 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26085 0 : allow_remaining = true;
26086 : }
26087 :
26088 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26089 : }
26090 :
26091 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26092 : {
26093 0 : DATA_BLOB blob;
26094 0 : Py_ssize_t blob_length = 0;
26095 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26096 0 : PyObject *bigendian_obj = NULL;
26097 0 : PyObject *ndr64_obj = NULL;
26098 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26099 0 : PyObject *allow_remaining_obj = NULL;
26100 0 : bool allow_remaining = false;
26101 :
26102 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26103 : discard_const_p(char *, kwnames),
26104 : &blob.data, &blob_length,
26105 : &bigendian_obj,
26106 : &ndr64_obj,
26107 : &allow_remaining_obj)) {
26108 0 : return NULL;
26109 : }
26110 0 : blob.length = blob_length;
26111 :
26112 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26113 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26114 : }
26115 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26116 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26117 : }
26118 :
26119 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26120 0 : allow_remaining = true;
26121 : }
26122 :
26123 0 : return py_lsa_SetInformationTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26124 : }
26125 :
26126 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26127 : {
26128 0 : const struct ndr_interface_call *call = NULL;
26129 0 : struct lsa_SetInformationTrustedDomain *object = pytalloc_get_ptr(py_obj);
26130 0 : PyObject *ret;
26131 0 : char *retstr;
26132 :
26133 0 : if (ndr_table_lsarpc.num_calls < 28) {
26134 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInformationTrustedDomain_ndr_print");
26135 0 : return NULL;
26136 : }
26137 0 : call = &ndr_table_lsarpc.calls[27];
26138 :
26139 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26140 0 : ret = PyUnicode_FromString(retstr);
26141 0 : TALLOC_FREE(retstr);
26142 :
26143 0 : return ret;
26144 : }
26145 :
26146 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26147 : {
26148 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_in", NDR_IN);
26149 : }
26150 :
26151 0 : static PyObject *py_lsa_SetInformationTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26152 : {
26153 0 : return py_lsa_SetInformationTrustedDomain_ndr_print(py_obj, "lsa_SetInformationTrustedDomain_out", NDR_OUT);
26154 : }
26155 :
26156 : static PyMethodDef py_lsa_SetInformationTrustedDomain_methods[] = {
26157 : { "opnum", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
26158 : "lsa.SetInformationTrustedDomain.opnum() -> 27 (0x1b) " },
26159 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26160 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26161 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26162 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26163 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26164 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26165 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInformationTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26166 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26167 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26168 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInformationTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26169 : { NULL, NULL, 0, NULL }
26170 : };
26171 :
26172 :
26173 : static PyTypeObject lsa_SetInformationTrustedDomain_Type = {
26174 : PyVarObject_HEAD_INIT(NULL, 0)
26175 : .tp_name = "lsa.SetInformationTrustedDomain",
26176 : .tp_getset = py_lsa_SetInformationTrustedDomain_getsetters,
26177 : .tp_methods = py_lsa_SetInformationTrustedDomain_methods,
26178 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26179 : .tp_new = py_lsa_SetInformationTrustedDomain_new,
26180 : };
26181 :
26182 22 : static bool pack_py_lsa_SetInformationTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInformationTrustedDomain *r)
26183 : {
26184 0 : PyObject *py_trustdom_handle;
26185 0 : PyObject *py_level;
26186 0 : PyObject *py_info;
26187 22 : const char *kwnames[] = {
26188 : "trustdom_handle", "level", "info", NULL
26189 : };
26190 :
26191 22 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInformationTrustedDomain", discard_const_p(char *, kwnames), &py_trustdom_handle, &py_level, &py_info)) {
26192 0 : return false;
26193 : }
26194 :
26195 22 : if (py_trustdom_handle == NULL) {
26196 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trustdom_handle");
26197 0 : return false;
26198 : }
26199 22 : r->in.trustdom_handle = talloc_ptrtype(r, r->in.trustdom_handle);
26200 22 : if (r->in.trustdom_handle == NULL) {
26201 0 : PyErr_NoMemory();
26202 0 : return false;
26203 : }
26204 22 : PY_CHECK_TYPE(policy_handle_Type, py_trustdom_handle, return false;);
26205 22 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trustdom_handle)) == NULL) {
26206 0 : PyErr_NoMemory();
26207 0 : return false;
26208 : }
26209 22 : r->in.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(py_trustdom_handle);
26210 22 : if (py_level == NULL) {
26211 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
26212 0 : return false;
26213 : }
26214 : {
26215 22 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
26216 22 : if (PyLong_Check(py_level)) {
26217 0 : unsigned long long test_var;
26218 22 : test_var = PyLong_AsUnsignedLongLong(py_level);
26219 22 : if (PyErr_Occurred() != NULL) {
26220 0 : return false;
26221 : }
26222 22 : if (test_var > uint_max) {
26223 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26224 : PyLong_Type.tp_name, uint_max, test_var);
26225 0 : return false;
26226 : }
26227 22 : r->in.level = test_var;
26228 : } else {
26229 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26230 : PyLong_Type.tp_name);
26231 0 : return false;
26232 : }
26233 : }
26234 22 : if (py_info == NULL) {
26235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
26236 0 : return false;
26237 : }
26238 22 : r->in.info = talloc_ptrtype(r, r->in.info);
26239 22 : if (r->in.info == NULL) {
26240 0 : PyErr_NoMemory();
26241 0 : return false;
26242 : }
26243 : {
26244 0 : union lsa_TrustedDomainInfo *info_switch_1;
26245 22 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
26246 22 : if (info_switch_1 == NULL) {
26247 0 : return false;
26248 : }
26249 22 : r->in.info = info_switch_1;
26250 : }
26251 22 : return true;
26252 : }
26253 :
26254 22 : static PyObject *unpack_py_lsa_SetInformationTrustedDomain_args_out(struct lsa_SetInformationTrustedDomain *r)
26255 : {
26256 0 : PyObject *result;
26257 22 : result = Py_None;
26258 12 : Py_INCREF(result);
26259 22 : if (NT_STATUS_IS_ERR(r->out.result)) {
26260 0 : PyErr_SetNTSTATUS(r->out.result);
26261 0 : return NULL;
26262 : }
26263 :
26264 22 : return result;
26265 : }
26266 :
26267 :
26268 0 : static PyObject *py_lsa_OpenSecret_in_get_handle(PyObject *obj, void *closure)
26269 : {
26270 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(obj);
26271 0 : PyObject *py_handle;
26272 0 : if (object->in.handle == NULL) {
26273 0 : Py_RETURN_NONE;
26274 : }
26275 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
26276 0 : return py_handle;
26277 : }
26278 :
26279 0 : static int py_lsa_OpenSecret_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
26280 : {
26281 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26282 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
26283 0 : if (value == NULL) {
26284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
26285 0 : return -1;
26286 : }
26287 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
26288 0 : if (object->in.handle == NULL) {
26289 0 : PyErr_NoMemory();
26290 0 : return -1;
26291 : }
26292 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26293 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26294 0 : PyErr_NoMemory();
26295 0 : return -1;
26296 : }
26297 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
26298 0 : return 0;
26299 : }
26300 :
26301 0 : static PyObject *py_lsa_OpenSecret_in_get_name(PyObject *obj, void *closure)
26302 : {
26303 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(obj);
26304 0 : PyObject *py_name;
26305 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
26306 0 : return py_name;
26307 : }
26308 :
26309 0 : static int py_lsa_OpenSecret_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
26310 : {
26311 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26312 0 : if (value == NULL) {
26313 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
26314 0 : return -1;
26315 : }
26316 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
26317 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26318 0 : PyErr_NoMemory();
26319 0 : return -1;
26320 : }
26321 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
26322 0 : return 0;
26323 : }
26324 :
26325 0 : static PyObject *py_lsa_OpenSecret_in_get_access_mask(PyObject *obj, void *closure)
26326 : {
26327 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(obj);
26328 0 : PyObject *py_access_mask;
26329 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
26330 0 : return py_access_mask;
26331 : }
26332 :
26333 0 : static int py_lsa_OpenSecret_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
26334 : {
26335 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26336 0 : if (value == NULL) {
26337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
26338 0 : return -1;
26339 : }
26340 : {
26341 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
26342 0 : if (PyLong_Check(value)) {
26343 0 : unsigned long long test_var;
26344 0 : test_var = PyLong_AsUnsignedLongLong(value);
26345 0 : if (PyErr_Occurred() != NULL) {
26346 0 : return -1;
26347 : }
26348 0 : if (test_var > uint_max) {
26349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26350 : PyLong_Type.tp_name, uint_max, test_var);
26351 0 : return -1;
26352 : }
26353 0 : object->in.access_mask = test_var;
26354 : } else {
26355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26356 : PyLong_Type.tp_name);
26357 0 : return -1;
26358 : }
26359 : }
26360 0 : return 0;
26361 : }
26362 :
26363 0 : static PyObject *py_lsa_OpenSecret_out_get_sec_handle(PyObject *obj, void *closure)
26364 : {
26365 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(obj);
26366 0 : PyObject *py_sec_handle;
26367 0 : if (object->out.sec_handle == NULL) {
26368 0 : Py_RETURN_NONE;
26369 : }
26370 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->out.sec_handle, object->out.sec_handle);
26371 0 : return py_sec_handle;
26372 : }
26373 :
26374 0 : static int py_lsa_OpenSecret_out_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
26375 : {
26376 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26377 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sec_handle));
26378 0 : if (value == NULL) {
26379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sec_handle");
26380 0 : return -1;
26381 : }
26382 0 : object->out.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sec_handle);
26383 0 : if (object->out.sec_handle == NULL) {
26384 0 : PyErr_NoMemory();
26385 0 : return -1;
26386 : }
26387 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26388 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26389 0 : PyErr_NoMemory();
26390 0 : return -1;
26391 : }
26392 0 : object->out.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26393 0 : return 0;
26394 : }
26395 :
26396 0 : static PyObject *py_lsa_OpenSecret_get_result(PyObject *obj, void *closure)
26397 : {
26398 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(obj);
26399 0 : PyObject *py_result;
26400 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26401 0 : return py_result;
26402 : }
26403 :
26404 0 : static int py_lsa_OpenSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
26405 : {
26406 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26407 0 : if (value == NULL) {
26408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
26409 0 : return -1;
26410 : }
26411 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26412 0 : return 0;
26413 : }
26414 :
26415 : static PyGetSetDef py_lsa_OpenSecret_getsetters[] = {
26416 : {
26417 : .name = discard_const_p(char, "in_handle"),
26418 : .get = py_lsa_OpenSecret_in_get_handle,
26419 : .set = py_lsa_OpenSecret_in_set_handle,
26420 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26421 : },
26422 : {
26423 : .name = discard_const_p(char, "in_name"),
26424 : .get = py_lsa_OpenSecret_in_get_name,
26425 : .set = py_lsa_OpenSecret_in_set_name,
26426 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
26427 : },
26428 : {
26429 : .name = discard_const_p(char, "in_access_mask"),
26430 : .get = py_lsa_OpenSecret_in_get_access_mask,
26431 : .set = py_lsa_OpenSecret_in_set_access_mask,
26432 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SecretAccessMask")
26433 : },
26434 : {
26435 : .name = discard_const_p(char, "out_sec_handle"),
26436 : .get = py_lsa_OpenSecret_out_get_sec_handle,
26437 : .set = py_lsa_OpenSecret_out_set_sec_handle,
26438 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26439 : },
26440 : {
26441 : .name = discard_const_p(char, "result"),
26442 : .get = py_lsa_OpenSecret_get_result,
26443 : .set = py_lsa_OpenSecret_set_result,
26444 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26445 : },
26446 : { .name = NULL }
26447 : };
26448 :
26449 0 : static PyObject *py_lsa_OpenSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26450 : {
26451 0 : PyObject *self = pytalloc_new(struct lsa_OpenSecret, type);
26452 0 : struct lsa_OpenSecret *_self = (struct lsa_OpenSecret *)pytalloc_get_ptr(self);
26453 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26454 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
26455 0 : _self->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
26456 0 : return self;
26457 : }
26458 :
26459 0 : static PyObject *py_lsa_OpenSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26460 : {
26461 :
26462 :
26463 0 : return PyLong_FromLong(28);
26464 : }
26465 :
26466 0 : static PyObject *py_lsa_OpenSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26467 : {
26468 0 : const struct ndr_interface_call *call = NULL;
26469 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26470 0 : PyObject *ret = NULL;
26471 0 : struct ndr_push *push = NULL;
26472 0 : DATA_BLOB blob;
26473 0 : enum ndr_err_code err;
26474 :
26475 0 : if (ndr_table_lsarpc.num_calls < 29) {
26476 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_pack");
26477 0 : return NULL;
26478 : }
26479 0 : call = &ndr_table_lsarpc.calls[28];
26480 :
26481 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26482 0 : if (push == NULL) {
26483 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26484 0 : return NULL;
26485 : }
26486 :
26487 0 : push->flags |= ndr_push_flags;
26488 :
26489 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26490 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26491 0 : TALLOC_FREE(push);
26492 0 : PyErr_SetNdrError(err);
26493 0 : return NULL;
26494 : }
26495 0 : blob = ndr_push_blob(push);
26496 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26497 0 : TALLOC_FREE(push);
26498 0 : return ret;
26499 : }
26500 :
26501 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26502 : {
26503 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26504 0 : PyObject *bigendian_obj = NULL;
26505 0 : PyObject *ndr64_obj = NULL;
26506 0 : libndr_flags ndr_push_flags = 0;
26507 :
26508 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26509 : discard_const_p(char *, kwnames),
26510 : &bigendian_obj,
26511 : &ndr64_obj)) {
26512 0 : return NULL;
26513 : }
26514 :
26515 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26516 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26517 : }
26518 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26519 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26520 : }
26521 :
26522 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26523 : }
26524 :
26525 0 : static PyObject *py_lsa_OpenSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26526 : {
26527 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26528 0 : PyObject *bigendian_obj = NULL;
26529 0 : PyObject *ndr64_obj = NULL;
26530 0 : libndr_flags ndr_push_flags = 0;
26531 :
26532 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26533 : discard_const_p(char *, kwnames),
26534 : &bigendian_obj,
26535 : &ndr64_obj)) {
26536 0 : return NULL;
26537 : }
26538 :
26539 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26540 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26541 : }
26542 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26543 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26544 : }
26545 :
26546 0 : return py_lsa_OpenSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26547 : }
26548 :
26549 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)
26550 : {
26551 0 : const struct ndr_interface_call *call = NULL;
26552 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26553 0 : struct ndr_pull *pull = NULL;
26554 0 : enum ndr_err_code err;
26555 :
26556 0 : if (ndr_table_lsarpc.num_calls < 29) {
26557 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_unpack");
26558 0 : return NULL;
26559 : }
26560 0 : call = &ndr_table_lsarpc.calls[28];
26561 :
26562 0 : pull = ndr_pull_init_blob(blob, object);
26563 0 : if (pull == NULL) {
26564 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26565 0 : return NULL;
26566 : }
26567 :
26568 0 : pull->flags |= ndr_pull_flags;
26569 :
26570 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26571 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26572 0 : TALLOC_FREE(pull);
26573 0 : PyErr_SetNdrError(err);
26574 0 : return NULL;
26575 : }
26576 0 : if (!allow_remaining) {
26577 0 : uint32_t highest_ofs;
26578 :
26579 0 : if (pull->offset > pull->relative_highest_offset) {
26580 0 : highest_ofs = pull->offset;
26581 : } else {
26582 0 : highest_ofs = pull->relative_highest_offset;
26583 : }
26584 0 : if (highest_ofs < pull->data_size) {
26585 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26586 : "not all bytes consumed ofs[%u] size[%u]",
26587 : highest_ofs, pull->data_size);
26588 0 : TALLOC_FREE(pull);
26589 0 : PyErr_SetNdrError(err);
26590 0 : return NULL;
26591 : }
26592 : }
26593 :
26594 0 : TALLOC_FREE(pull);
26595 0 : Py_RETURN_NONE;
26596 : }
26597 :
26598 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26599 : {
26600 0 : DATA_BLOB blob;
26601 0 : Py_ssize_t blob_length = 0;
26602 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26603 0 : PyObject *bigendian_obj = NULL;
26604 0 : PyObject *ndr64_obj = NULL;
26605 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26606 0 : PyObject *allow_remaining_obj = NULL;
26607 0 : bool allow_remaining = false;
26608 :
26609 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26610 : discard_const_p(char *, kwnames),
26611 : &blob.data, &blob_length,
26612 : &bigendian_obj,
26613 : &ndr64_obj,
26614 : &allow_remaining_obj)) {
26615 0 : return NULL;
26616 : }
26617 0 : blob.length = blob_length;
26618 :
26619 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26620 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26621 : }
26622 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26623 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26624 : }
26625 :
26626 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26627 0 : allow_remaining = true;
26628 : }
26629 :
26630 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26631 : }
26632 :
26633 0 : static PyObject *py_lsa_OpenSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26634 : {
26635 0 : DATA_BLOB blob;
26636 0 : Py_ssize_t blob_length = 0;
26637 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26638 0 : PyObject *bigendian_obj = NULL;
26639 0 : PyObject *ndr64_obj = NULL;
26640 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26641 0 : PyObject *allow_remaining_obj = NULL;
26642 0 : bool allow_remaining = false;
26643 :
26644 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26645 : discard_const_p(char *, kwnames),
26646 : &blob.data, &blob_length,
26647 : &bigendian_obj,
26648 : &ndr64_obj,
26649 : &allow_remaining_obj)) {
26650 0 : return NULL;
26651 : }
26652 0 : blob.length = blob_length;
26653 :
26654 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26655 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26656 : }
26657 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26658 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26659 : }
26660 :
26661 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26662 0 : allow_remaining = true;
26663 : }
26664 :
26665 0 : return py_lsa_OpenSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26666 : }
26667 :
26668 0 : static PyObject *py_lsa_OpenSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26669 : {
26670 0 : const struct ndr_interface_call *call = NULL;
26671 0 : struct lsa_OpenSecret *object = pytalloc_get_ptr(py_obj);
26672 0 : PyObject *ret;
26673 0 : char *retstr;
26674 :
26675 0 : if (ndr_table_lsarpc.num_calls < 29) {
26676 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenSecret_ndr_print");
26677 0 : return NULL;
26678 : }
26679 0 : call = &ndr_table_lsarpc.calls[28];
26680 :
26681 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26682 0 : ret = PyUnicode_FromString(retstr);
26683 0 : TALLOC_FREE(retstr);
26684 :
26685 0 : return ret;
26686 : }
26687 :
26688 0 : static PyObject *py_lsa_OpenSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26689 : {
26690 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_in", NDR_IN);
26691 : }
26692 :
26693 0 : static PyObject *py_lsa_OpenSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26694 : {
26695 0 : return py_lsa_OpenSecret_ndr_print(py_obj, "lsa_OpenSecret_out", NDR_OUT);
26696 : }
26697 :
26698 : static PyMethodDef py_lsa_OpenSecret_methods[] = {
26699 : { "opnum", (PyCFunction)py_lsa_OpenSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
26700 : "lsa.OpenSecret.opnum() -> 28 (0x1c) " },
26701 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26702 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26703 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26704 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26705 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26706 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26707 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26708 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26709 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26710 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26711 : { NULL, NULL, 0, NULL }
26712 : };
26713 :
26714 :
26715 : static PyTypeObject lsa_OpenSecret_Type = {
26716 : PyVarObject_HEAD_INIT(NULL, 0)
26717 : .tp_name = "lsa.OpenSecret",
26718 : .tp_getset = py_lsa_OpenSecret_getsetters,
26719 : .tp_methods = py_lsa_OpenSecret_methods,
26720 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26721 : .tp_new = py_lsa_OpenSecret_new,
26722 : };
26723 :
26724 1 : static bool pack_py_lsa_OpenSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenSecret *r)
26725 : {
26726 0 : PyObject *py_handle;
26727 0 : PyObject *py_name;
26728 0 : PyObject *py_access_mask;
26729 1 : const char *kwnames[] = {
26730 : "handle", "name", "access_mask", NULL
26731 : };
26732 :
26733 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenSecret", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
26734 0 : return false;
26735 : }
26736 :
26737 1 : if (py_handle == NULL) {
26738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
26739 0 : return false;
26740 : }
26741 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
26742 1 : if (r->in.handle == NULL) {
26743 0 : PyErr_NoMemory();
26744 0 : return false;
26745 : }
26746 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
26747 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
26748 0 : PyErr_NoMemory();
26749 0 : return false;
26750 : }
26751 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
26752 1 : if (py_name == NULL) {
26753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
26754 0 : return false;
26755 : }
26756 1 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
26757 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
26758 0 : PyErr_NoMemory();
26759 0 : return false;
26760 : }
26761 1 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
26762 1 : if (py_access_mask == NULL) {
26763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
26764 0 : return false;
26765 : }
26766 : {
26767 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
26768 1 : if (PyLong_Check(py_access_mask)) {
26769 0 : unsigned long long test_var;
26770 1 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
26771 1 : if (PyErr_Occurred() != NULL) {
26772 0 : return false;
26773 : }
26774 1 : if (test_var > uint_max) {
26775 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26776 : PyLong_Type.tp_name, uint_max, test_var);
26777 0 : return false;
26778 : }
26779 1 : r->in.access_mask = test_var;
26780 : } else {
26781 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26782 : PyLong_Type.tp_name);
26783 0 : return false;
26784 : }
26785 : }
26786 1 : return true;
26787 : }
26788 :
26789 1 : static PyObject *unpack_py_lsa_OpenSecret_args_out(struct lsa_OpenSecret *r)
26790 : {
26791 0 : PyObject *result;
26792 0 : PyObject *py_sec_handle;
26793 1 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, r->out.sec_handle, r->out.sec_handle);
26794 1 : result = py_sec_handle;
26795 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
26796 0 : PyErr_SetNTSTATUS(r->out.result);
26797 0 : return NULL;
26798 : }
26799 :
26800 1 : return result;
26801 : }
26802 :
26803 :
26804 0 : static PyObject *py_lsa_SetSecret_in_get_sec_handle(PyObject *obj, void *closure)
26805 : {
26806 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(obj);
26807 0 : PyObject *py_sec_handle;
26808 0 : if (object->in.sec_handle == NULL) {
26809 0 : Py_RETURN_NONE;
26810 : }
26811 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
26812 0 : return py_sec_handle;
26813 : }
26814 :
26815 0 : static int py_lsa_SetSecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
26816 : {
26817 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
26818 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
26819 0 : if (value == NULL) {
26820 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sec_handle");
26821 0 : return -1;
26822 : }
26823 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
26824 0 : if (object->in.sec_handle == NULL) {
26825 0 : PyErr_NoMemory();
26826 0 : return -1;
26827 : }
26828 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26829 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26830 0 : PyErr_NoMemory();
26831 0 : return -1;
26832 : }
26833 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26834 0 : return 0;
26835 : }
26836 :
26837 0 : static PyObject *py_lsa_SetSecret_in_get_new_val(PyObject *obj, void *closure)
26838 : {
26839 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(obj);
26840 0 : PyObject *py_new_val;
26841 0 : if (object->in.new_val == NULL) {
26842 0 : Py_RETURN_NONE;
26843 : }
26844 0 : if (object->in.new_val == NULL) {
26845 0 : py_new_val = Py_None;
26846 0 : Py_INCREF(py_new_val);
26847 : } else {
26848 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.new_val, object->in.new_val);
26849 : }
26850 0 : return py_new_val;
26851 : }
26852 :
26853 0 : static int py_lsa_SetSecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
26854 : {
26855 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
26856 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
26857 0 : if (value == NULL) {
26858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_val");
26859 0 : return -1;
26860 : }
26861 0 : if (value == Py_None) {
26862 0 : object->in.new_val = NULL;
26863 : } else {
26864 0 : object->in.new_val = NULL;
26865 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
26866 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26867 0 : PyErr_NoMemory();
26868 0 : return -1;
26869 : }
26870 0 : object->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
26871 : }
26872 0 : return 0;
26873 : }
26874 :
26875 0 : static PyObject *py_lsa_SetSecret_in_get_old_val(PyObject *obj, void *closure)
26876 : {
26877 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(obj);
26878 0 : PyObject *py_old_val;
26879 0 : if (object->in.old_val == NULL) {
26880 0 : Py_RETURN_NONE;
26881 : }
26882 0 : if (object->in.old_val == NULL) {
26883 0 : py_old_val = Py_None;
26884 0 : Py_INCREF(py_old_val);
26885 : } else {
26886 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.old_val, object->in.old_val);
26887 : }
26888 0 : return py_old_val;
26889 : }
26890 :
26891 0 : static int py_lsa_SetSecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
26892 : {
26893 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
26894 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
26895 0 : if (value == NULL) {
26896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_val");
26897 0 : return -1;
26898 : }
26899 0 : if (value == Py_None) {
26900 0 : object->in.old_val = NULL;
26901 : } else {
26902 0 : object->in.old_val = NULL;
26903 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
26904 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26905 0 : PyErr_NoMemory();
26906 0 : return -1;
26907 : }
26908 0 : object->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
26909 : }
26910 0 : return 0;
26911 : }
26912 :
26913 0 : static PyObject *py_lsa_SetSecret_get_result(PyObject *obj, void *closure)
26914 : {
26915 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(obj);
26916 0 : PyObject *py_result;
26917 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26918 0 : return py_result;
26919 : }
26920 :
26921 0 : static int py_lsa_SetSecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
26922 : {
26923 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
26924 0 : if (value == NULL) {
26925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
26926 0 : return -1;
26927 : }
26928 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26929 0 : return 0;
26930 : }
26931 :
26932 : static PyGetSetDef py_lsa_SetSecret_getsetters[] = {
26933 : {
26934 : .name = discard_const_p(char, "in_sec_handle"),
26935 : .get = py_lsa_SetSecret_in_get_sec_handle,
26936 : .set = py_lsa_SetSecret_in_set_sec_handle,
26937 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26938 : },
26939 : {
26940 : .name = discard_const_p(char, "in_new_val"),
26941 : .get = py_lsa_SetSecret_in_get_new_val,
26942 : .set = py_lsa_SetSecret_in_set_new_val,
26943 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
26944 : },
26945 : {
26946 : .name = discard_const_p(char, "in_old_val"),
26947 : .get = py_lsa_SetSecret_in_get_old_val,
26948 : .set = py_lsa_SetSecret_in_set_old_val,
26949 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
26950 : },
26951 : {
26952 : .name = discard_const_p(char, "result"),
26953 : .get = py_lsa_SetSecret_get_result,
26954 : .set = py_lsa_SetSecret_set_result,
26955 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26956 : },
26957 : { .name = NULL }
26958 : };
26959 :
26960 0 : static PyObject *py_lsa_SetSecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26961 : {
26962 0 : PyObject *self = pytalloc_new(struct lsa_SetSecret, type);
26963 0 : struct lsa_SetSecret *_self = (struct lsa_SetSecret *)pytalloc_get_ptr(self);
26964 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26965 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
26966 0 : return self;
26967 : }
26968 :
26969 0 : static PyObject *py_lsa_SetSecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26970 : {
26971 :
26972 :
26973 0 : return PyLong_FromLong(29);
26974 : }
26975 :
26976 0 : static PyObject *py_lsa_SetSecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26977 : {
26978 0 : const struct ndr_interface_call *call = NULL;
26979 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
26980 0 : PyObject *ret = NULL;
26981 0 : struct ndr_push *push = NULL;
26982 0 : DATA_BLOB blob;
26983 0 : enum ndr_err_code err;
26984 :
26985 0 : if (ndr_table_lsarpc.num_calls < 30) {
26986 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_pack");
26987 0 : return NULL;
26988 : }
26989 0 : call = &ndr_table_lsarpc.calls[29];
26990 :
26991 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26992 0 : if (push == NULL) {
26993 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26994 0 : return NULL;
26995 : }
26996 :
26997 0 : push->flags |= ndr_push_flags;
26998 :
26999 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27000 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27001 0 : TALLOC_FREE(push);
27002 0 : PyErr_SetNdrError(err);
27003 0 : return NULL;
27004 : }
27005 0 : blob = ndr_push_blob(push);
27006 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27007 0 : TALLOC_FREE(push);
27008 0 : return ret;
27009 : }
27010 :
27011 0 : static PyObject *py_lsa_SetSecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27012 : {
27013 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27014 0 : PyObject *bigendian_obj = NULL;
27015 0 : PyObject *ndr64_obj = NULL;
27016 0 : libndr_flags ndr_push_flags = 0;
27017 :
27018 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27019 : discard_const_p(char *, kwnames),
27020 : &bigendian_obj,
27021 : &ndr64_obj)) {
27022 0 : return NULL;
27023 : }
27024 :
27025 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27026 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27027 : }
27028 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27029 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27030 : }
27031 :
27032 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27033 : }
27034 :
27035 0 : static PyObject *py_lsa_SetSecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27036 : {
27037 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27038 0 : PyObject *bigendian_obj = NULL;
27039 0 : PyObject *ndr64_obj = NULL;
27040 0 : libndr_flags ndr_push_flags = 0;
27041 :
27042 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27043 : discard_const_p(char *, kwnames),
27044 : &bigendian_obj,
27045 : &ndr64_obj)) {
27046 0 : return NULL;
27047 : }
27048 :
27049 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27050 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27051 : }
27052 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27053 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27054 : }
27055 :
27056 0 : return py_lsa_SetSecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27057 : }
27058 :
27059 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)
27060 : {
27061 0 : const struct ndr_interface_call *call = NULL;
27062 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
27063 0 : struct ndr_pull *pull = NULL;
27064 0 : enum ndr_err_code err;
27065 :
27066 0 : if (ndr_table_lsarpc.num_calls < 30) {
27067 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_unpack");
27068 0 : return NULL;
27069 : }
27070 0 : call = &ndr_table_lsarpc.calls[29];
27071 :
27072 0 : pull = ndr_pull_init_blob(blob, object);
27073 0 : if (pull == NULL) {
27074 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27075 0 : return NULL;
27076 : }
27077 :
27078 0 : pull->flags |= ndr_pull_flags;
27079 :
27080 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27081 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27082 0 : TALLOC_FREE(pull);
27083 0 : PyErr_SetNdrError(err);
27084 0 : return NULL;
27085 : }
27086 0 : if (!allow_remaining) {
27087 0 : uint32_t highest_ofs;
27088 :
27089 0 : if (pull->offset > pull->relative_highest_offset) {
27090 0 : highest_ofs = pull->offset;
27091 : } else {
27092 0 : highest_ofs = pull->relative_highest_offset;
27093 : }
27094 0 : if (highest_ofs < pull->data_size) {
27095 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27096 : "not all bytes consumed ofs[%u] size[%u]",
27097 : highest_ofs, pull->data_size);
27098 0 : TALLOC_FREE(pull);
27099 0 : PyErr_SetNdrError(err);
27100 0 : return NULL;
27101 : }
27102 : }
27103 :
27104 0 : TALLOC_FREE(pull);
27105 0 : Py_RETURN_NONE;
27106 : }
27107 :
27108 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27109 : {
27110 0 : DATA_BLOB blob;
27111 0 : Py_ssize_t blob_length = 0;
27112 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27113 0 : PyObject *bigendian_obj = NULL;
27114 0 : PyObject *ndr64_obj = NULL;
27115 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27116 0 : PyObject *allow_remaining_obj = NULL;
27117 0 : bool allow_remaining = false;
27118 :
27119 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27120 : discard_const_p(char *, kwnames),
27121 : &blob.data, &blob_length,
27122 : &bigendian_obj,
27123 : &ndr64_obj,
27124 : &allow_remaining_obj)) {
27125 0 : return NULL;
27126 : }
27127 0 : blob.length = blob_length;
27128 :
27129 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27130 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27131 : }
27132 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27133 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27134 : }
27135 :
27136 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27137 0 : allow_remaining = true;
27138 : }
27139 :
27140 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27141 : }
27142 :
27143 0 : static PyObject *py_lsa_SetSecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27144 : {
27145 0 : DATA_BLOB blob;
27146 0 : Py_ssize_t blob_length = 0;
27147 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27148 0 : PyObject *bigendian_obj = NULL;
27149 0 : PyObject *ndr64_obj = NULL;
27150 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27151 0 : PyObject *allow_remaining_obj = NULL;
27152 0 : bool allow_remaining = false;
27153 :
27154 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27155 : discard_const_p(char *, kwnames),
27156 : &blob.data, &blob_length,
27157 : &bigendian_obj,
27158 : &ndr64_obj,
27159 : &allow_remaining_obj)) {
27160 0 : return NULL;
27161 : }
27162 0 : blob.length = blob_length;
27163 :
27164 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27165 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27166 : }
27167 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27168 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27169 : }
27170 :
27171 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27172 0 : allow_remaining = true;
27173 : }
27174 :
27175 0 : return py_lsa_SetSecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27176 : }
27177 :
27178 0 : static PyObject *py_lsa_SetSecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27179 : {
27180 0 : const struct ndr_interface_call *call = NULL;
27181 0 : struct lsa_SetSecret *object = pytalloc_get_ptr(py_obj);
27182 0 : PyObject *ret;
27183 0 : char *retstr;
27184 :
27185 0 : if (ndr_table_lsarpc.num_calls < 30) {
27186 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetSecret_ndr_print");
27187 0 : return NULL;
27188 : }
27189 0 : call = &ndr_table_lsarpc.calls[29];
27190 :
27191 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27192 0 : ret = PyUnicode_FromString(retstr);
27193 0 : TALLOC_FREE(retstr);
27194 :
27195 0 : return ret;
27196 : }
27197 :
27198 0 : static PyObject *py_lsa_SetSecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27199 : {
27200 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_in", NDR_IN);
27201 : }
27202 :
27203 0 : static PyObject *py_lsa_SetSecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27204 : {
27205 0 : return py_lsa_SetSecret_ndr_print(py_obj, "lsa_SetSecret_out", NDR_OUT);
27206 : }
27207 :
27208 : static PyMethodDef py_lsa_SetSecret_methods[] = {
27209 : { "opnum", (PyCFunction)py_lsa_SetSecret_ndr_opnum, METH_NOARGS|METH_CLASS,
27210 : "lsa.SetSecret.opnum() -> 29 (0x1d) " },
27211 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27212 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27213 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27214 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27215 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27216 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27217 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetSecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27218 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27219 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetSecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27220 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetSecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27221 : { NULL, NULL, 0, NULL }
27222 : };
27223 :
27224 :
27225 : static PyTypeObject lsa_SetSecret_Type = {
27226 : PyVarObject_HEAD_INIT(NULL, 0)
27227 : .tp_name = "lsa.SetSecret",
27228 : .tp_getset = py_lsa_SetSecret_getsetters,
27229 : .tp_methods = py_lsa_SetSecret_methods,
27230 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27231 : .tp_new = py_lsa_SetSecret_new,
27232 : };
27233 :
27234 0 : static bool pack_py_lsa_SetSecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetSecret *r)
27235 : {
27236 0 : PyObject *py_sec_handle;
27237 0 : PyObject *py_new_val;
27238 0 : PyObject *py_old_val;
27239 0 : const char *kwnames[] = {
27240 : "sec_handle", "new_val", "old_val", NULL
27241 : };
27242 :
27243 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetSecret", discard_const_p(char *, kwnames), &py_sec_handle, &py_new_val, &py_old_val)) {
27244 0 : return false;
27245 : }
27246 :
27247 0 : if (py_sec_handle == NULL) {
27248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sec_handle");
27249 0 : return false;
27250 : }
27251 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
27252 0 : if (r->in.sec_handle == NULL) {
27253 0 : PyErr_NoMemory();
27254 0 : return false;
27255 : }
27256 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
27257 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
27258 0 : PyErr_NoMemory();
27259 0 : return false;
27260 : }
27261 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
27262 0 : if (py_new_val == NULL) {
27263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_val");
27264 0 : return false;
27265 : }
27266 0 : if (py_new_val == Py_None) {
27267 0 : r->in.new_val = NULL;
27268 : } else {
27269 0 : r->in.new_val = NULL;
27270 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_new_val, return false;);
27271 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
27272 0 : PyErr_NoMemory();
27273 0 : return false;
27274 : }
27275 0 : r->in.new_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_new_val);
27276 : }
27277 0 : if (py_old_val == NULL) {
27278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_val");
27279 0 : return false;
27280 : }
27281 0 : if (py_old_val == Py_None) {
27282 0 : r->in.old_val = NULL;
27283 : } else {
27284 0 : r->in.old_val = NULL;
27285 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_old_val, return false;);
27286 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
27287 0 : PyErr_NoMemory();
27288 0 : return false;
27289 : }
27290 0 : r->in.old_val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_old_val);
27291 : }
27292 0 : return true;
27293 : }
27294 :
27295 0 : static PyObject *unpack_py_lsa_SetSecret_args_out(struct lsa_SetSecret *r)
27296 : {
27297 0 : PyObject *result;
27298 0 : result = Py_None;
27299 0 : Py_INCREF(result);
27300 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27301 0 : PyErr_SetNTSTATUS(r->out.result);
27302 0 : return NULL;
27303 : }
27304 :
27305 0 : return result;
27306 : }
27307 :
27308 :
27309 0 : static PyObject *py_lsa_QuerySecret_in_get_sec_handle(PyObject *obj, void *closure)
27310 : {
27311 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27312 0 : PyObject *py_sec_handle;
27313 0 : if (object->in.sec_handle == NULL) {
27314 0 : Py_RETURN_NONE;
27315 : }
27316 0 : py_sec_handle = pytalloc_reference_ex(policy_handle_Type, object->in.sec_handle, object->in.sec_handle);
27317 0 : return py_sec_handle;
27318 : }
27319 :
27320 0 : static int py_lsa_QuerySecret_in_set_sec_handle(PyObject *py_obj, PyObject *value, void *closure)
27321 : {
27322 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27323 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sec_handle));
27324 0 : if (value == NULL) {
27325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sec_handle");
27326 0 : return -1;
27327 : }
27328 0 : object->in.sec_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sec_handle);
27329 0 : if (object->in.sec_handle == NULL) {
27330 0 : PyErr_NoMemory();
27331 0 : return -1;
27332 : }
27333 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27334 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27335 0 : PyErr_NoMemory();
27336 0 : return -1;
27337 : }
27338 0 : object->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(value);
27339 0 : return 0;
27340 : }
27341 :
27342 0 : static PyObject *py_lsa_QuerySecret_in_get_new_val(PyObject *obj, void *closure)
27343 : {
27344 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27345 0 : PyObject *py_new_val;
27346 0 : if (object->in.new_val == NULL) {
27347 0 : Py_RETURN_NONE;
27348 : }
27349 0 : if (object->in.new_val == NULL) {
27350 0 : py_new_val = Py_None;
27351 0 : Py_INCREF(py_new_val);
27352 : } else {
27353 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.new_val, object->in.new_val);
27354 : }
27355 0 : return py_new_val;
27356 : }
27357 :
27358 0 : static int py_lsa_QuerySecret_in_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
27359 : {
27360 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27361 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_val));
27362 0 : if (value == NULL) {
27363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_val");
27364 0 : return -1;
27365 : }
27366 0 : if (value == Py_None) {
27367 0 : object->in.new_val = NULL;
27368 : } else {
27369 0 : object->in.new_val = NULL;
27370 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
27371 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27372 0 : PyErr_NoMemory();
27373 0 : return -1;
27374 : }
27375 0 : object->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
27376 : }
27377 0 : return 0;
27378 : }
27379 :
27380 0 : static PyObject *py_lsa_QuerySecret_out_get_new_val(PyObject *obj, void *closure)
27381 : {
27382 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27383 0 : PyObject *py_new_val;
27384 0 : if (object->out.new_val == NULL) {
27385 0 : Py_RETURN_NONE;
27386 : }
27387 0 : if (object->out.new_val == NULL) {
27388 0 : py_new_val = Py_None;
27389 0 : Py_INCREF(py_new_val);
27390 : } else {
27391 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.new_val, object->out.new_val);
27392 : }
27393 0 : return py_new_val;
27394 : }
27395 :
27396 0 : static int py_lsa_QuerySecret_out_set_new_val(PyObject *py_obj, PyObject *value, void *closure)
27397 : {
27398 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27399 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_val));
27400 0 : if (value == NULL) {
27401 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.new_val");
27402 0 : return -1;
27403 : }
27404 0 : if (value == Py_None) {
27405 0 : object->out.new_val = NULL;
27406 : } else {
27407 0 : object->out.new_val = NULL;
27408 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
27409 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27410 0 : PyErr_NoMemory();
27411 0 : return -1;
27412 : }
27413 0 : object->out.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
27414 : }
27415 0 : return 0;
27416 : }
27417 :
27418 0 : static PyObject *py_lsa_QuerySecret_in_get_new_mtime(PyObject *obj, void *closure)
27419 : {
27420 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27421 0 : PyObject *py_new_mtime;
27422 0 : if (object->in.new_mtime == NULL) {
27423 0 : Py_RETURN_NONE;
27424 : }
27425 0 : if (object->in.new_mtime == NULL) {
27426 0 : py_new_mtime = Py_None;
27427 0 : Py_INCREF(py_new_mtime);
27428 : } else {
27429 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->in.new_mtime);
27430 : }
27431 0 : return py_new_mtime;
27432 : }
27433 :
27434 0 : static int py_lsa_QuerySecret_in_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
27435 : {
27436 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27437 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_mtime));
27438 0 : if (value == NULL) {
27439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.new_mtime");
27440 0 : return -1;
27441 : }
27442 0 : if (value == Py_None) {
27443 0 : object->in.new_mtime = NULL;
27444 : } else {
27445 0 : object->in.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.new_mtime);
27446 0 : if (object->in.new_mtime == NULL) {
27447 0 : PyErr_NoMemory();
27448 0 : return -1;
27449 : }
27450 : {
27451 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.new_mtime));
27452 0 : if (PyLong_Check(value)) {
27453 0 : unsigned long long test_var;
27454 0 : test_var = PyLong_AsUnsignedLongLong(value);
27455 0 : if (PyErr_Occurred() != NULL) {
27456 0 : return -1;
27457 : }
27458 0 : if (test_var > uint_max) {
27459 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27460 : PyLong_Type.tp_name, uint_max, test_var);
27461 0 : return -1;
27462 : }
27463 0 : *object->in.new_mtime = test_var;
27464 : } else {
27465 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27466 : PyLong_Type.tp_name);
27467 0 : return -1;
27468 : }
27469 : }
27470 : }
27471 0 : return 0;
27472 : }
27473 :
27474 0 : static PyObject *py_lsa_QuerySecret_out_get_new_mtime(PyObject *obj, void *closure)
27475 : {
27476 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27477 0 : PyObject *py_new_mtime;
27478 0 : if (object->out.new_mtime == NULL) {
27479 0 : Py_RETURN_NONE;
27480 : }
27481 0 : if (object->out.new_mtime == NULL) {
27482 0 : py_new_mtime = Py_None;
27483 0 : Py_INCREF(py_new_mtime);
27484 : } else {
27485 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*object->out.new_mtime);
27486 : }
27487 0 : return py_new_mtime;
27488 : }
27489 :
27490 0 : static int py_lsa_QuerySecret_out_set_new_mtime(PyObject *py_obj, PyObject *value, void *closure)
27491 : {
27492 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27493 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.new_mtime));
27494 0 : if (value == NULL) {
27495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.new_mtime");
27496 0 : return -1;
27497 : }
27498 0 : if (value == Py_None) {
27499 0 : object->out.new_mtime = NULL;
27500 : } else {
27501 0 : object->out.new_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.new_mtime);
27502 0 : if (object->out.new_mtime == NULL) {
27503 0 : PyErr_NoMemory();
27504 0 : return -1;
27505 : }
27506 : {
27507 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.new_mtime));
27508 0 : if (PyLong_Check(value)) {
27509 0 : unsigned long long test_var;
27510 0 : test_var = PyLong_AsUnsignedLongLong(value);
27511 0 : if (PyErr_Occurred() != NULL) {
27512 0 : return -1;
27513 : }
27514 0 : if (test_var > uint_max) {
27515 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27516 : PyLong_Type.tp_name, uint_max, test_var);
27517 0 : return -1;
27518 : }
27519 0 : *object->out.new_mtime = test_var;
27520 : } else {
27521 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27522 : PyLong_Type.tp_name);
27523 0 : return -1;
27524 : }
27525 : }
27526 : }
27527 0 : return 0;
27528 : }
27529 :
27530 0 : static PyObject *py_lsa_QuerySecret_in_get_old_val(PyObject *obj, void *closure)
27531 : {
27532 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27533 0 : PyObject *py_old_val;
27534 0 : if (object->in.old_val == NULL) {
27535 0 : Py_RETURN_NONE;
27536 : }
27537 0 : if (object->in.old_val == NULL) {
27538 0 : py_old_val = Py_None;
27539 0 : Py_INCREF(py_old_val);
27540 : } else {
27541 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->in.old_val, object->in.old_val);
27542 : }
27543 0 : return py_old_val;
27544 : }
27545 :
27546 0 : static int py_lsa_QuerySecret_in_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
27547 : {
27548 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27549 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_val));
27550 0 : if (value == NULL) {
27551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_val");
27552 0 : return -1;
27553 : }
27554 0 : if (value == Py_None) {
27555 0 : object->in.old_val = NULL;
27556 : } else {
27557 0 : object->in.old_val = NULL;
27558 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
27559 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27560 0 : PyErr_NoMemory();
27561 0 : return -1;
27562 : }
27563 0 : object->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
27564 : }
27565 0 : return 0;
27566 : }
27567 :
27568 0 : static PyObject *py_lsa_QuerySecret_out_get_old_val(PyObject *obj, void *closure)
27569 : {
27570 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27571 0 : PyObject *py_old_val;
27572 0 : if (object->out.old_val == NULL) {
27573 0 : Py_RETURN_NONE;
27574 : }
27575 0 : if (object->out.old_val == NULL) {
27576 0 : py_old_val = Py_None;
27577 0 : Py_INCREF(py_old_val);
27578 : } else {
27579 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, object->out.old_val, object->out.old_val);
27580 : }
27581 0 : return py_old_val;
27582 : }
27583 :
27584 0 : static int py_lsa_QuerySecret_out_set_old_val(PyObject *py_obj, PyObject *value, void *closure)
27585 : {
27586 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_val));
27588 0 : if (value == NULL) {
27589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.old_val");
27590 0 : return -1;
27591 : }
27592 0 : if (value == Py_None) {
27593 0 : object->out.old_val = NULL;
27594 : } else {
27595 0 : object->out.old_val = NULL;
27596 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, value, return -1;);
27597 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27598 0 : PyErr_NoMemory();
27599 0 : return -1;
27600 : }
27601 0 : object->out.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(value);
27602 : }
27603 0 : return 0;
27604 : }
27605 :
27606 0 : static PyObject *py_lsa_QuerySecret_in_get_old_mtime(PyObject *obj, void *closure)
27607 : {
27608 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27609 0 : PyObject *py_old_mtime;
27610 0 : if (object->in.old_mtime == NULL) {
27611 0 : Py_RETURN_NONE;
27612 : }
27613 0 : if (object->in.old_mtime == NULL) {
27614 0 : py_old_mtime = Py_None;
27615 0 : Py_INCREF(py_old_mtime);
27616 : } else {
27617 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->in.old_mtime);
27618 : }
27619 0 : return py_old_mtime;
27620 : }
27621 :
27622 0 : static int py_lsa_QuerySecret_in_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
27623 : {
27624 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27625 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_mtime));
27626 0 : if (value == NULL) {
27627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.old_mtime");
27628 0 : return -1;
27629 : }
27630 0 : if (value == Py_None) {
27631 0 : object->in.old_mtime = NULL;
27632 : } else {
27633 0 : object->in.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.old_mtime);
27634 0 : if (object->in.old_mtime == NULL) {
27635 0 : PyErr_NoMemory();
27636 0 : return -1;
27637 : }
27638 : {
27639 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.old_mtime));
27640 0 : if (PyLong_Check(value)) {
27641 0 : unsigned long long test_var;
27642 0 : test_var = PyLong_AsUnsignedLongLong(value);
27643 0 : if (PyErr_Occurred() != NULL) {
27644 0 : return -1;
27645 : }
27646 0 : if (test_var > uint_max) {
27647 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27648 : PyLong_Type.tp_name, uint_max, test_var);
27649 0 : return -1;
27650 : }
27651 0 : *object->in.old_mtime = test_var;
27652 : } else {
27653 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27654 : PyLong_Type.tp_name);
27655 0 : return -1;
27656 : }
27657 : }
27658 : }
27659 0 : return 0;
27660 : }
27661 :
27662 0 : static PyObject *py_lsa_QuerySecret_out_get_old_mtime(PyObject *obj, void *closure)
27663 : {
27664 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27665 0 : PyObject *py_old_mtime;
27666 0 : if (object->out.old_mtime == NULL) {
27667 0 : Py_RETURN_NONE;
27668 : }
27669 0 : if (object->out.old_mtime == NULL) {
27670 0 : py_old_mtime = Py_None;
27671 0 : Py_INCREF(py_old_mtime);
27672 : } else {
27673 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*object->out.old_mtime);
27674 : }
27675 0 : return py_old_mtime;
27676 : }
27677 :
27678 0 : static int py_lsa_QuerySecret_out_set_old_mtime(PyObject *py_obj, PyObject *value, void *closure)
27679 : {
27680 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27681 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.old_mtime));
27682 0 : if (value == NULL) {
27683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.old_mtime");
27684 0 : return -1;
27685 : }
27686 0 : if (value == Py_None) {
27687 0 : object->out.old_mtime = NULL;
27688 : } else {
27689 0 : object->out.old_mtime = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.old_mtime);
27690 0 : if (object->out.old_mtime == NULL) {
27691 0 : PyErr_NoMemory();
27692 0 : return -1;
27693 : }
27694 : {
27695 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.old_mtime));
27696 0 : if (PyLong_Check(value)) {
27697 0 : unsigned long long test_var;
27698 0 : test_var = PyLong_AsUnsignedLongLong(value);
27699 0 : if (PyErr_Occurred() != NULL) {
27700 0 : return -1;
27701 : }
27702 0 : if (test_var > uint_max) {
27703 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27704 : PyLong_Type.tp_name, uint_max, test_var);
27705 0 : return -1;
27706 : }
27707 0 : *object->out.old_mtime = test_var;
27708 : } else {
27709 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27710 : PyLong_Type.tp_name);
27711 0 : return -1;
27712 : }
27713 : }
27714 : }
27715 0 : return 0;
27716 : }
27717 :
27718 0 : static PyObject *py_lsa_QuerySecret_get_result(PyObject *obj, void *closure)
27719 : {
27720 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(obj);
27721 0 : PyObject *py_result;
27722 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27723 0 : return py_result;
27724 : }
27725 :
27726 0 : static int py_lsa_QuerySecret_set_result(PyObject *py_obj, PyObject *value, void *closure)
27727 : {
27728 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27729 0 : if (value == NULL) {
27730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
27731 0 : return -1;
27732 : }
27733 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27734 0 : return 0;
27735 : }
27736 :
27737 : static PyGetSetDef py_lsa_QuerySecret_getsetters[] = {
27738 : {
27739 : .name = discard_const_p(char, "in_sec_handle"),
27740 : .get = py_lsa_QuerySecret_in_get_sec_handle,
27741 : .set = py_lsa_QuerySecret_in_set_sec_handle,
27742 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27743 : },
27744 : {
27745 : .name = discard_const_p(char, "in_new_val"),
27746 : .get = py_lsa_QuerySecret_in_get_new_val,
27747 : .set = py_lsa_QuerySecret_in_set_new_val,
27748 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
27749 : },
27750 : {
27751 : .name = discard_const_p(char, "out_new_val"),
27752 : .get = py_lsa_QuerySecret_out_get_new_val,
27753 : .set = py_lsa_QuerySecret_out_set_new_val,
27754 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
27755 : },
27756 : {
27757 : .name = discard_const_p(char, "in_new_mtime"),
27758 : .get = py_lsa_QuerySecret_in_get_new_mtime,
27759 : .set = py_lsa_QuerySecret_in_set_new_mtime,
27760 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
27761 : },
27762 : {
27763 : .name = discard_const_p(char, "out_new_mtime"),
27764 : .get = py_lsa_QuerySecret_out_get_new_mtime,
27765 : .set = py_lsa_QuerySecret_out_set_new_mtime,
27766 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
27767 : },
27768 : {
27769 : .name = discard_const_p(char, "in_old_val"),
27770 : .get = py_lsa_QuerySecret_in_get_old_val,
27771 : .set = py_lsa_QuerySecret_in_set_old_val,
27772 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
27773 : },
27774 : {
27775 : .name = discard_const_p(char, "out_old_val"),
27776 : .get = py_lsa_QuerySecret_out_get_old_val,
27777 : .set = py_lsa_QuerySecret_out_set_old_val,
27778 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF_PTR")
27779 : },
27780 : {
27781 : .name = discard_const_p(char, "in_old_mtime"),
27782 : .get = py_lsa_QuerySecret_in_get_old_mtime,
27783 : .set = py_lsa_QuerySecret_in_set_old_mtime,
27784 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
27785 : },
27786 : {
27787 : .name = discard_const_p(char, "out_old_mtime"),
27788 : .get = py_lsa_QuerySecret_out_get_old_mtime,
27789 : .set = py_lsa_QuerySecret_out_set_old_mtime,
27790 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
27791 : },
27792 : {
27793 : .name = discard_const_p(char, "result"),
27794 : .get = py_lsa_QuerySecret_get_result,
27795 : .set = py_lsa_QuerySecret_set_result,
27796 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27797 : },
27798 : { .name = NULL }
27799 : };
27800 :
27801 0 : static PyObject *py_lsa_QuerySecret_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27802 : {
27803 0 : PyObject *self = pytalloc_new(struct lsa_QuerySecret, type);
27804 0 : struct lsa_QuerySecret *_self = (struct lsa_QuerySecret *)pytalloc_get_ptr(self);
27805 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27806 0 : _self->in.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
27807 0 : return self;
27808 : }
27809 :
27810 0 : static PyObject *py_lsa_QuerySecret_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27811 : {
27812 :
27813 :
27814 0 : return PyLong_FromLong(30);
27815 : }
27816 :
27817 0 : static PyObject *py_lsa_QuerySecret_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27818 : {
27819 0 : const struct ndr_interface_call *call = NULL;
27820 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27821 0 : PyObject *ret = NULL;
27822 0 : struct ndr_push *push = NULL;
27823 0 : DATA_BLOB blob;
27824 0 : enum ndr_err_code err;
27825 :
27826 0 : if (ndr_table_lsarpc.num_calls < 31) {
27827 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_pack");
27828 0 : return NULL;
27829 : }
27830 0 : call = &ndr_table_lsarpc.calls[30];
27831 :
27832 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27833 0 : if (push == NULL) {
27834 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27835 0 : return NULL;
27836 : }
27837 :
27838 0 : push->flags |= ndr_push_flags;
27839 :
27840 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27841 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27842 0 : TALLOC_FREE(push);
27843 0 : PyErr_SetNdrError(err);
27844 0 : return NULL;
27845 : }
27846 0 : blob = ndr_push_blob(push);
27847 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27848 0 : TALLOC_FREE(push);
27849 0 : return ret;
27850 : }
27851 :
27852 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27853 : {
27854 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27855 0 : PyObject *bigendian_obj = NULL;
27856 0 : PyObject *ndr64_obj = NULL;
27857 0 : libndr_flags ndr_push_flags = 0;
27858 :
27859 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27860 : discard_const_p(char *, kwnames),
27861 : &bigendian_obj,
27862 : &ndr64_obj)) {
27863 0 : return NULL;
27864 : }
27865 :
27866 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27867 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27868 : }
27869 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27870 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27871 : }
27872 :
27873 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27874 : }
27875 :
27876 0 : static PyObject *py_lsa_QuerySecret_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27877 : {
27878 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27879 0 : PyObject *bigendian_obj = NULL;
27880 0 : PyObject *ndr64_obj = NULL;
27881 0 : libndr_flags ndr_push_flags = 0;
27882 :
27883 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27884 : discard_const_p(char *, kwnames),
27885 : &bigendian_obj,
27886 : &ndr64_obj)) {
27887 0 : return NULL;
27888 : }
27889 :
27890 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27891 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27892 : }
27893 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27894 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27895 : }
27896 :
27897 0 : return py_lsa_QuerySecret_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27898 : }
27899 :
27900 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)
27901 : {
27902 0 : const struct ndr_interface_call *call = NULL;
27903 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
27904 0 : struct ndr_pull *pull = NULL;
27905 0 : enum ndr_err_code err;
27906 :
27907 0 : if (ndr_table_lsarpc.num_calls < 31) {
27908 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_unpack");
27909 0 : return NULL;
27910 : }
27911 0 : call = &ndr_table_lsarpc.calls[30];
27912 :
27913 0 : pull = ndr_pull_init_blob(blob, object);
27914 0 : if (pull == NULL) {
27915 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27916 0 : return NULL;
27917 : }
27918 :
27919 0 : pull->flags |= ndr_pull_flags;
27920 :
27921 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27922 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27923 0 : TALLOC_FREE(pull);
27924 0 : PyErr_SetNdrError(err);
27925 0 : return NULL;
27926 : }
27927 0 : if (!allow_remaining) {
27928 0 : uint32_t highest_ofs;
27929 :
27930 0 : if (pull->offset > pull->relative_highest_offset) {
27931 0 : highest_ofs = pull->offset;
27932 : } else {
27933 0 : highest_ofs = pull->relative_highest_offset;
27934 : }
27935 0 : if (highest_ofs < pull->data_size) {
27936 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27937 : "not all bytes consumed ofs[%u] size[%u]",
27938 : highest_ofs, pull->data_size);
27939 0 : TALLOC_FREE(pull);
27940 0 : PyErr_SetNdrError(err);
27941 0 : return NULL;
27942 : }
27943 : }
27944 :
27945 0 : TALLOC_FREE(pull);
27946 0 : Py_RETURN_NONE;
27947 : }
27948 :
27949 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27950 : {
27951 0 : DATA_BLOB blob;
27952 0 : Py_ssize_t blob_length = 0;
27953 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27954 0 : PyObject *bigendian_obj = NULL;
27955 0 : PyObject *ndr64_obj = NULL;
27956 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27957 0 : PyObject *allow_remaining_obj = NULL;
27958 0 : bool allow_remaining = false;
27959 :
27960 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27961 : discard_const_p(char *, kwnames),
27962 : &blob.data, &blob_length,
27963 : &bigendian_obj,
27964 : &ndr64_obj,
27965 : &allow_remaining_obj)) {
27966 0 : return NULL;
27967 : }
27968 0 : blob.length = blob_length;
27969 :
27970 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27971 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27972 : }
27973 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27974 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27975 : }
27976 :
27977 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27978 0 : allow_remaining = true;
27979 : }
27980 :
27981 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27982 : }
27983 :
27984 0 : static PyObject *py_lsa_QuerySecret_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27985 : {
27986 0 : DATA_BLOB blob;
27987 0 : Py_ssize_t blob_length = 0;
27988 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27989 0 : PyObject *bigendian_obj = NULL;
27990 0 : PyObject *ndr64_obj = NULL;
27991 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27992 0 : PyObject *allow_remaining_obj = NULL;
27993 0 : bool allow_remaining = false;
27994 :
27995 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27996 : discard_const_p(char *, kwnames),
27997 : &blob.data, &blob_length,
27998 : &bigendian_obj,
27999 : &ndr64_obj,
28000 : &allow_remaining_obj)) {
28001 0 : return NULL;
28002 : }
28003 0 : blob.length = blob_length;
28004 :
28005 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28006 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28007 : }
28008 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28009 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28010 : }
28011 :
28012 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28013 0 : allow_remaining = true;
28014 : }
28015 :
28016 0 : return py_lsa_QuerySecret_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28017 : }
28018 :
28019 0 : static PyObject *py_lsa_QuerySecret_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28020 : {
28021 0 : const struct ndr_interface_call *call = NULL;
28022 0 : struct lsa_QuerySecret *object = pytalloc_get_ptr(py_obj);
28023 0 : PyObject *ret;
28024 0 : char *retstr;
28025 :
28026 0 : if (ndr_table_lsarpc.num_calls < 31) {
28027 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QuerySecret_ndr_print");
28028 0 : return NULL;
28029 : }
28030 0 : call = &ndr_table_lsarpc.calls[30];
28031 :
28032 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28033 0 : ret = PyUnicode_FromString(retstr);
28034 0 : TALLOC_FREE(retstr);
28035 :
28036 0 : return ret;
28037 : }
28038 :
28039 0 : static PyObject *py_lsa_QuerySecret_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28040 : {
28041 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_in", NDR_IN);
28042 : }
28043 :
28044 0 : static PyObject *py_lsa_QuerySecret_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28045 : {
28046 0 : return py_lsa_QuerySecret_ndr_print(py_obj, "lsa_QuerySecret_out", NDR_OUT);
28047 : }
28048 :
28049 : static PyMethodDef py_lsa_QuerySecret_methods[] = {
28050 : { "opnum", (PyCFunction)py_lsa_QuerySecret_ndr_opnum, METH_NOARGS|METH_CLASS,
28051 : "lsa.QuerySecret.opnum() -> 30 (0x1e) " },
28052 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28053 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28054 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28055 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28056 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28057 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28058 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QuerySecret_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28059 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28060 : { "__ndr_print_in__", (PyCFunction)py_lsa_QuerySecret_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28061 : { "__ndr_print_out__", (PyCFunction)py_lsa_QuerySecret_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28062 : { NULL, NULL, 0, NULL }
28063 : };
28064 :
28065 :
28066 : static PyTypeObject lsa_QuerySecret_Type = {
28067 : PyVarObject_HEAD_INIT(NULL, 0)
28068 : .tp_name = "lsa.QuerySecret",
28069 : .tp_getset = py_lsa_QuerySecret_getsetters,
28070 : .tp_methods = py_lsa_QuerySecret_methods,
28071 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28072 : .tp_new = py_lsa_QuerySecret_new,
28073 : };
28074 :
28075 0 : static bool pack_py_lsa_QuerySecret_args_in(PyObject *args, PyObject *kwargs, struct lsa_QuerySecret *r)
28076 : {
28077 0 : PyObject *py_sec_handle;
28078 0 : PyObject *py_new_val;
28079 0 : PyObject *py_new_mtime;
28080 0 : PyObject *py_old_val;
28081 0 : PyObject *py_old_mtime;
28082 0 : const char *kwnames[] = {
28083 : "sec_handle", "new_val", "new_mtime", "old_val", "old_mtime", NULL
28084 : };
28085 :
28086 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)) {
28087 0 : return false;
28088 : }
28089 :
28090 0 : if (py_sec_handle == NULL) {
28091 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sec_handle");
28092 0 : return false;
28093 : }
28094 0 : r->in.sec_handle = talloc_ptrtype(r, r->in.sec_handle);
28095 0 : if (r->in.sec_handle == NULL) {
28096 0 : PyErr_NoMemory();
28097 0 : return false;
28098 : }
28099 0 : PY_CHECK_TYPE(policy_handle_Type, py_sec_handle, return false;);
28100 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sec_handle)) == NULL) {
28101 0 : PyErr_NoMemory();
28102 0 : return false;
28103 : }
28104 0 : r->in.sec_handle = (struct policy_handle *)pytalloc_get_ptr(py_sec_handle);
28105 0 : if (py_new_val == NULL) {
28106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_val");
28107 0 : return false;
28108 : }
28109 0 : if (py_new_val == Py_None) {
28110 0 : r->in.new_val = NULL;
28111 : } else {
28112 0 : r->in.new_val = NULL;
28113 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_new_val, return false;);
28114 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_val)) == NULL) {
28115 0 : PyErr_NoMemory();
28116 0 : return false;
28117 : }
28118 0 : r->in.new_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_new_val);
28119 : }
28120 0 : if (py_new_mtime == NULL) {
28121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.new_mtime");
28122 0 : return false;
28123 : }
28124 0 : if (py_new_mtime == Py_None) {
28125 0 : r->in.new_mtime = NULL;
28126 : } else {
28127 0 : r->in.new_mtime = talloc_ptrtype(r, r->in.new_mtime);
28128 0 : if (r->in.new_mtime == NULL) {
28129 0 : PyErr_NoMemory();
28130 0 : return false;
28131 : }
28132 : {
28133 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.new_mtime));
28134 0 : if (PyLong_Check(py_new_mtime)) {
28135 0 : unsigned long long test_var;
28136 0 : test_var = PyLong_AsUnsignedLongLong(py_new_mtime);
28137 0 : if (PyErr_Occurred() != NULL) {
28138 0 : return false;
28139 : }
28140 0 : if (test_var > uint_max) {
28141 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28142 : PyLong_Type.tp_name, uint_max, test_var);
28143 0 : return false;
28144 : }
28145 0 : *r->in.new_mtime = test_var;
28146 : } else {
28147 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28148 : PyLong_Type.tp_name);
28149 0 : return false;
28150 : }
28151 : }
28152 : }
28153 0 : if (py_old_val == NULL) {
28154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_val");
28155 0 : return false;
28156 : }
28157 0 : if (py_old_val == Py_None) {
28158 0 : r->in.old_val = NULL;
28159 : } else {
28160 0 : r->in.old_val = NULL;
28161 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_PTR_Type, py_old_val, return false;);
28162 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_val)) == NULL) {
28163 0 : PyErr_NoMemory();
28164 0 : return false;
28165 : }
28166 0 : r->in.old_val = (struct lsa_DATA_BUF_PTR *)pytalloc_get_ptr(py_old_val);
28167 : }
28168 0 : if (py_old_mtime == NULL) {
28169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.old_mtime");
28170 0 : return false;
28171 : }
28172 0 : if (py_old_mtime == Py_None) {
28173 0 : r->in.old_mtime = NULL;
28174 : } else {
28175 0 : r->in.old_mtime = talloc_ptrtype(r, r->in.old_mtime);
28176 0 : if (r->in.old_mtime == NULL) {
28177 0 : PyErr_NoMemory();
28178 0 : return false;
28179 : }
28180 : {
28181 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.old_mtime));
28182 0 : if (PyLong_Check(py_old_mtime)) {
28183 0 : unsigned long long test_var;
28184 0 : test_var = PyLong_AsUnsignedLongLong(py_old_mtime);
28185 0 : if (PyErr_Occurred() != NULL) {
28186 0 : return false;
28187 : }
28188 0 : if (test_var > uint_max) {
28189 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28190 : PyLong_Type.tp_name, uint_max, test_var);
28191 0 : return false;
28192 : }
28193 0 : *r->in.old_mtime = test_var;
28194 : } else {
28195 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28196 : PyLong_Type.tp_name);
28197 0 : return false;
28198 : }
28199 : }
28200 : }
28201 0 : return true;
28202 : }
28203 :
28204 0 : static PyObject *unpack_py_lsa_QuerySecret_args_out(struct lsa_QuerySecret *r)
28205 : {
28206 0 : PyObject *result;
28207 0 : PyObject *py_new_val;
28208 0 : PyObject *py_new_mtime;
28209 0 : PyObject *py_old_val;
28210 0 : PyObject *py_old_mtime;
28211 0 : result = PyTuple_New(4);
28212 0 : if (r->out.new_val == NULL) {
28213 0 : py_new_val = Py_None;
28214 0 : Py_INCREF(py_new_val);
28215 : } else {
28216 0 : py_new_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.new_val, r->out.new_val);
28217 : }
28218 0 : PyTuple_SetItem(result, 0, py_new_val);
28219 0 : if (r->out.new_mtime == NULL) {
28220 0 : py_new_mtime = Py_None;
28221 0 : Py_INCREF(py_new_mtime);
28222 : } else {
28223 0 : py_new_mtime = PyLong_FromUnsignedLongLong(*r->out.new_mtime);
28224 : }
28225 0 : PyTuple_SetItem(result, 1, py_new_mtime);
28226 0 : if (r->out.old_val == NULL) {
28227 0 : py_old_val = Py_None;
28228 0 : Py_INCREF(py_old_val);
28229 : } else {
28230 0 : py_old_val = pytalloc_reference_ex(&lsa_DATA_BUF_PTR_Type, r->out.old_val, r->out.old_val);
28231 : }
28232 0 : PyTuple_SetItem(result, 2, py_old_val);
28233 0 : if (r->out.old_mtime == NULL) {
28234 0 : py_old_mtime = Py_None;
28235 0 : Py_INCREF(py_old_mtime);
28236 : } else {
28237 0 : py_old_mtime = PyLong_FromUnsignedLongLong(*r->out.old_mtime);
28238 : }
28239 0 : PyTuple_SetItem(result, 3, py_old_mtime);
28240 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28241 0 : PyErr_SetNTSTATUS(r->out.result);
28242 0 : return NULL;
28243 : }
28244 :
28245 0 : return result;
28246 : }
28247 :
28248 :
28249 0 : static PyObject *py_lsa_LookupPrivValue_in_get_handle(PyObject *obj, void *closure)
28250 : {
28251 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(obj);
28252 0 : PyObject *py_handle;
28253 0 : if (object->in.handle == NULL) {
28254 0 : Py_RETURN_NONE;
28255 : }
28256 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28257 0 : return py_handle;
28258 : }
28259 :
28260 0 : static int py_lsa_LookupPrivValue_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28261 : {
28262 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28263 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28264 0 : if (value == NULL) {
28265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
28266 0 : return -1;
28267 : }
28268 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28269 0 : if (object->in.handle == NULL) {
28270 0 : PyErr_NoMemory();
28271 0 : return -1;
28272 : }
28273 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28274 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28275 0 : PyErr_NoMemory();
28276 0 : return -1;
28277 : }
28278 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28279 0 : return 0;
28280 : }
28281 :
28282 0 : static PyObject *py_lsa_LookupPrivValue_in_get_name(PyObject *obj, void *closure)
28283 : {
28284 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(obj);
28285 0 : PyObject *py_name;
28286 0 : if (object->in.name == NULL) {
28287 0 : Py_RETURN_NONE;
28288 : }
28289 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
28290 0 : return py_name;
28291 : }
28292 :
28293 0 : static int py_lsa_LookupPrivValue_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
28294 : {
28295 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28296 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
28297 0 : if (value == NULL) {
28298 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
28299 0 : return -1;
28300 : }
28301 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
28302 0 : if (object->in.name == NULL) {
28303 0 : PyErr_NoMemory();
28304 0 : return -1;
28305 : }
28306 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
28307 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28308 0 : PyErr_NoMemory();
28309 0 : return -1;
28310 : }
28311 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
28312 0 : return 0;
28313 : }
28314 :
28315 0 : static PyObject *py_lsa_LookupPrivValue_out_get_luid(PyObject *obj, void *closure)
28316 : {
28317 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(obj);
28318 0 : PyObject *py_luid;
28319 0 : if (object->out.luid == NULL) {
28320 0 : Py_RETURN_NONE;
28321 : }
28322 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->out.luid, object->out.luid);
28323 0 : return py_luid;
28324 : }
28325 :
28326 0 : static int py_lsa_LookupPrivValue_out_set_luid(PyObject *py_obj, PyObject *value, void *closure)
28327 : {
28328 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28329 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.luid));
28330 0 : if (value == NULL) {
28331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.luid");
28332 0 : return -1;
28333 : }
28334 0 : object->out.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.luid);
28335 0 : if (object->out.luid == NULL) {
28336 0 : PyErr_NoMemory();
28337 0 : return -1;
28338 : }
28339 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
28340 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28341 0 : PyErr_NoMemory();
28342 0 : return -1;
28343 : }
28344 0 : object->out.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
28345 0 : return 0;
28346 : }
28347 :
28348 0 : static PyObject *py_lsa_LookupPrivValue_get_result(PyObject *obj, void *closure)
28349 : {
28350 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(obj);
28351 0 : PyObject *py_result;
28352 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28353 0 : return py_result;
28354 : }
28355 :
28356 0 : static int py_lsa_LookupPrivValue_set_result(PyObject *py_obj, PyObject *value, void *closure)
28357 : {
28358 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28359 0 : if (value == NULL) {
28360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
28361 0 : return -1;
28362 : }
28363 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28364 0 : return 0;
28365 : }
28366 :
28367 : static PyGetSetDef py_lsa_LookupPrivValue_getsetters[] = {
28368 : {
28369 : .name = discard_const_p(char, "in_handle"),
28370 : .get = py_lsa_LookupPrivValue_in_get_handle,
28371 : .set = py_lsa_LookupPrivValue_in_set_handle,
28372 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28373 : },
28374 : {
28375 : .name = discard_const_p(char, "in_name"),
28376 : .get = py_lsa_LookupPrivValue_in_get_name,
28377 : .set = py_lsa_LookupPrivValue_in_set_name,
28378 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
28379 : },
28380 : {
28381 : .name = discard_const_p(char, "out_luid"),
28382 : .get = py_lsa_LookupPrivValue_out_get_luid,
28383 : .set = py_lsa_LookupPrivValue_out_set_luid,
28384 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
28385 : },
28386 : {
28387 : .name = discard_const_p(char, "result"),
28388 : .get = py_lsa_LookupPrivValue_get_result,
28389 : .set = py_lsa_LookupPrivValue_set_result,
28390 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28391 : },
28392 : { .name = NULL }
28393 : };
28394 :
28395 0 : static PyObject *py_lsa_LookupPrivValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28396 : {
28397 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivValue, type);
28398 0 : struct lsa_LookupPrivValue *_self = (struct lsa_LookupPrivValue *)pytalloc_get_ptr(self);
28399 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28400 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28401 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
28402 0 : _self->out.luid = talloc_zero(mem_ctx, struct lsa_LUID);
28403 0 : return self;
28404 : }
28405 :
28406 0 : static PyObject *py_lsa_LookupPrivValue_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28407 : {
28408 :
28409 :
28410 0 : return PyLong_FromLong(31);
28411 : }
28412 :
28413 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28414 : {
28415 0 : const struct ndr_interface_call *call = NULL;
28416 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28417 0 : PyObject *ret = NULL;
28418 0 : struct ndr_push *push = NULL;
28419 0 : DATA_BLOB blob;
28420 0 : enum ndr_err_code err;
28421 :
28422 0 : if (ndr_table_lsarpc.num_calls < 32) {
28423 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_pack");
28424 0 : return NULL;
28425 : }
28426 0 : call = &ndr_table_lsarpc.calls[31];
28427 :
28428 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28429 0 : if (push == NULL) {
28430 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28431 0 : return NULL;
28432 : }
28433 :
28434 0 : push->flags |= ndr_push_flags;
28435 :
28436 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28437 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28438 0 : TALLOC_FREE(push);
28439 0 : PyErr_SetNdrError(err);
28440 0 : return NULL;
28441 : }
28442 0 : blob = ndr_push_blob(push);
28443 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28444 0 : TALLOC_FREE(push);
28445 0 : return ret;
28446 : }
28447 :
28448 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28449 : {
28450 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28451 0 : PyObject *bigendian_obj = NULL;
28452 0 : PyObject *ndr64_obj = NULL;
28453 0 : libndr_flags ndr_push_flags = 0;
28454 :
28455 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28456 : discard_const_p(char *, kwnames),
28457 : &bigendian_obj,
28458 : &ndr64_obj)) {
28459 0 : return NULL;
28460 : }
28461 :
28462 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28463 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28464 : }
28465 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28466 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28467 : }
28468 :
28469 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28470 : }
28471 :
28472 0 : static PyObject *py_lsa_LookupPrivValue_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28473 : {
28474 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28475 0 : PyObject *bigendian_obj = NULL;
28476 0 : PyObject *ndr64_obj = NULL;
28477 0 : libndr_flags ndr_push_flags = 0;
28478 :
28479 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28480 : discard_const_p(char *, kwnames),
28481 : &bigendian_obj,
28482 : &ndr64_obj)) {
28483 0 : return NULL;
28484 : }
28485 :
28486 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28487 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28488 : }
28489 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28490 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28491 : }
28492 :
28493 0 : return py_lsa_LookupPrivValue_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28494 : }
28495 :
28496 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)
28497 : {
28498 0 : const struct ndr_interface_call *call = NULL;
28499 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28500 0 : struct ndr_pull *pull = NULL;
28501 0 : enum ndr_err_code err;
28502 :
28503 0 : if (ndr_table_lsarpc.num_calls < 32) {
28504 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_unpack");
28505 0 : return NULL;
28506 : }
28507 0 : call = &ndr_table_lsarpc.calls[31];
28508 :
28509 0 : pull = ndr_pull_init_blob(blob, object);
28510 0 : if (pull == NULL) {
28511 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28512 0 : return NULL;
28513 : }
28514 :
28515 0 : pull->flags |= ndr_pull_flags;
28516 :
28517 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28518 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28519 0 : TALLOC_FREE(pull);
28520 0 : PyErr_SetNdrError(err);
28521 0 : return NULL;
28522 : }
28523 0 : if (!allow_remaining) {
28524 0 : uint32_t highest_ofs;
28525 :
28526 0 : if (pull->offset > pull->relative_highest_offset) {
28527 0 : highest_ofs = pull->offset;
28528 : } else {
28529 0 : highest_ofs = pull->relative_highest_offset;
28530 : }
28531 0 : if (highest_ofs < pull->data_size) {
28532 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28533 : "not all bytes consumed ofs[%u] size[%u]",
28534 : highest_ofs, pull->data_size);
28535 0 : TALLOC_FREE(pull);
28536 0 : PyErr_SetNdrError(err);
28537 0 : return NULL;
28538 : }
28539 : }
28540 :
28541 0 : TALLOC_FREE(pull);
28542 0 : Py_RETURN_NONE;
28543 : }
28544 :
28545 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28546 : {
28547 0 : DATA_BLOB blob;
28548 0 : Py_ssize_t blob_length = 0;
28549 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28550 0 : PyObject *bigendian_obj = NULL;
28551 0 : PyObject *ndr64_obj = NULL;
28552 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28553 0 : PyObject *allow_remaining_obj = NULL;
28554 0 : bool allow_remaining = false;
28555 :
28556 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28557 : discard_const_p(char *, kwnames),
28558 : &blob.data, &blob_length,
28559 : &bigendian_obj,
28560 : &ndr64_obj,
28561 : &allow_remaining_obj)) {
28562 0 : return NULL;
28563 : }
28564 0 : blob.length = blob_length;
28565 :
28566 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28567 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28568 : }
28569 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28570 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28571 : }
28572 :
28573 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28574 0 : allow_remaining = true;
28575 : }
28576 :
28577 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28578 : }
28579 :
28580 0 : static PyObject *py_lsa_LookupPrivValue_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28581 : {
28582 0 : DATA_BLOB blob;
28583 0 : Py_ssize_t blob_length = 0;
28584 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28585 0 : PyObject *bigendian_obj = NULL;
28586 0 : PyObject *ndr64_obj = NULL;
28587 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28588 0 : PyObject *allow_remaining_obj = NULL;
28589 0 : bool allow_remaining = false;
28590 :
28591 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28592 : discard_const_p(char *, kwnames),
28593 : &blob.data, &blob_length,
28594 : &bigendian_obj,
28595 : &ndr64_obj,
28596 : &allow_remaining_obj)) {
28597 0 : return NULL;
28598 : }
28599 0 : blob.length = blob_length;
28600 :
28601 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28602 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28603 : }
28604 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28605 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28606 : }
28607 :
28608 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28609 0 : allow_remaining = true;
28610 : }
28611 :
28612 0 : return py_lsa_LookupPrivValue_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28613 : }
28614 :
28615 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28616 : {
28617 0 : const struct ndr_interface_call *call = NULL;
28618 0 : struct lsa_LookupPrivValue *object = pytalloc_get_ptr(py_obj);
28619 0 : PyObject *ret;
28620 0 : char *retstr;
28621 :
28622 0 : if (ndr_table_lsarpc.num_calls < 32) {
28623 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivValue_ndr_print");
28624 0 : return NULL;
28625 : }
28626 0 : call = &ndr_table_lsarpc.calls[31];
28627 :
28628 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28629 0 : ret = PyUnicode_FromString(retstr);
28630 0 : TALLOC_FREE(retstr);
28631 :
28632 0 : return ret;
28633 : }
28634 :
28635 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28636 : {
28637 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_in", NDR_IN);
28638 : }
28639 :
28640 0 : static PyObject *py_lsa_LookupPrivValue_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28641 : {
28642 0 : return py_lsa_LookupPrivValue_ndr_print(py_obj, "lsa_LookupPrivValue_out", NDR_OUT);
28643 : }
28644 :
28645 : static PyMethodDef py_lsa_LookupPrivValue_methods[] = {
28646 : { "opnum", (PyCFunction)py_lsa_LookupPrivValue_ndr_opnum, METH_NOARGS|METH_CLASS,
28647 : "lsa.LookupPrivValue.opnum() -> 31 (0x1f) " },
28648 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28649 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28650 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28651 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28652 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28653 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28654 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivValue_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28655 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28656 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28657 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivValue_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28658 : { NULL, NULL, 0, NULL }
28659 : };
28660 :
28661 :
28662 : static PyTypeObject lsa_LookupPrivValue_Type = {
28663 : PyVarObject_HEAD_INIT(NULL, 0)
28664 : .tp_name = "lsa.LookupPrivValue",
28665 : .tp_getset = py_lsa_LookupPrivValue_getsetters,
28666 : .tp_methods = py_lsa_LookupPrivValue_methods,
28667 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28668 : .tp_new = py_lsa_LookupPrivValue_new,
28669 : };
28670 :
28671 0 : static bool pack_py_lsa_LookupPrivValue_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivValue *r)
28672 : {
28673 0 : PyObject *py_handle;
28674 0 : PyObject *py_name;
28675 0 : const char *kwnames[] = {
28676 : "handle", "name", NULL
28677 : };
28678 :
28679 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivValue", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
28680 0 : return false;
28681 : }
28682 :
28683 0 : if (py_handle == NULL) {
28684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
28685 0 : return false;
28686 : }
28687 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
28688 0 : if (r->in.handle == NULL) {
28689 0 : PyErr_NoMemory();
28690 0 : return false;
28691 : }
28692 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
28693 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
28694 0 : PyErr_NoMemory();
28695 0 : return false;
28696 : }
28697 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
28698 0 : if (py_name == NULL) {
28699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
28700 0 : return false;
28701 : }
28702 0 : r->in.name = talloc_ptrtype(r, r->in.name);
28703 0 : if (r->in.name == NULL) {
28704 0 : PyErr_NoMemory();
28705 0 : return false;
28706 : }
28707 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
28708 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
28709 0 : PyErr_NoMemory();
28710 0 : return false;
28711 : }
28712 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
28713 0 : return true;
28714 : }
28715 :
28716 0 : static PyObject *unpack_py_lsa_LookupPrivValue_args_out(struct lsa_LookupPrivValue *r)
28717 : {
28718 0 : PyObject *result;
28719 0 : PyObject *py_luid;
28720 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, r->out.luid, r->out.luid);
28721 0 : result = py_luid;
28722 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28723 0 : PyErr_SetNTSTATUS(r->out.result);
28724 0 : return NULL;
28725 : }
28726 :
28727 0 : return result;
28728 : }
28729 :
28730 :
28731 0 : static PyObject *py_lsa_LookupPrivName_in_get_handle(PyObject *obj, void *closure)
28732 : {
28733 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(obj);
28734 0 : PyObject *py_handle;
28735 0 : if (object->in.handle == NULL) {
28736 0 : Py_RETURN_NONE;
28737 : }
28738 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
28739 0 : return py_handle;
28740 : }
28741 :
28742 0 : static int py_lsa_LookupPrivName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
28743 : {
28744 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28745 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
28746 0 : if (value == NULL) {
28747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
28748 0 : return -1;
28749 : }
28750 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
28751 0 : if (object->in.handle == NULL) {
28752 0 : PyErr_NoMemory();
28753 0 : return -1;
28754 : }
28755 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28756 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28757 0 : PyErr_NoMemory();
28758 0 : return -1;
28759 : }
28760 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
28761 0 : return 0;
28762 : }
28763 :
28764 0 : static PyObject *py_lsa_LookupPrivName_in_get_luid(PyObject *obj, void *closure)
28765 : {
28766 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(obj);
28767 0 : PyObject *py_luid;
28768 0 : if (object->in.luid == NULL) {
28769 0 : Py_RETURN_NONE;
28770 : }
28771 0 : py_luid = pytalloc_reference_ex(&lsa_LUID_Type, object->in.luid, object->in.luid);
28772 0 : return py_luid;
28773 : }
28774 :
28775 0 : static int py_lsa_LookupPrivName_in_set_luid(PyObject *py_obj, PyObject *value, void *closure)
28776 : {
28777 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28778 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.luid));
28779 0 : if (value == NULL) {
28780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.luid");
28781 0 : return -1;
28782 : }
28783 0 : object->in.luid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.luid);
28784 0 : if (object->in.luid == NULL) {
28785 0 : PyErr_NoMemory();
28786 0 : return -1;
28787 : }
28788 0 : PY_CHECK_TYPE(&lsa_LUID_Type, value, return -1;);
28789 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28790 0 : PyErr_NoMemory();
28791 0 : return -1;
28792 : }
28793 0 : object->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(value);
28794 0 : return 0;
28795 : }
28796 :
28797 0 : static PyObject *py_lsa_LookupPrivName_out_get_name(PyObject *obj, void *closure)
28798 : {
28799 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(obj);
28800 0 : PyObject *py_name;
28801 0 : if (object->out.name == NULL) {
28802 0 : Py_RETURN_NONE;
28803 : }
28804 0 : if (*object->out.name == NULL) {
28805 0 : py_name = Py_None;
28806 0 : Py_INCREF(py_name);
28807 : } else {
28808 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.name, *object->out.name);
28809 : }
28810 0 : return py_name;
28811 : }
28812 :
28813 0 : static int py_lsa_LookupPrivName_out_set_name(PyObject *py_obj, PyObject *value, void *closure)
28814 : {
28815 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28816 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.name));
28817 0 : if (value == NULL) {
28818 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.name");
28819 0 : return -1;
28820 : }
28821 0 : object->out.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.name);
28822 0 : if (object->out.name == NULL) {
28823 0 : PyErr_NoMemory();
28824 0 : return -1;
28825 : }
28826 0 : if (value == Py_None) {
28827 0 : *object->out.name = NULL;
28828 : } else {
28829 0 : *object->out.name = NULL;
28830 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
28831 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28832 0 : PyErr_NoMemory();
28833 0 : return -1;
28834 : }
28835 0 : *object->out.name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
28836 : }
28837 0 : return 0;
28838 : }
28839 :
28840 0 : static PyObject *py_lsa_LookupPrivName_get_result(PyObject *obj, void *closure)
28841 : {
28842 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(obj);
28843 0 : PyObject *py_result;
28844 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28845 0 : return py_result;
28846 : }
28847 :
28848 0 : static int py_lsa_LookupPrivName_set_result(PyObject *py_obj, PyObject *value, void *closure)
28849 : {
28850 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28851 0 : if (value == NULL) {
28852 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
28853 0 : return -1;
28854 : }
28855 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28856 0 : return 0;
28857 : }
28858 :
28859 : static PyGetSetDef py_lsa_LookupPrivName_getsetters[] = {
28860 : {
28861 : .name = discard_const_p(char, "in_handle"),
28862 : .get = py_lsa_LookupPrivName_in_get_handle,
28863 : .set = py_lsa_LookupPrivName_in_set_handle,
28864 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28865 : },
28866 : {
28867 : .name = discard_const_p(char, "in_luid"),
28868 : .get = py_lsa_LookupPrivName_in_get_luid,
28869 : .set = py_lsa_LookupPrivName_in_set_luid,
28870 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LUID")
28871 : },
28872 : {
28873 : .name = discard_const_p(char, "out_name"),
28874 : .get = py_lsa_LookupPrivName_out_get_name,
28875 : .set = py_lsa_LookupPrivName_out_set_name,
28876 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
28877 : },
28878 : {
28879 : .name = discard_const_p(char, "result"),
28880 : .get = py_lsa_LookupPrivName_get_result,
28881 : .set = py_lsa_LookupPrivName_set_result,
28882 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28883 : },
28884 : { .name = NULL }
28885 : };
28886 :
28887 0 : static PyObject *py_lsa_LookupPrivName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28888 : {
28889 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivName, type);
28890 0 : struct lsa_LookupPrivName *_self = (struct lsa_LookupPrivName *)pytalloc_get_ptr(self);
28891 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28892 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
28893 0 : _self->in.luid = talloc_zero(mem_ctx, struct lsa_LUID);
28894 : /* a pointer to a NULL pointer */
28895 0 : _self->out.name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
28896 0 : return self;
28897 : }
28898 :
28899 0 : static PyObject *py_lsa_LookupPrivName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28900 : {
28901 :
28902 :
28903 0 : return PyLong_FromLong(32);
28904 : }
28905 :
28906 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28907 : {
28908 0 : const struct ndr_interface_call *call = NULL;
28909 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28910 0 : PyObject *ret = NULL;
28911 0 : struct ndr_push *push = NULL;
28912 0 : DATA_BLOB blob;
28913 0 : enum ndr_err_code err;
28914 :
28915 0 : if (ndr_table_lsarpc.num_calls < 33) {
28916 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_pack");
28917 0 : return NULL;
28918 : }
28919 0 : call = &ndr_table_lsarpc.calls[32];
28920 :
28921 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28922 0 : if (push == NULL) {
28923 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28924 0 : return NULL;
28925 : }
28926 :
28927 0 : push->flags |= ndr_push_flags;
28928 :
28929 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28930 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28931 0 : TALLOC_FREE(push);
28932 0 : PyErr_SetNdrError(err);
28933 0 : return NULL;
28934 : }
28935 0 : blob = ndr_push_blob(push);
28936 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28937 0 : TALLOC_FREE(push);
28938 0 : return ret;
28939 : }
28940 :
28941 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28942 : {
28943 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28944 0 : PyObject *bigendian_obj = NULL;
28945 0 : PyObject *ndr64_obj = NULL;
28946 0 : libndr_flags ndr_push_flags = 0;
28947 :
28948 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28949 : discard_const_p(char *, kwnames),
28950 : &bigendian_obj,
28951 : &ndr64_obj)) {
28952 0 : return NULL;
28953 : }
28954 :
28955 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28956 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28957 : }
28958 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28959 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28960 : }
28961 :
28962 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28963 : }
28964 :
28965 0 : static PyObject *py_lsa_LookupPrivName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28966 : {
28967 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28968 0 : PyObject *bigendian_obj = NULL;
28969 0 : PyObject *ndr64_obj = NULL;
28970 0 : libndr_flags ndr_push_flags = 0;
28971 :
28972 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28973 : discard_const_p(char *, kwnames),
28974 : &bigendian_obj,
28975 : &ndr64_obj)) {
28976 0 : return NULL;
28977 : }
28978 :
28979 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28980 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28981 : }
28982 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28983 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28984 : }
28985 :
28986 0 : return py_lsa_LookupPrivName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28987 : }
28988 :
28989 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)
28990 : {
28991 0 : const struct ndr_interface_call *call = NULL;
28992 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
28993 0 : struct ndr_pull *pull = NULL;
28994 0 : enum ndr_err_code err;
28995 :
28996 0 : if (ndr_table_lsarpc.num_calls < 33) {
28997 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_unpack");
28998 0 : return NULL;
28999 : }
29000 0 : call = &ndr_table_lsarpc.calls[32];
29001 :
29002 0 : pull = ndr_pull_init_blob(blob, object);
29003 0 : if (pull == NULL) {
29004 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29005 0 : return NULL;
29006 : }
29007 :
29008 0 : pull->flags |= ndr_pull_flags;
29009 :
29010 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29011 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29012 0 : TALLOC_FREE(pull);
29013 0 : PyErr_SetNdrError(err);
29014 0 : return NULL;
29015 : }
29016 0 : if (!allow_remaining) {
29017 0 : uint32_t highest_ofs;
29018 :
29019 0 : if (pull->offset > pull->relative_highest_offset) {
29020 0 : highest_ofs = pull->offset;
29021 : } else {
29022 0 : highest_ofs = pull->relative_highest_offset;
29023 : }
29024 0 : if (highest_ofs < pull->data_size) {
29025 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29026 : "not all bytes consumed ofs[%u] size[%u]",
29027 : highest_ofs, pull->data_size);
29028 0 : TALLOC_FREE(pull);
29029 0 : PyErr_SetNdrError(err);
29030 0 : return NULL;
29031 : }
29032 : }
29033 :
29034 0 : TALLOC_FREE(pull);
29035 0 : Py_RETURN_NONE;
29036 : }
29037 :
29038 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29039 : {
29040 0 : DATA_BLOB blob;
29041 0 : Py_ssize_t blob_length = 0;
29042 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29043 0 : PyObject *bigendian_obj = NULL;
29044 0 : PyObject *ndr64_obj = NULL;
29045 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29046 0 : PyObject *allow_remaining_obj = NULL;
29047 0 : bool allow_remaining = false;
29048 :
29049 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29050 : discard_const_p(char *, kwnames),
29051 : &blob.data, &blob_length,
29052 : &bigendian_obj,
29053 : &ndr64_obj,
29054 : &allow_remaining_obj)) {
29055 0 : return NULL;
29056 : }
29057 0 : blob.length = blob_length;
29058 :
29059 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29060 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29061 : }
29062 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29063 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29064 : }
29065 :
29066 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29067 0 : allow_remaining = true;
29068 : }
29069 :
29070 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29071 : }
29072 :
29073 0 : static PyObject *py_lsa_LookupPrivName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29074 : {
29075 0 : DATA_BLOB blob;
29076 0 : Py_ssize_t blob_length = 0;
29077 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29078 0 : PyObject *bigendian_obj = NULL;
29079 0 : PyObject *ndr64_obj = NULL;
29080 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29081 0 : PyObject *allow_remaining_obj = NULL;
29082 0 : bool allow_remaining = false;
29083 :
29084 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29085 : discard_const_p(char *, kwnames),
29086 : &blob.data, &blob_length,
29087 : &bigendian_obj,
29088 : &ndr64_obj,
29089 : &allow_remaining_obj)) {
29090 0 : return NULL;
29091 : }
29092 0 : blob.length = blob_length;
29093 :
29094 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29095 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29096 : }
29097 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29098 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29099 : }
29100 :
29101 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29102 0 : allow_remaining = true;
29103 : }
29104 :
29105 0 : return py_lsa_LookupPrivName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29106 : }
29107 :
29108 0 : static PyObject *py_lsa_LookupPrivName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29109 : {
29110 0 : const struct ndr_interface_call *call = NULL;
29111 0 : struct lsa_LookupPrivName *object = pytalloc_get_ptr(py_obj);
29112 0 : PyObject *ret;
29113 0 : char *retstr;
29114 :
29115 0 : if (ndr_table_lsarpc.num_calls < 33) {
29116 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivName_ndr_print");
29117 0 : return NULL;
29118 : }
29119 0 : call = &ndr_table_lsarpc.calls[32];
29120 :
29121 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29122 0 : ret = PyUnicode_FromString(retstr);
29123 0 : TALLOC_FREE(retstr);
29124 :
29125 0 : return ret;
29126 : }
29127 :
29128 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29129 : {
29130 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_in", NDR_IN);
29131 : }
29132 :
29133 0 : static PyObject *py_lsa_LookupPrivName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29134 : {
29135 0 : return py_lsa_LookupPrivName_ndr_print(py_obj, "lsa_LookupPrivName_out", NDR_OUT);
29136 : }
29137 :
29138 : static PyMethodDef py_lsa_LookupPrivName_methods[] = {
29139 : { "opnum", (PyCFunction)py_lsa_LookupPrivName_ndr_opnum, METH_NOARGS|METH_CLASS,
29140 : "lsa.LookupPrivName.opnum() -> 32 (0x20) " },
29141 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29142 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29143 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29144 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29145 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29146 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29147 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29148 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29149 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29150 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29151 : { NULL, NULL, 0, NULL }
29152 : };
29153 :
29154 :
29155 : static PyTypeObject lsa_LookupPrivName_Type = {
29156 : PyVarObject_HEAD_INIT(NULL, 0)
29157 : .tp_name = "lsa.LookupPrivName",
29158 : .tp_getset = py_lsa_LookupPrivName_getsetters,
29159 : .tp_methods = py_lsa_LookupPrivName_methods,
29160 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29161 : .tp_new = py_lsa_LookupPrivName_new,
29162 : };
29163 :
29164 0 : static bool pack_py_lsa_LookupPrivName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivName *r)
29165 : {
29166 0 : PyObject *py_handle;
29167 0 : PyObject *py_luid;
29168 0 : const char *kwnames[] = {
29169 : "handle", "luid", NULL
29170 : };
29171 :
29172 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_LookupPrivName", discard_const_p(char *, kwnames), &py_handle, &py_luid)) {
29173 0 : return false;
29174 : }
29175 :
29176 0 : if (py_handle == NULL) {
29177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
29178 0 : return false;
29179 : }
29180 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29181 0 : if (r->in.handle == NULL) {
29182 0 : PyErr_NoMemory();
29183 0 : return false;
29184 : }
29185 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29186 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29187 0 : PyErr_NoMemory();
29188 0 : return false;
29189 : }
29190 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29191 0 : if (py_luid == NULL) {
29192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.luid");
29193 0 : return false;
29194 : }
29195 0 : r->in.luid = talloc_ptrtype(r, r->in.luid);
29196 0 : if (r->in.luid == NULL) {
29197 0 : PyErr_NoMemory();
29198 0 : return false;
29199 : }
29200 0 : PY_CHECK_TYPE(&lsa_LUID_Type, py_luid, return false;);
29201 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_luid)) == NULL) {
29202 0 : PyErr_NoMemory();
29203 0 : return false;
29204 : }
29205 0 : r->in.luid = (struct lsa_LUID *)pytalloc_get_ptr(py_luid);
29206 0 : return true;
29207 : }
29208 :
29209 0 : static PyObject *unpack_py_lsa_LookupPrivName_args_out(struct lsa_LookupPrivName *r)
29210 : {
29211 0 : PyObject *result;
29212 0 : PyObject *py_name;
29213 0 : if (*r->out.name == NULL) {
29214 0 : py_name = Py_None;
29215 0 : Py_INCREF(py_name);
29216 : } else {
29217 0 : py_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.name, *r->out.name);
29218 : }
29219 0 : result = py_name;
29220 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29221 0 : PyErr_SetNTSTATUS(r->out.result);
29222 0 : return NULL;
29223 : }
29224 :
29225 0 : return result;
29226 : }
29227 :
29228 :
29229 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_handle(PyObject *obj, void *closure)
29230 : {
29231 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29232 0 : PyObject *py_handle;
29233 0 : if (object->in.handle == NULL) {
29234 0 : Py_RETURN_NONE;
29235 : }
29236 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29237 0 : return py_handle;
29238 : }
29239 :
29240 0 : static int py_lsa_LookupPrivDisplayName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29241 : {
29242 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29243 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29244 0 : if (value == NULL) {
29245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
29246 0 : return -1;
29247 : }
29248 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29249 0 : if (object->in.handle == NULL) {
29250 0 : PyErr_NoMemory();
29251 0 : return -1;
29252 : }
29253 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29254 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29255 0 : PyErr_NoMemory();
29256 0 : return -1;
29257 : }
29258 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29259 0 : return 0;
29260 : }
29261 :
29262 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_name(PyObject *obj, void *closure)
29263 : {
29264 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29265 0 : PyObject *py_name;
29266 0 : if (object->in.name == NULL) {
29267 0 : Py_RETURN_NONE;
29268 : }
29269 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
29270 0 : return py_name;
29271 : }
29272 :
29273 0 : static int py_lsa_LookupPrivDisplayName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
29274 : {
29275 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29276 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
29277 0 : if (value == NULL) {
29278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
29279 0 : return -1;
29280 : }
29281 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
29282 0 : if (object->in.name == NULL) {
29283 0 : PyErr_NoMemory();
29284 0 : return -1;
29285 : }
29286 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
29287 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29288 0 : PyErr_NoMemory();
29289 0 : return -1;
29290 : }
29291 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
29292 0 : return 0;
29293 : }
29294 :
29295 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id(PyObject *obj, void *closure)
29296 : {
29297 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29298 0 : PyObject *py_language_id;
29299 0 : py_language_id = PyLong_FromLong((uint16_t)(object->in.language_id));
29300 0 : return py_language_id;
29301 : }
29302 :
29303 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id(PyObject *py_obj, PyObject *value, void *closure)
29304 : {
29305 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29306 0 : if (value == NULL) {
29307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.language_id");
29308 0 : return -1;
29309 : }
29310 : {
29311 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id));
29312 0 : if (PyLong_Check(value)) {
29313 0 : unsigned long long test_var;
29314 0 : test_var = PyLong_AsUnsignedLongLong(value);
29315 0 : if (PyErr_Occurred() != NULL) {
29316 0 : return -1;
29317 : }
29318 0 : if (test_var > uint_max) {
29319 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29320 : PyLong_Type.tp_name, uint_max, test_var);
29321 0 : return -1;
29322 : }
29323 0 : object->in.language_id = test_var;
29324 : } else {
29325 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29326 : PyLong_Type.tp_name);
29327 0 : return -1;
29328 : }
29329 : }
29330 0 : return 0;
29331 : }
29332 :
29333 0 : static PyObject *py_lsa_LookupPrivDisplayName_in_get_language_id_sys(PyObject *obj, void *closure)
29334 : {
29335 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29336 0 : PyObject *py_language_id_sys;
29337 0 : py_language_id_sys = PyLong_FromLong((uint16_t)(object->in.language_id_sys));
29338 0 : return py_language_id_sys;
29339 : }
29340 :
29341 0 : static int py_lsa_LookupPrivDisplayName_in_set_language_id_sys(PyObject *py_obj, PyObject *value, void *closure)
29342 : {
29343 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29344 0 : if (value == NULL) {
29345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.language_id_sys");
29346 0 : return -1;
29347 : }
29348 : {
29349 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.language_id_sys));
29350 0 : if (PyLong_Check(value)) {
29351 0 : unsigned long long test_var;
29352 0 : test_var = PyLong_AsUnsignedLongLong(value);
29353 0 : if (PyErr_Occurred() != NULL) {
29354 0 : return -1;
29355 : }
29356 0 : if (test_var > uint_max) {
29357 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29358 : PyLong_Type.tp_name, uint_max, test_var);
29359 0 : return -1;
29360 : }
29361 0 : object->in.language_id_sys = test_var;
29362 : } else {
29363 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29364 : PyLong_Type.tp_name);
29365 0 : return -1;
29366 : }
29367 : }
29368 0 : return 0;
29369 : }
29370 :
29371 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_disp_name(PyObject *obj, void *closure)
29372 : {
29373 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29374 0 : PyObject *py_disp_name;
29375 0 : if (object->out.disp_name == NULL) {
29376 0 : Py_RETURN_NONE;
29377 : }
29378 0 : if (*object->out.disp_name == NULL) {
29379 0 : py_disp_name = Py_None;
29380 0 : Py_INCREF(py_disp_name);
29381 : } else {
29382 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *object->out.disp_name, *object->out.disp_name);
29383 : }
29384 0 : return py_disp_name;
29385 : }
29386 :
29387 0 : static int py_lsa_LookupPrivDisplayName_out_set_disp_name(PyObject *py_obj, PyObject *value, void *closure)
29388 : {
29389 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29390 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.disp_name));
29391 0 : if (value == NULL) {
29392 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.disp_name");
29393 0 : return -1;
29394 : }
29395 0 : object->out.disp_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.disp_name);
29396 0 : if (object->out.disp_name == NULL) {
29397 0 : PyErr_NoMemory();
29398 0 : return -1;
29399 : }
29400 0 : if (value == Py_None) {
29401 0 : *object->out.disp_name = NULL;
29402 : } else {
29403 0 : *object->out.disp_name = NULL;
29404 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
29405 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29406 0 : PyErr_NoMemory();
29407 0 : return -1;
29408 : }
29409 0 : *object->out.disp_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
29410 : }
29411 0 : return 0;
29412 : }
29413 :
29414 0 : static PyObject *py_lsa_LookupPrivDisplayName_out_get_returned_language_id(PyObject *obj, void *closure)
29415 : {
29416 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29417 0 : PyObject *py_returned_language_id;
29418 0 : if (object->out.returned_language_id == NULL) {
29419 0 : Py_RETURN_NONE;
29420 : }
29421 0 : py_returned_language_id = PyLong_FromLong((uint16_t)(*object->out.returned_language_id));
29422 0 : return py_returned_language_id;
29423 : }
29424 :
29425 0 : static int py_lsa_LookupPrivDisplayName_out_set_returned_language_id(PyObject *py_obj, PyObject *value, void *closure)
29426 : {
29427 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29428 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_language_id));
29429 0 : if (value == NULL) {
29430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.returned_language_id");
29431 0 : return -1;
29432 : }
29433 0 : object->out.returned_language_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_language_id);
29434 0 : if (object->out.returned_language_id == NULL) {
29435 0 : PyErr_NoMemory();
29436 0 : return -1;
29437 : }
29438 : {
29439 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_language_id));
29440 0 : if (PyLong_Check(value)) {
29441 0 : unsigned long long test_var;
29442 0 : test_var = PyLong_AsUnsignedLongLong(value);
29443 0 : if (PyErr_Occurred() != NULL) {
29444 0 : return -1;
29445 : }
29446 0 : if (test_var > uint_max) {
29447 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29448 : PyLong_Type.tp_name, uint_max, test_var);
29449 0 : return -1;
29450 : }
29451 0 : *object->out.returned_language_id = test_var;
29452 : } else {
29453 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29454 : PyLong_Type.tp_name);
29455 0 : return -1;
29456 : }
29457 : }
29458 0 : return 0;
29459 : }
29460 :
29461 0 : static PyObject *py_lsa_LookupPrivDisplayName_get_result(PyObject *obj, void *closure)
29462 : {
29463 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(obj);
29464 0 : PyObject *py_result;
29465 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29466 0 : return py_result;
29467 : }
29468 :
29469 0 : static int py_lsa_LookupPrivDisplayName_set_result(PyObject *py_obj, PyObject *value, void *closure)
29470 : {
29471 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29472 0 : if (value == NULL) {
29473 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
29474 0 : return -1;
29475 : }
29476 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29477 0 : return 0;
29478 : }
29479 :
29480 : static PyGetSetDef py_lsa_LookupPrivDisplayName_getsetters[] = {
29481 : {
29482 : .name = discard_const_p(char, "in_handle"),
29483 : .get = py_lsa_LookupPrivDisplayName_in_get_handle,
29484 : .set = py_lsa_LookupPrivDisplayName_in_set_handle,
29485 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29486 : },
29487 : {
29488 : .name = discard_const_p(char, "in_name"),
29489 : .get = py_lsa_LookupPrivDisplayName_in_get_name,
29490 : .set = py_lsa_LookupPrivDisplayName_in_set_name,
29491 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
29492 : },
29493 : {
29494 : .name = discard_const_p(char, "in_language_id"),
29495 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id,
29496 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id,
29497 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29498 : },
29499 : {
29500 : .name = discard_const_p(char, "in_language_id_sys"),
29501 : .get = py_lsa_LookupPrivDisplayName_in_get_language_id_sys,
29502 : .set = py_lsa_LookupPrivDisplayName_in_set_language_id_sys,
29503 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29504 : },
29505 : {
29506 : .name = discard_const_p(char, "out_disp_name"),
29507 : .get = py_lsa_LookupPrivDisplayName_out_get_disp_name,
29508 : .set = py_lsa_LookupPrivDisplayName_out_set_disp_name,
29509 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
29510 : },
29511 : {
29512 : .name = discard_const_p(char, "out_returned_language_id"),
29513 : .get = py_lsa_LookupPrivDisplayName_out_get_returned_language_id,
29514 : .set = py_lsa_LookupPrivDisplayName_out_set_returned_language_id,
29515 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
29516 : },
29517 : {
29518 : .name = discard_const_p(char, "result"),
29519 : .get = py_lsa_LookupPrivDisplayName_get_result,
29520 : .set = py_lsa_LookupPrivDisplayName_set_result,
29521 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29522 : },
29523 : { .name = NULL }
29524 : };
29525 :
29526 0 : static PyObject *py_lsa_LookupPrivDisplayName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29527 : {
29528 0 : PyObject *self = pytalloc_new(struct lsa_LookupPrivDisplayName, type);
29529 0 : struct lsa_LookupPrivDisplayName *_self = (struct lsa_LookupPrivDisplayName *)pytalloc_get_ptr(self);
29530 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29531 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
29532 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
29533 : /* a pointer to a NULL pointer */
29534 0 : _self->out.disp_name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
29535 0 : _self->out.returned_language_id = talloc_zero(mem_ctx, uint16_t);
29536 0 : return self;
29537 : }
29538 :
29539 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29540 : {
29541 :
29542 :
29543 0 : return PyLong_FromLong(33);
29544 : }
29545 :
29546 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29547 : {
29548 0 : const struct ndr_interface_call *call = NULL;
29549 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29550 0 : PyObject *ret = NULL;
29551 0 : struct ndr_push *push = NULL;
29552 0 : DATA_BLOB blob;
29553 0 : enum ndr_err_code err;
29554 :
29555 0 : if (ndr_table_lsarpc.num_calls < 34) {
29556 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_pack");
29557 0 : return NULL;
29558 : }
29559 0 : call = &ndr_table_lsarpc.calls[33];
29560 :
29561 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29562 0 : if (push == NULL) {
29563 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29564 0 : return NULL;
29565 : }
29566 :
29567 0 : push->flags |= ndr_push_flags;
29568 :
29569 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29570 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29571 0 : TALLOC_FREE(push);
29572 0 : PyErr_SetNdrError(err);
29573 0 : return NULL;
29574 : }
29575 0 : blob = ndr_push_blob(push);
29576 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29577 0 : TALLOC_FREE(push);
29578 0 : return ret;
29579 : }
29580 :
29581 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29582 : {
29583 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29584 0 : PyObject *bigendian_obj = NULL;
29585 0 : PyObject *ndr64_obj = NULL;
29586 0 : libndr_flags ndr_push_flags = 0;
29587 :
29588 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29589 : discard_const_p(char *, kwnames),
29590 : &bigendian_obj,
29591 : &ndr64_obj)) {
29592 0 : return NULL;
29593 : }
29594 :
29595 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29596 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29597 : }
29598 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29599 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29600 : }
29601 :
29602 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29603 : }
29604 :
29605 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29606 : {
29607 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29608 0 : PyObject *bigendian_obj = NULL;
29609 0 : PyObject *ndr64_obj = NULL;
29610 0 : libndr_flags ndr_push_flags = 0;
29611 :
29612 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29613 : discard_const_p(char *, kwnames),
29614 : &bigendian_obj,
29615 : &ndr64_obj)) {
29616 0 : return NULL;
29617 : }
29618 :
29619 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29620 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29621 : }
29622 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29623 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29624 : }
29625 :
29626 0 : return py_lsa_LookupPrivDisplayName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29627 : }
29628 :
29629 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)
29630 : {
29631 0 : const struct ndr_interface_call *call = NULL;
29632 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29633 0 : struct ndr_pull *pull = NULL;
29634 0 : enum ndr_err_code err;
29635 :
29636 0 : if (ndr_table_lsarpc.num_calls < 34) {
29637 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_unpack");
29638 0 : return NULL;
29639 : }
29640 0 : call = &ndr_table_lsarpc.calls[33];
29641 :
29642 0 : pull = ndr_pull_init_blob(blob, object);
29643 0 : if (pull == NULL) {
29644 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29645 0 : return NULL;
29646 : }
29647 :
29648 0 : pull->flags |= ndr_pull_flags;
29649 :
29650 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29651 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29652 0 : TALLOC_FREE(pull);
29653 0 : PyErr_SetNdrError(err);
29654 0 : return NULL;
29655 : }
29656 0 : if (!allow_remaining) {
29657 0 : uint32_t highest_ofs;
29658 :
29659 0 : if (pull->offset > pull->relative_highest_offset) {
29660 0 : highest_ofs = pull->offset;
29661 : } else {
29662 0 : highest_ofs = pull->relative_highest_offset;
29663 : }
29664 0 : if (highest_ofs < pull->data_size) {
29665 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29666 : "not all bytes consumed ofs[%u] size[%u]",
29667 : highest_ofs, pull->data_size);
29668 0 : TALLOC_FREE(pull);
29669 0 : PyErr_SetNdrError(err);
29670 0 : return NULL;
29671 : }
29672 : }
29673 :
29674 0 : TALLOC_FREE(pull);
29675 0 : Py_RETURN_NONE;
29676 : }
29677 :
29678 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29679 : {
29680 0 : DATA_BLOB blob;
29681 0 : Py_ssize_t blob_length = 0;
29682 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29683 0 : PyObject *bigendian_obj = NULL;
29684 0 : PyObject *ndr64_obj = NULL;
29685 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29686 0 : PyObject *allow_remaining_obj = NULL;
29687 0 : bool allow_remaining = false;
29688 :
29689 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29690 : discard_const_p(char *, kwnames),
29691 : &blob.data, &blob_length,
29692 : &bigendian_obj,
29693 : &ndr64_obj,
29694 : &allow_remaining_obj)) {
29695 0 : return NULL;
29696 : }
29697 0 : blob.length = blob_length;
29698 :
29699 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29700 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29701 : }
29702 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29703 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29704 : }
29705 :
29706 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29707 0 : allow_remaining = true;
29708 : }
29709 :
29710 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29711 : }
29712 :
29713 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29714 : {
29715 0 : DATA_BLOB blob;
29716 0 : Py_ssize_t blob_length = 0;
29717 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29718 0 : PyObject *bigendian_obj = NULL;
29719 0 : PyObject *ndr64_obj = NULL;
29720 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29721 0 : PyObject *allow_remaining_obj = NULL;
29722 0 : bool allow_remaining = false;
29723 :
29724 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29725 : discard_const_p(char *, kwnames),
29726 : &blob.data, &blob_length,
29727 : &bigendian_obj,
29728 : &ndr64_obj,
29729 : &allow_remaining_obj)) {
29730 0 : return NULL;
29731 : }
29732 0 : blob.length = blob_length;
29733 :
29734 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29735 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29736 : }
29737 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29738 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29739 : }
29740 :
29741 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29742 0 : allow_remaining = true;
29743 : }
29744 :
29745 0 : return py_lsa_LookupPrivDisplayName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29746 : }
29747 :
29748 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29749 : {
29750 0 : const struct ndr_interface_call *call = NULL;
29751 0 : struct lsa_LookupPrivDisplayName *object = pytalloc_get_ptr(py_obj);
29752 0 : PyObject *ret;
29753 0 : char *retstr;
29754 :
29755 0 : if (ndr_table_lsarpc.num_calls < 34) {
29756 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupPrivDisplayName_ndr_print");
29757 0 : return NULL;
29758 : }
29759 0 : call = &ndr_table_lsarpc.calls[33];
29760 :
29761 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29762 0 : ret = PyUnicode_FromString(retstr);
29763 0 : TALLOC_FREE(retstr);
29764 :
29765 0 : return ret;
29766 : }
29767 :
29768 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29769 : {
29770 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_in", NDR_IN);
29771 : }
29772 :
29773 0 : static PyObject *py_lsa_LookupPrivDisplayName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29774 : {
29775 0 : return py_lsa_LookupPrivDisplayName_ndr_print(py_obj, "lsa_LookupPrivDisplayName_out", NDR_OUT);
29776 : }
29777 :
29778 : static PyMethodDef py_lsa_LookupPrivDisplayName_methods[] = {
29779 : { "opnum", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_opnum, METH_NOARGS|METH_CLASS,
29780 : "lsa.LookupPrivDisplayName.opnum() -> 33 (0x21) " },
29781 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29782 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29783 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29784 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29785 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29786 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29787 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupPrivDisplayName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29788 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29789 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29790 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupPrivDisplayName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29791 : { NULL, NULL, 0, NULL }
29792 : };
29793 :
29794 :
29795 : static PyTypeObject lsa_LookupPrivDisplayName_Type = {
29796 : PyVarObject_HEAD_INIT(NULL, 0)
29797 : .tp_name = "lsa.LookupPrivDisplayName",
29798 : .tp_getset = py_lsa_LookupPrivDisplayName_getsetters,
29799 : .tp_methods = py_lsa_LookupPrivDisplayName_methods,
29800 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29801 : .tp_new = py_lsa_LookupPrivDisplayName_new,
29802 : };
29803 :
29804 0 : static bool pack_py_lsa_LookupPrivDisplayName_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupPrivDisplayName *r)
29805 : {
29806 0 : PyObject *py_handle;
29807 0 : PyObject *py_name;
29808 0 : PyObject *py_language_id;
29809 0 : PyObject *py_language_id_sys;
29810 0 : const char *kwnames[] = {
29811 : "handle", "name", "language_id", "language_id_sys", NULL
29812 : };
29813 :
29814 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)) {
29815 0 : return false;
29816 : }
29817 :
29818 0 : if (py_handle == NULL) {
29819 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
29820 0 : return false;
29821 : }
29822 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
29823 0 : if (r->in.handle == NULL) {
29824 0 : PyErr_NoMemory();
29825 0 : return false;
29826 : }
29827 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
29828 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
29829 0 : PyErr_NoMemory();
29830 0 : return false;
29831 : }
29832 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
29833 0 : if (py_name == NULL) {
29834 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
29835 0 : return false;
29836 : }
29837 0 : r->in.name = talloc_ptrtype(r, r->in.name);
29838 0 : if (r->in.name == NULL) {
29839 0 : PyErr_NoMemory();
29840 0 : return false;
29841 : }
29842 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
29843 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
29844 0 : PyErr_NoMemory();
29845 0 : return false;
29846 : }
29847 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
29848 0 : if (py_language_id == NULL) {
29849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.language_id");
29850 0 : return false;
29851 : }
29852 : {
29853 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id));
29854 0 : if (PyLong_Check(py_language_id)) {
29855 0 : unsigned long long test_var;
29856 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id);
29857 0 : if (PyErr_Occurred() != NULL) {
29858 0 : return false;
29859 : }
29860 0 : if (test_var > uint_max) {
29861 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29862 : PyLong_Type.tp_name, uint_max, test_var);
29863 0 : return false;
29864 : }
29865 0 : r->in.language_id = test_var;
29866 : } else {
29867 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29868 : PyLong_Type.tp_name);
29869 0 : return false;
29870 : }
29871 : }
29872 0 : if (py_language_id_sys == NULL) {
29873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.language_id_sys");
29874 0 : return false;
29875 : }
29876 : {
29877 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.language_id_sys));
29878 0 : if (PyLong_Check(py_language_id_sys)) {
29879 0 : unsigned long long test_var;
29880 0 : test_var = PyLong_AsUnsignedLongLong(py_language_id_sys);
29881 0 : if (PyErr_Occurred() != NULL) {
29882 0 : return false;
29883 : }
29884 0 : if (test_var > uint_max) {
29885 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29886 : PyLong_Type.tp_name, uint_max, test_var);
29887 0 : return false;
29888 : }
29889 0 : r->in.language_id_sys = test_var;
29890 : } else {
29891 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29892 : PyLong_Type.tp_name);
29893 0 : return false;
29894 : }
29895 : }
29896 0 : return true;
29897 : }
29898 :
29899 0 : static PyObject *unpack_py_lsa_LookupPrivDisplayName_args_out(struct lsa_LookupPrivDisplayName *r)
29900 : {
29901 0 : PyObject *result;
29902 0 : PyObject *py_disp_name;
29903 0 : PyObject *py_returned_language_id;
29904 0 : result = PyTuple_New(2);
29905 0 : if (*r->out.disp_name == NULL) {
29906 0 : py_disp_name = Py_None;
29907 0 : Py_INCREF(py_disp_name);
29908 : } else {
29909 0 : py_disp_name = pytalloc_reference_ex(&lsa_StringLarge_Type, *r->out.disp_name, *r->out.disp_name);
29910 : }
29911 0 : PyTuple_SetItem(result, 0, py_disp_name);
29912 0 : py_returned_language_id = PyLong_FromLong((uint16_t)(*r->out.returned_language_id));
29913 0 : PyTuple_SetItem(result, 1, py_returned_language_id);
29914 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29915 0 : PyErr_SetNTSTATUS(r->out.result);
29916 0 : return NULL;
29917 : }
29918 :
29919 0 : return result;
29920 : }
29921 :
29922 :
29923 0 : static PyObject *py_lsa_DeleteObject_in_get_handle(PyObject *obj, void *closure)
29924 : {
29925 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(obj);
29926 0 : PyObject *py_handle;
29927 0 : if (object->in.handle == NULL) {
29928 0 : Py_RETURN_NONE;
29929 : }
29930 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
29931 0 : return py_handle;
29932 : }
29933 :
29934 0 : static int py_lsa_DeleteObject_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29935 : {
29936 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
29937 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
29938 0 : if (value == NULL) {
29939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
29940 0 : return -1;
29941 : }
29942 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
29943 0 : if (object->in.handle == NULL) {
29944 0 : PyErr_NoMemory();
29945 0 : return -1;
29946 : }
29947 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29948 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29949 0 : PyErr_NoMemory();
29950 0 : return -1;
29951 : }
29952 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29953 0 : return 0;
29954 : }
29955 :
29956 0 : static PyObject *py_lsa_DeleteObject_out_get_handle(PyObject *obj, void *closure)
29957 : {
29958 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(obj);
29959 0 : PyObject *py_handle;
29960 0 : if (object->out.handle == NULL) {
29961 0 : Py_RETURN_NONE;
29962 : }
29963 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
29964 0 : return py_handle;
29965 : }
29966 :
29967 0 : static int py_lsa_DeleteObject_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
29968 : {
29969 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
29970 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
29971 0 : if (value == NULL) {
29972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
29973 0 : return -1;
29974 : }
29975 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
29976 0 : if (object->out.handle == NULL) {
29977 0 : PyErr_NoMemory();
29978 0 : return -1;
29979 : }
29980 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29981 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29982 0 : PyErr_NoMemory();
29983 0 : return -1;
29984 : }
29985 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
29986 0 : return 0;
29987 : }
29988 :
29989 0 : static PyObject *py_lsa_DeleteObject_get_result(PyObject *obj, void *closure)
29990 : {
29991 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(obj);
29992 0 : PyObject *py_result;
29993 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29994 0 : return py_result;
29995 : }
29996 :
29997 0 : static int py_lsa_DeleteObject_set_result(PyObject *py_obj, PyObject *value, void *closure)
29998 : {
29999 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
30000 0 : if (value == NULL) {
30001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
30002 0 : return -1;
30003 : }
30004 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30005 0 : return 0;
30006 : }
30007 :
30008 : static PyGetSetDef py_lsa_DeleteObject_getsetters[] = {
30009 : {
30010 : .name = discard_const_p(char, "in_handle"),
30011 : .get = py_lsa_DeleteObject_in_get_handle,
30012 : .set = py_lsa_DeleteObject_in_set_handle,
30013 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30014 : },
30015 : {
30016 : .name = discard_const_p(char, "out_handle"),
30017 : .get = py_lsa_DeleteObject_out_get_handle,
30018 : .set = py_lsa_DeleteObject_out_set_handle,
30019 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30020 : },
30021 : {
30022 : .name = discard_const_p(char, "result"),
30023 : .get = py_lsa_DeleteObject_get_result,
30024 : .set = py_lsa_DeleteObject_set_result,
30025 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30026 : },
30027 : { .name = NULL }
30028 : };
30029 :
30030 0 : static PyObject *py_lsa_DeleteObject_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30031 : {
30032 0 : PyObject *self = pytalloc_new(struct lsa_DeleteObject, type);
30033 0 : struct lsa_DeleteObject *_self = (struct lsa_DeleteObject *)pytalloc_get_ptr(self);
30034 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30035 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30036 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
30037 0 : return self;
30038 : }
30039 :
30040 0 : static PyObject *py_lsa_DeleteObject_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30041 : {
30042 :
30043 :
30044 0 : return PyLong_FromLong(34);
30045 : }
30046 :
30047 0 : static PyObject *py_lsa_DeleteObject_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30048 : {
30049 0 : const struct ndr_interface_call *call = NULL;
30050 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
30051 0 : PyObject *ret = NULL;
30052 0 : struct ndr_push *push = NULL;
30053 0 : DATA_BLOB blob;
30054 0 : enum ndr_err_code err;
30055 :
30056 0 : if (ndr_table_lsarpc.num_calls < 35) {
30057 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_pack");
30058 0 : return NULL;
30059 : }
30060 0 : call = &ndr_table_lsarpc.calls[34];
30061 :
30062 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30063 0 : if (push == NULL) {
30064 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30065 0 : return NULL;
30066 : }
30067 :
30068 0 : push->flags |= ndr_push_flags;
30069 :
30070 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30071 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30072 0 : TALLOC_FREE(push);
30073 0 : PyErr_SetNdrError(err);
30074 0 : return NULL;
30075 : }
30076 0 : blob = ndr_push_blob(push);
30077 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30078 0 : TALLOC_FREE(push);
30079 0 : return ret;
30080 : }
30081 :
30082 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30083 : {
30084 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30085 0 : PyObject *bigendian_obj = NULL;
30086 0 : PyObject *ndr64_obj = NULL;
30087 0 : libndr_flags ndr_push_flags = 0;
30088 :
30089 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30090 : discard_const_p(char *, kwnames),
30091 : &bigendian_obj,
30092 : &ndr64_obj)) {
30093 0 : return NULL;
30094 : }
30095 :
30096 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30097 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30098 : }
30099 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30100 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30101 : }
30102 :
30103 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30104 : }
30105 :
30106 0 : static PyObject *py_lsa_DeleteObject_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30107 : {
30108 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30109 0 : PyObject *bigendian_obj = NULL;
30110 0 : PyObject *ndr64_obj = NULL;
30111 0 : libndr_flags ndr_push_flags = 0;
30112 :
30113 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30114 : discard_const_p(char *, kwnames),
30115 : &bigendian_obj,
30116 : &ndr64_obj)) {
30117 0 : return NULL;
30118 : }
30119 :
30120 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30121 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30122 : }
30123 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30124 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30125 : }
30126 :
30127 0 : return py_lsa_DeleteObject_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30128 : }
30129 :
30130 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)
30131 : {
30132 0 : const struct ndr_interface_call *call = NULL;
30133 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
30134 0 : struct ndr_pull *pull = NULL;
30135 0 : enum ndr_err_code err;
30136 :
30137 0 : if (ndr_table_lsarpc.num_calls < 35) {
30138 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_unpack");
30139 0 : return NULL;
30140 : }
30141 0 : call = &ndr_table_lsarpc.calls[34];
30142 :
30143 0 : pull = ndr_pull_init_blob(blob, object);
30144 0 : if (pull == NULL) {
30145 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30146 0 : return NULL;
30147 : }
30148 :
30149 0 : pull->flags |= ndr_pull_flags;
30150 :
30151 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30152 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30153 0 : TALLOC_FREE(pull);
30154 0 : PyErr_SetNdrError(err);
30155 0 : return NULL;
30156 : }
30157 0 : if (!allow_remaining) {
30158 0 : uint32_t highest_ofs;
30159 :
30160 0 : if (pull->offset > pull->relative_highest_offset) {
30161 0 : highest_ofs = pull->offset;
30162 : } else {
30163 0 : highest_ofs = pull->relative_highest_offset;
30164 : }
30165 0 : if (highest_ofs < pull->data_size) {
30166 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30167 : "not all bytes consumed ofs[%u] size[%u]",
30168 : highest_ofs, pull->data_size);
30169 0 : TALLOC_FREE(pull);
30170 0 : PyErr_SetNdrError(err);
30171 0 : return NULL;
30172 : }
30173 : }
30174 :
30175 0 : TALLOC_FREE(pull);
30176 0 : Py_RETURN_NONE;
30177 : }
30178 :
30179 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30180 : {
30181 0 : DATA_BLOB blob;
30182 0 : Py_ssize_t blob_length = 0;
30183 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30184 0 : PyObject *bigendian_obj = NULL;
30185 0 : PyObject *ndr64_obj = NULL;
30186 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30187 0 : PyObject *allow_remaining_obj = NULL;
30188 0 : bool allow_remaining = false;
30189 :
30190 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30191 : discard_const_p(char *, kwnames),
30192 : &blob.data, &blob_length,
30193 : &bigendian_obj,
30194 : &ndr64_obj,
30195 : &allow_remaining_obj)) {
30196 0 : return NULL;
30197 : }
30198 0 : blob.length = blob_length;
30199 :
30200 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30201 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30202 : }
30203 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30204 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30205 : }
30206 :
30207 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30208 0 : allow_remaining = true;
30209 : }
30210 :
30211 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30212 : }
30213 :
30214 0 : static PyObject *py_lsa_DeleteObject_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30215 : {
30216 0 : DATA_BLOB blob;
30217 0 : Py_ssize_t blob_length = 0;
30218 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30219 0 : PyObject *bigendian_obj = NULL;
30220 0 : PyObject *ndr64_obj = NULL;
30221 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30222 0 : PyObject *allow_remaining_obj = NULL;
30223 0 : bool allow_remaining = false;
30224 :
30225 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30226 : discard_const_p(char *, kwnames),
30227 : &blob.data, &blob_length,
30228 : &bigendian_obj,
30229 : &ndr64_obj,
30230 : &allow_remaining_obj)) {
30231 0 : return NULL;
30232 : }
30233 0 : blob.length = blob_length;
30234 :
30235 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30236 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30237 : }
30238 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30239 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30240 : }
30241 :
30242 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30243 0 : allow_remaining = true;
30244 : }
30245 :
30246 0 : return py_lsa_DeleteObject_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30247 : }
30248 :
30249 0 : static PyObject *py_lsa_DeleteObject_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30250 : {
30251 0 : const struct ndr_interface_call *call = NULL;
30252 0 : struct lsa_DeleteObject *object = pytalloc_get_ptr(py_obj);
30253 0 : PyObject *ret;
30254 0 : char *retstr;
30255 :
30256 0 : if (ndr_table_lsarpc.num_calls < 35) {
30257 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteObject_ndr_print");
30258 0 : return NULL;
30259 : }
30260 0 : call = &ndr_table_lsarpc.calls[34];
30261 :
30262 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30263 0 : ret = PyUnicode_FromString(retstr);
30264 0 : TALLOC_FREE(retstr);
30265 :
30266 0 : return ret;
30267 : }
30268 :
30269 0 : static PyObject *py_lsa_DeleteObject_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30270 : {
30271 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_in", NDR_IN);
30272 : }
30273 :
30274 0 : static PyObject *py_lsa_DeleteObject_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30275 : {
30276 0 : return py_lsa_DeleteObject_ndr_print(py_obj, "lsa_DeleteObject_out", NDR_OUT);
30277 : }
30278 :
30279 : static PyMethodDef py_lsa_DeleteObject_methods[] = {
30280 : { "opnum", (PyCFunction)py_lsa_DeleteObject_ndr_opnum, METH_NOARGS|METH_CLASS,
30281 : "lsa.DeleteObject.opnum() -> 34 (0x22) " },
30282 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30283 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30284 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30285 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30286 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30287 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30288 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteObject_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30289 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30290 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteObject_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30291 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteObject_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30292 : { NULL, NULL, 0, NULL }
30293 : };
30294 :
30295 :
30296 : static PyTypeObject lsa_DeleteObject_Type = {
30297 : PyVarObject_HEAD_INIT(NULL, 0)
30298 : .tp_name = "lsa.DeleteObject",
30299 : .tp_getset = py_lsa_DeleteObject_getsetters,
30300 : .tp_methods = py_lsa_DeleteObject_methods,
30301 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30302 : .tp_new = py_lsa_DeleteObject_new,
30303 : };
30304 :
30305 1 : static bool pack_py_lsa_DeleteObject_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteObject *r)
30306 : {
30307 0 : PyObject *py_handle;
30308 1 : const char *kwnames[] = {
30309 : "handle", NULL
30310 : };
30311 :
30312 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_DeleteObject", discard_const_p(char *, kwnames), &py_handle)) {
30313 0 : return false;
30314 : }
30315 :
30316 1 : if (py_handle == NULL) {
30317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
30318 0 : return false;
30319 : }
30320 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30321 1 : if (r->in.handle == NULL) {
30322 0 : PyErr_NoMemory();
30323 0 : return false;
30324 : }
30325 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30326 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30327 0 : PyErr_NoMemory();
30328 0 : return false;
30329 : }
30330 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30331 1 : return true;
30332 : }
30333 :
30334 1 : static PyObject *unpack_py_lsa_DeleteObject_args_out(struct lsa_DeleteObject *r)
30335 : {
30336 0 : PyObject *result;
30337 0 : PyObject *py_handle;
30338 1 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
30339 1 : result = py_handle;
30340 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
30341 0 : PyErr_SetNTSTATUS(r->out.result);
30342 0 : return NULL;
30343 : }
30344 :
30345 1 : return result;
30346 : }
30347 :
30348 :
30349 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_handle(PyObject *obj, void *closure)
30350 : {
30351 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(obj);
30352 0 : PyObject *py_handle;
30353 0 : if (object->in.handle == NULL) {
30354 0 : Py_RETURN_NONE;
30355 : }
30356 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30357 0 : return py_handle;
30358 : }
30359 :
30360 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30361 : {
30362 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30363 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30364 0 : if (value == NULL) {
30365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
30366 0 : return -1;
30367 : }
30368 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30369 0 : if (object->in.handle == NULL) {
30370 0 : PyErr_NoMemory();
30371 0 : return -1;
30372 : }
30373 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30374 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30375 0 : PyErr_NoMemory();
30376 0 : return -1;
30377 : }
30378 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30379 0 : return 0;
30380 : }
30381 :
30382 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_in_get_name(PyObject *obj, void *closure)
30383 : {
30384 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(obj);
30385 0 : PyObject *py_name;
30386 0 : if (object->in.name == NULL) {
30387 0 : Py_RETURN_NONE;
30388 : }
30389 0 : if (object->in.name == NULL) {
30390 0 : py_name = Py_None;
30391 0 : Py_INCREF(py_name);
30392 : } else {
30393 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
30394 : }
30395 0 : return py_name;
30396 : }
30397 :
30398 0 : static int py_lsa_EnumAccountsWithUserRight_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
30399 : {
30400 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30401 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
30402 0 : if (value == NULL) {
30403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
30404 0 : return -1;
30405 : }
30406 0 : if (value == Py_None) {
30407 0 : object->in.name = NULL;
30408 : } else {
30409 0 : object->in.name = NULL;
30410 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
30411 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30412 0 : PyErr_NoMemory();
30413 0 : return -1;
30414 : }
30415 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
30416 : }
30417 0 : return 0;
30418 : }
30419 :
30420 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_out_get_sids(PyObject *obj, void *closure)
30421 : {
30422 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(obj);
30423 0 : PyObject *py_sids;
30424 0 : if (object->out.sids == NULL) {
30425 0 : Py_RETURN_NONE;
30426 : }
30427 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->out.sids, object->out.sids);
30428 0 : return py_sids;
30429 : }
30430 :
30431 0 : static int py_lsa_EnumAccountsWithUserRight_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
30432 : {
30433 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30434 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
30435 0 : if (value == NULL) {
30436 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
30437 0 : return -1;
30438 : }
30439 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
30440 0 : if (object->out.sids == NULL) {
30441 0 : PyErr_NoMemory();
30442 0 : return -1;
30443 : }
30444 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
30445 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30446 0 : PyErr_NoMemory();
30447 0 : return -1;
30448 : }
30449 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
30450 0 : return 0;
30451 : }
30452 :
30453 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_get_result(PyObject *obj, void *closure)
30454 : {
30455 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(obj);
30456 0 : PyObject *py_result;
30457 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30458 0 : return py_result;
30459 : }
30460 :
30461 0 : static int py_lsa_EnumAccountsWithUserRight_set_result(PyObject *py_obj, PyObject *value, void *closure)
30462 : {
30463 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30464 0 : if (value == NULL) {
30465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
30466 0 : return -1;
30467 : }
30468 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30469 0 : return 0;
30470 : }
30471 :
30472 : static PyGetSetDef py_lsa_EnumAccountsWithUserRight_getsetters[] = {
30473 : {
30474 : .name = discard_const_p(char, "in_handle"),
30475 : .get = py_lsa_EnumAccountsWithUserRight_in_get_handle,
30476 : .set = py_lsa_EnumAccountsWithUserRight_in_set_handle,
30477 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30478 : },
30479 : {
30480 : .name = discard_const_p(char, "in_name"),
30481 : .get = py_lsa_EnumAccountsWithUserRight_in_get_name,
30482 : .set = py_lsa_EnumAccountsWithUserRight_in_set_name,
30483 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
30484 : },
30485 : {
30486 : .name = discard_const_p(char, "out_sids"),
30487 : .get = py_lsa_EnumAccountsWithUserRight_out_get_sids,
30488 : .set = py_lsa_EnumAccountsWithUserRight_out_set_sids,
30489 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
30490 : },
30491 : {
30492 : .name = discard_const_p(char, "result"),
30493 : .get = py_lsa_EnumAccountsWithUserRight_get_result,
30494 : .set = py_lsa_EnumAccountsWithUserRight_set_result,
30495 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30496 : },
30497 : { .name = NULL }
30498 : };
30499 :
30500 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30501 : {
30502 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountsWithUserRight, type);
30503 0 : struct lsa_EnumAccountsWithUserRight *_self = (struct lsa_EnumAccountsWithUserRight *)pytalloc_get_ptr(self);
30504 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30505 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30506 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
30507 0 : return self;
30508 : }
30509 :
30510 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30511 : {
30512 :
30513 :
30514 0 : return PyLong_FromLong(35);
30515 : }
30516 :
30517 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30518 : {
30519 0 : const struct ndr_interface_call *call = NULL;
30520 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30521 0 : PyObject *ret = NULL;
30522 0 : struct ndr_push *push = NULL;
30523 0 : DATA_BLOB blob;
30524 0 : enum ndr_err_code err;
30525 :
30526 0 : if (ndr_table_lsarpc.num_calls < 36) {
30527 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_pack");
30528 0 : return NULL;
30529 : }
30530 0 : call = &ndr_table_lsarpc.calls[35];
30531 :
30532 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30533 0 : if (push == NULL) {
30534 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30535 0 : return NULL;
30536 : }
30537 :
30538 0 : push->flags |= ndr_push_flags;
30539 :
30540 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30541 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30542 0 : TALLOC_FREE(push);
30543 0 : PyErr_SetNdrError(err);
30544 0 : return NULL;
30545 : }
30546 0 : blob = ndr_push_blob(push);
30547 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30548 0 : TALLOC_FREE(push);
30549 0 : return ret;
30550 : }
30551 :
30552 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30553 : {
30554 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30555 0 : PyObject *bigendian_obj = NULL;
30556 0 : PyObject *ndr64_obj = NULL;
30557 0 : libndr_flags ndr_push_flags = 0;
30558 :
30559 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30560 : discard_const_p(char *, kwnames),
30561 : &bigendian_obj,
30562 : &ndr64_obj)) {
30563 0 : return NULL;
30564 : }
30565 :
30566 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30567 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30568 : }
30569 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30570 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30571 : }
30572 :
30573 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30574 : }
30575 :
30576 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30577 : {
30578 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30579 0 : PyObject *bigendian_obj = NULL;
30580 0 : PyObject *ndr64_obj = NULL;
30581 0 : libndr_flags ndr_push_flags = 0;
30582 :
30583 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30584 : discard_const_p(char *, kwnames),
30585 : &bigendian_obj,
30586 : &ndr64_obj)) {
30587 0 : return NULL;
30588 : }
30589 :
30590 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30591 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30592 : }
30593 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30594 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30595 : }
30596 :
30597 0 : return py_lsa_EnumAccountsWithUserRight_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30598 : }
30599 :
30600 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)
30601 : {
30602 0 : const struct ndr_interface_call *call = NULL;
30603 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30604 0 : struct ndr_pull *pull = NULL;
30605 0 : enum ndr_err_code err;
30606 :
30607 0 : if (ndr_table_lsarpc.num_calls < 36) {
30608 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_unpack");
30609 0 : return NULL;
30610 : }
30611 0 : call = &ndr_table_lsarpc.calls[35];
30612 :
30613 0 : pull = ndr_pull_init_blob(blob, object);
30614 0 : if (pull == NULL) {
30615 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30616 0 : return NULL;
30617 : }
30618 :
30619 0 : pull->flags |= ndr_pull_flags;
30620 :
30621 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30622 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30623 0 : TALLOC_FREE(pull);
30624 0 : PyErr_SetNdrError(err);
30625 0 : return NULL;
30626 : }
30627 0 : if (!allow_remaining) {
30628 0 : uint32_t highest_ofs;
30629 :
30630 0 : if (pull->offset > pull->relative_highest_offset) {
30631 0 : highest_ofs = pull->offset;
30632 : } else {
30633 0 : highest_ofs = pull->relative_highest_offset;
30634 : }
30635 0 : if (highest_ofs < pull->data_size) {
30636 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30637 : "not all bytes consumed ofs[%u] size[%u]",
30638 : highest_ofs, pull->data_size);
30639 0 : TALLOC_FREE(pull);
30640 0 : PyErr_SetNdrError(err);
30641 0 : return NULL;
30642 : }
30643 : }
30644 :
30645 0 : TALLOC_FREE(pull);
30646 0 : Py_RETURN_NONE;
30647 : }
30648 :
30649 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30650 : {
30651 0 : DATA_BLOB blob;
30652 0 : Py_ssize_t blob_length = 0;
30653 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30654 0 : PyObject *bigendian_obj = NULL;
30655 0 : PyObject *ndr64_obj = NULL;
30656 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30657 0 : PyObject *allow_remaining_obj = NULL;
30658 0 : bool allow_remaining = false;
30659 :
30660 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30661 : discard_const_p(char *, kwnames),
30662 : &blob.data, &blob_length,
30663 : &bigendian_obj,
30664 : &ndr64_obj,
30665 : &allow_remaining_obj)) {
30666 0 : return NULL;
30667 : }
30668 0 : blob.length = blob_length;
30669 :
30670 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30671 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30672 : }
30673 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30674 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30675 : }
30676 :
30677 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30678 0 : allow_remaining = true;
30679 : }
30680 :
30681 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30682 : }
30683 :
30684 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30685 : {
30686 0 : DATA_BLOB blob;
30687 0 : Py_ssize_t blob_length = 0;
30688 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30689 0 : PyObject *bigendian_obj = NULL;
30690 0 : PyObject *ndr64_obj = NULL;
30691 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30692 0 : PyObject *allow_remaining_obj = NULL;
30693 0 : bool allow_remaining = false;
30694 :
30695 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30696 : discard_const_p(char *, kwnames),
30697 : &blob.data, &blob_length,
30698 : &bigendian_obj,
30699 : &ndr64_obj,
30700 : &allow_remaining_obj)) {
30701 0 : return NULL;
30702 : }
30703 0 : blob.length = blob_length;
30704 :
30705 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30706 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30707 : }
30708 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30709 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30710 : }
30711 :
30712 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30713 0 : allow_remaining = true;
30714 : }
30715 :
30716 0 : return py_lsa_EnumAccountsWithUserRight_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30717 : }
30718 :
30719 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30720 : {
30721 0 : const struct ndr_interface_call *call = NULL;
30722 0 : struct lsa_EnumAccountsWithUserRight *object = pytalloc_get_ptr(py_obj);
30723 0 : PyObject *ret;
30724 0 : char *retstr;
30725 :
30726 0 : if (ndr_table_lsarpc.num_calls < 36) {
30727 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountsWithUserRight_ndr_print");
30728 0 : return NULL;
30729 : }
30730 0 : call = &ndr_table_lsarpc.calls[35];
30731 :
30732 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30733 0 : ret = PyUnicode_FromString(retstr);
30734 0 : TALLOC_FREE(retstr);
30735 :
30736 0 : return ret;
30737 : }
30738 :
30739 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30740 : {
30741 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_in", NDR_IN);
30742 : }
30743 :
30744 0 : static PyObject *py_lsa_EnumAccountsWithUserRight_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30745 : {
30746 0 : return py_lsa_EnumAccountsWithUserRight_ndr_print(py_obj, "lsa_EnumAccountsWithUserRight_out", NDR_OUT);
30747 : }
30748 :
30749 : static PyMethodDef py_lsa_EnumAccountsWithUserRight_methods[] = {
30750 : { "opnum", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_opnum, METH_NOARGS|METH_CLASS,
30751 : "lsa.EnumAccountsWithUserRight.opnum() -> 35 (0x23) " },
30752 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30753 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30754 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30755 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30756 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30757 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30758 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountsWithUserRight_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30759 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30760 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30761 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountsWithUserRight_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30762 : { NULL, NULL, 0, NULL }
30763 : };
30764 :
30765 :
30766 : static PyTypeObject lsa_EnumAccountsWithUserRight_Type = {
30767 : PyVarObject_HEAD_INIT(NULL, 0)
30768 : .tp_name = "lsa.EnumAccountsWithUserRight",
30769 : .tp_getset = py_lsa_EnumAccountsWithUserRight_getsetters,
30770 : .tp_methods = py_lsa_EnumAccountsWithUserRight_methods,
30771 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30772 : .tp_new = py_lsa_EnumAccountsWithUserRight_new,
30773 : };
30774 :
30775 0 : static bool pack_py_lsa_EnumAccountsWithUserRight_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountsWithUserRight *r)
30776 : {
30777 0 : PyObject *py_handle;
30778 0 : PyObject *py_name;
30779 0 : const char *kwnames[] = {
30780 : "handle", "name", NULL
30781 : };
30782 :
30783 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountsWithUserRight", discard_const_p(char *, kwnames), &py_handle, &py_name)) {
30784 0 : return false;
30785 : }
30786 :
30787 0 : if (py_handle == NULL) {
30788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
30789 0 : return false;
30790 : }
30791 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
30792 0 : if (r->in.handle == NULL) {
30793 0 : PyErr_NoMemory();
30794 0 : return false;
30795 : }
30796 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
30797 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
30798 0 : PyErr_NoMemory();
30799 0 : return false;
30800 : }
30801 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
30802 0 : if (py_name == NULL) {
30803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
30804 0 : return false;
30805 : }
30806 0 : if (py_name == Py_None) {
30807 0 : r->in.name = NULL;
30808 : } else {
30809 0 : r->in.name = NULL;
30810 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
30811 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
30812 0 : PyErr_NoMemory();
30813 0 : return false;
30814 : }
30815 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
30816 : }
30817 0 : return true;
30818 : }
30819 :
30820 0 : static PyObject *unpack_py_lsa_EnumAccountsWithUserRight_args_out(struct lsa_EnumAccountsWithUserRight *r)
30821 : {
30822 0 : PyObject *result;
30823 0 : PyObject *py_sids;
30824 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, r->out.sids, r->out.sids);
30825 0 : result = py_sids;
30826 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30827 0 : PyErr_SetNTSTATUS(r->out.result);
30828 0 : return NULL;
30829 : }
30830 :
30831 0 : return result;
30832 : }
30833 :
30834 :
30835 0 : static PyObject *py_lsa_EnumAccountRights_in_get_handle(PyObject *obj, void *closure)
30836 : {
30837 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(obj);
30838 0 : PyObject *py_handle;
30839 0 : if (object->in.handle == NULL) {
30840 0 : Py_RETURN_NONE;
30841 : }
30842 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
30843 0 : return py_handle;
30844 : }
30845 :
30846 0 : static int py_lsa_EnumAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
30847 : {
30848 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
30849 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
30850 0 : if (value == NULL) {
30851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
30852 0 : return -1;
30853 : }
30854 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
30855 0 : if (object->in.handle == NULL) {
30856 0 : PyErr_NoMemory();
30857 0 : return -1;
30858 : }
30859 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30860 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30861 0 : PyErr_NoMemory();
30862 0 : return -1;
30863 : }
30864 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
30865 0 : return 0;
30866 : }
30867 :
30868 0 : static PyObject *py_lsa_EnumAccountRights_in_get_sid(PyObject *obj, void *closure)
30869 : {
30870 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(obj);
30871 0 : PyObject *py_sid;
30872 0 : if (object->in.sid == NULL) {
30873 0 : Py_RETURN_NONE;
30874 : }
30875 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30876 0 : return py_sid;
30877 : }
30878 :
30879 0 : static int py_lsa_EnumAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30880 : {
30881 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
30882 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30883 0 : if (value == NULL) {
30884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
30885 0 : return -1;
30886 : }
30887 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30888 0 : if (object->in.sid == NULL) {
30889 0 : PyErr_NoMemory();
30890 0 : return -1;
30891 : }
30892 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30893 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30894 0 : PyErr_NoMemory();
30895 0 : return -1;
30896 : }
30897 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30898 0 : return 0;
30899 : }
30900 :
30901 0 : static PyObject *py_lsa_EnumAccountRights_out_get_rights(PyObject *obj, void *closure)
30902 : {
30903 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(obj);
30904 0 : PyObject *py_rights;
30905 0 : if (object->out.rights == NULL) {
30906 0 : Py_RETURN_NONE;
30907 : }
30908 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->out.rights, object->out.rights);
30909 0 : return py_rights;
30910 : }
30911 :
30912 0 : static int py_lsa_EnumAccountRights_out_set_rights(PyObject *py_obj, PyObject *value, void *closure)
30913 : {
30914 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
30915 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rights));
30916 0 : if (value == NULL) {
30917 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.rights");
30918 0 : return -1;
30919 : }
30920 0 : object->out.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rights);
30921 0 : if (object->out.rights == NULL) {
30922 0 : PyErr_NoMemory();
30923 0 : return -1;
30924 : }
30925 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
30926 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30927 0 : PyErr_NoMemory();
30928 0 : return -1;
30929 : }
30930 0 : object->out.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
30931 0 : return 0;
30932 : }
30933 :
30934 0 : static PyObject *py_lsa_EnumAccountRights_get_result(PyObject *obj, void *closure)
30935 : {
30936 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(obj);
30937 0 : PyObject *py_result;
30938 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30939 0 : return py_result;
30940 : }
30941 :
30942 0 : static int py_lsa_EnumAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
30943 : {
30944 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
30945 0 : if (value == NULL) {
30946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
30947 0 : return -1;
30948 : }
30949 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30950 0 : return 0;
30951 : }
30952 :
30953 : static PyGetSetDef py_lsa_EnumAccountRights_getsetters[] = {
30954 : {
30955 : .name = discard_const_p(char, "in_handle"),
30956 : .get = py_lsa_EnumAccountRights_in_get_handle,
30957 : .set = py_lsa_EnumAccountRights_in_set_handle,
30958 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30959 : },
30960 : {
30961 : .name = discard_const_p(char, "in_sid"),
30962 : .get = py_lsa_EnumAccountRights_in_get_sid,
30963 : .set = py_lsa_EnumAccountRights_in_set_sid,
30964 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30965 : },
30966 : {
30967 : .name = discard_const_p(char, "out_rights"),
30968 : .get = py_lsa_EnumAccountRights_out_get_rights,
30969 : .set = py_lsa_EnumAccountRights_out_set_rights,
30970 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
30971 : },
30972 : {
30973 : .name = discard_const_p(char, "result"),
30974 : .get = py_lsa_EnumAccountRights_get_result,
30975 : .set = py_lsa_EnumAccountRights_set_result,
30976 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30977 : },
30978 : { .name = NULL }
30979 : };
30980 :
30981 0 : static PyObject *py_lsa_EnumAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30982 : {
30983 0 : PyObject *self = pytalloc_new(struct lsa_EnumAccountRights, type);
30984 0 : struct lsa_EnumAccountRights *_self = (struct lsa_EnumAccountRights *)pytalloc_get_ptr(self);
30985 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30986 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
30987 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30988 0 : _self->out.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
30989 0 : return self;
30990 : }
30991 :
30992 0 : static PyObject *py_lsa_EnumAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30993 : {
30994 :
30995 :
30996 0 : return PyLong_FromLong(36);
30997 : }
30998 :
30999 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31000 : {
31001 0 : const struct ndr_interface_call *call = NULL;
31002 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
31003 0 : PyObject *ret = NULL;
31004 0 : struct ndr_push *push = NULL;
31005 0 : DATA_BLOB blob;
31006 0 : enum ndr_err_code err;
31007 :
31008 0 : if (ndr_table_lsarpc.num_calls < 37) {
31009 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_pack");
31010 0 : return NULL;
31011 : }
31012 0 : call = &ndr_table_lsarpc.calls[36];
31013 :
31014 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31015 0 : if (push == NULL) {
31016 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31017 0 : return NULL;
31018 : }
31019 :
31020 0 : push->flags |= ndr_push_flags;
31021 :
31022 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31023 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31024 0 : TALLOC_FREE(push);
31025 0 : PyErr_SetNdrError(err);
31026 0 : return NULL;
31027 : }
31028 0 : blob = ndr_push_blob(push);
31029 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31030 0 : TALLOC_FREE(push);
31031 0 : return ret;
31032 : }
31033 :
31034 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31035 : {
31036 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31037 0 : PyObject *bigendian_obj = NULL;
31038 0 : PyObject *ndr64_obj = NULL;
31039 0 : libndr_flags ndr_push_flags = 0;
31040 :
31041 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31042 : discard_const_p(char *, kwnames),
31043 : &bigendian_obj,
31044 : &ndr64_obj)) {
31045 0 : return NULL;
31046 : }
31047 :
31048 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31049 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31050 : }
31051 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31052 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31053 : }
31054 :
31055 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31056 : }
31057 :
31058 0 : static PyObject *py_lsa_EnumAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31059 : {
31060 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31061 0 : PyObject *bigendian_obj = NULL;
31062 0 : PyObject *ndr64_obj = NULL;
31063 0 : libndr_flags ndr_push_flags = 0;
31064 :
31065 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31066 : discard_const_p(char *, kwnames),
31067 : &bigendian_obj,
31068 : &ndr64_obj)) {
31069 0 : return NULL;
31070 : }
31071 :
31072 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31073 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31074 : }
31075 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31076 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31077 : }
31078 :
31079 0 : return py_lsa_EnumAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31080 : }
31081 :
31082 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)
31083 : {
31084 0 : const struct ndr_interface_call *call = NULL;
31085 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
31086 0 : struct ndr_pull *pull = NULL;
31087 0 : enum ndr_err_code err;
31088 :
31089 0 : if (ndr_table_lsarpc.num_calls < 37) {
31090 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_unpack");
31091 0 : return NULL;
31092 : }
31093 0 : call = &ndr_table_lsarpc.calls[36];
31094 :
31095 0 : pull = ndr_pull_init_blob(blob, object);
31096 0 : if (pull == NULL) {
31097 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31098 0 : return NULL;
31099 : }
31100 :
31101 0 : pull->flags |= ndr_pull_flags;
31102 :
31103 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31104 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31105 0 : TALLOC_FREE(pull);
31106 0 : PyErr_SetNdrError(err);
31107 0 : return NULL;
31108 : }
31109 0 : if (!allow_remaining) {
31110 0 : uint32_t highest_ofs;
31111 :
31112 0 : if (pull->offset > pull->relative_highest_offset) {
31113 0 : highest_ofs = pull->offset;
31114 : } else {
31115 0 : highest_ofs = pull->relative_highest_offset;
31116 : }
31117 0 : if (highest_ofs < pull->data_size) {
31118 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31119 : "not all bytes consumed ofs[%u] size[%u]",
31120 : highest_ofs, pull->data_size);
31121 0 : TALLOC_FREE(pull);
31122 0 : PyErr_SetNdrError(err);
31123 0 : return NULL;
31124 : }
31125 : }
31126 :
31127 0 : TALLOC_FREE(pull);
31128 0 : Py_RETURN_NONE;
31129 : }
31130 :
31131 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31132 : {
31133 0 : DATA_BLOB blob;
31134 0 : Py_ssize_t blob_length = 0;
31135 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31136 0 : PyObject *bigendian_obj = NULL;
31137 0 : PyObject *ndr64_obj = NULL;
31138 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31139 0 : PyObject *allow_remaining_obj = NULL;
31140 0 : bool allow_remaining = false;
31141 :
31142 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31143 : discard_const_p(char *, kwnames),
31144 : &blob.data, &blob_length,
31145 : &bigendian_obj,
31146 : &ndr64_obj,
31147 : &allow_remaining_obj)) {
31148 0 : return NULL;
31149 : }
31150 0 : blob.length = blob_length;
31151 :
31152 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31153 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31154 : }
31155 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31156 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31157 : }
31158 :
31159 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31160 0 : allow_remaining = true;
31161 : }
31162 :
31163 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31164 : }
31165 :
31166 0 : static PyObject *py_lsa_EnumAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31167 : {
31168 0 : DATA_BLOB blob;
31169 0 : Py_ssize_t blob_length = 0;
31170 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31171 0 : PyObject *bigendian_obj = NULL;
31172 0 : PyObject *ndr64_obj = NULL;
31173 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31174 0 : PyObject *allow_remaining_obj = NULL;
31175 0 : bool allow_remaining = false;
31176 :
31177 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31178 : discard_const_p(char *, kwnames),
31179 : &blob.data, &blob_length,
31180 : &bigendian_obj,
31181 : &ndr64_obj,
31182 : &allow_remaining_obj)) {
31183 0 : return NULL;
31184 : }
31185 0 : blob.length = blob_length;
31186 :
31187 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31188 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31189 : }
31190 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31191 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31192 : }
31193 :
31194 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31195 0 : allow_remaining = true;
31196 : }
31197 :
31198 0 : return py_lsa_EnumAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31199 : }
31200 :
31201 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31202 : {
31203 0 : const struct ndr_interface_call *call = NULL;
31204 0 : struct lsa_EnumAccountRights *object = pytalloc_get_ptr(py_obj);
31205 0 : PyObject *ret;
31206 0 : char *retstr;
31207 :
31208 0 : if (ndr_table_lsarpc.num_calls < 37) {
31209 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumAccountRights_ndr_print");
31210 0 : return NULL;
31211 : }
31212 0 : call = &ndr_table_lsarpc.calls[36];
31213 :
31214 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31215 0 : ret = PyUnicode_FromString(retstr);
31216 0 : TALLOC_FREE(retstr);
31217 :
31218 0 : return ret;
31219 : }
31220 :
31221 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31222 : {
31223 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_in", NDR_IN);
31224 : }
31225 :
31226 0 : static PyObject *py_lsa_EnumAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31227 : {
31228 0 : return py_lsa_EnumAccountRights_ndr_print(py_obj, "lsa_EnumAccountRights_out", NDR_OUT);
31229 : }
31230 :
31231 : static PyMethodDef py_lsa_EnumAccountRights_methods[] = {
31232 : { "opnum", (PyCFunction)py_lsa_EnumAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
31233 : "lsa.EnumAccountRights.opnum() -> 36 (0x24) " },
31234 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31235 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31236 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31237 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31238 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31239 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31240 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31241 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31242 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31243 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31244 : { NULL, NULL, 0, NULL }
31245 : };
31246 :
31247 :
31248 : static PyTypeObject lsa_EnumAccountRights_Type = {
31249 : PyVarObject_HEAD_INIT(NULL, 0)
31250 : .tp_name = "lsa.EnumAccountRights",
31251 : .tp_getset = py_lsa_EnumAccountRights_getsetters,
31252 : .tp_methods = py_lsa_EnumAccountRights_methods,
31253 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31254 : .tp_new = py_lsa_EnumAccountRights_new,
31255 : };
31256 :
31257 0 : static bool pack_py_lsa_EnumAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumAccountRights *r)
31258 : {
31259 0 : PyObject *py_handle;
31260 0 : PyObject *py_sid;
31261 0 : const char *kwnames[] = {
31262 : "handle", "sid", NULL
31263 : };
31264 :
31265 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_EnumAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid)) {
31266 0 : return false;
31267 : }
31268 :
31269 0 : if (py_handle == NULL) {
31270 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
31271 0 : return false;
31272 : }
31273 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31274 0 : if (r->in.handle == NULL) {
31275 0 : PyErr_NoMemory();
31276 0 : return false;
31277 : }
31278 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31279 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31280 0 : PyErr_NoMemory();
31281 0 : return false;
31282 : }
31283 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31284 0 : if (py_sid == NULL) {
31285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
31286 0 : return false;
31287 : }
31288 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
31289 0 : if (r->in.sid == NULL) {
31290 0 : PyErr_NoMemory();
31291 0 : return false;
31292 : }
31293 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
31294 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
31295 0 : PyErr_NoMemory();
31296 0 : return false;
31297 : }
31298 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
31299 0 : return true;
31300 : }
31301 :
31302 0 : static PyObject *unpack_py_lsa_EnumAccountRights_args_out(struct lsa_EnumAccountRights *r)
31303 : {
31304 0 : PyObject *result;
31305 0 : PyObject *py_rights;
31306 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, r->out.rights, r->out.rights);
31307 0 : result = py_rights;
31308 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31309 0 : PyErr_SetNTSTATUS(r->out.result);
31310 0 : return NULL;
31311 : }
31312 :
31313 0 : return result;
31314 : }
31315 :
31316 :
31317 0 : static PyObject *py_lsa_AddAccountRights_in_get_handle(PyObject *obj, void *closure)
31318 : {
31319 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(obj);
31320 0 : PyObject *py_handle;
31321 0 : if (object->in.handle == NULL) {
31322 0 : Py_RETURN_NONE;
31323 : }
31324 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31325 0 : return py_handle;
31326 : }
31327 :
31328 0 : static int py_lsa_AddAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31329 : {
31330 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31331 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31332 0 : if (value == NULL) {
31333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
31334 0 : return -1;
31335 : }
31336 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31337 0 : if (object->in.handle == NULL) {
31338 0 : PyErr_NoMemory();
31339 0 : return -1;
31340 : }
31341 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31342 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31343 0 : PyErr_NoMemory();
31344 0 : return -1;
31345 : }
31346 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31347 0 : return 0;
31348 : }
31349 :
31350 0 : static PyObject *py_lsa_AddAccountRights_in_get_sid(PyObject *obj, void *closure)
31351 : {
31352 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(obj);
31353 0 : PyObject *py_sid;
31354 0 : if (object->in.sid == NULL) {
31355 0 : Py_RETURN_NONE;
31356 : }
31357 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
31358 0 : return py_sid;
31359 : }
31360 :
31361 0 : static int py_lsa_AddAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
31362 : {
31363 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31364 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
31365 0 : if (value == NULL) {
31366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
31367 0 : return -1;
31368 : }
31369 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
31370 0 : if (object->in.sid == NULL) {
31371 0 : PyErr_NoMemory();
31372 0 : return -1;
31373 : }
31374 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31375 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31376 0 : PyErr_NoMemory();
31377 0 : return -1;
31378 : }
31379 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
31380 0 : return 0;
31381 : }
31382 :
31383 0 : static PyObject *py_lsa_AddAccountRights_in_get_rights(PyObject *obj, void *closure)
31384 : {
31385 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(obj);
31386 0 : PyObject *py_rights;
31387 0 : if (object->in.rights == NULL) {
31388 0 : Py_RETURN_NONE;
31389 : }
31390 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
31391 0 : return py_rights;
31392 : }
31393 :
31394 0 : static int py_lsa_AddAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
31395 : {
31396 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31397 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
31398 0 : if (value == NULL) {
31399 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.rights");
31400 0 : return -1;
31401 : }
31402 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
31403 0 : if (object->in.rights == NULL) {
31404 0 : PyErr_NoMemory();
31405 0 : return -1;
31406 : }
31407 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
31408 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31409 0 : PyErr_NoMemory();
31410 0 : return -1;
31411 : }
31412 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
31413 0 : return 0;
31414 : }
31415 :
31416 0 : static PyObject *py_lsa_AddAccountRights_get_result(PyObject *obj, void *closure)
31417 : {
31418 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(obj);
31419 0 : PyObject *py_result;
31420 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31421 0 : return py_result;
31422 : }
31423 :
31424 0 : static int py_lsa_AddAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
31425 : {
31426 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31427 0 : if (value == NULL) {
31428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
31429 0 : return -1;
31430 : }
31431 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31432 0 : return 0;
31433 : }
31434 :
31435 : static PyGetSetDef py_lsa_AddAccountRights_getsetters[] = {
31436 : {
31437 : .name = discard_const_p(char, "in_handle"),
31438 : .get = py_lsa_AddAccountRights_in_get_handle,
31439 : .set = py_lsa_AddAccountRights_in_set_handle,
31440 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31441 : },
31442 : {
31443 : .name = discard_const_p(char, "in_sid"),
31444 : .get = py_lsa_AddAccountRights_in_get_sid,
31445 : .set = py_lsa_AddAccountRights_in_set_sid,
31446 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31447 : },
31448 : {
31449 : .name = discard_const_p(char, "in_rights"),
31450 : .get = py_lsa_AddAccountRights_in_get_rights,
31451 : .set = py_lsa_AddAccountRights_in_set_rights,
31452 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
31453 : },
31454 : {
31455 : .name = discard_const_p(char, "result"),
31456 : .get = py_lsa_AddAccountRights_get_result,
31457 : .set = py_lsa_AddAccountRights_set_result,
31458 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31459 : },
31460 : { .name = NULL }
31461 : };
31462 :
31463 0 : static PyObject *py_lsa_AddAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31464 : {
31465 0 : PyObject *self = pytalloc_new(struct lsa_AddAccountRights, type);
31466 0 : struct lsa_AddAccountRights *_self = (struct lsa_AddAccountRights *)pytalloc_get_ptr(self);
31467 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31468 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
31469 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
31470 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
31471 0 : return self;
31472 : }
31473 :
31474 0 : static PyObject *py_lsa_AddAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31475 : {
31476 :
31477 :
31478 0 : return PyLong_FromLong(37);
31479 : }
31480 :
31481 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31482 : {
31483 0 : const struct ndr_interface_call *call = NULL;
31484 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31485 0 : PyObject *ret = NULL;
31486 0 : struct ndr_push *push = NULL;
31487 0 : DATA_BLOB blob;
31488 0 : enum ndr_err_code err;
31489 :
31490 0 : if (ndr_table_lsarpc.num_calls < 38) {
31491 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_pack");
31492 0 : return NULL;
31493 : }
31494 0 : call = &ndr_table_lsarpc.calls[37];
31495 :
31496 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31497 0 : if (push == NULL) {
31498 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31499 0 : return NULL;
31500 : }
31501 :
31502 0 : push->flags |= ndr_push_flags;
31503 :
31504 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31505 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31506 0 : TALLOC_FREE(push);
31507 0 : PyErr_SetNdrError(err);
31508 0 : return NULL;
31509 : }
31510 0 : blob = ndr_push_blob(push);
31511 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31512 0 : TALLOC_FREE(push);
31513 0 : return ret;
31514 : }
31515 :
31516 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31517 : {
31518 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31519 0 : PyObject *bigendian_obj = NULL;
31520 0 : PyObject *ndr64_obj = NULL;
31521 0 : libndr_flags ndr_push_flags = 0;
31522 :
31523 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31524 : discard_const_p(char *, kwnames),
31525 : &bigendian_obj,
31526 : &ndr64_obj)) {
31527 0 : return NULL;
31528 : }
31529 :
31530 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31531 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31532 : }
31533 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31534 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31535 : }
31536 :
31537 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31538 : }
31539 :
31540 0 : static PyObject *py_lsa_AddAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31541 : {
31542 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31543 0 : PyObject *bigendian_obj = NULL;
31544 0 : PyObject *ndr64_obj = NULL;
31545 0 : libndr_flags ndr_push_flags = 0;
31546 :
31547 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31548 : discard_const_p(char *, kwnames),
31549 : &bigendian_obj,
31550 : &ndr64_obj)) {
31551 0 : return NULL;
31552 : }
31553 :
31554 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31555 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31556 : }
31557 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31558 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31559 : }
31560 :
31561 0 : return py_lsa_AddAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31562 : }
31563 :
31564 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)
31565 : {
31566 0 : const struct ndr_interface_call *call = NULL;
31567 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31568 0 : struct ndr_pull *pull = NULL;
31569 0 : enum ndr_err_code err;
31570 :
31571 0 : if (ndr_table_lsarpc.num_calls < 38) {
31572 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_unpack");
31573 0 : return NULL;
31574 : }
31575 0 : call = &ndr_table_lsarpc.calls[37];
31576 :
31577 0 : pull = ndr_pull_init_blob(blob, object);
31578 0 : if (pull == NULL) {
31579 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31580 0 : return NULL;
31581 : }
31582 :
31583 0 : pull->flags |= ndr_pull_flags;
31584 :
31585 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31586 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31587 0 : TALLOC_FREE(pull);
31588 0 : PyErr_SetNdrError(err);
31589 0 : return NULL;
31590 : }
31591 0 : if (!allow_remaining) {
31592 0 : uint32_t highest_ofs;
31593 :
31594 0 : if (pull->offset > pull->relative_highest_offset) {
31595 0 : highest_ofs = pull->offset;
31596 : } else {
31597 0 : highest_ofs = pull->relative_highest_offset;
31598 : }
31599 0 : if (highest_ofs < pull->data_size) {
31600 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31601 : "not all bytes consumed ofs[%u] size[%u]",
31602 : highest_ofs, pull->data_size);
31603 0 : TALLOC_FREE(pull);
31604 0 : PyErr_SetNdrError(err);
31605 0 : return NULL;
31606 : }
31607 : }
31608 :
31609 0 : TALLOC_FREE(pull);
31610 0 : Py_RETURN_NONE;
31611 : }
31612 :
31613 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31614 : {
31615 0 : DATA_BLOB blob;
31616 0 : Py_ssize_t blob_length = 0;
31617 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31618 0 : PyObject *bigendian_obj = NULL;
31619 0 : PyObject *ndr64_obj = NULL;
31620 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31621 0 : PyObject *allow_remaining_obj = NULL;
31622 0 : bool allow_remaining = false;
31623 :
31624 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31625 : discard_const_p(char *, kwnames),
31626 : &blob.data, &blob_length,
31627 : &bigendian_obj,
31628 : &ndr64_obj,
31629 : &allow_remaining_obj)) {
31630 0 : return NULL;
31631 : }
31632 0 : blob.length = blob_length;
31633 :
31634 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31635 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31636 : }
31637 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31638 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31639 : }
31640 :
31641 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31642 0 : allow_remaining = true;
31643 : }
31644 :
31645 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31646 : }
31647 :
31648 0 : static PyObject *py_lsa_AddAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31649 : {
31650 0 : DATA_BLOB blob;
31651 0 : Py_ssize_t blob_length = 0;
31652 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31653 0 : PyObject *bigendian_obj = NULL;
31654 0 : PyObject *ndr64_obj = NULL;
31655 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31656 0 : PyObject *allow_remaining_obj = NULL;
31657 0 : bool allow_remaining = false;
31658 :
31659 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31660 : discard_const_p(char *, kwnames),
31661 : &blob.data, &blob_length,
31662 : &bigendian_obj,
31663 : &ndr64_obj,
31664 : &allow_remaining_obj)) {
31665 0 : return NULL;
31666 : }
31667 0 : blob.length = blob_length;
31668 :
31669 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31670 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31671 : }
31672 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31673 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31674 : }
31675 :
31676 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31677 0 : allow_remaining = true;
31678 : }
31679 :
31680 0 : return py_lsa_AddAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31681 : }
31682 :
31683 0 : static PyObject *py_lsa_AddAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31684 : {
31685 0 : const struct ndr_interface_call *call = NULL;
31686 0 : struct lsa_AddAccountRights *object = pytalloc_get_ptr(py_obj);
31687 0 : PyObject *ret;
31688 0 : char *retstr;
31689 :
31690 0 : if (ndr_table_lsarpc.num_calls < 38) {
31691 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_AddAccountRights_ndr_print");
31692 0 : return NULL;
31693 : }
31694 0 : call = &ndr_table_lsarpc.calls[37];
31695 :
31696 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31697 0 : ret = PyUnicode_FromString(retstr);
31698 0 : TALLOC_FREE(retstr);
31699 :
31700 0 : return ret;
31701 : }
31702 :
31703 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31704 : {
31705 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_in", NDR_IN);
31706 : }
31707 :
31708 0 : static PyObject *py_lsa_AddAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31709 : {
31710 0 : return py_lsa_AddAccountRights_ndr_print(py_obj, "lsa_AddAccountRights_out", NDR_OUT);
31711 : }
31712 :
31713 : static PyMethodDef py_lsa_AddAccountRights_methods[] = {
31714 : { "opnum", (PyCFunction)py_lsa_AddAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
31715 : "lsa.AddAccountRights.opnum() -> 37 (0x25) " },
31716 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31717 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31718 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31719 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31720 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31721 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31722 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_AddAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31723 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31724 : { "__ndr_print_in__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31725 : { "__ndr_print_out__", (PyCFunction)py_lsa_AddAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31726 : { NULL, NULL, 0, NULL }
31727 : };
31728 :
31729 :
31730 : static PyTypeObject lsa_AddAccountRights_Type = {
31731 : PyVarObject_HEAD_INIT(NULL, 0)
31732 : .tp_name = "lsa.AddAccountRights",
31733 : .tp_getset = py_lsa_AddAccountRights_getsetters,
31734 : .tp_methods = py_lsa_AddAccountRights_methods,
31735 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31736 : .tp_new = py_lsa_AddAccountRights_new,
31737 : };
31738 :
31739 0 : static bool pack_py_lsa_AddAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_AddAccountRights *r)
31740 : {
31741 0 : PyObject *py_handle;
31742 0 : PyObject *py_sid;
31743 0 : PyObject *py_rights;
31744 0 : const char *kwnames[] = {
31745 : "handle", "sid", "rights", NULL
31746 : };
31747 :
31748 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_AddAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_rights)) {
31749 0 : return false;
31750 : }
31751 :
31752 0 : if (py_handle == NULL) {
31753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
31754 0 : return false;
31755 : }
31756 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
31757 0 : if (r->in.handle == NULL) {
31758 0 : PyErr_NoMemory();
31759 0 : return false;
31760 : }
31761 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
31762 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
31763 0 : PyErr_NoMemory();
31764 0 : return false;
31765 : }
31766 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
31767 0 : if (py_sid == NULL) {
31768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
31769 0 : return false;
31770 : }
31771 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
31772 0 : if (r->in.sid == NULL) {
31773 0 : PyErr_NoMemory();
31774 0 : return false;
31775 : }
31776 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
31777 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
31778 0 : PyErr_NoMemory();
31779 0 : return false;
31780 : }
31781 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
31782 0 : if (py_rights == NULL) {
31783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.rights");
31784 0 : return false;
31785 : }
31786 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
31787 0 : if (r->in.rights == NULL) {
31788 0 : PyErr_NoMemory();
31789 0 : return false;
31790 : }
31791 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
31792 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
31793 0 : PyErr_NoMemory();
31794 0 : return false;
31795 : }
31796 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
31797 0 : return true;
31798 : }
31799 :
31800 0 : static PyObject *unpack_py_lsa_AddAccountRights_args_out(struct lsa_AddAccountRights *r)
31801 : {
31802 0 : PyObject *result;
31803 0 : result = Py_None;
31804 0 : Py_INCREF(result);
31805 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31806 0 : PyErr_SetNTSTATUS(r->out.result);
31807 0 : return NULL;
31808 : }
31809 :
31810 0 : return result;
31811 : }
31812 :
31813 :
31814 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_handle(PyObject *obj, void *closure)
31815 : {
31816 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(obj);
31817 0 : PyObject *py_handle;
31818 0 : if (object->in.handle == NULL) {
31819 0 : Py_RETURN_NONE;
31820 : }
31821 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
31822 0 : return py_handle;
31823 : }
31824 :
31825 0 : static int py_lsa_RemoveAccountRights_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
31826 : {
31827 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
31828 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
31829 0 : if (value == NULL) {
31830 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
31831 0 : return -1;
31832 : }
31833 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
31834 0 : if (object->in.handle == NULL) {
31835 0 : PyErr_NoMemory();
31836 0 : return -1;
31837 : }
31838 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31839 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31840 0 : PyErr_NoMemory();
31841 0 : return -1;
31842 : }
31843 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
31844 0 : return 0;
31845 : }
31846 :
31847 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_sid(PyObject *obj, void *closure)
31848 : {
31849 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(obj);
31850 0 : PyObject *py_sid;
31851 0 : if (object->in.sid == NULL) {
31852 0 : Py_RETURN_NONE;
31853 : }
31854 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
31855 0 : return py_sid;
31856 : }
31857 :
31858 0 : static int py_lsa_RemoveAccountRights_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
31859 : {
31860 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
31861 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
31862 0 : if (value == NULL) {
31863 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sid");
31864 0 : return -1;
31865 : }
31866 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
31867 0 : if (object->in.sid == NULL) {
31868 0 : PyErr_NoMemory();
31869 0 : return -1;
31870 : }
31871 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
31872 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31873 0 : PyErr_NoMemory();
31874 0 : return -1;
31875 : }
31876 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
31877 0 : return 0;
31878 : }
31879 :
31880 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_remove_all(PyObject *obj, void *closure)
31881 : {
31882 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(obj);
31883 0 : PyObject *py_remove_all;
31884 0 : py_remove_all = PyLong_FromLong((uint16_t)(object->in.remove_all));
31885 0 : return py_remove_all;
31886 : }
31887 :
31888 0 : static int py_lsa_RemoveAccountRights_in_set_remove_all(PyObject *py_obj, PyObject *value, void *closure)
31889 : {
31890 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
31891 0 : if (value == NULL) {
31892 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.remove_all");
31893 0 : return -1;
31894 : }
31895 : {
31896 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.remove_all));
31897 0 : if (PyLong_Check(value)) {
31898 0 : unsigned long long test_var;
31899 0 : test_var = PyLong_AsUnsignedLongLong(value);
31900 0 : if (PyErr_Occurred() != NULL) {
31901 0 : return -1;
31902 : }
31903 0 : if (test_var > uint_max) {
31904 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31905 : PyLong_Type.tp_name, uint_max, test_var);
31906 0 : return -1;
31907 : }
31908 0 : object->in.remove_all = test_var;
31909 : } else {
31910 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31911 : PyLong_Type.tp_name);
31912 0 : return -1;
31913 : }
31914 : }
31915 0 : return 0;
31916 : }
31917 :
31918 0 : static PyObject *py_lsa_RemoveAccountRights_in_get_rights(PyObject *obj, void *closure)
31919 : {
31920 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(obj);
31921 0 : PyObject *py_rights;
31922 0 : if (object->in.rights == NULL) {
31923 0 : Py_RETURN_NONE;
31924 : }
31925 0 : py_rights = pytalloc_reference_ex(&lsa_RightSet_Type, object->in.rights, object->in.rights);
31926 0 : return py_rights;
31927 : }
31928 :
31929 0 : static int py_lsa_RemoveAccountRights_in_set_rights(PyObject *py_obj, PyObject *value, void *closure)
31930 : {
31931 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
31932 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.rights));
31933 0 : if (value == NULL) {
31934 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.rights");
31935 0 : return -1;
31936 : }
31937 0 : object->in.rights = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rights);
31938 0 : if (object->in.rights == NULL) {
31939 0 : PyErr_NoMemory();
31940 0 : return -1;
31941 : }
31942 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, value, return -1;);
31943 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31944 0 : PyErr_NoMemory();
31945 0 : return -1;
31946 : }
31947 0 : object->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(value);
31948 0 : return 0;
31949 : }
31950 :
31951 0 : static PyObject *py_lsa_RemoveAccountRights_get_result(PyObject *obj, void *closure)
31952 : {
31953 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(obj);
31954 0 : PyObject *py_result;
31955 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31956 0 : return py_result;
31957 : }
31958 :
31959 0 : static int py_lsa_RemoveAccountRights_set_result(PyObject *py_obj, PyObject *value, void *closure)
31960 : {
31961 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
31962 0 : if (value == NULL) {
31963 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
31964 0 : return -1;
31965 : }
31966 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31967 0 : return 0;
31968 : }
31969 :
31970 : static PyGetSetDef py_lsa_RemoveAccountRights_getsetters[] = {
31971 : {
31972 : .name = discard_const_p(char, "in_handle"),
31973 : .get = py_lsa_RemoveAccountRights_in_get_handle,
31974 : .set = py_lsa_RemoveAccountRights_in_set_handle,
31975 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31976 : },
31977 : {
31978 : .name = discard_const_p(char, "in_sid"),
31979 : .get = py_lsa_RemoveAccountRights_in_get_sid,
31980 : .set = py_lsa_RemoveAccountRights_in_set_sid,
31981 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
31982 : },
31983 : {
31984 : .name = discard_const_p(char, "in_remove_all"),
31985 : .get = py_lsa_RemoveAccountRights_in_get_remove_all,
31986 : .set = py_lsa_RemoveAccountRights_in_set_remove_all,
31987 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
31988 : },
31989 : {
31990 : .name = discard_const_p(char, "in_rights"),
31991 : .get = py_lsa_RemoveAccountRights_in_get_rights,
31992 : .set = py_lsa_RemoveAccountRights_in_set_rights,
31993 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RightSet")
31994 : },
31995 : {
31996 : .name = discard_const_p(char, "result"),
31997 : .get = py_lsa_RemoveAccountRights_get_result,
31998 : .set = py_lsa_RemoveAccountRights_set_result,
31999 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32000 : },
32001 : { .name = NULL }
32002 : };
32003 :
32004 0 : static PyObject *py_lsa_RemoveAccountRights_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32005 : {
32006 0 : PyObject *self = pytalloc_new(struct lsa_RemoveAccountRights, type);
32007 0 : struct lsa_RemoveAccountRights *_self = (struct lsa_RemoveAccountRights *)pytalloc_get_ptr(self);
32008 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32009 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32010 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
32011 0 : _self->in.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
32012 0 : return self;
32013 : }
32014 :
32015 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32016 : {
32017 :
32018 :
32019 0 : return PyLong_FromLong(38);
32020 : }
32021 :
32022 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32023 : {
32024 0 : const struct ndr_interface_call *call = NULL;
32025 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
32026 0 : PyObject *ret = NULL;
32027 0 : struct ndr_push *push = NULL;
32028 0 : DATA_BLOB blob;
32029 0 : enum ndr_err_code err;
32030 :
32031 0 : if (ndr_table_lsarpc.num_calls < 39) {
32032 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_pack");
32033 0 : return NULL;
32034 : }
32035 0 : call = &ndr_table_lsarpc.calls[38];
32036 :
32037 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32038 0 : if (push == NULL) {
32039 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32040 0 : return NULL;
32041 : }
32042 :
32043 0 : push->flags |= ndr_push_flags;
32044 :
32045 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32046 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32047 0 : TALLOC_FREE(push);
32048 0 : PyErr_SetNdrError(err);
32049 0 : return NULL;
32050 : }
32051 0 : blob = ndr_push_blob(push);
32052 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32053 0 : TALLOC_FREE(push);
32054 0 : return ret;
32055 : }
32056 :
32057 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32058 : {
32059 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32060 0 : PyObject *bigendian_obj = NULL;
32061 0 : PyObject *ndr64_obj = NULL;
32062 0 : libndr_flags ndr_push_flags = 0;
32063 :
32064 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32065 : discard_const_p(char *, kwnames),
32066 : &bigendian_obj,
32067 : &ndr64_obj)) {
32068 0 : return NULL;
32069 : }
32070 :
32071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32072 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32073 : }
32074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32075 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32076 : }
32077 :
32078 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32079 : }
32080 :
32081 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32082 : {
32083 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32084 0 : PyObject *bigendian_obj = NULL;
32085 0 : PyObject *ndr64_obj = NULL;
32086 0 : libndr_flags ndr_push_flags = 0;
32087 :
32088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32089 : discard_const_p(char *, kwnames),
32090 : &bigendian_obj,
32091 : &ndr64_obj)) {
32092 0 : return NULL;
32093 : }
32094 :
32095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32096 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32097 : }
32098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32099 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32100 : }
32101 :
32102 0 : return py_lsa_RemoveAccountRights_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32103 : }
32104 :
32105 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)
32106 : {
32107 0 : const struct ndr_interface_call *call = NULL;
32108 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
32109 0 : struct ndr_pull *pull = NULL;
32110 0 : enum ndr_err_code err;
32111 :
32112 0 : if (ndr_table_lsarpc.num_calls < 39) {
32113 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_unpack");
32114 0 : return NULL;
32115 : }
32116 0 : call = &ndr_table_lsarpc.calls[38];
32117 :
32118 0 : pull = ndr_pull_init_blob(blob, object);
32119 0 : if (pull == NULL) {
32120 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32121 0 : return NULL;
32122 : }
32123 :
32124 0 : pull->flags |= ndr_pull_flags;
32125 :
32126 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32127 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32128 0 : TALLOC_FREE(pull);
32129 0 : PyErr_SetNdrError(err);
32130 0 : return NULL;
32131 : }
32132 0 : if (!allow_remaining) {
32133 0 : uint32_t highest_ofs;
32134 :
32135 0 : if (pull->offset > pull->relative_highest_offset) {
32136 0 : highest_ofs = pull->offset;
32137 : } else {
32138 0 : highest_ofs = pull->relative_highest_offset;
32139 : }
32140 0 : if (highest_ofs < pull->data_size) {
32141 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32142 : "not all bytes consumed ofs[%u] size[%u]",
32143 : highest_ofs, pull->data_size);
32144 0 : TALLOC_FREE(pull);
32145 0 : PyErr_SetNdrError(err);
32146 0 : return NULL;
32147 : }
32148 : }
32149 :
32150 0 : TALLOC_FREE(pull);
32151 0 : Py_RETURN_NONE;
32152 : }
32153 :
32154 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32155 : {
32156 0 : DATA_BLOB blob;
32157 0 : Py_ssize_t blob_length = 0;
32158 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32159 0 : PyObject *bigendian_obj = NULL;
32160 0 : PyObject *ndr64_obj = NULL;
32161 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32162 0 : PyObject *allow_remaining_obj = NULL;
32163 0 : bool allow_remaining = false;
32164 :
32165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32166 : discard_const_p(char *, kwnames),
32167 : &blob.data, &blob_length,
32168 : &bigendian_obj,
32169 : &ndr64_obj,
32170 : &allow_remaining_obj)) {
32171 0 : return NULL;
32172 : }
32173 0 : blob.length = blob_length;
32174 :
32175 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32176 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32177 : }
32178 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32179 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32180 : }
32181 :
32182 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32183 0 : allow_remaining = true;
32184 : }
32185 :
32186 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32187 : }
32188 :
32189 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32190 : {
32191 0 : DATA_BLOB blob;
32192 0 : Py_ssize_t blob_length = 0;
32193 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32194 0 : PyObject *bigendian_obj = NULL;
32195 0 : PyObject *ndr64_obj = NULL;
32196 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32197 0 : PyObject *allow_remaining_obj = NULL;
32198 0 : bool allow_remaining = false;
32199 :
32200 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32201 : discard_const_p(char *, kwnames),
32202 : &blob.data, &blob_length,
32203 : &bigendian_obj,
32204 : &ndr64_obj,
32205 : &allow_remaining_obj)) {
32206 0 : return NULL;
32207 : }
32208 0 : blob.length = blob_length;
32209 :
32210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32211 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32212 : }
32213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32214 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32215 : }
32216 :
32217 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32218 0 : allow_remaining = true;
32219 : }
32220 :
32221 0 : return py_lsa_RemoveAccountRights_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32222 : }
32223 :
32224 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32225 : {
32226 0 : const struct ndr_interface_call *call = NULL;
32227 0 : struct lsa_RemoveAccountRights *object = pytalloc_get_ptr(py_obj);
32228 0 : PyObject *ret;
32229 0 : char *retstr;
32230 :
32231 0 : if (ndr_table_lsarpc.num_calls < 39) {
32232 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RemoveAccountRights_ndr_print");
32233 0 : return NULL;
32234 : }
32235 0 : call = &ndr_table_lsarpc.calls[38];
32236 :
32237 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32238 0 : ret = PyUnicode_FromString(retstr);
32239 0 : TALLOC_FREE(retstr);
32240 :
32241 0 : return ret;
32242 : }
32243 :
32244 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32245 : {
32246 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_in", NDR_IN);
32247 : }
32248 :
32249 0 : static PyObject *py_lsa_RemoveAccountRights_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32250 : {
32251 0 : return py_lsa_RemoveAccountRights_ndr_print(py_obj, "lsa_RemoveAccountRights_out", NDR_OUT);
32252 : }
32253 :
32254 : static PyMethodDef py_lsa_RemoveAccountRights_methods[] = {
32255 : { "opnum", (PyCFunction)py_lsa_RemoveAccountRights_ndr_opnum, METH_NOARGS|METH_CLASS,
32256 : "lsa.RemoveAccountRights.opnum() -> 38 (0x26) " },
32257 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32258 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32259 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32260 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32261 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32262 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32263 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RemoveAccountRights_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32264 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32265 : { "__ndr_print_in__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32266 : { "__ndr_print_out__", (PyCFunction)py_lsa_RemoveAccountRights_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32267 : { NULL, NULL, 0, NULL }
32268 : };
32269 :
32270 :
32271 : static PyTypeObject lsa_RemoveAccountRights_Type = {
32272 : PyVarObject_HEAD_INIT(NULL, 0)
32273 : .tp_name = "lsa.RemoveAccountRights",
32274 : .tp_getset = py_lsa_RemoveAccountRights_getsetters,
32275 : .tp_methods = py_lsa_RemoveAccountRights_methods,
32276 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32277 : .tp_new = py_lsa_RemoveAccountRights_new,
32278 : };
32279 :
32280 0 : static bool pack_py_lsa_RemoveAccountRights_args_in(PyObject *args, PyObject *kwargs, struct lsa_RemoveAccountRights *r)
32281 : {
32282 0 : PyObject *py_handle;
32283 0 : PyObject *py_sid;
32284 0 : PyObject *py_remove_all;
32285 0 : PyObject *py_rights;
32286 0 : const char *kwnames[] = {
32287 : "handle", "sid", "remove_all", "rights", NULL
32288 : };
32289 :
32290 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_RemoveAccountRights", discard_const_p(char *, kwnames), &py_handle, &py_sid, &py_remove_all, &py_rights)) {
32291 0 : return false;
32292 : }
32293 :
32294 0 : if (py_handle == NULL) {
32295 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
32296 0 : return false;
32297 : }
32298 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32299 0 : if (r->in.handle == NULL) {
32300 0 : PyErr_NoMemory();
32301 0 : return false;
32302 : }
32303 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32304 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32305 0 : PyErr_NoMemory();
32306 0 : return false;
32307 : }
32308 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32309 0 : if (py_sid == NULL) {
32310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sid");
32311 0 : return false;
32312 : }
32313 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
32314 0 : if (r->in.sid == NULL) {
32315 0 : PyErr_NoMemory();
32316 0 : return false;
32317 : }
32318 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
32319 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
32320 0 : PyErr_NoMemory();
32321 0 : return false;
32322 : }
32323 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
32324 0 : if (py_remove_all == NULL) {
32325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.remove_all");
32326 0 : return false;
32327 : }
32328 : {
32329 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.remove_all));
32330 0 : if (PyLong_Check(py_remove_all)) {
32331 0 : unsigned long long test_var;
32332 0 : test_var = PyLong_AsUnsignedLongLong(py_remove_all);
32333 0 : if (PyErr_Occurred() != NULL) {
32334 0 : return false;
32335 : }
32336 0 : if (test_var > uint_max) {
32337 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32338 : PyLong_Type.tp_name, uint_max, test_var);
32339 0 : return false;
32340 : }
32341 0 : r->in.remove_all = test_var;
32342 : } else {
32343 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32344 : PyLong_Type.tp_name);
32345 0 : return false;
32346 : }
32347 : }
32348 0 : if (py_rights == NULL) {
32349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.rights");
32350 0 : return false;
32351 : }
32352 0 : r->in.rights = talloc_ptrtype(r, r->in.rights);
32353 0 : if (r->in.rights == NULL) {
32354 0 : PyErr_NoMemory();
32355 0 : return false;
32356 : }
32357 0 : PY_CHECK_TYPE(&lsa_RightSet_Type, py_rights, return false;);
32358 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_rights)) == NULL) {
32359 0 : PyErr_NoMemory();
32360 0 : return false;
32361 : }
32362 0 : r->in.rights = (struct lsa_RightSet *)pytalloc_get_ptr(py_rights);
32363 0 : return true;
32364 : }
32365 :
32366 0 : static PyObject *unpack_py_lsa_RemoveAccountRights_args_out(struct lsa_RemoveAccountRights *r)
32367 : {
32368 0 : PyObject *result;
32369 0 : result = Py_None;
32370 0 : Py_INCREF(result);
32371 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32372 0 : PyErr_SetNTSTATUS(r->out.result);
32373 0 : return NULL;
32374 : }
32375 :
32376 0 : return result;
32377 : }
32378 :
32379 :
32380 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_handle(PyObject *obj, void *closure)
32381 : {
32382 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(obj);
32383 0 : PyObject *py_handle;
32384 0 : if (object->in.handle == NULL) {
32385 0 : Py_RETURN_NONE;
32386 : }
32387 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32388 0 : return py_handle;
32389 : }
32390 :
32391 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32392 : {
32393 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32394 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32395 0 : if (value == NULL) {
32396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
32397 0 : return -1;
32398 : }
32399 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32400 0 : if (object->in.handle == NULL) {
32401 0 : PyErr_NoMemory();
32402 0 : return -1;
32403 : }
32404 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32405 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32406 0 : PyErr_NoMemory();
32407 0 : return -1;
32408 : }
32409 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32410 0 : return 0;
32411 : }
32412 :
32413 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid(PyObject *obj, void *closure)
32414 : {
32415 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(obj);
32416 0 : PyObject *py_dom_sid;
32417 0 : if (object->in.dom_sid == NULL) {
32418 0 : Py_RETURN_NONE;
32419 : }
32420 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
32421 0 : return py_dom_sid;
32422 : }
32423 :
32424 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
32425 : {
32426 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32427 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
32428 0 : if (value == NULL) {
32429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dom_sid");
32430 0 : return -1;
32431 : }
32432 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
32433 0 : if (object->in.dom_sid == NULL) {
32434 0 : PyErr_NoMemory();
32435 0 : return -1;
32436 : }
32437 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
32438 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32439 0 : PyErr_NoMemory();
32440 0 : return -1;
32441 : }
32442 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
32443 0 : return 0;
32444 : }
32445 :
32446 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_in_get_level(PyObject *obj, void *closure)
32447 : {
32448 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(obj);
32449 0 : PyObject *py_level;
32450 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
32451 0 : return py_level;
32452 : }
32453 :
32454 0 : static int py_lsa_QueryTrustedDomainInfoBySid_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
32455 : {
32456 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32457 0 : if (value == NULL) {
32458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
32459 0 : return -1;
32460 : }
32461 : {
32462 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
32463 0 : if (PyLong_Check(value)) {
32464 0 : unsigned long long test_var;
32465 0 : test_var = PyLong_AsUnsignedLongLong(value);
32466 0 : if (PyErr_Occurred() != NULL) {
32467 0 : return -1;
32468 : }
32469 0 : if (test_var > uint_max) {
32470 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32471 : PyLong_Type.tp_name, uint_max, test_var);
32472 0 : return -1;
32473 : }
32474 0 : object->in.level = test_var;
32475 : } else {
32476 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32477 : PyLong_Type.tp_name);
32478 0 : return -1;
32479 : }
32480 : }
32481 0 : return 0;
32482 : }
32483 :
32484 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_out_get_info(PyObject *obj, void *closure)
32485 : {
32486 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(obj);
32487 0 : PyObject *py_info;
32488 0 : if (object->out.info == NULL) {
32489 0 : Py_RETURN_NONE;
32490 : }
32491 0 : if (*object->out.info == NULL) {
32492 0 : py_info = Py_None;
32493 0 : Py_INCREF(py_info);
32494 : } else {
32495 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
32496 0 : if (py_info == NULL) {
32497 0 : return NULL;
32498 : }
32499 : }
32500 0 : return py_info;
32501 : }
32502 :
32503 0 : static int py_lsa_QueryTrustedDomainInfoBySid_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
32504 : {
32505 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32506 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
32507 0 : if (value == NULL) {
32508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
32509 0 : return -1;
32510 : }
32511 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
32512 0 : if (object->out.info == NULL) {
32513 0 : PyErr_NoMemory();
32514 0 : return -1;
32515 : }
32516 0 : if (value == Py_None) {
32517 0 : *object->out.info = NULL;
32518 : } else {
32519 0 : *object->out.info = NULL;
32520 : {
32521 0 : union lsa_TrustedDomainInfo *info_switch_2;
32522 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");
32523 0 : if (info_switch_2 == NULL) {
32524 0 : return -1;
32525 : }
32526 0 : *object->out.info = info_switch_2;
32527 : }
32528 : }
32529 0 : return 0;
32530 : }
32531 :
32532 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_get_result(PyObject *obj, void *closure)
32533 : {
32534 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(obj);
32535 0 : PyObject *py_result;
32536 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32537 0 : return py_result;
32538 : }
32539 :
32540 0 : static int py_lsa_QueryTrustedDomainInfoBySid_set_result(PyObject *py_obj, PyObject *value, void *closure)
32541 : {
32542 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32543 0 : if (value == NULL) {
32544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
32545 0 : return -1;
32546 : }
32547 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32548 0 : return 0;
32549 : }
32550 :
32551 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoBySid_getsetters[] = {
32552 : {
32553 : .name = discard_const_p(char, "in_handle"),
32554 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_handle,
32555 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_handle,
32556 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32557 : },
32558 : {
32559 : .name = discard_const_p(char, "in_dom_sid"),
32560 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_dom_sid,
32561 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_dom_sid,
32562 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
32563 : },
32564 : {
32565 : .name = discard_const_p(char, "in_level"),
32566 : .get = py_lsa_QueryTrustedDomainInfoBySid_in_get_level,
32567 : .set = py_lsa_QueryTrustedDomainInfoBySid_in_set_level,
32568 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
32569 : },
32570 : {
32571 : .name = discard_const_p(char, "out_info"),
32572 : .get = py_lsa_QueryTrustedDomainInfoBySid_out_get_info,
32573 : .set = py_lsa_QueryTrustedDomainInfoBySid_out_set_info,
32574 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
32575 : },
32576 : {
32577 : .name = discard_const_p(char, "result"),
32578 : .get = py_lsa_QueryTrustedDomainInfoBySid_get_result,
32579 : .set = py_lsa_QueryTrustedDomainInfoBySid_set_result,
32580 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32581 : },
32582 : { .name = NULL }
32583 : };
32584 :
32585 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32586 : {
32587 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoBySid, type);
32588 0 : struct lsa_QueryTrustedDomainInfoBySid *_self = (struct lsa_QueryTrustedDomainInfoBySid *)pytalloc_get_ptr(self);
32589 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32590 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
32591 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
32592 : /* a pointer to a NULL pointer */
32593 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
32594 0 : return self;
32595 : }
32596 :
32597 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32598 : {
32599 :
32600 :
32601 0 : return PyLong_FromLong(39);
32602 : }
32603 :
32604 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32605 : {
32606 0 : const struct ndr_interface_call *call = NULL;
32607 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32608 0 : PyObject *ret = NULL;
32609 0 : struct ndr_push *push = NULL;
32610 0 : DATA_BLOB blob;
32611 0 : enum ndr_err_code err;
32612 :
32613 0 : if (ndr_table_lsarpc.num_calls < 40) {
32614 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_pack");
32615 0 : return NULL;
32616 : }
32617 0 : call = &ndr_table_lsarpc.calls[39];
32618 :
32619 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32620 0 : if (push == NULL) {
32621 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32622 0 : return NULL;
32623 : }
32624 :
32625 0 : push->flags |= ndr_push_flags;
32626 :
32627 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32628 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32629 0 : TALLOC_FREE(push);
32630 0 : PyErr_SetNdrError(err);
32631 0 : return NULL;
32632 : }
32633 0 : blob = ndr_push_blob(push);
32634 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32635 0 : TALLOC_FREE(push);
32636 0 : return ret;
32637 : }
32638 :
32639 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32640 : {
32641 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32642 0 : PyObject *bigendian_obj = NULL;
32643 0 : PyObject *ndr64_obj = NULL;
32644 0 : libndr_flags ndr_push_flags = 0;
32645 :
32646 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32647 : discard_const_p(char *, kwnames),
32648 : &bigendian_obj,
32649 : &ndr64_obj)) {
32650 0 : return NULL;
32651 : }
32652 :
32653 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32654 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32655 : }
32656 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32657 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32658 : }
32659 :
32660 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32661 : }
32662 :
32663 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32664 : {
32665 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32666 0 : PyObject *bigendian_obj = NULL;
32667 0 : PyObject *ndr64_obj = NULL;
32668 0 : libndr_flags ndr_push_flags = 0;
32669 :
32670 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32671 : discard_const_p(char *, kwnames),
32672 : &bigendian_obj,
32673 : &ndr64_obj)) {
32674 0 : return NULL;
32675 : }
32676 :
32677 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32678 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32679 : }
32680 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32681 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32682 : }
32683 :
32684 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32685 : }
32686 :
32687 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)
32688 : {
32689 0 : const struct ndr_interface_call *call = NULL;
32690 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32691 0 : struct ndr_pull *pull = NULL;
32692 0 : enum ndr_err_code err;
32693 :
32694 0 : if (ndr_table_lsarpc.num_calls < 40) {
32695 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack");
32696 0 : return NULL;
32697 : }
32698 0 : call = &ndr_table_lsarpc.calls[39];
32699 :
32700 0 : pull = ndr_pull_init_blob(blob, object);
32701 0 : if (pull == NULL) {
32702 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32703 0 : return NULL;
32704 : }
32705 :
32706 0 : pull->flags |= ndr_pull_flags;
32707 :
32708 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32709 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32710 0 : TALLOC_FREE(pull);
32711 0 : PyErr_SetNdrError(err);
32712 0 : return NULL;
32713 : }
32714 0 : if (!allow_remaining) {
32715 0 : uint32_t highest_ofs;
32716 :
32717 0 : if (pull->offset > pull->relative_highest_offset) {
32718 0 : highest_ofs = pull->offset;
32719 : } else {
32720 0 : highest_ofs = pull->relative_highest_offset;
32721 : }
32722 0 : if (highest_ofs < pull->data_size) {
32723 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32724 : "not all bytes consumed ofs[%u] size[%u]",
32725 : highest_ofs, pull->data_size);
32726 0 : TALLOC_FREE(pull);
32727 0 : PyErr_SetNdrError(err);
32728 0 : return NULL;
32729 : }
32730 : }
32731 :
32732 0 : TALLOC_FREE(pull);
32733 0 : Py_RETURN_NONE;
32734 : }
32735 :
32736 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32737 : {
32738 0 : DATA_BLOB blob;
32739 0 : Py_ssize_t blob_length = 0;
32740 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32741 0 : PyObject *bigendian_obj = NULL;
32742 0 : PyObject *ndr64_obj = NULL;
32743 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32744 0 : PyObject *allow_remaining_obj = NULL;
32745 0 : bool allow_remaining = false;
32746 :
32747 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32748 : discard_const_p(char *, kwnames),
32749 : &blob.data, &blob_length,
32750 : &bigendian_obj,
32751 : &ndr64_obj,
32752 : &allow_remaining_obj)) {
32753 0 : return NULL;
32754 : }
32755 0 : blob.length = blob_length;
32756 :
32757 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32758 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32759 : }
32760 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32761 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32762 : }
32763 :
32764 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32765 0 : allow_remaining = true;
32766 : }
32767 :
32768 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32769 : }
32770 :
32771 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32772 : {
32773 0 : DATA_BLOB blob;
32774 0 : Py_ssize_t blob_length = 0;
32775 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32776 0 : PyObject *bigendian_obj = NULL;
32777 0 : PyObject *ndr64_obj = NULL;
32778 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32779 0 : PyObject *allow_remaining_obj = NULL;
32780 0 : bool allow_remaining = false;
32781 :
32782 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32783 : discard_const_p(char *, kwnames),
32784 : &blob.data, &blob_length,
32785 : &bigendian_obj,
32786 : &ndr64_obj,
32787 : &allow_remaining_obj)) {
32788 0 : return NULL;
32789 : }
32790 0 : blob.length = blob_length;
32791 :
32792 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32793 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32794 : }
32795 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32796 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32797 : }
32798 :
32799 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32800 0 : allow_remaining = true;
32801 : }
32802 :
32803 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32804 : }
32805 :
32806 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32807 : {
32808 0 : const struct ndr_interface_call *call = NULL;
32809 0 : struct lsa_QueryTrustedDomainInfoBySid *object = pytalloc_get_ptr(py_obj);
32810 0 : PyObject *ret;
32811 0 : char *retstr;
32812 :
32813 0 : if (ndr_table_lsarpc.num_calls < 40) {
32814 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoBySid_ndr_print");
32815 0 : return NULL;
32816 : }
32817 0 : call = &ndr_table_lsarpc.calls[39];
32818 :
32819 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32820 0 : ret = PyUnicode_FromString(retstr);
32821 0 : TALLOC_FREE(retstr);
32822 :
32823 0 : return ret;
32824 : }
32825 :
32826 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32827 : {
32828 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_in", NDR_IN);
32829 : }
32830 :
32831 0 : static PyObject *py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32832 : {
32833 0 : return py_lsa_QueryTrustedDomainInfoBySid_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoBySid_out", NDR_OUT);
32834 : }
32835 :
32836 : static PyMethodDef py_lsa_QueryTrustedDomainInfoBySid_methods[] = {
32837 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_opnum, METH_NOARGS|METH_CLASS,
32838 : "lsa.QueryTrustedDomainInfoBySid.opnum() -> 39 (0x27) " },
32839 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32840 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32841 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32842 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32843 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32844 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32845 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoBySid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32846 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32847 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32848 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoBySid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32849 : { NULL, NULL, 0, NULL }
32850 : };
32851 :
32852 :
32853 : static PyTypeObject lsa_QueryTrustedDomainInfoBySid_Type = {
32854 : PyVarObject_HEAD_INIT(NULL, 0)
32855 : .tp_name = "lsa.QueryTrustedDomainInfoBySid",
32856 : .tp_getset = py_lsa_QueryTrustedDomainInfoBySid_getsetters,
32857 : .tp_methods = py_lsa_QueryTrustedDomainInfoBySid_methods,
32858 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32859 : .tp_new = py_lsa_QueryTrustedDomainInfoBySid_new,
32860 : };
32861 :
32862 1 : static bool pack_py_lsa_QueryTrustedDomainInfoBySid_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoBySid *r)
32863 : {
32864 0 : PyObject *py_handle;
32865 0 : PyObject *py_dom_sid;
32866 0 : PyObject *py_level;
32867 1 : const char *kwnames[] = {
32868 : "handle", "dom_sid", "level", NULL
32869 : };
32870 :
32871 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoBySid", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level)) {
32872 0 : return false;
32873 : }
32874 :
32875 1 : if (py_handle == NULL) {
32876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
32877 0 : return false;
32878 : }
32879 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
32880 1 : if (r->in.handle == NULL) {
32881 0 : PyErr_NoMemory();
32882 0 : return false;
32883 : }
32884 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
32885 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
32886 0 : PyErr_NoMemory();
32887 0 : return false;
32888 : }
32889 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
32890 1 : if (py_dom_sid == NULL) {
32891 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dom_sid");
32892 0 : return false;
32893 : }
32894 1 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
32895 1 : if (r->in.dom_sid == NULL) {
32896 0 : PyErr_NoMemory();
32897 0 : return false;
32898 : }
32899 1 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
32900 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
32901 0 : PyErr_NoMemory();
32902 0 : return false;
32903 : }
32904 1 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
32905 1 : if (py_level == NULL) {
32906 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
32907 0 : return false;
32908 : }
32909 : {
32910 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
32911 1 : if (PyLong_Check(py_level)) {
32912 0 : unsigned long long test_var;
32913 1 : test_var = PyLong_AsUnsignedLongLong(py_level);
32914 1 : if (PyErr_Occurred() != NULL) {
32915 0 : return false;
32916 : }
32917 1 : if (test_var > uint_max) {
32918 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32919 : PyLong_Type.tp_name, uint_max, test_var);
32920 0 : return false;
32921 : }
32922 1 : r->in.level = test_var;
32923 : } else {
32924 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32925 : PyLong_Type.tp_name);
32926 0 : return false;
32927 : }
32928 : }
32929 1 : return true;
32930 : }
32931 :
32932 1 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoBySid_args_out(struct lsa_QueryTrustedDomainInfoBySid *r)
32933 : {
32934 0 : PyObject *result;
32935 0 : PyObject *py_info;
32936 1 : if (*r->out.info == NULL) {
32937 1 : py_info = Py_None;
32938 1 : Py_INCREF(py_info);
32939 : } else {
32940 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
32941 0 : if (py_info == NULL) {
32942 0 : return NULL;
32943 : }
32944 : }
32945 1 : result = py_info;
32946 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
32947 1 : PyErr_SetNTSTATUS(r->out.result);
32948 1 : return NULL;
32949 : }
32950 :
32951 0 : return result;
32952 : }
32953 :
32954 :
32955 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_handle(PyObject *obj, void *closure)
32956 : {
32957 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(obj);
32958 0 : PyObject *py_handle;
32959 0 : if (object->in.handle == NULL) {
32960 0 : Py_RETURN_NONE;
32961 : }
32962 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
32963 0 : return py_handle;
32964 : }
32965 :
32966 0 : static int py_lsa_SetTrustedDomainInfo_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
32967 : {
32968 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
32969 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
32970 0 : if (value == NULL) {
32971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
32972 0 : return -1;
32973 : }
32974 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
32975 0 : if (object->in.handle == NULL) {
32976 0 : PyErr_NoMemory();
32977 0 : return -1;
32978 : }
32979 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32980 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32981 0 : PyErr_NoMemory();
32982 0 : return -1;
32983 : }
32984 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
32985 0 : return 0;
32986 : }
32987 :
32988 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_dom_sid(PyObject *obj, void *closure)
32989 : {
32990 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(obj);
32991 0 : PyObject *py_dom_sid;
32992 0 : if (object->in.dom_sid == NULL) {
32993 0 : Py_RETURN_NONE;
32994 : }
32995 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
32996 0 : return py_dom_sid;
32997 : }
32998 :
32999 0 : static int py_lsa_SetTrustedDomainInfo_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
33000 : {
33001 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33002 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
33003 0 : if (value == NULL) {
33004 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dom_sid");
33005 0 : return -1;
33006 : }
33007 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
33008 0 : if (object->in.dom_sid == NULL) {
33009 0 : PyErr_NoMemory();
33010 0 : return -1;
33011 : }
33012 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
33013 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33014 0 : PyErr_NoMemory();
33015 0 : return -1;
33016 : }
33017 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
33018 0 : return 0;
33019 : }
33020 :
33021 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_level(PyObject *obj, void *closure)
33022 : {
33023 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(obj);
33024 0 : PyObject *py_level;
33025 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
33026 0 : return py_level;
33027 : }
33028 :
33029 0 : static int py_lsa_SetTrustedDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
33030 : {
33031 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33032 0 : if (value == NULL) {
33033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
33034 0 : return -1;
33035 : }
33036 : {
33037 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
33038 0 : if (PyLong_Check(value)) {
33039 0 : unsigned long long test_var;
33040 0 : test_var = PyLong_AsUnsignedLongLong(value);
33041 0 : if (PyErr_Occurred() != NULL) {
33042 0 : return -1;
33043 : }
33044 0 : if (test_var > uint_max) {
33045 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33046 : PyLong_Type.tp_name, uint_max, test_var);
33047 0 : return -1;
33048 : }
33049 0 : object->in.level = test_var;
33050 : } else {
33051 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33052 : PyLong_Type.tp_name);
33053 0 : return -1;
33054 : }
33055 : }
33056 0 : return 0;
33057 : }
33058 :
33059 0 : static PyObject *py_lsa_SetTrustedDomainInfo_in_get_info(PyObject *obj, void *closure)
33060 : {
33061 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(obj);
33062 0 : PyObject *py_info;
33063 0 : if (object->in.info == NULL) {
33064 0 : Py_RETURN_NONE;
33065 : }
33066 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
33067 0 : if (py_info == NULL) {
33068 0 : return NULL;
33069 : }
33070 0 : return py_info;
33071 : }
33072 :
33073 0 : static int py_lsa_SetTrustedDomainInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
33074 : {
33075 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33076 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
33077 0 : if (value == NULL) {
33078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
33079 0 : return -1;
33080 : }
33081 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
33082 0 : if (object->in.info == NULL) {
33083 0 : PyErr_NoMemory();
33084 0 : return -1;
33085 : }
33086 : {
33087 0 : union lsa_TrustedDomainInfo *info_switch_1;
33088 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");
33089 0 : if (info_switch_1 == NULL) {
33090 0 : return -1;
33091 : }
33092 0 : object->in.info = info_switch_1;
33093 : }
33094 0 : return 0;
33095 : }
33096 :
33097 0 : static PyObject *py_lsa_SetTrustedDomainInfo_get_result(PyObject *obj, void *closure)
33098 : {
33099 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(obj);
33100 0 : PyObject *py_result;
33101 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33102 0 : return py_result;
33103 : }
33104 :
33105 0 : static int py_lsa_SetTrustedDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
33106 : {
33107 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33108 0 : if (value == NULL) {
33109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
33110 0 : return -1;
33111 : }
33112 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33113 0 : return 0;
33114 : }
33115 :
33116 : static PyGetSetDef py_lsa_SetTrustedDomainInfo_getsetters[] = {
33117 : {
33118 : .name = discard_const_p(char, "in_handle"),
33119 : .get = py_lsa_SetTrustedDomainInfo_in_get_handle,
33120 : .set = py_lsa_SetTrustedDomainInfo_in_set_handle,
33121 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33122 : },
33123 : {
33124 : .name = discard_const_p(char, "in_dom_sid"),
33125 : .get = py_lsa_SetTrustedDomainInfo_in_get_dom_sid,
33126 : .set = py_lsa_SetTrustedDomainInfo_in_set_dom_sid,
33127 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
33128 : },
33129 : {
33130 : .name = discard_const_p(char, "in_level"),
33131 : .get = py_lsa_SetTrustedDomainInfo_in_get_level,
33132 : .set = py_lsa_SetTrustedDomainInfo_in_set_level,
33133 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
33134 : },
33135 : {
33136 : .name = discard_const_p(char, "in_info"),
33137 : .get = py_lsa_SetTrustedDomainInfo_in_get_info,
33138 : .set = py_lsa_SetTrustedDomainInfo_in_set_info,
33139 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
33140 : },
33141 : {
33142 : .name = discard_const_p(char, "result"),
33143 : .get = py_lsa_SetTrustedDomainInfo_get_result,
33144 : .set = py_lsa_SetTrustedDomainInfo_set_result,
33145 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33146 : },
33147 : { .name = NULL }
33148 : };
33149 :
33150 0 : static PyObject *py_lsa_SetTrustedDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33151 : {
33152 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfo, type);
33153 0 : struct lsa_SetTrustedDomainInfo *_self = (struct lsa_SetTrustedDomainInfo *)pytalloc_get_ptr(self);
33154 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33155 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
33156 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
33157 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
33158 0 : return self;
33159 : }
33160 :
33161 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33162 : {
33163 :
33164 :
33165 0 : return PyLong_FromLong(40);
33166 : }
33167 :
33168 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
33169 : {
33170 0 : const struct ndr_interface_call *call = NULL;
33171 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33172 0 : PyObject *ret = NULL;
33173 0 : struct ndr_push *push = NULL;
33174 0 : DATA_BLOB blob;
33175 0 : enum ndr_err_code err;
33176 :
33177 0 : if (ndr_table_lsarpc.num_calls < 41) {
33178 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_pack");
33179 0 : return NULL;
33180 : }
33181 0 : call = &ndr_table_lsarpc.calls[40];
33182 :
33183 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33184 0 : if (push == NULL) {
33185 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33186 0 : return NULL;
33187 : }
33188 :
33189 0 : push->flags |= ndr_push_flags;
33190 :
33191 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33192 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33193 0 : TALLOC_FREE(push);
33194 0 : PyErr_SetNdrError(err);
33195 0 : return NULL;
33196 : }
33197 0 : blob = ndr_push_blob(push);
33198 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33199 0 : TALLOC_FREE(push);
33200 0 : return ret;
33201 : }
33202 :
33203 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33204 : {
33205 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33206 0 : PyObject *bigendian_obj = NULL;
33207 0 : PyObject *ndr64_obj = NULL;
33208 0 : libndr_flags ndr_push_flags = 0;
33209 :
33210 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33211 : discard_const_p(char *, kwnames),
33212 : &bigendian_obj,
33213 : &ndr64_obj)) {
33214 0 : return NULL;
33215 : }
33216 :
33217 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33218 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33219 : }
33220 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33221 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33222 : }
33223 :
33224 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33225 : }
33226 :
33227 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33228 : {
33229 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33230 0 : PyObject *bigendian_obj = NULL;
33231 0 : PyObject *ndr64_obj = NULL;
33232 0 : libndr_flags ndr_push_flags = 0;
33233 :
33234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33235 : discard_const_p(char *, kwnames),
33236 : &bigendian_obj,
33237 : &ndr64_obj)) {
33238 0 : return NULL;
33239 : }
33240 :
33241 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33242 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33243 : }
33244 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33245 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33246 : }
33247 :
33248 0 : return py_lsa_SetTrustedDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33249 : }
33250 :
33251 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)
33252 : {
33253 0 : const struct ndr_interface_call *call = NULL;
33254 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33255 0 : struct ndr_pull *pull = NULL;
33256 0 : enum ndr_err_code err;
33257 :
33258 0 : if (ndr_table_lsarpc.num_calls < 41) {
33259 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_unpack");
33260 0 : return NULL;
33261 : }
33262 0 : call = &ndr_table_lsarpc.calls[40];
33263 :
33264 0 : pull = ndr_pull_init_blob(blob, object);
33265 0 : if (pull == NULL) {
33266 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33267 0 : return NULL;
33268 : }
33269 :
33270 0 : pull->flags |= ndr_pull_flags;
33271 :
33272 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33273 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33274 0 : TALLOC_FREE(pull);
33275 0 : PyErr_SetNdrError(err);
33276 0 : return NULL;
33277 : }
33278 0 : if (!allow_remaining) {
33279 0 : uint32_t highest_ofs;
33280 :
33281 0 : if (pull->offset > pull->relative_highest_offset) {
33282 0 : highest_ofs = pull->offset;
33283 : } else {
33284 0 : highest_ofs = pull->relative_highest_offset;
33285 : }
33286 0 : if (highest_ofs < pull->data_size) {
33287 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33288 : "not all bytes consumed ofs[%u] size[%u]",
33289 : highest_ofs, pull->data_size);
33290 0 : TALLOC_FREE(pull);
33291 0 : PyErr_SetNdrError(err);
33292 0 : return NULL;
33293 : }
33294 : }
33295 :
33296 0 : TALLOC_FREE(pull);
33297 0 : Py_RETURN_NONE;
33298 : }
33299 :
33300 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33301 : {
33302 0 : DATA_BLOB blob;
33303 0 : Py_ssize_t blob_length = 0;
33304 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33305 0 : PyObject *bigendian_obj = NULL;
33306 0 : PyObject *ndr64_obj = NULL;
33307 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33308 0 : PyObject *allow_remaining_obj = NULL;
33309 0 : bool allow_remaining = false;
33310 :
33311 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33312 : discard_const_p(char *, kwnames),
33313 : &blob.data, &blob_length,
33314 : &bigendian_obj,
33315 : &ndr64_obj,
33316 : &allow_remaining_obj)) {
33317 0 : return NULL;
33318 : }
33319 0 : blob.length = blob_length;
33320 :
33321 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33322 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33323 : }
33324 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33325 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33326 : }
33327 :
33328 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33329 0 : allow_remaining = true;
33330 : }
33331 :
33332 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33333 : }
33334 :
33335 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33336 : {
33337 0 : DATA_BLOB blob;
33338 0 : Py_ssize_t blob_length = 0;
33339 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33340 0 : PyObject *bigendian_obj = NULL;
33341 0 : PyObject *ndr64_obj = NULL;
33342 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33343 0 : PyObject *allow_remaining_obj = NULL;
33344 0 : bool allow_remaining = false;
33345 :
33346 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33347 : discard_const_p(char *, kwnames),
33348 : &blob.data, &blob_length,
33349 : &bigendian_obj,
33350 : &ndr64_obj,
33351 : &allow_remaining_obj)) {
33352 0 : return NULL;
33353 : }
33354 0 : blob.length = blob_length;
33355 :
33356 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33357 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33358 : }
33359 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33360 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33361 : }
33362 :
33363 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33364 0 : allow_remaining = true;
33365 : }
33366 :
33367 0 : return py_lsa_SetTrustedDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33368 : }
33369 :
33370 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33371 : {
33372 0 : const struct ndr_interface_call *call = NULL;
33373 0 : struct lsa_SetTrustedDomainInfo *object = pytalloc_get_ptr(py_obj);
33374 0 : PyObject *ret;
33375 0 : char *retstr;
33376 :
33377 0 : if (ndr_table_lsarpc.num_calls < 41) {
33378 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfo_ndr_print");
33379 0 : return NULL;
33380 : }
33381 0 : call = &ndr_table_lsarpc.calls[40];
33382 :
33383 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33384 0 : ret = PyUnicode_FromString(retstr);
33385 0 : TALLOC_FREE(retstr);
33386 :
33387 0 : return ret;
33388 : }
33389 :
33390 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33391 : {
33392 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_in", NDR_IN);
33393 : }
33394 :
33395 0 : static PyObject *py_lsa_SetTrustedDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33396 : {
33397 0 : return py_lsa_SetTrustedDomainInfo_ndr_print(py_obj, "lsa_SetTrustedDomainInfo_out", NDR_OUT);
33398 : }
33399 :
33400 : static PyMethodDef py_lsa_SetTrustedDomainInfo_methods[] = {
33401 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
33402 : "lsa.SetTrustedDomainInfo.opnum() -> 40 (0x28) " },
33403 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33404 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33405 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33406 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33407 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33408 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33409 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33410 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33411 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33412 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33413 : { NULL, NULL, 0, NULL }
33414 : };
33415 :
33416 :
33417 : static PyTypeObject lsa_SetTrustedDomainInfo_Type = {
33418 : PyVarObject_HEAD_INIT(NULL, 0)
33419 : .tp_name = "lsa.SetTrustedDomainInfo",
33420 : .tp_getset = py_lsa_SetTrustedDomainInfo_getsetters,
33421 : .tp_methods = py_lsa_SetTrustedDomainInfo_methods,
33422 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33423 : .tp_new = py_lsa_SetTrustedDomainInfo_new,
33424 : };
33425 :
33426 0 : static bool pack_py_lsa_SetTrustedDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfo *r)
33427 : {
33428 0 : PyObject *py_handle;
33429 0 : PyObject *py_dom_sid;
33430 0 : PyObject *py_level;
33431 0 : PyObject *py_info;
33432 0 : const char *kwnames[] = {
33433 : "handle", "dom_sid", "level", "info", NULL
33434 : };
33435 :
33436 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfo", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid, &py_level, &py_info)) {
33437 0 : return false;
33438 : }
33439 :
33440 0 : if (py_handle == NULL) {
33441 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
33442 0 : return false;
33443 : }
33444 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33445 0 : if (r->in.handle == NULL) {
33446 0 : PyErr_NoMemory();
33447 0 : return false;
33448 : }
33449 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33450 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33451 0 : PyErr_NoMemory();
33452 0 : return false;
33453 : }
33454 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33455 0 : if (py_dom_sid == NULL) {
33456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dom_sid");
33457 0 : return false;
33458 : }
33459 0 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
33460 0 : if (r->in.dom_sid == NULL) {
33461 0 : PyErr_NoMemory();
33462 0 : return false;
33463 : }
33464 0 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
33465 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
33466 0 : PyErr_NoMemory();
33467 0 : return false;
33468 : }
33469 0 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
33470 0 : if (py_level == NULL) {
33471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
33472 0 : return false;
33473 : }
33474 : {
33475 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
33476 0 : if (PyLong_Check(py_level)) {
33477 0 : unsigned long long test_var;
33478 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
33479 0 : if (PyErr_Occurred() != NULL) {
33480 0 : return false;
33481 : }
33482 0 : if (test_var > uint_max) {
33483 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33484 : PyLong_Type.tp_name, uint_max, test_var);
33485 0 : return false;
33486 : }
33487 0 : r->in.level = test_var;
33488 : } else {
33489 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33490 : PyLong_Type.tp_name);
33491 0 : return false;
33492 : }
33493 : }
33494 0 : if (py_info == NULL) {
33495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
33496 0 : return false;
33497 : }
33498 0 : r->in.info = talloc_ptrtype(r, r->in.info);
33499 0 : if (r->in.info == NULL) {
33500 0 : PyErr_NoMemory();
33501 0 : return false;
33502 : }
33503 : {
33504 0 : union lsa_TrustedDomainInfo *info_switch_1;
33505 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
33506 0 : if (info_switch_1 == NULL) {
33507 0 : return false;
33508 : }
33509 0 : r->in.info = info_switch_1;
33510 : }
33511 0 : return true;
33512 : }
33513 :
33514 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfo_args_out(struct lsa_SetTrustedDomainInfo *r)
33515 : {
33516 0 : PyObject *result;
33517 0 : result = Py_None;
33518 0 : Py_INCREF(result);
33519 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
33520 0 : PyErr_SetNTSTATUS(r->out.result);
33521 0 : return NULL;
33522 : }
33523 :
33524 0 : return result;
33525 : }
33526 :
33527 :
33528 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_handle(PyObject *obj, void *closure)
33529 : {
33530 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(obj);
33531 0 : PyObject *py_handle;
33532 0 : if (object->in.handle == NULL) {
33533 0 : Py_RETURN_NONE;
33534 : }
33535 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
33536 0 : return py_handle;
33537 : }
33538 :
33539 0 : static int py_lsa_DeleteTrustedDomain_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33540 : {
33541 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33542 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
33543 0 : if (value == NULL) {
33544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
33545 0 : return -1;
33546 : }
33547 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
33548 0 : if (object->in.handle == NULL) {
33549 0 : PyErr_NoMemory();
33550 0 : return -1;
33551 : }
33552 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33553 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33554 0 : PyErr_NoMemory();
33555 0 : return -1;
33556 : }
33557 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33558 0 : return 0;
33559 : }
33560 :
33561 0 : static PyObject *py_lsa_DeleteTrustedDomain_in_get_dom_sid(PyObject *obj, void *closure)
33562 : {
33563 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(obj);
33564 0 : PyObject *py_dom_sid;
33565 0 : if (object->in.dom_sid == NULL) {
33566 0 : Py_RETURN_NONE;
33567 : }
33568 0 : py_dom_sid = pytalloc_reference_ex(dom_sid_Type, object->in.dom_sid, object->in.dom_sid);
33569 0 : return py_dom_sid;
33570 : }
33571 :
33572 0 : static int py_lsa_DeleteTrustedDomain_in_set_dom_sid(PyObject *py_obj, PyObject *value, void *closure)
33573 : {
33574 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33575 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.dom_sid));
33576 0 : if (value == NULL) {
33577 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.dom_sid");
33578 0 : return -1;
33579 : }
33580 0 : object->in.dom_sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.dom_sid);
33581 0 : if (object->in.dom_sid == NULL) {
33582 0 : PyErr_NoMemory();
33583 0 : return -1;
33584 : }
33585 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
33586 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33587 0 : PyErr_NoMemory();
33588 0 : return -1;
33589 : }
33590 0 : object->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(value);
33591 0 : return 0;
33592 : }
33593 :
33594 0 : static PyObject *py_lsa_DeleteTrustedDomain_get_result(PyObject *obj, void *closure)
33595 : {
33596 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(obj);
33597 0 : PyObject *py_result;
33598 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33599 0 : return py_result;
33600 : }
33601 :
33602 0 : static int py_lsa_DeleteTrustedDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
33603 : {
33604 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33605 0 : if (value == NULL) {
33606 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
33607 0 : return -1;
33608 : }
33609 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33610 0 : return 0;
33611 : }
33612 :
33613 : static PyGetSetDef py_lsa_DeleteTrustedDomain_getsetters[] = {
33614 : {
33615 : .name = discard_const_p(char, "in_handle"),
33616 : .get = py_lsa_DeleteTrustedDomain_in_get_handle,
33617 : .set = py_lsa_DeleteTrustedDomain_in_set_handle,
33618 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33619 : },
33620 : {
33621 : .name = discard_const_p(char, "in_dom_sid"),
33622 : .get = py_lsa_DeleteTrustedDomain_in_get_dom_sid,
33623 : .set = py_lsa_DeleteTrustedDomain_in_set_dom_sid,
33624 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
33625 : },
33626 : {
33627 : .name = discard_const_p(char, "result"),
33628 : .get = py_lsa_DeleteTrustedDomain_get_result,
33629 : .set = py_lsa_DeleteTrustedDomain_set_result,
33630 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33631 : },
33632 : { .name = NULL }
33633 : };
33634 :
33635 0 : static PyObject *py_lsa_DeleteTrustedDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33636 : {
33637 0 : PyObject *self = pytalloc_new(struct lsa_DeleteTrustedDomain, type);
33638 0 : struct lsa_DeleteTrustedDomain *_self = (struct lsa_DeleteTrustedDomain *)pytalloc_get_ptr(self);
33639 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33640 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
33641 0 : _self->in.dom_sid = talloc_zero(mem_ctx, struct dom_sid2);
33642 0 : return self;
33643 : }
33644 :
33645 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33646 : {
33647 :
33648 :
33649 0 : return PyLong_FromLong(41);
33650 : }
33651 :
33652 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
33653 : {
33654 0 : const struct ndr_interface_call *call = NULL;
33655 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33656 0 : PyObject *ret = NULL;
33657 0 : struct ndr_push *push = NULL;
33658 0 : DATA_BLOB blob;
33659 0 : enum ndr_err_code err;
33660 :
33661 0 : if (ndr_table_lsarpc.num_calls < 42) {
33662 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_pack");
33663 0 : return NULL;
33664 : }
33665 0 : call = &ndr_table_lsarpc.calls[41];
33666 :
33667 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33668 0 : if (push == NULL) {
33669 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33670 0 : return NULL;
33671 : }
33672 :
33673 0 : push->flags |= ndr_push_flags;
33674 :
33675 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33676 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33677 0 : TALLOC_FREE(push);
33678 0 : PyErr_SetNdrError(err);
33679 0 : return NULL;
33680 : }
33681 0 : blob = ndr_push_blob(push);
33682 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33683 0 : TALLOC_FREE(push);
33684 0 : return ret;
33685 : }
33686 :
33687 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33688 : {
33689 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33690 0 : PyObject *bigendian_obj = NULL;
33691 0 : PyObject *ndr64_obj = NULL;
33692 0 : libndr_flags ndr_push_flags = 0;
33693 :
33694 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33695 : discard_const_p(char *, kwnames),
33696 : &bigendian_obj,
33697 : &ndr64_obj)) {
33698 0 : return NULL;
33699 : }
33700 :
33701 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33702 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33703 : }
33704 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33705 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33706 : }
33707 :
33708 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33709 : }
33710 :
33711 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33712 : {
33713 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33714 0 : PyObject *bigendian_obj = NULL;
33715 0 : PyObject *ndr64_obj = NULL;
33716 0 : libndr_flags ndr_push_flags = 0;
33717 :
33718 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33719 : discard_const_p(char *, kwnames),
33720 : &bigendian_obj,
33721 : &ndr64_obj)) {
33722 0 : return NULL;
33723 : }
33724 :
33725 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33726 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33727 : }
33728 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33729 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33730 : }
33731 :
33732 0 : return py_lsa_DeleteTrustedDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33733 : }
33734 :
33735 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)
33736 : {
33737 0 : const struct ndr_interface_call *call = NULL;
33738 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33739 0 : struct ndr_pull *pull = NULL;
33740 0 : enum ndr_err_code err;
33741 :
33742 0 : if (ndr_table_lsarpc.num_calls < 42) {
33743 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_unpack");
33744 0 : return NULL;
33745 : }
33746 0 : call = &ndr_table_lsarpc.calls[41];
33747 :
33748 0 : pull = ndr_pull_init_blob(blob, object);
33749 0 : if (pull == NULL) {
33750 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33751 0 : return NULL;
33752 : }
33753 :
33754 0 : pull->flags |= ndr_pull_flags;
33755 :
33756 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33757 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33758 0 : TALLOC_FREE(pull);
33759 0 : PyErr_SetNdrError(err);
33760 0 : return NULL;
33761 : }
33762 0 : if (!allow_remaining) {
33763 0 : uint32_t highest_ofs;
33764 :
33765 0 : if (pull->offset > pull->relative_highest_offset) {
33766 0 : highest_ofs = pull->offset;
33767 : } else {
33768 0 : highest_ofs = pull->relative_highest_offset;
33769 : }
33770 0 : if (highest_ofs < pull->data_size) {
33771 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33772 : "not all bytes consumed ofs[%u] size[%u]",
33773 : highest_ofs, pull->data_size);
33774 0 : TALLOC_FREE(pull);
33775 0 : PyErr_SetNdrError(err);
33776 0 : return NULL;
33777 : }
33778 : }
33779 :
33780 0 : TALLOC_FREE(pull);
33781 0 : Py_RETURN_NONE;
33782 : }
33783 :
33784 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33785 : {
33786 0 : DATA_BLOB blob;
33787 0 : Py_ssize_t blob_length = 0;
33788 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33789 0 : PyObject *bigendian_obj = NULL;
33790 0 : PyObject *ndr64_obj = NULL;
33791 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33792 0 : PyObject *allow_remaining_obj = NULL;
33793 0 : bool allow_remaining = false;
33794 :
33795 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33796 : discard_const_p(char *, kwnames),
33797 : &blob.data, &blob_length,
33798 : &bigendian_obj,
33799 : &ndr64_obj,
33800 : &allow_remaining_obj)) {
33801 0 : return NULL;
33802 : }
33803 0 : blob.length = blob_length;
33804 :
33805 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33806 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33807 : }
33808 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33809 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33810 : }
33811 :
33812 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33813 0 : allow_remaining = true;
33814 : }
33815 :
33816 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33817 : }
33818 :
33819 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33820 : {
33821 0 : DATA_BLOB blob;
33822 0 : Py_ssize_t blob_length = 0;
33823 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33824 0 : PyObject *bigendian_obj = NULL;
33825 0 : PyObject *ndr64_obj = NULL;
33826 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33827 0 : PyObject *allow_remaining_obj = NULL;
33828 0 : bool allow_remaining = false;
33829 :
33830 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33831 : discard_const_p(char *, kwnames),
33832 : &blob.data, &blob_length,
33833 : &bigendian_obj,
33834 : &ndr64_obj,
33835 : &allow_remaining_obj)) {
33836 0 : return NULL;
33837 : }
33838 0 : blob.length = blob_length;
33839 :
33840 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33841 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33842 : }
33843 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33844 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33845 : }
33846 :
33847 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33848 0 : allow_remaining = true;
33849 : }
33850 :
33851 0 : return py_lsa_DeleteTrustedDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33852 : }
33853 :
33854 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33855 : {
33856 0 : const struct ndr_interface_call *call = NULL;
33857 0 : struct lsa_DeleteTrustedDomain *object = pytalloc_get_ptr(py_obj);
33858 0 : PyObject *ret;
33859 0 : char *retstr;
33860 :
33861 0 : if (ndr_table_lsarpc.num_calls < 42) {
33862 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_DeleteTrustedDomain_ndr_print");
33863 0 : return NULL;
33864 : }
33865 0 : call = &ndr_table_lsarpc.calls[41];
33866 :
33867 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33868 0 : ret = PyUnicode_FromString(retstr);
33869 0 : TALLOC_FREE(retstr);
33870 :
33871 0 : return ret;
33872 : }
33873 :
33874 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33875 : {
33876 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_in", NDR_IN);
33877 : }
33878 :
33879 0 : static PyObject *py_lsa_DeleteTrustedDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33880 : {
33881 0 : return py_lsa_DeleteTrustedDomain_ndr_print(py_obj, "lsa_DeleteTrustedDomain_out", NDR_OUT);
33882 : }
33883 :
33884 : static PyMethodDef py_lsa_DeleteTrustedDomain_methods[] = {
33885 : { "opnum", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
33886 : "lsa.DeleteTrustedDomain.opnum() -> 41 (0x29) " },
33887 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33888 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33889 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33890 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33891 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33892 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33893 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_DeleteTrustedDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33894 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33895 : { "__ndr_print_in__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33896 : { "__ndr_print_out__", (PyCFunction)py_lsa_DeleteTrustedDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33897 : { NULL, NULL, 0, NULL }
33898 : };
33899 :
33900 :
33901 : static PyTypeObject lsa_DeleteTrustedDomain_Type = {
33902 : PyVarObject_HEAD_INIT(NULL, 0)
33903 : .tp_name = "lsa.DeleteTrustedDomain",
33904 : .tp_getset = py_lsa_DeleteTrustedDomain_getsetters,
33905 : .tp_methods = py_lsa_DeleteTrustedDomain_methods,
33906 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33907 : .tp_new = py_lsa_DeleteTrustedDomain_new,
33908 : };
33909 :
33910 2 : static bool pack_py_lsa_DeleteTrustedDomain_args_in(PyObject *args, PyObject *kwargs, struct lsa_DeleteTrustedDomain *r)
33911 : {
33912 0 : PyObject *py_handle;
33913 0 : PyObject *py_dom_sid;
33914 2 : const char *kwnames[] = {
33915 : "handle", "dom_sid", NULL
33916 : };
33917 :
33918 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_DeleteTrustedDomain", discard_const_p(char *, kwnames), &py_handle, &py_dom_sid)) {
33919 0 : return false;
33920 : }
33921 :
33922 2 : if (py_handle == NULL) {
33923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
33924 0 : return false;
33925 : }
33926 2 : r->in.handle = talloc_ptrtype(r, r->in.handle);
33927 2 : if (r->in.handle == NULL) {
33928 0 : PyErr_NoMemory();
33929 0 : return false;
33930 : }
33931 2 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
33932 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
33933 0 : PyErr_NoMemory();
33934 0 : return false;
33935 : }
33936 2 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
33937 2 : if (py_dom_sid == NULL) {
33938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.dom_sid");
33939 0 : return false;
33940 : }
33941 2 : r->in.dom_sid = talloc_ptrtype(r, r->in.dom_sid);
33942 2 : if (r->in.dom_sid == NULL) {
33943 0 : PyErr_NoMemory();
33944 0 : return false;
33945 : }
33946 2 : PY_CHECK_TYPE(dom_sid_Type, py_dom_sid, return false;);
33947 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_dom_sid)) == NULL) {
33948 0 : PyErr_NoMemory();
33949 0 : return false;
33950 : }
33951 2 : r->in.dom_sid = (struct dom_sid *)pytalloc_get_ptr(py_dom_sid);
33952 2 : return true;
33953 : }
33954 :
33955 2 : static PyObject *unpack_py_lsa_DeleteTrustedDomain_args_out(struct lsa_DeleteTrustedDomain *r)
33956 : {
33957 0 : PyObject *result;
33958 2 : result = Py_None;
33959 0 : Py_INCREF(result);
33960 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
33961 0 : PyErr_SetNTSTATUS(r->out.result);
33962 0 : return NULL;
33963 : }
33964 :
33965 2 : return result;
33966 : }
33967 :
33968 :
33969 0 : static PyObject *py_lsa_StorePrivateData_in_get_handle(PyObject *obj, void *closure)
33970 : {
33971 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(obj);
33972 0 : PyObject *py_handle;
33973 0 : if (object->in.handle == NULL) {
33974 0 : Py_RETURN_NONE;
33975 : }
33976 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
33977 0 : return py_handle;
33978 : }
33979 :
33980 0 : static int py_lsa_StorePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
33981 : {
33982 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
33983 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
33984 0 : if (value == NULL) {
33985 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
33986 0 : return -1;
33987 : }
33988 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
33989 0 : if (object->in.handle == NULL) {
33990 0 : PyErr_NoMemory();
33991 0 : return -1;
33992 : }
33993 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33994 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33995 0 : PyErr_NoMemory();
33996 0 : return -1;
33997 : }
33998 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
33999 0 : return 0;
34000 : }
34001 :
34002 0 : static PyObject *py_lsa_StorePrivateData_in_get_name(PyObject *obj, void *closure)
34003 : {
34004 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(obj);
34005 0 : PyObject *py_name;
34006 0 : if (object->in.name == NULL) {
34007 0 : Py_RETURN_NONE;
34008 : }
34009 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
34010 0 : return py_name;
34011 : }
34012 :
34013 0 : static int py_lsa_StorePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
34014 : {
34015 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34016 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
34017 0 : if (value == NULL) {
34018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
34019 0 : return -1;
34020 : }
34021 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
34022 0 : if (object->in.name == NULL) {
34023 0 : PyErr_NoMemory();
34024 0 : return -1;
34025 : }
34026 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34027 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34028 0 : PyErr_NoMemory();
34029 0 : return -1;
34030 : }
34031 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
34032 0 : return 0;
34033 : }
34034 :
34035 0 : static PyObject *py_lsa_StorePrivateData_in_get_val(PyObject *obj, void *closure)
34036 : {
34037 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(obj);
34038 0 : PyObject *py_val;
34039 0 : if (object->in.val == NULL) {
34040 0 : Py_RETURN_NONE;
34041 : }
34042 0 : if (object->in.val == NULL) {
34043 0 : py_val = Py_None;
34044 0 : Py_INCREF(py_val);
34045 : } else {
34046 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, object->in.val, object->in.val);
34047 : }
34048 0 : return py_val;
34049 : }
34050 :
34051 0 : static int py_lsa_StorePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
34052 : {
34053 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34054 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
34055 0 : if (value == NULL) {
34056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.val");
34057 0 : return -1;
34058 : }
34059 0 : if (value == Py_None) {
34060 0 : object->in.val = NULL;
34061 : } else {
34062 0 : object->in.val = NULL;
34063 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
34064 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34065 0 : PyErr_NoMemory();
34066 0 : return -1;
34067 : }
34068 0 : object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
34069 : }
34070 0 : return 0;
34071 : }
34072 :
34073 0 : static PyObject *py_lsa_StorePrivateData_get_result(PyObject *obj, void *closure)
34074 : {
34075 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(obj);
34076 0 : PyObject *py_result;
34077 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
34078 0 : return py_result;
34079 : }
34080 :
34081 0 : static int py_lsa_StorePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
34082 : {
34083 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34084 0 : if (value == NULL) {
34085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
34086 0 : return -1;
34087 : }
34088 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34089 0 : return 0;
34090 : }
34091 :
34092 : static PyGetSetDef py_lsa_StorePrivateData_getsetters[] = {
34093 : {
34094 : .name = discard_const_p(char, "in_handle"),
34095 : .get = py_lsa_StorePrivateData_in_get_handle,
34096 : .set = py_lsa_StorePrivateData_in_set_handle,
34097 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
34098 : },
34099 : {
34100 : .name = discard_const_p(char, "in_name"),
34101 : .get = py_lsa_StorePrivateData_in_get_name,
34102 : .set = py_lsa_StorePrivateData_in_set_name,
34103 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34104 : },
34105 : {
34106 : .name = discard_const_p(char, "in_val"),
34107 : .get = py_lsa_StorePrivateData_in_get_val,
34108 : .set = py_lsa_StorePrivateData_in_set_val,
34109 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
34110 : },
34111 : {
34112 : .name = discard_const_p(char, "result"),
34113 : .get = py_lsa_StorePrivateData_get_result,
34114 : .set = py_lsa_StorePrivateData_set_result,
34115 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34116 : },
34117 : { .name = NULL }
34118 : };
34119 :
34120 0 : static PyObject *py_lsa_StorePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34121 : {
34122 0 : PyObject *self = pytalloc_new(struct lsa_StorePrivateData, type);
34123 0 : struct lsa_StorePrivateData *_self = (struct lsa_StorePrivateData *)pytalloc_get_ptr(self);
34124 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34125 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
34126 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
34127 0 : return self;
34128 : }
34129 :
34130 0 : static PyObject *py_lsa_StorePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34131 : {
34132 :
34133 :
34134 0 : return PyLong_FromLong(42);
34135 : }
34136 :
34137 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34138 : {
34139 0 : const struct ndr_interface_call *call = NULL;
34140 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34141 0 : PyObject *ret = NULL;
34142 0 : struct ndr_push *push = NULL;
34143 0 : DATA_BLOB blob;
34144 0 : enum ndr_err_code err;
34145 :
34146 0 : if (ndr_table_lsarpc.num_calls < 43) {
34147 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_pack");
34148 0 : return NULL;
34149 : }
34150 0 : call = &ndr_table_lsarpc.calls[42];
34151 :
34152 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34153 0 : if (push == NULL) {
34154 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34155 0 : return NULL;
34156 : }
34157 :
34158 0 : push->flags |= ndr_push_flags;
34159 :
34160 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34161 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34162 0 : TALLOC_FREE(push);
34163 0 : PyErr_SetNdrError(err);
34164 0 : return NULL;
34165 : }
34166 0 : blob = ndr_push_blob(push);
34167 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34168 0 : TALLOC_FREE(push);
34169 0 : return ret;
34170 : }
34171 :
34172 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34173 : {
34174 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34175 0 : PyObject *bigendian_obj = NULL;
34176 0 : PyObject *ndr64_obj = NULL;
34177 0 : libndr_flags ndr_push_flags = 0;
34178 :
34179 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34180 : discard_const_p(char *, kwnames),
34181 : &bigendian_obj,
34182 : &ndr64_obj)) {
34183 0 : return NULL;
34184 : }
34185 :
34186 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34187 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34188 : }
34189 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34190 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34191 : }
34192 :
34193 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34194 : }
34195 :
34196 0 : static PyObject *py_lsa_StorePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34197 : {
34198 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34199 0 : PyObject *bigendian_obj = NULL;
34200 0 : PyObject *ndr64_obj = NULL;
34201 0 : libndr_flags ndr_push_flags = 0;
34202 :
34203 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34204 : discard_const_p(char *, kwnames),
34205 : &bigendian_obj,
34206 : &ndr64_obj)) {
34207 0 : return NULL;
34208 : }
34209 :
34210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34211 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34212 : }
34213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34214 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34215 : }
34216 :
34217 0 : return py_lsa_StorePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34218 : }
34219 :
34220 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)
34221 : {
34222 0 : const struct ndr_interface_call *call = NULL;
34223 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34224 0 : struct ndr_pull *pull = NULL;
34225 0 : enum ndr_err_code err;
34226 :
34227 0 : if (ndr_table_lsarpc.num_calls < 43) {
34228 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_unpack");
34229 0 : return NULL;
34230 : }
34231 0 : call = &ndr_table_lsarpc.calls[42];
34232 :
34233 0 : pull = ndr_pull_init_blob(blob, object);
34234 0 : if (pull == NULL) {
34235 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34236 0 : return NULL;
34237 : }
34238 :
34239 0 : pull->flags |= ndr_pull_flags;
34240 :
34241 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34242 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34243 0 : TALLOC_FREE(pull);
34244 0 : PyErr_SetNdrError(err);
34245 0 : return NULL;
34246 : }
34247 0 : if (!allow_remaining) {
34248 0 : uint32_t highest_ofs;
34249 :
34250 0 : if (pull->offset > pull->relative_highest_offset) {
34251 0 : highest_ofs = pull->offset;
34252 : } else {
34253 0 : highest_ofs = pull->relative_highest_offset;
34254 : }
34255 0 : if (highest_ofs < pull->data_size) {
34256 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34257 : "not all bytes consumed ofs[%u] size[%u]",
34258 : highest_ofs, pull->data_size);
34259 0 : TALLOC_FREE(pull);
34260 0 : PyErr_SetNdrError(err);
34261 0 : return NULL;
34262 : }
34263 : }
34264 :
34265 0 : TALLOC_FREE(pull);
34266 0 : Py_RETURN_NONE;
34267 : }
34268 :
34269 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34270 : {
34271 0 : DATA_BLOB blob;
34272 0 : Py_ssize_t blob_length = 0;
34273 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34274 0 : PyObject *bigendian_obj = NULL;
34275 0 : PyObject *ndr64_obj = NULL;
34276 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34277 0 : PyObject *allow_remaining_obj = NULL;
34278 0 : bool allow_remaining = false;
34279 :
34280 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34281 : discard_const_p(char *, kwnames),
34282 : &blob.data, &blob_length,
34283 : &bigendian_obj,
34284 : &ndr64_obj,
34285 : &allow_remaining_obj)) {
34286 0 : return NULL;
34287 : }
34288 0 : blob.length = blob_length;
34289 :
34290 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34291 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34292 : }
34293 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34294 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34295 : }
34296 :
34297 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34298 0 : allow_remaining = true;
34299 : }
34300 :
34301 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34302 : }
34303 :
34304 0 : static PyObject *py_lsa_StorePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34305 : {
34306 0 : DATA_BLOB blob;
34307 0 : Py_ssize_t blob_length = 0;
34308 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34309 0 : PyObject *bigendian_obj = NULL;
34310 0 : PyObject *ndr64_obj = NULL;
34311 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34312 0 : PyObject *allow_remaining_obj = NULL;
34313 0 : bool allow_remaining = false;
34314 :
34315 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34316 : discard_const_p(char *, kwnames),
34317 : &blob.data, &blob_length,
34318 : &bigendian_obj,
34319 : &ndr64_obj,
34320 : &allow_remaining_obj)) {
34321 0 : return NULL;
34322 : }
34323 0 : blob.length = blob_length;
34324 :
34325 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34326 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34327 : }
34328 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34329 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34330 : }
34331 :
34332 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34333 0 : allow_remaining = true;
34334 : }
34335 :
34336 0 : return py_lsa_StorePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34337 : }
34338 :
34339 0 : static PyObject *py_lsa_StorePrivateData_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34340 : {
34341 0 : const struct ndr_interface_call *call = NULL;
34342 0 : struct lsa_StorePrivateData *object = pytalloc_get_ptr(py_obj);
34343 0 : PyObject *ret;
34344 0 : char *retstr;
34345 :
34346 0 : if (ndr_table_lsarpc.num_calls < 43) {
34347 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_StorePrivateData_ndr_print");
34348 0 : return NULL;
34349 : }
34350 0 : call = &ndr_table_lsarpc.calls[42];
34351 :
34352 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34353 0 : ret = PyUnicode_FromString(retstr);
34354 0 : TALLOC_FREE(retstr);
34355 :
34356 0 : return ret;
34357 : }
34358 :
34359 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34360 : {
34361 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_in", NDR_IN);
34362 : }
34363 :
34364 0 : static PyObject *py_lsa_StorePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34365 : {
34366 0 : return py_lsa_StorePrivateData_ndr_print(py_obj, "lsa_StorePrivateData_out", NDR_OUT);
34367 : }
34368 :
34369 : static PyMethodDef py_lsa_StorePrivateData_methods[] = {
34370 : { "opnum", (PyCFunction)py_lsa_StorePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
34371 : "lsa.StorePrivateData.opnum() -> 42 (0x2a) " },
34372 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34373 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34374 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34375 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34376 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34377 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34378 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_StorePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34379 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34380 : { "__ndr_print_in__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34381 : { "__ndr_print_out__", (PyCFunction)py_lsa_StorePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34382 : { NULL, NULL, 0, NULL }
34383 : };
34384 :
34385 :
34386 : static PyTypeObject lsa_StorePrivateData_Type = {
34387 : PyVarObject_HEAD_INIT(NULL, 0)
34388 : .tp_name = "lsa.StorePrivateData",
34389 : .tp_getset = py_lsa_StorePrivateData_getsetters,
34390 : .tp_methods = py_lsa_StorePrivateData_methods,
34391 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34392 : .tp_new = py_lsa_StorePrivateData_new,
34393 : };
34394 :
34395 0 : static bool pack_py_lsa_StorePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_StorePrivateData *r)
34396 : {
34397 0 : PyObject *py_handle;
34398 0 : PyObject *py_name;
34399 0 : PyObject *py_val;
34400 0 : const char *kwnames[] = {
34401 : "handle", "name", "val", NULL
34402 : };
34403 :
34404 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_StorePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
34405 0 : return false;
34406 : }
34407 :
34408 0 : if (py_handle == NULL) {
34409 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
34410 0 : return false;
34411 : }
34412 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
34413 0 : if (r->in.handle == NULL) {
34414 0 : PyErr_NoMemory();
34415 0 : return false;
34416 : }
34417 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
34418 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
34419 0 : PyErr_NoMemory();
34420 0 : return false;
34421 : }
34422 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
34423 0 : if (py_name == NULL) {
34424 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
34425 0 : return false;
34426 : }
34427 0 : r->in.name = talloc_ptrtype(r, r->in.name);
34428 0 : if (r->in.name == NULL) {
34429 0 : PyErr_NoMemory();
34430 0 : return false;
34431 : }
34432 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
34433 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
34434 0 : PyErr_NoMemory();
34435 0 : return false;
34436 : }
34437 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
34438 0 : if (py_val == NULL) {
34439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.val");
34440 0 : return false;
34441 : }
34442 0 : if (py_val == Py_None) {
34443 0 : r->in.val = NULL;
34444 : } else {
34445 0 : r->in.val = NULL;
34446 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
34447 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
34448 0 : PyErr_NoMemory();
34449 0 : return false;
34450 : }
34451 0 : r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
34452 : }
34453 0 : return true;
34454 : }
34455 :
34456 0 : static PyObject *unpack_py_lsa_StorePrivateData_args_out(struct lsa_StorePrivateData *r)
34457 : {
34458 0 : PyObject *result;
34459 0 : result = Py_None;
34460 0 : Py_INCREF(result);
34461 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
34462 0 : PyErr_SetNTSTATUS(r->out.result);
34463 0 : return NULL;
34464 : }
34465 :
34466 0 : return result;
34467 : }
34468 :
34469 :
34470 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_handle(PyObject *obj, void *closure)
34471 : {
34472 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(obj);
34473 0 : PyObject *py_handle;
34474 0 : if (object->in.handle == NULL) {
34475 0 : Py_RETURN_NONE;
34476 : }
34477 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
34478 0 : return py_handle;
34479 : }
34480 :
34481 0 : static int py_lsa_RetrievePrivateData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
34482 : {
34483 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34484 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
34485 0 : if (value == NULL) {
34486 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
34487 0 : return -1;
34488 : }
34489 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
34490 0 : if (object->in.handle == NULL) {
34491 0 : PyErr_NoMemory();
34492 0 : return -1;
34493 : }
34494 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
34495 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34496 0 : PyErr_NoMemory();
34497 0 : return -1;
34498 : }
34499 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
34500 0 : return 0;
34501 : }
34502 :
34503 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_name(PyObject *obj, void *closure)
34504 : {
34505 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(obj);
34506 0 : PyObject *py_name;
34507 0 : if (object->in.name == NULL) {
34508 0 : Py_RETURN_NONE;
34509 : }
34510 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, object->in.name, object->in.name);
34511 0 : return py_name;
34512 : }
34513 :
34514 0 : static int py_lsa_RetrievePrivateData_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
34515 : {
34516 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34517 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
34518 0 : if (value == NULL) {
34519 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
34520 0 : return -1;
34521 : }
34522 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
34523 0 : if (object->in.name == NULL) {
34524 0 : PyErr_NoMemory();
34525 0 : return -1;
34526 : }
34527 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
34528 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34529 0 : PyErr_NoMemory();
34530 0 : return -1;
34531 : }
34532 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
34533 0 : return 0;
34534 : }
34535 :
34536 0 : static PyObject *py_lsa_RetrievePrivateData_in_get_val(PyObject *obj, void *closure)
34537 : {
34538 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(obj);
34539 0 : PyObject *py_val;
34540 0 : if (object->in.val == NULL) {
34541 0 : Py_RETURN_NONE;
34542 : }
34543 0 : if (*object->in.val == NULL) {
34544 0 : py_val = Py_None;
34545 0 : Py_INCREF(py_val);
34546 : } else {
34547 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->in.val, *object->in.val);
34548 : }
34549 0 : return py_val;
34550 : }
34551 :
34552 0 : static int py_lsa_RetrievePrivateData_in_set_val(PyObject *py_obj, PyObject *value, void *closure)
34553 : {
34554 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34555 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.val));
34556 0 : if (value == NULL) {
34557 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.val");
34558 0 : return -1;
34559 : }
34560 0 : object->in.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.val);
34561 0 : if (object->in.val == NULL) {
34562 0 : PyErr_NoMemory();
34563 0 : return -1;
34564 : }
34565 0 : if (value == Py_None) {
34566 0 : *object->in.val = NULL;
34567 : } else {
34568 0 : *object->in.val = NULL;
34569 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
34570 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34571 0 : PyErr_NoMemory();
34572 0 : return -1;
34573 : }
34574 0 : *object->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
34575 : }
34576 0 : return 0;
34577 : }
34578 :
34579 0 : static PyObject *py_lsa_RetrievePrivateData_out_get_val(PyObject *obj, void *closure)
34580 : {
34581 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(obj);
34582 0 : PyObject *py_val;
34583 0 : if (object->out.val == NULL) {
34584 0 : Py_RETURN_NONE;
34585 : }
34586 0 : if (*object->out.val == NULL) {
34587 0 : py_val = Py_None;
34588 0 : Py_INCREF(py_val);
34589 : } else {
34590 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *object->out.val, *object->out.val);
34591 : }
34592 0 : return py_val;
34593 : }
34594 :
34595 0 : static int py_lsa_RetrievePrivateData_out_set_val(PyObject *py_obj, PyObject *value, void *closure)
34596 : {
34597 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34598 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.val));
34599 0 : if (value == NULL) {
34600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.val");
34601 0 : return -1;
34602 : }
34603 0 : object->out.val = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.val);
34604 0 : if (object->out.val == NULL) {
34605 0 : PyErr_NoMemory();
34606 0 : return -1;
34607 : }
34608 0 : if (value == Py_None) {
34609 0 : *object->out.val = NULL;
34610 : } else {
34611 0 : *object->out.val = NULL;
34612 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, value, return -1;);
34613 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34614 0 : PyErr_NoMemory();
34615 0 : return -1;
34616 : }
34617 0 : *object->out.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(value);
34618 : }
34619 0 : return 0;
34620 : }
34621 :
34622 0 : static PyObject *py_lsa_RetrievePrivateData_get_result(PyObject *obj, void *closure)
34623 : {
34624 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(obj);
34625 0 : PyObject *py_result;
34626 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
34627 0 : return py_result;
34628 : }
34629 :
34630 0 : static int py_lsa_RetrievePrivateData_set_result(PyObject *py_obj, PyObject *value, void *closure)
34631 : {
34632 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34633 0 : if (value == NULL) {
34634 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
34635 0 : return -1;
34636 : }
34637 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34638 0 : return 0;
34639 : }
34640 :
34641 : static PyGetSetDef py_lsa_RetrievePrivateData_getsetters[] = {
34642 : {
34643 : .name = discard_const_p(char, "in_handle"),
34644 : .get = py_lsa_RetrievePrivateData_in_get_handle,
34645 : .set = py_lsa_RetrievePrivateData_in_set_handle,
34646 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
34647 : },
34648 : {
34649 : .name = discard_const_p(char, "in_name"),
34650 : .get = py_lsa_RetrievePrivateData_in_get_name,
34651 : .set = py_lsa_RetrievePrivateData_in_set_name,
34652 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
34653 : },
34654 : {
34655 : .name = discard_const_p(char, "in_val"),
34656 : .get = py_lsa_RetrievePrivateData_in_get_val,
34657 : .set = py_lsa_RetrievePrivateData_in_set_val,
34658 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
34659 : },
34660 : {
34661 : .name = discard_const_p(char, "out_val"),
34662 : .get = py_lsa_RetrievePrivateData_out_get_val,
34663 : .set = py_lsa_RetrievePrivateData_out_set_val,
34664 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DATA_BUF")
34665 : },
34666 : {
34667 : .name = discard_const_p(char, "result"),
34668 : .get = py_lsa_RetrievePrivateData_get_result,
34669 : .set = py_lsa_RetrievePrivateData_set_result,
34670 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34671 : },
34672 : { .name = NULL }
34673 : };
34674 :
34675 0 : static PyObject *py_lsa_RetrievePrivateData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34676 : {
34677 0 : PyObject *self = pytalloc_new(struct lsa_RetrievePrivateData, type);
34678 0 : struct lsa_RetrievePrivateData *_self = (struct lsa_RetrievePrivateData *)pytalloc_get_ptr(self);
34679 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34680 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
34681 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
34682 : /* a pointer to a NULL pointer */
34683 0 : _self->in.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
34684 0 : _self->out.val = talloc_zero(mem_ctx, struct lsa_DATA_BUF *);
34685 0 : return self;
34686 : }
34687 :
34688 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34689 : {
34690 :
34691 :
34692 0 : return PyLong_FromLong(43);
34693 : }
34694 :
34695 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34696 : {
34697 0 : const struct ndr_interface_call *call = NULL;
34698 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34699 0 : PyObject *ret = NULL;
34700 0 : struct ndr_push *push = NULL;
34701 0 : DATA_BLOB blob;
34702 0 : enum ndr_err_code err;
34703 :
34704 0 : if (ndr_table_lsarpc.num_calls < 44) {
34705 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_pack");
34706 0 : return NULL;
34707 : }
34708 0 : call = &ndr_table_lsarpc.calls[43];
34709 :
34710 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34711 0 : if (push == NULL) {
34712 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34713 0 : return NULL;
34714 : }
34715 :
34716 0 : push->flags |= ndr_push_flags;
34717 :
34718 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34719 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34720 0 : TALLOC_FREE(push);
34721 0 : PyErr_SetNdrError(err);
34722 0 : return NULL;
34723 : }
34724 0 : blob = ndr_push_blob(push);
34725 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34726 0 : TALLOC_FREE(push);
34727 0 : return ret;
34728 : }
34729 :
34730 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34731 : {
34732 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34733 0 : PyObject *bigendian_obj = NULL;
34734 0 : PyObject *ndr64_obj = NULL;
34735 0 : libndr_flags ndr_push_flags = 0;
34736 :
34737 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34738 : discard_const_p(char *, kwnames),
34739 : &bigendian_obj,
34740 : &ndr64_obj)) {
34741 0 : return NULL;
34742 : }
34743 :
34744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34745 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34746 : }
34747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34748 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34749 : }
34750 :
34751 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34752 : }
34753 :
34754 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34755 : {
34756 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34757 0 : PyObject *bigendian_obj = NULL;
34758 0 : PyObject *ndr64_obj = NULL;
34759 0 : libndr_flags ndr_push_flags = 0;
34760 :
34761 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34762 : discard_const_p(char *, kwnames),
34763 : &bigendian_obj,
34764 : &ndr64_obj)) {
34765 0 : return NULL;
34766 : }
34767 :
34768 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34769 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34770 : }
34771 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34772 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34773 : }
34774 :
34775 0 : return py_lsa_RetrievePrivateData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34776 : }
34777 :
34778 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)
34779 : {
34780 0 : const struct ndr_interface_call *call = NULL;
34781 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34782 0 : struct ndr_pull *pull = NULL;
34783 0 : enum ndr_err_code err;
34784 :
34785 0 : if (ndr_table_lsarpc.num_calls < 44) {
34786 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_unpack");
34787 0 : return NULL;
34788 : }
34789 0 : call = &ndr_table_lsarpc.calls[43];
34790 :
34791 0 : pull = ndr_pull_init_blob(blob, object);
34792 0 : if (pull == NULL) {
34793 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34794 0 : return NULL;
34795 : }
34796 :
34797 0 : pull->flags |= ndr_pull_flags;
34798 :
34799 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34800 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34801 0 : TALLOC_FREE(pull);
34802 0 : PyErr_SetNdrError(err);
34803 0 : return NULL;
34804 : }
34805 0 : if (!allow_remaining) {
34806 0 : uint32_t highest_ofs;
34807 :
34808 0 : if (pull->offset > pull->relative_highest_offset) {
34809 0 : highest_ofs = pull->offset;
34810 : } else {
34811 0 : highest_ofs = pull->relative_highest_offset;
34812 : }
34813 0 : if (highest_ofs < pull->data_size) {
34814 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34815 : "not all bytes consumed ofs[%u] size[%u]",
34816 : highest_ofs, pull->data_size);
34817 0 : TALLOC_FREE(pull);
34818 0 : PyErr_SetNdrError(err);
34819 0 : return NULL;
34820 : }
34821 : }
34822 :
34823 0 : TALLOC_FREE(pull);
34824 0 : Py_RETURN_NONE;
34825 : }
34826 :
34827 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34828 : {
34829 0 : DATA_BLOB blob;
34830 0 : Py_ssize_t blob_length = 0;
34831 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34832 0 : PyObject *bigendian_obj = NULL;
34833 0 : PyObject *ndr64_obj = NULL;
34834 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34835 0 : PyObject *allow_remaining_obj = NULL;
34836 0 : bool allow_remaining = false;
34837 :
34838 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34839 : discard_const_p(char *, kwnames),
34840 : &blob.data, &blob_length,
34841 : &bigendian_obj,
34842 : &ndr64_obj,
34843 : &allow_remaining_obj)) {
34844 0 : return NULL;
34845 : }
34846 0 : blob.length = blob_length;
34847 :
34848 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34849 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34850 : }
34851 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34852 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34853 : }
34854 :
34855 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34856 0 : allow_remaining = true;
34857 : }
34858 :
34859 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34860 : }
34861 :
34862 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34863 : {
34864 0 : DATA_BLOB blob;
34865 0 : Py_ssize_t blob_length = 0;
34866 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34867 0 : PyObject *bigendian_obj = NULL;
34868 0 : PyObject *ndr64_obj = NULL;
34869 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34870 0 : PyObject *allow_remaining_obj = NULL;
34871 0 : bool allow_remaining = false;
34872 :
34873 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34874 : discard_const_p(char *, kwnames),
34875 : &blob.data, &blob_length,
34876 : &bigendian_obj,
34877 : &ndr64_obj,
34878 : &allow_remaining_obj)) {
34879 0 : return NULL;
34880 : }
34881 0 : blob.length = blob_length;
34882 :
34883 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34884 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34885 : }
34886 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34887 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34888 : }
34889 :
34890 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34891 0 : allow_remaining = true;
34892 : }
34893 :
34894 0 : return py_lsa_RetrievePrivateData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34895 : }
34896 :
34897 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34898 : {
34899 0 : const struct ndr_interface_call *call = NULL;
34900 0 : struct lsa_RetrievePrivateData *object = pytalloc_get_ptr(py_obj);
34901 0 : PyObject *ret;
34902 0 : char *retstr;
34903 :
34904 0 : if (ndr_table_lsarpc.num_calls < 44) {
34905 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_RetrievePrivateData_ndr_print");
34906 0 : return NULL;
34907 : }
34908 0 : call = &ndr_table_lsarpc.calls[43];
34909 :
34910 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34911 0 : ret = PyUnicode_FromString(retstr);
34912 0 : TALLOC_FREE(retstr);
34913 :
34914 0 : return ret;
34915 : }
34916 :
34917 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34918 : {
34919 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_in", NDR_IN);
34920 : }
34921 :
34922 0 : static PyObject *py_lsa_RetrievePrivateData_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34923 : {
34924 0 : return py_lsa_RetrievePrivateData_ndr_print(py_obj, "lsa_RetrievePrivateData_out", NDR_OUT);
34925 : }
34926 :
34927 : static PyMethodDef py_lsa_RetrievePrivateData_methods[] = {
34928 : { "opnum", (PyCFunction)py_lsa_RetrievePrivateData_ndr_opnum, METH_NOARGS|METH_CLASS,
34929 : "lsa.RetrievePrivateData.opnum() -> 43 (0x2b) " },
34930 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34931 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34932 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34933 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34934 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34935 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34936 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_RetrievePrivateData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34937 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34938 : { "__ndr_print_in__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34939 : { "__ndr_print_out__", (PyCFunction)py_lsa_RetrievePrivateData_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34940 : { NULL, NULL, 0, NULL }
34941 : };
34942 :
34943 :
34944 : static PyTypeObject lsa_RetrievePrivateData_Type = {
34945 : PyVarObject_HEAD_INIT(NULL, 0)
34946 : .tp_name = "lsa.RetrievePrivateData",
34947 : .tp_getset = py_lsa_RetrievePrivateData_getsetters,
34948 : .tp_methods = py_lsa_RetrievePrivateData_methods,
34949 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34950 : .tp_new = py_lsa_RetrievePrivateData_new,
34951 : };
34952 :
34953 0 : static bool pack_py_lsa_RetrievePrivateData_args_in(PyObject *args, PyObject *kwargs, struct lsa_RetrievePrivateData *r)
34954 : {
34955 0 : PyObject *py_handle;
34956 0 : PyObject *py_name;
34957 0 : PyObject *py_val;
34958 0 : const char *kwnames[] = {
34959 : "handle", "name", "val", NULL
34960 : };
34961 :
34962 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_RetrievePrivateData", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_val)) {
34963 0 : return false;
34964 : }
34965 :
34966 0 : if (py_handle == NULL) {
34967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
34968 0 : return false;
34969 : }
34970 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
34971 0 : if (r->in.handle == NULL) {
34972 0 : PyErr_NoMemory();
34973 0 : return false;
34974 : }
34975 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
34976 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
34977 0 : PyErr_NoMemory();
34978 0 : return false;
34979 : }
34980 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
34981 0 : if (py_name == NULL) {
34982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
34983 0 : return false;
34984 : }
34985 0 : r->in.name = talloc_ptrtype(r, r->in.name);
34986 0 : if (r->in.name == NULL) {
34987 0 : PyErr_NoMemory();
34988 0 : return false;
34989 : }
34990 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
34991 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
34992 0 : PyErr_NoMemory();
34993 0 : return false;
34994 : }
34995 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
34996 0 : if (py_val == NULL) {
34997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.val");
34998 0 : return false;
34999 : }
35000 0 : r->in.val = talloc_ptrtype(r, r->in.val);
35001 0 : if (r->in.val == NULL) {
35002 0 : PyErr_NoMemory();
35003 0 : return false;
35004 : }
35005 0 : if (py_val == Py_None) {
35006 0 : *r->in.val = NULL;
35007 : } else {
35008 0 : *r->in.val = NULL;
35009 0 : PY_CHECK_TYPE(&lsa_DATA_BUF_Type, py_val, return false;);
35010 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_val)) == NULL) {
35011 0 : PyErr_NoMemory();
35012 0 : return false;
35013 : }
35014 0 : *r->in.val = (struct lsa_DATA_BUF *)pytalloc_get_ptr(py_val);
35015 : }
35016 0 : return true;
35017 : }
35018 :
35019 0 : static PyObject *unpack_py_lsa_RetrievePrivateData_args_out(struct lsa_RetrievePrivateData *r)
35020 : {
35021 0 : PyObject *result;
35022 0 : PyObject *py_val;
35023 0 : if (*r->out.val == NULL) {
35024 0 : py_val = Py_None;
35025 0 : Py_INCREF(py_val);
35026 : } else {
35027 0 : py_val = pytalloc_reference_ex(&lsa_DATA_BUF_Type, *r->out.val, *r->out.val);
35028 : }
35029 0 : result = py_val;
35030 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
35031 0 : PyErr_SetNTSTATUS(r->out.result);
35032 0 : return NULL;
35033 : }
35034 :
35035 0 : return result;
35036 : }
35037 :
35038 :
35039 0 : static PyObject *py_lsa_OpenPolicy2_in_get_system_name(PyObject *obj, void *closure)
35040 : {
35041 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(obj);
35042 0 : PyObject *py_system_name;
35043 0 : if (object->in.system_name == NULL) {
35044 0 : Py_RETURN_NONE;
35045 : }
35046 0 : if (object->in.system_name == NULL) {
35047 0 : py_system_name = Py_None;
35048 0 : Py_INCREF(py_system_name);
35049 : } else {
35050 0 : if (object->in.system_name == NULL) {
35051 0 : py_system_name = Py_None;
35052 0 : Py_INCREF(py_system_name);
35053 : } else {
35054 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
35055 : }
35056 : }
35057 0 : return py_system_name;
35058 : }
35059 :
35060 0 : static int py_lsa_OpenPolicy2_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
35061 : {
35062 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35063 0 : if (value == NULL) {
35064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.system_name");
35065 0 : return -1;
35066 : }
35067 0 : if (value == Py_None) {
35068 0 : object->in.system_name = NULL;
35069 : } else {
35070 0 : object->in.system_name = NULL;
35071 : {
35072 0 : const char *test_str;
35073 0 : const char *talloc_str;
35074 0 : PyObject *unicode = NULL;
35075 0 : if (PyUnicode_Check(value)) {
35076 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35077 0 : if (unicode == NULL) {
35078 0 : return -1;
35079 : }
35080 0 : test_str = PyBytes_AS_STRING(unicode);
35081 0 : } else if (PyBytes_Check(value)) {
35082 0 : test_str = PyBytes_AS_STRING(value);
35083 : } else {
35084 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35085 0 : return -1;
35086 : }
35087 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35088 0 : if (unicode != NULL) {
35089 0 : Py_DECREF(unicode);
35090 : }
35091 0 : if (talloc_str == NULL) {
35092 0 : PyErr_NoMemory();
35093 0 : return -1;
35094 : }
35095 0 : object->in.system_name = talloc_str;
35096 : }
35097 : }
35098 0 : return 0;
35099 : }
35100 :
35101 0 : static PyObject *py_lsa_OpenPolicy2_in_get_attr(PyObject *obj, void *closure)
35102 : {
35103 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(obj);
35104 0 : PyObject *py_attr;
35105 0 : if (object->in.attr == NULL) {
35106 0 : Py_RETURN_NONE;
35107 : }
35108 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
35109 0 : return py_attr;
35110 : }
35111 :
35112 0 : static int py_lsa_OpenPolicy2_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
35113 : {
35114 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35115 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
35116 0 : if (value == NULL) {
35117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.attr");
35118 0 : return -1;
35119 : }
35120 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
35121 0 : if (object->in.attr == NULL) {
35122 0 : PyErr_NoMemory();
35123 0 : return -1;
35124 : }
35125 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
35126 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35127 0 : PyErr_NoMemory();
35128 0 : return -1;
35129 : }
35130 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
35131 0 : return 0;
35132 : }
35133 :
35134 0 : static PyObject *py_lsa_OpenPolicy2_in_get_access_mask(PyObject *obj, void *closure)
35135 : {
35136 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(obj);
35137 0 : PyObject *py_access_mask;
35138 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
35139 0 : return py_access_mask;
35140 : }
35141 :
35142 0 : static int py_lsa_OpenPolicy2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
35143 : {
35144 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35145 0 : if (value == NULL) {
35146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
35147 0 : return -1;
35148 : }
35149 : {
35150 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
35151 0 : if (PyLong_Check(value)) {
35152 0 : unsigned long long test_var;
35153 0 : test_var = PyLong_AsUnsignedLongLong(value);
35154 0 : if (PyErr_Occurred() != NULL) {
35155 0 : return -1;
35156 : }
35157 0 : if (test_var > uint_max) {
35158 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35159 : PyLong_Type.tp_name, uint_max, test_var);
35160 0 : return -1;
35161 : }
35162 0 : object->in.access_mask = test_var;
35163 : } else {
35164 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35165 : PyLong_Type.tp_name);
35166 0 : return -1;
35167 : }
35168 : }
35169 0 : return 0;
35170 : }
35171 :
35172 0 : static PyObject *py_lsa_OpenPolicy2_out_get_handle(PyObject *obj, void *closure)
35173 : {
35174 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(obj);
35175 0 : PyObject *py_handle;
35176 0 : if (object->out.handle == NULL) {
35177 0 : Py_RETURN_NONE;
35178 : }
35179 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
35180 0 : return py_handle;
35181 : }
35182 :
35183 0 : static int py_lsa_OpenPolicy2_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
35184 : {
35185 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35186 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
35187 0 : if (value == NULL) {
35188 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
35189 0 : return -1;
35190 : }
35191 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
35192 0 : if (object->out.handle == NULL) {
35193 0 : PyErr_NoMemory();
35194 0 : return -1;
35195 : }
35196 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35197 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35198 0 : PyErr_NoMemory();
35199 0 : return -1;
35200 : }
35201 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
35202 0 : return 0;
35203 : }
35204 :
35205 0 : static PyObject *py_lsa_OpenPolicy2_get_result(PyObject *obj, void *closure)
35206 : {
35207 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(obj);
35208 0 : PyObject *py_result;
35209 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35210 0 : return py_result;
35211 : }
35212 :
35213 0 : static int py_lsa_OpenPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
35214 : {
35215 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35216 0 : if (value == NULL) {
35217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
35218 0 : return -1;
35219 : }
35220 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35221 0 : return 0;
35222 : }
35223 :
35224 : static PyGetSetDef py_lsa_OpenPolicy2_getsetters[] = {
35225 : {
35226 : .name = discard_const_p(char, "in_system_name"),
35227 : .get = py_lsa_OpenPolicy2_in_get_system_name,
35228 : .set = py_lsa_OpenPolicy2_in_set_system_name,
35229 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
35230 : },
35231 : {
35232 : .name = discard_const_p(char, "in_attr"),
35233 : .get = py_lsa_OpenPolicy2_in_get_attr,
35234 : .set = py_lsa_OpenPolicy2_in_set_attr,
35235 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
35236 : },
35237 : {
35238 : .name = discard_const_p(char, "in_access_mask"),
35239 : .get = py_lsa_OpenPolicy2_in_get_access_mask,
35240 : .set = py_lsa_OpenPolicy2_in_set_access_mask,
35241 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
35242 : },
35243 : {
35244 : .name = discard_const_p(char, "out_handle"),
35245 : .get = py_lsa_OpenPolicy2_out_get_handle,
35246 : .set = py_lsa_OpenPolicy2_out_set_handle,
35247 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35248 : },
35249 : {
35250 : .name = discard_const_p(char, "result"),
35251 : .get = py_lsa_OpenPolicy2_get_result,
35252 : .set = py_lsa_OpenPolicy2_set_result,
35253 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35254 : },
35255 : { .name = NULL }
35256 : };
35257 :
35258 0 : static PyObject *py_lsa_OpenPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35259 : {
35260 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy2, type);
35261 0 : struct lsa_OpenPolicy2 *_self = (struct lsa_OpenPolicy2 *)pytalloc_get_ptr(self);
35262 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35263 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
35264 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
35265 0 : return self;
35266 : }
35267 :
35268 0 : static PyObject *py_lsa_OpenPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35269 : {
35270 :
35271 :
35272 0 : return PyLong_FromLong(44);
35273 : }
35274 :
35275 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35276 : {
35277 0 : const struct ndr_interface_call *call = NULL;
35278 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35279 0 : PyObject *ret = NULL;
35280 0 : struct ndr_push *push = NULL;
35281 0 : DATA_BLOB blob;
35282 0 : enum ndr_err_code err;
35283 :
35284 0 : if (ndr_table_lsarpc.num_calls < 45) {
35285 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_pack");
35286 0 : return NULL;
35287 : }
35288 0 : call = &ndr_table_lsarpc.calls[44];
35289 :
35290 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35291 0 : if (push == NULL) {
35292 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35293 0 : return NULL;
35294 : }
35295 :
35296 0 : push->flags |= ndr_push_flags;
35297 :
35298 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35299 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35300 0 : TALLOC_FREE(push);
35301 0 : PyErr_SetNdrError(err);
35302 0 : return NULL;
35303 : }
35304 0 : blob = ndr_push_blob(push);
35305 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35306 0 : TALLOC_FREE(push);
35307 0 : return ret;
35308 : }
35309 :
35310 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35311 : {
35312 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35313 0 : PyObject *bigendian_obj = NULL;
35314 0 : PyObject *ndr64_obj = NULL;
35315 0 : libndr_flags ndr_push_flags = 0;
35316 :
35317 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35318 : discard_const_p(char *, kwnames),
35319 : &bigendian_obj,
35320 : &ndr64_obj)) {
35321 0 : return NULL;
35322 : }
35323 :
35324 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35325 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35326 : }
35327 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35328 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35329 : }
35330 :
35331 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35332 : }
35333 :
35334 0 : static PyObject *py_lsa_OpenPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35335 : {
35336 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35337 0 : PyObject *bigendian_obj = NULL;
35338 0 : PyObject *ndr64_obj = NULL;
35339 0 : libndr_flags ndr_push_flags = 0;
35340 :
35341 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35342 : discard_const_p(char *, kwnames),
35343 : &bigendian_obj,
35344 : &ndr64_obj)) {
35345 0 : return NULL;
35346 : }
35347 :
35348 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35349 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35350 : }
35351 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35352 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35353 : }
35354 :
35355 0 : return py_lsa_OpenPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35356 : }
35357 :
35358 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)
35359 : {
35360 0 : const struct ndr_interface_call *call = NULL;
35361 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35362 0 : struct ndr_pull *pull = NULL;
35363 0 : enum ndr_err_code err;
35364 :
35365 0 : if (ndr_table_lsarpc.num_calls < 45) {
35366 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_unpack");
35367 0 : return NULL;
35368 : }
35369 0 : call = &ndr_table_lsarpc.calls[44];
35370 :
35371 0 : pull = ndr_pull_init_blob(blob, object);
35372 0 : if (pull == NULL) {
35373 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35374 0 : return NULL;
35375 : }
35376 :
35377 0 : pull->flags |= ndr_pull_flags;
35378 :
35379 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35380 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35381 0 : TALLOC_FREE(pull);
35382 0 : PyErr_SetNdrError(err);
35383 0 : return NULL;
35384 : }
35385 0 : if (!allow_remaining) {
35386 0 : uint32_t highest_ofs;
35387 :
35388 0 : if (pull->offset > pull->relative_highest_offset) {
35389 0 : highest_ofs = pull->offset;
35390 : } else {
35391 0 : highest_ofs = pull->relative_highest_offset;
35392 : }
35393 0 : if (highest_ofs < pull->data_size) {
35394 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35395 : "not all bytes consumed ofs[%u] size[%u]",
35396 : highest_ofs, pull->data_size);
35397 0 : TALLOC_FREE(pull);
35398 0 : PyErr_SetNdrError(err);
35399 0 : return NULL;
35400 : }
35401 : }
35402 :
35403 0 : TALLOC_FREE(pull);
35404 0 : Py_RETURN_NONE;
35405 : }
35406 :
35407 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35408 : {
35409 0 : DATA_BLOB blob;
35410 0 : Py_ssize_t blob_length = 0;
35411 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35412 0 : PyObject *bigendian_obj = NULL;
35413 0 : PyObject *ndr64_obj = NULL;
35414 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35415 0 : PyObject *allow_remaining_obj = NULL;
35416 0 : bool allow_remaining = false;
35417 :
35418 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35419 : discard_const_p(char *, kwnames),
35420 : &blob.data, &blob_length,
35421 : &bigendian_obj,
35422 : &ndr64_obj,
35423 : &allow_remaining_obj)) {
35424 0 : return NULL;
35425 : }
35426 0 : blob.length = blob_length;
35427 :
35428 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35429 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35430 : }
35431 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35432 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35433 : }
35434 :
35435 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35436 0 : allow_remaining = true;
35437 : }
35438 :
35439 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35440 : }
35441 :
35442 0 : static PyObject *py_lsa_OpenPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35443 : {
35444 0 : DATA_BLOB blob;
35445 0 : Py_ssize_t blob_length = 0;
35446 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35447 0 : PyObject *bigendian_obj = NULL;
35448 0 : PyObject *ndr64_obj = NULL;
35449 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35450 0 : PyObject *allow_remaining_obj = NULL;
35451 0 : bool allow_remaining = false;
35452 :
35453 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35454 : discard_const_p(char *, kwnames),
35455 : &blob.data, &blob_length,
35456 : &bigendian_obj,
35457 : &ndr64_obj,
35458 : &allow_remaining_obj)) {
35459 0 : return NULL;
35460 : }
35461 0 : blob.length = blob_length;
35462 :
35463 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35464 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35465 : }
35466 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35467 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35468 : }
35469 :
35470 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35471 0 : allow_remaining = true;
35472 : }
35473 :
35474 0 : return py_lsa_OpenPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35475 : }
35476 :
35477 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
35478 : {
35479 0 : const struct ndr_interface_call *call = NULL;
35480 0 : struct lsa_OpenPolicy2 *object = pytalloc_get_ptr(py_obj);
35481 0 : PyObject *ret;
35482 0 : char *retstr;
35483 :
35484 0 : if (ndr_table_lsarpc.num_calls < 45) {
35485 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy2_ndr_print");
35486 0 : return NULL;
35487 : }
35488 0 : call = &ndr_table_lsarpc.calls[44];
35489 :
35490 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35491 0 : ret = PyUnicode_FromString(retstr);
35492 0 : TALLOC_FREE(retstr);
35493 :
35494 0 : return ret;
35495 : }
35496 :
35497 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35498 : {
35499 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_in", NDR_IN);
35500 : }
35501 :
35502 0 : static PyObject *py_lsa_OpenPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35503 : {
35504 0 : return py_lsa_OpenPolicy2_ndr_print(py_obj, "lsa_OpenPolicy2_out", NDR_OUT);
35505 : }
35506 :
35507 : static PyMethodDef py_lsa_OpenPolicy2_methods[] = {
35508 : { "opnum", (PyCFunction)py_lsa_OpenPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
35509 : "lsa.OpenPolicy2.opnum() -> 44 (0x2c) " },
35510 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35511 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35512 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35513 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35514 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35515 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35516 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35517 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35518 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35519 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35520 : { NULL, NULL, 0, NULL }
35521 : };
35522 :
35523 :
35524 : static PyTypeObject lsa_OpenPolicy2_Type = {
35525 : PyVarObject_HEAD_INIT(NULL, 0)
35526 : .tp_name = "lsa.OpenPolicy2",
35527 : .tp_getset = py_lsa_OpenPolicy2_getsetters,
35528 : .tp_methods = py_lsa_OpenPolicy2_methods,
35529 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
35530 : .tp_new = py_lsa_OpenPolicy2_new,
35531 : };
35532 :
35533 9 : static bool pack_py_lsa_OpenPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy2 *r)
35534 : {
35535 0 : PyObject *py_system_name;
35536 0 : PyObject *py_attr;
35537 0 : PyObject *py_access_mask;
35538 9 : const char *kwnames[] = {
35539 : "system_name", "attr", "access_mask", NULL
35540 : };
35541 :
35542 9 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenPolicy2", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask)) {
35543 0 : return false;
35544 : }
35545 :
35546 9 : if (py_system_name == NULL) {
35547 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.system_name");
35548 0 : return false;
35549 : }
35550 9 : if (py_system_name == Py_None) {
35551 0 : r->in.system_name = NULL;
35552 : } else {
35553 9 : r->in.system_name = NULL;
35554 : {
35555 0 : const char *test_str;
35556 0 : const char *talloc_str;
35557 9 : PyObject *unicode = NULL;
35558 9 : if (PyUnicode_Check(py_system_name)) {
35559 9 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
35560 9 : if (unicode == NULL) {
35561 0 : return false;
35562 : }
35563 9 : test_str = PyBytes_AS_STRING(unicode);
35564 0 : } else if (PyBytes_Check(py_system_name)) {
35565 0 : test_str = PyBytes_AS_STRING(py_system_name);
35566 : } else {
35567 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
35568 0 : return false;
35569 : }
35570 9 : talloc_str = talloc_strdup(r, test_str);
35571 9 : if (unicode != NULL) {
35572 9 : Py_DECREF(unicode);
35573 : }
35574 9 : if (talloc_str == NULL) {
35575 0 : PyErr_NoMemory();
35576 0 : return false;
35577 : }
35578 9 : r->in.system_name = talloc_str;
35579 : }
35580 : }
35581 9 : if (py_attr == NULL) {
35582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.attr");
35583 0 : return false;
35584 : }
35585 9 : r->in.attr = talloc_ptrtype(r, r->in.attr);
35586 9 : if (r->in.attr == NULL) {
35587 0 : PyErr_NoMemory();
35588 0 : return false;
35589 : }
35590 9 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
35591 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
35592 0 : PyErr_NoMemory();
35593 0 : return false;
35594 : }
35595 9 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
35596 9 : if (py_access_mask == NULL) {
35597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
35598 0 : return false;
35599 : }
35600 : {
35601 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
35602 9 : if (PyLong_Check(py_access_mask)) {
35603 0 : unsigned long long test_var;
35604 9 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
35605 9 : if (PyErr_Occurred() != NULL) {
35606 0 : return false;
35607 : }
35608 9 : if (test_var > uint_max) {
35609 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35610 : PyLong_Type.tp_name, uint_max, test_var);
35611 0 : return false;
35612 : }
35613 9 : r->in.access_mask = test_var;
35614 : } else {
35615 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35616 : PyLong_Type.tp_name);
35617 0 : return false;
35618 : }
35619 : }
35620 9 : return true;
35621 : }
35622 :
35623 9 : static PyObject *unpack_py_lsa_OpenPolicy2_args_out(struct lsa_OpenPolicy2 *r)
35624 : {
35625 0 : PyObject *result;
35626 0 : PyObject *py_handle;
35627 9 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
35628 9 : result = py_handle;
35629 9 : if (NT_STATUS_IS_ERR(r->out.result)) {
35630 0 : PyErr_SetNTSTATUS(r->out.result);
35631 0 : return NULL;
35632 : }
35633 :
35634 9 : return result;
35635 : }
35636 :
35637 :
35638 0 : static PyObject *py_lsa_GetUserName_in_get_system_name(PyObject *obj, void *closure)
35639 : {
35640 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35641 0 : PyObject *py_system_name;
35642 0 : if (object->in.system_name == NULL) {
35643 0 : Py_RETURN_NONE;
35644 : }
35645 0 : if (object->in.system_name == NULL) {
35646 0 : py_system_name = Py_None;
35647 0 : Py_INCREF(py_system_name);
35648 : } else {
35649 0 : if (object->in.system_name == NULL) {
35650 0 : py_system_name = Py_None;
35651 0 : Py_INCREF(py_system_name);
35652 : } else {
35653 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
35654 : }
35655 : }
35656 0 : return py_system_name;
35657 : }
35658 :
35659 30 : static int py_lsa_GetUserName_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
35660 : {
35661 30 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35662 30 : if (value == NULL) {
35663 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.system_name");
35664 0 : return -1;
35665 : }
35666 30 : if (value == Py_None) {
35667 0 : object->in.system_name = NULL;
35668 : } else {
35669 30 : object->in.system_name = NULL;
35670 : {
35671 0 : const char *test_str;
35672 0 : const char *talloc_str;
35673 30 : PyObject *unicode = NULL;
35674 30 : if (PyUnicode_Check(value)) {
35675 30 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
35676 30 : if (unicode == NULL) {
35677 0 : return -1;
35678 : }
35679 30 : test_str = PyBytes_AS_STRING(unicode);
35680 0 : } else if (PyBytes_Check(value)) {
35681 0 : test_str = PyBytes_AS_STRING(value);
35682 : } else {
35683 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
35684 0 : return -1;
35685 : }
35686 30 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
35687 30 : if (unicode != NULL) {
35688 20 : Py_DECREF(unicode);
35689 : }
35690 30 : if (talloc_str == NULL) {
35691 0 : PyErr_NoMemory();
35692 0 : return -1;
35693 : }
35694 30 : object->in.system_name = talloc_str;
35695 : }
35696 : }
35697 30 : return 0;
35698 : }
35699 :
35700 0 : static PyObject *py_lsa_GetUserName_in_get_account_name(PyObject *obj, void *closure)
35701 : {
35702 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35703 0 : PyObject *py_account_name;
35704 0 : if (object->in.account_name == NULL) {
35705 0 : Py_RETURN_NONE;
35706 : }
35707 0 : if (*object->in.account_name == NULL) {
35708 0 : py_account_name = Py_None;
35709 0 : Py_INCREF(py_account_name);
35710 : } else {
35711 0 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.account_name, *object->in.account_name);
35712 : }
35713 0 : return py_account_name;
35714 : }
35715 :
35716 30 : static int py_lsa_GetUserName_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
35717 : {
35718 30 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35719 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name));
35720 30 : if (value == NULL) {
35721 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.account_name");
35722 0 : return -1;
35723 : }
35724 30 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
35725 30 : if (object->in.account_name == NULL) {
35726 0 : PyErr_NoMemory();
35727 0 : return -1;
35728 : }
35729 30 : if (value == Py_None) {
35730 30 : *object->in.account_name = NULL;
35731 : } else {
35732 0 : *object->in.account_name = NULL;
35733 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
35734 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35735 0 : PyErr_NoMemory();
35736 0 : return -1;
35737 : }
35738 0 : *object->in.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
35739 : }
35740 30 : return 0;
35741 : }
35742 :
35743 294 : static PyObject *py_lsa_GetUserName_out_get_account_name(PyObject *obj, void *closure)
35744 : {
35745 294 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35746 0 : PyObject *py_account_name;
35747 294 : if (object->out.account_name == NULL) {
35748 0 : Py_RETURN_NONE;
35749 : }
35750 294 : if (*object->out.account_name == NULL) {
35751 0 : py_account_name = Py_None;
35752 0 : Py_INCREF(py_account_name);
35753 : } else {
35754 294 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.account_name, *object->out.account_name);
35755 : }
35756 294 : return py_account_name;
35757 : }
35758 :
35759 0 : static int py_lsa_GetUserName_out_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
35760 : {
35761 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35762 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.account_name));
35763 0 : if (value == NULL) {
35764 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.account_name");
35765 0 : return -1;
35766 : }
35767 0 : object->out.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.account_name);
35768 0 : if (object->out.account_name == NULL) {
35769 0 : PyErr_NoMemory();
35770 0 : return -1;
35771 : }
35772 0 : if (value == Py_None) {
35773 0 : *object->out.account_name = NULL;
35774 : } else {
35775 0 : *object->out.account_name = NULL;
35776 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
35777 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35778 0 : PyErr_NoMemory();
35779 0 : return -1;
35780 : }
35781 0 : *object->out.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
35782 : }
35783 0 : return 0;
35784 : }
35785 :
35786 0 : static PyObject *py_lsa_GetUserName_in_get_authority_name(PyObject *obj, void *closure)
35787 : {
35788 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35789 0 : PyObject *py_authority_name;
35790 0 : if (object->in.authority_name == NULL) {
35791 0 : Py_RETURN_NONE;
35792 : }
35793 0 : if (object->in.authority_name == NULL) {
35794 0 : py_authority_name = Py_None;
35795 0 : Py_INCREF(py_authority_name);
35796 : } else {
35797 0 : if (*object->in.authority_name == NULL) {
35798 0 : py_authority_name = Py_None;
35799 0 : Py_INCREF(py_authority_name);
35800 : } else {
35801 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->in.authority_name, *object->in.authority_name);
35802 : }
35803 : }
35804 : {
35805 0 : PyObject *py_authority_name_level_0 = py_authority_name;
35806 0 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
35807 0 : Py_XDECREF(py_authority_name_level_0);
35808 : }
35809 0 : return py_authority_name;
35810 : }
35811 :
35812 30 : static int py_lsa_GetUserName_in_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
35813 : {
35814 30 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35815 30 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.authority_name));
35816 30 : if (value == NULL) {
35817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.authority_name");
35818 0 : return -1;
35819 : }
35820 30 : if (value == Py_None) {
35821 0 : object->in.authority_name = NULL;
35822 : } else {
35823 30 : object->in.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.authority_name);
35824 30 : if (object->in.authority_name == NULL) {
35825 0 : PyErr_NoMemory();
35826 0 : return -1;
35827 : }
35828 30 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
35829 30 : if (value == NULL) {
35830 0 : return -1;
35831 : }
35832 30 : if (value == Py_None) {
35833 30 : *object->in.authority_name = NULL;
35834 : } else {
35835 0 : *object->in.authority_name = NULL;
35836 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
35837 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35838 0 : PyErr_NoMemory();
35839 0 : return -1;
35840 : }
35841 0 : *object->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
35842 : }
35843 : }
35844 30 : return 0;
35845 : }
35846 :
35847 294 : static PyObject *py_lsa_GetUserName_out_get_authority_name(PyObject *obj, void *closure)
35848 : {
35849 294 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35850 0 : PyObject *py_authority_name;
35851 294 : if (object->out.authority_name == NULL) {
35852 0 : Py_RETURN_NONE;
35853 : }
35854 294 : if (object->out.authority_name == NULL) {
35855 0 : py_authority_name = Py_None;
35856 0 : Py_INCREF(py_authority_name);
35857 : } else {
35858 294 : if (*object->out.authority_name == NULL) {
35859 0 : py_authority_name = Py_None;
35860 0 : Py_INCREF(py_authority_name);
35861 : } else {
35862 294 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *object->out.authority_name, *object->out.authority_name);
35863 : }
35864 : }
35865 : {
35866 294 : PyObject *py_authority_name_level_0 = py_authority_name;
35867 294 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
35868 294 : Py_XDECREF(py_authority_name_level_0);
35869 : }
35870 294 : return py_authority_name;
35871 : }
35872 :
35873 0 : static int py_lsa_GetUserName_out_set_authority_name(PyObject *py_obj, PyObject *value, void *closure)
35874 : {
35875 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35876 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.authority_name));
35877 0 : if (value == NULL) {
35878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.authority_name");
35879 0 : return -1;
35880 : }
35881 0 : if (value == Py_None) {
35882 0 : object->out.authority_name = NULL;
35883 : } else {
35884 0 : object->out.authority_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.authority_name);
35885 0 : if (object->out.authority_name == NULL) {
35886 0 : PyErr_NoMemory();
35887 0 : return -1;
35888 : }
35889 0 : value = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, value);
35890 0 : if (value == NULL) {
35891 0 : return -1;
35892 : }
35893 0 : if (value == Py_None) {
35894 0 : *object->out.authority_name = NULL;
35895 : } else {
35896 0 : *object->out.authority_name = NULL;
35897 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
35898 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35899 0 : PyErr_NoMemory();
35900 0 : return -1;
35901 : }
35902 0 : *object->out.authority_name = (struct lsa_String *)pytalloc_get_ptr(value);
35903 : }
35904 : }
35905 0 : return 0;
35906 : }
35907 :
35908 294 : static PyObject *py_lsa_GetUserName_get_result(PyObject *obj, void *closure)
35909 : {
35910 294 : struct lsa_GetUserName *object = pytalloc_get_ptr(obj);
35911 0 : PyObject *py_result;
35912 294 : py_result = PyErr_FromNTSTATUS(object->out.result);
35913 294 : return py_result;
35914 : }
35915 :
35916 0 : static int py_lsa_GetUserName_set_result(PyObject *py_obj, PyObject *value, void *closure)
35917 : {
35918 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35919 0 : if (value == NULL) {
35920 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
35921 0 : return -1;
35922 : }
35923 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35924 0 : return 0;
35925 : }
35926 :
35927 : static PyGetSetDef py_lsa_GetUserName_getsetters[] = {
35928 : {
35929 : .name = discard_const_p(char, "in_system_name"),
35930 : .get = py_lsa_GetUserName_in_get_system_name,
35931 : .set = py_lsa_GetUserName_in_set_system_name,
35932 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
35933 : },
35934 : {
35935 : .name = discard_const_p(char, "in_account_name"),
35936 : .get = py_lsa_GetUserName_in_get_account_name,
35937 : .set = py_lsa_GetUserName_in_set_account_name,
35938 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
35939 : },
35940 : {
35941 : .name = discard_const_p(char, "out_account_name"),
35942 : .get = py_lsa_GetUserName_out_get_account_name,
35943 : .set = py_lsa_GetUserName_out_set_account_name,
35944 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
35945 : },
35946 : {
35947 : .name = discard_const_p(char, "in_authority_name"),
35948 : .get = py_lsa_GetUserName_in_get_authority_name,
35949 : .set = py_lsa_GetUserName_in_set_authority_name,
35950 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
35951 : },
35952 : {
35953 : .name = discard_const_p(char, "out_authority_name"),
35954 : .get = py_lsa_GetUserName_out_get_authority_name,
35955 : .set = py_lsa_GetUserName_out_set_authority_name,
35956 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
35957 : },
35958 : {
35959 : .name = discard_const_p(char, "result"),
35960 : .get = py_lsa_GetUserName_get_result,
35961 : .set = py_lsa_GetUserName_set_result,
35962 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35963 : },
35964 : { .name = NULL }
35965 : };
35966 :
35967 30 : static PyObject *py_lsa_GetUserName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35968 : {
35969 30 : PyObject *self = pytalloc_new(struct lsa_GetUserName, type);
35970 30 : struct lsa_GetUserName *_self = (struct lsa_GetUserName *)pytalloc_get_ptr(self);
35971 30 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35972 : /* a pointer to a NULL pointer */
35973 30 : _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String *);
35974 30 : _self->out.account_name = talloc_zero(mem_ctx, struct lsa_String *);
35975 30 : return self;
35976 : }
35977 :
35978 294 : static PyObject *py_lsa_GetUserName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35979 : {
35980 :
35981 :
35982 294 : return PyLong_FromLong(45);
35983 : }
35984 :
35985 294 : static PyObject *py_lsa_GetUserName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35986 : {
35987 294 : const struct ndr_interface_call *call = NULL;
35988 294 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
35989 294 : PyObject *ret = NULL;
35990 294 : struct ndr_push *push = NULL;
35991 0 : DATA_BLOB blob;
35992 0 : enum ndr_err_code err;
35993 :
35994 294 : if (ndr_table_lsarpc.num_calls < 46) {
35995 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_pack");
35996 0 : return NULL;
35997 : }
35998 294 : call = &ndr_table_lsarpc.calls[45];
35999 :
36000 294 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36001 294 : if (push == NULL) {
36002 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36003 0 : return NULL;
36004 : }
36005 :
36006 294 : push->flags |= ndr_push_flags;
36007 :
36008 294 : err = call->ndr_push(push, ndr_inout_flags, object);
36009 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36010 0 : TALLOC_FREE(push);
36011 0 : PyErr_SetNdrError(err);
36012 0 : return NULL;
36013 : }
36014 294 : blob = ndr_push_blob(push);
36015 294 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36016 294 : TALLOC_FREE(push);
36017 294 : return ret;
36018 : }
36019 :
36020 294 : static PyObject *py_lsa_GetUserName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36021 : {
36022 294 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36023 294 : PyObject *bigendian_obj = NULL;
36024 294 : PyObject *ndr64_obj = NULL;
36025 294 : libndr_flags ndr_push_flags = 0;
36026 :
36027 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36028 : discard_const_p(char *, kwnames),
36029 : &bigendian_obj,
36030 : &ndr64_obj)) {
36031 0 : return NULL;
36032 : }
36033 :
36034 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36035 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36036 : }
36037 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36038 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36039 : }
36040 :
36041 294 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36042 : }
36043 :
36044 0 : static PyObject *py_lsa_GetUserName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36045 : {
36046 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36047 0 : PyObject *bigendian_obj = NULL;
36048 0 : PyObject *ndr64_obj = NULL;
36049 0 : libndr_flags ndr_push_flags = 0;
36050 :
36051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36052 : discard_const_p(char *, kwnames),
36053 : &bigendian_obj,
36054 : &ndr64_obj)) {
36055 0 : return NULL;
36056 : }
36057 :
36058 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36059 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36060 : }
36061 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36062 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36063 : }
36064 :
36065 0 : return py_lsa_GetUserName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36066 : }
36067 :
36068 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)
36069 : {
36070 294 : const struct ndr_interface_call *call = NULL;
36071 294 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
36072 294 : struct ndr_pull *pull = NULL;
36073 0 : enum ndr_err_code err;
36074 :
36075 294 : if (ndr_table_lsarpc.num_calls < 46) {
36076 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_unpack");
36077 0 : return NULL;
36078 : }
36079 294 : call = &ndr_table_lsarpc.calls[45];
36080 :
36081 294 : pull = ndr_pull_init_blob(blob, object);
36082 294 : if (pull == NULL) {
36083 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36084 0 : return NULL;
36085 : }
36086 :
36087 294 : pull->flags |= ndr_pull_flags;
36088 :
36089 294 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36090 294 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36091 0 : TALLOC_FREE(pull);
36092 0 : PyErr_SetNdrError(err);
36093 0 : return NULL;
36094 : }
36095 294 : if (!allow_remaining) {
36096 0 : uint32_t highest_ofs;
36097 :
36098 294 : if (pull->offset > pull->relative_highest_offset) {
36099 294 : highest_ofs = pull->offset;
36100 : } else {
36101 0 : highest_ofs = pull->relative_highest_offset;
36102 : }
36103 294 : if (highest_ofs < pull->data_size) {
36104 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36105 : "not all bytes consumed ofs[%u] size[%u]",
36106 : highest_ofs, pull->data_size);
36107 0 : TALLOC_FREE(pull);
36108 0 : PyErr_SetNdrError(err);
36109 0 : return NULL;
36110 : }
36111 : }
36112 :
36113 294 : TALLOC_FREE(pull);
36114 294 : Py_RETURN_NONE;
36115 : }
36116 :
36117 0 : static PyObject *py_lsa_GetUserName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36118 : {
36119 0 : DATA_BLOB blob;
36120 0 : Py_ssize_t blob_length = 0;
36121 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36122 0 : PyObject *bigendian_obj = NULL;
36123 0 : PyObject *ndr64_obj = NULL;
36124 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36125 0 : PyObject *allow_remaining_obj = NULL;
36126 0 : bool allow_remaining = false;
36127 :
36128 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36129 : discard_const_p(char *, kwnames),
36130 : &blob.data, &blob_length,
36131 : &bigendian_obj,
36132 : &ndr64_obj,
36133 : &allow_remaining_obj)) {
36134 0 : return NULL;
36135 : }
36136 0 : blob.length = blob_length;
36137 :
36138 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36139 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36140 : }
36141 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36142 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36143 : }
36144 :
36145 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36146 0 : allow_remaining = true;
36147 : }
36148 :
36149 0 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36150 : }
36151 :
36152 294 : static PyObject *py_lsa_GetUserName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36153 : {
36154 0 : DATA_BLOB blob;
36155 294 : Py_ssize_t blob_length = 0;
36156 294 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36157 294 : PyObject *bigendian_obj = NULL;
36158 294 : PyObject *ndr64_obj = NULL;
36159 294 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36160 294 : PyObject *allow_remaining_obj = NULL;
36161 294 : bool allow_remaining = false;
36162 :
36163 294 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36164 : discard_const_p(char *, kwnames),
36165 : &blob.data, &blob_length,
36166 : &bigendian_obj,
36167 : &ndr64_obj,
36168 : &allow_remaining_obj)) {
36169 0 : return NULL;
36170 : }
36171 294 : blob.length = blob_length;
36172 :
36173 294 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36174 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36175 : }
36176 294 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36177 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36178 : }
36179 :
36180 294 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36181 0 : allow_remaining = true;
36182 : }
36183 :
36184 294 : return py_lsa_GetUserName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36185 : }
36186 :
36187 0 : static PyObject *py_lsa_GetUserName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36188 : {
36189 0 : const struct ndr_interface_call *call = NULL;
36190 0 : struct lsa_GetUserName *object = pytalloc_get_ptr(py_obj);
36191 0 : PyObject *ret;
36192 0 : char *retstr;
36193 :
36194 0 : if (ndr_table_lsarpc.num_calls < 46) {
36195 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_GetUserName_ndr_print");
36196 0 : return NULL;
36197 : }
36198 0 : call = &ndr_table_lsarpc.calls[45];
36199 :
36200 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36201 0 : ret = PyUnicode_FromString(retstr);
36202 0 : TALLOC_FREE(retstr);
36203 :
36204 0 : return ret;
36205 : }
36206 :
36207 0 : static PyObject *py_lsa_GetUserName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36208 : {
36209 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_in", NDR_IN);
36210 : }
36211 :
36212 0 : static PyObject *py_lsa_GetUserName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36213 : {
36214 0 : return py_lsa_GetUserName_ndr_print(py_obj, "lsa_GetUserName_out", NDR_OUT);
36215 : }
36216 :
36217 : static PyMethodDef py_lsa_GetUserName_methods[] = {
36218 : { "opnum", (PyCFunction)py_lsa_GetUserName_ndr_opnum, METH_NOARGS|METH_CLASS,
36219 : "lsa.GetUserName.opnum() -> 45 (0x2d) " },
36220 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36221 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36222 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36223 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36224 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36225 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36226 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_GetUserName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36227 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36228 : { "__ndr_print_in__", (PyCFunction)py_lsa_GetUserName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36229 : { "__ndr_print_out__", (PyCFunction)py_lsa_GetUserName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36230 : { NULL, NULL, 0, NULL }
36231 : };
36232 :
36233 :
36234 : static PyTypeObject lsa_GetUserName_Type = {
36235 : PyVarObject_HEAD_INIT(NULL, 0)
36236 : .tp_name = "lsa.GetUserName",
36237 : .tp_getset = py_lsa_GetUserName_getsetters,
36238 : .tp_methods = py_lsa_GetUserName_methods,
36239 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36240 : .tp_new = py_lsa_GetUserName_new,
36241 : };
36242 :
36243 12 : static bool pack_py_lsa_GetUserName_args_in(PyObject *args, PyObject *kwargs, struct lsa_GetUserName *r)
36244 : {
36245 0 : PyObject *py_system_name;
36246 0 : PyObject *py_account_name;
36247 0 : PyObject *py_authority_name;
36248 12 : const char *kwnames[] = {
36249 : "system_name", "account_name", "authority_name", NULL
36250 : };
36251 :
36252 12 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_GetUserName", discard_const_p(char *, kwnames), &py_system_name, &py_account_name, &py_authority_name)) {
36253 0 : return false;
36254 : }
36255 :
36256 12 : if (py_system_name == NULL) {
36257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.system_name");
36258 0 : return false;
36259 : }
36260 12 : if (py_system_name == Py_None) {
36261 12 : r->in.system_name = NULL;
36262 : } else {
36263 0 : r->in.system_name = NULL;
36264 : {
36265 0 : const char *test_str;
36266 0 : const char *talloc_str;
36267 0 : PyObject *unicode = NULL;
36268 0 : if (PyUnicode_Check(py_system_name)) {
36269 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
36270 0 : if (unicode == NULL) {
36271 0 : return false;
36272 : }
36273 0 : test_str = PyBytes_AS_STRING(unicode);
36274 0 : } else if (PyBytes_Check(py_system_name)) {
36275 0 : test_str = PyBytes_AS_STRING(py_system_name);
36276 : } else {
36277 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
36278 0 : return false;
36279 : }
36280 0 : talloc_str = talloc_strdup(r, test_str);
36281 0 : if (unicode != NULL) {
36282 0 : Py_DECREF(unicode);
36283 : }
36284 0 : if (talloc_str == NULL) {
36285 0 : PyErr_NoMemory();
36286 0 : return false;
36287 : }
36288 0 : r->in.system_name = talloc_str;
36289 : }
36290 : }
36291 12 : if (py_account_name == NULL) {
36292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.account_name");
36293 0 : return false;
36294 : }
36295 12 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
36296 12 : if (r->in.account_name == NULL) {
36297 0 : PyErr_NoMemory();
36298 0 : return false;
36299 : }
36300 12 : if (py_account_name == Py_None) {
36301 12 : *r->in.account_name = NULL;
36302 : } else {
36303 0 : *r->in.account_name = NULL;
36304 0 : PY_CHECK_TYPE(&lsa_String_Type, py_account_name, return false;);
36305 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
36306 0 : PyErr_NoMemory();
36307 0 : return false;
36308 : }
36309 0 : *r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
36310 : }
36311 12 : if (py_authority_name == NULL) {
36312 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.authority_name");
36313 0 : return false;
36314 : }
36315 12 : if (py_authority_name == Py_None) {
36316 12 : r->in.authority_name = NULL;
36317 : } else {
36318 0 : r->in.authority_name = talloc_ptrtype(r, r->in.authority_name);
36319 0 : if (r->in.authority_name == NULL) {
36320 0 : PyErr_NoMemory();
36321 0 : return false;
36322 : }
36323 0 : py_authority_name = py_dcerpc_ndr_pointer_deref(ndr_pointer_Type, py_authority_name);
36324 0 : if (py_authority_name == NULL) {
36325 0 : return false;
36326 : }
36327 0 : if (py_authority_name == Py_None) {
36328 0 : *r->in.authority_name = NULL;
36329 : } else {
36330 0 : *r->in.authority_name = NULL;
36331 0 : PY_CHECK_TYPE(&lsa_String_Type, py_authority_name, return false;);
36332 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_authority_name)) == NULL) {
36333 0 : PyErr_NoMemory();
36334 0 : return false;
36335 : }
36336 0 : *r->in.authority_name = (struct lsa_String *)pytalloc_get_ptr(py_authority_name);
36337 : }
36338 : }
36339 12 : return true;
36340 : }
36341 :
36342 12 : static PyObject *unpack_py_lsa_GetUserName_args_out(struct lsa_GetUserName *r)
36343 : {
36344 0 : PyObject *result;
36345 0 : PyObject *py_account_name;
36346 0 : PyObject *py_authority_name;
36347 12 : result = PyTuple_New(2);
36348 12 : if (*r->out.account_name == NULL) {
36349 0 : py_account_name = Py_None;
36350 0 : Py_INCREF(py_account_name);
36351 : } else {
36352 12 : py_account_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.account_name, *r->out.account_name);
36353 : }
36354 12 : PyTuple_SetItem(result, 0, py_account_name);
36355 12 : if (r->out.authority_name == NULL) {
36356 12 : py_authority_name = Py_None;
36357 9 : Py_INCREF(py_authority_name);
36358 : } else {
36359 0 : if (*r->out.authority_name == NULL) {
36360 0 : py_authority_name = Py_None;
36361 0 : Py_INCREF(py_authority_name);
36362 : } else {
36363 0 : py_authority_name = pytalloc_reference_ex(&lsa_String_Type, *r->out.authority_name, *r->out.authority_name);
36364 : }
36365 : }
36366 : {
36367 12 : PyObject *py_authority_name_level_0 = py_authority_name;
36368 12 : py_authority_name = py_dcerpc_ndr_pointer_wrap(ndr_pointer_Type, py_authority_name_level_0);
36369 12 : Py_XDECREF(py_authority_name_level_0);
36370 : }
36371 12 : PyTuple_SetItem(result, 1, py_authority_name);
36372 12 : if (NT_STATUS_IS_ERR(r->out.result)) {
36373 0 : PyErr_SetNTSTATUS(r->out.result);
36374 0 : return NULL;
36375 : }
36376 :
36377 12 : return result;
36378 : }
36379 :
36380 :
36381 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
36382 : {
36383 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(obj);
36384 0 : PyObject *py_handle;
36385 0 : if (object->in.handle == NULL) {
36386 0 : Py_RETURN_NONE;
36387 : }
36388 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36389 0 : return py_handle;
36390 : }
36391 :
36392 0 : static int py_lsa_QueryInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36393 : {
36394 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36395 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36396 0 : if (value == NULL) {
36397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
36398 0 : return -1;
36399 : }
36400 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36401 0 : if (object->in.handle == NULL) {
36402 0 : PyErr_NoMemory();
36403 0 : return -1;
36404 : }
36405 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36406 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36407 0 : PyErr_NoMemory();
36408 0 : return -1;
36409 : }
36410 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36411 0 : return 0;
36412 : }
36413 :
36414 0 : static PyObject *py_lsa_QueryInfoPolicy2_in_get_level(PyObject *obj, void *closure)
36415 : {
36416 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(obj);
36417 0 : PyObject *py_level;
36418 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
36419 0 : return py_level;
36420 : }
36421 :
36422 0 : static int py_lsa_QueryInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36423 : {
36424 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36425 0 : if (value == NULL) {
36426 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
36427 0 : return -1;
36428 : }
36429 : {
36430 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36431 0 : if (PyLong_Check(value)) {
36432 0 : unsigned long long test_var;
36433 0 : test_var = PyLong_AsUnsignedLongLong(value);
36434 0 : if (PyErr_Occurred() != NULL) {
36435 0 : return -1;
36436 : }
36437 0 : if (test_var > uint_max) {
36438 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36439 : PyLong_Type.tp_name, uint_max, test_var);
36440 0 : return -1;
36441 : }
36442 0 : object->in.level = test_var;
36443 : } else {
36444 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36445 : PyLong_Type.tp_name);
36446 0 : return -1;
36447 : }
36448 : }
36449 0 : return 0;
36450 : }
36451 :
36452 0 : static PyObject *py_lsa_QueryInfoPolicy2_out_get_info(PyObject *obj, void *closure)
36453 : {
36454 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(obj);
36455 0 : PyObject *py_info;
36456 0 : if (object->out.info == NULL) {
36457 0 : Py_RETURN_NONE;
36458 : }
36459 0 : if (*object->out.info == NULL) {
36460 0 : py_info = Py_None;
36461 0 : Py_INCREF(py_info);
36462 : } else {
36463 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_PolicyInformation");
36464 0 : if (py_info == NULL) {
36465 0 : return NULL;
36466 : }
36467 : }
36468 0 : return py_info;
36469 : }
36470 :
36471 0 : static int py_lsa_QueryInfoPolicy2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
36472 : {
36473 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36474 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
36475 0 : if (value == NULL) {
36476 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
36477 0 : return -1;
36478 : }
36479 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
36480 0 : if (object->out.info == NULL) {
36481 0 : PyErr_NoMemory();
36482 0 : return -1;
36483 : }
36484 0 : if (value == Py_None) {
36485 0 : *object->out.info = NULL;
36486 : } else {
36487 0 : *object->out.info = NULL;
36488 : {
36489 0 : union lsa_PolicyInformation *info_switch_2;
36490 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");
36491 0 : if (info_switch_2 == NULL) {
36492 0 : return -1;
36493 : }
36494 0 : *object->out.info = info_switch_2;
36495 : }
36496 : }
36497 0 : return 0;
36498 : }
36499 :
36500 0 : static PyObject *py_lsa_QueryInfoPolicy2_get_result(PyObject *obj, void *closure)
36501 : {
36502 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(obj);
36503 0 : PyObject *py_result;
36504 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36505 0 : return py_result;
36506 : }
36507 :
36508 0 : static int py_lsa_QueryInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
36509 : {
36510 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36511 0 : if (value == NULL) {
36512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
36513 0 : return -1;
36514 : }
36515 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36516 0 : return 0;
36517 : }
36518 :
36519 : static PyGetSetDef py_lsa_QueryInfoPolicy2_getsetters[] = {
36520 : {
36521 : .name = discard_const_p(char, "in_handle"),
36522 : .get = py_lsa_QueryInfoPolicy2_in_get_handle,
36523 : .set = py_lsa_QueryInfoPolicy2_in_set_handle,
36524 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36525 : },
36526 : {
36527 : .name = discard_const_p(char, "in_level"),
36528 : .get = py_lsa_QueryInfoPolicy2_in_get_level,
36529 : .set = py_lsa_QueryInfoPolicy2_in_set_level,
36530 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
36531 : },
36532 : {
36533 : .name = discard_const_p(char, "out_info"),
36534 : .get = py_lsa_QueryInfoPolicy2_out_get_info,
36535 : .set = py_lsa_QueryInfoPolicy2_out_set_info,
36536 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
36537 : },
36538 : {
36539 : .name = discard_const_p(char, "result"),
36540 : .get = py_lsa_QueryInfoPolicy2_get_result,
36541 : .set = py_lsa_QueryInfoPolicy2_set_result,
36542 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36543 : },
36544 : { .name = NULL }
36545 : };
36546 :
36547 0 : static PyObject *py_lsa_QueryInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36548 : {
36549 0 : PyObject *self = pytalloc_new(struct lsa_QueryInfoPolicy2, type);
36550 0 : struct lsa_QueryInfoPolicy2 *_self = (struct lsa_QueryInfoPolicy2 *)pytalloc_get_ptr(self);
36551 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36552 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
36553 : /* a pointer to a NULL pointer */
36554 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
36555 0 : return self;
36556 : }
36557 :
36558 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36559 : {
36560 :
36561 :
36562 0 : return PyLong_FromLong(46);
36563 : }
36564 :
36565 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36566 : {
36567 0 : const struct ndr_interface_call *call = NULL;
36568 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36569 0 : PyObject *ret = NULL;
36570 0 : struct ndr_push *push = NULL;
36571 0 : DATA_BLOB blob;
36572 0 : enum ndr_err_code err;
36573 :
36574 0 : if (ndr_table_lsarpc.num_calls < 47) {
36575 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_pack");
36576 0 : return NULL;
36577 : }
36578 0 : call = &ndr_table_lsarpc.calls[46];
36579 :
36580 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36581 0 : if (push == NULL) {
36582 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36583 0 : return NULL;
36584 : }
36585 :
36586 0 : push->flags |= ndr_push_flags;
36587 :
36588 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36589 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36590 0 : TALLOC_FREE(push);
36591 0 : PyErr_SetNdrError(err);
36592 0 : return NULL;
36593 : }
36594 0 : blob = ndr_push_blob(push);
36595 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36596 0 : TALLOC_FREE(push);
36597 0 : return ret;
36598 : }
36599 :
36600 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36601 : {
36602 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36603 0 : PyObject *bigendian_obj = NULL;
36604 0 : PyObject *ndr64_obj = NULL;
36605 0 : libndr_flags ndr_push_flags = 0;
36606 :
36607 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36608 : discard_const_p(char *, kwnames),
36609 : &bigendian_obj,
36610 : &ndr64_obj)) {
36611 0 : return NULL;
36612 : }
36613 :
36614 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36615 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36616 : }
36617 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36618 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36619 : }
36620 :
36621 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36622 : }
36623 :
36624 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36625 : {
36626 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36627 0 : PyObject *bigendian_obj = NULL;
36628 0 : PyObject *ndr64_obj = NULL;
36629 0 : libndr_flags ndr_push_flags = 0;
36630 :
36631 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36632 : discard_const_p(char *, kwnames),
36633 : &bigendian_obj,
36634 : &ndr64_obj)) {
36635 0 : return NULL;
36636 : }
36637 :
36638 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36639 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36640 : }
36641 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36642 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36643 : }
36644 :
36645 0 : return py_lsa_QueryInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36646 : }
36647 :
36648 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)
36649 : {
36650 0 : const struct ndr_interface_call *call = NULL;
36651 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36652 0 : struct ndr_pull *pull = NULL;
36653 0 : enum ndr_err_code err;
36654 :
36655 0 : if (ndr_table_lsarpc.num_calls < 47) {
36656 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_unpack");
36657 0 : return NULL;
36658 : }
36659 0 : call = &ndr_table_lsarpc.calls[46];
36660 :
36661 0 : pull = ndr_pull_init_blob(blob, object);
36662 0 : if (pull == NULL) {
36663 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36664 0 : return NULL;
36665 : }
36666 :
36667 0 : pull->flags |= ndr_pull_flags;
36668 :
36669 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36670 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36671 0 : TALLOC_FREE(pull);
36672 0 : PyErr_SetNdrError(err);
36673 0 : return NULL;
36674 : }
36675 0 : if (!allow_remaining) {
36676 0 : uint32_t highest_ofs;
36677 :
36678 0 : if (pull->offset > pull->relative_highest_offset) {
36679 0 : highest_ofs = pull->offset;
36680 : } else {
36681 0 : highest_ofs = pull->relative_highest_offset;
36682 : }
36683 0 : if (highest_ofs < pull->data_size) {
36684 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36685 : "not all bytes consumed ofs[%u] size[%u]",
36686 : highest_ofs, pull->data_size);
36687 0 : TALLOC_FREE(pull);
36688 0 : PyErr_SetNdrError(err);
36689 0 : return NULL;
36690 : }
36691 : }
36692 :
36693 0 : TALLOC_FREE(pull);
36694 0 : Py_RETURN_NONE;
36695 : }
36696 :
36697 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36698 : {
36699 0 : DATA_BLOB blob;
36700 0 : Py_ssize_t blob_length = 0;
36701 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36702 0 : PyObject *bigendian_obj = NULL;
36703 0 : PyObject *ndr64_obj = NULL;
36704 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36705 0 : PyObject *allow_remaining_obj = NULL;
36706 0 : bool allow_remaining = false;
36707 :
36708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36709 : discard_const_p(char *, kwnames),
36710 : &blob.data, &blob_length,
36711 : &bigendian_obj,
36712 : &ndr64_obj,
36713 : &allow_remaining_obj)) {
36714 0 : return NULL;
36715 : }
36716 0 : blob.length = blob_length;
36717 :
36718 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36719 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36720 : }
36721 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36722 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36723 : }
36724 :
36725 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36726 0 : allow_remaining = true;
36727 : }
36728 :
36729 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36730 : }
36731 :
36732 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36733 : {
36734 0 : DATA_BLOB blob;
36735 0 : Py_ssize_t blob_length = 0;
36736 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36737 0 : PyObject *bigendian_obj = NULL;
36738 0 : PyObject *ndr64_obj = NULL;
36739 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36740 0 : PyObject *allow_remaining_obj = NULL;
36741 0 : bool allow_remaining = false;
36742 :
36743 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36744 : discard_const_p(char *, kwnames),
36745 : &blob.data, &blob_length,
36746 : &bigendian_obj,
36747 : &ndr64_obj,
36748 : &allow_remaining_obj)) {
36749 0 : return NULL;
36750 : }
36751 0 : blob.length = blob_length;
36752 :
36753 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36754 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36755 : }
36756 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36757 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36758 : }
36759 :
36760 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36761 0 : allow_remaining = true;
36762 : }
36763 :
36764 0 : return py_lsa_QueryInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36765 : }
36766 :
36767 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36768 : {
36769 0 : const struct ndr_interface_call *call = NULL;
36770 0 : struct lsa_QueryInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36771 0 : PyObject *ret;
36772 0 : char *retstr;
36773 :
36774 0 : if (ndr_table_lsarpc.num_calls < 47) {
36775 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryInfoPolicy2_ndr_print");
36776 0 : return NULL;
36777 : }
36778 0 : call = &ndr_table_lsarpc.calls[46];
36779 :
36780 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36781 0 : ret = PyUnicode_FromString(retstr);
36782 0 : TALLOC_FREE(retstr);
36783 :
36784 0 : return ret;
36785 : }
36786 :
36787 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36788 : {
36789 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_in", NDR_IN);
36790 : }
36791 :
36792 0 : static PyObject *py_lsa_QueryInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36793 : {
36794 0 : return py_lsa_QueryInfoPolicy2_ndr_print(py_obj, "lsa_QueryInfoPolicy2_out", NDR_OUT);
36795 : }
36796 :
36797 : static PyMethodDef py_lsa_QueryInfoPolicy2_methods[] = {
36798 : { "opnum", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
36799 : "lsa.QueryInfoPolicy2.opnum() -> 46 (0x2e) " },
36800 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36801 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36802 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36803 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36804 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36805 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36806 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36807 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36808 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36809 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36810 : { NULL, NULL, 0, NULL }
36811 : };
36812 :
36813 :
36814 : static PyTypeObject lsa_QueryInfoPolicy2_Type = {
36815 : PyVarObject_HEAD_INIT(NULL, 0)
36816 : .tp_name = "lsa.QueryInfoPolicy2",
36817 : .tp_getset = py_lsa_QueryInfoPolicy2_getsetters,
36818 : .tp_methods = py_lsa_QueryInfoPolicy2_methods,
36819 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36820 : .tp_new = py_lsa_QueryInfoPolicy2_new,
36821 : };
36822 :
36823 223 : static bool pack_py_lsa_QueryInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryInfoPolicy2 *r)
36824 : {
36825 2 : PyObject *py_handle;
36826 2 : PyObject *py_level;
36827 223 : const char *kwnames[] = {
36828 : "handle", "level", NULL
36829 : };
36830 :
36831 223 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
36832 0 : return false;
36833 : }
36834 :
36835 223 : if (py_handle == NULL) {
36836 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
36837 0 : return false;
36838 : }
36839 223 : r->in.handle = talloc_ptrtype(r, r->in.handle);
36840 223 : if (r->in.handle == NULL) {
36841 0 : PyErr_NoMemory();
36842 0 : return false;
36843 : }
36844 223 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
36845 223 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
36846 0 : PyErr_NoMemory();
36847 0 : return false;
36848 : }
36849 223 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
36850 223 : if (py_level == NULL) {
36851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
36852 0 : return false;
36853 : }
36854 : {
36855 223 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36856 223 : if (PyLong_Check(py_level)) {
36857 2 : unsigned long long test_var;
36858 223 : test_var = PyLong_AsUnsignedLongLong(py_level);
36859 223 : if (PyErr_Occurred() != NULL) {
36860 0 : return false;
36861 : }
36862 223 : if (test_var > uint_max) {
36863 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36864 : PyLong_Type.tp_name, uint_max, test_var);
36865 0 : return false;
36866 : }
36867 223 : r->in.level = test_var;
36868 : } else {
36869 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36870 : PyLong_Type.tp_name);
36871 0 : return false;
36872 : }
36873 : }
36874 223 : return true;
36875 : }
36876 :
36877 223 : static PyObject *unpack_py_lsa_QueryInfoPolicy2_args_out(struct lsa_QueryInfoPolicy2 *r)
36878 : {
36879 2 : PyObject *result;
36880 2 : PyObject *py_info;
36881 223 : if (*r->out.info == NULL) {
36882 0 : py_info = Py_None;
36883 0 : Py_INCREF(py_info);
36884 : } else {
36885 223 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_PolicyInformation");
36886 223 : if (py_info == NULL) {
36887 0 : return NULL;
36888 : }
36889 : }
36890 223 : result = py_info;
36891 223 : if (NT_STATUS_IS_ERR(r->out.result)) {
36892 0 : PyErr_SetNTSTATUS(r->out.result);
36893 0 : return NULL;
36894 : }
36895 :
36896 221 : return result;
36897 : }
36898 :
36899 :
36900 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_handle(PyObject *obj, void *closure)
36901 : {
36902 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(obj);
36903 0 : PyObject *py_handle;
36904 0 : if (object->in.handle == NULL) {
36905 0 : Py_RETURN_NONE;
36906 : }
36907 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
36908 0 : return py_handle;
36909 : }
36910 :
36911 0 : static int py_lsa_SetInfoPolicy2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
36912 : {
36913 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36914 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
36915 0 : if (value == NULL) {
36916 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
36917 0 : return -1;
36918 : }
36919 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
36920 0 : if (object->in.handle == NULL) {
36921 0 : PyErr_NoMemory();
36922 0 : return -1;
36923 : }
36924 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36925 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36926 0 : PyErr_NoMemory();
36927 0 : return -1;
36928 : }
36929 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
36930 0 : return 0;
36931 : }
36932 :
36933 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_level(PyObject *obj, void *closure)
36934 : {
36935 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(obj);
36936 0 : PyObject *py_level;
36937 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
36938 0 : return py_level;
36939 : }
36940 :
36941 0 : static int py_lsa_SetInfoPolicy2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
36942 : {
36943 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36944 0 : if (value == NULL) {
36945 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
36946 0 : return -1;
36947 : }
36948 : {
36949 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
36950 0 : if (PyLong_Check(value)) {
36951 0 : unsigned long long test_var;
36952 0 : test_var = PyLong_AsUnsignedLongLong(value);
36953 0 : if (PyErr_Occurred() != NULL) {
36954 0 : return -1;
36955 : }
36956 0 : if (test_var > uint_max) {
36957 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36958 : PyLong_Type.tp_name, uint_max, test_var);
36959 0 : return -1;
36960 : }
36961 0 : object->in.level = test_var;
36962 : } else {
36963 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36964 : PyLong_Type.tp_name);
36965 0 : return -1;
36966 : }
36967 : }
36968 0 : return 0;
36969 : }
36970 :
36971 0 : static PyObject *py_lsa_SetInfoPolicy2_in_get_info(PyObject *obj, void *closure)
36972 : {
36973 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(obj);
36974 0 : PyObject *py_info;
36975 0 : if (object->in.info == NULL) {
36976 0 : Py_RETURN_NONE;
36977 : }
36978 0 : py_info = pyrpc_import_union(&lsa_PolicyInformation_Type, object->in.info, object->in.level, object->in.info, "union lsa_PolicyInformation");
36979 0 : if (py_info == NULL) {
36980 0 : return NULL;
36981 : }
36982 0 : return py_info;
36983 : }
36984 :
36985 0 : static int py_lsa_SetInfoPolicy2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
36986 : {
36987 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
36988 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
36989 0 : if (value == NULL) {
36990 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
36991 0 : return -1;
36992 : }
36993 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
36994 0 : if (object->in.info == NULL) {
36995 0 : PyErr_NoMemory();
36996 0 : return -1;
36997 : }
36998 : {
36999 0 : union lsa_PolicyInformation *info_switch_1;
37000 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");
37001 0 : if (info_switch_1 == NULL) {
37002 0 : return -1;
37003 : }
37004 0 : object->in.info = info_switch_1;
37005 : }
37006 0 : return 0;
37007 : }
37008 :
37009 0 : static PyObject *py_lsa_SetInfoPolicy2_get_result(PyObject *obj, void *closure)
37010 : {
37011 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(obj);
37012 0 : PyObject *py_result;
37013 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37014 0 : return py_result;
37015 : }
37016 :
37017 0 : static int py_lsa_SetInfoPolicy2_set_result(PyObject *py_obj, PyObject *value, void *closure)
37018 : {
37019 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
37020 0 : if (value == NULL) {
37021 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
37022 0 : return -1;
37023 : }
37024 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37025 0 : return 0;
37026 : }
37027 :
37028 : static PyGetSetDef py_lsa_SetInfoPolicy2_getsetters[] = {
37029 : {
37030 : .name = discard_const_p(char, "in_handle"),
37031 : .get = py_lsa_SetInfoPolicy2_in_get_handle,
37032 : .set = py_lsa_SetInfoPolicy2_in_set_handle,
37033 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37034 : },
37035 : {
37036 : .name = discard_const_p(char, "in_level"),
37037 : .get = py_lsa_SetInfoPolicy2_in_get_level,
37038 : .set = py_lsa_SetInfoPolicy2_in_set_level,
37039 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInfo")
37040 : },
37041 : {
37042 : .name = discard_const_p(char, "in_info"),
37043 : .get = py_lsa_SetInfoPolicy2_in_get_info,
37044 : .set = py_lsa_SetInfoPolicy2_in_set_info,
37045 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyInformation")
37046 : },
37047 : {
37048 : .name = discard_const_p(char, "result"),
37049 : .get = py_lsa_SetInfoPolicy2_get_result,
37050 : .set = py_lsa_SetInfoPolicy2_set_result,
37051 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37052 : },
37053 : { .name = NULL }
37054 : };
37055 :
37056 0 : static PyObject *py_lsa_SetInfoPolicy2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37057 : {
37058 0 : PyObject *self = pytalloc_new(struct lsa_SetInfoPolicy2, type);
37059 0 : struct lsa_SetInfoPolicy2 *_self = (struct lsa_SetInfoPolicy2 *)pytalloc_get_ptr(self);
37060 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37061 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
37062 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_PolicyInformation);
37063 0 : return self;
37064 : }
37065 :
37066 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37067 : {
37068 :
37069 :
37070 0 : return PyLong_FromLong(47);
37071 : }
37072 :
37073 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37074 : {
37075 0 : const struct ndr_interface_call *call = NULL;
37076 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
37077 0 : PyObject *ret = NULL;
37078 0 : struct ndr_push *push = NULL;
37079 0 : DATA_BLOB blob;
37080 0 : enum ndr_err_code err;
37081 :
37082 0 : if (ndr_table_lsarpc.num_calls < 48) {
37083 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_pack");
37084 0 : return NULL;
37085 : }
37086 0 : call = &ndr_table_lsarpc.calls[47];
37087 :
37088 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37089 0 : if (push == NULL) {
37090 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37091 0 : return NULL;
37092 : }
37093 :
37094 0 : push->flags |= ndr_push_flags;
37095 :
37096 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37097 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37098 0 : TALLOC_FREE(push);
37099 0 : PyErr_SetNdrError(err);
37100 0 : return NULL;
37101 : }
37102 0 : blob = ndr_push_blob(push);
37103 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37104 0 : TALLOC_FREE(push);
37105 0 : return ret;
37106 : }
37107 :
37108 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37109 : {
37110 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37111 0 : PyObject *bigendian_obj = NULL;
37112 0 : PyObject *ndr64_obj = NULL;
37113 0 : libndr_flags ndr_push_flags = 0;
37114 :
37115 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37116 : discard_const_p(char *, kwnames),
37117 : &bigendian_obj,
37118 : &ndr64_obj)) {
37119 0 : return NULL;
37120 : }
37121 :
37122 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37123 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37124 : }
37125 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37126 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37127 : }
37128 :
37129 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37130 : }
37131 :
37132 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37133 : {
37134 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37135 0 : PyObject *bigendian_obj = NULL;
37136 0 : PyObject *ndr64_obj = NULL;
37137 0 : libndr_flags ndr_push_flags = 0;
37138 :
37139 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37140 : discard_const_p(char *, kwnames),
37141 : &bigendian_obj,
37142 : &ndr64_obj)) {
37143 0 : return NULL;
37144 : }
37145 :
37146 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37147 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37148 : }
37149 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37150 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37151 : }
37152 :
37153 0 : return py_lsa_SetInfoPolicy2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37154 : }
37155 :
37156 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)
37157 : {
37158 0 : const struct ndr_interface_call *call = NULL;
37159 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
37160 0 : struct ndr_pull *pull = NULL;
37161 0 : enum ndr_err_code err;
37162 :
37163 0 : if (ndr_table_lsarpc.num_calls < 48) {
37164 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_unpack");
37165 0 : return NULL;
37166 : }
37167 0 : call = &ndr_table_lsarpc.calls[47];
37168 :
37169 0 : pull = ndr_pull_init_blob(blob, object);
37170 0 : if (pull == NULL) {
37171 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37172 0 : return NULL;
37173 : }
37174 :
37175 0 : pull->flags |= ndr_pull_flags;
37176 :
37177 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37178 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37179 0 : TALLOC_FREE(pull);
37180 0 : PyErr_SetNdrError(err);
37181 0 : return NULL;
37182 : }
37183 0 : if (!allow_remaining) {
37184 0 : uint32_t highest_ofs;
37185 :
37186 0 : if (pull->offset > pull->relative_highest_offset) {
37187 0 : highest_ofs = pull->offset;
37188 : } else {
37189 0 : highest_ofs = pull->relative_highest_offset;
37190 : }
37191 0 : if (highest_ofs < pull->data_size) {
37192 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37193 : "not all bytes consumed ofs[%u] size[%u]",
37194 : highest_ofs, pull->data_size);
37195 0 : TALLOC_FREE(pull);
37196 0 : PyErr_SetNdrError(err);
37197 0 : return NULL;
37198 : }
37199 : }
37200 :
37201 0 : TALLOC_FREE(pull);
37202 0 : Py_RETURN_NONE;
37203 : }
37204 :
37205 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37206 : {
37207 0 : DATA_BLOB blob;
37208 0 : Py_ssize_t blob_length = 0;
37209 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37210 0 : PyObject *bigendian_obj = NULL;
37211 0 : PyObject *ndr64_obj = NULL;
37212 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37213 0 : PyObject *allow_remaining_obj = NULL;
37214 0 : bool allow_remaining = false;
37215 :
37216 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37217 : discard_const_p(char *, kwnames),
37218 : &blob.data, &blob_length,
37219 : &bigendian_obj,
37220 : &ndr64_obj,
37221 : &allow_remaining_obj)) {
37222 0 : return NULL;
37223 : }
37224 0 : blob.length = blob_length;
37225 :
37226 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37227 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37228 : }
37229 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37230 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37231 : }
37232 :
37233 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37234 0 : allow_remaining = true;
37235 : }
37236 :
37237 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37238 : }
37239 :
37240 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37241 : {
37242 0 : DATA_BLOB blob;
37243 0 : Py_ssize_t blob_length = 0;
37244 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37245 0 : PyObject *bigendian_obj = NULL;
37246 0 : PyObject *ndr64_obj = NULL;
37247 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37248 0 : PyObject *allow_remaining_obj = NULL;
37249 0 : bool allow_remaining = false;
37250 :
37251 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37252 : discard_const_p(char *, kwnames),
37253 : &blob.data, &blob_length,
37254 : &bigendian_obj,
37255 : &ndr64_obj,
37256 : &allow_remaining_obj)) {
37257 0 : return NULL;
37258 : }
37259 0 : blob.length = blob_length;
37260 :
37261 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37262 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37263 : }
37264 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37265 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37266 : }
37267 :
37268 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37269 0 : allow_remaining = true;
37270 : }
37271 :
37272 0 : return py_lsa_SetInfoPolicy2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37273 : }
37274 :
37275 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37276 : {
37277 0 : const struct ndr_interface_call *call = NULL;
37278 0 : struct lsa_SetInfoPolicy2 *object = pytalloc_get_ptr(py_obj);
37279 0 : PyObject *ret;
37280 0 : char *retstr;
37281 :
37282 0 : if (ndr_table_lsarpc.num_calls < 48) {
37283 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetInfoPolicy2_ndr_print");
37284 0 : return NULL;
37285 : }
37286 0 : call = &ndr_table_lsarpc.calls[47];
37287 :
37288 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37289 0 : ret = PyUnicode_FromString(retstr);
37290 0 : TALLOC_FREE(retstr);
37291 :
37292 0 : return ret;
37293 : }
37294 :
37295 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37296 : {
37297 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_in", NDR_IN);
37298 : }
37299 :
37300 0 : static PyObject *py_lsa_SetInfoPolicy2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37301 : {
37302 0 : return py_lsa_SetInfoPolicy2_ndr_print(py_obj, "lsa_SetInfoPolicy2_out", NDR_OUT);
37303 : }
37304 :
37305 : static PyMethodDef py_lsa_SetInfoPolicy2_methods[] = {
37306 : { "opnum", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_opnum, METH_NOARGS|METH_CLASS,
37307 : "lsa.SetInfoPolicy2.opnum() -> 47 (0x2f) " },
37308 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37309 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37310 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37311 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37312 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37313 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37314 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetInfoPolicy2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37315 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37316 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37317 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetInfoPolicy2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37318 : { NULL, NULL, 0, NULL }
37319 : };
37320 :
37321 :
37322 : static PyTypeObject lsa_SetInfoPolicy2_Type = {
37323 : PyVarObject_HEAD_INIT(NULL, 0)
37324 : .tp_name = "lsa.SetInfoPolicy2",
37325 : .tp_getset = py_lsa_SetInfoPolicy2_getsetters,
37326 : .tp_methods = py_lsa_SetInfoPolicy2_methods,
37327 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37328 : .tp_new = py_lsa_SetInfoPolicy2_new,
37329 : };
37330 :
37331 0 : static bool pack_py_lsa_SetInfoPolicy2_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetInfoPolicy2 *r)
37332 : {
37333 0 : PyObject *py_handle;
37334 0 : PyObject *py_level;
37335 0 : PyObject *py_info;
37336 0 : const char *kwnames[] = {
37337 : "handle", "level", "info", NULL
37338 : };
37339 :
37340 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetInfoPolicy2", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
37341 0 : return false;
37342 : }
37343 :
37344 0 : if (py_handle == NULL) {
37345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
37346 0 : return false;
37347 : }
37348 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37349 0 : if (r->in.handle == NULL) {
37350 0 : PyErr_NoMemory();
37351 0 : return false;
37352 : }
37353 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37354 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37355 0 : PyErr_NoMemory();
37356 0 : return false;
37357 : }
37358 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37359 0 : if (py_level == NULL) {
37360 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
37361 0 : return false;
37362 : }
37363 : {
37364 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
37365 0 : if (PyLong_Check(py_level)) {
37366 0 : unsigned long long test_var;
37367 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
37368 0 : if (PyErr_Occurred() != NULL) {
37369 0 : return false;
37370 : }
37371 0 : if (test_var > uint_max) {
37372 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37373 : PyLong_Type.tp_name, uint_max, test_var);
37374 0 : return false;
37375 : }
37376 0 : r->in.level = test_var;
37377 : } else {
37378 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37379 : PyLong_Type.tp_name);
37380 0 : return false;
37381 : }
37382 : }
37383 0 : if (py_info == NULL) {
37384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
37385 0 : return false;
37386 : }
37387 0 : r->in.info = talloc_ptrtype(r, r->in.info);
37388 0 : if (r->in.info == NULL) {
37389 0 : PyErr_NoMemory();
37390 0 : return false;
37391 : }
37392 : {
37393 0 : union lsa_PolicyInformation *info_switch_1;
37394 0 : info_switch_1 = (union lsa_PolicyInformation *)pyrpc_export_union(&lsa_PolicyInformation_Type, r, r->in.level, py_info, "union lsa_PolicyInformation");
37395 0 : if (info_switch_1 == NULL) {
37396 0 : return false;
37397 : }
37398 0 : r->in.info = info_switch_1;
37399 : }
37400 0 : return true;
37401 : }
37402 :
37403 0 : static PyObject *unpack_py_lsa_SetInfoPolicy2_args_out(struct lsa_SetInfoPolicy2 *r)
37404 : {
37405 0 : PyObject *result;
37406 0 : result = Py_None;
37407 0 : Py_INCREF(result);
37408 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37409 0 : PyErr_SetNTSTATUS(r->out.result);
37410 0 : return NULL;
37411 : }
37412 :
37413 0 : return result;
37414 : }
37415 :
37416 :
37417 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
37418 : {
37419 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37420 0 : PyObject *py_handle;
37421 0 : if (object->in.handle == NULL) {
37422 0 : Py_RETURN_NONE;
37423 : }
37424 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
37425 0 : return py_handle;
37426 : }
37427 :
37428 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
37429 : {
37430 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37431 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
37432 0 : if (value == NULL) {
37433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
37434 0 : return -1;
37435 : }
37436 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
37437 0 : if (object->in.handle == NULL) {
37438 0 : PyErr_NoMemory();
37439 0 : return -1;
37440 : }
37441 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37442 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37443 0 : PyErr_NoMemory();
37444 0 : return -1;
37445 : }
37446 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
37447 0 : return 0;
37448 : }
37449 :
37450 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
37451 : {
37452 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37453 0 : PyObject *py_trusted_domain;
37454 0 : if (object->in.trusted_domain == NULL) {
37455 0 : Py_RETURN_NONE;
37456 : }
37457 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
37458 0 : return py_trusted_domain;
37459 : }
37460 :
37461 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
37462 : {
37463 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37464 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
37465 0 : if (value == NULL) {
37466 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain");
37467 0 : return -1;
37468 : }
37469 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
37470 0 : if (object->in.trusted_domain == NULL) {
37471 0 : PyErr_NoMemory();
37472 0 : return -1;
37473 : }
37474 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
37475 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37476 0 : PyErr_NoMemory();
37477 0 : return -1;
37478 : }
37479 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
37480 0 : return 0;
37481 : }
37482 :
37483 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
37484 : {
37485 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37486 0 : PyObject *py_level;
37487 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
37488 0 : return py_level;
37489 : }
37490 :
37491 0 : static int py_lsa_QueryTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
37492 : {
37493 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37494 0 : if (value == NULL) {
37495 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
37496 0 : return -1;
37497 : }
37498 : {
37499 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
37500 0 : if (PyLong_Check(value)) {
37501 0 : unsigned long long test_var;
37502 0 : test_var = PyLong_AsUnsignedLongLong(value);
37503 0 : if (PyErr_Occurred() != NULL) {
37504 0 : return -1;
37505 : }
37506 0 : if (test_var > uint_max) {
37507 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37508 : PyLong_Type.tp_name, uint_max, test_var);
37509 0 : return -1;
37510 : }
37511 0 : object->in.level = test_var;
37512 : } else {
37513 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37514 : PyLong_Type.tp_name);
37515 0 : return -1;
37516 : }
37517 : }
37518 0 : return 0;
37519 : }
37520 :
37521 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_out_get_info(PyObject *obj, void *closure)
37522 : {
37523 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37524 0 : PyObject *py_info;
37525 0 : if (object->out.info == NULL) {
37526 0 : Py_RETURN_NONE;
37527 : }
37528 0 : if (*object->out.info == NULL) {
37529 0 : py_info = Py_None;
37530 0 : Py_INCREF(py_info);
37531 : } else {
37532 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_TrustedDomainInfo");
37533 0 : if (py_info == NULL) {
37534 0 : return NULL;
37535 : }
37536 : }
37537 0 : return py_info;
37538 : }
37539 :
37540 0 : static int py_lsa_QueryTrustedDomainInfoByName_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
37541 : {
37542 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37543 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
37544 0 : if (value == NULL) {
37545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
37546 0 : return -1;
37547 : }
37548 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
37549 0 : if (object->out.info == NULL) {
37550 0 : PyErr_NoMemory();
37551 0 : return -1;
37552 : }
37553 0 : if (value == Py_None) {
37554 0 : *object->out.info = NULL;
37555 : } else {
37556 0 : *object->out.info = NULL;
37557 : {
37558 0 : union lsa_TrustedDomainInfo *info_switch_2;
37559 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");
37560 0 : if (info_switch_2 == NULL) {
37561 0 : return -1;
37562 : }
37563 0 : *object->out.info = info_switch_2;
37564 : }
37565 : }
37566 0 : return 0;
37567 : }
37568 :
37569 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
37570 : {
37571 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37572 0 : PyObject *py_result;
37573 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37574 0 : return py_result;
37575 : }
37576 :
37577 0 : static int py_lsa_QueryTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
37578 : {
37579 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37580 0 : if (value == NULL) {
37581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
37582 0 : return -1;
37583 : }
37584 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37585 0 : return 0;
37586 : }
37587 :
37588 : static PyGetSetDef py_lsa_QueryTrustedDomainInfoByName_getsetters[] = {
37589 : {
37590 : .name = discard_const_p(char, "in_handle"),
37591 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_handle,
37592 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_handle,
37593 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37594 : },
37595 : {
37596 : .name = discard_const_p(char, "in_trusted_domain"),
37597 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_trusted_domain,
37598 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_trusted_domain,
37599 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
37600 : },
37601 : {
37602 : .name = discard_const_p(char, "in_level"),
37603 : .get = py_lsa_QueryTrustedDomainInfoByName_in_get_level,
37604 : .set = py_lsa_QueryTrustedDomainInfoByName_in_set_level,
37605 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
37606 : },
37607 : {
37608 : .name = discard_const_p(char, "out_info"),
37609 : .get = py_lsa_QueryTrustedDomainInfoByName_out_get_info,
37610 : .set = py_lsa_QueryTrustedDomainInfoByName_out_set_info,
37611 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
37612 : },
37613 : {
37614 : .name = discard_const_p(char, "result"),
37615 : .get = py_lsa_QueryTrustedDomainInfoByName_get_result,
37616 : .set = py_lsa_QueryTrustedDomainInfoByName_set_result,
37617 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37618 : },
37619 : { .name = NULL }
37620 : };
37621 :
37622 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37623 : {
37624 0 : PyObject *self = pytalloc_new(struct lsa_QueryTrustedDomainInfoByName, type);
37625 0 : struct lsa_QueryTrustedDomainInfoByName *_self = (struct lsa_QueryTrustedDomainInfoByName *)pytalloc_get_ptr(self);
37626 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37627 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
37628 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
37629 : /* a pointer to a NULL pointer */
37630 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
37631 0 : return self;
37632 : }
37633 :
37634 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37635 : {
37636 :
37637 :
37638 0 : return PyLong_FromLong(48);
37639 : }
37640 :
37641 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37642 : {
37643 0 : const struct ndr_interface_call *call = NULL;
37644 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37645 0 : PyObject *ret = NULL;
37646 0 : struct ndr_push *push = NULL;
37647 0 : DATA_BLOB blob;
37648 0 : enum ndr_err_code err;
37649 :
37650 0 : if (ndr_table_lsarpc.num_calls < 49) {
37651 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_pack");
37652 0 : return NULL;
37653 : }
37654 0 : call = &ndr_table_lsarpc.calls[48];
37655 :
37656 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37657 0 : if (push == NULL) {
37658 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37659 0 : return NULL;
37660 : }
37661 :
37662 0 : push->flags |= ndr_push_flags;
37663 :
37664 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37665 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37666 0 : TALLOC_FREE(push);
37667 0 : PyErr_SetNdrError(err);
37668 0 : return NULL;
37669 : }
37670 0 : blob = ndr_push_blob(push);
37671 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37672 0 : TALLOC_FREE(push);
37673 0 : return ret;
37674 : }
37675 :
37676 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37677 : {
37678 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37679 0 : PyObject *bigendian_obj = NULL;
37680 0 : PyObject *ndr64_obj = NULL;
37681 0 : libndr_flags ndr_push_flags = 0;
37682 :
37683 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37684 : discard_const_p(char *, kwnames),
37685 : &bigendian_obj,
37686 : &ndr64_obj)) {
37687 0 : return NULL;
37688 : }
37689 :
37690 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37691 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37692 : }
37693 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37694 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37695 : }
37696 :
37697 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37698 : }
37699 :
37700 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37701 : {
37702 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37703 0 : PyObject *bigendian_obj = NULL;
37704 0 : PyObject *ndr64_obj = NULL;
37705 0 : libndr_flags ndr_push_flags = 0;
37706 :
37707 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37708 : discard_const_p(char *, kwnames),
37709 : &bigendian_obj,
37710 : &ndr64_obj)) {
37711 0 : return NULL;
37712 : }
37713 :
37714 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37715 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37716 : }
37717 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37718 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37719 : }
37720 :
37721 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37722 : }
37723 :
37724 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)
37725 : {
37726 0 : const struct ndr_interface_call *call = NULL;
37727 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37728 0 : struct ndr_pull *pull = NULL;
37729 0 : enum ndr_err_code err;
37730 :
37731 0 : if (ndr_table_lsarpc.num_calls < 49) {
37732 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_unpack");
37733 0 : return NULL;
37734 : }
37735 0 : call = &ndr_table_lsarpc.calls[48];
37736 :
37737 0 : pull = ndr_pull_init_blob(blob, object);
37738 0 : if (pull == NULL) {
37739 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37740 0 : return NULL;
37741 : }
37742 :
37743 0 : pull->flags |= ndr_pull_flags;
37744 :
37745 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37746 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37747 0 : TALLOC_FREE(pull);
37748 0 : PyErr_SetNdrError(err);
37749 0 : return NULL;
37750 : }
37751 0 : if (!allow_remaining) {
37752 0 : uint32_t highest_ofs;
37753 :
37754 0 : if (pull->offset > pull->relative_highest_offset) {
37755 0 : highest_ofs = pull->offset;
37756 : } else {
37757 0 : highest_ofs = pull->relative_highest_offset;
37758 : }
37759 0 : if (highest_ofs < pull->data_size) {
37760 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37761 : "not all bytes consumed ofs[%u] size[%u]",
37762 : highest_ofs, pull->data_size);
37763 0 : TALLOC_FREE(pull);
37764 0 : PyErr_SetNdrError(err);
37765 0 : return NULL;
37766 : }
37767 : }
37768 :
37769 0 : TALLOC_FREE(pull);
37770 0 : Py_RETURN_NONE;
37771 : }
37772 :
37773 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37774 : {
37775 0 : DATA_BLOB blob;
37776 0 : Py_ssize_t blob_length = 0;
37777 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37778 0 : PyObject *bigendian_obj = NULL;
37779 0 : PyObject *ndr64_obj = NULL;
37780 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37781 0 : PyObject *allow_remaining_obj = NULL;
37782 0 : bool allow_remaining = false;
37783 :
37784 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37785 : discard_const_p(char *, kwnames),
37786 : &blob.data, &blob_length,
37787 : &bigendian_obj,
37788 : &ndr64_obj,
37789 : &allow_remaining_obj)) {
37790 0 : return NULL;
37791 : }
37792 0 : blob.length = blob_length;
37793 :
37794 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37795 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37796 : }
37797 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37798 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37799 : }
37800 :
37801 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37802 0 : allow_remaining = true;
37803 : }
37804 :
37805 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37806 : }
37807 :
37808 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37809 : {
37810 0 : DATA_BLOB blob;
37811 0 : Py_ssize_t blob_length = 0;
37812 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37813 0 : PyObject *bigendian_obj = NULL;
37814 0 : PyObject *ndr64_obj = NULL;
37815 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37816 0 : PyObject *allow_remaining_obj = NULL;
37817 0 : bool allow_remaining = false;
37818 :
37819 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37820 : discard_const_p(char *, kwnames),
37821 : &blob.data, &blob_length,
37822 : &bigendian_obj,
37823 : &ndr64_obj,
37824 : &allow_remaining_obj)) {
37825 0 : return NULL;
37826 : }
37827 0 : blob.length = blob_length;
37828 :
37829 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37830 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37831 : }
37832 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37833 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37834 : }
37835 :
37836 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37837 0 : allow_remaining = true;
37838 : }
37839 :
37840 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37841 : }
37842 :
37843 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37844 : {
37845 0 : const struct ndr_interface_call *call = NULL;
37846 0 : struct lsa_QueryTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
37847 0 : PyObject *ret;
37848 0 : char *retstr;
37849 :
37850 0 : if (ndr_table_lsarpc.num_calls < 49) {
37851 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryTrustedDomainInfoByName_ndr_print");
37852 0 : return NULL;
37853 : }
37854 0 : call = &ndr_table_lsarpc.calls[48];
37855 :
37856 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37857 0 : ret = PyUnicode_FromString(retstr);
37858 0 : TALLOC_FREE(retstr);
37859 :
37860 0 : return ret;
37861 : }
37862 :
37863 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37864 : {
37865 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_in", NDR_IN);
37866 : }
37867 :
37868 0 : static PyObject *py_lsa_QueryTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37869 : {
37870 0 : return py_lsa_QueryTrustedDomainInfoByName_ndr_print(py_obj, "lsa_QueryTrustedDomainInfoByName_out", NDR_OUT);
37871 : }
37872 :
37873 : static PyMethodDef py_lsa_QueryTrustedDomainInfoByName_methods[] = {
37874 : { "opnum", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
37875 : "lsa.QueryTrustedDomainInfoByName.opnum() -> 48 (0x30) " },
37876 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37877 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37878 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37879 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37880 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37881 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37882 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37883 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37884 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37885 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37886 : { NULL, NULL, 0, NULL }
37887 : };
37888 :
37889 :
37890 : static PyTypeObject lsa_QueryTrustedDomainInfoByName_Type = {
37891 : PyVarObject_HEAD_INIT(NULL, 0)
37892 : .tp_name = "lsa.QueryTrustedDomainInfoByName",
37893 : .tp_getset = py_lsa_QueryTrustedDomainInfoByName_getsetters,
37894 : .tp_methods = py_lsa_QueryTrustedDomainInfoByName_methods,
37895 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37896 : .tp_new = py_lsa_QueryTrustedDomainInfoByName_new,
37897 : };
37898 :
37899 191 : static bool pack_py_lsa_QueryTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryTrustedDomainInfoByName *r)
37900 : {
37901 0 : PyObject *py_handle;
37902 0 : PyObject *py_trusted_domain;
37903 0 : PyObject *py_level;
37904 191 : const char *kwnames[] = {
37905 : "handle", "trusted_domain", "level", NULL
37906 : };
37907 :
37908 191 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_QueryTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level)) {
37909 0 : return false;
37910 : }
37911 :
37912 191 : if (py_handle == NULL) {
37913 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
37914 0 : return false;
37915 : }
37916 191 : r->in.handle = talloc_ptrtype(r, r->in.handle);
37917 191 : if (r->in.handle == NULL) {
37918 0 : PyErr_NoMemory();
37919 0 : return false;
37920 : }
37921 191 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
37922 191 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
37923 0 : PyErr_NoMemory();
37924 0 : return false;
37925 : }
37926 191 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
37927 191 : if (py_trusted_domain == NULL) {
37928 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain");
37929 0 : return false;
37930 : }
37931 191 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
37932 191 : if (r->in.trusted_domain == NULL) {
37933 0 : PyErr_NoMemory();
37934 0 : return false;
37935 : }
37936 191 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
37937 191 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
37938 0 : PyErr_NoMemory();
37939 0 : return false;
37940 : }
37941 191 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
37942 191 : if (py_level == NULL) {
37943 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
37944 0 : return false;
37945 : }
37946 : {
37947 191 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
37948 191 : if (PyLong_Check(py_level)) {
37949 0 : unsigned long long test_var;
37950 191 : test_var = PyLong_AsUnsignedLongLong(py_level);
37951 191 : if (PyErr_Occurred() != NULL) {
37952 0 : return false;
37953 : }
37954 191 : if (test_var > uint_max) {
37955 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
37956 : PyLong_Type.tp_name, uint_max, test_var);
37957 0 : return false;
37958 : }
37959 191 : r->in.level = test_var;
37960 : } else {
37961 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
37962 : PyLong_Type.tp_name);
37963 0 : return false;
37964 : }
37965 : }
37966 191 : return true;
37967 : }
37968 :
37969 191 : static PyObject *unpack_py_lsa_QueryTrustedDomainInfoByName_args_out(struct lsa_QueryTrustedDomainInfoByName *r)
37970 : {
37971 0 : PyObject *result;
37972 0 : PyObject *py_info;
37973 191 : if (*r->out.info == NULL) {
37974 47 : py_info = Py_None;
37975 24 : Py_INCREF(py_info);
37976 : } else {
37977 144 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_TrustedDomainInfo");
37978 144 : if (py_info == NULL) {
37979 0 : return NULL;
37980 : }
37981 : }
37982 191 : result = py_info;
37983 191 : if (NT_STATUS_IS_ERR(r->out.result)) {
37984 47 : PyErr_SetNTSTATUS(r->out.result);
37985 47 : return NULL;
37986 : }
37987 :
37988 144 : return result;
37989 : }
37990 :
37991 :
37992 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_handle(PyObject *obj, void *closure)
37993 : {
37994 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
37995 0 : PyObject *py_handle;
37996 0 : if (object->in.handle == NULL) {
37997 0 : Py_RETURN_NONE;
37998 : }
37999 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38000 0 : return py_handle;
38001 : }
38002 :
38003 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38004 : {
38005 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38006 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
38007 0 : if (value == NULL) {
38008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
38009 0 : return -1;
38010 : }
38011 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
38012 0 : if (object->in.handle == NULL) {
38013 0 : PyErr_NoMemory();
38014 0 : return -1;
38015 : }
38016 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38017 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38018 0 : PyErr_NoMemory();
38019 0 : return -1;
38020 : }
38021 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38022 0 : return 0;
38023 : }
38024 :
38025 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain(PyObject *obj, void *closure)
38026 : {
38027 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
38028 0 : PyObject *py_trusted_domain;
38029 0 : if (object->in.trusted_domain == NULL) {
38030 0 : Py_RETURN_NONE;
38031 : }
38032 0 : py_trusted_domain = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain, object->in.trusted_domain);
38033 0 : return py_trusted_domain;
38034 : }
38035 :
38036 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain(PyObject *py_obj, PyObject *value, void *closure)
38037 : {
38038 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38039 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain));
38040 0 : if (value == NULL) {
38041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain");
38042 0 : return -1;
38043 : }
38044 0 : object->in.trusted_domain = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain);
38045 0 : if (object->in.trusted_domain == NULL) {
38046 0 : PyErr_NoMemory();
38047 0 : return -1;
38048 : }
38049 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
38050 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38051 0 : PyErr_NoMemory();
38052 0 : return -1;
38053 : }
38054 0 : object->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(value);
38055 0 : return 0;
38056 : }
38057 :
38058 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_level(PyObject *obj, void *closure)
38059 : {
38060 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
38061 0 : PyObject *py_level;
38062 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
38063 0 : return py_level;
38064 : }
38065 :
38066 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
38067 : {
38068 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38069 0 : if (value == NULL) {
38070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
38071 0 : return -1;
38072 : }
38073 : {
38074 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
38075 0 : if (PyLong_Check(value)) {
38076 0 : unsigned long long test_var;
38077 0 : test_var = PyLong_AsUnsignedLongLong(value);
38078 0 : if (PyErr_Occurred() != NULL) {
38079 0 : return -1;
38080 : }
38081 0 : if (test_var > uint_max) {
38082 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38083 : PyLong_Type.tp_name, uint_max, test_var);
38084 0 : return -1;
38085 : }
38086 0 : object->in.level = test_var;
38087 : } else {
38088 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38089 : PyLong_Type.tp_name);
38090 0 : return -1;
38091 : }
38092 : }
38093 0 : return 0;
38094 : }
38095 :
38096 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_in_get_info(PyObject *obj, void *closure)
38097 : {
38098 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
38099 0 : PyObject *py_info;
38100 0 : if (object->in.info == NULL) {
38101 0 : Py_RETURN_NONE;
38102 : }
38103 0 : py_info = pyrpc_import_union(&lsa_TrustedDomainInfo_Type, object->in.info, object->in.level, object->in.info, "union lsa_TrustedDomainInfo");
38104 0 : if (py_info == NULL) {
38105 0 : return NULL;
38106 : }
38107 0 : return py_info;
38108 : }
38109 :
38110 0 : static int py_lsa_SetTrustedDomainInfoByName_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
38111 : {
38112 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38113 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
38114 0 : if (value == NULL) {
38115 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
38116 0 : return -1;
38117 : }
38118 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
38119 0 : if (object->in.info == NULL) {
38120 0 : PyErr_NoMemory();
38121 0 : return -1;
38122 : }
38123 : {
38124 0 : union lsa_TrustedDomainInfo *info_switch_1;
38125 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");
38126 0 : if (info_switch_1 == NULL) {
38127 0 : return -1;
38128 : }
38129 0 : object->in.info = info_switch_1;
38130 : }
38131 0 : return 0;
38132 : }
38133 :
38134 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_get_result(PyObject *obj, void *closure)
38135 : {
38136 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(obj);
38137 0 : PyObject *py_result;
38138 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38139 0 : return py_result;
38140 : }
38141 :
38142 0 : static int py_lsa_SetTrustedDomainInfoByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
38143 : {
38144 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38145 0 : if (value == NULL) {
38146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
38147 0 : return -1;
38148 : }
38149 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38150 0 : return 0;
38151 : }
38152 :
38153 : static PyGetSetDef py_lsa_SetTrustedDomainInfoByName_getsetters[] = {
38154 : {
38155 : .name = discard_const_p(char, "in_handle"),
38156 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_handle,
38157 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_handle,
38158 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38159 : },
38160 : {
38161 : .name = discard_const_p(char, "in_trusted_domain"),
38162 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_trusted_domain,
38163 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_trusted_domain,
38164 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
38165 : },
38166 : {
38167 : .name = discard_const_p(char, "in_level"),
38168 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_level,
38169 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_level,
38170 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomInfoEnum")
38171 : },
38172 : {
38173 : .name = discard_const_p(char, "in_info"),
38174 : .get = py_lsa_SetTrustedDomainInfoByName_in_get_info,
38175 : .set = py_lsa_SetTrustedDomainInfoByName_in_set_info,
38176 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedDomainInfo")
38177 : },
38178 : {
38179 : .name = discard_const_p(char, "result"),
38180 : .get = py_lsa_SetTrustedDomainInfoByName_get_result,
38181 : .set = py_lsa_SetTrustedDomainInfoByName_set_result,
38182 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38183 : },
38184 : { .name = NULL }
38185 : };
38186 :
38187 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38188 : {
38189 0 : PyObject *self = pytalloc_new(struct lsa_SetTrustedDomainInfoByName, type);
38190 0 : struct lsa_SetTrustedDomainInfoByName *_self = (struct lsa_SetTrustedDomainInfoByName *)pytalloc_get_ptr(self);
38191 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38192 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
38193 0 : _self->in.trusted_domain = talloc_zero(mem_ctx, struct lsa_String);
38194 0 : _self->in.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo);
38195 0 : return self;
38196 : }
38197 :
38198 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38199 : {
38200 :
38201 :
38202 0 : return PyLong_FromLong(49);
38203 : }
38204 :
38205 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38206 : {
38207 0 : const struct ndr_interface_call *call = NULL;
38208 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38209 0 : PyObject *ret = NULL;
38210 0 : struct ndr_push *push = NULL;
38211 0 : DATA_BLOB blob;
38212 0 : enum ndr_err_code err;
38213 :
38214 0 : if (ndr_table_lsarpc.num_calls < 50) {
38215 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_pack");
38216 0 : return NULL;
38217 : }
38218 0 : call = &ndr_table_lsarpc.calls[49];
38219 :
38220 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38221 0 : if (push == NULL) {
38222 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38223 0 : return NULL;
38224 : }
38225 :
38226 0 : push->flags |= ndr_push_flags;
38227 :
38228 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38229 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38230 0 : TALLOC_FREE(push);
38231 0 : PyErr_SetNdrError(err);
38232 0 : return NULL;
38233 : }
38234 0 : blob = ndr_push_blob(push);
38235 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38236 0 : TALLOC_FREE(push);
38237 0 : return ret;
38238 : }
38239 :
38240 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38241 : {
38242 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38243 0 : PyObject *bigendian_obj = NULL;
38244 0 : PyObject *ndr64_obj = NULL;
38245 0 : libndr_flags ndr_push_flags = 0;
38246 :
38247 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38248 : discard_const_p(char *, kwnames),
38249 : &bigendian_obj,
38250 : &ndr64_obj)) {
38251 0 : return NULL;
38252 : }
38253 :
38254 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38255 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38256 : }
38257 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38258 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38259 : }
38260 :
38261 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38262 : }
38263 :
38264 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38265 : {
38266 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38267 0 : PyObject *bigendian_obj = NULL;
38268 0 : PyObject *ndr64_obj = NULL;
38269 0 : libndr_flags ndr_push_flags = 0;
38270 :
38271 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38272 : discard_const_p(char *, kwnames),
38273 : &bigendian_obj,
38274 : &ndr64_obj)) {
38275 0 : return NULL;
38276 : }
38277 :
38278 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38279 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38280 : }
38281 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38282 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38283 : }
38284 :
38285 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38286 : }
38287 :
38288 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)
38289 : {
38290 0 : const struct ndr_interface_call *call = NULL;
38291 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38292 0 : struct ndr_pull *pull = NULL;
38293 0 : enum ndr_err_code err;
38294 :
38295 0 : if (ndr_table_lsarpc.num_calls < 50) {
38296 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_unpack");
38297 0 : return NULL;
38298 : }
38299 0 : call = &ndr_table_lsarpc.calls[49];
38300 :
38301 0 : pull = ndr_pull_init_blob(blob, object);
38302 0 : if (pull == NULL) {
38303 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38304 0 : return NULL;
38305 : }
38306 :
38307 0 : pull->flags |= ndr_pull_flags;
38308 :
38309 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38310 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38311 0 : TALLOC_FREE(pull);
38312 0 : PyErr_SetNdrError(err);
38313 0 : return NULL;
38314 : }
38315 0 : if (!allow_remaining) {
38316 0 : uint32_t highest_ofs;
38317 :
38318 0 : if (pull->offset > pull->relative_highest_offset) {
38319 0 : highest_ofs = pull->offset;
38320 : } else {
38321 0 : highest_ofs = pull->relative_highest_offset;
38322 : }
38323 0 : if (highest_ofs < pull->data_size) {
38324 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38325 : "not all bytes consumed ofs[%u] size[%u]",
38326 : highest_ofs, pull->data_size);
38327 0 : TALLOC_FREE(pull);
38328 0 : PyErr_SetNdrError(err);
38329 0 : return NULL;
38330 : }
38331 : }
38332 :
38333 0 : TALLOC_FREE(pull);
38334 0 : Py_RETURN_NONE;
38335 : }
38336 :
38337 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38338 : {
38339 0 : DATA_BLOB blob;
38340 0 : Py_ssize_t blob_length = 0;
38341 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38342 0 : PyObject *bigendian_obj = NULL;
38343 0 : PyObject *ndr64_obj = NULL;
38344 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38345 0 : PyObject *allow_remaining_obj = NULL;
38346 0 : bool allow_remaining = false;
38347 :
38348 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38349 : discard_const_p(char *, kwnames),
38350 : &blob.data, &blob_length,
38351 : &bigendian_obj,
38352 : &ndr64_obj,
38353 : &allow_remaining_obj)) {
38354 0 : return NULL;
38355 : }
38356 0 : blob.length = blob_length;
38357 :
38358 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38359 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38360 : }
38361 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38362 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38363 : }
38364 :
38365 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38366 0 : allow_remaining = true;
38367 : }
38368 :
38369 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38370 : }
38371 :
38372 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38373 : {
38374 0 : DATA_BLOB blob;
38375 0 : Py_ssize_t blob_length = 0;
38376 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38377 0 : PyObject *bigendian_obj = NULL;
38378 0 : PyObject *ndr64_obj = NULL;
38379 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38380 0 : PyObject *allow_remaining_obj = NULL;
38381 0 : bool allow_remaining = false;
38382 :
38383 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38384 : discard_const_p(char *, kwnames),
38385 : &blob.data, &blob_length,
38386 : &bigendian_obj,
38387 : &ndr64_obj,
38388 : &allow_remaining_obj)) {
38389 0 : return NULL;
38390 : }
38391 0 : blob.length = blob_length;
38392 :
38393 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38394 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38395 : }
38396 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38397 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38398 : }
38399 :
38400 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38401 0 : allow_remaining = true;
38402 : }
38403 :
38404 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38405 : }
38406 :
38407 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38408 : {
38409 0 : const struct ndr_interface_call *call = NULL;
38410 0 : struct lsa_SetTrustedDomainInfoByName *object = pytalloc_get_ptr(py_obj);
38411 0 : PyObject *ret;
38412 0 : char *retstr;
38413 :
38414 0 : if (ndr_table_lsarpc.num_calls < 50) {
38415 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetTrustedDomainInfoByName_ndr_print");
38416 0 : return NULL;
38417 : }
38418 0 : call = &ndr_table_lsarpc.calls[49];
38419 :
38420 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38421 0 : ret = PyUnicode_FromString(retstr);
38422 0 : TALLOC_FREE(retstr);
38423 :
38424 0 : return ret;
38425 : }
38426 :
38427 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38428 : {
38429 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_in", NDR_IN);
38430 : }
38431 :
38432 0 : static PyObject *py_lsa_SetTrustedDomainInfoByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38433 : {
38434 0 : return py_lsa_SetTrustedDomainInfoByName_ndr_print(py_obj, "lsa_SetTrustedDomainInfoByName_out", NDR_OUT);
38435 : }
38436 :
38437 : static PyMethodDef py_lsa_SetTrustedDomainInfoByName_methods[] = {
38438 : { "opnum", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_opnum, METH_NOARGS|METH_CLASS,
38439 : "lsa.SetTrustedDomainInfoByName.opnum() -> 49 (0x31) " },
38440 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38441 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38442 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38443 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38444 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38445 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38446 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetTrustedDomainInfoByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38447 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38448 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38449 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetTrustedDomainInfoByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38450 : { NULL, NULL, 0, NULL }
38451 : };
38452 :
38453 :
38454 : static PyTypeObject lsa_SetTrustedDomainInfoByName_Type = {
38455 : PyVarObject_HEAD_INIT(NULL, 0)
38456 : .tp_name = "lsa.SetTrustedDomainInfoByName",
38457 : .tp_getset = py_lsa_SetTrustedDomainInfoByName_getsetters,
38458 : .tp_methods = py_lsa_SetTrustedDomainInfoByName_methods,
38459 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38460 : .tp_new = py_lsa_SetTrustedDomainInfoByName_new,
38461 : };
38462 :
38463 0 : static bool pack_py_lsa_SetTrustedDomainInfoByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetTrustedDomainInfoByName *r)
38464 : {
38465 0 : PyObject *py_handle;
38466 0 : PyObject *py_trusted_domain;
38467 0 : PyObject *py_level;
38468 0 : PyObject *py_info;
38469 0 : const char *kwnames[] = {
38470 : "handle", "trusted_domain", "level", "info", NULL
38471 : };
38472 :
38473 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_SetTrustedDomainInfoByName", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain, &py_level, &py_info)) {
38474 0 : return false;
38475 : }
38476 :
38477 0 : if (py_handle == NULL) {
38478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
38479 0 : return false;
38480 : }
38481 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
38482 0 : if (r->in.handle == NULL) {
38483 0 : PyErr_NoMemory();
38484 0 : return false;
38485 : }
38486 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
38487 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
38488 0 : PyErr_NoMemory();
38489 0 : return false;
38490 : }
38491 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
38492 0 : if (py_trusted_domain == NULL) {
38493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain");
38494 0 : return false;
38495 : }
38496 0 : r->in.trusted_domain = talloc_ptrtype(r, r->in.trusted_domain);
38497 0 : if (r->in.trusted_domain == NULL) {
38498 0 : PyErr_NoMemory();
38499 0 : return false;
38500 : }
38501 0 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain, return false;);
38502 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain)) == NULL) {
38503 0 : PyErr_NoMemory();
38504 0 : return false;
38505 : }
38506 0 : r->in.trusted_domain = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain);
38507 0 : if (py_level == NULL) {
38508 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
38509 0 : return false;
38510 : }
38511 : {
38512 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
38513 0 : if (PyLong_Check(py_level)) {
38514 0 : unsigned long long test_var;
38515 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
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.level = 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 : if (py_info == NULL) {
38532 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
38533 0 : return false;
38534 : }
38535 0 : r->in.info = talloc_ptrtype(r, r->in.info);
38536 0 : if (r->in.info == NULL) {
38537 0 : PyErr_NoMemory();
38538 0 : return false;
38539 : }
38540 : {
38541 0 : union lsa_TrustedDomainInfo *info_switch_1;
38542 0 : info_switch_1 = (union lsa_TrustedDomainInfo *)pyrpc_export_union(&lsa_TrustedDomainInfo_Type, r, r->in.level, py_info, "union lsa_TrustedDomainInfo");
38543 0 : if (info_switch_1 == NULL) {
38544 0 : return false;
38545 : }
38546 0 : r->in.info = info_switch_1;
38547 : }
38548 0 : return true;
38549 : }
38550 :
38551 0 : static PyObject *unpack_py_lsa_SetTrustedDomainInfoByName_args_out(struct lsa_SetTrustedDomainInfoByName *r)
38552 : {
38553 0 : PyObject *result;
38554 0 : result = Py_None;
38555 0 : Py_INCREF(result);
38556 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38557 0 : PyErr_SetNTSTATUS(r->out.result);
38558 0 : return NULL;
38559 : }
38560 :
38561 0 : return result;
38562 : }
38563 :
38564 :
38565 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_handle(PyObject *obj, void *closure)
38566 : {
38567 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38568 0 : PyObject *py_handle;
38569 0 : if (object->in.handle == NULL) {
38570 0 : Py_RETURN_NONE;
38571 : }
38572 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
38573 0 : return py_handle;
38574 : }
38575 :
38576 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
38577 : {
38578 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38579 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
38580 0 : if (value == NULL) {
38581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
38582 0 : return -1;
38583 : }
38584 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
38585 0 : if (object->in.handle == NULL) {
38586 0 : PyErr_NoMemory();
38587 0 : return -1;
38588 : }
38589 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38590 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38591 0 : PyErr_NoMemory();
38592 0 : return -1;
38593 : }
38594 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
38595 0 : return 0;
38596 : }
38597 :
38598 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_resume_handle(PyObject *obj, void *closure)
38599 : {
38600 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38601 0 : PyObject *py_resume_handle;
38602 0 : if (object->in.resume_handle == NULL) {
38603 0 : Py_RETURN_NONE;
38604 : }
38605 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.resume_handle));
38606 0 : return py_resume_handle;
38607 : }
38608 :
38609 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
38610 : {
38611 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38612 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
38613 0 : if (value == NULL) {
38614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.resume_handle");
38615 0 : return -1;
38616 : }
38617 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
38618 0 : if (object->in.resume_handle == NULL) {
38619 0 : PyErr_NoMemory();
38620 0 : return -1;
38621 : }
38622 : {
38623 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
38624 0 : if (PyLong_Check(value)) {
38625 0 : unsigned long long test_var;
38626 0 : test_var = PyLong_AsUnsignedLongLong(value);
38627 0 : if (PyErr_Occurred() != NULL) {
38628 0 : return -1;
38629 : }
38630 0 : if (test_var > uint_max) {
38631 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38632 : PyLong_Type.tp_name, uint_max, test_var);
38633 0 : return -1;
38634 : }
38635 0 : *object->in.resume_handle = test_var;
38636 : } else {
38637 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38638 : PyLong_Type.tp_name);
38639 0 : return -1;
38640 : }
38641 : }
38642 0 : return 0;
38643 : }
38644 :
38645 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_resume_handle(PyObject *obj, void *closure)
38646 : {
38647 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38648 0 : PyObject *py_resume_handle;
38649 0 : if (object->out.resume_handle == NULL) {
38650 0 : Py_RETURN_NONE;
38651 : }
38652 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.resume_handle));
38653 0 : return py_resume_handle;
38654 : }
38655 :
38656 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
38657 : {
38658 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38659 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
38660 0 : if (value == NULL) {
38661 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.resume_handle");
38662 0 : return -1;
38663 : }
38664 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
38665 0 : if (object->out.resume_handle == NULL) {
38666 0 : PyErr_NoMemory();
38667 0 : return -1;
38668 : }
38669 : {
38670 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
38671 0 : if (PyLong_Check(value)) {
38672 0 : unsigned long long test_var;
38673 0 : test_var = PyLong_AsUnsignedLongLong(value);
38674 0 : if (PyErr_Occurred() != NULL) {
38675 0 : return -1;
38676 : }
38677 0 : if (test_var > uint_max) {
38678 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38679 : PyLong_Type.tp_name, uint_max, test_var);
38680 0 : return -1;
38681 : }
38682 0 : *object->out.resume_handle = test_var;
38683 : } else {
38684 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38685 : PyLong_Type.tp_name);
38686 0 : return -1;
38687 : }
38688 : }
38689 0 : return 0;
38690 : }
38691 :
38692 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_out_get_domains(PyObject *obj, void *closure)
38693 : {
38694 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38695 0 : PyObject *py_domains;
38696 0 : if (object->out.domains == NULL) {
38697 0 : Py_RETURN_NONE;
38698 : }
38699 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, object->out.domains, object->out.domains);
38700 0 : return py_domains;
38701 : }
38702 :
38703 0 : static int py_lsa_EnumTrustedDomainsEx_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
38704 : {
38705 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38706 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
38707 0 : if (value == NULL) {
38708 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
38709 0 : return -1;
38710 : }
38711 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
38712 0 : if (object->out.domains == NULL) {
38713 0 : PyErr_NoMemory();
38714 0 : return -1;
38715 : }
38716 0 : PY_CHECK_TYPE(&lsa_DomainListEx_Type, value, return -1;);
38717 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38718 0 : PyErr_NoMemory();
38719 0 : return -1;
38720 : }
38721 0 : object->out.domains = (struct lsa_DomainListEx *)pytalloc_get_ptr(value);
38722 0 : return 0;
38723 : }
38724 :
38725 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_in_get_max_size(PyObject *obj, void *closure)
38726 : {
38727 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38728 0 : PyObject *py_max_size;
38729 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.max_size));
38730 0 : return py_max_size;
38731 : }
38732 :
38733 0 : static int py_lsa_EnumTrustedDomainsEx_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
38734 : {
38735 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38736 0 : if (value == NULL) {
38737 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.max_size");
38738 0 : return -1;
38739 : }
38740 : {
38741 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
38742 0 : if (PyLong_Check(value)) {
38743 0 : unsigned long long test_var;
38744 0 : test_var = PyLong_AsUnsignedLongLong(value);
38745 0 : if (PyErr_Occurred() != NULL) {
38746 0 : return -1;
38747 : }
38748 0 : if (test_var > uint_max) {
38749 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38750 : PyLong_Type.tp_name, uint_max, test_var);
38751 0 : return -1;
38752 : }
38753 0 : object->in.max_size = test_var;
38754 : } else {
38755 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38756 : PyLong_Type.tp_name);
38757 0 : return -1;
38758 : }
38759 : }
38760 0 : return 0;
38761 : }
38762 :
38763 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_get_result(PyObject *obj, void *closure)
38764 : {
38765 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(obj);
38766 0 : PyObject *py_result;
38767 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38768 0 : return py_result;
38769 : }
38770 :
38771 0 : static int py_lsa_EnumTrustedDomainsEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
38772 : {
38773 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38774 0 : if (value == NULL) {
38775 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
38776 0 : return -1;
38777 : }
38778 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38779 0 : return 0;
38780 : }
38781 :
38782 : static PyGetSetDef py_lsa_EnumTrustedDomainsEx_getsetters[] = {
38783 : {
38784 : .name = discard_const_p(char, "in_handle"),
38785 : .get = py_lsa_EnumTrustedDomainsEx_in_get_handle,
38786 : .set = py_lsa_EnumTrustedDomainsEx_in_set_handle,
38787 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38788 : },
38789 : {
38790 : .name = discard_const_p(char, "in_resume_handle"),
38791 : .get = py_lsa_EnumTrustedDomainsEx_in_get_resume_handle,
38792 : .set = py_lsa_EnumTrustedDomainsEx_in_set_resume_handle,
38793 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
38794 : },
38795 : {
38796 : .name = discard_const_p(char, "out_resume_handle"),
38797 : .get = py_lsa_EnumTrustedDomainsEx_out_get_resume_handle,
38798 : .set = py_lsa_EnumTrustedDomainsEx_out_set_resume_handle,
38799 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
38800 : },
38801 : {
38802 : .name = discard_const_p(char, "out_domains"),
38803 : .get = py_lsa_EnumTrustedDomainsEx_out_get_domains,
38804 : .set = py_lsa_EnumTrustedDomainsEx_out_set_domains,
38805 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainListEx")
38806 : },
38807 : {
38808 : .name = discard_const_p(char, "in_max_size"),
38809 : .get = py_lsa_EnumTrustedDomainsEx_in_get_max_size,
38810 : .set = py_lsa_EnumTrustedDomainsEx_in_set_max_size,
38811 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
38812 : },
38813 : {
38814 : .name = discard_const_p(char, "result"),
38815 : .get = py_lsa_EnumTrustedDomainsEx_get_result,
38816 : .set = py_lsa_EnumTrustedDomainsEx_set_result,
38817 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38818 : },
38819 : { .name = NULL }
38820 : };
38821 :
38822 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38823 : {
38824 0 : PyObject *self = pytalloc_new(struct lsa_EnumTrustedDomainsEx, type);
38825 0 : struct lsa_EnumTrustedDomainsEx *_self = (struct lsa_EnumTrustedDomainsEx *)pytalloc_get_ptr(self);
38826 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38827 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
38828 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
38829 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
38830 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_DomainListEx);
38831 0 : return self;
38832 : }
38833 :
38834 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38835 : {
38836 :
38837 :
38838 0 : return PyLong_FromLong(50);
38839 : }
38840 :
38841 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38842 : {
38843 0 : const struct ndr_interface_call *call = NULL;
38844 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38845 0 : PyObject *ret = NULL;
38846 0 : struct ndr_push *push = NULL;
38847 0 : DATA_BLOB blob;
38848 0 : enum ndr_err_code err;
38849 :
38850 0 : if (ndr_table_lsarpc.num_calls < 51) {
38851 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_pack");
38852 0 : return NULL;
38853 : }
38854 0 : call = &ndr_table_lsarpc.calls[50];
38855 :
38856 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38857 0 : if (push == NULL) {
38858 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38859 0 : return NULL;
38860 : }
38861 :
38862 0 : push->flags |= ndr_push_flags;
38863 :
38864 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38865 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38866 0 : TALLOC_FREE(push);
38867 0 : PyErr_SetNdrError(err);
38868 0 : return NULL;
38869 : }
38870 0 : blob = ndr_push_blob(push);
38871 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38872 0 : TALLOC_FREE(push);
38873 0 : return ret;
38874 : }
38875 :
38876 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38877 : {
38878 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38879 0 : PyObject *bigendian_obj = NULL;
38880 0 : PyObject *ndr64_obj = NULL;
38881 0 : libndr_flags ndr_push_flags = 0;
38882 :
38883 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38884 : discard_const_p(char *, kwnames),
38885 : &bigendian_obj,
38886 : &ndr64_obj)) {
38887 0 : return NULL;
38888 : }
38889 :
38890 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38891 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38892 : }
38893 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38894 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38895 : }
38896 :
38897 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38898 : }
38899 :
38900 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38901 : {
38902 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38903 0 : PyObject *bigendian_obj = NULL;
38904 0 : PyObject *ndr64_obj = NULL;
38905 0 : libndr_flags ndr_push_flags = 0;
38906 :
38907 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38908 : discard_const_p(char *, kwnames),
38909 : &bigendian_obj,
38910 : &ndr64_obj)) {
38911 0 : return NULL;
38912 : }
38913 :
38914 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38915 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38916 : }
38917 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38918 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38919 : }
38920 :
38921 0 : return py_lsa_EnumTrustedDomainsEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38922 : }
38923 :
38924 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)
38925 : {
38926 0 : const struct ndr_interface_call *call = NULL;
38927 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
38928 0 : struct ndr_pull *pull = NULL;
38929 0 : enum ndr_err_code err;
38930 :
38931 0 : if (ndr_table_lsarpc.num_calls < 51) {
38932 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_unpack");
38933 0 : return NULL;
38934 : }
38935 0 : call = &ndr_table_lsarpc.calls[50];
38936 :
38937 0 : pull = ndr_pull_init_blob(blob, object);
38938 0 : if (pull == NULL) {
38939 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38940 0 : return NULL;
38941 : }
38942 :
38943 0 : pull->flags |= ndr_pull_flags;
38944 :
38945 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38946 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38947 0 : TALLOC_FREE(pull);
38948 0 : PyErr_SetNdrError(err);
38949 0 : return NULL;
38950 : }
38951 0 : if (!allow_remaining) {
38952 0 : uint32_t highest_ofs;
38953 :
38954 0 : if (pull->offset > pull->relative_highest_offset) {
38955 0 : highest_ofs = pull->offset;
38956 : } else {
38957 0 : highest_ofs = pull->relative_highest_offset;
38958 : }
38959 0 : if (highest_ofs < pull->data_size) {
38960 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38961 : "not all bytes consumed ofs[%u] size[%u]",
38962 : highest_ofs, pull->data_size);
38963 0 : TALLOC_FREE(pull);
38964 0 : PyErr_SetNdrError(err);
38965 0 : return NULL;
38966 : }
38967 : }
38968 :
38969 0 : TALLOC_FREE(pull);
38970 0 : Py_RETURN_NONE;
38971 : }
38972 :
38973 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38974 : {
38975 0 : DATA_BLOB blob;
38976 0 : Py_ssize_t blob_length = 0;
38977 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38978 0 : PyObject *bigendian_obj = NULL;
38979 0 : PyObject *ndr64_obj = NULL;
38980 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38981 0 : PyObject *allow_remaining_obj = NULL;
38982 0 : bool allow_remaining = false;
38983 :
38984 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38985 : discard_const_p(char *, kwnames),
38986 : &blob.data, &blob_length,
38987 : &bigendian_obj,
38988 : &ndr64_obj,
38989 : &allow_remaining_obj)) {
38990 0 : return NULL;
38991 : }
38992 0 : blob.length = blob_length;
38993 :
38994 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38995 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38996 : }
38997 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38998 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38999 : }
39000 :
39001 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39002 0 : allow_remaining = true;
39003 : }
39004 :
39005 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39006 : }
39007 :
39008 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39009 : {
39010 0 : DATA_BLOB blob;
39011 0 : Py_ssize_t blob_length = 0;
39012 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39013 0 : PyObject *bigendian_obj = NULL;
39014 0 : PyObject *ndr64_obj = NULL;
39015 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39016 0 : PyObject *allow_remaining_obj = NULL;
39017 0 : bool allow_remaining = false;
39018 :
39019 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39020 : discard_const_p(char *, kwnames),
39021 : &blob.data, &blob_length,
39022 : &bigendian_obj,
39023 : &ndr64_obj,
39024 : &allow_remaining_obj)) {
39025 0 : return NULL;
39026 : }
39027 0 : blob.length = blob_length;
39028 :
39029 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39030 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39031 : }
39032 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39033 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39034 : }
39035 :
39036 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39037 0 : allow_remaining = true;
39038 : }
39039 :
39040 0 : return py_lsa_EnumTrustedDomainsEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39041 : }
39042 :
39043 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39044 : {
39045 0 : const struct ndr_interface_call *call = NULL;
39046 0 : struct lsa_EnumTrustedDomainsEx *object = pytalloc_get_ptr(py_obj);
39047 0 : PyObject *ret;
39048 0 : char *retstr;
39049 :
39050 0 : if (ndr_table_lsarpc.num_calls < 51) {
39051 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_EnumTrustedDomainsEx_ndr_print");
39052 0 : return NULL;
39053 : }
39054 0 : call = &ndr_table_lsarpc.calls[50];
39055 :
39056 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39057 0 : ret = PyUnicode_FromString(retstr);
39058 0 : TALLOC_FREE(retstr);
39059 :
39060 0 : return ret;
39061 : }
39062 :
39063 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39064 : {
39065 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_in", NDR_IN);
39066 : }
39067 :
39068 0 : static PyObject *py_lsa_EnumTrustedDomainsEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39069 : {
39070 0 : return py_lsa_EnumTrustedDomainsEx_ndr_print(py_obj, "lsa_EnumTrustedDomainsEx_out", NDR_OUT);
39071 : }
39072 :
39073 : static PyMethodDef py_lsa_EnumTrustedDomainsEx_methods[] = {
39074 : { "opnum", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_opnum, METH_NOARGS|METH_CLASS,
39075 : "lsa.EnumTrustedDomainsEx.opnum() -> 50 (0x32) " },
39076 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39077 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39078 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39079 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39080 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39081 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39082 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_EnumTrustedDomainsEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39083 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39084 : { "__ndr_print_in__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39085 : { "__ndr_print_out__", (PyCFunction)py_lsa_EnumTrustedDomainsEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39086 : { NULL, NULL, 0, NULL }
39087 : };
39088 :
39089 :
39090 : static PyTypeObject lsa_EnumTrustedDomainsEx_Type = {
39091 : PyVarObject_HEAD_INIT(NULL, 0)
39092 : .tp_name = "lsa.EnumTrustedDomainsEx",
39093 : .tp_getset = py_lsa_EnumTrustedDomainsEx_getsetters,
39094 : .tp_methods = py_lsa_EnumTrustedDomainsEx_methods,
39095 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39096 : .tp_new = py_lsa_EnumTrustedDomainsEx_new,
39097 : };
39098 :
39099 0 : static bool pack_py_lsa_EnumTrustedDomainsEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_EnumTrustedDomainsEx *r)
39100 : {
39101 0 : PyObject *py_handle;
39102 0 : PyObject *py_resume_handle;
39103 0 : PyObject *py_max_size;
39104 0 : const char *kwnames[] = {
39105 : "handle", "resume_handle", "max_size", NULL
39106 : };
39107 :
39108 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_EnumTrustedDomainsEx", discard_const_p(char *, kwnames), &py_handle, &py_resume_handle, &py_max_size)) {
39109 0 : return false;
39110 : }
39111 :
39112 0 : if (py_handle == NULL) {
39113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
39114 0 : return false;
39115 : }
39116 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
39117 0 : if (r->in.handle == NULL) {
39118 0 : PyErr_NoMemory();
39119 0 : return false;
39120 : }
39121 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
39122 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
39123 0 : PyErr_NoMemory();
39124 0 : return false;
39125 : }
39126 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
39127 0 : if (py_resume_handle == NULL) {
39128 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.resume_handle");
39129 0 : return false;
39130 : }
39131 0 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
39132 0 : if (r->in.resume_handle == NULL) {
39133 0 : PyErr_NoMemory();
39134 0 : return false;
39135 : }
39136 : {
39137 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
39138 0 : if (PyLong_Check(py_resume_handle)) {
39139 0 : unsigned long long test_var;
39140 0 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
39141 0 : if (PyErr_Occurred() != NULL) {
39142 0 : return false;
39143 : }
39144 0 : if (test_var > uint_max) {
39145 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39146 : PyLong_Type.tp_name, uint_max, test_var);
39147 0 : return false;
39148 : }
39149 0 : *r->in.resume_handle = test_var;
39150 : } else {
39151 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39152 : PyLong_Type.tp_name);
39153 0 : return false;
39154 : }
39155 : }
39156 0 : if (py_max_size == NULL) {
39157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.max_size");
39158 0 : return false;
39159 : }
39160 : {
39161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
39162 0 : if (PyLong_Check(py_max_size)) {
39163 0 : unsigned long long test_var;
39164 0 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
39165 0 : if (PyErr_Occurred() != NULL) {
39166 0 : return false;
39167 : }
39168 0 : if (test_var > uint_max) {
39169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39170 : PyLong_Type.tp_name, uint_max, test_var);
39171 0 : return false;
39172 : }
39173 0 : r->in.max_size = test_var;
39174 : } else {
39175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39176 : PyLong_Type.tp_name);
39177 0 : return false;
39178 : }
39179 : }
39180 0 : return true;
39181 : }
39182 :
39183 0 : static PyObject *unpack_py_lsa_EnumTrustedDomainsEx_args_out(struct lsa_EnumTrustedDomainsEx *r)
39184 : {
39185 0 : PyObject *result;
39186 0 : PyObject *py_resume_handle;
39187 0 : PyObject *py_domains;
39188 0 : result = PyTuple_New(2);
39189 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.resume_handle));
39190 0 : PyTuple_SetItem(result, 0, py_resume_handle);
39191 0 : py_domains = pytalloc_reference_ex(&lsa_DomainListEx_Type, r->out.domains, r->out.domains);
39192 0 : PyTuple_SetItem(result, 1, py_domains);
39193 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39194 0 : PyErr_SetNTSTATUS(r->out.result);
39195 0 : return NULL;
39196 : }
39197 :
39198 0 : return result;
39199 : }
39200 :
39201 :
39202 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_policy_handle(PyObject *obj, void *closure)
39203 : {
39204 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39205 0 : PyObject *py_policy_handle;
39206 0 : if (object->in.policy_handle == NULL) {
39207 0 : Py_RETURN_NONE;
39208 : }
39209 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
39210 0 : return py_policy_handle;
39211 : }
39212 :
39213 0 : static int py_lsa_CreateTrustedDomainEx_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
39214 : {
39215 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39216 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
39217 0 : if (value == NULL) {
39218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.policy_handle");
39219 0 : return -1;
39220 : }
39221 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
39222 0 : if (object->in.policy_handle == NULL) {
39223 0 : PyErr_NoMemory();
39224 0 : return -1;
39225 : }
39226 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39227 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39228 0 : PyErr_NoMemory();
39229 0 : return -1;
39230 : }
39231 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
39232 0 : return 0;
39233 : }
39234 :
39235 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_info(PyObject *obj, void *closure)
39236 : {
39237 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39238 0 : PyObject *py_info;
39239 0 : if (object->in.info == NULL) {
39240 0 : Py_RETURN_NONE;
39241 : }
39242 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
39243 0 : return py_info;
39244 : }
39245 :
39246 0 : static int py_lsa_CreateTrustedDomainEx_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
39247 : {
39248 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39249 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
39250 0 : if (value == NULL) {
39251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
39252 0 : return -1;
39253 : }
39254 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
39255 0 : if (object->in.info == NULL) {
39256 0 : PyErr_NoMemory();
39257 0 : return -1;
39258 : }
39259 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
39260 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39261 0 : PyErr_NoMemory();
39262 0 : return -1;
39263 : }
39264 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
39265 0 : return 0;
39266 : }
39267 :
39268 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_auth_info(PyObject *obj, void *closure)
39269 : {
39270 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39271 0 : PyObject *py_auth_info;
39272 0 : if (object->in.auth_info == NULL) {
39273 0 : Py_RETURN_NONE;
39274 : }
39275 0 : py_auth_info = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfo_Type, object->in.auth_info, object->in.auth_info);
39276 0 : return py_auth_info;
39277 : }
39278 :
39279 0 : static int py_lsa_CreateTrustedDomainEx_in_set_auth_info(PyObject *py_obj, PyObject *value, void *closure)
39280 : {
39281 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39282 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info));
39283 0 : if (value == NULL) {
39284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.auth_info");
39285 0 : return -1;
39286 : }
39287 0 : object->in.auth_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info);
39288 0 : if (object->in.auth_info == NULL) {
39289 0 : PyErr_NoMemory();
39290 0 : return -1;
39291 : }
39292 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, value, return -1;);
39293 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39294 0 : PyErr_NoMemory();
39295 0 : return -1;
39296 : }
39297 0 : object->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(value);
39298 0 : return 0;
39299 : }
39300 :
39301 0 : static PyObject *py_lsa_CreateTrustedDomainEx_in_get_access_mask(PyObject *obj, void *closure)
39302 : {
39303 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39304 0 : PyObject *py_access_mask;
39305 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
39306 0 : return py_access_mask;
39307 : }
39308 :
39309 0 : static int py_lsa_CreateTrustedDomainEx_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
39310 : {
39311 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39312 0 : if (value == NULL) {
39313 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
39314 0 : return -1;
39315 : }
39316 : {
39317 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
39318 0 : if (PyLong_Check(value)) {
39319 0 : unsigned long long test_var;
39320 0 : test_var = PyLong_AsUnsignedLongLong(value);
39321 0 : if (PyErr_Occurred() != NULL) {
39322 0 : return -1;
39323 : }
39324 0 : if (test_var > uint_max) {
39325 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39326 : PyLong_Type.tp_name, uint_max, test_var);
39327 0 : return -1;
39328 : }
39329 0 : object->in.access_mask = test_var;
39330 : } else {
39331 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39332 : PyLong_Type.tp_name);
39333 0 : return -1;
39334 : }
39335 : }
39336 0 : return 0;
39337 : }
39338 :
39339 0 : static PyObject *py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle(PyObject *obj, void *closure)
39340 : {
39341 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39342 0 : PyObject *py_trustdom_handle;
39343 0 : if (object->out.trustdom_handle == NULL) {
39344 0 : Py_RETURN_NONE;
39345 : }
39346 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
39347 0 : return py_trustdom_handle;
39348 : }
39349 :
39350 0 : static int py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
39351 : {
39352 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39353 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
39354 0 : if (value == NULL) {
39355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
39356 0 : return -1;
39357 : }
39358 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
39359 0 : if (object->out.trustdom_handle == NULL) {
39360 0 : PyErr_NoMemory();
39361 0 : return -1;
39362 : }
39363 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39364 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39365 0 : PyErr_NoMemory();
39366 0 : return -1;
39367 : }
39368 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
39369 0 : return 0;
39370 : }
39371 :
39372 0 : static PyObject *py_lsa_CreateTrustedDomainEx_get_result(PyObject *obj, void *closure)
39373 : {
39374 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(obj);
39375 0 : PyObject *py_result;
39376 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39377 0 : return py_result;
39378 : }
39379 :
39380 0 : static int py_lsa_CreateTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
39381 : {
39382 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39383 0 : if (value == NULL) {
39384 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
39385 0 : return -1;
39386 : }
39387 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39388 0 : return 0;
39389 : }
39390 :
39391 : static PyGetSetDef py_lsa_CreateTrustedDomainEx_getsetters[] = {
39392 : {
39393 : .name = discard_const_p(char, "in_policy_handle"),
39394 : .get = py_lsa_CreateTrustedDomainEx_in_get_policy_handle,
39395 : .set = py_lsa_CreateTrustedDomainEx_in_set_policy_handle,
39396 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39397 : },
39398 : {
39399 : .name = discard_const_p(char, "in_info"),
39400 : .get = py_lsa_CreateTrustedDomainEx_in_get_info,
39401 : .set = py_lsa_CreateTrustedDomainEx_in_set_info,
39402 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
39403 : },
39404 : {
39405 : .name = discard_const_p(char, "in_auth_info"),
39406 : .get = py_lsa_CreateTrustedDomainEx_in_get_auth_info,
39407 : .set = py_lsa_CreateTrustedDomainEx_in_set_auth_info,
39408 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfo")
39409 : },
39410 : {
39411 : .name = discard_const_p(char, "in_access_mask"),
39412 : .get = py_lsa_CreateTrustedDomainEx_in_get_access_mask,
39413 : .set = py_lsa_CreateTrustedDomainEx_in_set_access_mask,
39414 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
39415 : },
39416 : {
39417 : .name = discard_const_p(char, "out_trustdom_handle"),
39418 : .get = py_lsa_CreateTrustedDomainEx_out_get_trustdom_handle,
39419 : .set = py_lsa_CreateTrustedDomainEx_out_set_trustdom_handle,
39420 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39421 : },
39422 : {
39423 : .name = discard_const_p(char, "result"),
39424 : .get = py_lsa_CreateTrustedDomainEx_get_result,
39425 : .set = py_lsa_CreateTrustedDomainEx_set_result,
39426 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39427 : },
39428 : { .name = NULL }
39429 : };
39430 :
39431 0 : static PyObject *py_lsa_CreateTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39432 : {
39433 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx, type);
39434 0 : struct lsa_CreateTrustedDomainEx *_self = (struct lsa_CreateTrustedDomainEx *)pytalloc_get_ptr(self);
39435 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39436 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
39437 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
39438 0 : _self->in.auth_info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfo);
39439 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
39440 0 : return self;
39441 : }
39442 :
39443 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39444 : {
39445 :
39446 :
39447 0 : return PyLong_FromLong(51);
39448 : }
39449 :
39450 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39451 : {
39452 0 : const struct ndr_interface_call *call = NULL;
39453 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39454 0 : PyObject *ret = NULL;
39455 0 : struct ndr_push *push = NULL;
39456 0 : DATA_BLOB blob;
39457 0 : enum ndr_err_code err;
39458 :
39459 0 : if (ndr_table_lsarpc.num_calls < 52) {
39460 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_pack");
39461 0 : return NULL;
39462 : }
39463 0 : call = &ndr_table_lsarpc.calls[51];
39464 :
39465 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39466 0 : if (push == NULL) {
39467 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39468 0 : return NULL;
39469 : }
39470 :
39471 0 : push->flags |= ndr_push_flags;
39472 :
39473 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39474 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39475 0 : TALLOC_FREE(push);
39476 0 : PyErr_SetNdrError(err);
39477 0 : return NULL;
39478 : }
39479 0 : blob = ndr_push_blob(push);
39480 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39481 0 : TALLOC_FREE(push);
39482 0 : return ret;
39483 : }
39484 :
39485 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39486 : {
39487 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39488 0 : PyObject *bigendian_obj = NULL;
39489 0 : PyObject *ndr64_obj = NULL;
39490 0 : libndr_flags ndr_push_flags = 0;
39491 :
39492 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39493 : discard_const_p(char *, kwnames),
39494 : &bigendian_obj,
39495 : &ndr64_obj)) {
39496 0 : return NULL;
39497 : }
39498 :
39499 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39500 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39501 : }
39502 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39503 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39504 : }
39505 :
39506 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39507 : }
39508 :
39509 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39510 : {
39511 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39512 0 : PyObject *bigendian_obj = NULL;
39513 0 : PyObject *ndr64_obj = NULL;
39514 0 : libndr_flags ndr_push_flags = 0;
39515 :
39516 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39517 : discard_const_p(char *, kwnames),
39518 : &bigendian_obj,
39519 : &ndr64_obj)) {
39520 0 : return NULL;
39521 : }
39522 :
39523 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39524 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39525 : }
39526 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39527 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39528 : }
39529 :
39530 0 : return py_lsa_CreateTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39531 : }
39532 :
39533 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)
39534 : {
39535 0 : const struct ndr_interface_call *call = NULL;
39536 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39537 0 : struct ndr_pull *pull = NULL;
39538 0 : enum ndr_err_code err;
39539 :
39540 0 : if (ndr_table_lsarpc.num_calls < 52) {
39541 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_unpack");
39542 0 : return NULL;
39543 : }
39544 0 : call = &ndr_table_lsarpc.calls[51];
39545 :
39546 0 : pull = ndr_pull_init_blob(blob, object);
39547 0 : if (pull == NULL) {
39548 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39549 0 : return NULL;
39550 : }
39551 :
39552 0 : pull->flags |= ndr_pull_flags;
39553 :
39554 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39555 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39556 0 : TALLOC_FREE(pull);
39557 0 : PyErr_SetNdrError(err);
39558 0 : return NULL;
39559 : }
39560 0 : if (!allow_remaining) {
39561 0 : uint32_t highest_ofs;
39562 :
39563 0 : if (pull->offset > pull->relative_highest_offset) {
39564 0 : highest_ofs = pull->offset;
39565 : } else {
39566 0 : highest_ofs = pull->relative_highest_offset;
39567 : }
39568 0 : if (highest_ofs < pull->data_size) {
39569 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39570 : "not all bytes consumed ofs[%u] size[%u]",
39571 : highest_ofs, pull->data_size);
39572 0 : TALLOC_FREE(pull);
39573 0 : PyErr_SetNdrError(err);
39574 0 : return NULL;
39575 : }
39576 : }
39577 :
39578 0 : TALLOC_FREE(pull);
39579 0 : Py_RETURN_NONE;
39580 : }
39581 :
39582 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39583 : {
39584 0 : DATA_BLOB blob;
39585 0 : Py_ssize_t blob_length = 0;
39586 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39587 0 : PyObject *bigendian_obj = NULL;
39588 0 : PyObject *ndr64_obj = NULL;
39589 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39590 0 : PyObject *allow_remaining_obj = NULL;
39591 0 : bool allow_remaining = false;
39592 :
39593 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39594 : discard_const_p(char *, kwnames),
39595 : &blob.data, &blob_length,
39596 : &bigendian_obj,
39597 : &ndr64_obj,
39598 : &allow_remaining_obj)) {
39599 0 : return NULL;
39600 : }
39601 0 : blob.length = blob_length;
39602 :
39603 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39604 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39605 : }
39606 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39607 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39608 : }
39609 :
39610 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39611 0 : allow_remaining = true;
39612 : }
39613 :
39614 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39615 : }
39616 :
39617 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39618 : {
39619 0 : DATA_BLOB blob;
39620 0 : Py_ssize_t blob_length = 0;
39621 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39622 0 : PyObject *bigendian_obj = NULL;
39623 0 : PyObject *ndr64_obj = NULL;
39624 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39625 0 : PyObject *allow_remaining_obj = NULL;
39626 0 : bool allow_remaining = false;
39627 :
39628 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39629 : discard_const_p(char *, kwnames),
39630 : &blob.data, &blob_length,
39631 : &bigendian_obj,
39632 : &ndr64_obj,
39633 : &allow_remaining_obj)) {
39634 0 : return NULL;
39635 : }
39636 0 : blob.length = blob_length;
39637 :
39638 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39639 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39640 : }
39641 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39642 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39643 : }
39644 :
39645 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39646 0 : allow_remaining = true;
39647 : }
39648 :
39649 0 : return py_lsa_CreateTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39650 : }
39651 :
39652 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39653 : {
39654 0 : const struct ndr_interface_call *call = NULL;
39655 0 : struct lsa_CreateTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39656 0 : PyObject *ret;
39657 0 : char *retstr;
39658 :
39659 0 : if (ndr_table_lsarpc.num_calls < 52) {
39660 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx_ndr_print");
39661 0 : return NULL;
39662 : }
39663 0 : call = &ndr_table_lsarpc.calls[51];
39664 :
39665 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39666 0 : ret = PyUnicode_FromString(retstr);
39667 0 : TALLOC_FREE(retstr);
39668 :
39669 0 : return ret;
39670 : }
39671 :
39672 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39673 : {
39674 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_in", NDR_IN);
39675 : }
39676 :
39677 0 : static PyObject *py_lsa_CreateTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39678 : {
39679 0 : return py_lsa_CreateTrustedDomainEx_ndr_print(py_obj, "lsa_CreateTrustedDomainEx_out", NDR_OUT);
39680 : }
39681 :
39682 : static PyMethodDef py_lsa_CreateTrustedDomainEx_methods[] = {
39683 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
39684 : "lsa.CreateTrustedDomainEx.opnum() -> 51 (0x33) " },
39685 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39686 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39687 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39688 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39689 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39690 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39691 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39692 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39693 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39694 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39695 : { NULL, NULL, 0, NULL }
39696 : };
39697 :
39698 :
39699 : static PyTypeObject lsa_CreateTrustedDomainEx_Type = {
39700 : PyVarObject_HEAD_INIT(NULL, 0)
39701 : .tp_name = "lsa.CreateTrustedDomainEx",
39702 : .tp_getset = py_lsa_CreateTrustedDomainEx_getsetters,
39703 : .tp_methods = py_lsa_CreateTrustedDomainEx_methods,
39704 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39705 : .tp_new = py_lsa_CreateTrustedDomainEx_new,
39706 : };
39707 :
39708 0 : static bool pack_py_lsa_CreateTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx *r)
39709 : {
39710 0 : PyObject *py_policy_handle;
39711 0 : PyObject *py_info;
39712 0 : PyObject *py_auth_info;
39713 0 : PyObject *py_access_mask;
39714 0 : const char *kwnames[] = {
39715 : "policy_handle", "info", "auth_info", "access_mask", NULL
39716 : };
39717 :
39718 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)) {
39719 0 : return false;
39720 : }
39721 :
39722 0 : if (py_policy_handle == NULL) {
39723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.policy_handle");
39724 0 : return false;
39725 : }
39726 0 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
39727 0 : if (r->in.policy_handle == NULL) {
39728 0 : PyErr_NoMemory();
39729 0 : return false;
39730 : }
39731 0 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
39732 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
39733 0 : PyErr_NoMemory();
39734 0 : return false;
39735 : }
39736 0 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
39737 0 : if (py_info == NULL) {
39738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
39739 0 : return false;
39740 : }
39741 0 : r->in.info = talloc_ptrtype(r, r->in.info);
39742 0 : if (r->in.info == NULL) {
39743 0 : PyErr_NoMemory();
39744 0 : return false;
39745 : }
39746 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
39747 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
39748 0 : PyErr_NoMemory();
39749 0 : return false;
39750 : }
39751 0 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
39752 0 : if (py_auth_info == NULL) {
39753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.auth_info");
39754 0 : return false;
39755 : }
39756 0 : r->in.auth_info = talloc_ptrtype(r, r->in.auth_info);
39757 0 : if (r->in.auth_info == NULL) {
39758 0 : PyErr_NoMemory();
39759 0 : return false;
39760 : }
39761 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfo_Type, py_auth_info, return false;);
39762 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info)) == NULL) {
39763 0 : PyErr_NoMemory();
39764 0 : return false;
39765 : }
39766 0 : r->in.auth_info = (struct lsa_TrustDomainInfoAuthInfo *)pytalloc_get_ptr(py_auth_info);
39767 0 : if (py_access_mask == NULL) {
39768 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
39769 0 : return false;
39770 : }
39771 : {
39772 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
39773 0 : if (PyLong_Check(py_access_mask)) {
39774 0 : unsigned long long test_var;
39775 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
39776 0 : if (PyErr_Occurred() != NULL) {
39777 0 : return false;
39778 : }
39779 0 : if (test_var > uint_max) {
39780 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39781 : PyLong_Type.tp_name, uint_max, test_var);
39782 0 : return false;
39783 : }
39784 0 : r->in.access_mask = test_var;
39785 : } else {
39786 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39787 : PyLong_Type.tp_name);
39788 0 : return false;
39789 : }
39790 : }
39791 0 : return true;
39792 : }
39793 :
39794 0 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx_args_out(struct lsa_CreateTrustedDomainEx *r)
39795 : {
39796 0 : PyObject *result;
39797 0 : PyObject *py_trustdom_handle;
39798 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
39799 0 : result = py_trustdom_handle;
39800 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39801 0 : PyErr_SetNTSTATUS(r->out.result);
39802 0 : return NULL;
39803 : }
39804 :
39805 0 : return result;
39806 : }
39807 :
39808 :
39809 0 : static PyObject *py_lsa_CloseTrustedDomainEx_in_get_handle(PyObject *obj, void *closure)
39810 : {
39811 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(obj);
39812 0 : PyObject *py_handle;
39813 0 : if (object->in.handle == NULL) {
39814 0 : Py_RETURN_NONE;
39815 : }
39816 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
39817 0 : return py_handle;
39818 : }
39819 :
39820 0 : static int py_lsa_CloseTrustedDomainEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
39821 : {
39822 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39823 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
39824 0 : if (value == NULL) {
39825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
39826 0 : return -1;
39827 : }
39828 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
39829 0 : if (object->in.handle == NULL) {
39830 0 : PyErr_NoMemory();
39831 0 : return -1;
39832 : }
39833 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39834 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39835 0 : PyErr_NoMemory();
39836 0 : return -1;
39837 : }
39838 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39839 0 : return 0;
39840 : }
39841 :
39842 0 : static PyObject *py_lsa_CloseTrustedDomainEx_out_get_handle(PyObject *obj, void *closure)
39843 : {
39844 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(obj);
39845 0 : PyObject *py_handle;
39846 0 : if (object->out.handle == NULL) {
39847 0 : Py_RETURN_NONE;
39848 : }
39849 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
39850 0 : return py_handle;
39851 : }
39852 :
39853 0 : static int py_lsa_CloseTrustedDomainEx_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
39854 : {
39855 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39856 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
39857 0 : if (value == NULL) {
39858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
39859 0 : return -1;
39860 : }
39861 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
39862 0 : if (object->out.handle == NULL) {
39863 0 : PyErr_NoMemory();
39864 0 : return -1;
39865 : }
39866 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39867 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39868 0 : PyErr_NoMemory();
39869 0 : return -1;
39870 : }
39871 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
39872 0 : return 0;
39873 : }
39874 :
39875 0 : static PyObject *py_lsa_CloseTrustedDomainEx_get_result(PyObject *obj, void *closure)
39876 : {
39877 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(obj);
39878 0 : PyObject *py_result;
39879 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39880 0 : return py_result;
39881 : }
39882 :
39883 0 : static int py_lsa_CloseTrustedDomainEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
39884 : {
39885 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39886 0 : if (value == NULL) {
39887 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
39888 0 : return -1;
39889 : }
39890 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39891 0 : return 0;
39892 : }
39893 :
39894 : static PyGetSetDef py_lsa_CloseTrustedDomainEx_getsetters[] = {
39895 : {
39896 : .name = discard_const_p(char, "in_handle"),
39897 : .get = py_lsa_CloseTrustedDomainEx_in_get_handle,
39898 : .set = py_lsa_CloseTrustedDomainEx_in_set_handle,
39899 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39900 : },
39901 : {
39902 : .name = discard_const_p(char, "out_handle"),
39903 : .get = py_lsa_CloseTrustedDomainEx_out_get_handle,
39904 : .set = py_lsa_CloseTrustedDomainEx_out_set_handle,
39905 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39906 : },
39907 : {
39908 : .name = discard_const_p(char, "result"),
39909 : .get = py_lsa_CloseTrustedDomainEx_get_result,
39910 : .set = py_lsa_CloseTrustedDomainEx_set_result,
39911 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39912 : },
39913 : { .name = NULL }
39914 : };
39915 :
39916 0 : static PyObject *py_lsa_CloseTrustedDomainEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39917 : {
39918 0 : PyObject *self = pytalloc_new(struct lsa_CloseTrustedDomainEx, type);
39919 0 : struct lsa_CloseTrustedDomainEx *_self = (struct lsa_CloseTrustedDomainEx *)pytalloc_get_ptr(self);
39920 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39921 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
39922 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
39923 0 : return self;
39924 : }
39925 :
39926 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39927 : {
39928 :
39929 :
39930 0 : return PyLong_FromLong(52);
39931 : }
39932 :
39933 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39934 : {
39935 0 : const struct ndr_interface_call *call = NULL;
39936 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
39937 0 : PyObject *ret = NULL;
39938 0 : struct ndr_push *push = NULL;
39939 0 : DATA_BLOB blob;
39940 0 : enum ndr_err_code err;
39941 :
39942 0 : if (ndr_table_lsarpc.num_calls < 53) {
39943 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_pack");
39944 0 : return NULL;
39945 : }
39946 0 : call = &ndr_table_lsarpc.calls[52];
39947 :
39948 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39949 0 : if (push == NULL) {
39950 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39951 0 : return NULL;
39952 : }
39953 :
39954 0 : push->flags |= ndr_push_flags;
39955 :
39956 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39957 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39958 0 : TALLOC_FREE(push);
39959 0 : PyErr_SetNdrError(err);
39960 0 : return NULL;
39961 : }
39962 0 : blob = ndr_push_blob(push);
39963 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39964 0 : TALLOC_FREE(push);
39965 0 : return ret;
39966 : }
39967 :
39968 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39969 : {
39970 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39971 0 : PyObject *bigendian_obj = NULL;
39972 0 : PyObject *ndr64_obj = NULL;
39973 0 : libndr_flags ndr_push_flags = 0;
39974 :
39975 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39976 : discard_const_p(char *, kwnames),
39977 : &bigendian_obj,
39978 : &ndr64_obj)) {
39979 0 : return NULL;
39980 : }
39981 :
39982 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39983 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39984 : }
39985 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39986 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39987 : }
39988 :
39989 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39990 : }
39991 :
39992 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39993 : {
39994 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39995 0 : PyObject *bigendian_obj = NULL;
39996 0 : PyObject *ndr64_obj = NULL;
39997 0 : libndr_flags ndr_push_flags = 0;
39998 :
39999 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40000 : discard_const_p(char *, kwnames),
40001 : &bigendian_obj,
40002 : &ndr64_obj)) {
40003 0 : return NULL;
40004 : }
40005 :
40006 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40007 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40008 : }
40009 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40010 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40011 : }
40012 :
40013 0 : return py_lsa_CloseTrustedDomainEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40014 : }
40015 :
40016 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)
40017 : {
40018 0 : const struct ndr_interface_call *call = NULL;
40019 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
40020 0 : struct ndr_pull *pull = NULL;
40021 0 : enum ndr_err_code err;
40022 :
40023 0 : if (ndr_table_lsarpc.num_calls < 53) {
40024 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_unpack");
40025 0 : return NULL;
40026 : }
40027 0 : call = &ndr_table_lsarpc.calls[52];
40028 :
40029 0 : pull = ndr_pull_init_blob(blob, object);
40030 0 : if (pull == NULL) {
40031 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40032 0 : return NULL;
40033 : }
40034 :
40035 0 : pull->flags |= ndr_pull_flags;
40036 :
40037 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40038 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40039 0 : TALLOC_FREE(pull);
40040 0 : PyErr_SetNdrError(err);
40041 0 : return NULL;
40042 : }
40043 0 : if (!allow_remaining) {
40044 0 : uint32_t highest_ofs;
40045 :
40046 0 : if (pull->offset > pull->relative_highest_offset) {
40047 0 : highest_ofs = pull->offset;
40048 : } else {
40049 0 : highest_ofs = pull->relative_highest_offset;
40050 : }
40051 0 : if (highest_ofs < pull->data_size) {
40052 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40053 : "not all bytes consumed ofs[%u] size[%u]",
40054 : highest_ofs, pull->data_size);
40055 0 : TALLOC_FREE(pull);
40056 0 : PyErr_SetNdrError(err);
40057 0 : return NULL;
40058 : }
40059 : }
40060 :
40061 0 : TALLOC_FREE(pull);
40062 0 : Py_RETURN_NONE;
40063 : }
40064 :
40065 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40066 : {
40067 0 : DATA_BLOB blob;
40068 0 : Py_ssize_t blob_length = 0;
40069 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40070 0 : PyObject *bigendian_obj = NULL;
40071 0 : PyObject *ndr64_obj = NULL;
40072 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40073 0 : PyObject *allow_remaining_obj = NULL;
40074 0 : bool allow_remaining = false;
40075 :
40076 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40077 : discard_const_p(char *, kwnames),
40078 : &blob.data, &blob_length,
40079 : &bigendian_obj,
40080 : &ndr64_obj,
40081 : &allow_remaining_obj)) {
40082 0 : return NULL;
40083 : }
40084 0 : blob.length = blob_length;
40085 :
40086 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40087 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40088 : }
40089 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40090 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40091 : }
40092 :
40093 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40094 0 : allow_remaining = true;
40095 : }
40096 :
40097 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40098 : }
40099 :
40100 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40101 : {
40102 0 : DATA_BLOB blob;
40103 0 : Py_ssize_t blob_length = 0;
40104 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40105 0 : PyObject *bigendian_obj = NULL;
40106 0 : PyObject *ndr64_obj = NULL;
40107 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40108 0 : PyObject *allow_remaining_obj = NULL;
40109 0 : bool allow_remaining = false;
40110 :
40111 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40112 : discard_const_p(char *, kwnames),
40113 : &blob.data, &blob_length,
40114 : &bigendian_obj,
40115 : &ndr64_obj,
40116 : &allow_remaining_obj)) {
40117 0 : return NULL;
40118 : }
40119 0 : blob.length = blob_length;
40120 :
40121 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40122 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40123 : }
40124 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40125 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40126 : }
40127 :
40128 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40129 0 : allow_remaining = true;
40130 : }
40131 :
40132 0 : return py_lsa_CloseTrustedDomainEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40133 : }
40134 :
40135 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40136 : {
40137 0 : const struct ndr_interface_call *call = NULL;
40138 0 : struct lsa_CloseTrustedDomainEx *object = pytalloc_get_ptr(py_obj);
40139 0 : PyObject *ret;
40140 0 : char *retstr;
40141 :
40142 0 : if (ndr_table_lsarpc.num_calls < 53) {
40143 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CloseTrustedDomainEx_ndr_print");
40144 0 : return NULL;
40145 : }
40146 0 : call = &ndr_table_lsarpc.calls[52];
40147 :
40148 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40149 0 : ret = PyUnicode_FromString(retstr);
40150 0 : TALLOC_FREE(retstr);
40151 :
40152 0 : return ret;
40153 : }
40154 :
40155 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40156 : {
40157 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_in", NDR_IN);
40158 : }
40159 :
40160 0 : static PyObject *py_lsa_CloseTrustedDomainEx_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40161 : {
40162 0 : return py_lsa_CloseTrustedDomainEx_ndr_print(py_obj, "lsa_CloseTrustedDomainEx_out", NDR_OUT);
40163 : }
40164 :
40165 : static PyMethodDef py_lsa_CloseTrustedDomainEx_methods[] = {
40166 : { "opnum", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_opnum, METH_NOARGS|METH_CLASS,
40167 : "lsa.CloseTrustedDomainEx.opnum() -> 52 (0x34) " },
40168 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40169 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40170 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40171 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40172 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40173 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40174 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CloseTrustedDomainEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40175 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40176 : { "__ndr_print_in__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40177 : { "__ndr_print_out__", (PyCFunction)py_lsa_CloseTrustedDomainEx_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40178 : { NULL, NULL, 0, NULL }
40179 : };
40180 :
40181 :
40182 : static PyTypeObject lsa_CloseTrustedDomainEx_Type = {
40183 : PyVarObject_HEAD_INIT(NULL, 0)
40184 : .tp_name = "lsa.CloseTrustedDomainEx",
40185 : .tp_getset = py_lsa_CloseTrustedDomainEx_getsetters,
40186 : .tp_methods = py_lsa_CloseTrustedDomainEx_methods,
40187 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40188 : .tp_new = py_lsa_CloseTrustedDomainEx_new,
40189 : };
40190 :
40191 0 : static bool pack_py_lsa_CloseTrustedDomainEx_args_in(PyObject *args, PyObject *kwargs, struct lsa_CloseTrustedDomainEx *r)
40192 : {
40193 0 : PyObject *py_handle;
40194 0 : const char *kwnames[] = {
40195 : "handle", NULL
40196 : };
40197 :
40198 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:lsa_CloseTrustedDomainEx", discard_const_p(char *, kwnames), &py_handle)) {
40199 0 : return false;
40200 : }
40201 :
40202 0 : if (py_handle == NULL) {
40203 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
40204 0 : return false;
40205 : }
40206 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
40207 0 : if (r->in.handle == NULL) {
40208 0 : PyErr_NoMemory();
40209 0 : return false;
40210 : }
40211 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
40212 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
40213 0 : PyErr_NoMemory();
40214 0 : return false;
40215 : }
40216 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
40217 0 : return true;
40218 : }
40219 :
40220 0 : static PyObject *unpack_py_lsa_CloseTrustedDomainEx_args_out(struct lsa_CloseTrustedDomainEx *r)
40221 : {
40222 0 : PyObject *result;
40223 0 : PyObject *py_handle;
40224 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
40225 0 : result = py_handle;
40226 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40227 0 : PyErr_SetNTSTATUS(r->out.result);
40228 0 : return NULL;
40229 : }
40230 :
40231 0 : return result;
40232 : }
40233 :
40234 :
40235 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
40236 : {
40237 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40238 0 : PyObject *py_handle;
40239 0 : if (object->in.handle == NULL) {
40240 0 : Py_RETURN_NONE;
40241 : }
40242 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40243 0 : return py_handle;
40244 : }
40245 :
40246 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40247 : {
40248 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40249 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40250 0 : if (value == NULL) {
40251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
40252 0 : return -1;
40253 : }
40254 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40255 0 : if (object->in.handle == NULL) {
40256 0 : PyErr_NoMemory();
40257 0 : return -1;
40258 : }
40259 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40260 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40261 0 : PyErr_NoMemory();
40262 0 : return -1;
40263 : }
40264 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40265 0 : return 0;
40266 : }
40267 :
40268 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
40269 : {
40270 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40271 0 : PyObject *py_level;
40272 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
40273 0 : return py_level;
40274 : }
40275 :
40276 0 : static int py_lsa_QueryDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
40277 : {
40278 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40279 0 : if (value == NULL) {
40280 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
40281 0 : return -1;
40282 : }
40283 : {
40284 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
40285 0 : if (PyLong_Check(value)) {
40286 0 : unsigned long long test_var;
40287 0 : test_var = PyLong_AsUnsignedLongLong(value);
40288 0 : if (PyErr_Occurred() != NULL) {
40289 0 : return -1;
40290 : }
40291 0 : if (test_var > uint_max) {
40292 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40293 : PyLong_Type.tp_name, uint_max, test_var);
40294 0 : return -1;
40295 : }
40296 0 : object->in.level = test_var;
40297 : } else {
40298 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40299 : PyLong_Type.tp_name);
40300 0 : return -1;
40301 : }
40302 : }
40303 0 : return 0;
40304 : }
40305 :
40306 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_out_get_info(PyObject *obj, void *closure)
40307 : {
40308 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40309 0 : PyObject *py_info;
40310 0 : if (object->out.info == NULL) {
40311 0 : Py_RETURN_NONE;
40312 : }
40313 0 : if (*object->out.info == NULL) {
40314 0 : py_info = Py_None;
40315 0 : Py_INCREF(py_info);
40316 : } else {
40317 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *object->out.info, object->in.level, *object->out.info, "union lsa_DomainInformationPolicy");
40318 0 : if (py_info == NULL) {
40319 0 : return NULL;
40320 : }
40321 : }
40322 0 : return py_info;
40323 : }
40324 :
40325 0 : static int py_lsa_QueryDomainInformationPolicy_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
40326 : {
40327 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40328 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
40329 0 : if (value == NULL) {
40330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
40331 0 : return -1;
40332 : }
40333 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
40334 0 : if (object->out.info == NULL) {
40335 0 : PyErr_NoMemory();
40336 0 : return -1;
40337 : }
40338 0 : if (value == Py_None) {
40339 0 : *object->out.info = NULL;
40340 : } else {
40341 0 : *object->out.info = NULL;
40342 : {
40343 0 : union lsa_DomainInformationPolicy *info_switch_2;
40344 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");
40345 0 : if (info_switch_2 == NULL) {
40346 0 : return -1;
40347 : }
40348 0 : *object->out.info = info_switch_2;
40349 : }
40350 : }
40351 0 : return 0;
40352 : }
40353 :
40354 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_get_result(PyObject *obj, void *closure)
40355 : {
40356 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40357 0 : PyObject *py_result;
40358 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40359 0 : return py_result;
40360 : }
40361 :
40362 0 : static int py_lsa_QueryDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
40363 : {
40364 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40365 0 : if (value == NULL) {
40366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
40367 0 : return -1;
40368 : }
40369 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40370 0 : return 0;
40371 : }
40372 :
40373 : static PyGetSetDef py_lsa_QueryDomainInformationPolicy_getsetters[] = {
40374 : {
40375 : .name = discard_const_p(char, "in_handle"),
40376 : .get = py_lsa_QueryDomainInformationPolicy_in_get_handle,
40377 : .set = py_lsa_QueryDomainInformationPolicy_in_set_handle,
40378 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40379 : },
40380 : {
40381 : .name = discard_const_p(char, "in_level"),
40382 : .get = py_lsa_QueryDomainInformationPolicy_in_get_level,
40383 : .set = py_lsa_QueryDomainInformationPolicy_in_set_level,
40384 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfoEnum")
40385 : },
40386 : {
40387 : .name = discard_const_p(char, "out_info"),
40388 : .get = py_lsa_QueryDomainInformationPolicy_out_get_info,
40389 : .set = py_lsa_QueryDomainInformationPolicy_out_set_info,
40390 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
40391 : },
40392 : {
40393 : .name = discard_const_p(char, "result"),
40394 : .get = py_lsa_QueryDomainInformationPolicy_get_result,
40395 : .set = py_lsa_QueryDomainInformationPolicy_set_result,
40396 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40397 : },
40398 : { .name = NULL }
40399 : };
40400 :
40401 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40402 : {
40403 0 : PyObject *self = pytalloc_new(struct lsa_QueryDomainInformationPolicy, type);
40404 0 : struct lsa_QueryDomainInformationPolicy *_self = (struct lsa_QueryDomainInformationPolicy *)pytalloc_get_ptr(self);
40405 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40406 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
40407 : /* a pointer to a NULL pointer */
40408 0 : _self->out.info = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy *);
40409 0 : return self;
40410 : }
40411 :
40412 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40413 : {
40414 :
40415 :
40416 0 : return PyLong_FromLong(53);
40417 : }
40418 :
40419 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40420 : {
40421 0 : const struct ndr_interface_call *call = NULL;
40422 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40423 0 : PyObject *ret = NULL;
40424 0 : struct ndr_push *push = NULL;
40425 0 : DATA_BLOB blob;
40426 0 : enum ndr_err_code err;
40427 :
40428 0 : if (ndr_table_lsarpc.num_calls < 54) {
40429 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_pack");
40430 0 : return NULL;
40431 : }
40432 0 : call = &ndr_table_lsarpc.calls[53];
40433 :
40434 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40435 0 : if (push == NULL) {
40436 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40437 0 : return NULL;
40438 : }
40439 :
40440 0 : push->flags |= ndr_push_flags;
40441 :
40442 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40443 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40444 0 : TALLOC_FREE(push);
40445 0 : PyErr_SetNdrError(err);
40446 0 : return NULL;
40447 : }
40448 0 : blob = ndr_push_blob(push);
40449 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40450 0 : TALLOC_FREE(push);
40451 0 : return ret;
40452 : }
40453 :
40454 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40455 : {
40456 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40457 0 : PyObject *bigendian_obj = NULL;
40458 0 : PyObject *ndr64_obj = NULL;
40459 0 : libndr_flags ndr_push_flags = 0;
40460 :
40461 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40462 : discard_const_p(char *, kwnames),
40463 : &bigendian_obj,
40464 : &ndr64_obj)) {
40465 0 : return NULL;
40466 : }
40467 :
40468 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40469 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40470 : }
40471 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40472 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40473 : }
40474 :
40475 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40476 : }
40477 :
40478 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40479 : {
40480 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40481 0 : PyObject *bigendian_obj = NULL;
40482 0 : PyObject *ndr64_obj = NULL;
40483 0 : libndr_flags ndr_push_flags = 0;
40484 :
40485 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40486 : discard_const_p(char *, kwnames),
40487 : &bigendian_obj,
40488 : &ndr64_obj)) {
40489 0 : return NULL;
40490 : }
40491 :
40492 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40493 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40494 : }
40495 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40496 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40497 : }
40498 :
40499 0 : return py_lsa_QueryDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40500 : }
40501 :
40502 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)
40503 : {
40504 0 : const struct ndr_interface_call *call = NULL;
40505 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40506 0 : struct ndr_pull *pull = NULL;
40507 0 : enum ndr_err_code err;
40508 :
40509 0 : if (ndr_table_lsarpc.num_calls < 54) {
40510 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_unpack");
40511 0 : return NULL;
40512 : }
40513 0 : call = &ndr_table_lsarpc.calls[53];
40514 :
40515 0 : pull = ndr_pull_init_blob(blob, object);
40516 0 : if (pull == NULL) {
40517 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40518 0 : return NULL;
40519 : }
40520 :
40521 0 : pull->flags |= ndr_pull_flags;
40522 :
40523 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40524 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40525 0 : TALLOC_FREE(pull);
40526 0 : PyErr_SetNdrError(err);
40527 0 : return NULL;
40528 : }
40529 0 : if (!allow_remaining) {
40530 0 : uint32_t highest_ofs;
40531 :
40532 0 : if (pull->offset > pull->relative_highest_offset) {
40533 0 : highest_ofs = pull->offset;
40534 : } else {
40535 0 : highest_ofs = pull->relative_highest_offset;
40536 : }
40537 0 : if (highest_ofs < pull->data_size) {
40538 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40539 : "not all bytes consumed ofs[%u] size[%u]",
40540 : highest_ofs, pull->data_size);
40541 0 : TALLOC_FREE(pull);
40542 0 : PyErr_SetNdrError(err);
40543 0 : return NULL;
40544 : }
40545 : }
40546 :
40547 0 : TALLOC_FREE(pull);
40548 0 : Py_RETURN_NONE;
40549 : }
40550 :
40551 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40552 : {
40553 0 : DATA_BLOB blob;
40554 0 : Py_ssize_t blob_length = 0;
40555 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40556 0 : PyObject *bigendian_obj = NULL;
40557 0 : PyObject *ndr64_obj = NULL;
40558 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40559 0 : PyObject *allow_remaining_obj = NULL;
40560 0 : bool allow_remaining = false;
40561 :
40562 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40563 : discard_const_p(char *, kwnames),
40564 : &blob.data, &blob_length,
40565 : &bigendian_obj,
40566 : &ndr64_obj,
40567 : &allow_remaining_obj)) {
40568 0 : return NULL;
40569 : }
40570 0 : blob.length = blob_length;
40571 :
40572 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40573 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40574 : }
40575 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40576 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40577 : }
40578 :
40579 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40580 0 : allow_remaining = true;
40581 : }
40582 :
40583 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40584 : }
40585 :
40586 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40587 : {
40588 0 : DATA_BLOB blob;
40589 0 : Py_ssize_t blob_length = 0;
40590 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40591 0 : PyObject *bigendian_obj = NULL;
40592 0 : PyObject *ndr64_obj = NULL;
40593 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40594 0 : PyObject *allow_remaining_obj = NULL;
40595 0 : bool allow_remaining = false;
40596 :
40597 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40598 : discard_const_p(char *, kwnames),
40599 : &blob.data, &blob_length,
40600 : &bigendian_obj,
40601 : &ndr64_obj,
40602 : &allow_remaining_obj)) {
40603 0 : return NULL;
40604 : }
40605 0 : blob.length = blob_length;
40606 :
40607 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40608 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40609 : }
40610 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40611 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40612 : }
40613 :
40614 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40615 0 : allow_remaining = true;
40616 : }
40617 :
40618 0 : return py_lsa_QueryDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40619 : }
40620 :
40621 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40622 : {
40623 0 : const struct ndr_interface_call *call = NULL;
40624 0 : struct lsa_QueryDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40625 0 : PyObject *ret;
40626 0 : char *retstr;
40627 :
40628 0 : if (ndr_table_lsarpc.num_calls < 54) {
40629 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_QueryDomainInformationPolicy_ndr_print");
40630 0 : return NULL;
40631 : }
40632 0 : call = &ndr_table_lsarpc.calls[53];
40633 :
40634 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40635 0 : ret = PyUnicode_FromString(retstr);
40636 0 : TALLOC_FREE(retstr);
40637 :
40638 0 : return ret;
40639 : }
40640 :
40641 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40642 : {
40643 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_in", NDR_IN);
40644 : }
40645 :
40646 0 : static PyObject *py_lsa_QueryDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40647 : {
40648 0 : return py_lsa_QueryDomainInformationPolicy_ndr_print(py_obj, "lsa_QueryDomainInformationPolicy_out", NDR_OUT);
40649 : }
40650 :
40651 : static PyMethodDef py_lsa_QueryDomainInformationPolicy_methods[] = {
40652 : { "opnum", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
40653 : "lsa.QueryDomainInformationPolicy.opnum() -> 53 (0x35) " },
40654 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40655 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40656 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40657 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40658 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40659 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40660 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_QueryDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40661 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40662 : { "__ndr_print_in__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40663 : { "__ndr_print_out__", (PyCFunction)py_lsa_QueryDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40664 : { NULL, NULL, 0, NULL }
40665 : };
40666 :
40667 :
40668 : static PyTypeObject lsa_QueryDomainInformationPolicy_Type = {
40669 : PyVarObject_HEAD_INIT(NULL, 0)
40670 : .tp_name = "lsa.QueryDomainInformationPolicy",
40671 : .tp_getset = py_lsa_QueryDomainInformationPolicy_getsetters,
40672 : .tp_methods = py_lsa_QueryDomainInformationPolicy_methods,
40673 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40674 : .tp_new = py_lsa_QueryDomainInformationPolicy_new,
40675 : };
40676 :
40677 0 : static bool pack_py_lsa_QueryDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_QueryDomainInformationPolicy *r)
40678 : {
40679 0 : PyObject *py_handle;
40680 0 : PyObject *py_level;
40681 0 : const char *kwnames[] = {
40682 : "handle", "level", NULL
40683 : };
40684 :
40685 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:lsa_QueryDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level)) {
40686 0 : return false;
40687 : }
40688 :
40689 0 : if (py_handle == NULL) {
40690 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
40691 0 : return false;
40692 : }
40693 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
40694 0 : if (r->in.handle == NULL) {
40695 0 : PyErr_NoMemory();
40696 0 : return false;
40697 : }
40698 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
40699 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
40700 0 : PyErr_NoMemory();
40701 0 : return false;
40702 : }
40703 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
40704 0 : if (py_level == NULL) {
40705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
40706 0 : return false;
40707 : }
40708 : {
40709 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
40710 0 : if (PyLong_Check(py_level)) {
40711 0 : unsigned long long test_var;
40712 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
40713 0 : if (PyErr_Occurred() != NULL) {
40714 0 : return false;
40715 : }
40716 0 : if (test_var > uint_max) {
40717 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40718 : PyLong_Type.tp_name, uint_max, test_var);
40719 0 : return false;
40720 : }
40721 0 : r->in.level = test_var;
40722 : } else {
40723 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40724 : PyLong_Type.tp_name);
40725 0 : return false;
40726 : }
40727 : }
40728 0 : return true;
40729 : }
40730 :
40731 0 : static PyObject *unpack_py_lsa_QueryDomainInformationPolicy_args_out(struct lsa_QueryDomainInformationPolicy *r)
40732 : {
40733 0 : PyObject *result;
40734 0 : PyObject *py_info;
40735 0 : if (*r->out.info == NULL) {
40736 0 : py_info = Py_None;
40737 0 : Py_INCREF(py_info);
40738 : } else {
40739 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, *r->out.info, r->in.level, *r->out.info, "union lsa_DomainInformationPolicy");
40740 0 : if (py_info == NULL) {
40741 0 : return NULL;
40742 : }
40743 : }
40744 0 : result = py_info;
40745 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40746 0 : PyErr_SetNTSTATUS(r->out.result);
40747 0 : return NULL;
40748 : }
40749 :
40750 0 : return result;
40751 : }
40752 :
40753 :
40754 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_handle(PyObject *obj, void *closure)
40755 : {
40756 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40757 0 : PyObject *py_handle;
40758 0 : if (object->in.handle == NULL) {
40759 0 : Py_RETURN_NONE;
40760 : }
40761 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
40762 0 : return py_handle;
40763 : }
40764 :
40765 0 : static int py_lsa_SetDomainInformationPolicy_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
40766 : {
40767 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40768 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
40769 0 : if (value == NULL) {
40770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
40771 0 : return -1;
40772 : }
40773 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
40774 0 : if (object->in.handle == NULL) {
40775 0 : PyErr_NoMemory();
40776 0 : return -1;
40777 : }
40778 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40779 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40780 0 : PyErr_NoMemory();
40781 0 : return -1;
40782 : }
40783 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
40784 0 : return 0;
40785 : }
40786 :
40787 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_level(PyObject *obj, void *closure)
40788 : {
40789 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40790 0 : PyObject *py_level;
40791 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
40792 0 : return py_level;
40793 : }
40794 :
40795 0 : static int py_lsa_SetDomainInformationPolicy_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
40796 : {
40797 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40798 0 : if (value == NULL) {
40799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
40800 0 : return -1;
40801 : }
40802 : {
40803 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
40804 0 : if (PyLong_Check(value)) {
40805 0 : unsigned long long test_var;
40806 0 : test_var = PyLong_AsUnsignedLongLong(value);
40807 0 : if (PyErr_Occurred() != NULL) {
40808 0 : return -1;
40809 : }
40810 0 : if (test_var > uint_max) {
40811 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40812 : PyLong_Type.tp_name, uint_max, test_var);
40813 0 : return -1;
40814 : }
40815 0 : object->in.level = test_var;
40816 : } else {
40817 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40818 : PyLong_Type.tp_name);
40819 0 : return -1;
40820 : }
40821 : }
40822 0 : return 0;
40823 : }
40824 :
40825 0 : static PyObject *py_lsa_SetDomainInformationPolicy_in_get_info(PyObject *obj, void *closure)
40826 : {
40827 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40828 0 : PyObject *py_info;
40829 0 : if (object->in.info == NULL) {
40830 0 : Py_RETURN_NONE;
40831 : }
40832 0 : if (object->in.info == NULL) {
40833 0 : py_info = Py_None;
40834 0 : Py_INCREF(py_info);
40835 : } else {
40836 0 : py_info = pyrpc_import_union(&lsa_DomainInformationPolicy_Type, object->in.info, object->in.level, object->in.info, "union lsa_DomainInformationPolicy");
40837 0 : if (py_info == NULL) {
40838 0 : return NULL;
40839 : }
40840 : }
40841 0 : return py_info;
40842 : }
40843 :
40844 0 : static int py_lsa_SetDomainInformationPolicy_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
40845 : {
40846 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40847 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
40848 0 : if (value == NULL) {
40849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
40850 0 : return -1;
40851 : }
40852 0 : if (value == Py_None) {
40853 0 : object->in.info = NULL;
40854 : } else {
40855 0 : object->in.info = NULL;
40856 : {
40857 0 : union lsa_DomainInformationPolicy *info_switch_1;
40858 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");
40859 0 : if (info_switch_1 == NULL) {
40860 0 : return -1;
40861 : }
40862 0 : object->in.info = info_switch_1;
40863 : }
40864 : }
40865 0 : return 0;
40866 : }
40867 :
40868 0 : static PyObject *py_lsa_SetDomainInformationPolicy_get_result(PyObject *obj, void *closure)
40869 : {
40870 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(obj);
40871 0 : PyObject *py_result;
40872 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40873 0 : return py_result;
40874 : }
40875 :
40876 0 : static int py_lsa_SetDomainInformationPolicy_set_result(PyObject *py_obj, PyObject *value, void *closure)
40877 : {
40878 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40879 0 : if (value == NULL) {
40880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
40881 0 : return -1;
40882 : }
40883 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40884 0 : return 0;
40885 : }
40886 :
40887 : static PyGetSetDef py_lsa_SetDomainInformationPolicy_getsetters[] = {
40888 : {
40889 : .name = discard_const_p(char, "in_handle"),
40890 : .get = py_lsa_SetDomainInformationPolicy_in_get_handle,
40891 : .set = py_lsa_SetDomainInformationPolicy_in_set_handle,
40892 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40893 : },
40894 : {
40895 : .name = discard_const_p(char, "in_level"),
40896 : .get = py_lsa_SetDomainInformationPolicy_in_get_level,
40897 : .set = py_lsa_SetDomainInformationPolicy_in_set_level,
40898 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInfoEnum")
40899 : },
40900 : {
40901 : .name = discard_const_p(char, "in_info"),
40902 : .get = py_lsa_SetDomainInformationPolicy_in_get_info,
40903 : .set = py_lsa_SetDomainInformationPolicy_in_set_info,
40904 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_DomainInformationPolicy")
40905 : },
40906 : {
40907 : .name = discard_const_p(char, "result"),
40908 : .get = py_lsa_SetDomainInformationPolicy_get_result,
40909 : .set = py_lsa_SetDomainInformationPolicy_set_result,
40910 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40911 : },
40912 : { .name = NULL }
40913 : };
40914 :
40915 0 : static PyObject *py_lsa_SetDomainInformationPolicy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40916 : {
40917 0 : PyObject *self = pytalloc_new(struct lsa_SetDomainInformationPolicy, type);
40918 0 : struct lsa_SetDomainInformationPolicy *_self = (struct lsa_SetDomainInformationPolicy *)pytalloc_get_ptr(self);
40919 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40920 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
40921 0 : return self;
40922 : }
40923 :
40924 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40925 : {
40926 :
40927 :
40928 0 : return PyLong_FromLong(54);
40929 : }
40930 :
40931 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40932 : {
40933 0 : const struct ndr_interface_call *call = NULL;
40934 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
40935 0 : PyObject *ret = NULL;
40936 0 : struct ndr_push *push = NULL;
40937 0 : DATA_BLOB blob;
40938 0 : enum ndr_err_code err;
40939 :
40940 0 : if (ndr_table_lsarpc.num_calls < 55) {
40941 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_pack");
40942 0 : return NULL;
40943 : }
40944 0 : call = &ndr_table_lsarpc.calls[54];
40945 :
40946 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40947 0 : if (push == NULL) {
40948 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40949 0 : return NULL;
40950 : }
40951 :
40952 0 : push->flags |= ndr_push_flags;
40953 :
40954 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40955 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40956 0 : TALLOC_FREE(push);
40957 0 : PyErr_SetNdrError(err);
40958 0 : return NULL;
40959 : }
40960 0 : blob = ndr_push_blob(push);
40961 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40962 0 : TALLOC_FREE(push);
40963 0 : return ret;
40964 : }
40965 :
40966 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40967 : {
40968 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40969 0 : PyObject *bigendian_obj = NULL;
40970 0 : PyObject *ndr64_obj = NULL;
40971 0 : libndr_flags ndr_push_flags = 0;
40972 :
40973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40974 : discard_const_p(char *, kwnames),
40975 : &bigendian_obj,
40976 : &ndr64_obj)) {
40977 0 : return NULL;
40978 : }
40979 :
40980 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40981 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40982 : }
40983 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40984 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40985 : }
40986 :
40987 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40988 : }
40989 :
40990 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40991 : {
40992 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40993 0 : PyObject *bigendian_obj = NULL;
40994 0 : PyObject *ndr64_obj = NULL;
40995 0 : libndr_flags ndr_push_flags = 0;
40996 :
40997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40998 : discard_const_p(char *, kwnames),
40999 : &bigendian_obj,
41000 : &ndr64_obj)) {
41001 0 : return NULL;
41002 : }
41003 :
41004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41005 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41006 : }
41007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41008 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41009 : }
41010 :
41011 0 : return py_lsa_SetDomainInformationPolicy_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41012 : }
41013 :
41014 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)
41015 : {
41016 0 : const struct ndr_interface_call *call = NULL;
41017 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
41018 0 : struct ndr_pull *pull = NULL;
41019 0 : enum ndr_err_code err;
41020 :
41021 0 : if (ndr_table_lsarpc.num_calls < 55) {
41022 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_unpack");
41023 0 : return NULL;
41024 : }
41025 0 : call = &ndr_table_lsarpc.calls[54];
41026 :
41027 0 : pull = ndr_pull_init_blob(blob, object);
41028 0 : if (pull == NULL) {
41029 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41030 0 : return NULL;
41031 : }
41032 :
41033 0 : pull->flags |= ndr_pull_flags;
41034 :
41035 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41037 0 : TALLOC_FREE(pull);
41038 0 : PyErr_SetNdrError(err);
41039 0 : return NULL;
41040 : }
41041 0 : if (!allow_remaining) {
41042 0 : uint32_t highest_ofs;
41043 :
41044 0 : if (pull->offset > pull->relative_highest_offset) {
41045 0 : highest_ofs = pull->offset;
41046 : } else {
41047 0 : highest_ofs = pull->relative_highest_offset;
41048 : }
41049 0 : if (highest_ofs < pull->data_size) {
41050 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41051 : "not all bytes consumed ofs[%u] size[%u]",
41052 : highest_ofs, pull->data_size);
41053 0 : TALLOC_FREE(pull);
41054 0 : PyErr_SetNdrError(err);
41055 0 : return NULL;
41056 : }
41057 : }
41058 :
41059 0 : TALLOC_FREE(pull);
41060 0 : Py_RETURN_NONE;
41061 : }
41062 :
41063 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41064 : {
41065 0 : DATA_BLOB blob;
41066 0 : Py_ssize_t blob_length = 0;
41067 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41068 0 : PyObject *bigendian_obj = NULL;
41069 0 : PyObject *ndr64_obj = NULL;
41070 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41071 0 : PyObject *allow_remaining_obj = NULL;
41072 0 : bool allow_remaining = false;
41073 :
41074 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41075 : discard_const_p(char *, kwnames),
41076 : &blob.data, &blob_length,
41077 : &bigendian_obj,
41078 : &ndr64_obj,
41079 : &allow_remaining_obj)) {
41080 0 : return NULL;
41081 : }
41082 0 : blob.length = blob_length;
41083 :
41084 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41085 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41086 : }
41087 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41088 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41089 : }
41090 :
41091 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41092 0 : allow_remaining = true;
41093 : }
41094 :
41095 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41096 : }
41097 :
41098 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41099 : {
41100 0 : DATA_BLOB blob;
41101 0 : Py_ssize_t blob_length = 0;
41102 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41103 0 : PyObject *bigendian_obj = NULL;
41104 0 : PyObject *ndr64_obj = NULL;
41105 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41106 0 : PyObject *allow_remaining_obj = NULL;
41107 0 : bool allow_remaining = false;
41108 :
41109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41110 : discard_const_p(char *, kwnames),
41111 : &blob.data, &blob_length,
41112 : &bigendian_obj,
41113 : &ndr64_obj,
41114 : &allow_remaining_obj)) {
41115 0 : return NULL;
41116 : }
41117 0 : blob.length = blob_length;
41118 :
41119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41120 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41121 : }
41122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41123 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41124 : }
41125 :
41126 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41127 0 : allow_remaining = true;
41128 : }
41129 :
41130 0 : return py_lsa_SetDomainInformationPolicy_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41131 : }
41132 :
41133 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41134 : {
41135 0 : const struct ndr_interface_call *call = NULL;
41136 0 : struct lsa_SetDomainInformationPolicy *object = pytalloc_get_ptr(py_obj);
41137 0 : PyObject *ret;
41138 0 : char *retstr;
41139 :
41140 0 : if (ndr_table_lsarpc.num_calls < 55) {
41141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_SetDomainInformationPolicy_ndr_print");
41142 0 : return NULL;
41143 : }
41144 0 : call = &ndr_table_lsarpc.calls[54];
41145 :
41146 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41147 0 : ret = PyUnicode_FromString(retstr);
41148 0 : TALLOC_FREE(retstr);
41149 :
41150 0 : return ret;
41151 : }
41152 :
41153 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41154 : {
41155 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_in", NDR_IN);
41156 : }
41157 :
41158 0 : static PyObject *py_lsa_SetDomainInformationPolicy_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41159 : {
41160 0 : return py_lsa_SetDomainInformationPolicy_ndr_print(py_obj, "lsa_SetDomainInformationPolicy_out", NDR_OUT);
41161 : }
41162 :
41163 : static PyMethodDef py_lsa_SetDomainInformationPolicy_methods[] = {
41164 : { "opnum", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_opnum, METH_NOARGS|METH_CLASS,
41165 : "lsa.SetDomainInformationPolicy.opnum() -> 54 (0x36) " },
41166 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41167 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41168 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41169 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41170 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41171 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41172 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_SetDomainInformationPolicy_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41173 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41174 : { "__ndr_print_in__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41175 : { "__ndr_print_out__", (PyCFunction)py_lsa_SetDomainInformationPolicy_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41176 : { NULL, NULL, 0, NULL }
41177 : };
41178 :
41179 :
41180 : static PyTypeObject lsa_SetDomainInformationPolicy_Type = {
41181 : PyVarObject_HEAD_INIT(NULL, 0)
41182 : .tp_name = "lsa.SetDomainInformationPolicy",
41183 : .tp_getset = py_lsa_SetDomainInformationPolicy_getsetters,
41184 : .tp_methods = py_lsa_SetDomainInformationPolicy_methods,
41185 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41186 : .tp_new = py_lsa_SetDomainInformationPolicy_new,
41187 : };
41188 :
41189 0 : static bool pack_py_lsa_SetDomainInformationPolicy_args_in(PyObject *args, PyObject *kwargs, struct lsa_SetDomainInformationPolicy *r)
41190 : {
41191 0 : PyObject *py_handle;
41192 0 : PyObject *py_level;
41193 0 : PyObject *py_info;
41194 0 : const char *kwnames[] = {
41195 : "handle", "level", "info", NULL
41196 : };
41197 :
41198 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_SetDomainInformationPolicy", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_info)) {
41199 0 : return false;
41200 : }
41201 :
41202 0 : if (py_handle == NULL) {
41203 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
41204 0 : return false;
41205 : }
41206 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
41207 0 : if (r->in.handle == NULL) {
41208 0 : PyErr_NoMemory();
41209 0 : return false;
41210 : }
41211 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
41212 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
41213 0 : PyErr_NoMemory();
41214 0 : return false;
41215 : }
41216 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
41217 0 : if (py_level == NULL) {
41218 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
41219 0 : return false;
41220 : }
41221 : {
41222 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
41223 0 : if (PyLong_Check(py_level)) {
41224 0 : unsigned long long test_var;
41225 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
41226 0 : if (PyErr_Occurred() != NULL) {
41227 0 : return false;
41228 : }
41229 0 : if (test_var > uint_max) {
41230 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41231 : PyLong_Type.tp_name, uint_max, test_var);
41232 0 : return false;
41233 : }
41234 0 : r->in.level = test_var;
41235 : } else {
41236 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41237 : PyLong_Type.tp_name);
41238 0 : return false;
41239 : }
41240 : }
41241 0 : if (py_info == NULL) {
41242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
41243 0 : return false;
41244 : }
41245 0 : if (py_info == Py_None) {
41246 0 : r->in.info = NULL;
41247 : } else {
41248 0 : r->in.info = NULL;
41249 : {
41250 0 : union lsa_DomainInformationPolicy *info_switch_1;
41251 0 : info_switch_1 = (union lsa_DomainInformationPolicy *)pyrpc_export_union(&lsa_DomainInformationPolicy_Type, r, r->in.level, py_info, "union lsa_DomainInformationPolicy");
41252 0 : if (info_switch_1 == NULL) {
41253 0 : return false;
41254 : }
41255 0 : r->in.info = info_switch_1;
41256 : }
41257 : }
41258 0 : return true;
41259 : }
41260 :
41261 0 : static PyObject *unpack_py_lsa_SetDomainInformationPolicy_args_out(struct lsa_SetDomainInformationPolicy *r)
41262 : {
41263 0 : PyObject *result;
41264 0 : result = Py_None;
41265 0 : Py_INCREF(result);
41266 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41267 0 : PyErr_SetNTSTATUS(r->out.result);
41268 0 : return NULL;
41269 : }
41270 :
41271 0 : return result;
41272 : }
41273 :
41274 :
41275 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_handle(PyObject *obj, void *closure)
41276 : {
41277 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(obj);
41278 0 : PyObject *py_handle;
41279 0 : if (object->in.handle == NULL) {
41280 0 : Py_RETURN_NONE;
41281 : }
41282 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
41283 0 : return py_handle;
41284 : }
41285 :
41286 0 : static int py_lsa_OpenTrustedDomainByName_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
41287 : {
41288 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
41290 0 : if (value == NULL) {
41291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
41292 0 : return -1;
41293 : }
41294 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
41295 0 : if (object->in.handle == NULL) {
41296 0 : PyErr_NoMemory();
41297 0 : return -1;
41298 : }
41299 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41300 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41301 0 : PyErr_NoMemory();
41302 0 : return -1;
41303 : }
41304 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
41305 0 : return 0;
41306 : }
41307 :
41308 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_name(PyObject *obj, void *closure)
41309 : {
41310 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(obj);
41311 0 : PyObject *py_name;
41312 0 : py_name = pytalloc_reference_ex(&lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->in.name);
41313 0 : return py_name;
41314 : }
41315 :
41316 0 : static int py_lsa_OpenTrustedDomainByName_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
41317 : {
41318 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41319 0 : if (value == NULL) {
41320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.name");
41321 0 : return -1;
41322 : }
41323 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
41324 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41325 0 : PyErr_NoMemory();
41326 0 : return -1;
41327 : }
41328 0 : object->in.name = *(struct lsa_String *)pytalloc_get_ptr(value);
41329 0 : return 0;
41330 : }
41331 :
41332 0 : static PyObject *py_lsa_OpenTrustedDomainByName_in_get_access_mask(PyObject *obj, void *closure)
41333 : {
41334 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(obj);
41335 0 : PyObject *py_access_mask;
41336 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
41337 0 : return py_access_mask;
41338 : }
41339 :
41340 0 : static int py_lsa_OpenTrustedDomainByName_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
41341 : {
41342 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41343 0 : if (value == NULL) {
41344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
41345 0 : return -1;
41346 : }
41347 : {
41348 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
41349 0 : if (PyLong_Check(value)) {
41350 0 : unsigned long long test_var;
41351 0 : test_var = PyLong_AsUnsignedLongLong(value);
41352 0 : if (PyErr_Occurred() != NULL) {
41353 0 : return -1;
41354 : }
41355 0 : if (test_var > uint_max) {
41356 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41357 : PyLong_Type.tp_name, uint_max, test_var);
41358 0 : return -1;
41359 : }
41360 0 : object->in.access_mask = test_var;
41361 : } else {
41362 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41363 : PyLong_Type.tp_name);
41364 0 : return -1;
41365 : }
41366 : }
41367 0 : return 0;
41368 : }
41369 :
41370 0 : static PyObject *py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle(PyObject *obj, void *closure)
41371 : {
41372 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(obj);
41373 0 : PyObject *py_trustdom_handle;
41374 0 : if (object->out.trustdom_handle == NULL) {
41375 0 : Py_RETURN_NONE;
41376 : }
41377 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
41378 0 : return py_trustdom_handle;
41379 : }
41380 :
41381 0 : static int py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
41382 : {
41383 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41384 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
41385 0 : if (value == NULL) {
41386 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
41387 0 : return -1;
41388 : }
41389 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
41390 0 : if (object->out.trustdom_handle == NULL) {
41391 0 : PyErr_NoMemory();
41392 0 : return -1;
41393 : }
41394 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41395 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41396 0 : PyErr_NoMemory();
41397 0 : return -1;
41398 : }
41399 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
41400 0 : return 0;
41401 : }
41402 :
41403 0 : static PyObject *py_lsa_OpenTrustedDomainByName_get_result(PyObject *obj, void *closure)
41404 : {
41405 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(obj);
41406 0 : PyObject *py_result;
41407 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
41408 0 : return py_result;
41409 : }
41410 :
41411 0 : static int py_lsa_OpenTrustedDomainByName_set_result(PyObject *py_obj, PyObject *value, void *closure)
41412 : {
41413 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41414 0 : if (value == NULL) {
41415 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
41416 0 : return -1;
41417 : }
41418 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
41419 0 : return 0;
41420 : }
41421 :
41422 : static PyGetSetDef py_lsa_OpenTrustedDomainByName_getsetters[] = {
41423 : {
41424 : .name = discard_const_p(char, "in_handle"),
41425 : .get = py_lsa_OpenTrustedDomainByName_in_get_handle,
41426 : .set = py_lsa_OpenTrustedDomainByName_in_set_handle,
41427 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
41428 : },
41429 : {
41430 : .name = discard_const_p(char, "in_name"),
41431 : .get = py_lsa_OpenTrustedDomainByName_in_get_name,
41432 : .set = py_lsa_OpenTrustedDomainByName_in_set_name,
41433 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
41434 : },
41435 : {
41436 : .name = discard_const_p(char, "in_access_mask"),
41437 : .get = py_lsa_OpenTrustedDomainByName_in_get_access_mask,
41438 : .set = py_lsa_OpenTrustedDomainByName_in_set_access_mask,
41439 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
41440 : },
41441 : {
41442 : .name = discard_const_p(char, "out_trustdom_handle"),
41443 : .get = py_lsa_OpenTrustedDomainByName_out_get_trustdom_handle,
41444 : .set = py_lsa_OpenTrustedDomainByName_out_set_trustdom_handle,
41445 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
41446 : },
41447 : {
41448 : .name = discard_const_p(char, "result"),
41449 : .get = py_lsa_OpenTrustedDomainByName_get_result,
41450 : .set = py_lsa_OpenTrustedDomainByName_set_result,
41451 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
41452 : },
41453 : { .name = NULL }
41454 : };
41455 :
41456 0 : static PyObject *py_lsa_OpenTrustedDomainByName_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41457 : {
41458 0 : PyObject *self = pytalloc_new(struct lsa_OpenTrustedDomainByName, type);
41459 0 : struct lsa_OpenTrustedDomainByName *_self = (struct lsa_OpenTrustedDomainByName *)pytalloc_get_ptr(self);
41460 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41461 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
41462 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
41463 0 : return self;
41464 : }
41465 :
41466 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41467 : {
41468 :
41469 :
41470 0 : return PyLong_FromLong(55);
41471 : }
41472 :
41473 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41474 : {
41475 0 : const struct ndr_interface_call *call = NULL;
41476 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41477 0 : PyObject *ret = NULL;
41478 0 : struct ndr_push *push = NULL;
41479 0 : DATA_BLOB blob;
41480 0 : enum ndr_err_code err;
41481 :
41482 0 : if (ndr_table_lsarpc.num_calls < 56) {
41483 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_pack");
41484 0 : return NULL;
41485 : }
41486 0 : call = &ndr_table_lsarpc.calls[55];
41487 :
41488 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41489 0 : if (push == NULL) {
41490 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41491 0 : return NULL;
41492 : }
41493 :
41494 0 : push->flags |= ndr_push_flags;
41495 :
41496 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41497 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41498 0 : TALLOC_FREE(push);
41499 0 : PyErr_SetNdrError(err);
41500 0 : return NULL;
41501 : }
41502 0 : blob = ndr_push_blob(push);
41503 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41504 0 : TALLOC_FREE(push);
41505 0 : return ret;
41506 : }
41507 :
41508 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41509 : {
41510 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41511 0 : PyObject *bigendian_obj = NULL;
41512 0 : PyObject *ndr64_obj = NULL;
41513 0 : libndr_flags ndr_push_flags = 0;
41514 :
41515 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41516 : discard_const_p(char *, kwnames),
41517 : &bigendian_obj,
41518 : &ndr64_obj)) {
41519 0 : return NULL;
41520 : }
41521 :
41522 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41523 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41524 : }
41525 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41526 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41527 : }
41528 :
41529 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41530 : }
41531 :
41532 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41533 : {
41534 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41535 0 : PyObject *bigendian_obj = NULL;
41536 0 : PyObject *ndr64_obj = NULL;
41537 0 : libndr_flags ndr_push_flags = 0;
41538 :
41539 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41540 : discard_const_p(char *, kwnames),
41541 : &bigendian_obj,
41542 : &ndr64_obj)) {
41543 0 : return NULL;
41544 : }
41545 :
41546 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41547 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41548 : }
41549 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41550 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41551 : }
41552 :
41553 0 : return py_lsa_OpenTrustedDomainByName_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41554 : }
41555 :
41556 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)
41557 : {
41558 0 : const struct ndr_interface_call *call = NULL;
41559 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41560 0 : struct ndr_pull *pull = NULL;
41561 0 : enum ndr_err_code err;
41562 :
41563 0 : if (ndr_table_lsarpc.num_calls < 56) {
41564 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_unpack");
41565 0 : return NULL;
41566 : }
41567 0 : call = &ndr_table_lsarpc.calls[55];
41568 :
41569 0 : pull = ndr_pull_init_blob(blob, object);
41570 0 : if (pull == NULL) {
41571 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41572 0 : return NULL;
41573 : }
41574 :
41575 0 : pull->flags |= ndr_pull_flags;
41576 :
41577 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41578 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41579 0 : TALLOC_FREE(pull);
41580 0 : PyErr_SetNdrError(err);
41581 0 : return NULL;
41582 : }
41583 0 : if (!allow_remaining) {
41584 0 : uint32_t highest_ofs;
41585 :
41586 0 : if (pull->offset > pull->relative_highest_offset) {
41587 0 : highest_ofs = pull->offset;
41588 : } else {
41589 0 : highest_ofs = pull->relative_highest_offset;
41590 : }
41591 0 : if (highest_ofs < pull->data_size) {
41592 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41593 : "not all bytes consumed ofs[%u] size[%u]",
41594 : highest_ofs, pull->data_size);
41595 0 : TALLOC_FREE(pull);
41596 0 : PyErr_SetNdrError(err);
41597 0 : return NULL;
41598 : }
41599 : }
41600 :
41601 0 : TALLOC_FREE(pull);
41602 0 : Py_RETURN_NONE;
41603 : }
41604 :
41605 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41606 : {
41607 0 : DATA_BLOB blob;
41608 0 : Py_ssize_t blob_length = 0;
41609 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41610 0 : PyObject *bigendian_obj = NULL;
41611 0 : PyObject *ndr64_obj = NULL;
41612 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41613 0 : PyObject *allow_remaining_obj = NULL;
41614 0 : bool allow_remaining = false;
41615 :
41616 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41617 : discard_const_p(char *, kwnames),
41618 : &blob.data, &blob_length,
41619 : &bigendian_obj,
41620 : &ndr64_obj,
41621 : &allow_remaining_obj)) {
41622 0 : return NULL;
41623 : }
41624 0 : blob.length = blob_length;
41625 :
41626 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41627 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41628 : }
41629 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41630 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41631 : }
41632 :
41633 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41634 0 : allow_remaining = true;
41635 : }
41636 :
41637 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41638 : }
41639 :
41640 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41641 : {
41642 0 : DATA_BLOB blob;
41643 0 : Py_ssize_t blob_length = 0;
41644 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41645 0 : PyObject *bigendian_obj = NULL;
41646 0 : PyObject *ndr64_obj = NULL;
41647 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41648 0 : PyObject *allow_remaining_obj = NULL;
41649 0 : bool allow_remaining = false;
41650 :
41651 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41652 : discard_const_p(char *, kwnames),
41653 : &blob.data, &blob_length,
41654 : &bigendian_obj,
41655 : &ndr64_obj,
41656 : &allow_remaining_obj)) {
41657 0 : return NULL;
41658 : }
41659 0 : blob.length = blob_length;
41660 :
41661 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41662 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41663 : }
41664 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41665 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41666 : }
41667 :
41668 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41669 0 : allow_remaining = true;
41670 : }
41671 :
41672 0 : return py_lsa_OpenTrustedDomainByName_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41673 : }
41674 :
41675 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41676 : {
41677 0 : const struct ndr_interface_call *call = NULL;
41678 0 : struct lsa_OpenTrustedDomainByName *object = pytalloc_get_ptr(py_obj);
41679 0 : PyObject *ret;
41680 0 : char *retstr;
41681 :
41682 0 : if (ndr_table_lsarpc.num_calls < 56) {
41683 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenTrustedDomainByName_ndr_print");
41684 0 : return NULL;
41685 : }
41686 0 : call = &ndr_table_lsarpc.calls[55];
41687 :
41688 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41689 0 : ret = PyUnicode_FromString(retstr);
41690 0 : TALLOC_FREE(retstr);
41691 :
41692 0 : return ret;
41693 : }
41694 :
41695 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41696 : {
41697 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_in", NDR_IN);
41698 : }
41699 :
41700 0 : static PyObject *py_lsa_OpenTrustedDomainByName_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41701 : {
41702 0 : return py_lsa_OpenTrustedDomainByName_ndr_print(py_obj, "lsa_OpenTrustedDomainByName_out", NDR_OUT);
41703 : }
41704 :
41705 : static PyMethodDef py_lsa_OpenTrustedDomainByName_methods[] = {
41706 : { "opnum", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_opnum, METH_NOARGS|METH_CLASS,
41707 : "lsa.OpenTrustedDomainByName.opnum() -> 55 (0x37) " },
41708 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41709 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41710 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41711 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41712 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41713 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41714 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenTrustedDomainByName_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41715 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41716 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41717 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenTrustedDomainByName_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41718 : { NULL, NULL, 0, NULL }
41719 : };
41720 :
41721 :
41722 : static PyTypeObject lsa_OpenTrustedDomainByName_Type = {
41723 : PyVarObject_HEAD_INIT(NULL, 0)
41724 : .tp_name = "lsa.OpenTrustedDomainByName",
41725 : .tp_getset = py_lsa_OpenTrustedDomainByName_getsetters,
41726 : .tp_methods = py_lsa_OpenTrustedDomainByName_methods,
41727 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41728 : .tp_new = py_lsa_OpenTrustedDomainByName_new,
41729 : };
41730 :
41731 0 : static bool pack_py_lsa_OpenTrustedDomainByName_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenTrustedDomainByName *r)
41732 : {
41733 0 : PyObject *py_handle;
41734 0 : PyObject *py_name;
41735 0 : PyObject *py_access_mask;
41736 0 : const char *kwnames[] = {
41737 : "handle", "name", "access_mask", NULL
41738 : };
41739 :
41740 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_OpenTrustedDomainByName", discard_const_p(char *, kwnames), &py_handle, &py_name, &py_access_mask)) {
41741 0 : return false;
41742 : }
41743 :
41744 0 : if (py_handle == NULL) {
41745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
41746 0 : return false;
41747 : }
41748 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
41749 0 : if (r->in.handle == NULL) {
41750 0 : PyErr_NoMemory();
41751 0 : return false;
41752 : }
41753 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
41754 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
41755 0 : PyErr_NoMemory();
41756 0 : return false;
41757 : }
41758 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
41759 0 : if (py_name == NULL) {
41760 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.name");
41761 0 : return false;
41762 : }
41763 0 : PY_CHECK_TYPE(&lsa_String_Type, py_name, return false;);
41764 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
41765 0 : PyErr_NoMemory();
41766 0 : return false;
41767 : }
41768 0 : r->in.name = *(struct lsa_String *)pytalloc_get_ptr(py_name);
41769 0 : if (py_access_mask == NULL) {
41770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
41771 0 : return false;
41772 : }
41773 : {
41774 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
41775 0 : if (PyLong_Check(py_access_mask)) {
41776 0 : unsigned long long test_var;
41777 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
41778 0 : if (PyErr_Occurred() != NULL) {
41779 0 : return false;
41780 : }
41781 0 : if (test_var > uint_max) {
41782 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41783 : PyLong_Type.tp_name, uint_max, test_var);
41784 0 : return false;
41785 : }
41786 0 : r->in.access_mask = test_var;
41787 : } else {
41788 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41789 : PyLong_Type.tp_name);
41790 0 : return false;
41791 : }
41792 : }
41793 0 : return true;
41794 : }
41795 :
41796 0 : static PyObject *unpack_py_lsa_OpenTrustedDomainByName_args_out(struct lsa_OpenTrustedDomainByName *r)
41797 : {
41798 0 : PyObject *result;
41799 0 : PyObject *py_trustdom_handle;
41800 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
41801 0 : result = py_trustdom_handle;
41802 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41803 0 : PyErr_SetNTSTATUS(r->out.result);
41804 0 : return NULL;
41805 : }
41806 :
41807 0 : return result;
41808 : }
41809 :
41810 :
41811 0 : static PyObject *py_lsa_LookupSids2_in_get_handle(PyObject *obj, void *closure)
41812 : {
41813 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41814 0 : PyObject *py_handle;
41815 0 : if (object->in.handle == NULL) {
41816 0 : Py_RETURN_NONE;
41817 : }
41818 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
41819 0 : return py_handle;
41820 : }
41821 :
41822 0 : static int py_lsa_LookupSids2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
41823 : {
41824 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41825 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
41826 0 : if (value == NULL) {
41827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
41828 0 : return -1;
41829 : }
41830 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
41831 0 : if (object->in.handle == NULL) {
41832 0 : PyErr_NoMemory();
41833 0 : return -1;
41834 : }
41835 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41836 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41837 0 : PyErr_NoMemory();
41838 0 : return -1;
41839 : }
41840 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
41841 0 : return 0;
41842 : }
41843 :
41844 0 : static PyObject *py_lsa_LookupSids2_in_get_sids(PyObject *obj, void *closure)
41845 : {
41846 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41847 0 : PyObject *py_sids;
41848 0 : if (object->in.sids == NULL) {
41849 0 : Py_RETURN_NONE;
41850 : }
41851 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
41852 0 : return py_sids;
41853 : }
41854 :
41855 0 : static int py_lsa_LookupSids2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
41856 : {
41857 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41858 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
41859 0 : if (value == NULL) {
41860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
41861 0 : return -1;
41862 : }
41863 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
41864 0 : if (object->in.sids == NULL) {
41865 0 : PyErr_NoMemory();
41866 0 : return -1;
41867 : }
41868 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
41869 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41870 0 : PyErr_NoMemory();
41871 0 : return -1;
41872 : }
41873 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
41874 0 : return 0;
41875 : }
41876 :
41877 0 : static PyObject *py_lsa_LookupSids2_out_get_domains(PyObject *obj, void *closure)
41878 : {
41879 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41880 0 : PyObject *py_domains;
41881 0 : if (object->out.domains == NULL) {
41882 0 : Py_RETURN_NONE;
41883 : }
41884 0 : if (*object->out.domains == NULL) {
41885 0 : py_domains = Py_None;
41886 0 : Py_INCREF(py_domains);
41887 : } else {
41888 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
41889 : }
41890 0 : return py_domains;
41891 : }
41892 :
41893 0 : static int py_lsa_LookupSids2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
41894 : {
41895 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41896 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
41897 0 : if (value == NULL) {
41898 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
41899 0 : return -1;
41900 : }
41901 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
41902 0 : if (object->out.domains == NULL) {
41903 0 : PyErr_NoMemory();
41904 0 : return -1;
41905 : }
41906 0 : if (value == Py_None) {
41907 0 : *object->out.domains = NULL;
41908 : } else {
41909 0 : *object->out.domains = NULL;
41910 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
41911 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41912 0 : PyErr_NoMemory();
41913 0 : return -1;
41914 : }
41915 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
41916 : }
41917 0 : return 0;
41918 : }
41919 :
41920 0 : static PyObject *py_lsa_LookupSids2_in_get_names(PyObject *obj, void *closure)
41921 : {
41922 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41923 0 : PyObject *py_names;
41924 0 : if (object->in.names == NULL) {
41925 0 : Py_RETURN_NONE;
41926 : }
41927 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
41928 0 : return py_names;
41929 : }
41930 :
41931 0 : static int py_lsa_LookupSids2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
41932 : {
41933 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41934 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
41935 0 : if (value == NULL) {
41936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
41937 0 : return -1;
41938 : }
41939 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
41940 0 : if (object->in.names == NULL) {
41941 0 : PyErr_NoMemory();
41942 0 : return -1;
41943 : }
41944 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
41945 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41946 0 : PyErr_NoMemory();
41947 0 : return -1;
41948 : }
41949 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
41950 0 : return 0;
41951 : }
41952 :
41953 0 : static PyObject *py_lsa_LookupSids2_out_get_names(PyObject *obj, void *closure)
41954 : {
41955 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41956 0 : PyObject *py_names;
41957 0 : if (object->out.names == NULL) {
41958 0 : Py_RETURN_NONE;
41959 : }
41960 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
41961 0 : return py_names;
41962 : }
41963 :
41964 0 : static int py_lsa_LookupSids2_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
41965 : {
41966 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41967 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
41968 0 : if (value == NULL) {
41969 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.names");
41970 0 : return -1;
41971 : }
41972 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
41973 0 : if (object->out.names == NULL) {
41974 0 : PyErr_NoMemory();
41975 0 : return -1;
41976 : }
41977 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
41978 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41979 0 : PyErr_NoMemory();
41980 0 : return -1;
41981 : }
41982 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
41983 0 : return 0;
41984 : }
41985 :
41986 0 : static PyObject *py_lsa_LookupSids2_in_get_level(PyObject *obj, void *closure)
41987 : {
41988 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
41989 0 : PyObject *py_level;
41990 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
41991 0 : return py_level;
41992 : }
41993 :
41994 0 : static int py_lsa_LookupSids2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
41995 : {
41996 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
41997 0 : if (value == NULL) {
41998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
41999 0 : return -1;
42000 : }
42001 : {
42002 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
42003 0 : if (PyLong_Check(value)) {
42004 0 : unsigned long long test_var;
42005 0 : test_var = PyLong_AsUnsignedLongLong(value);
42006 0 : if (PyErr_Occurred() != NULL) {
42007 0 : return -1;
42008 : }
42009 0 : if (test_var > uint_max) {
42010 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42011 : PyLong_Type.tp_name, uint_max, test_var);
42012 0 : return -1;
42013 : }
42014 0 : object->in.level = test_var;
42015 : } else {
42016 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42017 : PyLong_Type.tp_name);
42018 0 : return -1;
42019 : }
42020 : }
42021 0 : return 0;
42022 : }
42023 :
42024 0 : static PyObject *py_lsa_LookupSids2_in_get_count(PyObject *obj, void *closure)
42025 : {
42026 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
42027 0 : PyObject *py_count;
42028 0 : if (object->in.count == NULL) {
42029 0 : Py_RETURN_NONE;
42030 : }
42031 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
42032 0 : return py_count;
42033 : }
42034 :
42035 0 : static int py_lsa_LookupSids2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
42036 : {
42037 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42038 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
42039 0 : if (value == NULL) {
42040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
42041 0 : return -1;
42042 : }
42043 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
42044 0 : if (object->in.count == NULL) {
42045 0 : PyErr_NoMemory();
42046 0 : return -1;
42047 : }
42048 : {
42049 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
42050 0 : if (PyLong_Check(value)) {
42051 0 : unsigned long long test_var;
42052 0 : test_var = PyLong_AsUnsignedLongLong(value);
42053 0 : if (PyErr_Occurred() != NULL) {
42054 0 : return -1;
42055 : }
42056 0 : if (test_var > uint_max) {
42057 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42058 : PyLong_Type.tp_name, uint_max, test_var);
42059 0 : return -1;
42060 : }
42061 0 : *object->in.count = test_var;
42062 : } else {
42063 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42064 : PyLong_Type.tp_name);
42065 0 : return -1;
42066 : }
42067 : }
42068 0 : return 0;
42069 : }
42070 :
42071 0 : static PyObject *py_lsa_LookupSids2_out_get_count(PyObject *obj, void *closure)
42072 : {
42073 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
42074 0 : PyObject *py_count;
42075 0 : if (object->out.count == NULL) {
42076 0 : Py_RETURN_NONE;
42077 : }
42078 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
42079 0 : return py_count;
42080 : }
42081 :
42082 0 : static int py_lsa_LookupSids2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
42083 : {
42084 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42085 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
42086 0 : if (value == NULL) {
42087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
42088 0 : return -1;
42089 : }
42090 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
42091 0 : if (object->out.count == NULL) {
42092 0 : PyErr_NoMemory();
42093 0 : return -1;
42094 : }
42095 : {
42096 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
42097 0 : if (PyLong_Check(value)) {
42098 0 : unsigned long long test_var;
42099 0 : test_var = PyLong_AsUnsignedLongLong(value);
42100 0 : if (PyErr_Occurred() != NULL) {
42101 0 : return -1;
42102 : }
42103 0 : if (test_var > uint_max) {
42104 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42105 : PyLong_Type.tp_name, uint_max, test_var);
42106 0 : return -1;
42107 : }
42108 0 : *object->out.count = test_var;
42109 : } else {
42110 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42111 : PyLong_Type.tp_name);
42112 0 : return -1;
42113 : }
42114 : }
42115 0 : return 0;
42116 : }
42117 :
42118 0 : static PyObject *py_lsa_LookupSids2_in_get_lookup_options(PyObject *obj, void *closure)
42119 : {
42120 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
42121 0 : PyObject *py_lookup_options;
42122 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.lookup_options));
42123 0 : return py_lookup_options;
42124 : }
42125 :
42126 0 : static int py_lsa_LookupSids2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
42127 : {
42128 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42129 0 : if (value == NULL) {
42130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lookup_options");
42131 0 : return -1;
42132 : }
42133 : {
42134 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
42135 0 : if (PyLong_Check(value)) {
42136 0 : unsigned long long test_var;
42137 0 : test_var = PyLong_AsUnsignedLongLong(value);
42138 0 : if (PyErr_Occurred() != NULL) {
42139 0 : return -1;
42140 : }
42141 0 : if (test_var > uint_max) {
42142 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42143 : PyLong_Type.tp_name, uint_max, test_var);
42144 0 : return -1;
42145 : }
42146 0 : object->in.lookup_options = test_var;
42147 : } else {
42148 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42149 : PyLong_Type.tp_name);
42150 0 : return -1;
42151 : }
42152 : }
42153 0 : return 0;
42154 : }
42155 :
42156 0 : static PyObject *py_lsa_LookupSids2_in_get_client_revision(PyObject *obj, void *closure)
42157 : {
42158 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
42159 0 : PyObject *py_client_revision;
42160 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_revision));
42161 0 : return py_client_revision;
42162 : }
42163 :
42164 0 : static int py_lsa_LookupSids2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
42165 : {
42166 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42167 0 : if (value == NULL) {
42168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_revision");
42169 0 : return -1;
42170 : }
42171 : {
42172 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
42173 0 : if (PyLong_Check(value)) {
42174 0 : unsigned long long test_var;
42175 0 : test_var = PyLong_AsUnsignedLongLong(value);
42176 0 : if (PyErr_Occurred() != NULL) {
42177 0 : return -1;
42178 : }
42179 0 : if (test_var > uint_max) {
42180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42181 : PyLong_Type.tp_name, uint_max, test_var);
42182 0 : return -1;
42183 : }
42184 0 : object->in.client_revision = test_var;
42185 : } else {
42186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42187 : PyLong_Type.tp_name);
42188 0 : return -1;
42189 : }
42190 : }
42191 0 : return 0;
42192 : }
42193 :
42194 0 : static PyObject *py_lsa_LookupSids2_get_result(PyObject *obj, void *closure)
42195 : {
42196 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(obj);
42197 0 : PyObject *py_result;
42198 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42199 0 : return py_result;
42200 : }
42201 :
42202 0 : static int py_lsa_LookupSids2_set_result(PyObject *py_obj, PyObject *value, void *closure)
42203 : {
42204 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42205 0 : if (value == NULL) {
42206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
42207 0 : return -1;
42208 : }
42209 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42210 0 : return 0;
42211 : }
42212 :
42213 : static PyGetSetDef py_lsa_LookupSids2_getsetters[] = {
42214 : {
42215 : .name = discard_const_p(char, "in_handle"),
42216 : .get = py_lsa_LookupSids2_in_get_handle,
42217 : .set = py_lsa_LookupSids2_in_set_handle,
42218 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42219 : },
42220 : {
42221 : .name = discard_const_p(char, "in_sids"),
42222 : .get = py_lsa_LookupSids2_in_get_sids,
42223 : .set = py_lsa_LookupSids2_in_set_sids,
42224 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
42225 : },
42226 : {
42227 : .name = discard_const_p(char, "out_domains"),
42228 : .get = py_lsa_LookupSids2_out_get_domains,
42229 : .set = py_lsa_LookupSids2_out_set_domains,
42230 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
42231 : },
42232 : {
42233 : .name = discard_const_p(char, "in_names"),
42234 : .get = py_lsa_LookupSids2_in_get_names,
42235 : .set = py_lsa_LookupSids2_in_set_names,
42236 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
42237 : },
42238 : {
42239 : .name = discard_const_p(char, "out_names"),
42240 : .get = py_lsa_LookupSids2_out_get_names,
42241 : .set = py_lsa_LookupSids2_out_set_names,
42242 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
42243 : },
42244 : {
42245 : .name = discard_const_p(char, "in_level"),
42246 : .get = py_lsa_LookupSids2_in_get_level,
42247 : .set = py_lsa_LookupSids2_in_set_level,
42248 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
42249 : },
42250 : {
42251 : .name = discard_const_p(char, "in_count"),
42252 : .get = py_lsa_LookupSids2_in_get_count,
42253 : .set = py_lsa_LookupSids2_in_set_count,
42254 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42255 : },
42256 : {
42257 : .name = discard_const_p(char, "out_count"),
42258 : .get = py_lsa_LookupSids2_out_get_count,
42259 : .set = py_lsa_LookupSids2_out_set_count,
42260 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
42261 : },
42262 : {
42263 : .name = discard_const_p(char, "in_lookup_options"),
42264 : .get = py_lsa_LookupSids2_in_get_lookup_options,
42265 : .set = py_lsa_LookupSids2_in_set_lookup_options,
42266 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
42267 : },
42268 : {
42269 : .name = discard_const_p(char, "in_client_revision"),
42270 : .get = py_lsa_LookupSids2_in_get_client_revision,
42271 : .set = py_lsa_LookupSids2_in_set_client_revision,
42272 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
42273 : },
42274 : {
42275 : .name = discard_const_p(char, "result"),
42276 : .get = py_lsa_LookupSids2_get_result,
42277 : .set = py_lsa_LookupSids2_set_result,
42278 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42279 : },
42280 : { .name = NULL }
42281 : };
42282 :
42283 0 : static PyObject *py_lsa_LookupSids2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42284 : {
42285 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids2, type);
42286 0 : struct lsa_LookupSids2 *_self = (struct lsa_LookupSids2 *)pytalloc_get_ptr(self);
42287 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42288 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
42289 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
42290 : /* a pointer to a NULL pointer */
42291 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
42292 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
42293 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
42294 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
42295 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
42296 0 : return self;
42297 : }
42298 :
42299 0 : static PyObject *py_lsa_LookupSids2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42300 : {
42301 :
42302 :
42303 0 : return PyLong_FromLong(57);
42304 : }
42305 :
42306 0 : static PyObject *py_lsa_LookupSids2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42307 : {
42308 0 : const struct ndr_interface_call *call = NULL;
42309 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42310 0 : PyObject *ret = NULL;
42311 0 : struct ndr_push *push = NULL;
42312 0 : DATA_BLOB blob;
42313 0 : enum ndr_err_code err;
42314 :
42315 0 : if (ndr_table_lsarpc.num_calls < 58) {
42316 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_pack");
42317 0 : return NULL;
42318 : }
42319 0 : call = &ndr_table_lsarpc.calls[57];
42320 :
42321 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42322 0 : if (push == NULL) {
42323 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42324 0 : return NULL;
42325 : }
42326 :
42327 0 : push->flags |= ndr_push_flags;
42328 :
42329 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42330 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42331 0 : TALLOC_FREE(push);
42332 0 : PyErr_SetNdrError(err);
42333 0 : return NULL;
42334 : }
42335 0 : blob = ndr_push_blob(push);
42336 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42337 0 : TALLOC_FREE(push);
42338 0 : return ret;
42339 : }
42340 :
42341 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42342 : {
42343 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42344 0 : PyObject *bigendian_obj = NULL;
42345 0 : PyObject *ndr64_obj = NULL;
42346 0 : libndr_flags ndr_push_flags = 0;
42347 :
42348 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42349 : discard_const_p(char *, kwnames),
42350 : &bigendian_obj,
42351 : &ndr64_obj)) {
42352 0 : return NULL;
42353 : }
42354 :
42355 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42356 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42357 : }
42358 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42359 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42360 : }
42361 :
42362 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42363 : }
42364 :
42365 0 : static PyObject *py_lsa_LookupSids2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42366 : {
42367 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42368 0 : PyObject *bigendian_obj = NULL;
42369 0 : PyObject *ndr64_obj = NULL;
42370 0 : libndr_flags ndr_push_flags = 0;
42371 :
42372 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42373 : discard_const_p(char *, kwnames),
42374 : &bigendian_obj,
42375 : &ndr64_obj)) {
42376 0 : return NULL;
42377 : }
42378 :
42379 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42380 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42381 : }
42382 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42383 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42384 : }
42385 :
42386 0 : return py_lsa_LookupSids2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42387 : }
42388 :
42389 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)
42390 : {
42391 0 : const struct ndr_interface_call *call = NULL;
42392 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42393 0 : struct ndr_pull *pull = NULL;
42394 0 : enum ndr_err_code err;
42395 :
42396 0 : if (ndr_table_lsarpc.num_calls < 58) {
42397 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_unpack");
42398 0 : return NULL;
42399 : }
42400 0 : call = &ndr_table_lsarpc.calls[57];
42401 :
42402 0 : pull = ndr_pull_init_blob(blob, object);
42403 0 : if (pull == NULL) {
42404 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42405 0 : return NULL;
42406 : }
42407 :
42408 0 : pull->flags |= ndr_pull_flags;
42409 :
42410 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42411 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42412 0 : TALLOC_FREE(pull);
42413 0 : PyErr_SetNdrError(err);
42414 0 : return NULL;
42415 : }
42416 0 : if (!allow_remaining) {
42417 0 : uint32_t highest_ofs;
42418 :
42419 0 : if (pull->offset > pull->relative_highest_offset) {
42420 0 : highest_ofs = pull->offset;
42421 : } else {
42422 0 : highest_ofs = pull->relative_highest_offset;
42423 : }
42424 0 : if (highest_ofs < pull->data_size) {
42425 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42426 : "not all bytes consumed ofs[%u] size[%u]",
42427 : highest_ofs, pull->data_size);
42428 0 : TALLOC_FREE(pull);
42429 0 : PyErr_SetNdrError(err);
42430 0 : return NULL;
42431 : }
42432 : }
42433 :
42434 0 : TALLOC_FREE(pull);
42435 0 : Py_RETURN_NONE;
42436 : }
42437 :
42438 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42439 : {
42440 0 : DATA_BLOB blob;
42441 0 : Py_ssize_t blob_length = 0;
42442 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42443 0 : PyObject *bigendian_obj = NULL;
42444 0 : PyObject *ndr64_obj = NULL;
42445 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42446 0 : PyObject *allow_remaining_obj = NULL;
42447 0 : bool allow_remaining = false;
42448 :
42449 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42450 : discard_const_p(char *, kwnames),
42451 : &blob.data, &blob_length,
42452 : &bigendian_obj,
42453 : &ndr64_obj,
42454 : &allow_remaining_obj)) {
42455 0 : return NULL;
42456 : }
42457 0 : blob.length = blob_length;
42458 :
42459 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42460 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42461 : }
42462 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42463 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42464 : }
42465 :
42466 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42467 0 : allow_remaining = true;
42468 : }
42469 :
42470 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42471 : }
42472 :
42473 0 : static PyObject *py_lsa_LookupSids2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42474 : {
42475 0 : DATA_BLOB blob;
42476 0 : Py_ssize_t blob_length = 0;
42477 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42478 0 : PyObject *bigendian_obj = NULL;
42479 0 : PyObject *ndr64_obj = NULL;
42480 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42481 0 : PyObject *allow_remaining_obj = NULL;
42482 0 : bool allow_remaining = false;
42483 :
42484 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42485 : discard_const_p(char *, kwnames),
42486 : &blob.data, &blob_length,
42487 : &bigendian_obj,
42488 : &ndr64_obj,
42489 : &allow_remaining_obj)) {
42490 0 : return NULL;
42491 : }
42492 0 : blob.length = blob_length;
42493 :
42494 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42495 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42496 : }
42497 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42498 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42499 : }
42500 :
42501 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42502 0 : allow_remaining = true;
42503 : }
42504 :
42505 0 : return py_lsa_LookupSids2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42506 : }
42507 :
42508 0 : static PyObject *py_lsa_LookupSids2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42509 : {
42510 0 : const struct ndr_interface_call *call = NULL;
42511 0 : struct lsa_LookupSids2 *object = pytalloc_get_ptr(py_obj);
42512 0 : PyObject *ret;
42513 0 : char *retstr;
42514 :
42515 0 : if (ndr_table_lsarpc.num_calls < 58) {
42516 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids2_ndr_print");
42517 0 : return NULL;
42518 : }
42519 0 : call = &ndr_table_lsarpc.calls[57];
42520 :
42521 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42522 0 : ret = PyUnicode_FromString(retstr);
42523 0 : TALLOC_FREE(retstr);
42524 :
42525 0 : return ret;
42526 : }
42527 :
42528 0 : static PyObject *py_lsa_LookupSids2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42529 : {
42530 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_in", NDR_IN);
42531 : }
42532 :
42533 0 : static PyObject *py_lsa_LookupSids2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42534 : {
42535 0 : return py_lsa_LookupSids2_ndr_print(py_obj, "lsa_LookupSids2_out", NDR_OUT);
42536 : }
42537 :
42538 : static PyMethodDef py_lsa_LookupSids2_methods[] = {
42539 : { "opnum", (PyCFunction)py_lsa_LookupSids2_ndr_opnum, METH_NOARGS|METH_CLASS,
42540 : "lsa.LookupSids2.opnum() -> 57 (0x39) " },
42541 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42542 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42543 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42544 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42545 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42546 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42547 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42548 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42549 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42550 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42551 : { NULL, NULL, 0, NULL }
42552 : };
42553 :
42554 :
42555 : static PyTypeObject lsa_LookupSids2_Type = {
42556 : PyVarObject_HEAD_INIT(NULL, 0)
42557 : .tp_name = "lsa.LookupSids2",
42558 : .tp_getset = py_lsa_LookupSids2_getsetters,
42559 : .tp_methods = py_lsa_LookupSids2_methods,
42560 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42561 : .tp_new = py_lsa_LookupSids2_new,
42562 : };
42563 :
42564 0 : static bool pack_py_lsa_LookupSids2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids2 *r)
42565 : {
42566 0 : PyObject *py_handle;
42567 0 : PyObject *py_sids;
42568 0 : PyObject *py_names;
42569 0 : PyObject *py_level;
42570 0 : PyObject *py_count;
42571 0 : PyObject *py_lookup_options;
42572 0 : PyObject *py_client_revision;
42573 0 : const char *kwnames[] = {
42574 : "handle", "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
42575 : };
42576 :
42577 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)) {
42578 0 : return false;
42579 : }
42580 :
42581 0 : if (py_handle == NULL) {
42582 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
42583 0 : return false;
42584 : }
42585 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
42586 0 : if (r->in.handle == NULL) {
42587 0 : PyErr_NoMemory();
42588 0 : return false;
42589 : }
42590 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
42591 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
42592 0 : PyErr_NoMemory();
42593 0 : return false;
42594 : }
42595 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
42596 0 : if (py_sids == NULL) {
42597 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
42598 0 : return false;
42599 : }
42600 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
42601 0 : if (r->in.sids == NULL) {
42602 0 : PyErr_NoMemory();
42603 0 : return false;
42604 : }
42605 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
42606 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
42607 0 : PyErr_NoMemory();
42608 0 : return false;
42609 : }
42610 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
42611 0 : if (py_names == NULL) {
42612 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
42613 0 : return false;
42614 : }
42615 0 : r->in.names = talloc_ptrtype(r, r->in.names);
42616 0 : if (r->in.names == NULL) {
42617 0 : PyErr_NoMemory();
42618 0 : return false;
42619 : }
42620 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
42621 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
42622 0 : PyErr_NoMemory();
42623 0 : return false;
42624 : }
42625 0 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
42626 0 : if (py_level == NULL) {
42627 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
42628 0 : return false;
42629 : }
42630 : {
42631 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
42632 0 : if (PyLong_Check(py_level)) {
42633 0 : unsigned long long test_var;
42634 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
42635 0 : if (PyErr_Occurred() != NULL) {
42636 0 : return false;
42637 : }
42638 0 : if (test_var > uint_max) {
42639 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42640 : PyLong_Type.tp_name, uint_max, test_var);
42641 0 : return false;
42642 : }
42643 0 : r->in.level = test_var;
42644 : } else {
42645 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42646 : PyLong_Type.tp_name);
42647 0 : return false;
42648 : }
42649 : }
42650 0 : if (py_count == NULL) {
42651 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
42652 0 : return false;
42653 : }
42654 0 : r->in.count = talloc_ptrtype(r, r->in.count);
42655 0 : if (r->in.count == NULL) {
42656 0 : PyErr_NoMemory();
42657 0 : return false;
42658 : }
42659 : {
42660 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
42661 0 : if (PyLong_Check(py_count)) {
42662 0 : unsigned long long test_var;
42663 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
42664 0 : if (PyErr_Occurred() != NULL) {
42665 0 : return false;
42666 : }
42667 0 : if (test_var > uint_max) {
42668 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42669 : PyLong_Type.tp_name, uint_max, test_var);
42670 0 : return false;
42671 : }
42672 0 : *r->in.count = test_var;
42673 : } else {
42674 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42675 : PyLong_Type.tp_name);
42676 0 : return false;
42677 : }
42678 : }
42679 0 : if (py_lookup_options == NULL) {
42680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lookup_options");
42681 0 : return false;
42682 : }
42683 : {
42684 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
42685 0 : if (PyLong_Check(py_lookup_options)) {
42686 0 : unsigned long long test_var;
42687 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
42688 0 : if (PyErr_Occurred() != NULL) {
42689 0 : return false;
42690 : }
42691 0 : if (test_var > uint_max) {
42692 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42693 : PyLong_Type.tp_name, uint_max, test_var);
42694 0 : return false;
42695 : }
42696 0 : r->in.lookup_options = test_var;
42697 : } else {
42698 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42699 : PyLong_Type.tp_name);
42700 0 : return false;
42701 : }
42702 : }
42703 0 : if (py_client_revision == NULL) {
42704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_revision");
42705 0 : return false;
42706 : }
42707 : {
42708 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
42709 0 : if (PyLong_Check(py_client_revision)) {
42710 0 : unsigned long long test_var;
42711 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
42712 0 : if (PyErr_Occurred() != NULL) {
42713 0 : return false;
42714 : }
42715 0 : if (test_var > uint_max) {
42716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42717 : PyLong_Type.tp_name, uint_max, test_var);
42718 0 : return false;
42719 : }
42720 0 : r->in.client_revision = test_var;
42721 : } else {
42722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42723 : PyLong_Type.tp_name);
42724 0 : return false;
42725 : }
42726 : }
42727 0 : return true;
42728 : }
42729 :
42730 0 : static PyObject *unpack_py_lsa_LookupSids2_args_out(struct lsa_LookupSids2 *r)
42731 : {
42732 0 : PyObject *result;
42733 0 : PyObject *py_domains;
42734 0 : PyObject *py_names;
42735 0 : PyObject *py_count;
42736 0 : result = PyTuple_New(3);
42737 0 : if (*r->out.domains == NULL) {
42738 0 : py_domains = Py_None;
42739 0 : Py_INCREF(py_domains);
42740 : } else {
42741 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
42742 : }
42743 0 : PyTuple_SetItem(result, 0, py_domains);
42744 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
42745 0 : PyTuple_SetItem(result, 1, py_names);
42746 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
42747 0 : PyTuple_SetItem(result, 2, py_count);
42748 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42749 0 : PyErr_SetNTSTATUS(r->out.result);
42750 0 : return NULL;
42751 : }
42752 :
42753 0 : return result;
42754 : }
42755 :
42756 :
42757 0 : static PyObject *py_lsa_LookupNames2_in_get_handle(PyObject *obj, void *closure)
42758 : {
42759 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42760 0 : PyObject *py_handle;
42761 0 : if (object->in.handle == NULL) {
42762 0 : Py_RETURN_NONE;
42763 : }
42764 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
42765 0 : return py_handle;
42766 : }
42767 :
42768 0 : static int py_lsa_LookupNames2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
42769 : {
42770 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42771 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
42772 0 : if (value == NULL) {
42773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
42774 0 : return -1;
42775 : }
42776 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
42777 0 : if (object->in.handle == NULL) {
42778 0 : PyErr_NoMemory();
42779 0 : return -1;
42780 : }
42781 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42782 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42783 0 : PyErr_NoMemory();
42784 0 : return -1;
42785 : }
42786 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
42787 0 : return 0;
42788 : }
42789 :
42790 0 : static PyObject *py_lsa_LookupNames2_in_get_num_names(PyObject *obj, void *closure)
42791 : {
42792 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42793 0 : PyObject *py_num_names;
42794 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_names));
42795 0 : return py_num_names;
42796 : }
42797 :
42798 0 : static int py_lsa_LookupNames2_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
42799 : {
42800 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42801 0 : if (value == NULL) {
42802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_names");
42803 0 : return -1;
42804 : }
42805 : {
42806 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
42807 0 : if (PyLong_Check(value)) {
42808 0 : unsigned long long test_var;
42809 0 : test_var = PyLong_AsUnsignedLongLong(value);
42810 0 : if (PyErr_Occurred() != NULL) {
42811 0 : return -1;
42812 : }
42813 0 : if (test_var > uint_max) {
42814 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42815 : PyLong_Type.tp_name, uint_max, test_var);
42816 0 : return -1;
42817 : }
42818 0 : object->in.num_names = test_var;
42819 : } else {
42820 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42821 : PyLong_Type.tp_name);
42822 0 : return -1;
42823 : }
42824 : }
42825 0 : return 0;
42826 : }
42827 :
42828 0 : static PyObject *py_lsa_LookupNames2_in_get_names(PyObject *obj, void *closure)
42829 : {
42830 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42831 0 : PyObject *py_names;
42832 0 : py_names = PyList_New(object->in.num_names);
42833 0 : if (py_names == NULL) {
42834 0 : return NULL;
42835 : }
42836 : {
42837 : int names_cntr_0;
42838 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
42839 0 : PyObject *py_names_0;
42840 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &(object->in.names)[names_cntr_0]);
42841 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
42842 : }
42843 : }
42844 0 : return py_names;
42845 : }
42846 :
42847 0 : static int py_lsa_LookupNames2_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
42848 : {
42849 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42850 0 : if (value == NULL) {
42851 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
42852 0 : return -1;
42853 : }
42854 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
42855 : {
42856 0 : int names_cntr_0;
42857 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
42858 0 : if (!object->in.names) { return -1; }
42859 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
42860 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
42861 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
42862 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.names)[names_cntr_0]");
42863 0 : return -1;
42864 : }
42865 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
42866 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
42867 0 : PyErr_NoMemory();
42868 0 : return -1;
42869 : }
42870 0 : (object->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
42871 : }
42872 : }
42873 0 : return 0;
42874 : }
42875 :
42876 0 : static PyObject *py_lsa_LookupNames2_out_get_domains(PyObject *obj, void *closure)
42877 : {
42878 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42879 0 : PyObject *py_domains;
42880 0 : if (object->out.domains == NULL) {
42881 0 : Py_RETURN_NONE;
42882 : }
42883 0 : if (*object->out.domains == NULL) {
42884 0 : py_domains = Py_None;
42885 0 : Py_INCREF(py_domains);
42886 : } else {
42887 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
42888 : }
42889 0 : return py_domains;
42890 : }
42891 :
42892 0 : static int py_lsa_LookupNames2_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
42893 : {
42894 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42895 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
42896 0 : if (value == NULL) {
42897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
42898 0 : return -1;
42899 : }
42900 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
42901 0 : if (object->out.domains == NULL) {
42902 0 : PyErr_NoMemory();
42903 0 : return -1;
42904 : }
42905 0 : if (value == Py_None) {
42906 0 : *object->out.domains = NULL;
42907 : } else {
42908 0 : *object->out.domains = NULL;
42909 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
42910 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42911 0 : PyErr_NoMemory();
42912 0 : return -1;
42913 : }
42914 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
42915 : }
42916 0 : return 0;
42917 : }
42918 :
42919 0 : static PyObject *py_lsa_LookupNames2_in_get_sids(PyObject *obj, void *closure)
42920 : {
42921 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42922 0 : PyObject *py_sids;
42923 0 : if (object->in.sids == NULL) {
42924 0 : Py_RETURN_NONE;
42925 : }
42926 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->in.sids, object->in.sids);
42927 0 : return py_sids;
42928 : }
42929 :
42930 0 : static int py_lsa_LookupNames2_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
42931 : {
42932 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42933 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
42934 0 : if (value == NULL) {
42935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
42936 0 : return -1;
42937 : }
42938 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
42939 0 : if (object->in.sids == NULL) {
42940 0 : PyErr_NoMemory();
42941 0 : return -1;
42942 : }
42943 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
42944 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42945 0 : PyErr_NoMemory();
42946 0 : return -1;
42947 : }
42948 0 : object->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
42949 0 : return 0;
42950 : }
42951 :
42952 0 : static PyObject *py_lsa_LookupNames2_out_get_sids(PyObject *obj, void *closure)
42953 : {
42954 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42955 0 : PyObject *py_sids;
42956 0 : if (object->out.sids == NULL) {
42957 0 : Py_RETURN_NONE;
42958 : }
42959 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, object->out.sids, object->out.sids);
42960 0 : return py_sids;
42961 : }
42962 :
42963 0 : static int py_lsa_LookupNames2_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
42964 : {
42965 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42966 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
42967 0 : if (value == NULL) {
42968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
42969 0 : return -1;
42970 : }
42971 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
42972 0 : if (object->out.sids == NULL) {
42973 0 : PyErr_NoMemory();
42974 0 : return -1;
42975 : }
42976 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, value, return -1;);
42977 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42978 0 : PyErr_NoMemory();
42979 0 : return -1;
42980 : }
42981 0 : object->out.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(value);
42982 0 : return 0;
42983 : }
42984 :
42985 0 : static PyObject *py_lsa_LookupNames2_in_get_level(PyObject *obj, void *closure)
42986 : {
42987 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
42988 0 : PyObject *py_level;
42989 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
42990 0 : return py_level;
42991 : }
42992 :
42993 0 : static int py_lsa_LookupNames2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
42994 : {
42995 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
42996 0 : if (value == NULL) {
42997 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
42998 0 : return -1;
42999 : }
43000 : {
43001 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
43002 0 : if (PyLong_Check(value)) {
43003 0 : unsigned long long test_var;
43004 0 : test_var = PyLong_AsUnsignedLongLong(value);
43005 0 : if (PyErr_Occurred() != NULL) {
43006 0 : return -1;
43007 : }
43008 0 : if (test_var > uint_max) {
43009 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43010 : PyLong_Type.tp_name, uint_max, test_var);
43011 0 : return -1;
43012 : }
43013 0 : object->in.level = test_var;
43014 : } else {
43015 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43016 : PyLong_Type.tp_name);
43017 0 : return -1;
43018 : }
43019 : }
43020 0 : return 0;
43021 : }
43022 :
43023 0 : static PyObject *py_lsa_LookupNames2_in_get_count(PyObject *obj, void *closure)
43024 : {
43025 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
43026 0 : PyObject *py_count;
43027 0 : if (object->in.count == NULL) {
43028 0 : Py_RETURN_NONE;
43029 : }
43030 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
43031 0 : return py_count;
43032 : }
43033 :
43034 0 : static int py_lsa_LookupNames2_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
43035 : {
43036 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43037 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
43038 0 : if (value == NULL) {
43039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
43040 0 : return -1;
43041 : }
43042 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
43043 0 : if (object->in.count == NULL) {
43044 0 : PyErr_NoMemory();
43045 0 : return -1;
43046 : }
43047 : {
43048 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
43049 0 : if (PyLong_Check(value)) {
43050 0 : unsigned long long test_var;
43051 0 : test_var = PyLong_AsUnsignedLongLong(value);
43052 0 : if (PyErr_Occurred() != NULL) {
43053 0 : return -1;
43054 : }
43055 0 : if (test_var > uint_max) {
43056 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43057 : PyLong_Type.tp_name, uint_max, test_var);
43058 0 : return -1;
43059 : }
43060 0 : *object->in.count = test_var;
43061 : } else {
43062 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43063 : PyLong_Type.tp_name);
43064 0 : return -1;
43065 : }
43066 : }
43067 0 : return 0;
43068 : }
43069 :
43070 0 : static PyObject *py_lsa_LookupNames2_out_get_count(PyObject *obj, void *closure)
43071 : {
43072 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
43073 0 : PyObject *py_count;
43074 0 : if (object->out.count == NULL) {
43075 0 : Py_RETURN_NONE;
43076 : }
43077 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
43078 0 : return py_count;
43079 : }
43080 :
43081 0 : static int py_lsa_LookupNames2_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
43082 : {
43083 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43084 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
43085 0 : if (value == NULL) {
43086 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
43087 0 : return -1;
43088 : }
43089 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
43090 0 : if (object->out.count == NULL) {
43091 0 : PyErr_NoMemory();
43092 0 : return -1;
43093 : }
43094 : {
43095 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
43096 0 : if (PyLong_Check(value)) {
43097 0 : unsigned long long test_var;
43098 0 : test_var = PyLong_AsUnsignedLongLong(value);
43099 0 : if (PyErr_Occurred() != NULL) {
43100 0 : return -1;
43101 : }
43102 0 : if (test_var > uint_max) {
43103 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43104 : PyLong_Type.tp_name, uint_max, test_var);
43105 0 : return -1;
43106 : }
43107 0 : *object->out.count = test_var;
43108 : } else {
43109 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43110 : PyLong_Type.tp_name);
43111 0 : return -1;
43112 : }
43113 : }
43114 0 : return 0;
43115 : }
43116 :
43117 0 : static PyObject *py_lsa_LookupNames2_in_get_lookup_options(PyObject *obj, void *closure)
43118 : {
43119 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
43120 0 : PyObject *py_lookup_options;
43121 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.lookup_options));
43122 0 : return py_lookup_options;
43123 : }
43124 :
43125 0 : static int py_lsa_LookupNames2_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
43126 : {
43127 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43128 0 : if (value == NULL) {
43129 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lookup_options");
43130 0 : return -1;
43131 : }
43132 : {
43133 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
43134 0 : if (PyLong_Check(value)) {
43135 0 : unsigned long long test_var;
43136 0 : test_var = PyLong_AsUnsignedLongLong(value);
43137 0 : if (PyErr_Occurred() != NULL) {
43138 0 : return -1;
43139 : }
43140 0 : if (test_var > uint_max) {
43141 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43142 : PyLong_Type.tp_name, uint_max, test_var);
43143 0 : return -1;
43144 : }
43145 0 : object->in.lookup_options = test_var;
43146 : } else {
43147 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43148 : PyLong_Type.tp_name);
43149 0 : return -1;
43150 : }
43151 : }
43152 0 : return 0;
43153 : }
43154 :
43155 0 : static PyObject *py_lsa_LookupNames2_in_get_client_revision(PyObject *obj, void *closure)
43156 : {
43157 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
43158 0 : PyObject *py_client_revision;
43159 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_revision));
43160 0 : return py_client_revision;
43161 : }
43162 :
43163 0 : static int py_lsa_LookupNames2_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
43164 : {
43165 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43166 0 : if (value == NULL) {
43167 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_revision");
43168 0 : return -1;
43169 : }
43170 : {
43171 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
43172 0 : if (PyLong_Check(value)) {
43173 0 : unsigned long long test_var;
43174 0 : test_var = PyLong_AsUnsignedLongLong(value);
43175 0 : if (PyErr_Occurred() != NULL) {
43176 0 : return -1;
43177 : }
43178 0 : if (test_var > uint_max) {
43179 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43180 : PyLong_Type.tp_name, uint_max, test_var);
43181 0 : return -1;
43182 : }
43183 0 : object->in.client_revision = test_var;
43184 : } else {
43185 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43186 : PyLong_Type.tp_name);
43187 0 : return -1;
43188 : }
43189 : }
43190 0 : return 0;
43191 : }
43192 :
43193 0 : static PyObject *py_lsa_LookupNames2_get_result(PyObject *obj, void *closure)
43194 : {
43195 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(obj);
43196 0 : PyObject *py_result;
43197 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43198 0 : return py_result;
43199 : }
43200 :
43201 0 : static int py_lsa_LookupNames2_set_result(PyObject *py_obj, PyObject *value, void *closure)
43202 : {
43203 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43204 0 : if (value == NULL) {
43205 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
43206 0 : return -1;
43207 : }
43208 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43209 0 : return 0;
43210 : }
43211 :
43212 : static PyGetSetDef py_lsa_LookupNames2_getsetters[] = {
43213 : {
43214 : .name = discard_const_p(char, "in_handle"),
43215 : .get = py_lsa_LookupNames2_in_get_handle,
43216 : .set = py_lsa_LookupNames2_in_set_handle,
43217 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
43218 : },
43219 : {
43220 : .name = discard_const_p(char, "in_num_names"),
43221 : .get = py_lsa_LookupNames2_in_get_num_names,
43222 : .set = py_lsa_LookupNames2_in_set_num_names,
43223 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43224 : },
43225 : {
43226 : .name = discard_const_p(char, "in_names"),
43227 : .get = py_lsa_LookupNames2_in_get_names,
43228 : .set = py_lsa_LookupNames2_in_set_names,
43229 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
43230 : },
43231 : {
43232 : .name = discard_const_p(char, "out_domains"),
43233 : .get = py_lsa_LookupNames2_out_get_domains,
43234 : .set = py_lsa_LookupNames2_out_set_domains,
43235 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
43236 : },
43237 : {
43238 : .name = discard_const_p(char, "in_sids"),
43239 : .get = py_lsa_LookupNames2_in_get_sids,
43240 : .set = py_lsa_LookupNames2_in_set_sids,
43241 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
43242 : },
43243 : {
43244 : .name = discard_const_p(char, "out_sids"),
43245 : .get = py_lsa_LookupNames2_out_get_sids,
43246 : .set = py_lsa_LookupNames2_out_set_sids,
43247 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray2")
43248 : },
43249 : {
43250 : .name = discard_const_p(char, "in_level"),
43251 : .get = py_lsa_LookupNames2_in_get_level,
43252 : .set = py_lsa_LookupNames2_in_set_level,
43253 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
43254 : },
43255 : {
43256 : .name = discard_const_p(char, "in_count"),
43257 : .get = py_lsa_LookupNames2_in_get_count,
43258 : .set = py_lsa_LookupNames2_in_set_count,
43259 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43260 : },
43261 : {
43262 : .name = discard_const_p(char, "out_count"),
43263 : .get = py_lsa_LookupNames2_out_get_count,
43264 : .set = py_lsa_LookupNames2_out_set_count,
43265 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
43266 : },
43267 : {
43268 : .name = discard_const_p(char, "in_lookup_options"),
43269 : .get = py_lsa_LookupNames2_in_get_lookup_options,
43270 : .set = py_lsa_LookupNames2_in_set_lookup_options,
43271 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
43272 : },
43273 : {
43274 : .name = discard_const_p(char, "in_client_revision"),
43275 : .get = py_lsa_LookupNames2_in_get_client_revision,
43276 : .set = py_lsa_LookupNames2_in_set_client_revision,
43277 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
43278 : },
43279 : {
43280 : .name = discard_const_p(char, "result"),
43281 : .get = py_lsa_LookupNames2_get_result,
43282 : .set = py_lsa_LookupNames2_set_result,
43283 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43284 : },
43285 : { .name = NULL }
43286 : };
43287 :
43288 0 : static PyObject *py_lsa_LookupNames2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43289 : {
43290 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames2, type);
43291 0 : struct lsa_LookupNames2 *_self = (struct lsa_LookupNames2 *)pytalloc_get_ptr(self);
43292 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43293 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
43294 : /* a pointer to a NULL pointer */
43295 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
43296 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
43297 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray2);
43298 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
43299 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
43300 0 : return self;
43301 : }
43302 :
43303 0 : static PyObject *py_lsa_LookupNames2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43304 : {
43305 :
43306 :
43307 0 : return PyLong_FromLong(58);
43308 : }
43309 :
43310 0 : static PyObject *py_lsa_LookupNames2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43311 : {
43312 0 : const struct ndr_interface_call *call = NULL;
43313 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43314 0 : PyObject *ret = NULL;
43315 0 : struct ndr_push *push = NULL;
43316 0 : DATA_BLOB blob;
43317 0 : enum ndr_err_code err;
43318 :
43319 0 : if (ndr_table_lsarpc.num_calls < 59) {
43320 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_pack");
43321 0 : return NULL;
43322 : }
43323 0 : call = &ndr_table_lsarpc.calls[58];
43324 :
43325 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43326 0 : if (push == NULL) {
43327 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43328 0 : return NULL;
43329 : }
43330 :
43331 0 : push->flags |= ndr_push_flags;
43332 :
43333 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43334 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43335 0 : TALLOC_FREE(push);
43336 0 : PyErr_SetNdrError(err);
43337 0 : return NULL;
43338 : }
43339 0 : blob = ndr_push_blob(push);
43340 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43341 0 : TALLOC_FREE(push);
43342 0 : return ret;
43343 : }
43344 :
43345 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43346 : {
43347 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43348 0 : PyObject *bigendian_obj = NULL;
43349 0 : PyObject *ndr64_obj = NULL;
43350 0 : libndr_flags ndr_push_flags = 0;
43351 :
43352 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43353 : discard_const_p(char *, kwnames),
43354 : &bigendian_obj,
43355 : &ndr64_obj)) {
43356 0 : return NULL;
43357 : }
43358 :
43359 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43360 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43361 : }
43362 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43363 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43364 : }
43365 :
43366 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43367 : }
43368 :
43369 0 : static PyObject *py_lsa_LookupNames2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43370 : {
43371 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43372 0 : PyObject *bigendian_obj = NULL;
43373 0 : PyObject *ndr64_obj = NULL;
43374 0 : libndr_flags ndr_push_flags = 0;
43375 :
43376 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43377 : discard_const_p(char *, kwnames),
43378 : &bigendian_obj,
43379 : &ndr64_obj)) {
43380 0 : return NULL;
43381 : }
43382 :
43383 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43384 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43385 : }
43386 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43387 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43388 : }
43389 :
43390 0 : return py_lsa_LookupNames2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43391 : }
43392 :
43393 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)
43394 : {
43395 0 : const struct ndr_interface_call *call = NULL;
43396 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43397 0 : struct ndr_pull *pull = NULL;
43398 0 : enum ndr_err_code err;
43399 :
43400 0 : if (ndr_table_lsarpc.num_calls < 59) {
43401 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_unpack");
43402 0 : return NULL;
43403 : }
43404 0 : call = &ndr_table_lsarpc.calls[58];
43405 :
43406 0 : pull = ndr_pull_init_blob(blob, object);
43407 0 : if (pull == NULL) {
43408 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43409 0 : return NULL;
43410 : }
43411 :
43412 0 : pull->flags |= ndr_pull_flags;
43413 :
43414 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43415 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43416 0 : TALLOC_FREE(pull);
43417 0 : PyErr_SetNdrError(err);
43418 0 : return NULL;
43419 : }
43420 0 : if (!allow_remaining) {
43421 0 : uint32_t highest_ofs;
43422 :
43423 0 : if (pull->offset > pull->relative_highest_offset) {
43424 0 : highest_ofs = pull->offset;
43425 : } else {
43426 0 : highest_ofs = pull->relative_highest_offset;
43427 : }
43428 0 : if (highest_ofs < pull->data_size) {
43429 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43430 : "not all bytes consumed ofs[%u] size[%u]",
43431 : highest_ofs, pull->data_size);
43432 0 : TALLOC_FREE(pull);
43433 0 : PyErr_SetNdrError(err);
43434 0 : return NULL;
43435 : }
43436 : }
43437 :
43438 0 : TALLOC_FREE(pull);
43439 0 : Py_RETURN_NONE;
43440 : }
43441 :
43442 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43443 : {
43444 0 : DATA_BLOB blob;
43445 0 : Py_ssize_t blob_length = 0;
43446 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43447 0 : PyObject *bigendian_obj = NULL;
43448 0 : PyObject *ndr64_obj = NULL;
43449 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43450 0 : PyObject *allow_remaining_obj = NULL;
43451 0 : bool allow_remaining = false;
43452 :
43453 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43454 : discard_const_p(char *, kwnames),
43455 : &blob.data, &blob_length,
43456 : &bigendian_obj,
43457 : &ndr64_obj,
43458 : &allow_remaining_obj)) {
43459 0 : return NULL;
43460 : }
43461 0 : blob.length = blob_length;
43462 :
43463 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43464 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43465 : }
43466 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43467 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43468 : }
43469 :
43470 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43471 0 : allow_remaining = true;
43472 : }
43473 :
43474 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43475 : }
43476 :
43477 0 : static PyObject *py_lsa_LookupNames2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43478 : {
43479 0 : DATA_BLOB blob;
43480 0 : Py_ssize_t blob_length = 0;
43481 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43482 0 : PyObject *bigendian_obj = NULL;
43483 0 : PyObject *ndr64_obj = NULL;
43484 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43485 0 : PyObject *allow_remaining_obj = NULL;
43486 0 : bool allow_remaining = false;
43487 :
43488 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43489 : discard_const_p(char *, kwnames),
43490 : &blob.data, &blob_length,
43491 : &bigendian_obj,
43492 : &ndr64_obj,
43493 : &allow_remaining_obj)) {
43494 0 : return NULL;
43495 : }
43496 0 : blob.length = blob_length;
43497 :
43498 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43499 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43500 : }
43501 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43502 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43503 : }
43504 :
43505 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43506 0 : allow_remaining = true;
43507 : }
43508 :
43509 0 : return py_lsa_LookupNames2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43510 : }
43511 :
43512 0 : static PyObject *py_lsa_LookupNames2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43513 : {
43514 0 : const struct ndr_interface_call *call = NULL;
43515 0 : struct lsa_LookupNames2 *object = pytalloc_get_ptr(py_obj);
43516 0 : PyObject *ret;
43517 0 : char *retstr;
43518 :
43519 0 : if (ndr_table_lsarpc.num_calls < 59) {
43520 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames2_ndr_print");
43521 0 : return NULL;
43522 : }
43523 0 : call = &ndr_table_lsarpc.calls[58];
43524 :
43525 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43526 0 : ret = PyUnicode_FromString(retstr);
43527 0 : TALLOC_FREE(retstr);
43528 :
43529 0 : return ret;
43530 : }
43531 :
43532 0 : static PyObject *py_lsa_LookupNames2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43533 : {
43534 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_in", NDR_IN);
43535 : }
43536 :
43537 0 : static PyObject *py_lsa_LookupNames2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43538 : {
43539 0 : return py_lsa_LookupNames2_ndr_print(py_obj, "lsa_LookupNames2_out", NDR_OUT);
43540 : }
43541 :
43542 : static PyMethodDef py_lsa_LookupNames2_methods[] = {
43543 : { "opnum", (PyCFunction)py_lsa_LookupNames2_ndr_opnum, METH_NOARGS|METH_CLASS,
43544 : "lsa.LookupNames2.opnum() -> 58 (0x3a) " },
43545 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43546 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43547 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43548 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43549 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43550 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43551 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43552 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43553 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43554 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43555 : { NULL, NULL, 0, NULL }
43556 : };
43557 :
43558 :
43559 : static PyTypeObject lsa_LookupNames2_Type = {
43560 : PyVarObject_HEAD_INIT(NULL, 0)
43561 : .tp_name = "lsa.LookupNames2",
43562 : .tp_getset = py_lsa_LookupNames2_getsetters,
43563 : .tp_methods = py_lsa_LookupNames2_methods,
43564 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43565 : .tp_new = py_lsa_LookupNames2_new,
43566 : };
43567 :
43568 0 : static bool pack_py_lsa_LookupNames2_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames2 *r)
43569 : {
43570 0 : PyObject *py_handle;
43571 0 : PyObject *py_names;
43572 0 : PyObject *py_sids;
43573 0 : PyObject *py_level;
43574 0 : PyObject *py_count;
43575 0 : PyObject *py_lookup_options;
43576 0 : PyObject *py_client_revision;
43577 0 : const char *kwnames[] = {
43578 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
43579 : };
43580 :
43581 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)) {
43582 0 : return false;
43583 : }
43584 :
43585 0 : if (py_handle == NULL) {
43586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
43587 0 : return false;
43588 : }
43589 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
43590 0 : if (r->in.handle == NULL) {
43591 0 : PyErr_NoMemory();
43592 0 : return false;
43593 : }
43594 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
43595 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
43596 0 : PyErr_NoMemory();
43597 0 : return false;
43598 : }
43599 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
43600 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43601 0 : r->in.num_names = PyList_GET_SIZE(py_names);
43602 0 : if (py_names == NULL) {
43603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
43604 0 : return false;
43605 : }
43606 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
43607 : {
43608 0 : int names_cntr_0;
43609 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
43610 0 : if (!r->in.names) { return false; }
43611 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
43612 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
43613 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
43614 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.names)[names_cntr_0]");
43615 0 : return false;
43616 : }
43617 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
43618 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
43619 0 : PyErr_NoMemory();
43620 0 : return false;
43621 : }
43622 0 : (r->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
43623 : }
43624 : }
43625 0 : if (py_sids == NULL) {
43626 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
43627 0 : return false;
43628 : }
43629 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
43630 0 : if (r->in.sids == NULL) {
43631 0 : PyErr_NoMemory();
43632 0 : return false;
43633 : }
43634 0 : PY_CHECK_TYPE(&lsa_TransSidArray2_Type, py_sids, return false;);
43635 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
43636 0 : PyErr_NoMemory();
43637 0 : return false;
43638 : }
43639 0 : r->in.sids = (struct lsa_TransSidArray2 *)pytalloc_get_ptr(py_sids);
43640 0 : if (py_level == NULL) {
43641 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
43642 0 : return false;
43643 : }
43644 : {
43645 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
43646 0 : if (PyLong_Check(py_level)) {
43647 0 : unsigned long long test_var;
43648 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
43649 0 : if (PyErr_Occurred() != NULL) {
43650 0 : return false;
43651 : }
43652 0 : if (test_var > uint_max) {
43653 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43654 : PyLong_Type.tp_name, uint_max, test_var);
43655 0 : return false;
43656 : }
43657 0 : r->in.level = test_var;
43658 : } else {
43659 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43660 : PyLong_Type.tp_name);
43661 0 : return false;
43662 : }
43663 : }
43664 0 : if (py_count == NULL) {
43665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
43666 0 : return false;
43667 : }
43668 0 : r->in.count = talloc_ptrtype(r, r->in.count);
43669 0 : if (r->in.count == NULL) {
43670 0 : PyErr_NoMemory();
43671 0 : return false;
43672 : }
43673 : {
43674 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
43675 0 : if (PyLong_Check(py_count)) {
43676 0 : unsigned long long test_var;
43677 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
43678 0 : if (PyErr_Occurred() != NULL) {
43679 0 : return false;
43680 : }
43681 0 : if (test_var > uint_max) {
43682 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43683 : PyLong_Type.tp_name, uint_max, test_var);
43684 0 : return false;
43685 : }
43686 0 : *r->in.count = test_var;
43687 : } else {
43688 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43689 : PyLong_Type.tp_name);
43690 0 : return false;
43691 : }
43692 : }
43693 0 : if (py_lookup_options == NULL) {
43694 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lookup_options");
43695 0 : return false;
43696 : }
43697 : {
43698 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
43699 0 : if (PyLong_Check(py_lookup_options)) {
43700 0 : unsigned long long test_var;
43701 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
43702 0 : if (PyErr_Occurred() != NULL) {
43703 0 : return false;
43704 : }
43705 0 : if (test_var > uint_max) {
43706 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43707 : PyLong_Type.tp_name, uint_max, test_var);
43708 0 : return false;
43709 : }
43710 0 : r->in.lookup_options = test_var;
43711 : } else {
43712 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43713 : PyLong_Type.tp_name);
43714 0 : return false;
43715 : }
43716 : }
43717 0 : if (py_client_revision == NULL) {
43718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_revision");
43719 0 : return false;
43720 : }
43721 : {
43722 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
43723 0 : if (PyLong_Check(py_client_revision)) {
43724 0 : unsigned long long test_var;
43725 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
43726 0 : if (PyErr_Occurred() != NULL) {
43727 0 : return false;
43728 : }
43729 0 : if (test_var > uint_max) {
43730 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43731 : PyLong_Type.tp_name, uint_max, test_var);
43732 0 : return false;
43733 : }
43734 0 : r->in.client_revision = test_var;
43735 : } else {
43736 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43737 : PyLong_Type.tp_name);
43738 0 : return false;
43739 : }
43740 : }
43741 0 : return true;
43742 : }
43743 :
43744 0 : static PyObject *unpack_py_lsa_LookupNames2_args_out(struct lsa_LookupNames2 *r)
43745 : {
43746 0 : PyObject *result;
43747 0 : PyObject *py_domains;
43748 0 : PyObject *py_sids;
43749 0 : PyObject *py_count;
43750 0 : result = PyTuple_New(3);
43751 0 : if (*r->out.domains == NULL) {
43752 0 : py_domains = Py_None;
43753 0 : Py_INCREF(py_domains);
43754 : } else {
43755 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
43756 : }
43757 0 : PyTuple_SetItem(result, 0, py_domains);
43758 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray2_Type, r->out.sids, r->out.sids);
43759 0 : PyTuple_SetItem(result, 1, py_sids);
43760 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
43761 0 : PyTuple_SetItem(result, 2, py_count);
43762 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
43763 0 : PyErr_SetNTSTATUS(r->out.result);
43764 0 : return NULL;
43765 : }
43766 :
43767 0 : return result;
43768 : }
43769 :
43770 :
43771 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_policy_handle(PyObject *obj, void *closure)
43772 : {
43773 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43774 0 : PyObject *py_policy_handle;
43775 0 : if (object->in.policy_handle == NULL) {
43776 0 : Py_RETURN_NONE;
43777 : }
43778 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
43779 0 : return py_policy_handle;
43780 : }
43781 :
43782 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
43783 : {
43784 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43785 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
43786 0 : if (value == NULL) {
43787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.policy_handle");
43788 0 : return -1;
43789 : }
43790 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
43791 0 : if (object->in.policy_handle == NULL) {
43792 0 : PyErr_NoMemory();
43793 0 : return -1;
43794 : }
43795 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
43796 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43797 0 : PyErr_NoMemory();
43798 0 : return -1;
43799 : }
43800 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
43801 0 : return 0;
43802 : }
43803 :
43804 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_info(PyObject *obj, void *closure)
43805 : {
43806 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43807 0 : PyObject *py_info;
43808 0 : if (object->in.info == NULL) {
43809 0 : Py_RETURN_NONE;
43810 : }
43811 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
43812 0 : return py_info;
43813 : }
43814 :
43815 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
43816 : {
43817 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43818 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
43819 0 : if (value == NULL) {
43820 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
43821 0 : return -1;
43822 : }
43823 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
43824 0 : if (object->in.info == NULL) {
43825 0 : PyErr_NoMemory();
43826 0 : return -1;
43827 : }
43828 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
43829 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43830 0 : PyErr_NoMemory();
43831 0 : return -1;
43832 : }
43833 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
43834 0 : return 0;
43835 : }
43836 :
43837 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal(PyObject *obj, void *closure)
43838 : {
43839 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43840 0 : PyObject *py_auth_info_internal;
43841 0 : if (object->in.auth_info_internal == NULL) {
43842 0 : Py_RETURN_NONE;
43843 : }
43844 0 : py_auth_info_internal = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternal_Type, object->in.auth_info_internal, object->in.auth_info_internal);
43845 0 : return py_auth_info_internal;
43846 : }
43847 :
43848 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal(PyObject *py_obj, PyObject *value, void *closure)
43849 : {
43850 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43851 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info_internal));
43852 0 : if (value == NULL) {
43853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.auth_info_internal");
43854 0 : return -1;
43855 : }
43856 0 : object->in.auth_info_internal = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info_internal);
43857 0 : if (object->in.auth_info_internal == NULL) {
43858 0 : PyErr_NoMemory();
43859 0 : return -1;
43860 : }
43861 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, value, return -1;);
43862 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43863 0 : PyErr_NoMemory();
43864 0 : return -1;
43865 : }
43866 0 : object->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(value);
43867 0 : return 0;
43868 : }
43869 :
43870 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_in_get_access_mask(PyObject *obj, void *closure)
43871 : {
43872 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43873 0 : PyObject *py_access_mask;
43874 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
43875 0 : return py_access_mask;
43876 : }
43877 :
43878 0 : static int py_lsa_CreateTrustedDomainEx2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
43879 : {
43880 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43881 0 : if (value == NULL) {
43882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
43883 0 : return -1;
43884 : }
43885 : {
43886 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
43887 0 : if (PyLong_Check(value)) {
43888 0 : unsigned long long test_var;
43889 0 : test_var = PyLong_AsUnsignedLongLong(value);
43890 0 : if (PyErr_Occurred() != NULL) {
43891 0 : return -1;
43892 : }
43893 0 : if (test_var > uint_max) {
43894 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43895 : PyLong_Type.tp_name, uint_max, test_var);
43896 0 : return -1;
43897 : }
43898 0 : object->in.access_mask = test_var;
43899 : } else {
43900 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43901 : PyLong_Type.tp_name);
43902 0 : return -1;
43903 : }
43904 : }
43905 0 : return 0;
43906 : }
43907 :
43908 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle(PyObject *obj, void *closure)
43909 : {
43910 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43911 0 : PyObject *py_trustdom_handle;
43912 0 : if (object->out.trustdom_handle == NULL) {
43913 0 : Py_RETURN_NONE;
43914 : }
43915 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
43916 0 : return py_trustdom_handle;
43917 : }
43918 :
43919 0 : static int py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
43920 : {
43921 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43922 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
43923 0 : if (value == NULL) {
43924 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
43925 0 : return -1;
43926 : }
43927 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
43928 0 : if (object->out.trustdom_handle == NULL) {
43929 0 : PyErr_NoMemory();
43930 0 : return -1;
43931 : }
43932 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
43933 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43934 0 : PyErr_NoMemory();
43935 0 : return -1;
43936 : }
43937 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
43938 0 : return 0;
43939 : }
43940 :
43941 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_get_result(PyObject *obj, void *closure)
43942 : {
43943 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(obj);
43944 0 : PyObject *py_result;
43945 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43946 0 : return py_result;
43947 : }
43948 :
43949 0 : static int py_lsa_CreateTrustedDomainEx2_set_result(PyObject *py_obj, PyObject *value, void *closure)
43950 : {
43951 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
43952 0 : if (value == NULL) {
43953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
43954 0 : return -1;
43955 : }
43956 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43957 0 : return 0;
43958 : }
43959 :
43960 : static PyGetSetDef py_lsa_CreateTrustedDomainEx2_getsetters[] = {
43961 : {
43962 : .name = discard_const_p(char, "in_policy_handle"),
43963 : .get = py_lsa_CreateTrustedDomainEx2_in_get_policy_handle,
43964 : .set = py_lsa_CreateTrustedDomainEx2_in_set_policy_handle,
43965 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
43966 : },
43967 : {
43968 : .name = discard_const_p(char, "in_info"),
43969 : .get = py_lsa_CreateTrustedDomainEx2_in_get_info,
43970 : .set = py_lsa_CreateTrustedDomainEx2_in_set_info,
43971 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
43972 : },
43973 : {
43974 : .name = discard_const_p(char, "in_auth_info_internal"),
43975 : .get = py_lsa_CreateTrustedDomainEx2_in_get_auth_info_internal,
43976 : .set = py_lsa_CreateTrustedDomainEx2_in_set_auth_info_internal,
43977 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternal")
43978 : },
43979 : {
43980 : .name = discard_const_p(char, "in_access_mask"),
43981 : .get = py_lsa_CreateTrustedDomainEx2_in_get_access_mask,
43982 : .set = py_lsa_CreateTrustedDomainEx2_in_set_access_mask,
43983 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
43984 : },
43985 : {
43986 : .name = discard_const_p(char, "out_trustdom_handle"),
43987 : .get = py_lsa_CreateTrustedDomainEx2_out_get_trustdom_handle,
43988 : .set = py_lsa_CreateTrustedDomainEx2_out_set_trustdom_handle,
43989 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
43990 : },
43991 : {
43992 : .name = discard_const_p(char, "result"),
43993 : .get = py_lsa_CreateTrustedDomainEx2_get_result,
43994 : .set = py_lsa_CreateTrustedDomainEx2_set_result,
43995 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43996 : },
43997 : { .name = NULL }
43998 : };
43999 :
44000 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44001 : {
44002 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx2, type);
44003 0 : struct lsa_CreateTrustedDomainEx2 *_self = (struct lsa_CreateTrustedDomainEx2 *)pytalloc_get_ptr(self);
44004 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44005 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
44006 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
44007 0 : _self->in.auth_info_internal = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfoInternal);
44008 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
44009 0 : return self;
44010 : }
44011 :
44012 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44013 : {
44014 :
44015 :
44016 0 : return PyLong_FromLong(59);
44017 : }
44018 :
44019 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44020 : {
44021 0 : const struct ndr_interface_call *call = NULL;
44022 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
44023 0 : PyObject *ret = NULL;
44024 0 : struct ndr_push *push = NULL;
44025 0 : DATA_BLOB blob;
44026 0 : enum ndr_err_code err;
44027 :
44028 0 : if (ndr_table_lsarpc.num_calls < 60) {
44029 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_pack");
44030 0 : return NULL;
44031 : }
44032 0 : call = &ndr_table_lsarpc.calls[59];
44033 :
44034 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44035 0 : if (push == NULL) {
44036 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44037 0 : return NULL;
44038 : }
44039 :
44040 0 : push->flags |= ndr_push_flags;
44041 :
44042 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44043 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44044 0 : TALLOC_FREE(push);
44045 0 : PyErr_SetNdrError(err);
44046 0 : return NULL;
44047 : }
44048 0 : blob = ndr_push_blob(push);
44049 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44050 0 : TALLOC_FREE(push);
44051 0 : return ret;
44052 : }
44053 :
44054 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44055 : {
44056 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44057 0 : PyObject *bigendian_obj = NULL;
44058 0 : PyObject *ndr64_obj = NULL;
44059 0 : libndr_flags ndr_push_flags = 0;
44060 :
44061 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44062 : discard_const_p(char *, kwnames),
44063 : &bigendian_obj,
44064 : &ndr64_obj)) {
44065 0 : return NULL;
44066 : }
44067 :
44068 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44069 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44070 : }
44071 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44072 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44073 : }
44074 :
44075 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44076 : }
44077 :
44078 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44079 : {
44080 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44081 0 : PyObject *bigendian_obj = NULL;
44082 0 : PyObject *ndr64_obj = NULL;
44083 0 : libndr_flags ndr_push_flags = 0;
44084 :
44085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44086 : discard_const_p(char *, kwnames),
44087 : &bigendian_obj,
44088 : &ndr64_obj)) {
44089 0 : return NULL;
44090 : }
44091 :
44092 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44093 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44094 : }
44095 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44096 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44097 : }
44098 :
44099 0 : return py_lsa_CreateTrustedDomainEx2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44100 : }
44101 :
44102 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)
44103 : {
44104 0 : const struct ndr_interface_call *call = NULL;
44105 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
44106 0 : struct ndr_pull *pull = NULL;
44107 0 : enum ndr_err_code err;
44108 :
44109 0 : if (ndr_table_lsarpc.num_calls < 60) {
44110 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_unpack");
44111 0 : return NULL;
44112 : }
44113 0 : call = &ndr_table_lsarpc.calls[59];
44114 :
44115 0 : pull = ndr_pull_init_blob(blob, object);
44116 0 : if (pull == NULL) {
44117 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44118 0 : return NULL;
44119 : }
44120 :
44121 0 : pull->flags |= ndr_pull_flags;
44122 :
44123 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44124 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44125 0 : TALLOC_FREE(pull);
44126 0 : PyErr_SetNdrError(err);
44127 0 : return NULL;
44128 : }
44129 0 : if (!allow_remaining) {
44130 0 : uint32_t highest_ofs;
44131 :
44132 0 : if (pull->offset > pull->relative_highest_offset) {
44133 0 : highest_ofs = pull->offset;
44134 : } else {
44135 0 : highest_ofs = pull->relative_highest_offset;
44136 : }
44137 0 : if (highest_ofs < pull->data_size) {
44138 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44139 : "not all bytes consumed ofs[%u] size[%u]",
44140 : highest_ofs, pull->data_size);
44141 0 : TALLOC_FREE(pull);
44142 0 : PyErr_SetNdrError(err);
44143 0 : return NULL;
44144 : }
44145 : }
44146 :
44147 0 : TALLOC_FREE(pull);
44148 0 : Py_RETURN_NONE;
44149 : }
44150 :
44151 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44152 : {
44153 0 : DATA_BLOB blob;
44154 0 : Py_ssize_t blob_length = 0;
44155 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44156 0 : PyObject *bigendian_obj = NULL;
44157 0 : PyObject *ndr64_obj = NULL;
44158 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44159 0 : PyObject *allow_remaining_obj = NULL;
44160 0 : bool allow_remaining = false;
44161 :
44162 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44163 : discard_const_p(char *, kwnames),
44164 : &blob.data, &blob_length,
44165 : &bigendian_obj,
44166 : &ndr64_obj,
44167 : &allow_remaining_obj)) {
44168 0 : return NULL;
44169 : }
44170 0 : blob.length = blob_length;
44171 :
44172 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44173 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44174 : }
44175 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44176 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44177 : }
44178 :
44179 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44180 0 : allow_remaining = true;
44181 : }
44182 :
44183 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44184 : }
44185 :
44186 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44187 : {
44188 0 : DATA_BLOB blob;
44189 0 : Py_ssize_t blob_length = 0;
44190 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44191 0 : PyObject *bigendian_obj = NULL;
44192 0 : PyObject *ndr64_obj = NULL;
44193 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44194 0 : PyObject *allow_remaining_obj = NULL;
44195 0 : bool allow_remaining = false;
44196 :
44197 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44198 : discard_const_p(char *, kwnames),
44199 : &blob.data, &blob_length,
44200 : &bigendian_obj,
44201 : &ndr64_obj,
44202 : &allow_remaining_obj)) {
44203 0 : return NULL;
44204 : }
44205 0 : blob.length = blob_length;
44206 :
44207 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44208 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44209 : }
44210 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44211 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44212 : }
44213 :
44214 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44215 0 : allow_remaining = true;
44216 : }
44217 :
44218 0 : return py_lsa_CreateTrustedDomainEx2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44219 : }
44220 :
44221 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
44222 : {
44223 0 : const struct ndr_interface_call *call = NULL;
44224 0 : struct lsa_CreateTrustedDomainEx2 *object = pytalloc_get_ptr(py_obj);
44225 0 : PyObject *ret;
44226 0 : char *retstr;
44227 :
44228 0 : if (ndr_table_lsarpc.num_calls < 60) {
44229 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx2_ndr_print");
44230 0 : return NULL;
44231 : }
44232 0 : call = &ndr_table_lsarpc.calls[59];
44233 :
44234 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44235 0 : ret = PyUnicode_FromString(retstr);
44236 0 : TALLOC_FREE(retstr);
44237 :
44238 0 : return ret;
44239 : }
44240 :
44241 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44242 : {
44243 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_in", NDR_IN);
44244 : }
44245 :
44246 0 : static PyObject *py_lsa_CreateTrustedDomainEx2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44247 : {
44248 0 : return py_lsa_CreateTrustedDomainEx2_ndr_print(py_obj, "lsa_CreateTrustedDomainEx2_out", NDR_OUT);
44249 : }
44250 :
44251 : static PyMethodDef py_lsa_CreateTrustedDomainEx2_methods[] = {
44252 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_opnum, METH_NOARGS|METH_CLASS,
44253 : "lsa.CreateTrustedDomainEx2.opnum() -> 59 (0x3b) " },
44254 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44255 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44256 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44257 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44258 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44259 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44260 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44261 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44262 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44263 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44264 : { NULL, NULL, 0, NULL }
44265 : };
44266 :
44267 :
44268 : static PyTypeObject lsa_CreateTrustedDomainEx2_Type = {
44269 : PyVarObject_HEAD_INIT(NULL, 0)
44270 : .tp_name = "lsa.CreateTrustedDomainEx2",
44271 : .tp_getset = py_lsa_CreateTrustedDomainEx2_getsetters,
44272 : .tp_methods = py_lsa_CreateTrustedDomainEx2_methods,
44273 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44274 : .tp_new = py_lsa_CreateTrustedDomainEx2_new,
44275 : };
44276 :
44277 1 : static bool pack_py_lsa_CreateTrustedDomainEx2_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx2 *r)
44278 : {
44279 0 : PyObject *py_policy_handle;
44280 0 : PyObject *py_info;
44281 0 : PyObject *py_auth_info_internal;
44282 0 : PyObject *py_access_mask;
44283 1 : const char *kwnames[] = {
44284 : "policy_handle", "info", "auth_info_internal", "access_mask", NULL
44285 : };
44286 :
44287 1 : 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)) {
44288 0 : return false;
44289 : }
44290 :
44291 1 : if (py_policy_handle == NULL) {
44292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.policy_handle");
44293 0 : return false;
44294 : }
44295 1 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
44296 1 : if (r->in.policy_handle == NULL) {
44297 0 : PyErr_NoMemory();
44298 0 : return false;
44299 : }
44300 1 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
44301 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
44302 0 : PyErr_NoMemory();
44303 0 : return false;
44304 : }
44305 1 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
44306 1 : if (py_info == NULL) {
44307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
44308 0 : return false;
44309 : }
44310 1 : r->in.info = talloc_ptrtype(r, r->in.info);
44311 1 : if (r->in.info == NULL) {
44312 0 : PyErr_NoMemory();
44313 0 : return false;
44314 : }
44315 1 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
44316 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
44317 0 : PyErr_NoMemory();
44318 0 : return false;
44319 : }
44320 1 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
44321 1 : if (py_auth_info_internal == NULL) {
44322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.auth_info_internal");
44323 0 : return false;
44324 : }
44325 1 : r->in.auth_info_internal = talloc_ptrtype(r, r->in.auth_info_internal);
44326 1 : if (r->in.auth_info_internal == NULL) {
44327 0 : PyErr_NoMemory();
44328 0 : return false;
44329 : }
44330 1 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternal_Type, py_auth_info_internal, return false;);
44331 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info_internal)) == NULL) {
44332 0 : PyErr_NoMemory();
44333 0 : return false;
44334 : }
44335 1 : r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternal *)pytalloc_get_ptr(py_auth_info_internal);
44336 1 : if (py_access_mask == NULL) {
44337 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
44338 0 : return false;
44339 : }
44340 : {
44341 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
44342 1 : if (PyLong_Check(py_access_mask)) {
44343 0 : unsigned long long test_var;
44344 1 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
44345 1 : if (PyErr_Occurred() != NULL) {
44346 0 : return false;
44347 : }
44348 1 : if (test_var > uint_max) {
44349 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44350 : PyLong_Type.tp_name, uint_max, test_var);
44351 0 : return false;
44352 : }
44353 1 : r->in.access_mask = test_var;
44354 : } else {
44355 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44356 : PyLong_Type.tp_name);
44357 0 : return false;
44358 : }
44359 : }
44360 1 : return true;
44361 : }
44362 :
44363 1 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx2_args_out(struct lsa_CreateTrustedDomainEx2 *r)
44364 : {
44365 0 : PyObject *result;
44366 0 : PyObject *py_trustdom_handle;
44367 1 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
44368 1 : result = py_trustdom_handle;
44369 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
44370 0 : PyErr_SetNTSTATUS(r->out.result);
44371 0 : return NULL;
44372 : }
44373 :
44374 1 : return result;
44375 : }
44376 :
44377 :
44378 0 : static PyObject *py_lsa_LookupNames3_in_get_handle(PyObject *obj, void *closure)
44379 : {
44380 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44381 0 : PyObject *py_handle;
44382 0 : if (object->in.handle == NULL) {
44383 0 : Py_RETURN_NONE;
44384 : }
44385 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
44386 0 : return py_handle;
44387 : }
44388 :
44389 0 : static int py_lsa_LookupNames3_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
44390 : {
44391 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44392 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
44393 0 : if (value == NULL) {
44394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
44395 0 : return -1;
44396 : }
44397 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
44398 0 : if (object->in.handle == NULL) {
44399 0 : PyErr_NoMemory();
44400 0 : return -1;
44401 : }
44402 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44403 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44404 0 : PyErr_NoMemory();
44405 0 : return -1;
44406 : }
44407 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
44408 0 : return 0;
44409 : }
44410 :
44411 0 : static PyObject *py_lsa_LookupNames3_in_get_num_names(PyObject *obj, void *closure)
44412 : {
44413 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44414 0 : PyObject *py_num_names;
44415 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_names));
44416 0 : return py_num_names;
44417 : }
44418 :
44419 0 : static int py_lsa_LookupNames3_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
44420 : {
44421 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44422 0 : if (value == NULL) {
44423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_names");
44424 0 : return -1;
44425 : }
44426 : {
44427 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
44428 0 : if (PyLong_Check(value)) {
44429 0 : unsigned long long test_var;
44430 0 : test_var = PyLong_AsUnsignedLongLong(value);
44431 0 : if (PyErr_Occurred() != NULL) {
44432 0 : return -1;
44433 : }
44434 0 : if (test_var > uint_max) {
44435 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44436 : PyLong_Type.tp_name, uint_max, test_var);
44437 0 : return -1;
44438 : }
44439 0 : object->in.num_names = test_var;
44440 : } else {
44441 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44442 : PyLong_Type.tp_name);
44443 0 : return -1;
44444 : }
44445 : }
44446 0 : return 0;
44447 : }
44448 :
44449 0 : static PyObject *py_lsa_LookupNames3_in_get_names(PyObject *obj, void *closure)
44450 : {
44451 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44452 0 : PyObject *py_names;
44453 0 : py_names = PyList_New(object->in.num_names);
44454 0 : if (py_names == NULL) {
44455 0 : return NULL;
44456 : }
44457 : {
44458 : int names_cntr_0;
44459 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
44460 0 : PyObject *py_names_0;
44461 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &(object->in.names)[names_cntr_0]);
44462 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
44463 : }
44464 : }
44465 0 : return py_names;
44466 : }
44467 :
44468 0 : static int py_lsa_LookupNames3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
44469 : {
44470 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44471 0 : if (value == NULL) {
44472 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
44473 0 : return -1;
44474 : }
44475 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
44476 : {
44477 0 : int names_cntr_0;
44478 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
44479 0 : if (!object->in.names) { return -1; }
44480 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
44481 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
44482 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
44483 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.names)[names_cntr_0]");
44484 0 : return -1;
44485 : }
44486 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
44487 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
44488 0 : PyErr_NoMemory();
44489 0 : return -1;
44490 : }
44491 0 : (object->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
44492 : }
44493 : }
44494 0 : return 0;
44495 : }
44496 :
44497 0 : static PyObject *py_lsa_LookupNames3_out_get_domains(PyObject *obj, void *closure)
44498 : {
44499 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44500 0 : PyObject *py_domains;
44501 0 : if (object->out.domains == NULL) {
44502 0 : Py_RETURN_NONE;
44503 : }
44504 0 : if (*object->out.domains == NULL) {
44505 0 : py_domains = Py_None;
44506 0 : Py_INCREF(py_domains);
44507 : } else {
44508 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
44509 : }
44510 0 : return py_domains;
44511 : }
44512 :
44513 0 : static int py_lsa_LookupNames3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
44514 : {
44515 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44516 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
44517 0 : if (value == NULL) {
44518 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
44519 0 : return -1;
44520 : }
44521 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
44522 0 : if (object->out.domains == NULL) {
44523 0 : PyErr_NoMemory();
44524 0 : return -1;
44525 : }
44526 0 : if (value == Py_None) {
44527 0 : *object->out.domains = NULL;
44528 : } else {
44529 0 : *object->out.domains = NULL;
44530 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
44531 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44532 0 : PyErr_NoMemory();
44533 0 : return -1;
44534 : }
44535 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
44536 : }
44537 0 : return 0;
44538 : }
44539 :
44540 0 : static PyObject *py_lsa_LookupNames3_in_get_sids(PyObject *obj, void *closure)
44541 : {
44542 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44543 0 : PyObject *py_sids;
44544 0 : if (object->in.sids == NULL) {
44545 0 : Py_RETURN_NONE;
44546 : }
44547 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
44548 0 : return py_sids;
44549 : }
44550 :
44551 0 : static int py_lsa_LookupNames3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
44552 : {
44553 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
44555 0 : if (value == NULL) {
44556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
44557 0 : return -1;
44558 : }
44559 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
44560 0 : if (object->in.sids == NULL) {
44561 0 : PyErr_NoMemory();
44562 0 : return -1;
44563 : }
44564 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
44565 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44566 0 : PyErr_NoMemory();
44567 0 : return -1;
44568 : }
44569 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
44570 0 : return 0;
44571 : }
44572 :
44573 0 : static PyObject *py_lsa_LookupNames3_out_get_sids(PyObject *obj, void *closure)
44574 : {
44575 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44576 0 : PyObject *py_sids;
44577 0 : if (object->out.sids == NULL) {
44578 0 : Py_RETURN_NONE;
44579 : }
44580 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
44581 0 : return py_sids;
44582 : }
44583 :
44584 0 : static int py_lsa_LookupNames3_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
44585 : {
44586 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44587 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
44588 0 : if (value == NULL) {
44589 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
44590 0 : return -1;
44591 : }
44592 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
44593 0 : if (object->out.sids == NULL) {
44594 0 : PyErr_NoMemory();
44595 0 : return -1;
44596 : }
44597 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
44598 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44599 0 : PyErr_NoMemory();
44600 0 : return -1;
44601 : }
44602 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
44603 0 : return 0;
44604 : }
44605 :
44606 0 : static PyObject *py_lsa_LookupNames3_in_get_level(PyObject *obj, void *closure)
44607 : {
44608 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44609 0 : PyObject *py_level;
44610 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
44611 0 : return py_level;
44612 : }
44613 :
44614 0 : static int py_lsa_LookupNames3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
44615 : {
44616 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44617 0 : if (value == NULL) {
44618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
44619 0 : return -1;
44620 : }
44621 : {
44622 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
44623 0 : if (PyLong_Check(value)) {
44624 0 : unsigned long long test_var;
44625 0 : test_var = PyLong_AsUnsignedLongLong(value);
44626 0 : if (PyErr_Occurred() != NULL) {
44627 0 : return -1;
44628 : }
44629 0 : if (test_var > uint_max) {
44630 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44631 : PyLong_Type.tp_name, uint_max, test_var);
44632 0 : return -1;
44633 : }
44634 0 : object->in.level = test_var;
44635 : } else {
44636 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44637 : PyLong_Type.tp_name);
44638 0 : return -1;
44639 : }
44640 : }
44641 0 : return 0;
44642 : }
44643 :
44644 0 : static PyObject *py_lsa_LookupNames3_in_get_count(PyObject *obj, void *closure)
44645 : {
44646 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44647 0 : PyObject *py_count;
44648 0 : if (object->in.count == NULL) {
44649 0 : Py_RETURN_NONE;
44650 : }
44651 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
44652 0 : return py_count;
44653 : }
44654 :
44655 0 : static int py_lsa_LookupNames3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
44656 : {
44657 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44658 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
44659 0 : if (value == NULL) {
44660 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
44661 0 : return -1;
44662 : }
44663 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
44664 0 : if (object->in.count == NULL) {
44665 0 : PyErr_NoMemory();
44666 0 : return -1;
44667 : }
44668 : {
44669 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
44670 0 : if (PyLong_Check(value)) {
44671 0 : unsigned long long test_var;
44672 0 : test_var = PyLong_AsUnsignedLongLong(value);
44673 0 : if (PyErr_Occurred() != NULL) {
44674 0 : return -1;
44675 : }
44676 0 : if (test_var > uint_max) {
44677 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44678 : PyLong_Type.tp_name, uint_max, test_var);
44679 0 : return -1;
44680 : }
44681 0 : *object->in.count = test_var;
44682 : } else {
44683 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44684 : PyLong_Type.tp_name);
44685 0 : return -1;
44686 : }
44687 : }
44688 0 : return 0;
44689 : }
44690 :
44691 0 : static PyObject *py_lsa_LookupNames3_out_get_count(PyObject *obj, void *closure)
44692 : {
44693 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44694 0 : PyObject *py_count;
44695 0 : if (object->out.count == NULL) {
44696 0 : Py_RETURN_NONE;
44697 : }
44698 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
44699 0 : return py_count;
44700 : }
44701 :
44702 0 : static int py_lsa_LookupNames3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
44703 : {
44704 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44705 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
44706 0 : if (value == NULL) {
44707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
44708 0 : return -1;
44709 : }
44710 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
44711 0 : if (object->out.count == NULL) {
44712 0 : PyErr_NoMemory();
44713 0 : return -1;
44714 : }
44715 : {
44716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
44717 0 : if (PyLong_Check(value)) {
44718 0 : unsigned long long test_var;
44719 0 : test_var = PyLong_AsUnsignedLongLong(value);
44720 0 : if (PyErr_Occurred() != NULL) {
44721 0 : return -1;
44722 : }
44723 0 : if (test_var > uint_max) {
44724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44725 : PyLong_Type.tp_name, uint_max, test_var);
44726 0 : return -1;
44727 : }
44728 0 : *object->out.count = test_var;
44729 : } else {
44730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44731 : PyLong_Type.tp_name);
44732 0 : return -1;
44733 : }
44734 : }
44735 0 : return 0;
44736 : }
44737 :
44738 0 : static PyObject *py_lsa_LookupNames3_in_get_lookup_options(PyObject *obj, void *closure)
44739 : {
44740 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44741 0 : PyObject *py_lookup_options;
44742 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.lookup_options));
44743 0 : return py_lookup_options;
44744 : }
44745 :
44746 0 : static int py_lsa_LookupNames3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
44747 : {
44748 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44749 0 : if (value == NULL) {
44750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lookup_options");
44751 0 : return -1;
44752 : }
44753 : {
44754 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
44755 0 : if (PyLong_Check(value)) {
44756 0 : unsigned long long test_var;
44757 0 : test_var = PyLong_AsUnsignedLongLong(value);
44758 0 : if (PyErr_Occurred() != NULL) {
44759 0 : return -1;
44760 : }
44761 0 : if (test_var > uint_max) {
44762 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44763 : PyLong_Type.tp_name, uint_max, test_var);
44764 0 : return -1;
44765 : }
44766 0 : object->in.lookup_options = test_var;
44767 : } else {
44768 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44769 : PyLong_Type.tp_name);
44770 0 : return -1;
44771 : }
44772 : }
44773 0 : return 0;
44774 : }
44775 :
44776 0 : static PyObject *py_lsa_LookupNames3_in_get_client_revision(PyObject *obj, void *closure)
44777 : {
44778 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44779 0 : PyObject *py_client_revision;
44780 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_revision));
44781 0 : return py_client_revision;
44782 : }
44783 :
44784 0 : static int py_lsa_LookupNames3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
44785 : {
44786 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44787 0 : if (value == NULL) {
44788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_revision");
44789 0 : return -1;
44790 : }
44791 : {
44792 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
44793 0 : if (PyLong_Check(value)) {
44794 0 : unsigned long long test_var;
44795 0 : test_var = PyLong_AsUnsignedLongLong(value);
44796 0 : if (PyErr_Occurred() != NULL) {
44797 0 : return -1;
44798 : }
44799 0 : if (test_var > uint_max) {
44800 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44801 : PyLong_Type.tp_name, uint_max, test_var);
44802 0 : return -1;
44803 : }
44804 0 : object->in.client_revision = test_var;
44805 : } else {
44806 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44807 : PyLong_Type.tp_name);
44808 0 : return -1;
44809 : }
44810 : }
44811 0 : return 0;
44812 : }
44813 :
44814 0 : static PyObject *py_lsa_LookupNames3_get_result(PyObject *obj, void *closure)
44815 : {
44816 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(obj);
44817 0 : PyObject *py_result;
44818 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44819 0 : return py_result;
44820 : }
44821 :
44822 0 : static int py_lsa_LookupNames3_set_result(PyObject *py_obj, PyObject *value, void *closure)
44823 : {
44824 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44825 0 : if (value == NULL) {
44826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
44827 0 : return -1;
44828 : }
44829 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44830 0 : return 0;
44831 : }
44832 :
44833 : static PyGetSetDef py_lsa_LookupNames3_getsetters[] = {
44834 : {
44835 : .name = discard_const_p(char, "in_handle"),
44836 : .get = py_lsa_LookupNames3_in_get_handle,
44837 : .set = py_lsa_LookupNames3_in_set_handle,
44838 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44839 : },
44840 : {
44841 : .name = discard_const_p(char, "in_num_names"),
44842 : .get = py_lsa_LookupNames3_in_get_num_names,
44843 : .set = py_lsa_LookupNames3_in_set_num_names,
44844 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44845 : },
44846 : {
44847 : .name = discard_const_p(char, "in_names"),
44848 : .get = py_lsa_LookupNames3_in_get_names,
44849 : .set = py_lsa_LookupNames3_in_set_names,
44850 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
44851 : },
44852 : {
44853 : .name = discard_const_p(char, "out_domains"),
44854 : .get = py_lsa_LookupNames3_out_get_domains,
44855 : .set = py_lsa_LookupNames3_out_set_domains,
44856 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
44857 : },
44858 : {
44859 : .name = discard_const_p(char, "in_sids"),
44860 : .get = py_lsa_LookupNames3_in_get_sids,
44861 : .set = py_lsa_LookupNames3_in_set_sids,
44862 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
44863 : },
44864 : {
44865 : .name = discard_const_p(char, "out_sids"),
44866 : .get = py_lsa_LookupNames3_out_get_sids,
44867 : .set = py_lsa_LookupNames3_out_set_sids,
44868 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
44869 : },
44870 : {
44871 : .name = discard_const_p(char, "in_level"),
44872 : .get = py_lsa_LookupNames3_in_get_level,
44873 : .set = py_lsa_LookupNames3_in_set_level,
44874 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
44875 : },
44876 : {
44877 : .name = discard_const_p(char, "in_count"),
44878 : .get = py_lsa_LookupNames3_in_get_count,
44879 : .set = py_lsa_LookupNames3_in_set_count,
44880 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44881 : },
44882 : {
44883 : .name = discard_const_p(char, "out_count"),
44884 : .get = py_lsa_LookupNames3_out_get_count,
44885 : .set = py_lsa_LookupNames3_out_set_count,
44886 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
44887 : },
44888 : {
44889 : .name = discard_const_p(char, "in_lookup_options"),
44890 : .get = py_lsa_LookupNames3_in_get_lookup_options,
44891 : .set = py_lsa_LookupNames3_in_set_lookup_options,
44892 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
44893 : },
44894 : {
44895 : .name = discard_const_p(char, "in_client_revision"),
44896 : .get = py_lsa_LookupNames3_in_get_client_revision,
44897 : .set = py_lsa_LookupNames3_in_set_client_revision,
44898 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
44899 : },
44900 : {
44901 : .name = discard_const_p(char, "result"),
44902 : .get = py_lsa_LookupNames3_get_result,
44903 : .set = py_lsa_LookupNames3_set_result,
44904 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44905 : },
44906 : { .name = NULL }
44907 : };
44908 :
44909 0 : static PyObject *py_lsa_LookupNames3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44910 : {
44911 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames3, type);
44912 0 : struct lsa_LookupNames3 *_self = (struct lsa_LookupNames3 *)pytalloc_get_ptr(self);
44913 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44914 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
44915 : /* a pointer to a NULL pointer */
44916 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
44917 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
44918 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
44919 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
44920 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
44921 0 : return self;
44922 : }
44923 :
44924 0 : static PyObject *py_lsa_LookupNames3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44925 : {
44926 :
44927 :
44928 0 : return PyLong_FromLong(68);
44929 : }
44930 :
44931 0 : static PyObject *py_lsa_LookupNames3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44932 : {
44933 0 : const struct ndr_interface_call *call = NULL;
44934 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
44935 0 : PyObject *ret = NULL;
44936 0 : struct ndr_push *push = NULL;
44937 0 : DATA_BLOB blob;
44938 0 : enum ndr_err_code err;
44939 :
44940 0 : if (ndr_table_lsarpc.num_calls < 69) {
44941 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_pack");
44942 0 : return NULL;
44943 : }
44944 0 : call = &ndr_table_lsarpc.calls[68];
44945 :
44946 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44947 0 : if (push == NULL) {
44948 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44949 0 : return NULL;
44950 : }
44951 :
44952 0 : push->flags |= ndr_push_flags;
44953 :
44954 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44955 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44956 0 : TALLOC_FREE(push);
44957 0 : PyErr_SetNdrError(err);
44958 0 : return NULL;
44959 : }
44960 0 : blob = ndr_push_blob(push);
44961 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44962 0 : TALLOC_FREE(push);
44963 0 : return ret;
44964 : }
44965 :
44966 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44967 : {
44968 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44969 0 : PyObject *bigendian_obj = NULL;
44970 0 : PyObject *ndr64_obj = NULL;
44971 0 : libndr_flags ndr_push_flags = 0;
44972 :
44973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44974 : discard_const_p(char *, kwnames),
44975 : &bigendian_obj,
44976 : &ndr64_obj)) {
44977 0 : return NULL;
44978 : }
44979 :
44980 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44981 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44982 : }
44983 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44984 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44985 : }
44986 :
44987 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44988 : }
44989 :
44990 0 : static PyObject *py_lsa_LookupNames3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44991 : {
44992 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44993 0 : PyObject *bigendian_obj = NULL;
44994 0 : PyObject *ndr64_obj = NULL;
44995 0 : libndr_flags ndr_push_flags = 0;
44996 :
44997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44998 : discard_const_p(char *, kwnames),
44999 : &bigendian_obj,
45000 : &ndr64_obj)) {
45001 0 : return NULL;
45002 : }
45003 :
45004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45005 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45006 : }
45007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45008 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45009 : }
45010 :
45011 0 : return py_lsa_LookupNames3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45012 : }
45013 :
45014 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)
45015 : {
45016 0 : const struct ndr_interface_call *call = NULL;
45017 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
45018 0 : struct ndr_pull *pull = NULL;
45019 0 : enum ndr_err_code err;
45020 :
45021 0 : if (ndr_table_lsarpc.num_calls < 69) {
45022 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_unpack");
45023 0 : return NULL;
45024 : }
45025 0 : call = &ndr_table_lsarpc.calls[68];
45026 :
45027 0 : pull = ndr_pull_init_blob(blob, object);
45028 0 : if (pull == NULL) {
45029 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45030 0 : return NULL;
45031 : }
45032 :
45033 0 : pull->flags |= ndr_pull_flags;
45034 :
45035 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45037 0 : TALLOC_FREE(pull);
45038 0 : PyErr_SetNdrError(err);
45039 0 : return NULL;
45040 : }
45041 0 : if (!allow_remaining) {
45042 0 : uint32_t highest_ofs;
45043 :
45044 0 : if (pull->offset > pull->relative_highest_offset) {
45045 0 : highest_ofs = pull->offset;
45046 : } else {
45047 0 : highest_ofs = pull->relative_highest_offset;
45048 : }
45049 0 : if (highest_ofs < pull->data_size) {
45050 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45051 : "not all bytes consumed ofs[%u] size[%u]",
45052 : highest_ofs, pull->data_size);
45053 0 : TALLOC_FREE(pull);
45054 0 : PyErr_SetNdrError(err);
45055 0 : return NULL;
45056 : }
45057 : }
45058 :
45059 0 : TALLOC_FREE(pull);
45060 0 : Py_RETURN_NONE;
45061 : }
45062 :
45063 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45064 : {
45065 0 : DATA_BLOB blob;
45066 0 : Py_ssize_t blob_length = 0;
45067 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45068 0 : PyObject *bigendian_obj = NULL;
45069 0 : PyObject *ndr64_obj = NULL;
45070 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45071 0 : PyObject *allow_remaining_obj = NULL;
45072 0 : bool allow_remaining = false;
45073 :
45074 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45075 : discard_const_p(char *, kwnames),
45076 : &blob.data, &blob_length,
45077 : &bigendian_obj,
45078 : &ndr64_obj,
45079 : &allow_remaining_obj)) {
45080 0 : return NULL;
45081 : }
45082 0 : blob.length = blob_length;
45083 :
45084 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45085 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45086 : }
45087 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45088 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45089 : }
45090 :
45091 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45092 0 : allow_remaining = true;
45093 : }
45094 :
45095 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45096 : }
45097 :
45098 0 : static PyObject *py_lsa_LookupNames3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45099 : {
45100 0 : DATA_BLOB blob;
45101 0 : Py_ssize_t blob_length = 0;
45102 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45103 0 : PyObject *bigendian_obj = NULL;
45104 0 : PyObject *ndr64_obj = NULL;
45105 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45106 0 : PyObject *allow_remaining_obj = NULL;
45107 0 : bool allow_remaining = false;
45108 :
45109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45110 : discard_const_p(char *, kwnames),
45111 : &blob.data, &blob_length,
45112 : &bigendian_obj,
45113 : &ndr64_obj,
45114 : &allow_remaining_obj)) {
45115 0 : return NULL;
45116 : }
45117 0 : blob.length = blob_length;
45118 :
45119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45120 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45121 : }
45122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45123 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45124 : }
45125 :
45126 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45127 0 : allow_remaining = true;
45128 : }
45129 :
45130 0 : return py_lsa_LookupNames3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45131 : }
45132 :
45133 0 : static PyObject *py_lsa_LookupNames3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45134 : {
45135 0 : const struct ndr_interface_call *call = NULL;
45136 0 : struct lsa_LookupNames3 *object = pytalloc_get_ptr(py_obj);
45137 0 : PyObject *ret;
45138 0 : char *retstr;
45139 :
45140 0 : if (ndr_table_lsarpc.num_calls < 69) {
45141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames3_ndr_print");
45142 0 : return NULL;
45143 : }
45144 0 : call = &ndr_table_lsarpc.calls[68];
45145 :
45146 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45147 0 : ret = PyUnicode_FromString(retstr);
45148 0 : TALLOC_FREE(retstr);
45149 :
45150 0 : return ret;
45151 : }
45152 :
45153 0 : static PyObject *py_lsa_LookupNames3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45154 : {
45155 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_in", NDR_IN);
45156 : }
45157 :
45158 0 : static PyObject *py_lsa_LookupNames3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45159 : {
45160 0 : return py_lsa_LookupNames3_ndr_print(py_obj, "lsa_LookupNames3_out", NDR_OUT);
45161 : }
45162 :
45163 : static PyMethodDef py_lsa_LookupNames3_methods[] = {
45164 : { "opnum", (PyCFunction)py_lsa_LookupNames3_ndr_opnum, METH_NOARGS|METH_CLASS,
45165 : "lsa.LookupNames3.opnum() -> 68 (0x44) " },
45166 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45167 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45168 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45169 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45170 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45171 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45172 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45173 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45174 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45175 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45176 : { NULL, NULL, 0, NULL }
45177 : };
45178 :
45179 :
45180 : static PyTypeObject lsa_LookupNames3_Type = {
45181 : PyVarObject_HEAD_INIT(NULL, 0)
45182 : .tp_name = "lsa.LookupNames3",
45183 : .tp_getset = py_lsa_LookupNames3_getsetters,
45184 : .tp_methods = py_lsa_LookupNames3_methods,
45185 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45186 : .tp_new = py_lsa_LookupNames3_new,
45187 : };
45188 :
45189 0 : static bool pack_py_lsa_LookupNames3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames3 *r)
45190 : {
45191 0 : PyObject *py_handle;
45192 0 : PyObject *py_names;
45193 0 : PyObject *py_sids;
45194 0 : PyObject *py_level;
45195 0 : PyObject *py_count;
45196 0 : PyObject *py_lookup_options;
45197 0 : PyObject *py_client_revision;
45198 0 : const char *kwnames[] = {
45199 : "handle", "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
45200 : };
45201 :
45202 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)) {
45203 0 : return false;
45204 : }
45205 :
45206 0 : if (py_handle == NULL) {
45207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
45208 0 : return false;
45209 : }
45210 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
45211 0 : if (r->in.handle == NULL) {
45212 0 : PyErr_NoMemory();
45213 0 : return false;
45214 : }
45215 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
45216 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
45217 0 : PyErr_NoMemory();
45218 0 : return false;
45219 : }
45220 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
45221 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
45222 0 : r->in.num_names = PyList_GET_SIZE(py_names);
45223 0 : if (py_names == NULL) {
45224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
45225 0 : return false;
45226 : }
45227 0 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
45228 : {
45229 0 : int names_cntr_0;
45230 0 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
45231 0 : if (!r->in.names) { return false; }
45232 0 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
45233 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
45234 0 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
45235 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.names)[names_cntr_0]");
45236 0 : return false;
45237 : }
45238 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
45239 0 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
45240 0 : PyErr_NoMemory();
45241 0 : return false;
45242 : }
45243 0 : (r->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
45244 : }
45245 : }
45246 0 : if (py_sids == NULL) {
45247 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
45248 0 : return false;
45249 : }
45250 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
45251 0 : if (r->in.sids == NULL) {
45252 0 : PyErr_NoMemory();
45253 0 : return false;
45254 : }
45255 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
45256 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
45257 0 : PyErr_NoMemory();
45258 0 : return false;
45259 : }
45260 0 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
45261 0 : if (py_level == NULL) {
45262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
45263 0 : return false;
45264 : }
45265 : {
45266 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
45267 0 : if (PyLong_Check(py_level)) {
45268 0 : unsigned long long test_var;
45269 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
45270 0 : if (PyErr_Occurred() != NULL) {
45271 0 : return false;
45272 : }
45273 0 : if (test_var > uint_max) {
45274 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45275 : PyLong_Type.tp_name, uint_max, test_var);
45276 0 : return false;
45277 : }
45278 0 : r->in.level = test_var;
45279 : } else {
45280 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45281 : PyLong_Type.tp_name);
45282 0 : return false;
45283 : }
45284 : }
45285 0 : if (py_count == NULL) {
45286 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
45287 0 : return false;
45288 : }
45289 0 : r->in.count = talloc_ptrtype(r, r->in.count);
45290 0 : if (r->in.count == NULL) {
45291 0 : PyErr_NoMemory();
45292 0 : return false;
45293 : }
45294 : {
45295 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
45296 0 : if (PyLong_Check(py_count)) {
45297 0 : unsigned long long test_var;
45298 0 : test_var = PyLong_AsUnsignedLongLong(py_count);
45299 0 : if (PyErr_Occurred() != NULL) {
45300 0 : return false;
45301 : }
45302 0 : if (test_var > uint_max) {
45303 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45304 : PyLong_Type.tp_name, uint_max, test_var);
45305 0 : return false;
45306 : }
45307 0 : *r->in.count = test_var;
45308 : } else {
45309 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45310 : PyLong_Type.tp_name);
45311 0 : return false;
45312 : }
45313 : }
45314 0 : if (py_lookup_options == NULL) {
45315 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lookup_options");
45316 0 : return false;
45317 : }
45318 : {
45319 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
45320 0 : if (PyLong_Check(py_lookup_options)) {
45321 0 : unsigned long long test_var;
45322 0 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
45323 0 : if (PyErr_Occurred() != NULL) {
45324 0 : return false;
45325 : }
45326 0 : if (test_var > uint_max) {
45327 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45328 : PyLong_Type.tp_name, uint_max, test_var);
45329 0 : return false;
45330 : }
45331 0 : r->in.lookup_options = test_var;
45332 : } else {
45333 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45334 : PyLong_Type.tp_name);
45335 0 : return false;
45336 : }
45337 : }
45338 0 : if (py_client_revision == NULL) {
45339 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_revision");
45340 0 : return false;
45341 : }
45342 : {
45343 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
45344 0 : if (PyLong_Check(py_client_revision)) {
45345 0 : unsigned long long test_var;
45346 0 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
45347 0 : if (PyErr_Occurred() != NULL) {
45348 0 : return false;
45349 : }
45350 0 : if (test_var > uint_max) {
45351 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45352 : PyLong_Type.tp_name, uint_max, test_var);
45353 0 : return false;
45354 : }
45355 0 : r->in.client_revision = test_var;
45356 : } else {
45357 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45358 : PyLong_Type.tp_name);
45359 0 : return false;
45360 : }
45361 : }
45362 0 : return true;
45363 : }
45364 :
45365 0 : static PyObject *unpack_py_lsa_LookupNames3_args_out(struct lsa_LookupNames3 *r)
45366 : {
45367 0 : PyObject *result;
45368 0 : PyObject *py_domains;
45369 0 : PyObject *py_sids;
45370 0 : PyObject *py_count;
45371 0 : result = PyTuple_New(3);
45372 0 : if (*r->out.domains == NULL) {
45373 0 : py_domains = Py_None;
45374 0 : Py_INCREF(py_domains);
45375 : } else {
45376 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
45377 : }
45378 0 : PyTuple_SetItem(result, 0, py_domains);
45379 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
45380 0 : PyTuple_SetItem(result, 1, py_sids);
45381 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
45382 0 : PyTuple_SetItem(result, 2, py_count);
45383 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
45384 0 : PyErr_SetNTSTATUS(r->out.result);
45385 0 : return NULL;
45386 : }
45387 :
45388 0 : return result;
45389 : }
45390 :
45391 :
45392 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
45393 : {
45394 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(obj);
45395 0 : PyObject *py_handle;
45396 0 : if (object->in.handle == NULL) {
45397 0 : Py_RETURN_NONE;
45398 : }
45399 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
45400 0 : return py_handle;
45401 : }
45402 :
45403 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
45404 : {
45405 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45406 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
45407 0 : if (value == NULL) {
45408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
45409 0 : return -1;
45410 : }
45411 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
45412 0 : if (object->in.handle == NULL) {
45413 0 : PyErr_NoMemory();
45414 0 : return -1;
45415 : }
45416 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45417 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45418 0 : PyErr_NoMemory();
45419 0 : return -1;
45420 : }
45421 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
45422 0 : return 0;
45423 : }
45424 :
45425 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
45426 : {
45427 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(obj);
45428 0 : PyObject *py_trusted_domain_name;
45429 0 : if (object->in.trusted_domain_name == NULL) {
45430 0 : Py_RETURN_NONE;
45431 : }
45432 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
45433 0 : return py_trusted_domain_name;
45434 : }
45435 :
45436 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
45437 : {
45438 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45439 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
45440 0 : if (value == NULL) {
45441 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain_name");
45442 0 : return -1;
45443 : }
45444 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
45445 0 : if (object->in.trusted_domain_name == NULL) {
45446 0 : PyErr_NoMemory();
45447 0 : return -1;
45448 : }
45449 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
45450 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45451 0 : PyErr_NoMemory();
45452 0 : return -1;
45453 : }
45454 0 : object->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
45455 0 : return 0;
45456 : }
45457 :
45458 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
45459 : {
45460 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(obj);
45461 0 : PyObject *py_highest_record_type;
45462 0 : py_highest_record_type = PyLong_FromLong((uint16_t)(object->in.highest_record_type));
45463 0 : return py_highest_record_type;
45464 : }
45465 :
45466 0 : static int py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
45467 : {
45468 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45469 0 : if (value == NULL) {
45470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.highest_record_type");
45471 0 : return -1;
45472 : }
45473 : {
45474 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
45475 0 : if (PyLong_Check(value)) {
45476 0 : unsigned long long test_var;
45477 0 : test_var = PyLong_AsUnsignedLongLong(value);
45478 0 : if (PyErr_Occurred() != NULL) {
45479 0 : return -1;
45480 : }
45481 0 : if (test_var > uint_max) {
45482 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45483 : PyLong_Type.tp_name, uint_max, test_var);
45484 0 : return -1;
45485 : }
45486 0 : object->in.highest_record_type = test_var;
45487 : } else {
45488 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45489 : PyLong_Type.tp_name);
45490 0 : return -1;
45491 : }
45492 : }
45493 0 : return 0;
45494 : }
45495 :
45496 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info(PyObject *obj, void *closure)
45497 : {
45498 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(obj);
45499 0 : PyObject *py_forest_trust_info;
45500 0 : if (object->out.forest_trust_info == NULL) {
45501 0 : Py_RETURN_NONE;
45502 : }
45503 0 : if (*object->out.forest_trust_info == NULL) {
45504 0 : py_forest_trust_info = Py_None;
45505 0 : Py_INCREF(py_forest_trust_info);
45506 : } else {
45507 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
45508 : }
45509 0 : return py_forest_trust_info;
45510 : }
45511 :
45512 0 : static int py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
45513 : {
45514 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45515 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
45516 0 : if (value == NULL) {
45517 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.forest_trust_info");
45518 0 : return -1;
45519 : }
45520 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
45521 0 : if (object->out.forest_trust_info == NULL) {
45522 0 : PyErr_NoMemory();
45523 0 : return -1;
45524 : }
45525 0 : if (value == Py_None) {
45526 0 : *object->out.forest_trust_info = NULL;
45527 : } else {
45528 0 : *object->out.forest_trust_info = NULL;
45529 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
45530 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45531 0 : PyErr_NoMemory();
45532 0 : return -1;
45533 : }
45534 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
45535 : }
45536 0 : return 0;
45537 : }
45538 :
45539 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_get_result(PyObject *obj, void *closure)
45540 : {
45541 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(obj);
45542 0 : PyObject *py_result;
45543 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45544 0 : return py_result;
45545 : }
45546 :
45547 0 : static int py_lsa_lsaRQueryForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
45548 : {
45549 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45550 0 : if (value == NULL) {
45551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
45552 0 : return -1;
45553 : }
45554 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45555 0 : return 0;
45556 : }
45557 :
45558 : static PyGetSetDef py_lsa_lsaRQueryForestTrustInformation_getsetters[] = {
45559 : {
45560 : .name = discard_const_p(char, "in_handle"),
45561 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_handle,
45562 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_handle,
45563 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
45564 : },
45565 : {
45566 : .name = discard_const_p(char, "in_trusted_domain_name"),
45567 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_trusted_domain_name,
45568 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_trusted_domain_name,
45569 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
45570 : },
45571 : {
45572 : .name = discard_const_p(char, "in_highest_record_type"),
45573 : .get = py_lsa_lsaRQueryForestTrustInformation_in_get_highest_record_type,
45574 : .set = py_lsa_lsaRQueryForestTrustInformation_in_set_highest_record_type,
45575 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
45576 : },
45577 : {
45578 : .name = discard_const_p(char, "out_forest_trust_info"),
45579 : .get = py_lsa_lsaRQueryForestTrustInformation_out_get_forest_trust_info,
45580 : .set = py_lsa_lsaRQueryForestTrustInformation_out_set_forest_trust_info,
45581 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
45582 : },
45583 : {
45584 : .name = discard_const_p(char, "result"),
45585 : .get = py_lsa_lsaRQueryForestTrustInformation_get_result,
45586 : .set = py_lsa_lsaRQueryForestTrustInformation_set_result,
45587 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
45588 : },
45589 : { .name = NULL }
45590 : };
45591 :
45592 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45593 : {
45594 0 : PyObject *self = pytalloc_new(struct lsa_lsaRQueryForestTrustInformation, type);
45595 0 : struct lsa_lsaRQueryForestTrustInformation *_self = (struct lsa_lsaRQueryForestTrustInformation *)pytalloc_get_ptr(self);
45596 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45597 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
45598 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_String);
45599 : /* a pointer to a NULL pointer */
45600 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
45601 0 : return self;
45602 : }
45603 :
45604 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45605 : {
45606 :
45607 :
45608 0 : return PyLong_FromLong(73);
45609 : }
45610 :
45611 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
45612 : {
45613 0 : const struct ndr_interface_call *call = NULL;
45614 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45615 0 : PyObject *ret = NULL;
45616 0 : struct ndr_push *push = NULL;
45617 0 : DATA_BLOB blob;
45618 0 : enum ndr_err_code err;
45619 :
45620 0 : if (ndr_table_lsarpc.num_calls < 74) {
45621 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_pack");
45622 0 : return NULL;
45623 : }
45624 0 : call = &ndr_table_lsarpc.calls[73];
45625 :
45626 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45627 0 : if (push == NULL) {
45628 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45629 0 : return NULL;
45630 : }
45631 :
45632 0 : push->flags |= ndr_push_flags;
45633 :
45634 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45635 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45636 0 : TALLOC_FREE(push);
45637 0 : PyErr_SetNdrError(err);
45638 0 : return NULL;
45639 : }
45640 0 : blob = ndr_push_blob(push);
45641 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45642 0 : TALLOC_FREE(push);
45643 0 : return ret;
45644 : }
45645 :
45646 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45647 : {
45648 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45649 0 : PyObject *bigendian_obj = NULL;
45650 0 : PyObject *ndr64_obj = NULL;
45651 0 : libndr_flags ndr_push_flags = 0;
45652 :
45653 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45654 : discard_const_p(char *, kwnames),
45655 : &bigendian_obj,
45656 : &ndr64_obj)) {
45657 0 : return NULL;
45658 : }
45659 :
45660 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45661 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45662 : }
45663 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45664 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45665 : }
45666 :
45667 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45668 : }
45669 :
45670 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45671 : {
45672 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45673 0 : PyObject *bigendian_obj = NULL;
45674 0 : PyObject *ndr64_obj = NULL;
45675 0 : libndr_flags ndr_push_flags = 0;
45676 :
45677 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45678 : discard_const_p(char *, kwnames),
45679 : &bigendian_obj,
45680 : &ndr64_obj)) {
45681 0 : return NULL;
45682 : }
45683 :
45684 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45685 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45686 : }
45687 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45688 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45689 : }
45690 :
45691 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45692 : }
45693 :
45694 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)
45695 : {
45696 0 : const struct ndr_interface_call *call = NULL;
45697 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45698 0 : struct ndr_pull *pull = NULL;
45699 0 : enum ndr_err_code err;
45700 :
45701 0 : if (ndr_table_lsarpc.num_calls < 74) {
45702 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_unpack");
45703 0 : return NULL;
45704 : }
45705 0 : call = &ndr_table_lsarpc.calls[73];
45706 :
45707 0 : pull = ndr_pull_init_blob(blob, object);
45708 0 : if (pull == NULL) {
45709 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45710 0 : return NULL;
45711 : }
45712 :
45713 0 : pull->flags |= ndr_pull_flags;
45714 :
45715 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45716 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45717 0 : TALLOC_FREE(pull);
45718 0 : PyErr_SetNdrError(err);
45719 0 : return NULL;
45720 : }
45721 0 : if (!allow_remaining) {
45722 0 : uint32_t highest_ofs;
45723 :
45724 0 : if (pull->offset > pull->relative_highest_offset) {
45725 0 : highest_ofs = pull->offset;
45726 : } else {
45727 0 : highest_ofs = pull->relative_highest_offset;
45728 : }
45729 0 : if (highest_ofs < pull->data_size) {
45730 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45731 : "not all bytes consumed ofs[%u] size[%u]",
45732 : highest_ofs, pull->data_size);
45733 0 : TALLOC_FREE(pull);
45734 0 : PyErr_SetNdrError(err);
45735 0 : return NULL;
45736 : }
45737 : }
45738 :
45739 0 : TALLOC_FREE(pull);
45740 0 : Py_RETURN_NONE;
45741 : }
45742 :
45743 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45744 : {
45745 0 : DATA_BLOB blob;
45746 0 : Py_ssize_t blob_length = 0;
45747 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45748 0 : PyObject *bigendian_obj = NULL;
45749 0 : PyObject *ndr64_obj = NULL;
45750 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45751 0 : PyObject *allow_remaining_obj = NULL;
45752 0 : bool allow_remaining = false;
45753 :
45754 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45755 : discard_const_p(char *, kwnames),
45756 : &blob.data, &blob_length,
45757 : &bigendian_obj,
45758 : &ndr64_obj,
45759 : &allow_remaining_obj)) {
45760 0 : return NULL;
45761 : }
45762 0 : blob.length = blob_length;
45763 :
45764 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45765 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45766 : }
45767 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45768 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45769 : }
45770 :
45771 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45772 0 : allow_remaining = true;
45773 : }
45774 :
45775 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45776 : }
45777 :
45778 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45779 : {
45780 0 : DATA_BLOB blob;
45781 0 : Py_ssize_t blob_length = 0;
45782 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45783 0 : PyObject *bigendian_obj = NULL;
45784 0 : PyObject *ndr64_obj = NULL;
45785 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45786 0 : PyObject *allow_remaining_obj = NULL;
45787 0 : bool allow_remaining = false;
45788 :
45789 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45790 : discard_const_p(char *, kwnames),
45791 : &blob.data, &blob_length,
45792 : &bigendian_obj,
45793 : &ndr64_obj,
45794 : &allow_remaining_obj)) {
45795 0 : return NULL;
45796 : }
45797 0 : blob.length = blob_length;
45798 :
45799 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45800 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45801 : }
45802 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45803 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45804 : }
45805 :
45806 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45807 0 : allow_remaining = true;
45808 : }
45809 :
45810 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45811 : }
45812 :
45813 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45814 : {
45815 0 : const struct ndr_interface_call *call = NULL;
45816 0 : struct lsa_lsaRQueryForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45817 0 : PyObject *ret;
45818 0 : char *retstr;
45819 :
45820 0 : if (ndr_table_lsarpc.num_calls < 74) {
45821 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation_ndr_print");
45822 0 : return NULL;
45823 : }
45824 0 : call = &ndr_table_lsarpc.calls[73];
45825 :
45826 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45827 0 : ret = PyUnicode_FromString(retstr);
45828 0 : TALLOC_FREE(retstr);
45829 :
45830 0 : return ret;
45831 : }
45832 :
45833 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45834 : {
45835 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_in", NDR_IN);
45836 : }
45837 :
45838 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45839 : {
45840 0 : return py_lsa_lsaRQueryForestTrustInformation_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation_out", NDR_OUT);
45841 : }
45842 :
45843 : static PyMethodDef py_lsa_lsaRQueryForestTrustInformation_methods[] = {
45844 : { "opnum", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
45845 : "lsa.lsaRQueryForestTrustInformation.opnum() -> 73 (0x49) " },
45846 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45847 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45848 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45849 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45850 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45851 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45852 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45853 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45854 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45855 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45856 : { NULL, NULL, 0, NULL }
45857 : };
45858 :
45859 :
45860 : static PyTypeObject lsa_lsaRQueryForestTrustInformation_Type = {
45861 : PyVarObject_HEAD_INIT(NULL, 0)
45862 : .tp_name = "lsa.lsaRQueryForestTrustInformation",
45863 : .tp_getset = py_lsa_lsaRQueryForestTrustInformation_getsetters,
45864 : .tp_methods = py_lsa_lsaRQueryForestTrustInformation_methods,
45865 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45866 : .tp_new = py_lsa_lsaRQueryForestTrustInformation_new,
45867 : };
45868 :
45869 124 : static bool pack_py_lsa_lsaRQueryForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation *r)
45870 : {
45871 0 : PyObject *py_handle;
45872 0 : PyObject *py_trusted_domain_name;
45873 0 : PyObject *py_highest_record_type;
45874 124 : const char *kwnames[] = {
45875 : "handle", "trusted_domain_name", "highest_record_type", NULL
45876 : };
45877 :
45878 124 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
45879 0 : return false;
45880 : }
45881 :
45882 124 : if (py_handle == NULL) {
45883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
45884 0 : return false;
45885 : }
45886 124 : r->in.handle = talloc_ptrtype(r, r->in.handle);
45887 124 : if (r->in.handle == NULL) {
45888 0 : PyErr_NoMemory();
45889 0 : return false;
45890 : }
45891 124 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
45892 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
45893 0 : PyErr_NoMemory();
45894 0 : return false;
45895 : }
45896 124 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
45897 124 : if (py_trusted_domain_name == NULL) {
45898 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain_name");
45899 0 : return false;
45900 : }
45901 124 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
45902 124 : if (r->in.trusted_domain_name == NULL) {
45903 0 : PyErr_NoMemory();
45904 0 : return false;
45905 : }
45906 124 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain_name, return false;);
45907 124 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
45908 0 : PyErr_NoMemory();
45909 0 : return false;
45910 : }
45911 124 : r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
45912 124 : if (py_highest_record_type == NULL) {
45913 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.highest_record_type");
45914 0 : return false;
45915 : }
45916 : {
45917 124 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
45918 124 : if (PyLong_Check(py_highest_record_type)) {
45919 0 : unsigned long long test_var;
45920 124 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
45921 124 : if (PyErr_Occurred() != NULL) {
45922 0 : return false;
45923 : }
45924 124 : if (test_var > uint_max) {
45925 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45926 : PyLong_Type.tp_name, uint_max, test_var);
45927 0 : return false;
45928 : }
45929 124 : r->in.highest_record_type = test_var;
45930 : } else {
45931 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45932 : PyLong_Type.tp_name);
45933 0 : return false;
45934 : }
45935 : }
45936 124 : return true;
45937 : }
45938 :
45939 124 : static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation_args_out(struct lsa_lsaRQueryForestTrustInformation *r)
45940 : {
45941 0 : PyObject *result;
45942 0 : PyObject *py_forest_trust_info;
45943 124 : if (*r->out.forest_trust_info == NULL) {
45944 0 : py_forest_trust_info = Py_None;
45945 0 : Py_INCREF(py_forest_trust_info);
45946 : } else {
45947 124 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
45948 : }
45949 124 : result = py_forest_trust_info;
45950 124 : if (NT_STATUS_IS_ERR(r->out.result)) {
45951 0 : PyErr_SetNTSTATUS(r->out.result);
45952 0 : return NULL;
45953 : }
45954 :
45955 124 : return result;
45956 : }
45957 :
45958 :
45959 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_handle(PyObject *obj, void *closure)
45960 : {
45961 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
45962 0 : PyObject *py_handle;
45963 0 : if (object->in.handle == NULL) {
45964 0 : Py_RETURN_NONE;
45965 : }
45966 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
45967 0 : return py_handle;
45968 : }
45969 :
45970 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
45971 : {
45972 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
45973 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
45974 0 : if (value == NULL) {
45975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
45976 0 : return -1;
45977 : }
45978 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
45979 0 : if (object->in.handle == NULL) {
45980 0 : PyErr_NoMemory();
45981 0 : return -1;
45982 : }
45983 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45984 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45985 0 : PyErr_NoMemory();
45986 0 : return -1;
45987 : }
45988 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
45989 0 : return 0;
45990 : }
45991 :
45992 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name(PyObject *obj, void *closure)
45993 : {
45994 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
45995 0 : PyObject *py_trusted_domain_name;
45996 0 : if (object->in.trusted_domain_name == NULL) {
45997 0 : Py_RETURN_NONE;
45998 : }
45999 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
46000 0 : return py_trusted_domain_name;
46001 : }
46002 :
46003 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
46004 : {
46005 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46006 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
46007 0 : if (value == NULL) {
46008 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain_name");
46009 0 : return -1;
46010 : }
46011 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
46012 0 : if (object->in.trusted_domain_name == NULL) {
46013 0 : PyErr_NoMemory();
46014 0 : return -1;
46015 : }
46016 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
46017 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46018 0 : PyErr_NoMemory();
46019 0 : return -1;
46020 : }
46021 0 : object->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
46022 0 : return 0;
46023 : }
46024 :
46025 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type(PyObject *obj, void *closure)
46026 : {
46027 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
46028 0 : PyObject *py_highest_record_type;
46029 0 : py_highest_record_type = PyLong_FromLong((uint16_t)(object->in.highest_record_type));
46030 0 : return py_highest_record_type;
46031 : }
46032 :
46033 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
46034 : {
46035 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46036 0 : if (value == NULL) {
46037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.highest_record_type");
46038 0 : return -1;
46039 : }
46040 : {
46041 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
46042 0 : if (PyLong_Check(value)) {
46043 0 : unsigned long long test_var;
46044 0 : test_var = PyLong_AsUnsignedLongLong(value);
46045 0 : if (PyErr_Occurred() != NULL) {
46046 0 : return -1;
46047 : }
46048 0 : if (test_var > uint_max) {
46049 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46050 : PyLong_Type.tp_name, uint_max, test_var);
46051 0 : return -1;
46052 : }
46053 0 : object->in.highest_record_type = test_var;
46054 : } else {
46055 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46056 : PyLong_Type.tp_name);
46057 0 : return -1;
46058 : }
46059 : }
46060 0 : return 0;
46061 : }
46062 :
46063 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info(PyObject *obj, void *closure)
46064 : {
46065 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
46066 0 : PyObject *py_forest_trust_info;
46067 0 : if (object->in.forest_trust_info == NULL) {
46068 0 : Py_RETURN_NONE;
46069 : }
46070 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation_Type, object->in.forest_trust_info, object->in.forest_trust_info);
46071 0 : return py_forest_trust_info;
46072 : }
46073 :
46074 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
46075 : {
46076 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46077 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.forest_trust_info));
46078 0 : if (value == NULL) {
46079 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.forest_trust_info");
46080 0 : return -1;
46081 : }
46082 0 : object->in.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.forest_trust_info);
46083 0 : if (object->in.forest_trust_info == NULL) {
46084 0 : PyErr_NoMemory();
46085 0 : return -1;
46086 : }
46087 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, value, return -1;);
46088 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46089 0 : PyErr_NoMemory();
46090 0 : return -1;
46091 : }
46092 0 : object->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(value);
46093 0 : return 0;
46094 : }
46095 :
46096 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_in_get_check_only(PyObject *obj, void *closure)
46097 : {
46098 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
46099 0 : PyObject *py_check_only;
46100 0 : py_check_only = PyLong_FromLong((uint16_t)(object->in.check_only));
46101 0 : return py_check_only;
46102 : }
46103 :
46104 0 : static int py_lsa_lsaRSetForestTrustInformation_in_set_check_only(PyObject *py_obj, PyObject *value, void *closure)
46105 : {
46106 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46107 0 : if (value == NULL) {
46108 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.check_only");
46109 0 : return -1;
46110 : }
46111 : {
46112 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.check_only));
46113 0 : if (PyLong_Check(value)) {
46114 0 : unsigned long long test_var;
46115 0 : test_var = PyLong_AsUnsignedLongLong(value);
46116 0 : if (PyErr_Occurred() != NULL) {
46117 0 : return -1;
46118 : }
46119 0 : if (test_var > uint_max) {
46120 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46121 : PyLong_Type.tp_name, uint_max, test_var);
46122 0 : return -1;
46123 : }
46124 0 : object->in.check_only = test_var;
46125 : } else {
46126 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46127 : PyLong_Type.tp_name);
46128 0 : return -1;
46129 : }
46130 : }
46131 0 : return 0;
46132 : }
46133 :
46134 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_out_get_collision_info(PyObject *obj, void *closure)
46135 : {
46136 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
46137 0 : PyObject *py_collision_info;
46138 0 : if (object->out.collision_info == NULL) {
46139 0 : Py_RETURN_NONE;
46140 : }
46141 0 : if (*object->out.collision_info == NULL) {
46142 0 : py_collision_info = Py_None;
46143 0 : Py_INCREF(py_collision_info);
46144 : } else {
46145 0 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *object->out.collision_info, *object->out.collision_info);
46146 : }
46147 0 : return py_collision_info;
46148 : }
46149 :
46150 0 : static int py_lsa_lsaRSetForestTrustInformation_out_set_collision_info(PyObject *py_obj, PyObject *value, void *closure)
46151 : {
46152 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46153 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.collision_info));
46154 0 : if (value == NULL) {
46155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.collision_info");
46156 0 : return -1;
46157 : }
46158 0 : object->out.collision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.collision_info);
46159 0 : if (object->out.collision_info == NULL) {
46160 0 : PyErr_NoMemory();
46161 0 : return -1;
46162 : }
46163 0 : if (value == Py_None) {
46164 0 : *object->out.collision_info = NULL;
46165 : } else {
46166 0 : *object->out.collision_info = NULL;
46167 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionInfo_Type, value, return -1;);
46168 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46169 0 : PyErr_NoMemory();
46170 0 : return -1;
46171 : }
46172 0 : *object->out.collision_info = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(value);
46173 : }
46174 0 : return 0;
46175 : }
46176 :
46177 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_get_result(PyObject *obj, void *closure)
46178 : {
46179 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(obj);
46180 0 : PyObject *py_result;
46181 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
46182 0 : return py_result;
46183 : }
46184 :
46185 0 : static int py_lsa_lsaRSetForestTrustInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
46186 : {
46187 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46188 0 : if (value == NULL) {
46189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
46190 0 : return -1;
46191 : }
46192 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
46193 0 : return 0;
46194 : }
46195 :
46196 : static PyGetSetDef py_lsa_lsaRSetForestTrustInformation_getsetters[] = {
46197 : {
46198 : .name = discard_const_p(char, "in_handle"),
46199 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_handle,
46200 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_handle,
46201 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
46202 : },
46203 : {
46204 : .name = discard_const_p(char, "in_trusted_domain_name"),
46205 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_trusted_domain_name,
46206 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_trusted_domain_name,
46207 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
46208 : },
46209 : {
46210 : .name = discard_const_p(char, "in_highest_record_type"),
46211 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_highest_record_type,
46212 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_highest_record_type,
46213 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
46214 : },
46215 : {
46216 : .name = discard_const_p(char, "in_forest_trust_info"),
46217 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_forest_trust_info,
46218 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_forest_trust_info,
46219 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation")
46220 : },
46221 : {
46222 : .name = discard_const_p(char, "in_check_only"),
46223 : .get = py_lsa_lsaRSetForestTrustInformation_in_get_check_only,
46224 : .set = py_lsa_lsaRSetForestTrustInformation_in_set_check_only,
46225 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
46226 : },
46227 : {
46228 : .name = discard_const_p(char, "out_collision_info"),
46229 : .get = py_lsa_lsaRSetForestTrustInformation_out_get_collision_info,
46230 : .set = py_lsa_lsaRSetForestTrustInformation_out_set_collision_info,
46231 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionInfo")
46232 : },
46233 : {
46234 : .name = discard_const_p(char, "result"),
46235 : .get = py_lsa_lsaRSetForestTrustInformation_get_result,
46236 : .set = py_lsa_lsaRSetForestTrustInformation_set_result,
46237 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
46238 : },
46239 : { .name = NULL }
46240 : };
46241 :
46242 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46243 : {
46244 0 : PyObject *self = pytalloc_new(struct lsa_lsaRSetForestTrustInformation, type);
46245 0 : struct lsa_lsaRSetForestTrustInformation *_self = (struct lsa_lsaRSetForestTrustInformation *)pytalloc_get_ptr(self);
46246 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46247 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
46248 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_StringLarge);
46249 0 : _self->in.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation);
46250 : /* a pointer to a NULL pointer */
46251 0 : _self->out.collision_info = talloc_zero(mem_ctx, struct lsa_ForestTrustCollisionInfo *);
46252 0 : return self;
46253 : }
46254 :
46255 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46256 : {
46257 :
46258 :
46259 0 : return PyLong_FromLong(74);
46260 : }
46261 :
46262 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
46263 : {
46264 0 : const struct ndr_interface_call *call = NULL;
46265 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46266 0 : PyObject *ret = NULL;
46267 0 : struct ndr_push *push = NULL;
46268 0 : DATA_BLOB blob;
46269 0 : enum ndr_err_code err;
46270 :
46271 0 : if (ndr_table_lsarpc.num_calls < 75) {
46272 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_pack");
46273 0 : return NULL;
46274 : }
46275 0 : call = &ndr_table_lsarpc.calls[74];
46276 :
46277 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46278 0 : if (push == NULL) {
46279 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46280 0 : return NULL;
46281 : }
46282 :
46283 0 : push->flags |= ndr_push_flags;
46284 :
46285 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46286 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46287 0 : TALLOC_FREE(push);
46288 0 : PyErr_SetNdrError(err);
46289 0 : return NULL;
46290 : }
46291 0 : blob = ndr_push_blob(push);
46292 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46293 0 : TALLOC_FREE(push);
46294 0 : return ret;
46295 : }
46296 :
46297 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46298 : {
46299 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46300 0 : PyObject *bigendian_obj = NULL;
46301 0 : PyObject *ndr64_obj = NULL;
46302 0 : libndr_flags ndr_push_flags = 0;
46303 :
46304 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46305 : discard_const_p(char *, kwnames),
46306 : &bigendian_obj,
46307 : &ndr64_obj)) {
46308 0 : return NULL;
46309 : }
46310 :
46311 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46312 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46313 : }
46314 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46315 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46316 : }
46317 :
46318 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46319 : }
46320 :
46321 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46322 : {
46323 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46324 0 : PyObject *bigendian_obj = NULL;
46325 0 : PyObject *ndr64_obj = NULL;
46326 0 : libndr_flags ndr_push_flags = 0;
46327 :
46328 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46329 : discard_const_p(char *, kwnames),
46330 : &bigendian_obj,
46331 : &ndr64_obj)) {
46332 0 : return NULL;
46333 : }
46334 :
46335 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46336 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46337 : }
46338 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46339 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46340 : }
46341 :
46342 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46343 : }
46344 :
46345 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)
46346 : {
46347 0 : const struct ndr_interface_call *call = NULL;
46348 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46349 0 : struct ndr_pull *pull = NULL;
46350 0 : enum ndr_err_code err;
46351 :
46352 0 : if (ndr_table_lsarpc.num_calls < 75) {
46353 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_unpack");
46354 0 : return NULL;
46355 : }
46356 0 : call = &ndr_table_lsarpc.calls[74];
46357 :
46358 0 : pull = ndr_pull_init_blob(blob, object);
46359 0 : if (pull == NULL) {
46360 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46361 0 : return NULL;
46362 : }
46363 :
46364 0 : pull->flags |= ndr_pull_flags;
46365 :
46366 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46367 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46368 0 : TALLOC_FREE(pull);
46369 0 : PyErr_SetNdrError(err);
46370 0 : return NULL;
46371 : }
46372 0 : if (!allow_remaining) {
46373 0 : uint32_t highest_ofs;
46374 :
46375 0 : if (pull->offset > pull->relative_highest_offset) {
46376 0 : highest_ofs = pull->offset;
46377 : } else {
46378 0 : highest_ofs = pull->relative_highest_offset;
46379 : }
46380 0 : if (highest_ofs < pull->data_size) {
46381 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46382 : "not all bytes consumed ofs[%u] size[%u]",
46383 : highest_ofs, pull->data_size);
46384 0 : TALLOC_FREE(pull);
46385 0 : PyErr_SetNdrError(err);
46386 0 : return NULL;
46387 : }
46388 : }
46389 :
46390 0 : TALLOC_FREE(pull);
46391 0 : Py_RETURN_NONE;
46392 : }
46393 :
46394 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46395 : {
46396 0 : DATA_BLOB blob;
46397 0 : Py_ssize_t blob_length = 0;
46398 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46399 0 : PyObject *bigendian_obj = NULL;
46400 0 : PyObject *ndr64_obj = NULL;
46401 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46402 0 : PyObject *allow_remaining_obj = NULL;
46403 0 : bool allow_remaining = false;
46404 :
46405 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46406 : discard_const_p(char *, kwnames),
46407 : &blob.data, &blob_length,
46408 : &bigendian_obj,
46409 : &ndr64_obj,
46410 : &allow_remaining_obj)) {
46411 0 : return NULL;
46412 : }
46413 0 : blob.length = blob_length;
46414 :
46415 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46416 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46417 : }
46418 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46419 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46420 : }
46421 :
46422 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46423 0 : allow_remaining = true;
46424 : }
46425 :
46426 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46427 : }
46428 :
46429 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46430 : {
46431 0 : DATA_BLOB blob;
46432 0 : Py_ssize_t blob_length = 0;
46433 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46434 0 : PyObject *bigendian_obj = NULL;
46435 0 : PyObject *ndr64_obj = NULL;
46436 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46437 0 : PyObject *allow_remaining_obj = NULL;
46438 0 : bool allow_remaining = false;
46439 :
46440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46441 : discard_const_p(char *, kwnames),
46442 : &blob.data, &blob_length,
46443 : &bigendian_obj,
46444 : &ndr64_obj,
46445 : &allow_remaining_obj)) {
46446 0 : return NULL;
46447 : }
46448 0 : blob.length = blob_length;
46449 :
46450 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46451 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46452 : }
46453 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46454 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46455 : }
46456 :
46457 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46458 0 : allow_remaining = true;
46459 : }
46460 :
46461 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46462 : }
46463 :
46464 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46465 : {
46466 0 : const struct ndr_interface_call *call = NULL;
46467 0 : struct lsa_lsaRSetForestTrustInformation *object = pytalloc_get_ptr(py_obj);
46468 0 : PyObject *ret;
46469 0 : char *retstr;
46470 :
46471 0 : if (ndr_table_lsarpc.num_calls < 75) {
46472 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation_ndr_print");
46473 0 : return NULL;
46474 : }
46475 0 : call = &ndr_table_lsarpc.calls[74];
46476 :
46477 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46478 0 : ret = PyUnicode_FromString(retstr);
46479 0 : TALLOC_FREE(retstr);
46480 :
46481 0 : return ret;
46482 : }
46483 :
46484 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46485 : {
46486 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_in", NDR_IN);
46487 : }
46488 :
46489 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46490 : {
46491 0 : return py_lsa_lsaRSetForestTrustInformation_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation_out", NDR_OUT);
46492 : }
46493 :
46494 : static PyMethodDef py_lsa_lsaRSetForestTrustInformation_methods[] = {
46495 : { "opnum", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
46496 : "lsa.lsaRSetForestTrustInformation.opnum() -> 74 (0x4a) " },
46497 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46498 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46499 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46500 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46501 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46502 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46503 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46504 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46505 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46506 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46507 : { NULL, NULL, 0, NULL }
46508 : };
46509 :
46510 :
46511 : static PyTypeObject lsa_lsaRSetForestTrustInformation_Type = {
46512 : PyVarObject_HEAD_INIT(NULL, 0)
46513 : .tp_name = "lsa.lsaRSetForestTrustInformation",
46514 : .tp_getset = py_lsa_lsaRSetForestTrustInformation_getsetters,
46515 : .tp_methods = py_lsa_lsaRSetForestTrustInformation_methods,
46516 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46517 : .tp_new = py_lsa_lsaRSetForestTrustInformation_new,
46518 : };
46519 :
46520 68 : static bool pack_py_lsa_lsaRSetForestTrustInformation_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation *r)
46521 : {
46522 0 : PyObject *py_handle;
46523 0 : PyObject *py_trusted_domain_name;
46524 0 : PyObject *py_highest_record_type;
46525 0 : PyObject *py_forest_trust_info;
46526 0 : PyObject *py_check_only;
46527 68 : const char *kwnames[] = {
46528 : "handle", "trusted_domain_name", "highest_record_type", "forest_trust_info", "check_only", NULL
46529 : };
46530 :
46531 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)) {
46532 0 : return false;
46533 : }
46534 :
46535 68 : if (py_handle == NULL) {
46536 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
46537 0 : return false;
46538 : }
46539 68 : r->in.handle = talloc_ptrtype(r, r->in.handle);
46540 68 : if (r->in.handle == NULL) {
46541 0 : PyErr_NoMemory();
46542 0 : return false;
46543 : }
46544 68 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
46545 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
46546 0 : PyErr_NoMemory();
46547 0 : return false;
46548 : }
46549 68 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
46550 68 : if (py_trusted_domain_name == NULL) {
46551 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain_name");
46552 0 : return false;
46553 : }
46554 68 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
46555 68 : if (r->in.trusted_domain_name == NULL) {
46556 0 : PyErr_NoMemory();
46557 0 : return false;
46558 : }
46559 68 : PY_CHECK_TYPE(&lsa_StringLarge_Type, py_trusted_domain_name, return false;);
46560 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
46561 0 : PyErr_NoMemory();
46562 0 : return false;
46563 : }
46564 68 : r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
46565 68 : if (py_highest_record_type == NULL) {
46566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.highest_record_type");
46567 0 : return false;
46568 : }
46569 : {
46570 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
46571 68 : if (PyLong_Check(py_highest_record_type)) {
46572 0 : unsigned long long test_var;
46573 68 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
46574 68 : if (PyErr_Occurred() != NULL) {
46575 0 : return false;
46576 : }
46577 68 : if (test_var > uint_max) {
46578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46579 : PyLong_Type.tp_name, uint_max, test_var);
46580 0 : return false;
46581 : }
46582 68 : r->in.highest_record_type = test_var;
46583 : } else {
46584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46585 : PyLong_Type.tp_name);
46586 0 : return false;
46587 : }
46588 : }
46589 68 : if (py_forest_trust_info == NULL) {
46590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.forest_trust_info");
46591 0 : return false;
46592 : }
46593 68 : r->in.forest_trust_info = talloc_ptrtype(r, r->in.forest_trust_info);
46594 68 : if (r->in.forest_trust_info == NULL) {
46595 0 : PyErr_NoMemory();
46596 0 : return false;
46597 : }
46598 68 : PY_CHECK_TYPE(&lsa_ForestTrustInformation_Type, py_forest_trust_info, return false;);
46599 68 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_forest_trust_info)) == NULL) {
46600 0 : PyErr_NoMemory();
46601 0 : return false;
46602 : }
46603 68 : r->in.forest_trust_info = (struct lsa_ForestTrustInformation *)pytalloc_get_ptr(py_forest_trust_info);
46604 68 : if (py_check_only == NULL) {
46605 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.check_only");
46606 0 : return false;
46607 : }
46608 : {
46609 68 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.check_only));
46610 68 : if (PyLong_Check(py_check_only)) {
46611 0 : unsigned long long test_var;
46612 68 : test_var = PyLong_AsUnsignedLongLong(py_check_only);
46613 68 : if (PyErr_Occurred() != NULL) {
46614 0 : return false;
46615 : }
46616 68 : if (test_var > uint_max) {
46617 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46618 : PyLong_Type.tp_name, uint_max, test_var);
46619 0 : return false;
46620 : }
46621 68 : r->in.check_only = test_var;
46622 : } else {
46623 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46624 : PyLong_Type.tp_name);
46625 0 : return false;
46626 : }
46627 : }
46628 68 : return true;
46629 : }
46630 :
46631 68 : static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation_args_out(struct lsa_lsaRSetForestTrustInformation *r)
46632 : {
46633 0 : PyObject *result;
46634 0 : PyObject *py_collision_info;
46635 68 : if (*r->out.collision_info == NULL) {
46636 52 : py_collision_info = Py_None;
46637 26 : Py_INCREF(py_collision_info);
46638 : } else {
46639 16 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
46640 : }
46641 68 : result = py_collision_info;
46642 68 : if (NT_STATUS_IS_ERR(r->out.result)) {
46643 0 : PyErr_SetNTSTATUS(r->out.result);
46644 0 : return NULL;
46645 : }
46646 :
46647 68 : return result;
46648 : }
46649 :
46650 :
46651 0 : static PyObject *py_lsa_LookupSids3_in_get_sids(PyObject *obj, void *closure)
46652 : {
46653 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46654 0 : PyObject *py_sids;
46655 0 : if (object->in.sids == NULL) {
46656 0 : Py_RETURN_NONE;
46657 : }
46658 0 : py_sids = pytalloc_reference_ex(&lsa_SidArray_Type, object->in.sids, object->in.sids);
46659 0 : return py_sids;
46660 : }
46661 :
46662 0 : static int py_lsa_LookupSids3_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
46663 : {
46664 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46665 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
46666 0 : if (value == NULL) {
46667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
46668 0 : return -1;
46669 : }
46670 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
46671 0 : if (object->in.sids == NULL) {
46672 0 : PyErr_NoMemory();
46673 0 : return -1;
46674 : }
46675 0 : PY_CHECK_TYPE(&lsa_SidArray_Type, value, return -1;);
46676 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46677 0 : PyErr_NoMemory();
46678 0 : return -1;
46679 : }
46680 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
46681 0 : return 0;
46682 : }
46683 :
46684 0 : static PyObject *py_lsa_LookupSids3_out_get_domains(PyObject *obj, void *closure)
46685 : {
46686 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46687 0 : PyObject *py_domains;
46688 0 : if (object->out.domains == NULL) {
46689 0 : Py_RETURN_NONE;
46690 : }
46691 0 : if (*object->out.domains == NULL) {
46692 0 : py_domains = Py_None;
46693 0 : Py_INCREF(py_domains);
46694 : } else {
46695 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
46696 : }
46697 0 : return py_domains;
46698 : }
46699 :
46700 0 : static int py_lsa_LookupSids3_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
46701 : {
46702 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46703 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
46704 0 : if (value == NULL) {
46705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
46706 0 : return -1;
46707 : }
46708 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
46709 0 : if (object->out.domains == NULL) {
46710 0 : PyErr_NoMemory();
46711 0 : return -1;
46712 : }
46713 0 : if (value == Py_None) {
46714 0 : *object->out.domains = NULL;
46715 : } else {
46716 0 : *object->out.domains = NULL;
46717 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
46718 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46719 0 : PyErr_NoMemory();
46720 0 : return -1;
46721 : }
46722 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
46723 : }
46724 0 : return 0;
46725 : }
46726 :
46727 0 : static PyObject *py_lsa_LookupSids3_in_get_names(PyObject *obj, void *closure)
46728 : {
46729 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46730 0 : PyObject *py_names;
46731 0 : if (object->in.names == NULL) {
46732 0 : Py_RETURN_NONE;
46733 : }
46734 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->in.names, object->in.names);
46735 0 : return py_names;
46736 : }
46737 :
46738 0 : static int py_lsa_LookupSids3_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
46739 : {
46740 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46741 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.names));
46742 0 : if (value == NULL) {
46743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
46744 0 : return -1;
46745 : }
46746 0 : object->in.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names);
46747 0 : if (object->in.names == NULL) {
46748 0 : PyErr_NoMemory();
46749 0 : return -1;
46750 : }
46751 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
46752 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46753 0 : PyErr_NoMemory();
46754 0 : return -1;
46755 : }
46756 0 : object->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
46757 0 : return 0;
46758 : }
46759 :
46760 0 : static PyObject *py_lsa_LookupSids3_out_get_names(PyObject *obj, void *closure)
46761 : {
46762 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46763 0 : PyObject *py_names;
46764 0 : if (object->out.names == NULL) {
46765 0 : Py_RETURN_NONE;
46766 : }
46767 0 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, object->out.names, object->out.names);
46768 0 : return py_names;
46769 : }
46770 :
46771 0 : static int py_lsa_LookupSids3_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
46772 : {
46773 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46774 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
46775 0 : if (value == NULL) {
46776 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.names");
46777 0 : return -1;
46778 : }
46779 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
46780 0 : if (object->out.names == NULL) {
46781 0 : PyErr_NoMemory();
46782 0 : return -1;
46783 : }
46784 0 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, value, return -1;);
46785 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46786 0 : PyErr_NoMemory();
46787 0 : return -1;
46788 : }
46789 0 : object->out.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(value);
46790 0 : return 0;
46791 : }
46792 :
46793 0 : static PyObject *py_lsa_LookupSids3_in_get_level(PyObject *obj, void *closure)
46794 : {
46795 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46796 0 : PyObject *py_level;
46797 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
46798 0 : return py_level;
46799 : }
46800 :
46801 0 : static int py_lsa_LookupSids3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
46802 : {
46803 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46804 0 : if (value == NULL) {
46805 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
46806 0 : return -1;
46807 : }
46808 : {
46809 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
46810 0 : if (PyLong_Check(value)) {
46811 0 : unsigned long long test_var;
46812 0 : test_var = PyLong_AsUnsignedLongLong(value);
46813 0 : if (PyErr_Occurred() != NULL) {
46814 0 : return -1;
46815 : }
46816 0 : if (test_var > uint_max) {
46817 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46818 : PyLong_Type.tp_name, uint_max, test_var);
46819 0 : return -1;
46820 : }
46821 0 : object->in.level = test_var;
46822 : } else {
46823 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46824 : PyLong_Type.tp_name);
46825 0 : return -1;
46826 : }
46827 : }
46828 0 : return 0;
46829 : }
46830 :
46831 0 : static PyObject *py_lsa_LookupSids3_in_get_count(PyObject *obj, void *closure)
46832 : {
46833 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46834 0 : PyObject *py_count;
46835 0 : if (object->in.count == NULL) {
46836 0 : Py_RETURN_NONE;
46837 : }
46838 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
46839 0 : return py_count;
46840 : }
46841 :
46842 0 : static int py_lsa_LookupSids3_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
46843 : {
46844 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46845 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
46846 0 : if (value == NULL) {
46847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
46848 0 : return -1;
46849 : }
46850 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
46851 0 : if (object->in.count == NULL) {
46852 0 : PyErr_NoMemory();
46853 0 : return -1;
46854 : }
46855 : {
46856 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
46857 0 : if (PyLong_Check(value)) {
46858 0 : unsigned long long test_var;
46859 0 : test_var = PyLong_AsUnsignedLongLong(value);
46860 0 : if (PyErr_Occurred() != NULL) {
46861 0 : return -1;
46862 : }
46863 0 : if (test_var > uint_max) {
46864 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46865 : PyLong_Type.tp_name, uint_max, test_var);
46866 0 : return -1;
46867 : }
46868 0 : *object->in.count = test_var;
46869 : } else {
46870 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46871 : PyLong_Type.tp_name);
46872 0 : return -1;
46873 : }
46874 : }
46875 0 : return 0;
46876 : }
46877 :
46878 0 : static PyObject *py_lsa_LookupSids3_out_get_count(PyObject *obj, void *closure)
46879 : {
46880 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46881 0 : PyObject *py_count;
46882 0 : if (object->out.count == NULL) {
46883 0 : Py_RETURN_NONE;
46884 : }
46885 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
46886 0 : return py_count;
46887 : }
46888 :
46889 0 : static int py_lsa_LookupSids3_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
46890 : {
46891 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46892 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
46893 0 : if (value == NULL) {
46894 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
46895 0 : return -1;
46896 : }
46897 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
46898 0 : if (object->out.count == NULL) {
46899 0 : PyErr_NoMemory();
46900 0 : return -1;
46901 : }
46902 : {
46903 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
46904 0 : if (PyLong_Check(value)) {
46905 0 : unsigned long long test_var;
46906 0 : test_var = PyLong_AsUnsignedLongLong(value);
46907 0 : if (PyErr_Occurred() != NULL) {
46908 0 : return -1;
46909 : }
46910 0 : if (test_var > uint_max) {
46911 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46912 : PyLong_Type.tp_name, uint_max, test_var);
46913 0 : return -1;
46914 : }
46915 0 : *object->out.count = test_var;
46916 : } else {
46917 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46918 : PyLong_Type.tp_name);
46919 0 : return -1;
46920 : }
46921 : }
46922 0 : return 0;
46923 : }
46924 :
46925 0 : static PyObject *py_lsa_LookupSids3_in_get_lookup_options(PyObject *obj, void *closure)
46926 : {
46927 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46928 0 : PyObject *py_lookup_options;
46929 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.lookup_options));
46930 0 : return py_lookup_options;
46931 : }
46932 :
46933 0 : static int py_lsa_LookupSids3_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
46934 : {
46935 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46936 0 : if (value == NULL) {
46937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lookup_options");
46938 0 : return -1;
46939 : }
46940 : {
46941 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
46942 0 : if (PyLong_Check(value)) {
46943 0 : unsigned long long test_var;
46944 0 : test_var = PyLong_AsUnsignedLongLong(value);
46945 0 : if (PyErr_Occurred() != NULL) {
46946 0 : return -1;
46947 : }
46948 0 : if (test_var > uint_max) {
46949 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46950 : PyLong_Type.tp_name, uint_max, test_var);
46951 0 : return -1;
46952 : }
46953 0 : object->in.lookup_options = test_var;
46954 : } else {
46955 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46956 : PyLong_Type.tp_name);
46957 0 : return -1;
46958 : }
46959 : }
46960 0 : return 0;
46961 : }
46962 :
46963 0 : static PyObject *py_lsa_LookupSids3_in_get_client_revision(PyObject *obj, void *closure)
46964 : {
46965 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
46966 0 : PyObject *py_client_revision;
46967 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_revision));
46968 0 : return py_client_revision;
46969 : }
46970 :
46971 0 : static int py_lsa_LookupSids3_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
46972 : {
46973 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
46974 0 : if (value == NULL) {
46975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_revision");
46976 0 : return -1;
46977 : }
46978 : {
46979 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
46980 0 : if (PyLong_Check(value)) {
46981 0 : unsigned long long test_var;
46982 0 : test_var = PyLong_AsUnsignedLongLong(value);
46983 0 : if (PyErr_Occurred() != NULL) {
46984 0 : return -1;
46985 : }
46986 0 : if (test_var > uint_max) {
46987 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46988 : PyLong_Type.tp_name, uint_max, test_var);
46989 0 : return -1;
46990 : }
46991 0 : object->in.client_revision = test_var;
46992 : } else {
46993 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46994 : PyLong_Type.tp_name);
46995 0 : return -1;
46996 : }
46997 : }
46998 0 : return 0;
46999 : }
47000 :
47001 0 : static PyObject *py_lsa_LookupSids3_get_result(PyObject *obj, void *closure)
47002 : {
47003 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(obj);
47004 0 : PyObject *py_result;
47005 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
47006 0 : return py_result;
47007 : }
47008 :
47009 0 : static int py_lsa_LookupSids3_set_result(PyObject *py_obj, PyObject *value, void *closure)
47010 : {
47011 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
47012 0 : if (value == NULL) {
47013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
47014 0 : return -1;
47015 : }
47016 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
47017 0 : return 0;
47018 : }
47019 :
47020 : static PyGetSetDef py_lsa_LookupSids3_getsetters[] = {
47021 : {
47022 : .name = discard_const_p(char, "in_sids"),
47023 : .get = py_lsa_LookupSids3_in_get_sids,
47024 : .set = py_lsa_LookupSids3_in_set_sids,
47025 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
47026 : },
47027 : {
47028 : .name = discard_const_p(char, "out_domains"),
47029 : .get = py_lsa_LookupSids3_out_get_domains,
47030 : .set = py_lsa_LookupSids3_out_set_domains,
47031 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
47032 : },
47033 : {
47034 : .name = discard_const_p(char, "in_names"),
47035 : .get = py_lsa_LookupSids3_in_get_names,
47036 : .set = py_lsa_LookupSids3_in_set_names,
47037 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
47038 : },
47039 : {
47040 : .name = discard_const_p(char, "out_names"),
47041 : .get = py_lsa_LookupSids3_out_get_names,
47042 : .set = py_lsa_LookupSids3_out_set_names,
47043 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransNameArray2")
47044 : },
47045 : {
47046 : .name = discard_const_p(char, "in_level"),
47047 : .get = py_lsa_LookupSids3_in_get_level,
47048 : .set = py_lsa_LookupSids3_in_set_level,
47049 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
47050 : },
47051 : {
47052 : .name = discard_const_p(char, "in_count"),
47053 : .get = py_lsa_LookupSids3_in_get_count,
47054 : .set = py_lsa_LookupSids3_in_set_count,
47055 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
47056 : },
47057 : {
47058 : .name = discard_const_p(char, "out_count"),
47059 : .get = py_lsa_LookupSids3_out_get_count,
47060 : .set = py_lsa_LookupSids3_out_set_count,
47061 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
47062 : },
47063 : {
47064 : .name = discard_const_p(char, "in_lookup_options"),
47065 : .get = py_lsa_LookupSids3_in_get_lookup_options,
47066 : .set = py_lsa_LookupSids3_in_set_lookup_options,
47067 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
47068 : },
47069 : {
47070 : .name = discard_const_p(char, "in_client_revision"),
47071 : .get = py_lsa_LookupSids3_in_get_client_revision,
47072 : .set = py_lsa_LookupSids3_in_set_client_revision,
47073 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
47074 : },
47075 : {
47076 : .name = discard_const_p(char, "result"),
47077 : .get = py_lsa_LookupSids3_get_result,
47078 : .set = py_lsa_LookupSids3_set_result,
47079 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
47080 : },
47081 : { .name = NULL }
47082 : };
47083 :
47084 0 : static PyObject *py_lsa_LookupSids3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47085 : {
47086 0 : PyObject *self = pytalloc_new(struct lsa_LookupSids3, type);
47087 0 : struct lsa_LookupSids3 *_self = (struct lsa_LookupSids3 *)pytalloc_get_ptr(self);
47088 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
47089 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
47090 : /* a pointer to a NULL pointer */
47091 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
47092 0 : _self->in.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
47093 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_TransNameArray2);
47094 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
47095 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
47096 0 : return self;
47097 : }
47098 :
47099 0 : static PyObject *py_lsa_LookupSids3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
47100 : {
47101 :
47102 :
47103 0 : return PyLong_FromLong(76);
47104 : }
47105 :
47106 0 : static PyObject *py_lsa_LookupSids3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
47107 : {
47108 0 : const struct ndr_interface_call *call = NULL;
47109 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
47110 0 : PyObject *ret = NULL;
47111 0 : struct ndr_push *push = NULL;
47112 0 : DATA_BLOB blob;
47113 0 : enum ndr_err_code err;
47114 :
47115 0 : if (ndr_table_lsarpc.num_calls < 77) {
47116 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_pack");
47117 0 : return NULL;
47118 : }
47119 0 : call = &ndr_table_lsarpc.calls[76];
47120 :
47121 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
47122 0 : if (push == NULL) {
47123 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47124 0 : return NULL;
47125 : }
47126 :
47127 0 : push->flags |= ndr_push_flags;
47128 :
47129 0 : err = call->ndr_push(push, ndr_inout_flags, object);
47130 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47131 0 : TALLOC_FREE(push);
47132 0 : PyErr_SetNdrError(err);
47133 0 : return NULL;
47134 : }
47135 0 : blob = ndr_push_blob(push);
47136 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
47137 0 : TALLOC_FREE(push);
47138 0 : return ret;
47139 : }
47140 :
47141 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47142 : {
47143 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47144 0 : PyObject *bigendian_obj = NULL;
47145 0 : PyObject *ndr64_obj = NULL;
47146 0 : libndr_flags ndr_push_flags = 0;
47147 :
47148 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
47149 : discard_const_p(char *, kwnames),
47150 : &bigendian_obj,
47151 : &ndr64_obj)) {
47152 0 : return NULL;
47153 : }
47154 :
47155 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47156 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47157 : }
47158 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47159 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47160 : }
47161 :
47162 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
47163 : }
47164 :
47165 0 : static PyObject *py_lsa_LookupSids3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47166 : {
47167 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47168 0 : PyObject *bigendian_obj = NULL;
47169 0 : PyObject *ndr64_obj = NULL;
47170 0 : libndr_flags ndr_push_flags = 0;
47171 :
47172 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
47173 : discard_const_p(char *, kwnames),
47174 : &bigendian_obj,
47175 : &ndr64_obj)) {
47176 0 : return NULL;
47177 : }
47178 :
47179 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47180 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47181 : }
47182 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47183 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47184 : }
47185 :
47186 0 : return py_lsa_LookupSids3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
47187 : }
47188 :
47189 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)
47190 : {
47191 0 : const struct ndr_interface_call *call = NULL;
47192 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
47193 0 : struct ndr_pull *pull = NULL;
47194 0 : enum ndr_err_code err;
47195 :
47196 0 : if (ndr_table_lsarpc.num_calls < 77) {
47197 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_unpack");
47198 0 : return NULL;
47199 : }
47200 0 : call = &ndr_table_lsarpc.calls[76];
47201 :
47202 0 : pull = ndr_pull_init_blob(blob, object);
47203 0 : if (pull == NULL) {
47204 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47205 0 : return NULL;
47206 : }
47207 :
47208 0 : pull->flags |= ndr_pull_flags;
47209 :
47210 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
47211 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47212 0 : TALLOC_FREE(pull);
47213 0 : PyErr_SetNdrError(err);
47214 0 : return NULL;
47215 : }
47216 0 : if (!allow_remaining) {
47217 0 : uint32_t highest_ofs;
47218 :
47219 0 : if (pull->offset > pull->relative_highest_offset) {
47220 0 : highest_ofs = pull->offset;
47221 : } else {
47222 0 : highest_ofs = pull->relative_highest_offset;
47223 : }
47224 0 : if (highest_ofs < pull->data_size) {
47225 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
47226 : "not all bytes consumed ofs[%u] size[%u]",
47227 : highest_ofs, pull->data_size);
47228 0 : TALLOC_FREE(pull);
47229 0 : PyErr_SetNdrError(err);
47230 0 : return NULL;
47231 : }
47232 : }
47233 :
47234 0 : TALLOC_FREE(pull);
47235 0 : Py_RETURN_NONE;
47236 : }
47237 :
47238 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47239 : {
47240 0 : DATA_BLOB blob;
47241 0 : Py_ssize_t blob_length = 0;
47242 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47243 0 : PyObject *bigendian_obj = NULL;
47244 0 : PyObject *ndr64_obj = NULL;
47245 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47246 0 : PyObject *allow_remaining_obj = NULL;
47247 0 : bool allow_remaining = false;
47248 :
47249 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
47250 : discard_const_p(char *, kwnames),
47251 : &blob.data, &blob_length,
47252 : &bigendian_obj,
47253 : &ndr64_obj,
47254 : &allow_remaining_obj)) {
47255 0 : return NULL;
47256 : }
47257 0 : blob.length = blob_length;
47258 :
47259 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47260 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47261 : }
47262 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47263 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47264 : }
47265 :
47266 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47267 0 : allow_remaining = true;
47268 : }
47269 :
47270 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
47271 : }
47272 :
47273 0 : static PyObject *py_lsa_LookupSids3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47274 : {
47275 0 : DATA_BLOB blob;
47276 0 : Py_ssize_t blob_length = 0;
47277 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47278 0 : PyObject *bigendian_obj = NULL;
47279 0 : PyObject *ndr64_obj = NULL;
47280 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47281 0 : PyObject *allow_remaining_obj = NULL;
47282 0 : bool allow_remaining = false;
47283 :
47284 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
47285 : discard_const_p(char *, kwnames),
47286 : &blob.data, &blob_length,
47287 : &bigendian_obj,
47288 : &ndr64_obj,
47289 : &allow_remaining_obj)) {
47290 0 : return NULL;
47291 : }
47292 0 : blob.length = blob_length;
47293 :
47294 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47295 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47296 : }
47297 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47298 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47299 : }
47300 :
47301 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47302 0 : allow_remaining = true;
47303 : }
47304 :
47305 0 : return py_lsa_LookupSids3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
47306 : }
47307 :
47308 0 : static PyObject *py_lsa_LookupSids3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
47309 : {
47310 0 : const struct ndr_interface_call *call = NULL;
47311 0 : struct lsa_LookupSids3 *object = pytalloc_get_ptr(py_obj);
47312 0 : PyObject *ret;
47313 0 : char *retstr;
47314 :
47315 0 : if (ndr_table_lsarpc.num_calls < 77) {
47316 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupSids3_ndr_print");
47317 0 : return NULL;
47318 : }
47319 0 : call = &ndr_table_lsarpc.calls[76];
47320 :
47321 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47322 0 : ret = PyUnicode_FromString(retstr);
47323 0 : TALLOC_FREE(retstr);
47324 :
47325 0 : return ret;
47326 : }
47327 :
47328 0 : static PyObject *py_lsa_LookupSids3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47329 : {
47330 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_in", NDR_IN);
47331 : }
47332 :
47333 0 : static PyObject *py_lsa_LookupSids3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47334 : {
47335 0 : return py_lsa_LookupSids3_ndr_print(py_obj, "lsa_LookupSids3_out", NDR_OUT);
47336 : }
47337 :
47338 : static PyMethodDef py_lsa_LookupSids3_methods[] = {
47339 : { "opnum", (PyCFunction)py_lsa_LookupSids3_ndr_opnum, METH_NOARGS|METH_CLASS,
47340 : "lsa.LookupSids3.opnum() -> 76 (0x4c) " },
47341 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47342 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47343 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47344 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47345 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47346 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47347 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupSids3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47348 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47349 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupSids3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47350 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupSids3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47351 : { NULL, NULL, 0, NULL }
47352 : };
47353 :
47354 :
47355 : static PyTypeObject lsa_LookupSids3_Type = {
47356 : PyVarObject_HEAD_INIT(NULL, 0)
47357 : .tp_name = "lsa.LookupSids3",
47358 : .tp_getset = py_lsa_LookupSids3_getsetters,
47359 : .tp_methods = py_lsa_LookupSids3_methods,
47360 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47361 : .tp_new = py_lsa_LookupSids3_new,
47362 : };
47363 :
47364 9 : static bool pack_py_lsa_LookupSids3_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupSids3 *r)
47365 : {
47366 0 : PyObject *py_sids;
47367 0 : PyObject *py_names;
47368 0 : PyObject *py_level;
47369 0 : PyObject *py_count;
47370 0 : PyObject *py_lookup_options;
47371 0 : PyObject *py_client_revision;
47372 9 : const char *kwnames[] = {
47373 : "sids", "names", "level", "count", "lookup_options", "client_revision", NULL
47374 : };
47375 :
47376 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)) {
47377 0 : return false;
47378 : }
47379 :
47380 9 : if (py_sids == NULL) {
47381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
47382 0 : return false;
47383 : }
47384 9 : r->in.sids = talloc_ptrtype(r, r->in.sids);
47385 9 : if (r->in.sids == NULL) {
47386 0 : PyErr_NoMemory();
47387 0 : return false;
47388 : }
47389 9 : PY_CHECK_TYPE(&lsa_SidArray_Type, py_sids, return false;);
47390 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
47391 0 : PyErr_NoMemory();
47392 0 : return false;
47393 : }
47394 9 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
47395 9 : if (py_names == NULL) {
47396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
47397 0 : return false;
47398 : }
47399 9 : r->in.names = talloc_ptrtype(r, r->in.names);
47400 9 : if (r->in.names == NULL) {
47401 0 : PyErr_NoMemory();
47402 0 : return false;
47403 : }
47404 9 : PY_CHECK_TYPE(&lsa_TransNameArray2_Type, py_names, return false;);
47405 9 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_names)) == NULL) {
47406 0 : PyErr_NoMemory();
47407 0 : return false;
47408 : }
47409 9 : r->in.names = (struct lsa_TransNameArray2 *)pytalloc_get_ptr(py_names);
47410 9 : if (py_level == NULL) {
47411 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
47412 0 : return false;
47413 : }
47414 : {
47415 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
47416 9 : if (PyLong_Check(py_level)) {
47417 0 : unsigned long long test_var;
47418 9 : test_var = PyLong_AsUnsignedLongLong(py_level);
47419 9 : if (PyErr_Occurred() != NULL) {
47420 0 : return false;
47421 : }
47422 9 : if (test_var > uint_max) {
47423 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47424 : PyLong_Type.tp_name, uint_max, test_var);
47425 0 : return false;
47426 : }
47427 9 : r->in.level = test_var;
47428 : } else {
47429 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47430 : PyLong_Type.tp_name);
47431 0 : return false;
47432 : }
47433 : }
47434 9 : if (py_count == NULL) {
47435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
47436 0 : return false;
47437 : }
47438 9 : r->in.count = talloc_ptrtype(r, r->in.count);
47439 9 : if (r->in.count == NULL) {
47440 0 : PyErr_NoMemory();
47441 0 : return false;
47442 : }
47443 : {
47444 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
47445 9 : if (PyLong_Check(py_count)) {
47446 0 : unsigned long long test_var;
47447 9 : test_var = PyLong_AsUnsignedLongLong(py_count);
47448 9 : if (PyErr_Occurred() != NULL) {
47449 0 : return false;
47450 : }
47451 9 : if (test_var > uint_max) {
47452 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47453 : PyLong_Type.tp_name, uint_max, test_var);
47454 0 : return false;
47455 : }
47456 9 : *r->in.count = test_var;
47457 : } else {
47458 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47459 : PyLong_Type.tp_name);
47460 0 : return false;
47461 : }
47462 : }
47463 9 : if (py_lookup_options == NULL) {
47464 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lookup_options");
47465 0 : return false;
47466 : }
47467 : {
47468 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
47469 9 : if (PyLong_Check(py_lookup_options)) {
47470 0 : unsigned long long test_var;
47471 9 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
47472 9 : if (PyErr_Occurred() != NULL) {
47473 0 : return false;
47474 : }
47475 9 : if (test_var > uint_max) {
47476 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47477 : PyLong_Type.tp_name, uint_max, test_var);
47478 0 : return false;
47479 : }
47480 9 : r->in.lookup_options = test_var;
47481 : } else {
47482 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47483 : PyLong_Type.tp_name);
47484 0 : return false;
47485 : }
47486 : }
47487 9 : if (py_client_revision == NULL) {
47488 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_revision");
47489 0 : return false;
47490 : }
47491 : {
47492 9 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
47493 9 : if (PyLong_Check(py_client_revision)) {
47494 0 : unsigned long long test_var;
47495 9 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
47496 9 : if (PyErr_Occurred() != NULL) {
47497 0 : return false;
47498 : }
47499 9 : if (test_var > uint_max) {
47500 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47501 : PyLong_Type.tp_name, uint_max, test_var);
47502 0 : return false;
47503 : }
47504 9 : r->in.client_revision = test_var;
47505 : } else {
47506 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47507 : PyLong_Type.tp_name);
47508 0 : return false;
47509 : }
47510 : }
47511 9 : return true;
47512 : }
47513 :
47514 8 : static PyObject *unpack_py_lsa_LookupSids3_args_out(struct lsa_LookupSids3 *r)
47515 : {
47516 0 : PyObject *result;
47517 0 : PyObject *py_domains;
47518 0 : PyObject *py_names;
47519 0 : PyObject *py_count;
47520 8 : result = PyTuple_New(3);
47521 8 : if (*r->out.domains == NULL) {
47522 0 : py_domains = Py_None;
47523 0 : Py_INCREF(py_domains);
47524 : } else {
47525 8 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
47526 : }
47527 8 : PyTuple_SetItem(result, 0, py_domains);
47528 8 : py_names = pytalloc_reference_ex(&lsa_TransNameArray2_Type, r->out.names, r->out.names);
47529 8 : PyTuple_SetItem(result, 1, py_names);
47530 8 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
47531 8 : PyTuple_SetItem(result, 2, py_count);
47532 8 : if (NT_STATUS_IS_ERR(r->out.result)) {
47533 0 : PyErr_SetNTSTATUS(r->out.result);
47534 0 : return NULL;
47535 : }
47536 :
47537 8 : return result;
47538 : }
47539 :
47540 :
47541 0 : static PyObject *py_lsa_LookupNames4_in_get_num_names(PyObject *obj, void *closure)
47542 : {
47543 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47544 0 : PyObject *py_num_names;
47545 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)(object->in.num_names));
47546 0 : return py_num_names;
47547 : }
47548 :
47549 0 : static int py_lsa_LookupNames4_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
47550 : {
47551 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47552 0 : if (value == NULL) {
47553 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.num_names");
47554 0 : return -1;
47555 : }
47556 : {
47557 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
47558 0 : if (PyLong_Check(value)) {
47559 0 : unsigned long long test_var;
47560 0 : test_var = PyLong_AsUnsignedLongLong(value);
47561 0 : if (PyErr_Occurred() != NULL) {
47562 0 : return -1;
47563 : }
47564 0 : if (test_var > uint_max) {
47565 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47566 : PyLong_Type.tp_name, uint_max, test_var);
47567 0 : return -1;
47568 : }
47569 0 : object->in.num_names = test_var;
47570 : } else {
47571 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47572 : PyLong_Type.tp_name);
47573 0 : return -1;
47574 : }
47575 : }
47576 0 : return 0;
47577 : }
47578 :
47579 0 : static PyObject *py_lsa_LookupNames4_in_get_names(PyObject *obj, void *closure)
47580 : {
47581 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47582 0 : PyObject *py_names;
47583 0 : py_names = PyList_New(object->in.num_names);
47584 0 : if (py_names == NULL) {
47585 0 : return NULL;
47586 : }
47587 : {
47588 : int names_cntr_0;
47589 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
47590 0 : PyObject *py_names_0;
47591 0 : py_names_0 = pytalloc_reference_ex(&lsa_String_Type, object->in.names, &(object->in.names)[names_cntr_0]);
47592 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
47593 : }
47594 : }
47595 0 : return py_names;
47596 : }
47597 :
47598 0 : static int py_lsa_LookupNames4_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
47599 : {
47600 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47601 0 : if (value == NULL) {
47602 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.names");
47603 0 : return -1;
47604 : }
47605 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
47606 : {
47607 0 : int names_cntr_0;
47608 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
47609 0 : if (!object->in.names) { return -1; }
47610 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
47611 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
47612 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
47613 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.names)[names_cntr_0]");
47614 0 : return -1;
47615 : }
47616 0 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
47617 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
47618 0 : PyErr_NoMemory();
47619 0 : return -1;
47620 : }
47621 0 : (object->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
47622 : }
47623 : }
47624 0 : return 0;
47625 : }
47626 :
47627 0 : static PyObject *py_lsa_LookupNames4_out_get_domains(PyObject *obj, void *closure)
47628 : {
47629 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47630 0 : PyObject *py_domains;
47631 0 : if (object->out.domains == NULL) {
47632 0 : Py_RETURN_NONE;
47633 : }
47634 0 : if (*object->out.domains == NULL) {
47635 0 : py_domains = Py_None;
47636 0 : Py_INCREF(py_domains);
47637 : } else {
47638 0 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *object->out.domains, *object->out.domains);
47639 : }
47640 0 : return py_domains;
47641 : }
47642 :
47643 0 : static int py_lsa_LookupNames4_out_set_domains(PyObject *py_obj, PyObject *value, void *closure)
47644 : {
47645 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47646 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domains));
47647 0 : if (value == NULL) {
47648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.domains");
47649 0 : return -1;
47650 : }
47651 0 : object->out.domains = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domains);
47652 0 : if (object->out.domains == NULL) {
47653 0 : PyErr_NoMemory();
47654 0 : return -1;
47655 : }
47656 0 : if (value == Py_None) {
47657 0 : *object->out.domains = NULL;
47658 : } else {
47659 0 : *object->out.domains = NULL;
47660 0 : PY_CHECK_TYPE(&lsa_RefDomainList_Type, value, return -1;);
47661 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47662 0 : PyErr_NoMemory();
47663 0 : return -1;
47664 : }
47665 0 : *object->out.domains = (struct lsa_RefDomainList *)pytalloc_get_ptr(value);
47666 : }
47667 0 : return 0;
47668 : }
47669 :
47670 0 : static PyObject *py_lsa_LookupNames4_in_get_sids(PyObject *obj, void *closure)
47671 : {
47672 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47673 0 : PyObject *py_sids;
47674 0 : if (object->in.sids == NULL) {
47675 0 : Py_RETURN_NONE;
47676 : }
47677 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->in.sids, object->in.sids);
47678 0 : return py_sids;
47679 : }
47680 :
47681 0 : static int py_lsa_LookupNames4_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
47682 : {
47683 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47684 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
47685 0 : if (value == NULL) {
47686 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.sids");
47687 0 : return -1;
47688 : }
47689 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
47690 0 : if (object->in.sids == NULL) {
47691 0 : PyErr_NoMemory();
47692 0 : return -1;
47693 : }
47694 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
47695 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47696 0 : PyErr_NoMemory();
47697 0 : return -1;
47698 : }
47699 0 : object->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
47700 0 : return 0;
47701 : }
47702 :
47703 0 : static PyObject *py_lsa_LookupNames4_out_get_sids(PyObject *obj, void *closure)
47704 : {
47705 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47706 0 : PyObject *py_sids;
47707 0 : if (object->out.sids == NULL) {
47708 0 : Py_RETURN_NONE;
47709 : }
47710 0 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, object->out.sids, object->out.sids);
47711 0 : return py_sids;
47712 : }
47713 :
47714 0 : static int py_lsa_LookupNames4_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
47715 : {
47716 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47717 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
47718 0 : if (value == NULL) {
47719 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.sids");
47720 0 : return -1;
47721 : }
47722 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
47723 0 : if (object->out.sids == NULL) {
47724 0 : PyErr_NoMemory();
47725 0 : return -1;
47726 : }
47727 0 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, value, return -1;);
47728 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47729 0 : PyErr_NoMemory();
47730 0 : return -1;
47731 : }
47732 0 : object->out.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(value);
47733 0 : return 0;
47734 : }
47735 :
47736 0 : static PyObject *py_lsa_LookupNames4_in_get_level(PyObject *obj, void *closure)
47737 : {
47738 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47739 0 : PyObject *py_level;
47740 0 : py_level = PyLong_FromLong((uint16_t)(object->in.level));
47741 0 : return py_level;
47742 : }
47743 :
47744 0 : static int py_lsa_LookupNames4_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
47745 : {
47746 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47747 0 : if (value == NULL) {
47748 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
47749 0 : return -1;
47750 : }
47751 : {
47752 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
47753 0 : if (PyLong_Check(value)) {
47754 0 : unsigned long long test_var;
47755 0 : test_var = PyLong_AsUnsignedLongLong(value);
47756 0 : if (PyErr_Occurred() != NULL) {
47757 0 : return -1;
47758 : }
47759 0 : if (test_var > uint_max) {
47760 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47761 : PyLong_Type.tp_name, uint_max, test_var);
47762 0 : return -1;
47763 : }
47764 0 : object->in.level = test_var;
47765 : } else {
47766 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47767 : PyLong_Type.tp_name);
47768 0 : return -1;
47769 : }
47770 : }
47771 0 : return 0;
47772 : }
47773 :
47774 0 : static PyObject *py_lsa_LookupNames4_in_get_count(PyObject *obj, void *closure)
47775 : {
47776 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47777 0 : PyObject *py_count;
47778 0 : if (object->in.count == NULL) {
47779 0 : Py_RETURN_NONE;
47780 : }
47781 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.count));
47782 0 : return py_count;
47783 : }
47784 :
47785 0 : static int py_lsa_LookupNames4_in_set_count(PyObject *py_obj, PyObject *value, void *closure)
47786 : {
47787 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47788 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.count));
47789 0 : if (value == NULL) {
47790 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.count");
47791 0 : return -1;
47792 : }
47793 0 : object->in.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.count);
47794 0 : if (object->in.count == NULL) {
47795 0 : PyErr_NoMemory();
47796 0 : return -1;
47797 : }
47798 : {
47799 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.count));
47800 0 : if (PyLong_Check(value)) {
47801 0 : unsigned long long test_var;
47802 0 : test_var = PyLong_AsUnsignedLongLong(value);
47803 0 : if (PyErr_Occurred() != NULL) {
47804 0 : return -1;
47805 : }
47806 0 : if (test_var > uint_max) {
47807 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47808 : PyLong_Type.tp_name, uint_max, test_var);
47809 0 : return -1;
47810 : }
47811 0 : *object->in.count = test_var;
47812 : } else {
47813 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47814 : PyLong_Type.tp_name);
47815 0 : return -1;
47816 : }
47817 : }
47818 0 : return 0;
47819 : }
47820 :
47821 0 : static PyObject *py_lsa_LookupNames4_out_get_count(PyObject *obj, void *closure)
47822 : {
47823 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47824 0 : PyObject *py_count;
47825 0 : if (object->out.count == NULL) {
47826 0 : Py_RETURN_NONE;
47827 : }
47828 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
47829 0 : return py_count;
47830 : }
47831 :
47832 0 : static int py_lsa_LookupNames4_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
47833 : {
47834 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47835 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
47836 0 : if (value == NULL) {
47837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
47838 0 : return -1;
47839 : }
47840 0 : object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
47841 0 : if (object->out.count == NULL) {
47842 0 : PyErr_NoMemory();
47843 0 : return -1;
47844 : }
47845 : {
47846 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
47847 0 : if (PyLong_Check(value)) {
47848 0 : unsigned long long test_var;
47849 0 : test_var = PyLong_AsUnsignedLongLong(value);
47850 0 : if (PyErr_Occurred() != NULL) {
47851 0 : return -1;
47852 : }
47853 0 : if (test_var > uint_max) {
47854 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47855 : PyLong_Type.tp_name, uint_max, test_var);
47856 0 : return -1;
47857 : }
47858 0 : *object->out.count = test_var;
47859 : } else {
47860 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47861 : PyLong_Type.tp_name);
47862 0 : return -1;
47863 : }
47864 : }
47865 0 : return 0;
47866 : }
47867 :
47868 0 : static PyObject *py_lsa_LookupNames4_in_get_lookup_options(PyObject *obj, void *closure)
47869 : {
47870 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47871 0 : PyObject *py_lookup_options;
47872 0 : py_lookup_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.lookup_options));
47873 0 : return py_lookup_options;
47874 : }
47875 :
47876 0 : static int py_lsa_LookupNames4_in_set_lookup_options(PyObject *py_obj, PyObject *value, void *closure)
47877 : {
47878 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47879 0 : if (value == NULL) {
47880 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.lookup_options");
47881 0 : return -1;
47882 : }
47883 : {
47884 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lookup_options));
47885 0 : if (PyLong_Check(value)) {
47886 0 : unsigned long long test_var;
47887 0 : test_var = PyLong_AsUnsignedLongLong(value);
47888 0 : if (PyErr_Occurred() != NULL) {
47889 0 : return -1;
47890 : }
47891 0 : if (test_var > uint_max) {
47892 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47893 : PyLong_Type.tp_name, uint_max, test_var);
47894 0 : return -1;
47895 : }
47896 0 : object->in.lookup_options = test_var;
47897 : } else {
47898 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47899 : PyLong_Type.tp_name);
47900 0 : return -1;
47901 : }
47902 : }
47903 0 : return 0;
47904 : }
47905 :
47906 0 : static PyObject *py_lsa_LookupNames4_in_get_client_revision(PyObject *obj, void *closure)
47907 : {
47908 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47909 0 : PyObject *py_client_revision;
47910 0 : py_client_revision = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_revision));
47911 0 : return py_client_revision;
47912 : }
47913 :
47914 0 : static int py_lsa_LookupNames4_in_set_client_revision(PyObject *py_obj, PyObject *value, void *closure)
47915 : {
47916 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47917 0 : if (value == NULL) {
47918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_revision");
47919 0 : return -1;
47920 : }
47921 : {
47922 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_revision));
47923 0 : if (PyLong_Check(value)) {
47924 0 : unsigned long long test_var;
47925 0 : test_var = PyLong_AsUnsignedLongLong(value);
47926 0 : if (PyErr_Occurred() != NULL) {
47927 0 : return -1;
47928 : }
47929 0 : if (test_var > uint_max) {
47930 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47931 : PyLong_Type.tp_name, uint_max, test_var);
47932 0 : return -1;
47933 : }
47934 0 : object->in.client_revision = test_var;
47935 : } else {
47936 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47937 : PyLong_Type.tp_name);
47938 0 : return -1;
47939 : }
47940 : }
47941 0 : return 0;
47942 : }
47943 :
47944 0 : static PyObject *py_lsa_LookupNames4_get_result(PyObject *obj, void *closure)
47945 : {
47946 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(obj);
47947 0 : PyObject *py_result;
47948 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
47949 0 : return py_result;
47950 : }
47951 :
47952 0 : static int py_lsa_LookupNames4_set_result(PyObject *py_obj, PyObject *value, void *closure)
47953 : {
47954 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
47955 0 : if (value == NULL) {
47956 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
47957 0 : return -1;
47958 : }
47959 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
47960 0 : return 0;
47961 : }
47962 :
47963 : static PyGetSetDef py_lsa_LookupNames4_getsetters[] = {
47964 : {
47965 : .name = discard_const_p(char, "in_num_names"),
47966 : .get = py_lsa_LookupNames4_in_get_num_names,
47967 : .set = py_lsa_LookupNames4_in_set_num_names,
47968 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
47969 : },
47970 : {
47971 : .name = discard_const_p(char, "in_names"),
47972 : .get = py_lsa_LookupNames4_in_get_names,
47973 : .set = py_lsa_LookupNames4_in_set_names,
47974 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
47975 : },
47976 : {
47977 : .name = discard_const_p(char, "out_domains"),
47978 : .get = py_lsa_LookupNames4_out_get_domains,
47979 : .set = py_lsa_LookupNames4_out_set_domains,
47980 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_RefDomainList")
47981 : },
47982 : {
47983 : .name = discard_const_p(char, "in_sids"),
47984 : .get = py_lsa_LookupNames4_in_get_sids,
47985 : .set = py_lsa_LookupNames4_in_set_sids,
47986 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
47987 : },
47988 : {
47989 : .name = discard_const_p(char, "out_sids"),
47990 : .get = py_lsa_LookupNames4_out_get_sids,
47991 : .set = py_lsa_LookupNames4_out_set_sids,
47992 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TransSidArray3")
47993 : },
47994 : {
47995 : .name = discard_const_p(char, "in_level"),
47996 : .get = py_lsa_LookupNames4_in_get_level,
47997 : .set = py_lsa_LookupNames4_in_set_level,
47998 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupNamesLevel")
47999 : },
48000 : {
48001 : .name = discard_const_p(char, "in_count"),
48002 : .get = py_lsa_LookupNames4_in_get_count,
48003 : .set = py_lsa_LookupNames4_in_set_count,
48004 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
48005 : },
48006 : {
48007 : .name = discard_const_p(char, "out_count"),
48008 : .get = py_lsa_LookupNames4_out_get_count,
48009 : .set = py_lsa_LookupNames4_out_set_count,
48010 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
48011 : },
48012 : {
48013 : .name = discard_const_p(char, "in_lookup_options"),
48014 : .get = py_lsa_LookupNames4_in_get_lookup_options,
48015 : .set = py_lsa_LookupNames4_in_set_lookup_options,
48016 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_LookupOptions")
48017 : },
48018 : {
48019 : .name = discard_const_p(char, "in_client_revision"),
48020 : .get = py_lsa_LookupNames4_in_get_client_revision,
48021 : .set = py_lsa_LookupNames4_in_set_client_revision,
48022 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ClientRevision")
48023 : },
48024 : {
48025 : .name = discard_const_p(char, "result"),
48026 : .get = py_lsa_LookupNames4_get_result,
48027 : .set = py_lsa_LookupNames4_set_result,
48028 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
48029 : },
48030 : { .name = NULL }
48031 : };
48032 :
48033 0 : static PyObject *py_lsa_LookupNames4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
48034 : {
48035 0 : PyObject *self = pytalloc_new(struct lsa_LookupNames4, type);
48036 0 : struct lsa_LookupNames4 *_self = (struct lsa_LookupNames4 *)pytalloc_get_ptr(self);
48037 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
48038 : /* a pointer to a NULL pointer */
48039 0 : _self->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
48040 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
48041 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_TransSidArray3);
48042 0 : _self->in.count = talloc_zero(mem_ctx, uint32_t);
48043 0 : _self->out.count = talloc_zero(mem_ctx, uint32_t);
48044 0 : return self;
48045 : }
48046 :
48047 0 : static PyObject *py_lsa_LookupNames4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
48048 : {
48049 :
48050 :
48051 0 : return PyLong_FromLong(77);
48052 : }
48053 :
48054 0 : static PyObject *py_lsa_LookupNames4_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
48055 : {
48056 0 : const struct ndr_interface_call *call = NULL;
48057 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
48058 0 : PyObject *ret = NULL;
48059 0 : struct ndr_push *push = NULL;
48060 0 : DATA_BLOB blob;
48061 0 : enum ndr_err_code err;
48062 :
48063 0 : if (ndr_table_lsarpc.num_calls < 78) {
48064 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_pack");
48065 0 : return NULL;
48066 : }
48067 0 : call = &ndr_table_lsarpc.calls[77];
48068 :
48069 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
48070 0 : if (push == NULL) {
48071 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48072 0 : return NULL;
48073 : }
48074 :
48075 0 : push->flags |= ndr_push_flags;
48076 :
48077 0 : err = call->ndr_push(push, ndr_inout_flags, object);
48078 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48079 0 : TALLOC_FREE(push);
48080 0 : PyErr_SetNdrError(err);
48081 0 : return NULL;
48082 : }
48083 0 : blob = ndr_push_blob(push);
48084 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
48085 0 : TALLOC_FREE(push);
48086 0 : return ret;
48087 : }
48088 :
48089 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48090 : {
48091 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48092 0 : PyObject *bigendian_obj = NULL;
48093 0 : PyObject *ndr64_obj = NULL;
48094 0 : libndr_flags ndr_push_flags = 0;
48095 :
48096 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
48097 : discard_const_p(char *, kwnames),
48098 : &bigendian_obj,
48099 : &ndr64_obj)) {
48100 0 : return NULL;
48101 : }
48102 :
48103 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48104 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48105 : }
48106 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48107 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48108 : }
48109 :
48110 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
48111 : }
48112 :
48113 0 : static PyObject *py_lsa_LookupNames4_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48114 : {
48115 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48116 0 : PyObject *bigendian_obj = NULL;
48117 0 : PyObject *ndr64_obj = NULL;
48118 0 : libndr_flags ndr_push_flags = 0;
48119 :
48120 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
48121 : discard_const_p(char *, kwnames),
48122 : &bigendian_obj,
48123 : &ndr64_obj)) {
48124 0 : return NULL;
48125 : }
48126 :
48127 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48128 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48129 : }
48130 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48131 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48132 : }
48133 :
48134 0 : return py_lsa_LookupNames4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
48135 : }
48136 :
48137 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)
48138 : {
48139 0 : const struct ndr_interface_call *call = NULL;
48140 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
48141 0 : struct ndr_pull *pull = NULL;
48142 0 : enum ndr_err_code err;
48143 :
48144 0 : if (ndr_table_lsarpc.num_calls < 78) {
48145 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_unpack");
48146 0 : return NULL;
48147 : }
48148 0 : call = &ndr_table_lsarpc.calls[77];
48149 :
48150 0 : pull = ndr_pull_init_blob(blob, object);
48151 0 : if (pull == NULL) {
48152 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48153 0 : return NULL;
48154 : }
48155 :
48156 0 : pull->flags |= ndr_pull_flags;
48157 :
48158 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
48159 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48160 0 : TALLOC_FREE(pull);
48161 0 : PyErr_SetNdrError(err);
48162 0 : return NULL;
48163 : }
48164 0 : if (!allow_remaining) {
48165 0 : uint32_t highest_ofs;
48166 :
48167 0 : if (pull->offset > pull->relative_highest_offset) {
48168 0 : highest_ofs = pull->offset;
48169 : } else {
48170 0 : highest_ofs = pull->relative_highest_offset;
48171 : }
48172 0 : if (highest_ofs < pull->data_size) {
48173 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
48174 : "not all bytes consumed ofs[%u] size[%u]",
48175 : highest_ofs, pull->data_size);
48176 0 : TALLOC_FREE(pull);
48177 0 : PyErr_SetNdrError(err);
48178 0 : return NULL;
48179 : }
48180 : }
48181 :
48182 0 : TALLOC_FREE(pull);
48183 0 : Py_RETURN_NONE;
48184 : }
48185 :
48186 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48187 : {
48188 0 : DATA_BLOB blob;
48189 0 : Py_ssize_t blob_length = 0;
48190 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48191 0 : PyObject *bigendian_obj = NULL;
48192 0 : PyObject *ndr64_obj = NULL;
48193 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48194 0 : PyObject *allow_remaining_obj = NULL;
48195 0 : bool allow_remaining = false;
48196 :
48197 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
48198 : discard_const_p(char *, kwnames),
48199 : &blob.data, &blob_length,
48200 : &bigendian_obj,
48201 : &ndr64_obj,
48202 : &allow_remaining_obj)) {
48203 0 : return NULL;
48204 : }
48205 0 : blob.length = blob_length;
48206 :
48207 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48208 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48209 : }
48210 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48211 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48212 : }
48213 :
48214 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48215 0 : allow_remaining = true;
48216 : }
48217 :
48218 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
48219 : }
48220 :
48221 0 : static PyObject *py_lsa_LookupNames4_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48222 : {
48223 0 : DATA_BLOB blob;
48224 0 : Py_ssize_t blob_length = 0;
48225 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48226 0 : PyObject *bigendian_obj = NULL;
48227 0 : PyObject *ndr64_obj = NULL;
48228 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48229 0 : PyObject *allow_remaining_obj = NULL;
48230 0 : bool allow_remaining = false;
48231 :
48232 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
48233 : discard_const_p(char *, kwnames),
48234 : &blob.data, &blob_length,
48235 : &bigendian_obj,
48236 : &ndr64_obj,
48237 : &allow_remaining_obj)) {
48238 0 : return NULL;
48239 : }
48240 0 : blob.length = blob_length;
48241 :
48242 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48243 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48244 : }
48245 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48246 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48247 : }
48248 :
48249 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48250 0 : allow_remaining = true;
48251 : }
48252 :
48253 0 : return py_lsa_LookupNames4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
48254 : }
48255 :
48256 0 : static PyObject *py_lsa_LookupNames4_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
48257 : {
48258 0 : const struct ndr_interface_call *call = NULL;
48259 0 : struct lsa_LookupNames4 *object = pytalloc_get_ptr(py_obj);
48260 0 : PyObject *ret;
48261 0 : char *retstr;
48262 :
48263 0 : if (ndr_table_lsarpc.num_calls < 78) {
48264 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_LookupNames4_ndr_print");
48265 0 : return NULL;
48266 : }
48267 0 : call = &ndr_table_lsarpc.calls[77];
48268 :
48269 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
48270 0 : ret = PyUnicode_FromString(retstr);
48271 0 : TALLOC_FREE(retstr);
48272 :
48273 0 : return ret;
48274 : }
48275 :
48276 0 : static PyObject *py_lsa_LookupNames4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48277 : {
48278 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_in", NDR_IN);
48279 : }
48280 :
48281 0 : static PyObject *py_lsa_LookupNames4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48282 : {
48283 0 : return py_lsa_LookupNames4_ndr_print(py_obj, "lsa_LookupNames4_out", NDR_OUT);
48284 : }
48285 :
48286 : static PyMethodDef py_lsa_LookupNames4_methods[] = {
48287 : { "opnum", (PyCFunction)py_lsa_LookupNames4_ndr_opnum, METH_NOARGS|METH_CLASS,
48288 : "lsa.LookupNames4.opnum() -> 77 (0x4d) " },
48289 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
48290 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
48291 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
48292 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
48293 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
48294 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
48295 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_LookupNames4_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
48296 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
48297 : { "__ndr_print_in__", (PyCFunction)py_lsa_LookupNames4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
48298 : { "__ndr_print_out__", (PyCFunction)py_lsa_LookupNames4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
48299 : { NULL, NULL, 0, NULL }
48300 : };
48301 :
48302 :
48303 : static PyTypeObject lsa_LookupNames4_Type = {
48304 : PyVarObject_HEAD_INIT(NULL, 0)
48305 : .tp_name = "lsa.LookupNames4",
48306 : .tp_getset = py_lsa_LookupNames4_getsetters,
48307 : .tp_methods = py_lsa_LookupNames4_methods,
48308 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
48309 : .tp_new = py_lsa_LookupNames4_new,
48310 : };
48311 :
48312 7 : static bool pack_py_lsa_LookupNames4_args_in(PyObject *args, PyObject *kwargs, struct lsa_LookupNames4 *r)
48313 : {
48314 0 : PyObject *py_names;
48315 0 : PyObject *py_sids;
48316 0 : PyObject *py_level;
48317 0 : PyObject *py_count;
48318 0 : PyObject *py_lookup_options;
48319 0 : PyObject *py_client_revision;
48320 7 : const char *kwnames[] = {
48321 : "names", "sids", "level", "count", "lookup_options", "client_revision", NULL
48322 : };
48323 :
48324 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)) {
48325 0 : return false;
48326 : }
48327 :
48328 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
48329 7 : r->in.num_names = PyList_GET_SIZE(py_names);
48330 7 : if (py_names == NULL) {
48331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.names");
48332 0 : return false;
48333 : }
48334 7 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
48335 : {
48336 0 : int names_cntr_0;
48337 7 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
48338 7 : if (!r->in.names) { return false; }
48339 7 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
48340 15 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
48341 8 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
48342 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.names)[names_cntr_0]");
48343 0 : return false;
48344 : }
48345 8 : PY_CHECK_TYPE(&lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
48346 8 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
48347 0 : PyErr_NoMemory();
48348 0 : return false;
48349 : }
48350 8 : (r->in.names)[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
48351 : }
48352 : }
48353 7 : if (py_sids == NULL) {
48354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.sids");
48355 0 : return false;
48356 : }
48357 7 : r->in.sids = talloc_ptrtype(r, r->in.sids);
48358 7 : if (r->in.sids == NULL) {
48359 0 : PyErr_NoMemory();
48360 0 : return false;
48361 : }
48362 7 : PY_CHECK_TYPE(&lsa_TransSidArray3_Type, py_sids, return false;);
48363 7 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
48364 0 : PyErr_NoMemory();
48365 0 : return false;
48366 : }
48367 7 : r->in.sids = (struct lsa_TransSidArray3 *)pytalloc_get_ptr(py_sids);
48368 7 : if (py_level == NULL) {
48369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
48370 0 : return false;
48371 : }
48372 : {
48373 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
48374 7 : if (PyLong_Check(py_level)) {
48375 0 : unsigned long long test_var;
48376 7 : test_var = PyLong_AsUnsignedLongLong(py_level);
48377 7 : if (PyErr_Occurred() != NULL) {
48378 0 : return false;
48379 : }
48380 7 : if (test_var > uint_max) {
48381 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48382 : PyLong_Type.tp_name, uint_max, test_var);
48383 0 : return false;
48384 : }
48385 7 : r->in.level = test_var;
48386 : } else {
48387 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48388 : PyLong_Type.tp_name);
48389 0 : return false;
48390 : }
48391 : }
48392 7 : if (py_count == NULL) {
48393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.count");
48394 0 : return false;
48395 : }
48396 7 : r->in.count = talloc_ptrtype(r, r->in.count);
48397 7 : if (r->in.count == NULL) {
48398 0 : PyErr_NoMemory();
48399 0 : return false;
48400 : }
48401 : {
48402 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.count));
48403 7 : if (PyLong_Check(py_count)) {
48404 0 : unsigned long long test_var;
48405 7 : test_var = PyLong_AsUnsignedLongLong(py_count);
48406 7 : if (PyErr_Occurred() != NULL) {
48407 0 : return false;
48408 : }
48409 7 : if (test_var > uint_max) {
48410 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48411 : PyLong_Type.tp_name, uint_max, test_var);
48412 0 : return false;
48413 : }
48414 7 : *r->in.count = test_var;
48415 : } else {
48416 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48417 : PyLong_Type.tp_name);
48418 0 : return false;
48419 : }
48420 : }
48421 7 : if (py_lookup_options == NULL) {
48422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.lookup_options");
48423 0 : return false;
48424 : }
48425 : {
48426 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lookup_options));
48427 7 : if (PyLong_Check(py_lookup_options)) {
48428 0 : unsigned long long test_var;
48429 7 : test_var = PyLong_AsUnsignedLongLong(py_lookup_options);
48430 7 : if (PyErr_Occurred() != NULL) {
48431 0 : return false;
48432 : }
48433 7 : if (test_var > uint_max) {
48434 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48435 : PyLong_Type.tp_name, uint_max, test_var);
48436 0 : return false;
48437 : }
48438 7 : r->in.lookup_options = test_var;
48439 : } else {
48440 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48441 : PyLong_Type.tp_name);
48442 0 : return false;
48443 : }
48444 : }
48445 7 : if (py_client_revision == NULL) {
48446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_revision");
48447 0 : return false;
48448 : }
48449 : {
48450 7 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_revision));
48451 7 : if (PyLong_Check(py_client_revision)) {
48452 0 : unsigned long long test_var;
48453 7 : test_var = PyLong_AsUnsignedLongLong(py_client_revision);
48454 7 : if (PyErr_Occurred() != NULL) {
48455 0 : return false;
48456 : }
48457 7 : if (test_var > uint_max) {
48458 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48459 : PyLong_Type.tp_name, uint_max, test_var);
48460 0 : return false;
48461 : }
48462 7 : r->in.client_revision = test_var;
48463 : } else {
48464 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48465 : PyLong_Type.tp_name);
48466 0 : return false;
48467 : }
48468 : }
48469 7 : return true;
48470 : }
48471 :
48472 6 : static PyObject *unpack_py_lsa_LookupNames4_args_out(struct lsa_LookupNames4 *r)
48473 : {
48474 0 : PyObject *result;
48475 0 : PyObject *py_domains;
48476 0 : PyObject *py_sids;
48477 0 : PyObject *py_count;
48478 6 : result = PyTuple_New(3);
48479 6 : if (*r->out.domains == NULL) {
48480 0 : py_domains = Py_None;
48481 0 : Py_INCREF(py_domains);
48482 : } else {
48483 6 : py_domains = pytalloc_reference_ex(&lsa_RefDomainList_Type, *r->out.domains, *r->out.domains);
48484 : }
48485 6 : PyTuple_SetItem(result, 0, py_domains);
48486 6 : py_sids = pytalloc_reference_ex(&lsa_TransSidArray3_Type, r->out.sids, r->out.sids);
48487 6 : PyTuple_SetItem(result, 1, py_sids);
48488 6 : py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
48489 6 : PyTuple_SetItem(result, 2, py_count);
48490 6 : if (NT_STATUS_IS_ERR(r->out.result)) {
48491 0 : PyErr_SetNTSTATUS(r->out.result);
48492 0 : return NULL;
48493 : }
48494 :
48495 6 : return result;
48496 : }
48497 :
48498 :
48499 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_in_get_policy_handle(PyObject *obj, void *closure)
48500 : {
48501 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48502 0 : PyObject *py_policy_handle;
48503 0 : if (object->in.policy_handle == NULL) {
48504 0 : Py_RETURN_NONE;
48505 : }
48506 0 : py_policy_handle = pytalloc_reference_ex(policy_handle_Type, object->in.policy_handle, object->in.policy_handle);
48507 0 : return py_policy_handle;
48508 : }
48509 :
48510 0 : static int py_lsa_CreateTrustedDomainEx3_in_set_policy_handle(PyObject *py_obj, PyObject *value, void *closure)
48511 : {
48512 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48513 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.policy_handle));
48514 0 : if (value == NULL) {
48515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.policy_handle");
48516 0 : return -1;
48517 : }
48518 0 : object->in.policy_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.policy_handle);
48519 0 : if (object->in.policy_handle == NULL) {
48520 0 : PyErr_NoMemory();
48521 0 : return -1;
48522 : }
48523 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
48524 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48525 0 : PyErr_NoMemory();
48526 0 : return -1;
48527 : }
48528 0 : object->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(value);
48529 0 : return 0;
48530 : }
48531 :
48532 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_in_get_info(PyObject *obj, void *closure)
48533 : {
48534 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48535 0 : PyObject *py_info;
48536 0 : if (object->in.info == NULL) {
48537 0 : Py_RETURN_NONE;
48538 : }
48539 0 : py_info = pytalloc_reference_ex(&lsa_TrustDomainInfoInfoEx_Type, object->in.info, object->in.info);
48540 0 : return py_info;
48541 : }
48542 :
48543 0 : static int py_lsa_CreateTrustedDomainEx3_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
48544 : {
48545 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48546 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
48547 0 : if (value == NULL) {
48548 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
48549 0 : return -1;
48550 : }
48551 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
48552 0 : if (object->in.info == NULL) {
48553 0 : PyErr_NoMemory();
48554 0 : return -1;
48555 : }
48556 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, value, return -1;);
48557 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48558 0 : PyErr_NoMemory();
48559 0 : return -1;
48560 : }
48561 0 : object->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(value);
48562 0 : return 0;
48563 : }
48564 :
48565 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_in_get_auth_info_internal(PyObject *obj, void *closure)
48566 : {
48567 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48568 0 : PyObject *py_auth_info_internal;
48569 0 : if (object->in.auth_info_internal == NULL) {
48570 0 : Py_RETURN_NONE;
48571 : }
48572 0 : py_auth_info_internal = pytalloc_reference_ex(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, object->in.auth_info_internal, object->in.auth_info_internal);
48573 0 : return py_auth_info_internal;
48574 : }
48575 :
48576 0 : static int py_lsa_CreateTrustedDomainEx3_in_set_auth_info_internal(PyObject *py_obj, PyObject *value, void *closure)
48577 : {
48578 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48579 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.auth_info_internal));
48580 0 : if (value == NULL) {
48581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.auth_info_internal");
48582 0 : return -1;
48583 : }
48584 0 : object->in.auth_info_internal = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.auth_info_internal);
48585 0 : if (object->in.auth_info_internal == NULL) {
48586 0 : PyErr_NoMemory();
48587 0 : return -1;
48588 : }
48589 0 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, value, return -1;);
48590 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48591 0 : PyErr_NoMemory();
48592 0 : return -1;
48593 : }
48594 0 : object->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternalAES *)pytalloc_get_ptr(value);
48595 0 : return 0;
48596 : }
48597 :
48598 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_in_get_access_mask(PyObject *obj, void *closure)
48599 : {
48600 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48601 0 : PyObject *py_access_mask;
48602 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
48603 0 : return py_access_mask;
48604 : }
48605 :
48606 0 : static int py_lsa_CreateTrustedDomainEx3_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
48607 : {
48608 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48609 0 : if (value == NULL) {
48610 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
48611 0 : return -1;
48612 : }
48613 : {
48614 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
48615 0 : if (PyLong_Check(value)) {
48616 0 : unsigned long long test_var;
48617 0 : test_var = PyLong_AsUnsignedLongLong(value);
48618 0 : if (PyErr_Occurred() != NULL) {
48619 0 : return -1;
48620 : }
48621 0 : if (test_var > uint_max) {
48622 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48623 : PyLong_Type.tp_name, uint_max, test_var);
48624 0 : return -1;
48625 : }
48626 0 : object->in.access_mask = test_var;
48627 : } else {
48628 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48629 : PyLong_Type.tp_name);
48630 0 : return -1;
48631 : }
48632 : }
48633 0 : return 0;
48634 : }
48635 :
48636 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_out_get_trustdom_handle(PyObject *obj, void *closure)
48637 : {
48638 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48639 0 : PyObject *py_trustdom_handle;
48640 0 : if (object->out.trustdom_handle == NULL) {
48641 0 : Py_RETURN_NONE;
48642 : }
48643 0 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, object->out.trustdom_handle, object->out.trustdom_handle);
48644 0 : return py_trustdom_handle;
48645 : }
48646 :
48647 0 : static int py_lsa_CreateTrustedDomainEx3_out_set_trustdom_handle(PyObject *py_obj, PyObject *value, void *closure)
48648 : {
48649 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48650 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.trustdom_handle));
48651 0 : if (value == NULL) {
48652 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.trustdom_handle");
48653 0 : return -1;
48654 : }
48655 0 : object->out.trustdom_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.trustdom_handle);
48656 0 : if (object->out.trustdom_handle == NULL) {
48657 0 : PyErr_NoMemory();
48658 0 : return -1;
48659 : }
48660 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
48661 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48662 0 : PyErr_NoMemory();
48663 0 : return -1;
48664 : }
48665 0 : object->out.trustdom_handle = (struct policy_handle *)pytalloc_get_ptr(value);
48666 0 : return 0;
48667 : }
48668 :
48669 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_get_result(PyObject *obj, void *closure)
48670 : {
48671 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(obj);
48672 0 : PyObject *py_result;
48673 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
48674 0 : return py_result;
48675 : }
48676 :
48677 0 : static int py_lsa_CreateTrustedDomainEx3_set_result(PyObject *py_obj, PyObject *value, void *closure)
48678 : {
48679 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48680 0 : if (value == NULL) {
48681 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
48682 0 : return -1;
48683 : }
48684 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
48685 0 : return 0;
48686 : }
48687 :
48688 : static PyGetSetDef py_lsa_CreateTrustedDomainEx3_getsetters[] = {
48689 : {
48690 : .name = discard_const_p(char, "in_policy_handle"),
48691 : .get = py_lsa_CreateTrustedDomainEx3_in_get_policy_handle,
48692 : .set = py_lsa_CreateTrustedDomainEx3_in_set_policy_handle,
48693 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
48694 : },
48695 : {
48696 : .name = discard_const_p(char, "in_info"),
48697 : .get = py_lsa_CreateTrustedDomainEx3_in_get_info,
48698 : .set = py_lsa_CreateTrustedDomainEx3_in_set_info,
48699 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoInfoEx")
48700 : },
48701 : {
48702 : .name = discard_const_p(char, "in_auth_info_internal"),
48703 : .get = py_lsa_CreateTrustedDomainEx3_in_get_auth_info_internal,
48704 : .set = py_lsa_CreateTrustedDomainEx3_in_set_auth_info_internal,
48705 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustDomainInfoAuthInfoInternalAES")
48706 : },
48707 : {
48708 : .name = discard_const_p(char, "in_access_mask"),
48709 : .get = py_lsa_CreateTrustedDomainEx3_in_get_access_mask,
48710 : .set = py_lsa_CreateTrustedDomainEx3_in_set_access_mask,
48711 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_TrustedAccessMask")
48712 : },
48713 : {
48714 : .name = discard_const_p(char, "out_trustdom_handle"),
48715 : .get = py_lsa_CreateTrustedDomainEx3_out_get_trustdom_handle,
48716 : .set = py_lsa_CreateTrustedDomainEx3_out_set_trustdom_handle,
48717 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
48718 : },
48719 : {
48720 : .name = discard_const_p(char, "result"),
48721 : .get = py_lsa_CreateTrustedDomainEx3_get_result,
48722 : .set = py_lsa_CreateTrustedDomainEx3_set_result,
48723 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
48724 : },
48725 : { .name = NULL }
48726 : };
48727 :
48728 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
48729 : {
48730 0 : PyObject *self = pytalloc_new(struct lsa_CreateTrustedDomainEx3, type);
48731 0 : struct lsa_CreateTrustedDomainEx3 *_self = (struct lsa_CreateTrustedDomainEx3 *)pytalloc_get_ptr(self);
48732 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
48733 0 : _self->in.policy_handle = talloc_zero(mem_ctx, struct policy_handle);
48734 0 : _self->in.info = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoInfoEx);
48735 0 : _self->in.auth_info_internal = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfoInternalAES);
48736 0 : _self->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
48737 0 : return self;
48738 : }
48739 :
48740 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
48741 : {
48742 :
48743 :
48744 0 : return PyLong_FromLong(129);
48745 : }
48746 :
48747 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
48748 : {
48749 0 : const struct ndr_interface_call *call = NULL;
48750 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48751 0 : PyObject *ret = NULL;
48752 0 : struct ndr_push *push = NULL;
48753 0 : DATA_BLOB blob;
48754 0 : enum ndr_err_code err;
48755 :
48756 0 : if (ndr_table_lsarpc.num_calls < 130) {
48757 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx3_ndr_pack");
48758 0 : return NULL;
48759 : }
48760 0 : call = &ndr_table_lsarpc.calls[129];
48761 :
48762 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
48763 0 : if (push == NULL) {
48764 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48765 0 : return NULL;
48766 : }
48767 :
48768 0 : push->flags |= ndr_push_flags;
48769 :
48770 0 : err = call->ndr_push(push, ndr_inout_flags, object);
48771 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48772 0 : TALLOC_FREE(push);
48773 0 : PyErr_SetNdrError(err);
48774 0 : return NULL;
48775 : }
48776 0 : blob = ndr_push_blob(push);
48777 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
48778 0 : TALLOC_FREE(push);
48779 0 : return ret;
48780 : }
48781 :
48782 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48783 : {
48784 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48785 0 : PyObject *bigendian_obj = NULL;
48786 0 : PyObject *ndr64_obj = NULL;
48787 0 : libndr_flags ndr_push_flags = 0;
48788 :
48789 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
48790 : discard_const_p(char *, kwnames),
48791 : &bigendian_obj,
48792 : &ndr64_obj)) {
48793 0 : return NULL;
48794 : }
48795 :
48796 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48797 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48798 : }
48799 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48800 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48801 : }
48802 :
48803 0 : return py_lsa_CreateTrustedDomainEx3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
48804 : }
48805 :
48806 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48807 : {
48808 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48809 0 : PyObject *bigendian_obj = NULL;
48810 0 : PyObject *ndr64_obj = NULL;
48811 0 : libndr_flags ndr_push_flags = 0;
48812 :
48813 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
48814 : discard_const_p(char *, kwnames),
48815 : &bigendian_obj,
48816 : &ndr64_obj)) {
48817 0 : return NULL;
48818 : }
48819 :
48820 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48821 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48822 : }
48823 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48824 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48825 : }
48826 :
48827 0 : return py_lsa_CreateTrustedDomainEx3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
48828 : }
48829 :
48830 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
48831 : {
48832 0 : const struct ndr_interface_call *call = NULL;
48833 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48834 0 : struct ndr_pull *pull = NULL;
48835 0 : enum ndr_err_code err;
48836 :
48837 0 : if (ndr_table_lsarpc.num_calls < 130) {
48838 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx3_ndr_unpack");
48839 0 : return NULL;
48840 : }
48841 0 : call = &ndr_table_lsarpc.calls[129];
48842 :
48843 0 : pull = ndr_pull_init_blob(blob, object);
48844 0 : if (pull == NULL) {
48845 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48846 0 : return NULL;
48847 : }
48848 :
48849 0 : pull->flags |= ndr_pull_flags;
48850 :
48851 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
48852 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48853 0 : TALLOC_FREE(pull);
48854 0 : PyErr_SetNdrError(err);
48855 0 : return NULL;
48856 : }
48857 0 : if (!allow_remaining) {
48858 0 : uint32_t highest_ofs;
48859 :
48860 0 : if (pull->offset > pull->relative_highest_offset) {
48861 0 : highest_ofs = pull->offset;
48862 : } else {
48863 0 : highest_ofs = pull->relative_highest_offset;
48864 : }
48865 0 : if (highest_ofs < pull->data_size) {
48866 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
48867 : "not all bytes consumed ofs[%u] size[%u]",
48868 : highest_ofs, pull->data_size);
48869 0 : TALLOC_FREE(pull);
48870 0 : PyErr_SetNdrError(err);
48871 0 : return NULL;
48872 : }
48873 : }
48874 :
48875 0 : TALLOC_FREE(pull);
48876 0 : Py_RETURN_NONE;
48877 : }
48878 :
48879 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48880 : {
48881 0 : DATA_BLOB blob;
48882 0 : Py_ssize_t blob_length = 0;
48883 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48884 0 : PyObject *bigendian_obj = NULL;
48885 0 : PyObject *ndr64_obj = NULL;
48886 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48887 0 : PyObject *allow_remaining_obj = NULL;
48888 0 : bool allow_remaining = false;
48889 :
48890 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
48891 : discard_const_p(char *, kwnames),
48892 : &blob.data, &blob_length,
48893 : &bigendian_obj,
48894 : &ndr64_obj,
48895 : &allow_remaining_obj)) {
48896 0 : return NULL;
48897 : }
48898 0 : blob.length = blob_length;
48899 :
48900 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48901 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48902 : }
48903 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48904 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48905 : }
48906 :
48907 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48908 0 : allow_remaining = true;
48909 : }
48910 :
48911 0 : return py_lsa_CreateTrustedDomainEx3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
48912 : }
48913 :
48914 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48915 : {
48916 0 : DATA_BLOB blob;
48917 0 : Py_ssize_t blob_length = 0;
48918 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48919 0 : PyObject *bigendian_obj = NULL;
48920 0 : PyObject *ndr64_obj = NULL;
48921 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48922 0 : PyObject *allow_remaining_obj = NULL;
48923 0 : bool allow_remaining = false;
48924 :
48925 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
48926 : discard_const_p(char *, kwnames),
48927 : &blob.data, &blob_length,
48928 : &bigendian_obj,
48929 : &ndr64_obj,
48930 : &allow_remaining_obj)) {
48931 0 : return NULL;
48932 : }
48933 0 : blob.length = blob_length;
48934 :
48935 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48936 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48937 : }
48938 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48939 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48940 : }
48941 :
48942 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48943 0 : allow_remaining = true;
48944 : }
48945 :
48946 0 : return py_lsa_CreateTrustedDomainEx3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
48947 : }
48948 :
48949 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
48950 : {
48951 0 : const struct ndr_interface_call *call = NULL;
48952 0 : struct lsa_CreateTrustedDomainEx3 *object = pytalloc_get_ptr(py_obj);
48953 0 : PyObject *ret;
48954 0 : char *retstr;
48955 :
48956 0 : if (ndr_table_lsarpc.num_calls < 130) {
48957 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_CreateTrustedDomainEx3_ndr_print");
48958 0 : return NULL;
48959 : }
48960 0 : call = &ndr_table_lsarpc.calls[129];
48961 :
48962 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
48963 0 : ret = PyUnicode_FromString(retstr);
48964 0 : TALLOC_FREE(retstr);
48965 :
48966 0 : return ret;
48967 : }
48968 :
48969 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48970 : {
48971 0 : return py_lsa_CreateTrustedDomainEx3_ndr_print(py_obj, "lsa_CreateTrustedDomainEx3_in", NDR_IN);
48972 : }
48973 :
48974 0 : static PyObject *py_lsa_CreateTrustedDomainEx3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48975 : {
48976 0 : return py_lsa_CreateTrustedDomainEx3_ndr_print(py_obj, "lsa_CreateTrustedDomainEx3_out", NDR_OUT);
48977 : }
48978 :
48979 : static PyMethodDef py_lsa_CreateTrustedDomainEx3_methods[] = {
48980 : { "opnum", (PyCFunction)py_lsa_CreateTrustedDomainEx3_ndr_opnum, METH_NOARGS|METH_CLASS,
48981 : "lsa.CreateTrustedDomainEx3.opnum() -> 129 (0x81) " },
48982 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
48983 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
48984 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
48985 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
48986 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
48987 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
48988 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_CreateTrustedDomainEx3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
48989 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
48990 : { "__ndr_print_in__", (PyCFunction)py_lsa_CreateTrustedDomainEx3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
48991 : { "__ndr_print_out__", (PyCFunction)py_lsa_CreateTrustedDomainEx3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
48992 : { NULL, NULL, 0, NULL }
48993 : };
48994 :
48995 :
48996 : static PyTypeObject lsa_CreateTrustedDomainEx3_Type = {
48997 : PyVarObject_HEAD_INIT(NULL, 0)
48998 : .tp_name = "lsa.CreateTrustedDomainEx3",
48999 : .tp_getset = py_lsa_CreateTrustedDomainEx3_getsetters,
49000 : .tp_methods = py_lsa_CreateTrustedDomainEx3_methods,
49001 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
49002 : .tp_new = py_lsa_CreateTrustedDomainEx3_new,
49003 : };
49004 :
49005 23 : static bool pack_py_lsa_CreateTrustedDomainEx3_args_in(PyObject *args, PyObject *kwargs, struct lsa_CreateTrustedDomainEx3 *r)
49006 : {
49007 0 : PyObject *py_policy_handle;
49008 0 : PyObject *py_info;
49009 0 : PyObject *py_auth_info_internal;
49010 0 : PyObject *py_access_mask;
49011 23 : const char *kwnames[] = {
49012 : "policy_handle", "info", "auth_info_internal", "access_mask", NULL
49013 : };
49014 :
49015 23 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:lsa_CreateTrustedDomainEx3", discard_const_p(char *, kwnames), &py_policy_handle, &py_info, &py_auth_info_internal, &py_access_mask)) {
49016 0 : return false;
49017 : }
49018 :
49019 23 : if (py_policy_handle == NULL) {
49020 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.policy_handle");
49021 0 : return false;
49022 : }
49023 23 : r->in.policy_handle = talloc_ptrtype(r, r->in.policy_handle);
49024 23 : if (r->in.policy_handle == NULL) {
49025 0 : PyErr_NoMemory();
49026 0 : return false;
49027 : }
49028 23 : PY_CHECK_TYPE(policy_handle_Type, py_policy_handle, return false;);
49029 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_policy_handle)) == NULL) {
49030 0 : PyErr_NoMemory();
49031 0 : return false;
49032 : }
49033 23 : r->in.policy_handle = (struct policy_handle *)pytalloc_get_ptr(py_policy_handle);
49034 23 : if (py_info == NULL) {
49035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
49036 0 : return false;
49037 : }
49038 23 : r->in.info = talloc_ptrtype(r, r->in.info);
49039 23 : if (r->in.info == NULL) {
49040 0 : PyErr_NoMemory();
49041 0 : return false;
49042 : }
49043 23 : PY_CHECK_TYPE(&lsa_TrustDomainInfoInfoEx_Type, py_info, return false;);
49044 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_info)) == NULL) {
49045 0 : PyErr_NoMemory();
49046 0 : return false;
49047 : }
49048 23 : r->in.info = (struct lsa_TrustDomainInfoInfoEx *)pytalloc_get_ptr(py_info);
49049 23 : if (py_auth_info_internal == NULL) {
49050 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.auth_info_internal");
49051 0 : return false;
49052 : }
49053 23 : r->in.auth_info_internal = talloc_ptrtype(r, r->in.auth_info_internal);
49054 23 : if (r->in.auth_info_internal == NULL) {
49055 0 : PyErr_NoMemory();
49056 0 : return false;
49057 : }
49058 23 : PY_CHECK_TYPE(&lsa_TrustDomainInfoAuthInfoInternalAES_Type, py_auth_info_internal, return false;);
49059 23 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_auth_info_internal)) == NULL) {
49060 0 : PyErr_NoMemory();
49061 0 : return false;
49062 : }
49063 23 : r->in.auth_info_internal = (struct lsa_TrustDomainInfoAuthInfoInternalAES *)pytalloc_get_ptr(py_auth_info_internal);
49064 23 : if (py_access_mask == NULL) {
49065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
49066 0 : return false;
49067 : }
49068 : {
49069 23 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
49070 23 : if (PyLong_Check(py_access_mask)) {
49071 0 : unsigned long long test_var;
49072 23 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
49073 23 : if (PyErr_Occurred() != NULL) {
49074 0 : return false;
49075 : }
49076 23 : if (test_var > uint_max) {
49077 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49078 : PyLong_Type.tp_name, uint_max, test_var);
49079 0 : return false;
49080 : }
49081 23 : r->in.access_mask = test_var;
49082 : } else {
49083 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49084 : PyLong_Type.tp_name);
49085 0 : return false;
49086 : }
49087 : }
49088 23 : return true;
49089 : }
49090 :
49091 23 : static PyObject *unpack_py_lsa_CreateTrustedDomainEx3_args_out(struct lsa_CreateTrustedDomainEx3 *r)
49092 : {
49093 0 : PyObject *result;
49094 0 : PyObject *py_trustdom_handle;
49095 23 : py_trustdom_handle = pytalloc_reference_ex(policy_handle_Type, r->out.trustdom_handle, r->out.trustdom_handle);
49096 23 : result = py_trustdom_handle;
49097 23 : if (NT_STATUS_IS_ERR(r->out.result)) {
49098 0 : PyErr_SetNTSTATUS(r->out.result);
49099 0 : return NULL;
49100 : }
49101 :
49102 23 : return result;
49103 : }
49104 :
49105 :
49106 0 : static PyObject *py_lsa_OpenPolicy3_in_get_system_name(PyObject *obj, void *closure)
49107 : {
49108 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49109 0 : PyObject *py_system_name;
49110 0 : if (object->in.system_name == NULL) {
49111 0 : Py_RETURN_NONE;
49112 : }
49113 0 : if (object->in.system_name == NULL) {
49114 0 : py_system_name = Py_None;
49115 0 : Py_INCREF(py_system_name);
49116 : } else {
49117 0 : if (object->in.system_name == NULL) {
49118 0 : py_system_name = Py_None;
49119 0 : Py_INCREF(py_system_name);
49120 : } else {
49121 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
49122 : }
49123 : }
49124 0 : return py_system_name;
49125 : }
49126 :
49127 0 : static int py_lsa_OpenPolicy3_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
49128 : {
49129 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49130 0 : if (value == NULL) {
49131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.system_name");
49132 0 : return -1;
49133 : }
49134 0 : if (value == Py_None) {
49135 0 : object->in.system_name = NULL;
49136 : } else {
49137 0 : object->in.system_name = NULL;
49138 : {
49139 0 : const char *test_str;
49140 0 : const char *talloc_str;
49141 0 : PyObject *unicode = NULL;
49142 0 : if (PyUnicode_Check(value)) {
49143 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
49144 0 : if (unicode == NULL) {
49145 0 : return -1;
49146 : }
49147 0 : test_str = PyBytes_AS_STRING(unicode);
49148 0 : } else if (PyBytes_Check(value)) {
49149 0 : test_str = PyBytes_AS_STRING(value);
49150 : } else {
49151 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
49152 0 : return -1;
49153 : }
49154 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
49155 0 : if (unicode != NULL) {
49156 0 : Py_DECREF(unicode);
49157 : }
49158 0 : if (talloc_str == NULL) {
49159 0 : PyErr_NoMemory();
49160 0 : return -1;
49161 : }
49162 0 : object->in.system_name = talloc_str;
49163 : }
49164 : }
49165 0 : return 0;
49166 : }
49167 :
49168 0 : static PyObject *py_lsa_OpenPolicy3_in_get_attr(PyObject *obj, void *closure)
49169 : {
49170 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49171 0 : PyObject *py_attr;
49172 0 : if (object->in.attr == NULL) {
49173 0 : Py_RETURN_NONE;
49174 : }
49175 0 : py_attr = pytalloc_reference_ex(&lsa_ObjectAttribute_Type, object->in.attr, object->in.attr);
49176 0 : return py_attr;
49177 : }
49178 :
49179 0 : static int py_lsa_OpenPolicy3_in_set_attr(PyObject *py_obj, PyObject *value, void *closure)
49180 : {
49181 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49182 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.attr));
49183 0 : if (value == NULL) {
49184 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.attr");
49185 0 : return -1;
49186 : }
49187 0 : object->in.attr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.attr);
49188 0 : if (object->in.attr == NULL) {
49189 0 : PyErr_NoMemory();
49190 0 : return -1;
49191 : }
49192 0 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, value, return -1;);
49193 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49194 0 : PyErr_NoMemory();
49195 0 : return -1;
49196 : }
49197 0 : object->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(value);
49198 0 : return 0;
49199 : }
49200 :
49201 0 : static PyObject *py_lsa_OpenPolicy3_in_get_access_mask(PyObject *obj, void *closure)
49202 : {
49203 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49204 0 : PyObject *py_access_mask;
49205 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
49206 0 : return py_access_mask;
49207 : }
49208 :
49209 0 : static int py_lsa_OpenPolicy3_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
49210 : {
49211 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49212 0 : if (value == NULL) {
49213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
49214 0 : return -1;
49215 : }
49216 : {
49217 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
49218 0 : if (PyLong_Check(value)) {
49219 0 : unsigned long long test_var;
49220 0 : test_var = PyLong_AsUnsignedLongLong(value);
49221 0 : if (PyErr_Occurred() != NULL) {
49222 0 : return -1;
49223 : }
49224 0 : if (test_var > uint_max) {
49225 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49226 : PyLong_Type.tp_name, uint_max, test_var);
49227 0 : return -1;
49228 : }
49229 0 : object->in.access_mask = test_var;
49230 : } else {
49231 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49232 : PyLong_Type.tp_name);
49233 0 : return -1;
49234 : }
49235 : }
49236 0 : return 0;
49237 : }
49238 :
49239 0 : static PyObject *py_lsa_OpenPolicy3_in_get_in_version(PyObject *obj, void *closure)
49240 : {
49241 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49242 0 : PyObject *py_in_version;
49243 0 : py_in_version = PyLong_FromUnsignedLongLong((uint32_t)(object->in.in_version));
49244 0 : return py_in_version;
49245 : }
49246 :
49247 0 : static int py_lsa_OpenPolicy3_in_set_in_version(PyObject *py_obj, PyObject *value, void *closure)
49248 : {
49249 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49250 0 : if (value == NULL) {
49251 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.in_version");
49252 0 : return -1;
49253 : }
49254 : {
49255 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.in_version));
49256 0 : if (PyLong_Check(value)) {
49257 0 : unsigned long long test_var;
49258 0 : test_var = PyLong_AsUnsignedLongLong(value);
49259 0 : if (PyErr_Occurred() != NULL) {
49260 0 : return -1;
49261 : }
49262 0 : if (test_var > uint_max) {
49263 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49264 : PyLong_Type.tp_name, uint_max, test_var);
49265 0 : return -1;
49266 : }
49267 0 : object->in.in_version = test_var;
49268 : } else {
49269 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49270 : PyLong_Type.tp_name);
49271 0 : return -1;
49272 : }
49273 : }
49274 0 : return 0;
49275 : }
49276 :
49277 0 : static PyObject *py_lsa_OpenPolicy3_in_get_in_revision_info(PyObject *obj, void *closure)
49278 : {
49279 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49280 0 : PyObject *py_in_revision_info;
49281 0 : if (object->in.in_revision_info == NULL) {
49282 0 : Py_RETURN_NONE;
49283 : }
49284 0 : py_in_revision_info = pyrpc_import_union(&lsa_revision_info_Type, object->in.in_revision_info, object->in.in_version, object->in.in_revision_info, "union lsa_revision_info");
49285 0 : if (py_in_revision_info == NULL) {
49286 0 : return NULL;
49287 : }
49288 0 : return py_in_revision_info;
49289 : }
49290 :
49291 0 : static int py_lsa_OpenPolicy3_in_set_in_revision_info(PyObject *py_obj, PyObject *value, void *closure)
49292 : {
49293 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49294 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.in_revision_info));
49295 0 : if (value == NULL) {
49296 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.in_revision_info");
49297 0 : return -1;
49298 : }
49299 0 : object->in.in_revision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.in_revision_info);
49300 0 : if (object->in.in_revision_info == NULL) {
49301 0 : PyErr_NoMemory();
49302 0 : return -1;
49303 : }
49304 : {
49305 0 : union lsa_revision_info *in_revision_info_switch_1;
49306 0 : in_revision_info_switch_1 = (union lsa_revision_info *)pyrpc_export_union(&lsa_revision_info_Type, pytalloc_get_mem_ctx(py_obj), object->in.in_version, value, "union lsa_revision_info");
49307 0 : if (in_revision_info_switch_1 == NULL) {
49308 0 : return -1;
49309 : }
49310 0 : object->in.in_revision_info = in_revision_info_switch_1;
49311 : }
49312 0 : return 0;
49313 : }
49314 :
49315 0 : static PyObject *py_lsa_OpenPolicy3_out_get_out_version(PyObject *obj, void *closure)
49316 : {
49317 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49318 0 : PyObject *py_out_version;
49319 0 : if (object->out.out_version == NULL) {
49320 0 : Py_RETURN_NONE;
49321 : }
49322 0 : py_out_version = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.out_version));
49323 0 : return py_out_version;
49324 : }
49325 :
49326 0 : static int py_lsa_OpenPolicy3_out_set_out_version(PyObject *py_obj, PyObject *value, void *closure)
49327 : {
49328 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49329 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_version));
49330 0 : if (value == NULL) {
49331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.out_version");
49332 0 : return -1;
49333 : }
49334 0 : object->out.out_version = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_version);
49335 0 : if (object->out.out_version == NULL) {
49336 0 : PyErr_NoMemory();
49337 0 : return -1;
49338 : }
49339 : {
49340 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.out_version));
49341 0 : if (PyLong_Check(value)) {
49342 0 : unsigned long long test_var;
49343 0 : test_var = PyLong_AsUnsignedLongLong(value);
49344 0 : if (PyErr_Occurred() != NULL) {
49345 0 : return -1;
49346 : }
49347 0 : if (test_var > uint_max) {
49348 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49349 : PyLong_Type.tp_name, uint_max, test_var);
49350 0 : return -1;
49351 : }
49352 0 : *object->out.out_version = test_var;
49353 : } else {
49354 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49355 : PyLong_Type.tp_name);
49356 0 : return -1;
49357 : }
49358 : }
49359 0 : return 0;
49360 : }
49361 :
49362 0 : static PyObject *py_lsa_OpenPolicy3_out_get_out_revision_info(PyObject *obj, void *closure)
49363 : {
49364 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49365 0 : PyObject *py_out_revision_info;
49366 0 : if (object->out.out_revision_info == NULL) {
49367 0 : Py_RETURN_NONE;
49368 : }
49369 0 : py_out_revision_info = pyrpc_import_union(&lsa_revision_info_Type, object->out.out_revision_info, *object->out.out_version, object->out.out_revision_info, "union lsa_revision_info");
49370 0 : if (py_out_revision_info == NULL) {
49371 0 : return NULL;
49372 : }
49373 0 : return py_out_revision_info;
49374 : }
49375 :
49376 0 : static int py_lsa_OpenPolicy3_out_set_out_revision_info(PyObject *py_obj, PyObject *value, void *closure)
49377 : {
49378 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49379 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_revision_info));
49380 0 : if (value == NULL) {
49381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.out_revision_info");
49382 0 : return -1;
49383 : }
49384 0 : object->out.out_revision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_revision_info);
49385 0 : if (object->out.out_revision_info == NULL) {
49386 0 : PyErr_NoMemory();
49387 0 : return -1;
49388 : }
49389 : {
49390 0 : union lsa_revision_info *out_revision_info_switch_1;
49391 0 : out_revision_info_switch_1 = (union lsa_revision_info *)pyrpc_export_union(&lsa_revision_info_Type, pytalloc_get_mem_ctx(py_obj), *object->out.out_version, value, "union lsa_revision_info");
49392 0 : if (out_revision_info_switch_1 == NULL) {
49393 0 : return -1;
49394 : }
49395 0 : object->out.out_revision_info = out_revision_info_switch_1;
49396 : }
49397 0 : return 0;
49398 : }
49399 :
49400 0 : static PyObject *py_lsa_OpenPolicy3_out_get_handle(PyObject *obj, void *closure)
49401 : {
49402 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49403 0 : PyObject *py_handle;
49404 0 : if (object->out.handle == NULL) {
49405 0 : Py_RETURN_NONE;
49406 : }
49407 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
49408 0 : return py_handle;
49409 : }
49410 :
49411 0 : static int py_lsa_OpenPolicy3_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
49412 : {
49413 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49414 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
49415 0 : if (value == NULL) {
49416 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
49417 0 : return -1;
49418 : }
49419 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
49420 0 : if (object->out.handle == NULL) {
49421 0 : PyErr_NoMemory();
49422 0 : return -1;
49423 : }
49424 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
49425 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49426 0 : PyErr_NoMemory();
49427 0 : return -1;
49428 : }
49429 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
49430 0 : return 0;
49431 : }
49432 :
49433 0 : static PyObject *py_lsa_OpenPolicy3_get_result(PyObject *obj, void *closure)
49434 : {
49435 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(obj);
49436 0 : PyObject *py_result;
49437 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
49438 0 : return py_result;
49439 : }
49440 :
49441 0 : static int py_lsa_OpenPolicy3_set_result(PyObject *py_obj, PyObject *value, void *closure)
49442 : {
49443 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49444 0 : if (value == NULL) {
49445 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
49446 0 : return -1;
49447 : }
49448 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
49449 0 : return 0;
49450 : }
49451 :
49452 : static PyGetSetDef py_lsa_OpenPolicy3_getsetters[] = {
49453 : {
49454 : .name = discard_const_p(char, "in_system_name"),
49455 : .get = py_lsa_OpenPolicy3_in_get_system_name,
49456 : .set = py_lsa_OpenPolicy3_in_set_system_name,
49457 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
49458 : },
49459 : {
49460 : .name = discard_const_p(char, "in_attr"),
49461 : .get = py_lsa_OpenPolicy3_in_get_attr,
49462 : .set = py_lsa_OpenPolicy3_in_set_attr,
49463 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ObjectAttribute")
49464 : },
49465 : {
49466 : .name = discard_const_p(char, "in_access_mask"),
49467 : .get = py_lsa_OpenPolicy3_in_get_access_mask,
49468 : .set = py_lsa_OpenPolicy3_in_set_access_mask,
49469 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_PolicyAccessMask")
49470 : },
49471 : {
49472 : .name = discard_const_p(char, "in_in_version"),
49473 : .get = py_lsa_OpenPolicy3_in_get_in_version,
49474 : .set = py_lsa_OpenPolicy3_in_set_in_version,
49475 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
49476 : },
49477 : {
49478 : .name = discard_const_p(char, "in_in_revision_info"),
49479 : .get = py_lsa_OpenPolicy3_in_get_in_revision_info,
49480 : .set = py_lsa_OpenPolicy3_in_set_in_revision_info,
49481 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_revision_info")
49482 : },
49483 : {
49484 : .name = discard_const_p(char, "out_out_version"),
49485 : .get = py_lsa_OpenPolicy3_out_get_out_version,
49486 : .set = py_lsa_OpenPolicy3_out_set_out_version,
49487 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
49488 : },
49489 : {
49490 : .name = discard_const_p(char, "out_out_revision_info"),
49491 : .get = py_lsa_OpenPolicy3_out_get_out_revision_info,
49492 : .set = py_lsa_OpenPolicy3_out_set_out_revision_info,
49493 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_revision_info")
49494 : },
49495 : {
49496 : .name = discard_const_p(char, "out_handle"),
49497 : .get = py_lsa_OpenPolicy3_out_get_handle,
49498 : .set = py_lsa_OpenPolicy3_out_set_handle,
49499 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
49500 : },
49501 : {
49502 : .name = discard_const_p(char, "result"),
49503 : .get = py_lsa_OpenPolicy3_get_result,
49504 : .set = py_lsa_OpenPolicy3_set_result,
49505 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
49506 : },
49507 : { .name = NULL }
49508 : };
49509 :
49510 0 : static PyObject *py_lsa_OpenPolicy3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
49511 : {
49512 0 : PyObject *self = pytalloc_new(struct lsa_OpenPolicy3, type);
49513 0 : struct lsa_OpenPolicy3 *_self = (struct lsa_OpenPolicy3 *)pytalloc_get_ptr(self);
49514 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
49515 0 : _self->in.attr = talloc_zero(mem_ctx, struct lsa_ObjectAttribute);
49516 0 : _self->in.in_revision_info = talloc_zero(mem_ctx, union lsa_revision_info);
49517 0 : _self->out.out_version = talloc_zero(mem_ctx, uint32_t);
49518 0 : _self->out.out_revision_info = talloc_zero(mem_ctx, union lsa_revision_info);
49519 0 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
49520 0 : return self;
49521 : }
49522 :
49523 0 : static PyObject *py_lsa_OpenPolicy3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
49524 : {
49525 :
49526 :
49527 0 : return PyLong_FromLong(130);
49528 : }
49529 :
49530 0 : static PyObject *py_lsa_OpenPolicy3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
49531 : {
49532 0 : const struct ndr_interface_call *call = NULL;
49533 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49534 0 : PyObject *ret = NULL;
49535 0 : struct ndr_push *push = NULL;
49536 0 : DATA_BLOB blob;
49537 0 : enum ndr_err_code err;
49538 :
49539 0 : if (ndr_table_lsarpc.num_calls < 131) {
49540 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy3_ndr_pack");
49541 0 : return NULL;
49542 : }
49543 0 : call = &ndr_table_lsarpc.calls[130];
49544 :
49545 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
49546 0 : if (push == NULL) {
49547 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49548 0 : return NULL;
49549 : }
49550 :
49551 0 : push->flags |= ndr_push_flags;
49552 :
49553 0 : err = call->ndr_push(push, ndr_inout_flags, object);
49554 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49555 0 : TALLOC_FREE(push);
49556 0 : PyErr_SetNdrError(err);
49557 0 : return NULL;
49558 : }
49559 0 : blob = ndr_push_blob(push);
49560 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
49561 0 : TALLOC_FREE(push);
49562 0 : return ret;
49563 : }
49564 :
49565 0 : static PyObject *py_lsa_OpenPolicy3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49566 : {
49567 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49568 0 : PyObject *bigendian_obj = NULL;
49569 0 : PyObject *ndr64_obj = NULL;
49570 0 : libndr_flags ndr_push_flags = 0;
49571 :
49572 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
49573 : discard_const_p(char *, kwnames),
49574 : &bigendian_obj,
49575 : &ndr64_obj)) {
49576 0 : return NULL;
49577 : }
49578 :
49579 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49580 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49581 : }
49582 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49583 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49584 : }
49585 :
49586 0 : return py_lsa_OpenPolicy3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
49587 : }
49588 :
49589 0 : static PyObject *py_lsa_OpenPolicy3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49590 : {
49591 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49592 0 : PyObject *bigendian_obj = NULL;
49593 0 : PyObject *ndr64_obj = NULL;
49594 0 : libndr_flags ndr_push_flags = 0;
49595 :
49596 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
49597 : discard_const_p(char *, kwnames),
49598 : &bigendian_obj,
49599 : &ndr64_obj)) {
49600 0 : return NULL;
49601 : }
49602 :
49603 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49604 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49605 : }
49606 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49607 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49608 : }
49609 :
49610 0 : return py_lsa_OpenPolicy3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
49611 : }
49612 :
49613 0 : static PyObject *py_lsa_OpenPolicy3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
49614 : {
49615 0 : const struct ndr_interface_call *call = NULL;
49616 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49617 0 : struct ndr_pull *pull = NULL;
49618 0 : enum ndr_err_code err;
49619 :
49620 0 : if (ndr_table_lsarpc.num_calls < 131) {
49621 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy3_ndr_unpack");
49622 0 : return NULL;
49623 : }
49624 0 : call = &ndr_table_lsarpc.calls[130];
49625 :
49626 0 : pull = ndr_pull_init_blob(blob, object);
49627 0 : if (pull == NULL) {
49628 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49629 0 : return NULL;
49630 : }
49631 :
49632 0 : pull->flags |= ndr_pull_flags;
49633 :
49634 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
49635 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49636 0 : TALLOC_FREE(pull);
49637 0 : PyErr_SetNdrError(err);
49638 0 : return NULL;
49639 : }
49640 0 : if (!allow_remaining) {
49641 0 : uint32_t highest_ofs;
49642 :
49643 0 : if (pull->offset > pull->relative_highest_offset) {
49644 0 : highest_ofs = pull->offset;
49645 : } else {
49646 0 : highest_ofs = pull->relative_highest_offset;
49647 : }
49648 0 : if (highest_ofs < pull->data_size) {
49649 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
49650 : "not all bytes consumed ofs[%u] size[%u]",
49651 : highest_ofs, pull->data_size);
49652 0 : TALLOC_FREE(pull);
49653 0 : PyErr_SetNdrError(err);
49654 0 : return NULL;
49655 : }
49656 : }
49657 :
49658 0 : TALLOC_FREE(pull);
49659 0 : Py_RETURN_NONE;
49660 : }
49661 :
49662 0 : static PyObject *py_lsa_OpenPolicy3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49663 : {
49664 0 : DATA_BLOB blob;
49665 0 : Py_ssize_t blob_length = 0;
49666 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49667 0 : PyObject *bigendian_obj = NULL;
49668 0 : PyObject *ndr64_obj = NULL;
49669 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49670 0 : PyObject *allow_remaining_obj = NULL;
49671 0 : bool allow_remaining = false;
49672 :
49673 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
49674 : discard_const_p(char *, kwnames),
49675 : &blob.data, &blob_length,
49676 : &bigendian_obj,
49677 : &ndr64_obj,
49678 : &allow_remaining_obj)) {
49679 0 : return NULL;
49680 : }
49681 0 : blob.length = blob_length;
49682 :
49683 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49684 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49685 : }
49686 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49687 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49688 : }
49689 :
49690 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49691 0 : allow_remaining = true;
49692 : }
49693 :
49694 0 : return py_lsa_OpenPolicy3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
49695 : }
49696 :
49697 0 : static PyObject *py_lsa_OpenPolicy3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49698 : {
49699 0 : DATA_BLOB blob;
49700 0 : Py_ssize_t blob_length = 0;
49701 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49702 0 : PyObject *bigendian_obj = NULL;
49703 0 : PyObject *ndr64_obj = NULL;
49704 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49705 0 : PyObject *allow_remaining_obj = NULL;
49706 0 : bool allow_remaining = false;
49707 :
49708 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
49709 : discard_const_p(char *, kwnames),
49710 : &blob.data, &blob_length,
49711 : &bigendian_obj,
49712 : &ndr64_obj,
49713 : &allow_remaining_obj)) {
49714 0 : return NULL;
49715 : }
49716 0 : blob.length = blob_length;
49717 :
49718 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49719 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49720 : }
49721 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49722 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49723 : }
49724 :
49725 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49726 0 : allow_remaining = true;
49727 : }
49728 :
49729 0 : return py_lsa_OpenPolicy3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
49730 : }
49731 :
49732 0 : static PyObject *py_lsa_OpenPolicy3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
49733 : {
49734 0 : const struct ndr_interface_call *call = NULL;
49735 0 : struct lsa_OpenPolicy3 *object = pytalloc_get_ptr(py_obj);
49736 0 : PyObject *ret;
49737 0 : char *retstr;
49738 :
49739 0 : if (ndr_table_lsarpc.num_calls < 131) {
49740 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_OpenPolicy3_ndr_print");
49741 0 : return NULL;
49742 : }
49743 0 : call = &ndr_table_lsarpc.calls[130];
49744 :
49745 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
49746 0 : ret = PyUnicode_FromString(retstr);
49747 0 : TALLOC_FREE(retstr);
49748 :
49749 0 : return ret;
49750 : }
49751 :
49752 0 : static PyObject *py_lsa_OpenPolicy3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49753 : {
49754 0 : return py_lsa_OpenPolicy3_ndr_print(py_obj, "lsa_OpenPolicy3_in", NDR_IN);
49755 : }
49756 :
49757 0 : static PyObject *py_lsa_OpenPolicy3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49758 : {
49759 0 : return py_lsa_OpenPolicy3_ndr_print(py_obj, "lsa_OpenPolicy3_out", NDR_OUT);
49760 : }
49761 :
49762 : static PyMethodDef py_lsa_OpenPolicy3_methods[] = {
49763 : { "opnum", (PyCFunction)py_lsa_OpenPolicy3_ndr_opnum, METH_NOARGS|METH_CLASS,
49764 : "lsa.OpenPolicy3.opnum() -> 130 (0x82) " },
49765 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
49766 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
49767 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
49768 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
49769 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
49770 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
49771 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_OpenPolicy3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
49772 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
49773 : { "__ndr_print_in__", (PyCFunction)py_lsa_OpenPolicy3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
49774 : { "__ndr_print_out__", (PyCFunction)py_lsa_OpenPolicy3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
49775 : { NULL, NULL, 0, NULL }
49776 : };
49777 :
49778 :
49779 : static PyTypeObject lsa_OpenPolicy3_Type = {
49780 : PyVarObject_HEAD_INIT(NULL, 0)
49781 : .tp_name = "lsa.OpenPolicy3",
49782 : .tp_getset = py_lsa_OpenPolicy3_getsetters,
49783 : .tp_methods = py_lsa_OpenPolicy3_methods,
49784 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
49785 : .tp_new = py_lsa_OpenPolicy3_new,
49786 : };
49787 :
49788 226 : static bool pack_py_lsa_OpenPolicy3_args_in(PyObject *args, PyObject *kwargs, struct lsa_OpenPolicy3 *r)
49789 : {
49790 2 : PyObject *py_system_name;
49791 2 : PyObject *py_attr;
49792 2 : PyObject *py_access_mask;
49793 2 : PyObject *py_in_version;
49794 2 : PyObject *py_in_revision_info;
49795 226 : const char *kwnames[] = {
49796 : "system_name", "attr", "access_mask", "in_version", "in_revision_info", NULL
49797 : };
49798 :
49799 226 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_OpenPolicy3", discard_const_p(char *, kwnames), &py_system_name, &py_attr, &py_access_mask, &py_in_version, &py_in_revision_info)) {
49800 0 : return false;
49801 : }
49802 :
49803 226 : if (py_system_name == NULL) {
49804 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.system_name");
49805 0 : return false;
49806 : }
49807 226 : if (py_system_name == Py_None) {
49808 0 : r->in.system_name = NULL;
49809 : } else {
49810 226 : r->in.system_name = NULL;
49811 : {
49812 2 : const char *test_str;
49813 2 : const char *talloc_str;
49814 226 : PyObject *unicode = NULL;
49815 226 : if (PyUnicode_Check(py_system_name)) {
49816 226 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
49817 226 : if (unicode == NULL) {
49818 0 : return false;
49819 : }
49820 226 : test_str = PyBytes_AS_STRING(unicode);
49821 0 : } else if (PyBytes_Check(py_system_name)) {
49822 0 : test_str = PyBytes_AS_STRING(py_system_name);
49823 : } else {
49824 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
49825 0 : return false;
49826 : }
49827 226 : talloc_str = talloc_strdup(r, test_str);
49828 226 : if (unicode != NULL) {
49829 119 : Py_DECREF(unicode);
49830 : }
49831 226 : if (talloc_str == NULL) {
49832 0 : PyErr_NoMemory();
49833 0 : return false;
49834 : }
49835 226 : r->in.system_name = talloc_str;
49836 : }
49837 : }
49838 226 : if (py_attr == NULL) {
49839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.attr");
49840 0 : return false;
49841 : }
49842 226 : r->in.attr = talloc_ptrtype(r, r->in.attr);
49843 226 : if (r->in.attr == NULL) {
49844 0 : PyErr_NoMemory();
49845 0 : return false;
49846 : }
49847 226 : PY_CHECK_TYPE(&lsa_ObjectAttribute_Type, py_attr, return false;);
49848 226 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_attr)) == NULL) {
49849 0 : PyErr_NoMemory();
49850 0 : return false;
49851 : }
49852 226 : r->in.attr = (struct lsa_ObjectAttribute *)pytalloc_get_ptr(py_attr);
49853 226 : if (py_access_mask == NULL) {
49854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
49855 0 : return false;
49856 : }
49857 : {
49858 226 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
49859 226 : if (PyLong_Check(py_access_mask)) {
49860 2 : unsigned long long test_var;
49861 226 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
49862 226 : if (PyErr_Occurred() != NULL) {
49863 0 : return false;
49864 : }
49865 226 : if (test_var > uint_max) {
49866 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49867 : PyLong_Type.tp_name, uint_max, test_var);
49868 0 : return false;
49869 : }
49870 226 : r->in.access_mask = test_var;
49871 : } else {
49872 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49873 : PyLong_Type.tp_name);
49874 0 : return false;
49875 : }
49876 : }
49877 226 : if (py_in_version == NULL) {
49878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.in_version");
49879 0 : return false;
49880 : }
49881 : {
49882 226 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.in_version));
49883 226 : if (PyLong_Check(py_in_version)) {
49884 2 : unsigned long long test_var;
49885 226 : test_var = PyLong_AsUnsignedLongLong(py_in_version);
49886 226 : if (PyErr_Occurred() != NULL) {
49887 0 : return false;
49888 : }
49889 226 : if (test_var > uint_max) {
49890 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49891 : PyLong_Type.tp_name, uint_max, test_var);
49892 0 : return false;
49893 : }
49894 226 : r->in.in_version = test_var;
49895 : } else {
49896 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49897 : PyLong_Type.tp_name);
49898 0 : return false;
49899 : }
49900 : }
49901 226 : if (py_in_revision_info == NULL) {
49902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.in_revision_info");
49903 0 : return false;
49904 : }
49905 226 : r->in.in_revision_info = talloc_ptrtype(r, r->in.in_revision_info);
49906 226 : if (r->in.in_revision_info == NULL) {
49907 0 : PyErr_NoMemory();
49908 0 : return false;
49909 : }
49910 : {
49911 2 : union lsa_revision_info *in_revision_info_switch_1;
49912 226 : in_revision_info_switch_1 = (union lsa_revision_info *)pyrpc_export_union(&lsa_revision_info_Type, r, r->in.in_version, py_in_revision_info, "union lsa_revision_info");
49913 226 : if (in_revision_info_switch_1 == NULL) {
49914 0 : return false;
49915 : }
49916 226 : r->in.in_revision_info = in_revision_info_switch_1;
49917 : }
49918 226 : return true;
49919 : }
49920 :
49921 226 : static PyObject *unpack_py_lsa_OpenPolicy3_args_out(struct lsa_OpenPolicy3 *r)
49922 : {
49923 2 : PyObject *result;
49924 2 : PyObject *py_out_version;
49925 2 : PyObject *py_out_revision_info;
49926 2 : PyObject *py_handle;
49927 226 : result = PyTuple_New(3);
49928 226 : py_out_version = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.out_version));
49929 226 : PyTuple_SetItem(result, 0, py_out_version);
49930 226 : py_out_revision_info = pyrpc_import_union(&lsa_revision_info_Type, r->out.out_revision_info, *r->out.out_version, r->out.out_revision_info, "union lsa_revision_info");
49931 226 : if (py_out_revision_info == NULL) {
49932 0 : return NULL;
49933 : }
49934 226 : PyTuple_SetItem(result, 1, py_out_revision_info);
49935 226 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
49936 226 : PyTuple_SetItem(result, 2, py_handle);
49937 226 : if (NT_STATUS_IS_ERR(r->out.result)) {
49938 0 : PyErr_SetNTSTATUS(r->out.result);
49939 0 : return NULL;
49940 : }
49941 :
49942 224 : return result;
49943 : }
49944 :
49945 :
49946 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_in_get_handle(PyObject *obj, void *closure)
49947 : {
49948 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(obj);
49949 0 : PyObject *py_handle;
49950 0 : if (object->in.handle == NULL) {
49951 0 : Py_RETURN_NONE;
49952 : }
49953 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
49954 0 : return py_handle;
49955 : }
49956 :
49957 0 : static int py_lsa_lsaRQueryForestTrustInformation2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
49958 : {
49959 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
49960 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
49961 0 : if (value == NULL) {
49962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
49963 0 : return -1;
49964 : }
49965 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
49966 0 : if (object->in.handle == NULL) {
49967 0 : PyErr_NoMemory();
49968 0 : return -1;
49969 : }
49970 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
49971 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49972 0 : PyErr_NoMemory();
49973 0 : return -1;
49974 : }
49975 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
49976 0 : return 0;
49977 : }
49978 :
49979 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_in_get_trusted_domain_name(PyObject *obj, void *closure)
49980 : {
49981 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(obj);
49982 0 : PyObject *py_trusted_domain_name;
49983 0 : if (object->in.trusted_domain_name == NULL) {
49984 0 : Py_RETURN_NONE;
49985 : }
49986 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_String_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
49987 0 : return py_trusted_domain_name;
49988 : }
49989 :
49990 0 : static int py_lsa_lsaRQueryForestTrustInformation2_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
49991 : {
49992 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
49993 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
49994 0 : if (value == NULL) {
49995 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain_name");
49996 0 : return -1;
49997 : }
49998 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
49999 0 : if (object->in.trusted_domain_name == NULL) {
50000 0 : PyErr_NoMemory();
50001 0 : return -1;
50002 : }
50003 0 : PY_CHECK_TYPE(&lsa_String_Type, value, return -1;);
50004 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50005 0 : PyErr_NoMemory();
50006 0 : return -1;
50007 : }
50008 0 : object->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
50009 0 : return 0;
50010 : }
50011 :
50012 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_in_get_highest_record_type(PyObject *obj, void *closure)
50013 : {
50014 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50015 0 : PyObject *py_highest_record_type;
50016 0 : py_highest_record_type = PyLong_FromLong((uint16_t)(object->in.highest_record_type));
50017 0 : return py_highest_record_type;
50018 : }
50019 :
50020 0 : static int py_lsa_lsaRQueryForestTrustInformation2_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
50021 : {
50022 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50023 0 : if (value == NULL) {
50024 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.highest_record_type");
50025 0 : return -1;
50026 : }
50027 : {
50028 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
50029 0 : if (PyLong_Check(value)) {
50030 0 : unsigned long long test_var;
50031 0 : test_var = PyLong_AsUnsignedLongLong(value);
50032 0 : if (PyErr_Occurred() != NULL) {
50033 0 : return -1;
50034 : }
50035 0 : if (test_var > uint_max) {
50036 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50037 : PyLong_Type.tp_name, uint_max, test_var);
50038 0 : return -1;
50039 : }
50040 0 : object->in.highest_record_type = test_var;
50041 : } else {
50042 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50043 : PyLong_Type.tp_name);
50044 0 : return -1;
50045 : }
50046 : }
50047 0 : return 0;
50048 : }
50049 :
50050 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_out_get_forest_trust_info(PyObject *obj, void *closure)
50051 : {
50052 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50053 0 : PyObject *py_forest_trust_info;
50054 0 : if (object->out.forest_trust_info == NULL) {
50055 0 : Py_RETURN_NONE;
50056 : }
50057 0 : if (*object->out.forest_trust_info == NULL) {
50058 0 : py_forest_trust_info = Py_None;
50059 0 : Py_INCREF(py_forest_trust_info);
50060 : } else {
50061 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation2_Type, *object->out.forest_trust_info, *object->out.forest_trust_info);
50062 : }
50063 0 : return py_forest_trust_info;
50064 : }
50065 :
50066 0 : static int py_lsa_lsaRQueryForestTrustInformation2_out_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
50067 : {
50068 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50069 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.forest_trust_info));
50070 0 : if (value == NULL) {
50071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.forest_trust_info");
50072 0 : return -1;
50073 : }
50074 0 : object->out.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.forest_trust_info);
50075 0 : if (object->out.forest_trust_info == NULL) {
50076 0 : PyErr_NoMemory();
50077 0 : return -1;
50078 : }
50079 0 : if (value == Py_None) {
50080 0 : *object->out.forest_trust_info = NULL;
50081 : } else {
50082 0 : *object->out.forest_trust_info = NULL;
50083 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation2_Type, value, return -1;);
50084 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50085 0 : PyErr_NoMemory();
50086 0 : return -1;
50087 : }
50088 0 : *object->out.forest_trust_info = (struct lsa_ForestTrustInformation2 *)pytalloc_get_ptr(value);
50089 : }
50090 0 : return 0;
50091 : }
50092 :
50093 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_get_result(PyObject *obj, void *closure)
50094 : {
50095 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50096 0 : PyObject *py_result;
50097 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
50098 0 : return py_result;
50099 : }
50100 :
50101 0 : static int py_lsa_lsaRQueryForestTrustInformation2_set_result(PyObject *py_obj, PyObject *value, void *closure)
50102 : {
50103 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50104 0 : if (value == NULL) {
50105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
50106 0 : return -1;
50107 : }
50108 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
50109 0 : return 0;
50110 : }
50111 :
50112 : static PyGetSetDef py_lsa_lsaRQueryForestTrustInformation2_getsetters[] = {
50113 : {
50114 : .name = discard_const_p(char, "in_handle"),
50115 : .get = py_lsa_lsaRQueryForestTrustInformation2_in_get_handle,
50116 : .set = py_lsa_lsaRQueryForestTrustInformation2_in_set_handle,
50117 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
50118 : },
50119 : {
50120 : .name = discard_const_p(char, "in_trusted_domain_name"),
50121 : .get = py_lsa_lsaRQueryForestTrustInformation2_in_get_trusted_domain_name,
50122 : .set = py_lsa_lsaRQueryForestTrustInformation2_in_set_trusted_domain_name,
50123 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
50124 : },
50125 : {
50126 : .name = discard_const_p(char, "in_highest_record_type"),
50127 : .get = py_lsa_lsaRQueryForestTrustInformation2_in_get_highest_record_type,
50128 : .set = py_lsa_lsaRQueryForestTrustInformation2_in_set_highest_record_type,
50129 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
50130 : },
50131 : {
50132 : .name = discard_const_p(char, "out_forest_trust_info"),
50133 : .get = py_lsa_lsaRQueryForestTrustInformation2_out_get_forest_trust_info,
50134 : .set = py_lsa_lsaRQueryForestTrustInformation2_out_set_forest_trust_info,
50135 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation2")
50136 : },
50137 : {
50138 : .name = discard_const_p(char, "result"),
50139 : .get = py_lsa_lsaRQueryForestTrustInformation2_get_result,
50140 : .set = py_lsa_lsaRQueryForestTrustInformation2_set_result,
50141 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
50142 : },
50143 : { .name = NULL }
50144 : };
50145 :
50146 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50147 : {
50148 0 : PyObject *self = pytalloc_new(struct lsa_lsaRQueryForestTrustInformation2, type);
50149 0 : struct lsa_lsaRQueryForestTrustInformation2 *_self = (struct lsa_lsaRQueryForestTrustInformation2 *)pytalloc_get_ptr(self);
50150 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
50151 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
50152 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_String);
50153 : /* a pointer to a NULL pointer */
50154 0 : _self->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation2 *);
50155 0 : return self;
50156 : }
50157 :
50158 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
50159 : {
50160 :
50161 :
50162 0 : return PyLong_FromLong(132);
50163 : }
50164 :
50165 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
50166 : {
50167 0 : const struct ndr_interface_call *call = NULL;
50168 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50169 0 : PyObject *ret = NULL;
50170 0 : struct ndr_push *push = NULL;
50171 0 : DATA_BLOB blob;
50172 0 : enum ndr_err_code err;
50173 :
50174 0 : if (ndr_table_lsarpc.num_calls < 133) {
50175 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation2_ndr_pack");
50176 0 : return NULL;
50177 : }
50178 0 : call = &ndr_table_lsarpc.calls[132];
50179 :
50180 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
50181 0 : if (push == NULL) {
50182 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50183 0 : return NULL;
50184 : }
50185 :
50186 0 : push->flags |= ndr_push_flags;
50187 :
50188 0 : err = call->ndr_push(push, ndr_inout_flags, object);
50189 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50190 0 : TALLOC_FREE(push);
50191 0 : PyErr_SetNdrError(err);
50192 0 : return NULL;
50193 : }
50194 0 : blob = ndr_push_blob(push);
50195 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
50196 0 : TALLOC_FREE(push);
50197 0 : return ret;
50198 : }
50199 :
50200 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50201 : {
50202 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50203 0 : PyObject *bigendian_obj = NULL;
50204 0 : PyObject *ndr64_obj = NULL;
50205 0 : libndr_flags ndr_push_flags = 0;
50206 :
50207 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
50208 : discard_const_p(char *, kwnames),
50209 : &bigendian_obj,
50210 : &ndr64_obj)) {
50211 0 : return NULL;
50212 : }
50213 :
50214 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50215 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50216 : }
50217 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50218 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50219 : }
50220 :
50221 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
50222 : }
50223 :
50224 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50225 : {
50226 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50227 0 : PyObject *bigendian_obj = NULL;
50228 0 : PyObject *ndr64_obj = NULL;
50229 0 : libndr_flags ndr_push_flags = 0;
50230 :
50231 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
50232 : discard_const_p(char *, kwnames),
50233 : &bigendian_obj,
50234 : &ndr64_obj)) {
50235 0 : return NULL;
50236 : }
50237 :
50238 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50239 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50240 : }
50241 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50242 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50243 : }
50244 :
50245 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
50246 : }
50247 :
50248 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
50249 : {
50250 0 : const struct ndr_interface_call *call = NULL;
50251 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50252 0 : struct ndr_pull *pull = NULL;
50253 0 : enum ndr_err_code err;
50254 :
50255 0 : if (ndr_table_lsarpc.num_calls < 133) {
50256 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack");
50257 0 : return NULL;
50258 : }
50259 0 : call = &ndr_table_lsarpc.calls[132];
50260 :
50261 0 : pull = ndr_pull_init_blob(blob, object);
50262 0 : if (pull == NULL) {
50263 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50264 0 : return NULL;
50265 : }
50266 :
50267 0 : pull->flags |= ndr_pull_flags;
50268 :
50269 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
50270 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50271 0 : TALLOC_FREE(pull);
50272 0 : PyErr_SetNdrError(err);
50273 0 : return NULL;
50274 : }
50275 0 : if (!allow_remaining) {
50276 0 : uint32_t highest_ofs;
50277 :
50278 0 : if (pull->offset > pull->relative_highest_offset) {
50279 0 : highest_ofs = pull->offset;
50280 : } else {
50281 0 : highest_ofs = pull->relative_highest_offset;
50282 : }
50283 0 : if (highest_ofs < pull->data_size) {
50284 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
50285 : "not all bytes consumed ofs[%u] size[%u]",
50286 : highest_ofs, pull->data_size);
50287 0 : TALLOC_FREE(pull);
50288 0 : PyErr_SetNdrError(err);
50289 0 : return NULL;
50290 : }
50291 : }
50292 :
50293 0 : TALLOC_FREE(pull);
50294 0 : Py_RETURN_NONE;
50295 : }
50296 :
50297 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50298 : {
50299 0 : DATA_BLOB blob;
50300 0 : Py_ssize_t blob_length = 0;
50301 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50302 0 : PyObject *bigendian_obj = NULL;
50303 0 : PyObject *ndr64_obj = NULL;
50304 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50305 0 : PyObject *allow_remaining_obj = NULL;
50306 0 : bool allow_remaining = false;
50307 :
50308 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
50309 : discard_const_p(char *, kwnames),
50310 : &blob.data, &blob_length,
50311 : &bigendian_obj,
50312 : &ndr64_obj,
50313 : &allow_remaining_obj)) {
50314 0 : return NULL;
50315 : }
50316 0 : blob.length = blob_length;
50317 :
50318 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50319 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50320 : }
50321 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50322 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50323 : }
50324 :
50325 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50326 0 : allow_remaining = true;
50327 : }
50328 :
50329 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
50330 : }
50331 :
50332 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50333 : {
50334 0 : DATA_BLOB blob;
50335 0 : Py_ssize_t blob_length = 0;
50336 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50337 0 : PyObject *bigendian_obj = NULL;
50338 0 : PyObject *ndr64_obj = NULL;
50339 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50340 0 : PyObject *allow_remaining_obj = NULL;
50341 0 : bool allow_remaining = false;
50342 :
50343 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
50344 : discard_const_p(char *, kwnames),
50345 : &blob.data, &blob_length,
50346 : &bigendian_obj,
50347 : &ndr64_obj,
50348 : &allow_remaining_obj)) {
50349 0 : return NULL;
50350 : }
50351 0 : blob.length = blob_length;
50352 :
50353 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50354 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50355 : }
50356 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50357 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50358 : }
50359 :
50360 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50361 0 : allow_remaining = true;
50362 : }
50363 :
50364 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
50365 : }
50366 :
50367 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
50368 : {
50369 0 : const struct ndr_interface_call *call = NULL;
50370 0 : struct lsa_lsaRQueryForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50371 0 : PyObject *ret;
50372 0 : char *retstr;
50373 :
50374 0 : if (ndr_table_lsarpc.num_calls < 133) {
50375 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRQueryForestTrustInformation2_ndr_print");
50376 0 : return NULL;
50377 : }
50378 0 : call = &ndr_table_lsarpc.calls[132];
50379 :
50380 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
50381 0 : ret = PyUnicode_FromString(retstr);
50382 0 : TALLOC_FREE(retstr);
50383 :
50384 0 : return ret;
50385 : }
50386 :
50387 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50388 : {
50389 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation2_in", NDR_IN);
50390 : }
50391 :
50392 0 : static PyObject *py_lsa_lsaRQueryForestTrustInformation2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50393 : {
50394 0 : return py_lsa_lsaRQueryForestTrustInformation2_ndr_print(py_obj, "lsa_lsaRQueryForestTrustInformation2_out", NDR_OUT);
50395 : }
50396 :
50397 : static PyMethodDef py_lsa_lsaRQueryForestTrustInformation2_methods[] = {
50398 : { "opnum", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation2_ndr_opnum, METH_NOARGS|METH_CLASS,
50399 : "lsa.lsaRQueryForestTrustInformation2.opnum() -> 132 (0x84) " },
50400 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
50401 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
50402 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
50403 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
50404 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
50405 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
50406 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRQueryForestTrustInformation2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
50407 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
50408 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
50409 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRQueryForestTrustInformation2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
50410 : { NULL, NULL, 0, NULL }
50411 : };
50412 :
50413 :
50414 : static PyTypeObject lsa_lsaRQueryForestTrustInformation2_Type = {
50415 : PyVarObject_HEAD_INIT(NULL, 0)
50416 : .tp_name = "lsa.lsaRQueryForestTrustInformation2",
50417 : .tp_getset = py_lsa_lsaRQueryForestTrustInformation2_getsetters,
50418 : .tp_methods = py_lsa_lsaRQueryForestTrustInformation2_methods,
50419 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
50420 : .tp_new = py_lsa_lsaRQueryForestTrustInformation2_new,
50421 : };
50422 :
50423 0 : static bool pack_py_lsa_lsaRQueryForestTrustInformation2_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRQueryForestTrustInformation2 *r)
50424 : {
50425 0 : PyObject *py_handle;
50426 0 : PyObject *py_trusted_domain_name;
50427 0 : PyObject *py_highest_record_type;
50428 0 : const char *kwnames[] = {
50429 : "handle", "trusted_domain_name", "highest_record_type", NULL
50430 : };
50431 :
50432 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:lsa_lsaRQueryForestTrustInformation2", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type)) {
50433 0 : return false;
50434 : }
50435 :
50436 0 : if (py_handle == NULL) {
50437 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
50438 0 : return false;
50439 : }
50440 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
50441 0 : if (r->in.handle == NULL) {
50442 0 : PyErr_NoMemory();
50443 0 : return false;
50444 : }
50445 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
50446 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
50447 0 : PyErr_NoMemory();
50448 0 : return false;
50449 : }
50450 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
50451 0 : if (py_trusted_domain_name == NULL) {
50452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain_name");
50453 0 : return false;
50454 : }
50455 0 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
50456 0 : if (r->in.trusted_domain_name == NULL) {
50457 0 : PyErr_NoMemory();
50458 0 : return false;
50459 : }
50460 0 : PY_CHECK_TYPE(&lsa_String_Type, py_trusted_domain_name, return false;);
50461 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
50462 0 : PyErr_NoMemory();
50463 0 : return false;
50464 : }
50465 0 : r->in.trusted_domain_name = (struct lsa_String *)pytalloc_get_ptr(py_trusted_domain_name);
50466 0 : if (py_highest_record_type == NULL) {
50467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.highest_record_type");
50468 0 : return false;
50469 : }
50470 : {
50471 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
50472 0 : if (PyLong_Check(py_highest_record_type)) {
50473 0 : unsigned long long test_var;
50474 0 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
50475 0 : if (PyErr_Occurred() != NULL) {
50476 0 : return false;
50477 : }
50478 0 : if (test_var > uint_max) {
50479 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50480 : PyLong_Type.tp_name, uint_max, test_var);
50481 0 : return false;
50482 : }
50483 0 : r->in.highest_record_type = test_var;
50484 : } else {
50485 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50486 : PyLong_Type.tp_name);
50487 0 : return false;
50488 : }
50489 : }
50490 0 : return true;
50491 : }
50492 :
50493 0 : static PyObject *unpack_py_lsa_lsaRQueryForestTrustInformation2_args_out(struct lsa_lsaRQueryForestTrustInformation2 *r)
50494 : {
50495 0 : PyObject *result;
50496 0 : PyObject *py_forest_trust_info;
50497 0 : if (*r->out.forest_trust_info == NULL) {
50498 0 : py_forest_trust_info = Py_None;
50499 0 : Py_INCREF(py_forest_trust_info);
50500 : } else {
50501 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation2_Type, *r->out.forest_trust_info, *r->out.forest_trust_info);
50502 : }
50503 0 : result = py_forest_trust_info;
50504 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
50505 0 : PyErr_SetNTSTATUS(r->out.result);
50506 0 : return NULL;
50507 : }
50508 :
50509 0 : return result;
50510 : }
50511 :
50512 :
50513 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_in_get_handle(PyObject *obj, void *closure)
50514 : {
50515 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50516 0 : PyObject *py_handle;
50517 0 : if (object->in.handle == NULL) {
50518 0 : Py_RETURN_NONE;
50519 : }
50520 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
50521 0 : return py_handle;
50522 : }
50523 :
50524 0 : static int py_lsa_lsaRSetForestTrustInformation2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
50525 : {
50526 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50527 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
50528 0 : if (value == NULL) {
50529 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
50530 0 : return -1;
50531 : }
50532 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
50533 0 : if (object->in.handle == NULL) {
50534 0 : PyErr_NoMemory();
50535 0 : return -1;
50536 : }
50537 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
50538 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50539 0 : PyErr_NoMemory();
50540 0 : return -1;
50541 : }
50542 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
50543 0 : return 0;
50544 : }
50545 :
50546 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_in_get_trusted_domain_name(PyObject *obj, void *closure)
50547 : {
50548 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50549 0 : PyObject *py_trusted_domain_name;
50550 0 : if (object->in.trusted_domain_name == NULL) {
50551 0 : Py_RETURN_NONE;
50552 : }
50553 0 : py_trusted_domain_name = pytalloc_reference_ex(&lsa_StringLarge_Type, object->in.trusted_domain_name, object->in.trusted_domain_name);
50554 0 : return py_trusted_domain_name;
50555 : }
50556 :
50557 0 : static int py_lsa_lsaRSetForestTrustInformation2_in_set_trusted_domain_name(PyObject *py_obj, PyObject *value, void *closure)
50558 : {
50559 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50560 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.trusted_domain_name));
50561 0 : if (value == NULL) {
50562 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.trusted_domain_name");
50563 0 : return -1;
50564 : }
50565 0 : object->in.trusted_domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.trusted_domain_name);
50566 0 : if (object->in.trusted_domain_name == NULL) {
50567 0 : PyErr_NoMemory();
50568 0 : return -1;
50569 : }
50570 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, value, return -1;);
50571 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50572 0 : PyErr_NoMemory();
50573 0 : return -1;
50574 : }
50575 0 : object->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(value);
50576 0 : return 0;
50577 : }
50578 :
50579 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_in_get_highest_record_type(PyObject *obj, void *closure)
50580 : {
50581 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50582 0 : PyObject *py_highest_record_type;
50583 0 : py_highest_record_type = PyLong_FromLong((uint16_t)(object->in.highest_record_type));
50584 0 : return py_highest_record_type;
50585 : }
50586 :
50587 0 : static int py_lsa_lsaRSetForestTrustInformation2_in_set_highest_record_type(PyObject *py_obj, PyObject *value, void *closure)
50588 : {
50589 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50590 0 : if (value == NULL) {
50591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.highest_record_type");
50592 0 : return -1;
50593 : }
50594 : {
50595 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.highest_record_type));
50596 0 : if (PyLong_Check(value)) {
50597 0 : unsigned long long test_var;
50598 0 : test_var = PyLong_AsUnsignedLongLong(value);
50599 0 : if (PyErr_Occurred() != NULL) {
50600 0 : return -1;
50601 : }
50602 0 : if (test_var > uint_max) {
50603 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50604 : PyLong_Type.tp_name, uint_max, test_var);
50605 0 : return -1;
50606 : }
50607 0 : object->in.highest_record_type = test_var;
50608 : } else {
50609 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50610 : PyLong_Type.tp_name);
50611 0 : return -1;
50612 : }
50613 : }
50614 0 : return 0;
50615 : }
50616 :
50617 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_in_get_forest_trust_info(PyObject *obj, void *closure)
50618 : {
50619 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50620 0 : PyObject *py_forest_trust_info;
50621 0 : if (object->in.forest_trust_info == NULL) {
50622 0 : Py_RETURN_NONE;
50623 : }
50624 0 : py_forest_trust_info = pytalloc_reference_ex(&lsa_ForestTrustInformation2_Type, object->in.forest_trust_info, object->in.forest_trust_info);
50625 0 : return py_forest_trust_info;
50626 : }
50627 :
50628 0 : static int py_lsa_lsaRSetForestTrustInformation2_in_set_forest_trust_info(PyObject *py_obj, PyObject *value, void *closure)
50629 : {
50630 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50631 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.forest_trust_info));
50632 0 : if (value == NULL) {
50633 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.forest_trust_info");
50634 0 : return -1;
50635 : }
50636 0 : object->in.forest_trust_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.forest_trust_info);
50637 0 : if (object->in.forest_trust_info == NULL) {
50638 0 : PyErr_NoMemory();
50639 0 : return -1;
50640 : }
50641 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation2_Type, value, return -1;);
50642 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50643 0 : PyErr_NoMemory();
50644 0 : return -1;
50645 : }
50646 0 : object->in.forest_trust_info = (struct lsa_ForestTrustInformation2 *)pytalloc_get_ptr(value);
50647 0 : return 0;
50648 : }
50649 :
50650 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_in_get_check_only(PyObject *obj, void *closure)
50651 : {
50652 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50653 0 : PyObject *py_check_only;
50654 0 : py_check_only = PyLong_FromLong((uint16_t)(object->in.check_only));
50655 0 : return py_check_only;
50656 : }
50657 :
50658 0 : static int py_lsa_lsaRSetForestTrustInformation2_in_set_check_only(PyObject *py_obj, PyObject *value, void *closure)
50659 : {
50660 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50661 0 : if (value == NULL) {
50662 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.check_only");
50663 0 : return -1;
50664 : }
50665 : {
50666 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.check_only));
50667 0 : if (PyLong_Check(value)) {
50668 0 : unsigned long long test_var;
50669 0 : test_var = PyLong_AsUnsignedLongLong(value);
50670 0 : if (PyErr_Occurred() != NULL) {
50671 0 : return -1;
50672 : }
50673 0 : if (test_var > uint_max) {
50674 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50675 : PyLong_Type.tp_name, uint_max, test_var);
50676 0 : return -1;
50677 : }
50678 0 : object->in.check_only = test_var;
50679 : } else {
50680 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50681 : PyLong_Type.tp_name);
50682 0 : return -1;
50683 : }
50684 : }
50685 0 : return 0;
50686 : }
50687 :
50688 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_out_get_collision_info(PyObject *obj, void *closure)
50689 : {
50690 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50691 0 : PyObject *py_collision_info;
50692 0 : if (object->out.collision_info == NULL) {
50693 0 : Py_RETURN_NONE;
50694 : }
50695 0 : if (*object->out.collision_info == NULL) {
50696 0 : py_collision_info = Py_None;
50697 0 : Py_INCREF(py_collision_info);
50698 : } else {
50699 0 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *object->out.collision_info, *object->out.collision_info);
50700 : }
50701 0 : return py_collision_info;
50702 : }
50703 :
50704 0 : static int py_lsa_lsaRSetForestTrustInformation2_out_set_collision_info(PyObject *py_obj, PyObject *value, void *closure)
50705 : {
50706 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50707 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.collision_info));
50708 0 : if (value == NULL) {
50709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.collision_info");
50710 0 : return -1;
50711 : }
50712 0 : object->out.collision_info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.collision_info);
50713 0 : if (object->out.collision_info == NULL) {
50714 0 : PyErr_NoMemory();
50715 0 : return -1;
50716 : }
50717 0 : if (value == Py_None) {
50718 0 : *object->out.collision_info = NULL;
50719 : } else {
50720 0 : *object->out.collision_info = NULL;
50721 0 : PY_CHECK_TYPE(&lsa_ForestTrustCollisionInfo_Type, value, return -1;);
50722 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50723 0 : PyErr_NoMemory();
50724 0 : return -1;
50725 : }
50726 0 : *object->out.collision_info = (struct lsa_ForestTrustCollisionInfo *)pytalloc_get_ptr(value);
50727 : }
50728 0 : return 0;
50729 : }
50730 :
50731 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_get_result(PyObject *obj, void *closure)
50732 : {
50733 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(obj);
50734 0 : PyObject *py_result;
50735 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
50736 0 : return py_result;
50737 : }
50738 :
50739 0 : static int py_lsa_lsaRSetForestTrustInformation2_set_result(PyObject *py_obj, PyObject *value, void *closure)
50740 : {
50741 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50742 0 : if (value == NULL) {
50743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
50744 0 : return -1;
50745 : }
50746 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
50747 0 : return 0;
50748 : }
50749 :
50750 : static PyGetSetDef py_lsa_lsaRSetForestTrustInformation2_getsetters[] = {
50751 : {
50752 : .name = discard_const_p(char, "in_handle"),
50753 : .get = py_lsa_lsaRSetForestTrustInformation2_in_get_handle,
50754 : .set = py_lsa_lsaRSetForestTrustInformation2_in_set_handle,
50755 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
50756 : },
50757 : {
50758 : .name = discard_const_p(char, "in_trusted_domain_name"),
50759 : .get = py_lsa_lsaRSetForestTrustInformation2_in_get_trusted_domain_name,
50760 : .set = py_lsa_lsaRSetForestTrustInformation2_in_set_trusted_domain_name,
50761 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
50762 : },
50763 : {
50764 : .name = discard_const_p(char, "in_highest_record_type"),
50765 : .get = py_lsa_lsaRSetForestTrustInformation2_in_get_highest_record_type,
50766 : .set = py_lsa_lsaRSetForestTrustInformation2_in_set_highest_record_type,
50767 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustRecordType")
50768 : },
50769 : {
50770 : .name = discard_const_p(char, "in_forest_trust_info"),
50771 : .get = py_lsa_lsaRSetForestTrustInformation2_in_get_forest_trust_info,
50772 : .set = py_lsa_lsaRSetForestTrustInformation2_in_set_forest_trust_info,
50773 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustInformation2")
50774 : },
50775 : {
50776 : .name = discard_const_p(char, "in_check_only"),
50777 : .get = py_lsa_lsaRSetForestTrustInformation2_in_get_check_only,
50778 : .set = py_lsa_lsaRSetForestTrustInformation2_in_set_check_only,
50779 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
50780 : },
50781 : {
50782 : .name = discard_const_p(char, "out_collision_info"),
50783 : .get = py_lsa_lsaRSetForestTrustInformation2_out_get_collision_info,
50784 : .set = py_lsa_lsaRSetForestTrustInformation2_out_set_collision_info,
50785 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_ForestTrustCollisionInfo")
50786 : },
50787 : {
50788 : .name = discard_const_p(char, "result"),
50789 : .get = py_lsa_lsaRSetForestTrustInformation2_get_result,
50790 : .set = py_lsa_lsaRSetForestTrustInformation2_set_result,
50791 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
50792 : },
50793 : { .name = NULL }
50794 : };
50795 :
50796 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50797 : {
50798 0 : PyObject *self = pytalloc_new(struct lsa_lsaRSetForestTrustInformation2, type);
50799 0 : struct lsa_lsaRSetForestTrustInformation2 *_self = (struct lsa_lsaRSetForestTrustInformation2 *)pytalloc_get_ptr(self);
50800 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
50801 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
50802 0 : _self->in.trusted_domain_name = talloc_zero(mem_ctx, struct lsa_StringLarge);
50803 0 : _self->in.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation2);
50804 : /* a pointer to a NULL pointer */
50805 0 : _self->out.collision_info = talloc_zero(mem_ctx, struct lsa_ForestTrustCollisionInfo *);
50806 0 : return self;
50807 : }
50808 :
50809 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
50810 : {
50811 :
50812 :
50813 0 : return PyLong_FromLong(133);
50814 : }
50815 :
50816 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
50817 : {
50818 0 : const struct ndr_interface_call *call = NULL;
50819 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50820 0 : PyObject *ret = NULL;
50821 0 : struct ndr_push *push = NULL;
50822 0 : DATA_BLOB blob;
50823 0 : enum ndr_err_code err;
50824 :
50825 0 : if (ndr_table_lsarpc.num_calls < 134) {
50826 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation2_ndr_pack");
50827 0 : return NULL;
50828 : }
50829 0 : call = &ndr_table_lsarpc.calls[133];
50830 :
50831 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
50832 0 : if (push == NULL) {
50833 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50834 0 : return NULL;
50835 : }
50836 :
50837 0 : push->flags |= ndr_push_flags;
50838 :
50839 0 : err = call->ndr_push(push, ndr_inout_flags, object);
50840 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50841 0 : TALLOC_FREE(push);
50842 0 : PyErr_SetNdrError(err);
50843 0 : return NULL;
50844 : }
50845 0 : blob = ndr_push_blob(push);
50846 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
50847 0 : TALLOC_FREE(push);
50848 0 : return ret;
50849 : }
50850 :
50851 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50852 : {
50853 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50854 0 : PyObject *bigendian_obj = NULL;
50855 0 : PyObject *ndr64_obj = NULL;
50856 0 : libndr_flags ndr_push_flags = 0;
50857 :
50858 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
50859 : discard_const_p(char *, kwnames),
50860 : &bigendian_obj,
50861 : &ndr64_obj)) {
50862 0 : return NULL;
50863 : }
50864 :
50865 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50866 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50867 : }
50868 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50869 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50870 : }
50871 :
50872 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
50873 : }
50874 :
50875 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50876 : {
50877 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50878 0 : PyObject *bigendian_obj = NULL;
50879 0 : PyObject *ndr64_obj = NULL;
50880 0 : libndr_flags ndr_push_flags = 0;
50881 :
50882 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
50883 : discard_const_p(char *, kwnames),
50884 : &bigendian_obj,
50885 : &ndr64_obj)) {
50886 0 : return NULL;
50887 : }
50888 :
50889 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50890 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50891 : }
50892 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50893 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50894 : }
50895 :
50896 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
50897 : }
50898 :
50899 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
50900 : {
50901 0 : const struct ndr_interface_call *call = NULL;
50902 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
50903 0 : struct ndr_pull *pull = NULL;
50904 0 : enum ndr_err_code err;
50905 :
50906 0 : if (ndr_table_lsarpc.num_calls < 134) {
50907 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation2_ndr_unpack");
50908 0 : return NULL;
50909 : }
50910 0 : call = &ndr_table_lsarpc.calls[133];
50911 :
50912 0 : pull = ndr_pull_init_blob(blob, object);
50913 0 : if (pull == NULL) {
50914 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50915 0 : return NULL;
50916 : }
50917 :
50918 0 : pull->flags |= ndr_pull_flags;
50919 :
50920 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
50921 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50922 0 : TALLOC_FREE(pull);
50923 0 : PyErr_SetNdrError(err);
50924 0 : return NULL;
50925 : }
50926 0 : if (!allow_remaining) {
50927 0 : uint32_t highest_ofs;
50928 :
50929 0 : if (pull->offset > pull->relative_highest_offset) {
50930 0 : highest_ofs = pull->offset;
50931 : } else {
50932 0 : highest_ofs = pull->relative_highest_offset;
50933 : }
50934 0 : if (highest_ofs < pull->data_size) {
50935 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
50936 : "not all bytes consumed ofs[%u] size[%u]",
50937 : highest_ofs, pull->data_size);
50938 0 : TALLOC_FREE(pull);
50939 0 : PyErr_SetNdrError(err);
50940 0 : return NULL;
50941 : }
50942 : }
50943 :
50944 0 : TALLOC_FREE(pull);
50945 0 : Py_RETURN_NONE;
50946 : }
50947 :
50948 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50949 : {
50950 0 : DATA_BLOB blob;
50951 0 : Py_ssize_t blob_length = 0;
50952 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50953 0 : PyObject *bigendian_obj = NULL;
50954 0 : PyObject *ndr64_obj = NULL;
50955 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50956 0 : PyObject *allow_remaining_obj = NULL;
50957 0 : bool allow_remaining = false;
50958 :
50959 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
50960 : discard_const_p(char *, kwnames),
50961 : &blob.data, &blob_length,
50962 : &bigendian_obj,
50963 : &ndr64_obj,
50964 : &allow_remaining_obj)) {
50965 0 : return NULL;
50966 : }
50967 0 : blob.length = blob_length;
50968 :
50969 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50970 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50971 : }
50972 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50973 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50974 : }
50975 :
50976 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50977 0 : allow_remaining = true;
50978 : }
50979 :
50980 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
50981 : }
50982 :
50983 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50984 : {
50985 0 : DATA_BLOB blob;
50986 0 : Py_ssize_t blob_length = 0;
50987 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50988 0 : PyObject *bigendian_obj = NULL;
50989 0 : PyObject *ndr64_obj = NULL;
50990 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50991 0 : PyObject *allow_remaining_obj = NULL;
50992 0 : bool allow_remaining = false;
50993 :
50994 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
50995 : discard_const_p(char *, kwnames),
50996 : &blob.data, &blob_length,
50997 : &bigendian_obj,
50998 : &ndr64_obj,
50999 : &allow_remaining_obj)) {
51000 0 : return NULL;
51001 : }
51002 0 : blob.length = blob_length;
51003 :
51004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51005 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51006 : }
51007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51008 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51009 : }
51010 :
51011 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51012 0 : allow_remaining = true;
51013 : }
51014 :
51015 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
51016 : }
51017 :
51018 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
51019 : {
51020 0 : const struct ndr_interface_call *call = NULL;
51021 0 : struct lsa_lsaRSetForestTrustInformation2 *object = pytalloc_get_ptr(py_obj);
51022 0 : PyObject *ret;
51023 0 : char *retstr;
51024 :
51025 0 : if (ndr_table_lsarpc.num_calls < 134) {
51026 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_lsa_lsaRSetForestTrustInformation2_ndr_print");
51027 0 : return NULL;
51028 : }
51029 0 : call = &ndr_table_lsarpc.calls[133];
51030 :
51031 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
51032 0 : ret = PyUnicode_FromString(retstr);
51033 0 : TALLOC_FREE(retstr);
51034 :
51035 0 : return ret;
51036 : }
51037 :
51038 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51039 : {
51040 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation2_in", NDR_IN);
51041 : }
51042 :
51043 0 : static PyObject *py_lsa_lsaRSetForestTrustInformation2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51044 : {
51045 0 : return py_lsa_lsaRSetForestTrustInformation2_ndr_print(py_obj, "lsa_lsaRSetForestTrustInformation2_out", NDR_OUT);
51046 : }
51047 :
51048 : static PyMethodDef py_lsa_lsaRSetForestTrustInformation2_methods[] = {
51049 : { "opnum", (PyCFunction)py_lsa_lsaRSetForestTrustInformation2_ndr_opnum, METH_NOARGS|METH_CLASS,
51050 : "lsa.lsaRSetForestTrustInformation2.opnum() -> 133 (0x85) " },
51051 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
51052 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
51053 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
51054 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
51055 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
51056 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
51057 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_lsa_lsaRSetForestTrustInformation2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
51058 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
51059 : { "__ndr_print_in__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
51060 : { "__ndr_print_out__", (PyCFunction)py_lsa_lsaRSetForestTrustInformation2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
51061 : { NULL, NULL, 0, NULL }
51062 : };
51063 :
51064 :
51065 : static PyTypeObject lsa_lsaRSetForestTrustInformation2_Type = {
51066 : PyVarObject_HEAD_INIT(NULL, 0)
51067 : .tp_name = "lsa.lsaRSetForestTrustInformation2",
51068 : .tp_getset = py_lsa_lsaRSetForestTrustInformation2_getsetters,
51069 : .tp_methods = py_lsa_lsaRSetForestTrustInformation2_methods,
51070 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51071 : .tp_new = py_lsa_lsaRSetForestTrustInformation2_new,
51072 : };
51073 :
51074 0 : static bool pack_py_lsa_lsaRSetForestTrustInformation2_args_in(PyObject *args, PyObject *kwargs, struct lsa_lsaRSetForestTrustInformation2 *r)
51075 : {
51076 0 : PyObject *py_handle;
51077 0 : PyObject *py_trusted_domain_name;
51078 0 : PyObject *py_highest_record_type;
51079 0 : PyObject *py_forest_trust_info;
51080 0 : PyObject *py_check_only;
51081 0 : const char *kwnames[] = {
51082 : "handle", "trusted_domain_name", "highest_record_type", "forest_trust_info", "check_only", NULL
51083 : };
51084 :
51085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:lsa_lsaRSetForestTrustInformation2", discard_const_p(char *, kwnames), &py_handle, &py_trusted_domain_name, &py_highest_record_type, &py_forest_trust_info, &py_check_only)) {
51086 0 : return false;
51087 : }
51088 :
51089 0 : if (py_handle == NULL) {
51090 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
51091 0 : return false;
51092 : }
51093 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
51094 0 : if (r->in.handle == NULL) {
51095 0 : PyErr_NoMemory();
51096 0 : return false;
51097 : }
51098 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
51099 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
51100 0 : PyErr_NoMemory();
51101 0 : return false;
51102 : }
51103 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
51104 0 : if (py_trusted_domain_name == NULL) {
51105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.trusted_domain_name");
51106 0 : return false;
51107 : }
51108 0 : r->in.trusted_domain_name = talloc_ptrtype(r, r->in.trusted_domain_name);
51109 0 : if (r->in.trusted_domain_name == NULL) {
51110 0 : PyErr_NoMemory();
51111 0 : return false;
51112 : }
51113 0 : PY_CHECK_TYPE(&lsa_StringLarge_Type, py_trusted_domain_name, return false;);
51114 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_trusted_domain_name)) == NULL) {
51115 0 : PyErr_NoMemory();
51116 0 : return false;
51117 : }
51118 0 : r->in.trusted_domain_name = (struct lsa_StringLarge *)pytalloc_get_ptr(py_trusted_domain_name);
51119 0 : if (py_highest_record_type == NULL) {
51120 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.highest_record_type");
51121 0 : return false;
51122 : }
51123 : {
51124 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.highest_record_type));
51125 0 : if (PyLong_Check(py_highest_record_type)) {
51126 0 : unsigned long long test_var;
51127 0 : test_var = PyLong_AsUnsignedLongLong(py_highest_record_type);
51128 0 : if (PyErr_Occurred() != NULL) {
51129 0 : return false;
51130 : }
51131 0 : if (test_var > uint_max) {
51132 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
51133 : PyLong_Type.tp_name, uint_max, test_var);
51134 0 : return false;
51135 : }
51136 0 : r->in.highest_record_type = test_var;
51137 : } else {
51138 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
51139 : PyLong_Type.tp_name);
51140 0 : return false;
51141 : }
51142 : }
51143 0 : if (py_forest_trust_info == NULL) {
51144 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.forest_trust_info");
51145 0 : return false;
51146 : }
51147 0 : r->in.forest_trust_info = talloc_ptrtype(r, r->in.forest_trust_info);
51148 0 : if (r->in.forest_trust_info == NULL) {
51149 0 : PyErr_NoMemory();
51150 0 : return false;
51151 : }
51152 0 : PY_CHECK_TYPE(&lsa_ForestTrustInformation2_Type, py_forest_trust_info, return false;);
51153 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_forest_trust_info)) == NULL) {
51154 0 : PyErr_NoMemory();
51155 0 : return false;
51156 : }
51157 0 : r->in.forest_trust_info = (struct lsa_ForestTrustInformation2 *)pytalloc_get_ptr(py_forest_trust_info);
51158 0 : if (py_check_only == NULL) {
51159 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.check_only");
51160 0 : return false;
51161 : }
51162 : {
51163 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.check_only));
51164 0 : if (PyLong_Check(py_check_only)) {
51165 0 : unsigned long long test_var;
51166 0 : test_var = PyLong_AsUnsignedLongLong(py_check_only);
51167 0 : if (PyErr_Occurred() != NULL) {
51168 0 : return false;
51169 : }
51170 0 : if (test_var > uint_max) {
51171 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
51172 : PyLong_Type.tp_name, uint_max, test_var);
51173 0 : return false;
51174 : }
51175 0 : r->in.check_only = test_var;
51176 : } else {
51177 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
51178 : PyLong_Type.tp_name);
51179 0 : return false;
51180 : }
51181 : }
51182 0 : return true;
51183 : }
51184 :
51185 0 : static PyObject *unpack_py_lsa_lsaRSetForestTrustInformation2_args_out(struct lsa_lsaRSetForestTrustInformation2 *r)
51186 : {
51187 0 : PyObject *result;
51188 0 : PyObject *py_collision_info;
51189 0 : if (*r->out.collision_info == NULL) {
51190 0 : py_collision_info = Py_None;
51191 0 : Py_INCREF(py_collision_info);
51192 : } else {
51193 0 : py_collision_info = pytalloc_reference_ex(&lsa_ForestTrustCollisionInfo_Type, *r->out.collision_info, *r->out.collision_info);
51194 : }
51195 0 : result = py_collision_info;
51196 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
51197 0 : PyErr_SetNTSTATUS(r->out.result);
51198 0 : return NULL;
51199 : }
51200 :
51201 0 : return result;
51202 : }
51203 :
51204 : const struct PyNdrRpcMethodDef py_ndr_lsarpc_methods[] = {
51205 : { "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 },
51206 : { "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 },
51207 : { "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 },
51208 : { "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 },
51209 : { "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 },
51210 : { "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 },
51211 : { "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 },
51212 : { "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 },
51213 : { "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 },
51214 : { "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 },
51215 : { "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 },
51216 : { "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 },
51217 : { "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 },
51218 : { "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 },
51219 : { "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 },
51220 : { "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 },
51221 : { "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 },
51222 : { "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 },
51223 : { "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 },
51224 : { "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 },
51225 : { "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 },
51226 : { "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 },
51227 : { "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 },
51228 : { "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 },
51229 : { "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 },
51230 : { "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 },
51231 : { "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 },
51232 : { "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 },
51233 : { "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 },
51234 : { "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 },
51235 : { "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 },
51236 : { "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 },
51237 : { "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 },
51238 : { "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 },
51239 : { "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 },
51240 : { "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 },
51241 : { "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 },
51242 : { "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 },
51243 : { "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 },
51244 : { "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 },
51245 : { "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 },
51246 : { "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 },
51247 : { "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 },
51248 : { "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 },
51249 : { "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 },
51250 : { "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 },
51251 : { "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 },
51252 : { "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 },
51253 : { "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 },
51254 : { "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 },
51255 : { "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 },
51256 : { "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 },
51257 : { "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 },
51258 : { "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 },
51259 : { "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 },
51260 : { "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 },
51261 : { "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 },
51262 : { "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 },
51263 : { "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 },
51264 : { "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 },
51265 : { "CreateTrustedDomainEx3", "S.CreateTrustedDomainEx3(policy_handle, info, auth_info_internal, access_mask) -> trustdom_handle", (py_dcerpc_call_fn)dcerpc_lsa_CreateTrustedDomainEx3_r, (py_data_pack_fn)pack_py_lsa_CreateTrustedDomainEx3_args_in, (py_data_unpack_fn)unpack_py_lsa_CreateTrustedDomainEx3_args_out, 129, &ndr_table_lsarpc },
51266 : { "OpenPolicy3", "S.OpenPolicy3(system_name, attr, access_mask, in_version, in_revision_info) -> (out_version, out_revision_info, handle)", (py_dcerpc_call_fn)dcerpc_lsa_OpenPolicy3_r, (py_data_pack_fn)pack_py_lsa_OpenPolicy3_args_in, (py_data_unpack_fn)unpack_py_lsa_OpenPolicy3_args_out, 130, &ndr_table_lsarpc },
51267 : { "lsaRQueryForestTrustInformation2", "S.lsaRQueryForestTrustInformation2(handle, trusted_domain_name, highest_record_type) -> forest_trust_info", (py_dcerpc_call_fn)dcerpc_lsa_lsaRQueryForestTrustInformation2_r, (py_data_pack_fn)pack_py_lsa_lsaRQueryForestTrustInformation2_args_in, (py_data_unpack_fn)unpack_py_lsa_lsaRQueryForestTrustInformation2_args_out, 132, &ndr_table_lsarpc },
51268 : { "lsaRSetForestTrustInformation2", "S.lsaRSetForestTrustInformation2(handle, trusted_domain_name, highest_record_type, forest_trust_info, check_only) -> collision_info", (py_dcerpc_call_fn)dcerpc_lsa_lsaRSetForestTrustInformation2_r, (py_data_pack_fn)pack_py_lsa_lsaRSetForestTrustInformation2_args_in, (py_data_unpack_fn)unpack_py_lsa_lsaRSetForestTrustInformation2_args_out, 133, &ndr_table_lsarpc },
51269 : {0}
51270 : };
51271 :
51272 263 : static PyObject *interface_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51273 : {
51274 263 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_lsarpc);
51275 : }
51276 :
51277 : #define PY_DOC_LSARPC "Local Security Authority"
51278 : static PyTypeObject lsarpc_InterfaceType = {
51279 : PyVarObject_HEAD_INIT(NULL, 0)
51280 : .tp_name = "lsa.lsarpc",
51281 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
51282 : .tp_doc = "lsarpc(binding, lp_ctx=None, credentials=None) -> connection\n"
51283 : "\n"
51284 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
51285 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
51286 : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_LSARPC,
51287 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51288 : .tp_new = interface_lsarpc_new,
51289 : };
51290 :
51291 30 : static PyObject *syntax_lsarpc_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51292 : {
51293 30 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_lsarpc.syntax_id);
51294 : }
51295 :
51296 : #define PY_DOC_LSARPC_SYNTAX "Local Security Authority"
51297 : static PyTypeObject lsarpc_SyntaxType = {
51298 : PyVarObject_HEAD_INIT(NULL, 0)
51299 : .tp_name = "lsa.lsarpc_abstract_syntax",
51300 : .tp_doc = "lsarpc_abstract_syntax()\n"PY_DOC_LSARPC_SYNTAX,
51301 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51302 : .tp_new = syntax_lsarpc_new,
51303 : };
51304 :
51305 : static PyMethodDef lsa_methods[] = {
51306 : { NULL, NULL, 0, NULL }
51307 : };
51308 :
51309 : static struct PyModuleDef moduledef = {
51310 : PyModuleDef_HEAD_INIT,
51311 : .m_name = "lsa",
51312 : .m_doc = "lsa DCE/RPC",
51313 : .m_size = -1,
51314 : .m_methods = lsa_methods,
51315 : };
51316 7710 : MODULE_INIT_FUNC(lsa)
51317 : {
51318 7710 : PyObject *m = NULL;
51319 7710 : PyObject *dep_samba_dcerpc_misc = NULL;
51320 7710 : PyObject *dep_samba_dcerpc_security = NULL;
51321 7710 : PyObject *dep_talloc = NULL;
51322 7710 : PyObject *dep_samba_dcerpc_base = NULL;
51323 :
51324 7710 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
51325 7710 : if (dep_samba_dcerpc_misc == NULL)
51326 0 : goto out;
51327 :
51328 7710 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
51329 7710 : if (dep_samba_dcerpc_security == NULL)
51330 0 : goto out;
51331 :
51332 7710 : dep_talloc = PyImport_ImportModule("talloc");
51333 7710 : if (dep_talloc == NULL)
51334 0 : goto out;
51335 :
51336 7710 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
51337 7710 : if (dep_samba_dcerpc_base == NULL)
51338 0 : goto out;
51339 :
51340 7710 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
51341 7710 : if (BaseObject_Type == NULL)
51342 0 : goto out;
51343 :
51344 7710 : security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
51345 7710 : if (security_descriptor_Type == NULL)
51346 0 : goto out;
51347 :
51348 7710 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
51349 7710 : if (dom_sid_Type == NULL)
51350 0 : goto out;
51351 :
51352 7710 : GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
51353 7710 : if (GUID_Type == NULL)
51354 0 : goto out;
51355 :
51356 7710 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
51357 7710 : if (policy_handle_Type == NULL)
51358 0 : goto out;
51359 :
51360 7710 : sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
51361 7710 : if (sec_desc_buf_Type == NULL)
51362 0 : goto out;
51363 :
51364 7710 : ndr_pointer_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ndr_pointer");
51365 7710 : if (ndr_pointer_Type == NULL)
51366 0 : goto out;
51367 :
51368 7710 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
51369 7710 : if (ClientConnection_Type == NULL)
51370 0 : goto out;
51371 :
51372 7710 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
51373 7710 : if (ndr_syntax_id_Type == NULL)
51374 0 : goto out;
51375 :
51376 7710 : lsa_String_Type.tp_base = BaseObject_Type;
51377 7710 : lsa_String_Type.tp_basicsize = pytalloc_BaseObject_size();
51378 :
51379 7710 : lsa_StringLarge_Type.tp_base = BaseObject_Type;
51380 7710 : lsa_StringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
51381 :
51382 7710 : lsa_Strings_Type.tp_base = BaseObject_Type;
51383 7710 : lsa_Strings_Type.tp_basicsize = pytalloc_BaseObject_size();
51384 :
51385 7710 : lsa_AsciiString_Type.tp_base = BaseObject_Type;
51386 7710 : lsa_AsciiString_Type.tp_basicsize = pytalloc_BaseObject_size();
51387 :
51388 7710 : lsa_AsciiStringLarge_Type.tp_base = BaseObject_Type;
51389 7710 : lsa_AsciiStringLarge_Type.tp_basicsize = pytalloc_BaseObject_size();
51390 :
51391 7710 : lsa_BinaryString_Type.tp_base = BaseObject_Type;
51392 7710 : lsa_BinaryString_Type.tp_basicsize = pytalloc_BaseObject_size();
51393 :
51394 7710 : lsa_LUID_Type.tp_base = BaseObject_Type;
51395 7710 : lsa_LUID_Type.tp_basicsize = pytalloc_BaseObject_size();
51396 :
51397 7710 : lsa_PrivEntry_Type.tp_base = BaseObject_Type;
51398 7710 : lsa_PrivEntry_Type.tp_basicsize = pytalloc_BaseObject_size();
51399 :
51400 7710 : lsa_PrivArray_Type.tp_base = BaseObject_Type;
51401 7710 : lsa_PrivArray_Type.tp_basicsize = pytalloc_BaseObject_size();
51402 :
51403 7710 : lsa_QosInfo_Type.tp_base = BaseObject_Type;
51404 7710 : lsa_QosInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51405 :
51406 7710 : lsa_ObjectAttribute_Type.tp_base = BaseObject_Type;
51407 7710 : lsa_ObjectAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
51408 :
51409 7710 : lsa_AuditLogInfo_Type.tp_base = BaseObject_Type;
51410 7710 : lsa_AuditLogInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51411 :
51412 7710 : lsa_AuditEventsInfo_Type.tp_base = BaseObject_Type;
51413 7710 : lsa_AuditEventsInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51414 :
51415 7710 : lsa_DomainInfo_Type.tp_base = BaseObject_Type;
51416 7710 : lsa_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51417 :
51418 7710 : lsa_PDAccountInfo_Type.tp_base = BaseObject_Type;
51419 7710 : lsa_PDAccountInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51420 :
51421 7710 : lsa_ServerRole_Type.tp_base = BaseObject_Type;
51422 7710 : lsa_ServerRole_Type.tp_basicsize = pytalloc_BaseObject_size();
51423 :
51424 7710 : lsa_ReplicaSourceInfo_Type.tp_base = BaseObject_Type;
51425 7710 : lsa_ReplicaSourceInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51426 :
51427 7710 : lsa_DefaultQuotaInfo_Type.tp_base = BaseObject_Type;
51428 7710 : lsa_DefaultQuotaInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51429 :
51430 7710 : lsa_ModificationInfo_Type.tp_base = BaseObject_Type;
51431 7710 : lsa_ModificationInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51432 :
51433 7710 : lsa_AuditFullSetInfo_Type.tp_base = BaseObject_Type;
51434 7710 : lsa_AuditFullSetInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51435 :
51436 7710 : lsa_AuditFullQueryInfo_Type.tp_base = BaseObject_Type;
51437 7710 : lsa_AuditFullQueryInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51438 :
51439 7710 : lsa_DnsDomainInfo_Type.tp_base = BaseObject_Type;
51440 7710 : lsa_DnsDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51441 :
51442 7710 : lsa_PolicyInformation_Type.tp_base = BaseObject_Type;
51443 7710 : lsa_PolicyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
51444 :
51445 7710 : lsa_SidPtr_Type.tp_base = BaseObject_Type;
51446 7710 : lsa_SidPtr_Type.tp_basicsize = pytalloc_BaseObject_size();
51447 :
51448 7710 : lsa_SidArray_Type.tp_base = BaseObject_Type;
51449 7710 : lsa_SidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
51450 :
51451 7710 : lsa_DomainList_Type.tp_base = BaseObject_Type;
51452 7710 : lsa_DomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
51453 :
51454 7710 : lsa_TranslatedSid_Type.tp_base = BaseObject_Type;
51455 7710 : lsa_TranslatedSid_Type.tp_basicsize = pytalloc_BaseObject_size();
51456 :
51457 7710 : lsa_TransSidArray_Type.tp_base = BaseObject_Type;
51458 7710 : lsa_TransSidArray_Type.tp_basicsize = pytalloc_BaseObject_size();
51459 :
51460 7710 : lsa_RefDomainList_Type.tp_base = BaseObject_Type;
51461 7710 : lsa_RefDomainList_Type.tp_basicsize = pytalloc_BaseObject_size();
51462 :
51463 7710 : lsa_TranslatedName_Type.tp_base = BaseObject_Type;
51464 7710 : lsa_TranslatedName_Type.tp_basicsize = pytalloc_BaseObject_size();
51465 :
51466 7710 : lsa_TransNameArray_Type.tp_base = BaseObject_Type;
51467 7710 : lsa_TransNameArray_Type.tp_basicsize = pytalloc_BaseObject_size();
51468 :
51469 7710 : lsa_LUIDAttribute_Type.tp_base = BaseObject_Type;
51470 7710 : lsa_LUIDAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
51471 :
51472 7710 : lsa_PrivilegeSet_Type.tp_base = BaseObject_Type;
51473 7710 : lsa_PrivilegeSet_Type.tp_basicsize = pytalloc_BaseObject_size();
51474 :
51475 7710 : lsa_DATA_BUF_Type.tp_base = BaseObject_Type;
51476 7710 : lsa_DATA_BUF_Type.tp_basicsize = pytalloc_BaseObject_size();
51477 :
51478 7710 : lsa_DATA_BUF2_Type.tp_base = BaseObject_Type;
51479 7710 : lsa_DATA_BUF2_Type.tp_basicsize = pytalloc_BaseObject_size();
51480 :
51481 7710 : lsa_TrustDomainInfoName_Type.tp_base = BaseObject_Type;
51482 7710 : lsa_TrustDomainInfoName_Type.tp_basicsize = pytalloc_BaseObject_size();
51483 :
51484 7710 : lsa_TrustDomainInfoControllers_Type.tp_base = BaseObject_Type;
51485 7710 : lsa_TrustDomainInfoControllers_Type.tp_basicsize = pytalloc_BaseObject_size();
51486 :
51487 7710 : lsa_TrustDomainInfoPosixOffset_Type.tp_base = BaseObject_Type;
51488 7710 : lsa_TrustDomainInfoPosixOffset_Type.tp_basicsize = pytalloc_BaseObject_size();
51489 :
51490 7710 : lsa_TrustDomainInfoPassword_Type.tp_base = BaseObject_Type;
51491 7710 : lsa_TrustDomainInfoPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
51492 :
51493 7710 : lsa_TrustDomainInfoBasic_Type.tp_base = BaseObject_Type;
51494 7710 : lsa_TrustDomainInfoBasic_Type.tp_basicsize = pytalloc_BaseObject_size();
51495 :
51496 7710 : lsa_TrustDomainInfoInfoEx_Type.tp_base = BaseObject_Type;
51497 7710 : lsa_TrustDomainInfoInfoEx_Type.tp_basicsize = pytalloc_BaseObject_size();
51498 :
51499 7710 : lsa_TrustDomainInfoBuffer_Type.tp_base = BaseObject_Type;
51500 7710 : lsa_TrustDomainInfoBuffer_Type.tp_basicsize = pytalloc_BaseObject_size();
51501 :
51502 7710 : lsa_TrustDomainInfoAuthInfo_Type.tp_base = BaseObject_Type;
51503 7710 : lsa_TrustDomainInfoAuthInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51504 :
51505 7710 : lsa_TrustDomainInfoFullInfo_Type.tp_base = BaseObject_Type;
51506 7710 : lsa_TrustDomainInfoFullInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51507 :
51508 7710 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_base = BaseObject_Type;
51509 7710 : lsa_TrustDomainInfoAuthInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
51510 :
51511 7710 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_base = BaseObject_Type;
51512 7710 : lsa_TrustDomainInfoFullInfoInternal_Type.tp_basicsize = pytalloc_BaseObject_size();
51513 :
51514 7710 : lsa_TrustDomainInfoAuthInfoInternalAES_Type.tp_base = BaseObject_Type;
51515 7710 : lsa_TrustDomainInfoAuthInfoInternalAES_Type.tp_basicsize = pytalloc_BaseObject_size();
51516 :
51517 7710 : lsa_TrustDomainInfoFullInfoInternalAES_Type.tp_base = BaseObject_Type;
51518 7710 : lsa_TrustDomainInfoFullInfoInternalAES_Type.tp_basicsize = pytalloc_BaseObject_size();
51519 :
51520 7710 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_base = BaseObject_Type;
51521 7710 : lsa_TrustDomainInfoInfoEx2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
51522 :
51523 7710 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_base = BaseObject_Type;
51524 7710 : lsa_TrustDomainInfoFullInfo2Internal_Type.tp_basicsize = pytalloc_BaseObject_size();
51525 :
51526 7710 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_base = BaseObject_Type;
51527 7710 : lsa_TrustDomainInfoSupportedEncTypes_Type.tp_basicsize = pytalloc_BaseObject_size();
51528 :
51529 7710 : lsa_TrustedDomainInfo_Type.tp_base = BaseObject_Type;
51530 7710 : lsa_TrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51531 :
51532 7710 : lsa_DATA_BUF_PTR_Type.tp_base = BaseObject_Type;
51533 7710 : lsa_DATA_BUF_PTR_Type.tp_basicsize = pytalloc_BaseObject_size();
51534 :
51535 7710 : lsa_RightAttribute_Type.tp_base = BaseObject_Type;
51536 7710 : lsa_RightAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
51537 :
51538 7710 : lsa_RightSet_Type.tp_base = BaseObject_Type;
51539 7710 : lsa_RightSet_Type.tp_basicsize = pytalloc_BaseObject_size();
51540 :
51541 7710 : lsa_DomainListEx_Type.tp_base = BaseObject_Type;
51542 7710 : lsa_DomainListEx_Type.tp_basicsize = pytalloc_BaseObject_size();
51543 :
51544 7710 : lsa_DomainInfoQoS_Type.tp_base = BaseObject_Type;
51545 7710 : lsa_DomainInfoQoS_Type.tp_basicsize = pytalloc_BaseObject_size();
51546 :
51547 7710 : lsa_DomainInfoKerberos_Type.tp_base = BaseObject_Type;
51548 7710 : lsa_DomainInfoKerberos_Type.tp_basicsize = pytalloc_BaseObject_size();
51549 :
51550 7710 : lsa_DomainInfoEfs_Type.tp_base = BaseObject_Type;
51551 7710 : lsa_DomainInfoEfs_Type.tp_basicsize = pytalloc_BaseObject_size();
51552 :
51553 7710 : lsa_DomainInformationPolicy_Type.tp_base = BaseObject_Type;
51554 7710 : lsa_DomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51555 :
51556 7710 : lsa_TranslatedName2_Type.tp_base = BaseObject_Type;
51557 7710 : lsa_TranslatedName2_Type.tp_basicsize = pytalloc_BaseObject_size();
51558 :
51559 7710 : lsa_TransNameArray2_Type.tp_base = BaseObject_Type;
51560 7710 : lsa_TransNameArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
51561 :
51562 7710 : lsa_TranslatedSid2_Type.tp_base = BaseObject_Type;
51563 7710 : lsa_TranslatedSid2_Type.tp_basicsize = pytalloc_BaseObject_size();
51564 :
51565 7710 : lsa_TransSidArray2_Type.tp_base = BaseObject_Type;
51566 7710 : lsa_TransSidArray2_Type.tp_basicsize = pytalloc_BaseObject_size();
51567 :
51568 7710 : lsa_TranslatedSid3_Type.tp_base = BaseObject_Type;
51569 7710 : lsa_TranslatedSid3_Type.tp_basicsize = pytalloc_BaseObject_size();
51570 :
51571 7710 : lsa_TransSidArray3_Type.tp_base = BaseObject_Type;
51572 7710 : lsa_TransSidArray3_Type.tp_basicsize = pytalloc_BaseObject_size();
51573 :
51574 7710 : lsa_ForestTrustBinaryData_Type.tp_base = BaseObject_Type;
51575 7710 : lsa_ForestTrustBinaryData_Type.tp_basicsize = pytalloc_BaseObject_size();
51576 :
51577 7710 : lsa_ForestTrustDomainInfo_Type.tp_base = BaseObject_Type;
51578 7710 : lsa_ForestTrustDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51579 :
51580 7710 : lsa_ForestTrustData_Type.tp_base = BaseObject_Type;
51581 7710 : lsa_ForestTrustData_Type.tp_basicsize = pytalloc_BaseObject_size();
51582 :
51583 7710 : lsa_ForestTrustRecord_Type.tp_base = BaseObject_Type;
51584 7710 : lsa_ForestTrustRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
51585 :
51586 7710 : lsa_ForestTrustInformation_Type.tp_base = BaseObject_Type;
51587 7710 : lsa_ForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
51588 :
51589 7710 : lsa_ForestTrustCollisionRecord_Type.tp_base = BaseObject_Type;
51590 7710 : lsa_ForestTrustCollisionRecord_Type.tp_basicsize = pytalloc_BaseObject_size();
51591 :
51592 7710 : lsa_ForestTrustCollisionInfo_Type.tp_base = BaseObject_Type;
51593 7710 : lsa_ForestTrustCollisionInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51594 :
51595 7710 : lsa_revision_info1_Type.tp_base = BaseObject_Type;
51596 7710 : lsa_revision_info1_Type.tp_basicsize = pytalloc_BaseObject_size();
51597 :
51598 7710 : lsa_revision_info_Type.tp_base = BaseObject_Type;
51599 7710 : lsa_revision_info_Type.tp_basicsize = pytalloc_BaseObject_size();
51600 :
51601 7710 : lsa_ForestTrustData2_Type.tp_base = BaseObject_Type;
51602 7710 : lsa_ForestTrustData2_Type.tp_basicsize = pytalloc_BaseObject_size();
51603 :
51604 7710 : lsa_ForestTrustRecord2_Type.tp_base = BaseObject_Type;
51605 7710 : lsa_ForestTrustRecord2_Type.tp_basicsize = pytalloc_BaseObject_size();
51606 :
51607 7710 : lsa_ForestTrustInformation2_Type.tp_base = BaseObject_Type;
51608 7710 : lsa_ForestTrustInformation2_Type.tp_basicsize = pytalloc_BaseObject_size();
51609 :
51610 7710 : lsa_Close_Type.tp_base = BaseObject_Type;
51611 7710 : lsa_Close_Type.tp_basicsize = pytalloc_BaseObject_size();
51612 :
51613 7710 : lsa_Delete_Type.tp_base = BaseObject_Type;
51614 7710 : lsa_Delete_Type.tp_basicsize = pytalloc_BaseObject_size();
51615 :
51616 7710 : lsa_EnumPrivs_Type.tp_base = BaseObject_Type;
51617 7710 : lsa_EnumPrivs_Type.tp_basicsize = pytalloc_BaseObject_size();
51618 :
51619 7710 : lsa_QuerySecurity_Type.tp_base = BaseObject_Type;
51620 7710 : lsa_QuerySecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
51621 :
51622 7710 : lsa_SetSecObj_Type.tp_base = BaseObject_Type;
51623 7710 : lsa_SetSecObj_Type.tp_basicsize = pytalloc_BaseObject_size();
51624 :
51625 7710 : lsa_OpenPolicy_Type.tp_base = BaseObject_Type;
51626 7710 : lsa_OpenPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51627 :
51628 7710 : lsa_QueryInfoPolicy_Type.tp_base = BaseObject_Type;
51629 7710 : lsa_QueryInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51630 :
51631 7710 : lsa_SetInfoPolicy_Type.tp_base = BaseObject_Type;
51632 7710 : lsa_SetInfoPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51633 :
51634 7710 : lsa_CreateAccount_Type.tp_base = BaseObject_Type;
51635 7710 : lsa_CreateAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51636 :
51637 7710 : lsa_EnumAccounts_Type.tp_base = BaseObject_Type;
51638 7710 : lsa_EnumAccounts_Type.tp_basicsize = pytalloc_BaseObject_size();
51639 :
51640 7710 : lsa_CreateTrustedDomain_Type.tp_base = BaseObject_Type;
51641 7710 : lsa_CreateTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
51642 :
51643 7710 : lsa_EnumTrustDom_Type.tp_base = BaseObject_Type;
51644 7710 : lsa_EnumTrustDom_Type.tp_basicsize = pytalloc_BaseObject_size();
51645 :
51646 7710 : lsa_LookupNames_Type.tp_base = BaseObject_Type;
51647 7710 : lsa_LookupNames_Type.tp_basicsize = pytalloc_BaseObject_size();
51648 :
51649 7710 : lsa_LookupSids_Type.tp_base = BaseObject_Type;
51650 7710 : lsa_LookupSids_Type.tp_basicsize = pytalloc_BaseObject_size();
51651 :
51652 7710 : lsa_CreateSecret_Type.tp_base = BaseObject_Type;
51653 7710 : lsa_CreateSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
51654 :
51655 7710 : lsa_OpenAccount_Type.tp_base = BaseObject_Type;
51656 7710 : lsa_OpenAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51657 :
51658 7710 : lsa_EnumPrivsAccount_Type.tp_base = BaseObject_Type;
51659 7710 : lsa_EnumPrivsAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51660 :
51661 7710 : lsa_AddPrivilegesToAccount_Type.tp_base = BaseObject_Type;
51662 7710 : lsa_AddPrivilegesToAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51663 :
51664 7710 : lsa_RemovePrivilegesFromAccount_Type.tp_base = BaseObject_Type;
51665 7710 : lsa_RemovePrivilegesFromAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51666 :
51667 7710 : lsa_GetSystemAccessAccount_Type.tp_base = BaseObject_Type;
51668 7710 : lsa_GetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51669 :
51670 7710 : lsa_SetSystemAccessAccount_Type.tp_base = BaseObject_Type;
51671 7710 : lsa_SetSystemAccessAccount_Type.tp_basicsize = pytalloc_BaseObject_size();
51672 :
51673 7710 : lsa_OpenTrustedDomain_Type.tp_base = BaseObject_Type;
51674 7710 : lsa_OpenTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
51675 :
51676 7710 : lsa_QueryTrustedDomainInfo_Type.tp_base = BaseObject_Type;
51677 7710 : lsa_QueryTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51678 :
51679 7710 : lsa_SetInformationTrustedDomain_Type.tp_base = BaseObject_Type;
51680 7710 : lsa_SetInformationTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
51681 :
51682 7710 : lsa_OpenSecret_Type.tp_base = BaseObject_Type;
51683 7710 : lsa_OpenSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
51684 :
51685 7710 : lsa_SetSecret_Type.tp_base = BaseObject_Type;
51686 7710 : lsa_SetSecret_Type.tp_basicsize = pytalloc_BaseObject_size();
51687 :
51688 7710 : lsa_QuerySecret_Type.tp_base = BaseObject_Type;
51689 7710 : lsa_QuerySecret_Type.tp_basicsize = pytalloc_BaseObject_size();
51690 :
51691 7710 : lsa_LookupPrivValue_Type.tp_base = BaseObject_Type;
51692 7710 : lsa_LookupPrivValue_Type.tp_basicsize = pytalloc_BaseObject_size();
51693 :
51694 7710 : lsa_LookupPrivName_Type.tp_base = BaseObject_Type;
51695 7710 : lsa_LookupPrivName_Type.tp_basicsize = pytalloc_BaseObject_size();
51696 :
51697 7710 : lsa_LookupPrivDisplayName_Type.tp_base = BaseObject_Type;
51698 7710 : lsa_LookupPrivDisplayName_Type.tp_basicsize = pytalloc_BaseObject_size();
51699 :
51700 7710 : lsa_DeleteObject_Type.tp_base = BaseObject_Type;
51701 7710 : lsa_DeleteObject_Type.tp_basicsize = pytalloc_BaseObject_size();
51702 :
51703 7710 : lsa_EnumAccountsWithUserRight_Type.tp_base = BaseObject_Type;
51704 7710 : lsa_EnumAccountsWithUserRight_Type.tp_basicsize = pytalloc_BaseObject_size();
51705 :
51706 7710 : lsa_EnumAccountRights_Type.tp_base = BaseObject_Type;
51707 7710 : lsa_EnumAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
51708 :
51709 7710 : lsa_AddAccountRights_Type.tp_base = BaseObject_Type;
51710 7710 : lsa_AddAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
51711 :
51712 7710 : lsa_RemoveAccountRights_Type.tp_base = BaseObject_Type;
51713 7710 : lsa_RemoveAccountRights_Type.tp_basicsize = pytalloc_BaseObject_size();
51714 :
51715 7710 : lsa_QueryTrustedDomainInfoBySid_Type.tp_base = BaseObject_Type;
51716 7710 : lsa_QueryTrustedDomainInfoBySid_Type.tp_basicsize = pytalloc_BaseObject_size();
51717 :
51718 7710 : lsa_SetTrustedDomainInfo_Type.tp_base = BaseObject_Type;
51719 7710 : lsa_SetTrustedDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
51720 :
51721 7710 : lsa_DeleteTrustedDomain_Type.tp_base = BaseObject_Type;
51722 7710 : lsa_DeleteTrustedDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
51723 :
51724 7710 : lsa_StorePrivateData_Type.tp_base = BaseObject_Type;
51725 7710 : lsa_StorePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
51726 :
51727 7710 : lsa_RetrievePrivateData_Type.tp_base = BaseObject_Type;
51728 7710 : lsa_RetrievePrivateData_Type.tp_basicsize = pytalloc_BaseObject_size();
51729 :
51730 7710 : lsa_OpenPolicy2_Type.tp_base = BaseObject_Type;
51731 7710 : lsa_OpenPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
51732 :
51733 7710 : lsa_GetUserName_Type.tp_base = BaseObject_Type;
51734 7710 : lsa_GetUserName_Type.tp_basicsize = pytalloc_BaseObject_size();
51735 :
51736 7710 : lsa_QueryInfoPolicy2_Type.tp_base = BaseObject_Type;
51737 7710 : lsa_QueryInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
51738 :
51739 7710 : lsa_SetInfoPolicy2_Type.tp_base = BaseObject_Type;
51740 7710 : lsa_SetInfoPolicy2_Type.tp_basicsize = pytalloc_BaseObject_size();
51741 :
51742 7710 : lsa_QueryTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
51743 7710 : lsa_QueryTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
51744 :
51745 7710 : lsa_SetTrustedDomainInfoByName_Type.tp_base = BaseObject_Type;
51746 7710 : lsa_SetTrustedDomainInfoByName_Type.tp_basicsize = pytalloc_BaseObject_size();
51747 :
51748 7710 : lsa_EnumTrustedDomainsEx_Type.tp_base = BaseObject_Type;
51749 7710 : lsa_EnumTrustedDomainsEx_Type.tp_basicsize = pytalloc_BaseObject_size();
51750 :
51751 7710 : lsa_CreateTrustedDomainEx_Type.tp_base = BaseObject_Type;
51752 7710 : lsa_CreateTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
51753 :
51754 7710 : lsa_CloseTrustedDomainEx_Type.tp_base = BaseObject_Type;
51755 7710 : lsa_CloseTrustedDomainEx_Type.tp_basicsize = pytalloc_BaseObject_size();
51756 :
51757 7710 : lsa_QueryDomainInformationPolicy_Type.tp_base = BaseObject_Type;
51758 7710 : lsa_QueryDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51759 :
51760 7710 : lsa_SetDomainInformationPolicy_Type.tp_base = BaseObject_Type;
51761 7710 : lsa_SetDomainInformationPolicy_Type.tp_basicsize = pytalloc_BaseObject_size();
51762 :
51763 7710 : lsa_OpenTrustedDomainByName_Type.tp_base = BaseObject_Type;
51764 7710 : lsa_OpenTrustedDomainByName_Type.tp_basicsize = pytalloc_BaseObject_size();
51765 :
51766 7710 : lsa_LookupSids2_Type.tp_base = BaseObject_Type;
51767 7710 : lsa_LookupSids2_Type.tp_basicsize = pytalloc_BaseObject_size();
51768 :
51769 7710 : lsa_LookupNames2_Type.tp_base = BaseObject_Type;
51770 7710 : lsa_LookupNames2_Type.tp_basicsize = pytalloc_BaseObject_size();
51771 :
51772 7710 : lsa_CreateTrustedDomainEx2_Type.tp_base = BaseObject_Type;
51773 7710 : lsa_CreateTrustedDomainEx2_Type.tp_basicsize = pytalloc_BaseObject_size();
51774 :
51775 7710 : lsa_LookupNames3_Type.tp_base = BaseObject_Type;
51776 7710 : lsa_LookupNames3_Type.tp_basicsize = pytalloc_BaseObject_size();
51777 :
51778 7710 : lsa_lsaRQueryForestTrustInformation_Type.tp_base = BaseObject_Type;
51779 7710 : lsa_lsaRQueryForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
51780 :
51781 7710 : lsa_lsaRSetForestTrustInformation_Type.tp_base = BaseObject_Type;
51782 7710 : lsa_lsaRSetForestTrustInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
51783 :
51784 7710 : lsa_LookupSids3_Type.tp_base = BaseObject_Type;
51785 7710 : lsa_LookupSids3_Type.tp_basicsize = pytalloc_BaseObject_size();
51786 :
51787 7710 : lsa_LookupNames4_Type.tp_base = BaseObject_Type;
51788 7710 : lsa_LookupNames4_Type.tp_basicsize = pytalloc_BaseObject_size();
51789 :
51790 7710 : lsa_CreateTrustedDomainEx3_Type.tp_base = BaseObject_Type;
51791 7710 : lsa_CreateTrustedDomainEx3_Type.tp_basicsize = pytalloc_BaseObject_size();
51792 :
51793 7710 : lsa_OpenPolicy3_Type.tp_base = BaseObject_Type;
51794 7710 : lsa_OpenPolicy3_Type.tp_basicsize = pytalloc_BaseObject_size();
51795 :
51796 7710 : lsa_lsaRQueryForestTrustInformation2_Type.tp_base = BaseObject_Type;
51797 7710 : lsa_lsaRQueryForestTrustInformation2_Type.tp_basicsize = pytalloc_BaseObject_size();
51798 :
51799 7710 : lsa_lsaRSetForestTrustInformation2_Type.tp_base = BaseObject_Type;
51800 7710 : lsa_lsaRSetForestTrustInformation2_Type.tp_basicsize = pytalloc_BaseObject_size();
51801 :
51802 7710 : lsarpc_InterfaceType.tp_base = ClientConnection_Type;
51803 :
51804 7710 : lsarpc_SyntaxType.tp_base = ndr_syntax_id_Type;
51805 7710 : lsarpc_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
51806 :
51807 7710 : if (PyType_Ready(&lsa_String_Type) < 0)
51808 0 : goto out;
51809 7710 : if (PyType_Ready(&lsa_StringLarge_Type) < 0)
51810 0 : goto out;
51811 7710 : if (PyType_Ready(&lsa_Strings_Type) < 0)
51812 0 : goto out;
51813 7710 : if (PyType_Ready(&lsa_AsciiString_Type) < 0)
51814 0 : goto out;
51815 7710 : if (PyType_Ready(&lsa_AsciiStringLarge_Type) < 0)
51816 0 : goto out;
51817 7710 : if (PyType_Ready(&lsa_BinaryString_Type) < 0)
51818 0 : goto out;
51819 7710 : if (PyType_Ready(&lsa_LUID_Type) < 0)
51820 0 : goto out;
51821 7710 : if (PyType_Ready(&lsa_PrivEntry_Type) < 0)
51822 0 : goto out;
51823 7710 : if (PyType_Ready(&lsa_PrivArray_Type) < 0)
51824 0 : goto out;
51825 7710 : if (PyType_Ready(&lsa_QosInfo_Type) < 0)
51826 0 : goto out;
51827 7710 : if (PyType_Ready(&lsa_ObjectAttribute_Type) < 0)
51828 0 : goto out;
51829 7710 : if (PyType_Ready(&lsa_AuditLogInfo_Type) < 0)
51830 0 : goto out;
51831 7710 : if (PyType_Ready(&lsa_AuditEventsInfo_Type) < 0)
51832 0 : goto out;
51833 7710 : if (PyType_Ready(&lsa_DomainInfo_Type) < 0)
51834 0 : goto out;
51835 7710 : if (PyType_Ready(&lsa_PDAccountInfo_Type) < 0)
51836 0 : goto out;
51837 7710 : if (PyType_Ready(&lsa_ServerRole_Type) < 0)
51838 0 : goto out;
51839 7710 : if (PyType_Ready(&lsa_ReplicaSourceInfo_Type) < 0)
51840 0 : goto out;
51841 7710 : if (PyType_Ready(&lsa_DefaultQuotaInfo_Type) < 0)
51842 0 : goto out;
51843 7710 : if (PyType_Ready(&lsa_ModificationInfo_Type) < 0)
51844 0 : goto out;
51845 7710 : if (PyType_Ready(&lsa_AuditFullSetInfo_Type) < 0)
51846 0 : goto out;
51847 7710 : if (PyType_Ready(&lsa_AuditFullQueryInfo_Type) < 0)
51848 0 : goto out;
51849 7710 : if (PyType_Ready(&lsa_DnsDomainInfo_Type) < 0)
51850 0 : goto out;
51851 7710 : if (PyType_Ready(&lsa_PolicyInformation_Type) < 0)
51852 0 : goto out;
51853 7710 : if (PyType_Ready(&lsa_SidPtr_Type) < 0)
51854 0 : goto out;
51855 7710 : if (PyType_Ready(&lsa_SidArray_Type) < 0)
51856 0 : goto out;
51857 7710 : if (PyType_Ready(&lsa_DomainList_Type) < 0)
51858 0 : goto out;
51859 7710 : if (PyType_Ready(&lsa_TranslatedSid_Type) < 0)
51860 0 : goto out;
51861 7710 : if (PyType_Ready(&lsa_TransSidArray_Type) < 0)
51862 0 : goto out;
51863 7710 : if (PyType_Ready(&lsa_RefDomainList_Type) < 0)
51864 0 : goto out;
51865 7710 : if (PyType_Ready(&lsa_TranslatedName_Type) < 0)
51866 0 : goto out;
51867 7710 : if (PyType_Ready(&lsa_TransNameArray_Type) < 0)
51868 0 : goto out;
51869 7710 : if (PyType_Ready(&lsa_LUIDAttribute_Type) < 0)
51870 0 : goto out;
51871 7710 : if (PyType_Ready(&lsa_PrivilegeSet_Type) < 0)
51872 0 : goto out;
51873 7710 : if (PyType_Ready(&lsa_DATA_BUF_Type) < 0)
51874 0 : goto out;
51875 7710 : if (PyType_Ready(&lsa_DATA_BUF2_Type) < 0)
51876 0 : goto out;
51877 7710 : if (PyType_Ready(&lsa_TrustDomainInfoName_Type) < 0)
51878 0 : goto out;
51879 7710 : if (PyType_Ready(&lsa_TrustDomainInfoControllers_Type) < 0)
51880 0 : goto out;
51881 7710 : if (PyType_Ready(&lsa_TrustDomainInfoPosixOffset_Type) < 0)
51882 0 : goto out;
51883 7710 : if (PyType_Ready(&lsa_TrustDomainInfoPassword_Type) < 0)
51884 0 : goto out;
51885 7710 : if (PyType_Ready(&lsa_TrustDomainInfoBasic_Type) < 0)
51886 0 : goto out;
51887 7710 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx_Type) < 0)
51888 0 : goto out;
51889 7710 : if (PyType_Ready(&lsa_TrustDomainInfoBuffer_Type) < 0)
51890 0 : goto out;
51891 7710 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfo_Type) < 0)
51892 0 : goto out;
51893 7710 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo_Type) < 0)
51894 0 : goto out;
51895 7710 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternal_Type) < 0)
51896 0 : goto out;
51897 7710 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternal_Type) < 0)
51898 0 : goto out;
51899 7710 : if (PyType_Ready(&lsa_TrustDomainInfoAuthInfoInternalAES_Type) < 0)
51900 0 : goto out;
51901 7710 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfoInternalAES_Type) < 0)
51902 0 : goto out;
51903 7710 : if (PyType_Ready(&lsa_TrustDomainInfoInfoEx2Internal_Type) < 0)
51904 0 : goto out;
51905 7710 : if (PyType_Ready(&lsa_TrustDomainInfoFullInfo2Internal_Type) < 0)
51906 0 : goto out;
51907 7710 : if (PyType_Ready(&lsa_TrustDomainInfoSupportedEncTypes_Type) < 0)
51908 0 : goto out;
51909 7710 : if (PyType_Ready(&lsa_TrustedDomainInfo_Type) < 0)
51910 0 : goto out;
51911 7710 : if (PyType_Ready(&lsa_DATA_BUF_PTR_Type) < 0)
51912 0 : goto out;
51913 7710 : if (PyType_Ready(&lsa_RightAttribute_Type) < 0)
51914 0 : goto out;
51915 7710 : if (PyType_Ready(&lsa_RightSet_Type) < 0)
51916 0 : goto out;
51917 7710 : if (PyType_Ready(&lsa_DomainListEx_Type) < 0)
51918 0 : goto out;
51919 7710 : if (PyType_Ready(&lsa_DomainInfoQoS_Type) < 0)
51920 0 : goto out;
51921 7710 : if (PyType_Ready(&lsa_DomainInfoKerberos_Type) < 0)
51922 0 : goto out;
51923 7710 : if (PyType_Ready(&lsa_DomainInfoEfs_Type) < 0)
51924 0 : goto out;
51925 7710 : if (PyType_Ready(&lsa_DomainInformationPolicy_Type) < 0)
51926 0 : goto out;
51927 7710 : if (PyType_Ready(&lsa_TranslatedName2_Type) < 0)
51928 0 : goto out;
51929 7710 : if (PyType_Ready(&lsa_TransNameArray2_Type) < 0)
51930 0 : goto out;
51931 7710 : if (PyType_Ready(&lsa_TranslatedSid2_Type) < 0)
51932 0 : goto out;
51933 7710 : if (PyType_Ready(&lsa_TransSidArray2_Type) < 0)
51934 0 : goto out;
51935 7710 : if (PyType_Ready(&lsa_TranslatedSid3_Type) < 0)
51936 0 : goto out;
51937 7710 : if (PyType_Ready(&lsa_TransSidArray3_Type) < 0)
51938 0 : goto out;
51939 7710 : if (PyType_Ready(&lsa_ForestTrustBinaryData_Type) < 0)
51940 0 : goto out;
51941 7710 : if (PyType_Ready(&lsa_ForestTrustDomainInfo_Type) < 0)
51942 0 : goto out;
51943 7710 : if (PyType_Ready(&lsa_ForestTrustData_Type) < 0)
51944 0 : goto out;
51945 7710 : if (PyType_Ready(&lsa_ForestTrustRecord_Type) < 0)
51946 0 : goto out;
51947 7710 : if (PyType_Ready(&lsa_ForestTrustInformation_Type) < 0)
51948 0 : goto out;
51949 7710 : if (PyType_Ready(&lsa_ForestTrustCollisionRecord_Type) < 0)
51950 0 : goto out;
51951 7710 : if (PyType_Ready(&lsa_ForestTrustCollisionInfo_Type) < 0)
51952 0 : goto out;
51953 7710 : if (PyType_Ready(&lsa_revision_info1_Type) < 0)
51954 0 : goto out;
51955 7710 : if (PyType_Ready(&lsa_revision_info_Type) < 0)
51956 0 : goto out;
51957 7710 : if (PyType_Ready(&lsa_ForestTrustData2_Type) < 0)
51958 0 : goto out;
51959 7710 : if (PyType_Ready(&lsa_ForestTrustRecord2_Type) < 0)
51960 0 : goto out;
51961 7710 : if (PyType_Ready(&lsa_ForestTrustInformation2_Type) < 0)
51962 0 : goto out;
51963 7710 : if (PyType_Ready(&lsa_Close_Type) < 0)
51964 0 : goto out;
51965 7710 : if (PyType_Ready(&lsa_Delete_Type) < 0)
51966 0 : goto out;
51967 7710 : if (PyType_Ready(&lsa_EnumPrivs_Type) < 0)
51968 0 : goto out;
51969 7710 : if (PyType_Ready(&lsa_QuerySecurity_Type) < 0)
51970 0 : goto out;
51971 7710 : if (PyType_Ready(&lsa_SetSecObj_Type) < 0)
51972 0 : goto out;
51973 7710 : if (PyType_Ready(&lsa_OpenPolicy_Type) < 0)
51974 0 : goto out;
51975 7710 : if (PyType_Ready(&lsa_QueryInfoPolicy_Type) < 0)
51976 0 : goto out;
51977 7710 : if (PyType_Ready(&lsa_SetInfoPolicy_Type) < 0)
51978 0 : goto out;
51979 7710 : if (PyType_Ready(&lsa_CreateAccount_Type) < 0)
51980 0 : goto out;
51981 7710 : if (PyType_Ready(&lsa_EnumAccounts_Type) < 0)
51982 0 : goto out;
51983 7710 : if (PyType_Ready(&lsa_CreateTrustedDomain_Type) < 0)
51984 0 : goto out;
51985 7710 : if (PyType_Ready(&lsa_EnumTrustDom_Type) < 0)
51986 0 : goto out;
51987 7710 : if (PyType_Ready(&lsa_LookupNames_Type) < 0)
51988 0 : goto out;
51989 7710 : if (PyType_Ready(&lsa_LookupSids_Type) < 0)
51990 0 : goto out;
51991 7710 : if (PyType_Ready(&lsa_CreateSecret_Type) < 0)
51992 0 : goto out;
51993 7710 : if (PyType_Ready(&lsa_OpenAccount_Type) < 0)
51994 0 : goto out;
51995 7710 : if (PyType_Ready(&lsa_EnumPrivsAccount_Type) < 0)
51996 0 : goto out;
51997 7710 : if (PyType_Ready(&lsa_AddPrivilegesToAccount_Type) < 0)
51998 0 : goto out;
51999 7710 : if (PyType_Ready(&lsa_RemovePrivilegesFromAccount_Type) < 0)
52000 0 : goto out;
52001 7710 : if (PyType_Ready(&lsa_GetSystemAccessAccount_Type) < 0)
52002 0 : goto out;
52003 7710 : if (PyType_Ready(&lsa_SetSystemAccessAccount_Type) < 0)
52004 0 : goto out;
52005 7710 : if (PyType_Ready(&lsa_OpenTrustedDomain_Type) < 0)
52006 0 : goto out;
52007 7710 : if (PyType_Ready(&lsa_QueryTrustedDomainInfo_Type) < 0)
52008 0 : goto out;
52009 7710 : if (PyType_Ready(&lsa_SetInformationTrustedDomain_Type) < 0)
52010 0 : goto out;
52011 7710 : if (PyType_Ready(&lsa_OpenSecret_Type) < 0)
52012 0 : goto out;
52013 7710 : if (PyType_Ready(&lsa_SetSecret_Type) < 0)
52014 0 : goto out;
52015 7710 : if (PyType_Ready(&lsa_QuerySecret_Type) < 0)
52016 0 : goto out;
52017 7710 : if (PyType_Ready(&lsa_LookupPrivValue_Type) < 0)
52018 0 : goto out;
52019 7710 : if (PyType_Ready(&lsa_LookupPrivName_Type) < 0)
52020 0 : goto out;
52021 7710 : if (PyType_Ready(&lsa_LookupPrivDisplayName_Type) < 0)
52022 0 : goto out;
52023 7710 : if (PyType_Ready(&lsa_DeleteObject_Type) < 0)
52024 0 : goto out;
52025 7710 : if (PyType_Ready(&lsa_EnumAccountsWithUserRight_Type) < 0)
52026 0 : goto out;
52027 7710 : if (PyType_Ready(&lsa_EnumAccountRights_Type) < 0)
52028 0 : goto out;
52029 7710 : if (PyType_Ready(&lsa_AddAccountRights_Type) < 0)
52030 0 : goto out;
52031 7710 : if (PyType_Ready(&lsa_RemoveAccountRights_Type) < 0)
52032 0 : goto out;
52033 7710 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoBySid_Type) < 0)
52034 0 : goto out;
52035 7710 : if (PyType_Ready(&lsa_SetTrustedDomainInfo_Type) < 0)
52036 0 : goto out;
52037 7710 : if (PyType_Ready(&lsa_DeleteTrustedDomain_Type) < 0)
52038 0 : goto out;
52039 7710 : if (PyType_Ready(&lsa_StorePrivateData_Type) < 0)
52040 0 : goto out;
52041 7710 : if (PyType_Ready(&lsa_RetrievePrivateData_Type) < 0)
52042 0 : goto out;
52043 7710 : if (PyType_Ready(&lsa_OpenPolicy2_Type) < 0)
52044 0 : goto out;
52045 7710 : if (PyType_Ready(&lsa_GetUserName_Type) < 0)
52046 0 : goto out;
52047 7710 : if (PyType_Ready(&lsa_QueryInfoPolicy2_Type) < 0)
52048 0 : goto out;
52049 7710 : if (PyType_Ready(&lsa_SetInfoPolicy2_Type) < 0)
52050 0 : goto out;
52051 7710 : if (PyType_Ready(&lsa_QueryTrustedDomainInfoByName_Type) < 0)
52052 0 : goto out;
52053 7710 : if (PyType_Ready(&lsa_SetTrustedDomainInfoByName_Type) < 0)
52054 0 : goto out;
52055 7710 : if (PyType_Ready(&lsa_EnumTrustedDomainsEx_Type) < 0)
52056 0 : goto out;
52057 7710 : if (PyType_Ready(&lsa_CreateTrustedDomainEx_Type) < 0)
52058 0 : goto out;
52059 7710 : if (PyType_Ready(&lsa_CloseTrustedDomainEx_Type) < 0)
52060 0 : goto out;
52061 7710 : if (PyType_Ready(&lsa_QueryDomainInformationPolicy_Type) < 0)
52062 0 : goto out;
52063 7710 : if (PyType_Ready(&lsa_SetDomainInformationPolicy_Type) < 0)
52064 0 : goto out;
52065 7710 : if (PyType_Ready(&lsa_OpenTrustedDomainByName_Type) < 0)
52066 0 : goto out;
52067 7710 : if (PyType_Ready(&lsa_LookupSids2_Type) < 0)
52068 0 : goto out;
52069 7710 : if (PyType_Ready(&lsa_LookupNames2_Type) < 0)
52070 0 : goto out;
52071 7710 : if (PyType_Ready(&lsa_CreateTrustedDomainEx2_Type) < 0)
52072 0 : goto out;
52073 7710 : if (PyType_Ready(&lsa_LookupNames3_Type) < 0)
52074 0 : goto out;
52075 7710 : if (PyType_Ready(&lsa_lsaRQueryForestTrustInformation_Type) < 0)
52076 0 : goto out;
52077 7710 : if (PyType_Ready(&lsa_lsaRSetForestTrustInformation_Type) < 0)
52078 0 : goto out;
52079 7710 : if (PyType_Ready(&lsa_LookupSids3_Type) < 0)
52080 0 : goto out;
52081 7710 : if (PyType_Ready(&lsa_LookupNames4_Type) < 0)
52082 0 : goto out;
52083 7710 : if (PyType_Ready(&lsa_CreateTrustedDomainEx3_Type) < 0)
52084 0 : goto out;
52085 7710 : if (PyType_Ready(&lsa_OpenPolicy3_Type) < 0)
52086 0 : goto out;
52087 7710 : if (PyType_Ready(&lsa_lsaRQueryForestTrustInformation2_Type) < 0)
52088 0 : goto out;
52089 7710 : if (PyType_Ready(&lsa_lsaRSetForestTrustInformation2_Type) < 0)
52090 0 : goto out;
52091 7710 : if (PyType_Ready(&lsarpc_InterfaceType) < 0)
52092 0 : goto out;
52093 7710 : if (PyType_Ready(&lsarpc_SyntaxType) < 0)
52094 0 : goto out;
52095 7710 : if (!PyInterface_AddNdrRpcMethods(&lsarpc_InterfaceType, py_ndr_lsarpc_methods))
52096 0 : return NULL;
52097 :
52098 : #ifdef PY_STRING_PATCH
52099 7710 : PY_STRING_PATCH(&lsa_String_Type);
52100 : #endif
52101 : #ifdef PY_STRINGLARGE_PATCH
52102 : PY_STRINGLARGE_PATCH(&lsa_StringLarge_Type);
52103 : #endif
52104 : #ifdef PY_STRINGS_PATCH
52105 : PY_STRINGS_PATCH(&lsa_Strings_Type);
52106 : #endif
52107 : #ifdef PY_ASCIISTRING_PATCH
52108 : PY_ASCIISTRING_PATCH(&lsa_AsciiString_Type);
52109 : #endif
52110 : #ifdef PY_ASCIISTRINGLARGE_PATCH
52111 : PY_ASCIISTRINGLARGE_PATCH(&lsa_AsciiStringLarge_Type);
52112 : #endif
52113 : #ifdef PY_BINARYSTRING_PATCH
52114 : PY_BINARYSTRING_PATCH(&lsa_BinaryString_Type);
52115 : #endif
52116 : #ifdef PY_LUID_PATCH
52117 : PY_LUID_PATCH(&lsa_LUID_Type);
52118 : #endif
52119 : #ifdef PY_PRIVENTRY_PATCH
52120 : PY_PRIVENTRY_PATCH(&lsa_PrivEntry_Type);
52121 : #endif
52122 : #ifdef PY_PRIVARRAY_PATCH
52123 : PY_PRIVARRAY_PATCH(&lsa_PrivArray_Type);
52124 : #endif
52125 : #ifdef PY_QOSINFO_PATCH
52126 : PY_QOSINFO_PATCH(&lsa_QosInfo_Type);
52127 : #endif
52128 : #ifdef PY_OBJECTATTRIBUTE_PATCH
52129 : PY_OBJECTATTRIBUTE_PATCH(&lsa_ObjectAttribute_Type);
52130 : #endif
52131 : #ifdef PY_AUDITLOGINFO_PATCH
52132 : PY_AUDITLOGINFO_PATCH(&lsa_AuditLogInfo_Type);
52133 : #endif
52134 : #ifdef PY_AUDITEVENTSINFO_PATCH
52135 : PY_AUDITEVENTSINFO_PATCH(&lsa_AuditEventsInfo_Type);
52136 : #endif
52137 : #ifdef PY_DOMAININFO_PATCH
52138 : PY_DOMAININFO_PATCH(&lsa_DomainInfo_Type);
52139 : #endif
52140 : #ifdef PY_PDACCOUNTINFO_PATCH
52141 : PY_PDACCOUNTINFO_PATCH(&lsa_PDAccountInfo_Type);
52142 : #endif
52143 : #ifdef PY_SERVERROLE_PATCH
52144 : PY_SERVERROLE_PATCH(&lsa_ServerRole_Type);
52145 : #endif
52146 : #ifdef PY_REPLICASOURCEINFO_PATCH
52147 : PY_REPLICASOURCEINFO_PATCH(&lsa_ReplicaSourceInfo_Type);
52148 : #endif
52149 : #ifdef PY_DEFAULTQUOTAINFO_PATCH
52150 : PY_DEFAULTQUOTAINFO_PATCH(&lsa_DefaultQuotaInfo_Type);
52151 : #endif
52152 : #ifdef PY_MODIFICATIONINFO_PATCH
52153 : PY_MODIFICATIONINFO_PATCH(&lsa_ModificationInfo_Type);
52154 : #endif
52155 : #ifdef PY_AUDITFULLSETINFO_PATCH
52156 : PY_AUDITFULLSETINFO_PATCH(&lsa_AuditFullSetInfo_Type);
52157 : #endif
52158 : #ifdef PY_AUDITFULLQUERYINFO_PATCH
52159 : PY_AUDITFULLQUERYINFO_PATCH(&lsa_AuditFullQueryInfo_Type);
52160 : #endif
52161 : #ifdef PY_DNSDOMAININFO_PATCH
52162 : PY_DNSDOMAININFO_PATCH(&lsa_DnsDomainInfo_Type);
52163 : #endif
52164 : #ifdef PY_POLICYINFORMATION_PATCH
52165 : PY_POLICYINFORMATION_PATCH(&lsa_PolicyInformation_Type);
52166 : #endif
52167 : #ifdef PY_SIDPTR_PATCH
52168 : PY_SIDPTR_PATCH(&lsa_SidPtr_Type);
52169 : #endif
52170 : #ifdef PY_SIDARRAY_PATCH
52171 : PY_SIDARRAY_PATCH(&lsa_SidArray_Type);
52172 : #endif
52173 : #ifdef PY_DOMAINLIST_PATCH
52174 : PY_DOMAINLIST_PATCH(&lsa_DomainList_Type);
52175 : #endif
52176 : #ifdef PY_TRANSLATEDSID_PATCH
52177 : PY_TRANSLATEDSID_PATCH(&lsa_TranslatedSid_Type);
52178 : #endif
52179 : #ifdef PY_TRANSSIDARRAY_PATCH
52180 : PY_TRANSSIDARRAY_PATCH(&lsa_TransSidArray_Type);
52181 : #endif
52182 : #ifdef PY_REFDOMAINLIST_PATCH
52183 : PY_REFDOMAINLIST_PATCH(&lsa_RefDomainList_Type);
52184 : #endif
52185 : #ifdef PY_TRANSLATEDNAME_PATCH
52186 : PY_TRANSLATEDNAME_PATCH(&lsa_TranslatedName_Type);
52187 : #endif
52188 : #ifdef PY_TRANSNAMEARRAY_PATCH
52189 : PY_TRANSNAMEARRAY_PATCH(&lsa_TransNameArray_Type);
52190 : #endif
52191 : #ifdef PY_LUIDATTRIBUTE_PATCH
52192 : PY_LUIDATTRIBUTE_PATCH(&lsa_LUIDAttribute_Type);
52193 : #endif
52194 : #ifdef PY_PRIVILEGESET_PATCH
52195 : PY_PRIVILEGESET_PATCH(&lsa_PrivilegeSet_Type);
52196 : #endif
52197 : #ifdef PY_DATA_BUF_PATCH
52198 : PY_DATA_BUF_PATCH(&lsa_DATA_BUF_Type);
52199 : #endif
52200 : #ifdef PY_DATA_BUF2_PATCH
52201 : PY_DATA_BUF2_PATCH(&lsa_DATA_BUF2_Type);
52202 : #endif
52203 : #ifdef PY_TRUSTDOMAININFONAME_PATCH
52204 : PY_TRUSTDOMAININFONAME_PATCH(&lsa_TrustDomainInfoName_Type);
52205 : #endif
52206 : #ifdef PY_TRUSTDOMAININFOCONTROLLERS_PATCH
52207 : PY_TRUSTDOMAININFOCONTROLLERS_PATCH(&lsa_TrustDomainInfoControllers_Type);
52208 : #endif
52209 : #ifdef PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH
52210 : PY_TRUSTDOMAININFOPOSIXOFFSET_PATCH(&lsa_TrustDomainInfoPosixOffset_Type);
52211 : #endif
52212 : #ifdef PY_TRUSTDOMAININFOPASSWORD_PATCH
52213 : PY_TRUSTDOMAININFOPASSWORD_PATCH(&lsa_TrustDomainInfoPassword_Type);
52214 : #endif
52215 : #ifdef PY_TRUSTDOMAININFOBASIC_PATCH
52216 : PY_TRUSTDOMAININFOBASIC_PATCH(&lsa_TrustDomainInfoBasic_Type);
52217 : #endif
52218 : #ifdef PY_TRUSTDOMAININFOINFOEX_PATCH
52219 : PY_TRUSTDOMAININFOINFOEX_PATCH(&lsa_TrustDomainInfoInfoEx_Type);
52220 : #endif
52221 : #ifdef PY_TRUSTDOMAININFOBUFFER_PATCH
52222 : PY_TRUSTDOMAININFOBUFFER_PATCH(&lsa_TrustDomainInfoBuffer_Type);
52223 : #endif
52224 : #ifdef PY_TRUSTDOMAININFOAUTHINFO_PATCH
52225 : PY_TRUSTDOMAININFOAUTHINFO_PATCH(&lsa_TrustDomainInfoAuthInfo_Type);
52226 : #endif
52227 : #ifdef PY_TRUSTDOMAININFOFULLINFO_PATCH
52228 : PY_TRUSTDOMAININFOFULLINFO_PATCH(&lsa_TrustDomainInfoFullInfo_Type);
52229 : #endif
52230 : #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH
52231 : PY_TRUSTDOMAININFOAUTHINFOINTERNAL_PATCH(&lsa_TrustDomainInfoAuthInfoInternal_Type);
52232 : #endif
52233 : #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH
52234 : PY_TRUSTDOMAININFOFULLINFOINTERNAL_PATCH(&lsa_TrustDomainInfoFullInfoInternal_Type);
52235 : #endif
52236 : #ifdef PY_TRUSTDOMAININFOAUTHINFOINTERNALAES_PATCH
52237 : PY_TRUSTDOMAININFOAUTHINFOINTERNALAES_PATCH(&lsa_TrustDomainInfoAuthInfoInternalAES_Type);
52238 : #endif
52239 : #ifdef PY_TRUSTDOMAININFOFULLINFOINTERNALAES_PATCH
52240 : PY_TRUSTDOMAININFOFULLINFOINTERNALAES_PATCH(&lsa_TrustDomainInfoFullInfoInternalAES_Type);
52241 : #endif
52242 : #ifdef PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH
52243 : PY_TRUSTDOMAININFOINFOEX2INTERNAL_PATCH(&lsa_TrustDomainInfoInfoEx2Internal_Type);
52244 : #endif
52245 : #ifdef PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH
52246 : PY_TRUSTDOMAININFOFULLINFO2INTERNAL_PATCH(&lsa_TrustDomainInfoFullInfo2Internal_Type);
52247 : #endif
52248 : #ifdef PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH
52249 : PY_TRUSTDOMAININFOSUPPORTEDENCTYPES_PATCH(&lsa_TrustDomainInfoSupportedEncTypes_Type);
52250 : #endif
52251 : #ifdef PY_TRUSTEDDOMAININFO_PATCH
52252 : PY_TRUSTEDDOMAININFO_PATCH(&lsa_TrustedDomainInfo_Type);
52253 : #endif
52254 : #ifdef PY_DATA_BUF_PTR_PATCH
52255 : PY_DATA_BUF_PTR_PATCH(&lsa_DATA_BUF_PTR_Type);
52256 : #endif
52257 : #ifdef PY_RIGHTATTRIBUTE_PATCH
52258 : PY_RIGHTATTRIBUTE_PATCH(&lsa_RightAttribute_Type);
52259 : #endif
52260 : #ifdef PY_RIGHTSET_PATCH
52261 : PY_RIGHTSET_PATCH(&lsa_RightSet_Type);
52262 : #endif
52263 : #ifdef PY_DOMAINLISTEX_PATCH
52264 : PY_DOMAINLISTEX_PATCH(&lsa_DomainListEx_Type);
52265 : #endif
52266 : #ifdef PY_DOMAININFOQOS_PATCH
52267 : PY_DOMAININFOQOS_PATCH(&lsa_DomainInfoQoS_Type);
52268 : #endif
52269 : #ifdef PY_DOMAININFOKERBEROS_PATCH
52270 : PY_DOMAININFOKERBEROS_PATCH(&lsa_DomainInfoKerberos_Type);
52271 : #endif
52272 : #ifdef PY_DOMAININFOEFS_PATCH
52273 : PY_DOMAININFOEFS_PATCH(&lsa_DomainInfoEfs_Type);
52274 : #endif
52275 : #ifdef PY_DOMAININFORMATIONPOLICY_PATCH
52276 : PY_DOMAININFORMATIONPOLICY_PATCH(&lsa_DomainInformationPolicy_Type);
52277 : #endif
52278 : #ifdef PY_TRANSLATEDNAME2_PATCH
52279 : PY_TRANSLATEDNAME2_PATCH(&lsa_TranslatedName2_Type);
52280 : #endif
52281 : #ifdef PY_TRANSNAMEARRAY2_PATCH
52282 : PY_TRANSNAMEARRAY2_PATCH(&lsa_TransNameArray2_Type);
52283 : #endif
52284 : #ifdef PY_TRANSLATEDSID2_PATCH
52285 : PY_TRANSLATEDSID2_PATCH(&lsa_TranslatedSid2_Type);
52286 : #endif
52287 : #ifdef PY_TRANSSIDARRAY2_PATCH
52288 : PY_TRANSSIDARRAY2_PATCH(&lsa_TransSidArray2_Type);
52289 : #endif
52290 : #ifdef PY_TRANSLATEDSID3_PATCH
52291 : PY_TRANSLATEDSID3_PATCH(&lsa_TranslatedSid3_Type);
52292 : #endif
52293 : #ifdef PY_TRANSSIDARRAY3_PATCH
52294 : PY_TRANSSIDARRAY3_PATCH(&lsa_TransSidArray3_Type);
52295 : #endif
52296 : #ifdef PY_FORESTTRUSTBINARYDATA_PATCH
52297 : PY_FORESTTRUSTBINARYDATA_PATCH(&lsa_ForestTrustBinaryData_Type);
52298 : #endif
52299 : #ifdef PY_FORESTTRUSTDOMAININFO_PATCH
52300 : PY_FORESTTRUSTDOMAININFO_PATCH(&lsa_ForestTrustDomainInfo_Type);
52301 : #endif
52302 : #ifdef PY_FORESTTRUSTDATA_PATCH
52303 : PY_FORESTTRUSTDATA_PATCH(&lsa_ForestTrustData_Type);
52304 : #endif
52305 : #ifdef PY_FORESTTRUSTRECORD_PATCH
52306 : PY_FORESTTRUSTRECORD_PATCH(&lsa_ForestTrustRecord_Type);
52307 : #endif
52308 : #ifdef PY_FORESTTRUSTINFORMATION_PATCH
52309 : PY_FORESTTRUSTINFORMATION_PATCH(&lsa_ForestTrustInformation_Type);
52310 : #endif
52311 : #ifdef PY_FORESTTRUSTCOLLISIONRECORD_PATCH
52312 : PY_FORESTTRUSTCOLLISIONRECORD_PATCH(&lsa_ForestTrustCollisionRecord_Type);
52313 : #endif
52314 : #ifdef PY_FORESTTRUSTCOLLISIONINFO_PATCH
52315 : PY_FORESTTRUSTCOLLISIONINFO_PATCH(&lsa_ForestTrustCollisionInfo_Type);
52316 : #endif
52317 : #ifdef PY_REVISION_INFO1_PATCH
52318 : PY_REVISION_INFO1_PATCH(&lsa_revision_info1_Type);
52319 : #endif
52320 : #ifdef PY_REVISION_INFO_PATCH
52321 : PY_REVISION_INFO_PATCH(&lsa_revision_info_Type);
52322 : #endif
52323 : #ifdef PY_FORESTTRUSTDATA2_PATCH
52324 : PY_FORESTTRUSTDATA2_PATCH(&lsa_ForestTrustData2_Type);
52325 : #endif
52326 : #ifdef PY_FORESTTRUSTRECORD2_PATCH
52327 : PY_FORESTTRUSTRECORD2_PATCH(&lsa_ForestTrustRecord2_Type);
52328 : #endif
52329 : #ifdef PY_FORESTTRUSTINFORMATION2_PATCH
52330 : PY_FORESTTRUSTINFORMATION2_PATCH(&lsa_ForestTrustInformation2_Type);
52331 : #endif
52332 : #ifdef PY_CLOSE_PATCH
52333 : PY_CLOSE_PATCH(&lsa_Close_Type);
52334 : #endif
52335 : #ifdef PY_DELETE_PATCH
52336 : PY_DELETE_PATCH(&lsa_Delete_Type);
52337 : #endif
52338 : #ifdef PY_ENUMPRIVS_PATCH
52339 : PY_ENUMPRIVS_PATCH(&lsa_EnumPrivs_Type);
52340 : #endif
52341 : #ifdef PY_QUERYSECURITY_PATCH
52342 : PY_QUERYSECURITY_PATCH(&lsa_QuerySecurity_Type);
52343 : #endif
52344 : #ifdef PY_SETSECOBJ_PATCH
52345 : PY_SETSECOBJ_PATCH(&lsa_SetSecObj_Type);
52346 : #endif
52347 : #ifdef PY_OPENPOLICY_PATCH
52348 : PY_OPENPOLICY_PATCH(&lsa_OpenPolicy_Type);
52349 : #endif
52350 : #ifdef PY_QUERYINFOPOLICY_PATCH
52351 : PY_QUERYINFOPOLICY_PATCH(&lsa_QueryInfoPolicy_Type);
52352 : #endif
52353 : #ifdef PY_SETINFOPOLICY_PATCH
52354 : PY_SETINFOPOLICY_PATCH(&lsa_SetInfoPolicy_Type);
52355 : #endif
52356 : #ifdef PY_CREATEACCOUNT_PATCH
52357 : PY_CREATEACCOUNT_PATCH(&lsa_CreateAccount_Type);
52358 : #endif
52359 : #ifdef PY_ENUMACCOUNTS_PATCH
52360 : PY_ENUMACCOUNTS_PATCH(&lsa_EnumAccounts_Type);
52361 : #endif
52362 : #ifdef PY_CREATETRUSTEDDOMAIN_PATCH
52363 : PY_CREATETRUSTEDDOMAIN_PATCH(&lsa_CreateTrustedDomain_Type);
52364 : #endif
52365 : #ifdef PY_ENUMTRUSTDOM_PATCH
52366 : PY_ENUMTRUSTDOM_PATCH(&lsa_EnumTrustDom_Type);
52367 : #endif
52368 : #ifdef PY_LOOKUPNAMES_PATCH
52369 : PY_LOOKUPNAMES_PATCH(&lsa_LookupNames_Type);
52370 : #endif
52371 : #ifdef PY_LOOKUPSIDS_PATCH
52372 : PY_LOOKUPSIDS_PATCH(&lsa_LookupSids_Type);
52373 : #endif
52374 : #ifdef PY_CREATESECRET_PATCH
52375 : PY_CREATESECRET_PATCH(&lsa_CreateSecret_Type);
52376 : #endif
52377 : #ifdef PY_OPENACCOUNT_PATCH
52378 : PY_OPENACCOUNT_PATCH(&lsa_OpenAccount_Type);
52379 : #endif
52380 : #ifdef PY_ENUMPRIVSACCOUNT_PATCH
52381 : PY_ENUMPRIVSACCOUNT_PATCH(&lsa_EnumPrivsAccount_Type);
52382 : #endif
52383 : #ifdef PY_ADDPRIVILEGESTOACCOUNT_PATCH
52384 : PY_ADDPRIVILEGESTOACCOUNT_PATCH(&lsa_AddPrivilegesToAccount_Type);
52385 : #endif
52386 : #ifdef PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH
52387 : PY_REMOVEPRIVILEGESFROMACCOUNT_PATCH(&lsa_RemovePrivilegesFromAccount_Type);
52388 : #endif
52389 : #ifdef PY_GETSYSTEMACCESSACCOUNT_PATCH
52390 : PY_GETSYSTEMACCESSACCOUNT_PATCH(&lsa_GetSystemAccessAccount_Type);
52391 : #endif
52392 : #ifdef PY_SETSYSTEMACCESSACCOUNT_PATCH
52393 : PY_SETSYSTEMACCESSACCOUNT_PATCH(&lsa_SetSystemAccessAccount_Type);
52394 : #endif
52395 : #ifdef PY_OPENTRUSTEDDOMAIN_PATCH
52396 : PY_OPENTRUSTEDDOMAIN_PATCH(&lsa_OpenTrustedDomain_Type);
52397 : #endif
52398 : #ifdef PY_QUERYTRUSTEDDOMAININFO_PATCH
52399 : PY_QUERYTRUSTEDDOMAININFO_PATCH(&lsa_QueryTrustedDomainInfo_Type);
52400 : #endif
52401 : #ifdef PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH
52402 : PY_SETINFORMATIONTRUSTEDDOMAIN_PATCH(&lsa_SetInformationTrustedDomain_Type);
52403 : #endif
52404 : #ifdef PY_OPENSECRET_PATCH
52405 : PY_OPENSECRET_PATCH(&lsa_OpenSecret_Type);
52406 : #endif
52407 : #ifdef PY_SETSECRET_PATCH
52408 : PY_SETSECRET_PATCH(&lsa_SetSecret_Type);
52409 : #endif
52410 : #ifdef PY_QUERYSECRET_PATCH
52411 : PY_QUERYSECRET_PATCH(&lsa_QuerySecret_Type);
52412 : #endif
52413 : #ifdef PY_LOOKUPPRIVVALUE_PATCH
52414 : PY_LOOKUPPRIVVALUE_PATCH(&lsa_LookupPrivValue_Type);
52415 : #endif
52416 : #ifdef PY_LOOKUPPRIVNAME_PATCH
52417 : PY_LOOKUPPRIVNAME_PATCH(&lsa_LookupPrivName_Type);
52418 : #endif
52419 : #ifdef PY_LOOKUPPRIVDISPLAYNAME_PATCH
52420 : PY_LOOKUPPRIVDISPLAYNAME_PATCH(&lsa_LookupPrivDisplayName_Type);
52421 : #endif
52422 : #ifdef PY_DELETEOBJECT_PATCH
52423 : PY_DELETEOBJECT_PATCH(&lsa_DeleteObject_Type);
52424 : #endif
52425 : #ifdef PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH
52426 : PY_ENUMACCOUNTSWITHUSERRIGHT_PATCH(&lsa_EnumAccountsWithUserRight_Type);
52427 : #endif
52428 : #ifdef PY_ENUMACCOUNTRIGHTS_PATCH
52429 : PY_ENUMACCOUNTRIGHTS_PATCH(&lsa_EnumAccountRights_Type);
52430 : #endif
52431 : #ifdef PY_ADDACCOUNTRIGHTS_PATCH
52432 : PY_ADDACCOUNTRIGHTS_PATCH(&lsa_AddAccountRights_Type);
52433 : #endif
52434 : #ifdef PY_REMOVEACCOUNTRIGHTS_PATCH
52435 : PY_REMOVEACCOUNTRIGHTS_PATCH(&lsa_RemoveAccountRights_Type);
52436 : #endif
52437 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH
52438 : PY_QUERYTRUSTEDDOMAININFOBYSID_PATCH(&lsa_QueryTrustedDomainInfoBySid_Type);
52439 : #endif
52440 : #ifdef PY_SETTRUSTEDDOMAININFO_PATCH
52441 : PY_SETTRUSTEDDOMAININFO_PATCH(&lsa_SetTrustedDomainInfo_Type);
52442 : #endif
52443 : #ifdef PY_DELETETRUSTEDDOMAIN_PATCH
52444 : PY_DELETETRUSTEDDOMAIN_PATCH(&lsa_DeleteTrustedDomain_Type);
52445 : #endif
52446 : #ifdef PY_STOREPRIVATEDATA_PATCH
52447 : PY_STOREPRIVATEDATA_PATCH(&lsa_StorePrivateData_Type);
52448 : #endif
52449 : #ifdef PY_RETRIEVEPRIVATEDATA_PATCH
52450 : PY_RETRIEVEPRIVATEDATA_PATCH(&lsa_RetrievePrivateData_Type);
52451 : #endif
52452 : #ifdef PY_OPENPOLICY2_PATCH
52453 : PY_OPENPOLICY2_PATCH(&lsa_OpenPolicy2_Type);
52454 : #endif
52455 : #ifdef PY_GETUSERNAME_PATCH
52456 : PY_GETUSERNAME_PATCH(&lsa_GetUserName_Type);
52457 : #endif
52458 : #ifdef PY_QUERYINFOPOLICY2_PATCH
52459 : PY_QUERYINFOPOLICY2_PATCH(&lsa_QueryInfoPolicy2_Type);
52460 : #endif
52461 : #ifdef PY_SETINFOPOLICY2_PATCH
52462 : PY_SETINFOPOLICY2_PATCH(&lsa_SetInfoPolicy2_Type);
52463 : #endif
52464 : #ifdef PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH
52465 : PY_QUERYTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_QueryTrustedDomainInfoByName_Type);
52466 : #endif
52467 : #ifdef PY_SETTRUSTEDDOMAININFOBYNAME_PATCH
52468 : PY_SETTRUSTEDDOMAININFOBYNAME_PATCH(&lsa_SetTrustedDomainInfoByName_Type);
52469 : #endif
52470 : #ifdef PY_ENUMTRUSTEDDOMAINSEX_PATCH
52471 : PY_ENUMTRUSTEDDOMAINSEX_PATCH(&lsa_EnumTrustedDomainsEx_Type);
52472 : #endif
52473 : #ifdef PY_CREATETRUSTEDDOMAINEX_PATCH
52474 : PY_CREATETRUSTEDDOMAINEX_PATCH(&lsa_CreateTrustedDomainEx_Type);
52475 : #endif
52476 : #ifdef PY_CLOSETRUSTEDDOMAINEX_PATCH
52477 : PY_CLOSETRUSTEDDOMAINEX_PATCH(&lsa_CloseTrustedDomainEx_Type);
52478 : #endif
52479 : #ifdef PY_QUERYDOMAININFORMATIONPOLICY_PATCH
52480 : PY_QUERYDOMAININFORMATIONPOLICY_PATCH(&lsa_QueryDomainInformationPolicy_Type);
52481 : #endif
52482 : #ifdef PY_SETDOMAININFORMATIONPOLICY_PATCH
52483 : PY_SETDOMAININFORMATIONPOLICY_PATCH(&lsa_SetDomainInformationPolicy_Type);
52484 : #endif
52485 : #ifdef PY_OPENTRUSTEDDOMAINBYNAME_PATCH
52486 : PY_OPENTRUSTEDDOMAINBYNAME_PATCH(&lsa_OpenTrustedDomainByName_Type);
52487 : #endif
52488 : #ifdef PY_LOOKUPSIDS2_PATCH
52489 : PY_LOOKUPSIDS2_PATCH(&lsa_LookupSids2_Type);
52490 : #endif
52491 : #ifdef PY_LOOKUPNAMES2_PATCH
52492 : PY_LOOKUPNAMES2_PATCH(&lsa_LookupNames2_Type);
52493 : #endif
52494 : #ifdef PY_CREATETRUSTEDDOMAINEX2_PATCH
52495 : PY_CREATETRUSTEDDOMAINEX2_PATCH(&lsa_CreateTrustedDomainEx2_Type);
52496 : #endif
52497 : #ifdef PY_LOOKUPNAMES3_PATCH
52498 : PY_LOOKUPNAMES3_PATCH(&lsa_LookupNames3_Type);
52499 : #endif
52500 : #ifdef PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH
52501 : PY_LSARQUERYFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRQueryForestTrustInformation_Type);
52502 : #endif
52503 : #ifdef PY_LSARSETFORESTTRUSTINFORMATION_PATCH
52504 : PY_LSARSETFORESTTRUSTINFORMATION_PATCH(&lsa_lsaRSetForestTrustInformation_Type);
52505 : #endif
52506 : #ifdef PY_LOOKUPSIDS3_PATCH
52507 : PY_LOOKUPSIDS3_PATCH(&lsa_LookupSids3_Type);
52508 : #endif
52509 : #ifdef PY_LOOKUPNAMES4_PATCH
52510 : PY_LOOKUPNAMES4_PATCH(&lsa_LookupNames4_Type);
52511 : #endif
52512 : #ifdef PY_CREATETRUSTEDDOMAINEX3_PATCH
52513 : PY_CREATETRUSTEDDOMAINEX3_PATCH(&lsa_CreateTrustedDomainEx3_Type);
52514 : #endif
52515 : #ifdef PY_OPENPOLICY3_PATCH
52516 : PY_OPENPOLICY3_PATCH(&lsa_OpenPolicy3_Type);
52517 : #endif
52518 : #ifdef PY_LSARQUERYFORESTTRUSTINFORMATION2_PATCH
52519 : PY_LSARQUERYFORESTTRUSTINFORMATION2_PATCH(&lsa_lsaRQueryForestTrustInformation2_Type);
52520 : #endif
52521 : #ifdef PY_LSARSETFORESTTRUSTINFORMATION2_PATCH
52522 : PY_LSARSETFORESTTRUSTINFORMATION2_PATCH(&lsa_lsaRSetForestTrustInformation2_Type);
52523 : #endif
52524 : #ifdef PY_LSARPC_PATCH
52525 : PY_LSARPC_PATCH(&lsarpc_InterfaceType);
52526 : #endif
52527 : #ifdef PY_LSARPC_ABSTRACT_SYNTAX_PATCH
52528 : PY_LSARPC_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
52529 : #endif
52530 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
52531 : PY_ABSTRACT_SYNTAX_PATCH(&lsarpc_SyntaxType);
52532 : #endif
52533 :
52534 7710 : m = PyModule_Create(&moduledef);
52535 7710 : if (m == NULL)
52536 0 : goto out;
52537 :
52538 7710 : 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)));
52539 7710 : 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)));
52540 7710 : 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)));
52541 7710 : PyModule_AddObject(m, "LSA_POLICY_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|LSA_POLICY_VIEW_LOCAL_INFORMATION|LSA_POLICY_LOOKUP_NAMES)));
52542 7710 : 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)));
52543 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|LSA_ACCOUNT_VIEW)));
52544 7710 : 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)));
52545 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS)));
52546 7710 : 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)));
52547 7710 : PyModule_AddObject(m, "LSA_SECRET_READ", PyLong_FromLong((LSA_SECRET_QUERY_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
52548 7710 : PyModule_AddObject(m, "LSA_SECRET_WRITE", PyLong_FromLong((LSA_SECRET_SET_VALUE|STANDARD_RIGHTS_READ_ACCESS)));
52549 7710 : PyModule_AddObject(m, "LSA_SECRET_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS)));
52550 7710 : 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)));
52551 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_READ", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|STANDARD_RIGHTS_READ_ACCESS)));
52552 7710 : 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)));
52553 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_EXECUTE", PyLong_FromLong((LSA_TRUSTED_QUERY_DOMAIN_NAME|LSA_TRUSTED_QUERY_POSIX|STANDARD_RIGHTS_READ_ACCESS)));
52554 7710 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_MULTIPLIER", PyLong_FromUnsignedLongLong(60));
52555 7710 : PyModule_AddObject(m, "LSA_REF_DOMAIN_LIST_MULTIPLIER", PyLong_FromUnsignedLongLong(32));
52556 7710 : PyModule_AddObject(m, "LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER", PyLong_FromUnsignedLongLong(82));
52557 7710 : PyModule_AddObject(m, "LSA_TLN_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)((LSA_TLN_DISABLED_NEW|LSA_TLN_DISABLED_ADMIN|LSA_TLN_DISABLED_CONFLICT))));
52558 7710 : PyModule_AddObject(m, "LSA_SID_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)((LSA_SID_DISABLED_ADMIN|LSA_SID_DISABLED_CONFLICT))));
52559 7710 : PyModule_AddObject(m, "LSA_NB_DISABLED_MASK", PyLong_FromUnsignedLongLong((uint32_t)((LSA_NB_DISABLED_ADMIN|LSA_NB_DISABLED_CONFLICT))));
52560 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_RECORD_TYPE_LAST", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FOREST_TRUST_BINARY_DATA)));
52561 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_RECORD2_TYPE_LAST", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FOREST_TRUST_SCANNER_INFO)));
52562 7710 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_NO_DNS", PyLong_FromUnsignedLongLong(0x00000001));
52563 7710 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_DNS", PyLong_FromUnsignedLongLong(0x00000002));
52564 7710 : PyModule_AddObject(m, "LSA_LOOKUP_OPTIONS_NO_ISOLATED", PyLong_FromUnsignedLongLong(0x80000000));
52565 7710 : PyModule_AddObject(m, "LSA_SECURITY_ANONYMOUS", PyLong_FromLong((uint16_t)(LSA_SECURITY_ANONYMOUS)));
52566 7710 : PyModule_AddObject(m, "LSA_SECURITY_IDENTIFICATION", PyLong_FromLong((uint16_t)(LSA_SECURITY_IDENTIFICATION)));
52567 7710 : PyModule_AddObject(m, "LSA_SECURITY_IMPERSONATION", PyLong_FromLong((uint16_t)(LSA_SECURITY_IMPERSONATION)));
52568 7710 : PyModule_AddObject(m, "LSA_SECURITY_DELEGATION", PyLong_FromLong((uint16_t)(LSA_SECURITY_DELEGATION)));
52569 7710 : PyModule_AddObject(m, "LSA_POLICY_VIEW_LOCAL_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_VIEW_LOCAL_INFORMATION)));
52570 7710 : PyModule_AddObject(m, "LSA_POLICY_VIEW_AUDIT_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_VIEW_AUDIT_INFORMATION)));
52571 7710 : PyModule_AddObject(m, "LSA_POLICY_GET_PRIVATE_INFORMATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_GET_PRIVATE_INFORMATION)));
52572 7710 : PyModule_AddObject(m, "LSA_POLICY_TRUST_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_TRUST_ADMIN)));
52573 7710 : PyModule_AddObject(m, "LSA_POLICY_CREATE_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_CREATE_ACCOUNT)));
52574 7710 : PyModule_AddObject(m, "LSA_POLICY_CREATE_SECRET", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_CREATE_SECRET)));
52575 7710 : PyModule_AddObject(m, "LSA_POLICY_CREATE_PRIVILEGE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_CREATE_PRIVILEGE)));
52576 7710 : PyModule_AddObject(m, "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS)));
52577 7710 : PyModule_AddObject(m, "LSA_POLICY_SET_AUDIT_REQUIREMENTS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_SET_AUDIT_REQUIREMENTS)));
52578 7710 : PyModule_AddObject(m, "LSA_POLICY_AUDIT_LOG_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_AUDIT_LOG_ADMIN)));
52579 7710 : PyModule_AddObject(m, "LSA_POLICY_SERVER_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_SERVER_ADMIN)));
52580 7710 : PyModule_AddObject(m, "LSA_POLICY_LOOKUP_NAMES", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_LOOKUP_NAMES)));
52581 7710 : PyModule_AddObject(m, "LSA_POLICY_NOTIFICATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_NOTIFICATION)));
52582 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_VIEW", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ACCOUNT_VIEW)));
52583 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_PRIVILEGES", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ACCOUNT_ADJUST_PRIVILEGES)));
52584 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_QUOTAS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ACCOUNT_ADJUST_QUOTAS)));
52585 7710 : PyModule_AddObject(m, "LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS)));
52586 7710 : PyModule_AddObject(m, "LSA_SECRET_SET_VALUE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SECRET_SET_VALUE)));
52587 7710 : PyModule_AddObject(m, "LSA_SECRET_QUERY_VALUE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SECRET_QUERY_VALUE)));
52588 7710 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_DOMAIN_NAME", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_QUERY_DOMAIN_NAME)));
52589 7710 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_QUERY_CONTROLLERS)));
52590 7710 : PyModule_AddObject(m, "LSA_TRUSTED_SET_CONTROLLERS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_SET_CONTROLLERS)));
52591 7710 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_POSIX", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_QUERY_POSIX)));
52592 7710 : PyModule_AddObject(m, "LSA_TRUSTED_SET_POSIX", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_SET_POSIX)));
52593 7710 : PyModule_AddObject(m, "LSA_TRUSTED_SET_AUTH", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_SET_AUTH)));
52594 7710 : PyModule_AddObject(m, "LSA_TRUSTED_QUERY_AUTH", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUSTED_QUERY_AUTH)));
52595 7710 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_NONE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_AUDIT_POLICY_NONE)));
52596 7710 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_SUCCESS", PyLong_FromUnsignedLongLong((uint32_t)(LSA_AUDIT_POLICY_SUCCESS)));
52597 7710 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_FAILURE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_AUDIT_POLICY_FAILURE)));
52598 7710 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_ALL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_AUDIT_POLICY_ALL)));
52599 7710 : PyModule_AddObject(m, "LSA_AUDIT_POLICY_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)(LSA_AUDIT_POLICY_CLEAR)));
52600 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SYSTEM", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_SYSTEM)));
52601 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_LOGON", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_LOGON)));
52602 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS)));
52603 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS)));
52604 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_PROCCESS_TRACKING", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_PROCCESS_TRACKING)));
52605 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES)));
52606 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT)));
52607 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS)));
52608 7710 : PyModule_AddObject(m, "LSA_AUDIT_CATEGORY_ACCOUNT_LOGON", PyLong_FromLong((uint16_t)(LSA_AUDIT_CATEGORY_ACCOUNT_LOGON)));
52609 7710 : PyModule_AddObject(m, "LSA_ROLE_BACKUP", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ROLE_BACKUP)));
52610 7710 : PyModule_AddObject(m, "LSA_ROLE_PRIMARY", PyLong_FromUnsignedLongLong((uint32_t)(LSA_ROLE_PRIMARY)));
52611 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_LOG", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_AUDIT_LOG)));
52612 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_EVENTS", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_AUDIT_EVENTS)));
52613 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_DOMAIN", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_DOMAIN)));
52614 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_PD", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_PD)));
52615 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_ACCOUNT_DOMAIN)));
52616 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_ROLE", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_ROLE)));
52617 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_REPLICA", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_REPLICA)));
52618 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_QUOTA", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_QUOTA)));
52619 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_MOD", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_MOD)));
52620 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_SET", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_AUDIT_FULL_SET)));
52621 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_AUDIT_FULL_QUERY", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_AUDIT_FULL_QUERY)));
52622 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_DNS)));
52623 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_DNS_INT", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_DNS_INT)));
52624 7710 : PyModule_AddObject(m, "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN", PyLong_FromLong((uint16_t)(LSA_POLICY_INFO_L_ACCOUNT_DOMAIN)));
52625 7710 : PyModule_AddObject(m, "SID_NAME_USE_NONE", PyLong_FromLong((uint16_t)(SID_NAME_USE_NONE)));
52626 7710 : PyModule_AddObject(m, "SID_NAME_USER", PyLong_FromLong((uint16_t)(SID_NAME_USER)));
52627 7710 : PyModule_AddObject(m, "SID_NAME_DOM_GRP", PyLong_FromLong((uint16_t)(SID_NAME_DOM_GRP)));
52628 7710 : PyModule_AddObject(m, "SID_NAME_DOMAIN", PyLong_FromLong((uint16_t)(SID_NAME_DOMAIN)));
52629 7710 : PyModule_AddObject(m, "SID_NAME_ALIAS", PyLong_FromLong((uint16_t)(SID_NAME_ALIAS)));
52630 7710 : PyModule_AddObject(m, "SID_NAME_WKN_GRP", PyLong_FromLong((uint16_t)(SID_NAME_WKN_GRP)));
52631 7710 : PyModule_AddObject(m, "SID_NAME_DELETED", PyLong_FromLong((uint16_t)(SID_NAME_DELETED)));
52632 7710 : PyModule_AddObject(m, "SID_NAME_INVALID", PyLong_FromLong((uint16_t)(SID_NAME_INVALID)));
52633 7710 : PyModule_AddObject(m, "SID_NAME_UNKNOWN", PyLong_FromLong((uint16_t)(SID_NAME_UNKNOWN)));
52634 7710 : PyModule_AddObject(m, "SID_NAME_COMPUTER", PyLong_FromLong((uint16_t)(SID_NAME_COMPUTER)));
52635 7710 : PyModule_AddObject(m, "SID_NAME_LABEL", PyLong_FromLong((uint16_t)(SID_NAME_LABEL)));
52636 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_ALL", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_ALL)));
52637 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_DOMAINS_ONLY", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_DOMAINS_ONLY)));
52638 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY)));
52639 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY)));
52640 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY)));
52641 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2)));
52642 7710 : PyModule_AddObject(m, "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC", PyLong_FromLong((uint16_t)(LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC)));
52643 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_NAME", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_NAME)));
52644 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)));
52645 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)));
52646 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_PASSWORD", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)));
52647 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_BASIC", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_BASIC)));
52648 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)));
52649 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)));
52650 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)));
52651 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)));
52652 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)));
52653 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)));
52654 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)));
52655 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES)));
52656 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL_AES", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL_AES)));
52657 7710 : PyModule_AddObject(m, "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL_AES", PyLong_FromLong((uint16_t)(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL_AES)));
52658 7710 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_INBOUND", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_DIRECTION_INBOUND)));
52659 7710 : PyModule_AddObject(m, "LSA_TRUST_DIRECTION_OUTBOUND", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_DIRECTION_OUTBOUND)));
52660 7710 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DOWNLEVEL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_TYPE_DOWNLEVEL)));
52661 7710 : PyModule_AddObject(m, "LSA_TRUST_TYPE_UPLEVEL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_TYPE_UPLEVEL)));
52662 7710 : PyModule_AddObject(m, "LSA_TRUST_TYPE_MIT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_TYPE_MIT)));
52663 7710 : PyModule_AddObject(m, "LSA_TRUST_TYPE_DCE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_TYPE_DCE)));
52664 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE)));
52665 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY)));
52666 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN)));
52667 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE)));
52668 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION)));
52669 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_WITHIN_FOREST)));
52670 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL)));
52671 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION)));
52672 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION)));
52673 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_PIM_TRUST", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_PIM_TRUST)));
52674 7710 : PyModule_AddObject(m, "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION)));
52675 7710 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NONE", PyLong_FromUnsignedLongLong((uint32_t)(TRUST_AUTH_TYPE_NONE)));
52676 7710 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_NT4OWF", PyLong_FromUnsignedLongLong((uint32_t)(TRUST_AUTH_TYPE_NT4OWF)));
52677 7710 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)(TRUST_AUTH_TYPE_CLEAR)));
52678 7710 : PyModule_AddObject(m, "TRUST_AUTH_TYPE_VERSION", PyLong_FromUnsignedLongLong((uint32_t)(TRUST_AUTH_TYPE_VERSION)));
52679 7710 : PyModule_AddObject(m, "LSA_POLICY_KERBEROS_VALIDATE_CLIENT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_POLICY_KERBEROS_VALIDATE_CLIENT)));
52680 7710 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_QOS", PyLong_FromLong((uint16_t)(LSA_DOMAIN_INFO_POLICY_QOS)));
52681 7710 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_EFS", PyLong_FromLong((uint16_t)(LSA_DOMAIN_INFO_POLICY_EFS)));
52682 7710 : PyModule_AddObject(m, "LSA_DOMAIN_INFO_POLICY_KERBEROS", PyLong_FromLong((uint16_t)(LSA_DOMAIN_INFO_POLICY_KERBEROS)));
52683 7710 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES", PyLong_FromUnsignedLongLong((uint32_t)(LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES)));
52684 7710 : PyModule_AddObject(m, "LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)(LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL)));
52685 7710 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_1", PyLong_FromUnsignedLongLong((uint32_t)(LSA_CLIENT_REVISION_1)));
52686 7710 : PyModule_AddObject(m, "LSA_CLIENT_REVISION_2", PyLong_FromUnsignedLongLong((uint32_t)(LSA_CLIENT_REVISION_2)));
52687 7710 : PyModule_AddObject(m, "LSA_TLN_DISABLED_NEW", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_NEW)));
52688 7710 : PyModule_AddObject(m, "LSA_TLN_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_ADMIN)));
52689 7710 : PyModule_AddObject(m, "LSA_TLN_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_TLN_DISABLED_CONFLICT)));
52690 7710 : PyModule_AddObject(m, "LSA_SID_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SID_DISABLED_ADMIN)));
52691 7710 : PyModule_AddObject(m, "LSA_SID_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_SID_DISABLED_CONFLICT)));
52692 7710 : PyModule_AddObject(m, "LSA_NB_DISABLED_ADMIN", PyLong_FromUnsignedLongLong((uint32_t)(LSA_NB_DISABLED_ADMIN)));
52693 7710 : PyModule_AddObject(m, "LSA_NB_DISABLED_CONFLICT", PyLong_FromUnsignedLongLong((uint32_t)(LSA_NB_DISABLED_CONFLICT)));
52694 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME", PyLong_FromLong((uint16_t)(LSA_FOREST_TRUST_TOP_LEVEL_NAME)));
52695 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX", PyLong_FromLong((uint16_t)(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)));
52696 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_DOMAIN_INFO", PyLong_FromLong((uint16_t)(LSA_FOREST_TRUST_DOMAIN_INFO)));
52697 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_BINARY_DATA", PyLong_FromLong((uint16_t)(LSA_FOREST_TRUST_BINARY_DATA)));
52698 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_SCANNER_INFO", PyLong_FromLong((uint16_t)(LSA_FOREST_TRUST_SCANNER_INFO)));
52699 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_TDO", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FOREST_TRUST_COLLISION_TDO)));
52700 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_XREF", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FOREST_TRUST_COLLISION_XREF)));
52701 7710 : PyModule_AddObject(m, "LSA_FOREST_TRUST_COLLISION_OTHER", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FOREST_TRUST_COLLISION_OTHER)));
52702 7710 : PyModule_AddObject(m, "LSA_FEATURE_TDO_AUTH_INFO_AES_CIPHER", PyLong_FromUnsignedLongLong((uint32_t)(LSA_FEATURE_TDO_AUTH_INFO_AES_CIPHER)));
52703 6441 : Py_INCREF((PyObject *)(void *)&lsa_String_Type);
52704 7710 : PyModule_AddObject(m, "String", (PyObject *)(void *)&lsa_String_Type);
52705 6441 : Py_INCREF((PyObject *)(void *)&lsa_StringLarge_Type);
52706 7710 : PyModule_AddObject(m, "StringLarge", (PyObject *)(void *)&lsa_StringLarge_Type);
52707 6441 : Py_INCREF((PyObject *)(void *)&lsa_Strings_Type);
52708 7710 : PyModule_AddObject(m, "Strings", (PyObject *)(void *)&lsa_Strings_Type);
52709 6441 : Py_INCREF((PyObject *)(void *)&lsa_AsciiString_Type);
52710 7710 : PyModule_AddObject(m, "AsciiString", (PyObject *)(void *)&lsa_AsciiString_Type);
52711 6441 : Py_INCREF((PyObject *)(void *)&lsa_AsciiStringLarge_Type);
52712 7710 : PyModule_AddObject(m, "AsciiStringLarge", (PyObject *)(void *)&lsa_AsciiStringLarge_Type);
52713 6441 : Py_INCREF((PyObject *)(void *)&lsa_BinaryString_Type);
52714 7710 : PyModule_AddObject(m, "BinaryString", (PyObject *)(void *)&lsa_BinaryString_Type);
52715 6441 : Py_INCREF((PyObject *)(void *)&lsa_LUID_Type);
52716 7710 : PyModule_AddObject(m, "LUID", (PyObject *)(void *)&lsa_LUID_Type);
52717 6441 : Py_INCREF((PyObject *)(void *)&lsa_PrivEntry_Type);
52718 7710 : PyModule_AddObject(m, "PrivEntry", (PyObject *)(void *)&lsa_PrivEntry_Type);
52719 6441 : Py_INCREF((PyObject *)(void *)&lsa_PrivArray_Type);
52720 7710 : PyModule_AddObject(m, "PrivArray", (PyObject *)(void *)&lsa_PrivArray_Type);
52721 6441 : Py_INCREF((PyObject *)(void *)&lsa_QosInfo_Type);
52722 7710 : PyModule_AddObject(m, "QosInfo", (PyObject *)(void *)&lsa_QosInfo_Type);
52723 6441 : Py_INCREF((PyObject *)(void *)&lsa_ObjectAttribute_Type);
52724 7710 : PyModule_AddObject(m, "ObjectAttribute", (PyObject *)(void *)&lsa_ObjectAttribute_Type);
52725 6441 : Py_INCREF((PyObject *)(void *)&lsa_AuditLogInfo_Type);
52726 7710 : PyModule_AddObject(m, "AuditLogInfo", (PyObject *)(void *)&lsa_AuditLogInfo_Type);
52727 6441 : Py_INCREF((PyObject *)(void *)&lsa_AuditEventsInfo_Type);
52728 7710 : PyModule_AddObject(m, "AuditEventsInfo", (PyObject *)(void *)&lsa_AuditEventsInfo_Type);
52729 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfo_Type);
52730 7710 : PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&lsa_DomainInfo_Type);
52731 6441 : Py_INCREF((PyObject *)(void *)&lsa_PDAccountInfo_Type);
52732 7710 : PyModule_AddObject(m, "PDAccountInfo", (PyObject *)(void *)&lsa_PDAccountInfo_Type);
52733 6441 : Py_INCREF((PyObject *)(void *)&lsa_ServerRole_Type);
52734 7710 : PyModule_AddObject(m, "ServerRole", (PyObject *)(void *)&lsa_ServerRole_Type);
52735 6441 : Py_INCREF((PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
52736 7710 : PyModule_AddObject(m, "ReplicaSourceInfo", (PyObject *)(void *)&lsa_ReplicaSourceInfo_Type);
52737 6441 : Py_INCREF((PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
52738 7710 : PyModule_AddObject(m, "DefaultQuotaInfo", (PyObject *)(void *)&lsa_DefaultQuotaInfo_Type);
52739 6441 : Py_INCREF((PyObject *)(void *)&lsa_ModificationInfo_Type);
52740 7710 : PyModule_AddObject(m, "ModificationInfo", (PyObject *)(void *)&lsa_ModificationInfo_Type);
52741 6441 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
52742 7710 : PyModule_AddObject(m, "AuditFullSetInfo", (PyObject *)(void *)&lsa_AuditFullSetInfo_Type);
52743 6441 : Py_INCREF((PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
52744 7710 : PyModule_AddObject(m, "AuditFullQueryInfo", (PyObject *)(void *)&lsa_AuditFullQueryInfo_Type);
52745 6441 : Py_INCREF((PyObject *)(void *)&lsa_DnsDomainInfo_Type);
52746 7710 : PyModule_AddObject(m, "DnsDomainInfo", (PyObject *)(void *)&lsa_DnsDomainInfo_Type);
52747 6441 : Py_INCREF((PyObject *)(void *)&lsa_PolicyInformation_Type);
52748 7710 : PyModule_AddObject(m, "PolicyInformation", (PyObject *)(void *)&lsa_PolicyInformation_Type);
52749 6441 : Py_INCREF((PyObject *)(void *)&lsa_SidPtr_Type);
52750 7710 : PyModule_AddObject(m, "SidPtr", (PyObject *)(void *)&lsa_SidPtr_Type);
52751 6441 : Py_INCREF((PyObject *)(void *)&lsa_SidArray_Type);
52752 7710 : PyModule_AddObject(m, "SidArray", (PyObject *)(void *)&lsa_SidArray_Type);
52753 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainList_Type);
52754 7710 : PyModule_AddObject(m, "DomainList", (PyObject *)(void *)&lsa_DomainList_Type);
52755 6441 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid_Type);
52756 7710 : PyModule_AddObject(m, "TranslatedSid", (PyObject *)(void *)&lsa_TranslatedSid_Type);
52757 6441 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray_Type);
52758 7710 : PyModule_AddObject(m, "TransSidArray", (PyObject *)(void *)&lsa_TransSidArray_Type);
52759 6441 : Py_INCREF((PyObject *)(void *)&lsa_RefDomainList_Type);
52760 7710 : PyModule_AddObject(m, "RefDomainList", (PyObject *)(void *)&lsa_RefDomainList_Type);
52761 6441 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName_Type);
52762 7710 : PyModule_AddObject(m, "TranslatedName", (PyObject *)(void *)&lsa_TranslatedName_Type);
52763 6441 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray_Type);
52764 7710 : PyModule_AddObject(m, "TransNameArray", (PyObject *)(void *)&lsa_TransNameArray_Type);
52765 6441 : Py_INCREF((PyObject *)(void *)&lsa_LUIDAttribute_Type);
52766 7710 : PyModule_AddObject(m, "LUIDAttribute", (PyObject *)(void *)&lsa_LUIDAttribute_Type);
52767 6441 : Py_INCREF((PyObject *)(void *)&lsa_PrivilegeSet_Type);
52768 7710 : PyModule_AddObject(m, "PrivilegeSet", (PyObject *)(void *)&lsa_PrivilegeSet_Type);
52769 6441 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_Type);
52770 7710 : PyModule_AddObject(m, "DATA_BUF", (PyObject *)(void *)&lsa_DATA_BUF_Type);
52771 6441 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF2_Type);
52772 7710 : PyModule_AddObject(m, "DATA_BUF2", (PyObject *)(void *)&lsa_DATA_BUF2_Type);
52773 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
52774 7710 : PyModule_AddObject(m, "TrustDomainInfoName", (PyObject *)(void *)&lsa_TrustDomainInfoName_Type);
52775 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
52776 7710 : PyModule_AddObject(m, "TrustDomainInfoControllers", (PyObject *)(void *)&lsa_TrustDomainInfoControllers_Type);
52777 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
52778 7710 : PyModule_AddObject(m, "TrustDomainInfoPosixOffset", (PyObject *)(void *)&lsa_TrustDomainInfoPosixOffset_Type);
52779 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
52780 7710 : PyModule_AddObject(m, "TrustDomainInfoPassword", (PyObject *)(void *)&lsa_TrustDomainInfoPassword_Type);
52781 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
52782 7710 : PyModule_AddObject(m, "TrustDomainInfoBasic", (PyObject *)(void *)&lsa_TrustDomainInfoBasic_Type);
52783 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
52784 7710 : PyModule_AddObject(m, "TrustDomainInfoInfoEx", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx_Type);
52785 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
52786 7710 : PyModule_AddObject(m, "TrustDomainInfoBuffer", (PyObject *)(void *)&lsa_TrustDomainInfoBuffer_Type);
52787 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
52788 7710 : PyModule_AddObject(m, "TrustDomainInfoAuthInfo", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfo_Type);
52789 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
52790 7710 : PyModule_AddObject(m, "TrustDomainInfoFullInfo", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo_Type);
52791 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
52792 7710 : PyModule_AddObject(m, "TrustDomainInfoAuthInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternal_Type);
52793 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
52794 7710 : PyModule_AddObject(m, "TrustDomainInfoFullInfoInternal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternal_Type);
52795 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternalAES_Type);
52796 7710 : PyModule_AddObject(m, "TrustDomainInfoAuthInfoInternalAES", (PyObject *)(void *)&lsa_TrustDomainInfoAuthInfoInternalAES_Type);
52797 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternalAES_Type);
52798 7710 : PyModule_AddObject(m, "TrustDomainInfoFullInfoInternalAES", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfoInternalAES_Type);
52799 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
52800 7710 : PyModule_AddObject(m, "TrustDomainInfoInfoEx2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoInfoEx2Internal_Type);
52801 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
52802 7710 : PyModule_AddObject(m, "TrustDomainInfoFullInfo2Internal", (PyObject *)(void *)&lsa_TrustDomainInfoFullInfo2Internal_Type);
52803 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
52804 7710 : PyModule_AddObject(m, "TrustDomainInfoSupportedEncTypes", (PyObject *)(void *)&lsa_TrustDomainInfoSupportedEncTypes_Type);
52805 6441 : Py_INCREF((PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
52806 7710 : PyModule_AddObject(m, "TrustedDomainInfo", (PyObject *)(void *)&lsa_TrustedDomainInfo_Type);
52807 6441 : Py_INCREF((PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
52808 7710 : PyModule_AddObject(m, "DATA_BUF_PTR", (PyObject *)(void *)&lsa_DATA_BUF_PTR_Type);
52809 6441 : Py_INCREF((PyObject *)(void *)&lsa_RightAttribute_Type);
52810 7710 : PyModule_AddObject(m, "RightAttribute", (PyObject *)(void *)&lsa_RightAttribute_Type);
52811 6441 : Py_INCREF((PyObject *)(void *)&lsa_RightSet_Type);
52812 7710 : PyModule_AddObject(m, "RightSet", (PyObject *)(void *)&lsa_RightSet_Type);
52813 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainListEx_Type);
52814 7710 : PyModule_AddObject(m, "DomainListEx", (PyObject *)(void *)&lsa_DomainListEx_Type);
52815 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoQoS_Type);
52816 7710 : PyModule_AddObject(m, "DomainInfoQoS", (PyObject *)(void *)&lsa_DomainInfoQoS_Type);
52817 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
52818 7710 : PyModule_AddObject(m, "DomainInfoKerberos", (PyObject *)(void *)&lsa_DomainInfoKerberos_Type);
52819 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainInfoEfs_Type);
52820 7710 : PyModule_AddObject(m, "DomainInfoEfs", (PyObject *)(void *)&lsa_DomainInfoEfs_Type);
52821 6441 : Py_INCREF((PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
52822 7710 : PyModule_AddObject(m, "DomainInformationPolicy", (PyObject *)(void *)&lsa_DomainInformationPolicy_Type);
52823 6441 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedName2_Type);
52824 7710 : PyModule_AddObject(m, "TranslatedName2", (PyObject *)(void *)&lsa_TranslatedName2_Type);
52825 6441 : Py_INCREF((PyObject *)(void *)&lsa_TransNameArray2_Type);
52826 7710 : PyModule_AddObject(m, "TransNameArray2", (PyObject *)(void *)&lsa_TransNameArray2_Type);
52827 6441 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid2_Type);
52828 7710 : PyModule_AddObject(m, "TranslatedSid2", (PyObject *)(void *)&lsa_TranslatedSid2_Type);
52829 6441 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray2_Type);
52830 7710 : PyModule_AddObject(m, "TransSidArray2", (PyObject *)(void *)&lsa_TransSidArray2_Type);
52831 6441 : Py_INCREF((PyObject *)(void *)&lsa_TranslatedSid3_Type);
52832 7710 : PyModule_AddObject(m, "TranslatedSid3", (PyObject *)(void *)&lsa_TranslatedSid3_Type);
52833 6441 : Py_INCREF((PyObject *)(void *)&lsa_TransSidArray3_Type);
52834 7710 : PyModule_AddObject(m, "TransSidArray3", (PyObject *)(void *)&lsa_TransSidArray3_Type);
52835 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
52836 7710 : PyModule_AddObject(m, "ForestTrustBinaryData", (PyObject *)(void *)&lsa_ForestTrustBinaryData_Type);
52837 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
52838 7710 : PyModule_AddObject(m, "ForestTrustDomainInfo", (PyObject *)(void *)&lsa_ForestTrustDomainInfo_Type);
52839 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustData_Type);
52840 7710 : PyModule_AddObject(m, "ForestTrustData", (PyObject *)(void *)&lsa_ForestTrustData_Type);
52841 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustRecord_Type);
52842 7710 : PyModule_AddObject(m, "ForestTrustRecord", (PyObject *)(void *)&lsa_ForestTrustRecord_Type);
52843 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustInformation_Type);
52844 7710 : PyModule_AddObject(m, "ForestTrustInformation", (PyObject *)(void *)&lsa_ForestTrustInformation_Type);
52845 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
52846 7710 : PyModule_AddObject(m, "ForestTrustCollisionRecord", (PyObject *)(void *)&lsa_ForestTrustCollisionRecord_Type);
52847 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
52848 7710 : PyModule_AddObject(m, "ForestTrustCollisionInfo", (PyObject *)(void *)&lsa_ForestTrustCollisionInfo_Type);
52849 6441 : Py_INCREF((PyObject *)(void *)&lsa_revision_info1_Type);
52850 7710 : PyModule_AddObject(m, "revision_info1", (PyObject *)(void *)&lsa_revision_info1_Type);
52851 6441 : Py_INCREF((PyObject *)(void *)&lsa_revision_info_Type);
52852 7710 : PyModule_AddObject(m, "revision_info", (PyObject *)(void *)&lsa_revision_info_Type);
52853 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustData2_Type);
52854 7710 : PyModule_AddObject(m, "ForestTrustData2", (PyObject *)(void *)&lsa_ForestTrustData2_Type);
52855 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustRecord2_Type);
52856 7710 : PyModule_AddObject(m, "ForestTrustRecord2", (PyObject *)(void *)&lsa_ForestTrustRecord2_Type);
52857 6441 : Py_INCREF((PyObject *)(void *)&lsa_ForestTrustInformation2_Type);
52858 7710 : PyModule_AddObject(m, "ForestTrustInformation2", (PyObject *)(void *)&lsa_ForestTrustInformation2_Type);
52859 6441 : Py_INCREF((PyObject *)(void *)&lsa_Close_Type);
52860 7710 : PyModule_AddObject(m, "Close", (PyObject *)(void *)&lsa_Close_Type);
52861 6441 : Py_INCREF((PyObject *)(void *)&lsa_Delete_Type);
52862 7710 : PyModule_AddObject(m, "Delete", (PyObject *)(void *)&lsa_Delete_Type);
52863 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivs_Type);
52864 7710 : PyModule_AddObject(m, "EnumPrivs", (PyObject *)(void *)&lsa_EnumPrivs_Type);
52865 6441 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecurity_Type);
52866 7710 : PyModule_AddObject(m, "QuerySecurity", (PyObject *)(void *)&lsa_QuerySecurity_Type);
52867 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetSecObj_Type);
52868 7710 : PyModule_AddObject(m, "SetSecObj", (PyObject *)(void *)&lsa_SetSecObj_Type);
52869 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy_Type);
52870 7710 : PyModule_AddObject(m, "OpenPolicy", (PyObject *)(void *)&lsa_OpenPolicy_Type);
52871 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
52872 7710 : PyModule_AddObject(m, "QueryInfoPolicy", (PyObject *)(void *)&lsa_QueryInfoPolicy_Type);
52873 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy_Type);
52874 7710 : PyModule_AddObject(m, "SetInfoPolicy", (PyObject *)(void *)&lsa_SetInfoPolicy_Type);
52875 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateAccount_Type);
52876 7710 : PyModule_AddObject(m, "CreateAccount", (PyObject *)(void *)&lsa_CreateAccount_Type);
52877 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccounts_Type);
52878 7710 : PyModule_AddObject(m, "EnumAccounts", (PyObject *)(void *)&lsa_EnumAccounts_Type);
52879 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
52880 7710 : PyModule_AddObject(m, "CreateTrustedDomain", (PyObject *)(void *)&lsa_CreateTrustedDomain_Type);
52881 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustDom_Type);
52882 7710 : PyModule_AddObject(m, "EnumTrustDom", (PyObject *)(void *)&lsa_EnumTrustDom_Type);
52883 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames_Type);
52884 7710 : PyModule_AddObject(m, "LookupNames", (PyObject *)(void *)&lsa_LookupNames_Type);
52885 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids_Type);
52886 7710 : PyModule_AddObject(m, "LookupSids", (PyObject *)(void *)&lsa_LookupSids_Type);
52887 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateSecret_Type);
52888 7710 : PyModule_AddObject(m, "CreateSecret", (PyObject *)(void *)&lsa_CreateSecret_Type);
52889 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenAccount_Type);
52890 7710 : PyModule_AddObject(m, "OpenAccount", (PyObject *)(void *)&lsa_OpenAccount_Type);
52891 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
52892 7710 : PyModule_AddObject(m, "EnumPrivsAccount", (PyObject *)(void *)&lsa_EnumPrivsAccount_Type);
52893 6441 : Py_INCREF((PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
52894 7710 : PyModule_AddObject(m, "AddPrivilegesToAccount", (PyObject *)(void *)&lsa_AddPrivilegesToAccount_Type);
52895 6441 : Py_INCREF((PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
52896 7710 : PyModule_AddObject(m, "RemovePrivilegesFromAccount", (PyObject *)(void *)&lsa_RemovePrivilegesFromAccount_Type);
52897 6441 : Py_INCREF((PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
52898 7710 : PyModule_AddObject(m, "GetSystemAccessAccount", (PyObject *)(void *)&lsa_GetSystemAccessAccount_Type);
52899 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
52900 7710 : PyModule_AddObject(m, "SetSystemAccessAccount", (PyObject *)(void *)&lsa_SetSystemAccessAccount_Type);
52901 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
52902 7710 : PyModule_AddObject(m, "OpenTrustedDomain", (PyObject *)(void *)&lsa_OpenTrustedDomain_Type);
52903 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
52904 7710 : PyModule_AddObject(m, "QueryTrustedDomainInfo", (PyObject *)(void *)&lsa_QueryTrustedDomainInfo_Type);
52905 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
52906 7710 : PyModule_AddObject(m, "SetInformationTrustedDomain", (PyObject *)(void *)&lsa_SetInformationTrustedDomain_Type);
52907 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenSecret_Type);
52908 7710 : PyModule_AddObject(m, "OpenSecret", (PyObject *)(void *)&lsa_OpenSecret_Type);
52909 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetSecret_Type);
52910 7710 : PyModule_AddObject(m, "SetSecret", (PyObject *)(void *)&lsa_SetSecret_Type);
52911 6441 : Py_INCREF((PyObject *)(void *)&lsa_QuerySecret_Type);
52912 7710 : PyModule_AddObject(m, "QuerySecret", (PyObject *)(void *)&lsa_QuerySecret_Type);
52913 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivValue_Type);
52914 7710 : PyModule_AddObject(m, "LookupPrivValue", (PyObject *)(void *)&lsa_LookupPrivValue_Type);
52915 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivName_Type);
52916 7710 : PyModule_AddObject(m, "LookupPrivName", (PyObject *)(void *)&lsa_LookupPrivName_Type);
52917 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
52918 7710 : PyModule_AddObject(m, "LookupPrivDisplayName", (PyObject *)(void *)&lsa_LookupPrivDisplayName_Type);
52919 6441 : Py_INCREF((PyObject *)(void *)&lsa_DeleteObject_Type);
52920 7710 : PyModule_AddObject(m, "DeleteObject", (PyObject *)(void *)&lsa_DeleteObject_Type);
52921 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
52922 7710 : PyModule_AddObject(m, "EnumAccountsWithUserRight", (PyObject *)(void *)&lsa_EnumAccountsWithUserRight_Type);
52923 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumAccountRights_Type);
52924 7710 : PyModule_AddObject(m, "EnumAccountRights", (PyObject *)(void *)&lsa_EnumAccountRights_Type);
52925 6441 : Py_INCREF((PyObject *)(void *)&lsa_AddAccountRights_Type);
52926 7710 : PyModule_AddObject(m, "AddAccountRights", (PyObject *)(void *)&lsa_AddAccountRights_Type);
52927 6441 : Py_INCREF((PyObject *)(void *)&lsa_RemoveAccountRights_Type);
52928 7710 : PyModule_AddObject(m, "RemoveAccountRights", (PyObject *)(void *)&lsa_RemoveAccountRights_Type);
52929 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
52930 7710 : PyModule_AddObject(m, "QueryTrustedDomainInfoBySid", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoBySid_Type);
52931 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
52932 7710 : PyModule_AddObject(m, "SetTrustedDomainInfo", (PyObject *)(void *)&lsa_SetTrustedDomainInfo_Type);
52933 6441 : Py_INCREF((PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
52934 7710 : PyModule_AddObject(m, "DeleteTrustedDomain", (PyObject *)(void *)&lsa_DeleteTrustedDomain_Type);
52935 6441 : Py_INCREF((PyObject *)(void *)&lsa_StorePrivateData_Type);
52936 7710 : PyModule_AddObject(m, "StorePrivateData", (PyObject *)(void *)&lsa_StorePrivateData_Type);
52937 6441 : Py_INCREF((PyObject *)(void *)&lsa_RetrievePrivateData_Type);
52938 7710 : PyModule_AddObject(m, "RetrievePrivateData", (PyObject *)(void *)&lsa_RetrievePrivateData_Type);
52939 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy2_Type);
52940 7710 : PyModule_AddObject(m, "OpenPolicy2", (PyObject *)(void *)&lsa_OpenPolicy2_Type);
52941 6441 : Py_INCREF((PyObject *)(void *)&lsa_GetUserName_Type);
52942 7710 : PyModule_AddObject(m, "GetUserName", (PyObject *)(void *)&lsa_GetUserName_Type);
52943 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
52944 7710 : PyModule_AddObject(m, "QueryInfoPolicy2", (PyObject *)(void *)&lsa_QueryInfoPolicy2_Type);
52945 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
52946 7710 : PyModule_AddObject(m, "SetInfoPolicy2", (PyObject *)(void *)&lsa_SetInfoPolicy2_Type);
52947 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
52948 7710 : PyModule_AddObject(m, "QueryTrustedDomainInfoByName", (PyObject *)(void *)&lsa_QueryTrustedDomainInfoByName_Type);
52949 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
52950 7710 : PyModule_AddObject(m, "SetTrustedDomainInfoByName", (PyObject *)(void *)&lsa_SetTrustedDomainInfoByName_Type);
52951 6441 : Py_INCREF((PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
52952 7710 : PyModule_AddObject(m, "EnumTrustedDomainsEx", (PyObject *)(void *)&lsa_EnumTrustedDomainsEx_Type);
52953 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
52954 7710 : PyModule_AddObject(m, "CreateTrustedDomainEx", (PyObject *)(void *)&lsa_CreateTrustedDomainEx_Type);
52955 6441 : Py_INCREF((PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
52956 7710 : PyModule_AddObject(m, "CloseTrustedDomainEx", (PyObject *)(void *)&lsa_CloseTrustedDomainEx_Type);
52957 6441 : Py_INCREF((PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
52958 7710 : PyModule_AddObject(m, "QueryDomainInformationPolicy", (PyObject *)(void *)&lsa_QueryDomainInformationPolicy_Type);
52959 6441 : Py_INCREF((PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
52960 7710 : PyModule_AddObject(m, "SetDomainInformationPolicy", (PyObject *)(void *)&lsa_SetDomainInformationPolicy_Type);
52961 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
52962 7710 : PyModule_AddObject(m, "OpenTrustedDomainByName", (PyObject *)(void *)&lsa_OpenTrustedDomainByName_Type);
52963 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids2_Type);
52964 7710 : PyModule_AddObject(m, "LookupSids2", (PyObject *)(void *)&lsa_LookupSids2_Type);
52965 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames2_Type);
52966 7710 : PyModule_AddObject(m, "LookupNames2", (PyObject *)(void *)&lsa_LookupNames2_Type);
52967 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
52968 7710 : PyModule_AddObject(m, "CreateTrustedDomainEx2", (PyObject *)(void *)&lsa_CreateTrustedDomainEx2_Type);
52969 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames3_Type);
52970 7710 : PyModule_AddObject(m, "LookupNames3", (PyObject *)(void *)&lsa_LookupNames3_Type);
52971 6441 : Py_INCREF((PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
52972 7710 : PyModule_AddObject(m, "lsaRQueryForestTrustInformation", (PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation_Type);
52973 6441 : Py_INCREF((PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
52974 7710 : PyModule_AddObject(m, "lsaRSetForestTrustInformation", (PyObject *)(void *)&lsa_lsaRSetForestTrustInformation_Type);
52975 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupSids3_Type);
52976 7710 : PyModule_AddObject(m, "LookupSids3", (PyObject *)(void *)&lsa_LookupSids3_Type);
52977 6441 : Py_INCREF((PyObject *)(void *)&lsa_LookupNames4_Type);
52978 7710 : PyModule_AddObject(m, "LookupNames4", (PyObject *)(void *)&lsa_LookupNames4_Type);
52979 6441 : Py_INCREF((PyObject *)(void *)&lsa_CreateTrustedDomainEx3_Type);
52980 7710 : PyModule_AddObject(m, "CreateTrustedDomainEx3", (PyObject *)(void *)&lsa_CreateTrustedDomainEx3_Type);
52981 6441 : Py_INCREF((PyObject *)(void *)&lsa_OpenPolicy3_Type);
52982 7710 : PyModule_AddObject(m, "OpenPolicy3", (PyObject *)(void *)&lsa_OpenPolicy3_Type);
52983 6441 : Py_INCREF((PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation2_Type);
52984 7710 : PyModule_AddObject(m, "lsaRQueryForestTrustInformation2", (PyObject *)(void *)&lsa_lsaRQueryForestTrustInformation2_Type);
52985 6441 : Py_INCREF((PyObject *)(void *)&lsa_lsaRSetForestTrustInformation2_Type);
52986 7710 : PyModule_AddObject(m, "lsaRSetForestTrustInformation2", (PyObject *)(void *)&lsa_lsaRSetForestTrustInformation2_Type);
52987 6441 : Py_INCREF((PyObject *)(void *)&lsarpc_InterfaceType);
52988 7710 : PyModule_AddObject(m, "lsarpc", (PyObject *)(void *)&lsarpc_InterfaceType);
52989 6441 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
52990 7710 : PyModule_AddObject(m, "lsarpc_abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
52991 6441 : Py_INCREF((PyObject *)(void *)&lsarpc_SyntaxType);
52992 7710 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&lsarpc_SyntaxType);
52993 : #ifdef PY_MOD_LSA_PATCH
52994 : PY_MOD_LSA_PATCH(m);
52995 : #endif
52996 7710 : out:
52997 7710 : Py_XDECREF(dep_samba_dcerpc_misc);
52998 7710 : Py_XDECREF(dep_samba_dcerpc_security);
52999 7710 : Py_XDECREF(dep_talloc);
53000 7710 : Py_XDECREF(dep_samba_dcerpc_base);
53001 7517 : return m;
53002 :
53003 : }
|