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_samr.h"
12 : #include "bin/default/librpc/gen_ndr/ndr_samr_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 28208 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
33 : {
34 28208 : switch (var_size) {
35 2 : case 8:
36 2 : return UINT64_MAX;
37 8878 : case 4:
38 8878 : return UINT32_MAX;
39 45 : case 2:
40 45 : return UINT16_MAX;
41 19283 : case 1:
42 19283 : return UINT8_MAX;
43 : }
44 :
45 0 : return 0;
46 : }
47 :
48 0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
49 : {
50 0 : switch (var_size) {
51 0 : case 8:
52 0 : return INT64_MAX;
53 0 : case 4:
54 0 : return INT32_MAX;
55 0 : case 2:
56 0 : return INT16_MAX;
57 0 : case 1:
58 0 : return INT8_MAX;
59 : }
60 :
61 0 : return 0;
62 : }
63 :
64 : #include "librpc/gen_ndr/misc.h"
65 : #include "librpc/gen_ndr/lsa.h"
66 : #include "librpc/gen_ndr/security.h"
67 : static PyTypeObject samr_SamEntry_Type;
68 : static PyTypeObject samr_SamArray_Type;
69 : static PyTypeObject samr_DomInfo1_Type;
70 : static PyTypeObject samr_DomGeneralInformation_Type;
71 : static PyTypeObject samr_DomInfo3_Type;
72 : static PyTypeObject samr_DomOEMInformation_Type;
73 : static PyTypeObject samr_DomInfo5_Type;
74 : static PyTypeObject samr_DomInfo6_Type;
75 : static PyTypeObject samr_DomInfo7_Type;
76 : static PyTypeObject samr_DomInfo8_Type;
77 : static PyTypeObject samr_DomInfo9_Type;
78 : static PyTypeObject samr_DomGeneralInformation2_Type;
79 : static PyTypeObject samr_DomInfo12_Type;
80 : static PyTypeObject samr_DomInfo13_Type;
81 : static PyTypeObject samr_DomainInfo_Type;
82 : static PyTypeObject samr_Ids_Type;
83 : static PyTypeObject samr_GroupInfoAll_Type;
84 : static PyTypeObject samr_GroupInfoAttributes_Type;
85 : static PyTypeObject samr_GroupInfoDescription_Type;
86 : static PyTypeObject samr_GroupInfo_Type;
87 : static PyTypeObject samr_RidAttrArray_Type;
88 : static PyTypeObject samr_AliasInfoAll_Type;
89 : static PyTypeObject samr_AliasInfo_Type;
90 : static PyTypeObject samr_UserInfo1_Type;
91 : static PyTypeObject samr_UserInfo2_Type;
92 : static PyTypeObject samr_LogonHours_Type;
93 : static PyTypeObject samr_UserInfo3_Type;
94 : static PyTypeObject samr_UserInfo4_Type;
95 : static PyTypeObject samr_UserInfo5_Type;
96 : static PyTypeObject samr_UserInfo6_Type;
97 : static PyTypeObject samr_UserInfo7_Type;
98 : static PyTypeObject samr_UserInfo8_Type;
99 : static PyTypeObject samr_UserInfo9_Type;
100 : static PyTypeObject samr_UserInfo10_Type;
101 : static PyTypeObject samr_UserInfo11_Type;
102 : static PyTypeObject samr_UserInfo12_Type;
103 : static PyTypeObject samr_UserInfo13_Type;
104 : static PyTypeObject samr_UserInfo14_Type;
105 : static PyTypeObject samr_UserInfo16_Type;
106 : static PyTypeObject samr_UserInfo17_Type;
107 : static PyTypeObject samr_Password_Type;
108 : static PyTypeObject samr_UserInfo18_Type;
109 : static PyTypeObject samr_UserInfo20_Type;
110 : static PyTypeObject samr_UserInfo21_Type;
111 : static PyTypeObject samr_CryptPassword_Type;
112 : static PyTypeObject samr_UserInfo23_Type;
113 : static PyTypeObject samr_UserInfo24_Type;
114 : static PyTypeObject samr_CryptPasswordEx_Type;
115 : static PyTypeObject samr_UserInfo25_Type;
116 : static PyTypeObject samr_UserInfo26_Type;
117 : static PyTypeObject samr_EncryptedPasswordAES_Type;
118 : static PyTypeObject samr_UserInfo31_Type;
119 : static PyTypeObject samr_UserInfo32_Type;
120 : static PyTypeObject samr_UserInfo_Type;
121 : static PyTypeObject samr_RidWithAttribute_Type;
122 : static PyTypeObject samr_RidWithAttributeArray_Type;
123 : static PyTypeObject samr_DispEntryGeneral_Type;
124 : static PyTypeObject samr_DispInfoGeneral_Type;
125 : static PyTypeObject samr_DispEntryFull_Type;
126 : static PyTypeObject samr_DispInfoFull_Type;
127 : static PyTypeObject samr_DispEntryFullGroup_Type;
128 : static PyTypeObject samr_DispInfoFullGroups_Type;
129 : static PyTypeObject samr_DispEntryAscii_Type;
130 : static PyTypeObject samr_DispInfoAscii_Type;
131 : static PyTypeObject samr_DispInfo_Type;
132 : static PyTypeObject samr_PwInfo_Type;
133 : static PyTypeObject userPwdChangeFailureInformation_Type;
134 : static PyTypeObject samr_ConnectInfo1_Type;
135 : static PyTypeObject samr_ConnectInfo_Type;
136 : static PyTypeObject samr_ValidationBlob_Type;
137 : static PyTypeObject samr_ValidatePasswordInfo_Type;
138 : static PyTypeObject samr_ValidatePasswordRepCtr_Type;
139 : static PyTypeObject samr_ValidatePasswordRep_Type;
140 : static PyTypeObject samr_ValidatePasswordReq3_Type;
141 : static PyTypeObject samr_ValidatePasswordReq2_Type;
142 : static PyTypeObject samr_ValidatePasswordReq1_Type;
143 : static PyTypeObject samr_ValidatePasswordReq_Type;
144 : static PyTypeObject samr_InterfaceType;
145 : static PyTypeObject samr_Connect_Type;
146 : static PyTypeObject samr_Close_Type;
147 : static PyTypeObject samr_SetSecurity_Type;
148 : static PyTypeObject samr_QuerySecurity_Type;
149 : static PyTypeObject samr_Shutdown_Type;
150 : static PyTypeObject samr_LookupDomain_Type;
151 : static PyTypeObject samr_EnumDomains_Type;
152 : static PyTypeObject samr_OpenDomain_Type;
153 : static PyTypeObject samr_QueryDomainInfo_Type;
154 : static PyTypeObject samr_SetDomainInfo_Type;
155 : static PyTypeObject samr_CreateDomainGroup_Type;
156 : static PyTypeObject samr_EnumDomainGroups_Type;
157 : static PyTypeObject samr_CreateUser_Type;
158 : static PyTypeObject samr_EnumDomainUsers_Type;
159 : static PyTypeObject samr_CreateDomAlias_Type;
160 : static PyTypeObject samr_EnumDomainAliases_Type;
161 : static PyTypeObject samr_GetAliasMembership_Type;
162 : static PyTypeObject samr_LookupNames_Type;
163 : static PyTypeObject samr_LookupRids_Type;
164 : static PyTypeObject samr_OpenGroup_Type;
165 : static PyTypeObject samr_QueryGroupInfo_Type;
166 : static PyTypeObject samr_SetGroupInfo_Type;
167 : static PyTypeObject samr_AddGroupMember_Type;
168 : static PyTypeObject samr_DeleteDomainGroup_Type;
169 : static PyTypeObject samr_DeleteGroupMember_Type;
170 : static PyTypeObject samr_QueryGroupMember_Type;
171 : static PyTypeObject samr_SetMemberAttributesOfGroup_Type;
172 : static PyTypeObject samr_OpenAlias_Type;
173 : static PyTypeObject samr_QueryAliasInfo_Type;
174 : static PyTypeObject samr_SetAliasInfo_Type;
175 : static PyTypeObject samr_DeleteDomAlias_Type;
176 : static PyTypeObject samr_AddAliasMember_Type;
177 : static PyTypeObject samr_DeleteAliasMember_Type;
178 : static PyTypeObject samr_GetMembersInAlias_Type;
179 : static PyTypeObject samr_OpenUser_Type;
180 : static PyTypeObject samr_DeleteUser_Type;
181 : static PyTypeObject samr_QueryUserInfo_Type;
182 : static PyTypeObject samr_SetUserInfo_Type;
183 : static PyTypeObject samr_ChangePasswordUser_Type;
184 : static PyTypeObject samr_GetGroupsForUser_Type;
185 : static PyTypeObject samr_QueryDisplayInfo_Type;
186 : static PyTypeObject samr_GetDisplayEnumerationIndex_Type;
187 : static PyTypeObject samr_TestPrivateFunctionsDomain_Type;
188 : static PyTypeObject samr_TestPrivateFunctionsUser_Type;
189 : static PyTypeObject samr_GetUserPwInfo_Type;
190 : static PyTypeObject samr_RemoveMemberFromForeignDomain_Type;
191 : static PyTypeObject samr_QueryDomainInfo2_Type;
192 : static PyTypeObject samr_QueryUserInfo2_Type;
193 : static PyTypeObject samr_QueryDisplayInfo2_Type;
194 : static PyTypeObject samr_GetDisplayEnumerationIndex2_Type;
195 : static PyTypeObject samr_CreateUser2_Type;
196 : static PyTypeObject samr_QueryDisplayInfo3_Type;
197 : static PyTypeObject samr_AddMultipleMembersToAlias_Type;
198 : static PyTypeObject samr_RemoveMultipleMembersFromAlias_Type;
199 : static PyTypeObject samr_OemChangePasswordUser2_Type;
200 : static PyTypeObject samr_ChangePasswordUser2_Type;
201 : static PyTypeObject samr_GetDomPwInfo_Type;
202 : static PyTypeObject samr_Connect2_Type;
203 : static PyTypeObject samr_SetUserInfo2_Type;
204 : static PyTypeObject samr_SetBootKeyInformation_Type;
205 : static PyTypeObject samr_GetBootKeyInformation_Type;
206 : static PyTypeObject samr_Connect3_Type;
207 : static PyTypeObject samr_Connect4_Type;
208 : static PyTypeObject samr_ChangePasswordUser3_Type;
209 : static PyTypeObject samr_Connect5_Type;
210 : static PyTypeObject samr_RidToSid_Type;
211 : static PyTypeObject samr_SetDsrmPassword_Type;
212 : static PyTypeObject samr_ValidatePassword_Type;
213 : static PyTypeObject samr_ChangePasswordUser4_Type;
214 :
215 : static PyTypeObject *lsa_String_Type;
216 : static PyTypeObject *BaseObject_Type;
217 : static PyTypeObject *lsa_BinaryString_Type;
218 : static PyTypeObject *lsa_AsciiStringLarge_Type;
219 : static PyTypeObject *lsa_StringLarge_Type;
220 : static PyTypeObject *policy_handle_Type;
221 : static PyTypeObject *sec_desc_buf_Type;
222 : static PyTypeObject *dom_sid_Type;
223 : static PyTypeObject *lsa_SidArray_Type;
224 : static PyTypeObject *lsa_Strings_Type;
225 : static PyTypeObject *lsa_AsciiString_Type;
226 : static PyTypeObject *ClientConnection_Type;
227 : static PyTypeObject *ndr_syntax_id_Type;
228 :
229 2 : static PyObject *py_samr_SamEntry_get_idx(PyObject *obj, void *closure)
230 : {
231 2 : struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
232 0 : PyObject *py_idx;
233 2 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx);
234 2 : return py_idx;
235 : }
236 :
237 0 : static int py_samr_SamEntry_set_idx(PyObject *py_obj, PyObject *value, void *closure)
238 : {
239 0 : struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj);
240 0 : if (value == NULL) {
241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx");
242 0 : return -1;
243 : }
244 : {
245 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx));
246 0 : if (PyLong_Check(value)) {
247 0 : unsigned long long test_var;
248 0 : test_var = PyLong_AsUnsignedLongLong(value);
249 0 : if (PyErr_Occurred() != NULL) {
250 0 : return -1;
251 : }
252 0 : if (test_var > uint_max) {
253 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
254 : PyLong_Type.tp_name, uint_max, test_var);
255 0 : return -1;
256 : }
257 0 : object->idx = test_var;
258 : } else {
259 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
260 : PyLong_Type.tp_name);
261 0 : return -1;
262 : }
263 : }
264 0 : return 0;
265 : }
266 :
267 154 : static PyObject *py_samr_SamEntry_get_name(PyObject *obj, void *closure)
268 : {
269 154 : struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
270 0 : PyObject *py_name;
271 154 : py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
272 154 : return py_name;
273 : }
274 :
275 0 : static int py_samr_SamEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
276 : {
277 0 : struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj);
278 0 : if (value == NULL) {
279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
280 0 : return -1;
281 : }
282 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
283 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
284 0 : PyErr_NoMemory();
285 0 : return -1;
286 : }
287 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
288 0 : return 0;
289 : }
290 :
291 : static PyGetSetDef py_samr_SamEntry_getsetters[] = {
292 : {
293 : .name = discard_const_p(char, "idx"),
294 : .get = py_samr_SamEntry_get_idx,
295 : .set = py_samr_SamEntry_set_idx,
296 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
297 : },
298 : {
299 : .name = discard_const_p(char, "name"),
300 : .get = py_samr_SamEntry_get_name,
301 : .set = py_samr_SamEntry_set_name,
302 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
303 : },
304 : { .name = NULL }
305 : };
306 :
307 0 : static PyObject *py_samr_SamEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
308 : {
309 0 : return pytalloc_new(struct samr_SamEntry, type);
310 : }
311 :
312 :
313 : static PyTypeObject samr_SamEntry_Type = {
314 : PyVarObject_HEAD_INIT(NULL, 0)
315 : .tp_name = "samr.SamEntry",
316 : .tp_getset = py_samr_SamEntry_getsetters,
317 : .tp_methods = NULL,
318 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
319 : .tp_new = py_samr_SamEntry_new,
320 : };
321 :
322 :
323 0 : static PyObject *py_samr_SamArray_get_count(PyObject *obj, void *closure)
324 : {
325 0 : struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj);
326 0 : PyObject *py_count;
327 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
328 0 : return py_count;
329 : }
330 :
331 0 : static int py_samr_SamArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
332 : {
333 0 : struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj);
334 0 : if (value == NULL) {
335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
336 0 : return -1;
337 : }
338 : {
339 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
340 0 : if (PyLong_Check(value)) {
341 0 : unsigned long long test_var;
342 0 : test_var = PyLong_AsUnsignedLongLong(value);
343 0 : if (PyErr_Occurred() != NULL) {
344 0 : return -1;
345 : }
346 0 : if (test_var > uint_max) {
347 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
348 : PyLong_Type.tp_name, uint_max, test_var);
349 0 : return -1;
350 : }
351 0 : object->count = test_var;
352 : } else {
353 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
354 : PyLong_Type.tp_name);
355 0 : return -1;
356 : }
357 : }
358 0 : return 0;
359 : }
360 :
361 92 : static PyObject *py_samr_SamArray_get_entries(PyObject *obj, void *closure)
362 : {
363 92 : struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj);
364 0 : PyObject *py_entries;
365 92 : if (object->entries == NULL) {
366 0 : Py_RETURN_NONE;
367 : }
368 92 : if (object->entries == NULL) {
369 0 : py_entries = Py_None;
370 0 : Py_INCREF(py_entries);
371 : } else {
372 92 : py_entries = PyList_New(object->count);
373 92 : if (py_entries == NULL) {
374 0 : return NULL;
375 : }
376 : {
377 : int entries_cntr_1;
378 263 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
379 0 : PyObject *py_entries_1;
380 171 : py_entries_1 = pytalloc_reference_ex(&samr_SamEntry_Type, object->entries, &object->entries[entries_cntr_1]);
381 171 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
382 : }
383 : }
384 : }
385 92 : return py_entries;
386 : }
387 :
388 0 : static int py_samr_SamArray_set_entries(PyObject *py_obj, PyObject *value, void *closure)
389 : {
390 0 : struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj);
391 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
392 0 : if (value == NULL) {
393 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
394 0 : return -1;
395 : }
396 0 : if (value == Py_None) {
397 0 : object->entries = NULL;
398 : } else {
399 0 : object->entries = NULL;
400 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
401 : {
402 0 : int entries_cntr_1;
403 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
404 0 : if (!object->entries) { return -1; }
405 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
406 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
407 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
408 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
409 0 : return -1;
410 : }
411 0 : PY_CHECK_TYPE(&samr_SamEntry_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
412 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
413 0 : PyErr_NoMemory();
414 0 : return -1;
415 : }
416 0 : object->entries[entries_cntr_1] = *(struct samr_SamEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
417 : }
418 : }
419 : }
420 0 : return 0;
421 : }
422 :
423 : static PyGetSetDef py_samr_SamArray_getsetters[] = {
424 : {
425 : .name = discard_const_p(char, "count"),
426 : .get = py_samr_SamArray_get_count,
427 : .set = py_samr_SamArray_set_count,
428 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
429 : },
430 : {
431 : .name = discard_const_p(char, "entries"),
432 : .get = py_samr_SamArray_get_entries,
433 : .set = py_samr_SamArray_set_entries,
434 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamEntry")
435 : },
436 : { .name = NULL }
437 : };
438 :
439 0 : static PyObject *py_samr_SamArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
440 : {
441 0 : return pytalloc_new(struct samr_SamArray, type);
442 : }
443 :
444 :
445 : static PyTypeObject samr_SamArray_Type = {
446 : PyVarObject_HEAD_INIT(NULL, 0)
447 : .tp_name = "samr.SamArray",
448 : .tp_getset = py_samr_SamArray_getsetters,
449 : .tp_methods = NULL,
450 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
451 : .tp_new = py_samr_SamArray_new,
452 : };
453 :
454 :
455 0 : static PyObject *py_samr_DomInfo1_get_min_password_length(PyObject *obj, void *closure)
456 : {
457 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
458 0 : PyObject *py_min_password_length;
459 0 : py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length);
460 0 : return py_min_password_length;
461 : }
462 :
463 0 : static int py_samr_DomInfo1_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
464 : {
465 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
466 0 : if (value == NULL) {
467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length");
468 0 : return -1;
469 : }
470 : {
471 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length));
472 0 : if (PyLong_Check(value)) {
473 0 : unsigned long long test_var;
474 0 : test_var = PyLong_AsUnsignedLongLong(value);
475 0 : if (PyErr_Occurred() != NULL) {
476 0 : return -1;
477 : }
478 0 : if (test_var > uint_max) {
479 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
480 : PyLong_Type.tp_name, uint_max, test_var);
481 0 : return -1;
482 : }
483 0 : object->min_password_length = test_var;
484 : } else {
485 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
486 : PyLong_Type.tp_name);
487 0 : return -1;
488 : }
489 : }
490 0 : return 0;
491 : }
492 :
493 0 : static PyObject *py_samr_DomInfo1_get_password_history_length(PyObject *obj, void *closure)
494 : {
495 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
496 0 : PyObject *py_password_history_length;
497 0 : py_password_history_length = PyLong_FromLong((uint16_t)object->password_history_length);
498 0 : return py_password_history_length;
499 : }
500 :
501 0 : static int py_samr_DomInfo1_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure)
502 : {
503 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
504 0 : if (value == NULL) {
505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_history_length");
506 0 : return -1;
507 : }
508 : {
509 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_history_length));
510 0 : if (PyLong_Check(value)) {
511 0 : unsigned long long test_var;
512 0 : test_var = PyLong_AsUnsignedLongLong(value);
513 0 : if (PyErr_Occurred() != NULL) {
514 0 : return -1;
515 : }
516 0 : if (test_var > uint_max) {
517 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
518 : PyLong_Type.tp_name, uint_max, test_var);
519 0 : return -1;
520 : }
521 0 : object->password_history_length = test_var;
522 : } else {
523 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
524 : PyLong_Type.tp_name);
525 0 : return -1;
526 : }
527 : }
528 0 : return 0;
529 : }
530 :
531 0 : static PyObject *py_samr_DomInfo1_get_password_properties(PyObject *obj, void *closure)
532 : {
533 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
534 0 : PyObject *py_password_properties;
535 0 : py_password_properties = PyLong_FromUnsignedLongLong((uint32_t)object->password_properties);
536 0 : return py_password_properties;
537 : }
538 :
539 0 : static int py_samr_DomInfo1_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
540 : {
541 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
542 0 : if (value == NULL) {
543 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_properties");
544 0 : return -1;
545 : }
546 : {
547 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_properties));
548 0 : if (PyLong_Check(value)) {
549 0 : unsigned long long test_var;
550 0 : test_var = PyLong_AsUnsignedLongLong(value);
551 0 : if (PyErr_Occurred() != NULL) {
552 0 : return -1;
553 : }
554 0 : if (test_var > uint_max) {
555 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
556 : PyLong_Type.tp_name, uint_max, test_var);
557 0 : return -1;
558 : }
559 0 : object->password_properties = test_var;
560 : } else {
561 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
562 : PyLong_Type.tp_name);
563 0 : return -1;
564 : }
565 : }
566 0 : return 0;
567 : }
568 :
569 4 : static PyObject *py_samr_DomInfo1_get_max_password_age(PyObject *obj, void *closure)
570 : {
571 4 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
572 4 : PyObject *py_max_password_age;
573 4 : py_max_password_age = PyLong_FromLongLong(object->max_password_age);
574 4 : return py_max_password_age;
575 : }
576 :
577 5 : static int py_samr_DomInfo1_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure)
578 : {
579 5 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
580 5 : if (value == NULL) {
581 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_password_age");
582 0 : return -1;
583 : }
584 : {
585 5 : const long long int_max = ndr_sizeof2intmax(sizeof(object->max_password_age));
586 5 : const long long int_min = -int_max - 1;
587 5 : if (PyLong_Check(value)) {
588 5 : long long test_var;
589 5 : test_var = PyLong_AsLongLong(value);
590 5 : if (PyErr_Occurred() != NULL) {
591 0 : return -1;
592 : }
593 4 : if (test_var < int_min || test_var > int_max) {
594 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
595 : PyLong_Type.tp_name, int_min, int_max, test_var);
596 0 : return -1;
597 : }
598 4 : object->max_password_age = test_var;
599 : } else {
600 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
601 : PyLong_Type.tp_name);
602 0 : return -1;
603 : }
604 : }
605 4 : return 0;
606 : }
607 :
608 0 : static PyObject *py_samr_DomInfo1_get_min_password_age(PyObject *obj, void *closure)
609 : {
610 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
611 0 : PyObject *py_min_password_age;
612 0 : py_min_password_age = PyLong_FromLongLong(object->min_password_age);
613 0 : return py_min_password_age;
614 : }
615 :
616 0 : static int py_samr_DomInfo1_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure)
617 : {
618 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
619 0 : if (value == NULL) {
620 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_age");
621 0 : return -1;
622 : }
623 : {
624 0 : const long long int_max = ndr_sizeof2intmax(sizeof(object->min_password_age));
625 0 : const long long int_min = -int_max - 1;
626 0 : if (PyLong_Check(value)) {
627 0 : long long test_var;
628 0 : test_var = PyLong_AsLongLong(value);
629 0 : if (PyErr_Occurred() != NULL) {
630 0 : return -1;
631 : }
632 0 : if (test_var < int_min || test_var > int_max) {
633 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
634 : PyLong_Type.tp_name, int_min, int_max, test_var);
635 0 : return -1;
636 : }
637 0 : object->min_password_age = test_var;
638 : } else {
639 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
640 : PyLong_Type.tp_name);
641 0 : return -1;
642 : }
643 : }
644 0 : return 0;
645 : }
646 :
647 : static PyGetSetDef py_samr_DomInfo1_getsetters[] = {
648 : {
649 : .name = discard_const_p(char, "min_password_length"),
650 : .get = py_samr_DomInfo1_get_min_password_length,
651 : .set = py_samr_DomInfo1_set_min_password_length,
652 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
653 : },
654 : {
655 : .name = discard_const_p(char, "password_history_length"),
656 : .get = py_samr_DomInfo1_get_password_history_length,
657 : .set = py_samr_DomInfo1_set_password_history_length,
658 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
659 : },
660 : {
661 : .name = discard_const_p(char, "password_properties"),
662 : .get = py_samr_DomInfo1_get_password_properties,
663 : .set = py_samr_DomInfo1_set_password_properties,
664 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_PasswordProperties")
665 : },
666 : {
667 : .name = discard_const_p(char, "max_password_age"),
668 : .get = py_samr_DomInfo1_get_max_password_age,
669 : .set = py_samr_DomInfo1_set_max_password_age,
670 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
671 : },
672 : {
673 : .name = discard_const_p(char, "min_password_age"),
674 : .get = py_samr_DomInfo1_get_min_password_age,
675 : .set = py_samr_DomInfo1_set_min_password_age,
676 : .doc = discard_const_p(char, "PIDL-generated element of base type dlong")
677 : },
678 : { .name = NULL }
679 : };
680 :
681 5 : static PyObject *py_samr_DomInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
682 : {
683 5 : return pytalloc_new(struct samr_DomInfo1, type);
684 : }
685 :
686 0 : static PyObject *py_samr_DomInfo1_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
687 : {
688 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
689 0 : PyObject *ret = NULL;
690 0 : DATA_BLOB blob;
691 0 : enum ndr_err_code err;
692 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
693 0 : if (tmp_ctx == NULL) {
694 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
695 0 : return NULL;
696 : }
697 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_DomInfo1);
698 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
699 0 : TALLOC_FREE(tmp_ctx);
700 0 : PyErr_SetNdrError(err);
701 0 : return NULL;
702 : }
703 :
704 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
705 0 : TALLOC_FREE(tmp_ctx);
706 0 : return ret;
707 : }
708 :
709 0 : static PyObject *py_samr_DomInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
710 : {
711 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
712 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
713 0 : Py_ssize_t blob_length = 0;
714 0 : enum ndr_err_code err;
715 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
716 0 : PyObject *allow_remaining_obj = NULL;
717 0 : bool allow_remaining = false;
718 :
719 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
720 : discard_const_p(char *, kwnames),
721 : &blob.data, &blob_length,
722 : &allow_remaining_obj)) {
723 0 : return NULL;
724 : }
725 0 : blob.length = blob_length;
726 :
727 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
728 0 : allow_remaining = true;
729 : }
730 :
731 0 : if (allow_remaining) {
732 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_DomInfo1);
733 : } else {
734 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_DomInfo1);
735 : }
736 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
737 0 : PyErr_SetNdrError(err);
738 0 : return NULL;
739 : }
740 :
741 0 : Py_RETURN_NONE;
742 : }
743 :
744 0 : static PyObject *py_samr_DomInfo1_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
745 : {
746 0 : struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
747 0 : PyObject *ret;
748 0 : char *retstr;
749 :
750 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_DomInfo1, "samr_DomInfo1", object);
751 0 : ret = PyUnicode_FromString(retstr);
752 0 : talloc_free(retstr);
753 :
754 0 : return ret;
755 : }
756 :
757 : static PyMethodDef py_samr_DomInfo1_methods[] = {
758 : { "__ndr_pack__", (PyCFunction)py_samr_DomInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
759 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DomInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
760 : { "__ndr_print__", (PyCFunction)py_samr_DomInfo1_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
761 : { NULL, NULL, 0, NULL }
762 : };
763 :
764 :
765 : static PyTypeObject samr_DomInfo1_Type = {
766 : PyVarObject_HEAD_INIT(NULL, 0)
767 : .tp_name = "samr.DomInfo1",
768 : .tp_getset = py_samr_DomInfo1_getsetters,
769 : .tp_methods = py_samr_DomInfo1_methods,
770 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
771 : .tp_new = py_samr_DomInfo1_new,
772 : };
773 :
774 :
775 0 : static PyObject *py_samr_DomGeneralInformation_get_force_logoff_time(PyObject *obj, void *closure)
776 : {
777 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
778 0 : PyObject *py_force_logoff_time;
779 0 : py_force_logoff_time = PyLong_FromUnsignedLongLong(object->force_logoff_time);
780 0 : return py_force_logoff_time;
781 : }
782 :
783 0 : static int py_samr_DomGeneralInformation_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
784 : {
785 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
786 0 : if (value == NULL) {
787 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time");
788 0 : return -1;
789 : }
790 : {
791 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_logoff_time));
792 0 : if (PyLong_Check(value)) {
793 0 : unsigned long long test_var;
794 0 : test_var = PyLong_AsUnsignedLongLong(value);
795 0 : if (PyErr_Occurred() != NULL) {
796 0 : return -1;
797 : }
798 0 : if (test_var > uint_max) {
799 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
800 : PyLong_Type.tp_name, uint_max, test_var);
801 0 : return -1;
802 : }
803 0 : object->force_logoff_time = test_var;
804 : } else {
805 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
806 : PyLong_Type.tp_name);
807 0 : return -1;
808 : }
809 : }
810 0 : return 0;
811 : }
812 :
813 0 : static PyObject *py_samr_DomGeneralInformation_get_oem_information(PyObject *obj, void *closure)
814 : {
815 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
816 0 : PyObject *py_oem_information;
817 0 : py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information);
818 0 : return py_oem_information;
819 : }
820 :
821 0 : static int py_samr_DomGeneralInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
822 : {
823 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
824 0 : if (value == NULL) {
825 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information");
826 0 : return -1;
827 : }
828 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
829 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
830 0 : PyErr_NoMemory();
831 0 : return -1;
832 : }
833 0 : object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
834 0 : return 0;
835 : }
836 :
837 0 : static PyObject *py_samr_DomGeneralInformation_get_domain_name(PyObject *obj, void *closure)
838 : {
839 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
840 0 : PyObject *py_domain_name;
841 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
842 0 : return py_domain_name;
843 : }
844 :
845 0 : static int py_samr_DomGeneralInformation_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
846 : {
847 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
848 0 : if (value == NULL) {
849 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
850 0 : return -1;
851 : }
852 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
853 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
854 0 : PyErr_NoMemory();
855 0 : return -1;
856 : }
857 0 : object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
858 0 : return 0;
859 : }
860 :
861 0 : static PyObject *py_samr_DomGeneralInformation_get_primary(PyObject *obj, void *closure)
862 : {
863 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
864 0 : PyObject *py_primary;
865 0 : py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary);
866 0 : return py_primary;
867 : }
868 :
869 0 : static int py_samr_DomGeneralInformation_set_primary(PyObject *py_obj, PyObject *value, void *closure)
870 : {
871 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
872 0 : if (value == NULL) {
873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary");
874 0 : return -1;
875 : }
876 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
877 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
878 0 : PyErr_NoMemory();
879 0 : return -1;
880 : }
881 0 : object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
882 0 : return 0;
883 : }
884 :
885 0 : static PyObject *py_samr_DomGeneralInformation_get_sequence_num(PyObject *obj, void *closure)
886 : {
887 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
888 0 : PyObject *py_sequence_num;
889 0 : py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num);
890 0 : return py_sequence_num;
891 : }
892 :
893 0 : static int py_samr_DomGeneralInformation_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
894 : {
895 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
896 0 : if (value == NULL) {
897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num");
898 0 : return -1;
899 : }
900 : {
901 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num));
902 0 : if (PyLong_Check(value)) {
903 0 : unsigned long long test_var;
904 0 : test_var = PyLong_AsUnsignedLongLong(value);
905 0 : if (PyErr_Occurred() != NULL) {
906 0 : return -1;
907 : }
908 0 : if (test_var > uint_max) {
909 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
910 : PyLong_Type.tp_name, uint_max, test_var);
911 0 : return -1;
912 : }
913 0 : object->sequence_num = test_var;
914 : } else {
915 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
916 : PyLong_Type.tp_name);
917 0 : return -1;
918 : }
919 : }
920 0 : return 0;
921 : }
922 :
923 0 : static PyObject *py_samr_DomGeneralInformation_get_domain_server_state(PyObject *obj, void *closure)
924 : {
925 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
926 0 : PyObject *py_domain_server_state;
927 0 : py_domain_server_state = PyLong_FromUnsignedLongLong((uint32_t)object->domain_server_state);
928 0 : return py_domain_server_state;
929 : }
930 :
931 0 : static int py_samr_DomGeneralInformation_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
932 : {
933 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
934 0 : if (value == NULL) {
935 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_server_state");
936 0 : return -1;
937 : }
938 : {
939 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_server_state));
940 0 : if (PyLong_Check(value)) {
941 0 : unsigned long long test_var;
942 0 : test_var = PyLong_AsUnsignedLongLong(value);
943 0 : if (PyErr_Occurred() != NULL) {
944 0 : return -1;
945 : }
946 0 : if (test_var > uint_max) {
947 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
948 : PyLong_Type.tp_name, uint_max, test_var);
949 0 : return -1;
950 : }
951 0 : object->domain_server_state = test_var;
952 : } else {
953 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
954 : PyLong_Type.tp_name);
955 0 : return -1;
956 : }
957 : }
958 0 : return 0;
959 : }
960 :
961 0 : static PyObject *py_samr_DomGeneralInformation_get_role(PyObject *obj, void *closure)
962 : {
963 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
964 0 : PyObject *py_role;
965 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role);
966 0 : return py_role;
967 : }
968 :
969 0 : static int py_samr_DomGeneralInformation_set_role(PyObject *py_obj, PyObject *value, void *closure)
970 : {
971 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
972 0 : if (value == NULL) {
973 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role");
974 0 : return -1;
975 : }
976 : {
977 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
978 0 : if (PyLong_Check(value)) {
979 0 : unsigned long long test_var;
980 0 : test_var = PyLong_AsUnsignedLongLong(value);
981 0 : if (PyErr_Occurred() != NULL) {
982 0 : return -1;
983 : }
984 0 : if (test_var > uint_max) {
985 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
986 : PyLong_Type.tp_name, uint_max, test_var);
987 0 : return -1;
988 : }
989 0 : object->role = test_var;
990 : } else {
991 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
992 : PyLong_Type.tp_name);
993 0 : return -1;
994 : }
995 : }
996 0 : return 0;
997 : }
998 :
999 0 : static PyObject *py_samr_DomGeneralInformation_get_unknown3(PyObject *obj, void *closure)
1000 : {
1001 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
1002 0 : PyObject *py_unknown3;
1003 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->unknown3);
1004 0 : return py_unknown3;
1005 : }
1006 :
1007 0 : static int py_samr_DomGeneralInformation_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
1008 : {
1009 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
1010 0 : if (value == NULL) {
1011 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->unknown3");
1012 0 : return -1;
1013 : }
1014 : {
1015 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unknown3));
1016 0 : if (PyLong_Check(value)) {
1017 0 : unsigned long long test_var;
1018 0 : test_var = PyLong_AsUnsignedLongLong(value);
1019 0 : if (PyErr_Occurred() != NULL) {
1020 0 : return -1;
1021 : }
1022 0 : if (test_var > uint_max) {
1023 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1024 : PyLong_Type.tp_name, uint_max, test_var);
1025 0 : return -1;
1026 : }
1027 0 : object->unknown3 = test_var;
1028 : } else {
1029 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1030 : PyLong_Type.tp_name);
1031 0 : return -1;
1032 : }
1033 : }
1034 0 : return 0;
1035 : }
1036 :
1037 1 : static PyObject *py_samr_DomGeneralInformation_get_num_users(PyObject *obj, void *closure)
1038 : {
1039 1 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
1040 0 : PyObject *py_num_users;
1041 1 : py_num_users = PyLong_FromUnsignedLongLong((uint32_t)object->num_users);
1042 1 : return py_num_users;
1043 : }
1044 :
1045 0 : static int py_samr_DomGeneralInformation_set_num_users(PyObject *py_obj, PyObject *value, void *closure)
1046 : {
1047 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
1048 0 : if (value == NULL) {
1049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_users");
1050 0 : return -1;
1051 : }
1052 : {
1053 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_users));
1054 0 : if (PyLong_Check(value)) {
1055 0 : unsigned long long test_var;
1056 0 : test_var = PyLong_AsUnsignedLongLong(value);
1057 0 : if (PyErr_Occurred() != NULL) {
1058 0 : return -1;
1059 : }
1060 0 : if (test_var > uint_max) {
1061 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1062 : PyLong_Type.tp_name, uint_max, test_var);
1063 0 : return -1;
1064 : }
1065 0 : object->num_users = test_var;
1066 : } else {
1067 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1068 : PyLong_Type.tp_name);
1069 0 : return -1;
1070 : }
1071 : }
1072 0 : return 0;
1073 : }
1074 :
1075 1 : static PyObject *py_samr_DomGeneralInformation_get_num_groups(PyObject *obj, void *closure)
1076 : {
1077 1 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
1078 0 : PyObject *py_num_groups;
1079 1 : py_num_groups = PyLong_FromUnsignedLongLong((uint32_t)object->num_groups);
1080 1 : return py_num_groups;
1081 : }
1082 :
1083 0 : static int py_samr_DomGeneralInformation_set_num_groups(PyObject *py_obj, PyObject *value, void *closure)
1084 : {
1085 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
1086 0 : if (value == NULL) {
1087 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_groups");
1088 0 : return -1;
1089 : }
1090 : {
1091 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_groups));
1092 0 : if (PyLong_Check(value)) {
1093 0 : unsigned long long test_var;
1094 0 : test_var = PyLong_AsUnsignedLongLong(value);
1095 0 : if (PyErr_Occurred() != NULL) {
1096 0 : return -1;
1097 : }
1098 0 : if (test_var > uint_max) {
1099 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1100 : PyLong_Type.tp_name, uint_max, test_var);
1101 0 : return -1;
1102 : }
1103 0 : object->num_groups = test_var;
1104 : } else {
1105 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1106 : PyLong_Type.tp_name);
1107 0 : return -1;
1108 : }
1109 : }
1110 0 : return 0;
1111 : }
1112 :
1113 1 : static PyObject *py_samr_DomGeneralInformation_get_num_aliases(PyObject *obj, void *closure)
1114 : {
1115 1 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
1116 0 : PyObject *py_num_aliases;
1117 1 : py_num_aliases = PyLong_FromUnsignedLongLong((uint32_t)object->num_aliases);
1118 1 : return py_num_aliases;
1119 : }
1120 :
1121 0 : static int py_samr_DomGeneralInformation_set_num_aliases(PyObject *py_obj, PyObject *value, void *closure)
1122 : {
1123 0 : struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
1124 0 : if (value == NULL) {
1125 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_aliases");
1126 0 : return -1;
1127 : }
1128 : {
1129 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_aliases));
1130 0 : if (PyLong_Check(value)) {
1131 0 : unsigned long long test_var;
1132 0 : test_var = PyLong_AsUnsignedLongLong(value);
1133 0 : if (PyErr_Occurred() != NULL) {
1134 0 : return -1;
1135 : }
1136 0 : if (test_var > uint_max) {
1137 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1138 : PyLong_Type.tp_name, uint_max, test_var);
1139 0 : return -1;
1140 : }
1141 0 : object->num_aliases = test_var;
1142 : } else {
1143 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1144 : PyLong_Type.tp_name);
1145 0 : return -1;
1146 : }
1147 : }
1148 0 : return 0;
1149 : }
1150 :
1151 : static PyGetSetDef py_samr_DomGeneralInformation_getsetters[] = {
1152 : {
1153 : .name = discard_const_p(char, "force_logoff_time"),
1154 : .get = py_samr_DomGeneralInformation_get_force_logoff_time,
1155 : .set = py_samr_DomGeneralInformation_set_force_logoff_time,
1156 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1157 : },
1158 : {
1159 : .name = discard_const_p(char, "oem_information"),
1160 : .get = py_samr_DomGeneralInformation_get_oem_information,
1161 : .set = py_samr_DomGeneralInformation_set_oem_information,
1162 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1163 : },
1164 : {
1165 : .name = discard_const_p(char, "domain_name"),
1166 : .get = py_samr_DomGeneralInformation_get_domain_name,
1167 : .set = py_samr_DomGeneralInformation_set_domain_name,
1168 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1169 : },
1170 : {
1171 : .name = discard_const_p(char, "primary"),
1172 : .get = py_samr_DomGeneralInformation_get_primary,
1173 : .set = py_samr_DomGeneralInformation_set_primary,
1174 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1175 : },
1176 : {
1177 : .name = discard_const_p(char, "sequence_num"),
1178 : .get = py_samr_DomGeneralInformation_get_sequence_num,
1179 : .set = py_samr_DomGeneralInformation_set_sequence_num,
1180 : .doc = discard_const_p(char, "PIDL-generated element of base type udlong")
1181 : },
1182 : {
1183 : .name = discard_const_p(char, "domain_server_state"),
1184 : .get = py_samr_DomGeneralInformation_get_domain_server_state,
1185 : .set = py_samr_DomGeneralInformation_set_domain_server_state,
1186 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainServerState")
1187 : },
1188 : {
1189 : .name = discard_const_p(char, "role"),
1190 : .get = py_samr_DomGeneralInformation_get_role,
1191 : .set = py_samr_DomGeneralInformation_set_role,
1192 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Role")
1193 : },
1194 : {
1195 : .name = discard_const_p(char, "unknown3"),
1196 : .get = py_samr_DomGeneralInformation_get_unknown3,
1197 : .set = py_samr_DomGeneralInformation_set_unknown3,
1198 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1199 : },
1200 : {
1201 : .name = discard_const_p(char, "num_users"),
1202 : .get = py_samr_DomGeneralInformation_get_num_users,
1203 : .set = py_samr_DomGeneralInformation_set_num_users,
1204 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1205 : },
1206 : {
1207 : .name = discard_const_p(char, "num_groups"),
1208 : .get = py_samr_DomGeneralInformation_get_num_groups,
1209 : .set = py_samr_DomGeneralInformation_set_num_groups,
1210 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1211 : },
1212 : {
1213 : .name = discard_const_p(char, "num_aliases"),
1214 : .get = py_samr_DomGeneralInformation_get_num_aliases,
1215 : .set = py_samr_DomGeneralInformation_set_num_aliases,
1216 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
1217 : },
1218 : { .name = NULL }
1219 : };
1220 :
1221 0 : static PyObject *py_samr_DomGeneralInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1222 : {
1223 0 : return pytalloc_new(struct samr_DomGeneralInformation, type);
1224 : }
1225 :
1226 :
1227 : static PyTypeObject samr_DomGeneralInformation_Type = {
1228 : PyVarObject_HEAD_INIT(NULL, 0)
1229 : .tp_name = "samr.DomGeneralInformation",
1230 : .tp_getset = py_samr_DomGeneralInformation_getsetters,
1231 : .tp_methods = NULL,
1232 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1233 : .tp_new = py_samr_DomGeneralInformation_new,
1234 : };
1235 :
1236 :
1237 0 : static PyObject *py_samr_DomInfo3_get_force_logoff_time(PyObject *obj, void *closure)
1238 : {
1239 0 : struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(obj);
1240 0 : PyObject *py_force_logoff_time;
1241 0 : py_force_logoff_time = PyLong_FromUnsignedLongLong(object->force_logoff_time);
1242 0 : return py_force_logoff_time;
1243 : }
1244 :
1245 0 : static int py_samr_DomInfo3_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
1246 : {
1247 0 : struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(py_obj);
1248 0 : if (value == NULL) {
1249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_logoff_time");
1250 0 : return -1;
1251 : }
1252 : {
1253 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_logoff_time));
1254 0 : if (PyLong_Check(value)) {
1255 0 : unsigned long long test_var;
1256 0 : test_var = PyLong_AsUnsignedLongLong(value);
1257 0 : if (PyErr_Occurred() != NULL) {
1258 0 : return -1;
1259 : }
1260 0 : if (test_var > uint_max) {
1261 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1262 : PyLong_Type.tp_name, uint_max, test_var);
1263 0 : return -1;
1264 : }
1265 0 : object->force_logoff_time = test_var;
1266 : } else {
1267 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1268 : PyLong_Type.tp_name);
1269 0 : return -1;
1270 : }
1271 : }
1272 0 : return 0;
1273 : }
1274 :
1275 : static PyGetSetDef py_samr_DomInfo3_getsetters[] = {
1276 : {
1277 : .name = discard_const_p(char, "force_logoff_time"),
1278 : .get = py_samr_DomInfo3_get_force_logoff_time,
1279 : .set = py_samr_DomInfo3_set_force_logoff_time,
1280 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1281 : },
1282 : { .name = NULL }
1283 : };
1284 :
1285 0 : static PyObject *py_samr_DomInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1286 : {
1287 0 : return pytalloc_new(struct samr_DomInfo3, type);
1288 : }
1289 :
1290 :
1291 : static PyTypeObject samr_DomInfo3_Type = {
1292 : PyVarObject_HEAD_INIT(NULL, 0)
1293 : .tp_name = "samr.DomInfo3",
1294 : .tp_getset = py_samr_DomInfo3_getsetters,
1295 : .tp_methods = NULL,
1296 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1297 : .tp_new = py_samr_DomInfo3_new,
1298 : };
1299 :
1300 :
1301 0 : static PyObject *py_samr_DomOEMInformation_get_oem_information(PyObject *obj, void *closure)
1302 : {
1303 0 : struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(obj);
1304 0 : PyObject *py_oem_information;
1305 0 : py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information);
1306 0 : return py_oem_information;
1307 : }
1308 :
1309 0 : static int py_samr_DomOEMInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
1310 : {
1311 0 : struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(py_obj);
1312 0 : if (value == NULL) {
1313 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->oem_information");
1314 0 : return -1;
1315 : }
1316 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1317 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1318 0 : PyErr_NoMemory();
1319 0 : return -1;
1320 : }
1321 0 : object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
1322 0 : return 0;
1323 : }
1324 :
1325 : static PyGetSetDef py_samr_DomOEMInformation_getsetters[] = {
1326 : {
1327 : .name = discard_const_p(char, "oem_information"),
1328 : .get = py_samr_DomOEMInformation_get_oem_information,
1329 : .set = py_samr_DomOEMInformation_set_oem_information,
1330 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1331 : },
1332 : { .name = NULL }
1333 : };
1334 :
1335 0 : static PyObject *py_samr_DomOEMInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1336 : {
1337 0 : return pytalloc_new(struct samr_DomOEMInformation, type);
1338 : }
1339 :
1340 :
1341 : static PyTypeObject samr_DomOEMInformation_Type = {
1342 : PyVarObject_HEAD_INIT(NULL, 0)
1343 : .tp_name = "samr.DomOEMInformation",
1344 : .tp_getset = py_samr_DomOEMInformation_getsetters,
1345 : .tp_methods = NULL,
1346 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1347 : .tp_new = py_samr_DomOEMInformation_new,
1348 : };
1349 :
1350 :
1351 0 : static PyObject *py_samr_DomInfo5_get_domain_name(PyObject *obj, void *closure)
1352 : {
1353 0 : struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(obj);
1354 0 : PyObject *py_domain_name;
1355 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
1356 0 : return py_domain_name;
1357 : }
1358 :
1359 0 : static int py_samr_DomInfo5_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
1360 : {
1361 0 : struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(py_obj);
1362 0 : if (value == NULL) {
1363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_name");
1364 0 : return -1;
1365 : }
1366 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1367 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1368 0 : PyErr_NoMemory();
1369 0 : return -1;
1370 : }
1371 0 : object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
1372 0 : return 0;
1373 : }
1374 :
1375 : static PyGetSetDef py_samr_DomInfo5_getsetters[] = {
1376 : {
1377 : .name = discard_const_p(char, "domain_name"),
1378 : .get = py_samr_DomInfo5_get_domain_name,
1379 : .set = py_samr_DomInfo5_set_domain_name,
1380 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1381 : },
1382 : { .name = NULL }
1383 : };
1384 :
1385 0 : static PyObject *py_samr_DomInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1386 : {
1387 0 : return pytalloc_new(struct samr_DomInfo5, type);
1388 : }
1389 :
1390 :
1391 : static PyTypeObject samr_DomInfo5_Type = {
1392 : PyVarObject_HEAD_INIT(NULL, 0)
1393 : .tp_name = "samr.DomInfo5",
1394 : .tp_getset = py_samr_DomInfo5_getsetters,
1395 : .tp_methods = NULL,
1396 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1397 : .tp_new = py_samr_DomInfo5_new,
1398 : };
1399 :
1400 :
1401 0 : static PyObject *py_samr_DomInfo6_get_primary(PyObject *obj, void *closure)
1402 : {
1403 0 : struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(obj);
1404 0 : PyObject *py_primary;
1405 0 : py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary);
1406 0 : return py_primary;
1407 : }
1408 :
1409 0 : static int py_samr_DomInfo6_set_primary(PyObject *py_obj, PyObject *value, void *closure)
1410 : {
1411 0 : struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(py_obj);
1412 0 : if (value == NULL) {
1413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary");
1414 0 : return -1;
1415 : }
1416 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1417 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1418 0 : PyErr_NoMemory();
1419 0 : return -1;
1420 : }
1421 0 : object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
1422 0 : return 0;
1423 : }
1424 :
1425 : static PyGetSetDef py_samr_DomInfo6_getsetters[] = {
1426 : {
1427 : .name = discard_const_p(char, "primary"),
1428 : .get = py_samr_DomInfo6_get_primary,
1429 : .set = py_samr_DomInfo6_set_primary,
1430 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
1431 : },
1432 : { .name = NULL }
1433 : };
1434 :
1435 0 : static PyObject *py_samr_DomInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1436 : {
1437 0 : return pytalloc_new(struct samr_DomInfo6, type);
1438 : }
1439 :
1440 :
1441 : static PyTypeObject samr_DomInfo6_Type = {
1442 : PyVarObject_HEAD_INIT(NULL, 0)
1443 : .tp_name = "samr.DomInfo6",
1444 : .tp_getset = py_samr_DomInfo6_getsetters,
1445 : .tp_methods = NULL,
1446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1447 : .tp_new = py_samr_DomInfo6_new,
1448 : };
1449 :
1450 :
1451 0 : static PyObject *py_samr_DomInfo7_get_role(PyObject *obj, void *closure)
1452 : {
1453 0 : struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(obj);
1454 0 : PyObject *py_role;
1455 0 : py_role = PyLong_FromUnsignedLongLong((uint32_t)object->role);
1456 0 : return py_role;
1457 : }
1458 :
1459 0 : static int py_samr_DomInfo7_set_role(PyObject *py_obj, PyObject *value, void *closure)
1460 : {
1461 0 : struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(py_obj);
1462 0 : if (value == NULL) {
1463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->role");
1464 0 : return -1;
1465 : }
1466 : {
1467 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->role));
1468 0 : if (PyLong_Check(value)) {
1469 0 : unsigned long long test_var;
1470 0 : test_var = PyLong_AsUnsignedLongLong(value);
1471 0 : if (PyErr_Occurred() != NULL) {
1472 0 : return -1;
1473 : }
1474 0 : if (test_var > uint_max) {
1475 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1476 : PyLong_Type.tp_name, uint_max, test_var);
1477 0 : return -1;
1478 : }
1479 0 : object->role = test_var;
1480 : } else {
1481 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1482 : PyLong_Type.tp_name);
1483 0 : return -1;
1484 : }
1485 : }
1486 0 : return 0;
1487 : }
1488 :
1489 : static PyGetSetDef py_samr_DomInfo7_getsetters[] = {
1490 : {
1491 : .name = discard_const_p(char, "role"),
1492 : .get = py_samr_DomInfo7_get_role,
1493 : .set = py_samr_DomInfo7_set_role,
1494 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Role")
1495 : },
1496 : { .name = NULL }
1497 : };
1498 :
1499 0 : static PyObject *py_samr_DomInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1500 : {
1501 0 : return pytalloc_new(struct samr_DomInfo7, type);
1502 : }
1503 :
1504 :
1505 : static PyTypeObject samr_DomInfo7_Type = {
1506 : PyVarObject_HEAD_INIT(NULL, 0)
1507 : .tp_name = "samr.DomInfo7",
1508 : .tp_getset = py_samr_DomInfo7_getsetters,
1509 : .tp_methods = NULL,
1510 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1511 : .tp_new = py_samr_DomInfo7_new,
1512 : };
1513 :
1514 :
1515 0 : static PyObject *py_samr_DomInfo8_get_sequence_num(PyObject *obj, void *closure)
1516 : {
1517 0 : struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj);
1518 0 : PyObject *py_sequence_num;
1519 0 : py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num);
1520 0 : return py_sequence_num;
1521 : }
1522 :
1523 0 : static int py_samr_DomInfo8_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
1524 : {
1525 0 : struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj);
1526 0 : if (value == NULL) {
1527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num");
1528 0 : return -1;
1529 : }
1530 : {
1531 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num));
1532 0 : if (PyLong_Check(value)) {
1533 0 : unsigned long long test_var;
1534 0 : test_var = PyLong_AsUnsignedLongLong(value);
1535 0 : if (PyErr_Occurred() != NULL) {
1536 0 : return -1;
1537 : }
1538 0 : if (test_var > uint_max) {
1539 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1540 : PyLong_Type.tp_name, uint_max, test_var);
1541 0 : return -1;
1542 : }
1543 0 : object->sequence_num = test_var;
1544 : } else {
1545 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1546 : PyLong_Type.tp_name);
1547 0 : return -1;
1548 : }
1549 : }
1550 0 : return 0;
1551 : }
1552 :
1553 0 : static PyObject *py_samr_DomInfo8_get_domain_create_time(PyObject *obj, void *closure)
1554 : {
1555 0 : struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj);
1556 0 : PyObject *py_domain_create_time;
1557 0 : py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time);
1558 0 : return py_domain_create_time;
1559 : }
1560 :
1561 0 : static int py_samr_DomInfo8_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
1562 : {
1563 0 : struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj);
1564 0 : if (value == NULL) {
1565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time");
1566 0 : return -1;
1567 : }
1568 : {
1569 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time));
1570 0 : if (PyLong_Check(value)) {
1571 0 : unsigned long long test_var;
1572 0 : test_var = PyLong_AsUnsignedLongLong(value);
1573 0 : if (PyErr_Occurred() != NULL) {
1574 0 : return -1;
1575 : }
1576 0 : if (test_var > uint_max) {
1577 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1578 : PyLong_Type.tp_name, uint_max, test_var);
1579 0 : return -1;
1580 : }
1581 0 : object->domain_create_time = test_var;
1582 : } else {
1583 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1584 : PyLong_Type.tp_name);
1585 0 : return -1;
1586 : }
1587 : }
1588 0 : return 0;
1589 : }
1590 :
1591 : static PyGetSetDef py_samr_DomInfo8_getsetters[] = {
1592 : {
1593 : .name = discard_const_p(char, "sequence_num"),
1594 : .get = py_samr_DomInfo8_get_sequence_num,
1595 : .set = py_samr_DomInfo8_set_sequence_num,
1596 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1597 : },
1598 : {
1599 : .name = discard_const_p(char, "domain_create_time"),
1600 : .get = py_samr_DomInfo8_get_domain_create_time,
1601 : .set = py_samr_DomInfo8_set_domain_create_time,
1602 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
1603 : },
1604 : { .name = NULL }
1605 : };
1606 :
1607 0 : static PyObject *py_samr_DomInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1608 : {
1609 0 : return pytalloc_new(struct samr_DomInfo8, type);
1610 : }
1611 :
1612 :
1613 : static PyTypeObject samr_DomInfo8_Type = {
1614 : PyVarObject_HEAD_INIT(NULL, 0)
1615 : .tp_name = "samr.DomInfo8",
1616 : .tp_getset = py_samr_DomInfo8_getsetters,
1617 : .tp_methods = NULL,
1618 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1619 : .tp_new = py_samr_DomInfo8_new,
1620 : };
1621 :
1622 :
1623 0 : static PyObject *py_samr_DomInfo9_get_domain_server_state(PyObject *obj, void *closure)
1624 : {
1625 0 : struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(obj);
1626 0 : PyObject *py_domain_server_state;
1627 0 : py_domain_server_state = PyLong_FromUnsignedLongLong((uint32_t)object->domain_server_state);
1628 0 : return py_domain_server_state;
1629 : }
1630 :
1631 0 : static int py_samr_DomInfo9_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
1632 : {
1633 0 : struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(py_obj);
1634 0 : if (value == NULL) {
1635 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_server_state");
1636 0 : return -1;
1637 : }
1638 : {
1639 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_server_state));
1640 0 : if (PyLong_Check(value)) {
1641 0 : unsigned long long test_var;
1642 0 : test_var = PyLong_AsUnsignedLongLong(value);
1643 0 : if (PyErr_Occurred() != NULL) {
1644 0 : return -1;
1645 : }
1646 0 : if (test_var > uint_max) {
1647 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1648 : PyLong_Type.tp_name, uint_max, test_var);
1649 0 : return -1;
1650 : }
1651 0 : object->domain_server_state = test_var;
1652 : } else {
1653 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1654 : PyLong_Type.tp_name);
1655 0 : return -1;
1656 : }
1657 : }
1658 0 : return 0;
1659 : }
1660 :
1661 : static PyGetSetDef py_samr_DomInfo9_getsetters[] = {
1662 : {
1663 : .name = discard_const_p(char, "domain_server_state"),
1664 : .get = py_samr_DomInfo9_get_domain_server_state,
1665 : .set = py_samr_DomInfo9_set_domain_server_state,
1666 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainServerState")
1667 : },
1668 : { .name = NULL }
1669 : };
1670 :
1671 0 : static PyObject *py_samr_DomInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1672 : {
1673 0 : return pytalloc_new(struct samr_DomInfo9, type);
1674 : }
1675 :
1676 :
1677 : static PyTypeObject samr_DomInfo9_Type = {
1678 : PyVarObject_HEAD_INIT(NULL, 0)
1679 : .tp_name = "samr.DomInfo9",
1680 : .tp_getset = py_samr_DomInfo9_getsetters,
1681 : .tp_methods = NULL,
1682 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1683 : .tp_new = py_samr_DomInfo9_new,
1684 : };
1685 :
1686 :
1687 0 : static PyObject *py_samr_DomGeneralInformation2_get_general(PyObject *obj, void *closure)
1688 : {
1689 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
1690 0 : PyObject *py_general;
1691 0 : py_general = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, pytalloc_get_mem_ctx(obj), &object->general);
1692 0 : return py_general;
1693 : }
1694 :
1695 0 : static int py_samr_DomGeneralInformation2_set_general(PyObject *py_obj, PyObject *value, void *closure)
1696 : {
1697 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1698 0 : if (value == NULL) {
1699 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->general");
1700 0 : return -1;
1701 : }
1702 0 : PY_CHECK_TYPE(&samr_DomGeneralInformation_Type, value, return -1;);
1703 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1704 0 : PyErr_NoMemory();
1705 0 : return -1;
1706 : }
1707 0 : object->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(value);
1708 0 : return 0;
1709 : }
1710 :
1711 0 : static PyObject *py_samr_DomGeneralInformation2_get_lockout_duration(PyObject *obj, void *closure)
1712 : {
1713 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
1714 0 : PyObject *py_lockout_duration;
1715 0 : py_lockout_duration = PyLong_FromUnsignedLongLong(object->lockout_duration);
1716 0 : return py_lockout_duration;
1717 : }
1718 :
1719 0 : static int py_samr_DomGeneralInformation2_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
1720 : {
1721 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1722 0 : if (value == NULL) {
1723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration");
1724 0 : return -1;
1725 : }
1726 : {
1727 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_duration));
1728 0 : if (PyLong_Check(value)) {
1729 0 : unsigned long long test_var;
1730 0 : test_var = PyLong_AsUnsignedLongLong(value);
1731 0 : if (PyErr_Occurred() != NULL) {
1732 0 : return -1;
1733 : }
1734 0 : if (test_var > uint_max) {
1735 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1736 : PyLong_Type.tp_name, uint_max, test_var);
1737 0 : return -1;
1738 : }
1739 0 : object->lockout_duration = test_var;
1740 : } else {
1741 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1742 : PyLong_Type.tp_name);
1743 0 : return -1;
1744 : }
1745 : }
1746 0 : return 0;
1747 : }
1748 :
1749 0 : static PyObject *py_samr_DomGeneralInformation2_get_lockout_window(PyObject *obj, void *closure)
1750 : {
1751 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
1752 0 : PyObject *py_lockout_window;
1753 0 : py_lockout_window = PyLong_FromUnsignedLongLong(object->lockout_window);
1754 0 : return py_lockout_window;
1755 : }
1756 :
1757 0 : static int py_samr_DomGeneralInformation2_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1758 : {
1759 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1760 0 : if (value == NULL) {
1761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_window");
1762 0 : return -1;
1763 : }
1764 : {
1765 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_window));
1766 0 : if (PyLong_Check(value)) {
1767 0 : unsigned long long test_var;
1768 0 : test_var = PyLong_AsUnsignedLongLong(value);
1769 0 : if (PyErr_Occurred() != NULL) {
1770 0 : return -1;
1771 : }
1772 0 : if (test_var > uint_max) {
1773 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1774 : PyLong_Type.tp_name, uint_max, test_var);
1775 0 : return -1;
1776 : }
1777 0 : object->lockout_window = test_var;
1778 : } else {
1779 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1780 : PyLong_Type.tp_name);
1781 0 : return -1;
1782 : }
1783 : }
1784 0 : return 0;
1785 : }
1786 :
1787 0 : static PyObject *py_samr_DomGeneralInformation2_get_lockout_threshold(PyObject *obj, void *closure)
1788 : {
1789 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
1790 0 : PyObject *py_lockout_threshold;
1791 0 : py_lockout_threshold = PyLong_FromLong((uint16_t)object->lockout_threshold);
1792 0 : return py_lockout_threshold;
1793 : }
1794 :
1795 0 : static int py_samr_DomGeneralInformation2_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1796 : {
1797 0 : struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1798 0 : if (value == NULL) {
1799 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_threshold");
1800 0 : return -1;
1801 : }
1802 : {
1803 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_threshold));
1804 0 : if (PyLong_Check(value)) {
1805 0 : unsigned long long test_var;
1806 0 : test_var = PyLong_AsUnsignedLongLong(value);
1807 0 : if (PyErr_Occurred() != NULL) {
1808 0 : return -1;
1809 : }
1810 0 : if (test_var > uint_max) {
1811 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1812 : PyLong_Type.tp_name, uint_max, test_var);
1813 0 : return -1;
1814 : }
1815 0 : object->lockout_threshold = test_var;
1816 : } else {
1817 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1818 : PyLong_Type.tp_name);
1819 0 : return -1;
1820 : }
1821 : }
1822 0 : return 0;
1823 : }
1824 :
1825 : static PyGetSetDef py_samr_DomGeneralInformation2_getsetters[] = {
1826 : {
1827 : .name = discard_const_p(char, "general"),
1828 : .get = py_samr_DomGeneralInformation2_get_general,
1829 : .set = py_samr_DomGeneralInformation2_set_general,
1830 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomGeneralInformation")
1831 : },
1832 : {
1833 : .name = discard_const_p(char, "lockout_duration"),
1834 : .get = py_samr_DomGeneralInformation2_get_lockout_duration,
1835 : .set = py_samr_DomGeneralInformation2_set_lockout_duration,
1836 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1837 : },
1838 : {
1839 : .name = discard_const_p(char, "lockout_window"),
1840 : .get = py_samr_DomGeneralInformation2_get_lockout_window,
1841 : .set = py_samr_DomGeneralInformation2_set_lockout_window,
1842 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1843 : },
1844 : {
1845 : .name = discard_const_p(char, "lockout_threshold"),
1846 : .get = py_samr_DomGeneralInformation2_get_lockout_threshold,
1847 : .set = py_samr_DomGeneralInformation2_set_lockout_threshold,
1848 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
1849 : },
1850 : { .name = NULL }
1851 : };
1852 :
1853 0 : static PyObject *py_samr_DomGeneralInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1854 : {
1855 0 : return pytalloc_new(struct samr_DomGeneralInformation2, type);
1856 : }
1857 :
1858 :
1859 : static PyTypeObject samr_DomGeneralInformation2_Type = {
1860 : PyVarObject_HEAD_INIT(NULL, 0)
1861 : .tp_name = "samr.DomGeneralInformation2",
1862 : .tp_getset = py_samr_DomGeneralInformation2_getsetters,
1863 : .tp_methods = NULL,
1864 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1865 : .tp_new = py_samr_DomGeneralInformation2_new,
1866 : };
1867 :
1868 :
1869 0 : static PyObject *py_samr_DomInfo12_get_lockout_duration(PyObject *obj, void *closure)
1870 : {
1871 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1872 0 : PyObject *py_lockout_duration;
1873 0 : py_lockout_duration = PyLong_FromUnsignedLongLong(object->lockout_duration);
1874 0 : return py_lockout_duration;
1875 : }
1876 :
1877 0 : static int py_samr_DomInfo12_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
1878 : {
1879 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1880 0 : if (value == NULL) {
1881 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_duration");
1882 0 : return -1;
1883 : }
1884 : {
1885 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_duration));
1886 0 : if (PyLong_Check(value)) {
1887 0 : unsigned long long test_var;
1888 0 : test_var = PyLong_AsUnsignedLongLong(value);
1889 0 : if (PyErr_Occurred() != NULL) {
1890 0 : return -1;
1891 : }
1892 0 : if (test_var > uint_max) {
1893 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1894 : PyLong_Type.tp_name, uint_max, test_var);
1895 0 : return -1;
1896 : }
1897 0 : object->lockout_duration = test_var;
1898 : } else {
1899 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1900 : PyLong_Type.tp_name);
1901 0 : return -1;
1902 : }
1903 : }
1904 0 : return 0;
1905 : }
1906 :
1907 0 : static PyObject *py_samr_DomInfo12_get_lockout_window(PyObject *obj, void *closure)
1908 : {
1909 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1910 0 : PyObject *py_lockout_window;
1911 0 : py_lockout_window = PyLong_FromUnsignedLongLong(object->lockout_window);
1912 0 : return py_lockout_window;
1913 : }
1914 :
1915 0 : static int py_samr_DomInfo12_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1916 : {
1917 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1918 0 : if (value == NULL) {
1919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_window");
1920 0 : return -1;
1921 : }
1922 : {
1923 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_window));
1924 0 : if (PyLong_Check(value)) {
1925 0 : unsigned long long test_var;
1926 0 : test_var = PyLong_AsUnsignedLongLong(value);
1927 0 : if (PyErr_Occurred() != NULL) {
1928 0 : return -1;
1929 : }
1930 0 : if (test_var > uint_max) {
1931 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1932 : PyLong_Type.tp_name, uint_max, test_var);
1933 0 : return -1;
1934 : }
1935 0 : object->lockout_window = test_var;
1936 : } else {
1937 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1938 : PyLong_Type.tp_name);
1939 0 : return -1;
1940 : }
1941 : }
1942 0 : return 0;
1943 : }
1944 :
1945 0 : static PyObject *py_samr_DomInfo12_get_lockout_threshold(PyObject *obj, void *closure)
1946 : {
1947 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1948 0 : PyObject *py_lockout_threshold;
1949 0 : py_lockout_threshold = PyLong_FromLong((uint16_t)object->lockout_threshold);
1950 0 : return py_lockout_threshold;
1951 : }
1952 :
1953 0 : static int py_samr_DomInfo12_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1954 : {
1955 0 : struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1956 0 : if (value == NULL) {
1957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_threshold");
1958 0 : return -1;
1959 : }
1960 : {
1961 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_threshold));
1962 0 : if (PyLong_Check(value)) {
1963 0 : unsigned long long test_var;
1964 0 : test_var = PyLong_AsUnsignedLongLong(value);
1965 0 : if (PyErr_Occurred() != NULL) {
1966 0 : return -1;
1967 : }
1968 0 : if (test_var > uint_max) {
1969 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
1970 : PyLong_Type.tp_name, uint_max, test_var);
1971 0 : return -1;
1972 : }
1973 0 : object->lockout_threshold = test_var;
1974 : } else {
1975 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
1976 : PyLong_Type.tp_name);
1977 0 : return -1;
1978 : }
1979 : }
1980 0 : return 0;
1981 : }
1982 :
1983 : static PyGetSetDef py_samr_DomInfo12_getsetters[] = {
1984 : {
1985 : .name = discard_const_p(char, "lockout_duration"),
1986 : .get = py_samr_DomInfo12_get_lockout_duration,
1987 : .set = py_samr_DomInfo12_set_lockout_duration,
1988 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1989 : },
1990 : {
1991 : .name = discard_const_p(char, "lockout_window"),
1992 : .get = py_samr_DomInfo12_get_lockout_window,
1993 : .set = py_samr_DomInfo12_set_lockout_window,
1994 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
1995 : },
1996 : {
1997 : .name = discard_const_p(char, "lockout_threshold"),
1998 : .get = py_samr_DomInfo12_get_lockout_threshold,
1999 : .set = py_samr_DomInfo12_set_lockout_threshold,
2000 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
2001 : },
2002 : { .name = NULL }
2003 : };
2004 :
2005 0 : static PyObject *py_samr_DomInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2006 : {
2007 0 : return pytalloc_new(struct samr_DomInfo12, type);
2008 : }
2009 :
2010 :
2011 : static PyTypeObject samr_DomInfo12_Type = {
2012 : PyVarObject_HEAD_INIT(NULL, 0)
2013 : .tp_name = "samr.DomInfo12",
2014 : .tp_getset = py_samr_DomInfo12_getsetters,
2015 : .tp_methods = NULL,
2016 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2017 : .tp_new = py_samr_DomInfo12_new,
2018 : };
2019 :
2020 :
2021 0 : static PyObject *py_samr_DomInfo13_get_sequence_num(PyObject *obj, void *closure)
2022 : {
2023 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
2024 0 : PyObject *py_sequence_num;
2025 0 : py_sequence_num = PyLong_FromUnsignedLongLong(object->sequence_num);
2026 0 : return py_sequence_num;
2027 : }
2028 :
2029 0 : static int py_samr_DomInfo13_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
2030 : {
2031 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
2032 0 : if (value == NULL) {
2033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sequence_num");
2034 0 : return -1;
2035 : }
2036 : {
2037 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sequence_num));
2038 0 : if (PyLong_Check(value)) {
2039 0 : unsigned long long test_var;
2040 0 : test_var = PyLong_AsUnsignedLongLong(value);
2041 0 : if (PyErr_Occurred() != NULL) {
2042 0 : return -1;
2043 : }
2044 0 : if (test_var > uint_max) {
2045 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2046 : PyLong_Type.tp_name, uint_max, test_var);
2047 0 : return -1;
2048 : }
2049 0 : object->sequence_num = test_var;
2050 : } else {
2051 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2052 : PyLong_Type.tp_name);
2053 0 : return -1;
2054 : }
2055 : }
2056 0 : return 0;
2057 : }
2058 :
2059 0 : static PyObject *py_samr_DomInfo13_get_domain_create_time(PyObject *obj, void *closure)
2060 : {
2061 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
2062 0 : PyObject *py_domain_create_time;
2063 0 : py_domain_create_time = PyLong_FromUnsignedLongLong(object->domain_create_time);
2064 0 : return py_domain_create_time;
2065 : }
2066 :
2067 0 : static int py_samr_DomInfo13_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
2068 : {
2069 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
2070 0 : if (value == NULL) {
2071 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_create_time");
2072 0 : return -1;
2073 : }
2074 : {
2075 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->domain_create_time));
2076 0 : if (PyLong_Check(value)) {
2077 0 : unsigned long long test_var;
2078 0 : test_var = PyLong_AsUnsignedLongLong(value);
2079 0 : if (PyErr_Occurred() != NULL) {
2080 0 : return -1;
2081 : }
2082 0 : if (test_var > uint_max) {
2083 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2084 : PyLong_Type.tp_name, uint_max, test_var);
2085 0 : return -1;
2086 : }
2087 0 : object->domain_create_time = test_var;
2088 : } else {
2089 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2090 : PyLong_Type.tp_name);
2091 0 : return -1;
2092 : }
2093 : }
2094 0 : return 0;
2095 : }
2096 :
2097 0 : static PyObject *py_samr_DomInfo13_get_modified_count_at_last_promotion(PyObject *obj, void *closure)
2098 : {
2099 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
2100 0 : PyObject *py_modified_count_at_last_promotion;
2101 0 : py_modified_count_at_last_promotion = PyLong_FromUnsignedLongLong(object->modified_count_at_last_promotion);
2102 0 : return py_modified_count_at_last_promotion;
2103 : }
2104 :
2105 0 : static int py_samr_DomInfo13_set_modified_count_at_last_promotion(PyObject *py_obj, PyObject *value, void *closure)
2106 : {
2107 0 : struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
2108 0 : if (value == NULL) {
2109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->modified_count_at_last_promotion");
2110 0 : return -1;
2111 : }
2112 : {
2113 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->modified_count_at_last_promotion));
2114 0 : if (PyLong_Check(value)) {
2115 0 : unsigned long long test_var;
2116 0 : test_var = PyLong_AsUnsignedLongLong(value);
2117 0 : if (PyErr_Occurred() != NULL) {
2118 0 : return -1;
2119 : }
2120 0 : if (test_var > uint_max) {
2121 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2122 : PyLong_Type.tp_name, uint_max, test_var);
2123 0 : return -1;
2124 : }
2125 0 : object->modified_count_at_last_promotion = test_var;
2126 : } else {
2127 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2128 : PyLong_Type.tp_name);
2129 0 : return -1;
2130 : }
2131 : }
2132 0 : return 0;
2133 : }
2134 :
2135 : static PyGetSetDef py_samr_DomInfo13_getsetters[] = {
2136 : {
2137 : .name = discard_const_p(char, "sequence_num"),
2138 : .get = py_samr_DomInfo13_get_sequence_num,
2139 : .set = py_samr_DomInfo13_set_sequence_num,
2140 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2141 : },
2142 : {
2143 : .name = discard_const_p(char, "domain_create_time"),
2144 : .get = py_samr_DomInfo13_get_domain_create_time,
2145 : .set = py_samr_DomInfo13_set_domain_create_time,
2146 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
2147 : },
2148 : {
2149 : .name = discard_const_p(char, "modified_count_at_last_promotion"),
2150 : .get = py_samr_DomInfo13_get_modified_count_at_last_promotion,
2151 : .set = py_samr_DomInfo13_set_modified_count_at_last_promotion,
2152 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
2153 : },
2154 : { .name = NULL }
2155 : };
2156 :
2157 0 : static PyObject *py_samr_DomInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2158 : {
2159 0 : return pytalloc_new(struct samr_DomInfo13, type);
2160 : }
2161 :
2162 :
2163 : static PyTypeObject samr_DomInfo13_Type = {
2164 : PyVarObject_HEAD_INIT(NULL, 0)
2165 : .tp_name = "samr.DomInfo13",
2166 : .tp_getset = py_samr_DomInfo13_getsetters,
2167 : .tp_methods = NULL,
2168 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2169 : .tp_new = py_samr_DomInfo13_new,
2170 : };
2171 :
2172 4 : static PyObject *py_import_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union samr_DomainInfo *in)
2173 : {
2174 0 : PyObject *ret;
2175 :
2176 4 : switch (level) {
2177 0 : case 1:
2178 0 : ret = pytalloc_reference_ex(&samr_DomInfo1_Type, mem_ctx, &in->info1);
2179 0 : return ret;
2180 :
2181 3 : case 2:
2182 3 : ret = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, mem_ctx, &in->general);
2183 3 : return ret;
2184 :
2185 0 : case 3:
2186 0 : ret = pytalloc_reference_ex(&samr_DomInfo3_Type, mem_ctx, &in->info3);
2187 0 : return ret;
2188 :
2189 0 : case 4:
2190 0 : ret = pytalloc_reference_ex(&samr_DomOEMInformation_Type, mem_ctx, &in->oem);
2191 0 : return ret;
2192 :
2193 0 : case 5:
2194 0 : ret = pytalloc_reference_ex(&samr_DomInfo5_Type, mem_ctx, &in->info5);
2195 0 : return ret;
2196 :
2197 0 : case 6:
2198 0 : ret = pytalloc_reference_ex(&samr_DomInfo6_Type, mem_ctx, &in->info6);
2199 0 : return ret;
2200 :
2201 0 : case 7:
2202 0 : ret = pytalloc_reference_ex(&samr_DomInfo7_Type, mem_ctx, &in->info7);
2203 0 : return ret;
2204 :
2205 0 : case 8:
2206 0 : ret = pytalloc_reference_ex(&samr_DomInfo8_Type, mem_ctx, &in->info8);
2207 0 : return ret;
2208 :
2209 0 : case 9:
2210 0 : ret = pytalloc_reference_ex(&samr_DomInfo9_Type, mem_ctx, &in->info9);
2211 0 : return ret;
2212 :
2213 0 : case 11:
2214 0 : ret = pytalloc_reference_ex(&samr_DomGeneralInformation2_Type, mem_ctx, &in->general2);
2215 0 : return ret;
2216 :
2217 1 : case 12:
2218 1 : ret = pytalloc_reference_ex(&samr_DomInfo12_Type, mem_ctx, &in->info12);
2219 1 : return ret;
2220 :
2221 0 : case 13:
2222 0 : ret = pytalloc_reference_ex(&samr_DomInfo13_Type, mem_ctx, &in->info13);
2223 0 : return ret;
2224 :
2225 : }
2226 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2227 0 : return NULL;
2228 : }
2229 :
2230 0 : static union samr_DomainInfo *py_export_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2231 : {
2232 0 : union samr_DomainInfo *ret = talloc_zero(mem_ctx, union samr_DomainInfo);
2233 0 : switch (level) {
2234 0 : case 1:
2235 0 : if (in == NULL) {
2236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
2237 0 : talloc_free(ret); return NULL;
2238 : }
2239 0 : PY_CHECK_TYPE(&samr_DomInfo1_Type, in, talloc_free(ret); return NULL;);
2240 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2241 0 : PyErr_NoMemory();
2242 0 : talloc_free(ret); return NULL;
2243 : }
2244 0 : ret->info1 = *(struct samr_DomInfo1 *)pytalloc_get_ptr(in);
2245 0 : break;
2246 :
2247 0 : case 2:
2248 0 : if (in == NULL) {
2249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->general");
2250 0 : talloc_free(ret); return NULL;
2251 : }
2252 0 : PY_CHECK_TYPE(&samr_DomGeneralInformation_Type, in, talloc_free(ret); return NULL;);
2253 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2254 0 : PyErr_NoMemory();
2255 0 : talloc_free(ret); return NULL;
2256 : }
2257 0 : ret->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(in);
2258 0 : break;
2259 :
2260 0 : case 3:
2261 0 : if (in == NULL) {
2262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
2263 0 : talloc_free(ret); return NULL;
2264 : }
2265 0 : PY_CHECK_TYPE(&samr_DomInfo3_Type, in, talloc_free(ret); return NULL;);
2266 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2267 0 : PyErr_NoMemory();
2268 0 : talloc_free(ret); return NULL;
2269 : }
2270 0 : ret->info3 = *(struct samr_DomInfo3 *)pytalloc_get_ptr(in);
2271 0 : break;
2272 :
2273 0 : case 4:
2274 0 : if (in == NULL) {
2275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->oem");
2276 0 : talloc_free(ret); return NULL;
2277 : }
2278 0 : PY_CHECK_TYPE(&samr_DomOEMInformation_Type, in, talloc_free(ret); return NULL;);
2279 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2280 0 : PyErr_NoMemory();
2281 0 : talloc_free(ret); return NULL;
2282 : }
2283 0 : ret->oem = *(struct samr_DomOEMInformation *)pytalloc_get_ptr(in);
2284 0 : break;
2285 :
2286 0 : case 5:
2287 0 : if (in == NULL) {
2288 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5");
2289 0 : talloc_free(ret); return NULL;
2290 : }
2291 0 : PY_CHECK_TYPE(&samr_DomInfo5_Type, in, talloc_free(ret); return NULL;);
2292 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2293 0 : PyErr_NoMemory();
2294 0 : talloc_free(ret); return NULL;
2295 : }
2296 0 : ret->info5 = *(struct samr_DomInfo5 *)pytalloc_get_ptr(in);
2297 0 : break;
2298 :
2299 0 : case 6:
2300 0 : if (in == NULL) {
2301 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info6");
2302 0 : talloc_free(ret); return NULL;
2303 : }
2304 0 : PY_CHECK_TYPE(&samr_DomInfo6_Type, in, talloc_free(ret); return NULL;);
2305 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2306 0 : PyErr_NoMemory();
2307 0 : talloc_free(ret); return NULL;
2308 : }
2309 0 : ret->info6 = *(struct samr_DomInfo6 *)pytalloc_get_ptr(in);
2310 0 : break;
2311 :
2312 0 : case 7:
2313 0 : if (in == NULL) {
2314 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info7");
2315 0 : talloc_free(ret); return NULL;
2316 : }
2317 0 : PY_CHECK_TYPE(&samr_DomInfo7_Type, in, talloc_free(ret); return NULL;);
2318 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2319 0 : PyErr_NoMemory();
2320 0 : talloc_free(ret); return NULL;
2321 : }
2322 0 : ret->info7 = *(struct samr_DomInfo7 *)pytalloc_get_ptr(in);
2323 0 : break;
2324 :
2325 0 : case 8:
2326 0 : if (in == NULL) {
2327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info8");
2328 0 : talloc_free(ret); return NULL;
2329 : }
2330 0 : PY_CHECK_TYPE(&samr_DomInfo8_Type, in, talloc_free(ret); return NULL;);
2331 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2332 0 : PyErr_NoMemory();
2333 0 : talloc_free(ret); return NULL;
2334 : }
2335 0 : ret->info8 = *(struct samr_DomInfo8 *)pytalloc_get_ptr(in);
2336 0 : break;
2337 :
2338 0 : case 9:
2339 0 : if (in == NULL) {
2340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info9");
2341 0 : talloc_free(ret); return NULL;
2342 : }
2343 0 : PY_CHECK_TYPE(&samr_DomInfo9_Type, in, talloc_free(ret); return NULL;);
2344 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2345 0 : PyErr_NoMemory();
2346 0 : talloc_free(ret); return NULL;
2347 : }
2348 0 : ret->info9 = *(struct samr_DomInfo9 *)pytalloc_get_ptr(in);
2349 0 : break;
2350 :
2351 0 : case 11:
2352 0 : if (in == NULL) {
2353 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->general2");
2354 0 : talloc_free(ret); return NULL;
2355 : }
2356 0 : PY_CHECK_TYPE(&samr_DomGeneralInformation2_Type, in, talloc_free(ret); return NULL;);
2357 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2358 0 : PyErr_NoMemory();
2359 0 : talloc_free(ret); return NULL;
2360 : }
2361 0 : ret->general2 = *(struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(in);
2362 0 : break;
2363 :
2364 0 : case 12:
2365 0 : if (in == NULL) {
2366 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info12");
2367 0 : talloc_free(ret); return NULL;
2368 : }
2369 0 : PY_CHECK_TYPE(&samr_DomInfo12_Type, in, talloc_free(ret); return NULL;);
2370 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2371 0 : PyErr_NoMemory();
2372 0 : talloc_free(ret); return NULL;
2373 : }
2374 0 : ret->info12 = *(struct samr_DomInfo12 *)pytalloc_get_ptr(in);
2375 0 : break;
2376 :
2377 0 : case 13:
2378 0 : if (in == NULL) {
2379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info13");
2380 0 : talloc_free(ret); return NULL;
2381 : }
2382 0 : PY_CHECK_TYPE(&samr_DomInfo13_Type, in, talloc_free(ret); return NULL;);
2383 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2384 0 : PyErr_NoMemory();
2385 0 : talloc_free(ret); return NULL;
2386 : }
2387 0 : ret->info13 = *(struct samr_DomInfo13 *)pytalloc_get_ptr(in);
2388 0 : break;
2389 :
2390 0 : default:
2391 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
2392 0 : talloc_free(ret);
2393 0 : ret = NULL;
2394 : }
2395 :
2396 0 : return ret;
2397 : }
2398 :
2399 4 : static PyObject *py_samr_DomainInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2400 : {
2401 4 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2402 4 : PyObject *mem_ctx_obj = NULL;
2403 4 : TALLOC_CTX *mem_ctx = NULL;
2404 4 : int level = 0;
2405 4 : PyObject *in_obj = NULL;
2406 4 : union samr_DomainInfo *in = NULL;
2407 :
2408 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
2409 : discard_const_p(char *, kwnames),
2410 : &mem_ctx_obj,
2411 : &level,
2412 : &in_obj)) {
2413 0 : return NULL;
2414 : }
2415 4 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2416 4 : if (mem_ctx == NULL) {
2417 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2418 0 : return NULL;
2419 : }
2420 4 : in = (union samr_DomainInfo *)pytalloc_get_ptr(in_obj);
2421 4 : if (in == NULL) {
2422 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_DomainInfo!");
2423 0 : return NULL;
2424 : }
2425 :
2426 4 : return py_import_samr_DomainInfo(mem_ctx, level, in);
2427 : }
2428 :
2429 0 : static PyObject *py_samr_DomainInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2430 : {
2431 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
2432 0 : PyObject *mem_ctx_obj = NULL;
2433 0 : TALLOC_CTX *mem_ctx = NULL;
2434 0 : int level = 0;
2435 0 : PyObject *in = NULL;
2436 0 : union samr_DomainInfo *out = NULL;
2437 :
2438 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
2439 : discard_const_p(char *, kwnames),
2440 : &mem_ctx_obj,
2441 : &level,
2442 : &in)) {
2443 0 : return NULL;
2444 : }
2445 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
2446 0 : if (mem_ctx == NULL) {
2447 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
2448 0 : return NULL;
2449 : }
2450 :
2451 0 : out = py_export_samr_DomainInfo(mem_ctx, level, in);
2452 0 : if (out == NULL) {
2453 0 : return NULL;
2454 : }
2455 :
2456 0 : return pytalloc_GenericObject_reference(out);
2457 : }
2458 :
2459 : static PyMethodDef py_samr_DomainInfo_methods[] = {
2460 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DomainInfo_import),
2461 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2462 : "T.__import__(mem_ctx, level, in) => ret." },
2463 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DomainInfo_export),
2464 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
2465 : "T.__export__(mem_ctx, level, in) => ret." },
2466 : { NULL, NULL, 0, NULL }
2467 : };
2468 :
2469 0 : static PyObject *py_samr_DomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2470 : {
2471 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
2472 0 : return NULL;
2473 : }
2474 :
2475 :
2476 : static PyTypeObject samr_DomainInfo_Type = {
2477 : PyVarObject_HEAD_INIT(NULL, 0)
2478 : .tp_name = "samr.DomainInfo",
2479 : .tp_getset = NULL,
2480 : .tp_methods = py_samr_DomainInfo_methods,
2481 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2482 : .tp_new = py_samr_DomainInfo_new,
2483 : };
2484 :
2485 :
2486 0 : static PyObject *py_samr_Ids_get_count(PyObject *obj, void *closure)
2487 : {
2488 0 : struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
2489 0 : PyObject *py_count;
2490 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
2491 0 : return py_count;
2492 : }
2493 :
2494 0 : static int py_samr_Ids_set_count(PyObject *py_obj, PyObject *value, void *closure)
2495 : {
2496 0 : struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj);
2497 0 : if (value == NULL) {
2498 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
2499 0 : return -1;
2500 : }
2501 : {
2502 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
2503 0 : if (PyLong_Check(value)) {
2504 0 : unsigned long long test_var;
2505 0 : test_var = PyLong_AsUnsignedLongLong(value);
2506 0 : if (PyErr_Occurred() != NULL) {
2507 0 : return -1;
2508 : }
2509 0 : if (test_var > uint_max) {
2510 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2511 : PyLong_Type.tp_name, uint_max, test_var);
2512 0 : return -1;
2513 : }
2514 0 : object->count = test_var;
2515 : } else {
2516 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2517 : PyLong_Type.tp_name);
2518 0 : return -1;
2519 : }
2520 : }
2521 0 : return 0;
2522 : }
2523 :
2524 10 : static PyObject *py_samr_Ids_get_ids(PyObject *obj, void *closure)
2525 : {
2526 10 : struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
2527 0 : PyObject *py_ids;
2528 10 : if (object->ids == NULL) {
2529 0 : Py_RETURN_NONE;
2530 : }
2531 10 : if (object->ids == NULL) {
2532 0 : py_ids = Py_None;
2533 0 : Py_INCREF(py_ids);
2534 : } else {
2535 10 : py_ids = PyList_New(object->count);
2536 10 : if (py_ids == NULL) {
2537 0 : return NULL;
2538 : }
2539 : {
2540 : int ids_cntr_1;
2541 20 : for (ids_cntr_1 = 0; ids_cntr_1 < (object->count); ids_cntr_1++) {
2542 0 : PyObject *py_ids_1;
2543 10 : py_ids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->ids[ids_cntr_1]);
2544 10 : PyList_SetItem(py_ids, ids_cntr_1, py_ids_1);
2545 : }
2546 : }
2547 : }
2548 10 : return py_ids;
2549 : }
2550 :
2551 0 : static int py_samr_Ids_set_ids(PyObject *py_obj, PyObject *value, void *closure)
2552 : {
2553 0 : struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj);
2554 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->ids));
2555 0 : if (value == NULL) {
2556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids");
2557 0 : return -1;
2558 : }
2559 0 : if (value == Py_None) {
2560 0 : object->ids = NULL;
2561 : } else {
2562 0 : object->ids = NULL;
2563 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2564 : {
2565 0 : int ids_cntr_1;
2566 0 : object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
2567 0 : if (!object->ids) { return -1; }
2568 0 : talloc_set_name_const(object->ids, "ARRAY: object->ids");
2569 0 : for (ids_cntr_1 = 0; ids_cntr_1 < PyList_GET_SIZE(value); ids_cntr_1++) {
2570 0 : if (PyList_GET_ITEM(value, ids_cntr_1) == NULL) {
2571 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ids[ids_cntr_1]");
2572 0 : return -1;
2573 : }
2574 : {
2575 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ids[ids_cntr_1]));
2576 0 : if (PyLong_Check(PyList_GET_ITEM(value, ids_cntr_1))) {
2577 0 : unsigned long long test_var;
2578 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, ids_cntr_1));
2579 0 : if (PyErr_Occurred() != NULL) {
2580 0 : return -1;
2581 : }
2582 0 : if (test_var > uint_max) {
2583 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2584 : PyLong_Type.tp_name, uint_max, test_var);
2585 0 : return -1;
2586 : }
2587 0 : object->ids[ids_cntr_1] = test_var;
2588 : } else {
2589 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2590 : PyLong_Type.tp_name);
2591 0 : return -1;
2592 : }
2593 : }
2594 : }
2595 : }
2596 : }
2597 0 : return 0;
2598 : }
2599 :
2600 : static PyGetSetDef py_samr_Ids_getsetters[] = {
2601 : {
2602 : .name = discard_const_p(char, "count"),
2603 : .get = py_samr_Ids_get_count,
2604 : .set = py_samr_Ids_set_count,
2605 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2606 : },
2607 : {
2608 : .name = discard_const_p(char, "ids"),
2609 : .get = py_samr_Ids_get_ids,
2610 : .set = py_samr_Ids_set_ids,
2611 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2612 : },
2613 : { .name = NULL }
2614 : };
2615 :
2616 0 : static PyObject *py_samr_Ids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2617 : {
2618 0 : return pytalloc_new(struct samr_Ids, type);
2619 : }
2620 :
2621 :
2622 : static PyTypeObject samr_Ids_Type = {
2623 : PyVarObject_HEAD_INIT(NULL, 0)
2624 : .tp_name = "samr.Ids",
2625 : .tp_getset = py_samr_Ids_getsetters,
2626 : .tp_methods = NULL,
2627 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2628 : .tp_new = py_samr_Ids_new,
2629 : };
2630 :
2631 :
2632 0 : static PyObject *py_samr_GroupInfoAll_get_name(PyObject *obj, void *closure)
2633 : {
2634 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
2635 0 : PyObject *py_name;
2636 0 : py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
2637 0 : return py_name;
2638 : }
2639 :
2640 0 : static int py_samr_GroupInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
2641 : {
2642 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
2643 0 : if (value == NULL) {
2644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
2645 0 : return -1;
2646 : }
2647 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2648 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2649 0 : PyErr_NoMemory();
2650 0 : return -1;
2651 : }
2652 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
2653 0 : return 0;
2654 : }
2655 :
2656 0 : static PyObject *py_samr_GroupInfoAll_get_attributes(PyObject *obj, void *closure)
2657 : {
2658 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
2659 0 : PyObject *py_attributes;
2660 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
2661 0 : return py_attributes;
2662 : }
2663 :
2664 0 : static int py_samr_GroupInfoAll_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2665 : {
2666 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
2667 0 : if (value == NULL) {
2668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
2669 0 : return -1;
2670 : }
2671 : {
2672 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2673 0 : if (PyLong_Check(value)) {
2674 0 : unsigned long long test_var;
2675 0 : test_var = PyLong_AsUnsignedLongLong(value);
2676 0 : if (PyErr_Occurred() != NULL) {
2677 0 : return -1;
2678 : }
2679 0 : if (test_var > uint_max) {
2680 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2681 : PyLong_Type.tp_name, uint_max, test_var);
2682 0 : return -1;
2683 : }
2684 0 : object->attributes = test_var;
2685 : } else {
2686 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2687 : PyLong_Type.tp_name);
2688 0 : return -1;
2689 : }
2690 : }
2691 0 : return 0;
2692 : }
2693 :
2694 0 : static PyObject *py_samr_GroupInfoAll_get_num_members(PyObject *obj, void *closure)
2695 : {
2696 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
2697 0 : PyObject *py_num_members;
2698 0 : py_num_members = PyLong_FromUnsignedLongLong((uint32_t)object->num_members);
2699 0 : return py_num_members;
2700 : }
2701 :
2702 0 : static int py_samr_GroupInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
2703 : {
2704 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
2705 0 : if (value == NULL) {
2706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_members");
2707 0 : return -1;
2708 : }
2709 : {
2710 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_members));
2711 0 : if (PyLong_Check(value)) {
2712 0 : unsigned long long test_var;
2713 0 : test_var = PyLong_AsUnsignedLongLong(value);
2714 0 : if (PyErr_Occurred() != NULL) {
2715 0 : return -1;
2716 : }
2717 0 : if (test_var > uint_max) {
2718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2719 : PyLong_Type.tp_name, uint_max, test_var);
2720 0 : return -1;
2721 : }
2722 0 : object->num_members = test_var;
2723 : } else {
2724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2725 : PyLong_Type.tp_name);
2726 0 : return -1;
2727 : }
2728 : }
2729 0 : return 0;
2730 : }
2731 :
2732 0 : static PyObject *py_samr_GroupInfoAll_get_description(PyObject *obj, void *closure)
2733 : {
2734 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
2735 0 : PyObject *py_description;
2736 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
2737 0 : return py_description;
2738 : }
2739 :
2740 0 : static int py_samr_GroupInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
2741 : {
2742 0 : struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
2743 0 : if (value == NULL) {
2744 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
2745 0 : return -1;
2746 : }
2747 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2748 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2749 0 : PyErr_NoMemory();
2750 0 : return -1;
2751 : }
2752 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
2753 0 : return 0;
2754 : }
2755 :
2756 : static PyGetSetDef py_samr_GroupInfoAll_getsetters[] = {
2757 : {
2758 : .name = discard_const_p(char, "name"),
2759 : .get = py_samr_GroupInfoAll_get_name,
2760 : .set = py_samr_GroupInfoAll_set_name,
2761 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
2762 : },
2763 : {
2764 : .name = discard_const_p(char, "attributes"),
2765 : .get = py_samr_GroupInfoAll_get_attributes,
2766 : .set = py_samr_GroupInfoAll_set_attributes,
2767 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
2768 : },
2769 : {
2770 : .name = discard_const_p(char, "num_members"),
2771 : .get = py_samr_GroupInfoAll_get_num_members,
2772 : .set = py_samr_GroupInfoAll_set_num_members,
2773 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
2774 : },
2775 : {
2776 : .name = discard_const_p(char, "description"),
2777 : .get = py_samr_GroupInfoAll_get_description,
2778 : .set = py_samr_GroupInfoAll_set_description,
2779 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
2780 : },
2781 : { .name = NULL }
2782 : };
2783 :
2784 0 : static PyObject *py_samr_GroupInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2785 : {
2786 0 : return pytalloc_new(struct samr_GroupInfoAll, type);
2787 : }
2788 :
2789 :
2790 : static PyTypeObject samr_GroupInfoAll_Type = {
2791 : PyVarObject_HEAD_INIT(NULL, 0)
2792 : .tp_name = "samr.GroupInfoAll",
2793 : .tp_getset = py_samr_GroupInfoAll_getsetters,
2794 : .tp_methods = NULL,
2795 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2796 : .tp_new = py_samr_GroupInfoAll_new,
2797 : };
2798 :
2799 :
2800 0 : static PyObject *py_samr_GroupInfoAttributes_get_attributes(PyObject *obj, void *closure)
2801 : {
2802 0 : struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(obj);
2803 0 : PyObject *py_attributes;
2804 0 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
2805 0 : return py_attributes;
2806 : }
2807 :
2808 0 : static int py_samr_GroupInfoAttributes_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
2809 : {
2810 0 : struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(py_obj);
2811 0 : if (value == NULL) {
2812 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
2813 0 : return -1;
2814 : }
2815 : {
2816 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
2817 0 : if (PyLong_Check(value)) {
2818 0 : unsigned long long test_var;
2819 0 : test_var = PyLong_AsUnsignedLongLong(value);
2820 0 : if (PyErr_Occurred() != NULL) {
2821 0 : return -1;
2822 : }
2823 0 : if (test_var > uint_max) {
2824 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
2825 : PyLong_Type.tp_name, uint_max, test_var);
2826 0 : return -1;
2827 : }
2828 0 : object->attributes = test_var;
2829 : } else {
2830 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
2831 : PyLong_Type.tp_name);
2832 0 : return -1;
2833 : }
2834 : }
2835 0 : return 0;
2836 : }
2837 :
2838 : static PyGetSetDef py_samr_GroupInfoAttributes_getsetters[] = {
2839 : {
2840 : .name = discard_const_p(char, "attributes"),
2841 : .get = py_samr_GroupInfoAttributes_get_attributes,
2842 : .set = py_samr_GroupInfoAttributes_set_attributes,
2843 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
2844 : },
2845 : { .name = NULL }
2846 : };
2847 :
2848 0 : static PyObject *py_samr_GroupInfoAttributes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2849 : {
2850 0 : return pytalloc_new(struct samr_GroupInfoAttributes, type);
2851 : }
2852 :
2853 :
2854 : static PyTypeObject samr_GroupInfoAttributes_Type = {
2855 : PyVarObject_HEAD_INIT(NULL, 0)
2856 : .tp_name = "samr.GroupInfoAttributes",
2857 : .tp_getset = py_samr_GroupInfoAttributes_getsetters,
2858 : .tp_methods = NULL,
2859 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2860 : .tp_new = py_samr_GroupInfoAttributes_new,
2861 : };
2862 :
2863 :
2864 0 : static PyObject *py_samr_GroupInfoDescription_get_description(PyObject *obj, void *closure)
2865 : {
2866 0 : struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(obj);
2867 0 : PyObject *py_description;
2868 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
2869 0 : return py_description;
2870 : }
2871 :
2872 0 : static int py_samr_GroupInfoDescription_set_description(PyObject *py_obj, PyObject *value, void *closure)
2873 : {
2874 0 : struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(py_obj);
2875 0 : if (value == NULL) {
2876 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
2877 0 : return -1;
2878 : }
2879 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2880 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2881 0 : PyErr_NoMemory();
2882 0 : return -1;
2883 : }
2884 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
2885 0 : return 0;
2886 : }
2887 :
2888 : static PyGetSetDef py_samr_GroupInfoDescription_getsetters[] = {
2889 : {
2890 : .name = discard_const_p(char, "description"),
2891 : .get = py_samr_GroupInfoDescription_get_description,
2892 : .set = py_samr_GroupInfoDescription_set_description,
2893 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
2894 : },
2895 : { .name = NULL }
2896 : };
2897 :
2898 0 : static PyObject *py_samr_GroupInfoDescription_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2899 : {
2900 0 : return pytalloc_new(struct samr_GroupInfoDescription, type);
2901 : }
2902 :
2903 :
2904 : static PyTypeObject samr_GroupInfoDescription_Type = {
2905 : PyVarObject_HEAD_INIT(NULL, 0)
2906 : .tp_name = "samr.GroupInfoDescription",
2907 : .tp_getset = py_samr_GroupInfoDescription_getsetters,
2908 : .tp_methods = NULL,
2909 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2910 : .tp_new = py_samr_GroupInfoDescription_new,
2911 : };
2912 :
2913 0 : static PyObject *py_import_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, union samr_GroupInfo *in)
2914 : {
2915 0 : PyObject *ret;
2916 :
2917 0 : switch (level) {
2918 0 : case GROUPINFOALL:
2919 0 : ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all);
2920 0 : return ret;
2921 :
2922 0 : case GROUPINFONAME:
2923 0 : ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
2924 0 : return ret;
2925 :
2926 0 : case GROUPINFOATTRIBUTES:
2927 0 : ret = pytalloc_reference_ex(&samr_GroupInfoAttributes_Type, mem_ctx, &in->attributes);
2928 0 : return ret;
2929 :
2930 0 : case GROUPINFODESCRIPTION:
2931 0 : ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
2932 0 : return ret;
2933 :
2934 0 : case GROUPINFOALL2:
2935 0 : ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all2);
2936 0 : return ret;
2937 :
2938 : }
2939 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
2940 0 : return NULL;
2941 : }
2942 :
2943 0 : static union samr_GroupInfo *py_export_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2944 : {
2945 0 : union samr_GroupInfo *ret = talloc_zero(mem_ctx, union samr_GroupInfo);
2946 0 : switch (level) {
2947 0 : case GROUPINFOALL:
2948 0 : if (in == NULL) {
2949 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all");
2950 0 : talloc_free(ret); return NULL;
2951 : }
2952 0 : PY_CHECK_TYPE(&samr_GroupInfoAll_Type, in, talloc_free(ret); return NULL;);
2953 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2954 0 : PyErr_NoMemory();
2955 0 : talloc_free(ret); return NULL;
2956 : }
2957 0 : ret->all = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
2958 0 : break;
2959 :
2960 0 : case GROUPINFONAME:
2961 0 : if (in == NULL) {
2962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
2963 0 : talloc_free(ret); return NULL;
2964 : }
2965 0 : PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
2966 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2967 0 : PyErr_NoMemory();
2968 0 : talloc_free(ret); return NULL;
2969 : }
2970 0 : ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
2971 0 : break;
2972 :
2973 0 : case GROUPINFOATTRIBUTES:
2974 0 : if (in == NULL) {
2975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->attributes");
2976 0 : talloc_free(ret); return NULL;
2977 : }
2978 0 : PY_CHECK_TYPE(&samr_GroupInfoAttributes_Type, in, talloc_free(ret); return NULL;);
2979 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2980 0 : PyErr_NoMemory();
2981 0 : talloc_free(ret); return NULL;
2982 : }
2983 0 : ret->attributes = *(struct samr_GroupInfoAttributes *)pytalloc_get_ptr(in);
2984 0 : break;
2985 :
2986 0 : case GROUPINFODESCRIPTION:
2987 0 : if (in == NULL) {
2988 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->description");
2989 0 : talloc_free(ret); return NULL;
2990 : }
2991 0 : PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
2992 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2993 0 : PyErr_NoMemory();
2994 0 : talloc_free(ret); return NULL;
2995 : }
2996 0 : ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
2997 0 : break;
2998 :
2999 0 : case GROUPINFOALL2:
3000 0 : if (in == NULL) {
3001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all2");
3002 0 : talloc_free(ret); return NULL;
3003 : }
3004 0 : PY_CHECK_TYPE(&samr_GroupInfoAll_Type, in, talloc_free(ret); return NULL;);
3005 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3006 0 : PyErr_NoMemory();
3007 0 : talloc_free(ret); return NULL;
3008 : }
3009 0 : ret->all2 = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
3010 0 : break;
3011 :
3012 0 : default:
3013 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
3014 0 : talloc_free(ret);
3015 0 : ret = NULL;
3016 : }
3017 :
3018 0 : return ret;
3019 : }
3020 :
3021 0 : static PyObject *py_samr_GroupInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3022 : {
3023 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3024 0 : PyObject *mem_ctx_obj = NULL;
3025 0 : TALLOC_CTX *mem_ctx = NULL;
3026 0 : int level = 0;
3027 0 : PyObject *in_obj = NULL;
3028 0 : union samr_GroupInfo *in = NULL;
3029 :
3030 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
3031 : discard_const_p(char *, kwnames),
3032 : &mem_ctx_obj,
3033 : &level,
3034 : &in_obj)) {
3035 0 : return NULL;
3036 : }
3037 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3038 0 : if (mem_ctx == NULL) {
3039 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3040 0 : return NULL;
3041 : }
3042 0 : in = (union samr_GroupInfo *)pytalloc_get_ptr(in_obj);
3043 0 : if (in == NULL) {
3044 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_GroupInfo!");
3045 0 : return NULL;
3046 : }
3047 :
3048 0 : return py_import_samr_GroupInfo(mem_ctx, level, in);
3049 : }
3050 :
3051 0 : static PyObject *py_samr_GroupInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3052 : {
3053 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3054 0 : PyObject *mem_ctx_obj = NULL;
3055 0 : TALLOC_CTX *mem_ctx = NULL;
3056 0 : int level = 0;
3057 0 : PyObject *in = NULL;
3058 0 : union samr_GroupInfo *out = NULL;
3059 :
3060 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
3061 : discard_const_p(char *, kwnames),
3062 : &mem_ctx_obj,
3063 : &level,
3064 : &in)) {
3065 0 : return NULL;
3066 : }
3067 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3068 0 : if (mem_ctx == NULL) {
3069 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3070 0 : return NULL;
3071 : }
3072 :
3073 0 : out = py_export_samr_GroupInfo(mem_ctx, level, in);
3074 0 : if (out == NULL) {
3075 0 : return NULL;
3076 : }
3077 :
3078 0 : return pytalloc_GenericObject_reference(out);
3079 : }
3080 :
3081 : static PyMethodDef py_samr_GroupInfo_methods[] = {
3082 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GroupInfo_import),
3083 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3084 : "T.__import__(mem_ctx, level, in) => ret." },
3085 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GroupInfo_export),
3086 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3087 : "T.__export__(mem_ctx, level, in) => ret." },
3088 : { NULL, NULL, 0, NULL }
3089 : };
3090 :
3091 0 : static PyObject *py_samr_GroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3092 : {
3093 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
3094 0 : return NULL;
3095 : }
3096 :
3097 :
3098 : static PyTypeObject samr_GroupInfo_Type = {
3099 : PyVarObject_HEAD_INIT(NULL, 0)
3100 : .tp_name = "samr.GroupInfo",
3101 : .tp_getset = NULL,
3102 : .tp_methods = py_samr_GroupInfo_methods,
3103 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3104 : .tp_new = py_samr_GroupInfo_new,
3105 : };
3106 :
3107 :
3108 0 : static PyObject *py_samr_RidAttrArray_get_count(PyObject *obj, void *closure)
3109 : {
3110 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
3111 0 : PyObject *py_count;
3112 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
3113 0 : return py_count;
3114 : }
3115 :
3116 0 : static int py_samr_RidAttrArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
3117 : {
3118 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
3119 0 : if (value == NULL) {
3120 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
3121 0 : return -1;
3122 : }
3123 : {
3124 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
3125 0 : if (PyLong_Check(value)) {
3126 0 : unsigned long long test_var;
3127 0 : test_var = PyLong_AsUnsignedLongLong(value);
3128 0 : if (PyErr_Occurred() != NULL) {
3129 0 : return -1;
3130 : }
3131 0 : if (test_var > uint_max) {
3132 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3133 : PyLong_Type.tp_name, uint_max, test_var);
3134 0 : return -1;
3135 : }
3136 0 : object->count = test_var;
3137 : } else {
3138 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3139 : PyLong_Type.tp_name);
3140 0 : return -1;
3141 : }
3142 : }
3143 0 : return 0;
3144 : }
3145 :
3146 0 : static PyObject *py_samr_RidAttrArray_get_rids(PyObject *obj, void *closure)
3147 : {
3148 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
3149 0 : PyObject *py_rids;
3150 0 : if (object->rids == NULL) {
3151 0 : Py_RETURN_NONE;
3152 : }
3153 0 : if (object->rids == NULL) {
3154 0 : py_rids = Py_None;
3155 0 : Py_INCREF(py_rids);
3156 : } else {
3157 0 : py_rids = PyList_New(object->count);
3158 0 : if (py_rids == NULL) {
3159 0 : return NULL;
3160 : }
3161 : {
3162 : int rids_cntr_1;
3163 0 : for (rids_cntr_1 = 0; rids_cntr_1 < (object->count); rids_cntr_1++) {
3164 0 : PyObject *py_rids_1;
3165 0 : py_rids_1 = PyLong_FromUnsignedLongLong((uint32_t)object->rids[rids_cntr_1]);
3166 0 : PyList_SetItem(py_rids, rids_cntr_1, py_rids_1);
3167 : }
3168 : }
3169 : }
3170 0 : return py_rids;
3171 : }
3172 :
3173 0 : static int py_samr_RidAttrArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
3174 : {
3175 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
3176 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids));
3177 0 : if (value == NULL) {
3178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids");
3179 0 : return -1;
3180 : }
3181 0 : if (value == Py_None) {
3182 0 : object->rids = NULL;
3183 : } else {
3184 0 : object->rids = NULL;
3185 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3186 : {
3187 0 : int rids_cntr_1;
3188 0 : object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
3189 0 : if (!object->rids) { return -1; }
3190 0 : talloc_set_name_const(object->rids, "ARRAY: object->rids");
3191 0 : for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) {
3192 0 : if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) {
3193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]");
3194 0 : return -1;
3195 : }
3196 : {
3197 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rids[rids_cntr_1]));
3198 0 : if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_1))) {
3199 0 : unsigned long long test_var;
3200 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_1));
3201 0 : if (PyErr_Occurred() != NULL) {
3202 0 : return -1;
3203 : }
3204 0 : if (test_var > uint_max) {
3205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3206 : PyLong_Type.tp_name, uint_max, test_var);
3207 0 : return -1;
3208 : }
3209 0 : object->rids[rids_cntr_1] = test_var;
3210 : } else {
3211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3212 : PyLong_Type.tp_name);
3213 0 : return -1;
3214 : }
3215 : }
3216 : }
3217 : }
3218 : }
3219 0 : return 0;
3220 : }
3221 :
3222 0 : static PyObject *py_samr_RidAttrArray_get_attributes(PyObject *obj, void *closure)
3223 : {
3224 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
3225 0 : PyObject *py_attributes;
3226 0 : if (object->attributes == NULL) {
3227 0 : Py_RETURN_NONE;
3228 : }
3229 0 : if (object->attributes == NULL) {
3230 0 : py_attributes = Py_None;
3231 0 : Py_INCREF(py_attributes);
3232 : } else {
3233 0 : py_attributes = PyList_New(object->count);
3234 0 : if (py_attributes == NULL) {
3235 0 : return NULL;
3236 : }
3237 : {
3238 : int attributes_cntr_1;
3239 0 : for (attributes_cntr_1 = 0; attributes_cntr_1 < (object->count); attributes_cntr_1++) {
3240 0 : PyObject *py_attributes_1;
3241 0 : py_attributes_1 = PyLong_FromUnsignedLongLong((uint32_t)object->attributes[attributes_cntr_1]);
3242 0 : PyList_SetItem(py_attributes, attributes_cntr_1, py_attributes_1);
3243 : }
3244 : }
3245 : }
3246 0 : return py_attributes;
3247 : }
3248 :
3249 0 : static int py_samr_RidAttrArray_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
3250 : {
3251 0 : struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
3252 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->attributes));
3253 0 : if (value == NULL) {
3254 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
3255 0 : return -1;
3256 : }
3257 0 : if (value == Py_None) {
3258 0 : object->attributes = NULL;
3259 : } else {
3260 0 : object->attributes = NULL;
3261 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3262 : {
3263 0 : int attributes_cntr_1;
3264 0 : object->attributes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->attributes, PyList_GET_SIZE(value));
3265 0 : if (!object->attributes) { return -1; }
3266 0 : talloc_set_name_const(object->attributes, "ARRAY: object->attributes");
3267 0 : for (attributes_cntr_1 = 0; attributes_cntr_1 < PyList_GET_SIZE(value); attributes_cntr_1++) {
3268 0 : if (PyList_GET_ITEM(value, attributes_cntr_1) == NULL) {
3269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes[attributes_cntr_1]");
3270 0 : return -1;
3271 : }
3272 : {
3273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes[attributes_cntr_1]));
3274 0 : if (PyLong_Check(PyList_GET_ITEM(value, attributes_cntr_1))) {
3275 0 : unsigned long long test_var;
3276 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, attributes_cntr_1));
3277 0 : if (PyErr_Occurred() != NULL) {
3278 0 : return -1;
3279 : }
3280 0 : if (test_var > uint_max) {
3281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3282 : PyLong_Type.tp_name, uint_max, test_var);
3283 0 : return -1;
3284 : }
3285 0 : object->attributes[attributes_cntr_1] = test_var;
3286 : } else {
3287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3288 : PyLong_Type.tp_name);
3289 0 : return -1;
3290 : }
3291 : }
3292 : }
3293 : }
3294 : }
3295 0 : return 0;
3296 : }
3297 :
3298 : static PyGetSetDef py_samr_RidAttrArray_getsetters[] = {
3299 : {
3300 : .name = discard_const_p(char, "count"),
3301 : .get = py_samr_RidAttrArray_get_count,
3302 : .set = py_samr_RidAttrArray_set_count,
3303 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3304 : },
3305 : {
3306 : .name = discard_const_p(char, "rids"),
3307 : .get = py_samr_RidAttrArray_get_rids,
3308 : .set = py_samr_RidAttrArray_set_rids,
3309 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3310 : },
3311 : {
3312 : .name = discard_const_p(char, "attributes"),
3313 : .get = py_samr_RidAttrArray_get_attributes,
3314 : .set = py_samr_RidAttrArray_set_attributes,
3315 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
3316 : },
3317 : { .name = NULL }
3318 : };
3319 :
3320 0 : static PyObject *py_samr_RidAttrArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3321 : {
3322 0 : return pytalloc_new(struct samr_RidAttrArray, type);
3323 : }
3324 :
3325 :
3326 : static PyTypeObject samr_RidAttrArray_Type = {
3327 : PyVarObject_HEAD_INIT(NULL, 0)
3328 : .tp_name = "samr.RidAttrArray",
3329 : .tp_getset = py_samr_RidAttrArray_getsetters,
3330 : .tp_methods = NULL,
3331 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3332 : .tp_new = py_samr_RidAttrArray_new,
3333 : };
3334 :
3335 :
3336 0 : static PyObject *py_samr_AliasInfoAll_get_name(PyObject *obj, void *closure)
3337 : {
3338 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
3339 0 : PyObject *py_name;
3340 0 : py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
3341 0 : return py_name;
3342 : }
3343 :
3344 0 : static int py_samr_AliasInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
3345 : {
3346 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
3347 0 : if (value == NULL) {
3348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
3349 0 : return -1;
3350 : }
3351 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3352 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3353 0 : PyErr_NoMemory();
3354 0 : return -1;
3355 : }
3356 0 : object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
3357 0 : return 0;
3358 : }
3359 :
3360 0 : static PyObject *py_samr_AliasInfoAll_get_num_members(PyObject *obj, void *closure)
3361 : {
3362 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
3363 0 : PyObject *py_num_members;
3364 0 : py_num_members = PyLong_FromUnsignedLongLong((uint32_t)object->num_members);
3365 0 : return py_num_members;
3366 : }
3367 :
3368 0 : static int py_samr_AliasInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
3369 : {
3370 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
3371 0 : if (value == NULL) {
3372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_members");
3373 0 : return -1;
3374 : }
3375 : {
3376 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_members));
3377 0 : if (PyLong_Check(value)) {
3378 0 : unsigned long long test_var;
3379 0 : test_var = PyLong_AsUnsignedLongLong(value);
3380 0 : if (PyErr_Occurred() != NULL) {
3381 0 : return -1;
3382 : }
3383 0 : if (test_var > uint_max) {
3384 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3385 : PyLong_Type.tp_name, uint_max, test_var);
3386 0 : return -1;
3387 : }
3388 0 : object->num_members = test_var;
3389 : } else {
3390 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3391 : PyLong_Type.tp_name);
3392 0 : return -1;
3393 : }
3394 : }
3395 0 : return 0;
3396 : }
3397 :
3398 0 : static PyObject *py_samr_AliasInfoAll_get_description(PyObject *obj, void *closure)
3399 : {
3400 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
3401 0 : PyObject *py_description;
3402 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
3403 0 : return py_description;
3404 : }
3405 :
3406 0 : static int py_samr_AliasInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
3407 : {
3408 0 : struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
3409 0 : if (value == NULL) {
3410 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
3411 0 : return -1;
3412 : }
3413 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3414 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3415 0 : PyErr_NoMemory();
3416 0 : return -1;
3417 : }
3418 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3419 0 : return 0;
3420 : }
3421 :
3422 : static PyGetSetDef py_samr_AliasInfoAll_getsetters[] = {
3423 : {
3424 : .name = discard_const_p(char, "name"),
3425 : .get = py_samr_AliasInfoAll_get_name,
3426 : .set = py_samr_AliasInfoAll_set_name,
3427 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3428 : },
3429 : {
3430 : .name = discard_const_p(char, "num_members"),
3431 : .get = py_samr_AliasInfoAll_get_num_members,
3432 : .set = py_samr_AliasInfoAll_set_num_members,
3433 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3434 : },
3435 : {
3436 : .name = discard_const_p(char, "description"),
3437 : .get = py_samr_AliasInfoAll_get_description,
3438 : .set = py_samr_AliasInfoAll_set_description,
3439 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3440 : },
3441 : { .name = NULL }
3442 : };
3443 :
3444 0 : static PyObject *py_samr_AliasInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3445 : {
3446 0 : return pytalloc_new(struct samr_AliasInfoAll, type);
3447 : }
3448 :
3449 :
3450 : static PyTypeObject samr_AliasInfoAll_Type = {
3451 : PyVarObject_HEAD_INIT(NULL, 0)
3452 : .tp_name = "samr.AliasInfoAll",
3453 : .tp_getset = py_samr_AliasInfoAll_getsetters,
3454 : .tp_methods = NULL,
3455 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3456 : .tp_new = py_samr_AliasInfoAll_new,
3457 : };
3458 :
3459 0 : static PyObject *py_import_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, union samr_AliasInfo *in)
3460 : {
3461 0 : PyObject *ret;
3462 :
3463 0 : switch (level) {
3464 0 : case ALIASINFOALL:
3465 0 : ret = pytalloc_reference_ex(&samr_AliasInfoAll_Type, mem_ctx, &in->all);
3466 0 : return ret;
3467 :
3468 0 : case ALIASINFONAME:
3469 0 : ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
3470 0 : return ret;
3471 :
3472 0 : case ALIASINFODESCRIPTION:
3473 0 : ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
3474 0 : return ret;
3475 :
3476 : }
3477 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
3478 0 : return NULL;
3479 : }
3480 :
3481 0 : static union samr_AliasInfo *py_export_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
3482 : {
3483 0 : union samr_AliasInfo *ret = talloc_zero(mem_ctx, union samr_AliasInfo);
3484 0 : switch (level) {
3485 0 : case ALIASINFOALL:
3486 0 : if (in == NULL) {
3487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->all");
3488 0 : talloc_free(ret); return NULL;
3489 : }
3490 0 : PY_CHECK_TYPE(&samr_AliasInfoAll_Type, in, talloc_free(ret); return NULL;);
3491 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3492 0 : PyErr_NoMemory();
3493 0 : talloc_free(ret); return NULL;
3494 : }
3495 0 : ret->all = *(struct samr_AliasInfoAll *)pytalloc_get_ptr(in);
3496 0 : break;
3497 :
3498 0 : case ALIASINFONAME:
3499 0 : if (in == NULL) {
3500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->name");
3501 0 : talloc_free(ret); return NULL;
3502 : }
3503 0 : PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
3504 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3505 0 : PyErr_NoMemory();
3506 0 : talloc_free(ret); return NULL;
3507 : }
3508 0 : ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
3509 0 : break;
3510 :
3511 0 : case ALIASINFODESCRIPTION:
3512 0 : if (in == NULL) {
3513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->description");
3514 0 : talloc_free(ret); return NULL;
3515 : }
3516 0 : PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
3517 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
3518 0 : PyErr_NoMemory();
3519 0 : talloc_free(ret); return NULL;
3520 : }
3521 0 : ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
3522 0 : break;
3523 :
3524 0 : default:
3525 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
3526 0 : talloc_free(ret);
3527 0 : ret = NULL;
3528 : }
3529 :
3530 0 : return ret;
3531 : }
3532 :
3533 0 : static PyObject *py_samr_AliasInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3534 : {
3535 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3536 0 : PyObject *mem_ctx_obj = NULL;
3537 0 : TALLOC_CTX *mem_ctx = NULL;
3538 0 : int level = 0;
3539 0 : PyObject *in_obj = NULL;
3540 0 : union samr_AliasInfo *in = NULL;
3541 :
3542 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
3543 : discard_const_p(char *, kwnames),
3544 : &mem_ctx_obj,
3545 : &level,
3546 : &in_obj)) {
3547 0 : return NULL;
3548 : }
3549 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3550 0 : if (mem_ctx == NULL) {
3551 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3552 0 : return NULL;
3553 : }
3554 0 : in = (union samr_AliasInfo *)pytalloc_get_ptr(in_obj);
3555 0 : if (in == NULL) {
3556 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_AliasInfo!");
3557 0 : return NULL;
3558 : }
3559 :
3560 0 : return py_import_samr_AliasInfo(mem_ctx, level, in);
3561 : }
3562 :
3563 0 : static PyObject *py_samr_AliasInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3564 : {
3565 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
3566 0 : PyObject *mem_ctx_obj = NULL;
3567 0 : TALLOC_CTX *mem_ctx = NULL;
3568 0 : int level = 0;
3569 0 : PyObject *in = NULL;
3570 0 : union samr_AliasInfo *out = NULL;
3571 :
3572 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
3573 : discard_const_p(char *, kwnames),
3574 : &mem_ctx_obj,
3575 : &level,
3576 : &in)) {
3577 0 : return NULL;
3578 : }
3579 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
3580 0 : if (mem_ctx == NULL) {
3581 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
3582 0 : return NULL;
3583 : }
3584 :
3585 0 : out = py_export_samr_AliasInfo(mem_ctx, level, in);
3586 0 : if (out == NULL) {
3587 0 : return NULL;
3588 : }
3589 :
3590 0 : return pytalloc_GenericObject_reference(out);
3591 : }
3592 :
3593 : static PyMethodDef py_samr_AliasInfo_methods[] = {
3594 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AliasInfo_import),
3595 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3596 : "T.__import__(mem_ctx, level, in) => ret." },
3597 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AliasInfo_export),
3598 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
3599 : "T.__export__(mem_ctx, level, in) => ret." },
3600 : { NULL, NULL, 0, NULL }
3601 : };
3602 :
3603 0 : static PyObject *py_samr_AliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3604 : {
3605 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
3606 0 : return NULL;
3607 : }
3608 :
3609 :
3610 : static PyTypeObject samr_AliasInfo_Type = {
3611 : PyVarObject_HEAD_INIT(NULL, 0)
3612 : .tp_name = "samr.AliasInfo",
3613 : .tp_getset = NULL,
3614 : .tp_methods = py_samr_AliasInfo_methods,
3615 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3616 : .tp_new = py_samr_AliasInfo_new,
3617 : };
3618 :
3619 :
3620 0 : static PyObject *py_samr_UserInfo1_get_account_name(PyObject *obj, void *closure)
3621 : {
3622 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
3623 0 : PyObject *py_account_name;
3624 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
3625 0 : return py_account_name;
3626 : }
3627 :
3628 0 : static int py_samr_UserInfo1_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3629 : {
3630 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
3631 0 : if (value == NULL) {
3632 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
3633 0 : return -1;
3634 : }
3635 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3636 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3637 0 : PyErr_NoMemory();
3638 0 : return -1;
3639 : }
3640 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3641 0 : return 0;
3642 : }
3643 :
3644 0 : static PyObject *py_samr_UserInfo1_get_full_name(PyObject *obj, void *closure)
3645 : {
3646 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
3647 0 : PyObject *py_full_name;
3648 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
3649 0 : return py_full_name;
3650 : }
3651 :
3652 0 : static int py_samr_UserInfo1_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3653 : {
3654 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
3655 0 : if (value == NULL) {
3656 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
3657 0 : return -1;
3658 : }
3659 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3660 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3661 0 : PyErr_NoMemory();
3662 0 : return -1;
3663 : }
3664 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3665 0 : return 0;
3666 : }
3667 :
3668 6 : static PyObject *py_samr_UserInfo1_get_primary_gid(PyObject *obj, void *closure)
3669 : {
3670 6 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
3671 0 : PyObject *py_primary_gid;
3672 6 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
3673 6 : return py_primary_gid;
3674 : }
3675 :
3676 0 : static int py_samr_UserInfo1_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
3677 : {
3678 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
3679 0 : if (value == NULL) {
3680 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
3681 0 : return -1;
3682 : }
3683 : {
3684 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
3685 0 : if (PyLong_Check(value)) {
3686 0 : unsigned long long test_var;
3687 0 : test_var = PyLong_AsUnsignedLongLong(value);
3688 0 : if (PyErr_Occurred() != NULL) {
3689 0 : return -1;
3690 : }
3691 0 : if (test_var > uint_max) {
3692 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3693 : PyLong_Type.tp_name, uint_max, test_var);
3694 0 : return -1;
3695 : }
3696 0 : object->primary_gid = test_var;
3697 : } else {
3698 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3699 : PyLong_Type.tp_name);
3700 0 : return -1;
3701 : }
3702 : }
3703 0 : return 0;
3704 : }
3705 :
3706 0 : static PyObject *py_samr_UserInfo1_get_description(PyObject *obj, void *closure)
3707 : {
3708 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
3709 0 : PyObject *py_description;
3710 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
3711 0 : return py_description;
3712 : }
3713 :
3714 0 : static int py_samr_UserInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure)
3715 : {
3716 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
3717 0 : if (value == NULL) {
3718 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
3719 0 : return -1;
3720 : }
3721 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3722 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3723 0 : PyErr_NoMemory();
3724 0 : return -1;
3725 : }
3726 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3727 0 : return 0;
3728 : }
3729 :
3730 0 : static PyObject *py_samr_UserInfo1_get_comment(PyObject *obj, void *closure)
3731 : {
3732 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
3733 0 : PyObject *py_comment;
3734 0 : py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
3735 0 : return py_comment;
3736 : }
3737 :
3738 0 : static int py_samr_UserInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
3739 : {
3740 0 : struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
3741 0 : if (value == NULL) {
3742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
3743 0 : return -1;
3744 : }
3745 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3746 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3747 0 : PyErr_NoMemory();
3748 0 : return -1;
3749 : }
3750 0 : object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
3751 0 : return 0;
3752 : }
3753 :
3754 : static PyGetSetDef py_samr_UserInfo1_getsetters[] = {
3755 : {
3756 : .name = discard_const_p(char, "account_name"),
3757 : .get = py_samr_UserInfo1_get_account_name,
3758 : .set = py_samr_UserInfo1_set_account_name,
3759 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3760 : },
3761 : {
3762 : .name = discard_const_p(char, "full_name"),
3763 : .get = py_samr_UserInfo1_get_full_name,
3764 : .set = py_samr_UserInfo1_set_full_name,
3765 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3766 : },
3767 : {
3768 : .name = discard_const_p(char, "primary_gid"),
3769 : .get = py_samr_UserInfo1_get_primary_gid,
3770 : .set = py_samr_UserInfo1_set_primary_gid,
3771 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
3772 : },
3773 : {
3774 : .name = discard_const_p(char, "description"),
3775 : .get = py_samr_UserInfo1_get_description,
3776 : .set = py_samr_UserInfo1_set_description,
3777 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3778 : },
3779 : {
3780 : .name = discard_const_p(char, "comment"),
3781 : .get = py_samr_UserInfo1_get_comment,
3782 : .set = py_samr_UserInfo1_set_comment,
3783 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3784 : },
3785 : { .name = NULL }
3786 : };
3787 :
3788 0 : static PyObject *py_samr_UserInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3789 : {
3790 0 : return pytalloc_new(struct samr_UserInfo1, type);
3791 : }
3792 :
3793 :
3794 : static PyTypeObject samr_UserInfo1_Type = {
3795 : PyVarObject_HEAD_INIT(NULL, 0)
3796 : .tp_name = "samr.UserInfo1",
3797 : .tp_getset = py_samr_UserInfo1_getsetters,
3798 : .tp_methods = NULL,
3799 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3800 : .tp_new = py_samr_UserInfo1_new,
3801 : };
3802 :
3803 :
3804 0 : static PyObject *py_samr_UserInfo2_get_comment(PyObject *obj, void *closure)
3805 : {
3806 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
3807 0 : PyObject *py_comment;
3808 0 : py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
3809 0 : return py_comment;
3810 : }
3811 :
3812 0 : static int py_samr_UserInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
3813 : {
3814 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
3815 0 : if (value == NULL) {
3816 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
3817 0 : return -1;
3818 : }
3819 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3820 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3821 0 : PyErr_NoMemory();
3822 0 : return -1;
3823 : }
3824 0 : object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
3825 0 : return 0;
3826 : }
3827 :
3828 0 : static PyObject *py_samr_UserInfo2_get_reserved(PyObject *obj, void *closure)
3829 : {
3830 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
3831 0 : PyObject *py_reserved;
3832 0 : py_reserved = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->reserved);
3833 0 : return py_reserved;
3834 : }
3835 :
3836 0 : static int py_samr_UserInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
3837 : {
3838 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
3839 0 : if (value == NULL) {
3840 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->reserved");
3841 0 : return -1;
3842 : }
3843 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3844 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3845 0 : PyErr_NoMemory();
3846 0 : return -1;
3847 : }
3848 0 : object->reserved = *(struct lsa_String *)pytalloc_get_ptr(value);
3849 0 : return 0;
3850 : }
3851 :
3852 0 : static PyObject *py_samr_UserInfo2_get_country_code(PyObject *obj, void *closure)
3853 : {
3854 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
3855 0 : PyObject *py_country_code;
3856 0 : py_country_code = PyLong_FromLong((uint16_t)object->country_code);
3857 0 : return py_country_code;
3858 : }
3859 :
3860 0 : static int py_samr_UserInfo2_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
3861 : {
3862 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
3863 0 : if (value == NULL) {
3864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code");
3865 0 : return -1;
3866 : }
3867 : {
3868 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_code));
3869 0 : if (PyLong_Check(value)) {
3870 0 : unsigned long long test_var;
3871 0 : test_var = PyLong_AsUnsignedLongLong(value);
3872 0 : if (PyErr_Occurred() != NULL) {
3873 0 : return -1;
3874 : }
3875 0 : if (test_var > uint_max) {
3876 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3877 : PyLong_Type.tp_name, uint_max, test_var);
3878 0 : return -1;
3879 : }
3880 0 : object->country_code = test_var;
3881 : } else {
3882 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3883 : PyLong_Type.tp_name);
3884 0 : return -1;
3885 : }
3886 : }
3887 0 : return 0;
3888 : }
3889 :
3890 0 : static PyObject *py_samr_UserInfo2_get_code_page(PyObject *obj, void *closure)
3891 : {
3892 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
3893 0 : PyObject *py_code_page;
3894 0 : py_code_page = PyLong_FromLong((uint16_t)object->code_page);
3895 0 : return py_code_page;
3896 : }
3897 :
3898 0 : static int py_samr_UserInfo2_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
3899 : {
3900 0 : struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
3901 0 : if (value == NULL) {
3902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page");
3903 0 : return -1;
3904 : }
3905 : {
3906 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page));
3907 0 : if (PyLong_Check(value)) {
3908 0 : unsigned long long test_var;
3909 0 : test_var = PyLong_AsUnsignedLongLong(value);
3910 0 : if (PyErr_Occurred() != NULL) {
3911 0 : return -1;
3912 : }
3913 0 : if (test_var > uint_max) {
3914 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3915 : PyLong_Type.tp_name, uint_max, test_var);
3916 0 : return -1;
3917 : }
3918 0 : object->code_page = test_var;
3919 : } else {
3920 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
3921 : PyLong_Type.tp_name);
3922 0 : return -1;
3923 : }
3924 : }
3925 0 : return 0;
3926 : }
3927 :
3928 : static PyGetSetDef py_samr_UserInfo2_getsetters[] = {
3929 : {
3930 : .name = discard_const_p(char, "comment"),
3931 : .get = py_samr_UserInfo2_get_comment,
3932 : .set = py_samr_UserInfo2_set_comment,
3933 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3934 : },
3935 : {
3936 : .name = discard_const_p(char, "reserved"),
3937 : .get = py_samr_UserInfo2_get_reserved,
3938 : .set = py_samr_UserInfo2_set_reserved,
3939 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
3940 : },
3941 : {
3942 : .name = discard_const_p(char, "country_code"),
3943 : .get = py_samr_UserInfo2_get_country_code,
3944 : .set = py_samr_UserInfo2_set_country_code,
3945 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3946 : },
3947 : {
3948 : .name = discard_const_p(char, "code_page"),
3949 : .get = py_samr_UserInfo2_get_code_page,
3950 : .set = py_samr_UserInfo2_set_code_page,
3951 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
3952 : },
3953 : { .name = NULL }
3954 : };
3955 :
3956 0 : static PyObject *py_samr_UserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3957 : {
3958 0 : return pytalloc_new(struct samr_UserInfo2, type);
3959 : }
3960 :
3961 :
3962 : static PyTypeObject samr_UserInfo2_Type = {
3963 : PyVarObject_HEAD_INIT(NULL, 0)
3964 : .tp_name = "samr.UserInfo2",
3965 : .tp_getset = py_samr_UserInfo2_getsetters,
3966 : .tp_methods = NULL,
3967 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3968 : .tp_new = py_samr_UserInfo2_new,
3969 : };
3970 :
3971 :
3972 0 : static PyObject *py_samr_LogonHours_get_units_per_week(PyObject *obj, void *closure)
3973 : {
3974 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj);
3975 0 : PyObject *py_units_per_week;
3976 0 : py_units_per_week = PyLong_FromLong((uint16_t)object->units_per_week);
3977 0 : return py_units_per_week;
3978 : }
3979 :
3980 0 : static int py_samr_LogonHours_set_units_per_week(PyObject *py_obj, PyObject *value, void *closure)
3981 : {
3982 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
3983 0 : if (value == NULL) {
3984 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->units_per_week");
3985 0 : return -1;
3986 : }
3987 : {
3988 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->units_per_week));
3989 0 : if (PyLong_Check(value)) {
3990 0 : unsigned long long test_var;
3991 0 : test_var = PyLong_AsUnsignedLongLong(value);
3992 0 : if (PyErr_Occurred() != NULL) {
3993 0 : return -1;
3994 : }
3995 0 : if (test_var > uint_max) {
3996 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
3997 : PyLong_Type.tp_name, uint_max, test_var);
3998 0 : return -1;
3999 : }
4000 0 : object->units_per_week = test_var;
4001 : } else {
4002 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4003 : PyLong_Type.tp_name);
4004 0 : return -1;
4005 : }
4006 : }
4007 0 : return 0;
4008 : }
4009 :
4010 0 : static PyObject *py_samr_LogonHours_get_bits(PyObject *obj, void *closure)
4011 : {
4012 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj);
4013 0 : PyObject *py_bits;
4014 0 : if (object->bits == NULL) {
4015 0 : Py_RETURN_NONE;
4016 : }
4017 0 : if (object->bits == NULL) {
4018 0 : py_bits = Py_None;
4019 0 : Py_INCREF(py_bits);
4020 : } else {
4021 0 : py_bits = PyList_New(object->units_per_week / 8);
4022 0 : if (py_bits == NULL) {
4023 0 : return NULL;
4024 : }
4025 : {
4026 : int bits_cntr_1;
4027 0 : for (bits_cntr_1 = 0; bits_cntr_1 < (object->units_per_week / 8); bits_cntr_1++) {
4028 0 : PyObject *py_bits_1;
4029 0 : py_bits_1 = PyLong_FromLong((uint16_t)object->bits[bits_cntr_1]);
4030 0 : PyList_SetItem(py_bits, bits_cntr_1, py_bits_1);
4031 : }
4032 : }
4033 : }
4034 0 : return py_bits;
4035 : }
4036 :
4037 0 : static int py_samr_LogonHours_set_bits(PyObject *py_obj, PyObject *value, void *closure)
4038 : {
4039 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
4040 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->bits));
4041 0 : if (value == NULL) {
4042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bits");
4043 0 : return -1;
4044 : }
4045 0 : if (value == Py_None) {
4046 0 : object->bits = NULL;
4047 : } else {
4048 0 : object->bits = NULL;
4049 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4050 : {
4051 0 : int bits_cntr_1;
4052 0 : object->bits = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->bits, PyList_GET_SIZE(value));
4053 0 : if (!object->bits) { return -1; }
4054 0 : talloc_set_name_const(object->bits, "ARRAY: object->bits");
4055 0 : for (bits_cntr_1 = 0; bits_cntr_1 < PyList_GET_SIZE(value); bits_cntr_1++) {
4056 0 : if (PyList_GET_ITEM(value, bits_cntr_1) == NULL) {
4057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bits[bits_cntr_1]");
4058 0 : return -1;
4059 : }
4060 : {
4061 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bits[bits_cntr_1]));
4062 0 : if (PyLong_Check(PyList_GET_ITEM(value, bits_cntr_1))) {
4063 0 : unsigned long long test_var;
4064 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, bits_cntr_1));
4065 0 : if (PyErr_Occurred() != NULL) {
4066 0 : return -1;
4067 : }
4068 0 : if (test_var > uint_max) {
4069 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4070 : PyLong_Type.tp_name, uint_max, test_var);
4071 0 : return -1;
4072 : }
4073 0 : object->bits[bits_cntr_1] = test_var;
4074 : } else {
4075 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4076 : PyLong_Type.tp_name);
4077 0 : return -1;
4078 : }
4079 : }
4080 : }
4081 : }
4082 : }
4083 0 : return 0;
4084 : }
4085 :
4086 : static PyGetSetDef py_samr_LogonHours_getsetters[] = {
4087 : {
4088 : .name = discard_const_p(char, "units_per_week"),
4089 : .get = py_samr_LogonHours_get_units_per_week,
4090 : .set = py_samr_LogonHours_set_units_per_week,
4091 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4092 : },
4093 : {
4094 : .name = discard_const_p(char, "bits"),
4095 : .get = py_samr_LogonHours_get_bits,
4096 : .set = py_samr_LogonHours_set_bits,
4097 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
4098 : },
4099 : { .name = NULL }
4100 : };
4101 :
4102 0 : static PyObject *py_samr_LogonHours_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4103 : {
4104 0 : return pytalloc_new(struct samr_LogonHours, type);
4105 : }
4106 :
4107 0 : static PyObject *py_samr_LogonHours_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4108 : {
4109 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
4110 0 : PyObject *ret = NULL;
4111 0 : DATA_BLOB blob;
4112 0 : enum ndr_err_code err;
4113 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
4114 0 : if (tmp_ctx == NULL) {
4115 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
4116 0 : return NULL;
4117 : }
4118 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_LogonHours);
4119 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4120 0 : TALLOC_FREE(tmp_ctx);
4121 0 : PyErr_SetNdrError(err);
4122 0 : return NULL;
4123 : }
4124 :
4125 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
4126 0 : TALLOC_FREE(tmp_ctx);
4127 0 : return ret;
4128 : }
4129 :
4130 0 : static PyObject *py_samr_LogonHours_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4131 : {
4132 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
4133 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
4134 0 : Py_ssize_t blob_length = 0;
4135 0 : enum ndr_err_code err;
4136 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4137 0 : PyObject *allow_remaining_obj = NULL;
4138 0 : bool allow_remaining = false;
4139 :
4140 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
4141 : discard_const_p(char *, kwnames),
4142 : &blob.data, &blob_length,
4143 : &allow_remaining_obj)) {
4144 0 : return NULL;
4145 : }
4146 0 : blob.length = blob_length;
4147 :
4148 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4149 0 : allow_remaining = true;
4150 : }
4151 :
4152 0 : if (allow_remaining) {
4153 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours);
4154 : } else {
4155 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours);
4156 : }
4157 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
4158 0 : PyErr_SetNdrError(err);
4159 0 : return NULL;
4160 : }
4161 :
4162 0 : Py_RETURN_NONE;
4163 : }
4164 :
4165 0 : static PyObject *py_samr_LogonHours_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
4166 : {
4167 0 : struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
4168 0 : PyObject *ret;
4169 0 : char *retstr;
4170 :
4171 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_LogonHours, "samr_LogonHours", object);
4172 0 : ret = PyUnicode_FromString(retstr);
4173 0 : talloc_free(retstr);
4174 :
4175 0 : return ret;
4176 : }
4177 :
4178 : static PyMethodDef py_samr_LogonHours_methods[] = {
4179 : { "__ndr_pack__", (PyCFunction)py_samr_LogonHours_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4180 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LogonHours_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4181 : { "__ndr_print__", (PyCFunction)py_samr_LogonHours_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
4182 : { NULL, NULL, 0, NULL }
4183 : };
4184 :
4185 :
4186 : static PyTypeObject samr_LogonHours_Type = {
4187 : PyVarObject_HEAD_INIT(NULL, 0)
4188 : .tp_name = "samr.LogonHours",
4189 : .tp_getset = py_samr_LogonHours_getsetters,
4190 : .tp_methods = py_samr_LogonHours_methods,
4191 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4192 : .tp_new = py_samr_LogonHours_new,
4193 : };
4194 :
4195 :
4196 0 : static PyObject *py_samr_UserInfo3_get_account_name(PyObject *obj, void *closure)
4197 : {
4198 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4199 0 : PyObject *py_account_name;
4200 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
4201 0 : return py_account_name;
4202 : }
4203 :
4204 0 : static int py_samr_UserInfo3_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
4205 : {
4206 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4207 0 : if (value == NULL) {
4208 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
4209 0 : return -1;
4210 : }
4211 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4212 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4213 0 : PyErr_NoMemory();
4214 0 : return -1;
4215 : }
4216 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4217 0 : return 0;
4218 : }
4219 :
4220 0 : static PyObject *py_samr_UserInfo3_get_full_name(PyObject *obj, void *closure)
4221 : {
4222 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4223 0 : PyObject *py_full_name;
4224 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
4225 0 : return py_full_name;
4226 : }
4227 :
4228 0 : static int py_samr_UserInfo3_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
4229 : {
4230 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4231 0 : if (value == NULL) {
4232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
4233 0 : return -1;
4234 : }
4235 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4236 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4237 0 : PyErr_NoMemory();
4238 0 : return -1;
4239 : }
4240 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4241 0 : return 0;
4242 : }
4243 :
4244 0 : static PyObject *py_samr_UserInfo3_get_rid(PyObject *obj, void *closure)
4245 : {
4246 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4247 0 : PyObject *py_rid;
4248 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4249 0 : return py_rid;
4250 : }
4251 :
4252 0 : static int py_samr_UserInfo3_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4253 : {
4254 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4255 0 : if (value == NULL) {
4256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
4257 0 : return -1;
4258 : }
4259 : {
4260 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
4261 0 : if (PyLong_Check(value)) {
4262 0 : unsigned long long test_var;
4263 0 : test_var = PyLong_AsUnsignedLongLong(value);
4264 0 : if (PyErr_Occurred() != NULL) {
4265 0 : return -1;
4266 : }
4267 0 : if (test_var > uint_max) {
4268 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4269 : PyLong_Type.tp_name, uint_max, test_var);
4270 0 : return -1;
4271 : }
4272 0 : object->rid = test_var;
4273 : } else {
4274 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4275 : PyLong_Type.tp_name);
4276 0 : return -1;
4277 : }
4278 : }
4279 0 : return 0;
4280 : }
4281 :
4282 0 : static PyObject *py_samr_UserInfo3_get_primary_gid(PyObject *obj, void *closure)
4283 : {
4284 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4285 0 : PyObject *py_primary_gid;
4286 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
4287 0 : return py_primary_gid;
4288 : }
4289 :
4290 0 : static int py_samr_UserInfo3_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
4291 : {
4292 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4293 0 : if (value == NULL) {
4294 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
4295 0 : return -1;
4296 : }
4297 : {
4298 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
4299 0 : if (PyLong_Check(value)) {
4300 0 : unsigned long long test_var;
4301 0 : test_var = PyLong_AsUnsignedLongLong(value);
4302 0 : if (PyErr_Occurred() != NULL) {
4303 0 : return -1;
4304 : }
4305 0 : if (test_var > uint_max) {
4306 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4307 : PyLong_Type.tp_name, uint_max, test_var);
4308 0 : return -1;
4309 : }
4310 0 : object->primary_gid = test_var;
4311 : } else {
4312 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4313 : PyLong_Type.tp_name);
4314 0 : return -1;
4315 : }
4316 : }
4317 0 : return 0;
4318 : }
4319 :
4320 0 : static PyObject *py_samr_UserInfo3_get_home_directory(PyObject *obj, void *closure)
4321 : {
4322 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4323 0 : PyObject *py_home_directory;
4324 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
4325 0 : return py_home_directory;
4326 : }
4327 :
4328 0 : static int py_samr_UserInfo3_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
4329 : {
4330 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4331 0 : if (value == NULL) {
4332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
4333 0 : return -1;
4334 : }
4335 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4336 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4337 0 : PyErr_NoMemory();
4338 0 : return -1;
4339 : }
4340 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
4341 0 : return 0;
4342 : }
4343 :
4344 0 : static PyObject *py_samr_UserInfo3_get_home_drive(PyObject *obj, void *closure)
4345 : {
4346 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4347 0 : PyObject *py_home_drive;
4348 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
4349 0 : return py_home_drive;
4350 : }
4351 :
4352 0 : static int py_samr_UserInfo3_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
4353 : {
4354 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4355 0 : if (value == NULL) {
4356 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
4357 0 : return -1;
4358 : }
4359 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4360 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4361 0 : PyErr_NoMemory();
4362 0 : return -1;
4363 : }
4364 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
4365 0 : return 0;
4366 : }
4367 :
4368 0 : static PyObject *py_samr_UserInfo3_get_logon_script(PyObject *obj, void *closure)
4369 : {
4370 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4371 0 : PyObject *py_logon_script;
4372 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
4373 0 : return py_logon_script;
4374 : }
4375 :
4376 0 : static int py_samr_UserInfo3_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
4377 : {
4378 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4379 0 : if (value == NULL) {
4380 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
4381 0 : return -1;
4382 : }
4383 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4384 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4385 0 : PyErr_NoMemory();
4386 0 : return -1;
4387 : }
4388 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
4389 0 : return 0;
4390 : }
4391 :
4392 0 : static PyObject *py_samr_UserInfo3_get_profile_path(PyObject *obj, void *closure)
4393 : {
4394 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4395 0 : PyObject *py_profile_path;
4396 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
4397 0 : return py_profile_path;
4398 : }
4399 :
4400 0 : static int py_samr_UserInfo3_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
4401 : {
4402 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4403 0 : if (value == NULL) {
4404 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
4405 0 : return -1;
4406 : }
4407 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4408 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4409 0 : PyErr_NoMemory();
4410 0 : return -1;
4411 : }
4412 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
4413 0 : return 0;
4414 : }
4415 :
4416 0 : static PyObject *py_samr_UserInfo3_get_workstations(PyObject *obj, void *closure)
4417 : {
4418 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4419 0 : PyObject *py_workstations;
4420 0 : py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
4421 0 : return py_workstations;
4422 : }
4423 :
4424 0 : static int py_samr_UserInfo3_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
4425 : {
4426 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4427 0 : if (value == NULL) {
4428 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations");
4429 0 : return -1;
4430 : }
4431 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4432 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4433 0 : PyErr_NoMemory();
4434 0 : return -1;
4435 : }
4436 0 : object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
4437 0 : return 0;
4438 : }
4439 :
4440 765 : static PyObject *py_samr_UserInfo3_get_last_logon(PyObject *obj, void *closure)
4441 : {
4442 765 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4443 0 : PyObject *py_last_logon;
4444 765 : py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon);
4445 765 : return py_last_logon;
4446 : }
4447 :
4448 0 : static int py_samr_UserInfo3_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
4449 : {
4450 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4451 0 : if (value == NULL) {
4452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
4453 0 : return -1;
4454 : }
4455 : {
4456 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon));
4457 0 : if (PyLong_Check(value)) {
4458 0 : unsigned long long test_var;
4459 0 : test_var = PyLong_AsUnsignedLongLong(value);
4460 0 : if (PyErr_Occurred() != NULL) {
4461 0 : return -1;
4462 : }
4463 0 : if (test_var > uint_max) {
4464 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4465 : PyLong_Type.tp_name, uint_max, test_var);
4466 0 : return -1;
4467 : }
4468 0 : object->last_logon = test_var;
4469 : } else {
4470 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4471 : PyLong_Type.tp_name);
4472 0 : return -1;
4473 : }
4474 : }
4475 0 : return 0;
4476 : }
4477 :
4478 0 : static PyObject *py_samr_UserInfo3_get_last_logoff(PyObject *obj, void *closure)
4479 : {
4480 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4481 0 : PyObject *py_last_logoff;
4482 0 : py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff);
4483 0 : return py_last_logoff;
4484 : }
4485 :
4486 0 : static int py_samr_UserInfo3_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
4487 : {
4488 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4489 0 : if (value == NULL) {
4490 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
4491 0 : return -1;
4492 : }
4493 : {
4494 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff));
4495 0 : if (PyLong_Check(value)) {
4496 0 : unsigned long long test_var;
4497 0 : test_var = PyLong_AsUnsignedLongLong(value);
4498 0 : if (PyErr_Occurred() != NULL) {
4499 0 : return -1;
4500 : }
4501 0 : if (test_var > uint_max) {
4502 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4503 : PyLong_Type.tp_name, uint_max, test_var);
4504 0 : return -1;
4505 : }
4506 0 : object->last_logoff = test_var;
4507 : } else {
4508 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4509 : PyLong_Type.tp_name);
4510 0 : return -1;
4511 : }
4512 : }
4513 0 : return 0;
4514 : }
4515 :
4516 0 : static PyObject *py_samr_UserInfo3_get_last_password_change(PyObject *obj, void *closure)
4517 : {
4518 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4519 0 : PyObject *py_last_password_change;
4520 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
4521 0 : return py_last_password_change;
4522 : }
4523 :
4524 0 : static int py_samr_UserInfo3_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
4525 : {
4526 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4527 0 : if (value == NULL) {
4528 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
4529 0 : return -1;
4530 : }
4531 : {
4532 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
4533 0 : if (PyLong_Check(value)) {
4534 0 : unsigned long long test_var;
4535 0 : test_var = PyLong_AsUnsignedLongLong(value);
4536 0 : if (PyErr_Occurred() != NULL) {
4537 0 : return -1;
4538 : }
4539 0 : if (test_var > uint_max) {
4540 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4541 : PyLong_Type.tp_name, uint_max, test_var);
4542 0 : return -1;
4543 : }
4544 0 : object->last_password_change = test_var;
4545 : } else {
4546 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4547 : PyLong_Type.tp_name);
4548 0 : return -1;
4549 : }
4550 : }
4551 0 : return 0;
4552 : }
4553 :
4554 0 : static PyObject *py_samr_UserInfo3_get_allow_password_change(PyObject *obj, void *closure)
4555 : {
4556 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4557 0 : PyObject *py_allow_password_change;
4558 0 : py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change);
4559 0 : return py_allow_password_change;
4560 : }
4561 :
4562 0 : static int py_samr_UserInfo3_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
4563 : {
4564 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4565 0 : if (value == NULL) {
4566 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change");
4567 0 : return -1;
4568 : }
4569 : {
4570 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change));
4571 0 : if (PyLong_Check(value)) {
4572 0 : unsigned long long test_var;
4573 0 : test_var = PyLong_AsUnsignedLongLong(value);
4574 0 : if (PyErr_Occurred() != NULL) {
4575 0 : return -1;
4576 : }
4577 0 : if (test_var > uint_max) {
4578 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4579 : PyLong_Type.tp_name, uint_max, test_var);
4580 0 : return -1;
4581 : }
4582 0 : object->allow_password_change = test_var;
4583 : } else {
4584 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4585 : PyLong_Type.tp_name);
4586 0 : return -1;
4587 : }
4588 : }
4589 0 : return 0;
4590 : }
4591 :
4592 0 : static PyObject *py_samr_UserInfo3_get_force_password_change(PyObject *obj, void *closure)
4593 : {
4594 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4595 0 : PyObject *py_force_password_change;
4596 0 : py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change);
4597 0 : return py_force_password_change;
4598 : }
4599 :
4600 0 : static int py_samr_UserInfo3_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
4601 : {
4602 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4603 0 : if (value == NULL) {
4604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change");
4605 0 : return -1;
4606 : }
4607 : {
4608 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change));
4609 0 : if (PyLong_Check(value)) {
4610 0 : unsigned long long test_var;
4611 0 : test_var = PyLong_AsUnsignedLongLong(value);
4612 0 : if (PyErr_Occurred() != NULL) {
4613 0 : return -1;
4614 : }
4615 0 : if (test_var > uint_max) {
4616 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4617 : PyLong_Type.tp_name, uint_max, test_var);
4618 0 : return -1;
4619 : }
4620 0 : object->force_password_change = test_var;
4621 : } else {
4622 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4623 : PyLong_Type.tp_name);
4624 0 : return -1;
4625 : }
4626 : }
4627 0 : return 0;
4628 : }
4629 :
4630 0 : static PyObject *py_samr_UserInfo3_get_logon_hours(PyObject *obj, void *closure)
4631 : {
4632 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4633 0 : PyObject *py_logon_hours;
4634 0 : py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
4635 0 : return py_logon_hours;
4636 : }
4637 :
4638 0 : static int py_samr_UserInfo3_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
4639 : {
4640 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4641 0 : if (value == NULL) {
4642 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours");
4643 0 : return -1;
4644 : }
4645 0 : PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
4646 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4647 0 : PyErr_NoMemory();
4648 0 : return -1;
4649 : }
4650 0 : object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
4651 0 : return 0;
4652 : }
4653 :
4654 814 : static PyObject *py_samr_UserInfo3_get_bad_password_count(PyObject *obj, void *closure)
4655 : {
4656 814 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4657 0 : PyObject *py_bad_password_count;
4658 814 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
4659 814 : return py_bad_password_count;
4660 : }
4661 :
4662 0 : static int py_samr_UserInfo3_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
4663 : {
4664 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4665 0 : if (value == NULL) {
4666 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
4667 0 : return -1;
4668 : }
4669 : {
4670 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
4671 0 : if (PyLong_Check(value)) {
4672 0 : unsigned long long test_var;
4673 0 : test_var = PyLong_AsUnsignedLongLong(value);
4674 0 : if (PyErr_Occurred() != NULL) {
4675 0 : return -1;
4676 : }
4677 0 : if (test_var > uint_max) {
4678 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4679 : PyLong_Type.tp_name, uint_max, test_var);
4680 0 : return -1;
4681 : }
4682 0 : object->bad_password_count = test_var;
4683 : } else {
4684 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4685 : PyLong_Type.tp_name);
4686 0 : return -1;
4687 : }
4688 : }
4689 0 : return 0;
4690 : }
4691 :
4692 765 : static PyObject *py_samr_UserInfo3_get_logon_count(PyObject *obj, void *closure)
4693 : {
4694 765 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4695 0 : PyObject *py_logon_count;
4696 765 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
4697 765 : return py_logon_count;
4698 : }
4699 :
4700 0 : static int py_samr_UserInfo3_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
4701 : {
4702 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4703 0 : if (value == NULL) {
4704 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
4705 0 : return -1;
4706 : }
4707 : {
4708 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
4709 0 : if (PyLong_Check(value)) {
4710 0 : unsigned long long test_var;
4711 0 : test_var = PyLong_AsUnsignedLongLong(value);
4712 0 : if (PyErr_Occurred() != NULL) {
4713 0 : return -1;
4714 : }
4715 0 : if (test_var > uint_max) {
4716 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4717 : PyLong_Type.tp_name, uint_max, test_var);
4718 0 : return -1;
4719 : }
4720 0 : object->logon_count = test_var;
4721 : } else {
4722 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4723 : PyLong_Type.tp_name);
4724 0 : return -1;
4725 : }
4726 : }
4727 0 : return 0;
4728 : }
4729 :
4730 765 : static PyObject *py_samr_UserInfo3_get_acct_flags(PyObject *obj, void *closure)
4731 : {
4732 765 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
4733 0 : PyObject *py_acct_flags;
4734 765 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
4735 765 : return py_acct_flags;
4736 : }
4737 :
4738 0 : static int py_samr_UserInfo3_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
4739 : {
4740 0 : struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
4741 0 : if (value == NULL) {
4742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
4743 0 : return -1;
4744 : }
4745 : {
4746 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
4747 0 : if (PyLong_Check(value)) {
4748 0 : unsigned long long test_var;
4749 0 : test_var = PyLong_AsUnsignedLongLong(value);
4750 0 : if (PyErr_Occurred() != NULL) {
4751 0 : return -1;
4752 : }
4753 0 : if (test_var > uint_max) {
4754 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
4755 : PyLong_Type.tp_name, uint_max, test_var);
4756 0 : return -1;
4757 : }
4758 0 : object->acct_flags = test_var;
4759 : } else {
4760 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
4761 : PyLong_Type.tp_name);
4762 0 : return -1;
4763 : }
4764 : }
4765 0 : return 0;
4766 : }
4767 :
4768 : static PyGetSetDef py_samr_UserInfo3_getsetters[] = {
4769 : {
4770 : .name = discard_const_p(char, "account_name"),
4771 : .get = py_samr_UserInfo3_get_account_name,
4772 : .set = py_samr_UserInfo3_set_account_name,
4773 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4774 : },
4775 : {
4776 : .name = discard_const_p(char, "full_name"),
4777 : .get = py_samr_UserInfo3_get_full_name,
4778 : .set = py_samr_UserInfo3_set_full_name,
4779 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4780 : },
4781 : {
4782 : .name = discard_const_p(char, "rid"),
4783 : .get = py_samr_UserInfo3_get_rid,
4784 : .set = py_samr_UserInfo3_set_rid,
4785 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4786 : },
4787 : {
4788 : .name = discard_const_p(char, "primary_gid"),
4789 : .get = py_samr_UserInfo3_get_primary_gid,
4790 : .set = py_samr_UserInfo3_set_primary_gid,
4791 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
4792 : },
4793 : {
4794 : .name = discard_const_p(char, "home_directory"),
4795 : .get = py_samr_UserInfo3_get_home_directory,
4796 : .set = py_samr_UserInfo3_set_home_directory,
4797 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4798 : },
4799 : {
4800 : .name = discard_const_p(char, "home_drive"),
4801 : .get = py_samr_UserInfo3_get_home_drive,
4802 : .set = py_samr_UserInfo3_set_home_drive,
4803 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4804 : },
4805 : {
4806 : .name = discard_const_p(char, "logon_script"),
4807 : .get = py_samr_UserInfo3_get_logon_script,
4808 : .set = py_samr_UserInfo3_set_logon_script,
4809 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4810 : },
4811 : {
4812 : .name = discard_const_p(char, "profile_path"),
4813 : .get = py_samr_UserInfo3_get_profile_path,
4814 : .set = py_samr_UserInfo3_set_profile_path,
4815 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4816 : },
4817 : {
4818 : .name = discard_const_p(char, "workstations"),
4819 : .get = py_samr_UserInfo3_get_workstations,
4820 : .set = py_samr_UserInfo3_set_workstations,
4821 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
4822 : },
4823 : {
4824 : .name = discard_const_p(char, "last_logon"),
4825 : .get = py_samr_UserInfo3_get_last_logon,
4826 : .set = py_samr_UserInfo3_set_last_logon,
4827 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4828 : },
4829 : {
4830 : .name = discard_const_p(char, "last_logoff"),
4831 : .get = py_samr_UserInfo3_get_last_logoff,
4832 : .set = py_samr_UserInfo3_set_last_logoff,
4833 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4834 : },
4835 : {
4836 : .name = discard_const_p(char, "last_password_change"),
4837 : .get = py_samr_UserInfo3_get_last_password_change,
4838 : .set = py_samr_UserInfo3_set_last_password_change,
4839 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4840 : },
4841 : {
4842 : .name = discard_const_p(char, "allow_password_change"),
4843 : .get = py_samr_UserInfo3_get_allow_password_change,
4844 : .set = py_samr_UserInfo3_set_allow_password_change,
4845 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4846 : },
4847 : {
4848 : .name = discard_const_p(char, "force_password_change"),
4849 : .get = py_samr_UserInfo3_get_force_password_change,
4850 : .set = py_samr_UserInfo3_set_force_password_change,
4851 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
4852 : },
4853 : {
4854 : .name = discard_const_p(char, "logon_hours"),
4855 : .get = py_samr_UserInfo3_get_logon_hours,
4856 : .set = py_samr_UserInfo3_set_logon_hours,
4857 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours")
4858 : },
4859 : {
4860 : .name = discard_const_p(char, "bad_password_count"),
4861 : .get = py_samr_UserInfo3_get_bad_password_count,
4862 : .set = py_samr_UserInfo3_set_bad_password_count,
4863 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4864 : },
4865 : {
4866 : .name = discard_const_p(char, "logon_count"),
4867 : .get = py_samr_UserInfo3_get_logon_count,
4868 : .set = py_samr_UserInfo3_set_logon_count,
4869 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
4870 : },
4871 : {
4872 : .name = discard_const_p(char, "acct_flags"),
4873 : .get = py_samr_UserInfo3_get_acct_flags,
4874 : .set = py_samr_UserInfo3_set_acct_flags,
4875 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
4876 : },
4877 : { .name = NULL }
4878 : };
4879 :
4880 0 : static PyObject *py_samr_UserInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4881 : {
4882 0 : return pytalloc_new(struct samr_UserInfo3, type);
4883 : }
4884 :
4885 :
4886 : static PyTypeObject samr_UserInfo3_Type = {
4887 : PyVarObject_HEAD_INIT(NULL, 0)
4888 : .tp_name = "samr.UserInfo3",
4889 : .tp_getset = py_samr_UserInfo3_getsetters,
4890 : .tp_methods = NULL,
4891 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4892 : .tp_new = py_samr_UserInfo3_new,
4893 : };
4894 :
4895 :
4896 0 : static PyObject *py_samr_UserInfo4_get_logon_hours(PyObject *obj, void *closure)
4897 : {
4898 0 : struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(obj);
4899 0 : PyObject *py_logon_hours;
4900 0 : py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
4901 0 : return py_logon_hours;
4902 : }
4903 :
4904 0 : static int py_samr_UserInfo4_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
4905 : {
4906 0 : struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(py_obj);
4907 0 : if (value == NULL) {
4908 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours");
4909 0 : return -1;
4910 : }
4911 0 : PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
4912 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4913 0 : PyErr_NoMemory();
4914 0 : return -1;
4915 : }
4916 0 : object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
4917 0 : return 0;
4918 : }
4919 :
4920 : static PyGetSetDef py_samr_UserInfo4_getsetters[] = {
4921 : {
4922 : .name = discard_const_p(char, "logon_hours"),
4923 : .get = py_samr_UserInfo4_get_logon_hours,
4924 : .set = py_samr_UserInfo4_set_logon_hours,
4925 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours")
4926 : },
4927 : { .name = NULL }
4928 : };
4929 :
4930 0 : static PyObject *py_samr_UserInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4931 : {
4932 0 : return pytalloc_new(struct samr_UserInfo4, type);
4933 : }
4934 :
4935 :
4936 : static PyTypeObject samr_UserInfo4_Type = {
4937 : PyVarObject_HEAD_INIT(NULL, 0)
4938 : .tp_name = "samr.UserInfo4",
4939 : .tp_getset = py_samr_UserInfo4_getsetters,
4940 : .tp_methods = NULL,
4941 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4942 : .tp_new = py_samr_UserInfo4_new,
4943 : };
4944 :
4945 :
4946 0 : static PyObject *py_samr_UserInfo5_get_account_name(PyObject *obj, void *closure)
4947 : {
4948 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
4949 0 : PyObject *py_account_name;
4950 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
4951 0 : return py_account_name;
4952 : }
4953 :
4954 0 : static int py_samr_UserInfo5_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
4955 : {
4956 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
4957 0 : if (value == NULL) {
4958 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
4959 0 : return -1;
4960 : }
4961 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4962 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4963 0 : PyErr_NoMemory();
4964 0 : return -1;
4965 : }
4966 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4967 0 : return 0;
4968 : }
4969 :
4970 0 : static PyObject *py_samr_UserInfo5_get_full_name(PyObject *obj, void *closure)
4971 : {
4972 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
4973 0 : PyObject *py_full_name;
4974 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
4975 0 : return py_full_name;
4976 : }
4977 :
4978 0 : static int py_samr_UserInfo5_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
4979 : {
4980 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
4981 0 : if (value == NULL) {
4982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
4983 0 : return -1;
4984 : }
4985 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4986 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4987 0 : PyErr_NoMemory();
4988 0 : return -1;
4989 : }
4990 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4991 0 : return 0;
4992 : }
4993 :
4994 0 : static PyObject *py_samr_UserInfo5_get_rid(PyObject *obj, void *closure)
4995 : {
4996 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
4997 0 : PyObject *py_rid;
4998 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
4999 0 : return py_rid;
5000 : }
5001 :
5002 0 : static int py_samr_UserInfo5_set_rid(PyObject *py_obj, PyObject *value, void *closure)
5003 : {
5004 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5005 0 : if (value == NULL) {
5006 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
5007 0 : return -1;
5008 : }
5009 : {
5010 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
5011 0 : if (PyLong_Check(value)) {
5012 0 : unsigned long long test_var;
5013 0 : test_var = PyLong_AsUnsignedLongLong(value);
5014 0 : if (PyErr_Occurred() != NULL) {
5015 0 : return -1;
5016 : }
5017 0 : if (test_var > uint_max) {
5018 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5019 : PyLong_Type.tp_name, uint_max, test_var);
5020 0 : return -1;
5021 : }
5022 0 : object->rid = test_var;
5023 : } else {
5024 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5025 : PyLong_Type.tp_name);
5026 0 : return -1;
5027 : }
5028 : }
5029 0 : return 0;
5030 : }
5031 :
5032 0 : static PyObject *py_samr_UserInfo5_get_primary_gid(PyObject *obj, void *closure)
5033 : {
5034 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5035 0 : PyObject *py_primary_gid;
5036 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
5037 0 : return py_primary_gid;
5038 : }
5039 :
5040 0 : static int py_samr_UserInfo5_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
5041 : {
5042 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5043 0 : if (value == NULL) {
5044 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
5045 0 : return -1;
5046 : }
5047 : {
5048 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
5049 0 : if (PyLong_Check(value)) {
5050 0 : unsigned long long test_var;
5051 0 : test_var = PyLong_AsUnsignedLongLong(value);
5052 0 : if (PyErr_Occurred() != NULL) {
5053 0 : return -1;
5054 : }
5055 0 : if (test_var > uint_max) {
5056 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5057 : PyLong_Type.tp_name, uint_max, test_var);
5058 0 : return -1;
5059 : }
5060 0 : object->primary_gid = test_var;
5061 : } else {
5062 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5063 : PyLong_Type.tp_name);
5064 0 : return -1;
5065 : }
5066 : }
5067 0 : return 0;
5068 : }
5069 :
5070 0 : static PyObject *py_samr_UserInfo5_get_home_directory(PyObject *obj, void *closure)
5071 : {
5072 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5073 0 : PyObject *py_home_directory;
5074 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
5075 0 : return py_home_directory;
5076 : }
5077 :
5078 0 : static int py_samr_UserInfo5_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
5079 : {
5080 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5081 0 : if (value == NULL) {
5082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
5083 0 : return -1;
5084 : }
5085 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5086 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5087 0 : PyErr_NoMemory();
5088 0 : return -1;
5089 : }
5090 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
5091 0 : return 0;
5092 : }
5093 :
5094 0 : static PyObject *py_samr_UserInfo5_get_home_drive(PyObject *obj, void *closure)
5095 : {
5096 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5097 0 : PyObject *py_home_drive;
5098 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
5099 0 : return py_home_drive;
5100 : }
5101 :
5102 0 : static int py_samr_UserInfo5_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
5103 : {
5104 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5105 0 : if (value == NULL) {
5106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
5107 0 : return -1;
5108 : }
5109 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5110 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5111 0 : PyErr_NoMemory();
5112 0 : return -1;
5113 : }
5114 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
5115 0 : return 0;
5116 : }
5117 :
5118 0 : static PyObject *py_samr_UserInfo5_get_logon_script(PyObject *obj, void *closure)
5119 : {
5120 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5121 0 : PyObject *py_logon_script;
5122 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
5123 0 : return py_logon_script;
5124 : }
5125 :
5126 0 : static int py_samr_UserInfo5_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
5127 : {
5128 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5129 0 : if (value == NULL) {
5130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
5131 0 : return -1;
5132 : }
5133 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5134 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5135 0 : PyErr_NoMemory();
5136 0 : return -1;
5137 : }
5138 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
5139 0 : return 0;
5140 : }
5141 :
5142 0 : static PyObject *py_samr_UserInfo5_get_profile_path(PyObject *obj, void *closure)
5143 : {
5144 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5145 0 : PyObject *py_profile_path;
5146 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
5147 0 : return py_profile_path;
5148 : }
5149 :
5150 0 : static int py_samr_UserInfo5_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
5151 : {
5152 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5153 0 : if (value == NULL) {
5154 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
5155 0 : return -1;
5156 : }
5157 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5158 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5159 0 : PyErr_NoMemory();
5160 0 : return -1;
5161 : }
5162 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
5163 0 : return 0;
5164 : }
5165 :
5166 0 : static PyObject *py_samr_UserInfo5_get_description(PyObject *obj, void *closure)
5167 : {
5168 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5169 0 : PyObject *py_description;
5170 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
5171 0 : return py_description;
5172 : }
5173 :
5174 0 : static int py_samr_UserInfo5_set_description(PyObject *py_obj, PyObject *value, void *closure)
5175 : {
5176 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5177 0 : if (value == NULL) {
5178 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
5179 0 : return -1;
5180 : }
5181 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5182 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5183 0 : PyErr_NoMemory();
5184 0 : return -1;
5185 : }
5186 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
5187 0 : return 0;
5188 : }
5189 :
5190 0 : static PyObject *py_samr_UserInfo5_get_workstations(PyObject *obj, void *closure)
5191 : {
5192 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5193 0 : PyObject *py_workstations;
5194 0 : py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
5195 0 : return py_workstations;
5196 : }
5197 :
5198 0 : static int py_samr_UserInfo5_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
5199 : {
5200 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5201 0 : if (value == NULL) {
5202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations");
5203 0 : return -1;
5204 : }
5205 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5206 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5207 0 : PyErr_NoMemory();
5208 0 : return -1;
5209 : }
5210 0 : object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
5211 0 : return 0;
5212 : }
5213 :
5214 765 : static PyObject *py_samr_UserInfo5_get_last_logon(PyObject *obj, void *closure)
5215 : {
5216 765 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5217 0 : PyObject *py_last_logon;
5218 765 : py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon);
5219 765 : return py_last_logon;
5220 : }
5221 :
5222 0 : static int py_samr_UserInfo5_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
5223 : {
5224 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5225 0 : if (value == NULL) {
5226 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
5227 0 : return -1;
5228 : }
5229 : {
5230 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon));
5231 0 : if (PyLong_Check(value)) {
5232 0 : unsigned long long test_var;
5233 0 : test_var = PyLong_AsUnsignedLongLong(value);
5234 0 : if (PyErr_Occurred() != NULL) {
5235 0 : return -1;
5236 : }
5237 0 : if (test_var > uint_max) {
5238 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5239 : PyLong_Type.tp_name, uint_max, test_var);
5240 0 : return -1;
5241 : }
5242 0 : object->last_logon = test_var;
5243 : } else {
5244 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5245 : PyLong_Type.tp_name);
5246 0 : return -1;
5247 : }
5248 : }
5249 0 : return 0;
5250 : }
5251 :
5252 0 : static PyObject *py_samr_UserInfo5_get_last_logoff(PyObject *obj, void *closure)
5253 : {
5254 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5255 0 : PyObject *py_last_logoff;
5256 0 : py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff);
5257 0 : return py_last_logoff;
5258 : }
5259 :
5260 0 : static int py_samr_UserInfo5_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
5261 : {
5262 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5263 0 : if (value == NULL) {
5264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
5265 0 : return -1;
5266 : }
5267 : {
5268 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff));
5269 0 : if (PyLong_Check(value)) {
5270 0 : unsigned long long test_var;
5271 0 : test_var = PyLong_AsUnsignedLongLong(value);
5272 0 : if (PyErr_Occurred() != NULL) {
5273 0 : return -1;
5274 : }
5275 0 : if (test_var > uint_max) {
5276 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5277 : PyLong_Type.tp_name, uint_max, test_var);
5278 0 : return -1;
5279 : }
5280 0 : object->last_logoff = test_var;
5281 : } else {
5282 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5283 : PyLong_Type.tp_name);
5284 0 : return -1;
5285 : }
5286 : }
5287 0 : return 0;
5288 : }
5289 :
5290 0 : static PyObject *py_samr_UserInfo5_get_logon_hours(PyObject *obj, void *closure)
5291 : {
5292 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5293 0 : PyObject *py_logon_hours;
5294 0 : py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
5295 0 : return py_logon_hours;
5296 : }
5297 :
5298 0 : static int py_samr_UserInfo5_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
5299 : {
5300 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5301 0 : if (value == NULL) {
5302 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours");
5303 0 : return -1;
5304 : }
5305 0 : PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
5306 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5307 0 : PyErr_NoMemory();
5308 0 : return -1;
5309 : }
5310 0 : object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
5311 0 : return 0;
5312 : }
5313 :
5314 765 : static PyObject *py_samr_UserInfo5_get_bad_password_count(PyObject *obj, void *closure)
5315 : {
5316 765 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5317 0 : PyObject *py_bad_password_count;
5318 765 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
5319 765 : return py_bad_password_count;
5320 : }
5321 :
5322 0 : static int py_samr_UserInfo5_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
5323 : {
5324 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5325 0 : if (value == NULL) {
5326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
5327 0 : return -1;
5328 : }
5329 : {
5330 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
5331 0 : if (PyLong_Check(value)) {
5332 0 : unsigned long long test_var;
5333 0 : test_var = PyLong_AsUnsignedLongLong(value);
5334 0 : if (PyErr_Occurred() != NULL) {
5335 0 : return -1;
5336 : }
5337 0 : if (test_var > uint_max) {
5338 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5339 : PyLong_Type.tp_name, uint_max, test_var);
5340 0 : return -1;
5341 : }
5342 0 : object->bad_password_count = test_var;
5343 : } else {
5344 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5345 : PyLong_Type.tp_name);
5346 0 : return -1;
5347 : }
5348 : }
5349 0 : return 0;
5350 : }
5351 :
5352 765 : static PyObject *py_samr_UserInfo5_get_logon_count(PyObject *obj, void *closure)
5353 : {
5354 765 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5355 0 : PyObject *py_logon_count;
5356 765 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
5357 765 : return py_logon_count;
5358 : }
5359 :
5360 0 : static int py_samr_UserInfo5_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
5361 : {
5362 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5363 0 : if (value == NULL) {
5364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
5365 0 : return -1;
5366 : }
5367 : {
5368 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
5369 0 : if (PyLong_Check(value)) {
5370 0 : unsigned long long test_var;
5371 0 : test_var = PyLong_AsUnsignedLongLong(value);
5372 0 : if (PyErr_Occurred() != NULL) {
5373 0 : return -1;
5374 : }
5375 0 : if (test_var > uint_max) {
5376 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5377 : PyLong_Type.tp_name, uint_max, test_var);
5378 0 : return -1;
5379 : }
5380 0 : object->logon_count = test_var;
5381 : } else {
5382 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5383 : PyLong_Type.tp_name);
5384 0 : return -1;
5385 : }
5386 : }
5387 0 : return 0;
5388 : }
5389 :
5390 0 : static PyObject *py_samr_UserInfo5_get_last_password_change(PyObject *obj, void *closure)
5391 : {
5392 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5393 0 : PyObject *py_last_password_change;
5394 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
5395 0 : return py_last_password_change;
5396 : }
5397 :
5398 0 : static int py_samr_UserInfo5_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
5399 : {
5400 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5401 0 : if (value == NULL) {
5402 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
5403 0 : return -1;
5404 : }
5405 : {
5406 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
5407 0 : if (PyLong_Check(value)) {
5408 0 : unsigned long long test_var;
5409 0 : test_var = PyLong_AsUnsignedLongLong(value);
5410 0 : if (PyErr_Occurred() != NULL) {
5411 0 : return -1;
5412 : }
5413 0 : if (test_var > uint_max) {
5414 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5415 : PyLong_Type.tp_name, uint_max, test_var);
5416 0 : return -1;
5417 : }
5418 0 : object->last_password_change = test_var;
5419 : } else {
5420 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5421 : PyLong_Type.tp_name);
5422 0 : return -1;
5423 : }
5424 : }
5425 0 : return 0;
5426 : }
5427 :
5428 0 : static PyObject *py_samr_UserInfo5_get_acct_expiry(PyObject *obj, void *closure)
5429 : {
5430 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5431 0 : PyObject *py_acct_expiry;
5432 0 : py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry);
5433 0 : return py_acct_expiry;
5434 : }
5435 :
5436 0 : static int py_samr_UserInfo5_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
5437 : {
5438 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5439 0 : if (value == NULL) {
5440 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry");
5441 0 : return -1;
5442 : }
5443 : {
5444 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry));
5445 0 : if (PyLong_Check(value)) {
5446 0 : unsigned long long test_var;
5447 0 : test_var = PyLong_AsUnsignedLongLong(value);
5448 0 : if (PyErr_Occurred() != NULL) {
5449 0 : return -1;
5450 : }
5451 0 : if (test_var > uint_max) {
5452 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5453 : PyLong_Type.tp_name, uint_max, test_var);
5454 0 : return -1;
5455 : }
5456 0 : object->acct_expiry = test_var;
5457 : } else {
5458 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5459 : PyLong_Type.tp_name);
5460 0 : return -1;
5461 : }
5462 : }
5463 0 : return 0;
5464 : }
5465 :
5466 765 : static PyObject *py_samr_UserInfo5_get_acct_flags(PyObject *obj, void *closure)
5467 : {
5468 765 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
5469 0 : PyObject *py_acct_flags;
5470 765 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
5471 765 : return py_acct_flags;
5472 : }
5473 :
5474 0 : static int py_samr_UserInfo5_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
5475 : {
5476 0 : struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
5477 0 : if (value == NULL) {
5478 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
5479 0 : return -1;
5480 : }
5481 : {
5482 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
5483 0 : if (PyLong_Check(value)) {
5484 0 : unsigned long long test_var;
5485 0 : test_var = PyLong_AsUnsignedLongLong(value);
5486 0 : if (PyErr_Occurred() != NULL) {
5487 0 : return -1;
5488 : }
5489 0 : if (test_var > uint_max) {
5490 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5491 : PyLong_Type.tp_name, uint_max, test_var);
5492 0 : return -1;
5493 : }
5494 0 : object->acct_flags = test_var;
5495 : } else {
5496 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5497 : PyLong_Type.tp_name);
5498 0 : return -1;
5499 : }
5500 : }
5501 0 : return 0;
5502 : }
5503 :
5504 : static PyGetSetDef py_samr_UserInfo5_getsetters[] = {
5505 : {
5506 : .name = discard_const_p(char, "account_name"),
5507 : .get = py_samr_UserInfo5_get_account_name,
5508 : .set = py_samr_UserInfo5_set_account_name,
5509 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5510 : },
5511 : {
5512 : .name = discard_const_p(char, "full_name"),
5513 : .get = py_samr_UserInfo5_get_full_name,
5514 : .set = py_samr_UserInfo5_set_full_name,
5515 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5516 : },
5517 : {
5518 : .name = discard_const_p(char, "rid"),
5519 : .get = py_samr_UserInfo5_get_rid,
5520 : .set = py_samr_UserInfo5_set_rid,
5521 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5522 : },
5523 : {
5524 : .name = discard_const_p(char, "primary_gid"),
5525 : .get = py_samr_UserInfo5_get_primary_gid,
5526 : .set = py_samr_UserInfo5_set_primary_gid,
5527 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5528 : },
5529 : {
5530 : .name = discard_const_p(char, "home_directory"),
5531 : .get = py_samr_UserInfo5_get_home_directory,
5532 : .set = py_samr_UserInfo5_set_home_directory,
5533 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5534 : },
5535 : {
5536 : .name = discard_const_p(char, "home_drive"),
5537 : .get = py_samr_UserInfo5_get_home_drive,
5538 : .set = py_samr_UserInfo5_set_home_drive,
5539 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5540 : },
5541 : {
5542 : .name = discard_const_p(char, "logon_script"),
5543 : .get = py_samr_UserInfo5_get_logon_script,
5544 : .set = py_samr_UserInfo5_set_logon_script,
5545 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5546 : },
5547 : {
5548 : .name = discard_const_p(char, "profile_path"),
5549 : .get = py_samr_UserInfo5_get_profile_path,
5550 : .set = py_samr_UserInfo5_set_profile_path,
5551 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5552 : },
5553 : {
5554 : .name = discard_const_p(char, "description"),
5555 : .get = py_samr_UserInfo5_get_description,
5556 : .set = py_samr_UserInfo5_set_description,
5557 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5558 : },
5559 : {
5560 : .name = discard_const_p(char, "workstations"),
5561 : .get = py_samr_UserInfo5_get_workstations,
5562 : .set = py_samr_UserInfo5_set_workstations,
5563 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5564 : },
5565 : {
5566 : .name = discard_const_p(char, "last_logon"),
5567 : .get = py_samr_UserInfo5_get_last_logon,
5568 : .set = py_samr_UserInfo5_set_last_logon,
5569 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
5570 : },
5571 : {
5572 : .name = discard_const_p(char, "last_logoff"),
5573 : .get = py_samr_UserInfo5_get_last_logoff,
5574 : .set = py_samr_UserInfo5_set_last_logoff,
5575 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
5576 : },
5577 : {
5578 : .name = discard_const_p(char, "logon_hours"),
5579 : .get = py_samr_UserInfo5_get_logon_hours,
5580 : .set = py_samr_UserInfo5_set_logon_hours,
5581 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours")
5582 : },
5583 : {
5584 : .name = discard_const_p(char, "bad_password_count"),
5585 : .get = py_samr_UserInfo5_get_bad_password_count,
5586 : .set = py_samr_UserInfo5_set_bad_password_count,
5587 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5588 : },
5589 : {
5590 : .name = discard_const_p(char, "logon_count"),
5591 : .get = py_samr_UserInfo5_get_logon_count,
5592 : .set = py_samr_UserInfo5_set_logon_count,
5593 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
5594 : },
5595 : {
5596 : .name = discard_const_p(char, "last_password_change"),
5597 : .get = py_samr_UserInfo5_get_last_password_change,
5598 : .set = py_samr_UserInfo5_set_last_password_change,
5599 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
5600 : },
5601 : {
5602 : .name = discard_const_p(char, "acct_expiry"),
5603 : .get = py_samr_UserInfo5_get_acct_expiry,
5604 : .set = py_samr_UserInfo5_set_acct_expiry,
5605 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
5606 : },
5607 : {
5608 : .name = discard_const_p(char, "acct_flags"),
5609 : .get = py_samr_UserInfo5_get_acct_flags,
5610 : .set = py_samr_UserInfo5_set_acct_flags,
5611 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
5612 : },
5613 : { .name = NULL }
5614 : };
5615 :
5616 0 : static PyObject *py_samr_UserInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5617 : {
5618 0 : return pytalloc_new(struct samr_UserInfo5, type);
5619 : }
5620 :
5621 :
5622 : static PyTypeObject samr_UserInfo5_Type = {
5623 : PyVarObject_HEAD_INIT(NULL, 0)
5624 : .tp_name = "samr.UserInfo5",
5625 : .tp_getset = py_samr_UserInfo5_getsetters,
5626 : .tp_methods = NULL,
5627 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5628 : .tp_new = py_samr_UserInfo5_new,
5629 : };
5630 :
5631 :
5632 0 : static PyObject *py_samr_UserInfo6_get_account_name(PyObject *obj, void *closure)
5633 : {
5634 0 : struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj);
5635 0 : PyObject *py_account_name;
5636 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
5637 0 : return py_account_name;
5638 : }
5639 :
5640 0 : static int py_samr_UserInfo6_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
5641 : {
5642 0 : struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj);
5643 0 : if (value == NULL) {
5644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
5645 0 : return -1;
5646 : }
5647 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5648 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5649 0 : PyErr_NoMemory();
5650 0 : return -1;
5651 : }
5652 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5653 0 : return 0;
5654 : }
5655 :
5656 0 : static PyObject *py_samr_UserInfo6_get_full_name(PyObject *obj, void *closure)
5657 : {
5658 0 : struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj);
5659 0 : PyObject *py_full_name;
5660 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
5661 0 : return py_full_name;
5662 : }
5663 :
5664 0 : static int py_samr_UserInfo6_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
5665 : {
5666 0 : struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj);
5667 0 : if (value == NULL) {
5668 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
5669 0 : return -1;
5670 : }
5671 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5672 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5673 0 : PyErr_NoMemory();
5674 0 : return -1;
5675 : }
5676 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5677 0 : return 0;
5678 : }
5679 :
5680 : static PyGetSetDef py_samr_UserInfo6_getsetters[] = {
5681 : {
5682 : .name = discard_const_p(char, "account_name"),
5683 : .get = py_samr_UserInfo6_get_account_name,
5684 : .set = py_samr_UserInfo6_set_account_name,
5685 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5686 : },
5687 : {
5688 : .name = discard_const_p(char, "full_name"),
5689 : .get = py_samr_UserInfo6_get_full_name,
5690 : .set = py_samr_UserInfo6_set_full_name,
5691 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5692 : },
5693 : { .name = NULL }
5694 : };
5695 :
5696 0 : static PyObject *py_samr_UserInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5697 : {
5698 0 : return pytalloc_new(struct samr_UserInfo6, type);
5699 : }
5700 :
5701 :
5702 : static PyTypeObject samr_UserInfo6_Type = {
5703 : PyVarObject_HEAD_INIT(NULL, 0)
5704 : .tp_name = "samr.UserInfo6",
5705 : .tp_getset = py_samr_UserInfo6_getsetters,
5706 : .tp_methods = NULL,
5707 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5708 : .tp_new = py_samr_UserInfo6_new,
5709 : };
5710 :
5711 :
5712 0 : static PyObject *py_samr_UserInfo7_get_account_name(PyObject *obj, void *closure)
5713 : {
5714 0 : struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(obj);
5715 0 : PyObject *py_account_name;
5716 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
5717 0 : return py_account_name;
5718 : }
5719 :
5720 0 : static int py_samr_UserInfo7_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
5721 : {
5722 0 : struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(py_obj);
5723 0 : if (value == NULL) {
5724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
5725 0 : return -1;
5726 : }
5727 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5728 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5729 0 : PyErr_NoMemory();
5730 0 : return -1;
5731 : }
5732 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5733 0 : return 0;
5734 : }
5735 :
5736 : static PyGetSetDef py_samr_UserInfo7_getsetters[] = {
5737 : {
5738 : .name = discard_const_p(char, "account_name"),
5739 : .get = py_samr_UserInfo7_get_account_name,
5740 : .set = py_samr_UserInfo7_set_account_name,
5741 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5742 : },
5743 : { .name = NULL }
5744 : };
5745 :
5746 0 : static PyObject *py_samr_UserInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5747 : {
5748 0 : return pytalloc_new(struct samr_UserInfo7, type);
5749 : }
5750 :
5751 :
5752 : static PyTypeObject samr_UserInfo7_Type = {
5753 : PyVarObject_HEAD_INIT(NULL, 0)
5754 : .tp_name = "samr.UserInfo7",
5755 : .tp_getset = py_samr_UserInfo7_getsetters,
5756 : .tp_methods = NULL,
5757 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5758 : .tp_new = py_samr_UserInfo7_new,
5759 : };
5760 :
5761 :
5762 0 : static PyObject *py_samr_UserInfo8_get_full_name(PyObject *obj, void *closure)
5763 : {
5764 0 : struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(obj);
5765 0 : PyObject *py_full_name;
5766 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
5767 0 : return py_full_name;
5768 : }
5769 :
5770 0 : static int py_samr_UserInfo8_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
5771 : {
5772 0 : struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(py_obj);
5773 0 : if (value == NULL) {
5774 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
5775 0 : return -1;
5776 : }
5777 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5778 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5779 0 : PyErr_NoMemory();
5780 0 : return -1;
5781 : }
5782 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5783 0 : return 0;
5784 : }
5785 :
5786 : static PyGetSetDef py_samr_UserInfo8_getsetters[] = {
5787 : {
5788 : .name = discard_const_p(char, "full_name"),
5789 : .get = py_samr_UserInfo8_get_full_name,
5790 : .set = py_samr_UserInfo8_set_full_name,
5791 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5792 : },
5793 : { .name = NULL }
5794 : };
5795 :
5796 0 : static PyObject *py_samr_UserInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5797 : {
5798 0 : return pytalloc_new(struct samr_UserInfo8, type);
5799 : }
5800 :
5801 :
5802 : static PyTypeObject samr_UserInfo8_Type = {
5803 : PyVarObject_HEAD_INIT(NULL, 0)
5804 : .tp_name = "samr.UserInfo8",
5805 : .tp_getset = py_samr_UserInfo8_getsetters,
5806 : .tp_methods = NULL,
5807 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5808 : .tp_new = py_samr_UserInfo8_new,
5809 : };
5810 :
5811 :
5812 0 : static PyObject *py_samr_UserInfo9_get_primary_gid(PyObject *obj, void *closure)
5813 : {
5814 0 : struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(obj);
5815 0 : PyObject *py_primary_gid;
5816 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
5817 0 : return py_primary_gid;
5818 : }
5819 :
5820 0 : static int py_samr_UserInfo9_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
5821 : {
5822 0 : struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(py_obj);
5823 0 : if (value == NULL) {
5824 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
5825 0 : return -1;
5826 : }
5827 : {
5828 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
5829 0 : if (PyLong_Check(value)) {
5830 0 : unsigned long long test_var;
5831 0 : test_var = PyLong_AsUnsignedLongLong(value);
5832 0 : if (PyErr_Occurred() != NULL) {
5833 0 : return -1;
5834 : }
5835 0 : if (test_var > uint_max) {
5836 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
5837 : PyLong_Type.tp_name, uint_max, test_var);
5838 0 : return -1;
5839 : }
5840 0 : object->primary_gid = test_var;
5841 : } else {
5842 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
5843 : PyLong_Type.tp_name);
5844 0 : return -1;
5845 : }
5846 : }
5847 0 : return 0;
5848 : }
5849 :
5850 : static PyGetSetDef py_samr_UserInfo9_getsetters[] = {
5851 : {
5852 : .name = discard_const_p(char, "primary_gid"),
5853 : .get = py_samr_UserInfo9_get_primary_gid,
5854 : .set = py_samr_UserInfo9_set_primary_gid,
5855 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
5856 : },
5857 : { .name = NULL }
5858 : };
5859 :
5860 0 : static PyObject *py_samr_UserInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5861 : {
5862 0 : return pytalloc_new(struct samr_UserInfo9, type);
5863 : }
5864 :
5865 :
5866 : static PyTypeObject samr_UserInfo9_Type = {
5867 : PyVarObject_HEAD_INIT(NULL, 0)
5868 : .tp_name = "samr.UserInfo9",
5869 : .tp_getset = py_samr_UserInfo9_getsetters,
5870 : .tp_methods = NULL,
5871 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5872 : .tp_new = py_samr_UserInfo9_new,
5873 : };
5874 :
5875 :
5876 0 : static PyObject *py_samr_UserInfo10_get_home_directory(PyObject *obj, void *closure)
5877 : {
5878 0 : struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj);
5879 0 : PyObject *py_home_directory;
5880 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
5881 0 : return py_home_directory;
5882 : }
5883 :
5884 0 : static int py_samr_UserInfo10_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
5885 : {
5886 0 : struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj);
5887 0 : if (value == NULL) {
5888 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
5889 0 : return -1;
5890 : }
5891 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5892 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5893 0 : PyErr_NoMemory();
5894 0 : return -1;
5895 : }
5896 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
5897 0 : return 0;
5898 : }
5899 :
5900 0 : static PyObject *py_samr_UserInfo10_get_home_drive(PyObject *obj, void *closure)
5901 : {
5902 0 : struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj);
5903 0 : PyObject *py_home_drive;
5904 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
5905 0 : return py_home_drive;
5906 : }
5907 :
5908 0 : static int py_samr_UserInfo10_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
5909 : {
5910 0 : struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj);
5911 0 : if (value == NULL) {
5912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
5913 0 : return -1;
5914 : }
5915 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5916 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5917 0 : PyErr_NoMemory();
5918 0 : return -1;
5919 : }
5920 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
5921 0 : return 0;
5922 : }
5923 :
5924 : static PyGetSetDef py_samr_UserInfo10_getsetters[] = {
5925 : {
5926 : .name = discard_const_p(char, "home_directory"),
5927 : .get = py_samr_UserInfo10_get_home_directory,
5928 : .set = py_samr_UserInfo10_set_home_directory,
5929 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5930 : },
5931 : {
5932 : .name = discard_const_p(char, "home_drive"),
5933 : .get = py_samr_UserInfo10_get_home_drive,
5934 : .set = py_samr_UserInfo10_set_home_drive,
5935 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5936 : },
5937 : { .name = NULL }
5938 : };
5939 :
5940 0 : static PyObject *py_samr_UserInfo10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5941 : {
5942 0 : return pytalloc_new(struct samr_UserInfo10, type);
5943 : }
5944 :
5945 :
5946 : static PyTypeObject samr_UserInfo10_Type = {
5947 : PyVarObject_HEAD_INIT(NULL, 0)
5948 : .tp_name = "samr.UserInfo10",
5949 : .tp_getset = py_samr_UserInfo10_getsetters,
5950 : .tp_methods = NULL,
5951 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5952 : .tp_new = py_samr_UserInfo10_new,
5953 : };
5954 :
5955 :
5956 0 : static PyObject *py_samr_UserInfo11_get_logon_script(PyObject *obj, void *closure)
5957 : {
5958 0 : struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(obj);
5959 0 : PyObject *py_logon_script;
5960 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
5961 0 : return py_logon_script;
5962 : }
5963 :
5964 0 : static int py_samr_UserInfo11_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
5965 : {
5966 0 : struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(py_obj);
5967 0 : if (value == NULL) {
5968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
5969 0 : return -1;
5970 : }
5971 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5972 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5973 0 : PyErr_NoMemory();
5974 0 : return -1;
5975 : }
5976 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
5977 0 : return 0;
5978 : }
5979 :
5980 : static PyGetSetDef py_samr_UserInfo11_getsetters[] = {
5981 : {
5982 : .name = discard_const_p(char, "logon_script"),
5983 : .get = py_samr_UserInfo11_get_logon_script,
5984 : .set = py_samr_UserInfo11_set_logon_script,
5985 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
5986 : },
5987 : { .name = NULL }
5988 : };
5989 :
5990 0 : static PyObject *py_samr_UserInfo11_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5991 : {
5992 0 : return pytalloc_new(struct samr_UserInfo11, type);
5993 : }
5994 :
5995 :
5996 : static PyTypeObject samr_UserInfo11_Type = {
5997 : PyVarObject_HEAD_INIT(NULL, 0)
5998 : .tp_name = "samr.UserInfo11",
5999 : .tp_getset = py_samr_UserInfo11_getsetters,
6000 : .tp_methods = NULL,
6001 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6002 : .tp_new = py_samr_UserInfo11_new,
6003 : };
6004 :
6005 :
6006 0 : static PyObject *py_samr_UserInfo12_get_profile_path(PyObject *obj, void *closure)
6007 : {
6008 0 : struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(obj);
6009 0 : PyObject *py_profile_path;
6010 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
6011 0 : return py_profile_path;
6012 : }
6013 :
6014 0 : static int py_samr_UserInfo12_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
6015 : {
6016 0 : struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(py_obj);
6017 0 : if (value == NULL) {
6018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
6019 0 : return -1;
6020 : }
6021 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6022 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6023 0 : PyErr_NoMemory();
6024 0 : return -1;
6025 : }
6026 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
6027 0 : return 0;
6028 : }
6029 :
6030 : static PyGetSetDef py_samr_UserInfo12_getsetters[] = {
6031 : {
6032 : .name = discard_const_p(char, "profile_path"),
6033 : .get = py_samr_UserInfo12_get_profile_path,
6034 : .set = py_samr_UserInfo12_set_profile_path,
6035 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6036 : },
6037 : { .name = NULL }
6038 : };
6039 :
6040 0 : static PyObject *py_samr_UserInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6041 : {
6042 0 : return pytalloc_new(struct samr_UserInfo12, type);
6043 : }
6044 :
6045 :
6046 : static PyTypeObject samr_UserInfo12_Type = {
6047 : PyVarObject_HEAD_INIT(NULL, 0)
6048 : .tp_name = "samr.UserInfo12",
6049 : .tp_getset = py_samr_UserInfo12_getsetters,
6050 : .tp_methods = NULL,
6051 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6052 : .tp_new = py_samr_UserInfo12_new,
6053 : };
6054 :
6055 :
6056 0 : static PyObject *py_samr_UserInfo13_get_description(PyObject *obj, void *closure)
6057 : {
6058 0 : struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(obj);
6059 0 : PyObject *py_description;
6060 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
6061 0 : return py_description;
6062 : }
6063 :
6064 0 : static int py_samr_UserInfo13_set_description(PyObject *py_obj, PyObject *value, void *closure)
6065 : {
6066 0 : struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(py_obj);
6067 0 : if (value == NULL) {
6068 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
6069 0 : return -1;
6070 : }
6071 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6072 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6073 0 : PyErr_NoMemory();
6074 0 : return -1;
6075 : }
6076 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
6077 0 : return 0;
6078 : }
6079 :
6080 : static PyGetSetDef py_samr_UserInfo13_getsetters[] = {
6081 : {
6082 : .name = discard_const_p(char, "description"),
6083 : .get = py_samr_UserInfo13_get_description,
6084 : .set = py_samr_UserInfo13_set_description,
6085 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6086 : },
6087 : { .name = NULL }
6088 : };
6089 :
6090 0 : static PyObject *py_samr_UserInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6091 : {
6092 0 : return pytalloc_new(struct samr_UserInfo13, type);
6093 : }
6094 :
6095 :
6096 : static PyTypeObject samr_UserInfo13_Type = {
6097 : PyVarObject_HEAD_INIT(NULL, 0)
6098 : .tp_name = "samr.UserInfo13",
6099 : .tp_getset = py_samr_UserInfo13_getsetters,
6100 : .tp_methods = NULL,
6101 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6102 : .tp_new = py_samr_UserInfo13_new,
6103 : };
6104 :
6105 :
6106 0 : static PyObject *py_samr_UserInfo14_get_workstations(PyObject *obj, void *closure)
6107 : {
6108 0 : struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(obj);
6109 0 : PyObject *py_workstations;
6110 0 : py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
6111 0 : return py_workstations;
6112 : }
6113 :
6114 0 : static int py_samr_UserInfo14_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
6115 : {
6116 0 : struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(py_obj);
6117 0 : if (value == NULL) {
6118 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations");
6119 0 : return -1;
6120 : }
6121 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6122 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6123 0 : PyErr_NoMemory();
6124 0 : return -1;
6125 : }
6126 0 : object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
6127 0 : return 0;
6128 : }
6129 :
6130 : static PyGetSetDef py_samr_UserInfo14_getsetters[] = {
6131 : {
6132 : .name = discard_const_p(char, "workstations"),
6133 : .get = py_samr_UserInfo14_get_workstations,
6134 : .set = py_samr_UserInfo14_set_workstations,
6135 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
6136 : },
6137 : { .name = NULL }
6138 : };
6139 :
6140 0 : static PyObject *py_samr_UserInfo14_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6141 : {
6142 0 : return pytalloc_new(struct samr_UserInfo14, type);
6143 : }
6144 :
6145 :
6146 : static PyTypeObject samr_UserInfo14_Type = {
6147 : PyVarObject_HEAD_INIT(NULL, 0)
6148 : .tp_name = "samr.UserInfo14",
6149 : .tp_getset = py_samr_UserInfo14_getsetters,
6150 : .tp_methods = NULL,
6151 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6152 : .tp_new = py_samr_UserInfo14_new,
6153 : };
6154 :
6155 :
6156 782 : static PyObject *py_samr_UserInfo16_get_acct_flags(PyObject *obj, void *closure)
6157 : {
6158 782 : struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(obj);
6159 0 : PyObject *py_acct_flags;
6160 782 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
6161 782 : return py_acct_flags;
6162 : }
6163 :
6164 17 : static int py_samr_UserInfo16_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
6165 : {
6166 17 : struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(py_obj);
6167 17 : if (value == NULL) {
6168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
6169 0 : return -1;
6170 : }
6171 : {
6172 17 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
6173 17 : if (PyLong_Check(value)) {
6174 0 : unsigned long long test_var;
6175 17 : test_var = PyLong_AsUnsignedLongLong(value);
6176 17 : if (PyErr_Occurred() != NULL) {
6177 0 : return -1;
6178 : }
6179 17 : if (test_var > uint_max) {
6180 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6181 : PyLong_Type.tp_name, uint_max, test_var);
6182 0 : return -1;
6183 : }
6184 17 : object->acct_flags = test_var;
6185 : } else {
6186 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6187 : PyLong_Type.tp_name);
6188 0 : return -1;
6189 : }
6190 : }
6191 17 : return 0;
6192 : }
6193 :
6194 : static PyGetSetDef py_samr_UserInfo16_getsetters[] = {
6195 : {
6196 : .name = discard_const_p(char, "acct_flags"),
6197 : .get = py_samr_UserInfo16_get_acct_flags,
6198 : .set = py_samr_UserInfo16_set_acct_flags,
6199 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
6200 : },
6201 : { .name = NULL }
6202 : };
6203 :
6204 0 : static PyObject *py_samr_UserInfo16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6205 : {
6206 0 : return pytalloc_new(struct samr_UserInfo16, type);
6207 : }
6208 :
6209 :
6210 : static PyTypeObject samr_UserInfo16_Type = {
6211 : PyVarObject_HEAD_INIT(NULL, 0)
6212 : .tp_name = "samr.UserInfo16",
6213 : .tp_getset = py_samr_UserInfo16_getsetters,
6214 : .tp_methods = NULL,
6215 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6216 : .tp_new = py_samr_UserInfo16_new,
6217 : };
6218 :
6219 :
6220 0 : static PyObject *py_samr_UserInfo17_get_acct_expiry(PyObject *obj, void *closure)
6221 : {
6222 0 : struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(obj);
6223 0 : PyObject *py_acct_expiry;
6224 0 : py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry);
6225 0 : return py_acct_expiry;
6226 : }
6227 :
6228 0 : static int py_samr_UserInfo17_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
6229 : {
6230 0 : struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(py_obj);
6231 0 : if (value == NULL) {
6232 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry");
6233 0 : return -1;
6234 : }
6235 : {
6236 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry));
6237 0 : if (PyLong_Check(value)) {
6238 0 : unsigned long long test_var;
6239 0 : test_var = PyLong_AsUnsignedLongLong(value);
6240 0 : if (PyErr_Occurred() != NULL) {
6241 0 : return -1;
6242 : }
6243 0 : if (test_var > uint_max) {
6244 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6245 : PyLong_Type.tp_name, uint_max, test_var);
6246 0 : return -1;
6247 : }
6248 0 : object->acct_expiry = test_var;
6249 : } else {
6250 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6251 : PyLong_Type.tp_name);
6252 0 : return -1;
6253 : }
6254 : }
6255 0 : return 0;
6256 : }
6257 :
6258 : static PyGetSetDef py_samr_UserInfo17_getsetters[] = {
6259 : {
6260 : .name = discard_const_p(char, "acct_expiry"),
6261 : .get = py_samr_UserInfo17_get_acct_expiry,
6262 : .set = py_samr_UserInfo17_set_acct_expiry,
6263 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
6264 : },
6265 : { .name = NULL }
6266 : };
6267 :
6268 0 : static PyObject *py_samr_UserInfo17_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6269 : {
6270 0 : return pytalloc_new(struct samr_UserInfo17, type);
6271 : }
6272 :
6273 :
6274 : static PyTypeObject samr_UserInfo17_Type = {
6275 : PyVarObject_HEAD_INIT(NULL, 0)
6276 : .tp_name = "samr.UserInfo17",
6277 : .tp_getset = py_samr_UserInfo17_getsetters,
6278 : .tp_methods = NULL,
6279 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6280 : .tp_new = py_samr_UserInfo17_new,
6281 : };
6282 :
6283 :
6284 194 : static PyObject *py_samr_Password_get_hash(PyObject *obj, void *closure)
6285 : {
6286 194 : struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(obj);
6287 18 : PyObject *py_hash;
6288 194 : py_hash = PyList_New(16);
6289 194 : if (py_hash == NULL) {
6290 0 : return NULL;
6291 : }
6292 : {
6293 : int hash_cntr_0;
6294 3298 : for (hash_cntr_0 = 0; hash_cntr_0 < (16); hash_cntr_0++) {
6295 288 : PyObject *py_hash_0;
6296 3104 : py_hash_0 = PyLong_FromLong((uint16_t)object->hash[hash_cntr_0]);
6297 3104 : PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
6298 : }
6299 : }
6300 176 : return py_hash;
6301 : }
6302 :
6303 280 : static int py_samr_Password_set_hash(PyObject *py_obj, PyObject *value, void *closure)
6304 : {
6305 280 : struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
6306 280 : if (value == NULL) {
6307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
6308 0 : return -1;
6309 : }
6310 280 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6311 : {
6312 0 : int hash_cntr_0;
6313 280 : if (ARRAY_SIZE(object->hash) != PyList_GET_SIZE(value)) {
6314 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->hash), PyList_GET_SIZE(value));
6315 0 : return -1;
6316 : }
6317 4760 : for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
6318 4480 : if (PyList_GET_ITEM(value, hash_cntr_0) == NULL) {
6319 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash[hash_cntr_0]");
6320 0 : return -1;
6321 : }
6322 : {
6323 4480 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hash[hash_cntr_0]));
6324 4480 : if (PyLong_Check(PyList_GET_ITEM(value, hash_cntr_0))) {
6325 0 : unsigned long long test_var;
6326 4480 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, hash_cntr_0));
6327 4480 : if (PyErr_Occurred() != NULL) {
6328 0 : return -1;
6329 : }
6330 4480 : if (test_var > uint_max) {
6331 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6332 : PyLong_Type.tp_name, uint_max, test_var);
6333 0 : return -1;
6334 : }
6335 4480 : object->hash[hash_cntr_0] = test_var;
6336 : } else {
6337 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6338 : PyLong_Type.tp_name);
6339 0 : return -1;
6340 : }
6341 : }
6342 : }
6343 : }
6344 280 : return 0;
6345 : }
6346 :
6347 : static PyGetSetDef py_samr_Password_getsetters[] = {
6348 : {
6349 : .name = discard_const_p(char, "hash"),
6350 : .get = py_samr_Password_get_hash,
6351 : .set = py_samr_Password_set_hash,
6352 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6353 : },
6354 : { .name = NULL }
6355 : };
6356 :
6357 270 : static PyObject *py_samr_Password_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6358 : {
6359 270 : return pytalloc_new(struct samr_Password, type);
6360 : }
6361 :
6362 0 : static PyObject *py_samr_Password_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6363 : {
6364 0 : struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
6365 0 : PyObject *ret = NULL;
6366 0 : DATA_BLOB blob;
6367 0 : enum ndr_err_code err;
6368 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
6369 0 : if (tmp_ctx == NULL) {
6370 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
6371 0 : return NULL;
6372 : }
6373 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_Password);
6374 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6375 0 : TALLOC_FREE(tmp_ctx);
6376 0 : PyErr_SetNdrError(err);
6377 0 : return NULL;
6378 : }
6379 :
6380 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
6381 0 : TALLOC_FREE(tmp_ctx);
6382 0 : return ret;
6383 : }
6384 :
6385 0 : static PyObject *py_samr_Password_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
6386 : {
6387 0 : struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
6388 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
6389 0 : Py_ssize_t blob_length = 0;
6390 0 : enum ndr_err_code err;
6391 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
6392 0 : PyObject *allow_remaining_obj = NULL;
6393 0 : bool allow_remaining = false;
6394 :
6395 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
6396 : discard_const_p(char *, kwnames),
6397 : &blob.data, &blob_length,
6398 : &allow_remaining_obj)) {
6399 0 : return NULL;
6400 : }
6401 0 : blob.length = blob_length;
6402 :
6403 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
6404 0 : allow_remaining = true;
6405 : }
6406 :
6407 0 : if (allow_remaining) {
6408 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password);
6409 : } else {
6410 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password);
6411 : }
6412 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
6413 0 : PyErr_SetNdrError(err);
6414 0 : return NULL;
6415 : }
6416 :
6417 0 : Py_RETURN_NONE;
6418 : }
6419 :
6420 0 : static PyObject *py_samr_Password_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
6421 : {
6422 0 : struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
6423 0 : PyObject *ret;
6424 0 : char *retstr;
6425 :
6426 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_Password, "samr_Password", object);
6427 0 : ret = PyUnicode_FromString(retstr);
6428 0 : talloc_free(retstr);
6429 :
6430 0 : return ret;
6431 : }
6432 :
6433 : static PyMethodDef py_samr_Password_methods[] = {
6434 : { "__ndr_pack__", (PyCFunction)py_samr_Password_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
6435 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Password_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
6436 : { "__ndr_print__", (PyCFunction)py_samr_Password_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
6437 : { NULL, NULL, 0, NULL }
6438 : };
6439 :
6440 :
6441 : static PyTypeObject samr_Password_Type = {
6442 : PyVarObject_HEAD_INIT(NULL, 0)
6443 : .tp_name = "samr.Password",
6444 : .tp_getset = py_samr_Password_getsetters,
6445 : .tp_methods = py_samr_Password_methods,
6446 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6447 : .tp_new = py_samr_Password_new,
6448 : };
6449 :
6450 :
6451 0 : static PyObject *py_samr_UserInfo18_get_nt_pwd(PyObject *obj, void *closure)
6452 : {
6453 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
6454 0 : PyObject *py_nt_pwd;
6455 0 : py_nt_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->nt_pwd);
6456 0 : return py_nt_pwd;
6457 : }
6458 :
6459 0 : static int py_samr_UserInfo18_set_nt_pwd(PyObject *py_obj, PyObject *value, void *closure)
6460 : {
6461 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
6462 0 : if (value == NULL) {
6463 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_pwd");
6464 0 : return -1;
6465 : }
6466 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
6467 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6468 0 : PyErr_NoMemory();
6469 0 : return -1;
6470 : }
6471 0 : object->nt_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
6472 0 : return 0;
6473 : }
6474 :
6475 0 : static PyObject *py_samr_UserInfo18_get_lm_pwd(PyObject *obj, void *closure)
6476 : {
6477 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
6478 0 : PyObject *py_lm_pwd;
6479 0 : py_lm_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lm_pwd);
6480 0 : return py_lm_pwd;
6481 : }
6482 :
6483 0 : static int py_samr_UserInfo18_set_lm_pwd(PyObject *py_obj, PyObject *value, void *closure)
6484 : {
6485 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
6486 0 : if (value == NULL) {
6487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_pwd");
6488 0 : return -1;
6489 : }
6490 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
6491 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6492 0 : PyErr_NoMemory();
6493 0 : return -1;
6494 : }
6495 0 : object->lm_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
6496 0 : return 0;
6497 : }
6498 :
6499 0 : static PyObject *py_samr_UserInfo18_get_nt_pwd_active(PyObject *obj, void *closure)
6500 : {
6501 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
6502 0 : PyObject *py_nt_pwd_active;
6503 0 : py_nt_pwd_active = PyLong_FromLong((uint16_t)object->nt_pwd_active);
6504 0 : return py_nt_pwd_active;
6505 : }
6506 :
6507 0 : static int py_samr_UserInfo18_set_nt_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
6508 : {
6509 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
6510 0 : if (value == NULL) {
6511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_pwd_active");
6512 0 : return -1;
6513 : }
6514 : {
6515 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_pwd_active));
6516 0 : if (PyLong_Check(value)) {
6517 0 : unsigned long long test_var;
6518 0 : test_var = PyLong_AsUnsignedLongLong(value);
6519 0 : if (PyErr_Occurred() != NULL) {
6520 0 : return -1;
6521 : }
6522 0 : if (test_var > uint_max) {
6523 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6524 : PyLong_Type.tp_name, uint_max, test_var);
6525 0 : return -1;
6526 : }
6527 0 : object->nt_pwd_active = test_var;
6528 : } else {
6529 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6530 : PyLong_Type.tp_name);
6531 0 : return -1;
6532 : }
6533 : }
6534 0 : return 0;
6535 : }
6536 :
6537 0 : static PyObject *py_samr_UserInfo18_get_lm_pwd_active(PyObject *obj, void *closure)
6538 : {
6539 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
6540 0 : PyObject *py_lm_pwd_active;
6541 0 : py_lm_pwd_active = PyLong_FromLong((uint16_t)object->lm_pwd_active);
6542 0 : return py_lm_pwd_active;
6543 : }
6544 :
6545 0 : static int py_samr_UserInfo18_set_lm_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
6546 : {
6547 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
6548 0 : if (value == NULL) {
6549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_pwd_active");
6550 0 : return -1;
6551 : }
6552 : {
6553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_pwd_active));
6554 0 : if (PyLong_Check(value)) {
6555 0 : unsigned long long test_var;
6556 0 : test_var = PyLong_AsUnsignedLongLong(value);
6557 0 : if (PyErr_Occurred() != NULL) {
6558 0 : return -1;
6559 : }
6560 0 : if (test_var > uint_max) {
6561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6562 : PyLong_Type.tp_name, uint_max, test_var);
6563 0 : return -1;
6564 : }
6565 0 : object->lm_pwd_active = test_var;
6566 : } else {
6567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6568 : PyLong_Type.tp_name);
6569 0 : return -1;
6570 : }
6571 : }
6572 0 : return 0;
6573 : }
6574 :
6575 0 : static PyObject *py_samr_UserInfo18_get_password_expired(PyObject *obj, void *closure)
6576 : {
6577 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
6578 0 : PyObject *py_password_expired;
6579 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
6580 0 : return py_password_expired;
6581 : }
6582 :
6583 0 : static int py_samr_UserInfo18_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
6584 : {
6585 0 : struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
6586 0 : if (value == NULL) {
6587 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
6588 0 : return -1;
6589 : }
6590 : {
6591 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
6592 0 : if (PyLong_Check(value)) {
6593 0 : unsigned long long test_var;
6594 0 : test_var = PyLong_AsUnsignedLongLong(value);
6595 0 : if (PyErr_Occurred() != NULL) {
6596 0 : return -1;
6597 : }
6598 0 : if (test_var > uint_max) {
6599 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6600 : PyLong_Type.tp_name, uint_max, test_var);
6601 0 : return -1;
6602 : }
6603 0 : object->password_expired = test_var;
6604 : } else {
6605 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6606 : PyLong_Type.tp_name);
6607 0 : return -1;
6608 : }
6609 : }
6610 0 : return 0;
6611 : }
6612 :
6613 : static PyGetSetDef py_samr_UserInfo18_getsetters[] = {
6614 : {
6615 : .name = discard_const_p(char, "nt_pwd"),
6616 : .get = py_samr_UserInfo18_get_nt_pwd,
6617 : .set = py_samr_UserInfo18_set_nt_pwd,
6618 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
6619 : },
6620 : {
6621 : .name = discard_const_p(char, "lm_pwd"),
6622 : .get = py_samr_UserInfo18_get_lm_pwd,
6623 : .set = py_samr_UserInfo18_set_lm_pwd,
6624 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
6625 : },
6626 : {
6627 : .name = discard_const_p(char, "nt_pwd_active"),
6628 : .get = py_samr_UserInfo18_get_nt_pwd_active,
6629 : .set = py_samr_UserInfo18_set_nt_pwd_active,
6630 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6631 : },
6632 : {
6633 : .name = discard_const_p(char, "lm_pwd_active"),
6634 : .get = py_samr_UserInfo18_get_lm_pwd_active,
6635 : .set = py_samr_UserInfo18_set_lm_pwd_active,
6636 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6637 : },
6638 : {
6639 : .name = discard_const_p(char, "password_expired"),
6640 : .get = py_samr_UserInfo18_get_password_expired,
6641 : .set = py_samr_UserInfo18_set_password_expired,
6642 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
6643 : },
6644 : { .name = NULL }
6645 : };
6646 :
6647 0 : static PyObject *py_samr_UserInfo18_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6648 : {
6649 0 : return pytalloc_new(struct samr_UserInfo18, type);
6650 : }
6651 :
6652 :
6653 : static PyTypeObject samr_UserInfo18_Type = {
6654 : PyVarObject_HEAD_INIT(NULL, 0)
6655 : .tp_name = "samr.UserInfo18",
6656 : .tp_getset = py_samr_UserInfo18_getsetters,
6657 : .tp_methods = NULL,
6658 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6659 : .tp_new = py_samr_UserInfo18_new,
6660 : };
6661 :
6662 :
6663 0 : static PyObject *py_samr_UserInfo20_get_parameters(PyObject *obj, void *closure)
6664 : {
6665 0 : struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(obj);
6666 0 : PyObject *py_parameters;
6667 0 : py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters);
6668 0 : return py_parameters;
6669 : }
6670 :
6671 0 : static int py_samr_UserInfo20_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
6672 : {
6673 0 : struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(py_obj);
6674 0 : if (value == NULL) {
6675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters");
6676 0 : return -1;
6677 : }
6678 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
6679 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6680 0 : PyErr_NoMemory();
6681 0 : return -1;
6682 : }
6683 0 : object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
6684 0 : return 0;
6685 : }
6686 :
6687 : static PyGetSetDef py_samr_UserInfo20_getsetters[] = {
6688 : {
6689 : .name = discard_const_p(char, "parameters"),
6690 : .get = py_samr_UserInfo20_get_parameters,
6691 : .set = py_samr_UserInfo20_set_parameters,
6692 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
6693 : },
6694 : { .name = NULL }
6695 : };
6696 :
6697 0 : static PyObject *py_samr_UserInfo20_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6698 : {
6699 0 : return pytalloc_new(struct samr_UserInfo20, type);
6700 : }
6701 :
6702 :
6703 : static PyTypeObject samr_UserInfo20_Type = {
6704 : PyVarObject_HEAD_INIT(NULL, 0)
6705 : .tp_name = "samr.UserInfo20",
6706 : .tp_getset = py_samr_UserInfo20_getsetters,
6707 : .tp_methods = NULL,
6708 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6709 : .tp_new = py_samr_UserInfo20_new,
6710 : };
6711 :
6712 :
6713 765 : static PyObject *py_samr_UserInfo21_get_last_logon(PyObject *obj, void *closure)
6714 : {
6715 765 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6716 0 : PyObject *py_last_logon;
6717 765 : py_last_logon = PyLong_FromUnsignedLongLong(object->last_logon);
6718 765 : return py_last_logon;
6719 : }
6720 :
6721 0 : static int py_samr_UserInfo21_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
6722 : {
6723 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6724 0 : if (value == NULL) {
6725 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logon");
6726 0 : return -1;
6727 : }
6728 : {
6729 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logon));
6730 0 : if (PyLong_Check(value)) {
6731 0 : unsigned long long test_var;
6732 0 : test_var = PyLong_AsUnsignedLongLong(value);
6733 0 : if (PyErr_Occurred() != NULL) {
6734 0 : return -1;
6735 : }
6736 0 : if (test_var > uint_max) {
6737 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6738 : PyLong_Type.tp_name, uint_max, test_var);
6739 0 : return -1;
6740 : }
6741 0 : object->last_logon = test_var;
6742 : } else {
6743 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6744 : PyLong_Type.tp_name);
6745 0 : return -1;
6746 : }
6747 : }
6748 0 : return 0;
6749 : }
6750 :
6751 0 : static PyObject *py_samr_UserInfo21_get_last_logoff(PyObject *obj, void *closure)
6752 : {
6753 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6754 0 : PyObject *py_last_logoff;
6755 0 : py_last_logoff = PyLong_FromUnsignedLongLong(object->last_logoff);
6756 0 : return py_last_logoff;
6757 : }
6758 :
6759 0 : static int py_samr_UserInfo21_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
6760 : {
6761 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6762 0 : if (value == NULL) {
6763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_logoff");
6764 0 : return -1;
6765 : }
6766 : {
6767 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_logoff));
6768 0 : if (PyLong_Check(value)) {
6769 0 : unsigned long long test_var;
6770 0 : test_var = PyLong_AsUnsignedLongLong(value);
6771 0 : if (PyErr_Occurred() != NULL) {
6772 0 : return -1;
6773 : }
6774 0 : if (test_var > uint_max) {
6775 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6776 : PyLong_Type.tp_name, uint_max, test_var);
6777 0 : return -1;
6778 : }
6779 0 : object->last_logoff = test_var;
6780 : } else {
6781 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6782 : PyLong_Type.tp_name);
6783 0 : return -1;
6784 : }
6785 : }
6786 0 : return 0;
6787 : }
6788 :
6789 0 : static PyObject *py_samr_UserInfo21_get_last_password_change(PyObject *obj, void *closure)
6790 : {
6791 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6792 0 : PyObject *py_last_password_change;
6793 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
6794 0 : return py_last_password_change;
6795 : }
6796 :
6797 0 : static int py_samr_UserInfo21_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
6798 : {
6799 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6800 0 : if (value == NULL) {
6801 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
6802 0 : return -1;
6803 : }
6804 : {
6805 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
6806 0 : if (PyLong_Check(value)) {
6807 0 : unsigned long long test_var;
6808 0 : test_var = PyLong_AsUnsignedLongLong(value);
6809 0 : if (PyErr_Occurred() != NULL) {
6810 0 : return -1;
6811 : }
6812 0 : if (test_var > uint_max) {
6813 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6814 : PyLong_Type.tp_name, uint_max, test_var);
6815 0 : return -1;
6816 : }
6817 0 : object->last_password_change = test_var;
6818 : } else {
6819 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6820 : PyLong_Type.tp_name);
6821 0 : return -1;
6822 : }
6823 : }
6824 0 : return 0;
6825 : }
6826 :
6827 0 : static PyObject *py_samr_UserInfo21_get_acct_expiry(PyObject *obj, void *closure)
6828 : {
6829 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6830 0 : PyObject *py_acct_expiry;
6831 0 : py_acct_expiry = PyLong_FromUnsignedLongLong(object->acct_expiry);
6832 0 : return py_acct_expiry;
6833 : }
6834 :
6835 0 : static int py_samr_UserInfo21_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
6836 : {
6837 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6838 0 : if (value == NULL) {
6839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_expiry");
6840 0 : return -1;
6841 : }
6842 : {
6843 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_expiry));
6844 0 : if (PyLong_Check(value)) {
6845 0 : unsigned long long test_var;
6846 0 : test_var = PyLong_AsUnsignedLongLong(value);
6847 0 : if (PyErr_Occurred() != NULL) {
6848 0 : return -1;
6849 : }
6850 0 : if (test_var > uint_max) {
6851 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6852 : PyLong_Type.tp_name, uint_max, test_var);
6853 0 : return -1;
6854 : }
6855 0 : object->acct_expiry = test_var;
6856 : } else {
6857 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6858 : PyLong_Type.tp_name);
6859 0 : return -1;
6860 : }
6861 : }
6862 0 : return 0;
6863 : }
6864 :
6865 0 : static PyObject *py_samr_UserInfo21_get_allow_password_change(PyObject *obj, void *closure)
6866 : {
6867 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6868 0 : PyObject *py_allow_password_change;
6869 0 : py_allow_password_change = PyLong_FromUnsignedLongLong(object->allow_password_change);
6870 0 : return py_allow_password_change;
6871 : }
6872 :
6873 0 : static int py_samr_UserInfo21_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
6874 : {
6875 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6876 0 : if (value == NULL) {
6877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->allow_password_change");
6878 0 : return -1;
6879 : }
6880 : {
6881 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->allow_password_change));
6882 0 : if (PyLong_Check(value)) {
6883 0 : unsigned long long test_var;
6884 0 : test_var = PyLong_AsUnsignedLongLong(value);
6885 0 : if (PyErr_Occurred() != NULL) {
6886 0 : return -1;
6887 : }
6888 0 : if (test_var > uint_max) {
6889 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6890 : PyLong_Type.tp_name, uint_max, test_var);
6891 0 : return -1;
6892 : }
6893 0 : object->allow_password_change = test_var;
6894 : } else {
6895 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6896 : PyLong_Type.tp_name);
6897 0 : return -1;
6898 : }
6899 : }
6900 0 : return 0;
6901 : }
6902 :
6903 0 : static PyObject *py_samr_UserInfo21_get_force_password_change(PyObject *obj, void *closure)
6904 : {
6905 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6906 0 : PyObject *py_force_password_change;
6907 0 : py_force_password_change = PyLong_FromUnsignedLongLong(object->force_password_change);
6908 0 : return py_force_password_change;
6909 : }
6910 :
6911 0 : static int py_samr_UserInfo21_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
6912 : {
6913 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6914 0 : if (value == NULL) {
6915 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->force_password_change");
6916 0 : return -1;
6917 : }
6918 : {
6919 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->force_password_change));
6920 0 : if (PyLong_Check(value)) {
6921 0 : unsigned long long test_var;
6922 0 : test_var = PyLong_AsUnsignedLongLong(value);
6923 0 : if (PyErr_Occurred() != NULL) {
6924 0 : return -1;
6925 : }
6926 0 : if (test_var > uint_max) {
6927 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
6928 : PyLong_Type.tp_name, uint_max, test_var);
6929 0 : return -1;
6930 : }
6931 0 : object->force_password_change = test_var;
6932 : } else {
6933 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
6934 : PyLong_Type.tp_name);
6935 0 : return -1;
6936 : }
6937 : }
6938 0 : return 0;
6939 : }
6940 :
6941 0 : static PyObject *py_samr_UserInfo21_get_account_name(PyObject *obj, void *closure)
6942 : {
6943 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6944 0 : PyObject *py_account_name;
6945 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
6946 0 : return py_account_name;
6947 : }
6948 :
6949 0 : static int py_samr_UserInfo21_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6950 : {
6951 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6952 0 : if (value == NULL) {
6953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
6954 0 : return -1;
6955 : }
6956 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6957 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6958 0 : PyErr_NoMemory();
6959 0 : return -1;
6960 : }
6961 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6962 0 : return 0;
6963 : }
6964 :
6965 0 : static PyObject *py_samr_UserInfo21_get_full_name(PyObject *obj, void *closure)
6966 : {
6967 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6968 0 : PyObject *py_full_name;
6969 0 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
6970 0 : return py_full_name;
6971 : }
6972 :
6973 0 : static int py_samr_UserInfo21_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
6974 : {
6975 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
6976 0 : if (value == NULL) {
6977 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
6978 0 : return -1;
6979 : }
6980 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6981 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6982 0 : PyErr_NoMemory();
6983 0 : return -1;
6984 : }
6985 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6986 0 : return 0;
6987 : }
6988 :
6989 0 : static PyObject *py_samr_UserInfo21_get_home_directory(PyObject *obj, void *closure)
6990 : {
6991 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
6992 0 : PyObject *py_home_directory;
6993 0 : py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
6994 0 : return py_home_directory;
6995 : }
6996 :
6997 0 : static int py_samr_UserInfo21_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
6998 : {
6999 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7000 0 : if (value == NULL) {
7001 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_directory");
7002 0 : return -1;
7003 : }
7004 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7005 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7006 0 : PyErr_NoMemory();
7007 0 : return -1;
7008 : }
7009 0 : object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
7010 0 : return 0;
7011 : }
7012 :
7013 0 : static PyObject *py_samr_UserInfo21_get_home_drive(PyObject *obj, void *closure)
7014 : {
7015 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7016 0 : PyObject *py_home_drive;
7017 0 : py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
7018 0 : return py_home_drive;
7019 : }
7020 :
7021 0 : static int py_samr_UserInfo21_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
7022 : {
7023 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7024 0 : if (value == NULL) {
7025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->home_drive");
7026 0 : return -1;
7027 : }
7028 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7029 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7030 0 : PyErr_NoMemory();
7031 0 : return -1;
7032 : }
7033 0 : object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
7034 0 : return 0;
7035 : }
7036 :
7037 0 : static PyObject *py_samr_UserInfo21_get_logon_script(PyObject *obj, void *closure)
7038 : {
7039 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7040 0 : PyObject *py_logon_script;
7041 0 : py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
7042 0 : return py_logon_script;
7043 : }
7044 :
7045 0 : static int py_samr_UserInfo21_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
7046 : {
7047 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7048 0 : if (value == NULL) {
7049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_script");
7050 0 : return -1;
7051 : }
7052 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7053 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7054 0 : PyErr_NoMemory();
7055 0 : return -1;
7056 : }
7057 0 : object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
7058 0 : return 0;
7059 : }
7060 :
7061 0 : static PyObject *py_samr_UserInfo21_get_profile_path(PyObject *obj, void *closure)
7062 : {
7063 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7064 0 : PyObject *py_profile_path;
7065 0 : py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
7066 0 : return py_profile_path;
7067 : }
7068 :
7069 0 : static int py_samr_UserInfo21_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
7070 : {
7071 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7072 0 : if (value == NULL) {
7073 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->profile_path");
7074 0 : return -1;
7075 : }
7076 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7077 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7078 0 : PyErr_NoMemory();
7079 0 : return -1;
7080 : }
7081 0 : object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
7082 0 : return 0;
7083 : }
7084 :
7085 0 : static PyObject *py_samr_UserInfo21_get_description(PyObject *obj, void *closure)
7086 : {
7087 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7088 0 : PyObject *py_description;
7089 0 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
7090 0 : return py_description;
7091 : }
7092 :
7093 0 : static int py_samr_UserInfo21_set_description(PyObject *py_obj, PyObject *value, void *closure)
7094 : {
7095 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7096 0 : if (value == NULL) {
7097 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
7098 0 : return -1;
7099 : }
7100 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7101 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7102 0 : PyErr_NoMemory();
7103 0 : return -1;
7104 : }
7105 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
7106 0 : return 0;
7107 : }
7108 :
7109 0 : static PyObject *py_samr_UserInfo21_get_workstations(PyObject *obj, void *closure)
7110 : {
7111 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7112 0 : PyObject *py_workstations;
7113 0 : py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
7114 0 : return py_workstations;
7115 : }
7116 :
7117 0 : static int py_samr_UserInfo21_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
7118 : {
7119 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7120 0 : if (value == NULL) {
7121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->workstations");
7122 0 : return -1;
7123 : }
7124 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7125 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7126 0 : PyErr_NoMemory();
7127 0 : return -1;
7128 : }
7129 0 : object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
7130 0 : return 0;
7131 : }
7132 :
7133 0 : static PyObject *py_samr_UserInfo21_get_comment(PyObject *obj, void *closure)
7134 : {
7135 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7136 0 : PyObject *py_comment;
7137 0 : py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
7138 0 : return py_comment;
7139 : }
7140 :
7141 0 : static int py_samr_UserInfo21_set_comment(PyObject *py_obj, PyObject *value, void *closure)
7142 : {
7143 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7144 0 : if (value == NULL) {
7145 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
7146 0 : return -1;
7147 : }
7148 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7149 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7150 0 : PyErr_NoMemory();
7151 0 : return -1;
7152 : }
7153 0 : object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
7154 0 : return 0;
7155 : }
7156 :
7157 0 : static PyObject *py_samr_UserInfo21_get_parameters(PyObject *obj, void *closure)
7158 : {
7159 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7160 0 : PyObject *py_parameters;
7161 0 : py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters);
7162 0 : return py_parameters;
7163 : }
7164 :
7165 0 : static int py_samr_UserInfo21_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
7166 : {
7167 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7168 0 : if (value == NULL) {
7169 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->parameters");
7170 0 : return -1;
7171 : }
7172 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
7173 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7174 0 : PyErr_NoMemory();
7175 0 : return -1;
7176 : }
7177 0 : object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
7178 0 : return 0;
7179 : }
7180 :
7181 0 : static PyObject *py_samr_UserInfo21_get_lm_owf_password(PyObject *obj, void *closure)
7182 : {
7183 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7184 0 : PyObject *py_lm_owf_password;
7185 0 : py_lm_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->lm_owf_password);
7186 0 : return py_lm_owf_password;
7187 : }
7188 :
7189 0 : static int py_samr_UserInfo21_set_lm_owf_password(PyObject *py_obj, PyObject *value, void *closure)
7190 : {
7191 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7192 0 : if (value == NULL) {
7193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_owf_password");
7194 0 : return -1;
7195 : }
7196 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
7197 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7198 0 : PyErr_NoMemory();
7199 0 : return -1;
7200 : }
7201 0 : object->lm_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
7202 0 : return 0;
7203 : }
7204 :
7205 0 : static PyObject *py_samr_UserInfo21_get_nt_owf_password(PyObject *obj, void *closure)
7206 : {
7207 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7208 0 : PyObject *py_nt_owf_password;
7209 0 : py_nt_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->nt_owf_password);
7210 0 : return py_nt_owf_password;
7211 : }
7212 :
7213 0 : static int py_samr_UserInfo21_set_nt_owf_password(PyObject *py_obj, PyObject *value, void *closure)
7214 : {
7215 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7216 0 : if (value == NULL) {
7217 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_owf_password");
7218 0 : return -1;
7219 : }
7220 0 : PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
7221 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7222 0 : PyErr_NoMemory();
7223 0 : return -1;
7224 : }
7225 0 : object->nt_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
7226 0 : return 0;
7227 : }
7228 :
7229 0 : static PyObject *py_samr_UserInfo21_get_private_data(PyObject *obj, void *closure)
7230 : {
7231 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7232 0 : PyObject *py_private_data;
7233 0 : py_private_data = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->private_data);
7234 0 : return py_private_data;
7235 : }
7236 :
7237 0 : static int py_samr_UserInfo21_set_private_data(PyObject *py_obj, PyObject *value, void *closure)
7238 : {
7239 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7240 0 : if (value == NULL) {
7241 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->private_data");
7242 0 : return -1;
7243 : }
7244 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
7245 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7246 0 : PyErr_NoMemory();
7247 0 : return -1;
7248 : }
7249 0 : object->private_data = *(struct lsa_String *)pytalloc_get_ptr(value);
7250 0 : return 0;
7251 : }
7252 :
7253 0 : static PyObject *py_samr_UserInfo21_get_buf_count(PyObject *obj, void *closure)
7254 : {
7255 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7256 0 : PyObject *py_buf_count;
7257 0 : py_buf_count = PyLong_FromUnsignedLongLong((uint32_t)object->buf_count);
7258 0 : return py_buf_count;
7259 : }
7260 :
7261 0 : static int py_samr_UserInfo21_set_buf_count(PyObject *py_obj, PyObject *value, void *closure)
7262 : {
7263 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7264 0 : if (value == NULL) {
7265 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buf_count");
7266 0 : return -1;
7267 : }
7268 : {
7269 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buf_count));
7270 0 : if (PyLong_Check(value)) {
7271 0 : unsigned long long test_var;
7272 0 : test_var = PyLong_AsUnsignedLongLong(value);
7273 0 : if (PyErr_Occurred() != NULL) {
7274 0 : return -1;
7275 : }
7276 0 : if (test_var > uint_max) {
7277 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7278 : PyLong_Type.tp_name, uint_max, test_var);
7279 0 : return -1;
7280 : }
7281 0 : object->buf_count = test_var;
7282 : } else {
7283 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7284 : PyLong_Type.tp_name);
7285 0 : return -1;
7286 : }
7287 : }
7288 0 : return 0;
7289 : }
7290 :
7291 0 : static PyObject *py_samr_UserInfo21_get_buffer(PyObject *obj, void *closure)
7292 : {
7293 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7294 0 : PyObject *py_buffer;
7295 0 : if (object->buffer == NULL) {
7296 0 : Py_RETURN_NONE;
7297 : }
7298 0 : if (object->buffer == NULL) {
7299 0 : py_buffer = Py_None;
7300 0 : Py_INCREF(py_buffer);
7301 : } else {
7302 0 : py_buffer = PyList_New(object->buf_count);
7303 0 : if (py_buffer == NULL) {
7304 0 : return NULL;
7305 : }
7306 : {
7307 : int buffer_cntr_1;
7308 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->buf_count); buffer_cntr_1++) {
7309 0 : PyObject *py_buffer_1;
7310 0 : py_buffer_1 = PyLong_FromLong((uint16_t)object->buffer[buffer_cntr_1]);
7311 0 : PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
7312 : }
7313 : }
7314 : }
7315 0 : return py_buffer;
7316 : }
7317 :
7318 0 : static int py_samr_UserInfo21_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
7319 : {
7320 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7321 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->buffer));
7322 0 : if (value == NULL) {
7323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer");
7324 0 : return -1;
7325 : }
7326 0 : if (value == Py_None) {
7327 0 : object->buffer = NULL;
7328 : } else {
7329 0 : object->buffer = NULL;
7330 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7331 : {
7332 0 : int buffer_cntr_1;
7333 0 : object->buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffer, PyList_GET_SIZE(value));
7334 0 : if (!object->buffer) { return -1; }
7335 0 : talloc_set_name_const(object->buffer, "ARRAY: object->buffer");
7336 0 : for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
7337 0 : if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
7338 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffer[buffer_cntr_1]");
7339 0 : return -1;
7340 : }
7341 : {
7342 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->buffer[buffer_cntr_1]));
7343 0 : if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
7344 0 : unsigned long long test_var;
7345 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
7346 0 : if (PyErr_Occurred() != NULL) {
7347 0 : return -1;
7348 : }
7349 0 : if (test_var > uint_max) {
7350 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7351 : PyLong_Type.tp_name, uint_max, test_var);
7352 0 : return -1;
7353 : }
7354 0 : object->buffer[buffer_cntr_1] = test_var;
7355 : } else {
7356 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7357 : PyLong_Type.tp_name);
7358 0 : return -1;
7359 : }
7360 : }
7361 : }
7362 : }
7363 : }
7364 0 : return 0;
7365 : }
7366 :
7367 0 : static PyObject *py_samr_UserInfo21_get_rid(PyObject *obj, void *closure)
7368 : {
7369 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7370 0 : PyObject *py_rid;
7371 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
7372 0 : return py_rid;
7373 : }
7374 :
7375 0 : static int py_samr_UserInfo21_set_rid(PyObject *py_obj, PyObject *value, void *closure)
7376 : {
7377 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7378 0 : if (value == NULL) {
7379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
7380 0 : return -1;
7381 : }
7382 : {
7383 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
7384 0 : if (PyLong_Check(value)) {
7385 0 : unsigned long long test_var;
7386 0 : test_var = PyLong_AsUnsignedLongLong(value);
7387 0 : if (PyErr_Occurred() != NULL) {
7388 0 : return -1;
7389 : }
7390 0 : if (test_var > uint_max) {
7391 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7392 : PyLong_Type.tp_name, uint_max, test_var);
7393 0 : return -1;
7394 : }
7395 0 : object->rid = test_var;
7396 : } else {
7397 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7398 : PyLong_Type.tp_name);
7399 0 : return -1;
7400 : }
7401 : }
7402 0 : return 0;
7403 : }
7404 :
7405 0 : static PyObject *py_samr_UserInfo21_get_primary_gid(PyObject *obj, void *closure)
7406 : {
7407 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7408 0 : PyObject *py_primary_gid;
7409 0 : py_primary_gid = PyLong_FromUnsignedLongLong((uint32_t)object->primary_gid);
7410 0 : return py_primary_gid;
7411 : }
7412 :
7413 0 : static int py_samr_UserInfo21_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
7414 : {
7415 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7416 0 : if (value == NULL) {
7417 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->primary_gid");
7418 0 : return -1;
7419 : }
7420 : {
7421 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->primary_gid));
7422 0 : if (PyLong_Check(value)) {
7423 0 : unsigned long long test_var;
7424 0 : test_var = PyLong_AsUnsignedLongLong(value);
7425 0 : if (PyErr_Occurred() != NULL) {
7426 0 : return -1;
7427 : }
7428 0 : if (test_var > uint_max) {
7429 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7430 : PyLong_Type.tp_name, uint_max, test_var);
7431 0 : return -1;
7432 : }
7433 0 : object->primary_gid = test_var;
7434 : } else {
7435 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7436 : PyLong_Type.tp_name);
7437 0 : return -1;
7438 : }
7439 : }
7440 0 : return 0;
7441 : }
7442 :
7443 765 : static PyObject *py_samr_UserInfo21_get_acct_flags(PyObject *obj, void *closure)
7444 : {
7445 765 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7446 0 : PyObject *py_acct_flags;
7447 765 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
7448 765 : return py_acct_flags;
7449 : }
7450 :
7451 0 : static int py_samr_UserInfo21_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
7452 : {
7453 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7454 0 : if (value == NULL) {
7455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
7456 0 : return -1;
7457 : }
7458 : {
7459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
7460 0 : if (PyLong_Check(value)) {
7461 0 : unsigned long long test_var;
7462 0 : test_var = PyLong_AsUnsignedLongLong(value);
7463 0 : if (PyErr_Occurred() != NULL) {
7464 0 : return -1;
7465 : }
7466 0 : if (test_var > uint_max) {
7467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7468 : PyLong_Type.tp_name, uint_max, test_var);
7469 0 : return -1;
7470 : }
7471 0 : object->acct_flags = test_var;
7472 : } else {
7473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7474 : PyLong_Type.tp_name);
7475 0 : return -1;
7476 : }
7477 : }
7478 0 : return 0;
7479 : }
7480 :
7481 0 : static PyObject *py_samr_UserInfo21_get_fields_present(PyObject *obj, void *closure)
7482 : {
7483 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7484 0 : PyObject *py_fields_present;
7485 0 : py_fields_present = PyLong_FromUnsignedLongLong((uint32_t)object->fields_present);
7486 0 : return py_fields_present;
7487 : }
7488 :
7489 0 : static int py_samr_UserInfo21_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
7490 : {
7491 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7492 0 : if (value == NULL) {
7493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fields_present");
7494 0 : return -1;
7495 : }
7496 : {
7497 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fields_present));
7498 0 : if (PyLong_Check(value)) {
7499 0 : unsigned long long test_var;
7500 0 : test_var = PyLong_AsUnsignedLongLong(value);
7501 0 : if (PyErr_Occurred() != NULL) {
7502 0 : return -1;
7503 : }
7504 0 : if (test_var > uint_max) {
7505 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7506 : PyLong_Type.tp_name, uint_max, test_var);
7507 0 : return -1;
7508 : }
7509 0 : object->fields_present = test_var;
7510 : } else {
7511 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7512 : PyLong_Type.tp_name);
7513 0 : return -1;
7514 : }
7515 : }
7516 0 : return 0;
7517 : }
7518 :
7519 0 : static PyObject *py_samr_UserInfo21_get_logon_hours(PyObject *obj, void *closure)
7520 : {
7521 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7522 0 : PyObject *py_logon_hours;
7523 0 : py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
7524 0 : return py_logon_hours;
7525 : }
7526 :
7527 0 : static int py_samr_UserInfo21_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
7528 : {
7529 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7530 0 : if (value == NULL) {
7531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_hours");
7532 0 : return -1;
7533 : }
7534 0 : PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
7535 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7536 0 : PyErr_NoMemory();
7537 0 : return -1;
7538 : }
7539 0 : object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
7540 0 : return 0;
7541 : }
7542 :
7543 765 : static PyObject *py_samr_UserInfo21_get_bad_password_count(PyObject *obj, void *closure)
7544 : {
7545 765 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7546 0 : PyObject *py_bad_password_count;
7547 765 : py_bad_password_count = PyLong_FromLong((uint16_t)object->bad_password_count);
7548 765 : return py_bad_password_count;
7549 : }
7550 :
7551 0 : static int py_samr_UserInfo21_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
7552 : {
7553 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7554 0 : if (value == NULL) {
7555 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_count");
7556 0 : return -1;
7557 : }
7558 : {
7559 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_count));
7560 0 : if (PyLong_Check(value)) {
7561 0 : unsigned long long test_var;
7562 0 : test_var = PyLong_AsUnsignedLongLong(value);
7563 0 : if (PyErr_Occurred() != NULL) {
7564 0 : return -1;
7565 : }
7566 0 : if (test_var > uint_max) {
7567 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7568 : PyLong_Type.tp_name, uint_max, test_var);
7569 0 : return -1;
7570 : }
7571 0 : object->bad_password_count = test_var;
7572 : } else {
7573 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7574 : PyLong_Type.tp_name);
7575 0 : return -1;
7576 : }
7577 : }
7578 0 : return 0;
7579 : }
7580 :
7581 765 : static PyObject *py_samr_UserInfo21_get_logon_count(PyObject *obj, void *closure)
7582 : {
7583 765 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7584 0 : PyObject *py_logon_count;
7585 765 : py_logon_count = PyLong_FromLong((uint16_t)object->logon_count);
7586 765 : return py_logon_count;
7587 : }
7588 :
7589 0 : static int py_samr_UserInfo21_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
7590 : {
7591 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7592 0 : if (value == NULL) {
7593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_count");
7594 0 : return -1;
7595 : }
7596 : {
7597 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_count));
7598 0 : if (PyLong_Check(value)) {
7599 0 : unsigned long long test_var;
7600 0 : test_var = PyLong_AsUnsignedLongLong(value);
7601 0 : if (PyErr_Occurred() != NULL) {
7602 0 : return -1;
7603 : }
7604 0 : if (test_var > uint_max) {
7605 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7606 : PyLong_Type.tp_name, uint_max, test_var);
7607 0 : return -1;
7608 : }
7609 0 : object->logon_count = test_var;
7610 : } else {
7611 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7612 : PyLong_Type.tp_name);
7613 0 : return -1;
7614 : }
7615 : }
7616 0 : return 0;
7617 : }
7618 :
7619 0 : static PyObject *py_samr_UserInfo21_get_country_code(PyObject *obj, void *closure)
7620 : {
7621 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7622 0 : PyObject *py_country_code;
7623 0 : py_country_code = PyLong_FromLong((uint16_t)object->country_code);
7624 0 : return py_country_code;
7625 : }
7626 :
7627 0 : static int py_samr_UserInfo21_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
7628 : {
7629 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7630 0 : if (value == NULL) {
7631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->country_code");
7632 0 : return -1;
7633 : }
7634 : {
7635 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->country_code));
7636 0 : if (PyLong_Check(value)) {
7637 0 : unsigned long long test_var;
7638 0 : test_var = PyLong_AsUnsignedLongLong(value);
7639 0 : if (PyErr_Occurred() != NULL) {
7640 0 : return -1;
7641 : }
7642 0 : if (test_var > uint_max) {
7643 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7644 : PyLong_Type.tp_name, uint_max, test_var);
7645 0 : return -1;
7646 : }
7647 0 : object->country_code = test_var;
7648 : } else {
7649 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7650 : PyLong_Type.tp_name);
7651 0 : return -1;
7652 : }
7653 : }
7654 0 : return 0;
7655 : }
7656 :
7657 0 : static PyObject *py_samr_UserInfo21_get_code_page(PyObject *obj, void *closure)
7658 : {
7659 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7660 0 : PyObject *py_code_page;
7661 0 : py_code_page = PyLong_FromLong((uint16_t)object->code_page);
7662 0 : return py_code_page;
7663 : }
7664 :
7665 0 : static int py_samr_UserInfo21_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
7666 : {
7667 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7668 0 : if (value == NULL) {
7669 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->code_page");
7670 0 : return -1;
7671 : }
7672 : {
7673 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->code_page));
7674 0 : if (PyLong_Check(value)) {
7675 0 : unsigned long long test_var;
7676 0 : test_var = PyLong_AsUnsignedLongLong(value);
7677 0 : if (PyErr_Occurred() != NULL) {
7678 0 : return -1;
7679 : }
7680 0 : if (test_var > uint_max) {
7681 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7682 : PyLong_Type.tp_name, uint_max, test_var);
7683 0 : return -1;
7684 : }
7685 0 : object->code_page = test_var;
7686 : } else {
7687 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7688 : PyLong_Type.tp_name);
7689 0 : return -1;
7690 : }
7691 : }
7692 0 : return 0;
7693 : }
7694 :
7695 0 : static PyObject *py_samr_UserInfo21_get_lm_password_set(PyObject *obj, void *closure)
7696 : {
7697 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7698 0 : PyObject *py_lm_password_set;
7699 0 : py_lm_password_set = PyLong_FromLong((uint16_t)object->lm_password_set);
7700 0 : return py_lm_password_set;
7701 : }
7702 :
7703 0 : static int py_samr_UserInfo21_set_lm_password_set(PyObject *py_obj, PyObject *value, void *closure)
7704 : {
7705 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7706 0 : if (value == NULL) {
7707 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password_set");
7708 0 : return -1;
7709 : }
7710 : {
7711 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lm_password_set));
7712 0 : if (PyLong_Check(value)) {
7713 0 : unsigned long long test_var;
7714 0 : test_var = PyLong_AsUnsignedLongLong(value);
7715 0 : if (PyErr_Occurred() != NULL) {
7716 0 : return -1;
7717 : }
7718 0 : if (test_var > uint_max) {
7719 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7720 : PyLong_Type.tp_name, uint_max, test_var);
7721 0 : return -1;
7722 : }
7723 0 : object->lm_password_set = test_var;
7724 : } else {
7725 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7726 : PyLong_Type.tp_name);
7727 0 : return -1;
7728 : }
7729 : }
7730 0 : return 0;
7731 : }
7732 :
7733 0 : static PyObject *py_samr_UserInfo21_get_nt_password_set(PyObject *obj, void *closure)
7734 : {
7735 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7736 0 : PyObject *py_nt_password_set;
7737 0 : py_nt_password_set = PyLong_FromLong((uint16_t)object->nt_password_set);
7738 0 : return py_nt_password_set;
7739 : }
7740 :
7741 0 : static int py_samr_UserInfo21_set_nt_password_set(PyObject *py_obj, PyObject *value, void *closure)
7742 : {
7743 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7744 0 : if (value == NULL) {
7745 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password_set");
7746 0 : return -1;
7747 : }
7748 : {
7749 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->nt_password_set));
7750 0 : if (PyLong_Check(value)) {
7751 0 : unsigned long long test_var;
7752 0 : test_var = PyLong_AsUnsignedLongLong(value);
7753 0 : if (PyErr_Occurred() != NULL) {
7754 0 : return -1;
7755 : }
7756 0 : if (test_var > uint_max) {
7757 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7758 : PyLong_Type.tp_name, uint_max, test_var);
7759 0 : return -1;
7760 : }
7761 0 : object->nt_password_set = test_var;
7762 : } else {
7763 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7764 : PyLong_Type.tp_name);
7765 0 : return -1;
7766 : }
7767 : }
7768 0 : return 0;
7769 : }
7770 :
7771 0 : static PyObject *py_samr_UserInfo21_get_password_expired(PyObject *obj, void *closure)
7772 : {
7773 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7774 0 : PyObject *py_password_expired;
7775 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
7776 0 : return py_password_expired;
7777 : }
7778 :
7779 0 : static int py_samr_UserInfo21_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
7780 : {
7781 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7782 0 : if (value == NULL) {
7783 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
7784 0 : return -1;
7785 : }
7786 : {
7787 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
7788 0 : if (PyLong_Check(value)) {
7789 0 : unsigned long long test_var;
7790 0 : test_var = PyLong_AsUnsignedLongLong(value);
7791 0 : if (PyErr_Occurred() != NULL) {
7792 0 : return -1;
7793 : }
7794 0 : if (test_var > uint_max) {
7795 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7796 : PyLong_Type.tp_name, uint_max, test_var);
7797 0 : return -1;
7798 : }
7799 0 : object->password_expired = test_var;
7800 : } else {
7801 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7802 : PyLong_Type.tp_name);
7803 0 : return -1;
7804 : }
7805 : }
7806 0 : return 0;
7807 : }
7808 :
7809 0 : static PyObject *py_samr_UserInfo21_get_private_data_sensitive(PyObject *obj, void *closure)
7810 : {
7811 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
7812 0 : PyObject *py_private_data_sensitive;
7813 0 : py_private_data_sensitive = PyLong_FromLong((uint16_t)object->private_data_sensitive);
7814 0 : return py_private_data_sensitive;
7815 : }
7816 :
7817 0 : static int py_samr_UserInfo21_set_private_data_sensitive(PyObject *py_obj, PyObject *value, void *closure)
7818 : {
7819 0 : struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
7820 0 : if (value == NULL) {
7821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->private_data_sensitive");
7822 0 : return -1;
7823 : }
7824 : {
7825 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->private_data_sensitive));
7826 0 : if (PyLong_Check(value)) {
7827 0 : unsigned long long test_var;
7828 0 : test_var = PyLong_AsUnsignedLongLong(value);
7829 0 : if (PyErr_Occurred() != NULL) {
7830 0 : return -1;
7831 : }
7832 0 : if (test_var > uint_max) {
7833 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
7834 : PyLong_Type.tp_name, uint_max, test_var);
7835 0 : return -1;
7836 : }
7837 0 : object->private_data_sensitive = test_var;
7838 : } else {
7839 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
7840 : PyLong_Type.tp_name);
7841 0 : return -1;
7842 : }
7843 : }
7844 0 : return 0;
7845 : }
7846 :
7847 : static PyGetSetDef py_samr_UserInfo21_getsetters[] = {
7848 : {
7849 : .name = discard_const_p(char, "last_logon"),
7850 : .get = py_samr_UserInfo21_get_last_logon,
7851 : .set = py_samr_UserInfo21_set_last_logon,
7852 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7853 : },
7854 : {
7855 : .name = discard_const_p(char, "last_logoff"),
7856 : .get = py_samr_UserInfo21_get_last_logoff,
7857 : .set = py_samr_UserInfo21_set_last_logoff,
7858 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7859 : },
7860 : {
7861 : .name = discard_const_p(char, "last_password_change"),
7862 : .get = py_samr_UserInfo21_get_last_password_change,
7863 : .set = py_samr_UserInfo21_set_last_password_change,
7864 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7865 : },
7866 : {
7867 : .name = discard_const_p(char, "acct_expiry"),
7868 : .get = py_samr_UserInfo21_get_acct_expiry,
7869 : .set = py_samr_UserInfo21_set_acct_expiry,
7870 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7871 : },
7872 : {
7873 : .name = discard_const_p(char, "allow_password_change"),
7874 : .get = py_samr_UserInfo21_get_allow_password_change,
7875 : .set = py_samr_UserInfo21_set_allow_password_change,
7876 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7877 : },
7878 : {
7879 : .name = discard_const_p(char, "force_password_change"),
7880 : .get = py_samr_UserInfo21_get_force_password_change,
7881 : .set = py_samr_UserInfo21_set_force_password_change,
7882 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
7883 : },
7884 : {
7885 : .name = discard_const_p(char, "account_name"),
7886 : .get = py_samr_UserInfo21_get_account_name,
7887 : .set = py_samr_UserInfo21_set_account_name,
7888 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7889 : },
7890 : {
7891 : .name = discard_const_p(char, "full_name"),
7892 : .get = py_samr_UserInfo21_get_full_name,
7893 : .set = py_samr_UserInfo21_set_full_name,
7894 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7895 : },
7896 : {
7897 : .name = discard_const_p(char, "home_directory"),
7898 : .get = py_samr_UserInfo21_get_home_directory,
7899 : .set = py_samr_UserInfo21_set_home_directory,
7900 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7901 : },
7902 : {
7903 : .name = discard_const_p(char, "home_drive"),
7904 : .get = py_samr_UserInfo21_get_home_drive,
7905 : .set = py_samr_UserInfo21_set_home_drive,
7906 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7907 : },
7908 : {
7909 : .name = discard_const_p(char, "logon_script"),
7910 : .get = py_samr_UserInfo21_get_logon_script,
7911 : .set = py_samr_UserInfo21_set_logon_script,
7912 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7913 : },
7914 : {
7915 : .name = discard_const_p(char, "profile_path"),
7916 : .get = py_samr_UserInfo21_get_profile_path,
7917 : .set = py_samr_UserInfo21_set_profile_path,
7918 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7919 : },
7920 : {
7921 : .name = discard_const_p(char, "description"),
7922 : .get = py_samr_UserInfo21_get_description,
7923 : .set = py_samr_UserInfo21_set_description,
7924 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7925 : },
7926 : {
7927 : .name = discard_const_p(char, "workstations"),
7928 : .get = py_samr_UserInfo21_get_workstations,
7929 : .set = py_samr_UserInfo21_set_workstations,
7930 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7931 : },
7932 : {
7933 : .name = discard_const_p(char, "comment"),
7934 : .get = py_samr_UserInfo21_get_comment,
7935 : .set = py_samr_UserInfo21_set_comment,
7936 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7937 : },
7938 : {
7939 : .name = discard_const_p(char, "parameters"),
7940 : .get = py_samr_UserInfo21_get_parameters,
7941 : .set = py_samr_UserInfo21_set_parameters,
7942 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
7943 : },
7944 : {
7945 : .name = discard_const_p(char, "lm_owf_password"),
7946 : .get = py_samr_UserInfo21_get_lm_owf_password,
7947 : .set = py_samr_UserInfo21_set_lm_owf_password,
7948 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
7949 : },
7950 : {
7951 : .name = discard_const_p(char, "nt_owf_password"),
7952 : .get = py_samr_UserInfo21_get_nt_owf_password,
7953 : .set = py_samr_UserInfo21_set_nt_owf_password,
7954 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_BinaryString")
7955 : },
7956 : {
7957 : .name = discard_const_p(char, "private_data"),
7958 : .get = py_samr_UserInfo21_get_private_data,
7959 : .set = py_samr_UserInfo21_set_private_data,
7960 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
7961 : },
7962 : {
7963 : .name = discard_const_p(char, "buf_count"),
7964 : .get = py_samr_UserInfo21_get_buf_count,
7965 : .set = py_samr_UserInfo21_set_buf_count,
7966 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7967 : },
7968 : {
7969 : .name = discard_const_p(char, "buffer"),
7970 : .get = py_samr_UserInfo21_get_buffer,
7971 : .set = py_samr_UserInfo21_set_buffer,
7972 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
7973 : },
7974 : {
7975 : .name = discard_const_p(char, "rid"),
7976 : .get = py_samr_UserInfo21_get_rid,
7977 : .set = py_samr_UserInfo21_set_rid,
7978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7979 : },
7980 : {
7981 : .name = discard_const_p(char, "primary_gid"),
7982 : .get = py_samr_UserInfo21_get_primary_gid,
7983 : .set = py_samr_UserInfo21_set_primary_gid,
7984 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
7985 : },
7986 : {
7987 : .name = discard_const_p(char, "acct_flags"),
7988 : .get = py_samr_UserInfo21_get_acct_flags,
7989 : .set = py_samr_UserInfo21_set_acct_flags,
7990 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
7991 : },
7992 : {
7993 : .name = discard_const_p(char, "fields_present"),
7994 : .get = py_samr_UserInfo21_get_fields_present,
7995 : .set = py_samr_UserInfo21_set_fields_present,
7996 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_FieldsPresent")
7997 : },
7998 : {
7999 : .name = discard_const_p(char, "logon_hours"),
8000 : .get = py_samr_UserInfo21_get_logon_hours,
8001 : .set = py_samr_UserInfo21_set_logon_hours,
8002 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_LogonHours")
8003 : },
8004 : {
8005 : .name = discard_const_p(char, "bad_password_count"),
8006 : .get = py_samr_UserInfo21_get_bad_password_count,
8007 : .set = py_samr_UserInfo21_set_bad_password_count,
8008 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8009 : },
8010 : {
8011 : .name = discard_const_p(char, "logon_count"),
8012 : .get = py_samr_UserInfo21_get_logon_count,
8013 : .set = py_samr_UserInfo21_set_logon_count,
8014 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8015 : },
8016 : {
8017 : .name = discard_const_p(char, "country_code"),
8018 : .get = py_samr_UserInfo21_get_country_code,
8019 : .set = py_samr_UserInfo21_set_country_code,
8020 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8021 : },
8022 : {
8023 : .name = discard_const_p(char, "code_page"),
8024 : .get = py_samr_UserInfo21_get_code_page,
8025 : .set = py_samr_UserInfo21_set_code_page,
8026 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
8027 : },
8028 : {
8029 : .name = discard_const_p(char, "lm_password_set"),
8030 : .get = py_samr_UserInfo21_get_lm_password_set,
8031 : .set = py_samr_UserInfo21_set_lm_password_set,
8032 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8033 : },
8034 : {
8035 : .name = discard_const_p(char, "nt_password_set"),
8036 : .get = py_samr_UserInfo21_get_nt_password_set,
8037 : .set = py_samr_UserInfo21_set_nt_password_set,
8038 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8039 : },
8040 : {
8041 : .name = discard_const_p(char, "password_expired"),
8042 : .get = py_samr_UserInfo21_get_password_expired,
8043 : .set = py_samr_UserInfo21_set_password_expired,
8044 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8045 : },
8046 : {
8047 : .name = discard_const_p(char, "private_data_sensitive"),
8048 : .get = py_samr_UserInfo21_get_private_data_sensitive,
8049 : .set = py_samr_UserInfo21_set_private_data_sensitive,
8050 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8051 : },
8052 : { .name = NULL }
8053 : };
8054 :
8055 0 : static PyObject *py_samr_UserInfo21_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8056 : {
8057 0 : return pytalloc_new(struct samr_UserInfo21, type);
8058 : }
8059 :
8060 :
8061 : static PyTypeObject samr_UserInfo21_Type = {
8062 : PyVarObject_HEAD_INIT(NULL, 0)
8063 : .tp_name = "samr.UserInfo21",
8064 : .tp_getset = py_samr_UserInfo21_getsetters,
8065 : .tp_methods = NULL,
8066 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8067 : .tp_new = py_samr_UserInfo21_new,
8068 : };
8069 :
8070 :
8071 0 : static PyObject *py_samr_CryptPassword_get_data(PyObject *obj, void *closure)
8072 : {
8073 0 : struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(obj);
8074 0 : PyObject *py_data;
8075 0 : py_data = PyList_New(516);
8076 0 : if (py_data == NULL) {
8077 0 : return NULL;
8078 : }
8079 : {
8080 : int data_cntr_0;
8081 0 : for (data_cntr_0 = 0; data_cntr_0 < (516); data_cntr_0++) {
8082 0 : PyObject *py_data_0;
8083 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
8084 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
8085 : }
8086 : }
8087 0 : return py_data;
8088 : }
8089 :
8090 28 : static int py_samr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure)
8091 : {
8092 28 : struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
8093 28 : if (value == NULL) {
8094 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
8095 0 : return -1;
8096 : }
8097 28 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8098 : {
8099 0 : int data_cntr_0;
8100 28 : if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) {
8101 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value));
8102 0 : return -1;
8103 : }
8104 14476 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
8105 14448 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
8106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
8107 0 : return -1;
8108 : }
8109 : {
8110 14448 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
8111 14448 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
8112 0 : unsigned long long test_var;
8113 14448 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
8114 14448 : if (PyErr_Occurred() != NULL) {
8115 0 : return -1;
8116 : }
8117 14448 : if (test_var > uint_max) {
8118 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8119 : PyLong_Type.tp_name, uint_max, test_var);
8120 0 : return -1;
8121 : }
8122 14448 : object->data[data_cntr_0] = test_var;
8123 : } else {
8124 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8125 : PyLong_Type.tp_name);
8126 0 : return -1;
8127 : }
8128 : }
8129 : }
8130 : }
8131 28 : return 0;
8132 : }
8133 :
8134 : static PyGetSetDef py_samr_CryptPassword_getsetters[] = {
8135 : {
8136 : .name = discard_const_p(char, "data"),
8137 : .get = py_samr_CryptPassword_get_data,
8138 : .set = py_samr_CryptPassword_set_data,
8139 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8140 : },
8141 : { .name = NULL }
8142 : };
8143 :
8144 18 : static PyObject *py_samr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8145 : {
8146 18 : return pytalloc_new(struct samr_CryptPassword, type);
8147 : }
8148 :
8149 0 : static PyObject *py_samr_CryptPassword_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8150 : {
8151 0 : struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
8152 0 : PyObject *ret = NULL;
8153 0 : DATA_BLOB blob;
8154 0 : enum ndr_err_code err;
8155 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
8156 0 : if (tmp_ctx == NULL) {
8157 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
8158 0 : return NULL;
8159 : }
8160 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_CryptPassword);
8161 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8162 0 : TALLOC_FREE(tmp_ctx);
8163 0 : PyErr_SetNdrError(err);
8164 0 : return NULL;
8165 : }
8166 :
8167 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
8168 0 : TALLOC_FREE(tmp_ctx);
8169 0 : return ret;
8170 : }
8171 :
8172 0 : static PyObject *py_samr_CryptPassword_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
8173 : {
8174 0 : struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
8175 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
8176 0 : Py_ssize_t blob_length = 0;
8177 0 : enum ndr_err_code err;
8178 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
8179 0 : PyObject *allow_remaining_obj = NULL;
8180 0 : bool allow_remaining = false;
8181 :
8182 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
8183 : discard_const_p(char *, kwnames),
8184 : &blob.data, &blob_length,
8185 : &allow_remaining_obj)) {
8186 0 : return NULL;
8187 : }
8188 0 : blob.length = blob_length;
8189 :
8190 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
8191 0 : allow_remaining = true;
8192 : }
8193 :
8194 0 : if (allow_remaining) {
8195 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword);
8196 : } else {
8197 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword);
8198 : }
8199 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
8200 0 : PyErr_SetNdrError(err);
8201 0 : return NULL;
8202 : }
8203 :
8204 0 : Py_RETURN_NONE;
8205 : }
8206 :
8207 0 : static PyObject *py_samr_CryptPassword_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
8208 : {
8209 0 : struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
8210 0 : PyObject *ret;
8211 0 : char *retstr;
8212 :
8213 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_CryptPassword, "samr_CryptPassword", object);
8214 0 : ret = PyUnicode_FromString(retstr);
8215 0 : talloc_free(retstr);
8216 :
8217 0 : return ret;
8218 : }
8219 :
8220 : static PyMethodDef py_samr_CryptPassword_methods[] = {
8221 : { "__ndr_pack__", (PyCFunction)py_samr_CryptPassword_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
8222 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CryptPassword_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
8223 : { "__ndr_print__", (PyCFunction)py_samr_CryptPassword_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
8224 : { NULL, NULL, 0, NULL }
8225 : };
8226 :
8227 :
8228 : static PyTypeObject samr_CryptPassword_Type = {
8229 : PyVarObject_HEAD_INIT(NULL, 0)
8230 : .tp_name = "samr.CryptPassword",
8231 : .tp_getset = py_samr_CryptPassword_getsetters,
8232 : .tp_methods = py_samr_CryptPassword_methods,
8233 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8234 : .tp_new = py_samr_CryptPassword_new,
8235 : };
8236 :
8237 :
8238 0 : static PyObject *py_samr_UserInfo23_get_info(PyObject *obj, void *closure)
8239 : {
8240 0 : struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj);
8241 0 : PyObject *py_info;
8242 0 : py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
8243 0 : return py_info;
8244 : }
8245 :
8246 0 : static int py_samr_UserInfo23_set_info(PyObject *py_obj, PyObject *value, void *closure)
8247 : {
8248 0 : struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj);
8249 0 : if (value == NULL) {
8250 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
8251 0 : return -1;
8252 : }
8253 0 : PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;);
8254 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8255 0 : PyErr_NoMemory();
8256 0 : return -1;
8257 : }
8258 0 : object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
8259 0 : return 0;
8260 : }
8261 :
8262 0 : static PyObject *py_samr_UserInfo23_get_password(PyObject *obj, void *closure)
8263 : {
8264 0 : struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj);
8265 0 : PyObject *py_password;
8266 0 : py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password);
8267 0 : return py_password;
8268 : }
8269 :
8270 0 : static int py_samr_UserInfo23_set_password(PyObject *py_obj, PyObject *value, void *closure)
8271 : {
8272 0 : struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj);
8273 0 : if (value == NULL) {
8274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
8275 0 : return -1;
8276 : }
8277 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
8278 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8279 0 : PyErr_NoMemory();
8280 0 : return -1;
8281 : }
8282 0 : object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
8283 0 : return 0;
8284 : }
8285 :
8286 : static PyGetSetDef py_samr_UserInfo23_getsetters[] = {
8287 : {
8288 : .name = discard_const_p(char, "info"),
8289 : .get = py_samr_UserInfo23_get_info,
8290 : .set = py_samr_UserInfo23_set_info,
8291 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo21")
8292 : },
8293 : {
8294 : .name = discard_const_p(char, "password"),
8295 : .get = py_samr_UserInfo23_get_password,
8296 : .set = py_samr_UserInfo23_set_password,
8297 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
8298 : },
8299 : { .name = NULL }
8300 : };
8301 :
8302 0 : static PyObject *py_samr_UserInfo23_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8303 : {
8304 0 : return pytalloc_new(struct samr_UserInfo23, type);
8305 : }
8306 :
8307 :
8308 : static PyTypeObject samr_UserInfo23_Type = {
8309 : PyVarObject_HEAD_INIT(NULL, 0)
8310 : .tp_name = "samr.UserInfo23",
8311 : .tp_getset = py_samr_UserInfo23_getsetters,
8312 : .tp_methods = NULL,
8313 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8314 : .tp_new = py_samr_UserInfo23_new,
8315 : };
8316 :
8317 :
8318 0 : static PyObject *py_samr_UserInfo24_get_password(PyObject *obj, void *closure)
8319 : {
8320 0 : struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj);
8321 0 : PyObject *py_password;
8322 0 : py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password);
8323 0 : return py_password;
8324 : }
8325 :
8326 4 : static int py_samr_UserInfo24_set_password(PyObject *py_obj, PyObject *value, void *closure)
8327 : {
8328 4 : struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj);
8329 4 : if (value == NULL) {
8330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
8331 0 : return -1;
8332 : }
8333 4 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
8334 4 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8335 0 : PyErr_NoMemory();
8336 0 : return -1;
8337 : }
8338 4 : object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
8339 4 : return 0;
8340 : }
8341 :
8342 0 : static PyObject *py_samr_UserInfo24_get_password_expired(PyObject *obj, void *closure)
8343 : {
8344 0 : struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj);
8345 0 : PyObject *py_password_expired;
8346 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
8347 0 : return py_password_expired;
8348 : }
8349 :
8350 4 : static int py_samr_UserInfo24_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
8351 : {
8352 4 : struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj);
8353 4 : if (value == NULL) {
8354 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
8355 0 : return -1;
8356 : }
8357 : {
8358 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
8359 4 : if (PyLong_Check(value)) {
8360 0 : unsigned long long test_var;
8361 4 : test_var = PyLong_AsUnsignedLongLong(value);
8362 4 : if (PyErr_Occurred() != NULL) {
8363 0 : return -1;
8364 : }
8365 4 : if (test_var > uint_max) {
8366 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8367 : PyLong_Type.tp_name, uint_max, test_var);
8368 0 : return -1;
8369 : }
8370 4 : object->password_expired = test_var;
8371 : } else {
8372 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8373 : PyLong_Type.tp_name);
8374 0 : return -1;
8375 : }
8376 : }
8377 4 : return 0;
8378 : }
8379 :
8380 : static PyGetSetDef py_samr_UserInfo24_getsetters[] = {
8381 : {
8382 : .name = discard_const_p(char, "password"),
8383 : .get = py_samr_UserInfo24_get_password,
8384 : .set = py_samr_UserInfo24_set_password,
8385 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
8386 : },
8387 : {
8388 : .name = discard_const_p(char, "password_expired"),
8389 : .get = py_samr_UserInfo24_get_password_expired,
8390 : .set = py_samr_UserInfo24_set_password_expired,
8391 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8392 : },
8393 : { .name = NULL }
8394 : };
8395 :
8396 4 : static PyObject *py_samr_UserInfo24_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8397 : {
8398 4 : return pytalloc_new(struct samr_UserInfo24, type);
8399 : }
8400 :
8401 :
8402 : static PyTypeObject samr_UserInfo24_Type = {
8403 : PyVarObject_HEAD_INIT(NULL, 0)
8404 : .tp_name = "samr.UserInfo24",
8405 : .tp_getset = py_samr_UserInfo24_getsetters,
8406 : .tp_methods = NULL,
8407 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8408 : .tp_new = py_samr_UserInfo24_new,
8409 : };
8410 :
8411 :
8412 0 : static PyObject *py_samr_CryptPasswordEx_get_data(PyObject *obj, void *closure)
8413 : {
8414 0 : struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(obj);
8415 0 : PyObject *py_data;
8416 0 : py_data = PyList_New(532);
8417 0 : if (py_data == NULL) {
8418 0 : return NULL;
8419 : }
8420 : {
8421 : int data_cntr_0;
8422 0 : for (data_cntr_0 = 0; data_cntr_0 < (532); data_cntr_0++) {
8423 0 : PyObject *py_data_0;
8424 0 : py_data_0 = PyLong_FromLong((uint16_t)object->data[data_cntr_0]);
8425 0 : PyList_SetItem(py_data, data_cntr_0, py_data_0);
8426 : }
8427 : }
8428 0 : return py_data;
8429 : }
8430 :
8431 0 : static int py_samr_CryptPasswordEx_set_data(PyObject *py_obj, PyObject *value, void *closure)
8432 : {
8433 0 : struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(py_obj);
8434 0 : if (value == NULL) {
8435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
8436 0 : return -1;
8437 : }
8438 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8439 : {
8440 0 : int data_cntr_0;
8441 0 : if (ARRAY_SIZE(object->data) != PyList_GET_SIZE(value)) {
8442 0 : PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->data), PyList_GET_SIZE(value));
8443 0 : return -1;
8444 : }
8445 0 : for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
8446 0 : if (PyList_GET_ITEM(value, data_cntr_0) == NULL) {
8447 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_0]");
8448 0 : return -1;
8449 : }
8450 : {
8451 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_0]));
8452 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_0))) {
8453 0 : unsigned long long test_var;
8454 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_0));
8455 0 : if (PyErr_Occurred() != NULL) {
8456 0 : return -1;
8457 : }
8458 0 : if (test_var > uint_max) {
8459 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8460 : PyLong_Type.tp_name, uint_max, test_var);
8461 0 : return -1;
8462 : }
8463 0 : object->data[data_cntr_0] = test_var;
8464 : } else {
8465 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8466 : PyLong_Type.tp_name);
8467 0 : return -1;
8468 : }
8469 : }
8470 : }
8471 : }
8472 0 : return 0;
8473 : }
8474 :
8475 : static PyGetSetDef py_samr_CryptPasswordEx_getsetters[] = {
8476 : {
8477 : .name = discard_const_p(char, "data"),
8478 : .get = py_samr_CryptPasswordEx_get_data,
8479 : .set = py_samr_CryptPasswordEx_set_data,
8480 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8481 : },
8482 : { .name = NULL }
8483 : };
8484 :
8485 0 : static PyObject *py_samr_CryptPasswordEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8486 : {
8487 0 : return pytalloc_new(struct samr_CryptPasswordEx, type);
8488 : }
8489 :
8490 :
8491 : static PyTypeObject samr_CryptPasswordEx_Type = {
8492 : PyVarObject_HEAD_INIT(NULL, 0)
8493 : .tp_name = "samr.CryptPasswordEx",
8494 : .tp_getset = py_samr_CryptPasswordEx_getsetters,
8495 : .tp_methods = NULL,
8496 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8497 : .tp_new = py_samr_CryptPasswordEx_new,
8498 : };
8499 :
8500 :
8501 0 : static PyObject *py_samr_UserInfo25_get_info(PyObject *obj, void *closure)
8502 : {
8503 0 : struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj);
8504 0 : PyObject *py_info;
8505 0 : py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
8506 0 : return py_info;
8507 : }
8508 :
8509 0 : static int py_samr_UserInfo25_set_info(PyObject *py_obj, PyObject *value, void *closure)
8510 : {
8511 0 : struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj);
8512 0 : if (value == NULL) {
8513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
8514 0 : return -1;
8515 : }
8516 0 : PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;);
8517 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8518 0 : PyErr_NoMemory();
8519 0 : return -1;
8520 : }
8521 0 : object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
8522 0 : return 0;
8523 : }
8524 :
8525 0 : static PyObject *py_samr_UserInfo25_get_password(PyObject *obj, void *closure)
8526 : {
8527 0 : struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj);
8528 0 : PyObject *py_password;
8529 0 : py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password);
8530 0 : return py_password;
8531 : }
8532 :
8533 0 : static int py_samr_UserInfo25_set_password(PyObject *py_obj, PyObject *value, void *closure)
8534 : {
8535 0 : struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj);
8536 0 : if (value == NULL) {
8537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
8538 0 : return -1;
8539 : }
8540 0 : PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;);
8541 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8542 0 : PyErr_NoMemory();
8543 0 : return -1;
8544 : }
8545 0 : object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
8546 0 : return 0;
8547 : }
8548 :
8549 : static PyGetSetDef py_samr_UserInfo25_getsetters[] = {
8550 : {
8551 : .name = discard_const_p(char, "info"),
8552 : .get = py_samr_UserInfo25_get_info,
8553 : .set = py_samr_UserInfo25_set_info,
8554 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo21")
8555 : },
8556 : {
8557 : .name = discard_const_p(char, "password"),
8558 : .get = py_samr_UserInfo25_get_password,
8559 : .set = py_samr_UserInfo25_set_password,
8560 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPasswordEx")
8561 : },
8562 : { .name = NULL }
8563 : };
8564 :
8565 0 : static PyObject *py_samr_UserInfo25_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8566 : {
8567 0 : return pytalloc_new(struct samr_UserInfo25, type);
8568 : }
8569 :
8570 :
8571 : static PyTypeObject samr_UserInfo25_Type = {
8572 : PyVarObject_HEAD_INIT(NULL, 0)
8573 : .tp_name = "samr.UserInfo25",
8574 : .tp_getset = py_samr_UserInfo25_getsetters,
8575 : .tp_methods = NULL,
8576 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8577 : .tp_new = py_samr_UserInfo25_new,
8578 : };
8579 :
8580 :
8581 0 : static PyObject *py_samr_UserInfo26_get_password(PyObject *obj, void *closure)
8582 : {
8583 0 : struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj);
8584 0 : PyObject *py_password;
8585 0 : py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password);
8586 0 : return py_password;
8587 : }
8588 :
8589 0 : static int py_samr_UserInfo26_set_password(PyObject *py_obj, PyObject *value, void *closure)
8590 : {
8591 0 : struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj);
8592 0 : if (value == NULL) {
8593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
8594 0 : return -1;
8595 : }
8596 0 : PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;);
8597 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
8598 0 : PyErr_NoMemory();
8599 0 : return -1;
8600 : }
8601 0 : object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
8602 0 : return 0;
8603 : }
8604 :
8605 0 : static PyObject *py_samr_UserInfo26_get_password_expired(PyObject *obj, void *closure)
8606 : {
8607 0 : struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj);
8608 0 : PyObject *py_password_expired;
8609 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
8610 0 : return py_password_expired;
8611 : }
8612 :
8613 0 : static int py_samr_UserInfo26_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
8614 : {
8615 0 : struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj);
8616 0 : if (value == NULL) {
8617 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
8618 0 : return -1;
8619 : }
8620 : {
8621 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
8622 0 : if (PyLong_Check(value)) {
8623 0 : unsigned long long test_var;
8624 0 : test_var = PyLong_AsUnsignedLongLong(value);
8625 0 : if (PyErr_Occurred() != NULL) {
8626 0 : return -1;
8627 : }
8628 0 : if (test_var > uint_max) {
8629 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8630 : PyLong_Type.tp_name, uint_max, test_var);
8631 0 : return -1;
8632 : }
8633 0 : object->password_expired = test_var;
8634 : } else {
8635 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8636 : PyLong_Type.tp_name);
8637 0 : return -1;
8638 : }
8639 : }
8640 0 : return 0;
8641 : }
8642 :
8643 : static PyGetSetDef py_samr_UserInfo26_getsetters[] = {
8644 : {
8645 : .name = discard_const_p(char, "password"),
8646 : .get = py_samr_UserInfo26_get_password,
8647 : .set = py_samr_UserInfo26_set_password,
8648 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPasswordEx")
8649 : },
8650 : {
8651 : .name = discard_const_p(char, "password_expired"),
8652 : .get = py_samr_UserInfo26_get_password_expired,
8653 : .set = py_samr_UserInfo26_set_password_expired,
8654 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8655 : },
8656 : { .name = NULL }
8657 : };
8658 :
8659 0 : static PyObject *py_samr_UserInfo26_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8660 : {
8661 0 : return pytalloc_new(struct samr_UserInfo26, type);
8662 : }
8663 :
8664 :
8665 : static PyTypeObject samr_UserInfo26_Type = {
8666 : PyVarObject_HEAD_INIT(NULL, 0)
8667 : .tp_name = "samr.UserInfo26",
8668 : .tp_getset = py_samr_UserInfo26_getsetters,
8669 : .tp_methods = NULL,
8670 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8671 : .tp_new = py_samr_UserInfo26_new,
8672 : };
8673 :
8674 :
8675 0 : static PyObject *py_samr_EncryptedPasswordAES_get_auth_data(PyObject *obj, void *closure)
8676 : {
8677 0 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(obj);
8678 0 : PyObject *py_auth_data;
8679 0 : py_auth_data = PyList_New(64);
8680 0 : if (py_auth_data == NULL) {
8681 0 : return NULL;
8682 : }
8683 : {
8684 : int auth_data_cntr_0;
8685 0 : for (auth_data_cntr_0 = 0; auth_data_cntr_0 < (64); auth_data_cntr_0++) {
8686 0 : PyObject *py_auth_data_0;
8687 0 : py_auth_data_0 = PyLong_FromLong((uint16_t)object->auth_data[auth_data_cntr_0]);
8688 0 : PyList_SetItem(py_auth_data, auth_data_cntr_0, py_auth_data_0);
8689 : }
8690 : }
8691 0 : return py_auth_data;
8692 : }
8693 :
8694 2 : static int py_samr_EncryptedPasswordAES_set_auth_data(PyObject *py_obj, PyObject *value, void *closure)
8695 : {
8696 2 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_obj);
8697 2 : if (value == NULL) {
8698 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_data");
8699 0 : return -1;
8700 : }
8701 2 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8702 : {
8703 0 : int auth_data_cntr_0;
8704 2 : if (ARRAY_SIZE(object->auth_data) != PyList_GET_SIZE(value)) {
8705 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));
8706 0 : return -1;
8707 : }
8708 130 : for (auth_data_cntr_0 = 0; auth_data_cntr_0 < PyList_GET_SIZE(value); auth_data_cntr_0++) {
8709 128 : if (PyList_GET_ITEM(value, auth_data_cntr_0) == NULL) {
8710 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->auth_data[auth_data_cntr_0]");
8711 0 : return -1;
8712 : }
8713 : {
8714 128 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->auth_data[auth_data_cntr_0]));
8715 128 : if (PyLong_Check(PyList_GET_ITEM(value, auth_data_cntr_0))) {
8716 0 : unsigned long long test_var;
8717 128 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, auth_data_cntr_0));
8718 128 : if (PyErr_Occurred() != NULL) {
8719 0 : return -1;
8720 : }
8721 128 : if (test_var > uint_max) {
8722 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8723 : PyLong_Type.tp_name, uint_max, test_var);
8724 0 : return -1;
8725 : }
8726 128 : object->auth_data[auth_data_cntr_0] = test_var;
8727 : } else {
8728 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8729 : PyLong_Type.tp_name);
8730 0 : return -1;
8731 : }
8732 : }
8733 : }
8734 : }
8735 2 : return 0;
8736 : }
8737 :
8738 0 : static PyObject *py_samr_EncryptedPasswordAES_get_salt(PyObject *obj, void *closure)
8739 : {
8740 0 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(obj);
8741 0 : PyObject *py_salt;
8742 0 : py_salt = PyList_New(16);
8743 0 : if (py_salt == NULL) {
8744 0 : return NULL;
8745 : }
8746 : {
8747 : int salt_cntr_0;
8748 0 : for (salt_cntr_0 = 0; salt_cntr_0 < (16); salt_cntr_0++) {
8749 0 : PyObject *py_salt_0;
8750 0 : py_salt_0 = PyLong_FromLong((uint16_t)object->salt[salt_cntr_0]);
8751 0 : PyList_SetItem(py_salt, salt_cntr_0, py_salt_0);
8752 : }
8753 : }
8754 0 : return py_salt;
8755 : }
8756 :
8757 2 : static int py_samr_EncryptedPasswordAES_set_salt(PyObject *py_obj, PyObject *value, void *closure)
8758 : {
8759 2 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_obj);
8760 2 : if (value == NULL) {
8761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->salt");
8762 0 : return -1;
8763 : }
8764 2 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8765 : {
8766 0 : int salt_cntr_0;
8767 2 : if (ARRAY_SIZE(object->salt) != PyList_GET_SIZE(value)) {
8768 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));
8769 0 : return -1;
8770 : }
8771 34 : for (salt_cntr_0 = 0; salt_cntr_0 < PyList_GET_SIZE(value); salt_cntr_0++) {
8772 32 : if (PyList_GET_ITEM(value, salt_cntr_0) == NULL) {
8773 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->salt[salt_cntr_0]");
8774 0 : return -1;
8775 : }
8776 : {
8777 32 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->salt[salt_cntr_0]));
8778 32 : if (PyLong_Check(PyList_GET_ITEM(value, salt_cntr_0))) {
8779 0 : unsigned long long test_var;
8780 32 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, salt_cntr_0));
8781 32 : if (PyErr_Occurred() != NULL) {
8782 0 : return -1;
8783 : }
8784 32 : if (test_var > uint_max) {
8785 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8786 : PyLong_Type.tp_name, uint_max, test_var);
8787 0 : return -1;
8788 : }
8789 32 : object->salt[salt_cntr_0] = test_var;
8790 : } else {
8791 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8792 : PyLong_Type.tp_name);
8793 0 : return -1;
8794 : }
8795 : }
8796 : }
8797 : }
8798 2 : return 0;
8799 : }
8800 :
8801 0 : static PyObject *py_samr_EncryptedPasswordAES_get_cipher_len(PyObject *obj, void *closure)
8802 : {
8803 0 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(obj);
8804 0 : PyObject *py_cipher_len;
8805 0 : py_cipher_len = PyLong_FromUnsignedLongLong((uint32_t)object->cipher_len);
8806 0 : return py_cipher_len;
8807 : }
8808 :
8809 2 : static int py_samr_EncryptedPasswordAES_set_cipher_len(PyObject *py_obj, PyObject *value, void *closure)
8810 : {
8811 2 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_obj);
8812 2 : if (value == NULL) {
8813 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher_len");
8814 0 : return -1;
8815 : }
8816 : {
8817 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cipher_len));
8818 2 : if (PyLong_Check(value)) {
8819 0 : unsigned long long test_var;
8820 2 : test_var = PyLong_AsUnsignedLongLong(value);
8821 2 : if (PyErr_Occurred() != NULL) {
8822 0 : return -1;
8823 : }
8824 2 : if (test_var > uint_max) {
8825 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8826 : PyLong_Type.tp_name, uint_max, test_var);
8827 0 : return -1;
8828 : }
8829 2 : object->cipher_len = test_var;
8830 : } else {
8831 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8832 : PyLong_Type.tp_name);
8833 0 : return -1;
8834 : }
8835 : }
8836 2 : return 0;
8837 : }
8838 :
8839 0 : static PyObject *py_samr_EncryptedPasswordAES_get_cipher(PyObject *obj, void *closure)
8840 : {
8841 0 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(obj);
8842 0 : PyObject *py_cipher;
8843 0 : if (object->cipher == NULL) {
8844 0 : Py_RETURN_NONE;
8845 : }
8846 0 : if (object->cipher == NULL) {
8847 0 : py_cipher = Py_None;
8848 0 : Py_INCREF(py_cipher);
8849 : } else {
8850 0 : py_cipher = PyList_New(object->cipher_len);
8851 0 : if (py_cipher == NULL) {
8852 0 : return NULL;
8853 : }
8854 : {
8855 : int cipher_cntr_1;
8856 0 : for (cipher_cntr_1 = 0; cipher_cntr_1 < (object->cipher_len); cipher_cntr_1++) {
8857 0 : PyObject *py_cipher_1;
8858 0 : py_cipher_1 = PyLong_FromLong((uint16_t)object->cipher[cipher_cntr_1]);
8859 0 : PyList_SetItem(py_cipher, cipher_cntr_1, py_cipher_1);
8860 : }
8861 : }
8862 : }
8863 0 : return py_cipher;
8864 : }
8865 :
8866 2 : static int py_samr_EncryptedPasswordAES_set_cipher(PyObject *py_obj, PyObject *value, void *closure)
8867 : {
8868 2 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_obj);
8869 2 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->cipher));
8870 2 : if (value == NULL) {
8871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher");
8872 0 : return -1;
8873 : }
8874 2 : if (value == Py_None) {
8875 0 : object->cipher = NULL;
8876 : } else {
8877 2 : object->cipher = NULL;
8878 2 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
8879 : {
8880 0 : int cipher_cntr_1;
8881 2 : object->cipher = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->cipher, PyList_GET_SIZE(value));
8882 2 : if (!object->cipher) { return -1; }
8883 2 : talloc_set_name_const(object->cipher, "ARRAY: object->cipher");
8884 162 : for (cipher_cntr_1 = 0; cipher_cntr_1 < PyList_GET_SIZE(value); cipher_cntr_1++) {
8885 160 : if (PyList_GET_ITEM(value, cipher_cntr_1) == NULL) {
8886 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->cipher[cipher_cntr_1]");
8887 0 : return -1;
8888 : }
8889 : {
8890 160 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cipher[cipher_cntr_1]));
8891 160 : if (PyLong_Check(PyList_GET_ITEM(value, cipher_cntr_1))) {
8892 0 : unsigned long long test_var;
8893 160 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, cipher_cntr_1));
8894 160 : if (PyErr_Occurred() != NULL) {
8895 0 : return -1;
8896 : }
8897 160 : if (test_var > uint_max) {
8898 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8899 : PyLong_Type.tp_name, uint_max, test_var);
8900 0 : return -1;
8901 : }
8902 160 : object->cipher[cipher_cntr_1] = test_var;
8903 : } else {
8904 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8905 : PyLong_Type.tp_name);
8906 0 : return -1;
8907 : }
8908 : }
8909 : }
8910 : }
8911 : }
8912 2 : return 0;
8913 : }
8914 :
8915 0 : static PyObject *py_samr_EncryptedPasswordAES_get_PBKDF2Iterations(PyObject *obj, void *closure)
8916 : {
8917 0 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(obj);
8918 0 : PyObject *py_PBKDF2Iterations;
8919 0 : py_PBKDF2Iterations = PyLong_FromUnsignedLongLong(object->PBKDF2Iterations);
8920 0 : return py_PBKDF2Iterations;
8921 : }
8922 :
8923 2 : static int py_samr_EncryptedPasswordAES_set_PBKDF2Iterations(PyObject *py_obj, PyObject *value, void *closure)
8924 : {
8925 2 : struct samr_EncryptedPasswordAES *object = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_obj);
8926 2 : if (value == NULL) {
8927 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->PBKDF2Iterations");
8928 0 : return -1;
8929 : }
8930 : {
8931 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PBKDF2Iterations));
8932 2 : if (PyLong_Check(value)) {
8933 0 : unsigned long long test_var;
8934 2 : test_var = PyLong_AsUnsignedLongLong(value);
8935 2 : if (PyErr_Occurred() != NULL) {
8936 0 : return -1;
8937 : }
8938 2 : if (test_var > uint_max) {
8939 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
8940 : PyLong_Type.tp_name, uint_max, test_var);
8941 0 : return -1;
8942 : }
8943 2 : object->PBKDF2Iterations = test_var;
8944 : } else {
8945 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
8946 : PyLong_Type.tp_name);
8947 0 : return -1;
8948 : }
8949 : }
8950 2 : return 0;
8951 : }
8952 :
8953 : static PyGetSetDef py_samr_EncryptedPasswordAES_getsetters[] = {
8954 : {
8955 : .name = discard_const_p(char, "auth_data"),
8956 : .get = py_samr_EncryptedPasswordAES_get_auth_data,
8957 : .set = py_samr_EncryptedPasswordAES_set_auth_data,
8958 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8959 : },
8960 : {
8961 : .name = discard_const_p(char, "salt"),
8962 : .get = py_samr_EncryptedPasswordAES_get_salt,
8963 : .set = py_samr_EncryptedPasswordAES_set_salt,
8964 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8965 : },
8966 : {
8967 : .name = discard_const_p(char, "cipher_len"),
8968 : .get = py_samr_EncryptedPasswordAES_get_cipher_len,
8969 : .set = py_samr_EncryptedPasswordAES_set_cipher_len,
8970 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
8971 : },
8972 : {
8973 : .name = discard_const_p(char, "cipher"),
8974 : .get = py_samr_EncryptedPasswordAES_get_cipher,
8975 : .set = py_samr_EncryptedPasswordAES_set_cipher,
8976 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
8977 : },
8978 : {
8979 : .name = discard_const_p(char, "PBKDF2Iterations"),
8980 : .get = py_samr_EncryptedPasswordAES_get_PBKDF2Iterations,
8981 : .set = py_samr_EncryptedPasswordAES_set_PBKDF2Iterations,
8982 : .doc = discard_const_p(char, "PIDL-generated element of base type hyper")
8983 : },
8984 : { .name = NULL }
8985 : };
8986 :
8987 2 : static PyObject *py_samr_EncryptedPasswordAES_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
8988 : {
8989 2 : return pytalloc_new(struct samr_EncryptedPasswordAES, type);
8990 : }
8991 :
8992 :
8993 : static PyTypeObject samr_EncryptedPasswordAES_Type = {
8994 : PyVarObject_HEAD_INIT(NULL, 0)
8995 : .tp_name = "samr.EncryptedPasswordAES",
8996 : .tp_getset = py_samr_EncryptedPasswordAES_getsetters,
8997 : .tp_methods = NULL,
8998 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
8999 : .tp_new = py_samr_EncryptedPasswordAES_new,
9000 : };
9001 :
9002 :
9003 0 : static PyObject *py_samr_UserInfo31_get_password(PyObject *obj, void *closure)
9004 : {
9005 0 : struct samr_UserInfo31 *object = (struct samr_UserInfo31 *)pytalloc_get_ptr(obj);
9006 0 : PyObject *py_password;
9007 0 : py_password = pytalloc_reference_ex(&samr_EncryptedPasswordAES_Type, pytalloc_get_mem_ctx(obj), &object->password);
9008 0 : return py_password;
9009 : }
9010 :
9011 0 : static int py_samr_UserInfo31_set_password(PyObject *py_obj, PyObject *value, void *closure)
9012 : {
9013 0 : struct samr_UserInfo31 *object = (struct samr_UserInfo31 *)pytalloc_get_ptr(py_obj);
9014 0 : if (value == NULL) {
9015 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
9016 0 : return -1;
9017 : }
9018 0 : PY_CHECK_TYPE(&samr_EncryptedPasswordAES_Type, value, return -1;);
9019 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9020 0 : PyErr_NoMemory();
9021 0 : return -1;
9022 : }
9023 0 : object->password = *(struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(value);
9024 0 : return 0;
9025 : }
9026 :
9027 0 : static PyObject *py_samr_UserInfo31_get_password_expired(PyObject *obj, void *closure)
9028 : {
9029 0 : struct samr_UserInfo31 *object = (struct samr_UserInfo31 *)pytalloc_get_ptr(obj);
9030 0 : PyObject *py_password_expired;
9031 0 : py_password_expired = PyLong_FromLong((uint16_t)object->password_expired);
9032 0 : return py_password_expired;
9033 : }
9034 :
9035 0 : static int py_samr_UserInfo31_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
9036 : {
9037 0 : struct samr_UserInfo31 *object = (struct samr_UserInfo31 *)pytalloc_get_ptr(py_obj);
9038 0 : if (value == NULL) {
9039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_expired");
9040 0 : return -1;
9041 : }
9042 : {
9043 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_expired));
9044 0 : if (PyLong_Check(value)) {
9045 0 : unsigned long long test_var;
9046 0 : test_var = PyLong_AsUnsignedLongLong(value);
9047 0 : if (PyErr_Occurred() != NULL) {
9048 0 : return -1;
9049 : }
9050 0 : if (test_var > uint_max) {
9051 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9052 : PyLong_Type.tp_name, uint_max, test_var);
9053 0 : return -1;
9054 : }
9055 0 : object->password_expired = test_var;
9056 : } else {
9057 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9058 : PyLong_Type.tp_name);
9059 0 : return -1;
9060 : }
9061 : }
9062 0 : return 0;
9063 : }
9064 :
9065 : static PyGetSetDef py_samr_UserInfo31_getsetters[] = {
9066 : {
9067 : .name = discard_const_p(char, "password"),
9068 : .get = py_samr_UserInfo31_get_password,
9069 : .set = py_samr_UserInfo31_set_password,
9070 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_EncryptedPasswordAES")
9071 : },
9072 : {
9073 : .name = discard_const_p(char, "password_expired"),
9074 : .get = py_samr_UserInfo31_get_password_expired,
9075 : .set = py_samr_UserInfo31_set_password_expired,
9076 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
9077 : },
9078 : { .name = NULL }
9079 : };
9080 :
9081 0 : static PyObject *py_samr_UserInfo31_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9082 : {
9083 0 : return pytalloc_new(struct samr_UserInfo31, type);
9084 : }
9085 :
9086 :
9087 : static PyTypeObject samr_UserInfo31_Type = {
9088 : PyVarObject_HEAD_INIT(NULL, 0)
9089 : .tp_name = "samr.UserInfo31",
9090 : .tp_getset = py_samr_UserInfo31_getsetters,
9091 : .tp_methods = NULL,
9092 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9093 : .tp_new = py_samr_UserInfo31_new,
9094 : };
9095 :
9096 :
9097 0 : static PyObject *py_samr_UserInfo32_get_info(PyObject *obj, void *closure)
9098 : {
9099 0 : struct samr_UserInfo32 *object = (struct samr_UserInfo32 *)pytalloc_get_ptr(obj);
9100 0 : PyObject *py_info;
9101 0 : py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
9102 0 : return py_info;
9103 : }
9104 :
9105 0 : static int py_samr_UserInfo32_set_info(PyObject *py_obj, PyObject *value, void *closure)
9106 : {
9107 0 : struct samr_UserInfo32 *object = (struct samr_UserInfo32 *)pytalloc_get_ptr(py_obj);
9108 0 : if (value == NULL) {
9109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
9110 0 : return -1;
9111 : }
9112 0 : PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;);
9113 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9114 0 : PyErr_NoMemory();
9115 0 : return -1;
9116 : }
9117 0 : object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
9118 0 : return 0;
9119 : }
9120 :
9121 0 : static PyObject *py_samr_UserInfo32_get_password(PyObject *obj, void *closure)
9122 : {
9123 0 : struct samr_UserInfo32 *object = (struct samr_UserInfo32 *)pytalloc_get_ptr(obj);
9124 0 : PyObject *py_password;
9125 0 : py_password = pytalloc_reference_ex(&samr_EncryptedPasswordAES_Type, pytalloc_get_mem_ctx(obj), &object->password);
9126 0 : return py_password;
9127 : }
9128 :
9129 0 : static int py_samr_UserInfo32_set_password(PyObject *py_obj, PyObject *value, void *closure)
9130 : {
9131 0 : struct samr_UserInfo32 *object = (struct samr_UserInfo32 *)pytalloc_get_ptr(py_obj);
9132 0 : if (value == NULL) {
9133 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
9134 0 : return -1;
9135 : }
9136 0 : PY_CHECK_TYPE(&samr_EncryptedPasswordAES_Type, value, return -1;);
9137 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
9138 0 : PyErr_NoMemory();
9139 0 : return -1;
9140 : }
9141 0 : object->password = *(struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(value);
9142 0 : return 0;
9143 : }
9144 :
9145 : static PyGetSetDef py_samr_UserInfo32_getsetters[] = {
9146 : {
9147 : .name = discard_const_p(char, "info"),
9148 : .get = py_samr_UserInfo32_get_info,
9149 : .set = py_samr_UserInfo32_set_info,
9150 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo21")
9151 : },
9152 : {
9153 : .name = discard_const_p(char, "password"),
9154 : .get = py_samr_UserInfo32_get_password,
9155 : .set = py_samr_UserInfo32_set_password,
9156 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_EncryptedPasswordAES")
9157 : },
9158 : { .name = NULL }
9159 : };
9160 :
9161 0 : static PyObject *py_samr_UserInfo32_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9162 : {
9163 0 : return pytalloc_new(struct samr_UserInfo32, type);
9164 : }
9165 :
9166 :
9167 : static PyTypeObject samr_UserInfo32_Type = {
9168 : PyVarObject_HEAD_INIT(NULL, 0)
9169 : .tp_name = "samr.UserInfo32",
9170 : .tp_getset = py_samr_UserInfo32_getsetters,
9171 : .tp_methods = NULL,
9172 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9173 : .tp_new = py_samr_UserInfo32_new,
9174 : };
9175 :
9176 3278 : static PyObject *py_import_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, union samr_UserInfo *in)
9177 : {
9178 0 : PyObject *ret;
9179 :
9180 3278 : switch (level) {
9181 5 : case 1:
9182 5 : ret = pytalloc_reference_ex(&samr_UserInfo1_Type, mem_ctx, &in->info1);
9183 5 : return ret;
9184 :
9185 0 : case 2:
9186 0 : ret = pytalloc_reference_ex(&samr_UserInfo2_Type, mem_ctx, &in->info2);
9187 0 : return ret;
9188 :
9189 814 : case 3:
9190 814 : ret = pytalloc_reference_ex(&samr_UserInfo3_Type, mem_ctx, &in->info3);
9191 814 : return ret;
9192 :
9193 0 : case 4:
9194 0 : ret = pytalloc_reference_ex(&samr_UserInfo4_Type, mem_ctx, &in->info4);
9195 0 : return ret;
9196 :
9197 814 : case 5:
9198 814 : ret = pytalloc_reference_ex(&samr_UserInfo5_Type, mem_ctx, &in->info5);
9199 814 : return ret;
9200 :
9201 0 : case 6:
9202 0 : ret = pytalloc_reference_ex(&samr_UserInfo6_Type, mem_ctx, &in->info6);
9203 0 : return ret;
9204 :
9205 0 : case 7:
9206 0 : ret = pytalloc_reference_ex(&samr_UserInfo7_Type, mem_ctx, &in->info7);
9207 0 : return ret;
9208 :
9209 0 : case 8:
9210 0 : ret = pytalloc_reference_ex(&samr_UserInfo8_Type, mem_ctx, &in->info8);
9211 0 : return ret;
9212 :
9213 0 : case 9:
9214 0 : ret = pytalloc_reference_ex(&samr_UserInfo9_Type, mem_ctx, &in->info9);
9215 0 : return ret;
9216 :
9217 0 : case 10:
9218 0 : ret = pytalloc_reference_ex(&samr_UserInfo10_Type, mem_ctx, &in->info10);
9219 0 : return ret;
9220 :
9221 0 : case 11:
9222 0 : ret = pytalloc_reference_ex(&samr_UserInfo11_Type, mem_ctx, &in->info11);
9223 0 : return ret;
9224 :
9225 0 : case 12:
9226 0 : ret = pytalloc_reference_ex(&samr_UserInfo12_Type, mem_ctx, &in->info12);
9227 0 : return ret;
9228 :
9229 0 : case 13:
9230 0 : ret = pytalloc_reference_ex(&samr_UserInfo13_Type, mem_ctx, &in->info13);
9231 0 : return ret;
9232 :
9233 0 : case 14:
9234 0 : ret = pytalloc_reference_ex(&samr_UserInfo14_Type, mem_ctx, &in->info14);
9235 0 : return ret;
9236 :
9237 831 : case 16:
9238 831 : ret = pytalloc_reference_ex(&samr_UserInfo16_Type, mem_ctx, &in->info16);
9239 831 : return ret;
9240 :
9241 0 : case 17:
9242 0 : ret = pytalloc_reference_ex(&samr_UserInfo17_Type, mem_ctx, &in->info17);
9243 0 : return ret;
9244 :
9245 0 : case 18:
9246 0 : ret = pytalloc_reference_ex(&samr_UserInfo18_Type, mem_ctx, &in->info18);
9247 0 : return ret;
9248 :
9249 0 : case 20:
9250 0 : ret = pytalloc_reference_ex(&samr_UserInfo20_Type, mem_ctx, &in->info20);
9251 0 : return ret;
9252 :
9253 814 : case 21:
9254 814 : ret = pytalloc_reference_ex(&samr_UserInfo21_Type, mem_ctx, &in->info21);
9255 814 : return ret;
9256 :
9257 0 : case 23:
9258 0 : ret = pytalloc_reference_ex(&samr_UserInfo23_Type, mem_ctx, &in->info23);
9259 0 : return ret;
9260 :
9261 0 : case 24:
9262 0 : ret = pytalloc_reference_ex(&samr_UserInfo24_Type, mem_ctx, &in->info24);
9263 0 : return ret;
9264 :
9265 0 : case 25:
9266 0 : ret = pytalloc_reference_ex(&samr_UserInfo25_Type, mem_ctx, &in->info25);
9267 0 : return ret;
9268 :
9269 0 : case 26:
9270 0 : ret = pytalloc_reference_ex(&samr_UserInfo26_Type, mem_ctx, &in->info26);
9271 0 : return ret;
9272 :
9273 0 : case 31:
9274 0 : ret = pytalloc_reference_ex(&samr_UserInfo31_Type, mem_ctx, &in->info31);
9275 0 : return ret;
9276 :
9277 0 : case 32:
9278 0 : ret = pytalloc_reference_ex(&samr_UserInfo32_Type, mem_ctx, &in->info32);
9279 0 : return ret;
9280 :
9281 : }
9282 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
9283 0 : return NULL;
9284 : }
9285 :
9286 21 : static union samr_UserInfo *py_export_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
9287 : {
9288 21 : union samr_UserInfo *ret = talloc_zero(mem_ctx, union samr_UserInfo);
9289 21 : switch (level) {
9290 0 : case 1:
9291 0 : if (in == NULL) {
9292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
9293 0 : talloc_free(ret); return NULL;
9294 : }
9295 0 : PY_CHECK_TYPE(&samr_UserInfo1_Type, in, talloc_free(ret); return NULL;);
9296 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9297 0 : PyErr_NoMemory();
9298 0 : talloc_free(ret); return NULL;
9299 : }
9300 0 : ret->info1 = *(struct samr_UserInfo1 *)pytalloc_get_ptr(in);
9301 0 : break;
9302 :
9303 0 : case 2:
9304 0 : if (in == NULL) {
9305 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2");
9306 0 : talloc_free(ret); return NULL;
9307 : }
9308 0 : PY_CHECK_TYPE(&samr_UserInfo2_Type, in, talloc_free(ret); return NULL;);
9309 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9310 0 : PyErr_NoMemory();
9311 0 : talloc_free(ret); return NULL;
9312 : }
9313 0 : ret->info2 = *(struct samr_UserInfo2 *)pytalloc_get_ptr(in);
9314 0 : break;
9315 :
9316 0 : case 3:
9317 0 : if (in == NULL) {
9318 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
9319 0 : talloc_free(ret); return NULL;
9320 : }
9321 0 : PY_CHECK_TYPE(&samr_UserInfo3_Type, in, talloc_free(ret); return NULL;);
9322 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9323 0 : PyErr_NoMemory();
9324 0 : talloc_free(ret); return NULL;
9325 : }
9326 0 : ret->info3 = *(struct samr_UserInfo3 *)pytalloc_get_ptr(in);
9327 0 : break;
9328 :
9329 0 : case 4:
9330 0 : if (in == NULL) {
9331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4");
9332 0 : talloc_free(ret); return NULL;
9333 : }
9334 0 : PY_CHECK_TYPE(&samr_UserInfo4_Type, in, talloc_free(ret); return NULL;);
9335 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9336 0 : PyErr_NoMemory();
9337 0 : talloc_free(ret); return NULL;
9338 : }
9339 0 : ret->info4 = *(struct samr_UserInfo4 *)pytalloc_get_ptr(in);
9340 0 : break;
9341 :
9342 0 : case 5:
9343 0 : if (in == NULL) {
9344 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5");
9345 0 : talloc_free(ret); return NULL;
9346 : }
9347 0 : PY_CHECK_TYPE(&samr_UserInfo5_Type, in, talloc_free(ret); return NULL;);
9348 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9349 0 : PyErr_NoMemory();
9350 0 : talloc_free(ret); return NULL;
9351 : }
9352 0 : ret->info5 = *(struct samr_UserInfo5 *)pytalloc_get_ptr(in);
9353 0 : break;
9354 :
9355 0 : case 6:
9356 0 : if (in == NULL) {
9357 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info6");
9358 0 : talloc_free(ret); return NULL;
9359 : }
9360 0 : PY_CHECK_TYPE(&samr_UserInfo6_Type, in, talloc_free(ret); return NULL;);
9361 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9362 0 : PyErr_NoMemory();
9363 0 : talloc_free(ret); return NULL;
9364 : }
9365 0 : ret->info6 = *(struct samr_UserInfo6 *)pytalloc_get_ptr(in);
9366 0 : break;
9367 :
9368 0 : case 7:
9369 0 : if (in == NULL) {
9370 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info7");
9371 0 : talloc_free(ret); return NULL;
9372 : }
9373 0 : PY_CHECK_TYPE(&samr_UserInfo7_Type, in, talloc_free(ret); return NULL;);
9374 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9375 0 : PyErr_NoMemory();
9376 0 : talloc_free(ret); return NULL;
9377 : }
9378 0 : ret->info7 = *(struct samr_UserInfo7 *)pytalloc_get_ptr(in);
9379 0 : break;
9380 :
9381 0 : case 8:
9382 0 : if (in == NULL) {
9383 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info8");
9384 0 : talloc_free(ret); return NULL;
9385 : }
9386 0 : PY_CHECK_TYPE(&samr_UserInfo8_Type, in, talloc_free(ret); return NULL;);
9387 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9388 0 : PyErr_NoMemory();
9389 0 : talloc_free(ret); return NULL;
9390 : }
9391 0 : ret->info8 = *(struct samr_UserInfo8 *)pytalloc_get_ptr(in);
9392 0 : break;
9393 :
9394 0 : case 9:
9395 0 : if (in == NULL) {
9396 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info9");
9397 0 : talloc_free(ret); return NULL;
9398 : }
9399 0 : PY_CHECK_TYPE(&samr_UserInfo9_Type, in, talloc_free(ret); return NULL;);
9400 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9401 0 : PyErr_NoMemory();
9402 0 : talloc_free(ret); return NULL;
9403 : }
9404 0 : ret->info9 = *(struct samr_UserInfo9 *)pytalloc_get_ptr(in);
9405 0 : break;
9406 :
9407 0 : case 10:
9408 0 : if (in == NULL) {
9409 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info10");
9410 0 : talloc_free(ret); return NULL;
9411 : }
9412 0 : PY_CHECK_TYPE(&samr_UserInfo10_Type, in, talloc_free(ret); return NULL;);
9413 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9414 0 : PyErr_NoMemory();
9415 0 : talloc_free(ret); return NULL;
9416 : }
9417 0 : ret->info10 = *(struct samr_UserInfo10 *)pytalloc_get_ptr(in);
9418 0 : break;
9419 :
9420 0 : case 11:
9421 0 : if (in == NULL) {
9422 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info11");
9423 0 : talloc_free(ret); return NULL;
9424 : }
9425 0 : PY_CHECK_TYPE(&samr_UserInfo11_Type, in, talloc_free(ret); return NULL;);
9426 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9427 0 : PyErr_NoMemory();
9428 0 : talloc_free(ret); return NULL;
9429 : }
9430 0 : ret->info11 = *(struct samr_UserInfo11 *)pytalloc_get_ptr(in);
9431 0 : break;
9432 :
9433 0 : case 12:
9434 0 : if (in == NULL) {
9435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info12");
9436 0 : talloc_free(ret); return NULL;
9437 : }
9438 0 : PY_CHECK_TYPE(&samr_UserInfo12_Type, in, talloc_free(ret); return NULL;);
9439 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9440 0 : PyErr_NoMemory();
9441 0 : talloc_free(ret); return NULL;
9442 : }
9443 0 : ret->info12 = *(struct samr_UserInfo12 *)pytalloc_get_ptr(in);
9444 0 : break;
9445 :
9446 0 : case 13:
9447 0 : if (in == NULL) {
9448 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info13");
9449 0 : talloc_free(ret); return NULL;
9450 : }
9451 0 : PY_CHECK_TYPE(&samr_UserInfo13_Type, in, talloc_free(ret); return NULL;);
9452 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9453 0 : PyErr_NoMemory();
9454 0 : talloc_free(ret); return NULL;
9455 : }
9456 0 : ret->info13 = *(struct samr_UserInfo13 *)pytalloc_get_ptr(in);
9457 0 : break;
9458 :
9459 0 : case 14:
9460 0 : if (in == NULL) {
9461 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info14");
9462 0 : talloc_free(ret); return NULL;
9463 : }
9464 0 : PY_CHECK_TYPE(&samr_UserInfo14_Type, in, talloc_free(ret); return NULL;);
9465 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9466 0 : PyErr_NoMemory();
9467 0 : talloc_free(ret); return NULL;
9468 : }
9469 0 : ret->info14 = *(struct samr_UserInfo14 *)pytalloc_get_ptr(in);
9470 0 : break;
9471 :
9472 17 : case 16:
9473 17 : if (in == NULL) {
9474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info16");
9475 0 : talloc_free(ret); return NULL;
9476 : }
9477 17 : PY_CHECK_TYPE(&samr_UserInfo16_Type, in, talloc_free(ret); return NULL;);
9478 17 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9479 0 : PyErr_NoMemory();
9480 0 : talloc_free(ret); return NULL;
9481 : }
9482 17 : ret->info16 = *(struct samr_UserInfo16 *)pytalloc_get_ptr(in);
9483 17 : break;
9484 :
9485 0 : case 17:
9486 0 : if (in == NULL) {
9487 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info17");
9488 0 : talloc_free(ret); return NULL;
9489 : }
9490 0 : PY_CHECK_TYPE(&samr_UserInfo17_Type, in, talloc_free(ret); return NULL;);
9491 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9492 0 : PyErr_NoMemory();
9493 0 : talloc_free(ret); return NULL;
9494 : }
9495 0 : ret->info17 = *(struct samr_UserInfo17 *)pytalloc_get_ptr(in);
9496 0 : break;
9497 :
9498 0 : case 18:
9499 0 : if (in == NULL) {
9500 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info18");
9501 0 : talloc_free(ret); return NULL;
9502 : }
9503 0 : PY_CHECK_TYPE(&samr_UserInfo18_Type, in, talloc_free(ret); return NULL;);
9504 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9505 0 : PyErr_NoMemory();
9506 0 : talloc_free(ret); return NULL;
9507 : }
9508 0 : ret->info18 = *(struct samr_UserInfo18 *)pytalloc_get_ptr(in);
9509 0 : break;
9510 :
9511 0 : case 20:
9512 0 : if (in == NULL) {
9513 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info20");
9514 0 : talloc_free(ret); return NULL;
9515 : }
9516 0 : PY_CHECK_TYPE(&samr_UserInfo20_Type, in, talloc_free(ret); return NULL;);
9517 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9518 0 : PyErr_NoMemory();
9519 0 : talloc_free(ret); return NULL;
9520 : }
9521 0 : ret->info20 = *(struct samr_UserInfo20 *)pytalloc_get_ptr(in);
9522 0 : break;
9523 :
9524 0 : case 21:
9525 0 : if (in == NULL) {
9526 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info21");
9527 0 : talloc_free(ret); return NULL;
9528 : }
9529 0 : PY_CHECK_TYPE(&samr_UserInfo21_Type, in, talloc_free(ret); return NULL;);
9530 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9531 0 : PyErr_NoMemory();
9532 0 : talloc_free(ret); return NULL;
9533 : }
9534 0 : ret->info21 = *(struct samr_UserInfo21 *)pytalloc_get_ptr(in);
9535 0 : break;
9536 :
9537 0 : case 23:
9538 0 : if (in == NULL) {
9539 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info23");
9540 0 : talloc_free(ret); return NULL;
9541 : }
9542 0 : PY_CHECK_TYPE(&samr_UserInfo23_Type, in, talloc_free(ret); return NULL;);
9543 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9544 0 : PyErr_NoMemory();
9545 0 : talloc_free(ret); return NULL;
9546 : }
9547 0 : ret->info23 = *(struct samr_UserInfo23 *)pytalloc_get_ptr(in);
9548 0 : break;
9549 :
9550 4 : case 24:
9551 4 : if (in == NULL) {
9552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info24");
9553 0 : talloc_free(ret); return NULL;
9554 : }
9555 4 : PY_CHECK_TYPE(&samr_UserInfo24_Type, in, talloc_free(ret); return NULL;);
9556 4 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9557 0 : PyErr_NoMemory();
9558 0 : talloc_free(ret); return NULL;
9559 : }
9560 4 : ret->info24 = *(struct samr_UserInfo24 *)pytalloc_get_ptr(in);
9561 4 : break;
9562 :
9563 0 : case 25:
9564 0 : if (in == NULL) {
9565 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info25");
9566 0 : talloc_free(ret); return NULL;
9567 : }
9568 0 : PY_CHECK_TYPE(&samr_UserInfo25_Type, in, talloc_free(ret); return NULL;);
9569 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9570 0 : PyErr_NoMemory();
9571 0 : talloc_free(ret); return NULL;
9572 : }
9573 0 : ret->info25 = *(struct samr_UserInfo25 *)pytalloc_get_ptr(in);
9574 0 : break;
9575 :
9576 0 : case 26:
9577 0 : if (in == NULL) {
9578 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info26");
9579 0 : talloc_free(ret); return NULL;
9580 : }
9581 0 : PY_CHECK_TYPE(&samr_UserInfo26_Type, in, talloc_free(ret); return NULL;);
9582 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9583 0 : PyErr_NoMemory();
9584 0 : talloc_free(ret); return NULL;
9585 : }
9586 0 : ret->info26 = *(struct samr_UserInfo26 *)pytalloc_get_ptr(in);
9587 0 : break;
9588 :
9589 0 : case 31:
9590 0 : if (in == NULL) {
9591 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info31");
9592 0 : talloc_free(ret); return NULL;
9593 : }
9594 0 : PY_CHECK_TYPE(&samr_UserInfo31_Type, in, talloc_free(ret); return NULL;);
9595 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9596 0 : PyErr_NoMemory();
9597 0 : talloc_free(ret); return NULL;
9598 : }
9599 0 : ret->info31 = *(struct samr_UserInfo31 *)pytalloc_get_ptr(in);
9600 0 : break;
9601 :
9602 0 : case 32:
9603 0 : if (in == NULL) {
9604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info32");
9605 0 : talloc_free(ret); return NULL;
9606 : }
9607 0 : PY_CHECK_TYPE(&samr_UserInfo32_Type, in, talloc_free(ret); return NULL;);
9608 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
9609 0 : PyErr_NoMemory();
9610 0 : talloc_free(ret); return NULL;
9611 : }
9612 0 : ret->info32 = *(struct samr_UserInfo32 *)pytalloc_get_ptr(in);
9613 0 : break;
9614 :
9615 0 : default:
9616 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
9617 0 : talloc_free(ret);
9618 0 : ret = NULL;
9619 : }
9620 :
9621 21 : return ret;
9622 : }
9623 :
9624 3278 : static PyObject *py_samr_UserInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9625 : {
9626 3278 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9627 3278 : PyObject *mem_ctx_obj = NULL;
9628 3278 : TALLOC_CTX *mem_ctx = NULL;
9629 3278 : int level = 0;
9630 3278 : PyObject *in_obj = NULL;
9631 3278 : union samr_UserInfo *in = NULL;
9632 :
9633 3278 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
9634 : discard_const_p(char *, kwnames),
9635 : &mem_ctx_obj,
9636 : &level,
9637 : &in_obj)) {
9638 0 : return NULL;
9639 : }
9640 3278 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9641 3278 : if (mem_ctx == NULL) {
9642 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9643 0 : return NULL;
9644 : }
9645 3278 : in = (union samr_UserInfo *)pytalloc_get_ptr(in_obj);
9646 3278 : if (in == NULL) {
9647 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_UserInfo!");
9648 0 : return NULL;
9649 : }
9650 :
9651 3278 : return py_import_samr_UserInfo(mem_ctx, level, in);
9652 : }
9653 :
9654 21 : static PyObject *py_samr_UserInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9655 : {
9656 21 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
9657 21 : PyObject *mem_ctx_obj = NULL;
9658 21 : TALLOC_CTX *mem_ctx = NULL;
9659 21 : int level = 0;
9660 21 : PyObject *in = NULL;
9661 21 : union samr_UserInfo *out = NULL;
9662 :
9663 21 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
9664 : discard_const_p(char *, kwnames),
9665 : &mem_ctx_obj,
9666 : &level,
9667 : &in)) {
9668 0 : return NULL;
9669 : }
9670 21 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
9671 21 : if (mem_ctx == NULL) {
9672 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
9673 0 : return NULL;
9674 : }
9675 :
9676 21 : out = py_export_samr_UserInfo(mem_ctx, level, in);
9677 21 : if (out == NULL) {
9678 0 : return NULL;
9679 : }
9680 :
9681 21 : return pytalloc_GenericObject_reference(out);
9682 : }
9683 :
9684 : static PyMethodDef py_samr_UserInfo_methods[] = {
9685 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_UserInfo_import),
9686 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9687 : "T.__import__(mem_ctx, level, in) => ret." },
9688 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_UserInfo_export),
9689 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
9690 : "T.__export__(mem_ctx, level, in) => ret." },
9691 : { NULL, NULL, 0, NULL }
9692 : };
9693 :
9694 0 : static PyObject *py_samr_UserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9695 : {
9696 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
9697 0 : return NULL;
9698 : }
9699 :
9700 :
9701 : static PyTypeObject samr_UserInfo_Type = {
9702 : PyVarObject_HEAD_INIT(NULL, 0)
9703 : .tp_name = "samr.UserInfo",
9704 : .tp_getset = NULL,
9705 : .tp_methods = py_samr_UserInfo_methods,
9706 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9707 : .tp_new = py_samr_UserInfo_new,
9708 : };
9709 :
9710 :
9711 680 : static PyObject *py_samr_RidWithAttribute_get_rid(PyObject *obj, void *closure)
9712 : {
9713 680 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj);
9714 0 : PyObject *py_rid;
9715 680 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
9716 680 : return py_rid;
9717 : }
9718 :
9719 723 : static int py_samr_RidWithAttribute_set_rid(PyObject *py_obj, PyObject *value, void *closure)
9720 : {
9721 723 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
9722 723 : if (value == NULL) {
9723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
9724 0 : return -1;
9725 : }
9726 : {
9727 723 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
9728 723 : if (PyLong_Check(value)) {
9729 0 : unsigned long long test_var;
9730 723 : test_var = PyLong_AsUnsignedLongLong(value);
9731 723 : if (PyErr_Occurred() != NULL) {
9732 0 : return -1;
9733 : }
9734 723 : if (test_var > uint_max) {
9735 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9736 : PyLong_Type.tp_name, uint_max, test_var);
9737 0 : return -1;
9738 : }
9739 723 : object->rid = test_var;
9740 : } else {
9741 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9742 : PyLong_Type.tp_name);
9743 0 : return -1;
9744 : }
9745 : }
9746 723 : return 0;
9747 : }
9748 :
9749 676 : static PyObject *py_samr_RidWithAttribute_get_attributes(PyObject *obj, void *closure)
9750 : {
9751 676 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj);
9752 0 : PyObject *py_attributes;
9753 676 : py_attributes = PyLong_FromUnsignedLongLong((uint32_t)object->attributes);
9754 676 : return py_attributes;
9755 : }
9756 :
9757 723 : static int py_samr_RidWithAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
9758 : {
9759 723 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
9760 723 : if (value == NULL) {
9761 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->attributes");
9762 0 : return -1;
9763 : }
9764 : {
9765 723 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
9766 723 : if (PyLong_Check(value)) {
9767 0 : unsigned long long test_var;
9768 723 : test_var = PyLong_AsUnsignedLongLong(value);
9769 723 : if (PyErr_Occurred() != NULL) {
9770 0 : return -1;
9771 : }
9772 723 : if (test_var > uint_max) {
9773 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9774 : PyLong_Type.tp_name, uint_max, test_var);
9775 0 : return -1;
9776 : }
9777 723 : object->attributes = test_var;
9778 : } else {
9779 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9780 : PyLong_Type.tp_name);
9781 0 : return -1;
9782 : }
9783 : }
9784 723 : return 0;
9785 : }
9786 :
9787 : static PyGetSetDef py_samr_RidWithAttribute_getsetters[] = {
9788 : {
9789 : .name = discard_const_p(char, "rid"),
9790 : .get = py_samr_RidWithAttribute_get_rid,
9791 : .set = py_samr_RidWithAttribute_set_rid,
9792 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
9793 : },
9794 : {
9795 : .name = discard_const_p(char, "attributes"),
9796 : .get = py_samr_RidWithAttribute_get_attributes,
9797 : .set = py_samr_RidWithAttribute_set_attributes,
9798 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
9799 : },
9800 : { .name = NULL }
9801 : };
9802 :
9803 723 : static PyObject *py_samr_RidWithAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
9804 : {
9805 723 : return pytalloc_new(struct samr_RidWithAttribute, type);
9806 : }
9807 :
9808 0 : static PyObject *py_samr_RidWithAttribute_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9809 : {
9810 0 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
9811 0 : PyObject *ret = NULL;
9812 0 : DATA_BLOB blob;
9813 0 : enum ndr_err_code err;
9814 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
9815 0 : if (tmp_ctx == NULL) {
9816 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
9817 0 : return NULL;
9818 : }
9819 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttribute);
9820 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9821 0 : TALLOC_FREE(tmp_ctx);
9822 0 : PyErr_SetNdrError(err);
9823 0 : return NULL;
9824 : }
9825 :
9826 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
9827 0 : TALLOC_FREE(tmp_ctx);
9828 0 : return ret;
9829 : }
9830 :
9831 0 : static PyObject *py_samr_RidWithAttribute_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
9832 : {
9833 0 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
9834 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
9835 0 : Py_ssize_t blob_length = 0;
9836 0 : enum ndr_err_code err;
9837 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
9838 0 : PyObject *allow_remaining_obj = NULL;
9839 0 : bool allow_remaining = false;
9840 :
9841 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
9842 : discard_const_p(char *, kwnames),
9843 : &blob.data, &blob_length,
9844 : &allow_remaining_obj)) {
9845 0 : return NULL;
9846 : }
9847 0 : blob.length = blob_length;
9848 :
9849 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
9850 0 : allow_remaining = true;
9851 : }
9852 :
9853 0 : if (allow_remaining) {
9854 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute);
9855 : } else {
9856 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute);
9857 : }
9858 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
9859 0 : PyErr_SetNdrError(err);
9860 0 : return NULL;
9861 : }
9862 :
9863 0 : Py_RETURN_NONE;
9864 : }
9865 :
9866 0 : static PyObject *py_samr_RidWithAttribute_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
9867 : {
9868 0 : struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
9869 0 : PyObject *ret;
9870 0 : char *retstr;
9871 :
9872 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttribute, "samr_RidWithAttribute", object);
9873 0 : ret = PyUnicode_FromString(retstr);
9874 0 : talloc_free(retstr);
9875 :
9876 0 : return ret;
9877 : }
9878 :
9879 : static PyMethodDef py_samr_RidWithAttribute_methods[] = {
9880 : { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttribute_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
9881 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidWithAttribute_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
9882 : { "__ndr_print__", (PyCFunction)py_samr_RidWithAttribute_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
9883 : { NULL, NULL, 0, NULL }
9884 : };
9885 :
9886 :
9887 : static PyTypeObject samr_RidWithAttribute_Type = {
9888 : PyVarObject_HEAD_INIT(NULL, 0)
9889 : .tp_name = "samr.RidWithAttribute",
9890 : .tp_getset = py_samr_RidWithAttribute_getsetters,
9891 : .tp_methods = py_samr_RidWithAttribute_methods,
9892 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
9893 : .tp_new = py_samr_RidWithAttribute_new,
9894 : };
9895 :
9896 :
9897 6 : static PyObject *py_samr_RidWithAttributeArray_get_count(PyObject *obj, void *closure)
9898 : {
9899 6 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
9900 0 : PyObject *py_count;
9901 6 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
9902 6 : return py_count;
9903 : }
9904 :
9905 1046 : static int py_samr_RidWithAttributeArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
9906 : {
9907 1046 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
9908 1046 : if (value == NULL) {
9909 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
9910 0 : return -1;
9911 : }
9912 : {
9913 1046 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
9914 1046 : if (PyLong_Check(value)) {
9915 0 : unsigned long long test_var;
9916 1046 : test_var = PyLong_AsUnsignedLongLong(value);
9917 1046 : if (PyErr_Occurred() != NULL) {
9918 0 : return -1;
9919 : }
9920 1046 : if (test_var > uint_max) {
9921 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
9922 : PyLong_Type.tp_name, uint_max, test_var);
9923 0 : return -1;
9924 : }
9925 1046 : object->count = test_var;
9926 : } else {
9927 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
9928 : PyLong_Type.tp_name);
9929 0 : return -1;
9930 : }
9931 : }
9932 1046 : return 0;
9933 : }
9934 :
9935 1965 : static PyObject *py_samr_RidWithAttributeArray_get_rids(PyObject *obj, void *closure)
9936 : {
9937 1965 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
9938 0 : PyObject *py_rids;
9939 1965 : if (object->rids == NULL) {
9940 594 : Py_RETURN_NONE;
9941 : }
9942 1371 : if (object->rids == NULL) {
9943 0 : py_rids = Py_None;
9944 0 : Py_INCREF(py_rids);
9945 : } else {
9946 1371 : py_rids = PyList_New(object->count);
9947 1371 : if (py_rids == NULL) {
9948 0 : return NULL;
9949 : }
9950 : {
9951 : int rids_cntr_1;
9952 3246 : for (rids_cntr_1 = 0; rids_cntr_1 < (object->count); rids_cntr_1++) {
9953 0 : PyObject *py_rids_1;
9954 1875 : py_rids_1 = pytalloc_reference_ex(&samr_RidWithAttribute_Type, object->rids, &object->rids[rids_cntr_1]);
9955 1875 : PyList_SetItem(py_rids, rids_cntr_1, py_rids_1);
9956 : }
9957 : }
9958 : }
9959 1371 : return py_rids;
9960 : }
9961 :
9962 1046 : static int py_samr_RidWithAttributeArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
9963 : {
9964 1046 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
9965 1046 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->rids));
9966 1046 : if (value == NULL) {
9967 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids");
9968 0 : return -1;
9969 : }
9970 1046 : if (value == Py_None) {
9971 449 : object->rids = NULL;
9972 : } else {
9973 597 : object->rids = NULL;
9974 597 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
9975 : {
9976 0 : int rids_cntr_1;
9977 597 : object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
9978 597 : if (!object->rids) { return -1; }
9979 597 : talloc_set_name_const(object->rids, "ARRAY: object->rids");
9980 1320 : for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) {
9981 723 : if (PyList_GET_ITEM(value, rids_cntr_1) == NULL) {
9982 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rids[rids_cntr_1]");
9983 0 : return -1;
9984 : }
9985 723 : PY_CHECK_TYPE(&samr_RidWithAttribute_Type, PyList_GET_ITEM(value, rids_cntr_1), return -1;);
9986 723 : if (talloc_reference(object->rids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, rids_cntr_1))) == NULL) {
9987 0 : PyErr_NoMemory();
9988 0 : return -1;
9989 : }
9990 723 : object->rids[rids_cntr_1] = *(struct samr_RidWithAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, rids_cntr_1));
9991 : }
9992 : }
9993 : }
9994 1046 : return 0;
9995 : }
9996 :
9997 : static PyGetSetDef py_samr_RidWithAttributeArray_getsetters[] = {
9998 : {
9999 : .name = discard_const_p(char, "count"),
10000 : .get = py_samr_RidWithAttributeArray_get_count,
10001 : .set = py_samr_RidWithAttributeArray_set_count,
10002 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10003 : },
10004 : {
10005 : .name = discard_const_p(char, "rids"),
10006 : .get = py_samr_RidWithAttributeArray_get_rids,
10007 : .set = py_samr_RidWithAttributeArray_set_rids,
10008 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttribute")
10009 : },
10010 : { .name = NULL }
10011 : };
10012 :
10013 0 : static PyObject *py_samr_RidWithAttributeArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10014 : {
10015 0 : return pytalloc_new(struct samr_RidWithAttributeArray, type);
10016 : }
10017 :
10018 0 : static PyObject *py_samr_RidWithAttributeArray_ndr_pack(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10019 : {
10020 0 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
10021 0 : PyObject *ret = NULL;
10022 0 : DATA_BLOB blob;
10023 0 : enum ndr_err_code err;
10024 0 : TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
10025 0 : if (tmp_ctx == NULL) {
10026 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
10027 0 : return NULL;
10028 : }
10029 0 : err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttributeArray);
10030 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10031 0 : TALLOC_FREE(tmp_ctx);
10032 0 : PyErr_SetNdrError(err);
10033 0 : return NULL;
10034 : }
10035 :
10036 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
10037 0 : TALLOC_FREE(tmp_ctx);
10038 0 : return ret;
10039 : }
10040 :
10041 0 : static PyObject *py_samr_RidWithAttributeArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
10042 : {
10043 0 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
10044 0 : DATA_BLOB blob = {.data = NULL, .length = 0};
10045 0 : Py_ssize_t blob_length = 0;
10046 0 : enum ndr_err_code err;
10047 0 : const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
10048 0 : PyObject *allow_remaining_obj = NULL;
10049 0 : bool allow_remaining = false;
10050 :
10051 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
10052 : discard_const_p(char *, kwnames),
10053 : &blob.data, &blob_length,
10054 : &allow_remaining_obj)) {
10055 0 : return NULL;
10056 : }
10057 0 : blob.length = blob_length;
10058 :
10059 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
10060 0 : allow_remaining = true;
10061 : }
10062 :
10063 0 : if (allow_remaining) {
10064 0 : err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray);
10065 : } else {
10066 0 : err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray);
10067 : }
10068 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
10069 0 : PyErr_SetNdrError(err);
10070 0 : return NULL;
10071 : }
10072 :
10073 0 : Py_RETURN_NONE;
10074 : }
10075 :
10076 0 : static PyObject *py_samr_RidWithAttributeArray_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
10077 : {
10078 0 : struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
10079 0 : PyObject *ret;
10080 0 : char *retstr;
10081 :
10082 0 : retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttributeArray, "samr_RidWithAttributeArray", object);
10083 0 : ret = PyUnicode_FromString(retstr);
10084 0 : talloc_free(retstr);
10085 :
10086 0 : return ret;
10087 : }
10088 :
10089 : static PyMethodDef py_samr_RidWithAttributeArray_methods[] = {
10090 : { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
10091 : { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidWithAttributeArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
10092 : { "__ndr_print__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
10093 : { NULL, NULL, 0, NULL }
10094 : };
10095 :
10096 :
10097 : static PyTypeObject samr_RidWithAttributeArray_Type = {
10098 : PyVarObject_HEAD_INIT(NULL, 0)
10099 : .tp_name = "samr.RidWithAttributeArray",
10100 : .tp_getset = py_samr_RidWithAttributeArray_getsetters,
10101 : .tp_methods = py_samr_RidWithAttributeArray_methods,
10102 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10103 : .tp_new = py_samr_RidWithAttributeArray_new,
10104 : };
10105 :
10106 :
10107 0 : static PyObject *py_samr_DispEntryGeneral_get_idx(PyObject *obj, void *closure)
10108 : {
10109 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10110 0 : PyObject *py_idx;
10111 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx);
10112 0 : return py_idx;
10113 : }
10114 :
10115 0 : static int py_samr_DispEntryGeneral_set_idx(PyObject *py_obj, PyObject *value, void *closure)
10116 : {
10117 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10118 0 : if (value == NULL) {
10119 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx");
10120 0 : return -1;
10121 : }
10122 : {
10123 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx));
10124 0 : if (PyLong_Check(value)) {
10125 0 : unsigned long long test_var;
10126 0 : test_var = PyLong_AsUnsignedLongLong(value);
10127 0 : if (PyErr_Occurred() != NULL) {
10128 0 : return -1;
10129 : }
10130 0 : if (test_var > uint_max) {
10131 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10132 : PyLong_Type.tp_name, uint_max, test_var);
10133 0 : return -1;
10134 : }
10135 0 : object->idx = test_var;
10136 : } else {
10137 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10138 : PyLong_Type.tp_name);
10139 0 : return -1;
10140 : }
10141 : }
10142 0 : return 0;
10143 : }
10144 :
10145 0 : static PyObject *py_samr_DispEntryGeneral_get_rid(PyObject *obj, void *closure)
10146 : {
10147 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10148 0 : PyObject *py_rid;
10149 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
10150 0 : return py_rid;
10151 : }
10152 :
10153 0 : static int py_samr_DispEntryGeneral_set_rid(PyObject *py_obj, PyObject *value, void *closure)
10154 : {
10155 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10156 0 : if (value == NULL) {
10157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
10158 0 : return -1;
10159 : }
10160 : {
10161 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
10162 0 : if (PyLong_Check(value)) {
10163 0 : unsigned long long test_var;
10164 0 : test_var = PyLong_AsUnsignedLongLong(value);
10165 0 : if (PyErr_Occurred() != NULL) {
10166 0 : return -1;
10167 : }
10168 0 : if (test_var > uint_max) {
10169 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10170 : PyLong_Type.tp_name, uint_max, test_var);
10171 0 : return -1;
10172 : }
10173 0 : object->rid = test_var;
10174 : } else {
10175 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10176 : PyLong_Type.tp_name);
10177 0 : return -1;
10178 : }
10179 : }
10180 0 : return 0;
10181 : }
10182 :
10183 0 : static PyObject *py_samr_DispEntryGeneral_get_acct_flags(PyObject *obj, void *closure)
10184 : {
10185 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10186 0 : PyObject *py_acct_flags;
10187 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
10188 0 : return py_acct_flags;
10189 : }
10190 :
10191 0 : static int py_samr_DispEntryGeneral_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
10192 : {
10193 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10194 0 : if (value == NULL) {
10195 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
10196 0 : return -1;
10197 : }
10198 : {
10199 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
10200 0 : if (PyLong_Check(value)) {
10201 0 : unsigned long long test_var;
10202 0 : test_var = PyLong_AsUnsignedLongLong(value);
10203 0 : if (PyErr_Occurred() != NULL) {
10204 0 : return -1;
10205 : }
10206 0 : if (test_var > uint_max) {
10207 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10208 : PyLong_Type.tp_name, uint_max, test_var);
10209 0 : return -1;
10210 : }
10211 0 : object->acct_flags = test_var;
10212 : } else {
10213 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10214 : PyLong_Type.tp_name);
10215 0 : return -1;
10216 : }
10217 : }
10218 0 : return 0;
10219 : }
10220 :
10221 87 : static PyObject *py_samr_DispEntryGeneral_get_account_name(PyObject *obj, void *closure)
10222 : {
10223 87 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10224 0 : PyObject *py_account_name;
10225 87 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
10226 87 : return py_account_name;
10227 : }
10228 :
10229 0 : static int py_samr_DispEntryGeneral_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
10230 : {
10231 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10232 0 : if (value == NULL) {
10233 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
10234 0 : return -1;
10235 : }
10236 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10237 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10238 0 : PyErr_NoMemory();
10239 0 : return -1;
10240 : }
10241 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
10242 0 : return 0;
10243 : }
10244 :
10245 131 : static PyObject *py_samr_DispEntryGeneral_get_description(PyObject *obj, void *closure)
10246 : {
10247 131 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10248 0 : PyObject *py_description;
10249 131 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
10250 131 : return py_description;
10251 : }
10252 :
10253 0 : static int py_samr_DispEntryGeneral_set_description(PyObject *py_obj, PyObject *value, void *closure)
10254 : {
10255 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10256 0 : if (value == NULL) {
10257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
10258 0 : return -1;
10259 : }
10260 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10261 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10262 0 : PyErr_NoMemory();
10263 0 : return -1;
10264 : }
10265 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
10266 0 : return 0;
10267 : }
10268 :
10269 115 : static PyObject *py_samr_DispEntryGeneral_get_full_name(PyObject *obj, void *closure)
10270 : {
10271 115 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
10272 0 : PyObject *py_full_name;
10273 115 : py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
10274 115 : return py_full_name;
10275 : }
10276 :
10277 0 : static int py_samr_DispEntryGeneral_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
10278 : {
10279 0 : struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
10280 0 : if (value == NULL) {
10281 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->full_name");
10282 0 : return -1;
10283 : }
10284 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10285 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10286 0 : PyErr_NoMemory();
10287 0 : return -1;
10288 : }
10289 0 : object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
10290 0 : return 0;
10291 : }
10292 :
10293 : static PyGetSetDef py_samr_DispEntryGeneral_getsetters[] = {
10294 : {
10295 : .name = discard_const_p(char, "idx"),
10296 : .get = py_samr_DispEntryGeneral_get_idx,
10297 : .set = py_samr_DispEntryGeneral_set_idx,
10298 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10299 : },
10300 : {
10301 : .name = discard_const_p(char, "rid"),
10302 : .get = py_samr_DispEntryGeneral_get_rid,
10303 : .set = py_samr_DispEntryGeneral_set_rid,
10304 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10305 : },
10306 : {
10307 : .name = discard_const_p(char, "acct_flags"),
10308 : .get = py_samr_DispEntryGeneral_get_acct_flags,
10309 : .set = py_samr_DispEntryGeneral_set_acct_flags,
10310 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
10311 : },
10312 : {
10313 : .name = discard_const_p(char, "account_name"),
10314 : .get = py_samr_DispEntryGeneral_get_account_name,
10315 : .set = py_samr_DispEntryGeneral_set_account_name,
10316 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10317 : },
10318 : {
10319 : .name = discard_const_p(char, "description"),
10320 : .get = py_samr_DispEntryGeneral_get_description,
10321 : .set = py_samr_DispEntryGeneral_set_description,
10322 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10323 : },
10324 : {
10325 : .name = discard_const_p(char, "full_name"),
10326 : .get = py_samr_DispEntryGeneral_get_full_name,
10327 : .set = py_samr_DispEntryGeneral_set_full_name,
10328 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10329 : },
10330 : { .name = NULL }
10331 : };
10332 :
10333 0 : static PyObject *py_samr_DispEntryGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10334 : {
10335 0 : return pytalloc_new(struct samr_DispEntryGeneral, type);
10336 : }
10337 :
10338 :
10339 : static PyTypeObject samr_DispEntryGeneral_Type = {
10340 : PyVarObject_HEAD_INIT(NULL, 0)
10341 : .tp_name = "samr.DispEntryGeneral",
10342 : .tp_getset = py_samr_DispEntryGeneral_getsetters,
10343 : .tp_methods = NULL,
10344 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10345 : .tp_new = py_samr_DispEntryGeneral_new,
10346 : };
10347 :
10348 :
10349 0 : static PyObject *py_samr_DispInfoGeneral_get_count(PyObject *obj, void *closure)
10350 : {
10351 0 : struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj);
10352 0 : PyObject *py_count;
10353 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10354 0 : return py_count;
10355 : }
10356 :
10357 0 : static int py_samr_DispInfoGeneral_set_count(PyObject *py_obj, PyObject *value, void *closure)
10358 : {
10359 0 : struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj);
10360 0 : if (value == NULL) {
10361 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10362 0 : return -1;
10363 : }
10364 : {
10365 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10366 0 : if (PyLong_Check(value)) {
10367 0 : unsigned long long test_var;
10368 0 : test_var = PyLong_AsUnsignedLongLong(value);
10369 0 : if (PyErr_Occurred() != NULL) {
10370 0 : return -1;
10371 : }
10372 0 : if (test_var > uint_max) {
10373 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10374 : PyLong_Type.tp_name, uint_max, test_var);
10375 0 : return -1;
10376 : }
10377 0 : object->count = test_var;
10378 : } else {
10379 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10380 : PyLong_Type.tp_name);
10381 0 : return -1;
10382 : }
10383 : }
10384 0 : return 0;
10385 : }
10386 :
10387 8 : static PyObject *py_samr_DispInfoGeneral_get_entries(PyObject *obj, void *closure)
10388 : {
10389 8 : struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj);
10390 0 : PyObject *py_entries;
10391 8 : if (object->entries == NULL) {
10392 0 : Py_RETURN_NONE;
10393 : }
10394 8 : if (object->entries == NULL) {
10395 0 : py_entries = Py_None;
10396 0 : Py_INCREF(py_entries);
10397 : } else {
10398 8 : py_entries = PyList_New(object->count);
10399 8 : if (py_entries == NULL) {
10400 0 : return NULL;
10401 : }
10402 : {
10403 : int entries_cntr_1;
10404 96 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
10405 0 : PyObject *py_entries_1;
10406 88 : py_entries_1 = pytalloc_reference_ex(&samr_DispEntryGeneral_Type, object->entries, &object->entries[entries_cntr_1]);
10407 88 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
10408 : }
10409 : }
10410 : }
10411 8 : return py_entries;
10412 : }
10413 :
10414 0 : static int py_samr_DispInfoGeneral_set_entries(PyObject *py_obj, PyObject *value, void *closure)
10415 : {
10416 0 : struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj);
10417 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
10418 0 : if (value == NULL) {
10419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
10420 0 : return -1;
10421 : }
10422 0 : if (value == Py_None) {
10423 0 : object->entries = NULL;
10424 : } else {
10425 0 : object->entries = NULL;
10426 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10427 : {
10428 0 : int entries_cntr_1;
10429 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
10430 0 : if (!object->entries) { return -1; }
10431 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
10432 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
10433 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
10434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
10435 0 : return -1;
10436 : }
10437 0 : PY_CHECK_TYPE(&samr_DispEntryGeneral_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
10438 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
10439 0 : PyErr_NoMemory();
10440 0 : return -1;
10441 : }
10442 0 : object->entries[entries_cntr_1] = *(struct samr_DispEntryGeneral *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
10443 : }
10444 : }
10445 : }
10446 0 : return 0;
10447 : }
10448 :
10449 : static PyGetSetDef py_samr_DispInfoGeneral_getsetters[] = {
10450 : {
10451 : .name = discard_const_p(char, "count"),
10452 : .get = py_samr_DispInfoGeneral_get_count,
10453 : .set = py_samr_DispInfoGeneral_set_count,
10454 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10455 : },
10456 : {
10457 : .name = discard_const_p(char, "entries"),
10458 : .get = py_samr_DispInfoGeneral_get_entries,
10459 : .set = py_samr_DispInfoGeneral_set_entries,
10460 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryGeneral")
10461 : },
10462 : { .name = NULL }
10463 : };
10464 :
10465 0 : static PyObject *py_samr_DispInfoGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10466 : {
10467 0 : return pytalloc_new(struct samr_DispInfoGeneral, type);
10468 : }
10469 :
10470 :
10471 : static PyTypeObject samr_DispInfoGeneral_Type = {
10472 : PyVarObject_HEAD_INIT(NULL, 0)
10473 : .tp_name = "samr.DispInfoGeneral",
10474 : .tp_getset = py_samr_DispInfoGeneral_getsetters,
10475 : .tp_methods = NULL,
10476 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10477 : .tp_new = py_samr_DispInfoGeneral_new,
10478 : };
10479 :
10480 :
10481 0 : static PyObject *py_samr_DispEntryFull_get_idx(PyObject *obj, void *closure)
10482 : {
10483 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
10484 0 : PyObject *py_idx;
10485 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx);
10486 0 : return py_idx;
10487 : }
10488 :
10489 0 : static int py_samr_DispEntryFull_set_idx(PyObject *py_obj, PyObject *value, void *closure)
10490 : {
10491 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
10492 0 : if (value == NULL) {
10493 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx");
10494 0 : return -1;
10495 : }
10496 : {
10497 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx));
10498 0 : if (PyLong_Check(value)) {
10499 0 : unsigned long long test_var;
10500 0 : test_var = PyLong_AsUnsignedLongLong(value);
10501 0 : if (PyErr_Occurred() != NULL) {
10502 0 : return -1;
10503 : }
10504 0 : if (test_var > uint_max) {
10505 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10506 : PyLong_Type.tp_name, uint_max, test_var);
10507 0 : return -1;
10508 : }
10509 0 : object->idx = test_var;
10510 : } else {
10511 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10512 : PyLong_Type.tp_name);
10513 0 : return -1;
10514 : }
10515 : }
10516 0 : return 0;
10517 : }
10518 :
10519 0 : static PyObject *py_samr_DispEntryFull_get_rid(PyObject *obj, void *closure)
10520 : {
10521 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
10522 0 : PyObject *py_rid;
10523 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
10524 0 : return py_rid;
10525 : }
10526 :
10527 0 : static int py_samr_DispEntryFull_set_rid(PyObject *py_obj, PyObject *value, void *closure)
10528 : {
10529 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
10530 0 : if (value == NULL) {
10531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
10532 0 : return -1;
10533 : }
10534 : {
10535 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
10536 0 : if (PyLong_Check(value)) {
10537 0 : unsigned long long test_var;
10538 0 : test_var = PyLong_AsUnsignedLongLong(value);
10539 0 : if (PyErr_Occurred() != NULL) {
10540 0 : return -1;
10541 : }
10542 0 : if (test_var > uint_max) {
10543 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10544 : PyLong_Type.tp_name, uint_max, test_var);
10545 0 : return -1;
10546 : }
10547 0 : object->rid = test_var;
10548 : } else {
10549 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10550 : PyLong_Type.tp_name);
10551 0 : return -1;
10552 : }
10553 : }
10554 0 : return 0;
10555 : }
10556 :
10557 0 : static PyObject *py_samr_DispEntryFull_get_acct_flags(PyObject *obj, void *closure)
10558 : {
10559 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
10560 0 : PyObject *py_acct_flags;
10561 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
10562 0 : return py_acct_flags;
10563 : }
10564 :
10565 0 : static int py_samr_DispEntryFull_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
10566 : {
10567 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
10568 0 : if (value == NULL) {
10569 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
10570 0 : return -1;
10571 : }
10572 : {
10573 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
10574 0 : if (PyLong_Check(value)) {
10575 0 : unsigned long long test_var;
10576 0 : test_var = PyLong_AsUnsignedLongLong(value);
10577 0 : if (PyErr_Occurred() != NULL) {
10578 0 : return -1;
10579 : }
10580 0 : if (test_var > uint_max) {
10581 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10582 : PyLong_Type.tp_name, uint_max, test_var);
10583 0 : return -1;
10584 : }
10585 0 : object->acct_flags = test_var;
10586 : } else {
10587 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10588 : PyLong_Type.tp_name);
10589 0 : return -1;
10590 : }
10591 : }
10592 0 : return 0;
10593 : }
10594 :
10595 32 : static PyObject *py_samr_DispEntryFull_get_account_name(PyObject *obj, void *closure)
10596 : {
10597 32 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
10598 0 : PyObject *py_account_name;
10599 32 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
10600 32 : return py_account_name;
10601 : }
10602 :
10603 0 : static int py_samr_DispEntryFull_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
10604 : {
10605 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
10606 0 : if (value == NULL) {
10607 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
10608 0 : return -1;
10609 : }
10610 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10611 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10612 0 : PyErr_NoMemory();
10613 0 : return -1;
10614 : }
10615 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
10616 0 : return 0;
10617 : }
10618 :
10619 60 : static PyObject *py_samr_DispEntryFull_get_description(PyObject *obj, void *closure)
10620 : {
10621 60 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
10622 0 : PyObject *py_description;
10623 60 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
10624 60 : return py_description;
10625 : }
10626 :
10627 0 : static int py_samr_DispEntryFull_set_description(PyObject *py_obj, PyObject *value, void *closure)
10628 : {
10629 0 : struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
10630 0 : if (value == NULL) {
10631 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
10632 0 : return -1;
10633 : }
10634 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10635 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10636 0 : PyErr_NoMemory();
10637 0 : return -1;
10638 : }
10639 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
10640 0 : return 0;
10641 : }
10642 :
10643 : static PyGetSetDef py_samr_DispEntryFull_getsetters[] = {
10644 : {
10645 : .name = discard_const_p(char, "idx"),
10646 : .get = py_samr_DispEntryFull_get_idx,
10647 : .set = py_samr_DispEntryFull_set_idx,
10648 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10649 : },
10650 : {
10651 : .name = discard_const_p(char, "rid"),
10652 : .get = py_samr_DispEntryFull_get_rid,
10653 : .set = py_samr_DispEntryFull_set_rid,
10654 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10655 : },
10656 : {
10657 : .name = discard_const_p(char, "acct_flags"),
10658 : .get = py_samr_DispEntryFull_get_acct_flags,
10659 : .set = py_samr_DispEntryFull_set_acct_flags,
10660 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
10661 : },
10662 : {
10663 : .name = discard_const_p(char, "account_name"),
10664 : .get = py_samr_DispEntryFull_get_account_name,
10665 : .set = py_samr_DispEntryFull_set_account_name,
10666 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10667 : },
10668 : {
10669 : .name = discard_const_p(char, "description"),
10670 : .get = py_samr_DispEntryFull_get_description,
10671 : .set = py_samr_DispEntryFull_set_description,
10672 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
10673 : },
10674 : { .name = NULL }
10675 : };
10676 :
10677 0 : static PyObject *py_samr_DispEntryFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10678 : {
10679 0 : return pytalloc_new(struct samr_DispEntryFull, type);
10680 : }
10681 :
10682 :
10683 : static PyTypeObject samr_DispEntryFull_Type = {
10684 : PyVarObject_HEAD_INIT(NULL, 0)
10685 : .tp_name = "samr.DispEntryFull",
10686 : .tp_getset = py_samr_DispEntryFull_getsetters,
10687 : .tp_methods = NULL,
10688 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10689 : .tp_new = py_samr_DispEntryFull_new,
10690 : };
10691 :
10692 :
10693 0 : static PyObject *py_samr_DispInfoFull_get_count(PyObject *obj, void *closure)
10694 : {
10695 0 : struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj);
10696 0 : PyObject *py_count;
10697 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
10698 0 : return py_count;
10699 : }
10700 :
10701 0 : static int py_samr_DispInfoFull_set_count(PyObject *py_obj, PyObject *value, void *closure)
10702 : {
10703 0 : struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj);
10704 0 : if (value == NULL) {
10705 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
10706 0 : return -1;
10707 : }
10708 : {
10709 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
10710 0 : if (PyLong_Check(value)) {
10711 0 : unsigned long long test_var;
10712 0 : test_var = PyLong_AsUnsignedLongLong(value);
10713 0 : if (PyErr_Occurred() != NULL) {
10714 0 : return -1;
10715 : }
10716 0 : if (test_var > uint_max) {
10717 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10718 : PyLong_Type.tp_name, uint_max, test_var);
10719 0 : return -1;
10720 : }
10721 0 : object->count = test_var;
10722 : } else {
10723 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10724 : PyLong_Type.tp_name);
10725 0 : return -1;
10726 : }
10727 : }
10728 0 : return 0;
10729 : }
10730 :
10731 8 : static PyObject *py_samr_DispInfoFull_get_entries(PyObject *obj, void *closure)
10732 : {
10733 8 : struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj);
10734 0 : PyObject *py_entries;
10735 8 : if (object->entries == NULL) {
10736 0 : Py_RETURN_NONE;
10737 : }
10738 8 : if (object->entries == NULL) {
10739 0 : py_entries = Py_None;
10740 0 : Py_INCREF(py_entries);
10741 : } else {
10742 8 : py_entries = PyList_New(object->count);
10743 8 : if (py_entries == NULL) {
10744 0 : return NULL;
10745 : }
10746 : {
10747 : int entries_cntr_1;
10748 41 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
10749 0 : PyObject *py_entries_1;
10750 33 : py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFull_Type, object->entries, &object->entries[entries_cntr_1]);
10751 33 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
10752 : }
10753 : }
10754 : }
10755 8 : return py_entries;
10756 : }
10757 :
10758 0 : static int py_samr_DispInfoFull_set_entries(PyObject *py_obj, PyObject *value, void *closure)
10759 : {
10760 0 : struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj);
10761 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
10762 0 : if (value == NULL) {
10763 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
10764 0 : return -1;
10765 : }
10766 0 : if (value == Py_None) {
10767 0 : object->entries = NULL;
10768 : } else {
10769 0 : object->entries = NULL;
10770 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
10771 : {
10772 0 : int entries_cntr_1;
10773 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
10774 0 : if (!object->entries) { return -1; }
10775 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
10776 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
10777 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
10778 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
10779 0 : return -1;
10780 : }
10781 0 : PY_CHECK_TYPE(&samr_DispEntryFull_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
10782 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
10783 0 : PyErr_NoMemory();
10784 0 : return -1;
10785 : }
10786 0 : object->entries[entries_cntr_1] = *(struct samr_DispEntryFull *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
10787 : }
10788 : }
10789 : }
10790 0 : return 0;
10791 : }
10792 :
10793 : static PyGetSetDef py_samr_DispInfoFull_getsetters[] = {
10794 : {
10795 : .name = discard_const_p(char, "count"),
10796 : .get = py_samr_DispInfoFull_get_count,
10797 : .set = py_samr_DispInfoFull_set_count,
10798 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10799 : },
10800 : {
10801 : .name = discard_const_p(char, "entries"),
10802 : .get = py_samr_DispInfoFull_get_entries,
10803 : .set = py_samr_DispInfoFull_set_entries,
10804 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryFull")
10805 : },
10806 : { .name = NULL }
10807 : };
10808 :
10809 0 : static PyObject *py_samr_DispInfoFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10810 : {
10811 0 : return pytalloc_new(struct samr_DispInfoFull, type);
10812 : }
10813 :
10814 :
10815 : static PyTypeObject samr_DispInfoFull_Type = {
10816 : PyVarObject_HEAD_INIT(NULL, 0)
10817 : .tp_name = "samr.DispInfoFull",
10818 : .tp_getset = py_samr_DispInfoFull_getsetters,
10819 : .tp_methods = NULL,
10820 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
10821 : .tp_new = py_samr_DispInfoFull_new,
10822 : };
10823 :
10824 :
10825 0 : static PyObject *py_samr_DispEntryFullGroup_get_idx(PyObject *obj, void *closure)
10826 : {
10827 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
10828 0 : PyObject *py_idx;
10829 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx);
10830 0 : return py_idx;
10831 : }
10832 :
10833 0 : static int py_samr_DispEntryFullGroup_set_idx(PyObject *py_obj, PyObject *value, void *closure)
10834 : {
10835 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
10836 0 : if (value == NULL) {
10837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx");
10838 0 : return -1;
10839 : }
10840 : {
10841 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx));
10842 0 : if (PyLong_Check(value)) {
10843 0 : unsigned long long test_var;
10844 0 : test_var = PyLong_AsUnsignedLongLong(value);
10845 0 : if (PyErr_Occurred() != NULL) {
10846 0 : return -1;
10847 : }
10848 0 : if (test_var > uint_max) {
10849 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10850 : PyLong_Type.tp_name, uint_max, test_var);
10851 0 : return -1;
10852 : }
10853 0 : object->idx = test_var;
10854 : } else {
10855 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10856 : PyLong_Type.tp_name);
10857 0 : return -1;
10858 : }
10859 : }
10860 0 : return 0;
10861 : }
10862 :
10863 0 : static PyObject *py_samr_DispEntryFullGroup_get_rid(PyObject *obj, void *closure)
10864 : {
10865 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
10866 0 : PyObject *py_rid;
10867 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->rid);
10868 0 : return py_rid;
10869 : }
10870 :
10871 0 : static int py_samr_DispEntryFullGroup_set_rid(PyObject *py_obj, PyObject *value, void *closure)
10872 : {
10873 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
10874 0 : if (value == NULL) {
10875 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->rid");
10876 0 : return -1;
10877 : }
10878 : {
10879 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->rid));
10880 0 : if (PyLong_Check(value)) {
10881 0 : unsigned long long test_var;
10882 0 : test_var = PyLong_AsUnsignedLongLong(value);
10883 0 : if (PyErr_Occurred() != NULL) {
10884 0 : return -1;
10885 : }
10886 0 : if (test_var > uint_max) {
10887 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10888 : PyLong_Type.tp_name, uint_max, test_var);
10889 0 : return -1;
10890 : }
10891 0 : object->rid = test_var;
10892 : } else {
10893 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10894 : PyLong_Type.tp_name);
10895 0 : return -1;
10896 : }
10897 : }
10898 0 : return 0;
10899 : }
10900 :
10901 0 : static PyObject *py_samr_DispEntryFullGroup_get_acct_flags(PyObject *obj, void *closure)
10902 : {
10903 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
10904 0 : PyObject *py_acct_flags;
10905 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->acct_flags);
10906 0 : return py_acct_flags;
10907 : }
10908 :
10909 0 : static int py_samr_DispEntryFullGroup_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
10910 : {
10911 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
10912 0 : if (value == NULL) {
10913 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->acct_flags");
10914 0 : return -1;
10915 : }
10916 : {
10917 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->acct_flags));
10918 0 : if (PyLong_Check(value)) {
10919 0 : unsigned long long test_var;
10920 0 : test_var = PyLong_AsUnsignedLongLong(value);
10921 0 : if (PyErr_Occurred() != NULL) {
10922 0 : return -1;
10923 : }
10924 0 : if (test_var > uint_max) {
10925 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
10926 : PyLong_Type.tp_name, uint_max, test_var);
10927 0 : return -1;
10928 : }
10929 0 : object->acct_flags = test_var;
10930 : } else {
10931 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
10932 : PyLong_Type.tp_name);
10933 0 : return -1;
10934 : }
10935 : }
10936 0 : return 0;
10937 : }
10938 :
10939 93 : static PyObject *py_samr_DispEntryFullGroup_get_account_name(PyObject *obj, void *closure)
10940 : {
10941 93 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
10942 0 : PyObject *py_account_name;
10943 93 : py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
10944 93 : return py_account_name;
10945 : }
10946 :
10947 0 : static int py_samr_DispEntryFullGroup_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
10948 : {
10949 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
10950 0 : if (value == NULL) {
10951 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
10952 0 : return -1;
10953 : }
10954 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10955 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10956 0 : PyErr_NoMemory();
10957 0 : return -1;
10958 : }
10959 0 : object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
10960 0 : return 0;
10961 : }
10962 :
10963 154 : static PyObject *py_samr_DispEntryFullGroup_get_description(PyObject *obj, void *closure)
10964 : {
10965 154 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
10966 0 : PyObject *py_description;
10967 154 : py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
10968 154 : return py_description;
10969 : }
10970 :
10971 0 : static int py_samr_DispEntryFullGroup_set_description(PyObject *py_obj, PyObject *value, void *closure)
10972 : {
10973 0 : struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
10974 0 : if (value == NULL) {
10975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->description");
10976 0 : return -1;
10977 : }
10978 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
10979 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
10980 0 : PyErr_NoMemory();
10981 0 : return -1;
10982 : }
10983 0 : object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
10984 0 : return 0;
10985 : }
10986 :
10987 : static PyGetSetDef py_samr_DispEntryFullGroup_getsetters[] = {
10988 : {
10989 : .name = discard_const_p(char, "idx"),
10990 : .get = py_samr_DispEntryFullGroup_get_idx,
10991 : .set = py_samr_DispEntryFullGroup_set_idx,
10992 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10993 : },
10994 : {
10995 : .name = discard_const_p(char, "rid"),
10996 : .get = py_samr_DispEntryFullGroup_get_rid,
10997 : .set = py_samr_DispEntryFullGroup_set_rid,
10998 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
10999 : },
11000 : {
11001 : .name = discard_const_p(char, "acct_flags"),
11002 : .get = py_samr_DispEntryFullGroup_get_acct_flags,
11003 : .set = py_samr_DispEntryFullGroup_set_acct_flags,
11004 : .doc = discard_const_p(char, "PIDL-generated element of base type security_GroupAttrs")
11005 : },
11006 : {
11007 : .name = discard_const_p(char, "account_name"),
11008 : .get = py_samr_DispEntryFullGroup_get_account_name,
11009 : .set = py_samr_DispEntryFullGroup_set_account_name,
11010 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11011 : },
11012 : {
11013 : .name = discard_const_p(char, "description"),
11014 : .get = py_samr_DispEntryFullGroup_get_description,
11015 : .set = py_samr_DispEntryFullGroup_set_description,
11016 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11017 : },
11018 : { .name = NULL }
11019 : };
11020 :
11021 0 : static PyObject *py_samr_DispEntryFullGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11022 : {
11023 0 : return pytalloc_new(struct samr_DispEntryFullGroup, type);
11024 : }
11025 :
11026 :
11027 : static PyTypeObject samr_DispEntryFullGroup_Type = {
11028 : PyVarObject_HEAD_INIT(NULL, 0)
11029 : .tp_name = "samr.DispEntryFullGroup",
11030 : .tp_getset = py_samr_DispEntryFullGroup_getsetters,
11031 : .tp_methods = NULL,
11032 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11033 : .tp_new = py_samr_DispEntryFullGroup_new,
11034 : };
11035 :
11036 :
11037 0 : static PyObject *py_samr_DispInfoFullGroups_get_count(PyObject *obj, void *closure)
11038 : {
11039 0 : struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj);
11040 0 : PyObject *py_count;
11041 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11042 0 : return py_count;
11043 : }
11044 :
11045 0 : static int py_samr_DispInfoFullGroups_set_count(PyObject *py_obj, PyObject *value, void *closure)
11046 : {
11047 0 : struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj);
11048 0 : if (value == NULL) {
11049 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11050 0 : return -1;
11051 : }
11052 : {
11053 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11054 0 : if (PyLong_Check(value)) {
11055 0 : unsigned long long test_var;
11056 0 : test_var = PyLong_AsUnsignedLongLong(value);
11057 0 : if (PyErr_Occurred() != NULL) {
11058 0 : return -1;
11059 : }
11060 0 : if (test_var > uint_max) {
11061 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11062 : PyLong_Type.tp_name, uint_max, test_var);
11063 0 : return -1;
11064 : }
11065 0 : object->count = test_var;
11066 : } else {
11067 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11068 : PyLong_Type.tp_name);
11069 0 : return -1;
11070 : }
11071 : }
11072 0 : return 0;
11073 : }
11074 :
11075 8 : static PyObject *py_samr_DispInfoFullGroups_get_entries(PyObject *obj, void *closure)
11076 : {
11077 8 : struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj);
11078 0 : PyObject *py_entries;
11079 8 : if (object->entries == NULL) {
11080 0 : Py_RETURN_NONE;
11081 : }
11082 8 : if (object->entries == NULL) {
11083 0 : py_entries = Py_None;
11084 0 : Py_INCREF(py_entries);
11085 : } else {
11086 8 : py_entries = PyList_New(object->count);
11087 8 : if (py_entries == NULL) {
11088 0 : return NULL;
11089 : }
11090 : {
11091 : int entries_cntr_1;
11092 102 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11093 0 : PyObject *py_entries_1;
11094 94 : py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFullGroup_Type, object->entries, &object->entries[entries_cntr_1]);
11095 94 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11096 : }
11097 : }
11098 : }
11099 8 : return py_entries;
11100 : }
11101 :
11102 0 : static int py_samr_DispInfoFullGroups_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11103 : {
11104 0 : struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj);
11105 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11106 0 : if (value == NULL) {
11107 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11108 0 : return -1;
11109 : }
11110 0 : if (value == Py_None) {
11111 0 : object->entries = NULL;
11112 : } else {
11113 0 : object->entries = NULL;
11114 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11115 : {
11116 0 : int entries_cntr_1;
11117 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11118 0 : if (!object->entries) { return -1; }
11119 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11120 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11121 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11122 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11123 0 : return -1;
11124 : }
11125 0 : PY_CHECK_TYPE(&samr_DispEntryFullGroup_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11126 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11127 0 : PyErr_NoMemory();
11128 0 : return -1;
11129 : }
11130 0 : object->entries[entries_cntr_1] = *(struct samr_DispEntryFullGroup *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11131 : }
11132 : }
11133 : }
11134 0 : return 0;
11135 : }
11136 :
11137 : static PyGetSetDef py_samr_DispInfoFullGroups_getsetters[] = {
11138 : {
11139 : .name = discard_const_p(char, "count"),
11140 : .get = py_samr_DispInfoFullGroups_get_count,
11141 : .set = py_samr_DispInfoFullGroups_set_count,
11142 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11143 : },
11144 : {
11145 : .name = discard_const_p(char, "entries"),
11146 : .get = py_samr_DispInfoFullGroups_get_entries,
11147 : .set = py_samr_DispInfoFullGroups_set_entries,
11148 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryFullGroup")
11149 : },
11150 : { .name = NULL }
11151 : };
11152 :
11153 0 : static PyObject *py_samr_DispInfoFullGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11154 : {
11155 0 : return pytalloc_new(struct samr_DispInfoFullGroups, type);
11156 : }
11157 :
11158 :
11159 : static PyTypeObject samr_DispInfoFullGroups_Type = {
11160 : PyVarObject_HEAD_INIT(NULL, 0)
11161 : .tp_name = "samr.DispInfoFullGroups",
11162 : .tp_getset = py_samr_DispInfoFullGroups_getsetters,
11163 : .tp_methods = NULL,
11164 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11165 : .tp_new = py_samr_DispInfoFullGroups_new,
11166 : };
11167 :
11168 :
11169 0 : static PyObject *py_samr_DispEntryAscii_get_idx(PyObject *obj, void *closure)
11170 : {
11171 0 : struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj);
11172 0 : PyObject *py_idx;
11173 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)object->idx);
11174 0 : return py_idx;
11175 : }
11176 :
11177 0 : static int py_samr_DispEntryAscii_set_idx(PyObject *py_obj, PyObject *value, void *closure)
11178 : {
11179 0 : struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj);
11180 0 : if (value == NULL) {
11181 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idx");
11182 0 : return -1;
11183 : }
11184 : {
11185 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idx));
11186 0 : if (PyLong_Check(value)) {
11187 0 : unsigned long long test_var;
11188 0 : test_var = PyLong_AsUnsignedLongLong(value);
11189 0 : if (PyErr_Occurred() != NULL) {
11190 0 : return -1;
11191 : }
11192 0 : if (test_var > uint_max) {
11193 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11194 : PyLong_Type.tp_name, uint_max, test_var);
11195 0 : return -1;
11196 : }
11197 0 : object->idx = test_var;
11198 : } else {
11199 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11200 : PyLong_Type.tp_name);
11201 0 : return -1;
11202 : }
11203 : }
11204 0 : return 0;
11205 : }
11206 :
11207 358 : static PyObject *py_samr_DispEntryAscii_get_account_name(PyObject *obj, void *closure)
11208 : {
11209 358 : struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj);
11210 0 : PyObject *py_account_name;
11211 358 : py_account_name = pytalloc_reference_ex(lsa_AsciiStringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
11212 358 : return py_account_name;
11213 : }
11214 :
11215 0 : static int py_samr_DispEntryAscii_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
11216 : {
11217 0 : struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj);
11218 0 : if (value == NULL) {
11219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
11220 0 : return -1;
11221 : }
11222 0 : PY_CHECK_TYPE(lsa_AsciiStringLarge_Type, value, return -1;);
11223 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11224 0 : PyErr_NoMemory();
11225 0 : return -1;
11226 : }
11227 0 : object->account_name = *(struct lsa_AsciiStringLarge *)pytalloc_get_ptr(value);
11228 0 : return 0;
11229 : }
11230 :
11231 : static PyGetSetDef py_samr_DispEntryAscii_getsetters[] = {
11232 : {
11233 : .name = discard_const_p(char, "idx"),
11234 : .get = py_samr_DispEntryAscii_get_idx,
11235 : .set = py_samr_DispEntryAscii_set_idx,
11236 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11237 : },
11238 : {
11239 : .name = discard_const_p(char, "account_name"),
11240 : .get = py_samr_DispEntryAscii_get_account_name,
11241 : .set = py_samr_DispEntryAscii_set_account_name,
11242 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiStringLarge")
11243 : },
11244 : { .name = NULL }
11245 : };
11246 :
11247 0 : static PyObject *py_samr_DispEntryAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11248 : {
11249 0 : return pytalloc_new(struct samr_DispEntryAscii, type);
11250 : }
11251 :
11252 :
11253 : static PyTypeObject samr_DispEntryAscii_Type = {
11254 : PyVarObject_HEAD_INIT(NULL, 0)
11255 : .tp_name = "samr.DispEntryAscii",
11256 : .tp_getset = py_samr_DispEntryAscii_getsetters,
11257 : .tp_methods = NULL,
11258 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11259 : .tp_new = py_samr_DispEntryAscii_new,
11260 : };
11261 :
11262 :
11263 0 : static PyObject *py_samr_DispInfoAscii_get_count(PyObject *obj, void *closure)
11264 : {
11265 0 : struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj);
11266 0 : PyObject *py_count;
11267 0 : py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
11268 0 : return py_count;
11269 : }
11270 :
11271 0 : static int py_samr_DispInfoAscii_set_count(PyObject *py_obj, PyObject *value, void *closure)
11272 : {
11273 0 : struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj);
11274 0 : if (value == NULL) {
11275 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
11276 0 : return -1;
11277 : }
11278 : {
11279 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
11280 0 : if (PyLong_Check(value)) {
11281 0 : unsigned long long test_var;
11282 0 : test_var = PyLong_AsUnsignedLongLong(value);
11283 0 : if (PyErr_Occurred() != NULL) {
11284 0 : return -1;
11285 : }
11286 0 : if (test_var > uint_max) {
11287 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11288 : PyLong_Type.tp_name, uint_max, test_var);
11289 0 : return -1;
11290 : }
11291 0 : object->count = test_var;
11292 : } else {
11293 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11294 : PyLong_Type.tp_name);
11295 0 : return -1;
11296 : }
11297 : }
11298 0 : return 0;
11299 : }
11300 :
11301 16 : static PyObject *py_samr_DispInfoAscii_get_entries(PyObject *obj, void *closure)
11302 : {
11303 16 : struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj);
11304 0 : PyObject *py_entries;
11305 16 : if (object->entries == NULL) {
11306 0 : Py_RETURN_NONE;
11307 : }
11308 16 : if (object->entries == NULL) {
11309 0 : py_entries = Py_None;
11310 0 : Py_INCREF(py_entries);
11311 : } else {
11312 16 : py_entries = PyList_New(object->count);
11313 16 : if (py_entries == NULL) {
11314 0 : return NULL;
11315 : }
11316 : {
11317 : int entries_cntr_1;
11318 197 : for (entries_cntr_1 = 0; entries_cntr_1 < (object->count); entries_cntr_1++) {
11319 0 : PyObject *py_entries_1;
11320 181 : py_entries_1 = pytalloc_reference_ex(&samr_DispEntryAscii_Type, object->entries, &object->entries[entries_cntr_1]);
11321 181 : PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
11322 : }
11323 : }
11324 : }
11325 16 : return py_entries;
11326 : }
11327 :
11328 0 : static int py_samr_DispInfoAscii_set_entries(PyObject *py_obj, PyObject *value, void *closure)
11329 : {
11330 0 : struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj);
11331 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->entries));
11332 0 : if (value == NULL) {
11333 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries");
11334 0 : return -1;
11335 : }
11336 0 : if (value == Py_None) {
11337 0 : object->entries = NULL;
11338 : } else {
11339 0 : object->entries = NULL;
11340 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
11341 : {
11342 0 : int entries_cntr_1;
11343 0 : object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
11344 0 : if (!object->entries) { return -1; }
11345 0 : talloc_set_name_const(object->entries, "ARRAY: object->entries");
11346 0 : for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
11347 0 : if (PyList_GET_ITEM(value, entries_cntr_1) == NULL) {
11348 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->entries[entries_cntr_1]");
11349 0 : return -1;
11350 : }
11351 0 : PY_CHECK_TYPE(&samr_DispEntryAscii_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
11352 0 : if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
11353 0 : PyErr_NoMemory();
11354 0 : return -1;
11355 : }
11356 0 : object->entries[entries_cntr_1] = *(struct samr_DispEntryAscii *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
11357 : }
11358 : }
11359 : }
11360 0 : return 0;
11361 : }
11362 :
11363 : static PyGetSetDef py_samr_DispInfoAscii_getsetters[] = {
11364 : {
11365 : .name = discard_const_p(char, "count"),
11366 : .get = py_samr_DispInfoAscii_get_count,
11367 : .set = py_samr_DispInfoAscii_set_count,
11368 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
11369 : },
11370 : {
11371 : .name = discard_const_p(char, "entries"),
11372 : .get = py_samr_DispInfoAscii_get_entries,
11373 : .set = py_samr_DispInfoAscii_set_entries,
11374 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispEntryAscii")
11375 : },
11376 : { .name = NULL }
11377 : };
11378 :
11379 0 : static PyObject *py_samr_DispInfoAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11380 : {
11381 0 : return pytalloc_new(struct samr_DispInfoAscii, type);
11382 : }
11383 :
11384 :
11385 : static PyTypeObject samr_DispInfoAscii_Type = {
11386 : PyVarObject_HEAD_INIT(NULL, 0)
11387 : .tp_name = "samr.DispInfoAscii",
11388 : .tp_getset = py_samr_DispInfoAscii_getsetters,
11389 : .tp_methods = NULL,
11390 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11391 : .tp_new = py_samr_DispInfoAscii_new,
11392 : };
11393 :
11394 45 : static PyObject *py_import_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, union samr_DispInfo *in)
11395 : {
11396 0 : PyObject *ret;
11397 :
11398 45 : switch (level) {
11399 9 : case 1:
11400 9 : ret = pytalloc_reference_ex(&samr_DispInfoGeneral_Type, mem_ctx, &in->info1);
11401 9 : return ret;
11402 :
11403 9 : case 2:
11404 9 : ret = pytalloc_reference_ex(&samr_DispInfoFull_Type, mem_ctx, &in->info2);
11405 9 : return ret;
11406 :
11407 9 : case 3:
11408 9 : ret = pytalloc_reference_ex(&samr_DispInfoFullGroups_Type, mem_ctx, &in->info3);
11409 9 : return ret;
11410 :
11411 9 : case 4:
11412 9 : ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info4);
11413 9 : return ret;
11414 :
11415 9 : case 5:
11416 9 : ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info5);
11417 9 : return ret;
11418 :
11419 : }
11420 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11421 0 : return NULL;
11422 : }
11423 :
11424 0 : static union samr_DispInfo *py_export_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11425 : {
11426 0 : union samr_DispInfo *ret = talloc_zero(mem_ctx, union samr_DispInfo);
11427 0 : switch (level) {
11428 0 : case 1:
11429 0 : if (in == NULL) {
11430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
11431 0 : talloc_free(ret); return NULL;
11432 : }
11433 0 : PY_CHECK_TYPE(&samr_DispInfoGeneral_Type, in, talloc_free(ret); return NULL;);
11434 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11435 0 : PyErr_NoMemory();
11436 0 : talloc_free(ret); return NULL;
11437 : }
11438 0 : ret->info1 = *(struct samr_DispInfoGeneral *)pytalloc_get_ptr(in);
11439 0 : break;
11440 :
11441 0 : case 2:
11442 0 : if (in == NULL) {
11443 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2");
11444 0 : talloc_free(ret); return NULL;
11445 : }
11446 0 : PY_CHECK_TYPE(&samr_DispInfoFull_Type, in, talloc_free(ret); return NULL;);
11447 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11448 0 : PyErr_NoMemory();
11449 0 : talloc_free(ret); return NULL;
11450 : }
11451 0 : ret->info2 = *(struct samr_DispInfoFull *)pytalloc_get_ptr(in);
11452 0 : break;
11453 :
11454 0 : case 3:
11455 0 : if (in == NULL) {
11456 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
11457 0 : talloc_free(ret); return NULL;
11458 : }
11459 0 : PY_CHECK_TYPE(&samr_DispInfoFullGroups_Type, in, talloc_free(ret); return NULL;);
11460 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11461 0 : PyErr_NoMemory();
11462 0 : talloc_free(ret); return NULL;
11463 : }
11464 0 : ret->info3 = *(struct samr_DispInfoFullGroups *)pytalloc_get_ptr(in);
11465 0 : break;
11466 :
11467 0 : case 4:
11468 0 : if (in == NULL) {
11469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info4");
11470 0 : talloc_free(ret); return NULL;
11471 : }
11472 0 : PY_CHECK_TYPE(&samr_DispInfoAscii_Type, in, talloc_free(ret); return NULL;);
11473 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11474 0 : PyErr_NoMemory();
11475 0 : talloc_free(ret); return NULL;
11476 : }
11477 0 : ret->info4 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
11478 0 : break;
11479 :
11480 0 : case 5:
11481 0 : if (in == NULL) {
11482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info5");
11483 0 : talloc_free(ret); return NULL;
11484 : }
11485 0 : PY_CHECK_TYPE(&samr_DispInfoAscii_Type, in, talloc_free(ret); return NULL;);
11486 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11487 0 : PyErr_NoMemory();
11488 0 : talloc_free(ret); return NULL;
11489 : }
11490 0 : ret->info5 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
11491 0 : break;
11492 :
11493 0 : default:
11494 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11495 0 : talloc_free(ret);
11496 0 : ret = NULL;
11497 : }
11498 :
11499 0 : return ret;
11500 : }
11501 :
11502 45 : static PyObject *py_samr_DispInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11503 : {
11504 45 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11505 45 : PyObject *mem_ctx_obj = NULL;
11506 45 : TALLOC_CTX *mem_ctx = NULL;
11507 45 : int level = 0;
11508 45 : PyObject *in_obj = NULL;
11509 45 : union samr_DispInfo *in = NULL;
11510 :
11511 45 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11512 : discard_const_p(char *, kwnames),
11513 : &mem_ctx_obj,
11514 : &level,
11515 : &in_obj)) {
11516 0 : return NULL;
11517 : }
11518 45 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11519 45 : if (mem_ctx == NULL) {
11520 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11521 0 : return NULL;
11522 : }
11523 45 : in = (union samr_DispInfo *)pytalloc_get_ptr(in_obj);
11524 45 : if (in == NULL) {
11525 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_DispInfo!");
11526 0 : return NULL;
11527 : }
11528 :
11529 45 : return py_import_samr_DispInfo(mem_ctx, level, in);
11530 : }
11531 :
11532 0 : static PyObject *py_samr_DispInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11533 : {
11534 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11535 0 : PyObject *mem_ctx_obj = NULL;
11536 0 : TALLOC_CTX *mem_ctx = NULL;
11537 0 : int level = 0;
11538 0 : PyObject *in = NULL;
11539 0 : union samr_DispInfo *out = NULL;
11540 :
11541 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11542 : discard_const_p(char *, kwnames),
11543 : &mem_ctx_obj,
11544 : &level,
11545 : &in)) {
11546 0 : return NULL;
11547 : }
11548 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11549 0 : if (mem_ctx == NULL) {
11550 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11551 0 : return NULL;
11552 : }
11553 :
11554 0 : out = py_export_samr_DispInfo(mem_ctx, level, in);
11555 0 : if (out == NULL) {
11556 0 : return NULL;
11557 : }
11558 :
11559 0 : return pytalloc_GenericObject_reference(out);
11560 : }
11561 :
11562 : static PyMethodDef py_samr_DispInfo_methods[] = {
11563 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DispInfo_import),
11564 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11565 : "T.__import__(mem_ctx, level, in) => ret." },
11566 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DispInfo_export),
11567 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
11568 : "T.__export__(mem_ctx, level, in) => ret." },
11569 : { NULL, NULL, 0, NULL }
11570 : };
11571 :
11572 0 : static PyObject *py_samr_DispInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11573 : {
11574 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
11575 0 : return NULL;
11576 : }
11577 :
11578 :
11579 : static PyTypeObject samr_DispInfo_Type = {
11580 : PyVarObject_HEAD_INIT(NULL, 0)
11581 : .tp_name = "samr.DispInfo",
11582 : .tp_getset = NULL,
11583 : .tp_methods = py_samr_DispInfo_methods,
11584 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11585 : .tp_new = py_samr_DispInfo_new,
11586 : };
11587 :
11588 :
11589 0 : static PyObject *py_samr_PwInfo_get_min_password_length(PyObject *obj, void *closure)
11590 : {
11591 0 : struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj);
11592 0 : PyObject *py_min_password_length;
11593 0 : py_min_password_length = PyLong_FromLong((uint16_t)object->min_password_length);
11594 0 : return py_min_password_length;
11595 : }
11596 :
11597 0 : static int py_samr_PwInfo_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
11598 : {
11599 0 : struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj);
11600 0 : if (value == NULL) {
11601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->min_password_length");
11602 0 : return -1;
11603 : }
11604 : {
11605 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_password_length));
11606 0 : if (PyLong_Check(value)) {
11607 0 : unsigned long long test_var;
11608 0 : test_var = PyLong_AsUnsignedLongLong(value);
11609 0 : if (PyErr_Occurred() != NULL) {
11610 0 : return -1;
11611 : }
11612 0 : if (test_var > uint_max) {
11613 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11614 : PyLong_Type.tp_name, uint_max, test_var);
11615 0 : return -1;
11616 : }
11617 0 : object->min_password_length = test_var;
11618 : } else {
11619 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11620 : PyLong_Type.tp_name);
11621 0 : return -1;
11622 : }
11623 : }
11624 0 : return 0;
11625 : }
11626 :
11627 0 : static PyObject *py_samr_PwInfo_get_password_properties(PyObject *obj, void *closure)
11628 : {
11629 0 : struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj);
11630 0 : PyObject *py_password_properties;
11631 0 : py_password_properties = PyLong_FromUnsignedLongLong((uint32_t)object->password_properties);
11632 0 : return py_password_properties;
11633 : }
11634 :
11635 0 : static int py_samr_PwInfo_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
11636 : {
11637 0 : struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj);
11638 0 : if (value == NULL) {
11639 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_properties");
11640 0 : return -1;
11641 : }
11642 : {
11643 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_properties));
11644 0 : if (PyLong_Check(value)) {
11645 0 : unsigned long long test_var;
11646 0 : test_var = PyLong_AsUnsignedLongLong(value);
11647 0 : if (PyErr_Occurred() != NULL) {
11648 0 : return -1;
11649 : }
11650 0 : if (test_var > uint_max) {
11651 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11652 : PyLong_Type.tp_name, uint_max, test_var);
11653 0 : return -1;
11654 : }
11655 0 : object->password_properties = test_var;
11656 : } else {
11657 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11658 : PyLong_Type.tp_name);
11659 0 : return -1;
11660 : }
11661 : }
11662 0 : return 0;
11663 : }
11664 :
11665 : static PyGetSetDef py_samr_PwInfo_getsetters[] = {
11666 : {
11667 : .name = discard_const_p(char, "min_password_length"),
11668 : .get = py_samr_PwInfo_get_min_password_length,
11669 : .set = py_samr_PwInfo_set_min_password_length,
11670 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
11671 : },
11672 : {
11673 : .name = discard_const_p(char, "password_properties"),
11674 : .get = py_samr_PwInfo_get_password_properties,
11675 : .set = py_samr_PwInfo_set_password_properties,
11676 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_PasswordProperties")
11677 : },
11678 : { .name = NULL }
11679 : };
11680 :
11681 0 : static PyObject *py_samr_PwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11682 : {
11683 0 : return pytalloc_new(struct samr_PwInfo, type);
11684 : }
11685 :
11686 :
11687 : static PyTypeObject samr_PwInfo_Type = {
11688 : PyVarObject_HEAD_INIT(NULL, 0)
11689 : .tp_name = "samr.PwInfo",
11690 : .tp_getset = py_samr_PwInfo_getsetters,
11691 : .tp_methods = NULL,
11692 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11693 : .tp_new = py_samr_PwInfo_new,
11694 : };
11695 :
11696 :
11697 0 : static PyObject *py_userPwdChangeFailureInformation_get_extendedFailureReason(PyObject *obj, void *closure)
11698 : {
11699 0 : struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj);
11700 0 : PyObject *py_extendedFailureReason;
11701 0 : py_extendedFailureReason = PyLong_FromUnsignedLongLong((uint32_t)object->extendedFailureReason);
11702 0 : return py_extendedFailureReason;
11703 : }
11704 :
11705 0 : static int py_userPwdChangeFailureInformation_set_extendedFailureReason(PyObject *py_obj, PyObject *value, void *closure)
11706 : {
11707 0 : struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj);
11708 0 : if (value == NULL) {
11709 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->extendedFailureReason");
11710 0 : return -1;
11711 : }
11712 : {
11713 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->extendedFailureReason));
11714 0 : if (PyLong_Check(value)) {
11715 0 : unsigned long long test_var;
11716 0 : test_var = PyLong_AsUnsignedLongLong(value);
11717 0 : if (PyErr_Occurred() != NULL) {
11718 0 : return -1;
11719 : }
11720 0 : if (test_var > uint_max) {
11721 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11722 : PyLong_Type.tp_name, uint_max, test_var);
11723 0 : return -1;
11724 : }
11725 0 : object->extendedFailureReason = test_var;
11726 : } else {
11727 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11728 : PyLong_Type.tp_name);
11729 0 : return -1;
11730 : }
11731 : }
11732 0 : return 0;
11733 : }
11734 :
11735 0 : static PyObject *py_userPwdChangeFailureInformation_get_filterModuleName(PyObject *obj, void *closure)
11736 : {
11737 0 : struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj);
11738 0 : PyObject *py_filterModuleName;
11739 0 : py_filterModuleName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->filterModuleName);
11740 0 : return py_filterModuleName;
11741 : }
11742 :
11743 0 : static int py_userPwdChangeFailureInformation_set_filterModuleName(PyObject *py_obj, PyObject *value, void *closure)
11744 : {
11745 0 : struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj);
11746 0 : if (value == NULL) {
11747 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->filterModuleName");
11748 0 : return -1;
11749 : }
11750 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
11751 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
11752 0 : PyErr_NoMemory();
11753 0 : return -1;
11754 : }
11755 0 : object->filterModuleName = *(struct lsa_String *)pytalloc_get_ptr(value);
11756 0 : return 0;
11757 : }
11758 :
11759 : static PyGetSetDef py_userPwdChangeFailureInformation_getsetters[] = {
11760 : {
11761 : .name = discard_const_p(char, "extendedFailureReason"),
11762 : .get = py_userPwdChangeFailureInformation_get_extendedFailureReason,
11763 : .set = py_userPwdChangeFailureInformation_set_extendedFailureReason,
11764 : .doc = discard_const_p(char, "PIDL-generated element of base type samPwdChangeReason")
11765 : },
11766 : {
11767 : .name = discard_const_p(char, "filterModuleName"),
11768 : .get = py_userPwdChangeFailureInformation_get_filterModuleName,
11769 : .set = py_userPwdChangeFailureInformation_set_filterModuleName,
11770 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
11771 : },
11772 : { .name = NULL }
11773 : };
11774 :
11775 0 : static PyObject *py_userPwdChangeFailureInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11776 : {
11777 0 : return pytalloc_new(struct userPwdChangeFailureInformation, type);
11778 : }
11779 :
11780 :
11781 : static PyTypeObject userPwdChangeFailureInformation_Type = {
11782 : PyVarObject_HEAD_INIT(NULL, 0)
11783 : .tp_name = "samr.userPwdChangeFailureInformation",
11784 : .tp_getset = py_userPwdChangeFailureInformation_getsetters,
11785 : .tp_methods = NULL,
11786 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11787 : .tp_new = py_userPwdChangeFailureInformation_new,
11788 : };
11789 :
11790 :
11791 0 : static PyObject *py_samr_ConnectInfo1_get_client_version(PyObject *obj, void *closure)
11792 : {
11793 0 : struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj);
11794 0 : PyObject *py_client_version;
11795 0 : py_client_version = PyLong_FromUnsignedLongLong((uint32_t)object->client_version);
11796 0 : return py_client_version;
11797 : }
11798 :
11799 0 : static int py_samr_ConnectInfo1_set_client_version(PyObject *py_obj, PyObject *value, void *closure)
11800 : {
11801 0 : struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj);
11802 0 : if (value == NULL) {
11803 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_version");
11804 0 : return -1;
11805 : }
11806 : {
11807 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->client_version));
11808 0 : if (PyLong_Check(value)) {
11809 0 : unsigned long long test_var;
11810 0 : test_var = PyLong_AsUnsignedLongLong(value);
11811 0 : if (PyErr_Occurred() != NULL) {
11812 0 : return -1;
11813 : }
11814 0 : if (test_var > uint_max) {
11815 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11816 : PyLong_Type.tp_name, uint_max, test_var);
11817 0 : return -1;
11818 : }
11819 0 : object->client_version = test_var;
11820 : } else {
11821 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11822 : PyLong_Type.tp_name);
11823 0 : return -1;
11824 : }
11825 : }
11826 0 : return 0;
11827 : }
11828 :
11829 0 : static PyObject *py_samr_ConnectInfo1_get_supported_features(PyObject *obj, void *closure)
11830 : {
11831 0 : struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj);
11832 0 : PyObject *py_supported_features;
11833 0 : py_supported_features = PyLong_FromUnsignedLongLong((uint32_t)object->supported_features);
11834 0 : return py_supported_features;
11835 : }
11836 :
11837 0 : static int py_samr_ConnectInfo1_set_supported_features(PyObject *py_obj, PyObject *value, void *closure)
11838 : {
11839 0 : struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj);
11840 0 : if (value == NULL) {
11841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->supported_features");
11842 0 : return -1;
11843 : }
11844 : {
11845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->supported_features));
11846 0 : if (PyLong_Check(value)) {
11847 0 : unsigned long long test_var;
11848 0 : test_var = PyLong_AsUnsignedLongLong(value);
11849 0 : if (PyErr_Occurred() != NULL) {
11850 0 : return -1;
11851 : }
11852 0 : if (test_var > uint_max) {
11853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
11854 : PyLong_Type.tp_name, uint_max, test_var);
11855 0 : return -1;
11856 : }
11857 0 : object->supported_features = test_var;
11858 : } else {
11859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
11860 : PyLong_Type.tp_name);
11861 0 : return -1;
11862 : }
11863 : }
11864 0 : return 0;
11865 : }
11866 :
11867 : static PyGetSetDef py_samr_ConnectInfo1_getsetters[] = {
11868 : {
11869 : .name = discard_const_p(char, "client_version"),
11870 : .get = py_samr_ConnectInfo1_get_client_version,
11871 : .set = py_samr_ConnectInfo1_set_client_version,
11872 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectVersion")
11873 : },
11874 : {
11875 : .name = discard_const_p(char, "supported_features"),
11876 : .get = py_samr_ConnectInfo1_get_supported_features,
11877 : .set = py_samr_ConnectInfo1_set_supported_features,
11878 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SupportedFeatures")
11879 : },
11880 : { .name = NULL }
11881 : };
11882 :
11883 1 : static PyObject *py_samr_ConnectInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11884 : {
11885 1 : return pytalloc_new(struct samr_ConnectInfo1, type);
11886 : }
11887 :
11888 :
11889 : static PyTypeObject samr_ConnectInfo1_Type = {
11890 : PyVarObject_HEAD_INIT(NULL, 0)
11891 : .tp_name = "samr.ConnectInfo1",
11892 : .tp_getset = py_samr_ConnectInfo1_getsetters,
11893 : .tp_methods = NULL,
11894 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11895 : .tp_new = py_samr_ConnectInfo1_new,
11896 : };
11897 :
11898 1 : static PyObject *py_import_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, union samr_ConnectInfo *in)
11899 : {
11900 0 : PyObject *ret;
11901 :
11902 1 : switch (level) {
11903 1 : case 1:
11904 1 : ret = pytalloc_reference_ex(&samr_ConnectInfo1_Type, mem_ctx, &in->info1);
11905 1 : return ret;
11906 :
11907 : }
11908 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
11909 0 : return NULL;
11910 : }
11911 :
11912 1 : static union samr_ConnectInfo *py_export_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
11913 : {
11914 1 : union samr_ConnectInfo *ret = talloc_zero(mem_ctx, union samr_ConnectInfo);
11915 1 : switch (level) {
11916 1 : case 1:
11917 1 : if (in == NULL) {
11918 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
11919 0 : talloc_free(ret); return NULL;
11920 : }
11921 1 : PY_CHECK_TYPE(&samr_ConnectInfo1_Type, in, talloc_free(ret); return NULL;);
11922 1 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
11923 0 : PyErr_NoMemory();
11924 0 : talloc_free(ret); return NULL;
11925 : }
11926 1 : ret->info1 = *(struct samr_ConnectInfo1 *)pytalloc_get_ptr(in);
11927 1 : break;
11928 :
11929 0 : default:
11930 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
11931 0 : talloc_free(ret);
11932 0 : ret = NULL;
11933 : }
11934 :
11935 1 : return ret;
11936 : }
11937 :
11938 1 : static PyObject *py_samr_ConnectInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11939 : {
11940 1 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11941 1 : PyObject *mem_ctx_obj = NULL;
11942 1 : TALLOC_CTX *mem_ctx = NULL;
11943 1 : int level = 0;
11944 1 : PyObject *in_obj = NULL;
11945 1 : union samr_ConnectInfo *in = NULL;
11946 :
11947 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
11948 : discard_const_p(char *, kwnames),
11949 : &mem_ctx_obj,
11950 : &level,
11951 : &in_obj)) {
11952 0 : return NULL;
11953 : }
11954 1 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11955 1 : if (mem_ctx == NULL) {
11956 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11957 0 : return NULL;
11958 : }
11959 1 : in = (union samr_ConnectInfo *)pytalloc_get_ptr(in_obj);
11960 1 : if (in == NULL) {
11961 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ConnectInfo!");
11962 0 : return NULL;
11963 : }
11964 :
11965 1 : return py_import_samr_ConnectInfo(mem_ctx, level, in);
11966 : }
11967 :
11968 1 : static PyObject *py_samr_ConnectInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11969 : {
11970 1 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
11971 1 : PyObject *mem_ctx_obj = NULL;
11972 1 : TALLOC_CTX *mem_ctx = NULL;
11973 1 : int level = 0;
11974 1 : PyObject *in = NULL;
11975 1 : union samr_ConnectInfo *out = NULL;
11976 :
11977 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
11978 : discard_const_p(char *, kwnames),
11979 : &mem_ctx_obj,
11980 : &level,
11981 : &in)) {
11982 0 : return NULL;
11983 : }
11984 1 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
11985 1 : if (mem_ctx == NULL) {
11986 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
11987 0 : return NULL;
11988 : }
11989 :
11990 1 : out = py_export_samr_ConnectInfo(mem_ctx, level, in);
11991 1 : if (out == NULL) {
11992 0 : return NULL;
11993 : }
11994 :
11995 1 : return pytalloc_GenericObject_reference(out);
11996 : }
11997 :
11998 : static PyMethodDef py_samr_ConnectInfo_methods[] = {
11999 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ConnectInfo_import),
12000 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12001 : "T.__import__(mem_ctx, level, in) => ret." },
12002 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ConnectInfo_export),
12003 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12004 : "T.__export__(mem_ctx, level, in) => ret." },
12005 : { NULL, NULL, 0, NULL }
12006 : };
12007 :
12008 0 : static PyObject *py_samr_ConnectInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12009 : {
12010 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
12011 0 : return NULL;
12012 : }
12013 :
12014 :
12015 : static PyTypeObject samr_ConnectInfo_Type = {
12016 : PyVarObject_HEAD_INIT(NULL, 0)
12017 : .tp_name = "samr.ConnectInfo",
12018 : .tp_getset = NULL,
12019 : .tp_methods = py_samr_ConnectInfo_methods,
12020 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12021 : .tp_new = py_samr_ConnectInfo_new,
12022 : };
12023 :
12024 :
12025 0 : static PyObject *py_samr_ValidationBlob_get_length(PyObject *obj, void *closure)
12026 : {
12027 0 : struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
12028 0 : PyObject *py_length;
12029 0 : py_length = PyLong_FromUnsignedLongLong((uint32_t)object->length);
12030 0 : return py_length;
12031 : }
12032 :
12033 0 : static int py_samr_ValidationBlob_set_length(PyObject *py_obj, PyObject *value, void *closure)
12034 : {
12035 0 : struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj);
12036 0 : if (value == NULL) {
12037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->length");
12038 0 : return -1;
12039 : }
12040 : {
12041 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->length));
12042 0 : if (PyLong_Check(value)) {
12043 0 : unsigned long long test_var;
12044 0 : test_var = PyLong_AsUnsignedLongLong(value);
12045 0 : if (PyErr_Occurred() != NULL) {
12046 0 : return -1;
12047 : }
12048 0 : if (test_var > uint_max) {
12049 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12050 : PyLong_Type.tp_name, uint_max, test_var);
12051 0 : return -1;
12052 : }
12053 0 : object->length = test_var;
12054 : } else {
12055 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12056 : PyLong_Type.tp_name);
12057 0 : return -1;
12058 : }
12059 : }
12060 0 : return 0;
12061 : }
12062 :
12063 0 : static PyObject *py_samr_ValidationBlob_get_data(PyObject *obj, void *closure)
12064 : {
12065 0 : struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
12066 0 : PyObject *py_data;
12067 0 : if (object->data == NULL) {
12068 0 : Py_RETURN_NONE;
12069 : }
12070 0 : if (object->data == NULL) {
12071 0 : py_data = Py_None;
12072 0 : Py_INCREF(py_data);
12073 : } else {
12074 0 : py_data = PyList_New(object->length);
12075 0 : if (py_data == NULL) {
12076 0 : return NULL;
12077 : }
12078 : {
12079 : int data_cntr_1;
12080 0 : for (data_cntr_1 = 0; data_cntr_1 < (object->length); data_cntr_1++) {
12081 0 : PyObject *py_data_1;
12082 0 : py_data_1 = PyLong_FromLong((uint16_t)object->data[data_cntr_1]);
12083 0 : PyList_SetItem(py_data, data_cntr_1, py_data_1);
12084 : }
12085 : }
12086 : }
12087 0 : return py_data;
12088 : }
12089 :
12090 0 : static int py_samr_ValidationBlob_set_data(PyObject *py_obj, PyObject *value, void *closure)
12091 : {
12092 0 : struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj);
12093 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
12094 0 : if (value == NULL) {
12095 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
12096 0 : return -1;
12097 : }
12098 0 : if (value == Py_None) {
12099 0 : object->data = NULL;
12100 : } else {
12101 0 : object->data = NULL;
12102 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12103 : {
12104 0 : int data_cntr_1;
12105 0 : object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
12106 0 : if (!object->data) { return -1; }
12107 0 : talloc_set_name_const(object->data, "ARRAY: object->data");
12108 0 : for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
12109 0 : if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
12110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data[data_cntr_1]");
12111 0 : return -1;
12112 : }
12113 : {
12114 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data[data_cntr_1]));
12115 0 : if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
12116 0 : unsigned long long test_var;
12117 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
12118 0 : if (PyErr_Occurred() != NULL) {
12119 0 : return -1;
12120 : }
12121 0 : if (test_var > uint_max) {
12122 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12123 : PyLong_Type.tp_name, uint_max, test_var);
12124 0 : return -1;
12125 : }
12126 0 : object->data[data_cntr_1] = test_var;
12127 : } else {
12128 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12129 : PyLong_Type.tp_name);
12130 0 : return -1;
12131 : }
12132 : }
12133 : }
12134 : }
12135 : }
12136 0 : return 0;
12137 : }
12138 :
12139 : static PyGetSetDef py_samr_ValidationBlob_getsetters[] = {
12140 : {
12141 : .name = discard_const_p(char, "length"),
12142 : .get = py_samr_ValidationBlob_get_length,
12143 : .set = py_samr_ValidationBlob_set_length,
12144 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12145 : },
12146 : {
12147 : .name = discard_const_p(char, "data"),
12148 : .get = py_samr_ValidationBlob_get_data,
12149 : .set = py_samr_ValidationBlob_set_data,
12150 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12151 : },
12152 : { .name = NULL }
12153 : };
12154 :
12155 0 : static PyObject *py_samr_ValidationBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12156 : {
12157 0 : return pytalloc_new(struct samr_ValidationBlob, type);
12158 : }
12159 :
12160 :
12161 : static PyTypeObject samr_ValidationBlob_Type = {
12162 : PyVarObject_HEAD_INIT(NULL, 0)
12163 : .tp_name = "samr.ValidationBlob",
12164 : .tp_getset = py_samr_ValidationBlob_getsetters,
12165 : .tp_methods = NULL,
12166 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12167 : .tp_new = py_samr_ValidationBlob_new,
12168 : };
12169 :
12170 :
12171 0 : static PyObject *py_samr_ValidatePasswordInfo_get_fields_present(PyObject *obj, void *closure)
12172 : {
12173 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12174 0 : PyObject *py_fields_present;
12175 0 : py_fields_present = PyLong_FromUnsignedLongLong((uint32_t)object->fields_present);
12176 0 : return py_fields_present;
12177 : }
12178 :
12179 0 : static int py_samr_ValidatePasswordInfo_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
12180 : {
12181 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12182 0 : if (value == NULL) {
12183 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fields_present");
12184 0 : return -1;
12185 : }
12186 : {
12187 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fields_present));
12188 0 : if (PyLong_Check(value)) {
12189 0 : unsigned long long test_var;
12190 0 : test_var = PyLong_AsUnsignedLongLong(value);
12191 0 : if (PyErr_Occurred() != NULL) {
12192 0 : return -1;
12193 : }
12194 0 : if (test_var > uint_max) {
12195 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12196 : PyLong_Type.tp_name, uint_max, test_var);
12197 0 : return -1;
12198 : }
12199 0 : object->fields_present = test_var;
12200 : } else {
12201 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12202 : PyLong_Type.tp_name);
12203 0 : return -1;
12204 : }
12205 : }
12206 0 : return 0;
12207 : }
12208 :
12209 0 : static PyObject *py_samr_ValidatePasswordInfo_get_last_password_change(PyObject *obj, void *closure)
12210 : {
12211 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12212 0 : PyObject *py_last_password_change;
12213 0 : py_last_password_change = PyLong_FromUnsignedLongLong(object->last_password_change);
12214 0 : return py_last_password_change;
12215 : }
12216 :
12217 0 : static int py_samr_ValidatePasswordInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
12218 : {
12219 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12220 0 : if (value == NULL) {
12221 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->last_password_change");
12222 0 : return -1;
12223 : }
12224 : {
12225 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->last_password_change));
12226 0 : if (PyLong_Check(value)) {
12227 0 : unsigned long long test_var;
12228 0 : test_var = PyLong_AsUnsignedLongLong(value);
12229 0 : if (PyErr_Occurred() != NULL) {
12230 0 : return -1;
12231 : }
12232 0 : if (test_var > uint_max) {
12233 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12234 : PyLong_Type.tp_name, uint_max, test_var);
12235 0 : return -1;
12236 : }
12237 0 : object->last_password_change = test_var;
12238 : } else {
12239 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12240 : PyLong_Type.tp_name);
12241 0 : return -1;
12242 : }
12243 : }
12244 0 : return 0;
12245 : }
12246 :
12247 0 : static PyObject *py_samr_ValidatePasswordInfo_get_bad_password_time(PyObject *obj, void *closure)
12248 : {
12249 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12250 0 : PyObject *py_bad_password_time;
12251 0 : py_bad_password_time = PyLong_FromUnsignedLongLong(object->bad_password_time);
12252 0 : return py_bad_password_time;
12253 : }
12254 :
12255 0 : static int py_samr_ValidatePasswordInfo_set_bad_password_time(PyObject *py_obj, PyObject *value, void *closure)
12256 : {
12257 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12258 0 : if (value == NULL) {
12259 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_password_time");
12260 0 : return -1;
12261 : }
12262 : {
12263 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_password_time));
12264 0 : if (PyLong_Check(value)) {
12265 0 : unsigned long long test_var;
12266 0 : test_var = PyLong_AsUnsignedLongLong(value);
12267 0 : if (PyErr_Occurred() != NULL) {
12268 0 : return -1;
12269 : }
12270 0 : if (test_var > uint_max) {
12271 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12272 : PyLong_Type.tp_name, uint_max, test_var);
12273 0 : return -1;
12274 : }
12275 0 : object->bad_password_time = test_var;
12276 : } else {
12277 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12278 : PyLong_Type.tp_name);
12279 0 : return -1;
12280 : }
12281 : }
12282 0 : return 0;
12283 : }
12284 :
12285 0 : static PyObject *py_samr_ValidatePasswordInfo_get_lockout_time(PyObject *obj, void *closure)
12286 : {
12287 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12288 0 : PyObject *py_lockout_time;
12289 0 : py_lockout_time = PyLong_FromUnsignedLongLong(object->lockout_time);
12290 0 : return py_lockout_time;
12291 : }
12292 :
12293 0 : static int py_samr_ValidatePasswordInfo_set_lockout_time(PyObject *py_obj, PyObject *value, void *closure)
12294 : {
12295 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12296 0 : if (value == NULL) {
12297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lockout_time");
12298 0 : return -1;
12299 : }
12300 : {
12301 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lockout_time));
12302 0 : if (PyLong_Check(value)) {
12303 0 : unsigned long long test_var;
12304 0 : test_var = PyLong_AsUnsignedLongLong(value);
12305 0 : if (PyErr_Occurred() != NULL) {
12306 0 : return -1;
12307 : }
12308 0 : if (test_var > uint_max) {
12309 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12310 : PyLong_Type.tp_name, uint_max, test_var);
12311 0 : return -1;
12312 : }
12313 0 : object->lockout_time = test_var;
12314 : } else {
12315 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12316 : PyLong_Type.tp_name);
12317 0 : return -1;
12318 : }
12319 : }
12320 0 : return 0;
12321 : }
12322 :
12323 0 : static PyObject *py_samr_ValidatePasswordInfo_get_bad_pwd_count(PyObject *obj, void *closure)
12324 : {
12325 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12326 0 : PyObject *py_bad_pwd_count;
12327 0 : py_bad_pwd_count = PyLong_FromUnsignedLongLong((uint32_t)object->bad_pwd_count);
12328 0 : return py_bad_pwd_count;
12329 : }
12330 :
12331 0 : static int py_samr_ValidatePasswordInfo_set_bad_pwd_count(PyObject *py_obj, PyObject *value, void *closure)
12332 : {
12333 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12334 0 : if (value == NULL) {
12335 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->bad_pwd_count");
12336 0 : return -1;
12337 : }
12338 : {
12339 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bad_pwd_count));
12340 0 : if (PyLong_Check(value)) {
12341 0 : unsigned long long test_var;
12342 0 : test_var = PyLong_AsUnsignedLongLong(value);
12343 0 : if (PyErr_Occurred() != NULL) {
12344 0 : return -1;
12345 : }
12346 0 : if (test_var > uint_max) {
12347 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12348 : PyLong_Type.tp_name, uint_max, test_var);
12349 0 : return -1;
12350 : }
12351 0 : object->bad_pwd_count = test_var;
12352 : } else {
12353 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12354 : PyLong_Type.tp_name);
12355 0 : return -1;
12356 : }
12357 : }
12358 0 : return 0;
12359 : }
12360 :
12361 0 : static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history_len(PyObject *obj, void *closure)
12362 : {
12363 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12364 0 : PyObject *py_pwd_history_len;
12365 0 : py_pwd_history_len = PyLong_FromUnsignedLongLong((uint32_t)object->pwd_history_len);
12366 0 : return py_pwd_history_len;
12367 : }
12368 :
12369 0 : static int py_samr_ValidatePasswordInfo_set_pwd_history_len(PyObject *py_obj, PyObject *value, void *closure)
12370 : {
12371 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12372 0 : if (value == NULL) {
12373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history_len");
12374 0 : return -1;
12375 : }
12376 : {
12377 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pwd_history_len));
12378 0 : if (PyLong_Check(value)) {
12379 0 : unsigned long long test_var;
12380 0 : test_var = PyLong_AsUnsignedLongLong(value);
12381 0 : if (PyErr_Occurred() != NULL) {
12382 0 : return -1;
12383 : }
12384 0 : if (test_var > uint_max) {
12385 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12386 : PyLong_Type.tp_name, uint_max, test_var);
12387 0 : return -1;
12388 : }
12389 0 : object->pwd_history_len = test_var;
12390 : } else {
12391 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12392 : PyLong_Type.tp_name);
12393 0 : return -1;
12394 : }
12395 : }
12396 0 : return 0;
12397 : }
12398 :
12399 0 : static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history(PyObject *obj, void *closure)
12400 : {
12401 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
12402 0 : PyObject *py_pwd_history;
12403 0 : if (object->pwd_history == NULL) {
12404 0 : Py_RETURN_NONE;
12405 : }
12406 0 : if (object->pwd_history == NULL) {
12407 0 : py_pwd_history = Py_None;
12408 0 : Py_INCREF(py_pwd_history);
12409 : } else {
12410 0 : py_pwd_history = PyList_New(object->pwd_history_len);
12411 0 : if (py_pwd_history == NULL) {
12412 0 : return NULL;
12413 : }
12414 : {
12415 : int pwd_history_cntr_1;
12416 0 : for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < (object->pwd_history_len); pwd_history_cntr_1++) {
12417 0 : PyObject *py_pwd_history_1;
12418 0 : py_pwd_history_1 = pytalloc_reference_ex(&samr_ValidationBlob_Type, object->pwd_history, &object->pwd_history[pwd_history_cntr_1]);
12419 0 : PyList_SetItem(py_pwd_history, pwd_history_cntr_1, py_pwd_history_1);
12420 : }
12421 : }
12422 : }
12423 0 : return py_pwd_history;
12424 : }
12425 :
12426 0 : static int py_samr_ValidatePasswordInfo_set_pwd_history(PyObject *py_obj, PyObject *value, void *closure)
12427 : {
12428 0 : struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
12429 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pwd_history));
12430 0 : if (value == NULL) {
12431 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history");
12432 0 : return -1;
12433 : }
12434 0 : if (value == Py_None) {
12435 0 : object->pwd_history = NULL;
12436 : } else {
12437 0 : object->pwd_history = NULL;
12438 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
12439 : {
12440 0 : int pwd_history_cntr_1;
12441 0 : object->pwd_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pwd_history, PyList_GET_SIZE(value));
12442 0 : if (!object->pwd_history) { return -1; }
12443 0 : talloc_set_name_const(object->pwd_history, "ARRAY: object->pwd_history");
12444 0 : for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < PyList_GET_SIZE(value); pwd_history_cntr_1++) {
12445 0 : if (PyList_GET_ITEM(value, pwd_history_cntr_1) == NULL) {
12446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_history[pwd_history_cntr_1]");
12447 0 : return -1;
12448 : }
12449 0 : PY_CHECK_TYPE(&samr_ValidationBlob_Type, PyList_GET_ITEM(value, pwd_history_cntr_1), return -1;);
12450 0 : if (talloc_reference(object->pwd_history, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, pwd_history_cntr_1))) == NULL) {
12451 0 : PyErr_NoMemory();
12452 0 : return -1;
12453 : }
12454 0 : object->pwd_history[pwd_history_cntr_1] = *(struct samr_ValidationBlob *)pytalloc_get_ptr(PyList_GET_ITEM(value, pwd_history_cntr_1));
12455 : }
12456 : }
12457 : }
12458 0 : return 0;
12459 : }
12460 :
12461 : static PyGetSetDef py_samr_ValidatePasswordInfo_getsetters[] = {
12462 : {
12463 : .name = discard_const_p(char, "fields_present"),
12464 : .get = py_samr_ValidatePasswordInfo_get_fields_present,
12465 : .set = py_samr_ValidatePasswordInfo_set_fields_present,
12466 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidateFieldsPresent")
12467 : },
12468 : {
12469 : .name = discard_const_p(char, "last_password_change"),
12470 : .get = py_samr_ValidatePasswordInfo_get_last_password_change,
12471 : .set = py_samr_ValidatePasswordInfo_set_last_password_change,
12472 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
12473 : },
12474 : {
12475 : .name = discard_const_p(char, "bad_password_time"),
12476 : .get = py_samr_ValidatePasswordInfo_get_bad_password_time,
12477 : .set = py_samr_ValidatePasswordInfo_set_bad_password_time,
12478 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
12479 : },
12480 : {
12481 : .name = discard_const_p(char, "lockout_time"),
12482 : .get = py_samr_ValidatePasswordInfo_get_lockout_time,
12483 : .set = py_samr_ValidatePasswordInfo_set_lockout_time,
12484 : .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME_hyper")
12485 : },
12486 : {
12487 : .name = discard_const_p(char, "bad_pwd_count"),
12488 : .get = py_samr_ValidatePasswordInfo_get_bad_pwd_count,
12489 : .set = py_samr_ValidatePasswordInfo_set_bad_pwd_count,
12490 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12491 : },
12492 : {
12493 : .name = discard_const_p(char, "pwd_history_len"),
12494 : .get = py_samr_ValidatePasswordInfo_get_pwd_history_len,
12495 : .set = py_samr_ValidatePasswordInfo_set_pwd_history_len,
12496 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
12497 : },
12498 : {
12499 : .name = discard_const_p(char, "pwd_history"),
12500 : .get = py_samr_ValidatePasswordInfo_get_pwd_history,
12501 : .set = py_samr_ValidatePasswordInfo_set_pwd_history,
12502 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob")
12503 : },
12504 : { .name = NULL }
12505 : };
12506 :
12507 0 : static PyObject *py_samr_ValidatePasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12508 : {
12509 0 : return pytalloc_new(struct samr_ValidatePasswordInfo, type);
12510 : }
12511 :
12512 :
12513 : static PyTypeObject samr_ValidatePasswordInfo_Type = {
12514 : PyVarObject_HEAD_INIT(NULL, 0)
12515 : .tp_name = "samr.ValidatePasswordInfo",
12516 : .tp_getset = py_samr_ValidatePasswordInfo_getsetters,
12517 : .tp_methods = NULL,
12518 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12519 : .tp_new = py_samr_ValidatePasswordInfo_new,
12520 : };
12521 :
12522 :
12523 0 : static PyObject *py_samr_ValidatePasswordRepCtr_get_info(PyObject *obj, void *closure)
12524 : {
12525 0 : struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
12526 0 : PyObject *py_info;
12527 0 : py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
12528 0 : return py_info;
12529 : }
12530 :
12531 0 : static int py_samr_ValidatePasswordRepCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
12532 : {
12533 0 : struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj);
12534 0 : if (value == NULL) {
12535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
12536 0 : return -1;
12537 : }
12538 0 : PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
12539 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12540 0 : PyErr_NoMemory();
12541 0 : return -1;
12542 : }
12543 0 : object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
12544 0 : return 0;
12545 : }
12546 :
12547 0 : static PyObject *py_samr_ValidatePasswordRepCtr_get_status(PyObject *obj, void *closure)
12548 : {
12549 0 : struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
12550 0 : PyObject *py_status;
12551 0 : py_status = PyLong_FromLong((uint16_t)object->status);
12552 0 : return py_status;
12553 : }
12554 :
12555 0 : static int py_samr_ValidatePasswordRepCtr_set_status(PyObject *py_obj, PyObject *value, void *closure)
12556 : {
12557 0 : struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj);
12558 0 : if (value == NULL) {
12559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
12560 0 : return -1;
12561 : }
12562 : {
12563 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
12564 0 : if (PyLong_Check(value)) {
12565 0 : unsigned long long test_var;
12566 0 : test_var = PyLong_AsUnsignedLongLong(value);
12567 0 : if (PyErr_Occurred() != NULL) {
12568 0 : return -1;
12569 : }
12570 0 : if (test_var > uint_max) {
12571 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12572 : PyLong_Type.tp_name, uint_max, test_var);
12573 0 : return -1;
12574 : }
12575 0 : object->status = test_var;
12576 : } else {
12577 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12578 : PyLong_Type.tp_name);
12579 0 : return -1;
12580 : }
12581 : }
12582 0 : return 0;
12583 : }
12584 :
12585 : static PyGetSetDef py_samr_ValidatePasswordRepCtr_getsetters[] = {
12586 : {
12587 : .name = discard_const_p(char, "info"),
12588 : .get = py_samr_ValidatePasswordRepCtr_get_info,
12589 : .set = py_samr_ValidatePasswordRepCtr_set_info,
12590 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo")
12591 : },
12592 : {
12593 : .name = discard_const_p(char, "status"),
12594 : .get = py_samr_ValidatePasswordRepCtr_get_status,
12595 : .set = py_samr_ValidatePasswordRepCtr_set_status,
12596 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationStatus")
12597 : },
12598 : { .name = NULL }
12599 : };
12600 :
12601 0 : static PyObject *py_samr_ValidatePasswordRepCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12602 : {
12603 0 : return pytalloc_new(struct samr_ValidatePasswordRepCtr, type);
12604 : }
12605 :
12606 :
12607 : static PyTypeObject samr_ValidatePasswordRepCtr_Type = {
12608 : PyVarObject_HEAD_INIT(NULL, 0)
12609 : .tp_name = "samr.ValidatePasswordRepCtr",
12610 : .tp_getset = py_samr_ValidatePasswordRepCtr_getsetters,
12611 : .tp_methods = NULL,
12612 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12613 : .tp_new = py_samr_ValidatePasswordRepCtr_new,
12614 : };
12615 :
12616 0 : static PyObject *py_import_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordRep *in)
12617 : {
12618 0 : PyObject *ret;
12619 :
12620 0 : switch (level) {
12621 0 : case 1:
12622 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr1);
12623 0 : return ret;
12624 :
12625 0 : case 2:
12626 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr2);
12627 0 : return ret;
12628 :
12629 0 : case 3:
12630 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr3);
12631 0 : return ret;
12632 :
12633 : }
12634 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
12635 0 : return NULL;
12636 : }
12637 :
12638 0 : static union samr_ValidatePasswordRep *py_export_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, PyObject *in)
12639 : {
12640 0 : union samr_ValidatePasswordRep *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordRep);
12641 0 : switch (level) {
12642 0 : case 1:
12643 0 : if (in == NULL) {
12644 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
12645 0 : talloc_free(ret); return NULL;
12646 : }
12647 0 : PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
12648 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12649 0 : PyErr_NoMemory();
12650 0 : talloc_free(ret); return NULL;
12651 : }
12652 0 : ret->ctr1 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
12653 0 : break;
12654 :
12655 0 : case 2:
12656 0 : if (in == NULL) {
12657 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2");
12658 0 : talloc_free(ret); return NULL;
12659 : }
12660 0 : PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
12661 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12662 0 : PyErr_NoMemory();
12663 0 : talloc_free(ret); return NULL;
12664 : }
12665 0 : ret->ctr2 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
12666 0 : break;
12667 :
12668 0 : case 3:
12669 0 : if (in == NULL) {
12670 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr3");
12671 0 : talloc_free(ret); return NULL;
12672 : }
12673 0 : PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
12674 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
12675 0 : PyErr_NoMemory();
12676 0 : talloc_free(ret); return NULL;
12677 : }
12678 0 : ret->ctr3 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
12679 0 : break;
12680 :
12681 0 : default:
12682 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
12683 0 : talloc_free(ret);
12684 0 : ret = NULL;
12685 : }
12686 :
12687 0 : return ret;
12688 : }
12689 :
12690 0 : static PyObject *py_samr_ValidatePasswordRep_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12691 : {
12692 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12693 0 : PyObject *mem_ctx_obj = NULL;
12694 0 : TALLOC_CTX *mem_ctx = NULL;
12695 0 : int level = 0;
12696 0 : PyObject *in_obj = NULL;
12697 0 : union samr_ValidatePasswordRep *in = NULL;
12698 :
12699 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
12700 : discard_const_p(char *, kwnames),
12701 : &mem_ctx_obj,
12702 : &level,
12703 : &in_obj)) {
12704 0 : return NULL;
12705 : }
12706 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12707 0 : if (mem_ctx == NULL) {
12708 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12709 0 : return NULL;
12710 : }
12711 0 : in = (union samr_ValidatePasswordRep *)pytalloc_get_ptr(in_obj);
12712 0 : if (in == NULL) {
12713 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ValidatePasswordRep!");
12714 0 : return NULL;
12715 : }
12716 :
12717 0 : return py_import_samr_ValidatePasswordRep(mem_ctx, level, in);
12718 : }
12719 :
12720 0 : static PyObject *py_samr_ValidatePasswordRep_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12721 : {
12722 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
12723 0 : PyObject *mem_ctx_obj = NULL;
12724 0 : TALLOC_CTX *mem_ctx = NULL;
12725 0 : int level = 0;
12726 0 : PyObject *in = NULL;
12727 0 : union samr_ValidatePasswordRep *out = NULL;
12728 :
12729 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
12730 : discard_const_p(char *, kwnames),
12731 : &mem_ctx_obj,
12732 : &level,
12733 : &in)) {
12734 0 : return NULL;
12735 : }
12736 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
12737 0 : if (mem_ctx == NULL) {
12738 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
12739 0 : return NULL;
12740 : }
12741 :
12742 0 : out = py_export_samr_ValidatePasswordRep(mem_ctx, level, in);
12743 0 : if (out == NULL) {
12744 0 : return NULL;
12745 : }
12746 :
12747 0 : return pytalloc_GenericObject_reference(out);
12748 : }
12749 :
12750 : static PyMethodDef py_samr_ValidatePasswordRep_methods[] = {
12751 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordRep_import),
12752 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12753 : "T.__import__(mem_ctx, level, in) => ret." },
12754 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordRep_export),
12755 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
12756 : "T.__export__(mem_ctx, level, in) => ret." },
12757 : { NULL, NULL, 0, NULL }
12758 : };
12759 :
12760 0 : static PyObject *py_samr_ValidatePasswordRep_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12761 : {
12762 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
12763 0 : return NULL;
12764 : }
12765 :
12766 :
12767 : static PyTypeObject samr_ValidatePasswordRep_Type = {
12768 : PyVarObject_HEAD_INIT(NULL, 0)
12769 : .tp_name = "samr.ValidatePasswordRep",
12770 : .tp_getset = NULL,
12771 : .tp_methods = py_samr_ValidatePasswordRep_methods,
12772 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
12773 : .tp_new = py_samr_ValidatePasswordRep_new,
12774 : };
12775 :
12776 :
12777 0 : static PyObject *py_samr_ValidatePasswordReq3_get_info(PyObject *obj, void *closure)
12778 : {
12779 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12780 0 : PyObject *py_info;
12781 0 : py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
12782 0 : return py_info;
12783 : }
12784 :
12785 0 : static int py_samr_ValidatePasswordReq3_set_info(PyObject *py_obj, PyObject *value, void *closure)
12786 : {
12787 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12788 0 : if (value == NULL) {
12789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
12790 0 : return -1;
12791 : }
12792 0 : PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
12793 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12794 0 : PyErr_NoMemory();
12795 0 : return -1;
12796 : }
12797 0 : object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
12798 0 : return 0;
12799 : }
12800 :
12801 0 : static PyObject *py_samr_ValidatePasswordReq3_get_password(PyObject *obj, void *closure)
12802 : {
12803 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12804 0 : PyObject *py_password;
12805 0 : py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password);
12806 0 : return py_password;
12807 : }
12808 :
12809 0 : static int py_samr_ValidatePasswordReq3_set_password(PyObject *py_obj, PyObject *value, void *closure)
12810 : {
12811 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12812 0 : if (value == NULL) {
12813 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
12814 0 : return -1;
12815 : }
12816 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
12817 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12818 0 : PyErr_NoMemory();
12819 0 : return -1;
12820 : }
12821 0 : object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
12822 0 : return 0;
12823 : }
12824 :
12825 0 : static PyObject *py_samr_ValidatePasswordReq3_get_account(PyObject *obj, void *closure)
12826 : {
12827 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12828 0 : PyObject *py_account;
12829 0 : py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account);
12830 0 : return py_account;
12831 : }
12832 :
12833 0 : static int py_samr_ValidatePasswordReq3_set_account(PyObject *py_obj, PyObject *value, void *closure)
12834 : {
12835 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12836 0 : if (value == NULL) {
12837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account");
12838 0 : return -1;
12839 : }
12840 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
12841 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12842 0 : PyErr_NoMemory();
12843 0 : return -1;
12844 : }
12845 0 : object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
12846 0 : return 0;
12847 : }
12848 :
12849 0 : static PyObject *py_samr_ValidatePasswordReq3_get_hash(PyObject *obj, void *closure)
12850 : {
12851 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12852 0 : PyObject *py_hash;
12853 0 : py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
12854 0 : return py_hash;
12855 : }
12856 :
12857 0 : static int py_samr_ValidatePasswordReq3_set_hash(PyObject *py_obj, PyObject *value, void *closure)
12858 : {
12859 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12860 0 : if (value == NULL) {
12861 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
12862 0 : return -1;
12863 : }
12864 0 : PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;);
12865 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
12866 0 : PyErr_NoMemory();
12867 0 : return -1;
12868 : }
12869 0 : object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
12870 0 : return 0;
12871 : }
12872 :
12873 0 : static PyObject *py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon(PyObject *obj, void *closure)
12874 : {
12875 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12876 0 : PyObject *py_pwd_must_change_at_next_logon;
12877 0 : py_pwd_must_change_at_next_logon = PyLong_FromLong((uint16_t)object->pwd_must_change_at_next_logon);
12878 0 : return py_pwd_must_change_at_next_logon;
12879 : }
12880 :
12881 0 : static int py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon(PyObject *py_obj, PyObject *value, void *closure)
12882 : {
12883 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12884 0 : if (value == NULL) {
12885 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->pwd_must_change_at_next_logon");
12886 0 : return -1;
12887 : }
12888 : {
12889 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pwd_must_change_at_next_logon));
12890 0 : if (PyLong_Check(value)) {
12891 0 : unsigned long long test_var;
12892 0 : test_var = PyLong_AsUnsignedLongLong(value);
12893 0 : if (PyErr_Occurred() != NULL) {
12894 0 : return -1;
12895 : }
12896 0 : if (test_var > uint_max) {
12897 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12898 : PyLong_Type.tp_name, uint_max, test_var);
12899 0 : return -1;
12900 : }
12901 0 : object->pwd_must_change_at_next_logon = test_var;
12902 : } else {
12903 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12904 : PyLong_Type.tp_name);
12905 0 : return -1;
12906 : }
12907 : }
12908 0 : return 0;
12909 : }
12910 :
12911 0 : static PyObject *py_samr_ValidatePasswordReq3_get_clear_lockout(PyObject *obj, void *closure)
12912 : {
12913 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
12914 0 : PyObject *py_clear_lockout;
12915 0 : py_clear_lockout = PyLong_FromLong((uint16_t)object->clear_lockout);
12916 0 : return py_clear_lockout;
12917 : }
12918 :
12919 0 : static int py_samr_ValidatePasswordReq3_set_clear_lockout(PyObject *py_obj, PyObject *value, void *closure)
12920 : {
12921 0 : struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
12922 0 : if (value == NULL) {
12923 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->clear_lockout");
12924 0 : return -1;
12925 : }
12926 : {
12927 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->clear_lockout));
12928 0 : if (PyLong_Check(value)) {
12929 0 : unsigned long long test_var;
12930 0 : test_var = PyLong_AsUnsignedLongLong(value);
12931 0 : if (PyErr_Occurred() != NULL) {
12932 0 : return -1;
12933 : }
12934 0 : if (test_var > uint_max) {
12935 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
12936 : PyLong_Type.tp_name, uint_max, test_var);
12937 0 : return -1;
12938 : }
12939 0 : object->clear_lockout = test_var;
12940 : } else {
12941 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
12942 : PyLong_Type.tp_name);
12943 0 : return -1;
12944 : }
12945 : }
12946 0 : return 0;
12947 : }
12948 :
12949 : static PyGetSetDef py_samr_ValidatePasswordReq3_getsetters[] = {
12950 : {
12951 : .name = discard_const_p(char, "info"),
12952 : .get = py_samr_ValidatePasswordReq3_get_info,
12953 : .set = py_samr_ValidatePasswordReq3_set_info,
12954 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo")
12955 : },
12956 : {
12957 : .name = discard_const_p(char, "password"),
12958 : .get = py_samr_ValidatePasswordReq3_get_password,
12959 : .set = py_samr_ValidatePasswordReq3_set_password,
12960 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
12961 : },
12962 : {
12963 : .name = discard_const_p(char, "account"),
12964 : .get = py_samr_ValidatePasswordReq3_get_account,
12965 : .set = py_samr_ValidatePasswordReq3_set_account,
12966 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
12967 : },
12968 : {
12969 : .name = discard_const_p(char, "hash"),
12970 : .get = py_samr_ValidatePasswordReq3_get_hash,
12971 : .set = py_samr_ValidatePasswordReq3_set_hash,
12972 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob")
12973 : },
12974 : {
12975 : .name = discard_const_p(char, "pwd_must_change_at_next_logon"),
12976 : .get = py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon,
12977 : .set = py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon,
12978 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12979 : },
12980 : {
12981 : .name = discard_const_p(char, "clear_lockout"),
12982 : .get = py_samr_ValidatePasswordReq3_get_clear_lockout,
12983 : .set = py_samr_ValidatePasswordReq3_set_clear_lockout,
12984 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
12985 : },
12986 : { .name = NULL }
12987 : };
12988 :
12989 0 : static PyObject *py_samr_ValidatePasswordReq3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
12990 : {
12991 0 : return pytalloc_new(struct samr_ValidatePasswordReq3, type);
12992 : }
12993 :
12994 :
12995 : static PyTypeObject samr_ValidatePasswordReq3_Type = {
12996 : PyVarObject_HEAD_INIT(NULL, 0)
12997 : .tp_name = "samr.ValidatePasswordReq3",
12998 : .tp_getset = py_samr_ValidatePasswordReq3_getsetters,
12999 : .tp_methods = NULL,
13000 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13001 : .tp_new = py_samr_ValidatePasswordReq3_new,
13002 : };
13003 :
13004 :
13005 0 : static PyObject *py_samr_ValidatePasswordReq2_get_info(PyObject *obj, void *closure)
13006 : {
13007 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
13008 0 : PyObject *py_info;
13009 0 : py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
13010 0 : return py_info;
13011 : }
13012 :
13013 0 : static int py_samr_ValidatePasswordReq2_set_info(PyObject *py_obj, PyObject *value, void *closure)
13014 : {
13015 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
13016 0 : if (value == NULL) {
13017 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
13018 0 : return -1;
13019 : }
13020 0 : PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
13021 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13022 0 : PyErr_NoMemory();
13023 0 : return -1;
13024 : }
13025 0 : object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
13026 0 : return 0;
13027 : }
13028 :
13029 0 : static PyObject *py_samr_ValidatePasswordReq2_get_password(PyObject *obj, void *closure)
13030 : {
13031 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
13032 0 : PyObject *py_password;
13033 0 : py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password);
13034 0 : return py_password;
13035 : }
13036 :
13037 0 : static int py_samr_ValidatePasswordReq2_set_password(PyObject *py_obj, PyObject *value, void *closure)
13038 : {
13039 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
13040 0 : if (value == NULL) {
13041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
13042 0 : return -1;
13043 : }
13044 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
13045 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13046 0 : PyErr_NoMemory();
13047 0 : return -1;
13048 : }
13049 0 : object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
13050 0 : return 0;
13051 : }
13052 :
13053 0 : static PyObject *py_samr_ValidatePasswordReq2_get_account(PyObject *obj, void *closure)
13054 : {
13055 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
13056 0 : PyObject *py_account;
13057 0 : py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account);
13058 0 : return py_account;
13059 : }
13060 :
13061 0 : static int py_samr_ValidatePasswordReq2_set_account(PyObject *py_obj, PyObject *value, void *closure)
13062 : {
13063 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
13064 0 : if (value == NULL) {
13065 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account");
13066 0 : return -1;
13067 : }
13068 0 : PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
13069 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13070 0 : PyErr_NoMemory();
13071 0 : return -1;
13072 : }
13073 0 : object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
13074 0 : return 0;
13075 : }
13076 :
13077 0 : static PyObject *py_samr_ValidatePasswordReq2_get_hash(PyObject *obj, void *closure)
13078 : {
13079 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
13080 0 : PyObject *py_hash;
13081 0 : py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
13082 0 : return py_hash;
13083 : }
13084 :
13085 0 : static int py_samr_ValidatePasswordReq2_set_hash(PyObject *py_obj, PyObject *value, void *closure)
13086 : {
13087 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
13088 0 : if (value == NULL) {
13089 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->hash");
13090 0 : return -1;
13091 : }
13092 0 : PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;);
13093 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13094 0 : PyErr_NoMemory();
13095 0 : return -1;
13096 : }
13097 0 : object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
13098 0 : return 0;
13099 : }
13100 :
13101 0 : static PyObject *py_samr_ValidatePasswordReq2_get_password_matched(PyObject *obj, void *closure)
13102 : {
13103 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
13104 0 : PyObject *py_password_matched;
13105 0 : py_password_matched = PyLong_FromLong((uint16_t)object->password_matched);
13106 0 : return py_password_matched;
13107 : }
13108 :
13109 0 : static int py_samr_ValidatePasswordReq2_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
13110 : {
13111 0 : struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
13112 0 : if (value == NULL) {
13113 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_matched");
13114 0 : return -1;
13115 : }
13116 : {
13117 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_matched));
13118 0 : if (PyLong_Check(value)) {
13119 0 : unsigned long long test_var;
13120 0 : test_var = PyLong_AsUnsignedLongLong(value);
13121 0 : if (PyErr_Occurred() != NULL) {
13122 0 : return -1;
13123 : }
13124 0 : if (test_var > uint_max) {
13125 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13126 : PyLong_Type.tp_name, uint_max, test_var);
13127 0 : return -1;
13128 : }
13129 0 : object->password_matched = test_var;
13130 : } else {
13131 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13132 : PyLong_Type.tp_name);
13133 0 : return -1;
13134 : }
13135 : }
13136 0 : return 0;
13137 : }
13138 :
13139 : static PyGetSetDef py_samr_ValidatePasswordReq2_getsetters[] = {
13140 : {
13141 : .name = discard_const_p(char, "info"),
13142 : .get = py_samr_ValidatePasswordReq2_get_info,
13143 : .set = py_samr_ValidatePasswordReq2_set_info,
13144 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo")
13145 : },
13146 : {
13147 : .name = discard_const_p(char, "password"),
13148 : .get = py_samr_ValidatePasswordReq2_get_password,
13149 : .set = py_samr_ValidatePasswordReq2_set_password,
13150 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
13151 : },
13152 : {
13153 : .name = discard_const_p(char, "account"),
13154 : .get = py_samr_ValidatePasswordReq2_get_account,
13155 : .set = py_samr_ValidatePasswordReq2_set_account,
13156 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_StringLarge")
13157 : },
13158 : {
13159 : .name = discard_const_p(char, "hash"),
13160 : .get = py_samr_ValidatePasswordReq2_get_hash,
13161 : .set = py_samr_ValidatePasswordReq2_set_hash,
13162 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidationBlob")
13163 : },
13164 : {
13165 : .name = discard_const_p(char, "password_matched"),
13166 : .get = py_samr_ValidatePasswordReq2_get_password_matched,
13167 : .set = py_samr_ValidatePasswordReq2_set_password_matched,
13168 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13169 : },
13170 : { .name = NULL }
13171 : };
13172 :
13173 0 : static PyObject *py_samr_ValidatePasswordReq2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13174 : {
13175 0 : return pytalloc_new(struct samr_ValidatePasswordReq2, type);
13176 : }
13177 :
13178 :
13179 : static PyTypeObject samr_ValidatePasswordReq2_Type = {
13180 : PyVarObject_HEAD_INIT(NULL, 0)
13181 : .tp_name = "samr.ValidatePasswordReq2",
13182 : .tp_getset = py_samr_ValidatePasswordReq2_getsetters,
13183 : .tp_methods = NULL,
13184 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13185 : .tp_new = py_samr_ValidatePasswordReq2_new,
13186 : };
13187 :
13188 :
13189 0 : static PyObject *py_samr_ValidatePasswordReq1_get_info(PyObject *obj, void *closure)
13190 : {
13191 0 : struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj);
13192 0 : PyObject *py_info;
13193 0 : py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
13194 0 : return py_info;
13195 : }
13196 :
13197 0 : static int py_samr_ValidatePasswordReq1_set_info(PyObject *py_obj, PyObject *value, void *closure)
13198 : {
13199 0 : struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj);
13200 0 : if (value == NULL) {
13201 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
13202 0 : return -1;
13203 : }
13204 0 : PY_CHECK_TYPE(&samr_ValidatePasswordInfo_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->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
13210 0 : return 0;
13211 : }
13212 :
13213 0 : static PyObject *py_samr_ValidatePasswordReq1_get_password_matched(PyObject *obj, void *closure)
13214 : {
13215 0 : struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj);
13216 0 : PyObject *py_password_matched;
13217 0 : py_password_matched = PyLong_FromLong((uint16_t)object->password_matched);
13218 0 : return py_password_matched;
13219 : }
13220 :
13221 0 : static int py_samr_ValidatePasswordReq1_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
13222 : {
13223 0 : struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj);
13224 0 : if (value == NULL) {
13225 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password_matched");
13226 0 : return -1;
13227 : }
13228 : {
13229 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->password_matched));
13230 0 : if (PyLong_Check(value)) {
13231 0 : unsigned long long test_var;
13232 0 : test_var = PyLong_AsUnsignedLongLong(value);
13233 0 : if (PyErr_Occurred() != NULL) {
13234 0 : return -1;
13235 : }
13236 0 : if (test_var > uint_max) {
13237 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13238 : PyLong_Type.tp_name, uint_max, test_var);
13239 0 : return -1;
13240 : }
13241 0 : object->password_matched = test_var;
13242 : } else {
13243 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13244 : PyLong_Type.tp_name);
13245 0 : return -1;
13246 : }
13247 : }
13248 0 : return 0;
13249 : }
13250 :
13251 : static PyGetSetDef py_samr_ValidatePasswordReq1_getsetters[] = {
13252 : {
13253 : .name = discard_const_p(char, "info"),
13254 : .get = py_samr_ValidatePasswordReq1_get_info,
13255 : .set = py_samr_ValidatePasswordReq1_set_info,
13256 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordInfo")
13257 : },
13258 : {
13259 : .name = discard_const_p(char, "password_matched"),
13260 : .get = py_samr_ValidatePasswordReq1_get_password_matched,
13261 : .set = py_samr_ValidatePasswordReq1_set_password_matched,
13262 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
13263 : },
13264 : { .name = NULL }
13265 : };
13266 :
13267 0 : static PyObject *py_samr_ValidatePasswordReq1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13268 : {
13269 0 : return pytalloc_new(struct samr_ValidatePasswordReq1, type);
13270 : }
13271 :
13272 :
13273 : static PyTypeObject samr_ValidatePasswordReq1_Type = {
13274 : PyVarObject_HEAD_INIT(NULL, 0)
13275 : .tp_name = "samr.ValidatePasswordReq1",
13276 : .tp_getset = py_samr_ValidatePasswordReq1_getsetters,
13277 : .tp_methods = NULL,
13278 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13279 : .tp_new = py_samr_ValidatePasswordReq1_new,
13280 : };
13281 :
13282 0 : static PyObject *py_import_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordReq *in)
13283 : {
13284 0 : PyObject *ret;
13285 :
13286 0 : switch (level) {
13287 0 : case 1:
13288 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordReq1_Type, mem_ctx, &in->req1);
13289 0 : return ret;
13290 :
13291 0 : case 2:
13292 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordReq2_Type, mem_ctx, &in->req2);
13293 0 : return ret;
13294 :
13295 0 : case 3:
13296 0 : ret = pytalloc_reference_ex(&samr_ValidatePasswordReq3_Type, mem_ctx, &in->req3);
13297 0 : return ret;
13298 :
13299 : }
13300 0 : PyErr_SetString(PyExc_TypeError, "unknown union level");
13301 0 : return NULL;
13302 : }
13303 :
13304 0 : static union samr_ValidatePasswordReq *py_export_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, PyObject *in)
13305 : {
13306 0 : union samr_ValidatePasswordReq *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordReq);
13307 0 : switch (level) {
13308 0 : case 1:
13309 0 : if (in == NULL) {
13310 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req1");
13311 0 : talloc_free(ret); return NULL;
13312 : }
13313 0 : PY_CHECK_TYPE(&samr_ValidatePasswordReq1_Type, in, talloc_free(ret); return NULL;);
13314 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13315 0 : PyErr_NoMemory();
13316 0 : talloc_free(ret); return NULL;
13317 : }
13318 0 : ret->req1 = *(struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(in);
13319 0 : break;
13320 :
13321 0 : case 2:
13322 0 : if (in == NULL) {
13323 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req2");
13324 0 : talloc_free(ret); return NULL;
13325 : }
13326 0 : PY_CHECK_TYPE(&samr_ValidatePasswordReq2_Type, in, talloc_free(ret); return NULL;);
13327 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13328 0 : PyErr_NoMemory();
13329 0 : talloc_free(ret); return NULL;
13330 : }
13331 0 : ret->req2 = *(struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(in);
13332 0 : break;
13333 :
13334 0 : case 3:
13335 0 : if (in == NULL) {
13336 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->req3");
13337 0 : talloc_free(ret); return NULL;
13338 : }
13339 0 : PY_CHECK_TYPE(&samr_ValidatePasswordReq3_Type, in, talloc_free(ret); return NULL;);
13340 0 : if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
13341 0 : PyErr_NoMemory();
13342 0 : talloc_free(ret); return NULL;
13343 : }
13344 0 : ret->req3 = *(struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(in);
13345 0 : break;
13346 :
13347 0 : default:
13348 0 : PyErr_SetString(PyExc_TypeError, "invalid union level value");
13349 0 : talloc_free(ret);
13350 0 : ret = NULL;
13351 : }
13352 :
13353 0 : return ret;
13354 : }
13355 :
13356 0 : static PyObject *py_samr_ValidatePasswordReq_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13357 : {
13358 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13359 0 : PyObject *mem_ctx_obj = NULL;
13360 0 : TALLOC_CTX *mem_ctx = NULL;
13361 0 : int level = 0;
13362 0 : PyObject *in_obj = NULL;
13363 0 : union samr_ValidatePasswordReq *in = NULL;
13364 :
13365 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
13366 : discard_const_p(char *, kwnames),
13367 : &mem_ctx_obj,
13368 : &level,
13369 : &in_obj)) {
13370 0 : return NULL;
13371 : }
13372 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13373 0 : if (mem_ctx == NULL) {
13374 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13375 0 : return NULL;
13376 : }
13377 0 : in = (union samr_ValidatePasswordReq *)pytalloc_get_ptr(in_obj);
13378 0 : if (in == NULL) {
13379 0 : PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union samr_ValidatePasswordReq!");
13380 0 : return NULL;
13381 : }
13382 :
13383 0 : return py_import_samr_ValidatePasswordReq(mem_ctx, level, in);
13384 : }
13385 :
13386 0 : static PyObject *py_samr_ValidatePasswordReq_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13387 : {
13388 0 : const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
13389 0 : PyObject *mem_ctx_obj = NULL;
13390 0 : TALLOC_CTX *mem_ctx = NULL;
13391 0 : int level = 0;
13392 0 : PyObject *in = NULL;
13393 0 : union samr_ValidatePasswordReq *out = NULL;
13394 :
13395 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
13396 : discard_const_p(char *, kwnames),
13397 : &mem_ctx_obj,
13398 : &level,
13399 : &in)) {
13400 0 : return NULL;
13401 : }
13402 0 : mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
13403 0 : if (mem_ctx == NULL) {
13404 0 : PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
13405 0 : return NULL;
13406 : }
13407 :
13408 0 : out = py_export_samr_ValidatePasswordReq(mem_ctx, level, in);
13409 0 : if (out == NULL) {
13410 0 : return NULL;
13411 : }
13412 :
13413 0 : return pytalloc_GenericObject_reference(out);
13414 : }
13415 :
13416 : static PyMethodDef py_samr_ValidatePasswordReq_methods[] = {
13417 : { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordReq_import),
13418 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13419 : "T.__import__(mem_ctx, level, in) => ret." },
13420 : { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePasswordReq_export),
13421 : METH_VARARGS|METH_KEYWORDS|METH_CLASS,
13422 : "T.__export__(mem_ctx, level, in) => ret." },
13423 : { NULL, NULL, 0, NULL }
13424 : };
13425 :
13426 0 : static PyObject *py_samr_ValidatePasswordReq_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13427 : {
13428 0 : PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
13429 0 : return NULL;
13430 : }
13431 :
13432 :
13433 : static PyTypeObject samr_ValidatePasswordReq_Type = {
13434 : PyVarObject_HEAD_INIT(NULL, 0)
13435 : .tp_name = "samr.ValidatePasswordReq",
13436 : .tp_getset = NULL,
13437 : .tp_methods = py_samr_ValidatePasswordReq_methods,
13438 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13439 : .tp_new = py_samr_ValidatePasswordReq_new,
13440 : };
13441 :
13442 :
13443 :
13444 0 : static PyObject *py_samr_Connect_in_get_system_name(PyObject *obj, void *closure)
13445 : {
13446 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj);
13447 0 : PyObject *py_system_name;
13448 0 : if (object->in.system_name == NULL) {
13449 0 : Py_RETURN_NONE;
13450 : }
13451 0 : if (object->in.system_name == NULL) {
13452 0 : py_system_name = Py_None;
13453 0 : Py_INCREF(py_system_name);
13454 : } else {
13455 0 : py_system_name = PyLong_FromLong((uint16_t)*object->in.system_name);
13456 : }
13457 0 : return py_system_name;
13458 : }
13459 :
13460 0 : static int py_samr_Connect_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
13461 : {
13462 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13463 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.system_name));
13464 0 : if (value == NULL) {
13465 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
13466 0 : return -1;
13467 : }
13468 0 : if (value == Py_None) {
13469 0 : object->in.system_name = NULL;
13470 : } else {
13471 0 : object->in.system_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.system_name);
13472 0 : if (object->in.system_name == NULL) {
13473 0 : PyErr_NoMemory();
13474 0 : return -1;
13475 : }
13476 : {
13477 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.system_name));
13478 0 : if (PyLong_Check(value)) {
13479 0 : unsigned long long test_var;
13480 0 : test_var = PyLong_AsUnsignedLongLong(value);
13481 0 : if (PyErr_Occurred() != NULL) {
13482 0 : return -1;
13483 : }
13484 0 : if (test_var > uint_max) {
13485 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13486 : PyLong_Type.tp_name, uint_max, test_var);
13487 0 : return -1;
13488 : }
13489 0 : *object->in.system_name = test_var;
13490 : } else {
13491 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13492 : PyLong_Type.tp_name);
13493 0 : return -1;
13494 : }
13495 : }
13496 : }
13497 0 : return 0;
13498 : }
13499 :
13500 0 : static PyObject *py_samr_Connect_in_get_access_mask(PyObject *obj, void *closure)
13501 : {
13502 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj);
13503 0 : PyObject *py_access_mask;
13504 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
13505 0 : return py_access_mask;
13506 : }
13507 :
13508 0 : static int py_samr_Connect_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
13509 : {
13510 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13511 0 : if (value == NULL) {
13512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
13513 0 : return -1;
13514 : }
13515 : {
13516 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
13517 0 : if (PyLong_Check(value)) {
13518 0 : unsigned long long test_var;
13519 0 : test_var = PyLong_AsUnsignedLongLong(value);
13520 0 : if (PyErr_Occurred() != NULL) {
13521 0 : return -1;
13522 : }
13523 0 : if (test_var > uint_max) {
13524 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13525 : PyLong_Type.tp_name, uint_max, test_var);
13526 0 : return -1;
13527 : }
13528 0 : object->in.access_mask = test_var;
13529 : } else {
13530 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13531 : PyLong_Type.tp_name);
13532 0 : return -1;
13533 : }
13534 : }
13535 0 : return 0;
13536 : }
13537 :
13538 0 : static PyObject *py_samr_Connect_out_get_connect_handle(PyObject *obj, void *closure)
13539 : {
13540 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj);
13541 0 : PyObject *py_connect_handle;
13542 0 : if (object->out.connect_handle == NULL) {
13543 0 : Py_RETURN_NONE;
13544 : }
13545 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle);
13546 0 : return py_connect_handle;
13547 : }
13548 :
13549 0 : static int py_samr_Connect_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
13550 : {
13551 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13552 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle));
13553 0 : if (value == NULL) {
13554 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle");
13555 0 : return -1;
13556 : }
13557 0 : object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle);
13558 0 : if (object->out.connect_handle == NULL) {
13559 0 : PyErr_NoMemory();
13560 0 : return -1;
13561 : }
13562 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
13563 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
13564 0 : PyErr_NoMemory();
13565 0 : return -1;
13566 : }
13567 0 : object->out.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
13568 0 : return 0;
13569 : }
13570 :
13571 0 : static PyObject *py_samr_Connect_get_result(PyObject *obj, void *closure)
13572 : {
13573 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(obj);
13574 0 : PyObject *py_result;
13575 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
13576 0 : return py_result;
13577 : }
13578 :
13579 0 : static int py_samr_Connect_set_result(PyObject *py_obj, PyObject *value, void *closure)
13580 : {
13581 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13582 0 : if (value == NULL) {
13583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
13584 0 : return -1;
13585 : }
13586 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
13587 0 : return 0;
13588 : }
13589 :
13590 : static PyGetSetDef py_samr_Connect_getsetters[] = {
13591 : {
13592 : .name = discard_const_p(char, "in_system_name"),
13593 : .get = py_samr_Connect_in_get_system_name,
13594 : .set = py_samr_Connect_in_set_system_name,
13595 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
13596 : },
13597 : {
13598 : .name = discard_const_p(char, "in_access_mask"),
13599 : .get = py_samr_Connect_in_get_access_mask,
13600 : .set = py_samr_Connect_in_set_access_mask,
13601 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask")
13602 : },
13603 : {
13604 : .name = discard_const_p(char, "out_connect_handle"),
13605 : .get = py_samr_Connect_out_get_connect_handle,
13606 : .set = py_samr_Connect_out_set_connect_handle,
13607 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
13608 : },
13609 : {
13610 : .name = discard_const_p(char, "result"),
13611 : .get = py_samr_Connect_get_result,
13612 : .set = py_samr_Connect_set_result,
13613 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
13614 : },
13615 : { .name = NULL }
13616 : };
13617 :
13618 0 : static PyObject *py_samr_Connect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
13619 : {
13620 0 : PyObject *self = pytalloc_new(struct samr_Connect, type);
13621 0 : struct samr_Connect *_self = (struct samr_Connect *)pytalloc_get_ptr(self);
13622 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
13623 0 : _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
13624 0 : return self;
13625 : }
13626 :
13627 0 : static PyObject *py_samr_Connect_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
13628 : {
13629 :
13630 :
13631 0 : return PyLong_FromLong(0);
13632 : }
13633 :
13634 0 : static PyObject *py_samr_Connect_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
13635 : {
13636 0 : const struct ndr_interface_call *call = NULL;
13637 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13638 0 : PyObject *ret = NULL;
13639 0 : struct ndr_push *push = NULL;
13640 0 : DATA_BLOB blob;
13641 0 : enum ndr_err_code err;
13642 :
13643 0 : if (ndr_table_samr.num_calls < 1) {
13644 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_pack");
13645 0 : return NULL;
13646 : }
13647 0 : call = &ndr_table_samr.calls[0];
13648 :
13649 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
13650 0 : if (push == NULL) {
13651 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13652 0 : return NULL;
13653 : }
13654 :
13655 0 : push->flags |= ndr_push_flags;
13656 :
13657 0 : err = call->ndr_push(push, ndr_inout_flags, object);
13658 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13659 0 : TALLOC_FREE(push);
13660 0 : PyErr_SetNdrError(err);
13661 0 : return NULL;
13662 : }
13663 0 : blob = ndr_push_blob(push);
13664 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
13665 0 : TALLOC_FREE(push);
13666 0 : return ret;
13667 : }
13668 :
13669 0 : static PyObject *py_samr_Connect_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13670 : {
13671 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13672 0 : PyObject *bigendian_obj = NULL;
13673 0 : PyObject *ndr64_obj = NULL;
13674 0 : libndr_flags ndr_push_flags = 0;
13675 :
13676 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
13677 : discard_const_p(char *, kwnames),
13678 : &bigendian_obj,
13679 : &ndr64_obj)) {
13680 0 : return NULL;
13681 : }
13682 :
13683 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13684 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13685 : }
13686 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13687 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13688 : }
13689 :
13690 0 : return py_samr_Connect_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
13691 : }
13692 :
13693 0 : static PyObject *py_samr_Connect_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13694 : {
13695 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
13696 0 : PyObject *bigendian_obj = NULL;
13697 0 : PyObject *ndr64_obj = NULL;
13698 0 : libndr_flags ndr_push_flags = 0;
13699 :
13700 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
13701 : discard_const_p(char *, kwnames),
13702 : &bigendian_obj,
13703 : &ndr64_obj)) {
13704 0 : return NULL;
13705 : }
13706 :
13707 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13708 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
13709 : }
13710 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13711 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
13712 : }
13713 :
13714 0 : return py_samr_Connect_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
13715 : }
13716 :
13717 0 : static PyObject *py_samr_Connect_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
13718 : {
13719 0 : const struct ndr_interface_call *call = NULL;
13720 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13721 0 : struct ndr_pull *pull = NULL;
13722 0 : enum ndr_err_code err;
13723 :
13724 0 : if (ndr_table_samr.num_calls < 1) {
13725 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_unpack");
13726 0 : return NULL;
13727 : }
13728 0 : call = &ndr_table_samr.calls[0];
13729 :
13730 0 : pull = ndr_pull_init_blob(blob, object);
13731 0 : if (pull == NULL) {
13732 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
13733 0 : return NULL;
13734 : }
13735 :
13736 0 : pull->flags |= ndr_pull_flags;
13737 :
13738 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
13739 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
13740 0 : TALLOC_FREE(pull);
13741 0 : PyErr_SetNdrError(err);
13742 0 : return NULL;
13743 : }
13744 0 : if (!allow_remaining) {
13745 0 : uint32_t highest_ofs;
13746 :
13747 0 : if (pull->offset > pull->relative_highest_offset) {
13748 0 : highest_ofs = pull->offset;
13749 : } else {
13750 0 : highest_ofs = pull->relative_highest_offset;
13751 : }
13752 0 : if (highest_ofs < pull->data_size) {
13753 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
13754 : "not all bytes consumed ofs[%u] size[%u]",
13755 : highest_ofs, pull->data_size);
13756 0 : TALLOC_FREE(pull);
13757 0 : PyErr_SetNdrError(err);
13758 0 : return NULL;
13759 : }
13760 : }
13761 :
13762 0 : TALLOC_FREE(pull);
13763 0 : Py_RETURN_NONE;
13764 : }
13765 :
13766 0 : static PyObject *py_samr_Connect_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13767 : {
13768 0 : DATA_BLOB blob;
13769 0 : Py_ssize_t blob_length = 0;
13770 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13771 0 : PyObject *bigendian_obj = NULL;
13772 0 : PyObject *ndr64_obj = NULL;
13773 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13774 0 : PyObject *allow_remaining_obj = NULL;
13775 0 : bool allow_remaining = false;
13776 :
13777 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
13778 : discard_const_p(char *, kwnames),
13779 : &blob.data, &blob_length,
13780 : &bigendian_obj,
13781 : &ndr64_obj,
13782 : &allow_remaining_obj)) {
13783 0 : return NULL;
13784 : }
13785 0 : blob.length = blob_length;
13786 :
13787 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13788 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13789 : }
13790 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13791 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13792 : }
13793 :
13794 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13795 0 : allow_remaining = true;
13796 : }
13797 :
13798 0 : return py_samr_Connect_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
13799 : }
13800 :
13801 0 : static PyObject *py_samr_Connect_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
13802 : {
13803 0 : DATA_BLOB blob;
13804 0 : Py_ssize_t blob_length = 0;
13805 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
13806 0 : PyObject *bigendian_obj = NULL;
13807 0 : PyObject *ndr64_obj = NULL;
13808 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
13809 0 : PyObject *allow_remaining_obj = NULL;
13810 0 : bool allow_remaining = false;
13811 :
13812 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
13813 : discard_const_p(char *, kwnames),
13814 : &blob.data, &blob_length,
13815 : &bigendian_obj,
13816 : &ndr64_obj,
13817 : &allow_remaining_obj)) {
13818 0 : return NULL;
13819 : }
13820 0 : blob.length = blob_length;
13821 :
13822 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
13823 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
13824 : }
13825 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
13826 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
13827 : }
13828 :
13829 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
13830 0 : allow_remaining = true;
13831 : }
13832 :
13833 0 : return py_samr_Connect_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
13834 : }
13835 :
13836 0 : static PyObject *py_samr_Connect_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
13837 : {
13838 0 : const struct ndr_interface_call *call = NULL;
13839 0 : struct samr_Connect *object = (struct samr_Connect *)pytalloc_get_ptr(py_obj);
13840 0 : PyObject *ret;
13841 0 : char *retstr;
13842 :
13843 0 : if (ndr_table_samr.num_calls < 1) {
13844 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect_ndr_print");
13845 0 : return NULL;
13846 : }
13847 0 : call = &ndr_table_samr.calls[0];
13848 :
13849 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
13850 0 : ret = PyUnicode_FromString(retstr);
13851 0 : TALLOC_FREE(retstr);
13852 :
13853 0 : return ret;
13854 : }
13855 :
13856 0 : static PyObject *py_samr_Connect_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13857 : {
13858 0 : return py_samr_Connect_ndr_print(py_obj, "samr_Connect_in", NDR_IN);
13859 : }
13860 :
13861 0 : static PyObject *py_samr_Connect_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
13862 : {
13863 0 : return py_samr_Connect_ndr_print(py_obj, "samr_Connect_out", NDR_OUT);
13864 : }
13865 :
13866 : static PyMethodDef py_samr_Connect_methods[] = {
13867 : { "opnum", (PyCFunction)py_samr_Connect_ndr_opnum, METH_NOARGS|METH_CLASS,
13868 : "samr.Connect.opnum() -> 0 (0x00) " },
13869 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
13870 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
13871 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
13872 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
13873 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
13874 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
13875 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
13876 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
13877 : { "__ndr_print_in__", (PyCFunction)py_samr_Connect_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
13878 : { "__ndr_print_out__", (PyCFunction)py_samr_Connect_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
13879 : { NULL, NULL, 0, NULL }
13880 : };
13881 :
13882 :
13883 : static PyTypeObject samr_Connect_Type = {
13884 : PyVarObject_HEAD_INIT(NULL, 0)
13885 : .tp_name = "samr.Connect",
13886 : .tp_getset = py_samr_Connect_getsetters,
13887 : .tp_methods = py_samr_Connect_methods,
13888 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
13889 : .tp_new = py_samr_Connect_new,
13890 : };
13891 :
13892 0 : static bool pack_py_samr_Connect_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect *r)
13893 : {
13894 0 : PyObject *py_system_name;
13895 0 : PyObject *py_access_mask;
13896 0 : const char *kwnames[] = {
13897 : "system_name", "access_mask", NULL
13898 : };
13899 :
13900 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
13901 0 : return false;
13902 : }
13903 :
13904 0 : if (py_system_name == NULL) {
13905 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
13906 0 : return false;
13907 : }
13908 0 : if (py_system_name == Py_None) {
13909 0 : r->in.system_name = NULL;
13910 : } else {
13911 0 : r->in.system_name = talloc_ptrtype(r, r->in.system_name);
13912 0 : if (r->in.system_name == NULL) {
13913 0 : PyErr_NoMemory();
13914 0 : return false;
13915 : }
13916 : {
13917 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.system_name));
13918 0 : if (PyLong_Check(py_system_name)) {
13919 0 : unsigned long long test_var;
13920 0 : test_var = PyLong_AsUnsignedLongLong(py_system_name);
13921 0 : if (PyErr_Occurred() != NULL) {
13922 0 : return false;
13923 : }
13924 0 : if (test_var > uint_max) {
13925 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13926 : PyLong_Type.tp_name, uint_max, test_var);
13927 0 : return false;
13928 : }
13929 0 : *r->in.system_name = test_var;
13930 : } else {
13931 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13932 : PyLong_Type.tp_name);
13933 0 : return false;
13934 : }
13935 : }
13936 : }
13937 0 : if (py_access_mask == NULL) {
13938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
13939 0 : return false;
13940 : }
13941 : {
13942 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
13943 0 : if (PyLong_Check(py_access_mask)) {
13944 0 : unsigned long long test_var;
13945 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
13946 0 : if (PyErr_Occurred() != NULL) {
13947 0 : return false;
13948 : }
13949 0 : if (test_var > uint_max) {
13950 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
13951 : PyLong_Type.tp_name, uint_max, test_var);
13952 0 : return false;
13953 : }
13954 0 : r->in.access_mask = test_var;
13955 : } else {
13956 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
13957 : PyLong_Type.tp_name);
13958 0 : return false;
13959 : }
13960 : }
13961 0 : return true;
13962 : }
13963 :
13964 0 : static PyObject *unpack_py_samr_Connect_args_out(struct samr_Connect *r)
13965 : {
13966 0 : PyObject *result;
13967 0 : PyObject *py_connect_handle;
13968 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
13969 0 : result = py_connect_handle;
13970 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
13971 0 : PyErr_SetNTSTATUS(r->out.result);
13972 0 : return NULL;
13973 : }
13974 :
13975 0 : return result;
13976 : }
13977 :
13978 :
13979 0 : static PyObject *py_samr_Close_in_get_handle(PyObject *obj, void *closure)
13980 : {
13981 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj);
13982 0 : PyObject *py_handle;
13983 0 : if (object->in.handle == NULL) {
13984 0 : Py_RETURN_NONE;
13985 : }
13986 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
13987 0 : return py_handle;
13988 : }
13989 :
13990 0 : static int py_samr_Close_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
13991 : {
13992 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
13993 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
13994 0 : if (value == NULL) {
13995 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
13996 0 : return -1;
13997 : }
13998 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
13999 0 : if (object->in.handle == NULL) {
14000 0 : PyErr_NoMemory();
14001 0 : return -1;
14002 : }
14003 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14004 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14005 0 : PyErr_NoMemory();
14006 0 : return -1;
14007 : }
14008 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14009 0 : return 0;
14010 : }
14011 :
14012 0 : static PyObject *py_samr_Close_out_get_handle(PyObject *obj, void *closure)
14013 : {
14014 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj);
14015 0 : PyObject *py_handle;
14016 0 : if (object->out.handle == NULL) {
14017 0 : Py_RETURN_NONE;
14018 : }
14019 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
14020 0 : return py_handle;
14021 : }
14022 :
14023 0 : static int py_samr_Close_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14024 : {
14025 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
14026 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
14027 0 : if (value == NULL) {
14028 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.handle");
14029 0 : return -1;
14030 : }
14031 0 : object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
14032 0 : if (object->out.handle == NULL) {
14033 0 : PyErr_NoMemory();
14034 0 : return -1;
14035 : }
14036 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14037 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14038 0 : PyErr_NoMemory();
14039 0 : return -1;
14040 : }
14041 0 : object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14042 0 : return 0;
14043 : }
14044 :
14045 0 : static PyObject *py_samr_Close_get_result(PyObject *obj, void *closure)
14046 : {
14047 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(obj);
14048 0 : PyObject *py_result;
14049 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14050 0 : return py_result;
14051 : }
14052 :
14053 0 : static int py_samr_Close_set_result(PyObject *py_obj, PyObject *value, void *closure)
14054 : {
14055 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
14056 0 : if (value == NULL) {
14057 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14058 0 : return -1;
14059 : }
14060 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14061 0 : return 0;
14062 : }
14063 :
14064 : static PyGetSetDef py_samr_Close_getsetters[] = {
14065 : {
14066 : .name = discard_const_p(char, "in_handle"),
14067 : .get = py_samr_Close_in_get_handle,
14068 : .set = py_samr_Close_in_set_handle,
14069 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14070 : },
14071 : {
14072 : .name = discard_const_p(char, "out_handle"),
14073 : .get = py_samr_Close_out_get_handle,
14074 : .set = py_samr_Close_out_set_handle,
14075 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14076 : },
14077 : {
14078 : .name = discard_const_p(char, "result"),
14079 : .get = py_samr_Close_get_result,
14080 : .set = py_samr_Close_set_result,
14081 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14082 : },
14083 : { .name = NULL }
14084 : };
14085 :
14086 12 : static PyObject *py_samr_Close_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14087 : {
14088 12 : PyObject *self = pytalloc_new(struct samr_Close, type);
14089 12 : struct samr_Close *_self = (struct samr_Close *)pytalloc_get_ptr(self);
14090 12 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14091 12 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14092 12 : _self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
14093 12 : return self;
14094 : }
14095 :
14096 0 : static PyObject *py_samr_Close_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14097 : {
14098 :
14099 :
14100 0 : return PyLong_FromLong(1);
14101 : }
14102 :
14103 0 : static PyObject *py_samr_Close_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14104 : {
14105 0 : const struct ndr_interface_call *call = NULL;
14106 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
14107 0 : PyObject *ret = NULL;
14108 0 : struct ndr_push *push = NULL;
14109 0 : DATA_BLOB blob;
14110 0 : enum ndr_err_code err;
14111 :
14112 0 : if (ndr_table_samr.num_calls < 2) {
14113 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_pack");
14114 0 : return NULL;
14115 : }
14116 0 : call = &ndr_table_samr.calls[1];
14117 :
14118 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14119 0 : if (push == NULL) {
14120 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14121 0 : return NULL;
14122 : }
14123 :
14124 0 : push->flags |= ndr_push_flags;
14125 :
14126 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14127 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14128 0 : TALLOC_FREE(push);
14129 0 : PyErr_SetNdrError(err);
14130 0 : return NULL;
14131 : }
14132 0 : blob = ndr_push_blob(push);
14133 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14134 0 : TALLOC_FREE(push);
14135 0 : return ret;
14136 : }
14137 :
14138 0 : static PyObject *py_samr_Close_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14139 : {
14140 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14141 0 : PyObject *bigendian_obj = NULL;
14142 0 : PyObject *ndr64_obj = NULL;
14143 0 : libndr_flags ndr_push_flags = 0;
14144 :
14145 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14146 : discard_const_p(char *, kwnames),
14147 : &bigendian_obj,
14148 : &ndr64_obj)) {
14149 0 : return NULL;
14150 : }
14151 :
14152 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14153 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14154 : }
14155 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14156 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14157 : }
14158 :
14159 0 : return py_samr_Close_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14160 : }
14161 :
14162 0 : static PyObject *py_samr_Close_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14163 : {
14164 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14165 0 : PyObject *bigendian_obj = NULL;
14166 0 : PyObject *ndr64_obj = NULL;
14167 0 : libndr_flags ndr_push_flags = 0;
14168 :
14169 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14170 : discard_const_p(char *, kwnames),
14171 : &bigendian_obj,
14172 : &ndr64_obj)) {
14173 0 : return NULL;
14174 : }
14175 :
14176 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14177 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14178 : }
14179 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14180 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14181 : }
14182 :
14183 0 : return py_samr_Close_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14184 : }
14185 :
14186 0 : static PyObject *py_samr_Close_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14187 : {
14188 0 : const struct ndr_interface_call *call = NULL;
14189 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
14190 0 : struct ndr_pull *pull = NULL;
14191 0 : enum ndr_err_code err;
14192 :
14193 0 : if (ndr_table_samr.num_calls < 2) {
14194 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_unpack");
14195 0 : return NULL;
14196 : }
14197 0 : call = &ndr_table_samr.calls[1];
14198 :
14199 0 : pull = ndr_pull_init_blob(blob, object);
14200 0 : if (pull == NULL) {
14201 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14202 0 : return NULL;
14203 : }
14204 :
14205 0 : pull->flags |= ndr_pull_flags;
14206 :
14207 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14208 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14209 0 : TALLOC_FREE(pull);
14210 0 : PyErr_SetNdrError(err);
14211 0 : return NULL;
14212 : }
14213 0 : if (!allow_remaining) {
14214 0 : uint32_t highest_ofs;
14215 :
14216 0 : if (pull->offset > pull->relative_highest_offset) {
14217 0 : highest_ofs = pull->offset;
14218 : } else {
14219 0 : highest_ofs = pull->relative_highest_offset;
14220 : }
14221 0 : if (highest_ofs < pull->data_size) {
14222 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14223 : "not all bytes consumed ofs[%u] size[%u]",
14224 : highest_ofs, pull->data_size);
14225 0 : TALLOC_FREE(pull);
14226 0 : PyErr_SetNdrError(err);
14227 0 : return NULL;
14228 : }
14229 : }
14230 :
14231 0 : TALLOC_FREE(pull);
14232 0 : Py_RETURN_NONE;
14233 : }
14234 :
14235 0 : static PyObject *py_samr_Close_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14236 : {
14237 0 : DATA_BLOB blob;
14238 0 : Py_ssize_t blob_length = 0;
14239 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14240 0 : PyObject *bigendian_obj = NULL;
14241 0 : PyObject *ndr64_obj = NULL;
14242 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14243 0 : PyObject *allow_remaining_obj = NULL;
14244 0 : bool allow_remaining = false;
14245 :
14246 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14247 : discard_const_p(char *, kwnames),
14248 : &blob.data, &blob_length,
14249 : &bigendian_obj,
14250 : &ndr64_obj,
14251 : &allow_remaining_obj)) {
14252 0 : return NULL;
14253 : }
14254 0 : blob.length = blob_length;
14255 :
14256 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14257 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14258 : }
14259 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14260 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14261 : }
14262 :
14263 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14264 0 : allow_remaining = true;
14265 : }
14266 :
14267 0 : return py_samr_Close_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14268 : }
14269 :
14270 0 : static PyObject *py_samr_Close_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14271 : {
14272 0 : DATA_BLOB blob;
14273 0 : Py_ssize_t blob_length = 0;
14274 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14275 0 : PyObject *bigendian_obj = NULL;
14276 0 : PyObject *ndr64_obj = NULL;
14277 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14278 0 : PyObject *allow_remaining_obj = NULL;
14279 0 : bool allow_remaining = false;
14280 :
14281 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14282 : discard_const_p(char *, kwnames),
14283 : &blob.data, &blob_length,
14284 : &bigendian_obj,
14285 : &ndr64_obj,
14286 : &allow_remaining_obj)) {
14287 0 : return NULL;
14288 : }
14289 0 : blob.length = blob_length;
14290 :
14291 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14292 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14293 : }
14294 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14295 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14296 : }
14297 :
14298 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14299 0 : allow_remaining = true;
14300 : }
14301 :
14302 0 : return py_samr_Close_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14303 : }
14304 :
14305 0 : static PyObject *py_samr_Close_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14306 : {
14307 0 : const struct ndr_interface_call *call = NULL;
14308 0 : struct samr_Close *object = (struct samr_Close *)pytalloc_get_ptr(py_obj);
14309 0 : PyObject *ret;
14310 0 : char *retstr;
14311 :
14312 0 : if (ndr_table_samr.num_calls < 2) {
14313 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Close_ndr_print");
14314 0 : return NULL;
14315 : }
14316 0 : call = &ndr_table_samr.calls[1];
14317 :
14318 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14319 0 : ret = PyUnicode_FromString(retstr);
14320 0 : TALLOC_FREE(retstr);
14321 :
14322 0 : return ret;
14323 : }
14324 :
14325 0 : static PyObject *py_samr_Close_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14326 : {
14327 0 : return py_samr_Close_ndr_print(py_obj, "samr_Close_in", NDR_IN);
14328 : }
14329 :
14330 0 : static PyObject *py_samr_Close_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14331 : {
14332 0 : return py_samr_Close_ndr_print(py_obj, "samr_Close_out", NDR_OUT);
14333 : }
14334 :
14335 : static PyMethodDef py_samr_Close_methods[] = {
14336 : { "opnum", (PyCFunction)py_samr_Close_ndr_opnum, METH_NOARGS|METH_CLASS,
14337 : "samr.Close.opnum() -> 1 (0x01) " },
14338 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Close_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14339 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14340 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Close_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14341 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14342 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Close_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14343 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14344 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Close_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14345 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14346 : { "__ndr_print_in__", (PyCFunction)py_samr_Close_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14347 : { "__ndr_print_out__", (PyCFunction)py_samr_Close_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14348 : { NULL, NULL, 0, NULL }
14349 : };
14350 :
14351 :
14352 : static PyTypeObject samr_Close_Type = {
14353 : PyVarObject_HEAD_INIT(NULL, 0)
14354 : .tp_name = "samr.Close",
14355 : .tp_getset = py_samr_Close_getsetters,
14356 : .tp_methods = py_samr_Close_methods,
14357 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14358 : .tp_new = py_samr_Close_new,
14359 : };
14360 :
14361 839 : static bool pack_py_samr_Close_args_in(PyObject *args, PyObject *kwargs, struct samr_Close *r)
14362 : {
14363 0 : PyObject *py_handle;
14364 839 : const char *kwnames[] = {
14365 : "handle", NULL
14366 : };
14367 :
14368 839 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Close", discard_const_p(char *, kwnames), &py_handle)) {
14369 0 : return false;
14370 : }
14371 :
14372 839 : if (py_handle == NULL) {
14373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14374 0 : return false;
14375 : }
14376 839 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14377 839 : if (r->in.handle == NULL) {
14378 0 : PyErr_NoMemory();
14379 0 : return false;
14380 : }
14381 839 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14382 839 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14383 0 : PyErr_NoMemory();
14384 0 : return false;
14385 : }
14386 839 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14387 839 : return true;
14388 : }
14389 :
14390 839 : static PyObject *unpack_py_samr_Close_args_out(struct samr_Close *r)
14391 : {
14392 0 : PyObject *result;
14393 0 : PyObject *py_handle;
14394 839 : py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
14395 839 : result = py_handle;
14396 839 : if (NT_STATUS_IS_ERR(r->out.result)) {
14397 0 : PyErr_SetNTSTATUS(r->out.result);
14398 0 : return NULL;
14399 : }
14400 :
14401 839 : return result;
14402 : }
14403 :
14404 :
14405 0 : static PyObject *py_samr_SetSecurity_in_get_handle(PyObject *obj, void *closure)
14406 : {
14407 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj);
14408 0 : PyObject *py_handle;
14409 0 : if (object->in.handle == NULL) {
14410 0 : Py_RETURN_NONE;
14411 : }
14412 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14413 0 : return py_handle;
14414 : }
14415 :
14416 0 : static int py_samr_SetSecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14417 : {
14418 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14419 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14420 0 : if (value == NULL) {
14421 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14422 0 : return -1;
14423 : }
14424 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14425 0 : if (object->in.handle == NULL) {
14426 0 : PyErr_NoMemory();
14427 0 : return -1;
14428 : }
14429 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14430 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14431 0 : PyErr_NoMemory();
14432 0 : return -1;
14433 : }
14434 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14435 0 : return 0;
14436 : }
14437 :
14438 0 : static PyObject *py_samr_SetSecurity_in_get_sec_info(PyObject *obj, void *closure)
14439 : {
14440 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj);
14441 0 : PyObject *py_sec_info;
14442 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
14443 0 : return py_sec_info;
14444 : }
14445 :
14446 0 : static int py_samr_SetSecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
14447 : {
14448 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14449 0 : if (value == NULL) {
14450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
14451 0 : return -1;
14452 : }
14453 : {
14454 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
14455 0 : if (PyLong_Check(value)) {
14456 0 : unsigned long long test_var;
14457 0 : test_var = PyLong_AsUnsignedLongLong(value);
14458 0 : if (PyErr_Occurred() != NULL) {
14459 0 : return -1;
14460 : }
14461 0 : if (test_var > uint_max) {
14462 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14463 : PyLong_Type.tp_name, uint_max, test_var);
14464 0 : return -1;
14465 : }
14466 0 : object->in.sec_info = test_var;
14467 : } else {
14468 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14469 : PyLong_Type.tp_name);
14470 0 : return -1;
14471 : }
14472 : }
14473 0 : return 0;
14474 : }
14475 :
14476 0 : static PyObject *py_samr_SetSecurity_in_get_sdbuf(PyObject *obj, void *closure)
14477 : {
14478 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj);
14479 0 : PyObject *py_sdbuf;
14480 0 : if (object->in.sdbuf == NULL) {
14481 0 : Py_RETURN_NONE;
14482 : }
14483 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, object->in.sdbuf, object->in.sdbuf);
14484 0 : return py_sdbuf;
14485 : }
14486 :
14487 0 : static int py_samr_SetSecurity_in_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
14488 : {
14489 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14490 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sdbuf));
14491 0 : if (value == NULL) {
14492 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sdbuf");
14493 0 : return -1;
14494 : }
14495 0 : object->in.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sdbuf);
14496 0 : if (object->in.sdbuf == NULL) {
14497 0 : PyErr_NoMemory();
14498 0 : return -1;
14499 : }
14500 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
14501 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14502 0 : PyErr_NoMemory();
14503 0 : return -1;
14504 : }
14505 0 : object->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
14506 0 : return 0;
14507 : }
14508 :
14509 0 : static PyObject *py_samr_SetSecurity_get_result(PyObject *obj, void *closure)
14510 : {
14511 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(obj);
14512 0 : PyObject *py_result;
14513 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
14514 0 : return py_result;
14515 : }
14516 :
14517 0 : static int py_samr_SetSecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
14518 : {
14519 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14520 0 : if (value == NULL) {
14521 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
14522 0 : return -1;
14523 : }
14524 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
14525 0 : return 0;
14526 : }
14527 :
14528 : static PyGetSetDef py_samr_SetSecurity_getsetters[] = {
14529 : {
14530 : .name = discard_const_p(char, "in_handle"),
14531 : .get = py_samr_SetSecurity_in_get_handle,
14532 : .set = py_samr_SetSecurity_in_set_handle,
14533 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
14534 : },
14535 : {
14536 : .name = discard_const_p(char, "in_sec_info"),
14537 : .get = py_samr_SetSecurity_in_get_sec_info,
14538 : .set = py_samr_SetSecurity_in_set_sec_info,
14539 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
14540 : },
14541 : {
14542 : .name = discard_const_p(char, "in_sdbuf"),
14543 : .get = py_samr_SetSecurity_in_get_sdbuf,
14544 : .set = py_samr_SetSecurity_in_set_sdbuf,
14545 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
14546 : },
14547 : {
14548 : .name = discard_const_p(char, "result"),
14549 : .get = py_samr_SetSecurity_get_result,
14550 : .set = py_samr_SetSecurity_set_result,
14551 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
14552 : },
14553 : { .name = NULL }
14554 : };
14555 :
14556 0 : static PyObject *py_samr_SetSecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
14557 : {
14558 0 : PyObject *self = pytalloc_new(struct samr_SetSecurity, type);
14559 0 : struct samr_SetSecurity *_self = (struct samr_SetSecurity *)pytalloc_get_ptr(self);
14560 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
14561 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
14562 0 : _self->in.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf);
14563 0 : return self;
14564 : }
14565 :
14566 0 : static PyObject *py_samr_SetSecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
14567 : {
14568 :
14569 :
14570 0 : return PyLong_FromLong(2);
14571 : }
14572 :
14573 0 : static PyObject *py_samr_SetSecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
14574 : {
14575 0 : const struct ndr_interface_call *call = NULL;
14576 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14577 0 : PyObject *ret = NULL;
14578 0 : struct ndr_push *push = NULL;
14579 0 : DATA_BLOB blob;
14580 0 : enum ndr_err_code err;
14581 :
14582 0 : if (ndr_table_samr.num_calls < 3) {
14583 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_pack");
14584 0 : return NULL;
14585 : }
14586 0 : call = &ndr_table_samr.calls[2];
14587 :
14588 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
14589 0 : if (push == NULL) {
14590 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14591 0 : return NULL;
14592 : }
14593 :
14594 0 : push->flags |= ndr_push_flags;
14595 :
14596 0 : err = call->ndr_push(push, ndr_inout_flags, object);
14597 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14598 0 : TALLOC_FREE(push);
14599 0 : PyErr_SetNdrError(err);
14600 0 : return NULL;
14601 : }
14602 0 : blob = ndr_push_blob(push);
14603 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
14604 0 : TALLOC_FREE(push);
14605 0 : return ret;
14606 : }
14607 :
14608 0 : static PyObject *py_samr_SetSecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14609 : {
14610 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14611 0 : PyObject *bigendian_obj = NULL;
14612 0 : PyObject *ndr64_obj = NULL;
14613 0 : libndr_flags ndr_push_flags = 0;
14614 :
14615 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
14616 : discard_const_p(char *, kwnames),
14617 : &bigendian_obj,
14618 : &ndr64_obj)) {
14619 0 : return NULL;
14620 : }
14621 :
14622 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14623 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14624 : }
14625 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14626 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14627 : }
14628 :
14629 0 : return py_samr_SetSecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
14630 : }
14631 :
14632 0 : static PyObject *py_samr_SetSecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14633 : {
14634 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
14635 0 : PyObject *bigendian_obj = NULL;
14636 0 : PyObject *ndr64_obj = NULL;
14637 0 : libndr_flags ndr_push_flags = 0;
14638 :
14639 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
14640 : discard_const_p(char *, kwnames),
14641 : &bigendian_obj,
14642 : &ndr64_obj)) {
14643 0 : return NULL;
14644 : }
14645 :
14646 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14647 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
14648 : }
14649 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14650 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
14651 : }
14652 :
14653 0 : return py_samr_SetSecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
14654 : }
14655 :
14656 0 : static PyObject *py_samr_SetSecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
14657 : {
14658 0 : const struct ndr_interface_call *call = NULL;
14659 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14660 0 : struct ndr_pull *pull = NULL;
14661 0 : enum ndr_err_code err;
14662 :
14663 0 : if (ndr_table_samr.num_calls < 3) {
14664 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_unpack");
14665 0 : return NULL;
14666 : }
14667 0 : call = &ndr_table_samr.calls[2];
14668 :
14669 0 : pull = ndr_pull_init_blob(blob, object);
14670 0 : if (pull == NULL) {
14671 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
14672 0 : return NULL;
14673 : }
14674 :
14675 0 : pull->flags |= ndr_pull_flags;
14676 :
14677 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
14678 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
14679 0 : TALLOC_FREE(pull);
14680 0 : PyErr_SetNdrError(err);
14681 0 : return NULL;
14682 : }
14683 0 : if (!allow_remaining) {
14684 0 : uint32_t highest_ofs;
14685 :
14686 0 : if (pull->offset > pull->relative_highest_offset) {
14687 0 : highest_ofs = pull->offset;
14688 : } else {
14689 0 : highest_ofs = pull->relative_highest_offset;
14690 : }
14691 0 : if (highest_ofs < pull->data_size) {
14692 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
14693 : "not all bytes consumed ofs[%u] size[%u]",
14694 : highest_ofs, pull->data_size);
14695 0 : TALLOC_FREE(pull);
14696 0 : PyErr_SetNdrError(err);
14697 0 : return NULL;
14698 : }
14699 : }
14700 :
14701 0 : TALLOC_FREE(pull);
14702 0 : Py_RETURN_NONE;
14703 : }
14704 :
14705 0 : static PyObject *py_samr_SetSecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14706 : {
14707 0 : DATA_BLOB blob;
14708 0 : Py_ssize_t blob_length = 0;
14709 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14710 0 : PyObject *bigendian_obj = NULL;
14711 0 : PyObject *ndr64_obj = NULL;
14712 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14713 0 : PyObject *allow_remaining_obj = NULL;
14714 0 : bool allow_remaining = false;
14715 :
14716 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
14717 : discard_const_p(char *, kwnames),
14718 : &blob.data, &blob_length,
14719 : &bigendian_obj,
14720 : &ndr64_obj,
14721 : &allow_remaining_obj)) {
14722 0 : return NULL;
14723 : }
14724 0 : blob.length = blob_length;
14725 :
14726 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14727 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14728 : }
14729 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14730 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14731 : }
14732 :
14733 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14734 0 : allow_remaining = true;
14735 : }
14736 :
14737 0 : return py_samr_SetSecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
14738 : }
14739 :
14740 0 : static PyObject *py_samr_SetSecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
14741 : {
14742 0 : DATA_BLOB blob;
14743 0 : Py_ssize_t blob_length = 0;
14744 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
14745 0 : PyObject *bigendian_obj = NULL;
14746 0 : PyObject *ndr64_obj = NULL;
14747 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
14748 0 : PyObject *allow_remaining_obj = NULL;
14749 0 : bool allow_remaining = false;
14750 :
14751 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
14752 : discard_const_p(char *, kwnames),
14753 : &blob.data, &blob_length,
14754 : &bigendian_obj,
14755 : &ndr64_obj,
14756 : &allow_remaining_obj)) {
14757 0 : return NULL;
14758 : }
14759 0 : blob.length = blob_length;
14760 :
14761 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
14762 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
14763 : }
14764 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
14765 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
14766 : }
14767 :
14768 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
14769 0 : allow_remaining = true;
14770 : }
14771 :
14772 0 : return py_samr_SetSecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
14773 : }
14774 :
14775 0 : static PyObject *py_samr_SetSecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
14776 : {
14777 0 : const struct ndr_interface_call *call = NULL;
14778 0 : struct samr_SetSecurity *object = (struct samr_SetSecurity *)pytalloc_get_ptr(py_obj);
14779 0 : PyObject *ret;
14780 0 : char *retstr;
14781 :
14782 0 : if (ndr_table_samr.num_calls < 3) {
14783 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetSecurity_ndr_print");
14784 0 : return NULL;
14785 : }
14786 0 : call = &ndr_table_samr.calls[2];
14787 :
14788 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
14789 0 : ret = PyUnicode_FromString(retstr);
14790 0 : TALLOC_FREE(retstr);
14791 :
14792 0 : return ret;
14793 : }
14794 :
14795 0 : static PyObject *py_samr_SetSecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14796 : {
14797 0 : return py_samr_SetSecurity_ndr_print(py_obj, "samr_SetSecurity_in", NDR_IN);
14798 : }
14799 :
14800 0 : static PyObject *py_samr_SetSecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
14801 : {
14802 0 : return py_samr_SetSecurity_ndr_print(py_obj, "samr_SetSecurity_out", NDR_OUT);
14803 : }
14804 :
14805 : static PyMethodDef py_samr_SetSecurity_methods[] = {
14806 : { "opnum", (PyCFunction)py_samr_SetSecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
14807 : "samr.SetSecurity.opnum() -> 2 (0x02) " },
14808 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetSecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
14809 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
14810 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetSecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
14811 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
14812 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetSecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
14813 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
14814 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetSecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
14815 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
14816 : { "__ndr_print_in__", (PyCFunction)py_samr_SetSecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
14817 : { "__ndr_print_out__", (PyCFunction)py_samr_SetSecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
14818 : { NULL, NULL, 0, NULL }
14819 : };
14820 :
14821 :
14822 : static PyTypeObject samr_SetSecurity_Type = {
14823 : PyVarObject_HEAD_INIT(NULL, 0)
14824 : .tp_name = "samr.SetSecurity",
14825 : .tp_getset = py_samr_SetSecurity_getsetters,
14826 : .tp_methods = py_samr_SetSecurity_methods,
14827 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
14828 : .tp_new = py_samr_SetSecurity_new,
14829 : };
14830 :
14831 0 : static bool pack_py_samr_SetSecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_SetSecurity *r)
14832 : {
14833 0 : PyObject *py_handle;
14834 0 : PyObject *py_sec_info;
14835 0 : PyObject *py_sdbuf;
14836 0 : const char *kwnames[] = {
14837 : "handle", "sec_info", "sdbuf", NULL
14838 : };
14839 :
14840 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetSecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
14841 0 : return false;
14842 : }
14843 :
14844 0 : if (py_handle == NULL) {
14845 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
14846 0 : return false;
14847 : }
14848 0 : r->in.handle = talloc_ptrtype(r, r->in.handle);
14849 0 : if (r->in.handle == NULL) {
14850 0 : PyErr_NoMemory();
14851 0 : return false;
14852 : }
14853 0 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
14854 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
14855 0 : PyErr_NoMemory();
14856 0 : return false;
14857 : }
14858 0 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
14859 0 : if (py_sec_info == NULL) {
14860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
14861 0 : return false;
14862 : }
14863 : {
14864 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
14865 0 : if (PyLong_Check(py_sec_info)) {
14866 0 : unsigned long long test_var;
14867 0 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
14868 0 : if (PyErr_Occurred() != NULL) {
14869 0 : return false;
14870 : }
14871 0 : if (test_var > uint_max) {
14872 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14873 : PyLong_Type.tp_name, uint_max, test_var);
14874 0 : return false;
14875 : }
14876 0 : r->in.sec_info = test_var;
14877 : } else {
14878 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14879 : PyLong_Type.tp_name);
14880 0 : return false;
14881 : }
14882 : }
14883 0 : if (py_sdbuf == NULL) {
14884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sdbuf");
14885 0 : return false;
14886 : }
14887 0 : r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
14888 0 : if (r->in.sdbuf == NULL) {
14889 0 : PyErr_NoMemory();
14890 0 : return false;
14891 : }
14892 0 : PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
14893 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
14894 0 : PyErr_NoMemory();
14895 0 : return false;
14896 : }
14897 0 : r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
14898 0 : return true;
14899 : }
14900 :
14901 0 : static PyObject *unpack_py_samr_SetSecurity_args_out(struct samr_SetSecurity *r)
14902 : {
14903 0 : PyObject *result;
14904 0 : result = Py_None;
14905 0 : Py_INCREF(result);
14906 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
14907 0 : PyErr_SetNTSTATUS(r->out.result);
14908 0 : return NULL;
14909 : }
14910 :
14911 0 : return result;
14912 : }
14913 :
14914 :
14915 0 : static PyObject *py_samr_QuerySecurity_in_get_handle(PyObject *obj, void *closure)
14916 : {
14917 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj);
14918 0 : PyObject *py_handle;
14919 0 : if (object->in.handle == NULL) {
14920 0 : Py_RETURN_NONE;
14921 : }
14922 0 : py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
14923 0 : return py_handle;
14924 : }
14925 :
14926 0 : static int py_samr_QuerySecurity_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
14927 : {
14928 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
14929 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
14930 0 : if (value == NULL) {
14931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.handle");
14932 0 : return -1;
14933 : }
14934 0 : object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
14935 0 : if (object->in.handle == NULL) {
14936 0 : PyErr_NoMemory();
14937 0 : return -1;
14938 : }
14939 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
14940 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
14941 0 : PyErr_NoMemory();
14942 0 : return -1;
14943 : }
14944 0 : object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
14945 0 : return 0;
14946 : }
14947 :
14948 0 : static PyObject *py_samr_QuerySecurity_in_get_sec_info(PyObject *obj, void *closure)
14949 : {
14950 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj);
14951 0 : PyObject *py_sec_info;
14952 0 : py_sec_info = PyLong_FromUnsignedLongLong((uint32_t)object->in.sec_info);
14953 0 : return py_sec_info;
14954 : }
14955 :
14956 0 : static int py_samr_QuerySecurity_in_set_sec_info(PyObject *py_obj, PyObject *value, void *closure)
14957 : {
14958 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
14959 0 : if (value == NULL) {
14960 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sec_info");
14961 0 : return -1;
14962 : }
14963 : {
14964 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.sec_info));
14965 0 : if (PyLong_Check(value)) {
14966 0 : unsigned long long test_var;
14967 0 : test_var = PyLong_AsUnsignedLongLong(value);
14968 0 : if (PyErr_Occurred() != NULL) {
14969 0 : return -1;
14970 : }
14971 0 : if (test_var > uint_max) {
14972 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
14973 : PyLong_Type.tp_name, uint_max, test_var);
14974 0 : return -1;
14975 : }
14976 0 : object->in.sec_info = test_var;
14977 : } else {
14978 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
14979 : PyLong_Type.tp_name);
14980 0 : return -1;
14981 : }
14982 : }
14983 0 : return 0;
14984 : }
14985 :
14986 0 : static PyObject *py_samr_QuerySecurity_out_get_sdbuf(PyObject *obj, void *closure)
14987 : {
14988 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj);
14989 0 : PyObject *py_sdbuf;
14990 0 : if (object->out.sdbuf == NULL) {
14991 0 : Py_RETURN_NONE;
14992 : }
14993 0 : if (*object->out.sdbuf == NULL) {
14994 0 : py_sdbuf = Py_None;
14995 0 : Py_INCREF(py_sdbuf);
14996 : } else {
14997 0 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *object->out.sdbuf, *object->out.sdbuf);
14998 : }
14999 0 : return py_sdbuf;
15000 : }
15001 :
15002 0 : static int py_samr_QuerySecurity_out_set_sdbuf(PyObject *py_obj, PyObject *value, void *closure)
15003 : {
15004 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
15005 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sdbuf));
15006 0 : if (value == NULL) {
15007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sdbuf");
15008 0 : return -1;
15009 : }
15010 0 : object->out.sdbuf = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sdbuf);
15011 0 : if (object->out.sdbuf == NULL) {
15012 0 : PyErr_NoMemory();
15013 0 : return -1;
15014 : }
15015 0 : if (value == Py_None) {
15016 0 : *object->out.sdbuf = NULL;
15017 : } else {
15018 0 : *object->out.sdbuf = NULL;
15019 0 : PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
15020 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15021 0 : PyErr_NoMemory();
15022 0 : return -1;
15023 : }
15024 0 : *object->out.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(value);
15025 : }
15026 0 : return 0;
15027 : }
15028 :
15029 0 : static PyObject *py_samr_QuerySecurity_get_result(PyObject *obj, void *closure)
15030 : {
15031 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(obj);
15032 0 : PyObject *py_result;
15033 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15034 0 : return py_result;
15035 : }
15036 :
15037 0 : static int py_samr_QuerySecurity_set_result(PyObject *py_obj, PyObject *value, void *closure)
15038 : {
15039 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
15040 0 : if (value == NULL) {
15041 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15042 0 : return -1;
15043 : }
15044 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15045 0 : return 0;
15046 : }
15047 :
15048 : static PyGetSetDef py_samr_QuerySecurity_getsetters[] = {
15049 : {
15050 : .name = discard_const_p(char, "in_handle"),
15051 : .get = py_samr_QuerySecurity_in_get_handle,
15052 : .set = py_samr_QuerySecurity_in_set_handle,
15053 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15054 : },
15055 : {
15056 : .name = discard_const_p(char, "in_sec_info"),
15057 : .get = py_samr_QuerySecurity_in_get_sec_info,
15058 : .set = py_samr_QuerySecurity_in_set_sec_info,
15059 : .doc = discard_const_p(char, "PIDL-generated element of base type security_secinfo")
15060 : },
15061 : {
15062 : .name = discard_const_p(char, "out_sdbuf"),
15063 : .get = py_samr_QuerySecurity_out_get_sdbuf,
15064 : .set = py_samr_QuerySecurity_out_set_sdbuf,
15065 : .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
15066 : },
15067 : {
15068 : .name = discard_const_p(char, "result"),
15069 : .get = py_samr_QuerySecurity_get_result,
15070 : .set = py_samr_QuerySecurity_set_result,
15071 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15072 : },
15073 : { .name = NULL }
15074 : };
15075 :
15076 0 : static PyObject *py_samr_QuerySecurity_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15077 : {
15078 0 : PyObject *self = pytalloc_new(struct samr_QuerySecurity, type);
15079 0 : struct samr_QuerySecurity *_self = (struct samr_QuerySecurity *)pytalloc_get_ptr(self);
15080 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15081 0 : _self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
15082 : /* a pointer to a NULL pointer */
15083 0 : _self->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
15084 0 : return self;
15085 : }
15086 :
15087 0 : static PyObject *py_samr_QuerySecurity_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15088 : {
15089 :
15090 :
15091 0 : return PyLong_FromLong(3);
15092 : }
15093 :
15094 0 : static PyObject *py_samr_QuerySecurity_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15095 : {
15096 0 : const struct ndr_interface_call *call = NULL;
15097 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
15098 0 : PyObject *ret = NULL;
15099 0 : struct ndr_push *push = NULL;
15100 0 : DATA_BLOB blob;
15101 0 : enum ndr_err_code err;
15102 :
15103 0 : if (ndr_table_samr.num_calls < 4) {
15104 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_pack");
15105 0 : return NULL;
15106 : }
15107 0 : call = &ndr_table_samr.calls[3];
15108 :
15109 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15110 0 : if (push == NULL) {
15111 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15112 0 : return NULL;
15113 : }
15114 :
15115 0 : push->flags |= ndr_push_flags;
15116 :
15117 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15118 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15119 0 : TALLOC_FREE(push);
15120 0 : PyErr_SetNdrError(err);
15121 0 : return NULL;
15122 : }
15123 0 : blob = ndr_push_blob(push);
15124 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15125 0 : TALLOC_FREE(push);
15126 0 : return ret;
15127 : }
15128 :
15129 0 : static PyObject *py_samr_QuerySecurity_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15130 : {
15131 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15132 0 : PyObject *bigendian_obj = NULL;
15133 0 : PyObject *ndr64_obj = NULL;
15134 0 : libndr_flags ndr_push_flags = 0;
15135 :
15136 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15137 : discard_const_p(char *, kwnames),
15138 : &bigendian_obj,
15139 : &ndr64_obj)) {
15140 0 : return NULL;
15141 : }
15142 :
15143 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15144 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15145 : }
15146 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15147 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15148 : }
15149 :
15150 0 : return py_samr_QuerySecurity_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15151 : }
15152 :
15153 0 : static PyObject *py_samr_QuerySecurity_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15154 : {
15155 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15156 0 : PyObject *bigendian_obj = NULL;
15157 0 : PyObject *ndr64_obj = NULL;
15158 0 : libndr_flags ndr_push_flags = 0;
15159 :
15160 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15161 : discard_const_p(char *, kwnames),
15162 : &bigendian_obj,
15163 : &ndr64_obj)) {
15164 0 : return NULL;
15165 : }
15166 :
15167 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15168 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15169 : }
15170 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15171 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15172 : }
15173 :
15174 0 : return py_samr_QuerySecurity_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15175 : }
15176 :
15177 0 : static PyObject *py_samr_QuerySecurity_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15178 : {
15179 0 : const struct ndr_interface_call *call = NULL;
15180 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
15181 0 : struct ndr_pull *pull = NULL;
15182 0 : enum ndr_err_code err;
15183 :
15184 0 : if (ndr_table_samr.num_calls < 4) {
15185 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_unpack");
15186 0 : return NULL;
15187 : }
15188 0 : call = &ndr_table_samr.calls[3];
15189 :
15190 0 : pull = ndr_pull_init_blob(blob, object);
15191 0 : if (pull == NULL) {
15192 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15193 0 : return NULL;
15194 : }
15195 :
15196 0 : pull->flags |= ndr_pull_flags;
15197 :
15198 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15199 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15200 0 : TALLOC_FREE(pull);
15201 0 : PyErr_SetNdrError(err);
15202 0 : return NULL;
15203 : }
15204 0 : if (!allow_remaining) {
15205 0 : uint32_t highest_ofs;
15206 :
15207 0 : if (pull->offset > pull->relative_highest_offset) {
15208 0 : highest_ofs = pull->offset;
15209 : } else {
15210 0 : highest_ofs = pull->relative_highest_offset;
15211 : }
15212 0 : if (highest_ofs < pull->data_size) {
15213 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15214 : "not all bytes consumed ofs[%u] size[%u]",
15215 : highest_ofs, pull->data_size);
15216 0 : TALLOC_FREE(pull);
15217 0 : PyErr_SetNdrError(err);
15218 0 : return NULL;
15219 : }
15220 : }
15221 :
15222 0 : TALLOC_FREE(pull);
15223 0 : Py_RETURN_NONE;
15224 : }
15225 :
15226 0 : static PyObject *py_samr_QuerySecurity_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15227 : {
15228 0 : DATA_BLOB blob;
15229 0 : Py_ssize_t blob_length = 0;
15230 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15231 0 : PyObject *bigendian_obj = NULL;
15232 0 : PyObject *ndr64_obj = NULL;
15233 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15234 0 : PyObject *allow_remaining_obj = NULL;
15235 0 : bool allow_remaining = false;
15236 :
15237 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15238 : discard_const_p(char *, kwnames),
15239 : &blob.data, &blob_length,
15240 : &bigendian_obj,
15241 : &ndr64_obj,
15242 : &allow_remaining_obj)) {
15243 0 : return NULL;
15244 : }
15245 0 : blob.length = blob_length;
15246 :
15247 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15248 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15249 : }
15250 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15251 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15252 : }
15253 :
15254 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15255 0 : allow_remaining = true;
15256 : }
15257 :
15258 0 : return py_samr_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15259 : }
15260 :
15261 0 : static PyObject *py_samr_QuerySecurity_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15262 : {
15263 0 : DATA_BLOB blob;
15264 0 : Py_ssize_t blob_length = 0;
15265 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15266 0 : PyObject *bigendian_obj = NULL;
15267 0 : PyObject *ndr64_obj = NULL;
15268 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15269 0 : PyObject *allow_remaining_obj = NULL;
15270 0 : bool allow_remaining = false;
15271 :
15272 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15273 : discard_const_p(char *, kwnames),
15274 : &blob.data, &blob_length,
15275 : &bigendian_obj,
15276 : &ndr64_obj,
15277 : &allow_remaining_obj)) {
15278 0 : return NULL;
15279 : }
15280 0 : blob.length = blob_length;
15281 :
15282 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15283 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15284 : }
15285 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15286 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15287 : }
15288 :
15289 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15290 0 : allow_remaining = true;
15291 : }
15292 :
15293 0 : return py_samr_QuerySecurity_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15294 : }
15295 :
15296 0 : static PyObject *py_samr_QuerySecurity_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15297 : {
15298 0 : const struct ndr_interface_call *call = NULL;
15299 0 : struct samr_QuerySecurity *object = (struct samr_QuerySecurity *)pytalloc_get_ptr(py_obj);
15300 0 : PyObject *ret;
15301 0 : char *retstr;
15302 :
15303 0 : if (ndr_table_samr.num_calls < 4) {
15304 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QuerySecurity_ndr_print");
15305 0 : return NULL;
15306 : }
15307 0 : call = &ndr_table_samr.calls[3];
15308 :
15309 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15310 0 : ret = PyUnicode_FromString(retstr);
15311 0 : TALLOC_FREE(retstr);
15312 :
15313 0 : return ret;
15314 : }
15315 :
15316 0 : static PyObject *py_samr_QuerySecurity_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15317 : {
15318 0 : return py_samr_QuerySecurity_ndr_print(py_obj, "samr_QuerySecurity_in", NDR_IN);
15319 : }
15320 :
15321 0 : static PyObject *py_samr_QuerySecurity_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15322 : {
15323 0 : return py_samr_QuerySecurity_ndr_print(py_obj, "samr_QuerySecurity_out", NDR_OUT);
15324 : }
15325 :
15326 : static PyMethodDef py_samr_QuerySecurity_methods[] = {
15327 : { "opnum", (PyCFunction)py_samr_QuerySecurity_ndr_opnum, METH_NOARGS|METH_CLASS,
15328 : "samr.QuerySecurity.opnum() -> 3 (0x03) " },
15329 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QuerySecurity_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15330 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15331 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QuerySecurity_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15332 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15333 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QuerySecurity_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15334 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15335 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QuerySecurity_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15336 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15337 : { "__ndr_print_in__", (PyCFunction)py_samr_QuerySecurity_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15338 : { "__ndr_print_out__", (PyCFunction)py_samr_QuerySecurity_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15339 : { NULL, NULL, 0, NULL }
15340 : };
15341 :
15342 :
15343 : static PyTypeObject samr_QuerySecurity_Type = {
15344 : PyVarObject_HEAD_INIT(NULL, 0)
15345 : .tp_name = "samr.QuerySecurity",
15346 : .tp_getset = py_samr_QuerySecurity_getsetters,
15347 : .tp_methods = py_samr_QuerySecurity_methods,
15348 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15349 : .tp_new = py_samr_QuerySecurity_new,
15350 : };
15351 :
15352 1 : static bool pack_py_samr_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_QuerySecurity *r)
15353 : {
15354 0 : PyObject *py_handle;
15355 0 : PyObject *py_sec_info;
15356 1 : const char *kwnames[] = {
15357 : "handle", "sec_info", NULL
15358 : };
15359 :
15360 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
15361 0 : return false;
15362 : }
15363 :
15364 1 : if (py_handle == NULL) {
15365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.handle");
15366 0 : return false;
15367 : }
15368 1 : r->in.handle = talloc_ptrtype(r, r->in.handle);
15369 1 : if (r->in.handle == NULL) {
15370 0 : PyErr_NoMemory();
15371 0 : return false;
15372 : }
15373 1 : PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
15374 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
15375 0 : PyErr_NoMemory();
15376 0 : return false;
15377 : }
15378 1 : r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
15379 1 : if (py_sec_info == NULL) {
15380 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sec_info");
15381 0 : return false;
15382 : }
15383 : {
15384 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.sec_info));
15385 1 : if (PyLong_Check(py_sec_info)) {
15386 0 : unsigned long long test_var;
15387 1 : test_var = PyLong_AsUnsignedLongLong(py_sec_info);
15388 1 : if (PyErr_Occurred() != NULL) {
15389 0 : return false;
15390 : }
15391 1 : if (test_var > uint_max) {
15392 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
15393 : PyLong_Type.tp_name, uint_max, test_var);
15394 0 : return false;
15395 : }
15396 1 : r->in.sec_info = test_var;
15397 : } else {
15398 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
15399 : PyLong_Type.tp_name);
15400 0 : return false;
15401 : }
15402 : }
15403 1 : return true;
15404 : }
15405 :
15406 1 : static PyObject *unpack_py_samr_QuerySecurity_args_out(struct samr_QuerySecurity *r)
15407 : {
15408 0 : PyObject *result;
15409 0 : PyObject *py_sdbuf;
15410 1 : if (*r->out.sdbuf == NULL) {
15411 0 : py_sdbuf = Py_None;
15412 0 : Py_INCREF(py_sdbuf);
15413 : } else {
15414 1 : py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
15415 : }
15416 1 : result = py_sdbuf;
15417 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
15418 0 : PyErr_SetNTSTATUS(r->out.result);
15419 0 : return NULL;
15420 : }
15421 :
15422 1 : return result;
15423 : }
15424 :
15425 :
15426 0 : static PyObject *py_samr_Shutdown_in_get_connect_handle(PyObject *obj, void *closure)
15427 : {
15428 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(obj);
15429 0 : PyObject *py_connect_handle;
15430 0 : if (object->in.connect_handle == NULL) {
15431 0 : Py_RETURN_NONE;
15432 : }
15433 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle);
15434 0 : return py_connect_handle;
15435 : }
15436 :
15437 0 : static int py_samr_Shutdown_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
15438 : {
15439 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj);
15440 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle));
15441 0 : if (value == NULL) {
15442 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle");
15443 0 : return -1;
15444 : }
15445 0 : object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle);
15446 0 : if (object->in.connect_handle == NULL) {
15447 0 : PyErr_NoMemory();
15448 0 : return -1;
15449 : }
15450 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15451 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15452 0 : PyErr_NoMemory();
15453 0 : return -1;
15454 : }
15455 0 : object->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
15456 0 : return 0;
15457 : }
15458 :
15459 0 : static PyObject *py_samr_Shutdown_get_result(PyObject *obj, void *closure)
15460 : {
15461 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(obj);
15462 0 : PyObject *py_result;
15463 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15464 0 : return py_result;
15465 : }
15466 :
15467 0 : static int py_samr_Shutdown_set_result(PyObject *py_obj, PyObject *value, void *closure)
15468 : {
15469 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj);
15470 0 : if (value == NULL) {
15471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15472 0 : return -1;
15473 : }
15474 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15475 0 : return 0;
15476 : }
15477 :
15478 : static PyGetSetDef py_samr_Shutdown_getsetters[] = {
15479 : {
15480 : .name = discard_const_p(char, "in_connect_handle"),
15481 : .get = py_samr_Shutdown_in_get_connect_handle,
15482 : .set = py_samr_Shutdown_in_set_connect_handle,
15483 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15484 : },
15485 : {
15486 : .name = discard_const_p(char, "result"),
15487 : .get = py_samr_Shutdown_get_result,
15488 : .set = py_samr_Shutdown_set_result,
15489 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15490 : },
15491 : { .name = NULL }
15492 : };
15493 :
15494 0 : static PyObject *py_samr_Shutdown_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15495 : {
15496 0 : PyObject *self = pytalloc_new(struct samr_Shutdown, type);
15497 0 : struct samr_Shutdown *_self = (struct samr_Shutdown *)pytalloc_get_ptr(self);
15498 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15499 0 : _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
15500 0 : return self;
15501 : }
15502 :
15503 0 : static PyObject *py_samr_Shutdown_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15504 : {
15505 :
15506 :
15507 0 : return PyLong_FromLong(4);
15508 : }
15509 :
15510 0 : static PyObject *py_samr_Shutdown_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15511 : {
15512 0 : const struct ndr_interface_call *call = NULL;
15513 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj);
15514 0 : PyObject *ret = NULL;
15515 0 : struct ndr_push *push = NULL;
15516 0 : DATA_BLOB blob;
15517 0 : enum ndr_err_code err;
15518 :
15519 0 : if (ndr_table_samr.num_calls < 5) {
15520 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_pack");
15521 0 : return NULL;
15522 : }
15523 0 : call = &ndr_table_samr.calls[4];
15524 :
15525 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
15526 0 : if (push == NULL) {
15527 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15528 0 : return NULL;
15529 : }
15530 :
15531 0 : push->flags |= ndr_push_flags;
15532 :
15533 0 : err = call->ndr_push(push, ndr_inout_flags, object);
15534 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15535 0 : TALLOC_FREE(push);
15536 0 : PyErr_SetNdrError(err);
15537 0 : return NULL;
15538 : }
15539 0 : blob = ndr_push_blob(push);
15540 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
15541 0 : TALLOC_FREE(push);
15542 0 : return ret;
15543 : }
15544 :
15545 0 : static PyObject *py_samr_Shutdown_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15546 : {
15547 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15548 0 : PyObject *bigendian_obj = NULL;
15549 0 : PyObject *ndr64_obj = NULL;
15550 0 : libndr_flags ndr_push_flags = 0;
15551 :
15552 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
15553 : discard_const_p(char *, kwnames),
15554 : &bigendian_obj,
15555 : &ndr64_obj)) {
15556 0 : return NULL;
15557 : }
15558 :
15559 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15560 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15561 : }
15562 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15563 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15564 : }
15565 :
15566 0 : return py_samr_Shutdown_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
15567 : }
15568 :
15569 0 : static PyObject *py_samr_Shutdown_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15570 : {
15571 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
15572 0 : PyObject *bigendian_obj = NULL;
15573 0 : PyObject *ndr64_obj = NULL;
15574 0 : libndr_flags ndr_push_flags = 0;
15575 :
15576 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
15577 : discard_const_p(char *, kwnames),
15578 : &bigendian_obj,
15579 : &ndr64_obj)) {
15580 0 : return NULL;
15581 : }
15582 :
15583 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15584 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
15585 : }
15586 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15587 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
15588 : }
15589 :
15590 0 : return py_samr_Shutdown_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
15591 : }
15592 :
15593 0 : static PyObject *py_samr_Shutdown_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
15594 : {
15595 0 : const struct ndr_interface_call *call = NULL;
15596 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj);
15597 0 : struct ndr_pull *pull = NULL;
15598 0 : enum ndr_err_code err;
15599 :
15600 0 : if (ndr_table_samr.num_calls < 5) {
15601 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_unpack");
15602 0 : return NULL;
15603 : }
15604 0 : call = &ndr_table_samr.calls[4];
15605 :
15606 0 : pull = ndr_pull_init_blob(blob, object);
15607 0 : if (pull == NULL) {
15608 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
15609 0 : return NULL;
15610 : }
15611 :
15612 0 : pull->flags |= ndr_pull_flags;
15613 :
15614 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
15615 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
15616 0 : TALLOC_FREE(pull);
15617 0 : PyErr_SetNdrError(err);
15618 0 : return NULL;
15619 : }
15620 0 : if (!allow_remaining) {
15621 0 : uint32_t highest_ofs;
15622 :
15623 0 : if (pull->offset > pull->relative_highest_offset) {
15624 0 : highest_ofs = pull->offset;
15625 : } else {
15626 0 : highest_ofs = pull->relative_highest_offset;
15627 : }
15628 0 : if (highest_ofs < pull->data_size) {
15629 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
15630 : "not all bytes consumed ofs[%u] size[%u]",
15631 : highest_ofs, pull->data_size);
15632 0 : TALLOC_FREE(pull);
15633 0 : PyErr_SetNdrError(err);
15634 0 : return NULL;
15635 : }
15636 : }
15637 :
15638 0 : TALLOC_FREE(pull);
15639 0 : Py_RETURN_NONE;
15640 : }
15641 :
15642 0 : static PyObject *py_samr_Shutdown_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15643 : {
15644 0 : DATA_BLOB blob;
15645 0 : Py_ssize_t blob_length = 0;
15646 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15647 0 : PyObject *bigendian_obj = NULL;
15648 0 : PyObject *ndr64_obj = NULL;
15649 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15650 0 : PyObject *allow_remaining_obj = NULL;
15651 0 : bool allow_remaining = false;
15652 :
15653 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
15654 : discard_const_p(char *, kwnames),
15655 : &blob.data, &blob_length,
15656 : &bigendian_obj,
15657 : &ndr64_obj,
15658 : &allow_remaining_obj)) {
15659 0 : return NULL;
15660 : }
15661 0 : blob.length = blob_length;
15662 :
15663 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15664 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15665 : }
15666 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15667 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15668 : }
15669 :
15670 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15671 0 : allow_remaining = true;
15672 : }
15673 :
15674 0 : return py_samr_Shutdown_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
15675 : }
15676 :
15677 0 : static PyObject *py_samr_Shutdown_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
15678 : {
15679 0 : DATA_BLOB blob;
15680 0 : Py_ssize_t blob_length = 0;
15681 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
15682 0 : PyObject *bigendian_obj = NULL;
15683 0 : PyObject *ndr64_obj = NULL;
15684 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
15685 0 : PyObject *allow_remaining_obj = NULL;
15686 0 : bool allow_remaining = false;
15687 :
15688 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
15689 : discard_const_p(char *, kwnames),
15690 : &blob.data, &blob_length,
15691 : &bigendian_obj,
15692 : &ndr64_obj,
15693 : &allow_remaining_obj)) {
15694 0 : return NULL;
15695 : }
15696 0 : blob.length = blob_length;
15697 :
15698 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
15699 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
15700 : }
15701 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
15702 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
15703 : }
15704 :
15705 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
15706 0 : allow_remaining = true;
15707 : }
15708 :
15709 0 : return py_samr_Shutdown_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
15710 : }
15711 :
15712 0 : static PyObject *py_samr_Shutdown_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
15713 : {
15714 0 : const struct ndr_interface_call *call = NULL;
15715 0 : struct samr_Shutdown *object = (struct samr_Shutdown *)pytalloc_get_ptr(py_obj);
15716 0 : PyObject *ret;
15717 0 : char *retstr;
15718 :
15719 0 : if (ndr_table_samr.num_calls < 5) {
15720 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Shutdown_ndr_print");
15721 0 : return NULL;
15722 : }
15723 0 : call = &ndr_table_samr.calls[4];
15724 :
15725 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
15726 0 : ret = PyUnicode_FromString(retstr);
15727 0 : TALLOC_FREE(retstr);
15728 :
15729 0 : return ret;
15730 : }
15731 :
15732 0 : static PyObject *py_samr_Shutdown_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15733 : {
15734 0 : return py_samr_Shutdown_ndr_print(py_obj, "samr_Shutdown_in", NDR_IN);
15735 : }
15736 :
15737 0 : static PyObject *py_samr_Shutdown_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
15738 : {
15739 0 : return py_samr_Shutdown_ndr_print(py_obj, "samr_Shutdown_out", NDR_OUT);
15740 : }
15741 :
15742 : static PyMethodDef py_samr_Shutdown_methods[] = {
15743 : { "opnum", (PyCFunction)py_samr_Shutdown_ndr_opnum, METH_NOARGS|METH_CLASS,
15744 : "samr.Shutdown.opnum() -> 4 (0x04) " },
15745 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Shutdown_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
15746 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
15747 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Shutdown_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
15748 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
15749 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Shutdown_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
15750 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
15751 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Shutdown_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
15752 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
15753 : { "__ndr_print_in__", (PyCFunction)py_samr_Shutdown_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
15754 : { "__ndr_print_out__", (PyCFunction)py_samr_Shutdown_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
15755 : { NULL, NULL, 0, NULL }
15756 : };
15757 :
15758 :
15759 : static PyTypeObject samr_Shutdown_Type = {
15760 : PyVarObject_HEAD_INIT(NULL, 0)
15761 : .tp_name = "samr.Shutdown",
15762 : .tp_getset = py_samr_Shutdown_getsetters,
15763 : .tp_methods = py_samr_Shutdown_methods,
15764 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
15765 : .tp_new = py_samr_Shutdown_new,
15766 : };
15767 :
15768 0 : static bool pack_py_samr_Shutdown_args_in(PyObject *args, PyObject *kwargs, struct samr_Shutdown *r)
15769 : {
15770 0 : PyObject *py_connect_handle;
15771 0 : const char *kwnames[] = {
15772 : "connect_handle", NULL
15773 : };
15774 :
15775 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Shutdown", discard_const_p(char *, kwnames), &py_connect_handle)) {
15776 0 : return false;
15777 : }
15778 :
15779 0 : if (py_connect_handle == NULL) {
15780 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle");
15781 0 : return false;
15782 : }
15783 0 : r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
15784 0 : if (r->in.connect_handle == NULL) {
15785 0 : PyErr_NoMemory();
15786 0 : return false;
15787 : }
15788 0 : PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
15789 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
15790 0 : PyErr_NoMemory();
15791 0 : return false;
15792 : }
15793 0 : r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
15794 0 : return true;
15795 : }
15796 :
15797 0 : static PyObject *unpack_py_samr_Shutdown_args_out(struct samr_Shutdown *r)
15798 : {
15799 0 : PyObject *result;
15800 0 : result = Py_None;
15801 0 : Py_INCREF(result);
15802 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
15803 0 : PyErr_SetNTSTATUS(r->out.result);
15804 0 : return NULL;
15805 : }
15806 :
15807 0 : return result;
15808 : }
15809 :
15810 :
15811 0 : static PyObject *py_samr_LookupDomain_in_get_connect_handle(PyObject *obj, void *closure)
15812 : {
15813 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj);
15814 0 : PyObject *py_connect_handle;
15815 0 : if (object->in.connect_handle == NULL) {
15816 0 : Py_RETURN_NONE;
15817 : }
15818 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle);
15819 0 : return py_connect_handle;
15820 : }
15821 :
15822 0 : static int py_samr_LookupDomain_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
15823 : {
15824 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
15825 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle));
15826 0 : if (value == NULL) {
15827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle");
15828 0 : return -1;
15829 : }
15830 0 : object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle);
15831 0 : if (object->in.connect_handle == NULL) {
15832 0 : PyErr_NoMemory();
15833 0 : return -1;
15834 : }
15835 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
15836 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15837 0 : PyErr_NoMemory();
15838 0 : return -1;
15839 : }
15840 0 : object->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
15841 0 : return 0;
15842 : }
15843 :
15844 0 : static PyObject *py_samr_LookupDomain_in_get_domain_name(PyObject *obj, void *closure)
15845 : {
15846 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj);
15847 0 : PyObject *py_domain_name;
15848 0 : if (object->in.domain_name == NULL) {
15849 0 : Py_RETURN_NONE;
15850 : }
15851 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, object->in.domain_name, object->in.domain_name);
15852 0 : return py_domain_name;
15853 : }
15854 :
15855 0 : static int py_samr_LookupDomain_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
15856 : {
15857 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
15858 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_name));
15859 0 : if (value == NULL) {
15860 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
15861 0 : return -1;
15862 : }
15863 0 : object->in.domain_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_name);
15864 0 : if (object->in.domain_name == NULL) {
15865 0 : PyErr_NoMemory();
15866 0 : return -1;
15867 : }
15868 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
15869 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15870 0 : PyErr_NoMemory();
15871 0 : return -1;
15872 : }
15873 0 : object->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
15874 0 : return 0;
15875 : }
15876 :
15877 0 : static PyObject *py_samr_LookupDomain_out_get_sid(PyObject *obj, void *closure)
15878 : {
15879 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj);
15880 0 : PyObject *py_sid;
15881 0 : if (object->out.sid == NULL) {
15882 0 : Py_RETURN_NONE;
15883 : }
15884 0 : if (*object->out.sid == NULL) {
15885 0 : py_sid = Py_None;
15886 0 : Py_INCREF(py_sid);
15887 : } else {
15888 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, *object->out.sid, *object->out.sid);
15889 : }
15890 0 : return py_sid;
15891 : }
15892 :
15893 0 : static int py_samr_LookupDomain_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
15894 : {
15895 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
15896 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
15897 0 : if (value == NULL) {
15898 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid");
15899 0 : return -1;
15900 : }
15901 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
15902 0 : if (object->out.sid == NULL) {
15903 0 : PyErr_NoMemory();
15904 0 : return -1;
15905 : }
15906 0 : if (value == Py_None) {
15907 0 : *object->out.sid = NULL;
15908 : } else {
15909 0 : *object->out.sid = NULL;
15910 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
15911 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
15912 0 : PyErr_NoMemory();
15913 0 : return -1;
15914 : }
15915 0 : *object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
15916 : }
15917 0 : return 0;
15918 : }
15919 :
15920 0 : static PyObject *py_samr_LookupDomain_get_result(PyObject *obj, void *closure)
15921 : {
15922 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(obj);
15923 0 : PyObject *py_result;
15924 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
15925 0 : return py_result;
15926 : }
15927 :
15928 0 : static int py_samr_LookupDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
15929 : {
15930 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
15931 0 : if (value == NULL) {
15932 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
15933 0 : return -1;
15934 : }
15935 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
15936 0 : return 0;
15937 : }
15938 :
15939 : static PyGetSetDef py_samr_LookupDomain_getsetters[] = {
15940 : {
15941 : .name = discard_const_p(char, "in_connect_handle"),
15942 : .get = py_samr_LookupDomain_in_get_connect_handle,
15943 : .set = py_samr_LookupDomain_in_set_connect_handle,
15944 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
15945 : },
15946 : {
15947 : .name = discard_const_p(char, "in_domain_name"),
15948 : .get = py_samr_LookupDomain_in_get_domain_name,
15949 : .set = py_samr_LookupDomain_in_set_domain_name,
15950 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
15951 : },
15952 : {
15953 : .name = discard_const_p(char, "out_sid"),
15954 : .get = py_samr_LookupDomain_out_get_sid,
15955 : .set = py_samr_LookupDomain_out_set_sid,
15956 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
15957 : },
15958 : {
15959 : .name = discard_const_p(char, "result"),
15960 : .get = py_samr_LookupDomain_get_result,
15961 : .set = py_samr_LookupDomain_set_result,
15962 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
15963 : },
15964 : { .name = NULL }
15965 : };
15966 :
15967 0 : static PyObject *py_samr_LookupDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
15968 : {
15969 0 : PyObject *self = pytalloc_new(struct samr_LookupDomain, type);
15970 0 : struct samr_LookupDomain *_self = (struct samr_LookupDomain *)pytalloc_get_ptr(self);
15971 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
15972 0 : _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
15973 0 : _self->in.domain_name = talloc_zero(mem_ctx, struct lsa_String);
15974 : /* a pointer to a NULL pointer */
15975 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *);
15976 0 : return self;
15977 : }
15978 :
15979 0 : static PyObject *py_samr_LookupDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
15980 : {
15981 :
15982 :
15983 0 : return PyLong_FromLong(5);
15984 : }
15985 :
15986 0 : static PyObject *py_samr_LookupDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
15987 : {
15988 0 : const struct ndr_interface_call *call = NULL;
15989 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
15990 0 : PyObject *ret = NULL;
15991 0 : struct ndr_push *push = NULL;
15992 0 : DATA_BLOB blob;
15993 0 : enum ndr_err_code err;
15994 :
15995 0 : if (ndr_table_samr.num_calls < 6) {
15996 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_pack");
15997 0 : return NULL;
15998 : }
15999 0 : call = &ndr_table_samr.calls[5];
16000 :
16001 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16002 0 : if (push == NULL) {
16003 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16004 0 : return NULL;
16005 : }
16006 :
16007 0 : push->flags |= ndr_push_flags;
16008 :
16009 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16010 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16011 0 : TALLOC_FREE(push);
16012 0 : PyErr_SetNdrError(err);
16013 0 : return NULL;
16014 : }
16015 0 : blob = ndr_push_blob(push);
16016 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16017 0 : TALLOC_FREE(push);
16018 0 : return ret;
16019 : }
16020 :
16021 0 : static PyObject *py_samr_LookupDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16022 : {
16023 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16024 0 : PyObject *bigendian_obj = NULL;
16025 0 : PyObject *ndr64_obj = NULL;
16026 0 : libndr_flags ndr_push_flags = 0;
16027 :
16028 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16029 : discard_const_p(char *, kwnames),
16030 : &bigendian_obj,
16031 : &ndr64_obj)) {
16032 0 : return NULL;
16033 : }
16034 :
16035 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16036 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16037 : }
16038 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16039 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16040 : }
16041 :
16042 0 : return py_samr_LookupDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16043 : }
16044 :
16045 0 : static PyObject *py_samr_LookupDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16046 : {
16047 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16048 0 : PyObject *bigendian_obj = NULL;
16049 0 : PyObject *ndr64_obj = NULL;
16050 0 : libndr_flags ndr_push_flags = 0;
16051 :
16052 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16053 : discard_const_p(char *, kwnames),
16054 : &bigendian_obj,
16055 : &ndr64_obj)) {
16056 0 : return NULL;
16057 : }
16058 :
16059 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16060 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16061 : }
16062 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16063 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16064 : }
16065 :
16066 0 : return py_samr_LookupDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16067 : }
16068 :
16069 0 : static PyObject *py_samr_LookupDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16070 : {
16071 0 : const struct ndr_interface_call *call = NULL;
16072 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
16073 0 : struct ndr_pull *pull = NULL;
16074 0 : enum ndr_err_code err;
16075 :
16076 0 : if (ndr_table_samr.num_calls < 6) {
16077 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_unpack");
16078 0 : return NULL;
16079 : }
16080 0 : call = &ndr_table_samr.calls[5];
16081 :
16082 0 : pull = ndr_pull_init_blob(blob, object);
16083 0 : if (pull == NULL) {
16084 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16085 0 : return NULL;
16086 : }
16087 :
16088 0 : pull->flags |= ndr_pull_flags;
16089 :
16090 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16091 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16092 0 : TALLOC_FREE(pull);
16093 0 : PyErr_SetNdrError(err);
16094 0 : return NULL;
16095 : }
16096 0 : if (!allow_remaining) {
16097 0 : uint32_t highest_ofs;
16098 :
16099 0 : if (pull->offset > pull->relative_highest_offset) {
16100 0 : highest_ofs = pull->offset;
16101 : } else {
16102 0 : highest_ofs = pull->relative_highest_offset;
16103 : }
16104 0 : if (highest_ofs < pull->data_size) {
16105 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16106 : "not all bytes consumed ofs[%u] size[%u]",
16107 : highest_ofs, pull->data_size);
16108 0 : TALLOC_FREE(pull);
16109 0 : PyErr_SetNdrError(err);
16110 0 : return NULL;
16111 : }
16112 : }
16113 :
16114 0 : TALLOC_FREE(pull);
16115 0 : Py_RETURN_NONE;
16116 : }
16117 :
16118 0 : static PyObject *py_samr_LookupDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16119 : {
16120 0 : DATA_BLOB blob;
16121 0 : Py_ssize_t blob_length = 0;
16122 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16123 0 : PyObject *bigendian_obj = NULL;
16124 0 : PyObject *ndr64_obj = NULL;
16125 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16126 0 : PyObject *allow_remaining_obj = NULL;
16127 0 : bool allow_remaining = false;
16128 :
16129 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16130 : discard_const_p(char *, kwnames),
16131 : &blob.data, &blob_length,
16132 : &bigendian_obj,
16133 : &ndr64_obj,
16134 : &allow_remaining_obj)) {
16135 0 : return NULL;
16136 : }
16137 0 : blob.length = blob_length;
16138 :
16139 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16140 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16141 : }
16142 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16143 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16144 : }
16145 :
16146 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16147 0 : allow_remaining = true;
16148 : }
16149 :
16150 0 : return py_samr_LookupDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16151 : }
16152 :
16153 0 : static PyObject *py_samr_LookupDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16154 : {
16155 0 : DATA_BLOB blob;
16156 0 : Py_ssize_t blob_length = 0;
16157 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16158 0 : PyObject *bigendian_obj = NULL;
16159 0 : PyObject *ndr64_obj = NULL;
16160 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16161 0 : PyObject *allow_remaining_obj = NULL;
16162 0 : bool allow_remaining = false;
16163 :
16164 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16165 : discard_const_p(char *, kwnames),
16166 : &blob.data, &blob_length,
16167 : &bigendian_obj,
16168 : &ndr64_obj,
16169 : &allow_remaining_obj)) {
16170 0 : return NULL;
16171 : }
16172 0 : blob.length = blob_length;
16173 :
16174 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16175 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16176 : }
16177 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16178 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16179 : }
16180 :
16181 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16182 0 : allow_remaining = true;
16183 : }
16184 :
16185 0 : return py_samr_LookupDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16186 : }
16187 :
16188 0 : static PyObject *py_samr_LookupDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16189 : {
16190 0 : const struct ndr_interface_call *call = NULL;
16191 0 : struct samr_LookupDomain *object = (struct samr_LookupDomain *)pytalloc_get_ptr(py_obj);
16192 0 : PyObject *ret;
16193 0 : char *retstr;
16194 :
16195 0 : if (ndr_table_samr.num_calls < 6) {
16196 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupDomain_ndr_print");
16197 0 : return NULL;
16198 : }
16199 0 : call = &ndr_table_samr.calls[5];
16200 :
16201 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16202 0 : ret = PyUnicode_FromString(retstr);
16203 0 : TALLOC_FREE(retstr);
16204 :
16205 0 : return ret;
16206 : }
16207 :
16208 0 : static PyObject *py_samr_LookupDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16209 : {
16210 0 : return py_samr_LookupDomain_ndr_print(py_obj, "samr_LookupDomain_in", NDR_IN);
16211 : }
16212 :
16213 0 : static PyObject *py_samr_LookupDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16214 : {
16215 0 : return py_samr_LookupDomain_ndr_print(py_obj, "samr_LookupDomain_out", NDR_OUT);
16216 : }
16217 :
16218 : static PyMethodDef py_samr_LookupDomain_methods[] = {
16219 : { "opnum", (PyCFunction)py_samr_LookupDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
16220 : "samr.LookupDomain.opnum() -> 5 (0x05) " },
16221 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16222 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16223 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16224 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16225 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16226 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16227 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16228 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16229 : { "__ndr_print_in__", (PyCFunction)py_samr_LookupDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16230 : { "__ndr_print_out__", (PyCFunction)py_samr_LookupDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16231 : { NULL, NULL, 0, NULL }
16232 : };
16233 :
16234 :
16235 : static PyTypeObject samr_LookupDomain_Type = {
16236 : PyVarObject_HEAD_INIT(NULL, 0)
16237 : .tp_name = "samr.LookupDomain",
16238 : .tp_getset = py_samr_LookupDomain_getsetters,
16239 : .tp_methods = py_samr_LookupDomain_methods,
16240 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16241 : .tp_new = py_samr_LookupDomain_new,
16242 : };
16243 :
16244 30 : static bool pack_py_samr_LookupDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupDomain *r)
16245 : {
16246 0 : PyObject *py_connect_handle;
16247 0 : PyObject *py_domain_name;
16248 30 : const char *kwnames[] = {
16249 : "connect_handle", "domain_name", NULL
16250 : };
16251 :
16252 30 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_domain_name)) {
16253 0 : return false;
16254 : }
16255 :
16256 30 : if (py_connect_handle == NULL) {
16257 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle");
16258 0 : return false;
16259 : }
16260 30 : r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
16261 30 : if (r->in.connect_handle == NULL) {
16262 0 : PyErr_NoMemory();
16263 0 : return false;
16264 : }
16265 30 : PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
16266 30 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
16267 0 : PyErr_NoMemory();
16268 0 : return false;
16269 : }
16270 30 : r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
16271 30 : if (py_domain_name == NULL) {
16272 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
16273 0 : return false;
16274 : }
16275 30 : r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
16276 30 : if (r->in.domain_name == NULL) {
16277 0 : PyErr_NoMemory();
16278 0 : return false;
16279 : }
16280 30 : PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;);
16281 30 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) {
16282 0 : PyErr_NoMemory();
16283 0 : return false;
16284 : }
16285 30 : r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
16286 30 : return true;
16287 : }
16288 :
16289 30 : static PyObject *unpack_py_samr_LookupDomain_args_out(struct samr_LookupDomain *r)
16290 : {
16291 0 : PyObject *result;
16292 0 : PyObject *py_sid;
16293 30 : if (*r->out.sid == NULL) {
16294 0 : py_sid = Py_None;
16295 0 : Py_INCREF(py_sid);
16296 : } else {
16297 30 : py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
16298 : }
16299 30 : result = py_sid;
16300 30 : if (NT_STATUS_IS_ERR(r->out.result)) {
16301 0 : PyErr_SetNTSTATUS(r->out.result);
16302 0 : return NULL;
16303 : }
16304 :
16305 30 : return result;
16306 : }
16307 :
16308 :
16309 0 : static PyObject *py_samr_EnumDomains_in_get_connect_handle(PyObject *obj, void *closure)
16310 : {
16311 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16312 0 : PyObject *py_connect_handle;
16313 0 : if (object->in.connect_handle == NULL) {
16314 0 : Py_RETURN_NONE;
16315 : }
16316 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle);
16317 0 : return py_connect_handle;
16318 : }
16319 :
16320 0 : static int py_samr_EnumDomains_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
16321 : {
16322 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16323 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle));
16324 0 : if (value == NULL) {
16325 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle");
16326 0 : return -1;
16327 : }
16328 0 : object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle);
16329 0 : if (object->in.connect_handle == NULL) {
16330 0 : PyErr_NoMemory();
16331 0 : return -1;
16332 : }
16333 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
16334 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16335 0 : PyErr_NoMemory();
16336 0 : return -1;
16337 : }
16338 0 : object->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
16339 0 : return 0;
16340 : }
16341 :
16342 0 : static PyObject *py_samr_EnumDomains_in_get_resume_handle(PyObject *obj, void *closure)
16343 : {
16344 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16345 0 : PyObject *py_resume_handle;
16346 0 : if (object->in.resume_handle == NULL) {
16347 0 : Py_RETURN_NONE;
16348 : }
16349 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
16350 0 : return py_resume_handle;
16351 : }
16352 :
16353 0 : static int py_samr_EnumDomains_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16354 : {
16355 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16356 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
16357 0 : if (value == NULL) {
16358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
16359 0 : return -1;
16360 : }
16361 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
16362 0 : if (object->in.resume_handle == NULL) {
16363 0 : PyErr_NoMemory();
16364 0 : return -1;
16365 : }
16366 : {
16367 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
16368 0 : if (PyLong_Check(value)) {
16369 0 : unsigned long long test_var;
16370 0 : test_var = PyLong_AsUnsignedLongLong(value);
16371 0 : if (PyErr_Occurred() != NULL) {
16372 0 : return -1;
16373 : }
16374 0 : if (test_var > uint_max) {
16375 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16376 : PyLong_Type.tp_name, uint_max, test_var);
16377 0 : return -1;
16378 : }
16379 0 : *object->in.resume_handle = test_var;
16380 : } else {
16381 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16382 : PyLong_Type.tp_name);
16383 0 : return -1;
16384 : }
16385 : }
16386 0 : return 0;
16387 : }
16388 :
16389 0 : static PyObject *py_samr_EnumDomains_out_get_resume_handle(PyObject *obj, void *closure)
16390 : {
16391 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16392 0 : PyObject *py_resume_handle;
16393 0 : if (object->out.resume_handle == NULL) {
16394 0 : Py_RETURN_NONE;
16395 : }
16396 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
16397 0 : return py_resume_handle;
16398 : }
16399 :
16400 0 : static int py_samr_EnumDomains_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
16401 : {
16402 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16403 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
16404 0 : if (value == NULL) {
16405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
16406 0 : return -1;
16407 : }
16408 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
16409 0 : if (object->out.resume_handle == NULL) {
16410 0 : PyErr_NoMemory();
16411 0 : return -1;
16412 : }
16413 : {
16414 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
16415 0 : if (PyLong_Check(value)) {
16416 0 : unsigned long long test_var;
16417 0 : test_var = PyLong_AsUnsignedLongLong(value);
16418 0 : if (PyErr_Occurred() != NULL) {
16419 0 : return -1;
16420 : }
16421 0 : if (test_var > uint_max) {
16422 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16423 : PyLong_Type.tp_name, uint_max, test_var);
16424 0 : return -1;
16425 : }
16426 0 : *object->out.resume_handle = test_var;
16427 : } else {
16428 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16429 : PyLong_Type.tp_name);
16430 0 : return -1;
16431 : }
16432 : }
16433 0 : return 0;
16434 : }
16435 :
16436 0 : static PyObject *py_samr_EnumDomains_out_get_sam(PyObject *obj, void *closure)
16437 : {
16438 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16439 0 : PyObject *py_sam;
16440 0 : if (object->out.sam == NULL) {
16441 0 : Py_RETURN_NONE;
16442 : }
16443 0 : if (*object->out.sam == NULL) {
16444 0 : py_sam = Py_None;
16445 0 : Py_INCREF(py_sam);
16446 : } else {
16447 0 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam);
16448 : }
16449 0 : return py_sam;
16450 : }
16451 :
16452 0 : static int py_samr_EnumDomains_out_set_sam(PyObject *py_obj, PyObject *value, void *closure)
16453 : {
16454 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16455 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam));
16456 0 : if (value == NULL) {
16457 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam");
16458 0 : return -1;
16459 : }
16460 0 : object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam);
16461 0 : if (object->out.sam == NULL) {
16462 0 : PyErr_NoMemory();
16463 0 : return -1;
16464 : }
16465 0 : if (value == Py_None) {
16466 0 : *object->out.sam = NULL;
16467 : } else {
16468 0 : *object->out.sam = NULL;
16469 0 : PY_CHECK_TYPE(&samr_SamArray_Type, value, return -1;);
16470 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
16471 0 : PyErr_NoMemory();
16472 0 : return -1;
16473 : }
16474 0 : *object->out.sam = (struct samr_SamArray *)pytalloc_get_ptr(value);
16475 : }
16476 0 : return 0;
16477 : }
16478 :
16479 0 : static PyObject *py_samr_EnumDomains_in_get_buf_size(PyObject *obj, void *closure)
16480 : {
16481 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16482 0 : PyObject *py_buf_size;
16483 0 : py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size);
16484 0 : return py_buf_size;
16485 : }
16486 :
16487 0 : static int py_samr_EnumDomains_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure)
16488 : {
16489 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16490 0 : if (value == NULL) {
16491 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size");
16492 0 : return -1;
16493 : }
16494 : {
16495 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size));
16496 0 : if (PyLong_Check(value)) {
16497 0 : unsigned long long test_var;
16498 0 : test_var = PyLong_AsUnsignedLongLong(value);
16499 0 : if (PyErr_Occurred() != NULL) {
16500 0 : return -1;
16501 : }
16502 0 : if (test_var > uint_max) {
16503 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16504 : PyLong_Type.tp_name, uint_max, test_var);
16505 0 : return -1;
16506 : }
16507 0 : object->in.buf_size = test_var;
16508 : } else {
16509 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16510 : PyLong_Type.tp_name);
16511 0 : return -1;
16512 : }
16513 : }
16514 0 : return 0;
16515 : }
16516 :
16517 0 : static PyObject *py_samr_EnumDomains_out_get_num_entries(PyObject *obj, void *closure)
16518 : {
16519 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16520 0 : PyObject *py_num_entries;
16521 0 : if (object->out.num_entries == NULL) {
16522 0 : Py_RETURN_NONE;
16523 : }
16524 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries);
16525 0 : return py_num_entries;
16526 : }
16527 :
16528 0 : static int py_samr_EnumDomains_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
16529 : {
16530 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16531 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries));
16532 0 : if (value == NULL) {
16533 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries");
16534 0 : return -1;
16535 : }
16536 0 : object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries);
16537 0 : if (object->out.num_entries == NULL) {
16538 0 : PyErr_NoMemory();
16539 0 : return -1;
16540 : }
16541 : {
16542 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries));
16543 0 : if (PyLong_Check(value)) {
16544 0 : unsigned long long test_var;
16545 0 : test_var = PyLong_AsUnsignedLongLong(value);
16546 0 : if (PyErr_Occurred() != NULL) {
16547 0 : return -1;
16548 : }
16549 0 : if (test_var > uint_max) {
16550 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16551 : PyLong_Type.tp_name, uint_max, test_var);
16552 0 : return -1;
16553 : }
16554 0 : *object->out.num_entries = test_var;
16555 : } else {
16556 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16557 : PyLong_Type.tp_name);
16558 0 : return -1;
16559 : }
16560 : }
16561 0 : return 0;
16562 : }
16563 :
16564 0 : static PyObject *py_samr_EnumDomains_get_result(PyObject *obj, void *closure)
16565 : {
16566 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(obj);
16567 0 : PyObject *py_result;
16568 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
16569 0 : return py_result;
16570 : }
16571 :
16572 0 : static int py_samr_EnumDomains_set_result(PyObject *py_obj, PyObject *value, void *closure)
16573 : {
16574 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16575 0 : if (value == NULL) {
16576 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
16577 0 : return -1;
16578 : }
16579 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
16580 0 : return 0;
16581 : }
16582 :
16583 : static PyGetSetDef py_samr_EnumDomains_getsetters[] = {
16584 : {
16585 : .name = discard_const_p(char, "in_connect_handle"),
16586 : .get = py_samr_EnumDomains_in_get_connect_handle,
16587 : .set = py_samr_EnumDomains_in_set_connect_handle,
16588 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
16589 : },
16590 : {
16591 : .name = discard_const_p(char, "in_resume_handle"),
16592 : .get = py_samr_EnumDomains_in_get_resume_handle,
16593 : .set = py_samr_EnumDomains_in_set_resume_handle,
16594 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16595 : },
16596 : {
16597 : .name = discard_const_p(char, "out_resume_handle"),
16598 : .get = py_samr_EnumDomains_out_get_resume_handle,
16599 : .set = py_samr_EnumDomains_out_set_resume_handle,
16600 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16601 : },
16602 : {
16603 : .name = discard_const_p(char, "out_sam"),
16604 : .get = py_samr_EnumDomains_out_get_sam,
16605 : .set = py_samr_EnumDomains_out_set_sam,
16606 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray")
16607 : },
16608 : {
16609 : .name = discard_const_p(char, "in_buf_size"),
16610 : .get = py_samr_EnumDomains_in_get_buf_size,
16611 : .set = py_samr_EnumDomains_in_set_buf_size,
16612 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16613 : },
16614 : {
16615 : .name = discard_const_p(char, "out_num_entries"),
16616 : .get = py_samr_EnumDomains_out_get_num_entries,
16617 : .set = py_samr_EnumDomains_out_set_num_entries,
16618 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
16619 : },
16620 : {
16621 : .name = discard_const_p(char, "result"),
16622 : .get = py_samr_EnumDomains_get_result,
16623 : .set = py_samr_EnumDomains_set_result,
16624 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
16625 : },
16626 : { .name = NULL }
16627 : };
16628 :
16629 0 : static PyObject *py_samr_EnumDomains_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
16630 : {
16631 0 : PyObject *self = pytalloc_new(struct samr_EnumDomains, type);
16632 0 : struct samr_EnumDomains *_self = (struct samr_EnumDomains *)pytalloc_get_ptr(self);
16633 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
16634 0 : _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
16635 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
16636 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
16637 : /* a pointer to a NULL pointer */
16638 0 : _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
16639 0 : _self->out.num_entries = talloc_zero(mem_ctx, uint32_t);
16640 0 : return self;
16641 : }
16642 :
16643 0 : static PyObject *py_samr_EnumDomains_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
16644 : {
16645 :
16646 :
16647 0 : return PyLong_FromLong(6);
16648 : }
16649 :
16650 0 : static PyObject *py_samr_EnumDomains_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
16651 : {
16652 0 : const struct ndr_interface_call *call = NULL;
16653 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16654 0 : PyObject *ret = NULL;
16655 0 : struct ndr_push *push = NULL;
16656 0 : DATA_BLOB blob;
16657 0 : enum ndr_err_code err;
16658 :
16659 0 : if (ndr_table_samr.num_calls < 7) {
16660 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_pack");
16661 0 : return NULL;
16662 : }
16663 0 : call = &ndr_table_samr.calls[6];
16664 :
16665 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
16666 0 : if (push == NULL) {
16667 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16668 0 : return NULL;
16669 : }
16670 :
16671 0 : push->flags |= ndr_push_flags;
16672 :
16673 0 : err = call->ndr_push(push, ndr_inout_flags, object);
16674 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16675 0 : TALLOC_FREE(push);
16676 0 : PyErr_SetNdrError(err);
16677 0 : return NULL;
16678 : }
16679 0 : blob = ndr_push_blob(push);
16680 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
16681 0 : TALLOC_FREE(push);
16682 0 : return ret;
16683 : }
16684 :
16685 0 : static PyObject *py_samr_EnumDomains_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16686 : {
16687 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16688 0 : PyObject *bigendian_obj = NULL;
16689 0 : PyObject *ndr64_obj = NULL;
16690 0 : libndr_flags ndr_push_flags = 0;
16691 :
16692 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
16693 : discard_const_p(char *, kwnames),
16694 : &bigendian_obj,
16695 : &ndr64_obj)) {
16696 0 : return NULL;
16697 : }
16698 :
16699 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16700 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16701 : }
16702 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16703 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16704 : }
16705 :
16706 0 : return py_samr_EnumDomains_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
16707 : }
16708 :
16709 0 : static PyObject *py_samr_EnumDomains_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16710 : {
16711 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
16712 0 : PyObject *bigendian_obj = NULL;
16713 0 : PyObject *ndr64_obj = NULL;
16714 0 : libndr_flags ndr_push_flags = 0;
16715 :
16716 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
16717 : discard_const_p(char *, kwnames),
16718 : &bigendian_obj,
16719 : &ndr64_obj)) {
16720 0 : return NULL;
16721 : }
16722 :
16723 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16724 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
16725 : }
16726 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16727 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
16728 : }
16729 :
16730 0 : return py_samr_EnumDomains_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
16731 : }
16732 :
16733 0 : static PyObject *py_samr_EnumDomains_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
16734 : {
16735 0 : const struct ndr_interface_call *call = NULL;
16736 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16737 0 : struct ndr_pull *pull = NULL;
16738 0 : enum ndr_err_code err;
16739 :
16740 0 : if (ndr_table_samr.num_calls < 7) {
16741 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_unpack");
16742 0 : return NULL;
16743 : }
16744 0 : call = &ndr_table_samr.calls[6];
16745 :
16746 0 : pull = ndr_pull_init_blob(blob, object);
16747 0 : if (pull == NULL) {
16748 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
16749 0 : return NULL;
16750 : }
16751 :
16752 0 : pull->flags |= ndr_pull_flags;
16753 :
16754 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
16755 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
16756 0 : TALLOC_FREE(pull);
16757 0 : PyErr_SetNdrError(err);
16758 0 : return NULL;
16759 : }
16760 0 : if (!allow_remaining) {
16761 0 : uint32_t highest_ofs;
16762 :
16763 0 : if (pull->offset > pull->relative_highest_offset) {
16764 0 : highest_ofs = pull->offset;
16765 : } else {
16766 0 : highest_ofs = pull->relative_highest_offset;
16767 : }
16768 0 : if (highest_ofs < pull->data_size) {
16769 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
16770 : "not all bytes consumed ofs[%u] size[%u]",
16771 : highest_ofs, pull->data_size);
16772 0 : TALLOC_FREE(pull);
16773 0 : PyErr_SetNdrError(err);
16774 0 : return NULL;
16775 : }
16776 : }
16777 :
16778 0 : TALLOC_FREE(pull);
16779 0 : Py_RETURN_NONE;
16780 : }
16781 :
16782 0 : static PyObject *py_samr_EnumDomains_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16783 : {
16784 0 : DATA_BLOB blob;
16785 0 : Py_ssize_t blob_length = 0;
16786 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16787 0 : PyObject *bigendian_obj = NULL;
16788 0 : PyObject *ndr64_obj = NULL;
16789 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16790 0 : PyObject *allow_remaining_obj = NULL;
16791 0 : bool allow_remaining = false;
16792 :
16793 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
16794 : discard_const_p(char *, kwnames),
16795 : &blob.data, &blob_length,
16796 : &bigendian_obj,
16797 : &ndr64_obj,
16798 : &allow_remaining_obj)) {
16799 0 : return NULL;
16800 : }
16801 0 : blob.length = blob_length;
16802 :
16803 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16804 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16805 : }
16806 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16807 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16808 : }
16809 :
16810 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16811 0 : allow_remaining = true;
16812 : }
16813 :
16814 0 : return py_samr_EnumDomains_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
16815 : }
16816 :
16817 0 : static PyObject *py_samr_EnumDomains_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
16818 : {
16819 0 : DATA_BLOB blob;
16820 0 : Py_ssize_t blob_length = 0;
16821 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
16822 0 : PyObject *bigendian_obj = NULL;
16823 0 : PyObject *ndr64_obj = NULL;
16824 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
16825 0 : PyObject *allow_remaining_obj = NULL;
16826 0 : bool allow_remaining = false;
16827 :
16828 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
16829 : discard_const_p(char *, kwnames),
16830 : &blob.data, &blob_length,
16831 : &bigendian_obj,
16832 : &ndr64_obj,
16833 : &allow_remaining_obj)) {
16834 0 : return NULL;
16835 : }
16836 0 : blob.length = blob_length;
16837 :
16838 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
16839 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
16840 : }
16841 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
16842 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
16843 : }
16844 :
16845 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
16846 0 : allow_remaining = true;
16847 : }
16848 :
16849 0 : return py_samr_EnumDomains_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
16850 : }
16851 :
16852 0 : static PyObject *py_samr_EnumDomains_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
16853 : {
16854 0 : const struct ndr_interface_call *call = NULL;
16855 0 : struct samr_EnumDomains *object = (struct samr_EnumDomains *)pytalloc_get_ptr(py_obj);
16856 0 : PyObject *ret;
16857 0 : char *retstr;
16858 :
16859 0 : if (ndr_table_samr.num_calls < 7) {
16860 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomains_ndr_print");
16861 0 : return NULL;
16862 : }
16863 0 : call = &ndr_table_samr.calls[6];
16864 :
16865 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
16866 0 : ret = PyUnicode_FromString(retstr);
16867 0 : TALLOC_FREE(retstr);
16868 :
16869 0 : return ret;
16870 : }
16871 :
16872 0 : static PyObject *py_samr_EnumDomains_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16873 : {
16874 0 : return py_samr_EnumDomains_ndr_print(py_obj, "samr_EnumDomains_in", NDR_IN);
16875 : }
16876 :
16877 0 : static PyObject *py_samr_EnumDomains_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
16878 : {
16879 0 : return py_samr_EnumDomains_ndr_print(py_obj, "samr_EnumDomains_out", NDR_OUT);
16880 : }
16881 :
16882 : static PyMethodDef py_samr_EnumDomains_methods[] = {
16883 : { "opnum", (PyCFunction)py_samr_EnumDomains_ndr_opnum, METH_NOARGS|METH_CLASS,
16884 : "samr.EnumDomains.opnum() -> 6 (0x06) " },
16885 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomains_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
16886 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
16887 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomains_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
16888 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
16889 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomains_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
16890 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
16891 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomains_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
16892 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
16893 : { "__ndr_print_in__", (PyCFunction)py_samr_EnumDomains_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
16894 : { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomains_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
16895 : { NULL, NULL, 0, NULL }
16896 : };
16897 :
16898 :
16899 : static PyTypeObject samr_EnumDomains_Type = {
16900 : PyVarObject_HEAD_INIT(NULL, 0)
16901 : .tp_name = "samr.EnumDomains",
16902 : .tp_getset = py_samr_EnumDomains_getsetters,
16903 : .tp_methods = py_samr_EnumDomains_methods,
16904 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
16905 : .tp_new = py_samr_EnumDomains_new,
16906 : };
16907 :
16908 2 : static bool pack_py_samr_EnumDomains_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomains *r)
16909 : {
16910 0 : PyObject *py_connect_handle;
16911 0 : PyObject *py_resume_handle;
16912 0 : PyObject *py_buf_size;
16913 2 : const char *kwnames[] = {
16914 : "connect_handle", "resume_handle", "buf_size", NULL
16915 : };
16916 :
16917 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomains", discard_const_p(char *, kwnames), &py_connect_handle, &py_resume_handle, &py_buf_size)) {
16918 0 : return false;
16919 : }
16920 :
16921 2 : if (py_connect_handle == NULL) {
16922 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle");
16923 0 : return false;
16924 : }
16925 2 : r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
16926 2 : if (r->in.connect_handle == NULL) {
16927 0 : PyErr_NoMemory();
16928 0 : return false;
16929 : }
16930 2 : PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
16931 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
16932 0 : PyErr_NoMemory();
16933 0 : return false;
16934 : }
16935 2 : r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
16936 2 : if (py_resume_handle == NULL) {
16937 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
16938 0 : return false;
16939 : }
16940 2 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
16941 2 : if (r->in.resume_handle == NULL) {
16942 0 : PyErr_NoMemory();
16943 0 : return false;
16944 : }
16945 : {
16946 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
16947 2 : if (PyLong_Check(py_resume_handle)) {
16948 0 : unsigned long long test_var;
16949 2 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
16950 2 : if (PyErr_Occurred() != NULL) {
16951 0 : return false;
16952 : }
16953 2 : if (test_var > uint_max) {
16954 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16955 : PyLong_Type.tp_name, uint_max, test_var);
16956 0 : return false;
16957 : }
16958 2 : *r->in.resume_handle = test_var;
16959 : } else {
16960 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16961 : PyLong_Type.tp_name);
16962 0 : return false;
16963 : }
16964 : }
16965 2 : if (py_buf_size == NULL) {
16966 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size");
16967 0 : return false;
16968 : }
16969 : {
16970 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size));
16971 2 : if (PyLong_Check(py_buf_size)) {
16972 0 : unsigned long long test_var;
16973 2 : test_var = PyLong_AsUnsignedLongLong(py_buf_size);
16974 2 : if (PyErr_Occurred() != NULL) {
16975 0 : return false;
16976 : }
16977 2 : if (test_var > uint_max) {
16978 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
16979 : PyLong_Type.tp_name, uint_max, test_var);
16980 0 : return false;
16981 : }
16982 2 : r->in.buf_size = test_var;
16983 : } else {
16984 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
16985 : PyLong_Type.tp_name);
16986 0 : return false;
16987 : }
16988 : }
16989 2 : return true;
16990 : }
16991 :
16992 2 : static PyObject *unpack_py_samr_EnumDomains_args_out(struct samr_EnumDomains *r)
16993 : {
16994 0 : PyObject *result;
16995 0 : PyObject *py_resume_handle;
16996 0 : PyObject *py_sam;
16997 0 : PyObject *py_num_entries;
16998 2 : result = PyTuple_New(3);
16999 2 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
17000 2 : PyTuple_SetItem(result, 0, py_resume_handle);
17001 2 : if (*r->out.sam == NULL) {
17002 0 : py_sam = Py_None;
17003 0 : Py_INCREF(py_sam);
17004 : } else {
17005 2 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
17006 : }
17007 2 : PyTuple_SetItem(result, 1, py_sam);
17008 2 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries);
17009 2 : PyTuple_SetItem(result, 2, py_num_entries);
17010 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
17011 0 : PyErr_SetNTSTATUS(r->out.result);
17012 0 : return NULL;
17013 : }
17014 :
17015 2 : return result;
17016 : }
17017 :
17018 :
17019 0 : static PyObject *py_samr_OpenDomain_in_get_connect_handle(PyObject *obj, void *closure)
17020 : {
17021 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj);
17022 0 : PyObject *py_connect_handle;
17023 0 : if (object->in.connect_handle == NULL) {
17024 0 : Py_RETURN_NONE;
17025 : }
17026 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle);
17027 0 : return py_connect_handle;
17028 : }
17029 :
17030 0 : static int py_samr_OpenDomain_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
17031 : {
17032 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17033 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle));
17034 0 : if (value == NULL) {
17035 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle");
17036 0 : return -1;
17037 : }
17038 0 : object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle);
17039 0 : if (object->in.connect_handle == NULL) {
17040 0 : PyErr_NoMemory();
17041 0 : return -1;
17042 : }
17043 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17044 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17045 0 : PyErr_NoMemory();
17046 0 : return -1;
17047 : }
17048 0 : object->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17049 0 : return 0;
17050 : }
17051 :
17052 0 : static PyObject *py_samr_OpenDomain_in_get_access_mask(PyObject *obj, void *closure)
17053 : {
17054 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj);
17055 0 : PyObject *py_access_mask;
17056 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
17057 0 : return py_access_mask;
17058 : }
17059 :
17060 0 : static int py_samr_OpenDomain_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
17061 : {
17062 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17063 0 : if (value == NULL) {
17064 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
17065 0 : return -1;
17066 : }
17067 : {
17068 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
17069 0 : if (PyLong_Check(value)) {
17070 0 : unsigned long long test_var;
17071 0 : test_var = PyLong_AsUnsignedLongLong(value);
17072 0 : if (PyErr_Occurred() != NULL) {
17073 0 : return -1;
17074 : }
17075 0 : if (test_var > uint_max) {
17076 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17077 : PyLong_Type.tp_name, uint_max, test_var);
17078 0 : return -1;
17079 : }
17080 0 : object->in.access_mask = test_var;
17081 : } else {
17082 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17083 : PyLong_Type.tp_name);
17084 0 : return -1;
17085 : }
17086 : }
17087 0 : return 0;
17088 : }
17089 :
17090 0 : static PyObject *py_samr_OpenDomain_in_get_sid(PyObject *obj, void *closure)
17091 : {
17092 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj);
17093 0 : PyObject *py_sid;
17094 0 : if (object->in.sid == NULL) {
17095 0 : Py_RETURN_NONE;
17096 : }
17097 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
17098 0 : return py_sid;
17099 : }
17100 :
17101 0 : static int py_samr_OpenDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
17102 : {
17103 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17104 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
17105 0 : if (value == NULL) {
17106 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
17107 0 : return -1;
17108 : }
17109 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
17110 0 : if (object->in.sid == NULL) {
17111 0 : PyErr_NoMemory();
17112 0 : return -1;
17113 : }
17114 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
17115 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17116 0 : PyErr_NoMemory();
17117 0 : return -1;
17118 : }
17119 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
17120 0 : return 0;
17121 : }
17122 :
17123 0 : static PyObject *py_samr_OpenDomain_out_get_domain_handle(PyObject *obj, void *closure)
17124 : {
17125 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj);
17126 0 : PyObject *py_domain_handle;
17127 0 : if (object->out.domain_handle == NULL) {
17128 0 : Py_RETURN_NONE;
17129 : }
17130 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->out.domain_handle, object->out.domain_handle);
17131 0 : return py_domain_handle;
17132 : }
17133 :
17134 0 : static int py_samr_OpenDomain_out_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
17135 : {
17136 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17137 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.domain_handle));
17138 0 : if (value == NULL) {
17139 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.domain_handle");
17140 0 : return -1;
17141 : }
17142 0 : object->out.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.domain_handle);
17143 0 : if (object->out.domain_handle == NULL) {
17144 0 : PyErr_NoMemory();
17145 0 : return -1;
17146 : }
17147 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17148 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17149 0 : PyErr_NoMemory();
17150 0 : return -1;
17151 : }
17152 0 : object->out.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17153 0 : return 0;
17154 : }
17155 :
17156 0 : static PyObject *py_samr_OpenDomain_get_result(PyObject *obj, void *closure)
17157 : {
17158 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(obj);
17159 0 : PyObject *py_result;
17160 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17161 0 : return py_result;
17162 : }
17163 :
17164 0 : static int py_samr_OpenDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
17165 : {
17166 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17167 0 : if (value == NULL) {
17168 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17169 0 : return -1;
17170 : }
17171 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17172 0 : return 0;
17173 : }
17174 :
17175 : static PyGetSetDef py_samr_OpenDomain_getsetters[] = {
17176 : {
17177 : .name = discard_const_p(char, "in_connect_handle"),
17178 : .get = py_samr_OpenDomain_in_get_connect_handle,
17179 : .set = py_samr_OpenDomain_in_set_connect_handle,
17180 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17181 : },
17182 : {
17183 : .name = discard_const_p(char, "in_access_mask"),
17184 : .get = py_samr_OpenDomain_in_get_access_mask,
17185 : .set = py_samr_OpenDomain_in_set_access_mask,
17186 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainAccessMask")
17187 : },
17188 : {
17189 : .name = discard_const_p(char, "in_sid"),
17190 : .get = py_samr_OpenDomain_in_get_sid,
17191 : .set = py_samr_OpenDomain_in_set_sid,
17192 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
17193 : },
17194 : {
17195 : .name = discard_const_p(char, "out_domain_handle"),
17196 : .get = py_samr_OpenDomain_out_get_domain_handle,
17197 : .set = py_samr_OpenDomain_out_set_domain_handle,
17198 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17199 : },
17200 : {
17201 : .name = discard_const_p(char, "result"),
17202 : .get = py_samr_OpenDomain_get_result,
17203 : .set = py_samr_OpenDomain_set_result,
17204 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17205 : },
17206 : { .name = NULL }
17207 : };
17208 :
17209 0 : static PyObject *py_samr_OpenDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17210 : {
17211 0 : PyObject *self = pytalloc_new(struct samr_OpenDomain, type);
17212 0 : struct samr_OpenDomain *_self = (struct samr_OpenDomain *)pytalloc_get_ptr(self);
17213 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17214 0 : _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
17215 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
17216 0 : _self->out.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
17217 0 : return self;
17218 : }
17219 :
17220 0 : static PyObject *py_samr_OpenDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17221 : {
17222 :
17223 :
17224 0 : return PyLong_FromLong(7);
17225 : }
17226 :
17227 0 : static PyObject *py_samr_OpenDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17228 : {
17229 0 : const struct ndr_interface_call *call = NULL;
17230 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17231 0 : PyObject *ret = NULL;
17232 0 : struct ndr_push *push = NULL;
17233 0 : DATA_BLOB blob;
17234 0 : enum ndr_err_code err;
17235 :
17236 0 : if (ndr_table_samr.num_calls < 8) {
17237 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_pack");
17238 0 : return NULL;
17239 : }
17240 0 : call = &ndr_table_samr.calls[7];
17241 :
17242 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17243 0 : if (push == NULL) {
17244 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17245 0 : return NULL;
17246 : }
17247 :
17248 0 : push->flags |= ndr_push_flags;
17249 :
17250 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17251 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17252 0 : TALLOC_FREE(push);
17253 0 : PyErr_SetNdrError(err);
17254 0 : return NULL;
17255 : }
17256 0 : blob = ndr_push_blob(push);
17257 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17258 0 : TALLOC_FREE(push);
17259 0 : return ret;
17260 : }
17261 :
17262 0 : static PyObject *py_samr_OpenDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17263 : {
17264 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17265 0 : PyObject *bigendian_obj = NULL;
17266 0 : PyObject *ndr64_obj = NULL;
17267 0 : libndr_flags ndr_push_flags = 0;
17268 :
17269 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17270 : discard_const_p(char *, kwnames),
17271 : &bigendian_obj,
17272 : &ndr64_obj)) {
17273 0 : return NULL;
17274 : }
17275 :
17276 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17277 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17278 : }
17279 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17280 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17281 : }
17282 :
17283 0 : return py_samr_OpenDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17284 : }
17285 :
17286 0 : static PyObject *py_samr_OpenDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17287 : {
17288 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17289 0 : PyObject *bigendian_obj = NULL;
17290 0 : PyObject *ndr64_obj = NULL;
17291 0 : libndr_flags ndr_push_flags = 0;
17292 :
17293 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17294 : discard_const_p(char *, kwnames),
17295 : &bigendian_obj,
17296 : &ndr64_obj)) {
17297 0 : return NULL;
17298 : }
17299 :
17300 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17301 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17302 : }
17303 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17304 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17305 : }
17306 :
17307 0 : return py_samr_OpenDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17308 : }
17309 :
17310 0 : static PyObject *py_samr_OpenDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17311 : {
17312 0 : const struct ndr_interface_call *call = NULL;
17313 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17314 0 : struct ndr_pull *pull = NULL;
17315 0 : enum ndr_err_code err;
17316 :
17317 0 : if (ndr_table_samr.num_calls < 8) {
17318 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_unpack");
17319 0 : return NULL;
17320 : }
17321 0 : call = &ndr_table_samr.calls[7];
17322 :
17323 0 : pull = ndr_pull_init_blob(blob, object);
17324 0 : if (pull == NULL) {
17325 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17326 0 : return NULL;
17327 : }
17328 :
17329 0 : pull->flags |= ndr_pull_flags;
17330 :
17331 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17332 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17333 0 : TALLOC_FREE(pull);
17334 0 : PyErr_SetNdrError(err);
17335 0 : return NULL;
17336 : }
17337 0 : if (!allow_remaining) {
17338 0 : uint32_t highest_ofs;
17339 :
17340 0 : if (pull->offset > pull->relative_highest_offset) {
17341 0 : highest_ofs = pull->offset;
17342 : } else {
17343 0 : highest_ofs = pull->relative_highest_offset;
17344 : }
17345 0 : if (highest_ofs < pull->data_size) {
17346 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17347 : "not all bytes consumed ofs[%u] size[%u]",
17348 : highest_ofs, pull->data_size);
17349 0 : TALLOC_FREE(pull);
17350 0 : PyErr_SetNdrError(err);
17351 0 : return NULL;
17352 : }
17353 : }
17354 :
17355 0 : TALLOC_FREE(pull);
17356 0 : Py_RETURN_NONE;
17357 : }
17358 :
17359 0 : static PyObject *py_samr_OpenDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17360 : {
17361 0 : DATA_BLOB blob;
17362 0 : Py_ssize_t blob_length = 0;
17363 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17364 0 : PyObject *bigendian_obj = NULL;
17365 0 : PyObject *ndr64_obj = NULL;
17366 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17367 0 : PyObject *allow_remaining_obj = NULL;
17368 0 : bool allow_remaining = false;
17369 :
17370 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17371 : discard_const_p(char *, kwnames),
17372 : &blob.data, &blob_length,
17373 : &bigendian_obj,
17374 : &ndr64_obj,
17375 : &allow_remaining_obj)) {
17376 0 : return NULL;
17377 : }
17378 0 : blob.length = blob_length;
17379 :
17380 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17381 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17382 : }
17383 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17384 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17385 : }
17386 :
17387 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17388 0 : allow_remaining = true;
17389 : }
17390 :
17391 0 : return py_samr_OpenDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17392 : }
17393 :
17394 0 : static PyObject *py_samr_OpenDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17395 : {
17396 0 : DATA_BLOB blob;
17397 0 : Py_ssize_t blob_length = 0;
17398 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17399 0 : PyObject *bigendian_obj = NULL;
17400 0 : PyObject *ndr64_obj = NULL;
17401 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17402 0 : PyObject *allow_remaining_obj = NULL;
17403 0 : bool allow_remaining = false;
17404 :
17405 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17406 : discard_const_p(char *, kwnames),
17407 : &blob.data, &blob_length,
17408 : &bigendian_obj,
17409 : &ndr64_obj,
17410 : &allow_remaining_obj)) {
17411 0 : return NULL;
17412 : }
17413 0 : blob.length = blob_length;
17414 :
17415 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17416 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17417 : }
17418 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17419 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17420 : }
17421 :
17422 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17423 0 : allow_remaining = true;
17424 : }
17425 :
17426 0 : return py_samr_OpenDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17427 : }
17428 :
17429 0 : static PyObject *py_samr_OpenDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17430 : {
17431 0 : const struct ndr_interface_call *call = NULL;
17432 0 : struct samr_OpenDomain *object = (struct samr_OpenDomain *)pytalloc_get_ptr(py_obj);
17433 0 : PyObject *ret;
17434 0 : char *retstr;
17435 :
17436 0 : if (ndr_table_samr.num_calls < 8) {
17437 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenDomain_ndr_print");
17438 0 : return NULL;
17439 : }
17440 0 : call = &ndr_table_samr.calls[7];
17441 :
17442 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17443 0 : ret = PyUnicode_FromString(retstr);
17444 0 : TALLOC_FREE(retstr);
17445 :
17446 0 : return ret;
17447 : }
17448 :
17449 0 : static PyObject *py_samr_OpenDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17450 : {
17451 0 : return py_samr_OpenDomain_ndr_print(py_obj, "samr_OpenDomain_in", NDR_IN);
17452 : }
17453 :
17454 0 : static PyObject *py_samr_OpenDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17455 : {
17456 0 : return py_samr_OpenDomain_ndr_print(py_obj, "samr_OpenDomain_out", NDR_OUT);
17457 : }
17458 :
17459 : static PyMethodDef py_samr_OpenDomain_methods[] = {
17460 : { "opnum", (PyCFunction)py_samr_OpenDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
17461 : "samr.OpenDomain.opnum() -> 7 (0x07) " },
17462 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17463 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17464 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17465 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17466 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17467 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17468 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17469 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17470 : { "__ndr_print_in__", (PyCFunction)py_samr_OpenDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17471 : { "__ndr_print_out__", (PyCFunction)py_samr_OpenDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17472 : { NULL, NULL, 0, NULL }
17473 : };
17474 :
17475 :
17476 : static PyTypeObject samr_OpenDomain_Type = {
17477 : PyVarObject_HEAD_INIT(NULL, 0)
17478 : .tp_name = "samr.OpenDomain",
17479 : .tp_getset = py_samr_OpenDomain_getsetters,
17480 : .tp_methods = py_samr_OpenDomain_methods,
17481 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
17482 : .tp_new = py_samr_OpenDomain_new,
17483 : };
17484 :
17485 460 : static bool pack_py_samr_OpenDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenDomain *r)
17486 : {
17487 0 : PyObject *py_connect_handle;
17488 0 : PyObject *py_access_mask;
17489 0 : PyObject *py_sid;
17490 460 : const char *kwnames[] = {
17491 : "connect_handle", "access_mask", "sid", NULL
17492 : };
17493 :
17494 460 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_access_mask, &py_sid)) {
17495 0 : return false;
17496 : }
17497 :
17498 460 : if (py_connect_handle == NULL) {
17499 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle");
17500 0 : return false;
17501 : }
17502 460 : r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
17503 460 : if (r->in.connect_handle == NULL) {
17504 0 : PyErr_NoMemory();
17505 0 : return false;
17506 : }
17507 460 : PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
17508 460 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
17509 0 : PyErr_NoMemory();
17510 0 : return false;
17511 : }
17512 460 : r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
17513 460 : if (py_access_mask == NULL) {
17514 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
17515 0 : return false;
17516 : }
17517 : {
17518 460 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
17519 460 : if (PyLong_Check(py_access_mask)) {
17520 0 : unsigned long long test_var;
17521 460 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
17522 460 : if (PyErr_Occurred() != NULL) {
17523 0 : return false;
17524 : }
17525 460 : if (test_var > uint_max) {
17526 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17527 : PyLong_Type.tp_name, uint_max, test_var);
17528 0 : return false;
17529 : }
17530 460 : r->in.access_mask = test_var;
17531 : } else {
17532 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17533 : PyLong_Type.tp_name);
17534 0 : return false;
17535 : }
17536 : }
17537 460 : if (py_sid == NULL) {
17538 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
17539 0 : return false;
17540 : }
17541 460 : r->in.sid = talloc_ptrtype(r, r->in.sid);
17542 460 : if (r->in.sid == NULL) {
17543 0 : PyErr_NoMemory();
17544 0 : return false;
17545 : }
17546 460 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
17547 460 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
17548 0 : PyErr_NoMemory();
17549 0 : return false;
17550 : }
17551 460 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
17552 460 : return true;
17553 : }
17554 :
17555 460 : static PyObject *unpack_py_samr_OpenDomain_args_out(struct samr_OpenDomain *r)
17556 : {
17557 0 : PyObject *result;
17558 0 : PyObject *py_domain_handle;
17559 460 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, r->out.domain_handle, r->out.domain_handle);
17560 460 : result = py_domain_handle;
17561 460 : if (NT_STATUS_IS_ERR(r->out.result)) {
17562 0 : PyErr_SetNTSTATUS(r->out.result);
17563 0 : return NULL;
17564 : }
17565 :
17566 460 : return result;
17567 : }
17568 :
17569 :
17570 0 : static PyObject *py_samr_QueryDomainInfo_in_get_domain_handle(PyObject *obj, void *closure)
17571 : {
17572 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj);
17573 0 : PyObject *py_domain_handle;
17574 0 : if (object->in.domain_handle == NULL) {
17575 0 : Py_RETURN_NONE;
17576 : }
17577 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
17578 0 : return py_domain_handle;
17579 : }
17580 :
17581 0 : static int py_samr_QueryDomainInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
17582 : {
17583 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17584 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
17585 0 : if (value == NULL) {
17586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
17587 0 : return -1;
17588 : }
17589 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
17590 0 : if (object->in.domain_handle == NULL) {
17591 0 : PyErr_NoMemory();
17592 0 : return -1;
17593 : }
17594 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
17595 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
17596 0 : PyErr_NoMemory();
17597 0 : return -1;
17598 : }
17599 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
17600 0 : return 0;
17601 : }
17602 :
17603 0 : static PyObject *py_samr_QueryDomainInfo_in_get_level(PyObject *obj, void *closure)
17604 : {
17605 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj);
17606 0 : PyObject *py_level;
17607 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
17608 0 : return py_level;
17609 : }
17610 :
17611 0 : static int py_samr_QueryDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
17612 : {
17613 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17614 0 : if (value == NULL) {
17615 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
17616 0 : return -1;
17617 : }
17618 : {
17619 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
17620 0 : if (PyLong_Check(value)) {
17621 0 : unsigned long long test_var;
17622 0 : test_var = PyLong_AsUnsignedLongLong(value);
17623 0 : if (PyErr_Occurred() != NULL) {
17624 0 : return -1;
17625 : }
17626 0 : if (test_var > uint_max) {
17627 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
17628 : PyLong_Type.tp_name, uint_max, test_var);
17629 0 : return -1;
17630 : }
17631 0 : object->in.level = test_var;
17632 : } else {
17633 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
17634 : PyLong_Type.tp_name);
17635 0 : return -1;
17636 : }
17637 : }
17638 0 : return 0;
17639 : }
17640 :
17641 0 : static PyObject *py_samr_QueryDomainInfo_out_get_info(PyObject *obj, void *closure)
17642 : {
17643 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj);
17644 0 : PyObject *py_info;
17645 0 : if (object->out.info == NULL) {
17646 0 : Py_RETURN_NONE;
17647 : }
17648 0 : if (*object->out.info == NULL) {
17649 0 : py_info = Py_None;
17650 0 : Py_INCREF(py_info);
17651 : } else {
17652 0 : py_info = pyrpc_import_union(&samr_DomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_DomainInfo");
17653 0 : if (py_info == NULL) {
17654 0 : return NULL;
17655 : }
17656 : }
17657 0 : return py_info;
17658 : }
17659 :
17660 0 : static int py_samr_QueryDomainInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
17661 : {
17662 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17663 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
17664 0 : if (value == NULL) {
17665 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
17666 0 : return -1;
17667 : }
17668 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
17669 0 : if (object->out.info == NULL) {
17670 0 : PyErr_NoMemory();
17671 0 : return -1;
17672 : }
17673 0 : if (value == Py_None) {
17674 0 : *object->out.info = NULL;
17675 : } else {
17676 0 : *object->out.info = NULL;
17677 : {
17678 0 : union samr_DomainInfo *info_switch_2;
17679 0 : info_switch_2 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo");
17680 0 : if (info_switch_2 == NULL) {
17681 0 : return -1;
17682 : }
17683 0 : *object->out.info = info_switch_2;
17684 : }
17685 : }
17686 0 : return 0;
17687 : }
17688 :
17689 0 : static PyObject *py_samr_QueryDomainInfo_get_result(PyObject *obj, void *closure)
17690 : {
17691 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(obj);
17692 0 : PyObject *py_result;
17693 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
17694 0 : return py_result;
17695 : }
17696 :
17697 0 : static int py_samr_QueryDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
17698 : {
17699 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17700 0 : if (value == NULL) {
17701 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
17702 0 : return -1;
17703 : }
17704 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
17705 0 : return 0;
17706 : }
17707 :
17708 : static PyGetSetDef py_samr_QueryDomainInfo_getsetters[] = {
17709 : {
17710 : .name = discard_const_p(char, "in_domain_handle"),
17711 : .get = py_samr_QueryDomainInfo_in_get_domain_handle,
17712 : .set = py_samr_QueryDomainInfo_in_set_domain_handle,
17713 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
17714 : },
17715 : {
17716 : .name = discard_const_p(char, "in_level"),
17717 : .get = py_samr_QueryDomainInfo_in_get_level,
17718 : .set = py_samr_QueryDomainInfo_in_set_level,
17719 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass")
17720 : },
17721 : {
17722 : .name = discard_const_p(char, "out_info"),
17723 : .get = py_samr_QueryDomainInfo_out_get_info,
17724 : .set = py_samr_QueryDomainInfo_out_set_info,
17725 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo")
17726 : },
17727 : {
17728 : .name = discard_const_p(char, "result"),
17729 : .get = py_samr_QueryDomainInfo_get_result,
17730 : .set = py_samr_QueryDomainInfo_set_result,
17731 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
17732 : },
17733 : { .name = NULL }
17734 : };
17735 :
17736 0 : static PyObject *py_samr_QueryDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
17737 : {
17738 0 : PyObject *self = pytalloc_new(struct samr_QueryDomainInfo, type);
17739 0 : struct samr_QueryDomainInfo *_self = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(self);
17740 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
17741 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
17742 : /* a pointer to a NULL pointer */
17743 0 : _self->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *);
17744 0 : return self;
17745 : }
17746 :
17747 0 : static PyObject *py_samr_QueryDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
17748 : {
17749 :
17750 :
17751 0 : return PyLong_FromLong(8);
17752 : }
17753 :
17754 0 : static PyObject *py_samr_QueryDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
17755 : {
17756 0 : const struct ndr_interface_call *call = NULL;
17757 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17758 0 : PyObject *ret = NULL;
17759 0 : struct ndr_push *push = NULL;
17760 0 : DATA_BLOB blob;
17761 0 : enum ndr_err_code err;
17762 :
17763 0 : if (ndr_table_samr.num_calls < 9) {
17764 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_pack");
17765 0 : return NULL;
17766 : }
17767 0 : call = &ndr_table_samr.calls[8];
17768 :
17769 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
17770 0 : if (push == NULL) {
17771 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17772 0 : return NULL;
17773 : }
17774 :
17775 0 : push->flags |= ndr_push_flags;
17776 :
17777 0 : err = call->ndr_push(push, ndr_inout_flags, object);
17778 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17779 0 : TALLOC_FREE(push);
17780 0 : PyErr_SetNdrError(err);
17781 0 : return NULL;
17782 : }
17783 0 : blob = ndr_push_blob(push);
17784 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
17785 0 : TALLOC_FREE(push);
17786 0 : return ret;
17787 : }
17788 :
17789 0 : static PyObject *py_samr_QueryDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17790 : {
17791 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17792 0 : PyObject *bigendian_obj = NULL;
17793 0 : PyObject *ndr64_obj = NULL;
17794 0 : libndr_flags ndr_push_flags = 0;
17795 :
17796 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
17797 : discard_const_p(char *, kwnames),
17798 : &bigendian_obj,
17799 : &ndr64_obj)) {
17800 0 : return NULL;
17801 : }
17802 :
17803 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17804 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17805 : }
17806 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17807 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17808 : }
17809 :
17810 0 : return py_samr_QueryDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
17811 : }
17812 :
17813 0 : static PyObject *py_samr_QueryDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17814 : {
17815 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
17816 0 : PyObject *bigendian_obj = NULL;
17817 0 : PyObject *ndr64_obj = NULL;
17818 0 : libndr_flags ndr_push_flags = 0;
17819 :
17820 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
17821 : discard_const_p(char *, kwnames),
17822 : &bigendian_obj,
17823 : &ndr64_obj)) {
17824 0 : return NULL;
17825 : }
17826 :
17827 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17828 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
17829 : }
17830 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17831 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
17832 : }
17833 :
17834 0 : return py_samr_QueryDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
17835 : }
17836 :
17837 0 : static PyObject *py_samr_QueryDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
17838 : {
17839 0 : const struct ndr_interface_call *call = NULL;
17840 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17841 0 : struct ndr_pull *pull = NULL;
17842 0 : enum ndr_err_code err;
17843 :
17844 0 : if (ndr_table_samr.num_calls < 9) {
17845 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_unpack");
17846 0 : return NULL;
17847 : }
17848 0 : call = &ndr_table_samr.calls[8];
17849 :
17850 0 : pull = ndr_pull_init_blob(blob, object);
17851 0 : if (pull == NULL) {
17852 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
17853 0 : return NULL;
17854 : }
17855 :
17856 0 : pull->flags |= ndr_pull_flags;
17857 :
17858 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
17859 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
17860 0 : TALLOC_FREE(pull);
17861 0 : PyErr_SetNdrError(err);
17862 0 : return NULL;
17863 : }
17864 0 : if (!allow_remaining) {
17865 0 : uint32_t highest_ofs;
17866 :
17867 0 : if (pull->offset > pull->relative_highest_offset) {
17868 0 : highest_ofs = pull->offset;
17869 : } else {
17870 0 : highest_ofs = pull->relative_highest_offset;
17871 : }
17872 0 : if (highest_ofs < pull->data_size) {
17873 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
17874 : "not all bytes consumed ofs[%u] size[%u]",
17875 : highest_ofs, pull->data_size);
17876 0 : TALLOC_FREE(pull);
17877 0 : PyErr_SetNdrError(err);
17878 0 : return NULL;
17879 : }
17880 : }
17881 :
17882 0 : TALLOC_FREE(pull);
17883 0 : Py_RETURN_NONE;
17884 : }
17885 :
17886 0 : static PyObject *py_samr_QueryDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17887 : {
17888 0 : DATA_BLOB blob;
17889 0 : Py_ssize_t blob_length = 0;
17890 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17891 0 : PyObject *bigendian_obj = NULL;
17892 0 : PyObject *ndr64_obj = NULL;
17893 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17894 0 : PyObject *allow_remaining_obj = NULL;
17895 0 : bool allow_remaining = false;
17896 :
17897 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
17898 : discard_const_p(char *, kwnames),
17899 : &blob.data, &blob_length,
17900 : &bigendian_obj,
17901 : &ndr64_obj,
17902 : &allow_remaining_obj)) {
17903 0 : return NULL;
17904 : }
17905 0 : blob.length = blob_length;
17906 :
17907 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17908 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17909 : }
17910 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17911 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17912 : }
17913 :
17914 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17915 0 : allow_remaining = true;
17916 : }
17917 :
17918 0 : return py_samr_QueryDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
17919 : }
17920 :
17921 0 : static PyObject *py_samr_QueryDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
17922 : {
17923 0 : DATA_BLOB blob;
17924 0 : Py_ssize_t blob_length = 0;
17925 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
17926 0 : PyObject *bigendian_obj = NULL;
17927 0 : PyObject *ndr64_obj = NULL;
17928 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
17929 0 : PyObject *allow_remaining_obj = NULL;
17930 0 : bool allow_remaining = false;
17931 :
17932 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
17933 : discard_const_p(char *, kwnames),
17934 : &blob.data, &blob_length,
17935 : &bigendian_obj,
17936 : &ndr64_obj,
17937 : &allow_remaining_obj)) {
17938 0 : return NULL;
17939 : }
17940 0 : blob.length = blob_length;
17941 :
17942 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
17943 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
17944 : }
17945 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
17946 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
17947 : }
17948 :
17949 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
17950 0 : allow_remaining = true;
17951 : }
17952 :
17953 0 : return py_samr_QueryDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
17954 : }
17955 :
17956 0 : static PyObject *py_samr_QueryDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
17957 : {
17958 0 : const struct ndr_interface_call *call = NULL;
17959 0 : struct samr_QueryDomainInfo *object = (struct samr_QueryDomainInfo *)pytalloc_get_ptr(py_obj);
17960 0 : PyObject *ret;
17961 0 : char *retstr;
17962 :
17963 0 : if (ndr_table_samr.num_calls < 9) {
17964 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo_ndr_print");
17965 0 : return NULL;
17966 : }
17967 0 : call = &ndr_table_samr.calls[8];
17968 :
17969 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
17970 0 : ret = PyUnicode_FromString(retstr);
17971 0 : TALLOC_FREE(retstr);
17972 :
17973 0 : return ret;
17974 : }
17975 :
17976 0 : static PyObject *py_samr_QueryDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17977 : {
17978 0 : return py_samr_QueryDomainInfo_ndr_print(py_obj, "samr_QueryDomainInfo_in", NDR_IN);
17979 : }
17980 :
17981 0 : static PyObject *py_samr_QueryDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
17982 : {
17983 0 : return py_samr_QueryDomainInfo_ndr_print(py_obj, "samr_QueryDomainInfo_out", NDR_OUT);
17984 : }
17985 :
17986 : static PyMethodDef py_samr_QueryDomainInfo_methods[] = {
17987 : { "opnum", (PyCFunction)py_samr_QueryDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
17988 : "samr.QueryDomainInfo.opnum() -> 8 (0x08) " },
17989 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
17990 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
17991 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
17992 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
17993 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
17994 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
17995 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
17996 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
17997 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
17998 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
17999 : { NULL, NULL, 0, NULL }
18000 : };
18001 :
18002 :
18003 : static PyTypeObject samr_QueryDomainInfo_Type = {
18004 : PyVarObject_HEAD_INIT(NULL, 0)
18005 : .tp_name = "samr.QueryDomainInfo",
18006 : .tp_getset = py_samr_QueryDomainInfo_getsetters,
18007 : .tp_methods = py_samr_QueryDomainInfo_methods,
18008 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18009 : .tp_new = py_samr_QueryDomainInfo_new,
18010 : };
18011 :
18012 4 : static bool pack_py_samr_QueryDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo *r)
18013 : {
18014 0 : PyObject *py_domain_handle;
18015 0 : PyObject *py_level;
18016 4 : const char *kwnames[] = {
18017 : "domain_handle", "level", NULL
18018 : };
18019 :
18020 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
18021 0 : return false;
18022 : }
18023 :
18024 4 : if (py_domain_handle == NULL) {
18025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
18026 0 : return false;
18027 : }
18028 4 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
18029 4 : if (r->in.domain_handle == NULL) {
18030 0 : PyErr_NoMemory();
18031 0 : return false;
18032 : }
18033 4 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
18034 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
18035 0 : PyErr_NoMemory();
18036 0 : return false;
18037 : }
18038 4 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
18039 4 : if (py_level == NULL) {
18040 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
18041 0 : return false;
18042 : }
18043 : {
18044 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
18045 4 : if (PyLong_Check(py_level)) {
18046 0 : unsigned long long test_var;
18047 4 : test_var = PyLong_AsUnsignedLongLong(py_level);
18048 4 : if (PyErr_Occurred() != NULL) {
18049 0 : return false;
18050 : }
18051 4 : if (test_var > uint_max) {
18052 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18053 : PyLong_Type.tp_name, uint_max, test_var);
18054 0 : return false;
18055 : }
18056 4 : r->in.level = test_var;
18057 : } else {
18058 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18059 : PyLong_Type.tp_name);
18060 0 : return false;
18061 : }
18062 : }
18063 4 : return true;
18064 : }
18065 :
18066 4 : static PyObject *unpack_py_samr_QueryDomainInfo_args_out(struct samr_QueryDomainInfo *r)
18067 : {
18068 0 : PyObject *result;
18069 0 : PyObject *py_info;
18070 4 : if (*r->out.info == NULL) {
18071 0 : py_info = Py_None;
18072 0 : Py_INCREF(py_info);
18073 : } else {
18074 4 : py_info = pyrpc_import_union(&samr_DomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_DomainInfo");
18075 4 : if (py_info == NULL) {
18076 0 : return NULL;
18077 : }
18078 : }
18079 4 : result = py_info;
18080 4 : if (NT_STATUS_IS_ERR(r->out.result)) {
18081 0 : PyErr_SetNTSTATUS(r->out.result);
18082 0 : return NULL;
18083 : }
18084 :
18085 4 : return result;
18086 : }
18087 :
18088 :
18089 0 : static PyObject *py_samr_SetDomainInfo_in_get_domain_handle(PyObject *obj, void *closure)
18090 : {
18091 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj);
18092 0 : PyObject *py_domain_handle;
18093 0 : if (object->in.domain_handle == NULL) {
18094 0 : Py_RETURN_NONE;
18095 : }
18096 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
18097 0 : return py_domain_handle;
18098 : }
18099 :
18100 0 : static int py_samr_SetDomainInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
18101 : {
18102 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18103 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
18104 0 : if (value == NULL) {
18105 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
18106 0 : return -1;
18107 : }
18108 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
18109 0 : if (object->in.domain_handle == NULL) {
18110 0 : PyErr_NoMemory();
18111 0 : return -1;
18112 : }
18113 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18114 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18115 0 : PyErr_NoMemory();
18116 0 : return -1;
18117 : }
18118 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
18119 0 : return 0;
18120 : }
18121 :
18122 0 : static PyObject *py_samr_SetDomainInfo_in_get_level(PyObject *obj, void *closure)
18123 : {
18124 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj);
18125 0 : PyObject *py_level;
18126 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
18127 0 : return py_level;
18128 : }
18129 :
18130 0 : static int py_samr_SetDomainInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
18131 : {
18132 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18133 0 : if (value == NULL) {
18134 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
18135 0 : return -1;
18136 : }
18137 : {
18138 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
18139 0 : if (PyLong_Check(value)) {
18140 0 : unsigned long long test_var;
18141 0 : test_var = PyLong_AsUnsignedLongLong(value);
18142 0 : if (PyErr_Occurred() != NULL) {
18143 0 : return -1;
18144 : }
18145 0 : if (test_var > uint_max) {
18146 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18147 : PyLong_Type.tp_name, uint_max, test_var);
18148 0 : return -1;
18149 : }
18150 0 : object->in.level = test_var;
18151 : } else {
18152 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18153 : PyLong_Type.tp_name);
18154 0 : return -1;
18155 : }
18156 : }
18157 0 : return 0;
18158 : }
18159 :
18160 0 : static PyObject *py_samr_SetDomainInfo_in_get_info(PyObject *obj, void *closure)
18161 : {
18162 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj);
18163 0 : PyObject *py_info;
18164 0 : if (object->in.info == NULL) {
18165 0 : Py_RETURN_NONE;
18166 : }
18167 0 : py_info = pyrpc_import_union(&samr_DomainInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_DomainInfo");
18168 0 : if (py_info == NULL) {
18169 0 : return NULL;
18170 : }
18171 0 : return py_info;
18172 : }
18173 :
18174 0 : static int py_samr_SetDomainInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
18175 : {
18176 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18177 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
18178 0 : if (value == NULL) {
18179 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
18180 0 : return -1;
18181 : }
18182 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
18183 0 : if (object->in.info == NULL) {
18184 0 : PyErr_NoMemory();
18185 0 : return -1;
18186 : }
18187 : {
18188 0 : union samr_DomainInfo *info_switch_1;
18189 0 : info_switch_1 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo");
18190 0 : if (info_switch_1 == NULL) {
18191 0 : return -1;
18192 : }
18193 0 : object->in.info = info_switch_1;
18194 : }
18195 0 : return 0;
18196 : }
18197 :
18198 0 : static PyObject *py_samr_SetDomainInfo_get_result(PyObject *obj, void *closure)
18199 : {
18200 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(obj);
18201 0 : PyObject *py_result;
18202 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18203 0 : return py_result;
18204 : }
18205 :
18206 0 : static int py_samr_SetDomainInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
18207 : {
18208 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18209 0 : if (value == NULL) {
18210 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18211 0 : return -1;
18212 : }
18213 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18214 0 : return 0;
18215 : }
18216 :
18217 : static PyGetSetDef py_samr_SetDomainInfo_getsetters[] = {
18218 : {
18219 : .name = discard_const_p(char, "in_domain_handle"),
18220 : .get = py_samr_SetDomainInfo_in_get_domain_handle,
18221 : .set = py_samr_SetDomainInfo_in_set_domain_handle,
18222 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18223 : },
18224 : {
18225 : .name = discard_const_p(char, "in_level"),
18226 : .get = py_samr_SetDomainInfo_in_get_level,
18227 : .set = py_samr_SetDomainInfo_in_set_level,
18228 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass")
18229 : },
18230 : {
18231 : .name = discard_const_p(char, "in_info"),
18232 : .get = py_samr_SetDomainInfo_in_get_info,
18233 : .set = py_samr_SetDomainInfo_in_set_info,
18234 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo")
18235 : },
18236 : {
18237 : .name = discard_const_p(char, "result"),
18238 : .get = py_samr_SetDomainInfo_get_result,
18239 : .set = py_samr_SetDomainInfo_set_result,
18240 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18241 : },
18242 : { .name = NULL }
18243 : };
18244 :
18245 0 : static PyObject *py_samr_SetDomainInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18246 : {
18247 0 : PyObject *self = pytalloc_new(struct samr_SetDomainInfo, type);
18248 0 : struct samr_SetDomainInfo *_self = (struct samr_SetDomainInfo *)pytalloc_get_ptr(self);
18249 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18250 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
18251 0 : _self->in.info = talloc_zero(mem_ctx, union samr_DomainInfo);
18252 0 : return self;
18253 : }
18254 :
18255 0 : static PyObject *py_samr_SetDomainInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18256 : {
18257 :
18258 :
18259 0 : return PyLong_FromLong(9);
18260 : }
18261 :
18262 0 : static PyObject *py_samr_SetDomainInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18263 : {
18264 0 : const struct ndr_interface_call *call = NULL;
18265 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18266 0 : PyObject *ret = NULL;
18267 0 : struct ndr_push *push = NULL;
18268 0 : DATA_BLOB blob;
18269 0 : enum ndr_err_code err;
18270 :
18271 0 : if (ndr_table_samr.num_calls < 10) {
18272 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_pack");
18273 0 : return NULL;
18274 : }
18275 0 : call = &ndr_table_samr.calls[9];
18276 :
18277 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18278 0 : if (push == NULL) {
18279 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18280 0 : return NULL;
18281 : }
18282 :
18283 0 : push->flags |= ndr_push_flags;
18284 :
18285 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18286 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18287 0 : TALLOC_FREE(push);
18288 0 : PyErr_SetNdrError(err);
18289 0 : return NULL;
18290 : }
18291 0 : blob = ndr_push_blob(push);
18292 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18293 0 : TALLOC_FREE(push);
18294 0 : return ret;
18295 : }
18296 :
18297 0 : static PyObject *py_samr_SetDomainInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18298 : {
18299 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18300 0 : PyObject *bigendian_obj = NULL;
18301 0 : PyObject *ndr64_obj = NULL;
18302 0 : libndr_flags ndr_push_flags = 0;
18303 :
18304 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18305 : discard_const_p(char *, kwnames),
18306 : &bigendian_obj,
18307 : &ndr64_obj)) {
18308 0 : return NULL;
18309 : }
18310 :
18311 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18312 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18313 : }
18314 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18315 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18316 : }
18317 :
18318 0 : return py_samr_SetDomainInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18319 : }
18320 :
18321 0 : static PyObject *py_samr_SetDomainInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18322 : {
18323 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18324 0 : PyObject *bigendian_obj = NULL;
18325 0 : PyObject *ndr64_obj = NULL;
18326 0 : libndr_flags ndr_push_flags = 0;
18327 :
18328 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18329 : discard_const_p(char *, kwnames),
18330 : &bigendian_obj,
18331 : &ndr64_obj)) {
18332 0 : return NULL;
18333 : }
18334 :
18335 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18336 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18337 : }
18338 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18339 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18340 : }
18341 :
18342 0 : return py_samr_SetDomainInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18343 : }
18344 :
18345 0 : static PyObject *py_samr_SetDomainInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18346 : {
18347 0 : const struct ndr_interface_call *call = NULL;
18348 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18349 0 : struct ndr_pull *pull = NULL;
18350 0 : enum ndr_err_code err;
18351 :
18352 0 : if (ndr_table_samr.num_calls < 10) {
18353 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_unpack");
18354 0 : return NULL;
18355 : }
18356 0 : call = &ndr_table_samr.calls[9];
18357 :
18358 0 : pull = ndr_pull_init_blob(blob, object);
18359 0 : if (pull == NULL) {
18360 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18361 0 : return NULL;
18362 : }
18363 :
18364 0 : pull->flags |= ndr_pull_flags;
18365 :
18366 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18367 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18368 0 : TALLOC_FREE(pull);
18369 0 : PyErr_SetNdrError(err);
18370 0 : return NULL;
18371 : }
18372 0 : if (!allow_remaining) {
18373 0 : uint32_t highest_ofs;
18374 :
18375 0 : if (pull->offset > pull->relative_highest_offset) {
18376 0 : highest_ofs = pull->offset;
18377 : } else {
18378 0 : highest_ofs = pull->relative_highest_offset;
18379 : }
18380 0 : if (highest_ofs < pull->data_size) {
18381 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18382 : "not all bytes consumed ofs[%u] size[%u]",
18383 : highest_ofs, pull->data_size);
18384 0 : TALLOC_FREE(pull);
18385 0 : PyErr_SetNdrError(err);
18386 0 : return NULL;
18387 : }
18388 : }
18389 :
18390 0 : TALLOC_FREE(pull);
18391 0 : Py_RETURN_NONE;
18392 : }
18393 :
18394 0 : static PyObject *py_samr_SetDomainInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18395 : {
18396 0 : DATA_BLOB blob;
18397 0 : Py_ssize_t blob_length = 0;
18398 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18399 0 : PyObject *bigendian_obj = NULL;
18400 0 : PyObject *ndr64_obj = NULL;
18401 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18402 0 : PyObject *allow_remaining_obj = NULL;
18403 0 : bool allow_remaining = false;
18404 :
18405 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
18406 : discard_const_p(char *, kwnames),
18407 : &blob.data, &blob_length,
18408 : &bigendian_obj,
18409 : &ndr64_obj,
18410 : &allow_remaining_obj)) {
18411 0 : return NULL;
18412 : }
18413 0 : blob.length = blob_length;
18414 :
18415 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18416 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18417 : }
18418 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18419 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18420 : }
18421 :
18422 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18423 0 : allow_remaining = true;
18424 : }
18425 :
18426 0 : return py_samr_SetDomainInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
18427 : }
18428 :
18429 0 : static PyObject *py_samr_SetDomainInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18430 : {
18431 0 : DATA_BLOB blob;
18432 0 : Py_ssize_t blob_length = 0;
18433 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
18434 0 : PyObject *bigendian_obj = NULL;
18435 0 : PyObject *ndr64_obj = NULL;
18436 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
18437 0 : PyObject *allow_remaining_obj = NULL;
18438 0 : bool allow_remaining = false;
18439 :
18440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
18441 : discard_const_p(char *, kwnames),
18442 : &blob.data, &blob_length,
18443 : &bigendian_obj,
18444 : &ndr64_obj,
18445 : &allow_remaining_obj)) {
18446 0 : return NULL;
18447 : }
18448 0 : blob.length = blob_length;
18449 :
18450 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18451 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
18452 : }
18453 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18454 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
18455 : }
18456 :
18457 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
18458 0 : allow_remaining = true;
18459 : }
18460 :
18461 0 : return py_samr_SetDomainInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
18462 : }
18463 :
18464 0 : static PyObject *py_samr_SetDomainInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
18465 : {
18466 0 : const struct ndr_interface_call *call = NULL;
18467 0 : struct samr_SetDomainInfo *object = (struct samr_SetDomainInfo *)pytalloc_get_ptr(py_obj);
18468 0 : PyObject *ret;
18469 0 : char *retstr;
18470 :
18471 0 : if (ndr_table_samr.num_calls < 10) {
18472 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDomainInfo_ndr_print");
18473 0 : return NULL;
18474 : }
18475 0 : call = &ndr_table_samr.calls[9];
18476 :
18477 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
18478 0 : ret = PyUnicode_FromString(retstr);
18479 0 : TALLOC_FREE(retstr);
18480 :
18481 0 : return ret;
18482 : }
18483 :
18484 0 : static PyObject *py_samr_SetDomainInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18485 : {
18486 0 : return py_samr_SetDomainInfo_ndr_print(py_obj, "samr_SetDomainInfo_in", NDR_IN);
18487 : }
18488 :
18489 0 : static PyObject *py_samr_SetDomainInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
18490 : {
18491 0 : return py_samr_SetDomainInfo_ndr_print(py_obj, "samr_SetDomainInfo_out", NDR_OUT);
18492 : }
18493 :
18494 : static PyMethodDef py_samr_SetDomainInfo_methods[] = {
18495 : { "opnum", (PyCFunction)py_samr_SetDomainInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
18496 : "samr.SetDomainInfo.opnum() -> 9 (0x09) " },
18497 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDomainInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
18498 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
18499 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDomainInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
18500 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
18501 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDomainInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
18502 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
18503 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDomainInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
18504 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
18505 : { "__ndr_print_in__", (PyCFunction)py_samr_SetDomainInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
18506 : { "__ndr_print_out__", (PyCFunction)py_samr_SetDomainInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
18507 : { NULL, NULL, 0, NULL }
18508 : };
18509 :
18510 :
18511 : static PyTypeObject samr_SetDomainInfo_Type = {
18512 : PyVarObject_HEAD_INIT(NULL, 0)
18513 : .tp_name = "samr.SetDomainInfo",
18514 : .tp_getset = py_samr_SetDomainInfo_getsetters,
18515 : .tp_methods = py_samr_SetDomainInfo_methods,
18516 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
18517 : .tp_new = py_samr_SetDomainInfo_new,
18518 : };
18519 :
18520 0 : static bool pack_py_samr_SetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDomainInfo *r)
18521 : {
18522 0 : PyObject *py_domain_handle;
18523 0 : PyObject *py_level;
18524 0 : PyObject *py_info;
18525 0 : const char *kwnames[] = {
18526 : "domain_handle", "level", "info", NULL
18527 : };
18528 :
18529 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_info)) {
18530 0 : return false;
18531 : }
18532 :
18533 0 : if (py_domain_handle == NULL) {
18534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
18535 0 : return false;
18536 : }
18537 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
18538 0 : if (r->in.domain_handle == NULL) {
18539 0 : PyErr_NoMemory();
18540 0 : return false;
18541 : }
18542 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
18543 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
18544 0 : PyErr_NoMemory();
18545 0 : return false;
18546 : }
18547 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
18548 0 : if (py_level == NULL) {
18549 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
18550 0 : return false;
18551 : }
18552 : {
18553 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
18554 0 : if (PyLong_Check(py_level)) {
18555 0 : unsigned long long test_var;
18556 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
18557 0 : if (PyErr_Occurred() != NULL) {
18558 0 : return false;
18559 : }
18560 0 : if (test_var > uint_max) {
18561 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18562 : PyLong_Type.tp_name, uint_max, test_var);
18563 0 : return false;
18564 : }
18565 0 : r->in.level = test_var;
18566 : } else {
18567 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18568 : PyLong_Type.tp_name);
18569 0 : return false;
18570 : }
18571 : }
18572 0 : if (py_info == NULL) {
18573 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
18574 0 : return false;
18575 : }
18576 0 : r->in.info = talloc_ptrtype(r, r->in.info);
18577 0 : if (r->in.info == NULL) {
18578 0 : PyErr_NoMemory();
18579 0 : return false;
18580 : }
18581 : {
18582 0 : union samr_DomainInfo *info_switch_1;
18583 0 : info_switch_1 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, r, r->in.level, py_info, "union samr_DomainInfo");
18584 0 : if (info_switch_1 == NULL) {
18585 0 : return false;
18586 : }
18587 0 : r->in.info = info_switch_1;
18588 : }
18589 0 : return true;
18590 : }
18591 :
18592 0 : static PyObject *unpack_py_samr_SetDomainInfo_args_out(struct samr_SetDomainInfo *r)
18593 : {
18594 0 : PyObject *result;
18595 0 : result = Py_None;
18596 0 : Py_INCREF(result);
18597 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
18598 0 : PyErr_SetNTSTATUS(r->out.result);
18599 0 : return NULL;
18600 : }
18601 :
18602 0 : return result;
18603 : }
18604 :
18605 :
18606 0 : static PyObject *py_samr_CreateDomainGroup_in_get_domain_handle(PyObject *obj, void *closure)
18607 : {
18608 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18609 0 : PyObject *py_domain_handle;
18610 0 : if (object->in.domain_handle == NULL) {
18611 0 : Py_RETURN_NONE;
18612 : }
18613 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
18614 0 : return py_domain_handle;
18615 : }
18616 :
18617 0 : static int py_samr_CreateDomainGroup_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
18618 : {
18619 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18620 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
18621 0 : if (value == NULL) {
18622 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
18623 0 : return -1;
18624 : }
18625 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
18626 0 : if (object->in.domain_handle == NULL) {
18627 0 : PyErr_NoMemory();
18628 0 : return -1;
18629 : }
18630 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18631 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18632 0 : PyErr_NoMemory();
18633 0 : return -1;
18634 : }
18635 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
18636 0 : return 0;
18637 : }
18638 :
18639 0 : static PyObject *py_samr_CreateDomainGroup_in_get_name(PyObject *obj, void *closure)
18640 : {
18641 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18642 0 : PyObject *py_name;
18643 0 : if (object->in.name == NULL) {
18644 0 : Py_RETURN_NONE;
18645 : }
18646 0 : py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name);
18647 0 : return py_name;
18648 : }
18649 :
18650 0 : static int py_samr_CreateDomainGroup_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
18651 : {
18652 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18653 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
18654 0 : if (value == NULL) {
18655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
18656 0 : return -1;
18657 : }
18658 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
18659 0 : if (object->in.name == NULL) {
18660 0 : PyErr_NoMemory();
18661 0 : return -1;
18662 : }
18663 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
18664 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18665 0 : PyErr_NoMemory();
18666 0 : return -1;
18667 : }
18668 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
18669 0 : return 0;
18670 : }
18671 :
18672 0 : static PyObject *py_samr_CreateDomainGroup_in_get_access_mask(PyObject *obj, void *closure)
18673 : {
18674 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18675 0 : PyObject *py_access_mask;
18676 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
18677 0 : return py_access_mask;
18678 : }
18679 :
18680 0 : static int py_samr_CreateDomainGroup_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
18681 : {
18682 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18683 0 : if (value == NULL) {
18684 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
18685 0 : return -1;
18686 : }
18687 : {
18688 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
18689 0 : if (PyLong_Check(value)) {
18690 0 : unsigned long long test_var;
18691 0 : test_var = PyLong_AsUnsignedLongLong(value);
18692 0 : if (PyErr_Occurred() != NULL) {
18693 0 : return -1;
18694 : }
18695 0 : if (test_var > uint_max) {
18696 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18697 : PyLong_Type.tp_name, uint_max, test_var);
18698 0 : return -1;
18699 : }
18700 0 : object->in.access_mask = test_var;
18701 : } else {
18702 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18703 : PyLong_Type.tp_name);
18704 0 : return -1;
18705 : }
18706 : }
18707 0 : return 0;
18708 : }
18709 :
18710 0 : static PyObject *py_samr_CreateDomainGroup_out_get_group_handle(PyObject *obj, void *closure)
18711 : {
18712 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18713 0 : PyObject *py_group_handle;
18714 0 : if (object->out.group_handle == NULL) {
18715 0 : Py_RETURN_NONE;
18716 : }
18717 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle);
18718 0 : return py_group_handle;
18719 : }
18720 :
18721 0 : static int py_samr_CreateDomainGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
18722 : {
18723 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18724 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle));
18725 0 : if (value == NULL) {
18726 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle");
18727 0 : return -1;
18728 : }
18729 0 : object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle);
18730 0 : if (object->out.group_handle == NULL) {
18731 0 : PyErr_NoMemory();
18732 0 : return -1;
18733 : }
18734 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
18735 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
18736 0 : PyErr_NoMemory();
18737 0 : return -1;
18738 : }
18739 0 : object->out.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
18740 0 : return 0;
18741 : }
18742 :
18743 0 : static PyObject *py_samr_CreateDomainGroup_out_get_rid(PyObject *obj, void *closure)
18744 : {
18745 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18746 0 : PyObject *py_rid;
18747 0 : if (object->out.rid == NULL) {
18748 0 : Py_RETURN_NONE;
18749 : }
18750 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
18751 0 : return py_rid;
18752 : }
18753 :
18754 0 : static int py_samr_CreateDomainGroup_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
18755 : {
18756 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18757 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
18758 0 : if (value == NULL) {
18759 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
18760 0 : return -1;
18761 : }
18762 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
18763 0 : if (object->out.rid == NULL) {
18764 0 : PyErr_NoMemory();
18765 0 : return -1;
18766 : }
18767 : {
18768 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
18769 0 : if (PyLong_Check(value)) {
18770 0 : unsigned long long test_var;
18771 0 : test_var = PyLong_AsUnsignedLongLong(value);
18772 0 : if (PyErr_Occurred() != NULL) {
18773 0 : return -1;
18774 : }
18775 0 : if (test_var > uint_max) {
18776 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
18777 : PyLong_Type.tp_name, uint_max, test_var);
18778 0 : return -1;
18779 : }
18780 0 : *object->out.rid = test_var;
18781 : } else {
18782 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
18783 : PyLong_Type.tp_name);
18784 0 : return -1;
18785 : }
18786 : }
18787 0 : return 0;
18788 : }
18789 :
18790 0 : static PyObject *py_samr_CreateDomainGroup_get_result(PyObject *obj, void *closure)
18791 : {
18792 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(obj);
18793 0 : PyObject *py_result;
18794 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
18795 0 : return py_result;
18796 : }
18797 :
18798 0 : static int py_samr_CreateDomainGroup_set_result(PyObject *py_obj, PyObject *value, void *closure)
18799 : {
18800 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18801 0 : if (value == NULL) {
18802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
18803 0 : return -1;
18804 : }
18805 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
18806 0 : return 0;
18807 : }
18808 :
18809 : static PyGetSetDef py_samr_CreateDomainGroup_getsetters[] = {
18810 : {
18811 : .name = discard_const_p(char, "in_domain_handle"),
18812 : .get = py_samr_CreateDomainGroup_in_get_domain_handle,
18813 : .set = py_samr_CreateDomainGroup_in_set_domain_handle,
18814 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18815 : },
18816 : {
18817 : .name = discard_const_p(char, "in_name"),
18818 : .get = py_samr_CreateDomainGroup_in_get_name,
18819 : .set = py_samr_CreateDomainGroup_in_set_name,
18820 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
18821 : },
18822 : {
18823 : .name = discard_const_p(char, "in_access_mask"),
18824 : .get = py_samr_CreateDomainGroup_in_get_access_mask,
18825 : .set = py_samr_CreateDomainGroup_in_set_access_mask,
18826 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupAccessMask")
18827 : },
18828 : {
18829 : .name = discard_const_p(char, "out_group_handle"),
18830 : .get = py_samr_CreateDomainGroup_out_get_group_handle,
18831 : .set = py_samr_CreateDomainGroup_out_set_group_handle,
18832 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
18833 : },
18834 : {
18835 : .name = discard_const_p(char, "out_rid"),
18836 : .get = py_samr_CreateDomainGroup_out_get_rid,
18837 : .set = py_samr_CreateDomainGroup_out_set_rid,
18838 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
18839 : },
18840 : {
18841 : .name = discard_const_p(char, "result"),
18842 : .get = py_samr_CreateDomainGroup_get_result,
18843 : .set = py_samr_CreateDomainGroup_set_result,
18844 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
18845 : },
18846 : { .name = NULL }
18847 : };
18848 :
18849 0 : static PyObject *py_samr_CreateDomainGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
18850 : {
18851 0 : PyObject *self = pytalloc_new(struct samr_CreateDomainGroup, type);
18852 0 : struct samr_CreateDomainGroup *_self = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(self);
18853 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
18854 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
18855 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
18856 0 : _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle);
18857 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
18858 0 : return self;
18859 : }
18860 :
18861 0 : static PyObject *py_samr_CreateDomainGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
18862 : {
18863 :
18864 :
18865 0 : return PyLong_FromLong(10);
18866 : }
18867 :
18868 0 : static PyObject *py_samr_CreateDomainGroup_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
18869 : {
18870 0 : const struct ndr_interface_call *call = NULL;
18871 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18872 0 : PyObject *ret = NULL;
18873 0 : struct ndr_push *push = NULL;
18874 0 : DATA_BLOB blob;
18875 0 : enum ndr_err_code err;
18876 :
18877 0 : if (ndr_table_samr.num_calls < 11) {
18878 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_pack");
18879 0 : return NULL;
18880 : }
18881 0 : call = &ndr_table_samr.calls[10];
18882 :
18883 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
18884 0 : if (push == NULL) {
18885 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18886 0 : return NULL;
18887 : }
18888 :
18889 0 : push->flags |= ndr_push_flags;
18890 :
18891 0 : err = call->ndr_push(push, ndr_inout_flags, object);
18892 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18893 0 : TALLOC_FREE(push);
18894 0 : PyErr_SetNdrError(err);
18895 0 : return NULL;
18896 : }
18897 0 : blob = ndr_push_blob(push);
18898 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
18899 0 : TALLOC_FREE(push);
18900 0 : return ret;
18901 : }
18902 :
18903 0 : static PyObject *py_samr_CreateDomainGroup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18904 : {
18905 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18906 0 : PyObject *bigendian_obj = NULL;
18907 0 : PyObject *ndr64_obj = NULL;
18908 0 : libndr_flags ndr_push_flags = 0;
18909 :
18910 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
18911 : discard_const_p(char *, kwnames),
18912 : &bigendian_obj,
18913 : &ndr64_obj)) {
18914 0 : return NULL;
18915 : }
18916 :
18917 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18918 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18919 : }
18920 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18921 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18922 : }
18923 :
18924 0 : return py_samr_CreateDomainGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
18925 : }
18926 :
18927 0 : static PyObject *py_samr_CreateDomainGroup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
18928 : {
18929 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
18930 0 : PyObject *bigendian_obj = NULL;
18931 0 : PyObject *ndr64_obj = NULL;
18932 0 : libndr_flags ndr_push_flags = 0;
18933 :
18934 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
18935 : discard_const_p(char *, kwnames),
18936 : &bigendian_obj,
18937 : &ndr64_obj)) {
18938 0 : return NULL;
18939 : }
18940 :
18941 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
18942 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
18943 : }
18944 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
18945 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
18946 : }
18947 :
18948 0 : return py_samr_CreateDomainGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
18949 : }
18950 :
18951 0 : static PyObject *py_samr_CreateDomainGroup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
18952 : {
18953 0 : const struct ndr_interface_call *call = NULL;
18954 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
18955 0 : struct ndr_pull *pull = NULL;
18956 0 : enum ndr_err_code err;
18957 :
18958 0 : if (ndr_table_samr.num_calls < 11) {
18959 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_unpack");
18960 0 : return NULL;
18961 : }
18962 0 : call = &ndr_table_samr.calls[10];
18963 :
18964 0 : pull = ndr_pull_init_blob(blob, object);
18965 0 : if (pull == NULL) {
18966 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
18967 0 : return NULL;
18968 : }
18969 :
18970 0 : pull->flags |= ndr_pull_flags;
18971 :
18972 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
18973 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
18974 0 : TALLOC_FREE(pull);
18975 0 : PyErr_SetNdrError(err);
18976 0 : return NULL;
18977 : }
18978 0 : if (!allow_remaining) {
18979 0 : uint32_t highest_ofs;
18980 :
18981 0 : if (pull->offset > pull->relative_highest_offset) {
18982 0 : highest_ofs = pull->offset;
18983 : } else {
18984 0 : highest_ofs = pull->relative_highest_offset;
18985 : }
18986 0 : if (highest_ofs < pull->data_size) {
18987 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
18988 : "not all bytes consumed ofs[%u] size[%u]",
18989 : highest_ofs, pull->data_size);
18990 0 : TALLOC_FREE(pull);
18991 0 : PyErr_SetNdrError(err);
18992 0 : return NULL;
18993 : }
18994 : }
18995 :
18996 0 : TALLOC_FREE(pull);
18997 0 : Py_RETURN_NONE;
18998 : }
18999 :
19000 0 : static PyObject *py_samr_CreateDomainGroup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19001 : {
19002 0 : DATA_BLOB blob;
19003 0 : Py_ssize_t blob_length = 0;
19004 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19005 0 : PyObject *bigendian_obj = NULL;
19006 0 : PyObject *ndr64_obj = NULL;
19007 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19008 0 : PyObject *allow_remaining_obj = NULL;
19009 0 : bool allow_remaining = false;
19010 :
19011 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19012 : discard_const_p(char *, kwnames),
19013 : &blob.data, &blob_length,
19014 : &bigendian_obj,
19015 : &ndr64_obj,
19016 : &allow_remaining_obj)) {
19017 0 : return NULL;
19018 : }
19019 0 : blob.length = blob_length;
19020 :
19021 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19022 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19023 : }
19024 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19025 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19026 : }
19027 :
19028 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19029 0 : allow_remaining = true;
19030 : }
19031 :
19032 0 : return py_samr_CreateDomainGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19033 : }
19034 :
19035 0 : static PyObject *py_samr_CreateDomainGroup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19036 : {
19037 0 : DATA_BLOB blob;
19038 0 : Py_ssize_t blob_length = 0;
19039 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19040 0 : PyObject *bigendian_obj = NULL;
19041 0 : PyObject *ndr64_obj = NULL;
19042 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19043 0 : PyObject *allow_remaining_obj = NULL;
19044 0 : bool allow_remaining = false;
19045 :
19046 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19047 : discard_const_p(char *, kwnames),
19048 : &blob.data, &blob_length,
19049 : &bigendian_obj,
19050 : &ndr64_obj,
19051 : &allow_remaining_obj)) {
19052 0 : return NULL;
19053 : }
19054 0 : blob.length = blob_length;
19055 :
19056 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19057 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19058 : }
19059 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19060 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19061 : }
19062 :
19063 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19064 0 : allow_remaining = true;
19065 : }
19066 :
19067 0 : return py_samr_CreateDomainGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19068 : }
19069 :
19070 0 : static PyObject *py_samr_CreateDomainGroup_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19071 : {
19072 0 : const struct ndr_interface_call *call = NULL;
19073 0 : struct samr_CreateDomainGroup *object = (struct samr_CreateDomainGroup *)pytalloc_get_ptr(py_obj);
19074 0 : PyObject *ret;
19075 0 : char *retstr;
19076 :
19077 0 : if (ndr_table_samr.num_calls < 11) {
19078 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomainGroup_ndr_print");
19079 0 : return NULL;
19080 : }
19081 0 : call = &ndr_table_samr.calls[10];
19082 :
19083 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19084 0 : ret = PyUnicode_FromString(retstr);
19085 0 : TALLOC_FREE(retstr);
19086 :
19087 0 : return ret;
19088 : }
19089 :
19090 0 : static PyObject *py_samr_CreateDomainGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19091 : {
19092 0 : return py_samr_CreateDomainGroup_ndr_print(py_obj, "samr_CreateDomainGroup_in", NDR_IN);
19093 : }
19094 :
19095 0 : static PyObject *py_samr_CreateDomainGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19096 : {
19097 0 : return py_samr_CreateDomainGroup_ndr_print(py_obj, "samr_CreateDomainGroup_out", NDR_OUT);
19098 : }
19099 :
19100 : static PyMethodDef py_samr_CreateDomainGroup_methods[] = {
19101 : { "opnum", (PyCFunction)py_samr_CreateDomainGroup_ndr_opnum, METH_NOARGS|METH_CLASS,
19102 : "samr.CreateDomainGroup.opnum() -> 10 (0x0a) " },
19103 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomainGroup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19104 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19105 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomainGroup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19106 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19107 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomainGroup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19108 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19109 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomainGroup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19110 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19111 : { "__ndr_print_in__", (PyCFunction)py_samr_CreateDomainGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19112 : { "__ndr_print_out__", (PyCFunction)py_samr_CreateDomainGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19113 : { NULL, NULL, 0, NULL }
19114 : };
19115 :
19116 :
19117 : static PyTypeObject samr_CreateDomainGroup_Type = {
19118 : PyVarObject_HEAD_INIT(NULL, 0)
19119 : .tp_name = "samr.CreateDomainGroup",
19120 : .tp_getset = py_samr_CreateDomainGroup_getsetters,
19121 : .tp_methods = py_samr_CreateDomainGroup_methods,
19122 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19123 : .tp_new = py_samr_CreateDomainGroup_new,
19124 : };
19125 :
19126 0 : static bool pack_py_samr_CreateDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomainGroup *r)
19127 : {
19128 0 : PyObject *py_domain_handle;
19129 0 : PyObject *py_name;
19130 0 : PyObject *py_access_mask;
19131 0 : const char *kwnames[] = {
19132 : "domain_handle", "name", "access_mask", NULL
19133 : };
19134 :
19135 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomainGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_name, &py_access_mask)) {
19136 0 : return false;
19137 : }
19138 :
19139 0 : if (py_domain_handle == NULL) {
19140 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
19141 0 : return false;
19142 : }
19143 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
19144 0 : if (r->in.domain_handle == NULL) {
19145 0 : PyErr_NoMemory();
19146 0 : return false;
19147 : }
19148 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
19149 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
19150 0 : PyErr_NoMemory();
19151 0 : return false;
19152 : }
19153 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
19154 0 : if (py_name == NULL) {
19155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
19156 0 : return false;
19157 : }
19158 0 : r->in.name = talloc_ptrtype(r, r->in.name);
19159 0 : if (r->in.name == NULL) {
19160 0 : PyErr_NoMemory();
19161 0 : return false;
19162 : }
19163 0 : PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
19164 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
19165 0 : PyErr_NoMemory();
19166 0 : return false;
19167 : }
19168 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
19169 0 : if (py_access_mask == NULL) {
19170 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
19171 0 : return false;
19172 : }
19173 : {
19174 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
19175 0 : if (PyLong_Check(py_access_mask)) {
19176 0 : unsigned long long test_var;
19177 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
19178 0 : if (PyErr_Occurred() != NULL) {
19179 0 : return false;
19180 : }
19181 0 : if (test_var > uint_max) {
19182 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19183 : PyLong_Type.tp_name, uint_max, test_var);
19184 0 : return false;
19185 : }
19186 0 : r->in.access_mask = test_var;
19187 : } else {
19188 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19189 : PyLong_Type.tp_name);
19190 0 : return false;
19191 : }
19192 : }
19193 0 : return true;
19194 : }
19195 :
19196 0 : static PyObject *unpack_py_samr_CreateDomainGroup_args_out(struct samr_CreateDomainGroup *r)
19197 : {
19198 0 : PyObject *result;
19199 0 : PyObject *py_group_handle;
19200 0 : PyObject *py_rid;
19201 0 : result = PyTuple_New(2);
19202 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
19203 0 : PyTuple_SetItem(result, 0, py_group_handle);
19204 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
19205 0 : PyTuple_SetItem(result, 1, py_rid);
19206 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
19207 0 : PyErr_SetNTSTATUS(r->out.result);
19208 0 : return NULL;
19209 : }
19210 :
19211 0 : return result;
19212 : }
19213 :
19214 :
19215 0 : static PyObject *py_samr_EnumDomainGroups_in_get_domain_handle(PyObject *obj, void *closure)
19216 : {
19217 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19218 0 : PyObject *py_domain_handle;
19219 0 : if (object->in.domain_handle == NULL) {
19220 0 : Py_RETURN_NONE;
19221 : }
19222 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
19223 0 : return py_domain_handle;
19224 : }
19225 :
19226 0 : static int py_samr_EnumDomainGroups_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
19227 : {
19228 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19229 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
19230 0 : if (value == NULL) {
19231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
19232 0 : return -1;
19233 : }
19234 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
19235 0 : if (object->in.domain_handle == NULL) {
19236 0 : PyErr_NoMemory();
19237 0 : return -1;
19238 : }
19239 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19240 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19241 0 : PyErr_NoMemory();
19242 0 : return -1;
19243 : }
19244 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
19245 0 : return 0;
19246 : }
19247 :
19248 0 : static PyObject *py_samr_EnumDomainGroups_in_get_resume_handle(PyObject *obj, void *closure)
19249 : {
19250 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19251 0 : PyObject *py_resume_handle;
19252 0 : if (object->in.resume_handle == NULL) {
19253 0 : Py_RETURN_NONE;
19254 : }
19255 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
19256 0 : return py_resume_handle;
19257 : }
19258 :
19259 0 : static int py_samr_EnumDomainGroups_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
19260 : {
19261 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19262 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
19263 0 : if (value == NULL) {
19264 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
19265 0 : return -1;
19266 : }
19267 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
19268 0 : if (object->in.resume_handle == NULL) {
19269 0 : PyErr_NoMemory();
19270 0 : return -1;
19271 : }
19272 : {
19273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
19274 0 : if (PyLong_Check(value)) {
19275 0 : unsigned long long test_var;
19276 0 : test_var = PyLong_AsUnsignedLongLong(value);
19277 0 : if (PyErr_Occurred() != NULL) {
19278 0 : return -1;
19279 : }
19280 0 : if (test_var > uint_max) {
19281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19282 : PyLong_Type.tp_name, uint_max, test_var);
19283 0 : return -1;
19284 : }
19285 0 : *object->in.resume_handle = test_var;
19286 : } else {
19287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19288 : PyLong_Type.tp_name);
19289 0 : return -1;
19290 : }
19291 : }
19292 0 : return 0;
19293 : }
19294 :
19295 0 : static PyObject *py_samr_EnumDomainGroups_out_get_resume_handle(PyObject *obj, void *closure)
19296 : {
19297 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19298 0 : PyObject *py_resume_handle;
19299 0 : if (object->out.resume_handle == NULL) {
19300 0 : Py_RETURN_NONE;
19301 : }
19302 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
19303 0 : return py_resume_handle;
19304 : }
19305 :
19306 0 : static int py_samr_EnumDomainGroups_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
19307 : {
19308 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19309 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
19310 0 : if (value == NULL) {
19311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
19312 0 : return -1;
19313 : }
19314 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
19315 0 : if (object->out.resume_handle == NULL) {
19316 0 : PyErr_NoMemory();
19317 0 : return -1;
19318 : }
19319 : {
19320 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
19321 0 : if (PyLong_Check(value)) {
19322 0 : unsigned long long test_var;
19323 0 : test_var = PyLong_AsUnsignedLongLong(value);
19324 0 : if (PyErr_Occurred() != NULL) {
19325 0 : return -1;
19326 : }
19327 0 : if (test_var > uint_max) {
19328 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19329 : PyLong_Type.tp_name, uint_max, test_var);
19330 0 : return -1;
19331 : }
19332 0 : *object->out.resume_handle = test_var;
19333 : } else {
19334 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19335 : PyLong_Type.tp_name);
19336 0 : return -1;
19337 : }
19338 : }
19339 0 : return 0;
19340 : }
19341 :
19342 0 : static PyObject *py_samr_EnumDomainGroups_out_get_sam(PyObject *obj, void *closure)
19343 : {
19344 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19345 0 : PyObject *py_sam;
19346 0 : if (object->out.sam == NULL) {
19347 0 : Py_RETURN_NONE;
19348 : }
19349 0 : if (*object->out.sam == NULL) {
19350 0 : py_sam = Py_None;
19351 0 : Py_INCREF(py_sam);
19352 : } else {
19353 0 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam);
19354 : }
19355 0 : return py_sam;
19356 : }
19357 :
19358 0 : static int py_samr_EnumDomainGroups_out_set_sam(PyObject *py_obj, PyObject *value, void *closure)
19359 : {
19360 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19361 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam));
19362 0 : if (value == NULL) {
19363 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam");
19364 0 : return -1;
19365 : }
19366 0 : object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam);
19367 0 : if (object->out.sam == NULL) {
19368 0 : PyErr_NoMemory();
19369 0 : return -1;
19370 : }
19371 0 : if (value == Py_None) {
19372 0 : *object->out.sam = NULL;
19373 : } else {
19374 0 : *object->out.sam = NULL;
19375 0 : PY_CHECK_TYPE(&samr_SamArray_Type, value, return -1;);
19376 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19377 0 : PyErr_NoMemory();
19378 0 : return -1;
19379 : }
19380 0 : *object->out.sam = (struct samr_SamArray *)pytalloc_get_ptr(value);
19381 : }
19382 0 : return 0;
19383 : }
19384 :
19385 0 : static PyObject *py_samr_EnumDomainGroups_in_get_max_size(PyObject *obj, void *closure)
19386 : {
19387 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19388 0 : PyObject *py_max_size;
19389 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
19390 0 : return py_max_size;
19391 : }
19392 :
19393 0 : static int py_samr_EnumDomainGroups_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
19394 : {
19395 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19396 0 : if (value == NULL) {
19397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
19398 0 : return -1;
19399 : }
19400 : {
19401 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
19402 0 : if (PyLong_Check(value)) {
19403 0 : unsigned long long test_var;
19404 0 : test_var = PyLong_AsUnsignedLongLong(value);
19405 0 : if (PyErr_Occurred() != NULL) {
19406 0 : return -1;
19407 : }
19408 0 : if (test_var > uint_max) {
19409 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19410 : PyLong_Type.tp_name, uint_max, test_var);
19411 0 : return -1;
19412 : }
19413 0 : object->in.max_size = test_var;
19414 : } else {
19415 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19416 : PyLong_Type.tp_name);
19417 0 : return -1;
19418 : }
19419 : }
19420 0 : return 0;
19421 : }
19422 :
19423 0 : static PyObject *py_samr_EnumDomainGroups_out_get_num_entries(PyObject *obj, void *closure)
19424 : {
19425 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19426 0 : PyObject *py_num_entries;
19427 0 : if (object->out.num_entries == NULL) {
19428 0 : Py_RETURN_NONE;
19429 : }
19430 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries);
19431 0 : return py_num_entries;
19432 : }
19433 :
19434 0 : static int py_samr_EnumDomainGroups_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
19435 : {
19436 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19437 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries));
19438 0 : if (value == NULL) {
19439 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries");
19440 0 : return -1;
19441 : }
19442 0 : object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries);
19443 0 : if (object->out.num_entries == NULL) {
19444 0 : PyErr_NoMemory();
19445 0 : return -1;
19446 : }
19447 : {
19448 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries));
19449 0 : if (PyLong_Check(value)) {
19450 0 : unsigned long long test_var;
19451 0 : test_var = PyLong_AsUnsignedLongLong(value);
19452 0 : if (PyErr_Occurred() != NULL) {
19453 0 : return -1;
19454 : }
19455 0 : if (test_var > uint_max) {
19456 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19457 : PyLong_Type.tp_name, uint_max, test_var);
19458 0 : return -1;
19459 : }
19460 0 : *object->out.num_entries = test_var;
19461 : } else {
19462 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19463 : PyLong_Type.tp_name);
19464 0 : return -1;
19465 : }
19466 : }
19467 0 : return 0;
19468 : }
19469 :
19470 0 : static PyObject *py_samr_EnumDomainGroups_get_result(PyObject *obj, void *closure)
19471 : {
19472 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(obj);
19473 0 : PyObject *py_result;
19474 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
19475 0 : return py_result;
19476 : }
19477 :
19478 0 : static int py_samr_EnumDomainGroups_set_result(PyObject *py_obj, PyObject *value, void *closure)
19479 : {
19480 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19481 0 : if (value == NULL) {
19482 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
19483 0 : return -1;
19484 : }
19485 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
19486 0 : return 0;
19487 : }
19488 :
19489 : static PyGetSetDef py_samr_EnumDomainGroups_getsetters[] = {
19490 : {
19491 : .name = discard_const_p(char, "in_domain_handle"),
19492 : .get = py_samr_EnumDomainGroups_in_get_domain_handle,
19493 : .set = py_samr_EnumDomainGroups_in_set_domain_handle,
19494 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
19495 : },
19496 : {
19497 : .name = discard_const_p(char, "in_resume_handle"),
19498 : .get = py_samr_EnumDomainGroups_in_get_resume_handle,
19499 : .set = py_samr_EnumDomainGroups_in_set_resume_handle,
19500 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19501 : },
19502 : {
19503 : .name = discard_const_p(char, "out_resume_handle"),
19504 : .get = py_samr_EnumDomainGroups_out_get_resume_handle,
19505 : .set = py_samr_EnumDomainGroups_out_set_resume_handle,
19506 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19507 : },
19508 : {
19509 : .name = discard_const_p(char, "out_sam"),
19510 : .get = py_samr_EnumDomainGroups_out_get_sam,
19511 : .set = py_samr_EnumDomainGroups_out_set_sam,
19512 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray")
19513 : },
19514 : {
19515 : .name = discard_const_p(char, "in_max_size"),
19516 : .get = py_samr_EnumDomainGroups_in_get_max_size,
19517 : .set = py_samr_EnumDomainGroups_in_set_max_size,
19518 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19519 : },
19520 : {
19521 : .name = discard_const_p(char, "out_num_entries"),
19522 : .get = py_samr_EnumDomainGroups_out_get_num_entries,
19523 : .set = py_samr_EnumDomainGroups_out_set_num_entries,
19524 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
19525 : },
19526 : {
19527 : .name = discard_const_p(char, "result"),
19528 : .get = py_samr_EnumDomainGroups_get_result,
19529 : .set = py_samr_EnumDomainGroups_set_result,
19530 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
19531 : },
19532 : { .name = NULL }
19533 : };
19534 :
19535 0 : static PyObject *py_samr_EnumDomainGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
19536 : {
19537 0 : PyObject *self = pytalloc_new(struct samr_EnumDomainGroups, type);
19538 0 : struct samr_EnumDomainGroups *_self = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(self);
19539 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
19540 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
19541 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
19542 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
19543 : /* a pointer to a NULL pointer */
19544 0 : _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
19545 0 : _self->out.num_entries = talloc_zero(mem_ctx, uint32_t);
19546 0 : return self;
19547 : }
19548 :
19549 0 : static PyObject *py_samr_EnumDomainGroups_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
19550 : {
19551 :
19552 :
19553 0 : return PyLong_FromLong(11);
19554 : }
19555 :
19556 0 : static PyObject *py_samr_EnumDomainGroups_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
19557 : {
19558 0 : const struct ndr_interface_call *call = NULL;
19559 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19560 0 : PyObject *ret = NULL;
19561 0 : struct ndr_push *push = NULL;
19562 0 : DATA_BLOB blob;
19563 0 : enum ndr_err_code err;
19564 :
19565 0 : if (ndr_table_samr.num_calls < 12) {
19566 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_pack");
19567 0 : return NULL;
19568 : }
19569 0 : call = &ndr_table_samr.calls[11];
19570 :
19571 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
19572 0 : if (push == NULL) {
19573 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19574 0 : return NULL;
19575 : }
19576 :
19577 0 : push->flags |= ndr_push_flags;
19578 :
19579 0 : err = call->ndr_push(push, ndr_inout_flags, object);
19580 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19581 0 : TALLOC_FREE(push);
19582 0 : PyErr_SetNdrError(err);
19583 0 : return NULL;
19584 : }
19585 0 : blob = ndr_push_blob(push);
19586 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
19587 0 : TALLOC_FREE(push);
19588 0 : return ret;
19589 : }
19590 :
19591 0 : static PyObject *py_samr_EnumDomainGroups_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19592 : {
19593 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19594 0 : PyObject *bigendian_obj = NULL;
19595 0 : PyObject *ndr64_obj = NULL;
19596 0 : libndr_flags ndr_push_flags = 0;
19597 :
19598 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
19599 : discard_const_p(char *, kwnames),
19600 : &bigendian_obj,
19601 : &ndr64_obj)) {
19602 0 : return NULL;
19603 : }
19604 :
19605 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19606 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19607 : }
19608 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19609 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19610 : }
19611 :
19612 0 : return py_samr_EnumDomainGroups_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
19613 : }
19614 :
19615 0 : static PyObject *py_samr_EnumDomainGroups_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19616 : {
19617 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
19618 0 : PyObject *bigendian_obj = NULL;
19619 0 : PyObject *ndr64_obj = NULL;
19620 0 : libndr_flags ndr_push_flags = 0;
19621 :
19622 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
19623 : discard_const_p(char *, kwnames),
19624 : &bigendian_obj,
19625 : &ndr64_obj)) {
19626 0 : return NULL;
19627 : }
19628 :
19629 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19630 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
19631 : }
19632 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19633 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
19634 : }
19635 :
19636 0 : return py_samr_EnumDomainGroups_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
19637 : }
19638 :
19639 0 : static PyObject *py_samr_EnumDomainGroups_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
19640 : {
19641 0 : const struct ndr_interface_call *call = NULL;
19642 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19643 0 : struct ndr_pull *pull = NULL;
19644 0 : enum ndr_err_code err;
19645 :
19646 0 : if (ndr_table_samr.num_calls < 12) {
19647 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_unpack");
19648 0 : return NULL;
19649 : }
19650 0 : call = &ndr_table_samr.calls[11];
19651 :
19652 0 : pull = ndr_pull_init_blob(blob, object);
19653 0 : if (pull == NULL) {
19654 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
19655 0 : return NULL;
19656 : }
19657 :
19658 0 : pull->flags |= ndr_pull_flags;
19659 :
19660 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
19661 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
19662 0 : TALLOC_FREE(pull);
19663 0 : PyErr_SetNdrError(err);
19664 0 : return NULL;
19665 : }
19666 0 : if (!allow_remaining) {
19667 0 : uint32_t highest_ofs;
19668 :
19669 0 : if (pull->offset > pull->relative_highest_offset) {
19670 0 : highest_ofs = pull->offset;
19671 : } else {
19672 0 : highest_ofs = pull->relative_highest_offset;
19673 : }
19674 0 : if (highest_ofs < pull->data_size) {
19675 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
19676 : "not all bytes consumed ofs[%u] size[%u]",
19677 : highest_ofs, pull->data_size);
19678 0 : TALLOC_FREE(pull);
19679 0 : PyErr_SetNdrError(err);
19680 0 : return NULL;
19681 : }
19682 : }
19683 :
19684 0 : TALLOC_FREE(pull);
19685 0 : Py_RETURN_NONE;
19686 : }
19687 :
19688 0 : static PyObject *py_samr_EnumDomainGroups_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19689 : {
19690 0 : DATA_BLOB blob;
19691 0 : Py_ssize_t blob_length = 0;
19692 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19693 0 : PyObject *bigendian_obj = NULL;
19694 0 : PyObject *ndr64_obj = NULL;
19695 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19696 0 : PyObject *allow_remaining_obj = NULL;
19697 0 : bool allow_remaining = false;
19698 :
19699 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
19700 : discard_const_p(char *, kwnames),
19701 : &blob.data, &blob_length,
19702 : &bigendian_obj,
19703 : &ndr64_obj,
19704 : &allow_remaining_obj)) {
19705 0 : return NULL;
19706 : }
19707 0 : blob.length = blob_length;
19708 :
19709 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19710 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19711 : }
19712 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19713 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19714 : }
19715 :
19716 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19717 0 : allow_remaining = true;
19718 : }
19719 :
19720 0 : return py_samr_EnumDomainGroups_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
19721 : }
19722 :
19723 0 : static PyObject *py_samr_EnumDomainGroups_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
19724 : {
19725 0 : DATA_BLOB blob;
19726 0 : Py_ssize_t blob_length = 0;
19727 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
19728 0 : PyObject *bigendian_obj = NULL;
19729 0 : PyObject *ndr64_obj = NULL;
19730 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
19731 0 : PyObject *allow_remaining_obj = NULL;
19732 0 : bool allow_remaining = false;
19733 :
19734 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
19735 : discard_const_p(char *, kwnames),
19736 : &blob.data, &blob_length,
19737 : &bigendian_obj,
19738 : &ndr64_obj,
19739 : &allow_remaining_obj)) {
19740 0 : return NULL;
19741 : }
19742 0 : blob.length = blob_length;
19743 :
19744 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
19745 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
19746 : }
19747 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
19748 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
19749 : }
19750 :
19751 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
19752 0 : allow_remaining = true;
19753 : }
19754 :
19755 0 : return py_samr_EnumDomainGroups_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
19756 : }
19757 :
19758 0 : static PyObject *py_samr_EnumDomainGroups_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
19759 : {
19760 0 : const struct ndr_interface_call *call = NULL;
19761 0 : struct samr_EnumDomainGroups *object = (struct samr_EnumDomainGroups *)pytalloc_get_ptr(py_obj);
19762 0 : PyObject *ret;
19763 0 : char *retstr;
19764 :
19765 0 : if (ndr_table_samr.num_calls < 12) {
19766 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainGroups_ndr_print");
19767 0 : return NULL;
19768 : }
19769 0 : call = &ndr_table_samr.calls[11];
19770 :
19771 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
19772 0 : ret = PyUnicode_FromString(retstr);
19773 0 : TALLOC_FREE(retstr);
19774 :
19775 0 : return ret;
19776 : }
19777 :
19778 0 : static PyObject *py_samr_EnumDomainGroups_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19779 : {
19780 0 : return py_samr_EnumDomainGroups_ndr_print(py_obj, "samr_EnumDomainGroups_in", NDR_IN);
19781 : }
19782 :
19783 0 : static PyObject *py_samr_EnumDomainGroups_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
19784 : {
19785 0 : return py_samr_EnumDomainGroups_ndr_print(py_obj, "samr_EnumDomainGroups_out", NDR_OUT);
19786 : }
19787 :
19788 : static PyMethodDef py_samr_EnumDomainGroups_methods[] = {
19789 : { "opnum", (PyCFunction)py_samr_EnumDomainGroups_ndr_opnum, METH_NOARGS|METH_CLASS,
19790 : "samr.EnumDomainGroups.opnum() -> 11 (0x0b) " },
19791 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainGroups_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
19792 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
19793 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainGroups_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
19794 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
19795 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainGroups_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
19796 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
19797 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainGroups_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
19798 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
19799 : { "__ndr_print_in__", (PyCFunction)py_samr_EnumDomainGroups_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
19800 : { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainGroups_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
19801 : { NULL, NULL, 0, NULL }
19802 : };
19803 :
19804 :
19805 : static PyTypeObject samr_EnumDomainGroups_Type = {
19806 : PyVarObject_HEAD_INIT(NULL, 0)
19807 : .tp_name = "samr.EnumDomainGroups",
19808 : .tp_getset = py_samr_EnumDomainGroups_getsetters,
19809 : .tp_methods = py_samr_EnumDomainGroups_methods,
19810 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
19811 : .tp_new = py_samr_EnumDomainGroups_new,
19812 : };
19813 :
19814 69 : static bool pack_py_samr_EnumDomainGroups_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainGroups *r)
19815 : {
19816 0 : PyObject *py_domain_handle;
19817 0 : PyObject *py_resume_handle;
19818 0 : PyObject *py_max_size;
19819 69 : const char *kwnames[] = {
19820 : "domain_handle", "resume_handle", "max_size", NULL
19821 : };
19822 :
19823 69 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainGroups", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
19824 0 : return false;
19825 : }
19826 :
19827 69 : if (py_domain_handle == NULL) {
19828 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
19829 0 : return false;
19830 : }
19831 69 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
19832 69 : if (r->in.domain_handle == NULL) {
19833 0 : PyErr_NoMemory();
19834 0 : return false;
19835 : }
19836 69 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
19837 69 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
19838 0 : PyErr_NoMemory();
19839 0 : return false;
19840 : }
19841 69 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
19842 69 : if (py_resume_handle == NULL) {
19843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
19844 0 : return false;
19845 : }
19846 69 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
19847 69 : if (r->in.resume_handle == NULL) {
19848 0 : PyErr_NoMemory();
19849 0 : return false;
19850 : }
19851 : {
19852 69 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
19853 69 : if (PyLong_Check(py_resume_handle)) {
19854 0 : unsigned long long test_var;
19855 69 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
19856 69 : if (PyErr_Occurred() != NULL) {
19857 0 : return false;
19858 : }
19859 69 : if (test_var > uint_max) {
19860 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19861 : PyLong_Type.tp_name, uint_max, test_var);
19862 0 : return false;
19863 : }
19864 69 : *r->in.resume_handle = test_var;
19865 : } else {
19866 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19867 : PyLong_Type.tp_name);
19868 0 : return false;
19869 : }
19870 : }
19871 69 : if (py_max_size == NULL) {
19872 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
19873 0 : return false;
19874 : }
19875 : {
19876 69 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
19877 69 : if (PyLong_Check(py_max_size)) {
19878 0 : unsigned long long test_var;
19879 69 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
19880 69 : if (PyErr_Occurred() != NULL) {
19881 0 : return false;
19882 : }
19883 69 : if (test_var > uint_max) {
19884 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
19885 : PyLong_Type.tp_name, uint_max, test_var);
19886 0 : return false;
19887 : }
19888 69 : r->in.max_size = test_var;
19889 : } else {
19890 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
19891 : PyLong_Type.tp_name);
19892 0 : return false;
19893 : }
19894 : }
19895 69 : return true;
19896 : }
19897 :
19898 69 : static PyObject *unpack_py_samr_EnumDomainGroups_args_out(struct samr_EnumDomainGroups *r)
19899 : {
19900 0 : PyObject *result;
19901 0 : PyObject *py_resume_handle;
19902 0 : PyObject *py_sam;
19903 0 : PyObject *py_num_entries;
19904 69 : result = PyTuple_New(3);
19905 69 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
19906 69 : PyTuple_SetItem(result, 0, py_resume_handle);
19907 69 : if (*r->out.sam == NULL) {
19908 0 : py_sam = Py_None;
19909 0 : Py_INCREF(py_sam);
19910 : } else {
19911 69 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
19912 : }
19913 69 : PyTuple_SetItem(result, 1, py_sam);
19914 69 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries);
19915 69 : PyTuple_SetItem(result, 2, py_num_entries);
19916 69 : if (NT_STATUS_IS_ERR(r->out.result)) {
19917 0 : PyErr_SetNTSTATUS(r->out.result);
19918 0 : return NULL;
19919 : }
19920 :
19921 69 : return result;
19922 : }
19923 :
19924 :
19925 0 : static PyObject *py_samr_CreateUser_in_get_domain_handle(PyObject *obj, void *closure)
19926 : {
19927 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
19928 0 : PyObject *py_domain_handle;
19929 0 : if (object->in.domain_handle == NULL) {
19930 0 : Py_RETURN_NONE;
19931 : }
19932 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
19933 0 : return py_domain_handle;
19934 : }
19935 :
19936 0 : static int py_samr_CreateUser_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
19937 : {
19938 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
19939 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
19940 0 : if (value == NULL) {
19941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
19942 0 : return -1;
19943 : }
19944 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
19945 0 : if (object->in.domain_handle == NULL) {
19946 0 : PyErr_NoMemory();
19947 0 : return -1;
19948 : }
19949 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
19950 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19951 0 : PyErr_NoMemory();
19952 0 : return -1;
19953 : }
19954 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
19955 0 : return 0;
19956 : }
19957 :
19958 0 : static PyObject *py_samr_CreateUser_in_get_account_name(PyObject *obj, void *closure)
19959 : {
19960 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
19961 0 : PyObject *py_account_name;
19962 0 : if (object->in.account_name == NULL) {
19963 0 : Py_RETURN_NONE;
19964 : }
19965 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, object->in.account_name, object->in.account_name);
19966 0 : return py_account_name;
19967 : }
19968 :
19969 0 : static int py_samr_CreateUser_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
19970 : {
19971 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
19972 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name));
19973 0 : if (value == NULL) {
19974 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
19975 0 : return -1;
19976 : }
19977 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
19978 0 : if (object->in.account_name == NULL) {
19979 0 : PyErr_NoMemory();
19980 0 : return -1;
19981 : }
19982 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
19983 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
19984 0 : PyErr_NoMemory();
19985 0 : return -1;
19986 : }
19987 0 : object->in.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
19988 0 : return 0;
19989 : }
19990 :
19991 0 : static PyObject *py_samr_CreateUser_in_get_access_mask(PyObject *obj, void *closure)
19992 : {
19993 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
19994 0 : PyObject *py_access_mask;
19995 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
19996 0 : return py_access_mask;
19997 : }
19998 :
19999 0 : static int py_samr_CreateUser_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
20000 : {
20001 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20002 0 : if (value == NULL) {
20003 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
20004 0 : return -1;
20005 : }
20006 : {
20007 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
20008 0 : if (PyLong_Check(value)) {
20009 0 : unsigned long long test_var;
20010 0 : test_var = PyLong_AsUnsignedLongLong(value);
20011 0 : if (PyErr_Occurred() != NULL) {
20012 0 : return -1;
20013 : }
20014 0 : if (test_var > uint_max) {
20015 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20016 : PyLong_Type.tp_name, uint_max, test_var);
20017 0 : return -1;
20018 : }
20019 0 : object->in.access_mask = test_var;
20020 : } else {
20021 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20022 : PyLong_Type.tp_name);
20023 0 : return -1;
20024 : }
20025 : }
20026 0 : return 0;
20027 : }
20028 :
20029 0 : static PyObject *py_samr_CreateUser_out_get_user_handle(PyObject *obj, void *closure)
20030 : {
20031 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
20032 0 : PyObject *py_user_handle;
20033 0 : if (object->out.user_handle == NULL) {
20034 0 : Py_RETURN_NONE;
20035 : }
20036 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle);
20037 0 : return py_user_handle;
20038 : }
20039 :
20040 0 : static int py_samr_CreateUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
20041 : {
20042 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20043 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle));
20044 0 : if (value == NULL) {
20045 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle");
20046 0 : return -1;
20047 : }
20048 0 : object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle);
20049 0 : if (object->out.user_handle == NULL) {
20050 0 : PyErr_NoMemory();
20051 0 : return -1;
20052 : }
20053 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20054 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20055 0 : PyErr_NoMemory();
20056 0 : return -1;
20057 : }
20058 0 : object->out.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20059 0 : return 0;
20060 : }
20061 :
20062 0 : static PyObject *py_samr_CreateUser_out_get_rid(PyObject *obj, void *closure)
20063 : {
20064 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
20065 0 : PyObject *py_rid;
20066 0 : if (object->out.rid == NULL) {
20067 0 : Py_RETURN_NONE;
20068 : }
20069 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
20070 0 : return py_rid;
20071 : }
20072 :
20073 0 : static int py_samr_CreateUser_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
20074 : {
20075 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20076 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
20077 0 : if (value == NULL) {
20078 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
20079 0 : return -1;
20080 : }
20081 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
20082 0 : if (object->out.rid == NULL) {
20083 0 : PyErr_NoMemory();
20084 0 : return -1;
20085 : }
20086 : {
20087 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
20088 0 : if (PyLong_Check(value)) {
20089 0 : unsigned long long test_var;
20090 0 : test_var = PyLong_AsUnsignedLongLong(value);
20091 0 : if (PyErr_Occurred() != NULL) {
20092 0 : return -1;
20093 : }
20094 0 : if (test_var > uint_max) {
20095 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20096 : PyLong_Type.tp_name, uint_max, test_var);
20097 0 : return -1;
20098 : }
20099 0 : *object->out.rid = test_var;
20100 : } else {
20101 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20102 : PyLong_Type.tp_name);
20103 0 : return -1;
20104 : }
20105 : }
20106 0 : return 0;
20107 : }
20108 :
20109 0 : static PyObject *py_samr_CreateUser_get_result(PyObject *obj, void *closure)
20110 : {
20111 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(obj);
20112 0 : PyObject *py_result;
20113 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20114 0 : return py_result;
20115 : }
20116 :
20117 0 : static int py_samr_CreateUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
20118 : {
20119 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20120 0 : if (value == NULL) {
20121 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20122 0 : return -1;
20123 : }
20124 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20125 0 : return 0;
20126 : }
20127 :
20128 : static PyGetSetDef py_samr_CreateUser_getsetters[] = {
20129 : {
20130 : .name = discard_const_p(char, "in_domain_handle"),
20131 : .get = py_samr_CreateUser_in_get_domain_handle,
20132 : .set = py_samr_CreateUser_in_set_domain_handle,
20133 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20134 : },
20135 : {
20136 : .name = discard_const_p(char, "in_account_name"),
20137 : .get = py_samr_CreateUser_in_get_account_name,
20138 : .set = py_samr_CreateUser_in_set_account_name,
20139 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
20140 : },
20141 : {
20142 : .name = discard_const_p(char, "in_access_mask"),
20143 : .get = py_samr_CreateUser_in_get_access_mask,
20144 : .set = py_samr_CreateUser_in_set_access_mask,
20145 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask")
20146 : },
20147 : {
20148 : .name = discard_const_p(char, "out_user_handle"),
20149 : .get = py_samr_CreateUser_out_get_user_handle,
20150 : .set = py_samr_CreateUser_out_set_user_handle,
20151 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20152 : },
20153 : {
20154 : .name = discard_const_p(char, "out_rid"),
20155 : .get = py_samr_CreateUser_out_get_rid,
20156 : .set = py_samr_CreateUser_out_set_rid,
20157 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20158 : },
20159 : {
20160 : .name = discard_const_p(char, "result"),
20161 : .get = py_samr_CreateUser_get_result,
20162 : .set = py_samr_CreateUser_set_result,
20163 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20164 : },
20165 : { .name = NULL }
20166 : };
20167 :
20168 0 : static PyObject *py_samr_CreateUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20169 : {
20170 0 : PyObject *self = pytalloc_new(struct samr_CreateUser, type);
20171 0 : struct samr_CreateUser *_self = (struct samr_CreateUser *)pytalloc_get_ptr(self);
20172 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20173 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
20174 0 : _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String);
20175 0 : _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
20176 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
20177 0 : return self;
20178 : }
20179 :
20180 0 : static PyObject *py_samr_CreateUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20181 : {
20182 :
20183 :
20184 0 : return PyLong_FromLong(12);
20185 : }
20186 :
20187 0 : static PyObject *py_samr_CreateUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20188 : {
20189 0 : const struct ndr_interface_call *call = NULL;
20190 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20191 0 : PyObject *ret = NULL;
20192 0 : struct ndr_push *push = NULL;
20193 0 : DATA_BLOB blob;
20194 0 : enum ndr_err_code err;
20195 :
20196 0 : if (ndr_table_samr.num_calls < 13) {
20197 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_pack");
20198 0 : return NULL;
20199 : }
20200 0 : call = &ndr_table_samr.calls[12];
20201 :
20202 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20203 0 : if (push == NULL) {
20204 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20205 0 : return NULL;
20206 : }
20207 :
20208 0 : push->flags |= ndr_push_flags;
20209 :
20210 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20211 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20212 0 : TALLOC_FREE(push);
20213 0 : PyErr_SetNdrError(err);
20214 0 : return NULL;
20215 : }
20216 0 : blob = ndr_push_blob(push);
20217 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20218 0 : TALLOC_FREE(push);
20219 0 : return ret;
20220 : }
20221 :
20222 0 : static PyObject *py_samr_CreateUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20223 : {
20224 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20225 0 : PyObject *bigendian_obj = NULL;
20226 0 : PyObject *ndr64_obj = NULL;
20227 0 : libndr_flags ndr_push_flags = 0;
20228 :
20229 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20230 : discard_const_p(char *, kwnames),
20231 : &bigendian_obj,
20232 : &ndr64_obj)) {
20233 0 : return NULL;
20234 : }
20235 :
20236 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20237 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20238 : }
20239 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20240 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20241 : }
20242 :
20243 0 : return py_samr_CreateUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20244 : }
20245 :
20246 0 : static PyObject *py_samr_CreateUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20247 : {
20248 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20249 0 : PyObject *bigendian_obj = NULL;
20250 0 : PyObject *ndr64_obj = NULL;
20251 0 : libndr_flags ndr_push_flags = 0;
20252 :
20253 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20254 : discard_const_p(char *, kwnames),
20255 : &bigendian_obj,
20256 : &ndr64_obj)) {
20257 0 : return NULL;
20258 : }
20259 :
20260 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20261 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20262 : }
20263 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20264 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20265 : }
20266 :
20267 0 : return py_samr_CreateUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
20268 : }
20269 :
20270 0 : static PyObject *py_samr_CreateUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
20271 : {
20272 0 : const struct ndr_interface_call *call = NULL;
20273 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20274 0 : struct ndr_pull *pull = NULL;
20275 0 : enum ndr_err_code err;
20276 :
20277 0 : if (ndr_table_samr.num_calls < 13) {
20278 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_unpack");
20279 0 : return NULL;
20280 : }
20281 0 : call = &ndr_table_samr.calls[12];
20282 :
20283 0 : pull = ndr_pull_init_blob(blob, object);
20284 0 : if (pull == NULL) {
20285 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20286 0 : return NULL;
20287 : }
20288 :
20289 0 : pull->flags |= ndr_pull_flags;
20290 :
20291 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
20292 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20293 0 : TALLOC_FREE(pull);
20294 0 : PyErr_SetNdrError(err);
20295 0 : return NULL;
20296 : }
20297 0 : if (!allow_remaining) {
20298 0 : uint32_t highest_ofs;
20299 :
20300 0 : if (pull->offset > pull->relative_highest_offset) {
20301 0 : highest_ofs = pull->offset;
20302 : } else {
20303 0 : highest_ofs = pull->relative_highest_offset;
20304 : }
20305 0 : if (highest_ofs < pull->data_size) {
20306 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
20307 : "not all bytes consumed ofs[%u] size[%u]",
20308 : highest_ofs, pull->data_size);
20309 0 : TALLOC_FREE(pull);
20310 0 : PyErr_SetNdrError(err);
20311 0 : return NULL;
20312 : }
20313 : }
20314 :
20315 0 : TALLOC_FREE(pull);
20316 0 : Py_RETURN_NONE;
20317 : }
20318 :
20319 0 : static PyObject *py_samr_CreateUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20320 : {
20321 0 : DATA_BLOB blob;
20322 0 : Py_ssize_t blob_length = 0;
20323 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20324 0 : PyObject *bigendian_obj = NULL;
20325 0 : PyObject *ndr64_obj = NULL;
20326 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20327 0 : PyObject *allow_remaining_obj = NULL;
20328 0 : bool allow_remaining = false;
20329 :
20330 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
20331 : discard_const_p(char *, kwnames),
20332 : &blob.data, &blob_length,
20333 : &bigendian_obj,
20334 : &ndr64_obj,
20335 : &allow_remaining_obj)) {
20336 0 : return NULL;
20337 : }
20338 0 : blob.length = blob_length;
20339 :
20340 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20341 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20342 : }
20343 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20344 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20345 : }
20346 :
20347 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20348 0 : allow_remaining = true;
20349 : }
20350 :
20351 0 : return py_samr_CreateUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
20352 : }
20353 :
20354 0 : static PyObject *py_samr_CreateUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20355 : {
20356 0 : DATA_BLOB blob;
20357 0 : Py_ssize_t blob_length = 0;
20358 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
20359 0 : PyObject *bigendian_obj = NULL;
20360 0 : PyObject *ndr64_obj = NULL;
20361 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
20362 0 : PyObject *allow_remaining_obj = NULL;
20363 0 : bool allow_remaining = false;
20364 :
20365 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
20366 : discard_const_p(char *, kwnames),
20367 : &blob.data, &blob_length,
20368 : &bigendian_obj,
20369 : &ndr64_obj,
20370 : &allow_remaining_obj)) {
20371 0 : return NULL;
20372 : }
20373 0 : blob.length = blob_length;
20374 :
20375 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20376 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
20377 : }
20378 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20379 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
20380 : }
20381 :
20382 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
20383 0 : allow_remaining = true;
20384 : }
20385 :
20386 0 : return py_samr_CreateUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
20387 : }
20388 :
20389 0 : static PyObject *py_samr_CreateUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
20390 : {
20391 0 : const struct ndr_interface_call *call = NULL;
20392 0 : struct samr_CreateUser *object = (struct samr_CreateUser *)pytalloc_get_ptr(py_obj);
20393 0 : PyObject *ret;
20394 0 : char *retstr;
20395 :
20396 0 : if (ndr_table_samr.num_calls < 13) {
20397 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser_ndr_print");
20398 0 : return NULL;
20399 : }
20400 0 : call = &ndr_table_samr.calls[12];
20401 :
20402 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
20403 0 : ret = PyUnicode_FromString(retstr);
20404 0 : TALLOC_FREE(retstr);
20405 :
20406 0 : return ret;
20407 : }
20408 :
20409 0 : static PyObject *py_samr_CreateUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20410 : {
20411 0 : return py_samr_CreateUser_ndr_print(py_obj, "samr_CreateUser_in", NDR_IN);
20412 : }
20413 :
20414 0 : static PyObject *py_samr_CreateUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
20415 : {
20416 0 : return py_samr_CreateUser_ndr_print(py_obj, "samr_CreateUser_out", NDR_OUT);
20417 : }
20418 :
20419 : static PyMethodDef py_samr_CreateUser_methods[] = {
20420 : { "opnum", (PyCFunction)py_samr_CreateUser_ndr_opnum, METH_NOARGS|METH_CLASS,
20421 : "samr.CreateUser.opnum() -> 12 (0x0c) " },
20422 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
20423 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
20424 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
20425 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
20426 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
20427 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
20428 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
20429 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
20430 : { "__ndr_print_in__", (PyCFunction)py_samr_CreateUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
20431 : { "__ndr_print_out__", (PyCFunction)py_samr_CreateUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
20432 : { NULL, NULL, 0, NULL }
20433 : };
20434 :
20435 :
20436 : static PyTypeObject samr_CreateUser_Type = {
20437 : PyVarObject_HEAD_INIT(NULL, 0)
20438 : .tp_name = "samr.CreateUser",
20439 : .tp_getset = py_samr_CreateUser_getsetters,
20440 : .tp_methods = py_samr_CreateUser_methods,
20441 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
20442 : .tp_new = py_samr_CreateUser_new,
20443 : };
20444 :
20445 0 : static bool pack_py_samr_CreateUser_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser *r)
20446 : {
20447 0 : PyObject *py_domain_handle;
20448 0 : PyObject *py_account_name;
20449 0 : PyObject *py_access_mask;
20450 0 : const char *kwnames[] = {
20451 : "domain_handle", "account_name", "access_mask", NULL
20452 : };
20453 :
20454 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_access_mask)) {
20455 0 : return false;
20456 : }
20457 :
20458 0 : if (py_domain_handle == NULL) {
20459 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
20460 0 : return false;
20461 : }
20462 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
20463 0 : if (r->in.domain_handle == NULL) {
20464 0 : PyErr_NoMemory();
20465 0 : return false;
20466 : }
20467 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
20468 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
20469 0 : PyErr_NoMemory();
20470 0 : return false;
20471 : }
20472 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
20473 0 : if (py_account_name == NULL) {
20474 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
20475 0 : return false;
20476 : }
20477 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
20478 0 : if (r->in.account_name == NULL) {
20479 0 : PyErr_NoMemory();
20480 0 : return false;
20481 : }
20482 0 : PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;);
20483 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
20484 0 : PyErr_NoMemory();
20485 0 : return false;
20486 : }
20487 0 : r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
20488 0 : if (py_access_mask == NULL) {
20489 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
20490 0 : return false;
20491 : }
20492 : {
20493 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
20494 0 : if (PyLong_Check(py_access_mask)) {
20495 0 : unsigned long long test_var;
20496 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
20497 0 : if (PyErr_Occurred() != NULL) {
20498 0 : return false;
20499 : }
20500 0 : if (test_var > uint_max) {
20501 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20502 : PyLong_Type.tp_name, uint_max, test_var);
20503 0 : return false;
20504 : }
20505 0 : r->in.access_mask = test_var;
20506 : } else {
20507 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20508 : PyLong_Type.tp_name);
20509 0 : return false;
20510 : }
20511 : }
20512 0 : return true;
20513 : }
20514 :
20515 0 : static PyObject *unpack_py_samr_CreateUser_args_out(struct samr_CreateUser *r)
20516 : {
20517 0 : PyObject *result;
20518 0 : PyObject *py_user_handle;
20519 0 : PyObject *py_rid;
20520 0 : result = PyTuple_New(2);
20521 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
20522 0 : PyTuple_SetItem(result, 0, py_user_handle);
20523 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
20524 0 : PyTuple_SetItem(result, 1, py_rid);
20525 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
20526 0 : PyErr_SetNTSTATUS(r->out.result);
20527 0 : return NULL;
20528 : }
20529 :
20530 0 : return result;
20531 : }
20532 :
20533 :
20534 0 : static PyObject *py_samr_EnumDomainUsers_in_get_domain_handle(PyObject *obj, void *closure)
20535 : {
20536 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20537 0 : PyObject *py_domain_handle;
20538 0 : if (object->in.domain_handle == NULL) {
20539 0 : Py_RETURN_NONE;
20540 : }
20541 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
20542 0 : return py_domain_handle;
20543 : }
20544 :
20545 0 : static int py_samr_EnumDomainUsers_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
20546 : {
20547 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20548 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
20549 0 : if (value == NULL) {
20550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
20551 0 : return -1;
20552 : }
20553 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
20554 0 : if (object->in.domain_handle == NULL) {
20555 0 : PyErr_NoMemory();
20556 0 : return -1;
20557 : }
20558 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
20559 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20560 0 : PyErr_NoMemory();
20561 0 : return -1;
20562 : }
20563 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
20564 0 : return 0;
20565 : }
20566 :
20567 0 : static PyObject *py_samr_EnumDomainUsers_in_get_resume_handle(PyObject *obj, void *closure)
20568 : {
20569 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20570 0 : PyObject *py_resume_handle;
20571 0 : if (object->in.resume_handle == NULL) {
20572 0 : Py_RETURN_NONE;
20573 : }
20574 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
20575 0 : return py_resume_handle;
20576 : }
20577 :
20578 0 : static int py_samr_EnumDomainUsers_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
20579 : {
20580 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20581 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
20582 0 : if (value == NULL) {
20583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
20584 0 : return -1;
20585 : }
20586 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
20587 0 : if (object->in.resume_handle == NULL) {
20588 0 : PyErr_NoMemory();
20589 0 : return -1;
20590 : }
20591 : {
20592 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
20593 0 : if (PyLong_Check(value)) {
20594 0 : unsigned long long test_var;
20595 0 : test_var = PyLong_AsUnsignedLongLong(value);
20596 0 : if (PyErr_Occurred() != NULL) {
20597 0 : return -1;
20598 : }
20599 0 : if (test_var > uint_max) {
20600 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20601 : PyLong_Type.tp_name, uint_max, test_var);
20602 0 : return -1;
20603 : }
20604 0 : *object->in.resume_handle = test_var;
20605 : } else {
20606 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20607 : PyLong_Type.tp_name);
20608 0 : return -1;
20609 : }
20610 : }
20611 0 : return 0;
20612 : }
20613 :
20614 0 : static PyObject *py_samr_EnumDomainUsers_out_get_resume_handle(PyObject *obj, void *closure)
20615 : {
20616 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20617 0 : PyObject *py_resume_handle;
20618 0 : if (object->out.resume_handle == NULL) {
20619 0 : Py_RETURN_NONE;
20620 : }
20621 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
20622 0 : return py_resume_handle;
20623 : }
20624 :
20625 0 : static int py_samr_EnumDomainUsers_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
20626 : {
20627 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20628 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
20629 0 : if (value == NULL) {
20630 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
20631 0 : return -1;
20632 : }
20633 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
20634 0 : if (object->out.resume_handle == NULL) {
20635 0 : PyErr_NoMemory();
20636 0 : return -1;
20637 : }
20638 : {
20639 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
20640 0 : if (PyLong_Check(value)) {
20641 0 : unsigned long long test_var;
20642 0 : test_var = PyLong_AsUnsignedLongLong(value);
20643 0 : if (PyErr_Occurred() != NULL) {
20644 0 : return -1;
20645 : }
20646 0 : if (test_var > uint_max) {
20647 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20648 : PyLong_Type.tp_name, uint_max, test_var);
20649 0 : return -1;
20650 : }
20651 0 : *object->out.resume_handle = test_var;
20652 : } else {
20653 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20654 : PyLong_Type.tp_name);
20655 0 : return -1;
20656 : }
20657 : }
20658 0 : return 0;
20659 : }
20660 :
20661 0 : static PyObject *py_samr_EnumDomainUsers_in_get_acct_flags(PyObject *obj, void *closure)
20662 : {
20663 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20664 0 : PyObject *py_acct_flags;
20665 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.acct_flags);
20666 0 : return py_acct_flags;
20667 : }
20668 :
20669 0 : static int py_samr_EnumDomainUsers_in_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
20670 : {
20671 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20672 0 : if (value == NULL) {
20673 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.acct_flags");
20674 0 : return -1;
20675 : }
20676 : {
20677 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.acct_flags));
20678 0 : if (PyLong_Check(value)) {
20679 0 : unsigned long long test_var;
20680 0 : test_var = PyLong_AsUnsignedLongLong(value);
20681 0 : if (PyErr_Occurred() != NULL) {
20682 0 : return -1;
20683 : }
20684 0 : if (test_var > uint_max) {
20685 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20686 : PyLong_Type.tp_name, uint_max, test_var);
20687 0 : return -1;
20688 : }
20689 0 : object->in.acct_flags = test_var;
20690 : } else {
20691 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20692 : PyLong_Type.tp_name);
20693 0 : return -1;
20694 : }
20695 : }
20696 0 : return 0;
20697 : }
20698 :
20699 0 : static PyObject *py_samr_EnumDomainUsers_out_get_sam(PyObject *obj, void *closure)
20700 : {
20701 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20702 0 : PyObject *py_sam;
20703 0 : if (object->out.sam == NULL) {
20704 0 : Py_RETURN_NONE;
20705 : }
20706 0 : if (*object->out.sam == NULL) {
20707 0 : py_sam = Py_None;
20708 0 : Py_INCREF(py_sam);
20709 : } else {
20710 0 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam);
20711 : }
20712 0 : return py_sam;
20713 : }
20714 :
20715 0 : static int py_samr_EnumDomainUsers_out_set_sam(PyObject *py_obj, PyObject *value, void *closure)
20716 : {
20717 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20718 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam));
20719 0 : if (value == NULL) {
20720 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam");
20721 0 : return -1;
20722 : }
20723 0 : object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam);
20724 0 : if (object->out.sam == NULL) {
20725 0 : PyErr_NoMemory();
20726 0 : return -1;
20727 : }
20728 0 : if (value == Py_None) {
20729 0 : *object->out.sam = NULL;
20730 : } else {
20731 0 : *object->out.sam = NULL;
20732 0 : PY_CHECK_TYPE(&samr_SamArray_Type, value, return -1;);
20733 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
20734 0 : PyErr_NoMemory();
20735 0 : return -1;
20736 : }
20737 0 : *object->out.sam = (struct samr_SamArray *)pytalloc_get_ptr(value);
20738 : }
20739 0 : return 0;
20740 : }
20741 :
20742 0 : static PyObject *py_samr_EnumDomainUsers_in_get_max_size(PyObject *obj, void *closure)
20743 : {
20744 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20745 0 : PyObject *py_max_size;
20746 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
20747 0 : return py_max_size;
20748 : }
20749 :
20750 0 : static int py_samr_EnumDomainUsers_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
20751 : {
20752 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20753 0 : if (value == NULL) {
20754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
20755 0 : return -1;
20756 : }
20757 : {
20758 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
20759 0 : if (PyLong_Check(value)) {
20760 0 : unsigned long long test_var;
20761 0 : test_var = PyLong_AsUnsignedLongLong(value);
20762 0 : if (PyErr_Occurred() != NULL) {
20763 0 : return -1;
20764 : }
20765 0 : if (test_var > uint_max) {
20766 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20767 : PyLong_Type.tp_name, uint_max, test_var);
20768 0 : return -1;
20769 : }
20770 0 : object->in.max_size = test_var;
20771 : } else {
20772 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20773 : PyLong_Type.tp_name);
20774 0 : return -1;
20775 : }
20776 : }
20777 0 : return 0;
20778 : }
20779 :
20780 0 : static PyObject *py_samr_EnumDomainUsers_out_get_num_entries(PyObject *obj, void *closure)
20781 : {
20782 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20783 0 : PyObject *py_num_entries;
20784 0 : if (object->out.num_entries == NULL) {
20785 0 : Py_RETURN_NONE;
20786 : }
20787 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries);
20788 0 : return py_num_entries;
20789 : }
20790 :
20791 0 : static int py_samr_EnumDomainUsers_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
20792 : {
20793 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20794 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries));
20795 0 : if (value == NULL) {
20796 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries");
20797 0 : return -1;
20798 : }
20799 0 : object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries);
20800 0 : if (object->out.num_entries == NULL) {
20801 0 : PyErr_NoMemory();
20802 0 : return -1;
20803 : }
20804 : {
20805 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries));
20806 0 : if (PyLong_Check(value)) {
20807 0 : unsigned long long test_var;
20808 0 : test_var = PyLong_AsUnsignedLongLong(value);
20809 0 : if (PyErr_Occurred() != NULL) {
20810 0 : return -1;
20811 : }
20812 0 : if (test_var > uint_max) {
20813 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
20814 : PyLong_Type.tp_name, uint_max, test_var);
20815 0 : return -1;
20816 : }
20817 0 : *object->out.num_entries = test_var;
20818 : } else {
20819 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
20820 : PyLong_Type.tp_name);
20821 0 : return -1;
20822 : }
20823 : }
20824 0 : return 0;
20825 : }
20826 :
20827 0 : static PyObject *py_samr_EnumDomainUsers_get_result(PyObject *obj, void *closure)
20828 : {
20829 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(obj);
20830 0 : PyObject *py_result;
20831 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
20832 0 : return py_result;
20833 : }
20834 :
20835 0 : static int py_samr_EnumDomainUsers_set_result(PyObject *py_obj, PyObject *value, void *closure)
20836 : {
20837 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20838 0 : if (value == NULL) {
20839 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
20840 0 : return -1;
20841 : }
20842 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
20843 0 : return 0;
20844 : }
20845 :
20846 : static PyGetSetDef py_samr_EnumDomainUsers_getsetters[] = {
20847 : {
20848 : .name = discard_const_p(char, "in_domain_handle"),
20849 : .get = py_samr_EnumDomainUsers_in_get_domain_handle,
20850 : .set = py_samr_EnumDomainUsers_in_set_domain_handle,
20851 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
20852 : },
20853 : {
20854 : .name = discard_const_p(char, "in_resume_handle"),
20855 : .get = py_samr_EnumDomainUsers_in_get_resume_handle,
20856 : .set = py_samr_EnumDomainUsers_in_set_resume_handle,
20857 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20858 : },
20859 : {
20860 : .name = discard_const_p(char, "out_resume_handle"),
20861 : .get = py_samr_EnumDomainUsers_out_get_resume_handle,
20862 : .set = py_samr_EnumDomainUsers_out_set_resume_handle,
20863 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20864 : },
20865 : {
20866 : .name = discard_const_p(char, "in_acct_flags"),
20867 : .get = py_samr_EnumDomainUsers_in_get_acct_flags,
20868 : .set = py_samr_EnumDomainUsers_in_set_acct_flags,
20869 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
20870 : },
20871 : {
20872 : .name = discard_const_p(char, "out_sam"),
20873 : .get = py_samr_EnumDomainUsers_out_get_sam,
20874 : .set = py_samr_EnumDomainUsers_out_set_sam,
20875 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray")
20876 : },
20877 : {
20878 : .name = discard_const_p(char, "in_max_size"),
20879 : .get = py_samr_EnumDomainUsers_in_get_max_size,
20880 : .set = py_samr_EnumDomainUsers_in_set_max_size,
20881 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20882 : },
20883 : {
20884 : .name = discard_const_p(char, "out_num_entries"),
20885 : .get = py_samr_EnumDomainUsers_out_get_num_entries,
20886 : .set = py_samr_EnumDomainUsers_out_set_num_entries,
20887 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
20888 : },
20889 : {
20890 : .name = discard_const_p(char, "result"),
20891 : .get = py_samr_EnumDomainUsers_get_result,
20892 : .set = py_samr_EnumDomainUsers_set_result,
20893 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
20894 : },
20895 : { .name = NULL }
20896 : };
20897 :
20898 0 : static PyObject *py_samr_EnumDomainUsers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
20899 : {
20900 0 : PyObject *self = pytalloc_new(struct samr_EnumDomainUsers, type);
20901 0 : struct samr_EnumDomainUsers *_self = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(self);
20902 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
20903 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
20904 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
20905 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
20906 : /* a pointer to a NULL pointer */
20907 0 : _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
20908 0 : _self->out.num_entries = talloc_zero(mem_ctx, uint32_t);
20909 0 : return self;
20910 : }
20911 :
20912 0 : static PyObject *py_samr_EnumDomainUsers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
20913 : {
20914 :
20915 :
20916 0 : return PyLong_FromLong(13);
20917 : }
20918 :
20919 0 : static PyObject *py_samr_EnumDomainUsers_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
20920 : {
20921 0 : const struct ndr_interface_call *call = NULL;
20922 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
20923 0 : PyObject *ret = NULL;
20924 0 : struct ndr_push *push = NULL;
20925 0 : DATA_BLOB blob;
20926 0 : enum ndr_err_code err;
20927 :
20928 0 : if (ndr_table_samr.num_calls < 14) {
20929 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_pack");
20930 0 : return NULL;
20931 : }
20932 0 : call = &ndr_table_samr.calls[13];
20933 :
20934 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
20935 0 : if (push == NULL) {
20936 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
20937 0 : return NULL;
20938 : }
20939 :
20940 0 : push->flags |= ndr_push_flags;
20941 :
20942 0 : err = call->ndr_push(push, ndr_inout_flags, object);
20943 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
20944 0 : TALLOC_FREE(push);
20945 0 : PyErr_SetNdrError(err);
20946 0 : return NULL;
20947 : }
20948 0 : blob = ndr_push_blob(push);
20949 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
20950 0 : TALLOC_FREE(push);
20951 0 : return ret;
20952 : }
20953 :
20954 0 : static PyObject *py_samr_EnumDomainUsers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20955 : {
20956 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20957 0 : PyObject *bigendian_obj = NULL;
20958 0 : PyObject *ndr64_obj = NULL;
20959 0 : libndr_flags ndr_push_flags = 0;
20960 :
20961 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
20962 : discard_const_p(char *, kwnames),
20963 : &bigendian_obj,
20964 : &ndr64_obj)) {
20965 0 : return NULL;
20966 : }
20967 :
20968 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20969 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20970 : }
20971 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20972 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20973 : }
20974 :
20975 0 : return py_samr_EnumDomainUsers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
20976 : }
20977 :
20978 0 : static PyObject *py_samr_EnumDomainUsers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
20979 : {
20980 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
20981 0 : PyObject *bigendian_obj = NULL;
20982 0 : PyObject *ndr64_obj = NULL;
20983 0 : libndr_flags ndr_push_flags = 0;
20984 :
20985 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
20986 : discard_const_p(char *, kwnames),
20987 : &bigendian_obj,
20988 : &ndr64_obj)) {
20989 0 : return NULL;
20990 : }
20991 :
20992 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
20993 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
20994 : }
20995 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
20996 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
20997 : }
20998 :
20999 0 : return py_samr_EnumDomainUsers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21000 : }
21001 :
21002 0 : static PyObject *py_samr_EnumDomainUsers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21003 : {
21004 0 : const struct ndr_interface_call *call = NULL;
21005 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
21006 0 : struct ndr_pull *pull = NULL;
21007 0 : enum ndr_err_code err;
21008 :
21009 0 : if (ndr_table_samr.num_calls < 14) {
21010 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_unpack");
21011 0 : return NULL;
21012 : }
21013 0 : call = &ndr_table_samr.calls[13];
21014 :
21015 0 : pull = ndr_pull_init_blob(blob, object);
21016 0 : if (pull == NULL) {
21017 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21018 0 : return NULL;
21019 : }
21020 :
21021 0 : pull->flags |= ndr_pull_flags;
21022 :
21023 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21024 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21025 0 : TALLOC_FREE(pull);
21026 0 : PyErr_SetNdrError(err);
21027 0 : return NULL;
21028 : }
21029 0 : if (!allow_remaining) {
21030 0 : uint32_t highest_ofs;
21031 :
21032 0 : if (pull->offset > pull->relative_highest_offset) {
21033 0 : highest_ofs = pull->offset;
21034 : } else {
21035 0 : highest_ofs = pull->relative_highest_offset;
21036 : }
21037 0 : if (highest_ofs < pull->data_size) {
21038 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21039 : "not all bytes consumed ofs[%u] size[%u]",
21040 : highest_ofs, pull->data_size);
21041 0 : TALLOC_FREE(pull);
21042 0 : PyErr_SetNdrError(err);
21043 0 : return NULL;
21044 : }
21045 : }
21046 :
21047 0 : TALLOC_FREE(pull);
21048 0 : Py_RETURN_NONE;
21049 : }
21050 :
21051 0 : static PyObject *py_samr_EnumDomainUsers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21052 : {
21053 0 : DATA_BLOB blob;
21054 0 : Py_ssize_t blob_length = 0;
21055 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21056 0 : PyObject *bigendian_obj = NULL;
21057 0 : PyObject *ndr64_obj = NULL;
21058 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21059 0 : PyObject *allow_remaining_obj = NULL;
21060 0 : bool allow_remaining = false;
21061 :
21062 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21063 : discard_const_p(char *, kwnames),
21064 : &blob.data, &blob_length,
21065 : &bigendian_obj,
21066 : &ndr64_obj,
21067 : &allow_remaining_obj)) {
21068 0 : return NULL;
21069 : }
21070 0 : blob.length = blob_length;
21071 :
21072 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21073 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21074 : }
21075 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21076 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21077 : }
21078 :
21079 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21080 0 : allow_remaining = true;
21081 : }
21082 :
21083 0 : return py_samr_EnumDomainUsers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21084 : }
21085 :
21086 0 : static PyObject *py_samr_EnumDomainUsers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21087 : {
21088 0 : DATA_BLOB blob;
21089 0 : Py_ssize_t blob_length = 0;
21090 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21091 0 : PyObject *bigendian_obj = NULL;
21092 0 : PyObject *ndr64_obj = NULL;
21093 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21094 0 : PyObject *allow_remaining_obj = NULL;
21095 0 : bool allow_remaining = false;
21096 :
21097 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21098 : discard_const_p(char *, kwnames),
21099 : &blob.data, &blob_length,
21100 : &bigendian_obj,
21101 : &ndr64_obj,
21102 : &allow_remaining_obj)) {
21103 0 : return NULL;
21104 : }
21105 0 : blob.length = blob_length;
21106 :
21107 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21108 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21109 : }
21110 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21111 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21112 : }
21113 :
21114 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21115 0 : allow_remaining = true;
21116 : }
21117 :
21118 0 : return py_samr_EnumDomainUsers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21119 : }
21120 :
21121 0 : static PyObject *py_samr_EnumDomainUsers_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21122 : {
21123 0 : const struct ndr_interface_call *call = NULL;
21124 0 : struct samr_EnumDomainUsers *object = (struct samr_EnumDomainUsers *)pytalloc_get_ptr(py_obj);
21125 0 : PyObject *ret;
21126 0 : char *retstr;
21127 :
21128 0 : if (ndr_table_samr.num_calls < 14) {
21129 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainUsers_ndr_print");
21130 0 : return NULL;
21131 : }
21132 0 : call = &ndr_table_samr.calls[13];
21133 :
21134 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21135 0 : ret = PyUnicode_FromString(retstr);
21136 0 : TALLOC_FREE(retstr);
21137 :
21138 0 : return ret;
21139 : }
21140 :
21141 0 : static PyObject *py_samr_EnumDomainUsers_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21142 : {
21143 0 : return py_samr_EnumDomainUsers_ndr_print(py_obj, "samr_EnumDomainUsers_in", NDR_IN);
21144 : }
21145 :
21146 0 : static PyObject *py_samr_EnumDomainUsers_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21147 : {
21148 0 : return py_samr_EnumDomainUsers_ndr_print(py_obj, "samr_EnumDomainUsers_out", NDR_OUT);
21149 : }
21150 :
21151 : static PyMethodDef py_samr_EnumDomainUsers_methods[] = {
21152 : { "opnum", (PyCFunction)py_samr_EnumDomainUsers_ndr_opnum, METH_NOARGS|METH_CLASS,
21153 : "samr.EnumDomainUsers.opnum() -> 13 (0x0d) " },
21154 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainUsers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21155 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21156 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainUsers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21157 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21158 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainUsers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21159 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21160 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainUsers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21161 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21162 : { "__ndr_print_in__", (PyCFunction)py_samr_EnumDomainUsers_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21163 : { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainUsers_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21164 : { NULL, NULL, 0, NULL }
21165 : };
21166 :
21167 :
21168 : static PyTypeObject samr_EnumDomainUsers_Type = {
21169 : PyVarObject_HEAD_INIT(NULL, 0)
21170 : .tp_name = "samr.EnumDomainUsers",
21171 : .tp_getset = py_samr_EnumDomainUsers_getsetters,
21172 : .tp_methods = py_samr_EnumDomainUsers_methods,
21173 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21174 : .tp_new = py_samr_EnumDomainUsers_new,
21175 : };
21176 :
21177 51 : static bool pack_py_samr_EnumDomainUsers_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainUsers *r)
21178 : {
21179 0 : PyObject *py_domain_handle;
21180 0 : PyObject *py_resume_handle;
21181 0 : PyObject *py_acct_flags;
21182 0 : PyObject *py_max_size;
21183 51 : const char *kwnames[] = {
21184 : "domain_handle", "resume_handle", "acct_flags", "max_size", NULL
21185 : };
21186 :
21187 51 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_EnumDomainUsers", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_acct_flags, &py_max_size)) {
21188 0 : return false;
21189 : }
21190 :
21191 51 : if (py_domain_handle == NULL) {
21192 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
21193 0 : return false;
21194 : }
21195 51 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
21196 51 : if (r->in.domain_handle == NULL) {
21197 0 : PyErr_NoMemory();
21198 0 : return false;
21199 : }
21200 51 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
21201 51 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
21202 0 : PyErr_NoMemory();
21203 0 : return false;
21204 : }
21205 51 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
21206 51 : if (py_resume_handle == NULL) {
21207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
21208 0 : return false;
21209 : }
21210 51 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
21211 51 : if (r->in.resume_handle == NULL) {
21212 0 : PyErr_NoMemory();
21213 0 : return false;
21214 : }
21215 : {
21216 51 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
21217 51 : if (PyLong_Check(py_resume_handle)) {
21218 0 : unsigned long long test_var;
21219 51 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
21220 51 : if (PyErr_Occurred() != NULL) {
21221 0 : return false;
21222 : }
21223 51 : if (test_var > uint_max) {
21224 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21225 : PyLong_Type.tp_name, uint_max, test_var);
21226 0 : return false;
21227 : }
21228 51 : *r->in.resume_handle = test_var;
21229 : } else {
21230 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21231 : PyLong_Type.tp_name);
21232 0 : return false;
21233 : }
21234 : }
21235 51 : if (py_acct_flags == NULL) {
21236 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.acct_flags");
21237 0 : return false;
21238 : }
21239 : {
21240 51 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.acct_flags));
21241 51 : if (PyLong_Check(py_acct_flags)) {
21242 0 : unsigned long long test_var;
21243 51 : test_var = PyLong_AsUnsignedLongLong(py_acct_flags);
21244 51 : if (PyErr_Occurred() != NULL) {
21245 0 : return false;
21246 : }
21247 51 : if (test_var > uint_max) {
21248 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21249 : PyLong_Type.tp_name, uint_max, test_var);
21250 0 : return false;
21251 : }
21252 51 : r->in.acct_flags = test_var;
21253 : } else {
21254 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21255 : PyLong_Type.tp_name);
21256 0 : return false;
21257 : }
21258 : }
21259 51 : if (py_max_size == NULL) {
21260 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
21261 0 : return false;
21262 : }
21263 : {
21264 51 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
21265 51 : if (PyLong_Check(py_max_size)) {
21266 0 : unsigned long long test_var;
21267 51 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
21268 51 : if (PyErr_Occurred() != NULL) {
21269 0 : return false;
21270 : }
21271 51 : if (test_var > uint_max) {
21272 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21273 : PyLong_Type.tp_name, uint_max, test_var);
21274 0 : return false;
21275 : }
21276 51 : r->in.max_size = test_var;
21277 : } else {
21278 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21279 : PyLong_Type.tp_name);
21280 0 : return false;
21281 : }
21282 : }
21283 51 : return true;
21284 : }
21285 :
21286 51 : static PyObject *unpack_py_samr_EnumDomainUsers_args_out(struct samr_EnumDomainUsers *r)
21287 : {
21288 0 : PyObject *result;
21289 0 : PyObject *py_resume_handle;
21290 0 : PyObject *py_sam;
21291 0 : PyObject *py_num_entries;
21292 51 : result = PyTuple_New(3);
21293 51 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
21294 51 : PyTuple_SetItem(result, 0, py_resume_handle);
21295 51 : if (*r->out.sam == NULL) {
21296 0 : py_sam = Py_None;
21297 0 : Py_INCREF(py_sam);
21298 : } else {
21299 51 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
21300 : }
21301 51 : PyTuple_SetItem(result, 1, py_sam);
21302 51 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries);
21303 51 : PyTuple_SetItem(result, 2, py_num_entries);
21304 51 : if (NT_STATUS_IS_ERR(r->out.result)) {
21305 0 : PyErr_SetNTSTATUS(r->out.result);
21306 0 : return NULL;
21307 : }
21308 :
21309 51 : return result;
21310 : }
21311 :
21312 :
21313 0 : static PyObject *py_samr_CreateDomAlias_in_get_domain_handle(PyObject *obj, void *closure)
21314 : {
21315 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21316 0 : PyObject *py_domain_handle;
21317 0 : if (object->in.domain_handle == NULL) {
21318 0 : Py_RETURN_NONE;
21319 : }
21320 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
21321 0 : return py_domain_handle;
21322 : }
21323 :
21324 0 : static int py_samr_CreateDomAlias_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
21325 : {
21326 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21327 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
21328 0 : if (value == NULL) {
21329 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
21330 0 : return -1;
21331 : }
21332 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
21333 0 : if (object->in.domain_handle == NULL) {
21334 0 : PyErr_NoMemory();
21335 0 : return -1;
21336 : }
21337 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21338 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21339 0 : PyErr_NoMemory();
21340 0 : return -1;
21341 : }
21342 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
21343 0 : return 0;
21344 : }
21345 :
21346 0 : static PyObject *py_samr_CreateDomAlias_in_get_alias_name(PyObject *obj, void *closure)
21347 : {
21348 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21349 0 : PyObject *py_alias_name;
21350 0 : if (object->in.alias_name == NULL) {
21351 0 : Py_RETURN_NONE;
21352 : }
21353 0 : py_alias_name = pytalloc_reference_ex(lsa_String_Type, object->in.alias_name, object->in.alias_name);
21354 0 : return py_alias_name;
21355 : }
21356 :
21357 0 : static int py_samr_CreateDomAlias_in_set_alias_name(PyObject *py_obj, PyObject *value, void *closure)
21358 : {
21359 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21360 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_name));
21361 0 : if (value == NULL) {
21362 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_name");
21363 0 : return -1;
21364 : }
21365 0 : object->in.alias_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_name);
21366 0 : if (object->in.alias_name == NULL) {
21367 0 : PyErr_NoMemory();
21368 0 : return -1;
21369 : }
21370 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
21371 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21372 0 : PyErr_NoMemory();
21373 0 : return -1;
21374 : }
21375 0 : object->in.alias_name = (struct lsa_String *)pytalloc_get_ptr(value);
21376 0 : return 0;
21377 : }
21378 :
21379 0 : static PyObject *py_samr_CreateDomAlias_in_get_access_mask(PyObject *obj, void *closure)
21380 : {
21381 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21382 0 : PyObject *py_access_mask;
21383 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
21384 0 : return py_access_mask;
21385 : }
21386 :
21387 0 : static int py_samr_CreateDomAlias_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
21388 : {
21389 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21390 0 : if (value == NULL) {
21391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
21392 0 : return -1;
21393 : }
21394 : {
21395 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
21396 0 : if (PyLong_Check(value)) {
21397 0 : unsigned long long test_var;
21398 0 : test_var = PyLong_AsUnsignedLongLong(value);
21399 0 : if (PyErr_Occurred() != NULL) {
21400 0 : return -1;
21401 : }
21402 0 : if (test_var > uint_max) {
21403 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21404 : PyLong_Type.tp_name, uint_max, test_var);
21405 0 : return -1;
21406 : }
21407 0 : object->in.access_mask = test_var;
21408 : } else {
21409 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21410 : PyLong_Type.tp_name);
21411 0 : return -1;
21412 : }
21413 : }
21414 0 : return 0;
21415 : }
21416 :
21417 0 : static PyObject *py_samr_CreateDomAlias_out_get_alias_handle(PyObject *obj, void *closure)
21418 : {
21419 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21420 0 : PyObject *py_alias_handle;
21421 0 : if (object->out.alias_handle == NULL) {
21422 0 : Py_RETURN_NONE;
21423 : }
21424 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle);
21425 0 : return py_alias_handle;
21426 : }
21427 :
21428 0 : static int py_samr_CreateDomAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
21429 : {
21430 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21431 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle));
21432 0 : if (value == NULL) {
21433 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle");
21434 0 : return -1;
21435 : }
21436 0 : object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle);
21437 0 : if (object->out.alias_handle == NULL) {
21438 0 : PyErr_NoMemory();
21439 0 : return -1;
21440 : }
21441 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21442 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21443 0 : PyErr_NoMemory();
21444 0 : return -1;
21445 : }
21446 0 : object->out.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
21447 0 : return 0;
21448 : }
21449 :
21450 0 : static PyObject *py_samr_CreateDomAlias_out_get_rid(PyObject *obj, void *closure)
21451 : {
21452 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21453 0 : PyObject *py_rid;
21454 0 : if (object->out.rid == NULL) {
21455 0 : Py_RETURN_NONE;
21456 : }
21457 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
21458 0 : return py_rid;
21459 : }
21460 :
21461 0 : static int py_samr_CreateDomAlias_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
21462 : {
21463 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21464 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
21465 0 : if (value == NULL) {
21466 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
21467 0 : return -1;
21468 : }
21469 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
21470 0 : if (object->out.rid == NULL) {
21471 0 : PyErr_NoMemory();
21472 0 : return -1;
21473 : }
21474 : {
21475 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
21476 0 : if (PyLong_Check(value)) {
21477 0 : unsigned long long test_var;
21478 0 : test_var = PyLong_AsUnsignedLongLong(value);
21479 0 : if (PyErr_Occurred() != NULL) {
21480 0 : return -1;
21481 : }
21482 0 : if (test_var > uint_max) {
21483 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21484 : PyLong_Type.tp_name, uint_max, test_var);
21485 0 : return -1;
21486 : }
21487 0 : *object->out.rid = test_var;
21488 : } else {
21489 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21490 : PyLong_Type.tp_name);
21491 0 : return -1;
21492 : }
21493 : }
21494 0 : return 0;
21495 : }
21496 :
21497 0 : static PyObject *py_samr_CreateDomAlias_get_result(PyObject *obj, void *closure)
21498 : {
21499 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(obj);
21500 0 : PyObject *py_result;
21501 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
21502 0 : return py_result;
21503 : }
21504 :
21505 0 : static int py_samr_CreateDomAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
21506 : {
21507 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21508 0 : if (value == NULL) {
21509 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
21510 0 : return -1;
21511 : }
21512 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
21513 0 : return 0;
21514 : }
21515 :
21516 : static PyGetSetDef py_samr_CreateDomAlias_getsetters[] = {
21517 : {
21518 : .name = discard_const_p(char, "in_domain_handle"),
21519 : .get = py_samr_CreateDomAlias_in_get_domain_handle,
21520 : .set = py_samr_CreateDomAlias_in_set_domain_handle,
21521 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21522 : },
21523 : {
21524 : .name = discard_const_p(char, "in_alias_name"),
21525 : .get = py_samr_CreateDomAlias_in_get_alias_name,
21526 : .set = py_samr_CreateDomAlias_in_set_alias_name,
21527 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
21528 : },
21529 : {
21530 : .name = discard_const_p(char, "in_access_mask"),
21531 : .get = py_samr_CreateDomAlias_in_get_access_mask,
21532 : .set = py_samr_CreateDomAlias_in_set_access_mask,
21533 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasAccessMask")
21534 : },
21535 : {
21536 : .name = discard_const_p(char, "out_alias_handle"),
21537 : .get = py_samr_CreateDomAlias_out_get_alias_handle,
21538 : .set = py_samr_CreateDomAlias_out_set_alias_handle,
21539 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
21540 : },
21541 : {
21542 : .name = discard_const_p(char, "out_rid"),
21543 : .get = py_samr_CreateDomAlias_out_get_rid,
21544 : .set = py_samr_CreateDomAlias_out_set_rid,
21545 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
21546 : },
21547 : {
21548 : .name = discard_const_p(char, "result"),
21549 : .get = py_samr_CreateDomAlias_get_result,
21550 : .set = py_samr_CreateDomAlias_set_result,
21551 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
21552 : },
21553 : { .name = NULL }
21554 : };
21555 :
21556 0 : static PyObject *py_samr_CreateDomAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
21557 : {
21558 0 : PyObject *self = pytalloc_new(struct samr_CreateDomAlias, type);
21559 0 : struct samr_CreateDomAlias *_self = (struct samr_CreateDomAlias *)pytalloc_get_ptr(self);
21560 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
21561 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
21562 0 : _self->in.alias_name = talloc_zero(mem_ctx, struct lsa_String);
21563 0 : _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
21564 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
21565 0 : return self;
21566 : }
21567 :
21568 0 : static PyObject *py_samr_CreateDomAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
21569 : {
21570 :
21571 :
21572 0 : return PyLong_FromLong(14);
21573 : }
21574 :
21575 0 : static PyObject *py_samr_CreateDomAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
21576 : {
21577 0 : const struct ndr_interface_call *call = NULL;
21578 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21579 0 : PyObject *ret = NULL;
21580 0 : struct ndr_push *push = NULL;
21581 0 : DATA_BLOB blob;
21582 0 : enum ndr_err_code err;
21583 :
21584 0 : if (ndr_table_samr.num_calls < 15) {
21585 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_pack");
21586 0 : return NULL;
21587 : }
21588 0 : call = &ndr_table_samr.calls[14];
21589 :
21590 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
21591 0 : if (push == NULL) {
21592 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21593 0 : return NULL;
21594 : }
21595 :
21596 0 : push->flags |= ndr_push_flags;
21597 :
21598 0 : err = call->ndr_push(push, ndr_inout_flags, object);
21599 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21600 0 : TALLOC_FREE(push);
21601 0 : PyErr_SetNdrError(err);
21602 0 : return NULL;
21603 : }
21604 0 : blob = ndr_push_blob(push);
21605 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
21606 0 : TALLOC_FREE(push);
21607 0 : return ret;
21608 : }
21609 :
21610 0 : static PyObject *py_samr_CreateDomAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21611 : {
21612 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21613 0 : PyObject *bigendian_obj = NULL;
21614 0 : PyObject *ndr64_obj = NULL;
21615 0 : libndr_flags ndr_push_flags = 0;
21616 :
21617 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
21618 : discard_const_p(char *, kwnames),
21619 : &bigendian_obj,
21620 : &ndr64_obj)) {
21621 0 : return NULL;
21622 : }
21623 :
21624 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21625 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21626 : }
21627 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21628 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21629 : }
21630 :
21631 0 : return py_samr_CreateDomAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
21632 : }
21633 :
21634 0 : static PyObject *py_samr_CreateDomAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21635 : {
21636 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
21637 0 : PyObject *bigendian_obj = NULL;
21638 0 : PyObject *ndr64_obj = NULL;
21639 0 : libndr_flags ndr_push_flags = 0;
21640 :
21641 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
21642 : discard_const_p(char *, kwnames),
21643 : &bigendian_obj,
21644 : &ndr64_obj)) {
21645 0 : return NULL;
21646 : }
21647 :
21648 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21649 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
21650 : }
21651 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21652 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
21653 : }
21654 :
21655 0 : return py_samr_CreateDomAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
21656 : }
21657 :
21658 0 : static PyObject *py_samr_CreateDomAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
21659 : {
21660 0 : const struct ndr_interface_call *call = NULL;
21661 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21662 0 : struct ndr_pull *pull = NULL;
21663 0 : enum ndr_err_code err;
21664 :
21665 0 : if (ndr_table_samr.num_calls < 15) {
21666 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_unpack");
21667 0 : return NULL;
21668 : }
21669 0 : call = &ndr_table_samr.calls[14];
21670 :
21671 0 : pull = ndr_pull_init_blob(blob, object);
21672 0 : if (pull == NULL) {
21673 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
21674 0 : return NULL;
21675 : }
21676 :
21677 0 : pull->flags |= ndr_pull_flags;
21678 :
21679 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
21680 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
21681 0 : TALLOC_FREE(pull);
21682 0 : PyErr_SetNdrError(err);
21683 0 : return NULL;
21684 : }
21685 0 : if (!allow_remaining) {
21686 0 : uint32_t highest_ofs;
21687 :
21688 0 : if (pull->offset > pull->relative_highest_offset) {
21689 0 : highest_ofs = pull->offset;
21690 : } else {
21691 0 : highest_ofs = pull->relative_highest_offset;
21692 : }
21693 0 : if (highest_ofs < pull->data_size) {
21694 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
21695 : "not all bytes consumed ofs[%u] size[%u]",
21696 : highest_ofs, pull->data_size);
21697 0 : TALLOC_FREE(pull);
21698 0 : PyErr_SetNdrError(err);
21699 0 : return NULL;
21700 : }
21701 : }
21702 :
21703 0 : TALLOC_FREE(pull);
21704 0 : Py_RETURN_NONE;
21705 : }
21706 :
21707 0 : static PyObject *py_samr_CreateDomAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21708 : {
21709 0 : DATA_BLOB blob;
21710 0 : Py_ssize_t blob_length = 0;
21711 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21712 0 : PyObject *bigendian_obj = NULL;
21713 0 : PyObject *ndr64_obj = NULL;
21714 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21715 0 : PyObject *allow_remaining_obj = NULL;
21716 0 : bool allow_remaining = false;
21717 :
21718 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
21719 : discard_const_p(char *, kwnames),
21720 : &blob.data, &blob_length,
21721 : &bigendian_obj,
21722 : &ndr64_obj,
21723 : &allow_remaining_obj)) {
21724 0 : return NULL;
21725 : }
21726 0 : blob.length = blob_length;
21727 :
21728 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21729 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21730 : }
21731 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21732 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21733 : }
21734 :
21735 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21736 0 : allow_remaining = true;
21737 : }
21738 :
21739 0 : return py_samr_CreateDomAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
21740 : }
21741 :
21742 0 : static PyObject *py_samr_CreateDomAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
21743 : {
21744 0 : DATA_BLOB blob;
21745 0 : Py_ssize_t blob_length = 0;
21746 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
21747 0 : PyObject *bigendian_obj = NULL;
21748 0 : PyObject *ndr64_obj = NULL;
21749 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
21750 0 : PyObject *allow_remaining_obj = NULL;
21751 0 : bool allow_remaining = false;
21752 :
21753 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
21754 : discard_const_p(char *, kwnames),
21755 : &blob.data, &blob_length,
21756 : &bigendian_obj,
21757 : &ndr64_obj,
21758 : &allow_remaining_obj)) {
21759 0 : return NULL;
21760 : }
21761 0 : blob.length = blob_length;
21762 :
21763 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
21764 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
21765 : }
21766 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
21767 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
21768 : }
21769 :
21770 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
21771 0 : allow_remaining = true;
21772 : }
21773 :
21774 0 : return py_samr_CreateDomAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
21775 : }
21776 :
21777 0 : static PyObject *py_samr_CreateDomAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
21778 : {
21779 0 : const struct ndr_interface_call *call = NULL;
21780 0 : struct samr_CreateDomAlias *object = (struct samr_CreateDomAlias *)pytalloc_get_ptr(py_obj);
21781 0 : PyObject *ret;
21782 0 : char *retstr;
21783 :
21784 0 : if (ndr_table_samr.num_calls < 15) {
21785 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateDomAlias_ndr_print");
21786 0 : return NULL;
21787 : }
21788 0 : call = &ndr_table_samr.calls[14];
21789 :
21790 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
21791 0 : ret = PyUnicode_FromString(retstr);
21792 0 : TALLOC_FREE(retstr);
21793 :
21794 0 : return ret;
21795 : }
21796 :
21797 0 : static PyObject *py_samr_CreateDomAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21798 : {
21799 0 : return py_samr_CreateDomAlias_ndr_print(py_obj, "samr_CreateDomAlias_in", NDR_IN);
21800 : }
21801 :
21802 0 : static PyObject *py_samr_CreateDomAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
21803 : {
21804 0 : return py_samr_CreateDomAlias_ndr_print(py_obj, "samr_CreateDomAlias_out", NDR_OUT);
21805 : }
21806 :
21807 : static PyMethodDef py_samr_CreateDomAlias_methods[] = {
21808 : { "opnum", (PyCFunction)py_samr_CreateDomAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
21809 : "samr.CreateDomAlias.opnum() -> 14 (0x0e) " },
21810 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
21811 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
21812 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
21813 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
21814 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
21815 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
21816 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateDomAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
21817 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
21818 : { "__ndr_print_in__", (PyCFunction)py_samr_CreateDomAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
21819 : { "__ndr_print_out__", (PyCFunction)py_samr_CreateDomAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
21820 : { NULL, NULL, 0, NULL }
21821 : };
21822 :
21823 :
21824 : static PyTypeObject samr_CreateDomAlias_Type = {
21825 : PyVarObject_HEAD_INIT(NULL, 0)
21826 : .tp_name = "samr.CreateDomAlias",
21827 : .tp_getset = py_samr_CreateDomAlias_getsetters,
21828 : .tp_methods = py_samr_CreateDomAlias_methods,
21829 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
21830 : .tp_new = py_samr_CreateDomAlias_new,
21831 : };
21832 :
21833 0 : static bool pack_py_samr_CreateDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomAlias *r)
21834 : {
21835 0 : PyObject *py_domain_handle;
21836 0 : PyObject *py_alias_name;
21837 0 : PyObject *py_access_mask;
21838 0 : const char *kwnames[] = {
21839 : "domain_handle", "alias_name", "access_mask", NULL
21840 : };
21841 :
21842 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_alias_name, &py_access_mask)) {
21843 0 : return false;
21844 : }
21845 :
21846 0 : if (py_domain_handle == NULL) {
21847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
21848 0 : return false;
21849 : }
21850 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
21851 0 : if (r->in.domain_handle == NULL) {
21852 0 : PyErr_NoMemory();
21853 0 : return false;
21854 : }
21855 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
21856 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
21857 0 : PyErr_NoMemory();
21858 0 : return false;
21859 : }
21860 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
21861 0 : if (py_alias_name == NULL) {
21862 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_name");
21863 0 : return false;
21864 : }
21865 0 : r->in.alias_name = talloc_ptrtype(r, r->in.alias_name);
21866 0 : if (r->in.alias_name == NULL) {
21867 0 : PyErr_NoMemory();
21868 0 : return false;
21869 : }
21870 0 : PY_CHECK_TYPE(lsa_String_Type, py_alias_name, return false;);
21871 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_name)) == NULL) {
21872 0 : PyErr_NoMemory();
21873 0 : return false;
21874 : }
21875 0 : r->in.alias_name = (struct lsa_String *)pytalloc_get_ptr(py_alias_name);
21876 0 : if (py_access_mask == NULL) {
21877 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
21878 0 : return false;
21879 : }
21880 : {
21881 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
21882 0 : if (PyLong_Check(py_access_mask)) {
21883 0 : unsigned long long test_var;
21884 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
21885 0 : if (PyErr_Occurred() != NULL) {
21886 0 : return false;
21887 : }
21888 0 : if (test_var > uint_max) {
21889 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21890 : PyLong_Type.tp_name, uint_max, test_var);
21891 0 : return false;
21892 : }
21893 0 : r->in.access_mask = test_var;
21894 : } else {
21895 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21896 : PyLong_Type.tp_name);
21897 0 : return false;
21898 : }
21899 : }
21900 0 : return true;
21901 : }
21902 :
21903 0 : static PyObject *unpack_py_samr_CreateDomAlias_args_out(struct samr_CreateDomAlias *r)
21904 : {
21905 0 : PyObject *result;
21906 0 : PyObject *py_alias_handle;
21907 0 : PyObject *py_rid;
21908 0 : result = PyTuple_New(2);
21909 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
21910 0 : PyTuple_SetItem(result, 0, py_alias_handle);
21911 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
21912 0 : PyTuple_SetItem(result, 1, py_rid);
21913 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
21914 0 : PyErr_SetNTSTATUS(r->out.result);
21915 0 : return NULL;
21916 : }
21917 :
21918 0 : return result;
21919 : }
21920 :
21921 :
21922 0 : static PyObject *py_samr_EnumDomainAliases_in_get_domain_handle(PyObject *obj, void *closure)
21923 : {
21924 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
21925 0 : PyObject *py_domain_handle;
21926 0 : if (object->in.domain_handle == NULL) {
21927 0 : Py_RETURN_NONE;
21928 : }
21929 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
21930 0 : return py_domain_handle;
21931 : }
21932 :
21933 0 : static int py_samr_EnumDomainAliases_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
21934 : {
21935 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
21936 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
21937 0 : if (value == NULL) {
21938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
21939 0 : return -1;
21940 : }
21941 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
21942 0 : if (object->in.domain_handle == NULL) {
21943 0 : PyErr_NoMemory();
21944 0 : return -1;
21945 : }
21946 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
21947 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
21948 0 : PyErr_NoMemory();
21949 0 : return -1;
21950 : }
21951 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
21952 0 : return 0;
21953 : }
21954 :
21955 0 : static PyObject *py_samr_EnumDomainAliases_in_get_resume_handle(PyObject *obj, void *closure)
21956 : {
21957 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
21958 0 : PyObject *py_resume_handle;
21959 0 : if (object->in.resume_handle == NULL) {
21960 0 : Py_RETURN_NONE;
21961 : }
21962 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->in.resume_handle);
21963 0 : return py_resume_handle;
21964 : }
21965 :
21966 0 : static int py_samr_EnumDomainAliases_in_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
21967 : {
21968 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
21969 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.resume_handle));
21970 0 : if (value == NULL) {
21971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.resume_handle");
21972 0 : return -1;
21973 : }
21974 0 : object->in.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.resume_handle);
21975 0 : if (object->in.resume_handle == NULL) {
21976 0 : PyErr_NoMemory();
21977 0 : return -1;
21978 : }
21979 : {
21980 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.resume_handle));
21981 0 : if (PyLong_Check(value)) {
21982 0 : unsigned long long test_var;
21983 0 : test_var = PyLong_AsUnsignedLongLong(value);
21984 0 : if (PyErr_Occurred() != NULL) {
21985 0 : return -1;
21986 : }
21987 0 : if (test_var > uint_max) {
21988 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
21989 : PyLong_Type.tp_name, uint_max, test_var);
21990 0 : return -1;
21991 : }
21992 0 : *object->in.resume_handle = test_var;
21993 : } else {
21994 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
21995 : PyLong_Type.tp_name);
21996 0 : return -1;
21997 : }
21998 : }
21999 0 : return 0;
22000 : }
22001 :
22002 0 : static PyObject *py_samr_EnumDomainAliases_out_get_resume_handle(PyObject *obj, void *closure)
22003 : {
22004 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
22005 0 : PyObject *py_resume_handle;
22006 0 : if (object->out.resume_handle == NULL) {
22007 0 : Py_RETURN_NONE;
22008 : }
22009 0 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*object->out.resume_handle);
22010 0 : return py_resume_handle;
22011 : }
22012 :
22013 0 : static int py_samr_EnumDomainAliases_out_set_resume_handle(PyObject *py_obj, PyObject *value, void *closure)
22014 : {
22015 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22016 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.resume_handle));
22017 0 : if (value == NULL) {
22018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.resume_handle");
22019 0 : return -1;
22020 : }
22021 0 : object->out.resume_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.resume_handle);
22022 0 : if (object->out.resume_handle == NULL) {
22023 0 : PyErr_NoMemory();
22024 0 : return -1;
22025 : }
22026 : {
22027 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.resume_handle));
22028 0 : if (PyLong_Check(value)) {
22029 0 : unsigned long long test_var;
22030 0 : test_var = PyLong_AsUnsignedLongLong(value);
22031 0 : if (PyErr_Occurred() != NULL) {
22032 0 : return -1;
22033 : }
22034 0 : if (test_var > uint_max) {
22035 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22036 : PyLong_Type.tp_name, uint_max, test_var);
22037 0 : return -1;
22038 : }
22039 0 : *object->out.resume_handle = test_var;
22040 : } else {
22041 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22042 : PyLong_Type.tp_name);
22043 0 : return -1;
22044 : }
22045 : }
22046 0 : return 0;
22047 : }
22048 :
22049 0 : static PyObject *py_samr_EnumDomainAliases_out_get_sam(PyObject *obj, void *closure)
22050 : {
22051 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
22052 0 : PyObject *py_sam;
22053 0 : if (object->out.sam == NULL) {
22054 0 : Py_RETURN_NONE;
22055 : }
22056 0 : if (*object->out.sam == NULL) {
22057 0 : py_sam = Py_None;
22058 0 : Py_INCREF(py_sam);
22059 : } else {
22060 0 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *object->out.sam, *object->out.sam);
22061 : }
22062 0 : return py_sam;
22063 : }
22064 :
22065 0 : static int py_samr_EnumDomainAliases_out_set_sam(PyObject *py_obj, PyObject *value, void *closure)
22066 : {
22067 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22068 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sam));
22069 0 : if (value == NULL) {
22070 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sam");
22071 0 : return -1;
22072 : }
22073 0 : object->out.sam = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sam);
22074 0 : if (object->out.sam == NULL) {
22075 0 : PyErr_NoMemory();
22076 0 : return -1;
22077 : }
22078 0 : if (value == Py_None) {
22079 0 : *object->out.sam = NULL;
22080 : } else {
22081 0 : *object->out.sam = NULL;
22082 0 : PY_CHECK_TYPE(&samr_SamArray_Type, value, return -1;);
22083 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22084 0 : PyErr_NoMemory();
22085 0 : return -1;
22086 : }
22087 0 : *object->out.sam = (struct samr_SamArray *)pytalloc_get_ptr(value);
22088 : }
22089 0 : return 0;
22090 : }
22091 :
22092 0 : static PyObject *py_samr_EnumDomainAliases_in_get_max_size(PyObject *obj, void *closure)
22093 : {
22094 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
22095 0 : PyObject *py_max_size;
22096 0 : py_max_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_size);
22097 0 : return py_max_size;
22098 : }
22099 :
22100 0 : static int py_samr_EnumDomainAliases_in_set_max_size(PyObject *py_obj, PyObject *value, void *closure)
22101 : {
22102 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22103 0 : if (value == NULL) {
22104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_size");
22105 0 : return -1;
22106 : }
22107 : {
22108 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_size));
22109 0 : if (PyLong_Check(value)) {
22110 0 : unsigned long long test_var;
22111 0 : test_var = PyLong_AsUnsignedLongLong(value);
22112 0 : if (PyErr_Occurred() != NULL) {
22113 0 : return -1;
22114 : }
22115 0 : if (test_var > uint_max) {
22116 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22117 : PyLong_Type.tp_name, uint_max, test_var);
22118 0 : return -1;
22119 : }
22120 0 : object->in.max_size = test_var;
22121 : } else {
22122 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22123 : PyLong_Type.tp_name);
22124 0 : return -1;
22125 : }
22126 : }
22127 0 : return 0;
22128 : }
22129 :
22130 0 : static PyObject *py_samr_EnumDomainAliases_out_get_num_entries(PyObject *obj, void *closure)
22131 : {
22132 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
22133 0 : PyObject *py_num_entries;
22134 0 : if (object->out.num_entries == NULL) {
22135 0 : Py_RETURN_NONE;
22136 : }
22137 0 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*object->out.num_entries);
22138 0 : return py_num_entries;
22139 : }
22140 :
22141 0 : static int py_samr_EnumDomainAliases_out_set_num_entries(PyObject *py_obj, PyObject *value, void *closure)
22142 : {
22143 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22144 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_entries));
22145 0 : if (value == NULL) {
22146 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.num_entries");
22147 0 : return -1;
22148 : }
22149 0 : object->out.num_entries = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_entries);
22150 0 : if (object->out.num_entries == NULL) {
22151 0 : PyErr_NoMemory();
22152 0 : return -1;
22153 : }
22154 : {
22155 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_entries));
22156 0 : if (PyLong_Check(value)) {
22157 0 : unsigned long long test_var;
22158 0 : test_var = PyLong_AsUnsignedLongLong(value);
22159 0 : if (PyErr_Occurred() != NULL) {
22160 0 : return -1;
22161 : }
22162 0 : if (test_var > uint_max) {
22163 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22164 : PyLong_Type.tp_name, uint_max, test_var);
22165 0 : return -1;
22166 : }
22167 0 : *object->out.num_entries = test_var;
22168 : } else {
22169 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22170 : PyLong_Type.tp_name);
22171 0 : return -1;
22172 : }
22173 : }
22174 0 : return 0;
22175 : }
22176 :
22177 0 : static PyObject *py_samr_EnumDomainAliases_get_result(PyObject *obj, void *closure)
22178 : {
22179 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(obj);
22180 0 : PyObject *py_result;
22181 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22182 0 : return py_result;
22183 : }
22184 :
22185 0 : static int py_samr_EnumDomainAliases_set_result(PyObject *py_obj, PyObject *value, void *closure)
22186 : {
22187 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22188 0 : if (value == NULL) {
22189 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22190 0 : return -1;
22191 : }
22192 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22193 0 : return 0;
22194 : }
22195 :
22196 : static PyGetSetDef py_samr_EnumDomainAliases_getsetters[] = {
22197 : {
22198 : .name = discard_const_p(char, "in_domain_handle"),
22199 : .get = py_samr_EnumDomainAliases_in_get_domain_handle,
22200 : .set = py_samr_EnumDomainAliases_in_set_domain_handle,
22201 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22202 : },
22203 : {
22204 : .name = discard_const_p(char, "in_resume_handle"),
22205 : .get = py_samr_EnumDomainAliases_in_get_resume_handle,
22206 : .set = py_samr_EnumDomainAliases_in_set_resume_handle,
22207 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22208 : },
22209 : {
22210 : .name = discard_const_p(char, "out_resume_handle"),
22211 : .get = py_samr_EnumDomainAliases_out_get_resume_handle,
22212 : .set = py_samr_EnumDomainAliases_out_set_resume_handle,
22213 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22214 : },
22215 : {
22216 : .name = discard_const_p(char, "out_sam"),
22217 : .get = py_samr_EnumDomainAliases_out_get_sam,
22218 : .set = py_samr_EnumDomainAliases_out_set_sam,
22219 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_SamArray")
22220 : },
22221 : {
22222 : .name = discard_const_p(char, "in_max_size"),
22223 : .get = py_samr_EnumDomainAliases_in_get_max_size,
22224 : .set = py_samr_EnumDomainAliases_in_set_max_size,
22225 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22226 : },
22227 : {
22228 : .name = discard_const_p(char, "out_num_entries"),
22229 : .get = py_samr_EnumDomainAliases_out_get_num_entries,
22230 : .set = py_samr_EnumDomainAliases_out_set_num_entries,
22231 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
22232 : },
22233 : {
22234 : .name = discard_const_p(char, "result"),
22235 : .get = py_samr_EnumDomainAliases_get_result,
22236 : .set = py_samr_EnumDomainAliases_set_result,
22237 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22238 : },
22239 : { .name = NULL }
22240 : };
22241 :
22242 0 : static PyObject *py_samr_EnumDomainAliases_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22243 : {
22244 0 : PyObject *self = pytalloc_new(struct samr_EnumDomainAliases, type);
22245 0 : struct samr_EnumDomainAliases *_self = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(self);
22246 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22247 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
22248 0 : _self->in.resume_handle = talloc_zero(mem_ctx, uint32_t);
22249 0 : _self->out.resume_handle = talloc_zero(mem_ctx, uint32_t);
22250 : /* a pointer to a NULL pointer */
22251 0 : _self->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
22252 0 : _self->out.num_entries = talloc_zero(mem_ctx, uint32_t);
22253 0 : return self;
22254 : }
22255 :
22256 0 : static PyObject *py_samr_EnumDomainAliases_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22257 : {
22258 :
22259 :
22260 0 : return PyLong_FromLong(15);
22261 : }
22262 :
22263 0 : static PyObject *py_samr_EnumDomainAliases_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22264 : {
22265 0 : const struct ndr_interface_call *call = NULL;
22266 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22267 0 : PyObject *ret = NULL;
22268 0 : struct ndr_push *push = NULL;
22269 0 : DATA_BLOB blob;
22270 0 : enum ndr_err_code err;
22271 :
22272 0 : if (ndr_table_samr.num_calls < 16) {
22273 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_pack");
22274 0 : return NULL;
22275 : }
22276 0 : call = &ndr_table_samr.calls[15];
22277 :
22278 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22279 0 : if (push == NULL) {
22280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22281 0 : return NULL;
22282 : }
22283 :
22284 0 : push->flags |= ndr_push_flags;
22285 :
22286 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22287 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22288 0 : TALLOC_FREE(push);
22289 0 : PyErr_SetNdrError(err);
22290 0 : return NULL;
22291 : }
22292 0 : blob = ndr_push_blob(push);
22293 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22294 0 : TALLOC_FREE(push);
22295 0 : return ret;
22296 : }
22297 :
22298 0 : static PyObject *py_samr_EnumDomainAliases_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22299 : {
22300 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22301 0 : PyObject *bigendian_obj = NULL;
22302 0 : PyObject *ndr64_obj = NULL;
22303 0 : libndr_flags ndr_push_flags = 0;
22304 :
22305 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22306 : discard_const_p(char *, kwnames),
22307 : &bigendian_obj,
22308 : &ndr64_obj)) {
22309 0 : return NULL;
22310 : }
22311 :
22312 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22313 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22314 : }
22315 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22316 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22317 : }
22318 :
22319 0 : return py_samr_EnumDomainAliases_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22320 : }
22321 :
22322 0 : static PyObject *py_samr_EnumDomainAliases_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22323 : {
22324 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22325 0 : PyObject *bigendian_obj = NULL;
22326 0 : PyObject *ndr64_obj = NULL;
22327 0 : libndr_flags ndr_push_flags = 0;
22328 :
22329 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22330 : discard_const_p(char *, kwnames),
22331 : &bigendian_obj,
22332 : &ndr64_obj)) {
22333 0 : return NULL;
22334 : }
22335 :
22336 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22337 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22338 : }
22339 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22340 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22341 : }
22342 :
22343 0 : return py_samr_EnumDomainAliases_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22344 : }
22345 :
22346 0 : static PyObject *py_samr_EnumDomainAliases_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
22347 : {
22348 0 : const struct ndr_interface_call *call = NULL;
22349 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22350 0 : struct ndr_pull *pull = NULL;
22351 0 : enum ndr_err_code err;
22352 :
22353 0 : if (ndr_table_samr.num_calls < 16) {
22354 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_unpack");
22355 0 : return NULL;
22356 : }
22357 0 : call = &ndr_table_samr.calls[15];
22358 :
22359 0 : pull = ndr_pull_init_blob(blob, object);
22360 0 : if (pull == NULL) {
22361 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22362 0 : return NULL;
22363 : }
22364 :
22365 0 : pull->flags |= ndr_pull_flags;
22366 :
22367 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22368 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22369 0 : TALLOC_FREE(pull);
22370 0 : PyErr_SetNdrError(err);
22371 0 : return NULL;
22372 : }
22373 0 : if (!allow_remaining) {
22374 0 : uint32_t highest_ofs;
22375 :
22376 0 : if (pull->offset > pull->relative_highest_offset) {
22377 0 : highest_ofs = pull->offset;
22378 : } else {
22379 0 : highest_ofs = pull->relative_highest_offset;
22380 : }
22381 0 : if (highest_ofs < pull->data_size) {
22382 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22383 : "not all bytes consumed ofs[%u] size[%u]",
22384 : highest_ofs, pull->data_size);
22385 0 : TALLOC_FREE(pull);
22386 0 : PyErr_SetNdrError(err);
22387 0 : return NULL;
22388 : }
22389 : }
22390 :
22391 0 : TALLOC_FREE(pull);
22392 0 : Py_RETURN_NONE;
22393 : }
22394 :
22395 0 : static PyObject *py_samr_EnumDomainAliases_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22396 : {
22397 0 : DATA_BLOB blob;
22398 0 : Py_ssize_t blob_length = 0;
22399 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22400 0 : PyObject *bigendian_obj = NULL;
22401 0 : PyObject *ndr64_obj = NULL;
22402 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22403 0 : PyObject *allow_remaining_obj = NULL;
22404 0 : bool allow_remaining = false;
22405 :
22406 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22407 : discard_const_p(char *, kwnames),
22408 : &blob.data, &blob_length,
22409 : &bigendian_obj,
22410 : &ndr64_obj,
22411 : &allow_remaining_obj)) {
22412 0 : return NULL;
22413 : }
22414 0 : blob.length = blob_length;
22415 :
22416 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22417 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22418 : }
22419 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22420 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22421 : }
22422 :
22423 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22424 0 : allow_remaining = true;
22425 : }
22426 :
22427 0 : return py_samr_EnumDomainAliases_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22428 : }
22429 :
22430 0 : static PyObject *py_samr_EnumDomainAliases_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22431 : {
22432 0 : DATA_BLOB blob;
22433 0 : Py_ssize_t blob_length = 0;
22434 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22435 0 : PyObject *bigendian_obj = NULL;
22436 0 : PyObject *ndr64_obj = NULL;
22437 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22438 0 : PyObject *allow_remaining_obj = NULL;
22439 0 : bool allow_remaining = false;
22440 :
22441 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22442 : discard_const_p(char *, kwnames),
22443 : &blob.data, &blob_length,
22444 : &bigendian_obj,
22445 : &ndr64_obj,
22446 : &allow_remaining_obj)) {
22447 0 : return NULL;
22448 : }
22449 0 : blob.length = blob_length;
22450 :
22451 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22452 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22453 : }
22454 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22455 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22456 : }
22457 :
22458 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22459 0 : allow_remaining = true;
22460 : }
22461 :
22462 0 : return py_samr_EnumDomainAliases_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22463 : }
22464 :
22465 0 : static PyObject *py_samr_EnumDomainAliases_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22466 : {
22467 0 : const struct ndr_interface_call *call = NULL;
22468 0 : struct samr_EnumDomainAliases *object = (struct samr_EnumDomainAliases *)pytalloc_get_ptr(py_obj);
22469 0 : PyObject *ret;
22470 0 : char *retstr;
22471 :
22472 0 : if (ndr_table_samr.num_calls < 16) {
22473 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_EnumDomainAliases_ndr_print");
22474 0 : return NULL;
22475 : }
22476 0 : call = &ndr_table_samr.calls[15];
22477 :
22478 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
22479 0 : ret = PyUnicode_FromString(retstr);
22480 0 : TALLOC_FREE(retstr);
22481 :
22482 0 : return ret;
22483 : }
22484 :
22485 0 : static PyObject *py_samr_EnumDomainAliases_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22486 : {
22487 0 : return py_samr_EnumDomainAliases_ndr_print(py_obj, "samr_EnumDomainAliases_in", NDR_IN);
22488 : }
22489 :
22490 0 : static PyObject *py_samr_EnumDomainAliases_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
22491 : {
22492 0 : return py_samr_EnumDomainAliases_ndr_print(py_obj, "samr_EnumDomainAliases_out", NDR_OUT);
22493 : }
22494 :
22495 : static PyMethodDef py_samr_EnumDomainAliases_methods[] = {
22496 : { "opnum", (PyCFunction)py_samr_EnumDomainAliases_ndr_opnum, METH_NOARGS|METH_CLASS,
22497 : "samr.EnumDomainAliases.opnum() -> 15 (0x0f) " },
22498 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainAliases_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
22499 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
22500 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainAliases_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
22501 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
22502 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainAliases_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
22503 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
22504 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_EnumDomainAliases_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
22505 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
22506 : { "__ndr_print_in__", (PyCFunction)py_samr_EnumDomainAliases_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
22507 : { "__ndr_print_out__", (PyCFunction)py_samr_EnumDomainAliases_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
22508 : { NULL, NULL, 0, NULL }
22509 : };
22510 :
22511 :
22512 : static PyTypeObject samr_EnumDomainAliases_Type = {
22513 : PyVarObject_HEAD_INIT(NULL, 0)
22514 : .tp_name = "samr.EnumDomainAliases",
22515 : .tp_getset = py_samr_EnumDomainAliases_getsetters,
22516 : .tp_methods = py_samr_EnumDomainAliases_methods,
22517 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
22518 : .tp_new = py_samr_EnumDomainAliases_new,
22519 : };
22520 :
22521 6 : static bool pack_py_samr_EnumDomainAliases_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainAliases *r)
22522 : {
22523 0 : PyObject *py_domain_handle;
22524 0 : PyObject *py_resume_handle;
22525 0 : PyObject *py_max_size;
22526 6 : const char *kwnames[] = {
22527 : "domain_handle", "resume_handle", "max_size", NULL
22528 : };
22529 :
22530 6 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainAliases", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
22531 0 : return false;
22532 : }
22533 :
22534 6 : if (py_domain_handle == NULL) {
22535 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
22536 0 : return false;
22537 : }
22538 6 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
22539 6 : if (r->in.domain_handle == NULL) {
22540 0 : PyErr_NoMemory();
22541 0 : return false;
22542 : }
22543 6 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
22544 6 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
22545 0 : PyErr_NoMemory();
22546 0 : return false;
22547 : }
22548 6 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
22549 6 : if (py_resume_handle == NULL) {
22550 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.resume_handle");
22551 0 : return false;
22552 : }
22553 6 : r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
22554 6 : if (r->in.resume_handle == NULL) {
22555 0 : PyErr_NoMemory();
22556 0 : return false;
22557 : }
22558 : {
22559 6 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.resume_handle));
22560 6 : if (PyLong_Check(py_resume_handle)) {
22561 0 : unsigned long long test_var;
22562 6 : test_var = PyLong_AsUnsignedLongLong(py_resume_handle);
22563 6 : if (PyErr_Occurred() != NULL) {
22564 0 : return false;
22565 : }
22566 6 : if (test_var > uint_max) {
22567 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22568 : PyLong_Type.tp_name, uint_max, test_var);
22569 0 : return false;
22570 : }
22571 6 : *r->in.resume_handle = test_var;
22572 : } else {
22573 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22574 : PyLong_Type.tp_name);
22575 0 : return false;
22576 : }
22577 : }
22578 6 : if (py_max_size == NULL) {
22579 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_size");
22580 0 : return false;
22581 : }
22582 : {
22583 6 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_size));
22584 6 : if (PyLong_Check(py_max_size)) {
22585 0 : unsigned long long test_var;
22586 6 : test_var = PyLong_AsUnsignedLongLong(py_max_size);
22587 6 : if (PyErr_Occurred() != NULL) {
22588 0 : return false;
22589 : }
22590 6 : if (test_var > uint_max) {
22591 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
22592 : PyLong_Type.tp_name, uint_max, test_var);
22593 0 : return false;
22594 : }
22595 6 : r->in.max_size = test_var;
22596 : } else {
22597 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
22598 : PyLong_Type.tp_name);
22599 0 : return false;
22600 : }
22601 : }
22602 6 : return true;
22603 : }
22604 :
22605 6 : static PyObject *unpack_py_samr_EnumDomainAliases_args_out(struct samr_EnumDomainAliases *r)
22606 : {
22607 0 : PyObject *result;
22608 0 : PyObject *py_resume_handle;
22609 0 : PyObject *py_sam;
22610 0 : PyObject *py_num_entries;
22611 6 : result = PyTuple_New(3);
22612 6 : py_resume_handle = PyLong_FromUnsignedLongLong((uint32_t)*r->out.resume_handle);
22613 6 : PyTuple_SetItem(result, 0, py_resume_handle);
22614 6 : if (*r->out.sam == NULL) {
22615 0 : py_sam = Py_None;
22616 0 : Py_INCREF(py_sam);
22617 : } else {
22618 6 : py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
22619 : }
22620 6 : PyTuple_SetItem(result, 1, py_sam);
22621 6 : py_num_entries = PyLong_FromUnsignedLongLong((uint32_t)*r->out.num_entries);
22622 6 : PyTuple_SetItem(result, 2, py_num_entries);
22623 6 : if (NT_STATUS_IS_ERR(r->out.result)) {
22624 0 : PyErr_SetNTSTATUS(r->out.result);
22625 0 : return NULL;
22626 : }
22627 :
22628 6 : return result;
22629 : }
22630 :
22631 :
22632 0 : static PyObject *py_samr_GetAliasMembership_in_get_domain_handle(PyObject *obj, void *closure)
22633 : {
22634 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj);
22635 0 : PyObject *py_domain_handle;
22636 0 : if (object->in.domain_handle == NULL) {
22637 0 : Py_RETURN_NONE;
22638 : }
22639 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
22640 0 : return py_domain_handle;
22641 : }
22642 :
22643 0 : static int py_samr_GetAliasMembership_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
22644 : {
22645 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22646 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
22647 0 : if (value == NULL) {
22648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
22649 0 : return -1;
22650 : }
22651 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
22652 0 : if (object->in.domain_handle == NULL) {
22653 0 : PyErr_NoMemory();
22654 0 : return -1;
22655 : }
22656 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
22657 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22658 0 : PyErr_NoMemory();
22659 0 : return -1;
22660 : }
22661 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
22662 0 : return 0;
22663 : }
22664 :
22665 0 : static PyObject *py_samr_GetAliasMembership_in_get_sids(PyObject *obj, void *closure)
22666 : {
22667 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj);
22668 0 : PyObject *py_sids;
22669 0 : if (object->in.sids == NULL) {
22670 0 : Py_RETURN_NONE;
22671 : }
22672 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
22673 0 : return py_sids;
22674 : }
22675 :
22676 0 : static int py_samr_GetAliasMembership_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
22677 : {
22678 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22679 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
22680 0 : if (value == NULL) {
22681 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
22682 0 : return -1;
22683 : }
22684 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
22685 0 : if (object->in.sids == NULL) {
22686 0 : PyErr_NoMemory();
22687 0 : return -1;
22688 : }
22689 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
22690 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22691 0 : PyErr_NoMemory();
22692 0 : return -1;
22693 : }
22694 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
22695 0 : return 0;
22696 : }
22697 :
22698 0 : static PyObject *py_samr_GetAliasMembership_out_get_rids(PyObject *obj, void *closure)
22699 : {
22700 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj);
22701 0 : PyObject *py_rids;
22702 0 : if (object->out.rids == NULL) {
22703 0 : Py_RETURN_NONE;
22704 : }
22705 0 : py_rids = pytalloc_reference_ex(&samr_Ids_Type, object->out.rids, object->out.rids);
22706 0 : return py_rids;
22707 : }
22708 :
22709 0 : static int py_samr_GetAliasMembership_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
22710 : {
22711 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22712 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
22713 0 : if (value == NULL) {
22714 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
22715 0 : return -1;
22716 : }
22717 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
22718 0 : if (object->out.rids == NULL) {
22719 0 : PyErr_NoMemory();
22720 0 : return -1;
22721 : }
22722 0 : PY_CHECK_TYPE(&samr_Ids_Type, value, return -1;);
22723 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
22724 0 : PyErr_NoMemory();
22725 0 : return -1;
22726 : }
22727 0 : object->out.rids = (struct samr_Ids *)pytalloc_get_ptr(value);
22728 0 : return 0;
22729 : }
22730 :
22731 0 : static PyObject *py_samr_GetAliasMembership_get_result(PyObject *obj, void *closure)
22732 : {
22733 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(obj);
22734 0 : PyObject *py_result;
22735 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
22736 0 : return py_result;
22737 : }
22738 :
22739 0 : static int py_samr_GetAliasMembership_set_result(PyObject *py_obj, PyObject *value, void *closure)
22740 : {
22741 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22742 0 : if (value == NULL) {
22743 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
22744 0 : return -1;
22745 : }
22746 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
22747 0 : return 0;
22748 : }
22749 :
22750 : static PyGetSetDef py_samr_GetAliasMembership_getsetters[] = {
22751 : {
22752 : .name = discard_const_p(char, "in_domain_handle"),
22753 : .get = py_samr_GetAliasMembership_in_get_domain_handle,
22754 : .set = py_samr_GetAliasMembership_in_set_domain_handle,
22755 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
22756 : },
22757 : {
22758 : .name = discard_const_p(char, "in_sids"),
22759 : .get = py_samr_GetAliasMembership_in_get_sids,
22760 : .set = py_samr_GetAliasMembership_in_set_sids,
22761 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
22762 : },
22763 : {
22764 : .name = discard_const_p(char, "out_rids"),
22765 : .get = py_samr_GetAliasMembership_out_get_rids,
22766 : .set = py_samr_GetAliasMembership_out_set_rids,
22767 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids")
22768 : },
22769 : {
22770 : .name = discard_const_p(char, "result"),
22771 : .get = py_samr_GetAliasMembership_get_result,
22772 : .set = py_samr_GetAliasMembership_set_result,
22773 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
22774 : },
22775 : { .name = NULL }
22776 : };
22777 :
22778 0 : static PyObject *py_samr_GetAliasMembership_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
22779 : {
22780 0 : PyObject *self = pytalloc_new(struct samr_GetAliasMembership, type);
22781 0 : struct samr_GetAliasMembership *_self = (struct samr_GetAliasMembership *)pytalloc_get_ptr(self);
22782 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
22783 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
22784 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
22785 0 : _self->out.rids = talloc_zero(mem_ctx, struct samr_Ids);
22786 0 : return self;
22787 : }
22788 :
22789 0 : static PyObject *py_samr_GetAliasMembership_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
22790 : {
22791 :
22792 :
22793 0 : return PyLong_FromLong(16);
22794 : }
22795 :
22796 0 : static PyObject *py_samr_GetAliasMembership_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
22797 : {
22798 0 : const struct ndr_interface_call *call = NULL;
22799 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22800 0 : PyObject *ret = NULL;
22801 0 : struct ndr_push *push = NULL;
22802 0 : DATA_BLOB blob;
22803 0 : enum ndr_err_code err;
22804 :
22805 0 : if (ndr_table_samr.num_calls < 17) {
22806 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_pack");
22807 0 : return NULL;
22808 : }
22809 0 : call = &ndr_table_samr.calls[16];
22810 :
22811 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
22812 0 : if (push == NULL) {
22813 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22814 0 : return NULL;
22815 : }
22816 :
22817 0 : push->flags |= ndr_push_flags;
22818 :
22819 0 : err = call->ndr_push(push, ndr_inout_flags, object);
22820 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22821 0 : TALLOC_FREE(push);
22822 0 : PyErr_SetNdrError(err);
22823 0 : return NULL;
22824 : }
22825 0 : blob = ndr_push_blob(push);
22826 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
22827 0 : TALLOC_FREE(push);
22828 0 : return ret;
22829 : }
22830 :
22831 0 : static PyObject *py_samr_GetAliasMembership_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22832 : {
22833 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22834 0 : PyObject *bigendian_obj = NULL;
22835 0 : PyObject *ndr64_obj = NULL;
22836 0 : libndr_flags ndr_push_flags = 0;
22837 :
22838 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
22839 : discard_const_p(char *, kwnames),
22840 : &bigendian_obj,
22841 : &ndr64_obj)) {
22842 0 : return NULL;
22843 : }
22844 :
22845 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22846 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22847 : }
22848 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22849 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22850 : }
22851 :
22852 0 : return py_samr_GetAliasMembership_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
22853 : }
22854 :
22855 0 : static PyObject *py_samr_GetAliasMembership_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22856 : {
22857 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
22858 0 : PyObject *bigendian_obj = NULL;
22859 0 : PyObject *ndr64_obj = NULL;
22860 0 : libndr_flags ndr_push_flags = 0;
22861 :
22862 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
22863 : discard_const_p(char *, kwnames),
22864 : &bigendian_obj,
22865 : &ndr64_obj)) {
22866 0 : return NULL;
22867 : }
22868 :
22869 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22870 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
22871 : }
22872 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22873 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
22874 : }
22875 :
22876 0 : return py_samr_GetAliasMembership_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
22877 : }
22878 :
22879 0 : static PyObject *py_samr_GetAliasMembership_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
22880 : {
22881 0 : const struct ndr_interface_call *call = NULL;
22882 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
22883 0 : struct ndr_pull *pull = NULL;
22884 0 : enum ndr_err_code err;
22885 :
22886 0 : if (ndr_table_samr.num_calls < 17) {
22887 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_unpack");
22888 0 : return NULL;
22889 : }
22890 0 : call = &ndr_table_samr.calls[16];
22891 :
22892 0 : pull = ndr_pull_init_blob(blob, object);
22893 0 : if (pull == NULL) {
22894 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
22895 0 : return NULL;
22896 : }
22897 :
22898 0 : pull->flags |= ndr_pull_flags;
22899 :
22900 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
22901 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
22902 0 : TALLOC_FREE(pull);
22903 0 : PyErr_SetNdrError(err);
22904 0 : return NULL;
22905 : }
22906 0 : if (!allow_remaining) {
22907 0 : uint32_t highest_ofs;
22908 :
22909 0 : if (pull->offset > pull->relative_highest_offset) {
22910 0 : highest_ofs = pull->offset;
22911 : } else {
22912 0 : highest_ofs = pull->relative_highest_offset;
22913 : }
22914 0 : if (highest_ofs < pull->data_size) {
22915 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
22916 : "not all bytes consumed ofs[%u] size[%u]",
22917 : highest_ofs, pull->data_size);
22918 0 : TALLOC_FREE(pull);
22919 0 : PyErr_SetNdrError(err);
22920 0 : return NULL;
22921 : }
22922 : }
22923 :
22924 0 : TALLOC_FREE(pull);
22925 0 : Py_RETURN_NONE;
22926 : }
22927 :
22928 0 : static PyObject *py_samr_GetAliasMembership_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22929 : {
22930 0 : DATA_BLOB blob;
22931 0 : Py_ssize_t blob_length = 0;
22932 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22933 0 : PyObject *bigendian_obj = NULL;
22934 0 : PyObject *ndr64_obj = NULL;
22935 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22936 0 : PyObject *allow_remaining_obj = NULL;
22937 0 : bool allow_remaining = false;
22938 :
22939 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
22940 : discard_const_p(char *, kwnames),
22941 : &blob.data, &blob_length,
22942 : &bigendian_obj,
22943 : &ndr64_obj,
22944 : &allow_remaining_obj)) {
22945 0 : return NULL;
22946 : }
22947 0 : blob.length = blob_length;
22948 :
22949 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22950 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22951 : }
22952 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22953 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22954 : }
22955 :
22956 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22957 0 : allow_remaining = true;
22958 : }
22959 :
22960 0 : return py_samr_GetAliasMembership_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
22961 : }
22962 :
22963 0 : static PyObject *py_samr_GetAliasMembership_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
22964 : {
22965 0 : DATA_BLOB blob;
22966 0 : Py_ssize_t blob_length = 0;
22967 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
22968 0 : PyObject *bigendian_obj = NULL;
22969 0 : PyObject *ndr64_obj = NULL;
22970 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
22971 0 : PyObject *allow_remaining_obj = NULL;
22972 0 : bool allow_remaining = false;
22973 :
22974 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
22975 : discard_const_p(char *, kwnames),
22976 : &blob.data, &blob_length,
22977 : &bigendian_obj,
22978 : &ndr64_obj,
22979 : &allow_remaining_obj)) {
22980 0 : return NULL;
22981 : }
22982 0 : blob.length = blob_length;
22983 :
22984 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
22985 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
22986 : }
22987 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
22988 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
22989 : }
22990 :
22991 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
22992 0 : allow_remaining = true;
22993 : }
22994 :
22995 0 : return py_samr_GetAliasMembership_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
22996 : }
22997 :
22998 0 : static PyObject *py_samr_GetAliasMembership_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
22999 : {
23000 0 : const struct ndr_interface_call *call = NULL;
23001 0 : struct samr_GetAliasMembership *object = (struct samr_GetAliasMembership *)pytalloc_get_ptr(py_obj);
23002 0 : PyObject *ret;
23003 0 : char *retstr;
23004 :
23005 0 : if (ndr_table_samr.num_calls < 17) {
23006 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetAliasMembership_ndr_print");
23007 0 : return NULL;
23008 : }
23009 0 : call = &ndr_table_samr.calls[16];
23010 :
23011 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23012 0 : ret = PyUnicode_FromString(retstr);
23013 0 : TALLOC_FREE(retstr);
23014 :
23015 0 : return ret;
23016 : }
23017 :
23018 0 : static PyObject *py_samr_GetAliasMembership_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23019 : {
23020 0 : return py_samr_GetAliasMembership_ndr_print(py_obj, "samr_GetAliasMembership_in", NDR_IN);
23021 : }
23022 :
23023 0 : static PyObject *py_samr_GetAliasMembership_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23024 : {
23025 0 : return py_samr_GetAliasMembership_ndr_print(py_obj, "samr_GetAliasMembership_out", NDR_OUT);
23026 : }
23027 :
23028 : static PyMethodDef py_samr_GetAliasMembership_methods[] = {
23029 : { "opnum", (PyCFunction)py_samr_GetAliasMembership_ndr_opnum, METH_NOARGS|METH_CLASS,
23030 : "samr.GetAliasMembership.opnum() -> 16 (0x10) " },
23031 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetAliasMembership_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23032 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23033 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetAliasMembership_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23034 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23035 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetAliasMembership_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23036 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23037 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetAliasMembership_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23038 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23039 : { "__ndr_print_in__", (PyCFunction)py_samr_GetAliasMembership_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23040 : { "__ndr_print_out__", (PyCFunction)py_samr_GetAliasMembership_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23041 : { NULL, NULL, 0, NULL }
23042 : };
23043 :
23044 :
23045 : static PyTypeObject samr_GetAliasMembership_Type = {
23046 : PyVarObject_HEAD_INIT(NULL, 0)
23047 : .tp_name = "samr.GetAliasMembership",
23048 : .tp_getset = py_samr_GetAliasMembership_getsetters,
23049 : .tp_methods = py_samr_GetAliasMembership_methods,
23050 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23051 : .tp_new = py_samr_GetAliasMembership_new,
23052 : };
23053 :
23054 1 : static bool pack_py_samr_GetAliasMembership_args_in(PyObject *args, PyObject *kwargs, struct samr_GetAliasMembership *r)
23055 : {
23056 0 : PyObject *py_domain_handle;
23057 0 : PyObject *py_sids;
23058 1 : const char *kwnames[] = {
23059 : "domain_handle", "sids", NULL
23060 : };
23061 :
23062 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_GetAliasMembership", discard_const_p(char *, kwnames), &py_domain_handle, &py_sids)) {
23063 0 : return false;
23064 : }
23065 :
23066 1 : if (py_domain_handle == NULL) {
23067 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
23068 0 : return false;
23069 : }
23070 1 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
23071 1 : if (r->in.domain_handle == NULL) {
23072 0 : PyErr_NoMemory();
23073 0 : return false;
23074 : }
23075 1 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
23076 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
23077 0 : PyErr_NoMemory();
23078 0 : return false;
23079 : }
23080 1 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
23081 1 : if (py_sids == NULL) {
23082 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
23083 0 : return false;
23084 : }
23085 1 : r->in.sids = talloc_ptrtype(r, r->in.sids);
23086 1 : if (r->in.sids == NULL) {
23087 0 : PyErr_NoMemory();
23088 0 : return false;
23089 : }
23090 1 : PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
23091 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
23092 0 : PyErr_NoMemory();
23093 0 : return false;
23094 : }
23095 1 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
23096 1 : return true;
23097 : }
23098 :
23099 1 : static PyObject *unpack_py_samr_GetAliasMembership_args_out(struct samr_GetAliasMembership *r)
23100 : {
23101 0 : PyObject *result;
23102 0 : PyObject *py_rids;
23103 1 : py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids);
23104 1 : result = py_rids;
23105 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
23106 0 : PyErr_SetNTSTATUS(r->out.result);
23107 0 : return NULL;
23108 : }
23109 :
23110 1 : return result;
23111 : }
23112 :
23113 :
23114 0 : static PyObject *py_samr_LookupNames_in_get_domain_handle(PyObject *obj, void *closure)
23115 : {
23116 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23117 0 : PyObject *py_domain_handle;
23118 0 : if (object->in.domain_handle == NULL) {
23119 0 : Py_RETURN_NONE;
23120 : }
23121 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
23122 0 : return py_domain_handle;
23123 : }
23124 :
23125 0 : static int py_samr_LookupNames_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
23126 : {
23127 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23128 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
23129 0 : if (value == NULL) {
23130 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
23131 0 : return -1;
23132 : }
23133 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
23134 0 : if (object->in.domain_handle == NULL) {
23135 0 : PyErr_NoMemory();
23136 0 : return -1;
23137 : }
23138 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23139 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23140 0 : PyErr_NoMemory();
23141 0 : return -1;
23142 : }
23143 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
23144 0 : return 0;
23145 : }
23146 :
23147 0 : static PyObject *py_samr_LookupNames_in_get_num_names(PyObject *obj, void *closure)
23148 : {
23149 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23150 0 : PyObject *py_num_names;
23151 0 : py_num_names = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_names);
23152 0 : return py_num_names;
23153 : }
23154 :
23155 0 : static int py_samr_LookupNames_in_set_num_names(PyObject *py_obj, PyObject *value, void *closure)
23156 : {
23157 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23158 0 : if (value == NULL) {
23159 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_names");
23160 0 : return -1;
23161 : }
23162 : {
23163 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_names));
23164 0 : if (PyLong_Check(value)) {
23165 0 : unsigned long long test_var;
23166 0 : test_var = PyLong_AsUnsignedLongLong(value);
23167 0 : if (PyErr_Occurred() != NULL) {
23168 0 : return -1;
23169 : }
23170 0 : if (test_var > uint_max) {
23171 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23172 : PyLong_Type.tp_name, uint_max, test_var);
23173 0 : return -1;
23174 : }
23175 0 : object->in.num_names = test_var;
23176 : } else {
23177 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23178 : PyLong_Type.tp_name);
23179 0 : return -1;
23180 : }
23181 : }
23182 0 : return 0;
23183 : }
23184 :
23185 0 : static PyObject *py_samr_LookupNames_in_get_names(PyObject *obj, void *closure)
23186 : {
23187 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23188 0 : PyObject *py_names;
23189 0 : py_names = PyList_New(object->in.num_names);
23190 0 : if (py_names == NULL) {
23191 0 : return NULL;
23192 : }
23193 : {
23194 : int names_cntr_0;
23195 0 : for (names_cntr_0 = 0; names_cntr_0 < (object->in.num_names); names_cntr_0++) {
23196 0 : PyObject *py_names_0;
23197 0 : py_names_0 = pytalloc_reference_ex(lsa_String_Type, object->in.names, &object->in.names[names_cntr_0]);
23198 0 : PyList_SetItem(py_names, names_cntr_0, py_names_0);
23199 : }
23200 : }
23201 0 : return py_names;
23202 : }
23203 :
23204 0 : static int py_samr_LookupNames_in_set_names(PyObject *py_obj, PyObject *value, void *closure)
23205 : {
23206 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23207 0 : if (value == NULL) {
23208 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names");
23209 0 : return -1;
23210 : }
23211 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
23212 : {
23213 0 : int names_cntr_0;
23214 0 : object->in.names = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.names, PyList_GET_SIZE(value));
23215 0 : if (!object->in.names) { return -1; }
23216 0 : talloc_set_name_const(object->in.names, "ARRAY: object->in.names");
23217 0 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(value); names_cntr_0++) {
23218 0 : if (PyList_GET_ITEM(value, names_cntr_0) == NULL) {
23219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.names[names_cntr_0]");
23220 0 : return -1;
23221 : }
23222 0 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, names_cntr_0), return -1;);
23223 0 : if (talloc_reference(object->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, names_cntr_0))) == NULL) {
23224 0 : PyErr_NoMemory();
23225 0 : return -1;
23226 : }
23227 0 : object->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, names_cntr_0));
23228 : }
23229 : }
23230 0 : return 0;
23231 : }
23232 :
23233 0 : static PyObject *py_samr_LookupNames_out_get_rids(PyObject *obj, void *closure)
23234 : {
23235 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23236 0 : PyObject *py_rids;
23237 0 : if (object->out.rids == NULL) {
23238 0 : Py_RETURN_NONE;
23239 : }
23240 0 : py_rids = pytalloc_reference_ex(&samr_Ids_Type, object->out.rids, object->out.rids);
23241 0 : return py_rids;
23242 : }
23243 :
23244 0 : static int py_samr_LookupNames_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
23245 : {
23246 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23247 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
23248 0 : if (value == NULL) {
23249 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
23250 0 : return -1;
23251 : }
23252 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
23253 0 : if (object->out.rids == NULL) {
23254 0 : PyErr_NoMemory();
23255 0 : return -1;
23256 : }
23257 0 : PY_CHECK_TYPE(&samr_Ids_Type, value, return -1;);
23258 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23259 0 : PyErr_NoMemory();
23260 0 : return -1;
23261 : }
23262 0 : object->out.rids = (struct samr_Ids *)pytalloc_get_ptr(value);
23263 0 : return 0;
23264 : }
23265 :
23266 0 : static PyObject *py_samr_LookupNames_out_get_types(PyObject *obj, void *closure)
23267 : {
23268 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23269 0 : PyObject *py_types;
23270 0 : if (object->out.types == NULL) {
23271 0 : Py_RETURN_NONE;
23272 : }
23273 0 : py_types = pytalloc_reference_ex(&samr_Ids_Type, object->out.types, object->out.types);
23274 0 : return py_types;
23275 : }
23276 :
23277 0 : static int py_samr_LookupNames_out_set_types(PyObject *py_obj, PyObject *value, void *closure)
23278 : {
23279 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23280 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.types));
23281 0 : if (value == NULL) {
23282 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.types");
23283 0 : return -1;
23284 : }
23285 0 : object->out.types = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.types);
23286 0 : if (object->out.types == NULL) {
23287 0 : PyErr_NoMemory();
23288 0 : return -1;
23289 : }
23290 0 : PY_CHECK_TYPE(&samr_Ids_Type, value, return -1;);
23291 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23292 0 : PyErr_NoMemory();
23293 0 : return -1;
23294 : }
23295 0 : object->out.types = (struct samr_Ids *)pytalloc_get_ptr(value);
23296 0 : return 0;
23297 : }
23298 :
23299 0 : static PyObject *py_samr_LookupNames_get_result(PyObject *obj, void *closure)
23300 : {
23301 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(obj);
23302 0 : PyObject *py_result;
23303 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23304 0 : return py_result;
23305 : }
23306 :
23307 0 : static int py_samr_LookupNames_set_result(PyObject *py_obj, PyObject *value, void *closure)
23308 : {
23309 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23310 0 : if (value == NULL) {
23311 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23312 0 : return -1;
23313 : }
23314 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23315 0 : return 0;
23316 : }
23317 :
23318 : static PyGetSetDef py_samr_LookupNames_getsetters[] = {
23319 : {
23320 : .name = discard_const_p(char, "in_domain_handle"),
23321 : .get = py_samr_LookupNames_in_get_domain_handle,
23322 : .set = py_samr_LookupNames_in_set_domain_handle,
23323 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23324 : },
23325 : {
23326 : .name = discard_const_p(char, "in_num_names"),
23327 : .get = py_samr_LookupNames_in_get_num_names,
23328 : .set = py_samr_LookupNames_in_set_num_names,
23329 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23330 : },
23331 : {
23332 : .name = discard_const_p(char, "in_names"),
23333 : .get = py_samr_LookupNames_in_get_names,
23334 : .set = py_samr_LookupNames_in_set_names,
23335 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
23336 : },
23337 : {
23338 : .name = discard_const_p(char, "out_rids"),
23339 : .get = py_samr_LookupNames_out_get_rids,
23340 : .set = py_samr_LookupNames_out_set_rids,
23341 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids")
23342 : },
23343 : {
23344 : .name = discard_const_p(char, "out_types"),
23345 : .get = py_samr_LookupNames_out_get_types,
23346 : .set = py_samr_LookupNames_out_set_types,
23347 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids")
23348 : },
23349 : {
23350 : .name = discard_const_p(char, "result"),
23351 : .get = py_samr_LookupNames_get_result,
23352 : .set = py_samr_LookupNames_set_result,
23353 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23354 : },
23355 : { .name = NULL }
23356 : };
23357 :
23358 0 : static PyObject *py_samr_LookupNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23359 : {
23360 0 : PyObject *self = pytalloc_new(struct samr_LookupNames, type);
23361 0 : struct samr_LookupNames *_self = (struct samr_LookupNames *)pytalloc_get_ptr(self);
23362 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23363 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
23364 0 : _self->out.rids = talloc_zero(mem_ctx, struct samr_Ids);
23365 0 : _self->out.types = talloc_zero(mem_ctx, struct samr_Ids);
23366 0 : return self;
23367 : }
23368 :
23369 0 : static PyObject *py_samr_LookupNames_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23370 : {
23371 :
23372 :
23373 0 : return PyLong_FromLong(17);
23374 : }
23375 :
23376 0 : static PyObject *py_samr_LookupNames_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23377 : {
23378 0 : const struct ndr_interface_call *call = NULL;
23379 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23380 0 : PyObject *ret = NULL;
23381 0 : struct ndr_push *push = NULL;
23382 0 : DATA_BLOB blob;
23383 0 : enum ndr_err_code err;
23384 :
23385 0 : if (ndr_table_samr.num_calls < 18) {
23386 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_pack");
23387 0 : return NULL;
23388 : }
23389 0 : call = &ndr_table_samr.calls[17];
23390 :
23391 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
23392 0 : if (push == NULL) {
23393 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23394 0 : return NULL;
23395 : }
23396 :
23397 0 : push->flags |= ndr_push_flags;
23398 :
23399 0 : err = call->ndr_push(push, ndr_inout_flags, object);
23400 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23401 0 : TALLOC_FREE(push);
23402 0 : PyErr_SetNdrError(err);
23403 0 : return NULL;
23404 : }
23405 0 : blob = ndr_push_blob(push);
23406 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
23407 0 : TALLOC_FREE(push);
23408 0 : return ret;
23409 : }
23410 :
23411 0 : static PyObject *py_samr_LookupNames_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23412 : {
23413 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23414 0 : PyObject *bigendian_obj = NULL;
23415 0 : PyObject *ndr64_obj = NULL;
23416 0 : libndr_flags ndr_push_flags = 0;
23417 :
23418 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
23419 : discard_const_p(char *, kwnames),
23420 : &bigendian_obj,
23421 : &ndr64_obj)) {
23422 0 : return NULL;
23423 : }
23424 :
23425 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23426 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23427 : }
23428 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23429 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23430 : }
23431 :
23432 0 : return py_samr_LookupNames_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
23433 : }
23434 :
23435 0 : static PyObject *py_samr_LookupNames_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23436 : {
23437 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
23438 0 : PyObject *bigendian_obj = NULL;
23439 0 : PyObject *ndr64_obj = NULL;
23440 0 : libndr_flags ndr_push_flags = 0;
23441 :
23442 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
23443 : discard_const_p(char *, kwnames),
23444 : &bigendian_obj,
23445 : &ndr64_obj)) {
23446 0 : return NULL;
23447 : }
23448 :
23449 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23450 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
23451 : }
23452 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23453 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
23454 : }
23455 :
23456 0 : return py_samr_LookupNames_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
23457 : }
23458 :
23459 0 : static PyObject *py_samr_LookupNames_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
23460 : {
23461 0 : const struct ndr_interface_call *call = NULL;
23462 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23463 0 : struct ndr_pull *pull = NULL;
23464 0 : enum ndr_err_code err;
23465 :
23466 0 : if (ndr_table_samr.num_calls < 18) {
23467 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_unpack");
23468 0 : return NULL;
23469 : }
23470 0 : call = &ndr_table_samr.calls[17];
23471 :
23472 0 : pull = ndr_pull_init_blob(blob, object);
23473 0 : if (pull == NULL) {
23474 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
23475 0 : return NULL;
23476 : }
23477 :
23478 0 : pull->flags |= ndr_pull_flags;
23479 :
23480 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
23481 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
23482 0 : TALLOC_FREE(pull);
23483 0 : PyErr_SetNdrError(err);
23484 0 : return NULL;
23485 : }
23486 0 : if (!allow_remaining) {
23487 0 : uint32_t highest_ofs;
23488 :
23489 0 : if (pull->offset > pull->relative_highest_offset) {
23490 0 : highest_ofs = pull->offset;
23491 : } else {
23492 0 : highest_ofs = pull->relative_highest_offset;
23493 : }
23494 0 : if (highest_ofs < pull->data_size) {
23495 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
23496 : "not all bytes consumed ofs[%u] size[%u]",
23497 : highest_ofs, pull->data_size);
23498 0 : TALLOC_FREE(pull);
23499 0 : PyErr_SetNdrError(err);
23500 0 : return NULL;
23501 : }
23502 : }
23503 :
23504 0 : TALLOC_FREE(pull);
23505 0 : Py_RETURN_NONE;
23506 : }
23507 :
23508 0 : static PyObject *py_samr_LookupNames_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23509 : {
23510 0 : DATA_BLOB blob;
23511 0 : Py_ssize_t blob_length = 0;
23512 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23513 0 : PyObject *bigendian_obj = NULL;
23514 0 : PyObject *ndr64_obj = NULL;
23515 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23516 0 : PyObject *allow_remaining_obj = NULL;
23517 0 : bool allow_remaining = false;
23518 :
23519 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
23520 : discard_const_p(char *, kwnames),
23521 : &blob.data, &blob_length,
23522 : &bigendian_obj,
23523 : &ndr64_obj,
23524 : &allow_remaining_obj)) {
23525 0 : return NULL;
23526 : }
23527 0 : blob.length = blob_length;
23528 :
23529 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23530 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23531 : }
23532 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23533 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23534 : }
23535 :
23536 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23537 0 : allow_remaining = true;
23538 : }
23539 :
23540 0 : return py_samr_LookupNames_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
23541 : }
23542 :
23543 0 : static PyObject *py_samr_LookupNames_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
23544 : {
23545 0 : DATA_BLOB blob;
23546 0 : Py_ssize_t blob_length = 0;
23547 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
23548 0 : PyObject *bigendian_obj = NULL;
23549 0 : PyObject *ndr64_obj = NULL;
23550 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
23551 0 : PyObject *allow_remaining_obj = NULL;
23552 0 : bool allow_remaining = false;
23553 :
23554 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
23555 : discard_const_p(char *, kwnames),
23556 : &blob.data, &blob_length,
23557 : &bigendian_obj,
23558 : &ndr64_obj,
23559 : &allow_remaining_obj)) {
23560 0 : return NULL;
23561 : }
23562 0 : blob.length = blob_length;
23563 :
23564 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
23565 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
23566 : }
23567 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
23568 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
23569 : }
23570 :
23571 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
23572 0 : allow_remaining = true;
23573 : }
23574 :
23575 0 : return py_samr_LookupNames_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
23576 : }
23577 :
23578 0 : static PyObject *py_samr_LookupNames_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
23579 : {
23580 0 : const struct ndr_interface_call *call = NULL;
23581 0 : struct samr_LookupNames *object = (struct samr_LookupNames *)pytalloc_get_ptr(py_obj);
23582 0 : PyObject *ret;
23583 0 : char *retstr;
23584 :
23585 0 : if (ndr_table_samr.num_calls < 18) {
23586 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupNames_ndr_print");
23587 0 : return NULL;
23588 : }
23589 0 : call = &ndr_table_samr.calls[17];
23590 :
23591 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
23592 0 : ret = PyUnicode_FromString(retstr);
23593 0 : TALLOC_FREE(retstr);
23594 :
23595 0 : return ret;
23596 : }
23597 :
23598 0 : static PyObject *py_samr_LookupNames_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23599 : {
23600 0 : return py_samr_LookupNames_ndr_print(py_obj, "samr_LookupNames_in", NDR_IN);
23601 : }
23602 :
23603 0 : static PyObject *py_samr_LookupNames_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
23604 : {
23605 0 : return py_samr_LookupNames_ndr_print(py_obj, "samr_LookupNames_out", NDR_OUT);
23606 : }
23607 :
23608 : static PyMethodDef py_samr_LookupNames_methods[] = {
23609 : { "opnum", (PyCFunction)py_samr_LookupNames_ndr_opnum, METH_NOARGS|METH_CLASS,
23610 : "samr.LookupNames.opnum() -> 17 (0x11) " },
23611 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupNames_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
23612 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
23613 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupNames_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
23614 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
23615 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupNames_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
23616 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
23617 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupNames_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
23618 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
23619 : { "__ndr_print_in__", (PyCFunction)py_samr_LookupNames_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
23620 : { "__ndr_print_out__", (PyCFunction)py_samr_LookupNames_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
23621 : { NULL, NULL, 0, NULL }
23622 : };
23623 :
23624 :
23625 : static PyTypeObject samr_LookupNames_Type = {
23626 : PyVarObject_HEAD_INIT(NULL, 0)
23627 : .tp_name = "samr.LookupNames",
23628 : .tp_getset = py_samr_LookupNames_getsetters,
23629 : .tp_methods = py_samr_LookupNames_methods,
23630 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
23631 : .tp_new = py_samr_LookupNames_new,
23632 : };
23633 :
23634 10 : static bool pack_py_samr_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupNames *r)
23635 : {
23636 0 : PyObject *py_domain_handle;
23637 0 : PyObject *py_names;
23638 10 : const char *kwnames[] = {
23639 : "domain_handle", "names", NULL
23640 : };
23641 :
23642 10 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupNames", discard_const_p(char *, kwnames), &py_domain_handle, &py_names)) {
23643 0 : return false;
23644 : }
23645 :
23646 10 : if (py_domain_handle == NULL) {
23647 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
23648 0 : return false;
23649 : }
23650 10 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
23651 10 : if (r->in.domain_handle == NULL) {
23652 0 : PyErr_NoMemory();
23653 0 : return false;
23654 : }
23655 10 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
23656 10 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
23657 0 : PyErr_NoMemory();
23658 0 : return false;
23659 : }
23660 10 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
23661 10 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
23662 10 : r->in.num_names = PyList_GET_SIZE(py_names);
23663 10 : if (py_names == NULL) {
23664 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names");
23665 0 : return false;
23666 : }
23667 10 : PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
23668 : {
23669 0 : int names_cntr_0;
23670 10 : r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
23671 10 : if (!r->in.names) { return false; }
23672 10 : talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
23673 20 : for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
23674 10 : if (PyList_GET_ITEM(py_names, names_cntr_0) == NULL) {
23675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.names[names_cntr_0]");
23676 0 : return false;
23677 : }
23678 10 : PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
23679 10 : if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
23680 0 : PyErr_NoMemory();
23681 0 : return false;
23682 : }
23683 10 : r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
23684 : }
23685 : }
23686 10 : return true;
23687 : }
23688 :
23689 10 : static PyObject *unpack_py_samr_LookupNames_args_out(struct samr_LookupNames *r)
23690 : {
23691 0 : PyObject *result;
23692 0 : PyObject *py_rids;
23693 0 : PyObject *py_types;
23694 10 : result = PyTuple_New(2);
23695 10 : py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids);
23696 10 : PyTuple_SetItem(result, 0, py_rids);
23697 10 : py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types);
23698 10 : PyTuple_SetItem(result, 1, py_types);
23699 10 : if (NT_STATUS_IS_ERR(r->out.result)) {
23700 0 : PyErr_SetNTSTATUS(r->out.result);
23701 0 : return NULL;
23702 : }
23703 :
23704 10 : return result;
23705 : }
23706 :
23707 :
23708 0 : static PyObject *py_samr_LookupRids_in_get_domain_handle(PyObject *obj, void *closure)
23709 : {
23710 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23711 0 : PyObject *py_domain_handle;
23712 0 : if (object->in.domain_handle == NULL) {
23713 0 : Py_RETURN_NONE;
23714 : }
23715 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
23716 0 : return py_domain_handle;
23717 : }
23718 :
23719 0 : static int py_samr_LookupRids_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
23720 : {
23721 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23722 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
23723 0 : if (value == NULL) {
23724 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
23725 0 : return -1;
23726 : }
23727 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
23728 0 : if (object->in.domain_handle == NULL) {
23729 0 : PyErr_NoMemory();
23730 0 : return -1;
23731 : }
23732 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
23733 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23734 0 : PyErr_NoMemory();
23735 0 : return -1;
23736 : }
23737 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
23738 0 : return 0;
23739 : }
23740 :
23741 0 : static PyObject *py_samr_LookupRids_in_get_num_rids(PyObject *obj, void *closure)
23742 : {
23743 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23744 0 : PyObject *py_num_rids;
23745 0 : py_num_rids = PyLong_FromUnsignedLongLong((uint32_t)object->in.num_rids);
23746 0 : return py_num_rids;
23747 : }
23748 :
23749 0 : static int py_samr_LookupRids_in_set_num_rids(PyObject *py_obj, PyObject *value, void *closure)
23750 : {
23751 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23752 0 : if (value == NULL) {
23753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.num_rids");
23754 0 : return -1;
23755 : }
23756 : {
23757 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.num_rids));
23758 0 : if (PyLong_Check(value)) {
23759 0 : unsigned long long test_var;
23760 0 : test_var = PyLong_AsUnsignedLongLong(value);
23761 0 : if (PyErr_Occurred() != NULL) {
23762 0 : return -1;
23763 : }
23764 0 : if (test_var > uint_max) {
23765 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23766 : PyLong_Type.tp_name, uint_max, test_var);
23767 0 : return -1;
23768 : }
23769 0 : object->in.num_rids = test_var;
23770 : } else {
23771 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23772 : PyLong_Type.tp_name);
23773 0 : return -1;
23774 : }
23775 : }
23776 0 : return 0;
23777 : }
23778 :
23779 0 : static PyObject *py_samr_LookupRids_in_get_rids(PyObject *obj, void *closure)
23780 : {
23781 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23782 0 : PyObject *py_rids;
23783 0 : py_rids = PyList_New(object->in.num_rids);
23784 0 : if (py_rids == NULL) {
23785 0 : return NULL;
23786 : }
23787 : {
23788 : int rids_cntr_0;
23789 0 : for (rids_cntr_0 = 0; rids_cntr_0 < (object->in.num_rids); rids_cntr_0++) {
23790 0 : PyObject *py_rids_0;
23791 0 : py_rids_0 = PyLong_FromUnsignedLongLong((uint32_t)object->in.rids[rids_cntr_0]);
23792 0 : PyList_SetItem(py_rids, rids_cntr_0, py_rids_0);
23793 : }
23794 : }
23795 0 : return py_rids;
23796 : }
23797 :
23798 0 : static int py_samr_LookupRids_in_set_rids(PyObject *py_obj, PyObject *value, void *closure)
23799 : {
23800 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23801 0 : if (value == NULL) {
23802 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids");
23803 0 : return -1;
23804 : }
23805 0 : PY_CHECK_TYPE(&PyList_Type, value, return -1;);
23806 : {
23807 0 : int rids_cntr_0;
23808 0 : object->in.rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.rids, PyList_GET_SIZE(value));
23809 0 : if (!object->in.rids) { return -1; }
23810 0 : talloc_set_name_const(object->in.rids, "ARRAY: object->in.rids");
23811 0 : for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(value); rids_cntr_0++) {
23812 0 : if (PyList_GET_ITEM(value, rids_cntr_0) == NULL) {
23813 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rids[rids_cntr_0]");
23814 0 : return -1;
23815 : }
23816 : {
23817 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rids[rids_cntr_0]));
23818 0 : if (PyLong_Check(PyList_GET_ITEM(value, rids_cntr_0))) {
23819 0 : unsigned long long test_var;
23820 0 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, rids_cntr_0));
23821 0 : if (PyErr_Occurred() != NULL) {
23822 0 : return -1;
23823 : }
23824 0 : if (test_var > uint_max) {
23825 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
23826 : PyLong_Type.tp_name, uint_max, test_var);
23827 0 : return -1;
23828 : }
23829 0 : object->in.rids[rids_cntr_0] = test_var;
23830 : } else {
23831 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
23832 : PyLong_Type.tp_name);
23833 0 : return -1;
23834 : }
23835 : }
23836 : }
23837 : }
23838 0 : return 0;
23839 : }
23840 :
23841 0 : static PyObject *py_samr_LookupRids_out_get_names(PyObject *obj, void *closure)
23842 : {
23843 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23844 0 : PyObject *py_names;
23845 0 : if (object->out.names == NULL) {
23846 0 : Py_RETURN_NONE;
23847 : }
23848 0 : py_names = pytalloc_reference_ex(lsa_Strings_Type, object->out.names, object->out.names);
23849 0 : return py_names;
23850 : }
23851 :
23852 0 : static int py_samr_LookupRids_out_set_names(PyObject *py_obj, PyObject *value, void *closure)
23853 : {
23854 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23855 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.names));
23856 0 : if (value == NULL) {
23857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.names");
23858 0 : return -1;
23859 : }
23860 0 : object->out.names = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.names);
23861 0 : if (object->out.names == NULL) {
23862 0 : PyErr_NoMemory();
23863 0 : return -1;
23864 : }
23865 0 : PY_CHECK_TYPE(lsa_Strings_Type, value, return -1;);
23866 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23867 0 : PyErr_NoMemory();
23868 0 : return -1;
23869 : }
23870 0 : object->out.names = (struct lsa_Strings *)pytalloc_get_ptr(value);
23871 0 : return 0;
23872 : }
23873 :
23874 0 : static PyObject *py_samr_LookupRids_out_get_types(PyObject *obj, void *closure)
23875 : {
23876 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23877 0 : PyObject *py_types;
23878 0 : if (object->out.types == NULL) {
23879 0 : Py_RETURN_NONE;
23880 : }
23881 0 : py_types = pytalloc_reference_ex(&samr_Ids_Type, object->out.types, object->out.types);
23882 0 : return py_types;
23883 : }
23884 :
23885 0 : static int py_samr_LookupRids_out_set_types(PyObject *py_obj, PyObject *value, void *closure)
23886 : {
23887 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23888 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.types));
23889 0 : if (value == NULL) {
23890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.types");
23891 0 : return -1;
23892 : }
23893 0 : object->out.types = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.types);
23894 0 : if (object->out.types == NULL) {
23895 0 : PyErr_NoMemory();
23896 0 : return -1;
23897 : }
23898 0 : PY_CHECK_TYPE(&samr_Ids_Type, value, return -1;);
23899 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
23900 0 : PyErr_NoMemory();
23901 0 : return -1;
23902 : }
23903 0 : object->out.types = (struct samr_Ids *)pytalloc_get_ptr(value);
23904 0 : return 0;
23905 : }
23906 :
23907 0 : static PyObject *py_samr_LookupRids_get_result(PyObject *obj, void *closure)
23908 : {
23909 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(obj);
23910 0 : PyObject *py_result;
23911 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
23912 0 : return py_result;
23913 : }
23914 :
23915 0 : static int py_samr_LookupRids_set_result(PyObject *py_obj, PyObject *value, void *closure)
23916 : {
23917 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23918 0 : if (value == NULL) {
23919 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
23920 0 : return -1;
23921 : }
23922 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
23923 0 : return 0;
23924 : }
23925 :
23926 : static PyGetSetDef py_samr_LookupRids_getsetters[] = {
23927 : {
23928 : .name = discard_const_p(char, "in_domain_handle"),
23929 : .get = py_samr_LookupRids_in_get_domain_handle,
23930 : .set = py_samr_LookupRids_in_set_domain_handle,
23931 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
23932 : },
23933 : {
23934 : .name = discard_const_p(char, "in_num_rids"),
23935 : .get = py_samr_LookupRids_in_get_num_rids,
23936 : .set = py_samr_LookupRids_in_set_num_rids,
23937 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23938 : },
23939 : {
23940 : .name = discard_const_p(char, "in_rids"),
23941 : .get = py_samr_LookupRids_in_get_rids,
23942 : .set = py_samr_LookupRids_in_set_rids,
23943 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
23944 : },
23945 : {
23946 : .name = discard_const_p(char, "out_names"),
23947 : .get = py_samr_LookupRids_out_get_names,
23948 : .set = py_samr_LookupRids_out_set_names,
23949 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_Strings")
23950 : },
23951 : {
23952 : .name = discard_const_p(char, "out_types"),
23953 : .get = py_samr_LookupRids_out_get_types,
23954 : .set = py_samr_LookupRids_out_set_types,
23955 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Ids")
23956 : },
23957 : {
23958 : .name = discard_const_p(char, "result"),
23959 : .get = py_samr_LookupRids_get_result,
23960 : .set = py_samr_LookupRids_set_result,
23961 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
23962 : },
23963 : { .name = NULL }
23964 : };
23965 :
23966 0 : static PyObject *py_samr_LookupRids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
23967 : {
23968 0 : PyObject *self = pytalloc_new(struct samr_LookupRids, type);
23969 0 : struct samr_LookupRids *_self = (struct samr_LookupRids *)pytalloc_get_ptr(self);
23970 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
23971 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
23972 0 : _self->out.names = talloc_zero(mem_ctx, struct lsa_Strings);
23973 0 : _self->out.types = talloc_zero(mem_ctx, struct samr_Ids);
23974 0 : return self;
23975 : }
23976 :
23977 0 : static PyObject *py_samr_LookupRids_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
23978 : {
23979 :
23980 :
23981 0 : return PyLong_FromLong(18);
23982 : }
23983 :
23984 0 : static PyObject *py_samr_LookupRids_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
23985 : {
23986 0 : const struct ndr_interface_call *call = NULL;
23987 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
23988 0 : PyObject *ret = NULL;
23989 0 : struct ndr_push *push = NULL;
23990 0 : DATA_BLOB blob;
23991 0 : enum ndr_err_code err;
23992 :
23993 0 : if (ndr_table_samr.num_calls < 19) {
23994 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_pack");
23995 0 : return NULL;
23996 : }
23997 0 : call = &ndr_table_samr.calls[18];
23998 :
23999 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24000 0 : if (push == NULL) {
24001 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24002 0 : return NULL;
24003 : }
24004 :
24005 0 : push->flags |= ndr_push_flags;
24006 :
24007 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24008 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24009 0 : TALLOC_FREE(push);
24010 0 : PyErr_SetNdrError(err);
24011 0 : return NULL;
24012 : }
24013 0 : blob = ndr_push_blob(push);
24014 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24015 0 : TALLOC_FREE(push);
24016 0 : return ret;
24017 : }
24018 :
24019 0 : static PyObject *py_samr_LookupRids_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24020 : {
24021 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24022 0 : PyObject *bigendian_obj = NULL;
24023 0 : PyObject *ndr64_obj = NULL;
24024 0 : libndr_flags ndr_push_flags = 0;
24025 :
24026 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24027 : discard_const_p(char *, kwnames),
24028 : &bigendian_obj,
24029 : &ndr64_obj)) {
24030 0 : return NULL;
24031 : }
24032 :
24033 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24034 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24035 : }
24036 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24037 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24038 : }
24039 :
24040 0 : return py_samr_LookupRids_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24041 : }
24042 :
24043 0 : static PyObject *py_samr_LookupRids_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24044 : {
24045 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24046 0 : PyObject *bigendian_obj = NULL;
24047 0 : PyObject *ndr64_obj = NULL;
24048 0 : libndr_flags ndr_push_flags = 0;
24049 :
24050 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24051 : discard_const_p(char *, kwnames),
24052 : &bigendian_obj,
24053 : &ndr64_obj)) {
24054 0 : return NULL;
24055 : }
24056 :
24057 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24058 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24059 : }
24060 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24061 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24062 : }
24063 :
24064 0 : return py_samr_LookupRids_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24065 : }
24066 :
24067 0 : static PyObject *py_samr_LookupRids_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
24068 : {
24069 0 : const struct ndr_interface_call *call = NULL;
24070 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
24071 0 : struct ndr_pull *pull = NULL;
24072 0 : enum ndr_err_code err;
24073 :
24074 0 : if (ndr_table_samr.num_calls < 19) {
24075 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_unpack");
24076 0 : return NULL;
24077 : }
24078 0 : call = &ndr_table_samr.calls[18];
24079 :
24080 0 : pull = ndr_pull_init_blob(blob, object);
24081 0 : if (pull == NULL) {
24082 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24083 0 : return NULL;
24084 : }
24085 :
24086 0 : pull->flags |= ndr_pull_flags;
24087 :
24088 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24089 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24090 0 : TALLOC_FREE(pull);
24091 0 : PyErr_SetNdrError(err);
24092 0 : return NULL;
24093 : }
24094 0 : if (!allow_remaining) {
24095 0 : uint32_t highest_ofs;
24096 :
24097 0 : if (pull->offset > pull->relative_highest_offset) {
24098 0 : highest_ofs = pull->offset;
24099 : } else {
24100 0 : highest_ofs = pull->relative_highest_offset;
24101 : }
24102 0 : if (highest_ofs < pull->data_size) {
24103 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24104 : "not all bytes consumed ofs[%u] size[%u]",
24105 : highest_ofs, pull->data_size);
24106 0 : TALLOC_FREE(pull);
24107 0 : PyErr_SetNdrError(err);
24108 0 : return NULL;
24109 : }
24110 : }
24111 :
24112 0 : TALLOC_FREE(pull);
24113 0 : Py_RETURN_NONE;
24114 : }
24115 :
24116 0 : static PyObject *py_samr_LookupRids_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24117 : {
24118 0 : DATA_BLOB blob;
24119 0 : Py_ssize_t blob_length = 0;
24120 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24121 0 : PyObject *bigendian_obj = NULL;
24122 0 : PyObject *ndr64_obj = NULL;
24123 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24124 0 : PyObject *allow_remaining_obj = NULL;
24125 0 : bool allow_remaining = false;
24126 :
24127 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24128 : discard_const_p(char *, kwnames),
24129 : &blob.data, &blob_length,
24130 : &bigendian_obj,
24131 : &ndr64_obj,
24132 : &allow_remaining_obj)) {
24133 0 : return NULL;
24134 : }
24135 0 : blob.length = blob_length;
24136 :
24137 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24138 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24139 : }
24140 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24141 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24142 : }
24143 :
24144 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24145 0 : allow_remaining = true;
24146 : }
24147 :
24148 0 : return py_samr_LookupRids_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24149 : }
24150 :
24151 0 : static PyObject *py_samr_LookupRids_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24152 : {
24153 0 : DATA_BLOB blob;
24154 0 : Py_ssize_t blob_length = 0;
24155 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24156 0 : PyObject *bigendian_obj = NULL;
24157 0 : PyObject *ndr64_obj = NULL;
24158 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24159 0 : PyObject *allow_remaining_obj = NULL;
24160 0 : bool allow_remaining = false;
24161 :
24162 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24163 : discard_const_p(char *, kwnames),
24164 : &blob.data, &blob_length,
24165 : &bigendian_obj,
24166 : &ndr64_obj,
24167 : &allow_remaining_obj)) {
24168 0 : return NULL;
24169 : }
24170 0 : blob.length = blob_length;
24171 :
24172 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24173 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24174 : }
24175 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24176 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24177 : }
24178 :
24179 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24180 0 : allow_remaining = true;
24181 : }
24182 :
24183 0 : return py_samr_LookupRids_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24184 : }
24185 :
24186 0 : static PyObject *py_samr_LookupRids_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24187 : {
24188 0 : const struct ndr_interface_call *call = NULL;
24189 0 : struct samr_LookupRids *object = (struct samr_LookupRids *)pytalloc_get_ptr(py_obj);
24190 0 : PyObject *ret;
24191 0 : char *retstr;
24192 :
24193 0 : if (ndr_table_samr.num_calls < 19) {
24194 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_LookupRids_ndr_print");
24195 0 : return NULL;
24196 : }
24197 0 : call = &ndr_table_samr.calls[18];
24198 :
24199 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24200 0 : ret = PyUnicode_FromString(retstr);
24201 0 : TALLOC_FREE(retstr);
24202 :
24203 0 : return ret;
24204 : }
24205 :
24206 0 : static PyObject *py_samr_LookupRids_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24207 : {
24208 0 : return py_samr_LookupRids_ndr_print(py_obj, "samr_LookupRids_in", NDR_IN);
24209 : }
24210 :
24211 0 : static PyObject *py_samr_LookupRids_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24212 : {
24213 0 : return py_samr_LookupRids_ndr_print(py_obj, "samr_LookupRids_out", NDR_OUT);
24214 : }
24215 :
24216 : static PyMethodDef py_samr_LookupRids_methods[] = {
24217 : { "opnum", (PyCFunction)py_samr_LookupRids_ndr_opnum, METH_NOARGS|METH_CLASS,
24218 : "samr.LookupRids.opnum() -> 18 (0x12) " },
24219 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupRids_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24220 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24221 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupRids_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24222 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24223 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupRids_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24224 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24225 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_LookupRids_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24226 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24227 : { "__ndr_print_in__", (PyCFunction)py_samr_LookupRids_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24228 : { "__ndr_print_out__", (PyCFunction)py_samr_LookupRids_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24229 : { NULL, NULL, 0, NULL }
24230 : };
24231 :
24232 :
24233 : static PyTypeObject samr_LookupRids_Type = {
24234 : PyVarObject_HEAD_INIT(NULL, 0)
24235 : .tp_name = "samr.LookupRids",
24236 : .tp_getset = py_samr_LookupRids_getsetters,
24237 : .tp_methods = py_samr_LookupRids_methods,
24238 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24239 : .tp_new = py_samr_LookupRids_new,
24240 : };
24241 :
24242 1 : static bool pack_py_samr_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupRids *r)
24243 : {
24244 0 : PyObject *py_domain_handle;
24245 0 : PyObject *py_rids;
24246 1 : const char *kwnames[] = {
24247 : "domain_handle", "rids", NULL
24248 : };
24249 :
24250 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupRids", discard_const_p(char *, kwnames), &py_domain_handle, &py_rids)) {
24251 0 : return false;
24252 : }
24253 :
24254 1 : if (py_domain_handle == NULL) {
24255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
24256 0 : return false;
24257 : }
24258 1 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
24259 1 : if (r->in.domain_handle == NULL) {
24260 0 : PyErr_NoMemory();
24261 0 : return false;
24262 : }
24263 1 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
24264 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
24265 0 : PyErr_NoMemory();
24266 0 : return false;
24267 : }
24268 1 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
24269 1 : PY_CHECK_TYPE(&PyList_Type, py_rids, return false;);
24270 1 : r->in.num_rids = PyList_GET_SIZE(py_rids);
24271 1 : if (py_rids == NULL) {
24272 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids");
24273 0 : return false;
24274 : }
24275 1 : PY_CHECK_TYPE(&PyList_Type, py_rids, return false;);
24276 : {
24277 0 : int rids_cntr_0;
24278 1 : r->in.rids = talloc_array_ptrtype(r, r->in.rids, PyList_GET_SIZE(py_rids));
24279 1 : if (!r->in.rids) { return false; }
24280 1 : talloc_set_name_const(r->in.rids, "ARRAY: r->in.rids");
24281 3 : for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(py_rids); rids_cntr_0++) {
24282 2 : if (PyList_GET_ITEM(py_rids, rids_cntr_0) == NULL) {
24283 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rids[rids_cntr_0]");
24284 0 : return false;
24285 : }
24286 : {
24287 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rids[rids_cntr_0]));
24288 2 : if (PyLong_Check(PyList_GET_ITEM(py_rids, rids_cntr_0))) {
24289 0 : unsigned long long test_var;
24290 2 : test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_rids, rids_cntr_0));
24291 2 : if (PyErr_Occurred() != NULL) {
24292 0 : return false;
24293 : }
24294 2 : if (test_var > uint_max) {
24295 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24296 : PyLong_Type.tp_name, uint_max, test_var);
24297 0 : return false;
24298 : }
24299 2 : r->in.rids[rids_cntr_0] = test_var;
24300 : } else {
24301 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24302 : PyLong_Type.tp_name);
24303 0 : return false;
24304 : }
24305 : }
24306 : }
24307 : }
24308 1 : return true;
24309 : }
24310 :
24311 1 : static PyObject *unpack_py_samr_LookupRids_args_out(struct samr_LookupRids *r)
24312 : {
24313 0 : PyObject *result;
24314 0 : PyObject *py_names;
24315 0 : PyObject *py_types;
24316 1 : result = PyTuple_New(2);
24317 1 : py_names = pytalloc_reference_ex(lsa_Strings_Type, r->out.names, r->out.names);
24318 1 : PyTuple_SetItem(result, 0, py_names);
24319 1 : py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types);
24320 1 : PyTuple_SetItem(result, 1, py_types);
24321 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
24322 0 : PyErr_SetNTSTATUS(r->out.result);
24323 0 : return NULL;
24324 : }
24325 :
24326 1 : return result;
24327 : }
24328 :
24329 :
24330 0 : static PyObject *py_samr_OpenGroup_in_get_domain_handle(PyObject *obj, void *closure)
24331 : {
24332 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj);
24333 0 : PyObject *py_domain_handle;
24334 0 : if (object->in.domain_handle == NULL) {
24335 0 : Py_RETURN_NONE;
24336 : }
24337 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
24338 0 : return py_domain_handle;
24339 : }
24340 :
24341 0 : static int py_samr_OpenGroup_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
24342 : {
24343 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24344 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
24345 0 : if (value == NULL) {
24346 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
24347 0 : return -1;
24348 : }
24349 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
24350 0 : if (object->in.domain_handle == NULL) {
24351 0 : PyErr_NoMemory();
24352 0 : return -1;
24353 : }
24354 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24355 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24356 0 : PyErr_NoMemory();
24357 0 : return -1;
24358 : }
24359 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24360 0 : return 0;
24361 : }
24362 :
24363 0 : static PyObject *py_samr_OpenGroup_in_get_access_mask(PyObject *obj, void *closure)
24364 : {
24365 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj);
24366 0 : PyObject *py_access_mask;
24367 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
24368 0 : return py_access_mask;
24369 : }
24370 :
24371 0 : static int py_samr_OpenGroup_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
24372 : {
24373 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24374 0 : if (value == NULL) {
24375 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
24376 0 : return -1;
24377 : }
24378 : {
24379 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
24380 0 : if (PyLong_Check(value)) {
24381 0 : unsigned long long test_var;
24382 0 : test_var = PyLong_AsUnsignedLongLong(value);
24383 0 : if (PyErr_Occurred() != NULL) {
24384 0 : return -1;
24385 : }
24386 0 : if (test_var > uint_max) {
24387 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24388 : PyLong_Type.tp_name, uint_max, test_var);
24389 0 : return -1;
24390 : }
24391 0 : object->in.access_mask = test_var;
24392 : } else {
24393 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24394 : PyLong_Type.tp_name);
24395 0 : return -1;
24396 : }
24397 : }
24398 0 : return 0;
24399 : }
24400 :
24401 0 : static PyObject *py_samr_OpenGroup_in_get_rid(PyObject *obj, void *closure)
24402 : {
24403 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj);
24404 0 : PyObject *py_rid;
24405 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
24406 0 : return py_rid;
24407 : }
24408 :
24409 0 : static int py_samr_OpenGroup_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
24410 : {
24411 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24412 0 : if (value == NULL) {
24413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
24414 0 : return -1;
24415 : }
24416 : {
24417 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
24418 0 : if (PyLong_Check(value)) {
24419 0 : unsigned long long test_var;
24420 0 : test_var = PyLong_AsUnsignedLongLong(value);
24421 0 : if (PyErr_Occurred() != NULL) {
24422 0 : return -1;
24423 : }
24424 0 : if (test_var > uint_max) {
24425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24426 : PyLong_Type.tp_name, uint_max, test_var);
24427 0 : return -1;
24428 : }
24429 0 : object->in.rid = test_var;
24430 : } else {
24431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24432 : PyLong_Type.tp_name);
24433 0 : return -1;
24434 : }
24435 : }
24436 0 : return 0;
24437 : }
24438 :
24439 0 : static PyObject *py_samr_OpenGroup_out_get_group_handle(PyObject *obj, void *closure)
24440 : {
24441 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj);
24442 0 : PyObject *py_group_handle;
24443 0 : if (object->out.group_handle == NULL) {
24444 0 : Py_RETURN_NONE;
24445 : }
24446 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle);
24447 0 : return py_group_handle;
24448 : }
24449 :
24450 0 : static int py_samr_OpenGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
24451 : {
24452 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24453 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle));
24454 0 : if (value == NULL) {
24455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle");
24456 0 : return -1;
24457 : }
24458 0 : object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle);
24459 0 : if (object->out.group_handle == NULL) {
24460 0 : PyErr_NoMemory();
24461 0 : return -1;
24462 : }
24463 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24464 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24465 0 : PyErr_NoMemory();
24466 0 : return -1;
24467 : }
24468 0 : object->out.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24469 0 : return 0;
24470 : }
24471 :
24472 0 : static PyObject *py_samr_OpenGroup_get_result(PyObject *obj, void *closure)
24473 : {
24474 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(obj);
24475 0 : PyObject *py_result;
24476 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
24477 0 : return py_result;
24478 : }
24479 :
24480 0 : static int py_samr_OpenGroup_set_result(PyObject *py_obj, PyObject *value, void *closure)
24481 : {
24482 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24483 0 : if (value == NULL) {
24484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
24485 0 : return -1;
24486 : }
24487 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
24488 0 : return 0;
24489 : }
24490 :
24491 : static PyGetSetDef py_samr_OpenGroup_getsetters[] = {
24492 : {
24493 : .name = discard_const_p(char, "in_domain_handle"),
24494 : .get = py_samr_OpenGroup_in_get_domain_handle,
24495 : .set = py_samr_OpenGroup_in_set_domain_handle,
24496 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24497 : },
24498 : {
24499 : .name = discard_const_p(char, "in_access_mask"),
24500 : .get = py_samr_OpenGroup_in_get_access_mask,
24501 : .set = py_samr_OpenGroup_in_set_access_mask,
24502 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupAccessMask")
24503 : },
24504 : {
24505 : .name = discard_const_p(char, "in_rid"),
24506 : .get = py_samr_OpenGroup_in_get_rid,
24507 : .set = py_samr_OpenGroup_in_set_rid,
24508 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
24509 : },
24510 : {
24511 : .name = discard_const_p(char, "out_group_handle"),
24512 : .get = py_samr_OpenGroup_out_get_group_handle,
24513 : .set = py_samr_OpenGroup_out_set_group_handle,
24514 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
24515 : },
24516 : {
24517 : .name = discard_const_p(char, "result"),
24518 : .get = py_samr_OpenGroup_get_result,
24519 : .set = py_samr_OpenGroup_set_result,
24520 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
24521 : },
24522 : { .name = NULL }
24523 : };
24524 :
24525 0 : static PyObject *py_samr_OpenGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
24526 : {
24527 0 : PyObject *self = pytalloc_new(struct samr_OpenGroup, type);
24528 0 : struct samr_OpenGroup *_self = (struct samr_OpenGroup *)pytalloc_get_ptr(self);
24529 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
24530 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
24531 0 : _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle);
24532 0 : return self;
24533 : }
24534 :
24535 0 : static PyObject *py_samr_OpenGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
24536 : {
24537 :
24538 :
24539 0 : return PyLong_FromLong(19);
24540 : }
24541 :
24542 0 : static PyObject *py_samr_OpenGroup_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
24543 : {
24544 0 : const struct ndr_interface_call *call = NULL;
24545 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24546 0 : PyObject *ret = NULL;
24547 0 : struct ndr_push *push = NULL;
24548 0 : DATA_BLOB blob;
24549 0 : enum ndr_err_code err;
24550 :
24551 0 : if (ndr_table_samr.num_calls < 20) {
24552 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_pack");
24553 0 : return NULL;
24554 : }
24555 0 : call = &ndr_table_samr.calls[19];
24556 :
24557 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
24558 0 : if (push == NULL) {
24559 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24560 0 : return NULL;
24561 : }
24562 :
24563 0 : push->flags |= ndr_push_flags;
24564 :
24565 0 : err = call->ndr_push(push, ndr_inout_flags, object);
24566 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24567 0 : TALLOC_FREE(push);
24568 0 : PyErr_SetNdrError(err);
24569 0 : return NULL;
24570 : }
24571 0 : blob = ndr_push_blob(push);
24572 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
24573 0 : TALLOC_FREE(push);
24574 0 : return ret;
24575 : }
24576 :
24577 0 : static PyObject *py_samr_OpenGroup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24578 : {
24579 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24580 0 : PyObject *bigendian_obj = NULL;
24581 0 : PyObject *ndr64_obj = NULL;
24582 0 : libndr_flags ndr_push_flags = 0;
24583 :
24584 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
24585 : discard_const_p(char *, kwnames),
24586 : &bigendian_obj,
24587 : &ndr64_obj)) {
24588 0 : return NULL;
24589 : }
24590 :
24591 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24592 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24593 : }
24594 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24595 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24596 : }
24597 :
24598 0 : return py_samr_OpenGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
24599 : }
24600 :
24601 0 : static PyObject *py_samr_OpenGroup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24602 : {
24603 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
24604 0 : PyObject *bigendian_obj = NULL;
24605 0 : PyObject *ndr64_obj = NULL;
24606 0 : libndr_flags ndr_push_flags = 0;
24607 :
24608 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
24609 : discard_const_p(char *, kwnames),
24610 : &bigendian_obj,
24611 : &ndr64_obj)) {
24612 0 : return NULL;
24613 : }
24614 :
24615 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24616 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
24617 : }
24618 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24619 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
24620 : }
24621 :
24622 0 : return py_samr_OpenGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
24623 : }
24624 :
24625 0 : static PyObject *py_samr_OpenGroup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
24626 : {
24627 0 : const struct ndr_interface_call *call = NULL;
24628 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24629 0 : struct ndr_pull *pull = NULL;
24630 0 : enum ndr_err_code err;
24631 :
24632 0 : if (ndr_table_samr.num_calls < 20) {
24633 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_unpack");
24634 0 : return NULL;
24635 : }
24636 0 : call = &ndr_table_samr.calls[19];
24637 :
24638 0 : pull = ndr_pull_init_blob(blob, object);
24639 0 : if (pull == NULL) {
24640 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
24641 0 : return NULL;
24642 : }
24643 :
24644 0 : pull->flags |= ndr_pull_flags;
24645 :
24646 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
24647 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
24648 0 : TALLOC_FREE(pull);
24649 0 : PyErr_SetNdrError(err);
24650 0 : return NULL;
24651 : }
24652 0 : if (!allow_remaining) {
24653 0 : uint32_t highest_ofs;
24654 :
24655 0 : if (pull->offset > pull->relative_highest_offset) {
24656 0 : highest_ofs = pull->offset;
24657 : } else {
24658 0 : highest_ofs = pull->relative_highest_offset;
24659 : }
24660 0 : if (highest_ofs < pull->data_size) {
24661 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
24662 : "not all bytes consumed ofs[%u] size[%u]",
24663 : highest_ofs, pull->data_size);
24664 0 : TALLOC_FREE(pull);
24665 0 : PyErr_SetNdrError(err);
24666 0 : return NULL;
24667 : }
24668 : }
24669 :
24670 0 : TALLOC_FREE(pull);
24671 0 : Py_RETURN_NONE;
24672 : }
24673 :
24674 0 : static PyObject *py_samr_OpenGroup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24675 : {
24676 0 : DATA_BLOB blob;
24677 0 : Py_ssize_t blob_length = 0;
24678 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24679 0 : PyObject *bigendian_obj = NULL;
24680 0 : PyObject *ndr64_obj = NULL;
24681 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24682 0 : PyObject *allow_remaining_obj = NULL;
24683 0 : bool allow_remaining = false;
24684 :
24685 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
24686 : discard_const_p(char *, kwnames),
24687 : &blob.data, &blob_length,
24688 : &bigendian_obj,
24689 : &ndr64_obj,
24690 : &allow_remaining_obj)) {
24691 0 : return NULL;
24692 : }
24693 0 : blob.length = blob_length;
24694 :
24695 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24696 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24697 : }
24698 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24699 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24700 : }
24701 :
24702 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24703 0 : allow_remaining = true;
24704 : }
24705 :
24706 0 : return py_samr_OpenGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
24707 : }
24708 :
24709 0 : static PyObject *py_samr_OpenGroup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
24710 : {
24711 0 : DATA_BLOB blob;
24712 0 : Py_ssize_t blob_length = 0;
24713 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
24714 0 : PyObject *bigendian_obj = NULL;
24715 0 : PyObject *ndr64_obj = NULL;
24716 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
24717 0 : PyObject *allow_remaining_obj = NULL;
24718 0 : bool allow_remaining = false;
24719 :
24720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
24721 : discard_const_p(char *, kwnames),
24722 : &blob.data, &blob_length,
24723 : &bigendian_obj,
24724 : &ndr64_obj,
24725 : &allow_remaining_obj)) {
24726 0 : return NULL;
24727 : }
24728 0 : blob.length = blob_length;
24729 :
24730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
24731 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
24732 : }
24733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
24734 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
24735 : }
24736 :
24737 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
24738 0 : allow_remaining = true;
24739 : }
24740 :
24741 0 : return py_samr_OpenGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
24742 : }
24743 :
24744 0 : static PyObject *py_samr_OpenGroup_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
24745 : {
24746 0 : const struct ndr_interface_call *call = NULL;
24747 0 : struct samr_OpenGroup *object = (struct samr_OpenGroup *)pytalloc_get_ptr(py_obj);
24748 0 : PyObject *ret;
24749 0 : char *retstr;
24750 :
24751 0 : if (ndr_table_samr.num_calls < 20) {
24752 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenGroup_ndr_print");
24753 0 : return NULL;
24754 : }
24755 0 : call = &ndr_table_samr.calls[19];
24756 :
24757 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
24758 0 : ret = PyUnicode_FromString(retstr);
24759 0 : TALLOC_FREE(retstr);
24760 :
24761 0 : return ret;
24762 : }
24763 :
24764 0 : static PyObject *py_samr_OpenGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24765 : {
24766 0 : return py_samr_OpenGroup_ndr_print(py_obj, "samr_OpenGroup_in", NDR_IN);
24767 : }
24768 :
24769 0 : static PyObject *py_samr_OpenGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
24770 : {
24771 0 : return py_samr_OpenGroup_ndr_print(py_obj, "samr_OpenGroup_out", NDR_OUT);
24772 : }
24773 :
24774 : static PyMethodDef py_samr_OpenGroup_methods[] = {
24775 : { "opnum", (PyCFunction)py_samr_OpenGroup_ndr_opnum, METH_NOARGS|METH_CLASS,
24776 : "samr.OpenGroup.opnum() -> 19 (0x13) " },
24777 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenGroup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
24778 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
24779 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenGroup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
24780 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
24781 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenGroup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
24782 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
24783 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenGroup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
24784 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
24785 : { "__ndr_print_in__", (PyCFunction)py_samr_OpenGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
24786 : { "__ndr_print_out__", (PyCFunction)py_samr_OpenGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
24787 : { NULL, NULL, 0, NULL }
24788 : };
24789 :
24790 :
24791 : static PyTypeObject samr_OpenGroup_Type = {
24792 : PyVarObject_HEAD_INIT(NULL, 0)
24793 : .tp_name = "samr.OpenGroup",
24794 : .tp_getset = py_samr_OpenGroup_getsetters,
24795 : .tp_methods = py_samr_OpenGroup_methods,
24796 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
24797 : .tp_new = py_samr_OpenGroup_new,
24798 : };
24799 :
24800 2 : static bool pack_py_samr_OpenGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenGroup *r)
24801 : {
24802 0 : PyObject *py_domain_handle;
24803 0 : PyObject *py_access_mask;
24804 0 : PyObject *py_rid;
24805 2 : const char *kwnames[] = {
24806 : "domain_handle", "access_mask", "rid", NULL
24807 : };
24808 :
24809 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
24810 0 : return false;
24811 : }
24812 :
24813 2 : if (py_domain_handle == NULL) {
24814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
24815 0 : return false;
24816 : }
24817 2 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
24818 2 : if (r->in.domain_handle == NULL) {
24819 0 : PyErr_NoMemory();
24820 0 : return false;
24821 : }
24822 2 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
24823 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
24824 0 : PyErr_NoMemory();
24825 0 : return false;
24826 : }
24827 2 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
24828 2 : if (py_access_mask == NULL) {
24829 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
24830 0 : return false;
24831 : }
24832 : {
24833 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
24834 2 : if (PyLong_Check(py_access_mask)) {
24835 0 : unsigned long long test_var;
24836 2 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
24837 2 : if (PyErr_Occurred() != NULL) {
24838 0 : return false;
24839 : }
24840 2 : if (test_var > uint_max) {
24841 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24842 : PyLong_Type.tp_name, uint_max, test_var);
24843 0 : return false;
24844 : }
24845 2 : r->in.access_mask = test_var;
24846 : } else {
24847 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24848 : PyLong_Type.tp_name);
24849 0 : return false;
24850 : }
24851 : }
24852 2 : if (py_rid == NULL) {
24853 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
24854 0 : return false;
24855 : }
24856 : {
24857 2 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
24858 2 : if (PyLong_Check(py_rid)) {
24859 0 : unsigned long long test_var;
24860 2 : test_var = PyLong_AsUnsignedLongLong(py_rid);
24861 2 : if (PyErr_Occurred() != NULL) {
24862 0 : return false;
24863 : }
24864 2 : if (test_var > uint_max) {
24865 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24866 : PyLong_Type.tp_name, uint_max, test_var);
24867 0 : return false;
24868 : }
24869 2 : r->in.rid = test_var;
24870 : } else {
24871 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24872 : PyLong_Type.tp_name);
24873 0 : return false;
24874 : }
24875 : }
24876 2 : return true;
24877 : }
24878 :
24879 2 : static PyObject *unpack_py_samr_OpenGroup_args_out(struct samr_OpenGroup *r)
24880 : {
24881 0 : PyObject *result;
24882 0 : PyObject *py_group_handle;
24883 2 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
24884 2 : result = py_group_handle;
24885 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
24886 0 : PyErr_SetNTSTATUS(r->out.result);
24887 0 : return NULL;
24888 : }
24889 :
24890 2 : return result;
24891 : }
24892 :
24893 :
24894 0 : static PyObject *py_samr_QueryGroupInfo_in_get_group_handle(PyObject *obj, void *closure)
24895 : {
24896 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj);
24897 0 : PyObject *py_group_handle;
24898 0 : if (object->in.group_handle == NULL) {
24899 0 : Py_RETURN_NONE;
24900 : }
24901 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
24902 0 : return py_group_handle;
24903 : }
24904 :
24905 0 : static int py_samr_QueryGroupInfo_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
24906 : {
24907 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
24908 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
24909 0 : if (value == NULL) {
24910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
24911 0 : return -1;
24912 : }
24913 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
24914 0 : if (object->in.group_handle == NULL) {
24915 0 : PyErr_NoMemory();
24916 0 : return -1;
24917 : }
24918 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
24919 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
24920 0 : PyErr_NoMemory();
24921 0 : return -1;
24922 : }
24923 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
24924 0 : return 0;
24925 : }
24926 :
24927 0 : static PyObject *py_samr_QueryGroupInfo_in_get_level(PyObject *obj, void *closure)
24928 : {
24929 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj);
24930 0 : PyObject *py_level;
24931 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
24932 0 : return py_level;
24933 : }
24934 :
24935 0 : static int py_samr_QueryGroupInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
24936 : {
24937 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
24938 0 : if (value == NULL) {
24939 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
24940 0 : return -1;
24941 : }
24942 : {
24943 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
24944 0 : if (PyLong_Check(value)) {
24945 0 : unsigned long long test_var;
24946 0 : test_var = PyLong_AsUnsignedLongLong(value);
24947 0 : if (PyErr_Occurred() != NULL) {
24948 0 : return -1;
24949 : }
24950 0 : if (test_var > uint_max) {
24951 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
24952 : PyLong_Type.tp_name, uint_max, test_var);
24953 0 : return -1;
24954 : }
24955 0 : object->in.level = test_var;
24956 : } else {
24957 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
24958 : PyLong_Type.tp_name);
24959 0 : return -1;
24960 : }
24961 : }
24962 0 : return 0;
24963 : }
24964 :
24965 0 : static PyObject *py_samr_QueryGroupInfo_out_get_info(PyObject *obj, void *closure)
24966 : {
24967 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj);
24968 0 : PyObject *py_info;
24969 0 : if (object->out.info == NULL) {
24970 0 : Py_RETURN_NONE;
24971 : }
24972 0 : if (*object->out.info == NULL) {
24973 0 : py_info = Py_None;
24974 0 : Py_INCREF(py_info);
24975 : } else {
24976 0 : py_info = pyrpc_import_union(&samr_GroupInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_GroupInfo");
24977 0 : if (py_info == NULL) {
24978 0 : return NULL;
24979 : }
24980 : }
24981 0 : return py_info;
24982 : }
24983 :
24984 0 : static int py_samr_QueryGroupInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
24985 : {
24986 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
24987 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
24988 0 : if (value == NULL) {
24989 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
24990 0 : return -1;
24991 : }
24992 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
24993 0 : if (object->out.info == NULL) {
24994 0 : PyErr_NoMemory();
24995 0 : return -1;
24996 : }
24997 0 : if (value == Py_None) {
24998 0 : *object->out.info = NULL;
24999 : } else {
25000 0 : *object->out.info = NULL;
25001 : {
25002 0 : union samr_GroupInfo *info_switch_2;
25003 0 : info_switch_2 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_GroupInfo");
25004 0 : if (info_switch_2 == NULL) {
25005 0 : return -1;
25006 : }
25007 0 : *object->out.info = info_switch_2;
25008 : }
25009 : }
25010 0 : return 0;
25011 : }
25012 :
25013 0 : static PyObject *py_samr_QueryGroupInfo_get_result(PyObject *obj, void *closure)
25014 : {
25015 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(obj);
25016 0 : PyObject *py_result;
25017 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25018 0 : return py_result;
25019 : }
25020 :
25021 0 : static int py_samr_QueryGroupInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
25022 : {
25023 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
25024 0 : if (value == NULL) {
25025 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25026 0 : return -1;
25027 : }
25028 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25029 0 : return 0;
25030 : }
25031 :
25032 : static PyGetSetDef py_samr_QueryGroupInfo_getsetters[] = {
25033 : {
25034 : .name = discard_const_p(char, "in_group_handle"),
25035 : .get = py_samr_QueryGroupInfo_in_get_group_handle,
25036 : .set = py_samr_QueryGroupInfo_in_set_group_handle,
25037 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25038 : },
25039 : {
25040 : .name = discard_const_p(char, "in_level"),
25041 : .get = py_samr_QueryGroupInfo_in_get_level,
25042 : .set = py_samr_QueryGroupInfo_in_set_level,
25043 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfoEnum")
25044 : },
25045 : {
25046 : .name = discard_const_p(char, "out_info"),
25047 : .get = py_samr_QueryGroupInfo_out_get_info,
25048 : .set = py_samr_QueryGroupInfo_out_set_info,
25049 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfo")
25050 : },
25051 : {
25052 : .name = discard_const_p(char, "result"),
25053 : .get = py_samr_QueryGroupInfo_get_result,
25054 : .set = py_samr_QueryGroupInfo_set_result,
25055 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25056 : },
25057 : { .name = NULL }
25058 : };
25059 :
25060 0 : static PyObject *py_samr_QueryGroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25061 : {
25062 0 : PyObject *self = pytalloc_new(struct samr_QueryGroupInfo, type);
25063 0 : struct samr_QueryGroupInfo *_self = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(self);
25064 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25065 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
25066 : /* a pointer to a NULL pointer */
25067 0 : _self->out.info = talloc_zero(mem_ctx, union samr_GroupInfo *);
25068 0 : return self;
25069 : }
25070 :
25071 0 : static PyObject *py_samr_QueryGroupInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25072 : {
25073 :
25074 :
25075 0 : return PyLong_FromLong(20);
25076 : }
25077 :
25078 0 : static PyObject *py_samr_QueryGroupInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25079 : {
25080 0 : const struct ndr_interface_call *call = NULL;
25081 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
25082 0 : PyObject *ret = NULL;
25083 0 : struct ndr_push *push = NULL;
25084 0 : DATA_BLOB blob;
25085 0 : enum ndr_err_code err;
25086 :
25087 0 : if (ndr_table_samr.num_calls < 21) {
25088 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_pack");
25089 0 : return NULL;
25090 : }
25091 0 : call = &ndr_table_samr.calls[20];
25092 :
25093 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25094 0 : if (push == NULL) {
25095 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25096 0 : return NULL;
25097 : }
25098 :
25099 0 : push->flags |= ndr_push_flags;
25100 :
25101 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25102 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25103 0 : TALLOC_FREE(push);
25104 0 : PyErr_SetNdrError(err);
25105 0 : return NULL;
25106 : }
25107 0 : blob = ndr_push_blob(push);
25108 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25109 0 : TALLOC_FREE(push);
25110 0 : return ret;
25111 : }
25112 :
25113 0 : static PyObject *py_samr_QueryGroupInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25114 : {
25115 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25116 0 : PyObject *bigendian_obj = NULL;
25117 0 : PyObject *ndr64_obj = NULL;
25118 0 : libndr_flags ndr_push_flags = 0;
25119 :
25120 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25121 : discard_const_p(char *, kwnames),
25122 : &bigendian_obj,
25123 : &ndr64_obj)) {
25124 0 : return NULL;
25125 : }
25126 :
25127 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25128 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25129 : }
25130 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25131 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25132 : }
25133 :
25134 0 : return py_samr_QueryGroupInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25135 : }
25136 :
25137 0 : static PyObject *py_samr_QueryGroupInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25138 : {
25139 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25140 0 : PyObject *bigendian_obj = NULL;
25141 0 : PyObject *ndr64_obj = NULL;
25142 0 : libndr_flags ndr_push_flags = 0;
25143 :
25144 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25145 : discard_const_p(char *, kwnames),
25146 : &bigendian_obj,
25147 : &ndr64_obj)) {
25148 0 : return NULL;
25149 : }
25150 :
25151 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25152 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25153 : }
25154 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25155 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25156 : }
25157 :
25158 0 : return py_samr_QueryGroupInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25159 : }
25160 :
25161 0 : static PyObject *py_samr_QueryGroupInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
25162 : {
25163 0 : const struct ndr_interface_call *call = NULL;
25164 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
25165 0 : struct ndr_pull *pull = NULL;
25166 0 : enum ndr_err_code err;
25167 :
25168 0 : if (ndr_table_samr.num_calls < 21) {
25169 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_unpack");
25170 0 : return NULL;
25171 : }
25172 0 : call = &ndr_table_samr.calls[20];
25173 :
25174 0 : pull = ndr_pull_init_blob(blob, object);
25175 0 : if (pull == NULL) {
25176 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25177 0 : return NULL;
25178 : }
25179 :
25180 0 : pull->flags |= ndr_pull_flags;
25181 :
25182 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25183 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25184 0 : TALLOC_FREE(pull);
25185 0 : PyErr_SetNdrError(err);
25186 0 : return NULL;
25187 : }
25188 0 : if (!allow_remaining) {
25189 0 : uint32_t highest_ofs;
25190 :
25191 0 : if (pull->offset > pull->relative_highest_offset) {
25192 0 : highest_ofs = pull->offset;
25193 : } else {
25194 0 : highest_ofs = pull->relative_highest_offset;
25195 : }
25196 0 : if (highest_ofs < pull->data_size) {
25197 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25198 : "not all bytes consumed ofs[%u] size[%u]",
25199 : highest_ofs, pull->data_size);
25200 0 : TALLOC_FREE(pull);
25201 0 : PyErr_SetNdrError(err);
25202 0 : return NULL;
25203 : }
25204 : }
25205 :
25206 0 : TALLOC_FREE(pull);
25207 0 : Py_RETURN_NONE;
25208 : }
25209 :
25210 0 : static PyObject *py_samr_QueryGroupInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25211 : {
25212 0 : DATA_BLOB blob;
25213 0 : Py_ssize_t blob_length = 0;
25214 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25215 0 : PyObject *bigendian_obj = NULL;
25216 0 : PyObject *ndr64_obj = NULL;
25217 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25218 0 : PyObject *allow_remaining_obj = NULL;
25219 0 : bool allow_remaining = false;
25220 :
25221 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25222 : discard_const_p(char *, kwnames),
25223 : &blob.data, &blob_length,
25224 : &bigendian_obj,
25225 : &ndr64_obj,
25226 : &allow_remaining_obj)) {
25227 0 : return NULL;
25228 : }
25229 0 : blob.length = blob_length;
25230 :
25231 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25232 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25233 : }
25234 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25235 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25236 : }
25237 :
25238 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25239 0 : allow_remaining = true;
25240 : }
25241 :
25242 0 : return py_samr_QueryGroupInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25243 : }
25244 :
25245 0 : static PyObject *py_samr_QueryGroupInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25246 : {
25247 0 : DATA_BLOB blob;
25248 0 : Py_ssize_t blob_length = 0;
25249 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25250 0 : PyObject *bigendian_obj = NULL;
25251 0 : PyObject *ndr64_obj = NULL;
25252 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25253 0 : PyObject *allow_remaining_obj = NULL;
25254 0 : bool allow_remaining = false;
25255 :
25256 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25257 : discard_const_p(char *, kwnames),
25258 : &blob.data, &blob_length,
25259 : &bigendian_obj,
25260 : &ndr64_obj,
25261 : &allow_remaining_obj)) {
25262 0 : return NULL;
25263 : }
25264 0 : blob.length = blob_length;
25265 :
25266 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25267 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25268 : }
25269 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25270 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25271 : }
25272 :
25273 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25274 0 : allow_remaining = true;
25275 : }
25276 :
25277 0 : return py_samr_QueryGroupInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25278 : }
25279 :
25280 0 : static PyObject *py_samr_QueryGroupInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25281 : {
25282 0 : const struct ndr_interface_call *call = NULL;
25283 0 : struct samr_QueryGroupInfo *object = (struct samr_QueryGroupInfo *)pytalloc_get_ptr(py_obj);
25284 0 : PyObject *ret;
25285 0 : char *retstr;
25286 :
25287 0 : if (ndr_table_samr.num_calls < 21) {
25288 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupInfo_ndr_print");
25289 0 : return NULL;
25290 : }
25291 0 : call = &ndr_table_samr.calls[20];
25292 :
25293 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25294 0 : ret = PyUnicode_FromString(retstr);
25295 0 : TALLOC_FREE(retstr);
25296 :
25297 0 : return ret;
25298 : }
25299 :
25300 0 : static PyObject *py_samr_QueryGroupInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25301 : {
25302 0 : return py_samr_QueryGroupInfo_ndr_print(py_obj, "samr_QueryGroupInfo_in", NDR_IN);
25303 : }
25304 :
25305 0 : static PyObject *py_samr_QueryGroupInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25306 : {
25307 0 : return py_samr_QueryGroupInfo_ndr_print(py_obj, "samr_QueryGroupInfo_out", NDR_OUT);
25308 : }
25309 :
25310 : static PyMethodDef py_samr_QueryGroupInfo_methods[] = {
25311 : { "opnum", (PyCFunction)py_samr_QueryGroupInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
25312 : "samr.QueryGroupInfo.opnum() -> 20 (0x14) " },
25313 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25314 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25315 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25316 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25317 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25318 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25319 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25320 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25321 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryGroupInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25322 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryGroupInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25323 : { NULL, NULL, 0, NULL }
25324 : };
25325 :
25326 :
25327 : static PyTypeObject samr_QueryGroupInfo_Type = {
25328 : PyVarObject_HEAD_INIT(NULL, 0)
25329 : .tp_name = "samr.QueryGroupInfo",
25330 : .tp_getset = py_samr_QueryGroupInfo_getsetters,
25331 : .tp_methods = py_samr_QueryGroupInfo_methods,
25332 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25333 : .tp_new = py_samr_QueryGroupInfo_new,
25334 : };
25335 :
25336 0 : static bool pack_py_samr_QueryGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupInfo *r)
25337 : {
25338 0 : PyObject *py_group_handle;
25339 0 : PyObject *py_level;
25340 0 : const char *kwnames[] = {
25341 : "group_handle", "level", NULL
25342 : };
25343 :
25344 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level)) {
25345 0 : return false;
25346 : }
25347 :
25348 0 : if (py_group_handle == NULL) {
25349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
25350 0 : return false;
25351 : }
25352 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
25353 0 : if (r->in.group_handle == NULL) {
25354 0 : PyErr_NoMemory();
25355 0 : return false;
25356 : }
25357 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
25358 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
25359 0 : PyErr_NoMemory();
25360 0 : return false;
25361 : }
25362 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
25363 0 : if (py_level == NULL) {
25364 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
25365 0 : return false;
25366 : }
25367 : {
25368 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
25369 0 : if (PyLong_Check(py_level)) {
25370 0 : unsigned long long test_var;
25371 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
25372 0 : if (PyErr_Occurred() != NULL) {
25373 0 : return false;
25374 : }
25375 0 : if (test_var > uint_max) {
25376 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25377 : PyLong_Type.tp_name, uint_max, test_var);
25378 0 : return false;
25379 : }
25380 0 : r->in.level = test_var;
25381 : } else {
25382 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25383 : PyLong_Type.tp_name);
25384 0 : return false;
25385 : }
25386 : }
25387 0 : return true;
25388 : }
25389 :
25390 0 : static PyObject *unpack_py_samr_QueryGroupInfo_args_out(struct samr_QueryGroupInfo *r)
25391 : {
25392 0 : PyObject *result;
25393 0 : PyObject *py_info;
25394 0 : if (*r->out.info == NULL) {
25395 0 : py_info = Py_None;
25396 0 : Py_INCREF(py_info);
25397 : } else {
25398 0 : py_info = pyrpc_import_union(&samr_GroupInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_GroupInfo");
25399 0 : if (py_info == NULL) {
25400 0 : return NULL;
25401 : }
25402 : }
25403 0 : result = py_info;
25404 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
25405 0 : PyErr_SetNTSTATUS(r->out.result);
25406 0 : return NULL;
25407 : }
25408 :
25409 0 : return result;
25410 : }
25411 :
25412 :
25413 0 : static PyObject *py_samr_SetGroupInfo_in_get_group_handle(PyObject *obj, void *closure)
25414 : {
25415 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj);
25416 0 : PyObject *py_group_handle;
25417 0 : if (object->in.group_handle == NULL) {
25418 0 : Py_RETURN_NONE;
25419 : }
25420 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
25421 0 : return py_group_handle;
25422 : }
25423 :
25424 0 : static int py_samr_SetGroupInfo_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
25425 : {
25426 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25427 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
25428 0 : if (value == NULL) {
25429 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
25430 0 : return -1;
25431 : }
25432 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
25433 0 : if (object->in.group_handle == NULL) {
25434 0 : PyErr_NoMemory();
25435 0 : return -1;
25436 : }
25437 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25438 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25439 0 : PyErr_NoMemory();
25440 0 : return -1;
25441 : }
25442 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25443 0 : return 0;
25444 : }
25445 :
25446 0 : static PyObject *py_samr_SetGroupInfo_in_get_level(PyObject *obj, void *closure)
25447 : {
25448 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj);
25449 0 : PyObject *py_level;
25450 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
25451 0 : return py_level;
25452 : }
25453 :
25454 0 : static int py_samr_SetGroupInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
25455 : {
25456 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25457 0 : if (value == NULL) {
25458 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
25459 0 : return -1;
25460 : }
25461 : {
25462 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
25463 0 : if (PyLong_Check(value)) {
25464 0 : unsigned long long test_var;
25465 0 : test_var = PyLong_AsUnsignedLongLong(value);
25466 0 : if (PyErr_Occurred() != NULL) {
25467 0 : return -1;
25468 : }
25469 0 : if (test_var > uint_max) {
25470 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25471 : PyLong_Type.tp_name, uint_max, test_var);
25472 0 : return -1;
25473 : }
25474 0 : object->in.level = test_var;
25475 : } else {
25476 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25477 : PyLong_Type.tp_name);
25478 0 : return -1;
25479 : }
25480 : }
25481 0 : return 0;
25482 : }
25483 :
25484 0 : static PyObject *py_samr_SetGroupInfo_in_get_info(PyObject *obj, void *closure)
25485 : {
25486 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj);
25487 0 : PyObject *py_info;
25488 0 : if (object->in.info == NULL) {
25489 0 : Py_RETURN_NONE;
25490 : }
25491 0 : py_info = pyrpc_import_union(&samr_GroupInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_GroupInfo");
25492 0 : if (py_info == NULL) {
25493 0 : return NULL;
25494 : }
25495 0 : return py_info;
25496 : }
25497 :
25498 0 : static int py_samr_SetGroupInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
25499 : {
25500 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25501 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
25502 0 : if (value == NULL) {
25503 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
25504 0 : return -1;
25505 : }
25506 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
25507 0 : if (object->in.info == NULL) {
25508 0 : PyErr_NoMemory();
25509 0 : return -1;
25510 : }
25511 : {
25512 0 : union samr_GroupInfo *info_switch_1;
25513 0 : info_switch_1 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_GroupInfo");
25514 0 : if (info_switch_1 == NULL) {
25515 0 : return -1;
25516 : }
25517 0 : object->in.info = info_switch_1;
25518 : }
25519 0 : return 0;
25520 : }
25521 :
25522 0 : static PyObject *py_samr_SetGroupInfo_get_result(PyObject *obj, void *closure)
25523 : {
25524 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(obj);
25525 0 : PyObject *py_result;
25526 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
25527 0 : return py_result;
25528 : }
25529 :
25530 0 : static int py_samr_SetGroupInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
25531 : {
25532 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25533 0 : if (value == NULL) {
25534 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
25535 0 : return -1;
25536 : }
25537 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
25538 0 : return 0;
25539 : }
25540 :
25541 : static PyGetSetDef py_samr_SetGroupInfo_getsetters[] = {
25542 : {
25543 : .name = discard_const_p(char, "in_group_handle"),
25544 : .get = py_samr_SetGroupInfo_in_get_group_handle,
25545 : .set = py_samr_SetGroupInfo_in_set_group_handle,
25546 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
25547 : },
25548 : {
25549 : .name = discard_const_p(char, "in_level"),
25550 : .get = py_samr_SetGroupInfo_in_get_level,
25551 : .set = py_samr_SetGroupInfo_in_set_level,
25552 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfoEnum")
25553 : },
25554 : {
25555 : .name = discard_const_p(char, "in_info"),
25556 : .get = py_samr_SetGroupInfo_in_get_info,
25557 : .set = py_samr_SetGroupInfo_in_set_info,
25558 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_GroupInfo")
25559 : },
25560 : {
25561 : .name = discard_const_p(char, "result"),
25562 : .get = py_samr_SetGroupInfo_get_result,
25563 : .set = py_samr_SetGroupInfo_set_result,
25564 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
25565 : },
25566 : { .name = NULL }
25567 : };
25568 :
25569 0 : static PyObject *py_samr_SetGroupInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
25570 : {
25571 0 : PyObject *self = pytalloc_new(struct samr_SetGroupInfo, type);
25572 0 : struct samr_SetGroupInfo *_self = (struct samr_SetGroupInfo *)pytalloc_get_ptr(self);
25573 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
25574 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
25575 0 : _self->in.info = talloc_zero(mem_ctx, union samr_GroupInfo);
25576 0 : return self;
25577 : }
25578 :
25579 0 : static PyObject *py_samr_SetGroupInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
25580 : {
25581 :
25582 :
25583 0 : return PyLong_FromLong(21);
25584 : }
25585 :
25586 0 : static PyObject *py_samr_SetGroupInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
25587 : {
25588 0 : const struct ndr_interface_call *call = NULL;
25589 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25590 0 : PyObject *ret = NULL;
25591 0 : struct ndr_push *push = NULL;
25592 0 : DATA_BLOB blob;
25593 0 : enum ndr_err_code err;
25594 :
25595 0 : if (ndr_table_samr.num_calls < 22) {
25596 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_pack");
25597 0 : return NULL;
25598 : }
25599 0 : call = &ndr_table_samr.calls[21];
25600 :
25601 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
25602 0 : if (push == NULL) {
25603 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25604 0 : return NULL;
25605 : }
25606 :
25607 0 : push->flags |= ndr_push_flags;
25608 :
25609 0 : err = call->ndr_push(push, ndr_inout_flags, object);
25610 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25611 0 : TALLOC_FREE(push);
25612 0 : PyErr_SetNdrError(err);
25613 0 : return NULL;
25614 : }
25615 0 : blob = ndr_push_blob(push);
25616 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
25617 0 : TALLOC_FREE(push);
25618 0 : return ret;
25619 : }
25620 :
25621 0 : static PyObject *py_samr_SetGroupInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25622 : {
25623 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25624 0 : PyObject *bigendian_obj = NULL;
25625 0 : PyObject *ndr64_obj = NULL;
25626 0 : libndr_flags ndr_push_flags = 0;
25627 :
25628 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
25629 : discard_const_p(char *, kwnames),
25630 : &bigendian_obj,
25631 : &ndr64_obj)) {
25632 0 : return NULL;
25633 : }
25634 :
25635 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25636 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25637 : }
25638 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25639 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25640 : }
25641 :
25642 0 : return py_samr_SetGroupInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
25643 : }
25644 :
25645 0 : static PyObject *py_samr_SetGroupInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25646 : {
25647 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
25648 0 : PyObject *bigendian_obj = NULL;
25649 0 : PyObject *ndr64_obj = NULL;
25650 0 : libndr_flags ndr_push_flags = 0;
25651 :
25652 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
25653 : discard_const_p(char *, kwnames),
25654 : &bigendian_obj,
25655 : &ndr64_obj)) {
25656 0 : return NULL;
25657 : }
25658 :
25659 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25660 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
25661 : }
25662 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25663 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
25664 : }
25665 :
25666 0 : return py_samr_SetGroupInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
25667 : }
25668 :
25669 0 : static PyObject *py_samr_SetGroupInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
25670 : {
25671 0 : const struct ndr_interface_call *call = NULL;
25672 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25673 0 : struct ndr_pull *pull = NULL;
25674 0 : enum ndr_err_code err;
25675 :
25676 0 : if (ndr_table_samr.num_calls < 22) {
25677 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_unpack");
25678 0 : return NULL;
25679 : }
25680 0 : call = &ndr_table_samr.calls[21];
25681 :
25682 0 : pull = ndr_pull_init_blob(blob, object);
25683 0 : if (pull == NULL) {
25684 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
25685 0 : return NULL;
25686 : }
25687 :
25688 0 : pull->flags |= ndr_pull_flags;
25689 :
25690 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
25691 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
25692 0 : TALLOC_FREE(pull);
25693 0 : PyErr_SetNdrError(err);
25694 0 : return NULL;
25695 : }
25696 0 : if (!allow_remaining) {
25697 0 : uint32_t highest_ofs;
25698 :
25699 0 : if (pull->offset > pull->relative_highest_offset) {
25700 0 : highest_ofs = pull->offset;
25701 : } else {
25702 0 : highest_ofs = pull->relative_highest_offset;
25703 : }
25704 0 : if (highest_ofs < pull->data_size) {
25705 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
25706 : "not all bytes consumed ofs[%u] size[%u]",
25707 : highest_ofs, pull->data_size);
25708 0 : TALLOC_FREE(pull);
25709 0 : PyErr_SetNdrError(err);
25710 0 : return NULL;
25711 : }
25712 : }
25713 :
25714 0 : TALLOC_FREE(pull);
25715 0 : Py_RETURN_NONE;
25716 : }
25717 :
25718 0 : static PyObject *py_samr_SetGroupInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25719 : {
25720 0 : DATA_BLOB blob;
25721 0 : Py_ssize_t blob_length = 0;
25722 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25723 0 : PyObject *bigendian_obj = NULL;
25724 0 : PyObject *ndr64_obj = NULL;
25725 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25726 0 : PyObject *allow_remaining_obj = NULL;
25727 0 : bool allow_remaining = false;
25728 :
25729 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
25730 : discard_const_p(char *, kwnames),
25731 : &blob.data, &blob_length,
25732 : &bigendian_obj,
25733 : &ndr64_obj,
25734 : &allow_remaining_obj)) {
25735 0 : return NULL;
25736 : }
25737 0 : blob.length = blob_length;
25738 :
25739 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25740 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25741 : }
25742 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25743 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25744 : }
25745 :
25746 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25747 0 : allow_remaining = true;
25748 : }
25749 :
25750 0 : return py_samr_SetGroupInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
25751 : }
25752 :
25753 0 : static PyObject *py_samr_SetGroupInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
25754 : {
25755 0 : DATA_BLOB blob;
25756 0 : Py_ssize_t blob_length = 0;
25757 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
25758 0 : PyObject *bigendian_obj = NULL;
25759 0 : PyObject *ndr64_obj = NULL;
25760 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
25761 0 : PyObject *allow_remaining_obj = NULL;
25762 0 : bool allow_remaining = false;
25763 :
25764 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
25765 : discard_const_p(char *, kwnames),
25766 : &blob.data, &blob_length,
25767 : &bigendian_obj,
25768 : &ndr64_obj,
25769 : &allow_remaining_obj)) {
25770 0 : return NULL;
25771 : }
25772 0 : blob.length = blob_length;
25773 :
25774 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
25775 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
25776 : }
25777 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
25778 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
25779 : }
25780 :
25781 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
25782 0 : allow_remaining = true;
25783 : }
25784 :
25785 0 : return py_samr_SetGroupInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
25786 : }
25787 :
25788 0 : static PyObject *py_samr_SetGroupInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
25789 : {
25790 0 : const struct ndr_interface_call *call = NULL;
25791 0 : struct samr_SetGroupInfo *object = (struct samr_SetGroupInfo *)pytalloc_get_ptr(py_obj);
25792 0 : PyObject *ret;
25793 0 : char *retstr;
25794 :
25795 0 : if (ndr_table_samr.num_calls < 22) {
25796 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetGroupInfo_ndr_print");
25797 0 : return NULL;
25798 : }
25799 0 : call = &ndr_table_samr.calls[21];
25800 :
25801 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
25802 0 : ret = PyUnicode_FromString(retstr);
25803 0 : TALLOC_FREE(retstr);
25804 :
25805 0 : return ret;
25806 : }
25807 :
25808 0 : static PyObject *py_samr_SetGroupInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25809 : {
25810 0 : return py_samr_SetGroupInfo_ndr_print(py_obj, "samr_SetGroupInfo_in", NDR_IN);
25811 : }
25812 :
25813 0 : static PyObject *py_samr_SetGroupInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
25814 : {
25815 0 : return py_samr_SetGroupInfo_ndr_print(py_obj, "samr_SetGroupInfo_out", NDR_OUT);
25816 : }
25817 :
25818 : static PyMethodDef py_samr_SetGroupInfo_methods[] = {
25819 : { "opnum", (PyCFunction)py_samr_SetGroupInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
25820 : "samr.SetGroupInfo.opnum() -> 21 (0x15) " },
25821 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetGroupInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
25822 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
25823 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetGroupInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
25824 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
25825 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetGroupInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
25826 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
25827 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetGroupInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
25828 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
25829 : { "__ndr_print_in__", (PyCFunction)py_samr_SetGroupInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
25830 : { "__ndr_print_out__", (PyCFunction)py_samr_SetGroupInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
25831 : { NULL, NULL, 0, NULL }
25832 : };
25833 :
25834 :
25835 : static PyTypeObject samr_SetGroupInfo_Type = {
25836 : PyVarObject_HEAD_INIT(NULL, 0)
25837 : .tp_name = "samr.SetGroupInfo",
25838 : .tp_getset = py_samr_SetGroupInfo_getsetters,
25839 : .tp_methods = py_samr_SetGroupInfo_methods,
25840 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
25841 : .tp_new = py_samr_SetGroupInfo_new,
25842 : };
25843 :
25844 0 : static bool pack_py_samr_SetGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetGroupInfo *r)
25845 : {
25846 0 : PyObject *py_group_handle;
25847 0 : PyObject *py_level;
25848 0 : PyObject *py_info;
25849 0 : const char *kwnames[] = {
25850 : "group_handle", "level", "info", NULL
25851 : };
25852 :
25853 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level, &py_info)) {
25854 0 : return false;
25855 : }
25856 :
25857 0 : if (py_group_handle == NULL) {
25858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
25859 0 : return false;
25860 : }
25861 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
25862 0 : if (r->in.group_handle == NULL) {
25863 0 : PyErr_NoMemory();
25864 0 : return false;
25865 : }
25866 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
25867 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
25868 0 : PyErr_NoMemory();
25869 0 : return false;
25870 : }
25871 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
25872 0 : if (py_level == NULL) {
25873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
25874 0 : return false;
25875 : }
25876 : {
25877 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
25878 0 : if (PyLong_Check(py_level)) {
25879 0 : unsigned long long test_var;
25880 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
25881 0 : if (PyErr_Occurred() != NULL) {
25882 0 : return false;
25883 : }
25884 0 : if (test_var > uint_max) {
25885 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25886 : PyLong_Type.tp_name, uint_max, test_var);
25887 0 : return false;
25888 : }
25889 0 : r->in.level = test_var;
25890 : } else {
25891 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25892 : PyLong_Type.tp_name);
25893 0 : return false;
25894 : }
25895 : }
25896 0 : if (py_info == NULL) {
25897 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
25898 0 : return false;
25899 : }
25900 0 : r->in.info = talloc_ptrtype(r, r->in.info);
25901 0 : if (r->in.info == NULL) {
25902 0 : PyErr_NoMemory();
25903 0 : return false;
25904 : }
25905 : {
25906 0 : union samr_GroupInfo *info_switch_1;
25907 0 : info_switch_1 = (union samr_GroupInfo *)pyrpc_export_union(&samr_GroupInfo_Type, r, r->in.level, py_info, "union samr_GroupInfo");
25908 0 : if (info_switch_1 == NULL) {
25909 0 : return false;
25910 : }
25911 0 : r->in.info = info_switch_1;
25912 : }
25913 0 : return true;
25914 : }
25915 :
25916 0 : static PyObject *unpack_py_samr_SetGroupInfo_args_out(struct samr_SetGroupInfo *r)
25917 : {
25918 0 : PyObject *result;
25919 0 : result = Py_None;
25920 0 : Py_INCREF(result);
25921 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
25922 0 : PyErr_SetNTSTATUS(r->out.result);
25923 0 : return NULL;
25924 : }
25925 :
25926 0 : return result;
25927 : }
25928 :
25929 :
25930 0 : static PyObject *py_samr_AddGroupMember_in_get_group_handle(PyObject *obj, void *closure)
25931 : {
25932 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj);
25933 0 : PyObject *py_group_handle;
25934 0 : if (object->in.group_handle == NULL) {
25935 0 : Py_RETURN_NONE;
25936 : }
25937 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
25938 0 : return py_group_handle;
25939 : }
25940 :
25941 0 : static int py_samr_AddGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
25942 : {
25943 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
25944 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
25945 0 : if (value == NULL) {
25946 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
25947 0 : return -1;
25948 : }
25949 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
25950 0 : if (object->in.group_handle == NULL) {
25951 0 : PyErr_NoMemory();
25952 0 : return -1;
25953 : }
25954 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
25955 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
25956 0 : PyErr_NoMemory();
25957 0 : return -1;
25958 : }
25959 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
25960 0 : return 0;
25961 : }
25962 :
25963 0 : static PyObject *py_samr_AddGroupMember_in_get_rid(PyObject *obj, void *closure)
25964 : {
25965 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj);
25966 0 : PyObject *py_rid;
25967 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
25968 0 : return py_rid;
25969 : }
25970 :
25971 0 : static int py_samr_AddGroupMember_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
25972 : {
25973 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
25974 0 : if (value == NULL) {
25975 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
25976 0 : return -1;
25977 : }
25978 : {
25979 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
25980 0 : if (PyLong_Check(value)) {
25981 0 : unsigned long long test_var;
25982 0 : test_var = PyLong_AsUnsignedLongLong(value);
25983 0 : if (PyErr_Occurred() != NULL) {
25984 0 : return -1;
25985 : }
25986 0 : if (test_var > uint_max) {
25987 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
25988 : PyLong_Type.tp_name, uint_max, test_var);
25989 0 : return -1;
25990 : }
25991 0 : object->in.rid = test_var;
25992 : } else {
25993 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
25994 : PyLong_Type.tp_name);
25995 0 : return -1;
25996 : }
25997 : }
25998 0 : return 0;
25999 : }
26000 :
26001 0 : static PyObject *py_samr_AddGroupMember_in_get_flags(PyObject *obj, void *closure)
26002 : {
26003 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj);
26004 0 : PyObject *py_flags;
26005 0 : py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.flags);
26006 0 : return py_flags;
26007 : }
26008 :
26009 0 : static int py_samr_AddGroupMember_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
26010 : {
26011 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
26012 0 : if (value == NULL) {
26013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.flags");
26014 0 : return -1;
26015 : }
26016 : {
26017 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
26018 0 : if (PyLong_Check(value)) {
26019 0 : unsigned long long test_var;
26020 0 : test_var = PyLong_AsUnsignedLongLong(value);
26021 0 : if (PyErr_Occurred() != NULL) {
26022 0 : return -1;
26023 : }
26024 0 : if (test_var > uint_max) {
26025 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26026 : PyLong_Type.tp_name, uint_max, test_var);
26027 0 : return -1;
26028 : }
26029 0 : object->in.flags = test_var;
26030 : } else {
26031 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26032 : PyLong_Type.tp_name);
26033 0 : return -1;
26034 : }
26035 : }
26036 0 : return 0;
26037 : }
26038 :
26039 0 : static PyObject *py_samr_AddGroupMember_get_result(PyObject *obj, void *closure)
26040 : {
26041 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(obj);
26042 0 : PyObject *py_result;
26043 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26044 0 : return py_result;
26045 : }
26046 :
26047 0 : static int py_samr_AddGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure)
26048 : {
26049 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
26050 0 : if (value == NULL) {
26051 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26052 0 : return -1;
26053 : }
26054 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26055 0 : return 0;
26056 : }
26057 :
26058 : static PyGetSetDef py_samr_AddGroupMember_getsetters[] = {
26059 : {
26060 : .name = discard_const_p(char, "in_group_handle"),
26061 : .get = py_samr_AddGroupMember_in_get_group_handle,
26062 : .set = py_samr_AddGroupMember_in_set_group_handle,
26063 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26064 : },
26065 : {
26066 : .name = discard_const_p(char, "in_rid"),
26067 : .get = py_samr_AddGroupMember_in_get_rid,
26068 : .set = py_samr_AddGroupMember_in_set_rid,
26069 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26070 : },
26071 : {
26072 : .name = discard_const_p(char, "in_flags"),
26073 : .get = py_samr_AddGroupMember_in_get_flags,
26074 : .set = py_samr_AddGroupMember_in_set_flags,
26075 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26076 : },
26077 : {
26078 : .name = discard_const_p(char, "result"),
26079 : .get = py_samr_AddGroupMember_get_result,
26080 : .set = py_samr_AddGroupMember_set_result,
26081 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26082 : },
26083 : { .name = NULL }
26084 : };
26085 :
26086 0 : static PyObject *py_samr_AddGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26087 : {
26088 0 : PyObject *self = pytalloc_new(struct samr_AddGroupMember, type);
26089 0 : struct samr_AddGroupMember *_self = (struct samr_AddGroupMember *)pytalloc_get_ptr(self);
26090 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26091 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
26092 0 : return self;
26093 : }
26094 :
26095 0 : static PyObject *py_samr_AddGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26096 : {
26097 :
26098 :
26099 0 : return PyLong_FromLong(22);
26100 : }
26101 :
26102 0 : static PyObject *py_samr_AddGroupMember_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26103 : {
26104 0 : const struct ndr_interface_call *call = NULL;
26105 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
26106 0 : PyObject *ret = NULL;
26107 0 : struct ndr_push *push = NULL;
26108 0 : DATA_BLOB blob;
26109 0 : enum ndr_err_code err;
26110 :
26111 0 : if (ndr_table_samr.num_calls < 23) {
26112 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_pack");
26113 0 : return NULL;
26114 : }
26115 0 : call = &ndr_table_samr.calls[22];
26116 :
26117 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26118 0 : if (push == NULL) {
26119 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26120 0 : return NULL;
26121 : }
26122 :
26123 0 : push->flags |= ndr_push_flags;
26124 :
26125 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26126 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26127 0 : TALLOC_FREE(push);
26128 0 : PyErr_SetNdrError(err);
26129 0 : return NULL;
26130 : }
26131 0 : blob = ndr_push_blob(push);
26132 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26133 0 : TALLOC_FREE(push);
26134 0 : return ret;
26135 : }
26136 :
26137 0 : static PyObject *py_samr_AddGroupMember_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26138 : {
26139 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26140 0 : PyObject *bigendian_obj = NULL;
26141 0 : PyObject *ndr64_obj = NULL;
26142 0 : libndr_flags ndr_push_flags = 0;
26143 :
26144 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26145 : discard_const_p(char *, kwnames),
26146 : &bigendian_obj,
26147 : &ndr64_obj)) {
26148 0 : return NULL;
26149 : }
26150 :
26151 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26152 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26153 : }
26154 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26155 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26156 : }
26157 :
26158 0 : return py_samr_AddGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26159 : }
26160 :
26161 0 : static PyObject *py_samr_AddGroupMember_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26162 : {
26163 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26164 0 : PyObject *bigendian_obj = NULL;
26165 0 : PyObject *ndr64_obj = NULL;
26166 0 : libndr_flags ndr_push_flags = 0;
26167 :
26168 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26169 : discard_const_p(char *, kwnames),
26170 : &bigendian_obj,
26171 : &ndr64_obj)) {
26172 0 : return NULL;
26173 : }
26174 :
26175 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26176 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26177 : }
26178 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26179 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26180 : }
26181 :
26182 0 : return py_samr_AddGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26183 : }
26184 :
26185 0 : static PyObject *py_samr_AddGroupMember_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
26186 : {
26187 0 : const struct ndr_interface_call *call = NULL;
26188 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
26189 0 : struct ndr_pull *pull = NULL;
26190 0 : enum ndr_err_code err;
26191 :
26192 0 : if (ndr_table_samr.num_calls < 23) {
26193 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_unpack");
26194 0 : return NULL;
26195 : }
26196 0 : call = &ndr_table_samr.calls[22];
26197 :
26198 0 : pull = ndr_pull_init_blob(blob, object);
26199 0 : if (pull == NULL) {
26200 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26201 0 : return NULL;
26202 : }
26203 :
26204 0 : pull->flags |= ndr_pull_flags;
26205 :
26206 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26207 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26208 0 : TALLOC_FREE(pull);
26209 0 : PyErr_SetNdrError(err);
26210 0 : return NULL;
26211 : }
26212 0 : if (!allow_remaining) {
26213 0 : uint32_t highest_ofs;
26214 :
26215 0 : if (pull->offset > pull->relative_highest_offset) {
26216 0 : highest_ofs = pull->offset;
26217 : } else {
26218 0 : highest_ofs = pull->relative_highest_offset;
26219 : }
26220 0 : if (highest_ofs < pull->data_size) {
26221 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26222 : "not all bytes consumed ofs[%u] size[%u]",
26223 : highest_ofs, pull->data_size);
26224 0 : TALLOC_FREE(pull);
26225 0 : PyErr_SetNdrError(err);
26226 0 : return NULL;
26227 : }
26228 : }
26229 :
26230 0 : TALLOC_FREE(pull);
26231 0 : Py_RETURN_NONE;
26232 : }
26233 :
26234 0 : static PyObject *py_samr_AddGroupMember_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26235 : {
26236 0 : DATA_BLOB blob;
26237 0 : Py_ssize_t blob_length = 0;
26238 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26239 0 : PyObject *bigendian_obj = NULL;
26240 0 : PyObject *ndr64_obj = NULL;
26241 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26242 0 : PyObject *allow_remaining_obj = NULL;
26243 0 : bool allow_remaining = false;
26244 :
26245 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26246 : discard_const_p(char *, kwnames),
26247 : &blob.data, &blob_length,
26248 : &bigendian_obj,
26249 : &ndr64_obj,
26250 : &allow_remaining_obj)) {
26251 0 : return NULL;
26252 : }
26253 0 : blob.length = blob_length;
26254 :
26255 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26256 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26257 : }
26258 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26259 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26260 : }
26261 :
26262 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26263 0 : allow_remaining = true;
26264 : }
26265 :
26266 0 : return py_samr_AddGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26267 : }
26268 :
26269 0 : static PyObject *py_samr_AddGroupMember_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26270 : {
26271 0 : DATA_BLOB blob;
26272 0 : Py_ssize_t blob_length = 0;
26273 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26274 0 : PyObject *bigendian_obj = NULL;
26275 0 : PyObject *ndr64_obj = NULL;
26276 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26277 0 : PyObject *allow_remaining_obj = NULL;
26278 0 : bool allow_remaining = false;
26279 :
26280 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26281 : discard_const_p(char *, kwnames),
26282 : &blob.data, &blob_length,
26283 : &bigendian_obj,
26284 : &ndr64_obj,
26285 : &allow_remaining_obj)) {
26286 0 : return NULL;
26287 : }
26288 0 : blob.length = blob_length;
26289 :
26290 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26291 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26292 : }
26293 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26294 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26295 : }
26296 :
26297 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26298 0 : allow_remaining = true;
26299 : }
26300 :
26301 0 : return py_samr_AddGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26302 : }
26303 :
26304 0 : static PyObject *py_samr_AddGroupMember_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26305 : {
26306 0 : const struct ndr_interface_call *call = NULL;
26307 0 : struct samr_AddGroupMember *object = (struct samr_AddGroupMember *)pytalloc_get_ptr(py_obj);
26308 0 : PyObject *ret;
26309 0 : char *retstr;
26310 :
26311 0 : if (ndr_table_samr.num_calls < 23) {
26312 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddGroupMember_ndr_print");
26313 0 : return NULL;
26314 : }
26315 0 : call = &ndr_table_samr.calls[22];
26316 :
26317 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26318 0 : ret = PyUnicode_FromString(retstr);
26319 0 : TALLOC_FREE(retstr);
26320 :
26321 0 : return ret;
26322 : }
26323 :
26324 0 : static PyObject *py_samr_AddGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26325 : {
26326 0 : return py_samr_AddGroupMember_ndr_print(py_obj, "samr_AddGroupMember_in", NDR_IN);
26327 : }
26328 :
26329 0 : static PyObject *py_samr_AddGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26330 : {
26331 0 : return py_samr_AddGroupMember_ndr_print(py_obj, "samr_AddGroupMember_out", NDR_OUT);
26332 : }
26333 :
26334 : static PyMethodDef py_samr_AddGroupMember_methods[] = {
26335 : { "opnum", (PyCFunction)py_samr_AddGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS,
26336 : "samr.AddGroupMember.opnum() -> 22 (0x16) " },
26337 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddGroupMember_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26338 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26339 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddGroupMember_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26340 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26341 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddGroupMember_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26342 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26343 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddGroupMember_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26344 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26345 : { "__ndr_print_in__", (PyCFunction)py_samr_AddGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26346 : { "__ndr_print_out__", (PyCFunction)py_samr_AddGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26347 : { NULL, NULL, 0, NULL }
26348 : };
26349 :
26350 :
26351 : static PyTypeObject samr_AddGroupMember_Type = {
26352 : PyVarObject_HEAD_INIT(NULL, 0)
26353 : .tp_name = "samr.AddGroupMember",
26354 : .tp_getset = py_samr_AddGroupMember_getsetters,
26355 : .tp_methods = py_samr_AddGroupMember_methods,
26356 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26357 : .tp_new = py_samr_AddGroupMember_new,
26358 : };
26359 :
26360 0 : static bool pack_py_samr_AddGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddGroupMember *r)
26361 : {
26362 0 : PyObject *py_group_handle;
26363 0 : PyObject *py_rid;
26364 0 : PyObject *py_flags;
26365 0 : const char *kwnames[] = {
26366 : "group_handle", "rid", "flags", NULL
26367 : };
26368 :
26369 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_AddGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid, &py_flags)) {
26370 0 : return false;
26371 : }
26372 :
26373 0 : if (py_group_handle == NULL) {
26374 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
26375 0 : return false;
26376 : }
26377 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
26378 0 : if (r->in.group_handle == NULL) {
26379 0 : PyErr_NoMemory();
26380 0 : return false;
26381 : }
26382 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
26383 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
26384 0 : PyErr_NoMemory();
26385 0 : return false;
26386 : }
26387 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
26388 0 : if (py_rid == NULL) {
26389 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
26390 0 : return false;
26391 : }
26392 : {
26393 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
26394 0 : if (PyLong_Check(py_rid)) {
26395 0 : unsigned long long test_var;
26396 0 : test_var = PyLong_AsUnsignedLongLong(py_rid);
26397 0 : if (PyErr_Occurred() != NULL) {
26398 0 : return false;
26399 : }
26400 0 : if (test_var > uint_max) {
26401 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26402 : PyLong_Type.tp_name, uint_max, test_var);
26403 0 : return false;
26404 : }
26405 0 : r->in.rid = test_var;
26406 : } else {
26407 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26408 : PyLong_Type.tp_name);
26409 0 : return false;
26410 : }
26411 : }
26412 0 : if (py_flags == NULL) {
26413 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.flags");
26414 0 : return false;
26415 : }
26416 : {
26417 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
26418 0 : if (PyLong_Check(py_flags)) {
26419 0 : unsigned long long test_var;
26420 0 : test_var = PyLong_AsUnsignedLongLong(py_flags);
26421 0 : if (PyErr_Occurred() != NULL) {
26422 0 : return false;
26423 : }
26424 0 : if (test_var > uint_max) {
26425 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26426 : PyLong_Type.tp_name, uint_max, test_var);
26427 0 : return false;
26428 : }
26429 0 : r->in.flags = test_var;
26430 : } else {
26431 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26432 : PyLong_Type.tp_name);
26433 0 : return false;
26434 : }
26435 : }
26436 0 : return true;
26437 : }
26438 :
26439 0 : static PyObject *unpack_py_samr_AddGroupMember_args_out(struct samr_AddGroupMember *r)
26440 : {
26441 0 : PyObject *result;
26442 0 : result = Py_None;
26443 0 : Py_INCREF(result);
26444 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26445 0 : PyErr_SetNTSTATUS(r->out.result);
26446 0 : return NULL;
26447 : }
26448 :
26449 0 : return result;
26450 : }
26451 :
26452 :
26453 0 : static PyObject *py_samr_DeleteDomainGroup_in_get_group_handle(PyObject *obj, void *closure)
26454 : {
26455 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj);
26456 0 : PyObject *py_group_handle;
26457 0 : if (object->in.group_handle == NULL) {
26458 0 : Py_RETURN_NONE;
26459 : }
26460 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
26461 0 : return py_group_handle;
26462 : }
26463 :
26464 0 : static int py_samr_DeleteDomainGroup_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
26465 : {
26466 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26467 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
26468 0 : if (value == NULL) {
26469 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
26470 0 : return -1;
26471 : }
26472 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
26473 0 : if (object->in.group_handle == NULL) {
26474 0 : PyErr_NoMemory();
26475 0 : return -1;
26476 : }
26477 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26478 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26479 0 : PyErr_NoMemory();
26480 0 : return -1;
26481 : }
26482 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26483 0 : return 0;
26484 : }
26485 :
26486 0 : static PyObject *py_samr_DeleteDomainGroup_out_get_group_handle(PyObject *obj, void *closure)
26487 : {
26488 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj);
26489 0 : PyObject *py_group_handle;
26490 0 : if (object->out.group_handle == NULL) {
26491 0 : Py_RETURN_NONE;
26492 : }
26493 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->out.group_handle, object->out.group_handle);
26494 0 : return py_group_handle;
26495 : }
26496 :
26497 0 : static int py_samr_DeleteDomainGroup_out_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
26498 : {
26499 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26500 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.group_handle));
26501 0 : if (value == NULL) {
26502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.group_handle");
26503 0 : return -1;
26504 : }
26505 0 : object->out.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.group_handle);
26506 0 : if (object->out.group_handle == NULL) {
26507 0 : PyErr_NoMemory();
26508 0 : return -1;
26509 : }
26510 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
26511 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
26512 0 : PyErr_NoMemory();
26513 0 : return -1;
26514 : }
26515 0 : object->out.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26516 0 : return 0;
26517 : }
26518 :
26519 0 : static PyObject *py_samr_DeleteDomainGroup_get_result(PyObject *obj, void *closure)
26520 : {
26521 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(obj);
26522 0 : PyObject *py_result;
26523 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26524 0 : return py_result;
26525 : }
26526 :
26527 0 : static int py_samr_DeleteDomainGroup_set_result(PyObject *py_obj, PyObject *value, void *closure)
26528 : {
26529 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26530 0 : if (value == NULL) {
26531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26532 0 : return -1;
26533 : }
26534 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26535 0 : return 0;
26536 : }
26537 :
26538 : static PyGetSetDef py_samr_DeleteDomainGroup_getsetters[] = {
26539 : {
26540 : .name = discard_const_p(char, "in_group_handle"),
26541 : .get = py_samr_DeleteDomainGroup_in_get_group_handle,
26542 : .set = py_samr_DeleteDomainGroup_in_set_group_handle,
26543 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26544 : },
26545 : {
26546 : .name = discard_const_p(char, "out_group_handle"),
26547 : .get = py_samr_DeleteDomainGroup_out_get_group_handle,
26548 : .set = py_samr_DeleteDomainGroup_out_set_group_handle,
26549 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26550 : },
26551 : {
26552 : .name = discard_const_p(char, "result"),
26553 : .get = py_samr_DeleteDomainGroup_get_result,
26554 : .set = py_samr_DeleteDomainGroup_set_result,
26555 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26556 : },
26557 : { .name = NULL }
26558 : };
26559 :
26560 0 : static PyObject *py_samr_DeleteDomainGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26561 : {
26562 0 : PyObject *self = pytalloc_new(struct samr_DeleteDomainGroup, type);
26563 0 : struct samr_DeleteDomainGroup *_self = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(self);
26564 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26565 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
26566 0 : _self->out.group_handle = talloc_zero(mem_ctx, struct policy_handle);
26567 0 : return self;
26568 : }
26569 :
26570 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
26571 : {
26572 :
26573 :
26574 0 : return PyLong_FromLong(23);
26575 : }
26576 :
26577 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
26578 : {
26579 0 : const struct ndr_interface_call *call = NULL;
26580 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26581 0 : PyObject *ret = NULL;
26582 0 : struct ndr_push *push = NULL;
26583 0 : DATA_BLOB blob;
26584 0 : enum ndr_err_code err;
26585 :
26586 0 : if (ndr_table_samr.num_calls < 24) {
26587 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_pack");
26588 0 : return NULL;
26589 : }
26590 0 : call = &ndr_table_samr.calls[23];
26591 :
26592 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
26593 0 : if (push == NULL) {
26594 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26595 0 : return NULL;
26596 : }
26597 :
26598 0 : push->flags |= ndr_push_flags;
26599 :
26600 0 : err = call->ndr_push(push, ndr_inout_flags, object);
26601 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26602 0 : TALLOC_FREE(push);
26603 0 : PyErr_SetNdrError(err);
26604 0 : return NULL;
26605 : }
26606 0 : blob = ndr_push_blob(push);
26607 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
26608 0 : TALLOC_FREE(push);
26609 0 : return ret;
26610 : }
26611 :
26612 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26613 : {
26614 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26615 0 : PyObject *bigendian_obj = NULL;
26616 0 : PyObject *ndr64_obj = NULL;
26617 0 : libndr_flags ndr_push_flags = 0;
26618 :
26619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
26620 : discard_const_p(char *, kwnames),
26621 : &bigendian_obj,
26622 : &ndr64_obj)) {
26623 0 : return NULL;
26624 : }
26625 :
26626 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26627 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26628 : }
26629 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26630 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26631 : }
26632 :
26633 0 : return py_samr_DeleteDomainGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
26634 : }
26635 :
26636 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26637 : {
26638 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
26639 0 : PyObject *bigendian_obj = NULL;
26640 0 : PyObject *ndr64_obj = NULL;
26641 0 : libndr_flags ndr_push_flags = 0;
26642 :
26643 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
26644 : discard_const_p(char *, kwnames),
26645 : &bigendian_obj,
26646 : &ndr64_obj)) {
26647 0 : return NULL;
26648 : }
26649 :
26650 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26651 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
26652 : }
26653 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26654 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
26655 : }
26656 :
26657 0 : return py_samr_DeleteDomainGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
26658 : }
26659 :
26660 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
26661 : {
26662 0 : const struct ndr_interface_call *call = NULL;
26663 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26664 0 : struct ndr_pull *pull = NULL;
26665 0 : enum ndr_err_code err;
26666 :
26667 0 : if (ndr_table_samr.num_calls < 24) {
26668 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_unpack");
26669 0 : return NULL;
26670 : }
26671 0 : call = &ndr_table_samr.calls[23];
26672 :
26673 0 : pull = ndr_pull_init_blob(blob, object);
26674 0 : if (pull == NULL) {
26675 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
26676 0 : return NULL;
26677 : }
26678 :
26679 0 : pull->flags |= ndr_pull_flags;
26680 :
26681 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
26682 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
26683 0 : TALLOC_FREE(pull);
26684 0 : PyErr_SetNdrError(err);
26685 0 : return NULL;
26686 : }
26687 0 : if (!allow_remaining) {
26688 0 : uint32_t highest_ofs;
26689 :
26690 0 : if (pull->offset > pull->relative_highest_offset) {
26691 0 : highest_ofs = pull->offset;
26692 : } else {
26693 0 : highest_ofs = pull->relative_highest_offset;
26694 : }
26695 0 : if (highest_ofs < pull->data_size) {
26696 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
26697 : "not all bytes consumed ofs[%u] size[%u]",
26698 : highest_ofs, pull->data_size);
26699 0 : TALLOC_FREE(pull);
26700 0 : PyErr_SetNdrError(err);
26701 0 : return NULL;
26702 : }
26703 : }
26704 :
26705 0 : TALLOC_FREE(pull);
26706 0 : Py_RETURN_NONE;
26707 : }
26708 :
26709 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26710 : {
26711 0 : DATA_BLOB blob;
26712 0 : Py_ssize_t blob_length = 0;
26713 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26714 0 : PyObject *bigendian_obj = NULL;
26715 0 : PyObject *ndr64_obj = NULL;
26716 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26717 0 : PyObject *allow_remaining_obj = NULL;
26718 0 : bool allow_remaining = false;
26719 :
26720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
26721 : discard_const_p(char *, kwnames),
26722 : &blob.data, &blob_length,
26723 : &bigendian_obj,
26724 : &ndr64_obj,
26725 : &allow_remaining_obj)) {
26726 0 : return NULL;
26727 : }
26728 0 : blob.length = blob_length;
26729 :
26730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26731 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26732 : }
26733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26734 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26735 : }
26736 :
26737 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26738 0 : allow_remaining = true;
26739 : }
26740 :
26741 0 : return py_samr_DeleteDomainGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
26742 : }
26743 :
26744 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
26745 : {
26746 0 : DATA_BLOB blob;
26747 0 : Py_ssize_t blob_length = 0;
26748 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
26749 0 : PyObject *bigendian_obj = NULL;
26750 0 : PyObject *ndr64_obj = NULL;
26751 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
26752 0 : PyObject *allow_remaining_obj = NULL;
26753 0 : bool allow_remaining = false;
26754 :
26755 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
26756 : discard_const_p(char *, kwnames),
26757 : &blob.data, &blob_length,
26758 : &bigendian_obj,
26759 : &ndr64_obj,
26760 : &allow_remaining_obj)) {
26761 0 : return NULL;
26762 : }
26763 0 : blob.length = blob_length;
26764 :
26765 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
26766 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
26767 : }
26768 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
26769 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
26770 : }
26771 :
26772 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
26773 0 : allow_remaining = true;
26774 : }
26775 :
26776 0 : return py_samr_DeleteDomainGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
26777 : }
26778 :
26779 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
26780 : {
26781 0 : const struct ndr_interface_call *call = NULL;
26782 0 : struct samr_DeleteDomainGroup *object = (struct samr_DeleteDomainGroup *)pytalloc_get_ptr(py_obj);
26783 0 : PyObject *ret;
26784 0 : char *retstr;
26785 :
26786 0 : if (ndr_table_samr.num_calls < 24) {
26787 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomainGroup_ndr_print");
26788 0 : return NULL;
26789 : }
26790 0 : call = &ndr_table_samr.calls[23];
26791 :
26792 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
26793 0 : ret = PyUnicode_FromString(retstr);
26794 0 : TALLOC_FREE(retstr);
26795 :
26796 0 : return ret;
26797 : }
26798 :
26799 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26800 : {
26801 0 : return py_samr_DeleteDomainGroup_ndr_print(py_obj, "samr_DeleteDomainGroup_in", NDR_IN);
26802 : }
26803 :
26804 0 : static PyObject *py_samr_DeleteDomainGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
26805 : {
26806 0 : return py_samr_DeleteDomainGroup_ndr_print(py_obj, "samr_DeleteDomainGroup_out", NDR_OUT);
26807 : }
26808 :
26809 : static PyMethodDef py_samr_DeleteDomainGroup_methods[] = {
26810 : { "opnum", (PyCFunction)py_samr_DeleteDomainGroup_ndr_opnum, METH_NOARGS|METH_CLASS,
26811 : "samr.DeleteDomainGroup.opnum() -> 23 (0x17) " },
26812 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomainGroup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
26813 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
26814 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomainGroup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
26815 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
26816 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomainGroup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
26817 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
26818 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomainGroup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
26819 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
26820 : { "__ndr_print_in__", (PyCFunction)py_samr_DeleteDomainGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
26821 : { "__ndr_print_out__", (PyCFunction)py_samr_DeleteDomainGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
26822 : { NULL, NULL, 0, NULL }
26823 : };
26824 :
26825 :
26826 : static PyTypeObject samr_DeleteDomainGroup_Type = {
26827 : PyVarObject_HEAD_INIT(NULL, 0)
26828 : .tp_name = "samr.DeleteDomainGroup",
26829 : .tp_getset = py_samr_DeleteDomainGroup_getsetters,
26830 : .tp_methods = py_samr_DeleteDomainGroup_methods,
26831 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
26832 : .tp_new = py_samr_DeleteDomainGroup_new,
26833 : };
26834 :
26835 0 : static bool pack_py_samr_DeleteDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomainGroup *r)
26836 : {
26837 0 : PyObject *py_group_handle;
26838 0 : const char *kwnames[] = {
26839 : "group_handle", NULL
26840 : };
26841 :
26842 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomainGroup", discard_const_p(char *, kwnames), &py_group_handle)) {
26843 0 : return false;
26844 : }
26845 :
26846 0 : if (py_group_handle == NULL) {
26847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
26848 0 : return false;
26849 : }
26850 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
26851 0 : if (r->in.group_handle == NULL) {
26852 0 : PyErr_NoMemory();
26853 0 : return false;
26854 : }
26855 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
26856 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
26857 0 : PyErr_NoMemory();
26858 0 : return false;
26859 : }
26860 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
26861 0 : return true;
26862 : }
26863 :
26864 0 : static PyObject *unpack_py_samr_DeleteDomainGroup_args_out(struct samr_DeleteDomainGroup *r)
26865 : {
26866 0 : PyObject *result;
26867 0 : PyObject *py_group_handle;
26868 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
26869 0 : result = py_group_handle;
26870 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
26871 0 : PyErr_SetNTSTATUS(r->out.result);
26872 0 : return NULL;
26873 : }
26874 :
26875 0 : return result;
26876 : }
26877 :
26878 :
26879 0 : static PyObject *py_samr_DeleteGroupMember_in_get_group_handle(PyObject *obj, void *closure)
26880 : {
26881 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj);
26882 0 : PyObject *py_group_handle;
26883 0 : if (object->in.group_handle == NULL) {
26884 0 : Py_RETURN_NONE;
26885 : }
26886 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
26887 0 : return py_group_handle;
26888 : }
26889 :
26890 0 : static int py_samr_DeleteGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
26891 : {
26892 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
26893 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
26894 0 : if (value == NULL) {
26895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
26896 0 : return -1;
26897 : }
26898 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
26899 0 : if (object->in.group_handle == NULL) {
26900 0 : PyErr_NoMemory();
26901 0 : return -1;
26902 : }
26903 0 : PY_CHECK_TYPE(policy_handle_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.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
26909 0 : return 0;
26910 : }
26911 :
26912 0 : static PyObject *py_samr_DeleteGroupMember_in_get_rid(PyObject *obj, void *closure)
26913 : {
26914 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj);
26915 0 : PyObject *py_rid;
26916 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
26917 0 : return py_rid;
26918 : }
26919 :
26920 0 : static int py_samr_DeleteGroupMember_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
26921 : {
26922 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
26923 0 : if (value == NULL) {
26924 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
26925 0 : return -1;
26926 : }
26927 : {
26928 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
26929 0 : if (PyLong_Check(value)) {
26930 0 : unsigned long long test_var;
26931 0 : test_var = PyLong_AsUnsignedLongLong(value);
26932 0 : if (PyErr_Occurred() != NULL) {
26933 0 : return -1;
26934 : }
26935 0 : if (test_var > uint_max) {
26936 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
26937 : PyLong_Type.tp_name, uint_max, test_var);
26938 0 : return -1;
26939 : }
26940 0 : object->in.rid = test_var;
26941 : } else {
26942 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
26943 : PyLong_Type.tp_name);
26944 0 : return -1;
26945 : }
26946 : }
26947 0 : return 0;
26948 : }
26949 :
26950 0 : static PyObject *py_samr_DeleteGroupMember_get_result(PyObject *obj, void *closure)
26951 : {
26952 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(obj);
26953 0 : PyObject *py_result;
26954 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
26955 0 : return py_result;
26956 : }
26957 :
26958 0 : static int py_samr_DeleteGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure)
26959 : {
26960 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
26961 0 : if (value == NULL) {
26962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
26963 0 : return -1;
26964 : }
26965 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
26966 0 : return 0;
26967 : }
26968 :
26969 : static PyGetSetDef py_samr_DeleteGroupMember_getsetters[] = {
26970 : {
26971 : .name = discard_const_p(char, "in_group_handle"),
26972 : .get = py_samr_DeleteGroupMember_in_get_group_handle,
26973 : .set = py_samr_DeleteGroupMember_in_set_group_handle,
26974 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
26975 : },
26976 : {
26977 : .name = discard_const_p(char, "in_rid"),
26978 : .get = py_samr_DeleteGroupMember_in_get_rid,
26979 : .set = py_samr_DeleteGroupMember_in_set_rid,
26980 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
26981 : },
26982 : {
26983 : .name = discard_const_p(char, "result"),
26984 : .get = py_samr_DeleteGroupMember_get_result,
26985 : .set = py_samr_DeleteGroupMember_set_result,
26986 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
26987 : },
26988 : { .name = NULL }
26989 : };
26990 :
26991 0 : static PyObject *py_samr_DeleteGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
26992 : {
26993 0 : PyObject *self = pytalloc_new(struct samr_DeleteGroupMember, type);
26994 0 : struct samr_DeleteGroupMember *_self = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(self);
26995 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
26996 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
26997 0 : return self;
26998 : }
26999 :
27000 0 : static PyObject *py_samr_DeleteGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27001 : {
27002 :
27003 :
27004 0 : return PyLong_FromLong(24);
27005 : }
27006 :
27007 0 : static PyObject *py_samr_DeleteGroupMember_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27008 : {
27009 0 : const struct ndr_interface_call *call = NULL;
27010 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
27011 0 : PyObject *ret = NULL;
27012 0 : struct ndr_push *push = NULL;
27013 0 : DATA_BLOB blob;
27014 0 : enum ndr_err_code err;
27015 :
27016 0 : if (ndr_table_samr.num_calls < 25) {
27017 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_pack");
27018 0 : return NULL;
27019 : }
27020 0 : call = &ndr_table_samr.calls[24];
27021 :
27022 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27023 0 : if (push == NULL) {
27024 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27025 0 : return NULL;
27026 : }
27027 :
27028 0 : push->flags |= ndr_push_flags;
27029 :
27030 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27031 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27032 0 : TALLOC_FREE(push);
27033 0 : PyErr_SetNdrError(err);
27034 0 : return NULL;
27035 : }
27036 0 : blob = ndr_push_blob(push);
27037 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27038 0 : TALLOC_FREE(push);
27039 0 : return ret;
27040 : }
27041 :
27042 0 : static PyObject *py_samr_DeleteGroupMember_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27043 : {
27044 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27045 0 : PyObject *bigendian_obj = NULL;
27046 0 : PyObject *ndr64_obj = NULL;
27047 0 : libndr_flags ndr_push_flags = 0;
27048 :
27049 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27050 : discard_const_p(char *, kwnames),
27051 : &bigendian_obj,
27052 : &ndr64_obj)) {
27053 0 : return NULL;
27054 : }
27055 :
27056 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27057 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27058 : }
27059 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27060 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27061 : }
27062 :
27063 0 : return py_samr_DeleteGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27064 : }
27065 :
27066 0 : static PyObject *py_samr_DeleteGroupMember_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27067 : {
27068 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27069 0 : PyObject *bigendian_obj = NULL;
27070 0 : PyObject *ndr64_obj = NULL;
27071 0 : libndr_flags ndr_push_flags = 0;
27072 :
27073 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27074 : discard_const_p(char *, kwnames),
27075 : &bigendian_obj,
27076 : &ndr64_obj)) {
27077 0 : return NULL;
27078 : }
27079 :
27080 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27081 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27082 : }
27083 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27084 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27085 : }
27086 :
27087 0 : return py_samr_DeleteGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27088 : }
27089 :
27090 0 : static PyObject *py_samr_DeleteGroupMember_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27091 : {
27092 0 : const struct ndr_interface_call *call = NULL;
27093 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
27094 0 : struct ndr_pull *pull = NULL;
27095 0 : enum ndr_err_code err;
27096 :
27097 0 : if (ndr_table_samr.num_calls < 25) {
27098 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_unpack");
27099 0 : return NULL;
27100 : }
27101 0 : call = &ndr_table_samr.calls[24];
27102 :
27103 0 : pull = ndr_pull_init_blob(blob, object);
27104 0 : if (pull == NULL) {
27105 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27106 0 : return NULL;
27107 : }
27108 :
27109 0 : pull->flags |= ndr_pull_flags;
27110 :
27111 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27112 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27113 0 : TALLOC_FREE(pull);
27114 0 : PyErr_SetNdrError(err);
27115 0 : return NULL;
27116 : }
27117 0 : if (!allow_remaining) {
27118 0 : uint32_t highest_ofs;
27119 :
27120 0 : if (pull->offset > pull->relative_highest_offset) {
27121 0 : highest_ofs = pull->offset;
27122 : } else {
27123 0 : highest_ofs = pull->relative_highest_offset;
27124 : }
27125 0 : if (highest_ofs < pull->data_size) {
27126 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27127 : "not all bytes consumed ofs[%u] size[%u]",
27128 : highest_ofs, pull->data_size);
27129 0 : TALLOC_FREE(pull);
27130 0 : PyErr_SetNdrError(err);
27131 0 : return NULL;
27132 : }
27133 : }
27134 :
27135 0 : TALLOC_FREE(pull);
27136 0 : Py_RETURN_NONE;
27137 : }
27138 :
27139 0 : static PyObject *py_samr_DeleteGroupMember_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27140 : {
27141 0 : DATA_BLOB blob;
27142 0 : Py_ssize_t blob_length = 0;
27143 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27144 0 : PyObject *bigendian_obj = NULL;
27145 0 : PyObject *ndr64_obj = NULL;
27146 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27147 0 : PyObject *allow_remaining_obj = NULL;
27148 0 : bool allow_remaining = false;
27149 :
27150 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27151 : discard_const_p(char *, kwnames),
27152 : &blob.data, &blob_length,
27153 : &bigendian_obj,
27154 : &ndr64_obj,
27155 : &allow_remaining_obj)) {
27156 0 : return NULL;
27157 : }
27158 0 : blob.length = blob_length;
27159 :
27160 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27161 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27162 : }
27163 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27164 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27165 : }
27166 :
27167 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27168 0 : allow_remaining = true;
27169 : }
27170 :
27171 0 : return py_samr_DeleteGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27172 : }
27173 :
27174 0 : static PyObject *py_samr_DeleteGroupMember_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27175 : {
27176 0 : DATA_BLOB blob;
27177 0 : Py_ssize_t blob_length = 0;
27178 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27179 0 : PyObject *bigendian_obj = NULL;
27180 0 : PyObject *ndr64_obj = NULL;
27181 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27182 0 : PyObject *allow_remaining_obj = NULL;
27183 0 : bool allow_remaining = false;
27184 :
27185 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27186 : discard_const_p(char *, kwnames),
27187 : &blob.data, &blob_length,
27188 : &bigendian_obj,
27189 : &ndr64_obj,
27190 : &allow_remaining_obj)) {
27191 0 : return NULL;
27192 : }
27193 0 : blob.length = blob_length;
27194 :
27195 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27196 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27197 : }
27198 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27199 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27200 : }
27201 :
27202 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27203 0 : allow_remaining = true;
27204 : }
27205 :
27206 0 : return py_samr_DeleteGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27207 : }
27208 :
27209 0 : static PyObject *py_samr_DeleteGroupMember_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27210 : {
27211 0 : const struct ndr_interface_call *call = NULL;
27212 0 : struct samr_DeleteGroupMember *object = (struct samr_DeleteGroupMember *)pytalloc_get_ptr(py_obj);
27213 0 : PyObject *ret;
27214 0 : char *retstr;
27215 :
27216 0 : if (ndr_table_samr.num_calls < 25) {
27217 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteGroupMember_ndr_print");
27218 0 : return NULL;
27219 : }
27220 0 : call = &ndr_table_samr.calls[24];
27221 :
27222 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27223 0 : ret = PyUnicode_FromString(retstr);
27224 0 : TALLOC_FREE(retstr);
27225 :
27226 0 : return ret;
27227 : }
27228 :
27229 0 : static PyObject *py_samr_DeleteGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27230 : {
27231 0 : return py_samr_DeleteGroupMember_ndr_print(py_obj, "samr_DeleteGroupMember_in", NDR_IN);
27232 : }
27233 :
27234 0 : static PyObject *py_samr_DeleteGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27235 : {
27236 0 : return py_samr_DeleteGroupMember_ndr_print(py_obj, "samr_DeleteGroupMember_out", NDR_OUT);
27237 : }
27238 :
27239 : static PyMethodDef py_samr_DeleteGroupMember_methods[] = {
27240 : { "opnum", (PyCFunction)py_samr_DeleteGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS,
27241 : "samr.DeleteGroupMember.opnum() -> 24 (0x18) " },
27242 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteGroupMember_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27243 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27244 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteGroupMember_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27245 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27246 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteGroupMember_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27247 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27248 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteGroupMember_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27249 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27250 : { "__ndr_print_in__", (PyCFunction)py_samr_DeleteGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27251 : { "__ndr_print_out__", (PyCFunction)py_samr_DeleteGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27252 : { NULL, NULL, 0, NULL }
27253 : };
27254 :
27255 :
27256 : static PyTypeObject samr_DeleteGroupMember_Type = {
27257 : PyVarObject_HEAD_INIT(NULL, 0)
27258 : .tp_name = "samr.DeleteGroupMember",
27259 : .tp_getset = py_samr_DeleteGroupMember_getsetters,
27260 : .tp_methods = py_samr_DeleteGroupMember_methods,
27261 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27262 : .tp_new = py_samr_DeleteGroupMember_new,
27263 : };
27264 :
27265 0 : static bool pack_py_samr_DeleteGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteGroupMember *r)
27266 : {
27267 0 : PyObject *py_group_handle;
27268 0 : PyObject *py_rid;
27269 0 : const char *kwnames[] = {
27270 : "group_handle", "rid", NULL
27271 : };
27272 :
27273 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid)) {
27274 0 : return false;
27275 : }
27276 :
27277 0 : if (py_group_handle == NULL) {
27278 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
27279 0 : return false;
27280 : }
27281 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
27282 0 : if (r->in.group_handle == NULL) {
27283 0 : PyErr_NoMemory();
27284 0 : return false;
27285 : }
27286 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
27287 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
27288 0 : PyErr_NoMemory();
27289 0 : return false;
27290 : }
27291 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
27292 0 : if (py_rid == NULL) {
27293 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
27294 0 : return false;
27295 : }
27296 : {
27297 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
27298 0 : if (PyLong_Check(py_rid)) {
27299 0 : unsigned long long test_var;
27300 0 : test_var = PyLong_AsUnsignedLongLong(py_rid);
27301 0 : if (PyErr_Occurred() != NULL) {
27302 0 : return false;
27303 : }
27304 0 : if (test_var > uint_max) {
27305 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27306 : PyLong_Type.tp_name, uint_max, test_var);
27307 0 : return false;
27308 : }
27309 0 : r->in.rid = test_var;
27310 : } else {
27311 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27312 : PyLong_Type.tp_name);
27313 0 : return false;
27314 : }
27315 : }
27316 0 : return true;
27317 : }
27318 :
27319 0 : static PyObject *unpack_py_samr_DeleteGroupMember_args_out(struct samr_DeleteGroupMember *r)
27320 : {
27321 0 : PyObject *result;
27322 0 : result = Py_None;
27323 0 : Py_INCREF(result);
27324 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
27325 0 : PyErr_SetNTSTATUS(r->out.result);
27326 0 : return NULL;
27327 : }
27328 :
27329 0 : return result;
27330 : }
27331 :
27332 :
27333 0 : static PyObject *py_samr_QueryGroupMember_in_get_group_handle(PyObject *obj, void *closure)
27334 : {
27335 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj);
27336 0 : PyObject *py_group_handle;
27337 0 : if (object->in.group_handle == NULL) {
27338 0 : Py_RETURN_NONE;
27339 : }
27340 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
27341 0 : return py_group_handle;
27342 : }
27343 :
27344 0 : static int py_samr_QueryGroupMember_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
27345 : {
27346 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27347 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
27348 0 : if (value == NULL) {
27349 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
27350 0 : return -1;
27351 : }
27352 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
27353 0 : if (object->in.group_handle == NULL) {
27354 0 : PyErr_NoMemory();
27355 0 : return -1;
27356 : }
27357 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27358 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27359 0 : PyErr_NoMemory();
27360 0 : return -1;
27361 : }
27362 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
27363 0 : return 0;
27364 : }
27365 :
27366 0 : static PyObject *py_samr_QueryGroupMember_out_get_rids(PyObject *obj, void *closure)
27367 : {
27368 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj);
27369 0 : PyObject *py_rids;
27370 0 : if (object->out.rids == NULL) {
27371 0 : Py_RETURN_NONE;
27372 : }
27373 0 : if (*object->out.rids == NULL) {
27374 0 : py_rids = Py_None;
27375 0 : Py_INCREF(py_rids);
27376 : } else {
27377 0 : py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *object->out.rids, *object->out.rids);
27378 : }
27379 0 : return py_rids;
27380 : }
27381 :
27382 0 : static int py_samr_QueryGroupMember_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
27383 : {
27384 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27385 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
27386 0 : if (value == NULL) {
27387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
27388 0 : return -1;
27389 : }
27390 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
27391 0 : if (object->out.rids == NULL) {
27392 0 : PyErr_NoMemory();
27393 0 : return -1;
27394 : }
27395 0 : if (value == Py_None) {
27396 0 : *object->out.rids = NULL;
27397 : } else {
27398 0 : *object->out.rids = NULL;
27399 0 : PY_CHECK_TYPE(&samr_RidAttrArray_Type, value, return -1;);
27400 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27401 0 : PyErr_NoMemory();
27402 0 : return -1;
27403 : }
27404 0 : *object->out.rids = (struct samr_RidAttrArray *)pytalloc_get_ptr(value);
27405 : }
27406 0 : return 0;
27407 : }
27408 :
27409 0 : static PyObject *py_samr_QueryGroupMember_get_result(PyObject *obj, void *closure)
27410 : {
27411 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(obj);
27412 0 : PyObject *py_result;
27413 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27414 0 : return py_result;
27415 : }
27416 :
27417 0 : static int py_samr_QueryGroupMember_set_result(PyObject *py_obj, PyObject *value, void *closure)
27418 : {
27419 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27420 0 : if (value == NULL) {
27421 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27422 0 : return -1;
27423 : }
27424 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27425 0 : return 0;
27426 : }
27427 :
27428 : static PyGetSetDef py_samr_QueryGroupMember_getsetters[] = {
27429 : {
27430 : .name = discard_const_p(char, "in_group_handle"),
27431 : .get = py_samr_QueryGroupMember_in_get_group_handle,
27432 : .set = py_samr_QueryGroupMember_in_set_group_handle,
27433 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27434 : },
27435 : {
27436 : .name = discard_const_p(char, "out_rids"),
27437 : .get = py_samr_QueryGroupMember_out_get_rids,
27438 : .set = py_samr_QueryGroupMember_out_set_rids,
27439 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidAttrArray")
27440 : },
27441 : {
27442 : .name = discard_const_p(char, "result"),
27443 : .get = py_samr_QueryGroupMember_get_result,
27444 : .set = py_samr_QueryGroupMember_set_result,
27445 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27446 : },
27447 : { .name = NULL }
27448 : };
27449 :
27450 0 : static PyObject *py_samr_QueryGroupMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27451 : {
27452 0 : PyObject *self = pytalloc_new(struct samr_QueryGroupMember, type);
27453 0 : struct samr_QueryGroupMember *_self = (struct samr_QueryGroupMember *)pytalloc_get_ptr(self);
27454 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27455 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
27456 : /* a pointer to a NULL pointer */
27457 0 : _self->out.rids = talloc_zero(mem_ctx, struct samr_RidAttrArray *);
27458 0 : return self;
27459 : }
27460 :
27461 0 : static PyObject *py_samr_QueryGroupMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27462 : {
27463 :
27464 :
27465 0 : return PyLong_FromLong(25);
27466 : }
27467 :
27468 0 : static PyObject *py_samr_QueryGroupMember_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27469 : {
27470 0 : const struct ndr_interface_call *call = NULL;
27471 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27472 0 : PyObject *ret = NULL;
27473 0 : struct ndr_push *push = NULL;
27474 0 : DATA_BLOB blob;
27475 0 : enum ndr_err_code err;
27476 :
27477 0 : if (ndr_table_samr.num_calls < 26) {
27478 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_pack");
27479 0 : return NULL;
27480 : }
27481 0 : call = &ndr_table_samr.calls[25];
27482 :
27483 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27484 0 : if (push == NULL) {
27485 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27486 0 : return NULL;
27487 : }
27488 :
27489 0 : push->flags |= ndr_push_flags;
27490 :
27491 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27492 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27493 0 : TALLOC_FREE(push);
27494 0 : PyErr_SetNdrError(err);
27495 0 : return NULL;
27496 : }
27497 0 : blob = ndr_push_blob(push);
27498 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27499 0 : TALLOC_FREE(push);
27500 0 : return ret;
27501 : }
27502 :
27503 0 : static PyObject *py_samr_QueryGroupMember_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27504 : {
27505 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27506 0 : PyObject *bigendian_obj = NULL;
27507 0 : PyObject *ndr64_obj = NULL;
27508 0 : libndr_flags ndr_push_flags = 0;
27509 :
27510 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27511 : discard_const_p(char *, kwnames),
27512 : &bigendian_obj,
27513 : &ndr64_obj)) {
27514 0 : return NULL;
27515 : }
27516 :
27517 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27518 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27519 : }
27520 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27521 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27522 : }
27523 :
27524 0 : return py_samr_QueryGroupMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
27525 : }
27526 :
27527 0 : static PyObject *py_samr_QueryGroupMember_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27528 : {
27529 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27530 0 : PyObject *bigendian_obj = NULL;
27531 0 : PyObject *ndr64_obj = NULL;
27532 0 : libndr_flags ndr_push_flags = 0;
27533 :
27534 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
27535 : discard_const_p(char *, kwnames),
27536 : &bigendian_obj,
27537 : &ndr64_obj)) {
27538 0 : return NULL;
27539 : }
27540 :
27541 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27542 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27543 : }
27544 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27545 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
27546 : }
27547 :
27548 0 : return py_samr_QueryGroupMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
27549 : }
27550 :
27551 0 : static PyObject *py_samr_QueryGroupMember_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
27552 : {
27553 0 : const struct ndr_interface_call *call = NULL;
27554 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27555 0 : struct ndr_pull *pull = NULL;
27556 0 : enum ndr_err_code err;
27557 :
27558 0 : if (ndr_table_samr.num_calls < 26) {
27559 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_unpack");
27560 0 : return NULL;
27561 : }
27562 0 : call = &ndr_table_samr.calls[25];
27563 :
27564 0 : pull = ndr_pull_init_blob(blob, object);
27565 0 : if (pull == NULL) {
27566 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27567 0 : return NULL;
27568 : }
27569 :
27570 0 : pull->flags |= ndr_pull_flags;
27571 :
27572 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
27573 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27574 0 : TALLOC_FREE(pull);
27575 0 : PyErr_SetNdrError(err);
27576 0 : return NULL;
27577 : }
27578 0 : if (!allow_remaining) {
27579 0 : uint32_t highest_ofs;
27580 :
27581 0 : if (pull->offset > pull->relative_highest_offset) {
27582 0 : highest_ofs = pull->offset;
27583 : } else {
27584 0 : highest_ofs = pull->relative_highest_offset;
27585 : }
27586 0 : if (highest_ofs < pull->data_size) {
27587 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
27588 : "not all bytes consumed ofs[%u] size[%u]",
27589 : highest_ofs, pull->data_size);
27590 0 : TALLOC_FREE(pull);
27591 0 : PyErr_SetNdrError(err);
27592 0 : return NULL;
27593 : }
27594 : }
27595 :
27596 0 : TALLOC_FREE(pull);
27597 0 : Py_RETURN_NONE;
27598 : }
27599 :
27600 0 : static PyObject *py_samr_QueryGroupMember_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27601 : {
27602 0 : DATA_BLOB blob;
27603 0 : Py_ssize_t blob_length = 0;
27604 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27605 0 : PyObject *bigendian_obj = NULL;
27606 0 : PyObject *ndr64_obj = NULL;
27607 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27608 0 : PyObject *allow_remaining_obj = NULL;
27609 0 : bool allow_remaining = false;
27610 :
27611 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
27612 : discard_const_p(char *, kwnames),
27613 : &blob.data, &blob_length,
27614 : &bigendian_obj,
27615 : &ndr64_obj,
27616 : &allow_remaining_obj)) {
27617 0 : return NULL;
27618 : }
27619 0 : blob.length = blob_length;
27620 :
27621 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27622 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27623 : }
27624 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27625 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27626 : }
27627 :
27628 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27629 0 : allow_remaining = true;
27630 : }
27631 :
27632 0 : return py_samr_QueryGroupMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
27633 : }
27634 :
27635 0 : static PyObject *py_samr_QueryGroupMember_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27636 : {
27637 0 : DATA_BLOB blob;
27638 0 : Py_ssize_t blob_length = 0;
27639 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
27640 0 : PyObject *bigendian_obj = NULL;
27641 0 : PyObject *ndr64_obj = NULL;
27642 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
27643 0 : PyObject *allow_remaining_obj = NULL;
27644 0 : bool allow_remaining = false;
27645 :
27646 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
27647 : discard_const_p(char *, kwnames),
27648 : &blob.data, &blob_length,
27649 : &bigendian_obj,
27650 : &ndr64_obj,
27651 : &allow_remaining_obj)) {
27652 0 : return NULL;
27653 : }
27654 0 : blob.length = blob_length;
27655 :
27656 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27657 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
27658 : }
27659 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
27660 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
27661 : }
27662 :
27663 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
27664 0 : allow_remaining = true;
27665 : }
27666 :
27667 0 : return py_samr_QueryGroupMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
27668 : }
27669 :
27670 0 : static PyObject *py_samr_QueryGroupMember_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
27671 : {
27672 0 : const struct ndr_interface_call *call = NULL;
27673 0 : struct samr_QueryGroupMember *object = (struct samr_QueryGroupMember *)pytalloc_get_ptr(py_obj);
27674 0 : PyObject *ret;
27675 0 : char *retstr;
27676 :
27677 0 : if (ndr_table_samr.num_calls < 26) {
27678 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryGroupMember_ndr_print");
27679 0 : return NULL;
27680 : }
27681 0 : call = &ndr_table_samr.calls[25];
27682 :
27683 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
27684 0 : ret = PyUnicode_FromString(retstr);
27685 0 : TALLOC_FREE(retstr);
27686 :
27687 0 : return ret;
27688 : }
27689 :
27690 0 : static PyObject *py_samr_QueryGroupMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27691 : {
27692 0 : return py_samr_QueryGroupMember_ndr_print(py_obj, "samr_QueryGroupMember_in", NDR_IN);
27693 : }
27694 :
27695 0 : static PyObject *py_samr_QueryGroupMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
27696 : {
27697 0 : return py_samr_QueryGroupMember_ndr_print(py_obj, "samr_QueryGroupMember_out", NDR_OUT);
27698 : }
27699 :
27700 : static PyMethodDef py_samr_QueryGroupMember_methods[] = {
27701 : { "opnum", (PyCFunction)py_samr_QueryGroupMember_ndr_opnum, METH_NOARGS|METH_CLASS,
27702 : "samr.QueryGroupMember.opnum() -> 25 (0x19) " },
27703 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupMember_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
27704 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
27705 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupMember_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
27706 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
27707 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupMember_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
27708 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
27709 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryGroupMember_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
27710 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
27711 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryGroupMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
27712 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryGroupMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
27713 : { NULL, NULL, 0, NULL }
27714 : };
27715 :
27716 :
27717 : static PyTypeObject samr_QueryGroupMember_Type = {
27718 : PyVarObject_HEAD_INIT(NULL, 0)
27719 : .tp_name = "samr.QueryGroupMember",
27720 : .tp_getset = py_samr_QueryGroupMember_getsetters,
27721 : .tp_methods = py_samr_QueryGroupMember_methods,
27722 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
27723 : .tp_new = py_samr_QueryGroupMember_new,
27724 : };
27725 :
27726 1 : static bool pack_py_samr_QueryGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupMember *r)
27727 : {
27728 0 : PyObject *py_group_handle;
27729 1 : const char *kwnames[] = {
27730 : "group_handle", NULL
27731 : };
27732 :
27733 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_QueryGroupMember", discard_const_p(char *, kwnames), &py_group_handle)) {
27734 0 : return false;
27735 : }
27736 :
27737 1 : if (py_group_handle == NULL) {
27738 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
27739 0 : return false;
27740 : }
27741 1 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
27742 1 : if (r->in.group_handle == NULL) {
27743 0 : PyErr_NoMemory();
27744 0 : return false;
27745 : }
27746 1 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
27747 1 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
27748 0 : PyErr_NoMemory();
27749 0 : return false;
27750 : }
27751 1 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
27752 1 : return true;
27753 : }
27754 :
27755 1 : static PyObject *unpack_py_samr_QueryGroupMember_args_out(struct samr_QueryGroupMember *r)
27756 : {
27757 0 : PyObject *result;
27758 0 : PyObject *py_rids;
27759 1 : if (*r->out.rids == NULL) {
27760 0 : py_rids = Py_None;
27761 0 : Py_INCREF(py_rids);
27762 : } else {
27763 1 : py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *r->out.rids, *r->out.rids);
27764 : }
27765 1 : result = py_rids;
27766 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
27767 0 : PyErr_SetNTSTATUS(r->out.result);
27768 0 : return NULL;
27769 : }
27770 :
27771 1 : return result;
27772 : }
27773 :
27774 :
27775 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_group_handle(PyObject *obj, void *closure)
27776 : {
27777 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj);
27778 0 : PyObject *py_group_handle;
27779 0 : if (object->in.group_handle == NULL) {
27780 0 : Py_RETURN_NONE;
27781 : }
27782 0 : py_group_handle = pytalloc_reference_ex(policy_handle_Type, object->in.group_handle, object->in.group_handle);
27783 0 : return py_group_handle;
27784 : }
27785 :
27786 0 : static int py_samr_SetMemberAttributesOfGroup_in_set_group_handle(PyObject *py_obj, PyObject *value, void *closure)
27787 : {
27788 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
27789 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.group_handle));
27790 0 : if (value == NULL) {
27791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.group_handle");
27792 0 : return -1;
27793 : }
27794 0 : object->in.group_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.group_handle);
27795 0 : if (object->in.group_handle == NULL) {
27796 0 : PyErr_NoMemory();
27797 0 : return -1;
27798 : }
27799 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
27800 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
27801 0 : PyErr_NoMemory();
27802 0 : return -1;
27803 : }
27804 0 : object->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(value);
27805 0 : return 0;
27806 : }
27807 :
27808 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_unknown1(PyObject *obj, void *closure)
27809 : {
27810 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj);
27811 0 : PyObject *py_unknown1;
27812 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown1);
27813 0 : return py_unknown1;
27814 : }
27815 :
27816 0 : static int py_samr_SetMemberAttributesOfGroup_in_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
27817 : {
27818 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
27819 0 : if (value == NULL) {
27820 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown1");
27821 0 : return -1;
27822 : }
27823 : {
27824 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown1));
27825 0 : if (PyLong_Check(value)) {
27826 0 : unsigned long long test_var;
27827 0 : test_var = PyLong_AsUnsignedLongLong(value);
27828 0 : if (PyErr_Occurred() != NULL) {
27829 0 : return -1;
27830 : }
27831 0 : if (test_var > uint_max) {
27832 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27833 : PyLong_Type.tp_name, uint_max, test_var);
27834 0 : return -1;
27835 : }
27836 0 : object->in.unknown1 = test_var;
27837 : } else {
27838 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27839 : PyLong_Type.tp_name);
27840 0 : return -1;
27841 : }
27842 : }
27843 0 : return 0;
27844 : }
27845 :
27846 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_in_get_unknown2(PyObject *obj, void *closure)
27847 : {
27848 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj);
27849 0 : PyObject *py_unknown2;
27850 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown2);
27851 0 : return py_unknown2;
27852 : }
27853 :
27854 0 : static int py_samr_SetMemberAttributesOfGroup_in_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
27855 : {
27856 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
27857 0 : if (value == NULL) {
27858 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown2");
27859 0 : return -1;
27860 : }
27861 : {
27862 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown2));
27863 0 : if (PyLong_Check(value)) {
27864 0 : unsigned long long test_var;
27865 0 : test_var = PyLong_AsUnsignedLongLong(value);
27866 0 : if (PyErr_Occurred() != NULL) {
27867 0 : return -1;
27868 : }
27869 0 : if (test_var > uint_max) {
27870 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
27871 : PyLong_Type.tp_name, uint_max, test_var);
27872 0 : return -1;
27873 : }
27874 0 : object->in.unknown2 = test_var;
27875 : } else {
27876 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
27877 : PyLong_Type.tp_name);
27878 0 : return -1;
27879 : }
27880 : }
27881 0 : return 0;
27882 : }
27883 :
27884 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_get_result(PyObject *obj, void *closure)
27885 : {
27886 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(obj);
27887 0 : PyObject *py_result;
27888 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
27889 0 : return py_result;
27890 : }
27891 :
27892 0 : static int py_samr_SetMemberAttributesOfGroup_set_result(PyObject *py_obj, PyObject *value, void *closure)
27893 : {
27894 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
27895 0 : if (value == NULL) {
27896 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
27897 0 : return -1;
27898 : }
27899 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
27900 0 : return 0;
27901 : }
27902 :
27903 : static PyGetSetDef py_samr_SetMemberAttributesOfGroup_getsetters[] = {
27904 : {
27905 : .name = discard_const_p(char, "in_group_handle"),
27906 : .get = py_samr_SetMemberAttributesOfGroup_in_get_group_handle,
27907 : .set = py_samr_SetMemberAttributesOfGroup_in_set_group_handle,
27908 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
27909 : },
27910 : {
27911 : .name = discard_const_p(char, "in_unknown1"),
27912 : .get = py_samr_SetMemberAttributesOfGroup_in_get_unknown1,
27913 : .set = py_samr_SetMemberAttributesOfGroup_in_set_unknown1,
27914 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27915 : },
27916 : {
27917 : .name = discard_const_p(char, "in_unknown2"),
27918 : .get = py_samr_SetMemberAttributesOfGroup_in_get_unknown2,
27919 : .set = py_samr_SetMemberAttributesOfGroup_in_set_unknown2,
27920 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
27921 : },
27922 : {
27923 : .name = discard_const_p(char, "result"),
27924 : .get = py_samr_SetMemberAttributesOfGroup_get_result,
27925 : .set = py_samr_SetMemberAttributesOfGroup_set_result,
27926 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
27927 : },
27928 : { .name = NULL }
27929 : };
27930 :
27931 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
27932 : {
27933 0 : PyObject *self = pytalloc_new(struct samr_SetMemberAttributesOfGroup, type);
27934 0 : struct samr_SetMemberAttributesOfGroup *_self = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(self);
27935 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
27936 0 : _self->in.group_handle = talloc_zero(mem_ctx, struct policy_handle);
27937 0 : return self;
27938 : }
27939 :
27940 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
27941 : {
27942 :
27943 :
27944 0 : return PyLong_FromLong(26);
27945 : }
27946 :
27947 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
27948 : {
27949 0 : const struct ndr_interface_call *call = NULL;
27950 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
27951 0 : PyObject *ret = NULL;
27952 0 : struct ndr_push *push = NULL;
27953 0 : DATA_BLOB blob;
27954 0 : enum ndr_err_code err;
27955 :
27956 0 : if (ndr_table_samr.num_calls < 27) {
27957 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_pack");
27958 0 : return NULL;
27959 : }
27960 0 : call = &ndr_table_samr.calls[26];
27961 :
27962 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
27963 0 : if (push == NULL) {
27964 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
27965 0 : return NULL;
27966 : }
27967 :
27968 0 : push->flags |= ndr_push_flags;
27969 :
27970 0 : err = call->ndr_push(push, ndr_inout_flags, object);
27971 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
27972 0 : TALLOC_FREE(push);
27973 0 : PyErr_SetNdrError(err);
27974 0 : return NULL;
27975 : }
27976 0 : blob = ndr_push_blob(push);
27977 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
27978 0 : TALLOC_FREE(push);
27979 0 : return ret;
27980 : }
27981 :
27982 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
27983 : {
27984 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
27985 0 : PyObject *bigendian_obj = NULL;
27986 0 : PyObject *ndr64_obj = NULL;
27987 0 : libndr_flags ndr_push_flags = 0;
27988 :
27989 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
27990 : discard_const_p(char *, kwnames),
27991 : &bigendian_obj,
27992 : &ndr64_obj)) {
27993 0 : return NULL;
27994 : }
27995 :
27996 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
27997 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
27998 : }
27999 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28000 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28001 : }
28002 :
28003 0 : return py_samr_SetMemberAttributesOfGroup_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28004 : }
28005 :
28006 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28007 : {
28008 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28009 0 : PyObject *bigendian_obj = NULL;
28010 0 : PyObject *ndr64_obj = NULL;
28011 0 : libndr_flags ndr_push_flags = 0;
28012 :
28013 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28014 : discard_const_p(char *, kwnames),
28015 : &bigendian_obj,
28016 : &ndr64_obj)) {
28017 0 : return NULL;
28018 : }
28019 :
28020 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28021 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28022 : }
28023 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28024 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28025 : }
28026 :
28027 0 : return py_samr_SetMemberAttributesOfGroup_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28028 : }
28029 :
28030 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
28031 : {
28032 0 : const struct ndr_interface_call *call = NULL;
28033 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
28034 0 : struct ndr_pull *pull = NULL;
28035 0 : enum ndr_err_code err;
28036 :
28037 0 : if (ndr_table_samr.num_calls < 27) {
28038 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_unpack");
28039 0 : return NULL;
28040 : }
28041 0 : call = &ndr_table_samr.calls[26];
28042 :
28043 0 : pull = ndr_pull_init_blob(blob, object);
28044 0 : if (pull == NULL) {
28045 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28046 0 : return NULL;
28047 : }
28048 :
28049 0 : pull->flags |= ndr_pull_flags;
28050 :
28051 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28052 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28053 0 : TALLOC_FREE(pull);
28054 0 : PyErr_SetNdrError(err);
28055 0 : return NULL;
28056 : }
28057 0 : if (!allow_remaining) {
28058 0 : uint32_t highest_ofs;
28059 :
28060 0 : if (pull->offset > pull->relative_highest_offset) {
28061 0 : highest_ofs = pull->offset;
28062 : } else {
28063 0 : highest_ofs = pull->relative_highest_offset;
28064 : }
28065 0 : if (highest_ofs < pull->data_size) {
28066 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28067 : "not all bytes consumed ofs[%u] size[%u]",
28068 : highest_ofs, pull->data_size);
28069 0 : TALLOC_FREE(pull);
28070 0 : PyErr_SetNdrError(err);
28071 0 : return NULL;
28072 : }
28073 : }
28074 :
28075 0 : TALLOC_FREE(pull);
28076 0 : Py_RETURN_NONE;
28077 : }
28078 :
28079 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28080 : {
28081 0 : DATA_BLOB blob;
28082 0 : Py_ssize_t blob_length = 0;
28083 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28084 0 : PyObject *bigendian_obj = NULL;
28085 0 : PyObject *ndr64_obj = NULL;
28086 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28087 0 : PyObject *allow_remaining_obj = NULL;
28088 0 : bool allow_remaining = false;
28089 :
28090 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28091 : discard_const_p(char *, kwnames),
28092 : &blob.data, &blob_length,
28093 : &bigendian_obj,
28094 : &ndr64_obj,
28095 : &allow_remaining_obj)) {
28096 0 : return NULL;
28097 : }
28098 0 : blob.length = blob_length;
28099 :
28100 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28101 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28102 : }
28103 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28104 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28105 : }
28106 :
28107 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28108 0 : allow_remaining = true;
28109 : }
28110 :
28111 0 : return py_samr_SetMemberAttributesOfGroup_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28112 : }
28113 :
28114 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28115 : {
28116 0 : DATA_BLOB blob;
28117 0 : Py_ssize_t blob_length = 0;
28118 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28119 0 : PyObject *bigendian_obj = NULL;
28120 0 : PyObject *ndr64_obj = NULL;
28121 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28122 0 : PyObject *allow_remaining_obj = NULL;
28123 0 : bool allow_remaining = false;
28124 :
28125 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28126 : discard_const_p(char *, kwnames),
28127 : &blob.data, &blob_length,
28128 : &bigendian_obj,
28129 : &ndr64_obj,
28130 : &allow_remaining_obj)) {
28131 0 : return NULL;
28132 : }
28133 0 : blob.length = blob_length;
28134 :
28135 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28136 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28137 : }
28138 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28139 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28140 : }
28141 :
28142 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28143 0 : allow_remaining = true;
28144 : }
28145 :
28146 0 : return py_samr_SetMemberAttributesOfGroup_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28147 : }
28148 :
28149 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28150 : {
28151 0 : const struct ndr_interface_call *call = NULL;
28152 0 : struct samr_SetMemberAttributesOfGroup *object = (struct samr_SetMemberAttributesOfGroup *)pytalloc_get_ptr(py_obj);
28153 0 : PyObject *ret;
28154 0 : char *retstr;
28155 :
28156 0 : if (ndr_table_samr.num_calls < 27) {
28157 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetMemberAttributesOfGroup_ndr_print");
28158 0 : return NULL;
28159 : }
28160 0 : call = &ndr_table_samr.calls[26];
28161 :
28162 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28163 0 : ret = PyUnicode_FromString(retstr);
28164 0 : TALLOC_FREE(retstr);
28165 :
28166 0 : return ret;
28167 : }
28168 :
28169 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28170 : {
28171 0 : return py_samr_SetMemberAttributesOfGroup_ndr_print(py_obj, "samr_SetMemberAttributesOfGroup_in", NDR_IN);
28172 : }
28173 :
28174 0 : static PyObject *py_samr_SetMemberAttributesOfGroup_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28175 : {
28176 0 : return py_samr_SetMemberAttributesOfGroup_ndr_print(py_obj, "samr_SetMemberAttributesOfGroup_out", NDR_OUT);
28177 : }
28178 :
28179 : static PyMethodDef py_samr_SetMemberAttributesOfGroup_methods[] = {
28180 : { "opnum", (PyCFunction)py_samr_SetMemberAttributesOfGroup_ndr_opnum, METH_NOARGS|METH_CLASS,
28181 : "samr.SetMemberAttributesOfGroup.opnum() -> 26 (0x1a) " },
28182 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetMemberAttributesOfGroup_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28183 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28184 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetMemberAttributesOfGroup_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28185 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28186 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetMemberAttributesOfGroup_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28187 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28188 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetMemberAttributesOfGroup_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28189 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28190 : { "__ndr_print_in__", (PyCFunction)py_samr_SetMemberAttributesOfGroup_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28191 : { "__ndr_print_out__", (PyCFunction)py_samr_SetMemberAttributesOfGroup_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28192 : { NULL, NULL, 0, NULL }
28193 : };
28194 :
28195 :
28196 : static PyTypeObject samr_SetMemberAttributesOfGroup_Type = {
28197 : PyVarObject_HEAD_INIT(NULL, 0)
28198 : .tp_name = "samr.SetMemberAttributesOfGroup",
28199 : .tp_getset = py_samr_SetMemberAttributesOfGroup_getsetters,
28200 : .tp_methods = py_samr_SetMemberAttributesOfGroup_methods,
28201 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28202 : .tp_new = py_samr_SetMemberAttributesOfGroup_new,
28203 : };
28204 :
28205 0 : static bool pack_py_samr_SetMemberAttributesOfGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_SetMemberAttributesOfGroup *r)
28206 : {
28207 0 : PyObject *py_group_handle;
28208 0 : PyObject *py_unknown1;
28209 0 : PyObject *py_unknown2;
28210 0 : const char *kwnames[] = {
28211 : "group_handle", "unknown1", "unknown2", NULL
28212 : };
28213 :
28214 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetMemberAttributesOfGroup", discard_const_p(char *, kwnames), &py_group_handle, &py_unknown1, &py_unknown2)) {
28215 0 : return false;
28216 : }
28217 :
28218 0 : if (py_group_handle == NULL) {
28219 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.group_handle");
28220 0 : return false;
28221 : }
28222 0 : r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
28223 0 : if (r->in.group_handle == NULL) {
28224 0 : PyErr_NoMemory();
28225 0 : return false;
28226 : }
28227 0 : PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
28228 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
28229 0 : PyErr_NoMemory();
28230 0 : return false;
28231 : }
28232 0 : r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
28233 0 : if (py_unknown1 == NULL) {
28234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown1");
28235 0 : return false;
28236 : }
28237 : {
28238 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown1));
28239 0 : if (PyLong_Check(py_unknown1)) {
28240 0 : unsigned long long test_var;
28241 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown1);
28242 0 : if (PyErr_Occurred() != NULL) {
28243 0 : return false;
28244 : }
28245 0 : if (test_var > uint_max) {
28246 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28247 : PyLong_Type.tp_name, uint_max, test_var);
28248 0 : return false;
28249 : }
28250 0 : r->in.unknown1 = test_var;
28251 : } else {
28252 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28253 : PyLong_Type.tp_name);
28254 0 : return false;
28255 : }
28256 : }
28257 0 : if (py_unknown2 == NULL) {
28258 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown2");
28259 0 : return false;
28260 : }
28261 : {
28262 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown2));
28263 0 : if (PyLong_Check(py_unknown2)) {
28264 0 : unsigned long long test_var;
28265 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown2);
28266 0 : if (PyErr_Occurred() != NULL) {
28267 0 : return false;
28268 : }
28269 0 : if (test_var > uint_max) {
28270 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28271 : PyLong_Type.tp_name, uint_max, test_var);
28272 0 : return false;
28273 : }
28274 0 : r->in.unknown2 = test_var;
28275 : } else {
28276 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28277 : PyLong_Type.tp_name);
28278 0 : return false;
28279 : }
28280 : }
28281 0 : return true;
28282 : }
28283 :
28284 0 : static PyObject *unpack_py_samr_SetMemberAttributesOfGroup_args_out(struct samr_SetMemberAttributesOfGroup *r)
28285 : {
28286 0 : PyObject *result;
28287 0 : result = Py_None;
28288 0 : Py_INCREF(result);
28289 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28290 0 : PyErr_SetNTSTATUS(r->out.result);
28291 0 : return NULL;
28292 : }
28293 :
28294 0 : return result;
28295 : }
28296 :
28297 :
28298 0 : static PyObject *py_samr_OpenAlias_in_get_domain_handle(PyObject *obj, void *closure)
28299 : {
28300 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj);
28301 0 : PyObject *py_domain_handle;
28302 0 : if (object->in.domain_handle == NULL) {
28303 0 : Py_RETURN_NONE;
28304 : }
28305 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
28306 0 : return py_domain_handle;
28307 : }
28308 :
28309 0 : static int py_samr_OpenAlias_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
28310 : {
28311 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28312 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
28313 0 : if (value == NULL) {
28314 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
28315 0 : return -1;
28316 : }
28317 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
28318 0 : if (object->in.domain_handle == NULL) {
28319 0 : PyErr_NoMemory();
28320 0 : return -1;
28321 : }
28322 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28323 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28324 0 : PyErr_NoMemory();
28325 0 : return -1;
28326 : }
28327 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
28328 0 : return 0;
28329 : }
28330 :
28331 0 : static PyObject *py_samr_OpenAlias_in_get_access_mask(PyObject *obj, void *closure)
28332 : {
28333 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj);
28334 0 : PyObject *py_access_mask;
28335 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
28336 0 : return py_access_mask;
28337 : }
28338 :
28339 0 : static int py_samr_OpenAlias_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
28340 : {
28341 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28342 0 : if (value == NULL) {
28343 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
28344 0 : return -1;
28345 : }
28346 : {
28347 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
28348 0 : if (PyLong_Check(value)) {
28349 0 : unsigned long long test_var;
28350 0 : test_var = PyLong_AsUnsignedLongLong(value);
28351 0 : if (PyErr_Occurred() != NULL) {
28352 0 : return -1;
28353 : }
28354 0 : if (test_var > uint_max) {
28355 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28356 : PyLong_Type.tp_name, uint_max, test_var);
28357 0 : return -1;
28358 : }
28359 0 : object->in.access_mask = test_var;
28360 : } else {
28361 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28362 : PyLong_Type.tp_name);
28363 0 : return -1;
28364 : }
28365 : }
28366 0 : return 0;
28367 : }
28368 :
28369 0 : static PyObject *py_samr_OpenAlias_in_get_rid(PyObject *obj, void *closure)
28370 : {
28371 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj);
28372 0 : PyObject *py_rid;
28373 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
28374 0 : return py_rid;
28375 : }
28376 :
28377 0 : static int py_samr_OpenAlias_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
28378 : {
28379 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28380 0 : if (value == NULL) {
28381 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
28382 0 : return -1;
28383 : }
28384 : {
28385 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
28386 0 : if (PyLong_Check(value)) {
28387 0 : unsigned long long test_var;
28388 0 : test_var = PyLong_AsUnsignedLongLong(value);
28389 0 : if (PyErr_Occurred() != NULL) {
28390 0 : return -1;
28391 : }
28392 0 : if (test_var > uint_max) {
28393 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28394 : PyLong_Type.tp_name, uint_max, test_var);
28395 0 : return -1;
28396 : }
28397 0 : object->in.rid = test_var;
28398 : } else {
28399 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28400 : PyLong_Type.tp_name);
28401 0 : return -1;
28402 : }
28403 : }
28404 0 : return 0;
28405 : }
28406 :
28407 0 : static PyObject *py_samr_OpenAlias_out_get_alias_handle(PyObject *obj, void *closure)
28408 : {
28409 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj);
28410 0 : PyObject *py_alias_handle;
28411 0 : if (object->out.alias_handle == NULL) {
28412 0 : Py_RETURN_NONE;
28413 : }
28414 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle);
28415 0 : return py_alias_handle;
28416 : }
28417 :
28418 0 : static int py_samr_OpenAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
28419 : {
28420 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28421 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle));
28422 0 : if (value == NULL) {
28423 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle");
28424 0 : return -1;
28425 : }
28426 0 : object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle);
28427 0 : if (object->out.alias_handle == NULL) {
28428 0 : PyErr_NoMemory();
28429 0 : return -1;
28430 : }
28431 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28432 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28433 0 : PyErr_NoMemory();
28434 0 : return -1;
28435 : }
28436 0 : object->out.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
28437 0 : return 0;
28438 : }
28439 :
28440 0 : static PyObject *py_samr_OpenAlias_get_result(PyObject *obj, void *closure)
28441 : {
28442 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(obj);
28443 0 : PyObject *py_result;
28444 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28445 0 : return py_result;
28446 : }
28447 :
28448 0 : static int py_samr_OpenAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
28449 : {
28450 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28451 0 : if (value == NULL) {
28452 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28453 0 : return -1;
28454 : }
28455 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28456 0 : return 0;
28457 : }
28458 :
28459 : static PyGetSetDef py_samr_OpenAlias_getsetters[] = {
28460 : {
28461 : .name = discard_const_p(char, "in_domain_handle"),
28462 : .get = py_samr_OpenAlias_in_get_domain_handle,
28463 : .set = py_samr_OpenAlias_in_set_domain_handle,
28464 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28465 : },
28466 : {
28467 : .name = discard_const_p(char, "in_access_mask"),
28468 : .get = py_samr_OpenAlias_in_get_access_mask,
28469 : .set = py_samr_OpenAlias_in_set_access_mask,
28470 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasAccessMask")
28471 : },
28472 : {
28473 : .name = discard_const_p(char, "in_rid"),
28474 : .get = py_samr_OpenAlias_in_get_rid,
28475 : .set = py_samr_OpenAlias_in_set_rid,
28476 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
28477 : },
28478 : {
28479 : .name = discard_const_p(char, "out_alias_handle"),
28480 : .get = py_samr_OpenAlias_out_get_alias_handle,
28481 : .set = py_samr_OpenAlias_out_set_alias_handle,
28482 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
28483 : },
28484 : {
28485 : .name = discard_const_p(char, "result"),
28486 : .get = py_samr_OpenAlias_get_result,
28487 : .set = py_samr_OpenAlias_set_result,
28488 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
28489 : },
28490 : { .name = NULL }
28491 : };
28492 :
28493 0 : static PyObject *py_samr_OpenAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
28494 : {
28495 0 : PyObject *self = pytalloc_new(struct samr_OpenAlias, type);
28496 0 : struct samr_OpenAlias *_self = (struct samr_OpenAlias *)pytalloc_get_ptr(self);
28497 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
28498 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
28499 0 : _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
28500 0 : return self;
28501 : }
28502 :
28503 0 : static PyObject *py_samr_OpenAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
28504 : {
28505 :
28506 :
28507 0 : return PyLong_FromLong(27);
28508 : }
28509 :
28510 0 : static PyObject *py_samr_OpenAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
28511 : {
28512 0 : const struct ndr_interface_call *call = NULL;
28513 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28514 0 : PyObject *ret = NULL;
28515 0 : struct ndr_push *push = NULL;
28516 0 : DATA_BLOB blob;
28517 0 : enum ndr_err_code err;
28518 :
28519 0 : if (ndr_table_samr.num_calls < 28) {
28520 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_pack");
28521 0 : return NULL;
28522 : }
28523 0 : call = &ndr_table_samr.calls[27];
28524 :
28525 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
28526 0 : if (push == NULL) {
28527 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28528 0 : return NULL;
28529 : }
28530 :
28531 0 : push->flags |= ndr_push_flags;
28532 :
28533 0 : err = call->ndr_push(push, ndr_inout_flags, object);
28534 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28535 0 : TALLOC_FREE(push);
28536 0 : PyErr_SetNdrError(err);
28537 0 : return NULL;
28538 : }
28539 0 : blob = ndr_push_blob(push);
28540 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
28541 0 : TALLOC_FREE(push);
28542 0 : return ret;
28543 : }
28544 :
28545 0 : static PyObject *py_samr_OpenAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28546 : {
28547 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28548 0 : PyObject *bigendian_obj = NULL;
28549 0 : PyObject *ndr64_obj = NULL;
28550 0 : libndr_flags ndr_push_flags = 0;
28551 :
28552 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
28553 : discard_const_p(char *, kwnames),
28554 : &bigendian_obj,
28555 : &ndr64_obj)) {
28556 0 : return NULL;
28557 : }
28558 :
28559 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28560 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28561 : }
28562 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28563 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28564 : }
28565 :
28566 0 : return py_samr_OpenAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
28567 : }
28568 :
28569 0 : static PyObject *py_samr_OpenAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28570 : {
28571 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
28572 0 : PyObject *bigendian_obj = NULL;
28573 0 : PyObject *ndr64_obj = NULL;
28574 0 : libndr_flags ndr_push_flags = 0;
28575 :
28576 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
28577 : discard_const_p(char *, kwnames),
28578 : &bigendian_obj,
28579 : &ndr64_obj)) {
28580 0 : return NULL;
28581 : }
28582 :
28583 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28584 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
28585 : }
28586 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28587 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
28588 : }
28589 :
28590 0 : return py_samr_OpenAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
28591 : }
28592 :
28593 0 : static PyObject *py_samr_OpenAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
28594 : {
28595 0 : const struct ndr_interface_call *call = NULL;
28596 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28597 0 : struct ndr_pull *pull = NULL;
28598 0 : enum ndr_err_code err;
28599 :
28600 0 : if (ndr_table_samr.num_calls < 28) {
28601 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_unpack");
28602 0 : return NULL;
28603 : }
28604 0 : call = &ndr_table_samr.calls[27];
28605 :
28606 0 : pull = ndr_pull_init_blob(blob, object);
28607 0 : if (pull == NULL) {
28608 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
28609 0 : return NULL;
28610 : }
28611 :
28612 0 : pull->flags |= ndr_pull_flags;
28613 :
28614 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
28615 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
28616 0 : TALLOC_FREE(pull);
28617 0 : PyErr_SetNdrError(err);
28618 0 : return NULL;
28619 : }
28620 0 : if (!allow_remaining) {
28621 0 : uint32_t highest_ofs;
28622 :
28623 0 : if (pull->offset > pull->relative_highest_offset) {
28624 0 : highest_ofs = pull->offset;
28625 : } else {
28626 0 : highest_ofs = pull->relative_highest_offset;
28627 : }
28628 0 : if (highest_ofs < pull->data_size) {
28629 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
28630 : "not all bytes consumed ofs[%u] size[%u]",
28631 : highest_ofs, pull->data_size);
28632 0 : TALLOC_FREE(pull);
28633 0 : PyErr_SetNdrError(err);
28634 0 : return NULL;
28635 : }
28636 : }
28637 :
28638 0 : TALLOC_FREE(pull);
28639 0 : Py_RETURN_NONE;
28640 : }
28641 :
28642 0 : static PyObject *py_samr_OpenAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28643 : {
28644 0 : DATA_BLOB blob;
28645 0 : Py_ssize_t blob_length = 0;
28646 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28647 0 : PyObject *bigendian_obj = NULL;
28648 0 : PyObject *ndr64_obj = NULL;
28649 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28650 0 : PyObject *allow_remaining_obj = NULL;
28651 0 : bool allow_remaining = false;
28652 :
28653 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
28654 : discard_const_p(char *, kwnames),
28655 : &blob.data, &blob_length,
28656 : &bigendian_obj,
28657 : &ndr64_obj,
28658 : &allow_remaining_obj)) {
28659 0 : return NULL;
28660 : }
28661 0 : blob.length = blob_length;
28662 :
28663 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28664 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28665 : }
28666 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28667 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28668 : }
28669 :
28670 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28671 0 : allow_remaining = true;
28672 : }
28673 :
28674 0 : return py_samr_OpenAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
28675 : }
28676 :
28677 0 : static PyObject *py_samr_OpenAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
28678 : {
28679 0 : DATA_BLOB blob;
28680 0 : Py_ssize_t blob_length = 0;
28681 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
28682 0 : PyObject *bigendian_obj = NULL;
28683 0 : PyObject *ndr64_obj = NULL;
28684 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
28685 0 : PyObject *allow_remaining_obj = NULL;
28686 0 : bool allow_remaining = false;
28687 :
28688 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
28689 : discard_const_p(char *, kwnames),
28690 : &blob.data, &blob_length,
28691 : &bigendian_obj,
28692 : &ndr64_obj,
28693 : &allow_remaining_obj)) {
28694 0 : return NULL;
28695 : }
28696 0 : blob.length = blob_length;
28697 :
28698 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
28699 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
28700 : }
28701 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
28702 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
28703 : }
28704 :
28705 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
28706 0 : allow_remaining = true;
28707 : }
28708 :
28709 0 : return py_samr_OpenAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
28710 : }
28711 :
28712 0 : static PyObject *py_samr_OpenAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
28713 : {
28714 0 : const struct ndr_interface_call *call = NULL;
28715 0 : struct samr_OpenAlias *object = (struct samr_OpenAlias *)pytalloc_get_ptr(py_obj);
28716 0 : PyObject *ret;
28717 0 : char *retstr;
28718 :
28719 0 : if (ndr_table_samr.num_calls < 28) {
28720 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenAlias_ndr_print");
28721 0 : return NULL;
28722 : }
28723 0 : call = &ndr_table_samr.calls[27];
28724 :
28725 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
28726 0 : ret = PyUnicode_FromString(retstr);
28727 0 : TALLOC_FREE(retstr);
28728 :
28729 0 : return ret;
28730 : }
28731 :
28732 0 : static PyObject *py_samr_OpenAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28733 : {
28734 0 : return py_samr_OpenAlias_ndr_print(py_obj, "samr_OpenAlias_in", NDR_IN);
28735 : }
28736 :
28737 0 : static PyObject *py_samr_OpenAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
28738 : {
28739 0 : return py_samr_OpenAlias_ndr_print(py_obj, "samr_OpenAlias_out", NDR_OUT);
28740 : }
28741 :
28742 : static PyMethodDef py_samr_OpenAlias_methods[] = {
28743 : { "opnum", (PyCFunction)py_samr_OpenAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
28744 : "samr.OpenAlias.opnum() -> 27 (0x1b) " },
28745 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
28746 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
28747 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
28748 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
28749 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
28750 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
28751 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
28752 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
28753 : { "__ndr_print_in__", (PyCFunction)py_samr_OpenAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
28754 : { "__ndr_print_out__", (PyCFunction)py_samr_OpenAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
28755 : { NULL, NULL, 0, NULL }
28756 : };
28757 :
28758 :
28759 : static PyTypeObject samr_OpenAlias_Type = {
28760 : PyVarObject_HEAD_INIT(NULL, 0)
28761 : .tp_name = "samr.OpenAlias",
28762 : .tp_getset = py_samr_OpenAlias_getsetters,
28763 : .tp_methods = py_samr_OpenAlias_methods,
28764 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
28765 : .tp_new = py_samr_OpenAlias_new,
28766 : };
28767 :
28768 0 : static bool pack_py_samr_OpenAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenAlias *r)
28769 : {
28770 0 : PyObject *py_domain_handle;
28771 0 : PyObject *py_access_mask;
28772 0 : PyObject *py_rid;
28773 0 : const char *kwnames[] = {
28774 : "domain_handle", "access_mask", "rid", NULL
28775 : };
28776 :
28777 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
28778 0 : return false;
28779 : }
28780 :
28781 0 : if (py_domain_handle == NULL) {
28782 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
28783 0 : return false;
28784 : }
28785 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
28786 0 : if (r->in.domain_handle == NULL) {
28787 0 : PyErr_NoMemory();
28788 0 : return false;
28789 : }
28790 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
28791 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
28792 0 : PyErr_NoMemory();
28793 0 : return false;
28794 : }
28795 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
28796 0 : if (py_access_mask == NULL) {
28797 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
28798 0 : return false;
28799 : }
28800 : {
28801 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
28802 0 : if (PyLong_Check(py_access_mask)) {
28803 0 : unsigned long long test_var;
28804 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
28805 0 : if (PyErr_Occurred() != NULL) {
28806 0 : return false;
28807 : }
28808 0 : if (test_var > uint_max) {
28809 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28810 : PyLong_Type.tp_name, uint_max, test_var);
28811 0 : return false;
28812 : }
28813 0 : r->in.access_mask = test_var;
28814 : } else {
28815 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28816 : PyLong_Type.tp_name);
28817 0 : return false;
28818 : }
28819 : }
28820 0 : if (py_rid == NULL) {
28821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
28822 0 : return false;
28823 : }
28824 : {
28825 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
28826 0 : if (PyLong_Check(py_rid)) {
28827 0 : unsigned long long test_var;
28828 0 : test_var = PyLong_AsUnsignedLongLong(py_rid);
28829 0 : if (PyErr_Occurred() != NULL) {
28830 0 : return false;
28831 : }
28832 0 : if (test_var > uint_max) {
28833 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28834 : PyLong_Type.tp_name, uint_max, test_var);
28835 0 : return false;
28836 : }
28837 0 : r->in.rid = test_var;
28838 : } else {
28839 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28840 : PyLong_Type.tp_name);
28841 0 : return false;
28842 : }
28843 : }
28844 0 : return true;
28845 : }
28846 :
28847 0 : static PyObject *unpack_py_samr_OpenAlias_args_out(struct samr_OpenAlias *r)
28848 : {
28849 0 : PyObject *result;
28850 0 : PyObject *py_alias_handle;
28851 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
28852 0 : result = py_alias_handle;
28853 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
28854 0 : PyErr_SetNTSTATUS(r->out.result);
28855 0 : return NULL;
28856 : }
28857 :
28858 0 : return result;
28859 : }
28860 :
28861 :
28862 0 : static PyObject *py_samr_QueryAliasInfo_in_get_alias_handle(PyObject *obj, void *closure)
28863 : {
28864 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj);
28865 0 : PyObject *py_alias_handle;
28866 0 : if (object->in.alias_handle == NULL) {
28867 0 : Py_RETURN_NONE;
28868 : }
28869 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
28870 0 : return py_alias_handle;
28871 : }
28872 :
28873 0 : static int py_samr_QueryAliasInfo_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
28874 : {
28875 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
28876 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
28877 0 : if (value == NULL) {
28878 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
28879 0 : return -1;
28880 : }
28881 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
28882 0 : if (object->in.alias_handle == NULL) {
28883 0 : PyErr_NoMemory();
28884 0 : return -1;
28885 : }
28886 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
28887 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
28888 0 : PyErr_NoMemory();
28889 0 : return -1;
28890 : }
28891 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
28892 0 : return 0;
28893 : }
28894 :
28895 0 : static PyObject *py_samr_QueryAliasInfo_in_get_level(PyObject *obj, void *closure)
28896 : {
28897 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj);
28898 0 : PyObject *py_level;
28899 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
28900 0 : return py_level;
28901 : }
28902 :
28903 0 : static int py_samr_QueryAliasInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
28904 : {
28905 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
28906 0 : if (value == NULL) {
28907 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
28908 0 : return -1;
28909 : }
28910 : {
28911 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
28912 0 : if (PyLong_Check(value)) {
28913 0 : unsigned long long test_var;
28914 0 : test_var = PyLong_AsUnsignedLongLong(value);
28915 0 : if (PyErr_Occurred() != NULL) {
28916 0 : return -1;
28917 : }
28918 0 : if (test_var > uint_max) {
28919 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
28920 : PyLong_Type.tp_name, uint_max, test_var);
28921 0 : return -1;
28922 : }
28923 0 : object->in.level = test_var;
28924 : } else {
28925 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
28926 : PyLong_Type.tp_name);
28927 0 : return -1;
28928 : }
28929 : }
28930 0 : return 0;
28931 : }
28932 :
28933 0 : static PyObject *py_samr_QueryAliasInfo_out_get_info(PyObject *obj, void *closure)
28934 : {
28935 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj);
28936 0 : PyObject *py_info;
28937 0 : if (object->out.info == NULL) {
28938 0 : Py_RETURN_NONE;
28939 : }
28940 0 : if (*object->out.info == NULL) {
28941 0 : py_info = Py_None;
28942 0 : Py_INCREF(py_info);
28943 : } else {
28944 0 : py_info = pyrpc_import_union(&samr_AliasInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_AliasInfo");
28945 0 : if (py_info == NULL) {
28946 0 : return NULL;
28947 : }
28948 : }
28949 0 : return py_info;
28950 : }
28951 :
28952 0 : static int py_samr_QueryAliasInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
28953 : {
28954 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
28955 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
28956 0 : if (value == NULL) {
28957 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
28958 0 : return -1;
28959 : }
28960 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
28961 0 : if (object->out.info == NULL) {
28962 0 : PyErr_NoMemory();
28963 0 : return -1;
28964 : }
28965 0 : if (value == Py_None) {
28966 0 : *object->out.info = NULL;
28967 : } else {
28968 0 : *object->out.info = NULL;
28969 : {
28970 0 : union samr_AliasInfo *info_switch_2;
28971 0 : info_switch_2 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_AliasInfo");
28972 0 : if (info_switch_2 == NULL) {
28973 0 : return -1;
28974 : }
28975 0 : *object->out.info = info_switch_2;
28976 : }
28977 : }
28978 0 : return 0;
28979 : }
28980 :
28981 0 : static PyObject *py_samr_QueryAliasInfo_get_result(PyObject *obj, void *closure)
28982 : {
28983 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(obj);
28984 0 : PyObject *py_result;
28985 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
28986 0 : return py_result;
28987 : }
28988 :
28989 0 : static int py_samr_QueryAliasInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
28990 : {
28991 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
28992 0 : if (value == NULL) {
28993 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
28994 0 : return -1;
28995 : }
28996 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
28997 0 : return 0;
28998 : }
28999 :
29000 : static PyGetSetDef py_samr_QueryAliasInfo_getsetters[] = {
29001 : {
29002 : .name = discard_const_p(char, "in_alias_handle"),
29003 : .get = py_samr_QueryAliasInfo_in_get_alias_handle,
29004 : .set = py_samr_QueryAliasInfo_in_set_alias_handle,
29005 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29006 : },
29007 : {
29008 : .name = discard_const_p(char, "in_level"),
29009 : .get = py_samr_QueryAliasInfo_in_get_level,
29010 : .set = py_samr_QueryAliasInfo_in_set_level,
29011 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfoEnum")
29012 : },
29013 : {
29014 : .name = discard_const_p(char, "out_info"),
29015 : .get = py_samr_QueryAliasInfo_out_get_info,
29016 : .set = py_samr_QueryAliasInfo_out_set_info,
29017 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfo")
29018 : },
29019 : {
29020 : .name = discard_const_p(char, "result"),
29021 : .get = py_samr_QueryAliasInfo_get_result,
29022 : .set = py_samr_QueryAliasInfo_set_result,
29023 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29024 : },
29025 : { .name = NULL }
29026 : };
29027 :
29028 0 : static PyObject *py_samr_QueryAliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29029 : {
29030 0 : PyObject *self = pytalloc_new(struct samr_QueryAliasInfo, type);
29031 0 : struct samr_QueryAliasInfo *_self = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(self);
29032 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29033 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
29034 : /* a pointer to a NULL pointer */
29035 0 : _self->out.info = talloc_zero(mem_ctx, union samr_AliasInfo *);
29036 0 : return self;
29037 : }
29038 :
29039 0 : static PyObject *py_samr_QueryAliasInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29040 : {
29041 :
29042 :
29043 0 : return PyLong_FromLong(28);
29044 : }
29045 :
29046 0 : static PyObject *py_samr_QueryAliasInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29047 : {
29048 0 : const struct ndr_interface_call *call = NULL;
29049 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
29050 0 : PyObject *ret = NULL;
29051 0 : struct ndr_push *push = NULL;
29052 0 : DATA_BLOB blob;
29053 0 : enum ndr_err_code err;
29054 :
29055 0 : if (ndr_table_samr.num_calls < 29) {
29056 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_pack");
29057 0 : return NULL;
29058 : }
29059 0 : call = &ndr_table_samr.calls[28];
29060 :
29061 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29062 0 : if (push == NULL) {
29063 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29064 0 : return NULL;
29065 : }
29066 :
29067 0 : push->flags |= ndr_push_flags;
29068 :
29069 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29070 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29071 0 : TALLOC_FREE(push);
29072 0 : PyErr_SetNdrError(err);
29073 0 : return NULL;
29074 : }
29075 0 : blob = ndr_push_blob(push);
29076 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29077 0 : TALLOC_FREE(push);
29078 0 : return ret;
29079 : }
29080 :
29081 0 : static PyObject *py_samr_QueryAliasInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29082 : {
29083 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29084 0 : PyObject *bigendian_obj = NULL;
29085 0 : PyObject *ndr64_obj = NULL;
29086 0 : libndr_flags ndr_push_flags = 0;
29087 :
29088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29089 : discard_const_p(char *, kwnames),
29090 : &bigendian_obj,
29091 : &ndr64_obj)) {
29092 0 : return NULL;
29093 : }
29094 :
29095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29096 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29097 : }
29098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29099 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29100 : }
29101 :
29102 0 : return py_samr_QueryAliasInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29103 : }
29104 :
29105 0 : static PyObject *py_samr_QueryAliasInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29106 : {
29107 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29108 0 : PyObject *bigendian_obj = NULL;
29109 0 : PyObject *ndr64_obj = NULL;
29110 0 : libndr_flags ndr_push_flags = 0;
29111 :
29112 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29113 : discard_const_p(char *, kwnames),
29114 : &bigendian_obj,
29115 : &ndr64_obj)) {
29116 0 : return NULL;
29117 : }
29118 :
29119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29120 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29121 : }
29122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29123 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29124 : }
29125 :
29126 0 : return py_samr_QueryAliasInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29127 : }
29128 :
29129 0 : static PyObject *py_samr_QueryAliasInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29130 : {
29131 0 : const struct ndr_interface_call *call = NULL;
29132 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
29133 0 : struct ndr_pull *pull = NULL;
29134 0 : enum ndr_err_code err;
29135 :
29136 0 : if (ndr_table_samr.num_calls < 29) {
29137 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_unpack");
29138 0 : return NULL;
29139 : }
29140 0 : call = &ndr_table_samr.calls[28];
29141 :
29142 0 : pull = ndr_pull_init_blob(blob, object);
29143 0 : if (pull == NULL) {
29144 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29145 0 : return NULL;
29146 : }
29147 :
29148 0 : pull->flags |= ndr_pull_flags;
29149 :
29150 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29151 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29152 0 : TALLOC_FREE(pull);
29153 0 : PyErr_SetNdrError(err);
29154 0 : return NULL;
29155 : }
29156 0 : if (!allow_remaining) {
29157 0 : uint32_t highest_ofs;
29158 :
29159 0 : if (pull->offset > pull->relative_highest_offset) {
29160 0 : highest_ofs = pull->offset;
29161 : } else {
29162 0 : highest_ofs = pull->relative_highest_offset;
29163 : }
29164 0 : if (highest_ofs < pull->data_size) {
29165 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29166 : "not all bytes consumed ofs[%u] size[%u]",
29167 : highest_ofs, pull->data_size);
29168 0 : TALLOC_FREE(pull);
29169 0 : PyErr_SetNdrError(err);
29170 0 : return NULL;
29171 : }
29172 : }
29173 :
29174 0 : TALLOC_FREE(pull);
29175 0 : Py_RETURN_NONE;
29176 : }
29177 :
29178 0 : static PyObject *py_samr_QueryAliasInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29179 : {
29180 0 : DATA_BLOB blob;
29181 0 : Py_ssize_t blob_length = 0;
29182 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29183 0 : PyObject *bigendian_obj = NULL;
29184 0 : PyObject *ndr64_obj = NULL;
29185 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29186 0 : PyObject *allow_remaining_obj = NULL;
29187 0 : bool allow_remaining = false;
29188 :
29189 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29190 : discard_const_p(char *, kwnames),
29191 : &blob.data, &blob_length,
29192 : &bigendian_obj,
29193 : &ndr64_obj,
29194 : &allow_remaining_obj)) {
29195 0 : return NULL;
29196 : }
29197 0 : blob.length = blob_length;
29198 :
29199 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29200 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29201 : }
29202 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29203 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29204 : }
29205 :
29206 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29207 0 : allow_remaining = true;
29208 : }
29209 :
29210 0 : return py_samr_QueryAliasInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29211 : }
29212 :
29213 0 : static PyObject *py_samr_QueryAliasInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29214 : {
29215 0 : DATA_BLOB blob;
29216 0 : Py_ssize_t blob_length = 0;
29217 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29218 0 : PyObject *bigendian_obj = NULL;
29219 0 : PyObject *ndr64_obj = NULL;
29220 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29221 0 : PyObject *allow_remaining_obj = NULL;
29222 0 : bool allow_remaining = false;
29223 :
29224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29225 : discard_const_p(char *, kwnames),
29226 : &blob.data, &blob_length,
29227 : &bigendian_obj,
29228 : &ndr64_obj,
29229 : &allow_remaining_obj)) {
29230 0 : return NULL;
29231 : }
29232 0 : blob.length = blob_length;
29233 :
29234 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29235 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29236 : }
29237 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29238 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29239 : }
29240 :
29241 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29242 0 : allow_remaining = true;
29243 : }
29244 :
29245 0 : return py_samr_QueryAliasInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29246 : }
29247 :
29248 0 : static PyObject *py_samr_QueryAliasInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29249 : {
29250 0 : const struct ndr_interface_call *call = NULL;
29251 0 : struct samr_QueryAliasInfo *object = (struct samr_QueryAliasInfo *)pytalloc_get_ptr(py_obj);
29252 0 : PyObject *ret;
29253 0 : char *retstr;
29254 :
29255 0 : if (ndr_table_samr.num_calls < 29) {
29256 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryAliasInfo_ndr_print");
29257 0 : return NULL;
29258 : }
29259 0 : call = &ndr_table_samr.calls[28];
29260 :
29261 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29262 0 : ret = PyUnicode_FromString(retstr);
29263 0 : TALLOC_FREE(retstr);
29264 :
29265 0 : return ret;
29266 : }
29267 :
29268 0 : static PyObject *py_samr_QueryAliasInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29269 : {
29270 0 : return py_samr_QueryAliasInfo_ndr_print(py_obj, "samr_QueryAliasInfo_in", NDR_IN);
29271 : }
29272 :
29273 0 : static PyObject *py_samr_QueryAliasInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29274 : {
29275 0 : return py_samr_QueryAliasInfo_ndr_print(py_obj, "samr_QueryAliasInfo_out", NDR_OUT);
29276 : }
29277 :
29278 : static PyMethodDef py_samr_QueryAliasInfo_methods[] = {
29279 : { "opnum", (PyCFunction)py_samr_QueryAliasInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
29280 : "samr.QueryAliasInfo.opnum() -> 28 (0x1c) " },
29281 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryAliasInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29282 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29283 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryAliasInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29284 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29285 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryAliasInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29286 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29287 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryAliasInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29288 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29289 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryAliasInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29290 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryAliasInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29291 : { NULL, NULL, 0, NULL }
29292 : };
29293 :
29294 :
29295 : static PyTypeObject samr_QueryAliasInfo_Type = {
29296 : PyVarObject_HEAD_INIT(NULL, 0)
29297 : .tp_name = "samr.QueryAliasInfo",
29298 : .tp_getset = py_samr_QueryAliasInfo_getsetters,
29299 : .tp_methods = py_samr_QueryAliasInfo_methods,
29300 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29301 : .tp_new = py_samr_QueryAliasInfo_new,
29302 : };
29303 :
29304 0 : static bool pack_py_samr_QueryAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryAliasInfo *r)
29305 : {
29306 0 : PyObject *py_alias_handle;
29307 0 : PyObject *py_level;
29308 0 : const char *kwnames[] = {
29309 : "alias_handle", "level", NULL
29310 : };
29311 :
29312 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level)) {
29313 0 : return false;
29314 : }
29315 :
29316 0 : if (py_alias_handle == NULL) {
29317 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
29318 0 : return false;
29319 : }
29320 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
29321 0 : if (r->in.alias_handle == NULL) {
29322 0 : PyErr_NoMemory();
29323 0 : return false;
29324 : }
29325 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
29326 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
29327 0 : PyErr_NoMemory();
29328 0 : return false;
29329 : }
29330 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
29331 0 : if (py_level == NULL) {
29332 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
29333 0 : return false;
29334 : }
29335 : {
29336 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
29337 0 : if (PyLong_Check(py_level)) {
29338 0 : unsigned long long test_var;
29339 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
29340 0 : if (PyErr_Occurred() != NULL) {
29341 0 : return false;
29342 : }
29343 0 : if (test_var > uint_max) {
29344 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29345 : PyLong_Type.tp_name, uint_max, test_var);
29346 0 : return false;
29347 : }
29348 0 : r->in.level = test_var;
29349 : } else {
29350 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29351 : PyLong_Type.tp_name);
29352 0 : return false;
29353 : }
29354 : }
29355 0 : return true;
29356 : }
29357 :
29358 0 : static PyObject *unpack_py_samr_QueryAliasInfo_args_out(struct samr_QueryAliasInfo *r)
29359 : {
29360 0 : PyObject *result;
29361 0 : PyObject *py_info;
29362 0 : if (*r->out.info == NULL) {
29363 0 : py_info = Py_None;
29364 0 : Py_INCREF(py_info);
29365 : } else {
29366 0 : py_info = pyrpc_import_union(&samr_AliasInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_AliasInfo");
29367 0 : if (py_info == NULL) {
29368 0 : return NULL;
29369 : }
29370 : }
29371 0 : result = py_info;
29372 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29373 0 : PyErr_SetNTSTATUS(r->out.result);
29374 0 : return NULL;
29375 : }
29376 :
29377 0 : return result;
29378 : }
29379 :
29380 :
29381 0 : static PyObject *py_samr_SetAliasInfo_in_get_alias_handle(PyObject *obj, void *closure)
29382 : {
29383 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj);
29384 0 : PyObject *py_alias_handle;
29385 0 : if (object->in.alias_handle == NULL) {
29386 0 : Py_RETURN_NONE;
29387 : }
29388 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
29389 0 : return py_alias_handle;
29390 : }
29391 :
29392 0 : static int py_samr_SetAliasInfo_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
29393 : {
29394 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29395 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
29396 0 : if (value == NULL) {
29397 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
29398 0 : return -1;
29399 : }
29400 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
29401 0 : if (object->in.alias_handle == NULL) {
29402 0 : PyErr_NoMemory();
29403 0 : return -1;
29404 : }
29405 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29406 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29407 0 : PyErr_NoMemory();
29408 0 : return -1;
29409 : }
29410 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
29411 0 : return 0;
29412 : }
29413 :
29414 0 : static PyObject *py_samr_SetAliasInfo_in_get_level(PyObject *obj, void *closure)
29415 : {
29416 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj);
29417 0 : PyObject *py_level;
29418 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
29419 0 : return py_level;
29420 : }
29421 :
29422 0 : static int py_samr_SetAliasInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
29423 : {
29424 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29425 0 : if (value == NULL) {
29426 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
29427 0 : return -1;
29428 : }
29429 : {
29430 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
29431 0 : if (PyLong_Check(value)) {
29432 0 : unsigned long long test_var;
29433 0 : test_var = PyLong_AsUnsignedLongLong(value);
29434 0 : if (PyErr_Occurred() != NULL) {
29435 0 : return -1;
29436 : }
29437 0 : if (test_var > uint_max) {
29438 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29439 : PyLong_Type.tp_name, uint_max, test_var);
29440 0 : return -1;
29441 : }
29442 0 : object->in.level = test_var;
29443 : } else {
29444 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29445 : PyLong_Type.tp_name);
29446 0 : return -1;
29447 : }
29448 : }
29449 0 : return 0;
29450 : }
29451 :
29452 0 : static PyObject *py_samr_SetAliasInfo_in_get_info(PyObject *obj, void *closure)
29453 : {
29454 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj);
29455 0 : PyObject *py_info;
29456 0 : if (object->in.info == NULL) {
29457 0 : Py_RETURN_NONE;
29458 : }
29459 0 : py_info = pyrpc_import_union(&samr_AliasInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_AliasInfo");
29460 0 : if (py_info == NULL) {
29461 0 : return NULL;
29462 : }
29463 0 : return py_info;
29464 : }
29465 :
29466 0 : static int py_samr_SetAliasInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
29467 : {
29468 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29469 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
29470 0 : if (value == NULL) {
29471 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
29472 0 : return -1;
29473 : }
29474 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
29475 0 : if (object->in.info == NULL) {
29476 0 : PyErr_NoMemory();
29477 0 : return -1;
29478 : }
29479 : {
29480 0 : union samr_AliasInfo *info_switch_1;
29481 0 : info_switch_1 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_AliasInfo");
29482 0 : if (info_switch_1 == NULL) {
29483 0 : return -1;
29484 : }
29485 0 : object->in.info = info_switch_1;
29486 : }
29487 0 : return 0;
29488 : }
29489 :
29490 0 : static PyObject *py_samr_SetAliasInfo_get_result(PyObject *obj, void *closure)
29491 : {
29492 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(obj);
29493 0 : PyObject *py_result;
29494 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29495 0 : return py_result;
29496 : }
29497 :
29498 0 : static int py_samr_SetAliasInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
29499 : {
29500 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29501 0 : if (value == NULL) {
29502 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29503 0 : return -1;
29504 : }
29505 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29506 0 : return 0;
29507 : }
29508 :
29509 : static PyGetSetDef py_samr_SetAliasInfo_getsetters[] = {
29510 : {
29511 : .name = discard_const_p(char, "in_alias_handle"),
29512 : .get = py_samr_SetAliasInfo_in_get_alias_handle,
29513 : .set = py_samr_SetAliasInfo_in_set_alias_handle,
29514 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29515 : },
29516 : {
29517 : .name = discard_const_p(char, "in_level"),
29518 : .get = py_samr_SetAliasInfo_in_get_level,
29519 : .set = py_samr_SetAliasInfo_in_set_level,
29520 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfoEnum")
29521 : },
29522 : {
29523 : .name = discard_const_p(char, "in_info"),
29524 : .get = py_samr_SetAliasInfo_in_get_info,
29525 : .set = py_samr_SetAliasInfo_in_set_info,
29526 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AliasInfo")
29527 : },
29528 : {
29529 : .name = discard_const_p(char, "result"),
29530 : .get = py_samr_SetAliasInfo_get_result,
29531 : .set = py_samr_SetAliasInfo_set_result,
29532 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
29533 : },
29534 : { .name = NULL }
29535 : };
29536 :
29537 0 : static PyObject *py_samr_SetAliasInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
29538 : {
29539 0 : PyObject *self = pytalloc_new(struct samr_SetAliasInfo, type);
29540 0 : struct samr_SetAliasInfo *_self = (struct samr_SetAliasInfo *)pytalloc_get_ptr(self);
29541 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
29542 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
29543 0 : _self->in.info = talloc_zero(mem_ctx, union samr_AliasInfo);
29544 0 : return self;
29545 : }
29546 :
29547 0 : static PyObject *py_samr_SetAliasInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
29548 : {
29549 :
29550 :
29551 0 : return PyLong_FromLong(29);
29552 : }
29553 :
29554 0 : static PyObject *py_samr_SetAliasInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
29555 : {
29556 0 : const struct ndr_interface_call *call = NULL;
29557 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29558 0 : PyObject *ret = NULL;
29559 0 : struct ndr_push *push = NULL;
29560 0 : DATA_BLOB blob;
29561 0 : enum ndr_err_code err;
29562 :
29563 0 : if (ndr_table_samr.num_calls < 30) {
29564 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_pack");
29565 0 : return NULL;
29566 : }
29567 0 : call = &ndr_table_samr.calls[29];
29568 :
29569 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
29570 0 : if (push == NULL) {
29571 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29572 0 : return NULL;
29573 : }
29574 :
29575 0 : push->flags |= ndr_push_flags;
29576 :
29577 0 : err = call->ndr_push(push, ndr_inout_flags, object);
29578 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29579 0 : TALLOC_FREE(push);
29580 0 : PyErr_SetNdrError(err);
29581 0 : return NULL;
29582 : }
29583 0 : blob = ndr_push_blob(push);
29584 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
29585 0 : TALLOC_FREE(push);
29586 0 : return ret;
29587 : }
29588 :
29589 0 : static PyObject *py_samr_SetAliasInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29590 : {
29591 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29592 0 : PyObject *bigendian_obj = NULL;
29593 0 : PyObject *ndr64_obj = NULL;
29594 0 : libndr_flags ndr_push_flags = 0;
29595 :
29596 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
29597 : discard_const_p(char *, kwnames),
29598 : &bigendian_obj,
29599 : &ndr64_obj)) {
29600 0 : return NULL;
29601 : }
29602 :
29603 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29604 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29605 : }
29606 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29607 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29608 : }
29609 :
29610 0 : return py_samr_SetAliasInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
29611 : }
29612 :
29613 0 : static PyObject *py_samr_SetAliasInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29614 : {
29615 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
29616 0 : PyObject *bigendian_obj = NULL;
29617 0 : PyObject *ndr64_obj = NULL;
29618 0 : libndr_flags ndr_push_flags = 0;
29619 :
29620 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
29621 : discard_const_p(char *, kwnames),
29622 : &bigendian_obj,
29623 : &ndr64_obj)) {
29624 0 : return NULL;
29625 : }
29626 :
29627 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29628 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
29629 : }
29630 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29631 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
29632 : }
29633 :
29634 0 : return py_samr_SetAliasInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
29635 : }
29636 :
29637 0 : static PyObject *py_samr_SetAliasInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
29638 : {
29639 0 : const struct ndr_interface_call *call = NULL;
29640 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29641 0 : struct ndr_pull *pull = NULL;
29642 0 : enum ndr_err_code err;
29643 :
29644 0 : if (ndr_table_samr.num_calls < 30) {
29645 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_unpack");
29646 0 : return NULL;
29647 : }
29648 0 : call = &ndr_table_samr.calls[29];
29649 :
29650 0 : pull = ndr_pull_init_blob(blob, object);
29651 0 : if (pull == NULL) {
29652 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
29653 0 : return NULL;
29654 : }
29655 :
29656 0 : pull->flags |= ndr_pull_flags;
29657 :
29658 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
29659 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
29660 0 : TALLOC_FREE(pull);
29661 0 : PyErr_SetNdrError(err);
29662 0 : return NULL;
29663 : }
29664 0 : if (!allow_remaining) {
29665 0 : uint32_t highest_ofs;
29666 :
29667 0 : if (pull->offset > pull->relative_highest_offset) {
29668 0 : highest_ofs = pull->offset;
29669 : } else {
29670 0 : highest_ofs = pull->relative_highest_offset;
29671 : }
29672 0 : if (highest_ofs < pull->data_size) {
29673 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
29674 : "not all bytes consumed ofs[%u] size[%u]",
29675 : highest_ofs, pull->data_size);
29676 0 : TALLOC_FREE(pull);
29677 0 : PyErr_SetNdrError(err);
29678 0 : return NULL;
29679 : }
29680 : }
29681 :
29682 0 : TALLOC_FREE(pull);
29683 0 : Py_RETURN_NONE;
29684 : }
29685 :
29686 0 : static PyObject *py_samr_SetAliasInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29687 : {
29688 0 : DATA_BLOB blob;
29689 0 : Py_ssize_t blob_length = 0;
29690 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29691 0 : PyObject *bigendian_obj = NULL;
29692 0 : PyObject *ndr64_obj = NULL;
29693 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29694 0 : PyObject *allow_remaining_obj = NULL;
29695 0 : bool allow_remaining = false;
29696 :
29697 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
29698 : discard_const_p(char *, kwnames),
29699 : &blob.data, &blob_length,
29700 : &bigendian_obj,
29701 : &ndr64_obj,
29702 : &allow_remaining_obj)) {
29703 0 : return NULL;
29704 : }
29705 0 : blob.length = blob_length;
29706 :
29707 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29708 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29709 : }
29710 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29711 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29712 : }
29713 :
29714 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29715 0 : allow_remaining = true;
29716 : }
29717 :
29718 0 : return py_samr_SetAliasInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
29719 : }
29720 :
29721 0 : static PyObject *py_samr_SetAliasInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
29722 : {
29723 0 : DATA_BLOB blob;
29724 0 : Py_ssize_t blob_length = 0;
29725 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
29726 0 : PyObject *bigendian_obj = NULL;
29727 0 : PyObject *ndr64_obj = NULL;
29728 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
29729 0 : PyObject *allow_remaining_obj = NULL;
29730 0 : bool allow_remaining = false;
29731 :
29732 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
29733 : discard_const_p(char *, kwnames),
29734 : &blob.data, &blob_length,
29735 : &bigendian_obj,
29736 : &ndr64_obj,
29737 : &allow_remaining_obj)) {
29738 0 : return NULL;
29739 : }
29740 0 : blob.length = blob_length;
29741 :
29742 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
29743 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
29744 : }
29745 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
29746 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
29747 : }
29748 :
29749 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
29750 0 : allow_remaining = true;
29751 : }
29752 :
29753 0 : return py_samr_SetAliasInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
29754 : }
29755 :
29756 0 : static PyObject *py_samr_SetAliasInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
29757 : {
29758 0 : const struct ndr_interface_call *call = NULL;
29759 0 : struct samr_SetAliasInfo *object = (struct samr_SetAliasInfo *)pytalloc_get_ptr(py_obj);
29760 0 : PyObject *ret;
29761 0 : char *retstr;
29762 :
29763 0 : if (ndr_table_samr.num_calls < 30) {
29764 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetAliasInfo_ndr_print");
29765 0 : return NULL;
29766 : }
29767 0 : call = &ndr_table_samr.calls[29];
29768 :
29769 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
29770 0 : ret = PyUnicode_FromString(retstr);
29771 0 : TALLOC_FREE(retstr);
29772 :
29773 0 : return ret;
29774 : }
29775 :
29776 0 : static PyObject *py_samr_SetAliasInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29777 : {
29778 0 : return py_samr_SetAliasInfo_ndr_print(py_obj, "samr_SetAliasInfo_in", NDR_IN);
29779 : }
29780 :
29781 0 : static PyObject *py_samr_SetAliasInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
29782 : {
29783 0 : return py_samr_SetAliasInfo_ndr_print(py_obj, "samr_SetAliasInfo_out", NDR_OUT);
29784 : }
29785 :
29786 : static PyMethodDef py_samr_SetAliasInfo_methods[] = {
29787 : { "opnum", (PyCFunction)py_samr_SetAliasInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
29788 : "samr.SetAliasInfo.opnum() -> 29 (0x1d) " },
29789 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetAliasInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
29790 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
29791 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetAliasInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
29792 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
29793 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetAliasInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
29794 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
29795 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetAliasInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
29796 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
29797 : { "__ndr_print_in__", (PyCFunction)py_samr_SetAliasInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
29798 : { "__ndr_print_out__", (PyCFunction)py_samr_SetAliasInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
29799 : { NULL, NULL, 0, NULL }
29800 : };
29801 :
29802 :
29803 : static PyTypeObject samr_SetAliasInfo_Type = {
29804 : PyVarObject_HEAD_INIT(NULL, 0)
29805 : .tp_name = "samr.SetAliasInfo",
29806 : .tp_getset = py_samr_SetAliasInfo_getsetters,
29807 : .tp_methods = py_samr_SetAliasInfo_methods,
29808 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
29809 : .tp_new = py_samr_SetAliasInfo_new,
29810 : };
29811 :
29812 0 : static bool pack_py_samr_SetAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetAliasInfo *r)
29813 : {
29814 0 : PyObject *py_alias_handle;
29815 0 : PyObject *py_level;
29816 0 : PyObject *py_info;
29817 0 : const char *kwnames[] = {
29818 : "alias_handle", "level", "info", NULL
29819 : };
29820 :
29821 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level, &py_info)) {
29822 0 : return false;
29823 : }
29824 :
29825 0 : if (py_alias_handle == NULL) {
29826 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
29827 0 : return false;
29828 : }
29829 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
29830 0 : if (r->in.alias_handle == NULL) {
29831 0 : PyErr_NoMemory();
29832 0 : return false;
29833 : }
29834 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
29835 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
29836 0 : PyErr_NoMemory();
29837 0 : return false;
29838 : }
29839 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
29840 0 : if (py_level == NULL) {
29841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
29842 0 : return false;
29843 : }
29844 : {
29845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
29846 0 : if (PyLong_Check(py_level)) {
29847 0 : unsigned long long test_var;
29848 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
29849 0 : if (PyErr_Occurred() != NULL) {
29850 0 : return false;
29851 : }
29852 0 : if (test_var > uint_max) {
29853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
29854 : PyLong_Type.tp_name, uint_max, test_var);
29855 0 : return false;
29856 : }
29857 0 : r->in.level = test_var;
29858 : } else {
29859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
29860 : PyLong_Type.tp_name);
29861 0 : return false;
29862 : }
29863 : }
29864 0 : if (py_info == NULL) {
29865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
29866 0 : return false;
29867 : }
29868 0 : r->in.info = talloc_ptrtype(r, r->in.info);
29869 0 : if (r->in.info == NULL) {
29870 0 : PyErr_NoMemory();
29871 0 : return false;
29872 : }
29873 : {
29874 0 : union samr_AliasInfo *info_switch_1;
29875 0 : info_switch_1 = (union samr_AliasInfo *)pyrpc_export_union(&samr_AliasInfo_Type, r, r->in.level, py_info, "union samr_AliasInfo");
29876 0 : if (info_switch_1 == NULL) {
29877 0 : return false;
29878 : }
29879 0 : r->in.info = info_switch_1;
29880 : }
29881 0 : return true;
29882 : }
29883 :
29884 0 : static PyObject *unpack_py_samr_SetAliasInfo_args_out(struct samr_SetAliasInfo *r)
29885 : {
29886 0 : PyObject *result;
29887 0 : result = Py_None;
29888 0 : Py_INCREF(result);
29889 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
29890 0 : PyErr_SetNTSTATUS(r->out.result);
29891 0 : return NULL;
29892 : }
29893 :
29894 0 : return result;
29895 : }
29896 :
29897 :
29898 0 : static PyObject *py_samr_DeleteDomAlias_in_get_alias_handle(PyObject *obj, void *closure)
29899 : {
29900 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj);
29901 0 : PyObject *py_alias_handle;
29902 0 : if (object->in.alias_handle == NULL) {
29903 0 : Py_RETURN_NONE;
29904 : }
29905 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
29906 0 : return py_alias_handle;
29907 : }
29908 :
29909 0 : static int py_samr_DeleteDomAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
29910 : {
29911 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
29912 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
29913 0 : if (value == NULL) {
29914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
29915 0 : return -1;
29916 : }
29917 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
29918 0 : if (object->in.alias_handle == NULL) {
29919 0 : PyErr_NoMemory();
29920 0 : return -1;
29921 : }
29922 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29923 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29924 0 : PyErr_NoMemory();
29925 0 : return -1;
29926 : }
29927 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
29928 0 : return 0;
29929 : }
29930 :
29931 0 : static PyObject *py_samr_DeleteDomAlias_out_get_alias_handle(PyObject *obj, void *closure)
29932 : {
29933 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj);
29934 0 : PyObject *py_alias_handle;
29935 0 : if (object->out.alias_handle == NULL) {
29936 0 : Py_RETURN_NONE;
29937 : }
29938 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->out.alias_handle, object->out.alias_handle);
29939 0 : return py_alias_handle;
29940 : }
29941 :
29942 0 : static int py_samr_DeleteDomAlias_out_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
29943 : {
29944 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
29945 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.alias_handle));
29946 0 : if (value == NULL) {
29947 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.alias_handle");
29948 0 : return -1;
29949 : }
29950 0 : object->out.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.alias_handle);
29951 0 : if (object->out.alias_handle == NULL) {
29952 0 : PyErr_NoMemory();
29953 0 : return -1;
29954 : }
29955 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
29956 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
29957 0 : PyErr_NoMemory();
29958 0 : return -1;
29959 : }
29960 0 : object->out.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
29961 0 : return 0;
29962 : }
29963 :
29964 0 : static PyObject *py_samr_DeleteDomAlias_get_result(PyObject *obj, void *closure)
29965 : {
29966 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(obj);
29967 0 : PyObject *py_result;
29968 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
29969 0 : return py_result;
29970 : }
29971 :
29972 0 : static int py_samr_DeleteDomAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
29973 : {
29974 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
29975 0 : if (value == NULL) {
29976 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
29977 0 : return -1;
29978 : }
29979 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
29980 0 : return 0;
29981 : }
29982 :
29983 : static PyGetSetDef py_samr_DeleteDomAlias_getsetters[] = {
29984 : {
29985 : .name = discard_const_p(char, "in_alias_handle"),
29986 : .get = py_samr_DeleteDomAlias_in_get_alias_handle,
29987 : .set = py_samr_DeleteDomAlias_in_set_alias_handle,
29988 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29989 : },
29990 : {
29991 : .name = discard_const_p(char, "out_alias_handle"),
29992 : .get = py_samr_DeleteDomAlias_out_get_alias_handle,
29993 : .set = py_samr_DeleteDomAlias_out_set_alias_handle,
29994 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
29995 : },
29996 : {
29997 : .name = discard_const_p(char, "result"),
29998 : .get = py_samr_DeleteDomAlias_get_result,
29999 : .set = py_samr_DeleteDomAlias_set_result,
30000 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30001 : },
30002 : { .name = NULL }
30003 : };
30004 :
30005 0 : static PyObject *py_samr_DeleteDomAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30006 : {
30007 0 : PyObject *self = pytalloc_new(struct samr_DeleteDomAlias, type);
30008 0 : struct samr_DeleteDomAlias *_self = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(self);
30009 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30010 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
30011 0 : _self->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
30012 0 : return self;
30013 : }
30014 :
30015 0 : static PyObject *py_samr_DeleteDomAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30016 : {
30017 :
30018 :
30019 0 : return PyLong_FromLong(30);
30020 : }
30021 :
30022 0 : static PyObject *py_samr_DeleteDomAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30023 : {
30024 0 : const struct ndr_interface_call *call = NULL;
30025 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
30026 0 : PyObject *ret = NULL;
30027 0 : struct ndr_push *push = NULL;
30028 0 : DATA_BLOB blob;
30029 0 : enum ndr_err_code err;
30030 :
30031 0 : if (ndr_table_samr.num_calls < 31) {
30032 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_pack");
30033 0 : return NULL;
30034 : }
30035 0 : call = &ndr_table_samr.calls[30];
30036 :
30037 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30038 0 : if (push == NULL) {
30039 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30040 0 : return NULL;
30041 : }
30042 :
30043 0 : push->flags |= ndr_push_flags;
30044 :
30045 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30046 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30047 0 : TALLOC_FREE(push);
30048 0 : PyErr_SetNdrError(err);
30049 0 : return NULL;
30050 : }
30051 0 : blob = ndr_push_blob(push);
30052 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30053 0 : TALLOC_FREE(push);
30054 0 : return ret;
30055 : }
30056 :
30057 0 : static PyObject *py_samr_DeleteDomAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30058 : {
30059 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30060 0 : PyObject *bigendian_obj = NULL;
30061 0 : PyObject *ndr64_obj = NULL;
30062 0 : libndr_flags ndr_push_flags = 0;
30063 :
30064 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30065 : discard_const_p(char *, kwnames),
30066 : &bigendian_obj,
30067 : &ndr64_obj)) {
30068 0 : return NULL;
30069 : }
30070 :
30071 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30072 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30073 : }
30074 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30075 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30076 : }
30077 :
30078 0 : return py_samr_DeleteDomAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30079 : }
30080 :
30081 0 : static PyObject *py_samr_DeleteDomAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30082 : {
30083 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30084 0 : PyObject *bigendian_obj = NULL;
30085 0 : PyObject *ndr64_obj = NULL;
30086 0 : libndr_flags ndr_push_flags = 0;
30087 :
30088 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30089 : discard_const_p(char *, kwnames),
30090 : &bigendian_obj,
30091 : &ndr64_obj)) {
30092 0 : return NULL;
30093 : }
30094 :
30095 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30096 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30097 : }
30098 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30099 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30100 : }
30101 :
30102 0 : return py_samr_DeleteDomAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30103 : }
30104 :
30105 0 : static PyObject *py_samr_DeleteDomAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30106 : {
30107 0 : const struct ndr_interface_call *call = NULL;
30108 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
30109 0 : struct ndr_pull *pull = NULL;
30110 0 : enum ndr_err_code err;
30111 :
30112 0 : if (ndr_table_samr.num_calls < 31) {
30113 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_unpack");
30114 0 : return NULL;
30115 : }
30116 0 : call = &ndr_table_samr.calls[30];
30117 :
30118 0 : pull = ndr_pull_init_blob(blob, object);
30119 0 : if (pull == NULL) {
30120 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30121 0 : return NULL;
30122 : }
30123 :
30124 0 : pull->flags |= ndr_pull_flags;
30125 :
30126 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30127 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30128 0 : TALLOC_FREE(pull);
30129 0 : PyErr_SetNdrError(err);
30130 0 : return NULL;
30131 : }
30132 0 : if (!allow_remaining) {
30133 0 : uint32_t highest_ofs;
30134 :
30135 0 : if (pull->offset > pull->relative_highest_offset) {
30136 0 : highest_ofs = pull->offset;
30137 : } else {
30138 0 : highest_ofs = pull->relative_highest_offset;
30139 : }
30140 0 : if (highest_ofs < pull->data_size) {
30141 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30142 : "not all bytes consumed ofs[%u] size[%u]",
30143 : highest_ofs, pull->data_size);
30144 0 : TALLOC_FREE(pull);
30145 0 : PyErr_SetNdrError(err);
30146 0 : return NULL;
30147 : }
30148 : }
30149 :
30150 0 : TALLOC_FREE(pull);
30151 0 : Py_RETURN_NONE;
30152 : }
30153 :
30154 0 : static PyObject *py_samr_DeleteDomAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30155 : {
30156 0 : DATA_BLOB blob;
30157 0 : Py_ssize_t blob_length = 0;
30158 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30159 0 : PyObject *bigendian_obj = NULL;
30160 0 : PyObject *ndr64_obj = NULL;
30161 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30162 0 : PyObject *allow_remaining_obj = NULL;
30163 0 : bool allow_remaining = false;
30164 :
30165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30166 : discard_const_p(char *, kwnames),
30167 : &blob.data, &blob_length,
30168 : &bigendian_obj,
30169 : &ndr64_obj,
30170 : &allow_remaining_obj)) {
30171 0 : return NULL;
30172 : }
30173 0 : blob.length = blob_length;
30174 :
30175 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30176 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30177 : }
30178 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30179 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30180 : }
30181 :
30182 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30183 0 : allow_remaining = true;
30184 : }
30185 :
30186 0 : return py_samr_DeleteDomAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30187 : }
30188 :
30189 0 : static PyObject *py_samr_DeleteDomAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30190 : {
30191 0 : DATA_BLOB blob;
30192 0 : Py_ssize_t blob_length = 0;
30193 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30194 0 : PyObject *bigendian_obj = NULL;
30195 0 : PyObject *ndr64_obj = NULL;
30196 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30197 0 : PyObject *allow_remaining_obj = NULL;
30198 0 : bool allow_remaining = false;
30199 :
30200 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30201 : discard_const_p(char *, kwnames),
30202 : &blob.data, &blob_length,
30203 : &bigendian_obj,
30204 : &ndr64_obj,
30205 : &allow_remaining_obj)) {
30206 0 : return NULL;
30207 : }
30208 0 : blob.length = blob_length;
30209 :
30210 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30211 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30212 : }
30213 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30214 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30215 : }
30216 :
30217 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30218 0 : allow_remaining = true;
30219 : }
30220 :
30221 0 : return py_samr_DeleteDomAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30222 : }
30223 :
30224 0 : static PyObject *py_samr_DeleteDomAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30225 : {
30226 0 : const struct ndr_interface_call *call = NULL;
30227 0 : struct samr_DeleteDomAlias *object = (struct samr_DeleteDomAlias *)pytalloc_get_ptr(py_obj);
30228 0 : PyObject *ret;
30229 0 : char *retstr;
30230 :
30231 0 : if (ndr_table_samr.num_calls < 31) {
30232 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteDomAlias_ndr_print");
30233 0 : return NULL;
30234 : }
30235 0 : call = &ndr_table_samr.calls[30];
30236 :
30237 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30238 0 : ret = PyUnicode_FromString(retstr);
30239 0 : TALLOC_FREE(retstr);
30240 :
30241 0 : return ret;
30242 : }
30243 :
30244 0 : static PyObject *py_samr_DeleteDomAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30245 : {
30246 0 : return py_samr_DeleteDomAlias_ndr_print(py_obj, "samr_DeleteDomAlias_in", NDR_IN);
30247 : }
30248 :
30249 0 : static PyObject *py_samr_DeleteDomAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30250 : {
30251 0 : return py_samr_DeleteDomAlias_ndr_print(py_obj, "samr_DeleteDomAlias_out", NDR_OUT);
30252 : }
30253 :
30254 : static PyMethodDef py_samr_DeleteDomAlias_methods[] = {
30255 : { "opnum", (PyCFunction)py_samr_DeleteDomAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
30256 : "samr.DeleteDomAlias.opnum() -> 30 (0x1e) " },
30257 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30258 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30259 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30260 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30261 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30262 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30263 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteDomAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30264 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30265 : { "__ndr_print_in__", (PyCFunction)py_samr_DeleteDomAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30266 : { "__ndr_print_out__", (PyCFunction)py_samr_DeleteDomAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30267 : { NULL, NULL, 0, NULL }
30268 : };
30269 :
30270 :
30271 : static PyTypeObject samr_DeleteDomAlias_Type = {
30272 : PyVarObject_HEAD_INIT(NULL, 0)
30273 : .tp_name = "samr.DeleteDomAlias",
30274 : .tp_getset = py_samr_DeleteDomAlias_getsetters,
30275 : .tp_methods = py_samr_DeleteDomAlias_methods,
30276 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30277 : .tp_new = py_samr_DeleteDomAlias_new,
30278 : };
30279 :
30280 0 : static bool pack_py_samr_DeleteDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomAlias *r)
30281 : {
30282 0 : PyObject *py_alias_handle;
30283 0 : const char *kwnames[] = {
30284 : "alias_handle", NULL
30285 : };
30286 :
30287 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
30288 0 : return false;
30289 : }
30290 :
30291 0 : if (py_alias_handle == NULL) {
30292 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
30293 0 : return false;
30294 : }
30295 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
30296 0 : if (r->in.alias_handle == NULL) {
30297 0 : PyErr_NoMemory();
30298 0 : return false;
30299 : }
30300 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
30301 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
30302 0 : PyErr_NoMemory();
30303 0 : return false;
30304 : }
30305 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
30306 0 : return true;
30307 : }
30308 :
30309 0 : static PyObject *unpack_py_samr_DeleteDomAlias_args_out(struct samr_DeleteDomAlias *r)
30310 : {
30311 0 : PyObject *result;
30312 0 : PyObject *py_alias_handle;
30313 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
30314 0 : result = py_alias_handle;
30315 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30316 0 : PyErr_SetNTSTATUS(r->out.result);
30317 0 : return NULL;
30318 : }
30319 :
30320 0 : return result;
30321 : }
30322 :
30323 :
30324 0 : static PyObject *py_samr_AddAliasMember_in_get_alias_handle(PyObject *obj, void *closure)
30325 : {
30326 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj);
30327 0 : PyObject *py_alias_handle;
30328 0 : if (object->in.alias_handle == NULL) {
30329 0 : Py_RETURN_NONE;
30330 : }
30331 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
30332 0 : return py_alias_handle;
30333 : }
30334 :
30335 0 : static int py_samr_AddAliasMember_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
30336 : {
30337 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30338 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
30339 0 : if (value == NULL) {
30340 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
30341 0 : return -1;
30342 : }
30343 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
30344 0 : if (object->in.alias_handle == NULL) {
30345 0 : PyErr_NoMemory();
30346 0 : return -1;
30347 : }
30348 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30349 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30350 0 : PyErr_NoMemory();
30351 0 : return -1;
30352 : }
30353 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
30354 0 : return 0;
30355 : }
30356 :
30357 0 : static PyObject *py_samr_AddAliasMember_in_get_sid(PyObject *obj, void *closure)
30358 : {
30359 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj);
30360 0 : PyObject *py_sid;
30361 0 : if (object->in.sid == NULL) {
30362 0 : Py_RETURN_NONE;
30363 : }
30364 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30365 0 : return py_sid;
30366 : }
30367 :
30368 0 : static int py_samr_AddAliasMember_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30369 : {
30370 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30371 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30372 0 : if (value == NULL) {
30373 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30374 0 : return -1;
30375 : }
30376 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30377 0 : if (object->in.sid == NULL) {
30378 0 : PyErr_NoMemory();
30379 0 : return -1;
30380 : }
30381 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30382 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30383 0 : PyErr_NoMemory();
30384 0 : return -1;
30385 : }
30386 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30387 0 : return 0;
30388 : }
30389 :
30390 0 : static PyObject *py_samr_AddAliasMember_get_result(PyObject *obj, void *closure)
30391 : {
30392 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(obj);
30393 0 : PyObject *py_result;
30394 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30395 0 : return py_result;
30396 : }
30397 :
30398 0 : static int py_samr_AddAliasMember_set_result(PyObject *py_obj, PyObject *value, void *closure)
30399 : {
30400 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30401 0 : if (value == NULL) {
30402 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30403 0 : return -1;
30404 : }
30405 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30406 0 : return 0;
30407 : }
30408 :
30409 : static PyGetSetDef py_samr_AddAliasMember_getsetters[] = {
30410 : {
30411 : .name = discard_const_p(char, "in_alias_handle"),
30412 : .get = py_samr_AddAliasMember_in_get_alias_handle,
30413 : .set = py_samr_AddAliasMember_in_set_alias_handle,
30414 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30415 : },
30416 : {
30417 : .name = discard_const_p(char, "in_sid"),
30418 : .get = py_samr_AddAliasMember_in_get_sid,
30419 : .set = py_samr_AddAliasMember_in_set_sid,
30420 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30421 : },
30422 : {
30423 : .name = discard_const_p(char, "result"),
30424 : .get = py_samr_AddAliasMember_get_result,
30425 : .set = py_samr_AddAliasMember_set_result,
30426 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30427 : },
30428 : { .name = NULL }
30429 : };
30430 :
30431 0 : static PyObject *py_samr_AddAliasMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30432 : {
30433 0 : PyObject *self = pytalloc_new(struct samr_AddAliasMember, type);
30434 0 : struct samr_AddAliasMember *_self = (struct samr_AddAliasMember *)pytalloc_get_ptr(self);
30435 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30436 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
30437 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30438 0 : return self;
30439 : }
30440 :
30441 0 : static PyObject *py_samr_AddAliasMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30442 : {
30443 :
30444 :
30445 0 : return PyLong_FromLong(31);
30446 : }
30447 :
30448 0 : static PyObject *py_samr_AddAliasMember_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30449 : {
30450 0 : const struct ndr_interface_call *call = NULL;
30451 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30452 0 : PyObject *ret = NULL;
30453 0 : struct ndr_push *push = NULL;
30454 0 : DATA_BLOB blob;
30455 0 : enum ndr_err_code err;
30456 :
30457 0 : if (ndr_table_samr.num_calls < 32) {
30458 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_pack");
30459 0 : return NULL;
30460 : }
30461 0 : call = &ndr_table_samr.calls[31];
30462 :
30463 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30464 0 : if (push == NULL) {
30465 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30466 0 : return NULL;
30467 : }
30468 :
30469 0 : push->flags |= ndr_push_flags;
30470 :
30471 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30472 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30473 0 : TALLOC_FREE(push);
30474 0 : PyErr_SetNdrError(err);
30475 0 : return NULL;
30476 : }
30477 0 : blob = ndr_push_blob(push);
30478 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30479 0 : TALLOC_FREE(push);
30480 0 : return ret;
30481 : }
30482 :
30483 0 : static PyObject *py_samr_AddAliasMember_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30484 : {
30485 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30486 0 : PyObject *bigendian_obj = NULL;
30487 0 : PyObject *ndr64_obj = NULL;
30488 0 : libndr_flags ndr_push_flags = 0;
30489 :
30490 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30491 : discard_const_p(char *, kwnames),
30492 : &bigendian_obj,
30493 : &ndr64_obj)) {
30494 0 : return NULL;
30495 : }
30496 :
30497 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30498 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30499 : }
30500 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30501 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30502 : }
30503 :
30504 0 : return py_samr_AddAliasMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30505 : }
30506 :
30507 0 : static PyObject *py_samr_AddAliasMember_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30508 : {
30509 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30510 0 : PyObject *bigendian_obj = NULL;
30511 0 : PyObject *ndr64_obj = NULL;
30512 0 : libndr_flags ndr_push_flags = 0;
30513 :
30514 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30515 : discard_const_p(char *, kwnames),
30516 : &bigendian_obj,
30517 : &ndr64_obj)) {
30518 0 : return NULL;
30519 : }
30520 :
30521 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30522 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30523 : }
30524 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30525 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30526 : }
30527 :
30528 0 : return py_samr_AddAliasMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30529 : }
30530 :
30531 0 : static PyObject *py_samr_AddAliasMember_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30532 : {
30533 0 : const struct ndr_interface_call *call = NULL;
30534 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30535 0 : struct ndr_pull *pull = NULL;
30536 0 : enum ndr_err_code err;
30537 :
30538 0 : if (ndr_table_samr.num_calls < 32) {
30539 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_unpack");
30540 0 : return NULL;
30541 : }
30542 0 : call = &ndr_table_samr.calls[31];
30543 :
30544 0 : pull = ndr_pull_init_blob(blob, object);
30545 0 : if (pull == NULL) {
30546 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30547 0 : return NULL;
30548 : }
30549 :
30550 0 : pull->flags |= ndr_pull_flags;
30551 :
30552 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30553 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30554 0 : TALLOC_FREE(pull);
30555 0 : PyErr_SetNdrError(err);
30556 0 : return NULL;
30557 : }
30558 0 : if (!allow_remaining) {
30559 0 : uint32_t highest_ofs;
30560 :
30561 0 : if (pull->offset > pull->relative_highest_offset) {
30562 0 : highest_ofs = pull->offset;
30563 : } else {
30564 0 : highest_ofs = pull->relative_highest_offset;
30565 : }
30566 0 : if (highest_ofs < pull->data_size) {
30567 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
30568 : "not all bytes consumed ofs[%u] size[%u]",
30569 : highest_ofs, pull->data_size);
30570 0 : TALLOC_FREE(pull);
30571 0 : PyErr_SetNdrError(err);
30572 0 : return NULL;
30573 : }
30574 : }
30575 :
30576 0 : TALLOC_FREE(pull);
30577 0 : Py_RETURN_NONE;
30578 : }
30579 :
30580 0 : static PyObject *py_samr_AddAliasMember_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30581 : {
30582 0 : DATA_BLOB blob;
30583 0 : Py_ssize_t blob_length = 0;
30584 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30585 0 : PyObject *bigendian_obj = NULL;
30586 0 : PyObject *ndr64_obj = NULL;
30587 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30588 0 : PyObject *allow_remaining_obj = NULL;
30589 0 : bool allow_remaining = false;
30590 :
30591 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
30592 : discard_const_p(char *, kwnames),
30593 : &blob.data, &blob_length,
30594 : &bigendian_obj,
30595 : &ndr64_obj,
30596 : &allow_remaining_obj)) {
30597 0 : return NULL;
30598 : }
30599 0 : blob.length = blob_length;
30600 :
30601 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30602 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30603 : }
30604 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30605 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30606 : }
30607 :
30608 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30609 0 : allow_remaining = true;
30610 : }
30611 :
30612 0 : return py_samr_AddAliasMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
30613 : }
30614 :
30615 0 : static PyObject *py_samr_AddAliasMember_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30616 : {
30617 0 : DATA_BLOB blob;
30618 0 : Py_ssize_t blob_length = 0;
30619 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
30620 0 : PyObject *bigendian_obj = NULL;
30621 0 : PyObject *ndr64_obj = NULL;
30622 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
30623 0 : PyObject *allow_remaining_obj = NULL;
30624 0 : bool allow_remaining = false;
30625 :
30626 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
30627 : discard_const_p(char *, kwnames),
30628 : &blob.data, &blob_length,
30629 : &bigendian_obj,
30630 : &ndr64_obj,
30631 : &allow_remaining_obj)) {
30632 0 : return NULL;
30633 : }
30634 0 : blob.length = blob_length;
30635 :
30636 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30637 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
30638 : }
30639 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30640 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
30641 : }
30642 :
30643 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
30644 0 : allow_remaining = true;
30645 : }
30646 :
30647 0 : return py_samr_AddAliasMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
30648 : }
30649 :
30650 0 : static PyObject *py_samr_AddAliasMember_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
30651 : {
30652 0 : const struct ndr_interface_call *call = NULL;
30653 0 : struct samr_AddAliasMember *object = (struct samr_AddAliasMember *)pytalloc_get_ptr(py_obj);
30654 0 : PyObject *ret;
30655 0 : char *retstr;
30656 :
30657 0 : if (ndr_table_samr.num_calls < 32) {
30658 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddAliasMember_ndr_print");
30659 0 : return NULL;
30660 : }
30661 0 : call = &ndr_table_samr.calls[31];
30662 :
30663 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
30664 0 : ret = PyUnicode_FromString(retstr);
30665 0 : TALLOC_FREE(retstr);
30666 :
30667 0 : return ret;
30668 : }
30669 :
30670 0 : static PyObject *py_samr_AddAliasMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30671 : {
30672 0 : return py_samr_AddAliasMember_ndr_print(py_obj, "samr_AddAliasMember_in", NDR_IN);
30673 : }
30674 :
30675 0 : static PyObject *py_samr_AddAliasMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
30676 : {
30677 0 : return py_samr_AddAliasMember_ndr_print(py_obj, "samr_AddAliasMember_out", NDR_OUT);
30678 : }
30679 :
30680 : static PyMethodDef py_samr_AddAliasMember_methods[] = {
30681 : { "opnum", (PyCFunction)py_samr_AddAliasMember_ndr_opnum, METH_NOARGS|METH_CLASS,
30682 : "samr.AddAliasMember.opnum() -> 31 (0x1f) " },
30683 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddAliasMember_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
30684 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
30685 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddAliasMember_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
30686 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
30687 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddAliasMember_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
30688 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
30689 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddAliasMember_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
30690 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
30691 : { "__ndr_print_in__", (PyCFunction)py_samr_AddAliasMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
30692 : { "__ndr_print_out__", (PyCFunction)py_samr_AddAliasMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
30693 : { NULL, NULL, 0, NULL }
30694 : };
30695 :
30696 :
30697 : static PyTypeObject samr_AddAliasMember_Type = {
30698 : PyVarObject_HEAD_INIT(NULL, 0)
30699 : .tp_name = "samr.AddAliasMember",
30700 : .tp_getset = py_samr_AddAliasMember_getsetters,
30701 : .tp_methods = py_samr_AddAliasMember_methods,
30702 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
30703 : .tp_new = py_samr_AddAliasMember_new,
30704 : };
30705 :
30706 0 : static bool pack_py_samr_AddAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddAliasMember *r)
30707 : {
30708 0 : PyObject *py_alias_handle;
30709 0 : PyObject *py_sid;
30710 0 : const char *kwnames[] = {
30711 : "alias_handle", "sid", NULL
30712 : };
30713 :
30714 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
30715 0 : return false;
30716 : }
30717 :
30718 0 : if (py_alias_handle == NULL) {
30719 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
30720 0 : return false;
30721 : }
30722 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
30723 0 : if (r->in.alias_handle == NULL) {
30724 0 : PyErr_NoMemory();
30725 0 : return false;
30726 : }
30727 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
30728 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
30729 0 : PyErr_NoMemory();
30730 0 : return false;
30731 : }
30732 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
30733 0 : if (py_sid == NULL) {
30734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
30735 0 : return false;
30736 : }
30737 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
30738 0 : if (r->in.sid == NULL) {
30739 0 : PyErr_NoMemory();
30740 0 : return false;
30741 : }
30742 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
30743 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
30744 0 : PyErr_NoMemory();
30745 0 : return false;
30746 : }
30747 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
30748 0 : return true;
30749 : }
30750 :
30751 0 : static PyObject *unpack_py_samr_AddAliasMember_args_out(struct samr_AddAliasMember *r)
30752 : {
30753 0 : PyObject *result;
30754 0 : result = Py_None;
30755 0 : Py_INCREF(result);
30756 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
30757 0 : PyErr_SetNTSTATUS(r->out.result);
30758 0 : return NULL;
30759 : }
30760 :
30761 0 : return result;
30762 : }
30763 :
30764 :
30765 0 : static PyObject *py_samr_DeleteAliasMember_in_get_alias_handle(PyObject *obj, void *closure)
30766 : {
30767 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj);
30768 0 : PyObject *py_alias_handle;
30769 0 : if (object->in.alias_handle == NULL) {
30770 0 : Py_RETURN_NONE;
30771 : }
30772 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
30773 0 : return py_alias_handle;
30774 : }
30775 :
30776 0 : static int py_samr_DeleteAliasMember_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
30777 : {
30778 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
30779 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
30780 0 : if (value == NULL) {
30781 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
30782 0 : return -1;
30783 : }
30784 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
30785 0 : if (object->in.alias_handle == NULL) {
30786 0 : PyErr_NoMemory();
30787 0 : return -1;
30788 : }
30789 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
30790 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30791 0 : PyErr_NoMemory();
30792 0 : return -1;
30793 : }
30794 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
30795 0 : return 0;
30796 : }
30797 :
30798 0 : static PyObject *py_samr_DeleteAliasMember_in_get_sid(PyObject *obj, void *closure)
30799 : {
30800 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj);
30801 0 : PyObject *py_sid;
30802 0 : if (object->in.sid == NULL) {
30803 0 : Py_RETURN_NONE;
30804 : }
30805 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
30806 0 : return py_sid;
30807 : }
30808 :
30809 0 : static int py_samr_DeleteAliasMember_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
30810 : {
30811 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
30812 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
30813 0 : if (value == NULL) {
30814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
30815 0 : return -1;
30816 : }
30817 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
30818 0 : if (object->in.sid == NULL) {
30819 0 : PyErr_NoMemory();
30820 0 : return -1;
30821 : }
30822 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
30823 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
30824 0 : PyErr_NoMemory();
30825 0 : return -1;
30826 : }
30827 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
30828 0 : return 0;
30829 : }
30830 :
30831 0 : static PyObject *py_samr_DeleteAliasMember_get_result(PyObject *obj, void *closure)
30832 : {
30833 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(obj);
30834 0 : PyObject *py_result;
30835 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
30836 0 : return py_result;
30837 : }
30838 :
30839 0 : static int py_samr_DeleteAliasMember_set_result(PyObject *py_obj, PyObject *value, void *closure)
30840 : {
30841 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
30842 0 : if (value == NULL) {
30843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
30844 0 : return -1;
30845 : }
30846 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
30847 0 : return 0;
30848 : }
30849 :
30850 : static PyGetSetDef py_samr_DeleteAliasMember_getsetters[] = {
30851 : {
30852 : .name = discard_const_p(char, "in_alias_handle"),
30853 : .get = py_samr_DeleteAliasMember_in_get_alias_handle,
30854 : .set = py_samr_DeleteAliasMember_in_set_alias_handle,
30855 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
30856 : },
30857 : {
30858 : .name = discard_const_p(char, "in_sid"),
30859 : .get = py_samr_DeleteAliasMember_in_get_sid,
30860 : .set = py_samr_DeleteAliasMember_in_set_sid,
30861 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
30862 : },
30863 : {
30864 : .name = discard_const_p(char, "result"),
30865 : .get = py_samr_DeleteAliasMember_get_result,
30866 : .set = py_samr_DeleteAliasMember_set_result,
30867 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
30868 : },
30869 : { .name = NULL }
30870 : };
30871 :
30872 0 : static PyObject *py_samr_DeleteAliasMember_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
30873 : {
30874 0 : PyObject *self = pytalloc_new(struct samr_DeleteAliasMember, type);
30875 0 : struct samr_DeleteAliasMember *_self = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(self);
30876 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
30877 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
30878 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
30879 0 : return self;
30880 : }
30881 :
30882 0 : static PyObject *py_samr_DeleteAliasMember_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
30883 : {
30884 :
30885 :
30886 0 : return PyLong_FromLong(32);
30887 : }
30888 :
30889 0 : static PyObject *py_samr_DeleteAliasMember_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
30890 : {
30891 0 : const struct ndr_interface_call *call = NULL;
30892 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
30893 0 : PyObject *ret = NULL;
30894 0 : struct ndr_push *push = NULL;
30895 0 : DATA_BLOB blob;
30896 0 : enum ndr_err_code err;
30897 :
30898 0 : if (ndr_table_samr.num_calls < 33) {
30899 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_pack");
30900 0 : return NULL;
30901 : }
30902 0 : call = &ndr_table_samr.calls[32];
30903 :
30904 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
30905 0 : if (push == NULL) {
30906 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30907 0 : return NULL;
30908 : }
30909 :
30910 0 : push->flags |= ndr_push_flags;
30911 :
30912 0 : err = call->ndr_push(push, ndr_inout_flags, object);
30913 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30914 0 : TALLOC_FREE(push);
30915 0 : PyErr_SetNdrError(err);
30916 0 : return NULL;
30917 : }
30918 0 : blob = ndr_push_blob(push);
30919 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
30920 0 : TALLOC_FREE(push);
30921 0 : return ret;
30922 : }
30923 :
30924 0 : static PyObject *py_samr_DeleteAliasMember_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30925 : {
30926 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30927 0 : PyObject *bigendian_obj = NULL;
30928 0 : PyObject *ndr64_obj = NULL;
30929 0 : libndr_flags ndr_push_flags = 0;
30930 :
30931 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
30932 : discard_const_p(char *, kwnames),
30933 : &bigendian_obj,
30934 : &ndr64_obj)) {
30935 0 : return NULL;
30936 : }
30937 :
30938 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30939 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30940 : }
30941 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30942 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30943 : }
30944 :
30945 0 : return py_samr_DeleteAliasMember_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
30946 : }
30947 :
30948 0 : static PyObject *py_samr_DeleteAliasMember_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
30949 : {
30950 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
30951 0 : PyObject *bigendian_obj = NULL;
30952 0 : PyObject *ndr64_obj = NULL;
30953 0 : libndr_flags ndr_push_flags = 0;
30954 :
30955 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
30956 : discard_const_p(char *, kwnames),
30957 : &bigendian_obj,
30958 : &ndr64_obj)) {
30959 0 : return NULL;
30960 : }
30961 :
30962 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
30963 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
30964 : }
30965 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
30966 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
30967 : }
30968 :
30969 0 : return py_samr_DeleteAliasMember_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
30970 : }
30971 :
30972 0 : static PyObject *py_samr_DeleteAliasMember_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
30973 : {
30974 0 : const struct ndr_interface_call *call = NULL;
30975 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
30976 0 : struct ndr_pull *pull = NULL;
30977 0 : enum ndr_err_code err;
30978 :
30979 0 : if (ndr_table_samr.num_calls < 33) {
30980 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_unpack");
30981 0 : return NULL;
30982 : }
30983 0 : call = &ndr_table_samr.calls[32];
30984 :
30985 0 : pull = ndr_pull_init_blob(blob, object);
30986 0 : if (pull == NULL) {
30987 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
30988 0 : return NULL;
30989 : }
30990 :
30991 0 : pull->flags |= ndr_pull_flags;
30992 :
30993 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
30994 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
30995 0 : TALLOC_FREE(pull);
30996 0 : PyErr_SetNdrError(err);
30997 0 : return NULL;
30998 : }
30999 0 : if (!allow_remaining) {
31000 0 : uint32_t highest_ofs;
31001 :
31002 0 : if (pull->offset > pull->relative_highest_offset) {
31003 0 : highest_ofs = pull->offset;
31004 : } else {
31005 0 : highest_ofs = pull->relative_highest_offset;
31006 : }
31007 0 : if (highest_ofs < pull->data_size) {
31008 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31009 : "not all bytes consumed ofs[%u] size[%u]",
31010 : highest_ofs, pull->data_size);
31011 0 : TALLOC_FREE(pull);
31012 0 : PyErr_SetNdrError(err);
31013 0 : return NULL;
31014 : }
31015 : }
31016 :
31017 0 : TALLOC_FREE(pull);
31018 0 : Py_RETURN_NONE;
31019 : }
31020 :
31021 0 : static PyObject *py_samr_DeleteAliasMember_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31022 : {
31023 0 : DATA_BLOB blob;
31024 0 : Py_ssize_t blob_length = 0;
31025 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31026 0 : PyObject *bigendian_obj = NULL;
31027 0 : PyObject *ndr64_obj = NULL;
31028 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31029 0 : PyObject *allow_remaining_obj = NULL;
31030 0 : bool allow_remaining = false;
31031 :
31032 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31033 : discard_const_p(char *, kwnames),
31034 : &blob.data, &blob_length,
31035 : &bigendian_obj,
31036 : &ndr64_obj,
31037 : &allow_remaining_obj)) {
31038 0 : return NULL;
31039 : }
31040 0 : blob.length = blob_length;
31041 :
31042 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31043 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31044 : }
31045 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31046 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31047 : }
31048 :
31049 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31050 0 : allow_remaining = true;
31051 : }
31052 :
31053 0 : return py_samr_DeleteAliasMember_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31054 : }
31055 :
31056 0 : static PyObject *py_samr_DeleteAliasMember_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31057 : {
31058 0 : DATA_BLOB blob;
31059 0 : Py_ssize_t blob_length = 0;
31060 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31061 0 : PyObject *bigendian_obj = NULL;
31062 0 : PyObject *ndr64_obj = NULL;
31063 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31064 0 : PyObject *allow_remaining_obj = NULL;
31065 0 : bool allow_remaining = false;
31066 :
31067 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31068 : discard_const_p(char *, kwnames),
31069 : &blob.data, &blob_length,
31070 : &bigendian_obj,
31071 : &ndr64_obj,
31072 : &allow_remaining_obj)) {
31073 0 : return NULL;
31074 : }
31075 0 : blob.length = blob_length;
31076 :
31077 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31078 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31079 : }
31080 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31081 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31082 : }
31083 :
31084 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31085 0 : allow_remaining = true;
31086 : }
31087 :
31088 0 : return py_samr_DeleteAliasMember_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31089 : }
31090 :
31091 0 : static PyObject *py_samr_DeleteAliasMember_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31092 : {
31093 0 : const struct ndr_interface_call *call = NULL;
31094 0 : struct samr_DeleteAliasMember *object = (struct samr_DeleteAliasMember *)pytalloc_get_ptr(py_obj);
31095 0 : PyObject *ret;
31096 0 : char *retstr;
31097 :
31098 0 : if (ndr_table_samr.num_calls < 33) {
31099 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteAliasMember_ndr_print");
31100 0 : return NULL;
31101 : }
31102 0 : call = &ndr_table_samr.calls[32];
31103 :
31104 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31105 0 : ret = PyUnicode_FromString(retstr);
31106 0 : TALLOC_FREE(retstr);
31107 :
31108 0 : return ret;
31109 : }
31110 :
31111 0 : static PyObject *py_samr_DeleteAliasMember_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31112 : {
31113 0 : return py_samr_DeleteAliasMember_ndr_print(py_obj, "samr_DeleteAliasMember_in", NDR_IN);
31114 : }
31115 :
31116 0 : static PyObject *py_samr_DeleteAliasMember_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31117 : {
31118 0 : return py_samr_DeleteAliasMember_ndr_print(py_obj, "samr_DeleteAliasMember_out", NDR_OUT);
31119 : }
31120 :
31121 : static PyMethodDef py_samr_DeleteAliasMember_methods[] = {
31122 : { "opnum", (PyCFunction)py_samr_DeleteAliasMember_ndr_opnum, METH_NOARGS|METH_CLASS,
31123 : "samr.DeleteAliasMember.opnum() -> 32 (0x20) " },
31124 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteAliasMember_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31125 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31126 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteAliasMember_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31127 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31128 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteAliasMember_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31129 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31130 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteAliasMember_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31131 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31132 : { "__ndr_print_in__", (PyCFunction)py_samr_DeleteAliasMember_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31133 : { "__ndr_print_out__", (PyCFunction)py_samr_DeleteAliasMember_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31134 : { NULL, NULL, 0, NULL }
31135 : };
31136 :
31137 :
31138 : static PyTypeObject samr_DeleteAliasMember_Type = {
31139 : PyVarObject_HEAD_INIT(NULL, 0)
31140 : .tp_name = "samr.DeleteAliasMember",
31141 : .tp_getset = py_samr_DeleteAliasMember_getsetters,
31142 : .tp_methods = py_samr_DeleteAliasMember_methods,
31143 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31144 : .tp_new = py_samr_DeleteAliasMember_new,
31145 : };
31146 :
31147 0 : static bool pack_py_samr_DeleteAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteAliasMember *r)
31148 : {
31149 0 : PyObject *py_alias_handle;
31150 0 : PyObject *py_sid;
31151 0 : const char *kwnames[] = {
31152 : "alias_handle", "sid", NULL
31153 : };
31154 :
31155 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
31156 0 : return false;
31157 : }
31158 :
31159 0 : if (py_alias_handle == NULL) {
31160 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
31161 0 : return false;
31162 : }
31163 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
31164 0 : if (r->in.alias_handle == NULL) {
31165 0 : PyErr_NoMemory();
31166 0 : return false;
31167 : }
31168 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
31169 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
31170 0 : PyErr_NoMemory();
31171 0 : return false;
31172 : }
31173 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
31174 0 : if (py_sid == NULL) {
31175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
31176 0 : return false;
31177 : }
31178 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
31179 0 : if (r->in.sid == NULL) {
31180 0 : PyErr_NoMemory();
31181 0 : return false;
31182 : }
31183 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
31184 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
31185 0 : PyErr_NoMemory();
31186 0 : return false;
31187 : }
31188 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
31189 0 : return true;
31190 : }
31191 :
31192 0 : static PyObject *unpack_py_samr_DeleteAliasMember_args_out(struct samr_DeleteAliasMember *r)
31193 : {
31194 0 : PyObject *result;
31195 0 : result = Py_None;
31196 0 : Py_INCREF(result);
31197 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31198 0 : PyErr_SetNTSTATUS(r->out.result);
31199 0 : return NULL;
31200 : }
31201 :
31202 0 : return result;
31203 : }
31204 :
31205 :
31206 0 : static PyObject *py_samr_GetMembersInAlias_in_get_alias_handle(PyObject *obj, void *closure)
31207 : {
31208 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj);
31209 0 : PyObject *py_alias_handle;
31210 0 : if (object->in.alias_handle == NULL) {
31211 0 : Py_RETURN_NONE;
31212 : }
31213 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
31214 0 : return py_alias_handle;
31215 : }
31216 :
31217 0 : static int py_samr_GetMembersInAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
31218 : {
31219 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31220 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
31221 0 : if (value == NULL) {
31222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
31223 0 : return -1;
31224 : }
31225 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
31226 0 : if (object->in.alias_handle == NULL) {
31227 0 : PyErr_NoMemory();
31228 0 : return -1;
31229 : }
31230 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31231 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31232 0 : PyErr_NoMemory();
31233 0 : return -1;
31234 : }
31235 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
31236 0 : return 0;
31237 : }
31238 :
31239 0 : static PyObject *py_samr_GetMembersInAlias_out_get_sids(PyObject *obj, void *closure)
31240 : {
31241 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj);
31242 0 : PyObject *py_sids;
31243 0 : if (object->out.sids == NULL) {
31244 0 : Py_RETURN_NONE;
31245 : }
31246 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->out.sids, object->out.sids);
31247 0 : return py_sids;
31248 : }
31249 :
31250 0 : static int py_samr_GetMembersInAlias_out_set_sids(PyObject *py_obj, PyObject *value, void *closure)
31251 : {
31252 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31253 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sids));
31254 0 : if (value == NULL) {
31255 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sids");
31256 0 : return -1;
31257 : }
31258 0 : object->out.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sids);
31259 0 : if (object->out.sids == NULL) {
31260 0 : PyErr_NoMemory();
31261 0 : return -1;
31262 : }
31263 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
31264 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31265 0 : PyErr_NoMemory();
31266 0 : return -1;
31267 : }
31268 0 : object->out.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
31269 0 : return 0;
31270 : }
31271 :
31272 0 : static PyObject *py_samr_GetMembersInAlias_get_result(PyObject *obj, void *closure)
31273 : {
31274 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(obj);
31275 0 : PyObject *py_result;
31276 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31277 0 : return py_result;
31278 : }
31279 :
31280 0 : static int py_samr_GetMembersInAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
31281 : {
31282 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31283 0 : if (value == NULL) {
31284 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31285 0 : return -1;
31286 : }
31287 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31288 0 : return 0;
31289 : }
31290 :
31291 : static PyGetSetDef py_samr_GetMembersInAlias_getsetters[] = {
31292 : {
31293 : .name = discard_const_p(char, "in_alias_handle"),
31294 : .get = py_samr_GetMembersInAlias_in_get_alias_handle,
31295 : .set = py_samr_GetMembersInAlias_in_set_alias_handle,
31296 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31297 : },
31298 : {
31299 : .name = discard_const_p(char, "out_sids"),
31300 : .get = py_samr_GetMembersInAlias_out_get_sids,
31301 : .set = py_samr_GetMembersInAlias_out_set_sids,
31302 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
31303 : },
31304 : {
31305 : .name = discard_const_p(char, "result"),
31306 : .get = py_samr_GetMembersInAlias_get_result,
31307 : .set = py_samr_GetMembersInAlias_set_result,
31308 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31309 : },
31310 : { .name = NULL }
31311 : };
31312 :
31313 0 : static PyObject *py_samr_GetMembersInAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31314 : {
31315 0 : PyObject *self = pytalloc_new(struct samr_GetMembersInAlias, type);
31316 0 : struct samr_GetMembersInAlias *_self = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(self);
31317 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31318 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
31319 0 : _self->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
31320 0 : return self;
31321 : }
31322 :
31323 0 : static PyObject *py_samr_GetMembersInAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31324 : {
31325 :
31326 :
31327 0 : return PyLong_FromLong(33);
31328 : }
31329 :
31330 0 : static PyObject *py_samr_GetMembersInAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31331 : {
31332 0 : const struct ndr_interface_call *call = NULL;
31333 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31334 0 : PyObject *ret = NULL;
31335 0 : struct ndr_push *push = NULL;
31336 0 : DATA_BLOB blob;
31337 0 : enum ndr_err_code err;
31338 :
31339 0 : if (ndr_table_samr.num_calls < 34) {
31340 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_pack");
31341 0 : return NULL;
31342 : }
31343 0 : call = &ndr_table_samr.calls[33];
31344 :
31345 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31346 0 : if (push == NULL) {
31347 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31348 0 : return NULL;
31349 : }
31350 :
31351 0 : push->flags |= ndr_push_flags;
31352 :
31353 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31354 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31355 0 : TALLOC_FREE(push);
31356 0 : PyErr_SetNdrError(err);
31357 0 : return NULL;
31358 : }
31359 0 : blob = ndr_push_blob(push);
31360 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31361 0 : TALLOC_FREE(push);
31362 0 : return ret;
31363 : }
31364 :
31365 0 : static PyObject *py_samr_GetMembersInAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31366 : {
31367 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31368 0 : PyObject *bigendian_obj = NULL;
31369 0 : PyObject *ndr64_obj = NULL;
31370 0 : libndr_flags ndr_push_flags = 0;
31371 :
31372 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31373 : discard_const_p(char *, kwnames),
31374 : &bigendian_obj,
31375 : &ndr64_obj)) {
31376 0 : return NULL;
31377 : }
31378 :
31379 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31380 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31381 : }
31382 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31383 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31384 : }
31385 :
31386 0 : return py_samr_GetMembersInAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31387 : }
31388 :
31389 0 : static PyObject *py_samr_GetMembersInAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31390 : {
31391 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31392 0 : PyObject *bigendian_obj = NULL;
31393 0 : PyObject *ndr64_obj = NULL;
31394 0 : libndr_flags ndr_push_flags = 0;
31395 :
31396 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31397 : discard_const_p(char *, kwnames),
31398 : &bigendian_obj,
31399 : &ndr64_obj)) {
31400 0 : return NULL;
31401 : }
31402 :
31403 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31404 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31405 : }
31406 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31407 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31408 : }
31409 :
31410 0 : return py_samr_GetMembersInAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31411 : }
31412 :
31413 0 : static PyObject *py_samr_GetMembersInAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31414 : {
31415 0 : const struct ndr_interface_call *call = NULL;
31416 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31417 0 : struct ndr_pull *pull = NULL;
31418 0 : enum ndr_err_code err;
31419 :
31420 0 : if (ndr_table_samr.num_calls < 34) {
31421 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_unpack");
31422 0 : return NULL;
31423 : }
31424 0 : call = &ndr_table_samr.calls[33];
31425 :
31426 0 : pull = ndr_pull_init_blob(blob, object);
31427 0 : if (pull == NULL) {
31428 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31429 0 : return NULL;
31430 : }
31431 :
31432 0 : pull->flags |= ndr_pull_flags;
31433 :
31434 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31435 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31436 0 : TALLOC_FREE(pull);
31437 0 : PyErr_SetNdrError(err);
31438 0 : return NULL;
31439 : }
31440 0 : if (!allow_remaining) {
31441 0 : uint32_t highest_ofs;
31442 :
31443 0 : if (pull->offset > pull->relative_highest_offset) {
31444 0 : highest_ofs = pull->offset;
31445 : } else {
31446 0 : highest_ofs = pull->relative_highest_offset;
31447 : }
31448 0 : if (highest_ofs < pull->data_size) {
31449 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31450 : "not all bytes consumed ofs[%u] size[%u]",
31451 : highest_ofs, pull->data_size);
31452 0 : TALLOC_FREE(pull);
31453 0 : PyErr_SetNdrError(err);
31454 0 : return NULL;
31455 : }
31456 : }
31457 :
31458 0 : TALLOC_FREE(pull);
31459 0 : Py_RETURN_NONE;
31460 : }
31461 :
31462 0 : static PyObject *py_samr_GetMembersInAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31463 : {
31464 0 : DATA_BLOB blob;
31465 0 : Py_ssize_t blob_length = 0;
31466 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31467 0 : PyObject *bigendian_obj = NULL;
31468 0 : PyObject *ndr64_obj = NULL;
31469 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31470 0 : PyObject *allow_remaining_obj = NULL;
31471 0 : bool allow_remaining = false;
31472 :
31473 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31474 : discard_const_p(char *, kwnames),
31475 : &blob.data, &blob_length,
31476 : &bigendian_obj,
31477 : &ndr64_obj,
31478 : &allow_remaining_obj)) {
31479 0 : return NULL;
31480 : }
31481 0 : blob.length = blob_length;
31482 :
31483 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31484 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31485 : }
31486 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31487 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31488 : }
31489 :
31490 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31491 0 : allow_remaining = true;
31492 : }
31493 :
31494 0 : return py_samr_GetMembersInAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
31495 : }
31496 :
31497 0 : static PyObject *py_samr_GetMembersInAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31498 : {
31499 0 : DATA_BLOB blob;
31500 0 : Py_ssize_t blob_length = 0;
31501 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31502 0 : PyObject *bigendian_obj = NULL;
31503 0 : PyObject *ndr64_obj = NULL;
31504 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31505 0 : PyObject *allow_remaining_obj = NULL;
31506 0 : bool allow_remaining = false;
31507 :
31508 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
31509 : discard_const_p(char *, kwnames),
31510 : &blob.data, &blob_length,
31511 : &bigendian_obj,
31512 : &ndr64_obj,
31513 : &allow_remaining_obj)) {
31514 0 : return NULL;
31515 : }
31516 0 : blob.length = blob_length;
31517 :
31518 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31519 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31520 : }
31521 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31522 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
31523 : }
31524 :
31525 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
31526 0 : allow_remaining = true;
31527 : }
31528 :
31529 0 : return py_samr_GetMembersInAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
31530 : }
31531 :
31532 0 : static PyObject *py_samr_GetMembersInAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
31533 : {
31534 0 : const struct ndr_interface_call *call = NULL;
31535 0 : struct samr_GetMembersInAlias *object = (struct samr_GetMembersInAlias *)pytalloc_get_ptr(py_obj);
31536 0 : PyObject *ret;
31537 0 : char *retstr;
31538 :
31539 0 : if (ndr_table_samr.num_calls < 34) {
31540 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetMembersInAlias_ndr_print");
31541 0 : return NULL;
31542 : }
31543 0 : call = &ndr_table_samr.calls[33];
31544 :
31545 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
31546 0 : ret = PyUnicode_FromString(retstr);
31547 0 : TALLOC_FREE(retstr);
31548 :
31549 0 : return ret;
31550 : }
31551 :
31552 0 : static PyObject *py_samr_GetMembersInAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31553 : {
31554 0 : return py_samr_GetMembersInAlias_ndr_print(py_obj, "samr_GetMembersInAlias_in", NDR_IN);
31555 : }
31556 :
31557 0 : static PyObject *py_samr_GetMembersInAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
31558 : {
31559 0 : return py_samr_GetMembersInAlias_ndr_print(py_obj, "samr_GetMembersInAlias_out", NDR_OUT);
31560 : }
31561 :
31562 : static PyMethodDef py_samr_GetMembersInAlias_methods[] = {
31563 : { "opnum", (PyCFunction)py_samr_GetMembersInAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
31564 : "samr.GetMembersInAlias.opnum() -> 33 (0x21) " },
31565 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetMembersInAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
31566 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
31567 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetMembersInAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
31568 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
31569 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetMembersInAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
31570 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
31571 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetMembersInAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
31572 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
31573 : { "__ndr_print_in__", (PyCFunction)py_samr_GetMembersInAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
31574 : { "__ndr_print_out__", (PyCFunction)py_samr_GetMembersInAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
31575 : { NULL, NULL, 0, NULL }
31576 : };
31577 :
31578 :
31579 : static PyTypeObject samr_GetMembersInAlias_Type = {
31580 : PyVarObject_HEAD_INIT(NULL, 0)
31581 : .tp_name = "samr.GetMembersInAlias",
31582 : .tp_getset = py_samr_GetMembersInAlias_getsetters,
31583 : .tp_methods = py_samr_GetMembersInAlias_methods,
31584 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
31585 : .tp_new = py_samr_GetMembersInAlias_new,
31586 : };
31587 :
31588 0 : static bool pack_py_samr_GetMembersInAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_GetMembersInAlias *r)
31589 : {
31590 0 : PyObject *py_alias_handle;
31591 0 : const char *kwnames[] = {
31592 : "alias_handle", NULL
31593 : };
31594 :
31595 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetMembersInAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
31596 0 : return false;
31597 : }
31598 :
31599 0 : if (py_alias_handle == NULL) {
31600 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
31601 0 : return false;
31602 : }
31603 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
31604 0 : if (r->in.alias_handle == NULL) {
31605 0 : PyErr_NoMemory();
31606 0 : return false;
31607 : }
31608 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
31609 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
31610 0 : PyErr_NoMemory();
31611 0 : return false;
31612 : }
31613 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
31614 0 : return true;
31615 : }
31616 :
31617 0 : static PyObject *unpack_py_samr_GetMembersInAlias_args_out(struct samr_GetMembersInAlias *r)
31618 : {
31619 0 : PyObject *result;
31620 0 : PyObject *py_sids;
31621 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, r->out.sids, r->out.sids);
31622 0 : result = py_sids;
31623 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
31624 0 : PyErr_SetNTSTATUS(r->out.result);
31625 0 : return NULL;
31626 : }
31627 :
31628 0 : return result;
31629 : }
31630 :
31631 :
31632 0 : static PyObject *py_samr_OpenUser_in_get_domain_handle(PyObject *obj, void *closure)
31633 : {
31634 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj);
31635 0 : PyObject *py_domain_handle;
31636 0 : if (object->in.domain_handle == NULL) {
31637 0 : Py_RETURN_NONE;
31638 : }
31639 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
31640 0 : return py_domain_handle;
31641 : }
31642 :
31643 0 : static int py_samr_OpenUser_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
31644 : {
31645 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31646 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
31647 0 : if (value == NULL) {
31648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
31649 0 : return -1;
31650 : }
31651 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
31652 0 : if (object->in.domain_handle == NULL) {
31653 0 : PyErr_NoMemory();
31654 0 : return -1;
31655 : }
31656 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31657 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31658 0 : PyErr_NoMemory();
31659 0 : return -1;
31660 : }
31661 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
31662 0 : return 0;
31663 : }
31664 :
31665 0 : static PyObject *py_samr_OpenUser_in_get_access_mask(PyObject *obj, void *closure)
31666 : {
31667 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj);
31668 0 : PyObject *py_access_mask;
31669 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
31670 0 : return py_access_mask;
31671 : }
31672 :
31673 0 : static int py_samr_OpenUser_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
31674 : {
31675 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31676 0 : if (value == NULL) {
31677 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
31678 0 : return -1;
31679 : }
31680 : {
31681 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
31682 0 : if (PyLong_Check(value)) {
31683 0 : unsigned long long test_var;
31684 0 : test_var = PyLong_AsUnsignedLongLong(value);
31685 0 : if (PyErr_Occurred() != NULL) {
31686 0 : return -1;
31687 : }
31688 0 : if (test_var > uint_max) {
31689 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31690 : PyLong_Type.tp_name, uint_max, test_var);
31691 0 : return -1;
31692 : }
31693 0 : object->in.access_mask = test_var;
31694 : } else {
31695 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31696 : PyLong_Type.tp_name);
31697 0 : return -1;
31698 : }
31699 : }
31700 0 : return 0;
31701 : }
31702 :
31703 0 : static PyObject *py_samr_OpenUser_in_get_rid(PyObject *obj, void *closure)
31704 : {
31705 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj);
31706 0 : PyObject *py_rid;
31707 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
31708 0 : return py_rid;
31709 : }
31710 :
31711 0 : static int py_samr_OpenUser_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
31712 : {
31713 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31714 0 : if (value == NULL) {
31715 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
31716 0 : return -1;
31717 : }
31718 : {
31719 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
31720 0 : if (PyLong_Check(value)) {
31721 0 : unsigned long long test_var;
31722 0 : test_var = PyLong_AsUnsignedLongLong(value);
31723 0 : if (PyErr_Occurred() != NULL) {
31724 0 : return -1;
31725 : }
31726 0 : if (test_var > uint_max) {
31727 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
31728 : PyLong_Type.tp_name, uint_max, test_var);
31729 0 : return -1;
31730 : }
31731 0 : object->in.rid = test_var;
31732 : } else {
31733 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
31734 : PyLong_Type.tp_name);
31735 0 : return -1;
31736 : }
31737 : }
31738 0 : return 0;
31739 : }
31740 :
31741 0 : static PyObject *py_samr_OpenUser_out_get_user_handle(PyObject *obj, void *closure)
31742 : {
31743 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj);
31744 0 : PyObject *py_user_handle;
31745 0 : if (object->out.user_handle == NULL) {
31746 0 : Py_RETURN_NONE;
31747 : }
31748 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle);
31749 0 : return py_user_handle;
31750 : }
31751 :
31752 0 : static int py_samr_OpenUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
31753 : {
31754 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31755 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle));
31756 0 : if (value == NULL) {
31757 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle");
31758 0 : return -1;
31759 : }
31760 0 : object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle);
31761 0 : if (object->out.user_handle == NULL) {
31762 0 : PyErr_NoMemory();
31763 0 : return -1;
31764 : }
31765 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
31766 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
31767 0 : PyErr_NoMemory();
31768 0 : return -1;
31769 : }
31770 0 : object->out.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
31771 0 : return 0;
31772 : }
31773 :
31774 0 : static PyObject *py_samr_OpenUser_get_result(PyObject *obj, void *closure)
31775 : {
31776 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(obj);
31777 0 : PyObject *py_result;
31778 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
31779 0 : return py_result;
31780 : }
31781 :
31782 0 : static int py_samr_OpenUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
31783 : {
31784 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31785 0 : if (value == NULL) {
31786 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
31787 0 : return -1;
31788 : }
31789 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
31790 0 : return 0;
31791 : }
31792 :
31793 : static PyGetSetDef py_samr_OpenUser_getsetters[] = {
31794 : {
31795 : .name = discard_const_p(char, "in_domain_handle"),
31796 : .get = py_samr_OpenUser_in_get_domain_handle,
31797 : .set = py_samr_OpenUser_in_set_domain_handle,
31798 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31799 : },
31800 : {
31801 : .name = discard_const_p(char, "in_access_mask"),
31802 : .get = py_samr_OpenUser_in_get_access_mask,
31803 : .set = py_samr_OpenUser_in_set_access_mask,
31804 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask")
31805 : },
31806 : {
31807 : .name = discard_const_p(char, "in_rid"),
31808 : .get = py_samr_OpenUser_in_get_rid,
31809 : .set = py_samr_OpenUser_in_set_rid,
31810 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
31811 : },
31812 : {
31813 : .name = discard_const_p(char, "out_user_handle"),
31814 : .get = py_samr_OpenUser_out_get_user_handle,
31815 : .set = py_samr_OpenUser_out_set_user_handle,
31816 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
31817 : },
31818 : {
31819 : .name = discard_const_p(char, "result"),
31820 : .get = py_samr_OpenUser_get_result,
31821 : .set = py_samr_OpenUser_set_result,
31822 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
31823 : },
31824 : { .name = NULL }
31825 : };
31826 :
31827 0 : static PyObject *py_samr_OpenUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
31828 : {
31829 0 : PyObject *self = pytalloc_new(struct samr_OpenUser, type);
31830 0 : struct samr_OpenUser *_self = (struct samr_OpenUser *)pytalloc_get_ptr(self);
31831 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
31832 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
31833 0 : _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
31834 0 : return self;
31835 : }
31836 :
31837 0 : static PyObject *py_samr_OpenUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
31838 : {
31839 :
31840 :
31841 0 : return PyLong_FromLong(34);
31842 : }
31843 :
31844 0 : static PyObject *py_samr_OpenUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
31845 : {
31846 0 : const struct ndr_interface_call *call = NULL;
31847 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31848 0 : PyObject *ret = NULL;
31849 0 : struct ndr_push *push = NULL;
31850 0 : DATA_BLOB blob;
31851 0 : enum ndr_err_code err;
31852 :
31853 0 : if (ndr_table_samr.num_calls < 35) {
31854 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_pack");
31855 0 : return NULL;
31856 : }
31857 0 : call = &ndr_table_samr.calls[34];
31858 :
31859 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
31860 0 : if (push == NULL) {
31861 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31862 0 : return NULL;
31863 : }
31864 :
31865 0 : push->flags |= ndr_push_flags;
31866 :
31867 0 : err = call->ndr_push(push, ndr_inout_flags, object);
31868 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31869 0 : TALLOC_FREE(push);
31870 0 : PyErr_SetNdrError(err);
31871 0 : return NULL;
31872 : }
31873 0 : blob = ndr_push_blob(push);
31874 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
31875 0 : TALLOC_FREE(push);
31876 0 : return ret;
31877 : }
31878 :
31879 0 : static PyObject *py_samr_OpenUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31880 : {
31881 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31882 0 : PyObject *bigendian_obj = NULL;
31883 0 : PyObject *ndr64_obj = NULL;
31884 0 : libndr_flags ndr_push_flags = 0;
31885 :
31886 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
31887 : discard_const_p(char *, kwnames),
31888 : &bigendian_obj,
31889 : &ndr64_obj)) {
31890 0 : return NULL;
31891 : }
31892 :
31893 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31894 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31895 : }
31896 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31897 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31898 : }
31899 :
31900 0 : return py_samr_OpenUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
31901 : }
31902 :
31903 0 : static PyObject *py_samr_OpenUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31904 : {
31905 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
31906 0 : PyObject *bigendian_obj = NULL;
31907 0 : PyObject *ndr64_obj = NULL;
31908 0 : libndr_flags ndr_push_flags = 0;
31909 :
31910 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
31911 : discard_const_p(char *, kwnames),
31912 : &bigendian_obj,
31913 : &ndr64_obj)) {
31914 0 : return NULL;
31915 : }
31916 :
31917 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31918 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
31919 : }
31920 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
31921 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
31922 : }
31923 :
31924 0 : return py_samr_OpenUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
31925 : }
31926 :
31927 0 : static PyObject *py_samr_OpenUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
31928 : {
31929 0 : const struct ndr_interface_call *call = NULL;
31930 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
31931 0 : struct ndr_pull *pull = NULL;
31932 0 : enum ndr_err_code err;
31933 :
31934 0 : if (ndr_table_samr.num_calls < 35) {
31935 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_unpack");
31936 0 : return NULL;
31937 : }
31938 0 : call = &ndr_table_samr.calls[34];
31939 :
31940 0 : pull = ndr_pull_init_blob(blob, object);
31941 0 : if (pull == NULL) {
31942 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
31943 0 : return NULL;
31944 : }
31945 :
31946 0 : pull->flags |= ndr_pull_flags;
31947 :
31948 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
31949 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
31950 0 : TALLOC_FREE(pull);
31951 0 : PyErr_SetNdrError(err);
31952 0 : return NULL;
31953 : }
31954 0 : if (!allow_remaining) {
31955 0 : uint32_t highest_ofs;
31956 :
31957 0 : if (pull->offset > pull->relative_highest_offset) {
31958 0 : highest_ofs = pull->offset;
31959 : } else {
31960 0 : highest_ofs = pull->relative_highest_offset;
31961 : }
31962 0 : if (highest_ofs < pull->data_size) {
31963 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
31964 : "not all bytes consumed ofs[%u] size[%u]",
31965 : highest_ofs, pull->data_size);
31966 0 : TALLOC_FREE(pull);
31967 0 : PyErr_SetNdrError(err);
31968 0 : return NULL;
31969 : }
31970 : }
31971 :
31972 0 : TALLOC_FREE(pull);
31973 0 : Py_RETURN_NONE;
31974 : }
31975 :
31976 0 : static PyObject *py_samr_OpenUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
31977 : {
31978 0 : DATA_BLOB blob;
31979 0 : Py_ssize_t blob_length = 0;
31980 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
31981 0 : PyObject *bigendian_obj = NULL;
31982 0 : PyObject *ndr64_obj = NULL;
31983 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
31984 0 : PyObject *allow_remaining_obj = NULL;
31985 0 : bool allow_remaining = false;
31986 :
31987 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
31988 : discard_const_p(char *, kwnames),
31989 : &blob.data, &blob_length,
31990 : &bigendian_obj,
31991 : &ndr64_obj,
31992 : &allow_remaining_obj)) {
31993 0 : return NULL;
31994 : }
31995 0 : blob.length = blob_length;
31996 :
31997 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
31998 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
31999 : }
32000 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32001 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32002 : }
32003 :
32004 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32005 0 : allow_remaining = true;
32006 : }
32007 :
32008 0 : return py_samr_OpenUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32009 : }
32010 :
32011 0 : static PyObject *py_samr_OpenUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32012 : {
32013 0 : DATA_BLOB blob;
32014 0 : Py_ssize_t blob_length = 0;
32015 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32016 0 : PyObject *bigendian_obj = NULL;
32017 0 : PyObject *ndr64_obj = NULL;
32018 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32019 0 : PyObject *allow_remaining_obj = NULL;
32020 0 : bool allow_remaining = false;
32021 :
32022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32023 : discard_const_p(char *, kwnames),
32024 : &blob.data, &blob_length,
32025 : &bigendian_obj,
32026 : &ndr64_obj,
32027 : &allow_remaining_obj)) {
32028 0 : return NULL;
32029 : }
32030 0 : blob.length = blob_length;
32031 :
32032 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32033 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32034 : }
32035 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32036 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32037 : }
32038 :
32039 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32040 0 : allow_remaining = true;
32041 : }
32042 :
32043 0 : return py_samr_OpenUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32044 : }
32045 :
32046 0 : static PyObject *py_samr_OpenUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32047 : {
32048 0 : const struct ndr_interface_call *call = NULL;
32049 0 : struct samr_OpenUser *object = (struct samr_OpenUser *)pytalloc_get_ptr(py_obj);
32050 0 : PyObject *ret;
32051 0 : char *retstr;
32052 :
32053 0 : if (ndr_table_samr.num_calls < 35) {
32054 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OpenUser_ndr_print");
32055 0 : return NULL;
32056 : }
32057 0 : call = &ndr_table_samr.calls[34];
32058 :
32059 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32060 0 : ret = PyUnicode_FromString(retstr);
32061 0 : TALLOC_FREE(retstr);
32062 :
32063 0 : return ret;
32064 : }
32065 :
32066 0 : static PyObject *py_samr_OpenUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32067 : {
32068 0 : return py_samr_OpenUser_ndr_print(py_obj, "samr_OpenUser_in", NDR_IN);
32069 : }
32070 :
32071 0 : static PyObject *py_samr_OpenUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32072 : {
32073 0 : return py_samr_OpenUser_ndr_print(py_obj, "samr_OpenUser_out", NDR_OUT);
32074 : }
32075 :
32076 : static PyMethodDef py_samr_OpenUser_methods[] = {
32077 : { "opnum", (PyCFunction)py_samr_OpenUser_ndr_opnum, METH_NOARGS|METH_CLASS,
32078 : "samr.OpenUser.opnum() -> 34 (0x22) " },
32079 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32080 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32081 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32082 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32083 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32084 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32085 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OpenUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32086 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32087 : { "__ndr_print_in__", (PyCFunction)py_samr_OpenUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32088 : { "__ndr_print_out__", (PyCFunction)py_samr_OpenUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32089 : { NULL, NULL, 0, NULL }
32090 : };
32091 :
32092 :
32093 : static PyTypeObject samr_OpenUser_Type = {
32094 : PyVarObject_HEAD_INIT(NULL, 0)
32095 : .tp_name = "samr.OpenUser",
32096 : .tp_getset = py_samr_OpenUser_getsetters,
32097 : .tp_methods = py_samr_OpenUser_methods,
32098 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32099 : .tp_new = py_samr_OpenUser_new,
32100 : };
32101 :
32102 843 : static bool pack_py_samr_OpenUser_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenUser *r)
32103 : {
32104 0 : PyObject *py_domain_handle;
32105 0 : PyObject *py_access_mask;
32106 0 : PyObject *py_rid;
32107 843 : const char *kwnames[] = {
32108 : "domain_handle", "access_mask", "rid", NULL
32109 : };
32110 :
32111 843 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
32112 0 : return false;
32113 : }
32114 :
32115 843 : if (py_domain_handle == NULL) {
32116 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
32117 0 : return false;
32118 : }
32119 843 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
32120 843 : if (r->in.domain_handle == NULL) {
32121 0 : PyErr_NoMemory();
32122 0 : return false;
32123 : }
32124 843 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
32125 843 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
32126 0 : PyErr_NoMemory();
32127 0 : return false;
32128 : }
32129 843 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
32130 843 : if (py_access_mask == NULL) {
32131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
32132 0 : return false;
32133 : }
32134 : {
32135 843 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
32136 843 : if (PyLong_Check(py_access_mask)) {
32137 0 : unsigned long long test_var;
32138 843 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
32139 843 : if (PyErr_Occurred() != NULL) {
32140 0 : return false;
32141 : }
32142 843 : if (test_var > uint_max) {
32143 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32144 : PyLong_Type.tp_name, uint_max, test_var);
32145 0 : return false;
32146 : }
32147 843 : r->in.access_mask = test_var;
32148 : } else {
32149 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32150 : PyLong_Type.tp_name);
32151 0 : return false;
32152 : }
32153 : }
32154 843 : if (py_rid == NULL) {
32155 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
32156 0 : return false;
32157 : }
32158 : {
32159 843 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
32160 843 : if (PyLong_Check(py_rid)) {
32161 0 : unsigned long long test_var;
32162 843 : test_var = PyLong_AsUnsignedLongLong(py_rid);
32163 843 : if (PyErr_Occurred() != NULL) {
32164 0 : return false;
32165 : }
32166 843 : if (test_var > uint_max) {
32167 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32168 : PyLong_Type.tp_name, uint_max, test_var);
32169 0 : return false;
32170 : }
32171 843 : r->in.rid = test_var;
32172 : } else {
32173 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32174 : PyLong_Type.tp_name);
32175 0 : return false;
32176 : }
32177 : }
32178 843 : return true;
32179 : }
32180 :
32181 843 : static PyObject *unpack_py_samr_OpenUser_args_out(struct samr_OpenUser *r)
32182 : {
32183 0 : PyObject *result;
32184 0 : PyObject *py_user_handle;
32185 843 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
32186 843 : result = py_user_handle;
32187 843 : if (NT_STATUS_IS_ERR(r->out.result)) {
32188 0 : PyErr_SetNTSTATUS(r->out.result);
32189 0 : return NULL;
32190 : }
32191 :
32192 843 : return result;
32193 : }
32194 :
32195 :
32196 0 : static PyObject *py_samr_DeleteUser_in_get_user_handle(PyObject *obj, void *closure)
32197 : {
32198 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj);
32199 0 : PyObject *py_user_handle;
32200 0 : if (object->in.user_handle == NULL) {
32201 0 : Py_RETURN_NONE;
32202 : }
32203 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
32204 0 : return py_user_handle;
32205 : }
32206 :
32207 0 : static int py_samr_DeleteUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
32208 : {
32209 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32210 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
32211 0 : if (value == NULL) {
32212 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
32213 0 : return -1;
32214 : }
32215 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
32216 0 : if (object->in.user_handle == NULL) {
32217 0 : PyErr_NoMemory();
32218 0 : return -1;
32219 : }
32220 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32221 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32222 0 : PyErr_NoMemory();
32223 0 : return -1;
32224 : }
32225 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
32226 0 : return 0;
32227 : }
32228 :
32229 0 : static PyObject *py_samr_DeleteUser_out_get_user_handle(PyObject *obj, void *closure)
32230 : {
32231 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj);
32232 0 : PyObject *py_user_handle;
32233 0 : if (object->out.user_handle == NULL) {
32234 0 : Py_RETURN_NONE;
32235 : }
32236 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle);
32237 0 : return py_user_handle;
32238 : }
32239 :
32240 0 : static int py_samr_DeleteUser_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
32241 : {
32242 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32243 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle));
32244 0 : if (value == NULL) {
32245 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle");
32246 0 : return -1;
32247 : }
32248 0 : object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle);
32249 0 : if (object->out.user_handle == NULL) {
32250 0 : PyErr_NoMemory();
32251 0 : return -1;
32252 : }
32253 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32254 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32255 0 : PyErr_NoMemory();
32256 0 : return -1;
32257 : }
32258 0 : object->out.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
32259 0 : return 0;
32260 : }
32261 :
32262 0 : static PyObject *py_samr_DeleteUser_get_result(PyObject *obj, void *closure)
32263 : {
32264 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(obj);
32265 0 : PyObject *py_result;
32266 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32267 0 : return py_result;
32268 : }
32269 :
32270 0 : static int py_samr_DeleteUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
32271 : {
32272 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32273 0 : if (value == NULL) {
32274 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32275 0 : return -1;
32276 : }
32277 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32278 0 : return 0;
32279 : }
32280 :
32281 : static PyGetSetDef py_samr_DeleteUser_getsetters[] = {
32282 : {
32283 : .name = discard_const_p(char, "in_user_handle"),
32284 : .get = py_samr_DeleteUser_in_get_user_handle,
32285 : .set = py_samr_DeleteUser_in_set_user_handle,
32286 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32287 : },
32288 : {
32289 : .name = discard_const_p(char, "out_user_handle"),
32290 : .get = py_samr_DeleteUser_out_get_user_handle,
32291 : .set = py_samr_DeleteUser_out_set_user_handle,
32292 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32293 : },
32294 : {
32295 : .name = discard_const_p(char, "result"),
32296 : .get = py_samr_DeleteUser_get_result,
32297 : .set = py_samr_DeleteUser_set_result,
32298 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32299 : },
32300 : { .name = NULL }
32301 : };
32302 :
32303 0 : static PyObject *py_samr_DeleteUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32304 : {
32305 0 : PyObject *self = pytalloc_new(struct samr_DeleteUser, type);
32306 0 : struct samr_DeleteUser *_self = (struct samr_DeleteUser *)pytalloc_get_ptr(self);
32307 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32308 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
32309 0 : _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
32310 0 : return self;
32311 : }
32312 :
32313 0 : static PyObject *py_samr_DeleteUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32314 : {
32315 :
32316 :
32317 0 : return PyLong_FromLong(35);
32318 : }
32319 :
32320 0 : static PyObject *py_samr_DeleteUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32321 : {
32322 0 : const struct ndr_interface_call *call = NULL;
32323 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32324 0 : PyObject *ret = NULL;
32325 0 : struct ndr_push *push = NULL;
32326 0 : DATA_BLOB blob;
32327 0 : enum ndr_err_code err;
32328 :
32329 0 : if (ndr_table_samr.num_calls < 36) {
32330 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_pack");
32331 0 : return NULL;
32332 : }
32333 0 : call = &ndr_table_samr.calls[35];
32334 :
32335 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32336 0 : if (push == NULL) {
32337 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32338 0 : return NULL;
32339 : }
32340 :
32341 0 : push->flags |= ndr_push_flags;
32342 :
32343 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32344 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32345 0 : TALLOC_FREE(push);
32346 0 : PyErr_SetNdrError(err);
32347 0 : return NULL;
32348 : }
32349 0 : blob = ndr_push_blob(push);
32350 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32351 0 : TALLOC_FREE(push);
32352 0 : return ret;
32353 : }
32354 :
32355 0 : static PyObject *py_samr_DeleteUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32356 : {
32357 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32358 0 : PyObject *bigendian_obj = NULL;
32359 0 : PyObject *ndr64_obj = NULL;
32360 0 : libndr_flags ndr_push_flags = 0;
32361 :
32362 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32363 : discard_const_p(char *, kwnames),
32364 : &bigendian_obj,
32365 : &ndr64_obj)) {
32366 0 : return NULL;
32367 : }
32368 :
32369 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32370 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32371 : }
32372 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32373 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32374 : }
32375 :
32376 0 : return py_samr_DeleteUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32377 : }
32378 :
32379 0 : static PyObject *py_samr_DeleteUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32380 : {
32381 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32382 0 : PyObject *bigendian_obj = NULL;
32383 0 : PyObject *ndr64_obj = NULL;
32384 0 : libndr_flags ndr_push_flags = 0;
32385 :
32386 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32387 : discard_const_p(char *, kwnames),
32388 : &bigendian_obj,
32389 : &ndr64_obj)) {
32390 0 : return NULL;
32391 : }
32392 :
32393 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32394 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32395 : }
32396 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32397 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32398 : }
32399 :
32400 0 : return py_samr_DeleteUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32401 : }
32402 :
32403 0 : static PyObject *py_samr_DeleteUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
32404 : {
32405 0 : const struct ndr_interface_call *call = NULL;
32406 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32407 0 : struct ndr_pull *pull = NULL;
32408 0 : enum ndr_err_code err;
32409 :
32410 0 : if (ndr_table_samr.num_calls < 36) {
32411 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_unpack");
32412 0 : return NULL;
32413 : }
32414 0 : call = &ndr_table_samr.calls[35];
32415 :
32416 0 : pull = ndr_pull_init_blob(blob, object);
32417 0 : if (pull == NULL) {
32418 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32419 0 : return NULL;
32420 : }
32421 :
32422 0 : pull->flags |= ndr_pull_flags;
32423 :
32424 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32425 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32426 0 : TALLOC_FREE(pull);
32427 0 : PyErr_SetNdrError(err);
32428 0 : return NULL;
32429 : }
32430 0 : if (!allow_remaining) {
32431 0 : uint32_t highest_ofs;
32432 :
32433 0 : if (pull->offset > pull->relative_highest_offset) {
32434 0 : highest_ofs = pull->offset;
32435 : } else {
32436 0 : highest_ofs = pull->relative_highest_offset;
32437 : }
32438 0 : if (highest_ofs < pull->data_size) {
32439 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32440 : "not all bytes consumed ofs[%u] size[%u]",
32441 : highest_ofs, pull->data_size);
32442 0 : TALLOC_FREE(pull);
32443 0 : PyErr_SetNdrError(err);
32444 0 : return NULL;
32445 : }
32446 : }
32447 :
32448 0 : TALLOC_FREE(pull);
32449 0 : Py_RETURN_NONE;
32450 : }
32451 :
32452 0 : static PyObject *py_samr_DeleteUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32453 : {
32454 0 : DATA_BLOB blob;
32455 0 : Py_ssize_t blob_length = 0;
32456 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32457 0 : PyObject *bigendian_obj = NULL;
32458 0 : PyObject *ndr64_obj = NULL;
32459 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32460 0 : PyObject *allow_remaining_obj = NULL;
32461 0 : bool allow_remaining = false;
32462 :
32463 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32464 : discard_const_p(char *, kwnames),
32465 : &blob.data, &blob_length,
32466 : &bigendian_obj,
32467 : &ndr64_obj,
32468 : &allow_remaining_obj)) {
32469 0 : return NULL;
32470 : }
32471 0 : blob.length = blob_length;
32472 :
32473 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32474 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32475 : }
32476 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32477 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32478 : }
32479 :
32480 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32481 0 : allow_remaining = true;
32482 : }
32483 :
32484 0 : return py_samr_DeleteUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32485 : }
32486 :
32487 0 : static PyObject *py_samr_DeleteUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32488 : {
32489 0 : DATA_BLOB blob;
32490 0 : Py_ssize_t blob_length = 0;
32491 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32492 0 : PyObject *bigendian_obj = NULL;
32493 0 : PyObject *ndr64_obj = NULL;
32494 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32495 0 : PyObject *allow_remaining_obj = NULL;
32496 0 : bool allow_remaining = false;
32497 :
32498 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32499 : discard_const_p(char *, kwnames),
32500 : &blob.data, &blob_length,
32501 : &bigendian_obj,
32502 : &ndr64_obj,
32503 : &allow_remaining_obj)) {
32504 0 : return NULL;
32505 : }
32506 0 : blob.length = blob_length;
32507 :
32508 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32509 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32510 : }
32511 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32512 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32513 : }
32514 :
32515 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32516 0 : allow_remaining = true;
32517 : }
32518 :
32519 0 : return py_samr_DeleteUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
32520 : }
32521 :
32522 0 : static PyObject *py_samr_DeleteUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
32523 : {
32524 0 : const struct ndr_interface_call *call = NULL;
32525 0 : struct samr_DeleteUser *object = (struct samr_DeleteUser *)pytalloc_get_ptr(py_obj);
32526 0 : PyObject *ret;
32527 0 : char *retstr;
32528 :
32529 0 : if (ndr_table_samr.num_calls < 36) {
32530 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_DeleteUser_ndr_print");
32531 0 : return NULL;
32532 : }
32533 0 : call = &ndr_table_samr.calls[35];
32534 :
32535 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
32536 0 : ret = PyUnicode_FromString(retstr);
32537 0 : TALLOC_FREE(retstr);
32538 :
32539 0 : return ret;
32540 : }
32541 :
32542 0 : static PyObject *py_samr_DeleteUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32543 : {
32544 0 : return py_samr_DeleteUser_ndr_print(py_obj, "samr_DeleteUser_in", NDR_IN);
32545 : }
32546 :
32547 0 : static PyObject *py_samr_DeleteUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
32548 : {
32549 0 : return py_samr_DeleteUser_ndr_print(py_obj, "samr_DeleteUser_out", NDR_OUT);
32550 : }
32551 :
32552 : static PyMethodDef py_samr_DeleteUser_methods[] = {
32553 : { "opnum", (PyCFunction)py_samr_DeleteUser_ndr_opnum, METH_NOARGS|METH_CLASS,
32554 : "samr.DeleteUser.opnum() -> 35 (0x23) " },
32555 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
32556 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
32557 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
32558 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
32559 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
32560 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
32561 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_DeleteUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
32562 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
32563 : { "__ndr_print_in__", (PyCFunction)py_samr_DeleteUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
32564 : { "__ndr_print_out__", (PyCFunction)py_samr_DeleteUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
32565 : { NULL, NULL, 0, NULL }
32566 : };
32567 :
32568 :
32569 : static PyTypeObject samr_DeleteUser_Type = {
32570 : PyVarObject_HEAD_INIT(NULL, 0)
32571 : .tp_name = "samr.DeleteUser",
32572 : .tp_getset = py_samr_DeleteUser_getsetters,
32573 : .tp_methods = py_samr_DeleteUser_methods,
32574 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
32575 : .tp_new = py_samr_DeleteUser_new,
32576 : };
32577 :
32578 0 : static bool pack_py_samr_DeleteUser_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteUser *r)
32579 : {
32580 0 : PyObject *py_user_handle;
32581 0 : const char *kwnames[] = {
32582 : "user_handle", NULL
32583 : };
32584 :
32585 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteUser", discard_const_p(char *, kwnames), &py_user_handle)) {
32586 0 : return false;
32587 : }
32588 :
32589 0 : if (py_user_handle == NULL) {
32590 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
32591 0 : return false;
32592 : }
32593 0 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
32594 0 : if (r->in.user_handle == NULL) {
32595 0 : PyErr_NoMemory();
32596 0 : return false;
32597 : }
32598 0 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
32599 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
32600 0 : PyErr_NoMemory();
32601 0 : return false;
32602 : }
32603 0 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
32604 0 : return true;
32605 : }
32606 :
32607 0 : static PyObject *unpack_py_samr_DeleteUser_args_out(struct samr_DeleteUser *r)
32608 : {
32609 0 : PyObject *result;
32610 0 : PyObject *py_user_handle;
32611 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
32612 0 : result = py_user_handle;
32613 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
32614 0 : PyErr_SetNTSTATUS(r->out.result);
32615 0 : return NULL;
32616 : }
32617 :
32618 0 : return result;
32619 : }
32620 :
32621 :
32622 0 : static PyObject *py_samr_QueryUserInfo_in_get_user_handle(PyObject *obj, void *closure)
32623 : {
32624 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj);
32625 0 : PyObject *py_user_handle;
32626 0 : if (object->in.user_handle == NULL) {
32627 0 : Py_RETURN_NONE;
32628 : }
32629 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
32630 0 : return py_user_handle;
32631 : }
32632 :
32633 0 : static int py_samr_QueryUserInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
32634 : {
32635 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32636 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
32637 0 : if (value == NULL) {
32638 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
32639 0 : return -1;
32640 : }
32641 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
32642 0 : if (object->in.user_handle == NULL) {
32643 0 : PyErr_NoMemory();
32644 0 : return -1;
32645 : }
32646 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
32647 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
32648 0 : PyErr_NoMemory();
32649 0 : return -1;
32650 : }
32651 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
32652 0 : return 0;
32653 : }
32654 :
32655 0 : static PyObject *py_samr_QueryUserInfo_in_get_level(PyObject *obj, void *closure)
32656 : {
32657 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj);
32658 0 : PyObject *py_level;
32659 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
32660 0 : return py_level;
32661 : }
32662 :
32663 0 : static int py_samr_QueryUserInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
32664 : {
32665 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32666 0 : if (value == NULL) {
32667 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
32668 0 : return -1;
32669 : }
32670 : {
32671 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
32672 0 : if (PyLong_Check(value)) {
32673 0 : unsigned long long test_var;
32674 0 : test_var = PyLong_AsUnsignedLongLong(value);
32675 0 : if (PyErr_Occurred() != NULL) {
32676 0 : return -1;
32677 : }
32678 0 : if (test_var > uint_max) {
32679 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
32680 : PyLong_Type.tp_name, uint_max, test_var);
32681 0 : return -1;
32682 : }
32683 0 : object->in.level = test_var;
32684 : } else {
32685 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
32686 : PyLong_Type.tp_name);
32687 0 : return -1;
32688 : }
32689 : }
32690 0 : return 0;
32691 : }
32692 :
32693 0 : static PyObject *py_samr_QueryUserInfo_out_get_info(PyObject *obj, void *closure)
32694 : {
32695 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj);
32696 0 : PyObject *py_info;
32697 0 : if (object->out.info == NULL) {
32698 0 : Py_RETURN_NONE;
32699 : }
32700 0 : if (*object->out.info == NULL) {
32701 0 : py_info = Py_None;
32702 0 : Py_INCREF(py_info);
32703 : } else {
32704 0 : py_info = pyrpc_import_union(&samr_UserInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_UserInfo");
32705 0 : if (py_info == NULL) {
32706 0 : return NULL;
32707 : }
32708 : }
32709 0 : return py_info;
32710 : }
32711 :
32712 0 : static int py_samr_QueryUserInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
32713 : {
32714 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32715 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
32716 0 : if (value == NULL) {
32717 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
32718 0 : return -1;
32719 : }
32720 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
32721 0 : if (object->out.info == NULL) {
32722 0 : PyErr_NoMemory();
32723 0 : return -1;
32724 : }
32725 0 : if (value == Py_None) {
32726 0 : *object->out.info = NULL;
32727 : } else {
32728 0 : *object->out.info = NULL;
32729 : {
32730 0 : union samr_UserInfo *info_switch_2;
32731 0 : info_switch_2 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo");
32732 0 : if (info_switch_2 == NULL) {
32733 0 : return -1;
32734 : }
32735 0 : *object->out.info = info_switch_2;
32736 : }
32737 : }
32738 0 : return 0;
32739 : }
32740 :
32741 0 : static PyObject *py_samr_QueryUserInfo_get_result(PyObject *obj, void *closure)
32742 : {
32743 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(obj);
32744 0 : PyObject *py_result;
32745 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
32746 0 : return py_result;
32747 : }
32748 :
32749 0 : static int py_samr_QueryUserInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
32750 : {
32751 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32752 0 : if (value == NULL) {
32753 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
32754 0 : return -1;
32755 : }
32756 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
32757 0 : return 0;
32758 : }
32759 :
32760 : static PyGetSetDef py_samr_QueryUserInfo_getsetters[] = {
32761 : {
32762 : .name = discard_const_p(char, "in_user_handle"),
32763 : .get = py_samr_QueryUserInfo_in_get_user_handle,
32764 : .set = py_samr_QueryUserInfo_in_set_user_handle,
32765 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
32766 : },
32767 : {
32768 : .name = discard_const_p(char, "in_level"),
32769 : .get = py_samr_QueryUserInfo_in_get_level,
32770 : .set = py_samr_QueryUserInfo_in_set_level,
32771 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel")
32772 : },
32773 : {
32774 : .name = discard_const_p(char, "out_info"),
32775 : .get = py_samr_QueryUserInfo_out_get_info,
32776 : .set = py_samr_QueryUserInfo_out_set_info,
32777 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo")
32778 : },
32779 : {
32780 : .name = discard_const_p(char, "result"),
32781 : .get = py_samr_QueryUserInfo_get_result,
32782 : .set = py_samr_QueryUserInfo_set_result,
32783 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
32784 : },
32785 : { .name = NULL }
32786 : };
32787 :
32788 0 : static PyObject *py_samr_QueryUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
32789 : {
32790 0 : PyObject *self = pytalloc_new(struct samr_QueryUserInfo, type);
32791 0 : struct samr_QueryUserInfo *_self = (struct samr_QueryUserInfo *)pytalloc_get_ptr(self);
32792 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
32793 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
32794 : /* a pointer to a NULL pointer */
32795 0 : _self->out.info = talloc_zero(mem_ctx, union samr_UserInfo *);
32796 0 : return self;
32797 : }
32798 :
32799 0 : static PyObject *py_samr_QueryUserInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
32800 : {
32801 :
32802 :
32803 0 : return PyLong_FromLong(36);
32804 : }
32805 :
32806 0 : static PyObject *py_samr_QueryUserInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
32807 : {
32808 0 : const struct ndr_interface_call *call = NULL;
32809 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32810 0 : PyObject *ret = NULL;
32811 0 : struct ndr_push *push = NULL;
32812 0 : DATA_BLOB blob;
32813 0 : enum ndr_err_code err;
32814 :
32815 0 : if (ndr_table_samr.num_calls < 37) {
32816 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_pack");
32817 0 : return NULL;
32818 : }
32819 0 : call = &ndr_table_samr.calls[36];
32820 :
32821 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
32822 0 : if (push == NULL) {
32823 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32824 0 : return NULL;
32825 : }
32826 :
32827 0 : push->flags |= ndr_push_flags;
32828 :
32829 0 : err = call->ndr_push(push, ndr_inout_flags, object);
32830 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32831 0 : TALLOC_FREE(push);
32832 0 : PyErr_SetNdrError(err);
32833 0 : return NULL;
32834 : }
32835 0 : blob = ndr_push_blob(push);
32836 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
32837 0 : TALLOC_FREE(push);
32838 0 : return ret;
32839 : }
32840 :
32841 0 : static PyObject *py_samr_QueryUserInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32842 : {
32843 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32844 0 : PyObject *bigendian_obj = NULL;
32845 0 : PyObject *ndr64_obj = NULL;
32846 0 : libndr_flags ndr_push_flags = 0;
32847 :
32848 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
32849 : discard_const_p(char *, kwnames),
32850 : &bigendian_obj,
32851 : &ndr64_obj)) {
32852 0 : return NULL;
32853 : }
32854 :
32855 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32856 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32857 : }
32858 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32859 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32860 : }
32861 :
32862 0 : return py_samr_QueryUserInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
32863 : }
32864 :
32865 0 : static PyObject *py_samr_QueryUserInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32866 : {
32867 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
32868 0 : PyObject *bigendian_obj = NULL;
32869 0 : PyObject *ndr64_obj = NULL;
32870 0 : libndr_flags ndr_push_flags = 0;
32871 :
32872 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
32873 : discard_const_p(char *, kwnames),
32874 : &bigendian_obj,
32875 : &ndr64_obj)) {
32876 0 : return NULL;
32877 : }
32878 :
32879 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32880 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
32881 : }
32882 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32883 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
32884 : }
32885 :
32886 0 : return py_samr_QueryUserInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
32887 : }
32888 :
32889 0 : static PyObject *py_samr_QueryUserInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
32890 : {
32891 0 : const struct ndr_interface_call *call = NULL;
32892 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
32893 0 : struct ndr_pull *pull = NULL;
32894 0 : enum ndr_err_code err;
32895 :
32896 0 : if (ndr_table_samr.num_calls < 37) {
32897 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_unpack");
32898 0 : return NULL;
32899 : }
32900 0 : call = &ndr_table_samr.calls[36];
32901 :
32902 0 : pull = ndr_pull_init_blob(blob, object);
32903 0 : if (pull == NULL) {
32904 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
32905 0 : return NULL;
32906 : }
32907 :
32908 0 : pull->flags |= ndr_pull_flags;
32909 :
32910 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
32911 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
32912 0 : TALLOC_FREE(pull);
32913 0 : PyErr_SetNdrError(err);
32914 0 : return NULL;
32915 : }
32916 0 : if (!allow_remaining) {
32917 0 : uint32_t highest_ofs;
32918 :
32919 0 : if (pull->offset > pull->relative_highest_offset) {
32920 0 : highest_ofs = pull->offset;
32921 : } else {
32922 0 : highest_ofs = pull->relative_highest_offset;
32923 : }
32924 0 : if (highest_ofs < pull->data_size) {
32925 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
32926 : "not all bytes consumed ofs[%u] size[%u]",
32927 : highest_ofs, pull->data_size);
32928 0 : TALLOC_FREE(pull);
32929 0 : PyErr_SetNdrError(err);
32930 0 : return NULL;
32931 : }
32932 : }
32933 :
32934 0 : TALLOC_FREE(pull);
32935 0 : Py_RETURN_NONE;
32936 : }
32937 :
32938 0 : static PyObject *py_samr_QueryUserInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32939 : {
32940 0 : DATA_BLOB blob;
32941 0 : Py_ssize_t blob_length = 0;
32942 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32943 0 : PyObject *bigendian_obj = NULL;
32944 0 : PyObject *ndr64_obj = NULL;
32945 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32946 0 : PyObject *allow_remaining_obj = NULL;
32947 0 : bool allow_remaining = false;
32948 :
32949 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
32950 : discard_const_p(char *, kwnames),
32951 : &blob.data, &blob_length,
32952 : &bigendian_obj,
32953 : &ndr64_obj,
32954 : &allow_remaining_obj)) {
32955 0 : return NULL;
32956 : }
32957 0 : blob.length = blob_length;
32958 :
32959 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32960 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32961 : }
32962 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32963 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32964 : }
32965 :
32966 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
32967 0 : allow_remaining = true;
32968 : }
32969 :
32970 0 : return py_samr_QueryUserInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
32971 : }
32972 :
32973 0 : static PyObject *py_samr_QueryUserInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
32974 : {
32975 0 : DATA_BLOB blob;
32976 0 : Py_ssize_t blob_length = 0;
32977 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
32978 0 : PyObject *bigendian_obj = NULL;
32979 0 : PyObject *ndr64_obj = NULL;
32980 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
32981 0 : PyObject *allow_remaining_obj = NULL;
32982 0 : bool allow_remaining = false;
32983 :
32984 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
32985 : discard_const_p(char *, kwnames),
32986 : &blob.data, &blob_length,
32987 : &bigendian_obj,
32988 : &ndr64_obj,
32989 : &allow_remaining_obj)) {
32990 0 : return NULL;
32991 : }
32992 0 : blob.length = blob_length;
32993 :
32994 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
32995 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
32996 : }
32997 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
32998 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
32999 : }
33000 :
33001 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33002 0 : allow_remaining = true;
33003 : }
33004 :
33005 0 : return py_samr_QueryUserInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33006 : }
33007 :
33008 0 : static PyObject *py_samr_QueryUserInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33009 : {
33010 0 : const struct ndr_interface_call *call = NULL;
33011 0 : struct samr_QueryUserInfo *object = (struct samr_QueryUserInfo *)pytalloc_get_ptr(py_obj);
33012 0 : PyObject *ret;
33013 0 : char *retstr;
33014 :
33015 0 : if (ndr_table_samr.num_calls < 37) {
33016 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo_ndr_print");
33017 0 : return NULL;
33018 : }
33019 0 : call = &ndr_table_samr.calls[36];
33020 :
33021 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33022 0 : ret = PyUnicode_FromString(retstr);
33023 0 : TALLOC_FREE(retstr);
33024 :
33025 0 : return ret;
33026 : }
33027 :
33028 0 : static PyObject *py_samr_QueryUserInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33029 : {
33030 0 : return py_samr_QueryUserInfo_ndr_print(py_obj, "samr_QueryUserInfo_in", NDR_IN);
33031 : }
33032 :
33033 0 : static PyObject *py_samr_QueryUserInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33034 : {
33035 0 : return py_samr_QueryUserInfo_ndr_print(py_obj, "samr_QueryUserInfo_out", NDR_OUT);
33036 : }
33037 :
33038 : static PyMethodDef py_samr_QueryUserInfo_methods[] = {
33039 : { "opnum", (PyCFunction)py_samr_QueryUserInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
33040 : "samr.QueryUserInfo.opnum() -> 36 (0x24) " },
33041 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33042 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33043 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33044 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33045 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33046 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33047 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33048 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33049 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryUserInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33050 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryUserInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33051 : { NULL, NULL, 0, NULL }
33052 : };
33053 :
33054 :
33055 : static PyTypeObject samr_QueryUserInfo_Type = {
33056 : PyVarObject_HEAD_INIT(NULL, 0)
33057 : .tp_name = "samr.QueryUserInfo",
33058 : .tp_getset = py_samr_QueryUserInfo_getsetters,
33059 : .tp_methods = py_samr_QueryUserInfo_methods,
33060 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33061 : .tp_new = py_samr_QueryUserInfo_new,
33062 : };
33063 :
33064 3278 : static bool pack_py_samr_QueryUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo *r)
33065 : {
33066 0 : PyObject *py_user_handle;
33067 0 : PyObject *py_level;
33068 3278 : const char *kwnames[] = {
33069 : "user_handle", "level", NULL
33070 : };
33071 :
33072 3278 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
33073 0 : return false;
33074 : }
33075 :
33076 3278 : if (py_user_handle == NULL) {
33077 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
33078 0 : return false;
33079 : }
33080 3278 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
33081 3278 : if (r->in.user_handle == NULL) {
33082 0 : PyErr_NoMemory();
33083 0 : return false;
33084 : }
33085 3278 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
33086 3278 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
33087 0 : PyErr_NoMemory();
33088 0 : return false;
33089 : }
33090 3278 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
33091 3278 : if (py_level == NULL) {
33092 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
33093 0 : return false;
33094 : }
33095 : {
33096 3278 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
33097 3278 : if (PyLong_Check(py_level)) {
33098 0 : unsigned long long test_var;
33099 3278 : test_var = PyLong_AsUnsignedLongLong(py_level);
33100 3278 : if (PyErr_Occurred() != NULL) {
33101 0 : return false;
33102 : }
33103 3278 : if (test_var > uint_max) {
33104 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33105 : PyLong_Type.tp_name, uint_max, test_var);
33106 0 : return false;
33107 : }
33108 3278 : r->in.level = test_var;
33109 : } else {
33110 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33111 : PyLong_Type.tp_name);
33112 0 : return false;
33113 : }
33114 : }
33115 3278 : return true;
33116 : }
33117 :
33118 3278 : static PyObject *unpack_py_samr_QueryUserInfo_args_out(struct samr_QueryUserInfo *r)
33119 : {
33120 0 : PyObject *result;
33121 0 : PyObject *py_info;
33122 3278 : if (*r->out.info == NULL) {
33123 0 : py_info = Py_None;
33124 0 : Py_INCREF(py_info);
33125 : } else {
33126 3278 : py_info = pyrpc_import_union(&samr_UserInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_UserInfo");
33127 3278 : if (py_info == NULL) {
33128 0 : return NULL;
33129 : }
33130 : }
33131 3278 : result = py_info;
33132 3278 : if (NT_STATUS_IS_ERR(r->out.result)) {
33133 0 : PyErr_SetNTSTATUS(r->out.result);
33134 0 : return NULL;
33135 : }
33136 :
33137 3278 : return result;
33138 : }
33139 :
33140 :
33141 0 : static PyObject *py_samr_SetUserInfo_in_get_user_handle(PyObject *obj, void *closure)
33142 : {
33143 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj);
33144 0 : PyObject *py_user_handle;
33145 0 : if (object->in.user_handle == NULL) {
33146 0 : Py_RETURN_NONE;
33147 : }
33148 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
33149 0 : return py_user_handle;
33150 : }
33151 :
33152 0 : static int py_samr_SetUserInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
33153 : {
33154 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33155 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
33156 0 : if (value == NULL) {
33157 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
33158 0 : return -1;
33159 : }
33160 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
33161 0 : if (object->in.user_handle == NULL) {
33162 0 : PyErr_NoMemory();
33163 0 : return -1;
33164 : }
33165 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33166 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33167 0 : PyErr_NoMemory();
33168 0 : return -1;
33169 : }
33170 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
33171 0 : return 0;
33172 : }
33173 :
33174 0 : static PyObject *py_samr_SetUserInfo_in_get_level(PyObject *obj, void *closure)
33175 : {
33176 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj);
33177 0 : PyObject *py_level;
33178 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
33179 0 : return py_level;
33180 : }
33181 :
33182 0 : static int py_samr_SetUserInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
33183 : {
33184 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33185 0 : if (value == NULL) {
33186 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
33187 0 : return -1;
33188 : }
33189 : {
33190 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
33191 0 : if (PyLong_Check(value)) {
33192 0 : unsigned long long test_var;
33193 0 : test_var = PyLong_AsUnsignedLongLong(value);
33194 0 : if (PyErr_Occurred() != NULL) {
33195 0 : return -1;
33196 : }
33197 0 : if (test_var > uint_max) {
33198 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33199 : PyLong_Type.tp_name, uint_max, test_var);
33200 0 : return -1;
33201 : }
33202 0 : object->in.level = test_var;
33203 : } else {
33204 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33205 : PyLong_Type.tp_name);
33206 0 : return -1;
33207 : }
33208 : }
33209 0 : return 0;
33210 : }
33211 :
33212 0 : static PyObject *py_samr_SetUserInfo_in_get_info(PyObject *obj, void *closure)
33213 : {
33214 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj);
33215 0 : PyObject *py_info;
33216 0 : if (object->in.info == NULL) {
33217 0 : Py_RETURN_NONE;
33218 : }
33219 0 : py_info = pyrpc_import_union(&samr_UserInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_UserInfo");
33220 0 : if (py_info == NULL) {
33221 0 : return NULL;
33222 : }
33223 0 : return py_info;
33224 : }
33225 :
33226 0 : static int py_samr_SetUserInfo_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
33227 : {
33228 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33229 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
33230 0 : if (value == NULL) {
33231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
33232 0 : return -1;
33233 : }
33234 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
33235 0 : if (object->in.info == NULL) {
33236 0 : PyErr_NoMemory();
33237 0 : return -1;
33238 : }
33239 : {
33240 0 : union samr_UserInfo *info_switch_1;
33241 0 : info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo");
33242 0 : if (info_switch_1 == NULL) {
33243 0 : return -1;
33244 : }
33245 0 : object->in.info = info_switch_1;
33246 : }
33247 0 : return 0;
33248 : }
33249 :
33250 0 : static PyObject *py_samr_SetUserInfo_get_result(PyObject *obj, void *closure)
33251 : {
33252 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(obj);
33253 0 : PyObject *py_result;
33254 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
33255 0 : return py_result;
33256 : }
33257 :
33258 0 : static int py_samr_SetUserInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
33259 : {
33260 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33261 0 : if (value == NULL) {
33262 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
33263 0 : return -1;
33264 : }
33265 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
33266 0 : return 0;
33267 : }
33268 :
33269 : static PyGetSetDef py_samr_SetUserInfo_getsetters[] = {
33270 : {
33271 : .name = discard_const_p(char, "in_user_handle"),
33272 : .get = py_samr_SetUserInfo_in_get_user_handle,
33273 : .set = py_samr_SetUserInfo_in_set_user_handle,
33274 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
33275 : },
33276 : {
33277 : .name = discard_const_p(char, "in_level"),
33278 : .get = py_samr_SetUserInfo_in_get_level,
33279 : .set = py_samr_SetUserInfo_in_set_level,
33280 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel")
33281 : },
33282 : {
33283 : .name = discard_const_p(char, "in_info"),
33284 : .get = py_samr_SetUserInfo_in_get_info,
33285 : .set = py_samr_SetUserInfo_in_set_info,
33286 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo")
33287 : },
33288 : {
33289 : .name = discard_const_p(char, "result"),
33290 : .get = py_samr_SetUserInfo_get_result,
33291 : .set = py_samr_SetUserInfo_set_result,
33292 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
33293 : },
33294 : { .name = NULL }
33295 : };
33296 :
33297 0 : static PyObject *py_samr_SetUserInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
33298 : {
33299 0 : PyObject *self = pytalloc_new(struct samr_SetUserInfo, type);
33300 0 : struct samr_SetUserInfo *_self = (struct samr_SetUserInfo *)pytalloc_get_ptr(self);
33301 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
33302 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
33303 0 : _self->in.info = talloc_zero(mem_ctx, union samr_UserInfo);
33304 0 : return self;
33305 : }
33306 :
33307 0 : static PyObject *py_samr_SetUserInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
33308 : {
33309 :
33310 :
33311 0 : return PyLong_FromLong(37);
33312 : }
33313 :
33314 0 : static PyObject *py_samr_SetUserInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
33315 : {
33316 0 : const struct ndr_interface_call *call = NULL;
33317 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33318 0 : PyObject *ret = NULL;
33319 0 : struct ndr_push *push = NULL;
33320 0 : DATA_BLOB blob;
33321 0 : enum ndr_err_code err;
33322 :
33323 0 : if (ndr_table_samr.num_calls < 38) {
33324 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_pack");
33325 0 : return NULL;
33326 : }
33327 0 : call = &ndr_table_samr.calls[37];
33328 :
33329 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
33330 0 : if (push == NULL) {
33331 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33332 0 : return NULL;
33333 : }
33334 :
33335 0 : push->flags |= ndr_push_flags;
33336 :
33337 0 : err = call->ndr_push(push, ndr_inout_flags, object);
33338 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33339 0 : TALLOC_FREE(push);
33340 0 : PyErr_SetNdrError(err);
33341 0 : return NULL;
33342 : }
33343 0 : blob = ndr_push_blob(push);
33344 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
33345 0 : TALLOC_FREE(push);
33346 0 : return ret;
33347 : }
33348 :
33349 0 : static PyObject *py_samr_SetUserInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33350 : {
33351 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33352 0 : PyObject *bigendian_obj = NULL;
33353 0 : PyObject *ndr64_obj = NULL;
33354 0 : libndr_flags ndr_push_flags = 0;
33355 :
33356 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
33357 : discard_const_p(char *, kwnames),
33358 : &bigendian_obj,
33359 : &ndr64_obj)) {
33360 0 : return NULL;
33361 : }
33362 :
33363 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33364 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33365 : }
33366 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33367 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33368 : }
33369 :
33370 0 : return py_samr_SetUserInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
33371 : }
33372 :
33373 0 : static PyObject *py_samr_SetUserInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33374 : {
33375 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
33376 0 : PyObject *bigendian_obj = NULL;
33377 0 : PyObject *ndr64_obj = NULL;
33378 0 : libndr_flags ndr_push_flags = 0;
33379 :
33380 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
33381 : discard_const_p(char *, kwnames),
33382 : &bigendian_obj,
33383 : &ndr64_obj)) {
33384 0 : return NULL;
33385 : }
33386 :
33387 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33388 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
33389 : }
33390 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33391 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
33392 : }
33393 :
33394 0 : return py_samr_SetUserInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
33395 : }
33396 :
33397 0 : static PyObject *py_samr_SetUserInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
33398 : {
33399 0 : const struct ndr_interface_call *call = NULL;
33400 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33401 0 : struct ndr_pull *pull = NULL;
33402 0 : enum ndr_err_code err;
33403 :
33404 0 : if (ndr_table_samr.num_calls < 38) {
33405 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_unpack");
33406 0 : return NULL;
33407 : }
33408 0 : call = &ndr_table_samr.calls[37];
33409 :
33410 0 : pull = ndr_pull_init_blob(blob, object);
33411 0 : if (pull == NULL) {
33412 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
33413 0 : return NULL;
33414 : }
33415 :
33416 0 : pull->flags |= ndr_pull_flags;
33417 :
33418 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
33419 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
33420 0 : TALLOC_FREE(pull);
33421 0 : PyErr_SetNdrError(err);
33422 0 : return NULL;
33423 : }
33424 0 : if (!allow_remaining) {
33425 0 : uint32_t highest_ofs;
33426 :
33427 0 : if (pull->offset > pull->relative_highest_offset) {
33428 0 : highest_ofs = pull->offset;
33429 : } else {
33430 0 : highest_ofs = pull->relative_highest_offset;
33431 : }
33432 0 : if (highest_ofs < pull->data_size) {
33433 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
33434 : "not all bytes consumed ofs[%u] size[%u]",
33435 : highest_ofs, pull->data_size);
33436 0 : TALLOC_FREE(pull);
33437 0 : PyErr_SetNdrError(err);
33438 0 : return NULL;
33439 : }
33440 : }
33441 :
33442 0 : TALLOC_FREE(pull);
33443 0 : Py_RETURN_NONE;
33444 : }
33445 :
33446 0 : static PyObject *py_samr_SetUserInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33447 : {
33448 0 : DATA_BLOB blob;
33449 0 : Py_ssize_t blob_length = 0;
33450 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33451 0 : PyObject *bigendian_obj = NULL;
33452 0 : PyObject *ndr64_obj = NULL;
33453 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33454 0 : PyObject *allow_remaining_obj = NULL;
33455 0 : bool allow_remaining = false;
33456 :
33457 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
33458 : discard_const_p(char *, kwnames),
33459 : &blob.data, &blob_length,
33460 : &bigendian_obj,
33461 : &ndr64_obj,
33462 : &allow_remaining_obj)) {
33463 0 : return NULL;
33464 : }
33465 0 : blob.length = blob_length;
33466 :
33467 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33468 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33469 : }
33470 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33471 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33472 : }
33473 :
33474 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33475 0 : allow_remaining = true;
33476 : }
33477 :
33478 0 : return py_samr_SetUserInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
33479 : }
33480 :
33481 0 : static PyObject *py_samr_SetUserInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
33482 : {
33483 0 : DATA_BLOB blob;
33484 0 : Py_ssize_t blob_length = 0;
33485 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
33486 0 : PyObject *bigendian_obj = NULL;
33487 0 : PyObject *ndr64_obj = NULL;
33488 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
33489 0 : PyObject *allow_remaining_obj = NULL;
33490 0 : bool allow_remaining = false;
33491 :
33492 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
33493 : discard_const_p(char *, kwnames),
33494 : &blob.data, &blob_length,
33495 : &bigendian_obj,
33496 : &ndr64_obj,
33497 : &allow_remaining_obj)) {
33498 0 : return NULL;
33499 : }
33500 0 : blob.length = blob_length;
33501 :
33502 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
33503 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
33504 : }
33505 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
33506 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
33507 : }
33508 :
33509 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
33510 0 : allow_remaining = true;
33511 : }
33512 :
33513 0 : return py_samr_SetUserInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
33514 : }
33515 :
33516 0 : static PyObject *py_samr_SetUserInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
33517 : {
33518 0 : const struct ndr_interface_call *call = NULL;
33519 0 : struct samr_SetUserInfo *object = (struct samr_SetUserInfo *)pytalloc_get_ptr(py_obj);
33520 0 : PyObject *ret;
33521 0 : char *retstr;
33522 :
33523 0 : if (ndr_table_samr.num_calls < 38) {
33524 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo_ndr_print");
33525 0 : return NULL;
33526 : }
33527 0 : call = &ndr_table_samr.calls[37];
33528 :
33529 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
33530 0 : ret = PyUnicode_FromString(retstr);
33531 0 : TALLOC_FREE(retstr);
33532 :
33533 0 : return ret;
33534 : }
33535 :
33536 0 : static PyObject *py_samr_SetUserInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33537 : {
33538 0 : return py_samr_SetUserInfo_ndr_print(py_obj, "samr_SetUserInfo_in", NDR_IN);
33539 : }
33540 :
33541 0 : static PyObject *py_samr_SetUserInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
33542 : {
33543 0 : return py_samr_SetUserInfo_ndr_print(py_obj, "samr_SetUserInfo_out", NDR_OUT);
33544 : }
33545 :
33546 : static PyMethodDef py_samr_SetUserInfo_methods[] = {
33547 : { "opnum", (PyCFunction)py_samr_SetUserInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
33548 : "samr.SetUserInfo.opnum() -> 37 (0x25) " },
33549 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
33550 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
33551 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
33552 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
33553 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
33554 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
33555 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
33556 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
33557 : { "__ndr_print_in__", (PyCFunction)py_samr_SetUserInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
33558 : { "__ndr_print_out__", (PyCFunction)py_samr_SetUserInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
33559 : { NULL, NULL, 0, NULL }
33560 : };
33561 :
33562 :
33563 : static PyTypeObject samr_SetUserInfo_Type = {
33564 : PyVarObject_HEAD_INIT(NULL, 0)
33565 : .tp_name = "samr.SetUserInfo",
33566 : .tp_getset = py_samr_SetUserInfo_getsetters,
33567 : .tp_methods = py_samr_SetUserInfo_methods,
33568 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
33569 : .tp_new = py_samr_SetUserInfo_new,
33570 : };
33571 :
33572 17 : static bool pack_py_samr_SetUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo *r)
33573 : {
33574 0 : PyObject *py_user_handle;
33575 0 : PyObject *py_level;
33576 0 : PyObject *py_info;
33577 17 : const char *kwnames[] = {
33578 : "user_handle", "level", "info", NULL
33579 : };
33580 :
33581 17 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
33582 0 : return false;
33583 : }
33584 :
33585 17 : if (py_user_handle == NULL) {
33586 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
33587 0 : return false;
33588 : }
33589 17 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
33590 17 : if (r->in.user_handle == NULL) {
33591 0 : PyErr_NoMemory();
33592 0 : return false;
33593 : }
33594 17 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
33595 17 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
33596 0 : PyErr_NoMemory();
33597 0 : return false;
33598 : }
33599 17 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
33600 17 : if (py_level == NULL) {
33601 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
33602 0 : return false;
33603 : }
33604 : {
33605 17 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
33606 17 : if (PyLong_Check(py_level)) {
33607 0 : unsigned long long test_var;
33608 17 : test_var = PyLong_AsUnsignedLongLong(py_level);
33609 17 : if (PyErr_Occurred() != NULL) {
33610 0 : return false;
33611 : }
33612 17 : if (test_var > uint_max) {
33613 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33614 : PyLong_Type.tp_name, uint_max, test_var);
33615 0 : return false;
33616 : }
33617 17 : r->in.level = test_var;
33618 : } else {
33619 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33620 : PyLong_Type.tp_name);
33621 0 : return false;
33622 : }
33623 : }
33624 17 : if (py_info == NULL) {
33625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
33626 0 : return false;
33627 : }
33628 17 : r->in.info = talloc_ptrtype(r, r->in.info);
33629 17 : if (r->in.info == NULL) {
33630 0 : PyErr_NoMemory();
33631 0 : return false;
33632 : }
33633 : {
33634 0 : union samr_UserInfo *info_switch_1;
33635 17 : info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, r, r->in.level, py_info, "union samr_UserInfo");
33636 17 : if (info_switch_1 == NULL) {
33637 0 : return false;
33638 : }
33639 17 : r->in.info = info_switch_1;
33640 : }
33641 17 : return true;
33642 : }
33643 :
33644 17 : static PyObject *unpack_py_samr_SetUserInfo_args_out(struct samr_SetUserInfo *r)
33645 : {
33646 0 : PyObject *result;
33647 17 : result = Py_None;
33648 17 : Py_INCREF(result);
33649 17 : if (NT_STATUS_IS_ERR(r->out.result)) {
33650 0 : PyErr_SetNTSTATUS(r->out.result);
33651 0 : return NULL;
33652 : }
33653 :
33654 17 : return result;
33655 : }
33656 :
33657 :
33658 0 : static PyObject *py_samr_ChangePasswordUser_in_get_user_handle(PyObject *obj, void *closure)
33659 : {
33660 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33661 0 : PyObject *py_user_handle;
33662 0 : if (object->in.user_handle == NULL) {
33663 0 : Py_RETURN_NONE;
33664 : }
33665 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
33666 0 : return py_user_handle;
33667 : }
33668 :
33669 0 : static int py_samr_ChangePasswordUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
33670 : {
33671 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33672 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
33673 0 : if (value == NULL) {
33674 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
33675 0 : return -1;
33676 : }
33677 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
33678 0 : if (object->in.user_handle == NULL) {
33679 0 : PyErr_NoMemory();
33680 0 : return -1;
33681 : }
33682 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
33683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33684 0 : PyErr_NoMemory();
33685 0 : return -1;
33686 : }
33687 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
33688 0 : return 0;
33689 : }
33690 :
33691 0 : static PyObject *py_samr_ChangePasswordUser_in_get_lm_present(PyObject *obj, void *closure)
33692 : {
33693 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33694 0 : PyObject *py_lm_present;
33695 0 : py_lm_present = PyLong_FromLong((uint16_t)object->in.lm_present);
33696 0 : return py_lm_present;
33697 : }
33698 :
33699 0 : static int py_samr_ChangePasswordUser_in_set_lm_present(PyObject *py_obj, PyObject *value, void *closure)
33700 : {
33701 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33702 0 : if (value == NULL) {
33703 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_present");
33704 0 : return -1;
33705 : }
33706 : {
33707 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_present));
33708 0 : if (PyLong_Check(value)) {
33709 0 : unsigned long long test_var;
33710 0 : test_var = PyLong_AsUnsignedLongLong(value);
33711 0 : if (PyErr_Occurred() != NULL) {
33712 0 : return -1;
33713 : }
33714 0 : if (test_var > uint_max) {
33715 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33716 : PyLong_Type.tp_name, uint_max, test_var);
33717 0 : return -1;
33718 : }
33719 0 : object->in.lm_present = test_var;
33720 : } else {
33721 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33722 : PyLong_Type.tp_name);
33723 0 : return -1;
33724 : }
33725 : }
33726 0 : return 0;
33727 : }
33728 :
33729 0 : static PyObject *py_samr_ChangePasswordUser_in_get_old_lm_crypted(PyObject *obj, void *closure)
33730 : {
33731 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33732 0 : PyObject *py_old_lm_crypted;
33733 0 : if (object->in.old_lm_crypted == NULL) {
33734 0 : Py_RETURN_NONE;
33735 : }
33736 0 : if (object->in.old_lm_crypted == NULL) {
33737 0 : py_old_lm_crypted = Py_None;
33738 0 : Py_INCREF(py_old_lm_crypted);
33739 : } else {
33740 0 : py_old_lm_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.old_lm_crypted, object->in.old_lm_crypted);
33741 : }
33742 0 : return py_old_lm_crypted;
33743 : }
33744 :
33745 0 : static int py_samr_ChangePasswordUser_in_set_old_lm_crypted(PyObject *py_obj, PyObject *value, void *closure)
33746 : {
33747 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33748 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_lm_crypted));
33749 0 : if (value == NULL) {
33750 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_lm_crypted");
33751 0 : return -1;
33752 : }
33753 0 : if (value == Py_None) {
33754 0 : object->in.old_lm_crypted = NULL;
33755 : } else {
33756 0 : object->in.old_lm_crypted = NULL;
33757 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
33758 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33759 0 : PyErr_NoMemory();
33760 0 : return -1;
33761 : }
33762 0 : object->in.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(value);
33763 : }
33764 0 : return 0;
33765 : }
33766 :
33767 0 : static PyObject *py_samr_ChangePasswordUser_in_get_new_lm_crypted(PyObject *obj, void *closure)
33768 : {
33769 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33770 0 : PyObject *py_new_lm_crypted;
33771 0 : if (object->in.new_lm_crypted == NULL) {
33772 0 : Py_RETURN_NONE;
33773 : }
33774 0 : if (object->in.new_lm_crypted == NULL) {
33775 0 : py_new_lm_crypted = Py_None;
33776 0 : Py_INCREF(py_new_lm_crypted);
33777 : } else {
33778 0 : py_new_lm_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.new_lm_crypted, object->in.new_lm_crypted);
33779 : }
33780 0 : return py_new_lm_crypted;
33781 : }
33782 :
33783 0 : static int py_samr_ChangePasswordUser_in_set_new_lm_crypted(PyObject *py_obj, PyObject *value, void *closure)
33784 : {
33785 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33786 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_lm_crypted));
33787 0 : if (value == NULL) {
33788 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_lm_crypted");
33789 0 : return -1;
33790 : }
33791 0 : if (value == Py_None) {
33792 0 : object->in.new_lm_crypted = NULL;
33793 : } else {
33794 0 : object->in.new_lm_crypted = NULL;
33795 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
33796 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33797 0 : PyErr_NoMemory();
33798 0 : return -1;
33799 : }
33800 0 : object->in.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(value);
33801 : }
33802 0 : return 0;
33803 : }
33804 :
33805 0 : static PyObject *py_samr_ChangePasswordUser_in_get_nt_present(PyObject *obj, void *closure)
33806 : {
33807 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33808 0 : PyObject *py_nt_present;
33809 0 : py_nt_present = PyLong_FromLong((uint16_t)object->in.nt_present);
33810 0 : return py_nt_present;
33811 : }
33812 :
33813 0 : static int py_samr_ChangePasswordUser_in_set_nt_present(PyObject *py_obj, PyObject *value, void *closure)
33814 : {
33815 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33816 0 : if (value == NULL) {
33817 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_present");
33818 0 : return -1;
33819 : }
33820 : {
33821 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.nt_present));
33822 0 : if (PyLong_Check(value)) {
33823 0 : unsigned long long test_var;
33824 0 : test_var = PyLong_AsUnsignedLongLong(value);
33825 0 : if (PyErr_Occurred() != NULL) {
33826 0 : return -1;
33827 : }
33828 0 : if (test_var > uint_max) {
33829 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33830 : PyLong_Type.tp_name, uint_max, test_var);
33831 0 : return -1;
33832 : }
33833 0 : object->in.nt_present = test_var;
33834 : } else {
33835 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33836 : PyLong_Type.tp_name);
33837 0 : return -1;
33838 : }
33839 : }
33840 0 : return 0;
33841 : }
33842 :
33843 0 : static PyObject *py_samr_ChangePasswordUser_in_get_old_nt_crypted(PyObject *obj, void *closure)
33844 : {
33845 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33846 0 : PyObject *py_old_nt_crypted;
33847 0 : if (object->in.old_nt_crypted == NULL) {
33848 0 : Py_RETURN_NONE;
33849 : }
33850 0 : if (object->in.old_nt_crypted == NULL) {
33851 0 : py_old_nt_crypted = Py_None;
33852 0 : Py_INCREF(py_old_nt_crypted);
33853 : } else {
33854 0 : py_old_nt_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.old_nt_crypted, object->in.old_nt_crypted);
33855 : }
33856 0 : return py_old_nt_crypted;
33857 : }
33858 :
33859 0 : static int py_samr_ChangePasswordUser_in_set_old_nt_crypted(PyObject *py_obj, PyObject *value, void *closure)
33860 : {
33861 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33862 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.old_nt_crypted));
33863 0 : if (value == NULL) {
33864 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.old_nt_crypted");
33865 0 : return -1;
33866 : }
33867 0 : if (value == Py_None) {
33868 0 : object->in.old_nt_crypted = NULL;
33869 : } else {
33870 0 : object->in.old_nt_crypted = NULL;
33871 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
33872 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33873 0 : PyErr_NoMemory();
33874 0 : return -1;
33875 : }
33876 0 : object->in.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(value);
33877 : }
33878 0 : return 0;
33879 : }
33880 :
33881 0 : static PyObject *py_samr_ChangePasswordUser_in_get_new_nt_crypted(PyObject *obj, void *closure)
33882 : {
33883 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33884 0 : PyObject *py_new_nt_crypted;
33885 0 : if (object->in.new_nt_crypted == NULL) {
33886 0 : Py_RETURN_NONE;
33887 : }
33888 0 : if (object->in.new_nt_crypted == NULL) {
33889 0 : py_new_nt_crypted = Py_None;
33890 0 : Py_INCREF(py_new_nt_crypted);
33891 : } else {
33892 0 : py_new_nt_crypted = pytalloc_reference_ex(&samr_Password_Type, object->in.new_nt_crypted, object->in.new_nt_crypted);
33893 : }
33894 0 : return py_new_nt_crypted;
33895 : }
33896 :
33897 0 : static int py_samr_ChangePasswordUser_in_set_new_nt_crypted(PyObject *py_obj, PyObject *value, void *closure)
33898 : {
33899 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33900 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.new_nt_crypted));
33901 0 : if (value == NULL) {
33902 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.new_nt_crypted");
33903 0 : return -1;
33904 : }
33905 0 : if (value == Py_None) {
33906 0 : object->in.new_nt_crypted = NULL;
33907 : } else {
33908 0 : object->in.new_nt_crypted = NULL;
33909 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
33910 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33911 0 : PyErr_NoMemory();
33912 0 : return -1;
33913 : }
33914 0 : object->in.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(value);
33915 : }
33916 0 : return 0;
33917 : }
33918 :
33919 0 : static PyObject *py_samr_ChangePasswordUser_in_get_cross1_present(PyObject *obj, void *closure)
33920 : {
33921 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33922 0 : PyObject *py_cross1_present;
33923 0 : py_cross1_present = PyLong_FromLong((uint16_t)object->in.cross1_present);
33924 0 : return py_cross1_present;
33925 : }
33926 :
33927 0 : static int py_samr_ChangePasswordUser_in_set_cross1_present(PyObject *py_obj, PyObject *value, void *closure)
33928 : {
33929 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33930 0 : if (value == NULL) {
33931 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.cross1_present");
33932 0 : return -1;
33933 : }
33934 : {
33935 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cross1_present));
33936 0 : if (PyLong_Check(value)) {
33937 0 : unsigned long long test_var;
33938 0 : test_var = PyLong_AsUnsignedLongLong(value);
33939 0 : if (PyErr_Occurred() != NULL) {
33940 0 : return -1;
33941 : }
33942 0 : if (test_var > uint_max) {
33943 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
33944 : PyLong_Type.tp_name, uint_max, test_var);
33945 0 : return -1;
33946 : }
33947 0 : object->in.cross1_present = test_var;
33948 : } else {
33949 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
33950 : PyLong_Type.tp_name);
33951 0 : return -1;
33952 : }
33953 : }
33954 0 : return 0;
33955 : }
33956 :
33957 0 : static PyObject *py_samr_ChangePasswordUser_in_get_nt_cross(PyObject *obj, void *closure)
33958 : {
33959 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33960 0 : PyObject *py_nt_cross;
33961 0 : if (object->in.nt_cross == NULL) {
33962 0 : Py_RETURN_NONE;
33963 : }
33964 0 : if (object->in.nt_cross == NULL) {
33965 0 : py_nt_cross = Py_None;
33966 0 : Py_INCREF(py_nt_cross);
33967 : } else {
33968 0 : py_nt_cross = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_cross, object->in.nt_cross);
33969 : }
33970 0 : return py_nt_cross;
33971 : }
33972 :
33973 0 : static int py_samr_ChangePasswordUser_in_set_nt_cross(PyObject *py_obj, PyObject *value, void *closure)
33974 : {
33975 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
33976 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_cross));
33977 0 : if (value == NULL) {
33978 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_cross");
33979 0 : return -1;
33980 : }
33981 0 : if (value == Py_None) {
33982 0 : object->in.nt_cross = NULL;
33983 : } else {
33984 0 : object->in.nt_cross = NULL;
33985 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
33986 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
33987 0 : PyErr_NoMemory();
33988 0 : return -1;
33989 : }
33990 0 : object->in.nt_cross = (struct samr_Password *)pytalloc_get_ptr(value);
33991 : }
33992 0 : return 0;
33993 : }
33994 :
33995 0 : static PyObject *py_samr_ChangePasswordUser_in_get_cross2_present(PyObject *obj, void *closure)
33996 : {
33997 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
33998 0 : PyObject *py_cross2_present;
33999 0 : py_cross2_present = PyLong_FromLong((uint16_t)object->in.cross2_present);
34000 0 : return py_cross2_present;
34001 : }
34002 :
34003 0 : static int py_samr_ChangePasswordUser_in_set_cross2_present(PyObject *py_obj, PyObject *value, void *closure)
34004 : {
34005 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34006 0 : if (value == NULL) {
34007 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.cross2_present");
34008 0 : return -1;
34009 : }
34010 : {
34011 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cross2_present));
34012 0 : if (PyLong_Check(value)) {
34013 0 : unsigned long long test_var;
34014 0 : test_var = PyLong_AsUnsignedLongLong(value);
34015 0 : if (PyErr_Occurred() != NULL) {
34016 0 : return -1;
34017 : }
34018 0 : if (test_var > uint_max) {
34019 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34020 : PyLong_Type.tp_name, uint_max, test_var);
34021 0 : return -1;
34022 : }
34023 0 : object->in.cross2_present = test_var;
34024 : } else {
34025 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34026 : PyLong_Type.tp_name);
34027 0 : return -1;
34028 : }
34029 : }
34030 0 : return 0;
34031 : }
34032 :
34033 0 : static PyObject *py_samr_ChangePasswordUser_in_get_lm_cross(PyObject *obj, void *closure)
34034 : {
34035 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
34036 0 : PyObject *py_lm_cross;
34037 0 : if (object->in.lm_cross == NULL) {
34038 0 : Py_RETURN_NONE;
34039 : }
34040 0 : if (object->in.lm_cross == NULL) {
34041 0 : py_lm_cross = Py_None;
34042 0 : Py_INCREF(py_lm_cross);
34043 : } else {
34044 0 : py_lm_cross = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_cross, object->in.lm_cross);
34045 : }
34046 0 : return py_lm_cross;
34047 : }
34048 :
34049 0 : static int py_samr_ChangePasswordUser_in_set_lm_cross(PyObject *py_obj, PyObject *value, void *closure)
34050 : {
34051 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34052 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_cross));
34053 0 : if (value == NULL) {
34054 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_cross");
34055 0 : return -1;
34056 : }
34057 0 : if (value == Py_None) {
34058 0 : object->in.lm_cross = NULL;
34059 : } else {
34060 0 : object->in.lm_cross = NULL;
34061 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
34062 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34063 0 : PyErr_NoMemory();
34064 0 : return -1;
34065 : }
34066 0 : object->in.lm_cross = (struct samr_Password *)pytalloc_get_ptr(value);
34067 : }
34068 0 : return 0;
34069 : }
34070 :
34071 0 : static PyObject *py_samr_ChangePasswordUser_get_result(PyObject *obj, void *closure)
34072 : {
34073 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(obj);
34074 0 : PyObject *py_result;
34075 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
34076 0 : return py_result;
34077 : }
34078 :
34079 0 : static int py_samr_ChangePasswordUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
34080 : {
34081 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34082 0 : if (value == NULL) {
34083 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34084 0 : return -1;
34085 : }
34086 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34087 0 : return 0;
34088 : }
34089 :
34090 : static PyGetSetDef py_samr_ChangePasswordUser_getsetters[] = {
34091 : {
34092 : .name = discard_const_p(char, "in_user_handle"),
34093 : .get = py_samr_ChangePasswordUser_in_get_user_handle,
34094 : .set = py_samr_ChangePasswordUser_in_set_user_handle,
34095 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
34096 : },
34097 : {
34098 : .name = discard_const_p(char, "in_lm_present"),
34099 : .get = py_samr_ChangePasswordUser_in_get_lm_present,
34100 : .set = py_samr_ChangePasswordUser_in_set_lm_present,
34101 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
34102 : },
34103 : {
34104 : .name = discard_const_p(char, "in_old_lm_crypted"),
34105 : .get = py_samr_ChangePasswordUser_in_get_old_lm_crypted,
34106 : .set = py_samr_ChangePasswordUser_in_set_old_lm_crypted,
34107 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34108 : },
34109 : {
34110 : .name = discard_const_p(char, "in_new_lm_crypted"),
34111 : .get = py_samr_ChangePasswordUser_in_get_new_lm_crypted,
34112 : .set = py_samr_ChangePasswordUser_in_set_new_lm_crypted,
34113 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34114 : },
34115 : {
34116 : .name = discard_const_p(char, "in_nt_present"),
34117 : .get = py_samr_ChangePasswordUser_in_get_nt_present,
34118 : .set = py_samr_ChangePasswordUser_in_set_nt_present,
34119 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
34120 : },
34121 : {
34122 : .name = discard_const_p(char, "in_old_nt_crypted"),
34123 : .get = py_samr_ChangePasswordUser_in_get_old_nt_crypted,
34124 : .set = py_samr_ChangePasswordUser_in_set_old_nt_crypted,
34125 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34126 : },
34127 : {
34128 : .name = discard_const_p(char, "in_new_nt_crypted"),
34129 : .get = py_samr_ChangePasswordUser_in_get_new_nt_crypted,
34130 : .set = py_samr_ChangePasswordUser_in_set_new_nt_crypted,
34131 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34132 : },
34133 : {
34134 : .name = discard_const_p(char, "in_cross1_present"),
34135 : .get = py_samr_ChangePasswordUser_in_get_cross1_present,
34136 : .set = py_samr_ChangePasswordUser_in_set_cross1_present,
34137 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
34138 : },
34139 : {
34140 : .name = discard_const_p(char, "in_nt_cross"),
34141 : .get = py_samr_ChangePasswordUser_in_get_nt_cross,
34142 : .set = py_samr_ChangePasswordUser_in_set_nt_cross,
34143 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34144 : },
34145 : {
34146 : .name = discard_const_p(char, "in_cross2_present"),
34147 : .get = py_samr_ChangePasswordUser_in_get_cross2_present,
34148 : .set = py_samr_ChangePasswordUser_in_set_cross2_present,
34149 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
34150 : },
34151 : {
34152 : .name = discard_const_p(char, "in_lm_cross"),
34153 : .get = py_samr_ChangePasswordUser_in_get_lm_cross,
34154 : .set = py_samr_ChangePasswordUser_in_set_lm_cross,
34155 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
34156 : },
34157 : {
34158 : .name = discard_const_p(char, "result"),
34159 : .get = py_samr_ChangePasswordUser_get_result,
34160 : .set = py_samr_ChangePasswordUser_set_result,
34161 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34162 : },
34163 : { .name = NULL }
34164 : };
34165 :
34166 0 : static PyObject *py_samr_ChangePasswordUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34167 : {
34168 0 : PyObject *self = pytalloc_new(struct samr_ChangePasswordUser, type);
34169 0 : struct samr_ChangePasswordUser *_self = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(self);
34170 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34171 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
34172 0 : return self;
34173 : }
34174 :
34175 0 : static PyObject *py_samr_ChangePasswordUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34176 : {
34177 :
34178 :
34179 0 : return PyLong_FromLong(38);
34180 : }
34181 :
34182 0 : static PyObject *py_samr_ChangePasswordUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34183 : {
34184 0 : const struct ndr_interface_call *call = NULL;
34185 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34186 0 : PyObject *ret = NULL;
34187 0 : struct ndr_push *push = NULL;
34188 0 : DATA_BLOB blob;
34189 0 : enum ndr_err_code err;
34190 :
34191 0 : if (ndr_table_samr.num_calls < 39) {
34192 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_pack");
34193 0 : return NULL;
34194 : }
34195 0 : call = &ndr_table_samr.calls[38];
34196 :
34197 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34198 0 : if (push == NULL) {
34199 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34200 0 : return NULL;
34201 : }
34202 :
34203 0 : push->flags |= ndr_push_flags;
34204 :
34205 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34206 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34207 0 : TALLOC_FREE(push);
34208 0 : PyErr_SetNdrError(err);
34209 0 : return NULL;
34210 : }
34211 0 : blob = ndr_push_blob(push);
34212 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34213 0 : TALLOC_FREE(push);
34214 0 : return ret;
34215 : }
34216 :
34217 0 : static PyObject *py_samr_ChangePasswordUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34218 : {
34219 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34220 0 : PyObject *bigendian_obj = NULL;
34221 0 : PyObject *ndr64_obj = NULL;
34222 0 : libndr_flags ndr_push_flags = 0;
34223 :
34224 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34225 : discard_const_p(char *, kwnames),
34226 : &bigendian_obj,
34227 : &ndr64_obj)) {
34228 0 : return NULL;
34229 : }
34230 :
34231 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34232 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34233 : }
34234 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34235 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34236 : }
34237 :
34238 0 : return py_samr_ChangePasswordUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34239 : }
34240 :
34241 0 : static PyObject *py_samr_ChangePasswordUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34242 : {
34243 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34244 0 : PyObject *bigendian_obj = NULL;
34245 0 : PyObject *ndr64_obj = NULL;
34246 0 : libndr_flags ndr_push_flags = 0;
34247 :
34248 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34249 : discard_const_p(char *, kwnames),
34250 : &bigendian_obj,
34251 : &ndr64_obj)) {
34252 0 : return NULL;
34253 : }
34254 :
34255 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34256 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34257 : }
34258 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34259 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34260 : }
34261 :
34262 0 : return py_samr_ChangePasswordUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34263 : }
34264 :
34265 0 : static PyObject *py_samr_ChangePasswordUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
34266 : {
34267 0 : const struct ndr_interface_call *call = NULL;
34268 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34269 0 : struct ndr_pull *pull = NULL;
34270 0 : enum ndr_err_code err;
34271 :
34272 0 : if (ndr_table_samr.num_calls < 39) {
34273 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_unpack");
34274 0 : return NULL;
34275 : }
34276 0 : call = &ndr_table_samr.calls[38];
34277 :
34278 0 : pull = ndr_pull_init_blob(blob, object);
34279 0 : if (pull == NULL) {
34280 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34281 0 : return NULL;
34282 : }
34283 :
34284 0 : pull->flags |= ndr_pull_flags;
34285 :
34286 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34287 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34288 0 : TALLOC_FREE(pull);
34289 0 : PyErr_SetNdrError(err);
34290 0 : return NULL;
34291 : }
34292 0 : if (!allow_remaining) {
34293 0 : uint32_t highest_ofs;
34294 :
34295 0 : if (pull->offset > pull->relative_highest_offset) {
34296 0 : highest_ofs = pull->offset;
34297 : } else {
34298 0 : highest_ofs = pull->relative_highest_offset;
34299 : }
34300 0 : if (highest_ofs < pull->data_size) {
34301 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34302 : "not all bytes consumed ofs[%u] size[%u]",
34303 : highest_ofs, pull->data_size);
34304 0 : TALLOC_FREE(pull);
34305 0 : PyErr_SetNdrError(err);
34306 0 : return NULL;
34307 : }
34308 : }
34309 :
34310 0 : TALLOC_FREE(pull);
34311 0 : Py_RETURN_NONE;
34312 : }
34313 :
34314 0 : static PyObject *py_samr_ChangePasswordUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34315 : {
34316 0 : DATA_BLOB blob;
34317 0 : Py_ssize_t blob_length = 0;
34318 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34319 0 : PyObject *bigendian_obj = NULL;
34320 0 : PyObject *ndr64_obj = NULL;
34321 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34322 0 : PyObject *allow_remaining_obj = NULL;
34323 0 : bool allow_remaining = false;
34324 :
34325 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34326 : discard_const_p(char *, kwnames),
34327 : &blob.data, &blob_length,
34328 : &bigendian_obj,
34329 : &ndr64_obj,
34330 : &allow_remaining_obj)) {
34331 0 : return NULL;
34332 : }
34333 0 : blob.length = blob_length;
34334 :
34335 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34336 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34337 : }
34338 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34339 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34340 : }
34341 :
34342 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34343 0 : allow_remaining = true;
34344 : }
34345 :
34346 0 : return py_samr_ChangePasswordUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34347 : }
34348 :
34349 0 : static PyObject *py_samr_ChangePasswordUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34350 : {
34351 0 : DATA_BLOB blob;
34352 0 : Py_ssize_t blob_length = 0;
34353 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34354 0 : PyObject *bigendian_obj = NULL;
34355 0 : PyObject *ndr64_obj = NULL;
34356 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34357 0 : PyObject *allow_remaining_obj = NULL;
34358 0 : bool allow_remaining = false;
34359 :
34360 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34361 : discard_const_p(char *, kwnames),
34362 : &blob.data, &blob_length,
34363 : &bigendian_obj,
34364 : &ndr64_obj,
34365 : &allow_remaining_obj)) {
34366 0 : return NULL;
34367 : }
34368 0 : blob.length = blob_length;
34369 :
34370 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34371 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34372 : }
34373 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34374 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34375 : }
34376 :
34377 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34378 0 : allow_remaining = true;
34379 : }
34380 :
34381 0 : return py_samr_ChangePasswordUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
34382 : }
34383 :
34384 0 : static PyObject *py_samr_ChangePasswordUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
34385 : {
34386 0 : const struct ndr_interface_call *call = NULL;
34387 0 : struct samr_ChangePasswordUser *object = (struct samr_ChangePasswordUser *)pytalloc_get_ptr(py_obj);
34388 0 : PyObject *ret;
34389 0 : char *retstr;
34390 :
34391 0 : if (ndr_table_samr.num_calls < 39) {
34392 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser_ndr_print");
34393 0 : return NULL;
34394 : }
34395 0 : call = &ndr_table_samr.calls[38];
34396 :
34397 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
34398 0 : ret = PyUnicode_FromString(retstr);
34399 0 : TALLOC_FREE(retstr);
34400 :
34401 0 : return ret;
34402 : }
34403 :
34404 0 : static PyObject *py_samr_ChangePasswordUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34405 : {
34406 0 : return py_samr_ChangePasswordUser_ndr_print(py_obj, "samr_ChangePasswordUser_in", NDR_IN);
34407 : }
34408 :
34409 0 : static PyObject *py_samr_ChangePasswordUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
34410 : {
34411 0 : return py_samr_ChangePasswordUser_ndr_print(py_obj, "samr_ChangePasswordUser_out", NDR_OUT);
34412 : }
34413 :
34414 : static PyMethodDef py_samr_ChangePasswordUser_methods[] = {
34415 : { "opnum", (PyCFunction)py_samr_ChangePasswordUser_ndr_opnum, METH_NOARGS|METH_CLASS,
34416 : "samr.ChangePasswordUser.opnum() -> 38 (0x26) " },
34417 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
34418 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
34419 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
34420 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
34421 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
34422 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
34423 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
34424 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
34425 : { "__ndr_print_in__", (PyCFunction)py_samr_ChangePasswordUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
34426 : { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
34427 : { NULL, NULL, 0, NULL }
34428 : };
34429 :
34430 :
34431 : static PyTypeObject samr_ChangePasswordUser_Type = {
34432 : PyVarObject_HEAD_INIT(NULL, 0)
34433 : .tp_name = "samr.ChangePasswordUser",
34434 : .tp_getset = py_samr_ChangePasswordUser_getsetters,
34435 : .tp_methods = py_samr_ChangePasswordUser_methods,
34436 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
34437 : .tp_new = py_samr_ChangePasswordUser_new,
34438 : };
34439 :
34440 0 : static bool pack_py_samr_ChangePasswordUser_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser *r)
34441 : {
34442 0 : PyObject *py_user_handle;
34443 0 : PyObject *py_lm_present;
34444 0 : PyObject *py_old_lm_crypted;
34445 0 : PyObject *py_new_lm_crypted;
34446 0 : PyObject *py_nt_present;
34447 0 : PyObject *py_old_nt_crypted;
34448 0 : PyObject *py_new_nt_crypted;
34449 0 : PyObject *py_cross1_present;
34450 0 : PyObject *py_nt_cross;
34451 0 : PyObject *py_cross2_present;
34452 0 : PyObject *py_lm_cross;
34453 0 : const char *kwnames[] = {
34454 : "user_handle", "lm_present", "old_lm_crypted", "new_lm_crypted", "nt_present", "old_nt_crypted", "new_nt_crypted", "cross1_present", "nt_cross", "cross2_present", "lm_cross", NULL
34455 : };
34456 :
34457 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOOOOO:samr_ChangePasswordUser", discard_const_p(char *, kwnames), &py_user_handle, &py_lm_present, &py_old_lm_crypted, &py_new_lm_crypted, &py_nt_present, &py_old_nt_crypted, &py_new_nt_crypted, &py_cross1_present, &py_nt_cross, &py_cross2_present, &py_lm_cross)) {
34458 0 : return false;
34459 : }
34460 :
34461 0 : if (py_user_handle == NULL) {
34462 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
34463 0 : return false;
34464 : }
34465 0 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
34466 0 : if (r->in.user_handle == NULL) {
34467 0 : PyErr_NoMemory();
34468 0 : return false;
34469 : }
34470 0 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
34471 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
34472 0 : PyErr_NoMemory();
34473 0 : return false;
34474 : }
34475 0 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
34476 0 : if (py_lm_present == NULL) {
34477 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_present");
34478 0 : return false;
34479 : }
34480 : {
34481 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_present));
34482 0 : if (PyLong_Check(py_lm_present)) {
34483 0 : unsigned long long test_var;
34484 0 : test_var = PyLong_AsUnsignedLongLong(py_lm_present);
34485 0 : if (PyErr_Occurred() != NULL) {
34486 0 : return false;
34487 : }
34488 0 : if (test_var > uint_max) {
34489 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34490 : PyLong_Type.tp_name, uint_max, test_var);
34491 0 : return false;
34492 : }
34493 0 : r->in.lm_present = test_var;
34494 : } else {
34495 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34496 : PyLong_Type.tp_name);
34497 0 : return false;
34498 : }
34499 : }
34500 0 : if (py_old_lm_crypted == NULL) {
34501 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_lm_crypted");
34502 0 : return false;
34503 : }
34504 0 : if (py_old_lm_crypted == Py_None) {
34505 0 : r->in.old_lm_crypted = NULL;
34506 : } else {
34507 0 : r->in.old_lm_crypted = NULL;
34508 0 : PY_CHECK_TYPE(&samr_Password_Type, py_old_lm_crypted, return false;);
34509 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_lm_crypted)) == NULL) {
34510 0 : PyErr_NoMemory();
34511 0 : return false;
34512 : }
34513 0 : r->in.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_lm_crypted);
34514 : }
34515 0 : if (py_new_lm_crypted == NULL) {
34516 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_lm_crypted");
34517 0 : return false;
34518 : }
34519 0 : if (py_new_lm_crypted == Py_None) {
34520 0 : r->in.new_lm_crypted = NULL;
34521 : } else {
34522 0 : r->in.new_lm_crypted = NULL;
34523 0 : PY_CHECK_TYPE(&samr_Password_Type, py_new_lm_crypted, return false;);
34524 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_lm_crypted)) == NULL) {
34525 0 : PyErr_NoMemory();
34526 0 : return false;
34527 : }
34528 0 : r->in.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_lm_crypted);
34529 : }
34530 0 : if (py_nt_present == NULL) {
34531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_present");
34532 0 : return false;
34533 : }
34534 : {
34535 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.nt_present));
34536 0 : if (PyLong_Check(py_nt_present)) {
34537 0 : unsigned long long test_var;
34538 0 : test_var = PyLong_AsUnsignedLongLong(py_nt_present);
34539 0 : if (PyErr_Occurred() != NULL) {
34540 0 : return false;
34541 : }
34542 0 : if (test_var > uint_max) {
34543 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34544 : PyLong_Type.tp_name, uint_max, test_var);
34545 0 : return false;
34546 : }
34547 0 : r->in.nt_present = test_var;
34548 : } else {
34549 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34550 : PyLong_Type.tp_name);
34551 0 : return false;
34552 : }
34553 : }
34554 0 : if (py_old_nt_crypted == NULL) {
34555 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.old_nt_crypted");
34556 0 : return false;
34557 : }
34558 0 : if (py_old_nt_crypted == Py_None) {
34559 0 : r->in.old_nt_crypted = NULL;
34560 : } else {
34561 0 : r->in.old_nt_crypted = NULL;
34562 0 : PY_CHECK_TYPE(&samr_Password_Type, py_old_nt_crypted, return false;);
34563 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_nt_crypted)) == NULL) {
34564 0 : PyErr_NoMemory();
34565 0 : return false;
34566 : }
34567 0 : r->in.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_nt_crypted);
34568 : }
34569 0 : if (py_new_nt_crypted == NULL) {
34570 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.new_nt_crypted");
34571 0 : return false;
34572 : }
34573 0 : if (py_new_nt_crypted == Py_None) {
34574 0 : r->in.new_nt_crypted = NULL;
34575 : } else {
34576 0 : r->in.new_nt_crypted = NULL;
34577 0 : PY_CHECK_TYPE(&samr_Password_Type, py_new_nt_crypted, return false;);
34578 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_nt_crypted)) == NULL) {
34579 0 : PyErr_NoMemory();
34580 0 : return false;
34581 : }
34582 0 : r->in.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_nt_crypted);
34583 : }
34584 0 : if (py_cross1_present == NULL) {
34585 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.cross1_present");
34586 0 : return false;
34587 : }
34588 : {
34589 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cross1_present));
34590 0 : if (PyLong_Check(py_cross1_present)) {
34591 0 : unsigned long long test_var;
34592 0 : test_var = PyLong_AsUnsignedLongLong(py_cross1_present);
34593 0 : if (PyErr_Occurred() != NULL) {
34594 0 : return false;
34595 : }
34596 0 : if (test_var > uint_max) {
34597 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34598 : PyLong_Type.tp_name, uint_max, test_var);
34599 0 : return false;
34600 : }
34601 0 : r->in.cross1_present = test_var;
34602 : } else {
34603 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34604 : PyLong_Type.tp_name);
34605 0 : return false;
34606 : }
34607 : }
34608 0 : if (py_nt_cross == NULL) {
34609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_cross");
34610 0 : return false;
34611 : }
34612 0 : if (py_nt_cross == Py_None) {
34613 0 : r->in.nt_cross = NULL;
34614 : } else {
34615 0 : r->in.nt_cross = NULL;
34616 0 : PY_CHECK_TYPE(&samr_Password_Type, py_nt_cross, return false;);
34617 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_cross)) == NULL) {
34618 0 : PyErr_NoMemory();
34619 0 : return false;
34620 : }
34621 0 : r->in.nt_cross = (struct samr_Password *)pytalloc_get_ptr(py_nt_cross);
34622 : }
34623 0 : if (py_cross2_present == NULL) {
34624 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.cross2_present");
34625 0 : return false;
34626 : }
34627 : {
34628 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cross2_present));
34629 0 : if (PyLong_Check(py_cross2_present)) {
34630 0 : unsigned long long test_var;
34631 0 : test_var = PyLong_AsUnsignedLongLong(py_cross2_present);
34632 0 : if (PyErr_Occurred() != NULL) {
34633 0 : return false;
34634 : }
34635 0 : if (test_var > uint_max) {
34636 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
34637 : PyLong_Type.tp_name, uint_max, test_var);
34638 0 : return false;
34639 : }
34640 0 : r->in.cross2_present = test_var;
34641 : } else {
34642 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
34643 : PyLong_Type.tp_name);
34644 0 : return false;
34645 : }
34646 : }
34647 0 : if (py_lm_cross == NULL) {
34648 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_cross");
34649 0 : return false;
34650 : }
34651 0 : if (py_lm_cross == Py_None) {
34652 0 : r->in.lm_cross = NULL;
34653 : } else {
34654 0 : r->in.lm_cross = NULL;
34655 0 : PY_CHECK_TYPE(&samr_Password_Type, py_lm_cross, return false;);
34656 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_cross)) == NULL) {
34657 0 : PyErr_NoMemory();
34658 0 : return false;
34659 : }
34660 0 : r->in.lm_cross = (struct samr_Password *)pytalloc_get_ptr(py_lm_cross);
34661 : }
34662 0 : return true;
34663 : }
34664 :
34665 0 : static PyObject *unpack_py_samr_ChangePasswordUser_args_out(struct samr_ChangePasswordUser *r)
34666 : {
34667 0 : PyObject *result;
34668 0 : result = Py_None;
34669 0 : Py_INCREF(result);
34670 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
34671 0 : PyErr_SetNTSTATUS(r->out.result);
34672 0 : return NULL;
34673 : }
34674 :
34675 0 : return result;
34676 : }
34677 :
34678 :
34679 0 : static PyObject *py_samr_GetGroupsForUser_in_get_user_handle(PyObject *obj, void *closure)
34680 : {
34681 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj);
34682 0 : PyObject *py_user_handle;
34683 0 : if (object->in.user_handle == NULL) {
34684 0 : Py_RETURN_NONE;
34685 : }
34686 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
34687 0 : return py_user_handle;
34688 : }
34689 :
34690 0 : static int py_samr_GetGroupsForUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
34691 : {
34692 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
34693 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
34694 0 : if (value == NULL) {
34695 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
34696 0 : return -1;
34697 : }
34698 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
34699 0 : if (object->in.user_handle == NULL) {
34700 0 : PyErr_NoMemory();
34701 0 : return -1;
34702 : }
34703 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
34704 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34705 0 : PyErr_NoMemory();
34706 0 : return -1;
34707 : }
34708 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
34709 0 : return 0;
34710 : }
34711 :
34712 0 : static PyObject *py_samr_GetGroupsForUser_out_get_rids(PyObject *obj, void *closure)
34713 : {
34714 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj);
34715 0 : PyObject *py_rids;
34716 0 : if (object->out.rids == NULL) {
34717 0 : Py_RETURN_NONE;
34718 : }
34719 0 : if (*object->out.rids == NULL) {
34720 0 : py_rids = Py_None;
34721 0 : Py_INCREF(py_rids);
34722 : } else {
34723 0 : py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *object->out.rids, *object->out.rids);
34724 : }
34725 0 : return py_rids;
34726 : }
34727 :
34728 0 : static int py_samr_GetGroupsForUser_out_set_rids(PyObject *py_obj, PyObject *value, void *closure)
34729 : {
34730 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
34731 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rids));
34732 0 : if (value == NULL) {
34733 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rids");
34734 0 : return -1;
34735 : }
34736 0 : object->out.rids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rids);
34737 0 : if (object->out.rids == NULL) {
34738 0 : PyErr_NoMemory();
34739 0 : return -1;
34740 : }
34741 0 : if (value == Py_None) {
34742 0 : *object->out.rids = NULL;
34743 : } else {
34744 0 : *object->out.rids = NULL;
34745 0 : PY_CHECK_TYPE(&samr_RidWithAttributeArray_Type, value, return -1;);
34746 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
34747 0 : PyErr_NoMemory();
34748 0 : return -1;
34749 : }
34750 0 : *object->out.rids = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value);
34751 : }
34752 0 : return 0;
34753 : }
34754 :
34755 0 : static PyObject *py_samr_GetGroupsForUser_get_result(PyObject *obj, void *closure)
34756 : {
34757 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(obj);
34758 0 : PyObject *py_result;
34759 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
34760 0 : return py_result;
34761 : }
34762 :
34763 0 : static int py_samr_GetGroupsForUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
34764 : {
34765 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
34766 0 : if (value == NULL) {
34767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
34768 0 : return -1;
34769 : }
34770 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
34771 0 : return 0;
34772 : }
34773 :
34774 : static PyGetSetDef py_samr_GetGroupsForUser_getsetters[] = {
34775 : {
34776 : .name = discard_const_p(char, "in_user_handle"),
34777 : .get = py_samr_GetGroupsForUser_in_get_user_handle,
34778 : .set = py_samr_GetGroupsForUser_in_set_user_handle,
34779 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
34780 : },
34781 : {
34782 : .name = discard_const_p(char, "out_rids"),
34783 : .get = py_samr_GetGroupsForUser_out_get_rids,
34784 : .set = py_samr_GetGroupsForUser_out_set_rids,
34785 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray")
34786 : },
34787 : {
34788 : .name = discard_const_p(char, "result"),
34789 : .get = py_samr_GetGroupsForUser_get_result,
34790 : .set = py_samr_GetGroupsForUser_set_result,
34791 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
34792 : },
34793 : { .name = NULL }
34794 : };
34795 :
34796 0 : static PyObject *py_samr_GetGroupsForUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
34797 : {
34798 0 : PyObject *self = pytalloc_new(struct samr_GetGroupsForUser, type);
34799 0 : struct samr_GetGroupsForUser *_self = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(self);
34800 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
34801 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
34802 : /* a pointer to a NULL pointer */
34803 0 : _self->out.rids = talloc_zero(mem_ctx, struct samr_RidWithAttributeArray *);
34804 0 : return self;
34805 : }
34806 :
34807 0 : static PyObject *py_samr_GetGroupsForUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
34808 : {
34809 :
34810 :
34811 0 : return PyLong_FromLong(39);
34812 : }
34813 :
34814 0 : static PyObject *py_samr_GetGroupsForUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
34815 : {
34816 0 : const struct ndr_interface_call *call = NULL;
34817 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
34818 0 : PyObject *ret = NULL;
34819 0 : struct ndr_push *push = NULL;
34820 0 : DATA_BLOB blob;
34821 0 : enum ndr_err_code err;
34822 :
34823 0 : if (ndr_table_samr.num_calls < 40) {
34824 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_pack");
34825 0 : return NULL;
34826 : }
34827 0 : call = &ndr_table_samr.calls[39];
34828 :
34829 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
34830 0 : if (push == NULL) {
34831 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34832 0 : return NULL;
34833 : }
34834 :
34835 0 : push->flags |= ndr_push_flags;
34836 :
34837 0 : err = call->ndr_push(push, ndr_inout_flags, object);
34838 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34839 0 : TALLOC_FREE(push);
34840 0 : PyErr_SetNdrError(err);
34841 0 : return NULL;
34842 : }
34843 0 : blob = ndr_push_blob(push);
34844 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
34845 0 : TALLOC_FREE(push);
34846 0 : return ret;
34847 : }
34848 :
34849 0 : static PyObject *py_samr_GetGroupsForUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34850 : {
34851 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34852 0 : PyObject *bigendian_obj = NULL;
34853 0 : PyObject *ndr64_obj = NULL;
34854 0 : libndr_flags ndr_push_flags = 0;
34855 :
34856 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
34857 : discard_const_p(char *, kwnames),
34858 : &bigendian_obj,
34859 : &ndr64_obj)) {
34860 0 : return NULL;
34861 : }
34862 :
34863 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34864 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34865 : }
34866 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34867 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34868 : }
34869 :
34870 0 : return py_samr_GetGroupsForUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
34871 : }
34872 :
34873 0 : static PyObject *py_samr_GetGroupsForUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34874 : {
34875 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
34876 0 : PyObject *bigendian_obj = NULL;
34877 0 : PyObject *ndr64_obj = NULL;
34878 0 : libndr_flags ndr_push_flags = 0;
34879 :
34880 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
34881 : discard_const_p(char *, kwnames),
34882 : &bigendian_obj,
34883 : &ndr64_obj)) {
34884 0 : return NULL;
34885 : }
34886 :
34887 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34888 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
34889 : }
34890 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34891 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
34892 : }
34893 :
34894 0 : return py_samr_GetGroupsForUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
34895 : }
34896 :
34897 0 : static PyObject *py_samr_GetGroupsForUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
34898 : {
34899 0 : const struct ndr_interface_call *call = NULL;
34900 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
34901 0 : struct ndr_pull *pull = NULL;
34902 0 : enum ndr_err_code err;
34903 :
34904 0 : if (ndr_table_samr.num_calls < 40) {
34905 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_unpack");
34906 0 : return NULL;
34907 : }
34908 0 : call = &ndr_table_samr.calls[39];
34909 :
34910 0 : pull = ndr_pull_init_blob(blob, object);
34911 0 : if (pull == NULL) {
34912 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
34913 0 : return NULL;
34914 : }
34915 :
34916 0 : pull->flags |= ndr_pull_flags;
34917 :
34918 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
34919 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
34920 0 : TALLOC_FREE(pull);
34921 0 : PyErr_SetNdrError(err);
34922 0 : return NULL;
34923 : }
34924 0 : if (!allow_remaining) {
34925 0 : uint32_t highest_ofs;
34926 :
34927 0 : if (pull->offset > pull->relative_highest_offset) {
34928 0 : highest_ofs = pull->offset;
34929 : } else {
34930 0 : highest_ofs = pull->relative_highest_offset;
34931 : }
34932 0 : if (highest_ofs < pull->data_size) {
34933 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
34934 : "not all bytes consumed ofs[%u] size[%u]",
34935 : highest_ofs, pull->data_size);
34936 0 : TALLOC_FREE(pull);
34937 0 : PyErr_SetNdrError(err);
34938 0 : return NULL;
34939 : }
34940 : }
34941 :
34942 0 : TALLOC_FREE(pull);
34943 0 : Py_RETURN_NONE;
34944 : }
34945 :
34946 0 : static PyObject *py_samr_GetGroupsForUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34947 : {
34948 0 : DATA_BLOB blob;
34949 0 : Py_ssize_t blob_length = 0;
34950 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34951 0 : PyObject *bigendian_obj = NULL;
34952 0 : PyObject *ndr64_obj = NULL;
34953 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34954 0 : PyObject *allow_remaining_obj = NULL;
34955 0 : bool allow_remaining = false;
34956 :
34957 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
34958 : discard_const_p(char *, kwnames),
34959 : &blob.data, &blob_length,
34960 : &bigendian_obj,
34961 : &ndr64_obj,
34962 : &allow_remaining_obj)) {
34963 0 : return NULL;
34964 : }
34965 0 : blob.length = blob_length;
34966 :
34967 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
34968 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
34969 : }
34970 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
34971 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
34972 : }
34973 :
34974 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
34975 0 : allow_remaining = true;
34976 : }
34977 :
34978 0 : return py_samr_GetGroupsForUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
34979 : }
34980 :
34981 0 : static PyObject *py_samr_GetGroupsForUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
34982 : {
34983 0 : DATA_BLOB blob;
34984 0 : Py_ssize_t blob_length = 0;
34985 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
34986 0 : PyObject *bigendian_obj = NULL;
34987 0 : PyObject *ndr64_obj = NULL;
34988 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
34989 0 : PyObject *allow_remaining_obj = NULL;
34990 0 : bool allow_remaining = false;
34991 :
34992 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
34993 : discard_const_p(char *, kwnames),
34994 : &blob.data, &blob_length,
34995 : &bigendian_obj,
34996 : &ndr64_obj,
34997 : &allow_remaining_obj)) {
34998 0 : return NULL;
34999 : }
35000 0 : blob.length = blob_length;
35001 :
35002 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35003 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35004 : }
35005 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35006 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35007 : }
35008 :
35009 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35010 0 : allow_remaining = true;
35011 : }
35012 :
35013 0 : return py_samr_GetGroupsForUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35014 : }
35015 :
35016 0 : static PyObject *py_samr_GetGroupsForUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
35017 : {
35018 0 : const struct ndr_interface_call *call = NULL;
35019 0 : struct samr_GetGroupsForUser *object = (struct samr_GetGroupsForUser *)pytalloc_get_ptr(py_obj);
35020 0 : PyObject *ret;
35021 0 : char *retstr;
35022 :
35023 0 : if (ndr_table_samr.num_calls < 40) {
35024 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetGroupsForUser_ndr_print");
35025 0 : return NULL;
35026 : }
35027 0 : call = &ndr_table_samr.calls[39];
35028 :
35029 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35030 0 : ret = PyUnicode_FromString(retstr);
35031 0 : TALLOC_FREE(retstr);
35032 :
35033 0 : return ret;
35034 : }
35035 :
35036 0 : static PyObject *py_samr_GetGroupsForUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35037 : {
35038 0 : return py_samr_GetGroupsForUser_ndr_print(py_obj, "samr_GetGroupsForUser_in", NDR_IN);
35039 : }
35040 :
35041 0 : static PyObject *py_samr_GetGroupsForUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35042 : {
35043 0 : return py_samr_GetGroupsForUser_ndr_print(py_obj, "samr_GetGroupsForUser_out", NDR_OUT);
35044 : }
35045 :
35046 : static PyMethodDef py_samr_GetGroupsForUser_methods[] = {
35047 : { "opnum", (PyCFunction)py_samr_GetGroupsForUser_ndr_opnum, METH_NOARGS|METH_CLASS,
35048 : "samr.GetGroupsForUser.opnum() -> 39 (0x27) " },
35049 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetGroupsForUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35050 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35051 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetGroupsForUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35052 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35053 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetGroupsForUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35054 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35055 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetGroupsForUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35056 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35057 : { "__ndr_print_in__", (PyCFunction)py_samr_GetGroupsForUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35058 : { "__ndr_print_out__", (PyCFunction)py_samr_GetGroupsForUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35059 : { NULL, NULL, 0, NULL }
35060 : };
35061 :
35062 :
35063 : static PyTypeObject samr_GetGroupsForUser_Type = {
35064 : PyVarObject_HEAD_INIT(NULL, 0)
35065 : .tp_name = "samr.GetGroupsForUser",
35066 : .tp_getset = py_samr_GetGroupsForUser_getsetters,
35067 : .tp_methods = py_samr_GetGroupsForUser_methods,
35068 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
35069 : .tp_new = py_samr_GetGroupsForUser_new,
35070 : };
35071 :
35072 5 : static bool pack_py_samr_GetGroupsForUser_args_in(PyObject *args, PyObject *kwargs, struct samr_GetGroupsForUser *r)
35073 : {
35074 0 : PyObject *py_user_handle;
35075 5 : const char *kwnames[] = {
35076 : "user_handle", NULL
35077 : };
35078 :
35079 5 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetGroupsForUser", discard_const_p(char *, kwnames), &py_user_handle)) {
35080 0 : return false;
35081 : }
35082 :
35083 5 : if (py_user_handle == NULL) {
35084 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
35085 0 : return false;
35086 : }
35087 5 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
35088 5 : if (r->in.user_handle == NULL) {
35089 0 : PyErr_NoMemory();
35090 0 : return false;
35091 : }
35092 5 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
35093 5 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
35094 0 : PyErr_NoMemory();
35095 0 : return false;
35096 : }
35097 5 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
35098 5 : return true;
35099 : }
35100 :
35101 5 : static PyObject *unpack_py_samr_GetGroupsForUser_args_out(struct samr_GetGroupsForUser *r)
35102 : {
35103 0 : PyObject *result;
35104 0 : PyObject *py_rids;
35105 5 : if (*r->out.rids == NULL) {
35106 0 : py_rids = Py_None;
35107 0 : Py_INCREF(py_rids);
35108 : } else {
35109 5 : py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *r->out.rids, *r->out.rids);
35110 : }
35111 5 : result = py_rids;
35112 5 : if (NT_STATUS_IS_ERR(r->out.result)) {
35113 0 : PyErr_SetNTSTATUS(r->out.result);
35114 0 : return NULL;
35115 : }
35116 :
35117 5 : return result;
35118 : }
35119 :
35120 :
35121 0 : static PyObject *py_samr_QueryDisplayInfo_in_get_domain_handle(PyObject *obj, void *closure)
35122 : {
35123 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35124 0 : PyObject *py_domain_handle;
35125 0 : if (object->in.domain_handle == NULL) {
35126 0 : Py_RETURN_NONE;
35127 : }
35128 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
35129 0 : return py_domain_handle;
35130 : }
35131 :
35132 0 : static int py_samr_QueryDisplayInfo_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
35133 : {
35134 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35135 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
35136 0 : if (value == NULL) {
35137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
35138 0 : return -1;
35139 : }
35140 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
35141 0 : if (object->in.domain_handle == NULL) {
35142 0 : PyErr_NoMemory();
35143 0 : return -1;
35144 : }
35145 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35146 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35147 0 : PyErr_NoMemory();
35148 0 : return -1;
35149 : }
35150 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
35151 0 : return 0;
35152 : }
35153 :
35154 0 : static PyObject *py_samr_QueryDisplayInfo_in_get_level(PyObject *obj, void *closure)
35155 : {
35156 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35157 0 : PyObject *py_level;
35158 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35159 0 : return py_level;
35160 : }
35161 :
35162 0 : static int py_samr_QueryDisplayInfo_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35163 : {
35164 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35165 0 : if (value == NULL) {
35166 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35167 0 : return -1;
35168 : }
35169 : {
35170 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35171 0 : if (PyLong_Check(value)) {
35172 0 : unsigned long long test_var;
35173 0 : test_var = PyLong_AsUnsignedLongLong(value);
35174 0 : if (PyErr_Occurred() != NULL) {
35175 0 : return -1;
35176 : }
35177 0 : if (test_var > uint_max) {
35178 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35179 : PyLong_Type.tp_name, uint_max, test_var);
35180 0 : return -1;
35181 : }
35182 0 : object->in.level = test_var;
35183 : } else {
35184 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35185 : PyLong_Type.tp_name);
35186 0 : return -1;
35187 : }
35188 : }
35189 0 : return 0;
35190 : }
35191 :
35192 0 : static PyObject *py_samr_QueryDisplayInfo_in_get_start_idx(PyObject *obj, void *closure)
35193 : {
35194 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35195 0 : PyObject *py_start_idx;
35196 0 : py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx);
35197 0 : return py_start_idx;
35198 : }
35199 :
35200 0 : static int py_samr_QueryDisplayInfo_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure)
35201 : {
35202 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35203 0 : if (value == NULL) {
35204 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx");
35205 0 : return -1;
35206 : }
35207 : {
35208 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx));
35209 0 : if (PyLong_Check(value)) {
35210 0 : unsigned long long test_var;
35211 0 : test_var = PyLong_AsUnsignedLongLong(value);
35212 0 : if (PyErr_Occurred() != NULL) {
35213 0 : return -1;
35214 : }
35215 0 : if (test_var > uint_max) {
35216 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35217 : PyLong_Type.tp_name, uint_max, test_var);
35218 0 : return -1;
35219 : }
35220 0 : object->in.start_idx = test_var;
35221 : } else {
35222 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35223 : PyLong_Type.tp_name);
35224 0 : return -1;
35225 : }
35226 : }
35227 0 : return 0;
35228 : }
35229 :
35230 0 : static PyObject *py_samr_QueryDisplayInfo_in_get_max_entries(PyObject *obj, void *closure)
35231 : {
35232 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35233 0 : PyObject *py_max_entries;
35234 0 : py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries);
35235 0 : return py_max_entries;
35236 : }
35237 :
35238 0 : static int py_samr_QueryDisplayInfo_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure)
35239 : {
35240 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35241 0 : if (value == NULL) {
35242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries");
35243 0 : return -1;
35244 : }
35245 : {
35246 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries));
35247 0 : if (PyLong_Check(value)) {
35248 0 : unsigned long long test_var;
35249 0 : test_var = PyLong_AsUnsignedLongLong(value);
35250 0 : if (PyErr_Occurred() != NULL) {
35251 0 : return -1;
35252 : }
35253 0 : if (test_var > uint_max) {
35254 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35255 : PyLong_Type.tp_name, uint_max, test_var);
35256 0 : return -1;
35257 : }
35258 0 : object->in.max_entries = test_var;
35259 : } else {
35260 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35261 : PyLong_Type.tp_name);
35262 0 : return -1;
35263 : }
35264 : }
35265 0 : return 0;
35266 : }
35267 :
35268 0 : static PyObject *py_samr_QueryDisplayInfo_in_get_buf_size(PyObject *obj, void *closure)
35269 : {
35270 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35271 0 : PyObject *py_buf_size;
35272 0 : py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size);
35273 0 : return py_buf_size;
35274 : }
35275 :
35276 0 : static int py_samr_QueryDisplayInfo_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure)
35277 : {
35278 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35279 0 : if (value == NULL) {
35280 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size");
35281 0 : return -1;
35282 : }
35283 : {
35284 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size));
35285 0 : if (PyLong_Check(value)) {
35286 0 : unsigned long long test_var;
35287 0 : test_var = PyLong_AsUnsignedLongLong(value);
35288 0 : if (PyErr_Occurred() != NULL) {
35289 0 : return -1;
35290 : }
35291 0 : if (test_var > uint_max) {
35292 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35293 : PyLong_Type.tp_name, uint_max, test_var);
35294 0 : return -1;
35295 : }
35296 0 : object->in.buf_size = test_var;
35297 : } else {
35298 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35299 : PyLong_Type.tp_name);
35300 0 : return -1;
35301 : }
35302 : }
35303 0 : return 0;
35304 : }
35305 :
35306 0 : static PyObject *py_samr_QueryDisplayInfo_out_get_total_size(PyObject *obj, void *closure)
35307 : {
35308 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35309 0 : PyObject *py_total_size;
35310 0 : if (object->out.total_size == NULL) {
35311 0 : Py_RETURN_NONE;
35312 : }
35313 0 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size);
35314 0 : return py_total_size;
35315 : }
35316 :
35317 0 : static int py_samr_QueryDisplayInfo_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure)
35318 : {
35319 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35320 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size));
35321 0 : if (value == NULL) {
35322 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size");
35323 0 : return -1;
35324 : }
35325 0 : object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size);
35326 0 : if (object->out.total_size == NULL) {
35327 0 : PyErr_NoMemory();
35328 0 : return -1;
35329 : }
35330 : {
35331 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size));
35332 0 : if (PyLong_Check(value)) {
35333 0 : unsigned long long test_var;
35334 0 : test_var = PyLong_AsUnsignedLongLong(value);
35335 0 : if (PyErr_Occurred() != NULL) {
35336 0 : return -1;
35337 : }
35338 0 : if (test_var > uint_max) {
35339 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35340 : PyLong_Type.tp_name, uint_max, test_var);
35341 0 : return -1;
35342 : }
35343 0 : *object->out.total_size = test_var;
35344 : } else {
35345 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35346 : PyLong_Type.tp_name);
35347 0 : return -1;
35348 : }
35349 : }
35350 0 : return 0;
35351 : }
35352 :
35353 0 : static PyObject *py_samr_QueryDisplayInfo_out_get_returned_size(PyObject *obj, void *closure)
35354 : {
35355 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35356 0 : PyObject *py_returned_size;
35357 0 : if (object->out.returned_size == NULL) {
35358 0 : Py_RETURN_NONE;
35359 : }
35360 0 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size);
35361 0 : return py_returned_size;
35362 : }
35363 :
35364 0 : static int py_samr_QueryDisplayInfo_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure)
35365 : {
35366 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35367 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size));
35368 0 : if (value == NULL) {
35369 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size");
35370 0 : return -1;
35371 : }
35372 0 : object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size);
35373 0 : if (object->out.returned_size == NULL) {
35374 0 : PyErr_NoMemory();
35375 0 : return -1;
35376 : }
35377 : {
35378 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size));
35379 0 : if (PyLong_Check(value)) {
35380 0 : unsigned long long test_var;
35381 0 : test_var = PyLong_AsUnsignedLongLong(value);
35382 0 : if (PyErr_Occurred() != NULL) {
35383 0 : return -1;
35384 : }
35385 0 : if (test_var > uint_max) {
35386 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35387 : PyLong_Type.tp_name, uint_max, test_var);
35388 0 : return -1;
35389 : }
35390 0 : *object->out.returned_size = test_var;
35391 : } else {
35392 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35393 : PyLong_Type.tp_name);
35394 0 : return -1;
35395 : }
35396 : }
35397 0 : return 0;
35398 : }
35399 :
35400 0 : static PyObject *py_samr_QueryDisplayInfo_out_get_info(PyObject *obj, void *closure)
35401 : {
35402 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35403 0 : PyObject *py_info;
35404 0 : if (object->out.info == NULL) {
35405 0 : Py_RETURN_NONE;
35406 : }
35407 0 : py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo");
35408 0 : if (py_info == NULL) {
35409 0 : return NULL;
35410 : }
35411 0 : return py_info;
35412 : }
35413 :
35414 0 : static int py_samr_QueryDisplayInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
35415 : {
35416 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35417 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
35418 0 : if (value == NULL) {
35419 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
35420 0 : return -1;
35421 : }
35422 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
35423 0 : if (object->out.info == NULL) {
35424 0 : PyErr_NoMemory();
35425 0 : return -1;
35426 : }
35427 : {
35428 0 : union samr_DispInfo *info_switch_1;
35429 0 : info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo");
35430 0 : if (info_switch_1 == NULL) {
35431 0 : return -1;
35432 : }
35433 0 : object->out.info = info_switch_1;
35434 : }
35435 0 : return 0;
35436 : }
35437 :
35438 0 : static PyObject *py_samr_QueryDisplayInfo_get_result(PyObject *obj, void *closure)
35439 : {
35440 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(obj);
35441 0 : PyObject *py_result;
35442 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
35443 0 : return py_result;
35444 : }
35445 :
35446 0 : static int py_samr_QueryDisplayInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
35447 : {
35448 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35449 0 : if (value == NULL) {
35450 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
35451 0 : return -1;
35452 : }
35453 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
35454 0 : return 0;
35455 : }
35456 :
35457 : static PyGetSetDef py_samr_QueryDisplayInfo_getsetters[] = {
35458 : {
35459 : .name = discard_const_p(char, "in_domain_handle"),
35460 : .get = py_samr_QueryDisplayInfo_in_get_domain_handle,
35461 : .set = py_samr_QueryDisplayInfo_in_set_domain_handle,
35462 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
35463 : },
35464 : {
35465 : .name = discard_const_p(char, "in_level"),
35466 : .get = py_samr_QueryDisplayInfo_in_get_level,
35467 : .set = py_samr_QueryDisplayInfo_in_set_level,
35468 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
35469 : },
35470 : {
35471 : .name = discard_const_p(char, "in_start_idx"),
35472 : .get = py_samr_QueryDisplayInfo_in_get_start_idx,
35473 : .set = py_samr_QueryDisplayInfo_in_set_start_idx,
35474 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35475 : },
35476 : {
35477 : .name = discard_const_p(char, "in_max_entries"),
35478 : .get = py_samr_QueryDisplayInfo_in_get_max_entries,
35479 : .set = py_samr_QueryDisplayInfo_in_set_max_entries,
35480 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35481 : },
35482 : {
35483 : .name = discard_const_p(char, "in_buf_size"),
35484 : .get = py_samr_QueryDisplayInfo_in_get_buf_size,
35485 : .set = py_samr_QueryDisplayInfo_in_set_buf_size,
35486 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35487 : },
35488 : {
35489 : .name = discard_const_p(char, "out_total_size"),
35490 : .get = py_samr_QueryDisplayInfo_out_get_total_size,
35491 : .set = py_samr_QueryDisplayInfo_out_set_total_size,
35492 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35493 : },
35494 : {
35495 : .name = discard_const_p(char, "out_returned_size"),
35496 : .get = py_samr_QueryDisplayInfo_out_get_returned_size,
35497 : .set = py_samr_QueryDisplayInfo_out_set_returned_size,
35498 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
35499 : },
35500 : {
35501 : .name = discard_const_p(char, "out_info"),
35502 : .get = py_samr_QueryDisplayInfo_out_get_info,
35503 : .set = py_samr_QueryDisplayInfo_out_set_info,
35504 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo")
35505 : },
35506 : {
35507 : .name = discard_const_p(char, "result"),
35508 : .get = py_samr_QueryDisplayInfo_get_result,
35509 : .set = py_samr_QueryDisplayInfo_set_result,
35510 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
35511 : },
35512 : { .name = NULL }
35513 : };
35514 :
35515 0 : static PyObject *py_samr_QueryDisplayInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
35516 : {
35517 0 : PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo, type);
35518 0 : struct samr_QueryDisplayInfo *_self = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(self);
35519 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
35520 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
35521 0 : _self->out.total_size = talloc_zero(mem_ctx, uint32_t);
35522 0 : _self->out.returned_size = talloc_zero(mem_ctx, uint32_t);
35523 0 : _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
35524 0 : return self;
35525 : }
35526 :
35527 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
35528 : {
35529 :
35530 :
35531 0 : return PyLong_FromLong(40);
35532 : }
35533 :
35534 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
35535 : {
35536 0 : const struct ndr_interface_call *call = NULL;
35537 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35538 0 : PyObject *ret = NULL;
35539 0 : struct ndr_push *push = NULL;
35540 0 : DATA_BLOB blob;
35541 0 : enum ndr_err_code err;
35542 :
35543 0 : if (ndr_table_samr.num_calls < 41) {
35544 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_pack");
35545 0 : return NULL;
35546 : }
35547 0 : call = &ndr_table_samr.calls[40];
35548 :
35549 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
35550 0 : if (push == NULL) {
35551 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35552 0 : return NULL;
35553 : }
35554 :
35555 0 : push->flags |= ndr_push_flags;
35556 :
35557 0 : err = call->ndr_push(push, ndr_inout_flags, object);
35558 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35559 0 : TALLOC_FREE(push);
35560 0 : PyErr_SetNdrError(err);
35561 0 : return NULL;
35562 : }
35563 0 : blob = ndr_push_blob(push);
35564 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
35565 0 : TALLOC_FREE(push);
35566 0 : return ret;
35567 : }
35568 :
35569 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35570 : {
35571 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35572 0 : PyObject *bigendian_obj = NULL;
35573 0 : PyObject *ndr64_obj = NULL;
35574 0 : libndr_flags ndr_push_flags = 0;
35575 :
35576 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
35577 : discard_const_p(char *, kwnames),
35578 : &bigendian_obj,
35579 : &ndr64_obj)) {
35580 0 : return NULL;
35581 : }
35582 :
35583 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35584 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35585 : }
35586 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35587 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35588 : }
35589 :
35590 0 : return py_samr_QueryDisplayInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
35591 : }
35592 :
35593 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35594 : {
35595 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
35596 0 : PyObject *bigendian_obj = NULL;
35597 0 : PyObject *ndr64_obj = NULL;
35598 0 : libndr_flags ndr_push_flags = 0;
35599 :
35600 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
35601 : discard_const_p(char *, kwnames),
35602 : &bigendian_obj,
35603 : &ndr64_obj)) {
35604 0 : return NULL;
35605 : }
35606 :
35607 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35608 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
35609 : }
35610 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35611 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
35612 : }
35613 :
35614 0 : return py_samr_QueryDisplayInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
35615 : }
35616 :
35617 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
35618 : {
35619 0 : const struct ndr_interface_call *call = NULL;
35620 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35621 0 : struct ndr_pull *pull = NULL;
35622 0 : enum ndr_err_code err;
35623 :
35624 0 : if (ndr_table_samr.num_calls < 41) {
35625 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_unpack");
35626 0 : return NULL;
35627 : }
35628 0 : call = &ndr_table_samr.calls[40];
35629 :
35630 0 : pull = ndr_pull_init_blob(blob, object);
35631 0 : if (pull == NULL) {
35632 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
35633 0 : return NULL;
35634 : }
35635 :
35636 0 : pull->flags |= ndr_pull_flags;
35637 :
35638 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
35639 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
35640 0 : TALLOC_FREE(pull);
35641 0 : PyErr_SetNdrError(err);
35642 0 : return NULL;
35643 : }
35644 0 : if (!allow_remaining) {
35645 0 : uint32_t highest_ofs;
35646 :
35647 0 : if (pull->offset > pull->relative_highest_offset) {
35648 0 : highest_ofs = pull->offset;
35649 : } else {
35650 0 : highest_ofs = pull->relative_highest_offset;
35651 : }
35652 0 : if (highest_ofs < pull->data_size) {
35653 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
35654 : "not all bytes consumed ofs[%u] size[%u]",
35655 : highest_ofs, pull->data_size);
35656 0 : TALLOC_FREE(pull);
35657 0 : PyErr_SetNdrError(err);
35658 0 : return NULL;
35659 : }
35660 : }
35661 :
35662 0 : TALLOC_FREE(pull);
35663 0 : Py_RETURN_NONE;
35664 : }
35665 :
35666 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35667 : {
35668 0 : DATA_BLOB blob;
35669 0 : Py_ssize_t blob_length = 0;
35670 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35671 0 : PyObject *bigendian_obj = NULL;
35672 0 : PyObject *ndr64_obj = NULL;
35673 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35674 0 : PyObject *allow_remaining_obj = NULL;
35675 0 : bool allow_remaining = false;
35676 :
35677 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
35678 : discard_const_p(char *, kwnames),
35679 : &blob.data, &blob_length,
35680 : &bigendian_obj,
35681 : &ndr64_obj,
35682 : &allow_remaining_obj)) {
35683 0 : return NULL;
35684 : }
35685 0 : blob.length = blob_length;
35686 :
35687 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35688 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35689 : }
35690 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35691 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35692 : }
35693 :
35694 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35695 0 : allow_remaining = true;
35696 : }
35697 :
35698 0 : return py_samr_QueryDisplayInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
35699 : }
35700 :
35701 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
35702 : {
35703 0 : DATA_BLOB blob;
35704 0 : Py_ssize_t blob_length = 0;
35705 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
35706 0 : PyObject *bigendian_obj = NULL;
35707 0 : PyObject *ndr64_obj = NULL;
35708 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
35709 0 : PyObject *allow_remaining_obj = NULL;
35710 0 : bool allow_remaining = false;
35711 :
35712 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
35713 : discard_const_p(char *, kwnames),
35714 : &blob.data, &blob_length,
35715 : &bigendian_obj,
35716 : &ndr64_obj,
35717 : &allow_remaining_obj)) {
35718 0 : return NULL;
35719 : }
35720 0 : blob.length = blob_length;
35721 :
35722 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
35723 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
35724 : }
35725 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
35726 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
35727 : }
35728 :
35729 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
35730 0 : allow_remaining = true;
35731 : }
35732 :
35733 0 : return py_samr_QueryDisplayInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
35734 : }
35735 :
35736 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
35737 : {
35738 0 : const struct ndr_interface_call *call = NULL;
35739 0 : struct samr_QueryDisplayInfo *object = (struct samr_QueryDisplayInfo *)pytalloc_get_ptr(py_obj);
35740 0 : PyObject *ret;
35741 0 : char *retstr;
35742 :
35743 0 : if (ndr_table_samr.num_calls < 41) {
35744 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo_ndr_print");
35745 0 : return NULL;
35746 : }
35747 0 : call = &ndr_table_samr.calls[40];
35748 :
35749 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
35750 0 : ret = PyUnicode_FromString(retstr);
35751 0 : TALLOC_FREE(retstr);
35752 :
35753 0 : return ret;
35754 : }
35755 :
35756 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35757 : {
35758 0 : return py_samr_QueryDisplayInfo_ndr_print(py_obj, "samr_QueryDisplayInfo_in", NDR_IN);
35759 : }
35760 :
35761 0 : static PyObject *py_samr_QueryDisplayInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
35762 : {
35763 0 : return py_samr_QueryDisplayInfo_ndr_print(py_obj, "samr_QueryDisplayInfo_out", NDR_OUT);
35764 : }
35765 :
35766 : static PyMethodDef py_samr_QueryDisplayInfo_methods[] = {
35767 : { "opnum", (PyCFunction)py_samr_QueryDisplayInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
35768 : "samr.QueryDisplayInfo.opnum() -> 40 (0x28) " },
35769 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
35770 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
35771 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
35772 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
35773 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
35774 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
35775 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
35776 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
35777 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryDisplayInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
35778 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
35779 : { NULL, NULL, 0, NULL }
35780 : };
35781 :
35782 :
35783 : static PyTypeObject samr_QueryDisplayInfo_Type = {
35784 : PyVarObject_HEAD_INIT(NULL, 0)
35785 : .tp_name = "samr.QueryDisplayInfo",
35786 : .tp_getset = py_samr_QueryDisplayInfo_getsetters,
35787 : .tp_methods = py_samr_QueryDisplayInfo_methods,
35788 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
35789 : .tp_new = py_samr_QueryDisplayInfo_new,
35790 : };
35791 :
35792 45 : static bool pack_py_samr_QueryDisplayInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo *r)
35793 : {
35794 0 : PyObject *py_domain_handle;
35795 0 : PyObject *py_level;
35796 0 : PyObject *py_start_idx;
35797 0 : PyObject *py_max_entries;
35798 0 : PyObject *py_buf_size;
35799 45 : const char *kwnames[] = {
35800 : "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
35801 : };
35802 :
35803 45 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) {
35804 0 : return false;
35805 : }
35806 :
35807 45 : if (py_domain_handle == NULL) {
35808 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
35809 0 : return false;
35810 : }
35811 45 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
35812 45 : if (r->in.domain_handle == NULL) {
35813 0 : PyErr_NoMemory();
35814 0 : return false;
35815 : }
35816 45 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
35817 45 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
35818 0 : PyErr_NoMemory();
35819 0 : return false;
35820 : }
35821 45 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
35822 45 : if (py_level == NULL) {
35823 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
35824 0 : return false;
35825 : }
35826 : {
35827 45 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
35828 45 : if (PyLong_Check(py_level)) {
35829 0 : unsigned long long test_var;
35830 45 : test_var = PyLong_AsUnsignedLongLong(py_level);
35831 45 : if (PyErr_Occurred() != NULL) {
35832 0 : return false;
35833 : }
35834 45 : if (test_var > uint_max) {
35835 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35836 : PyLong_Type.tp_name, uint_max, test_var);
35837 0 : return false;
35838 : }
35839 45 : r->in.level = test_var;
35840 : } else {
35841 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35842 : PyLong_Type.tp_name);
35843 0 : return false;
35844 : }
35845 : }
35846 45 : if (py_start_idx == NULL) {
35847 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx");
35848 0 : return false;
35849 : }
35850 : {
35851 45 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx));
35852 45 : if (PyLong_Check(py_start_idx)) {
35853 0 : unsigned long long test_var;
35854 45 : test_var = PyLong_AsUnsignedLongLong(py_start_idx);
35855 45 : if (PyErr_Occurred() != NULL) {
35856 0 : return false;
35857 : }
35858 45 : if (test_var > uint_max) {
35859 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35860 : PyLong_Type.tp_name, uint_max, test_var);
35861 0 : return false;
35862 : }
35863 45 : r->in.start_idx = test_var;
35864 : } else {
35865 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35866 : PyLong_Type.tp_name);
35867 0 : return false;
35868 : }
35869 : }
35870 45 : if (py_max_entries == NULL) {
35871 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries");
35872 0 : return false;
35873 : }
35874 : {
35875 45 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries));
35876 45 : if (PyLong_Check(py_max_entries)) {
35877 0 : unsigned long long test_var;
35878 45 : test_var = PyLong_AsUnsignedLongLong(py_max_entries);
35879 45 : if (PyErr_Occurred() != NULL) {
35880 0 : return false;
35881 : }
35882 45 : if (test_var > uint_max) {
35883 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35884 : PyLong_Type.tp_name, uint_max, test_var);
35885 0 : return false;
35886 : }
35887 45 : r->in.max_entries = test_var;
35888 : } else {
35889 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35890 : PyLong_Type.tp_name);
35891 0 : return false;
35892 : }
35893 : }
35894 45 : if (py_buf_size == NULL) {
35895 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size");
35896 0 : return false;
35897 : }
35898 : {
35899 45 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size));
35900 45 : if (PyLong_Check(py_buf_size)) {
35901 0 : unsigned long long test_var;
35902 45 : test_var = PyLong_AsUnsignedLongLong(py_buf_size);
35903 45 : if (PyErr_Occurred() != NULL) {
35904 0 : return false;
35905 : }
35906 45 : if (test_var > uint_max) {
35907 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
35908 : PyLong_Type.tp_name, uint_max, test_var);
35909 0 : return false;
35910 : }
35911 45 : r->in.buf_size = test_var;
35912 : } else {
35913 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
35914 : PyLong_Type.tp_name);
35915 0 : return false;
35916 : }
35917 : }
35918 45 : return true;
35919 : }
35920 :
35921 45 : static PyObject *unpack_py_samr_QueryDisplayInfo_args_out(struct samr_QueryDisplayInfo *r)
35922 : {
35923 0 : PyObject *result;
35924 0 : PyObject *py_total_size;
35925 0 : PyObject *py_returned_size;
35926 0 : PyObject *py_info;
35927 45 : result = PyTuple_New(3);
35928 45 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size);
35929 45 : PyTuple_SetItem(result, 0, py_total_size);
35930 45 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size);
35931 45 : PyTuple_SetItem(result, 1, py_returned_size);
35932 45 : py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo");
35933 45 : if (py_info == NULL) {
35934 0 : return NULL;
35935 : }
35936 45 : PyTuple_SetItem(result, 2, py_info);
35937 45 : if (NT_STATUS_IS_ERR(r->out.result)) {
35938 0 : PyErr_SetNTSTATUS(r->out.result);
35939 0 : return NULL;
35940 : }
35941 :
35942 45 : return result;
35943 : }
35944 :
35945 :
35946 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_in_get_domain_handle(PyObject *obj, void *closure)
35947 : {
35948 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj);
35949 0 : PyObject *py_domain_handle;
35950 0 : if (object->in.domain_handle == NULL) {
35951 0 : Py_RETURN_NONE;
35952 : }
35953 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
35954 0 : return py_domain_handle;
35955 : }
35956 :
35957 0 : static int py_samr_GetDisplayEnumerationIndex_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
35958 : {
35959 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
35960 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
35961 0 : if (value == NULL) {
35962 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
35963 0 : return -1;
35964 : }
35965 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
35966 0 : if (object->in.domain_handle == NULL) {
35967 0 : PyErr_NoMemory();
35968 0 : return -1;
35969 : }
35970 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
35971 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
35972 0 : PyErr_NoMemory();
35973 0 : return -1;
35974 : }
35975 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
35976 0 : return 0;
35977 : }
35978 :
35979 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_in_get_level(PyObject *obj, void *closure)
35980 : {
35981 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj);
35982 0 : PyObject *py_level;
35983 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
35984 0 : return py_level;
35985 : }
35986 :
35987 0 : static int py_samr_GetDisplayEnumerationIndex_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
35988 : {
35989 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
35990 0 : if (value == NULL) {
35991 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
35992 0 : return -1;
35993 : }
35994 : {
35995 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
35996 0 : if (PyLong_Check(value)) {
35997 0 : unsigned long long test_var;
35998 0 : test_var = PyLong_AsUnsignedLongLong(value);
35999 0 : if (PyErr_Occurred() != NULL) {
36000 0 : return -1;
36001 : }
36002 0 : if (test_var > uint_max) {
36003 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36004 : PyLong_Type.tp_name, uint_max, test_var);
36005 0 : return -1;
36006 : }
36007 0 : object->in.level = test_var;
36008 : } else {
36009 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36010 : PyLong_Type.tp_name);
36011 0 : return -1;
36012 : }
36013 : }
36014 0 : return 0;
36015 : }
36016 :
36017 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_in_get_name(PyObject *obj, void *closure)
36018 : {
36019 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj);
36020 0 : PyObject *py_name;
36021 0 : if (object->in.name == NULL) {
36022 0 : Py_RETURN_NONE;
36023 : }
36024 0 : py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name);
36025 0 : return py_name;
36026 : }
36027 :
36028 0 : static int py_samr_GetDisplayEnumerationIndex_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
36029 : {
36030 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36031 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
36032 0 : if (value == NULL) {
36033 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
36034 0 : return -1;
36035 : }
36036 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
36037 0 : if (object->in.name == NULL) {
36038 0 : PyErr_NoMemory();
36039 0 : return -1;
36040 : }
36041 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
36042 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36043 0 : PyErr_NoMemory();
36044 0 : return -1;
36045 : }
36046 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
36047 0 : return 0;
36048 : }
36049 :
36050 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_out_get_idx(PyObject *obj, void *closure)
36051 : {
36052 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj);
36053 0 : PyObject *py_idx;
36054 0 : if (object->out.idx == NULL) {
36055 0 : Py_RETURN_NONE;
36056 : }
36057 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)*object->out.idx);
36058 0 : return py_idx;
36059 : }
36060 :
36061 0 : static int py_samr_GetDisplayEnumerationIndex_out_set_idx(PyObject *py_obj, PyObject *value, void *closure)
36062 : {
36063 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36064 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.idx));
36065 0 : if (value == NULL) {
36066 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.idx");
36067 0 : return -1;
36068 : }
36069 0 : object->out.idx = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.idx);
36070 0 : if (object->out.idx == NULL) {
36071 0 : PyErr_NoMemory();
36072 0 : return -1;
36073 : }
36074 : {
36075 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.idx));
36076 0 : if (PyLong_Check(value)) {
36077 0 : unsigned long long test_var;
36078 0 : test_var = PyLong_AsUnsignedLongLong(value);
36079 0 : if (PyErr_Occurred() != NULL) {
36080 0 : return -1;
36081 : }
36082 0 : if (test_var > uint_max) {
36083 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36084 : PyLong_Type.tp_name, uint_max, test_var);
36085 0 : return -1;
36086 : }
36087 0 : *object->out.idx = test_var;
36088 : } else {
36089 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36090 : PyLong_Type.tp_name);
36091 0 : return -1;
36092 : }
36093 : }
36094 0 : return 0;
36095 : }
36096 :
36097 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_get_result(PyObject *obj, void *closure)
36098 : {
36099 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(obj);
36100 0 : PyObject *py_result;
36101 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36102 0 : return py_result;
36103 : }
36104 :
36105 0 : static int py_samr_GetDisplayEnumerationIndex_set_result(PyObject *py_obj, PyObject *value, void *closure)
36106 : {
36107 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36108 0 : if (value == NULL) {
36109 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36110 0 : return -1;
36111 : }
36112 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36113 0 : return 0;
36114 : }
36115 :
36116 : static PyGetSetDef py_samr_GetDisplayEnumerationIndex_getsetters[] = {
36117 : {
36118 : .name = discard_const_p(char, "in_domain_handle"),
36119 : .get = py_samr_GetDisplayEnumerationIndex_in_get_domain_handle,
36120 : .set = py_samr_GetDisplayEnumerationIndex_in_set_domain_handle,
36121 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36122 : },
36123 : {
36124 : .name = discard_const_p(char, "in_level"),
36125 : .get = py_samr_GetDisplayEnumerationIndex_in_get_level,
36126 : .set = py_samr_GetDisplayEnumerationIndex_in_set_level,
36127 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
36128 : },
36129 : {
36130 : .name = discard_const_p(char, "in_name"),
36131 : .get = py_samr_GetDisplayEnumerationIndex_in_get_name,
36132 : .set = py_samr_GetDisplayEnumerationIndex_in_set_name,
36133 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
36134 : },
36135 : {
36136 : .name = discard_const_p(char, "out_idx"),
36137 : .get = py_samr_GetDisplayEnumerationIndex_out_get_idx,
36138 : .set = py_samr_GetDisplayEnumerationIndex_out_set_idx,
36139 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
36140 : },
36141 : {
36142 : .name = discard_const_p(char, "result"),
36143 : .get = py_samr_GetDisplayEnumerationIndex_get_result,
36144 : .set = py_samr_GetDisplayEnumerationIndex_set_result,
36145 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36146 : },
36147 : { .name = NULL }
36148 : };
36149 :
36150 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36151 : {
36152 0 : PyObject *self = pytalloc_new(struct samr_GetDisplayEnumerationIndex, type);
36153 0 : struct samr_GetDisplayEnumerationIndex *_self = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(self);
36154 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36155 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
36156 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
36157 0 : _self->out.idx = talloc_zero(mem_ctx, uint32_t);
36158 0 : return self;
36159 : }
36160 :
36161 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36162 : {
36163 :
36164 :
36165 0 : return PyLong_FromLong(41);
36166 : }
36167 :
36168 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36169 : {
36170 0 : const struct ndr_interface_call *call = NULL;
36171 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36172 0 : PyObject *ret = NULL;
36173 0 : struct ndr_push *push = NULL;
36174 0 : DATA_BLOB blob;
36175 0 : enum ndr_err_code err;
36176 :
36177 0 : if (ndr_table_samr.num_calls < 42) {
36178 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_pack");
36179 0 : return NULL;
36180 : }
36181 0 : call = &ndr_table_samr.calls[41];
36182 :
36183 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36184 0 : if (push == NULL) {
36185 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36186 0 : return NULL;
36187 : }
36188 :
36189 0 : push->flags |= ndr_push_flags;
36190 :
36191 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36192 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36193 0 : TALLOC_FREE(push);
36194 0 : PyErr_SetNdrError(err);
36195 0 : return NULL;
36196 : }
36197 0 : blob = ndr_push_blob(push);
36198 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36199 0 : TALLOC_FREE(push);
36200 0 : return ret;
36201 : }
36202 :
36203 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36204 : {
36205 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36206 0 : PyObject *bigendian_obj = NULL;
36207 0 : PyObject *ndr64_obj = NULL;
36208 0 : libndr_flags ndr_push_flags = 0;
36209 :
36210 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36211 : discard_const_p(char *, kwnames),
36212 : &bigendian_obj,
36213 : &ndr64_obj)) {
36214 0 : return NULL;
36215 : }
36216 :
36217 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36218 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36219 : }
36220 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36221 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36222 : }
36223 :
36224 0 : return py_samr_GetDisplayEnumerationIndex_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36225 : }
36226 :
36227 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36228 : {
36229 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36230 0 : PyObject *bigendian_obj = NULL;
36231 0 : PyObject *ndr64_obj = NULL;
36232 0 : libndr_flags ndr_push_flags = 0;
36233 :
36234 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36235 : discard_const_p(char *, kwnames),
36236 : &bigendian_obj,
36237 : &ndr64_obj)) {
36238 0 : return NULL;
36239 : }
36240 :
36241 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36242 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36243 : }
36244 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36245 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36246 : }
36247 :
36248 0 : return py_samr_GetDisplayEnumerationIndex_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36249 : }
36250 :
36251 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
36252 : {
36253 0 : const struct ndr_interface_call *call = NULL;
36254 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36255 0 : struct ndr_pull *pull = NULL;
36256 0 : enum ndr_err_code err;
36257 :
36258 0 : if (ndr_table_samr.num_calls < 42) {
36259 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_unpack");
36260 0 : return NULL;
36261 : }
36262 0 : call = &ndr_table_samr.calls[41];
36263 :
36264 0 : pull = ndr_pull_init_blob(blob, object);
36265 0 : if (pull == NULL) {
36266 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36267 0 : return NULL;
36268 : }
36269 :
36270 0 : pull->flags |= ndr_pull_flags;
36271 :
36272 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36273 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36274 0 : TALLOC_FREE(pull);
36275 0 : PyErr_SetNdrError(err);
36276 0 : return NULL;
36277 : }
36278 0 : if (!allow_remaining) {
36279 0 : uint32_t highest_ofs;
36280 :
36281 0 : if (pull->offset > pull->relative_highest_offset) {
36282 0 : highest_ofs = pull->offset;
36283 : } else {
36284 0 : highest_ofs = pull->relative_highest_offset;
36285 : }
36286 0 : if (highest_ofs < pull->data_size) {
36287 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36288 : "not all bytes consumed ofs[%u] size[%u]",
36289 : highest_ofs, pull->data_size);
36290 0 : TALLOC_FREE(pull);
36291 0 : PyErr_SetNdrError(err);
36292 0 : return NULL;
36293 : }
36294 : }
36295 :
36296 0 : TALLOC_FREE(pull);
36297 0 : Py_RETURN_NONE;
36298 : }
36299 :
36300 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36301 : {
36302 0 : DATA_BLOB blob;
36303 0 : Py_ssize_t blob_length = 0;
36304 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36305 0 : PyObject *bigendian_obj = NULL;
36306 0 : PyObject *ndr64_obj = NULL;
36307 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36308 0 : PyObject *allow_remaining_obj = NULL;
36309 0 : bool allow_remaining = false;
36310 :
36311 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36312 : discard_const_p(char *, kwnames),
36313 : &blob.data, &blob_length,
36314 : &bigendian_obj,
36315 : &ndr64_obj,
36316 : &allow_remaining_obj)) {
36317 0 : return NULL;
36318 : }
36319 0 : blob.length = blob_length;
36320 :
36321 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36322 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36323 : }
36324 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36325 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36326 : }
36327 :
36328 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36329 0 : allow_remaining = true;
36330 : }
36331 :
36332 0 : return py_samr_GetDisplayEnumerationIndex_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36333 : }
36334 :
36335 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36336 : {
36337 0 : DATA_BLOB blob;
36338 0 : Py_ssize_t blob_length = 0;
36339 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36340 0 : PyObject *bigendian_obj = NULL;
36341 0 : PyObject *ndr64_obj = NULL;
36342 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36343 0 : PyObject *allow_remaining_obj = NULL;
36344 0 : bool allow_remaining = false;
36345 :
36346 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36347 : discard_const_p(char *, kwnames),
36348 : &blob.data, &blob_length,
36349 : &bigendian_obj,
36350 : &ndr64_obj,
36351 : &allow_remaining_obj)) {
36352 0 : return NULL;
36353 : }
36354 0 : blob.length = blob_length;
36355 :
36356 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36357 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36358 : }
36359 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36360 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36361 : }
36362 :
36363 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36364 0 : allow_remaining = true;
36365 : }
36366 :
36367 0 : return py_samr_GetDisplayEnumerationIndex_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36368 : }
36369 :
36370 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36371 : {
36372 0 : const struct ndr_interface_call *call = NULL;
36373 0 : struct samr_GetDisplayEnumerationIndex *object = (struct samr_GetDisplayEnumerationIndex *)pytalloc_get_ptr(py_obj);
36374 0 : PyObject *ret;
36375 0 : char *retstr;
36376 :
36377 0 : if (ndr_table_samr.num_calls < 42) {
36378 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex_ndr_print");
36379 0 : return NULL;
36380 : }
36381 0 : call = &ndr_table_samr.calls[41];
36382 :
36383 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36384 0 : ret = PyUnicode_FromString(retstr);
36385 0 : TALLOC_FREE(retstr);
36386 :
36387 0 : return ret;
36388 : }
36389 :
36390 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36391 : {
36392 0 : return py_samr_GetDisplayEnumerationIndex_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex_in", NDR_IN);
36393 : }
36394 :
36395 0 : static PyObject *py_samr_GetDisplayEnumerationIndex_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36396 : {
36397 0 : return py_samr_GetDisplayEnumerationIndex_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex_out", NDR_OUT);
36398 : }
36399 :
36400 : static PyMethodDef py_samr_GetDisplayEnumerationIndex_methods[] = {
36401 : { "opnum", (PyCFunction)py_samr_GetDisplayEnumerationIndex_ndr_opnum, METH_NOARGS|METH_CLASS,
36402 : "samr.GetDisplayEnumerationIndex.opnum() -> 41 (0x29) " },
36403 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36404 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36405 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36406 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36407 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36408 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36409 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36410 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36411 : { "__ndr_print_in__", (PyCFunction)py_samr_GetDisplayEnumerationIndex_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36412 : { "__ndr_print_out__", (PyCFunction)py_samr_GetDisplayEnumerationIndex_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36413 : { NULL, NULL, 0, NULL }
36414 : };
36415 :
36416 :
36417 : static PyTypeObject samr_GetDisplayEnumerationIndex_Type = {
36418 : PyVarObject_HEAD_INIT(NULL, 0)
36419 : .tp_name = "samr.GetDisplayEnumerationIndex",
36420 : .tp_getset = py_samr_GetDisplayEnumerationIndex_getsetters,
36421 : .tp_methods = py_samr_GetDisplayEnumerationIndex_methods,
36422 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36423 : .tp_new = py_samr_GetDisplayEnumerationIndex_new,
36424 : };
36425 :
36426 0 : static bool pack_py_samr_GetDisplayEnumerationIndex_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex *r)
36427 : {
36428 0 : PyObject *py_domain_handle;
36429 0 : PyObject *py_level;
36430 0 : PyObject *py_name;
36431 0 : const char *kwnames[] = {
36432 : "domain_handle", "level", "name", NULL
36433 : };
36434 :
36435 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
36436 0 : return false;
36437 : }
36438 :
36439 0 : if (py_domain_handle == NULL) {
36440 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
36441 0 : return false;
36442 : }
36443 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
36444 0 : if (r->in.domain_handle == NULL) {
36445 0 : PyErr_NoMemory();
36446 0 : return false;
36447 : }
36448 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
36449 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
36450 0 : PyErr_NoMemory();
36451 0 : return false;
36452 : }
36453 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
36454 0 : if (py_level == NULL) {
36455 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
36456 0 : return false;
36457 : }
36458 : {
36459 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
36460 0 : if (PyLong_Check(py_level)) {
36461 0 : unsigned long long test_var;
36462 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
36463 0 : if (PyErr_Occurred() != NULL) {
36464 0 : return false;
36465 : }
36466 0 : if (test_var > uint_max) {
36467 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
36468 : PyLong_Type.tp_name, uint_max, test_var);
36469 0 : return false;
36470 : }
36471 0 : r->in.level = test_var;
36472 : } else {
36473 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
36474 : PyLong_Type.tp_name);
36475 0 : return false;
36476 : }
36477 : }
36478 0 : if (py_name == NULL) {
36479 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
36480 0 : return false;
36481 : }
36482 0 : r->in.name = talloc_ptrtype(r, r->in.name);
36483 0 : if (r->in.name == NULL) {
36484 0 : PyErr_NoMemory();
36485 0 : return false;
36486 : }
36487 0 : PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
36488 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
36489 0 : PyErr_NoMemory();
36490 0 : return false;
36491 : }
36492 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
36493 0 : return true;
36494 : }
36495 :
36496 0 : static PyObject *unpack_py_samr_GetDisplayEnumerationIndex_args_out(struct samr_GetDisplayEnumerationIndex *r)
36497 : {
36498 0 : PyObject *result;
36499 0 : PyObject *py_idx;
36500 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)*r->out.idx);
36501 0 : result = py_idx;
36502 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
36503 0 : PyErr_SetNTSTATUS(r->out.result);
36504 0 : return NULL;
36505 : }
36506 :
36507 0 : return result;
36508 : }
36509 :
36510 :
36511 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_in_get_domain_handle(PyObject *obj, void *closure)
36512 : {
36513 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(obj);
36514 0 : PyObject *py_domain_handle;
36515 0 : if (object->in.domain_handle == NULL) {
36516 0 : Py_RETURN_NONE;
36517 : }
36518 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
36519 0 : return py_domain_handle;
36520 : }
36521 :
36522 0 : static int py_samr_TestPrivateFunctionsDomain_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
36523 : {
36524 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj);
36525 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
36526 0 : if (value == NULL) {
36527 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
36528 0 : return -1;
36529 : }
36530 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
36531 0 : if (object->in.domain_handle == NULL) {
36532 0 : PyErr_NoMemory();
36533 0 : return -1;
36534 : }
36535 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36536 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36537 0 : PyErr_NoMemory();
36538 0 : return -1;
36539 : }
36540 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
36541 0 : return 0;
36542 : }
36543 :
36544 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_get_result(PyObject *obj, void *closure)
36545 : {
36546 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(obj);
36547 0 : PyObject *py_result;
36548 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36549 0 : return py_result;
36550 : }
36551 :
36552 0 : static int py_samr_TestPrivateFunctionsDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
36553 : {
36554 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj);
36555 0 : if (value == NULL) {
36556 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36557 0 : return -1;
36558 : }
36559 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36560 0 : return 0;
36561 : }
36562 :
36563 : static PyGetSetDef py_samr_TestPrivateFunctionsDomain_getsetters[] = {
36564 : {
36565 : .name = discard_const_p(char, "in_domain_handle"),
36566 : .get = py_samr_TestPrivateFunctionsDomain_in_get_domain_handle,
36567 : .set = py_samr_TestPrivateFunctionsDomain_in_set_domain_handle,
36568 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36569 : },
36570 : {
36571 : .name = discard_const_p(char, "result"),
36572 : .get = py_samr_TestPrivateFunctionsDomain_get_result,
36573 : .set = py_samr_TestPrivateFunctionsDomain_set_result,
36574 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36575 : },
36576 : { .name = NULL }
36577 : };
36578 :
36579 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36580 : {
36581 0 : PyObject *self = pytalloc_new(struct samr_TestPrivateFunctionsDomain, type);
36582 0 : struct samr_TestPrivateFunctionsDomain *_self = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(self);
36583 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36584 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
36585 0 : return self;
36586 : }
36587 :
36588 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36589 : {
36590 :
36591 :
36592 0 : return PyLong_FromLong(42);
36593 : }
36594 :
36595 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36596 : {
36597 0 : const struct ndr_interface_call *call = NULL;
36598 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj);
36599 0 : PyObject *ret = NULL;
36600 0 : struct ndr_push *push = NULL;
36601 0 : DATA_BLOB blob;
36602 0 : enum ndr_err_code err;
36603 :
36604 0 : if (ndr_table_samr.num_calls < 43) {
36605 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_pack");
36606 0 : return NULL;
36607 : }
36608 0 : call = &ndr_table_samr.calls[42];
36609 :
36610 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36611 0 : if (push == NULL) {
36612 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36613 0 : return NULL;
36614 : }
36615 :
36616 0 : push->flags |= ndr_push_flags;
36617 :
36618 0 : err = call->ndr_push(push, ndr_inout_flags, object);
36619 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36620 0 : TALLOC_FREE(push);
36621 0 : PyErr_SetNdrError(err);
36622 0 : return NULL;
36623 : }
36624 0 : blob = ndr_push_blob(push);
36625 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
36626 0 : TALLOC_FREE(push);
36627 0 : return ret;
36628 : }
36629 :
36630 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36631 : {
36632 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36633 0 : PyObject *bigendian_obj = NULL;
36634 0 : PyObject *ndr64_obj = NULL;
36635 0 : libndr_flags ndr_push_flags = 0;
36636 :
36637 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
36638 : discard_const_p(char *, kwnames),
36639 : &bigendian_obj,
36640 : &ndr64_obj)) {
36641 0 : return NULL;
36642 : }
36643 :
36644 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36645 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36646 : }
36647 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36648 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36649 : }
36650 :
36651 0 : return py_samr_TestPrivateFunctionsDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
36652 : }
36653 :
36654 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36655 : {
36656 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
36657 0 : PyObject *bigendian_obj = NULL;
36658 0 : PyObject *ndr64_obj = NULL;
36659 0 : libndr_flags ndr_push_flags = 0;
36660 :
36661 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
36662 : discard_const_p(char *, kwnames),
36663 : &bigendian_obj,
36664 : &ndr64_obj)) {
36665 0 : return NULL;
36666 : }
36667 :
36668 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36669 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
36670 : }
36671 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36672 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
36673 : }
36674 :
36675 0 : return py_samr_TestPrivateFunctionsDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
36676 : }
36677 :
36678 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
36679 : {
36680 0 : const struct ndr_interface_call *call = NULL;
36681 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj);
36682 0 : struct ndr_pull *pull = NULL;
36683 0 : enum ndr_err_code err;
36684 :
36685 0 : if (ndr_table_samr.num_calls < 43) {
36686 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_unpack");
36687 0 : return NULL;
36688 : }
36689 0 : call = &ndr_table_samr.calls[42];
36690 :
36691 0 : pull = ndr_pull_init_blob(blob, object);
36692 0 : if (pull == NULL) {
36693 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36694 0 : return NULL;
36695 : }
36696 :
36697 0 : pull->flags |= ndr_pull_flags;
36698 :
36699 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
36700 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
36701 0 : TALLOC_FREE(pull);
36702 0 : PyErr_SetNdrError(err);
36703 0 : return NULL;
36704 : }
36705 0 : if (!allow_remaining) {
36706 0 : uint32_t highest_ofs;
36707 :
36708 0 : if (pull->offset > pull->relative_highest_offset) {
36709 0 : highest_ofs = pull->offset;
36710 : } else {
36711 0 : highest_ofs = pull->relative_highest_offset;
36712 : }
36713 0 : if (highest_ofs < pull->data_size) {
36714 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
36715 : "not all bytes consumed ofs[%u] size[%u]",
36716 : highest_ofs, pull->data_size);
36717 0 : TALLOC_FREE(pull);
36718 0 : PyErr_SetNdrError(err);
36719 0 : return NULL;
36720 : }
36721 : }
36722 :
36723 0 : TALLOC_FREE(pull);
36724 0 : Py_RETURN_NONE;
36725 : }
36726 :
36727 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36728 : {
36729 0 : DATA_BLOB blob;
36730 0 : Py_ssize_t blob_length = 0;
36731 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36732 0 : PyObject *bigendian_obj = NULL;
36733 0 : PyObject *ndr64_obj = NULL;
36734 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36735 0 : PyObject *allow_remaining_obj = NULL;
36736 0 : bool allow_remaining = false;
36737 :
36738 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
36739 : discard_const_p(char *, kwnames),
36740 : &blob.data, &blob_length,
36741 : &bigendian_obj,
36742 : &ndr64_obj,
36743 : &allow_remaining_obj)) {
36744 0 : return NULL;
36745 : }
36746 0 : blob.length = blob_length;
36747 :
36748 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36749 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36750 : }
36751 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36752 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36753 : }
36754 :
36755 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36756 0 : allow_remaining = true;
36757 : }
36758 :
36759 0 : return py_samr_TestPrivateFunctionsDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
36760 : }
36761 :
36762 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
36763 : {
36764 0 : DATA_BLOB blob;
36765 0 : Py_ssize_t blob_length = 0;
36766 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
36767 0 : PyObject *bigendian_obj = NULL;
36768 0 : PyObject *ndr64_obj = NULL;
36769 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
36770 0 : PyObject *allow_remaining_obj = NULL;
36771 0 : bool allow_remaining = false;
36772 :
36773 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
36774 : discard_const_p(char *, kwnames),
36775 : &blob.data, &blob_length,
36776 : &bigendian_obj,
36777 : &ndr64_obj,
36778 : &allow_remaining_obj)) {
36779 0 : return NULL;
36780 : }
36781 0 : blob.length = blob_length;
36782 :
36783 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
36784 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
36785 : }
36786 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
36787 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
36788 : }
36789 :
36790 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
36791 0 : allow_remaining = true;
36792 : }
36793 :
36794 0 : return py_samr_TestPrivateFunctionsDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
36795 : }
36796 :
36797 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
36798 : {
36799 0 : const struct ndr_interface_call *call = NULL;
36800 0 : struct samr_TestPrivateFunctionsDomain *object = (struct samr_TestPrivateFunctionsDomain *)pytalloc_get_ptr(py_obj);
36801 0 : PyObject *ret;
36802 0 : char *retstr;
36803 :
36804 0 : if (ndr_table_samr.num_calls < 43) {
36805 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsDomain_ndr_print");
36806 0 : return NULL;
36807 : }
36808 0 : call = &ndr_table_samr.calls[42];
36809 :
36810 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
36811 0 : ret = PyUnicode_FromString(retstr);
36812 0 : TALLOC_FREE(retstr);
36813 :
36814 0 : return ret;
36815 : }
36816 :
36817 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36818 : {
36819 0 : return py_samr_TestPrivateFunctionsDomain_ndr_print(py_obj, "samr_TestPrivateFunctionsDomain_in", NDR_IN);
36820 : }
36821 :
36822 0 : static PyObject *py_samr_TestPrivateFunctionsDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
36823 : {
36824 0 : return py_samr_TestPrivateFunctionsDomain_ndr_print(py_obj, "samr_TestPrivateFunctionsDomain_out", NDR_OUT);
36825 : }
36826 :
36827 : static PyMethodDef py_samr_TestPrivateFunctionsDomain_methods[] = {
36828 : { "opnum", (PyCFunction)py_samr_TestPrivateFunctionsDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
36829 : "samr.TestPrivateFunctionsDomain.opnum() -> 42 (0x2a) " },
36830 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
36831 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
36832 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
36833 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
36834 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
36835 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
36836 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
36837 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
36838 : { "__ndr_print_in__", (PyCFunction)py_samr_TestPrivateFunctionsDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
36839 : { "__ndr_print_out__", (PyCFunction)py_samr_TestPrivateFunctionsDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
36840 : { NULL, NULL, 0, NULL }
36841 : };
36842 :
36843 :
36844 : static PyTypeObject samr_TestPrivateFunctionsDomain_Type = {
36845 : PyVarObject_HEAD_INIT(NULL, 0)
36846 : .tp_name = "samr.TestPrivateFunctionsDomain",
36847 : .tp_getset = py_samr_TestPrivateFunctionsDomain_getsetters,
36848 : .tp_methods = py_samr_TestPrivateFunctionsDomain_methods,
36849 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
36850 : .tp_new = py_samr_TestPrivateFunctionsDomain_new,
36851 : };
36852 :
36853 0 : static bool pack_py_samr_TestPrivateFunctionsDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsDomain *r)
36854 : {
36855 0 : PyObject *py_domain_handle;
36856 0 : const char *kwnames[] = {
36857 : "domain_handle", NULL
36858 : };
36859 :
36860 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsDomain", discard_const_p(char *, kwnames), &py_domain_handle)) {
36861 0 : return false;
36862 : }
36863 :
36864 0 : if (py_domain_handle == NULL) {
36865 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
36866 0 : return false;
36867 : }
36868 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
36869 0 : if (r->in.domain_handle == NULL) {
36870 0 : PyErr_NoMemory();
36871 0 : return false;
36872 : }
36873 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
36874 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
36875 0 : PyErr_NoMemory();
36876 0 : return false;
36877 : }
36878 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
36879 0 : return true;
36880 : }
36881 :
36882 0 : static PyObject *unpack_py_samr_TestPrivateFunctionsDomain_args_out(struct samr_TestPrivateFunctionsDomain *r)
36883 : {
36884 0 : PyObject *result;
36885 0 : result = Py_None;
36886 0 : Py_INCREF(result);
36887 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
36888 0 : PyErr_SetNTSTATUS(r->out.result);
36889 0 : return NULL;
36890 : }
36891 :
36892 0 : return result;
36893 : }
36894 :
36895 :
36896 0 : static PyObject *py_samr_TestPrivateFunctionsUser_in_get_user_handle(PyObject *obj, void *closure)
36897 : {
36898 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(obj);
36899 0 : PyObject *py_user_handle;
36900 0 : if (object->in.user_handle == NULL) {
36901 0 : Py_RETURN_NONE;
36902 : }
36903 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
36904 0 : return py_user_handle;
36905 : }
36906 :
36907 0 : static int py_samr_TestPrivateFunctionsUser_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
36908 : {
36909 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj);
36910 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
36911 0 : if (value == NULL) {
36912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
36913 0 : return -1;
36914 : }
36915 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
36916 0 : if (object->in.user_handle == NULL) {
36917 0 : PyErr_NoMemory();
36918 0 : return -1;
36919 : }
36920 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
36921 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
36922 0 : PyErr_NoMemory();
36923 0 : return -1;
36924 : }
36925 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
36926 0 : return 0;
36927 : }
36928 :
36929 0 : static PyObject *py_samr_TestPrivateFunctionsUser_get_result(PyObject *obj, void *closure)
36930 : {
36931 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(obj);
36932 0 : PyObject *py_result;
36933 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
36934 0 : return py_result;
36935 : }
36936 :
36937 0 : static int py_samr_TestPrivateFunctionsUser_set_result(PyObject *py_obj, PyObject *value, void *closure)
36938 : {
36939 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj);
36940 0 : if (value == NULL) {
36941 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
36942 0 : return -1;
36943 : }
36944 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
36945 0 : return 0;
36946 : }
36947 :
36948 : static PyGetSetDef py_samr_TestPrivateFunctionsUser_getsetters[] = {
36949 : {
36950 : .name = discard_const_p(char, "in_user_handle"),
36951 : .get = py_samr_TestPrivateFunctionsUser_in_get_user_handle,
36952 : .set = py_samr_TestPrivateFunctionsUser_in_set_user_handle,
36953 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
36954 : },
36955 : {
36956 : .name = discard_const_p(char, "result"),
36957 : .get = py_samr_TestPrivateFunctionsUser_get_result,
36958 : .set = py_samr_TestPrivateFunctionsUser_set_result,
36959 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
36960 : },
36961 : { .name = NULL }
36962 : };
36963 :
36964 0 : static PyObject *py_samr_TestPrivateFunctionsUser_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
36965 : {
36966 0 : PyObject *self = pytalloc_new(struct samr_TestPrivateFunctionsUser, type);
36967 0 : struct samr_TestPrivateFunctionsUser *_self = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(self);
36968 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
36969 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
36970 0 : return self;
36971 : }
36972 :
36973 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
36974 : {
36975 :
36976 :
36977 0 : return PyLong_FromLong(43);
36978 : }
36979 :
36980 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
36981 : {
36982 0 : const struct ndr_interface_call *call = NULL;
36983 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj);
36984 0 : PyObject *ret = NULL;
36985 0 : struct ndr_push *push = NULL;
36986 0 : DATA_BLOB blob;
36987 0 : enum ndr_err_code err;
36988 :
36989 0 : if (ndr_table_samr.num_calls < 44) {
36990 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_pack");
36991 0 : return NULL;
36992 : }
36993 0 : call = &ndr_table_samr.calls[43];
36994 :
36995 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
36996 0 : if (push == NULL) {
36997 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
36998 0 : return NULL;
36999 : }
37000 :
37001 0 : push->flags |= ndr_push_flags;
37002 :
37003 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37004 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37005 0 : TALLOC_FREE(push);
37006 0 : PyErr_SetNdrError(err);
37007 0 : return NULL;
37008 : }
37009 0 : blob = ndr_push_blob(push);
37010 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37011 0 : TALLOC_FREE(push);
37012 0 : return ret;
37013 : }
37014 :
37015 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37016 : {
37017 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37018 0 : PyObject *bigendian_obj = NULL;
37019 0 : PyObject *ndr64_obj = NULL;
37020 0 : libndr_flags ndr_push_flags = 0;
37021 :
37022 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37023 : discard_const_p(char *, kwnames),
37024 : &bigendian_obj,
37025 : &ndr64_obj)) {
37026 0 : return NULL;
37027 : }
37028 :
37029 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37030 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37031 : }
37032 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37033 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37034 : }
37035 :
37036 0 : return py_samr_TestPrivateFunctionsUser_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37037 : }
37038 :
37039 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37040 : {
37041 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37042 0 : PyObject *bigendian_obj = NULL;
37043 0 : PyObject *ndr64_obj = NULL;
37044 0 : libndr_flags ndr_push_flags = 0;
37045 :
37046 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37047 : discard_const_p(char *, kwnames),
37048 : &bigendian_obj,
37049 : &ndr64_obj)) {
37050 0 : return NULL;
37051 : }
37052 :
37053 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37054 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37055 : }
37056 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37057 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37058 : }
37059 :
37060 0 : return py_samr_TestPrivateFunctionsUser_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37061 : }
37062 :
37063 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37064 : {
37065 0 : const struct ndr_interface_call *call = NULL;
37066 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj);
37067 0 : struct ndr_pull *pull = NULL;
37068 0 : enum ndr_err_code err;
37069 :
37070 0 : if (ndr_table_samr.num_calls < 44) {
37071 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_unpack");
37072 0 : return NULL;
37073 : }
37074 0 : call = &ndr_table_samr.calls[43];
37075 :
37076 0 : pull = ndr_pull_init_blob(blob, object);
37077 0 : if (pull == NULL) {
37078 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37079 0 : return NULL;
37080 : }
37081 :
37082 0 : pull->flags |= ndr_pull_flags;
37083 :
37084 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37085 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37086 0 : TALLOC_FREE(pull);
37087 0 : PyErr_SetNdrError(err);
37088 0 : return NULL;
37089 : }
37090 0 : if (!allow_remaining) {
37091 0 : uint32_t highest_ofs;
37092 :
37093 0 : if (pull->offset > pull->relative_highest_offset) {
37094 0 : highest_ofs = pull->offset;
37095 : } else {
37096 0 : highest_ofs = pull->relative_highest_offset;
37097 : }
37098 0 : if (highest_ofs < pull->data_size) {
37099 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37100 : "not all bytes consumed ofs[%u] size[%u]",
37101 : highest_ofs, pull->data_size);
37102 0 : TALLOC_FREE(pull);
37103 0 : PyErr_SetNdrError(err);
37104 0 : return NULL;
37105 : }
37106 : }
37107 :
37108 0 : TALLOC_FREE(pull);
37109 0 : Py_RETURN_NONE;
37110 : }
37111 :
37112 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37113 : {
37114 0 : DATA_BLOB blob;
37115 0 : Py_ssize_t blob_length = 0;
37116 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37117 0 : PyObject *bigendian_obj = NULL;
37118 0 : PyObject *ndr64_obj = NULL;
37119 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37120 0 : PyObject *allow_remaining_obj = NULL;
37121 0 : bool allow_remaining = false;
37122 :
37123 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37124 : discard_const_p(char *, kwnames),
37125 : &blob.data, &blob_length,
37126 : &bigendian_obj,
37127 : &ndr64_obj,
37128 : &allow_remaining_obj)) {
37129 0 : return NULL;
37130 : }
37131 0 : blob.length = blob_length;
37132 :
37133 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37134 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37135 : }
37136 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37137 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37138 : }
37139 :
37140 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37141 0 : allow_remaining = true;
37142 : }
37143 :
37144 0 : return py_samr_TestPrivateFunctionsUser_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37145 : }
37146 :
37147 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37148 : {
37149 0 : DATA_BLOB blob;
37150 0 : Py_ssize_t blob_length = 0;
37151 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37152 0 : PyObject *bigendian_obj = NULL;
37153 0 : PyObject *ndr64_obj = NULL;
37154 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37155 0 : PyObject *allow_remaining_obj = NULL;
37156 0 : bool allow_remaining = false;
37157 :
37158 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37159 : discard_const_p(char *, kwnames),
37160 : &blob.data, &blob_length,
37161 : &bigendian_obj,
37162 : &ndr64_obj,
37163 : &allow_remaining_obj)) {
37164 0 : return NULL;
37165 : }
37166 0 : blob.length = blob_length;
37167 :
37168 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37169 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37170 : }
37171 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37172 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37173 : }
37174 :
37175 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37176 0 : allow_remaining = true;
37177 : }
37178 :
37179 0 : return py_samr_TestPrivateFunctionsUser_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37180 : }
37181 :
37182 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37183 : {
37184 0 : const struct ndr_interface_call *call = NULL;
37185 0 : struct samr_TestPrivateFunctionsUser *object = (struct samr_TestPrivateFunctionsUser *)pytalloc_get_ptr(py_obj);
37186 0 : PyObject *ret;
37187 0 : char *retstr;
37188 :
37189 0 : if (ndr_table_samr.num_calls < 44) {
37190 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_TestPrivateFunctionsUser_ndr_print");
37191 0 : return NULL;
37192 : }
37193 0 : call = &ndr_table_samr.calls[43];
37194 :
37195 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37196 0 : ret = PyUnicode_FromString(retstr);
37197 0 : TALLOC_FREE(retstr);
37198 :
37199 0 : return ret;
37200 : }
37201 :
37202 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37203 : {
37204 0 : return py_samr_TestPrivateFunctionsUser_ndr_print(py_obj, "samr_TestPrivateFunctionsUser_in", NDR_IN);
37205 : }
37206 :
37207 0 : static PyObject *py_samr_TestPrivateFunctionsUser_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37208 : {
37209 0 : return py_samr_TestPrivateFunctionsUser_ndr_print(py_obj, "samr_TestPrivateFunctionsUser_out", NDR_OUT);
37210 : }
37211 :
37212 : static PyMethodDef py_samr_TestPrivateFunctionsUser_methods[] = {
37213 : { "opnum", (PyCFunction)py_samr_TestPrivateFunctionsUser_ndr_opnum, METH_NOARGS|METH_CLASS,
37214 : "samr.TestPrivateFunctionsUser.opnum() -> 43 (0x2b) " },
37215 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsUser_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37216 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37217 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsUser_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37218 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37219 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsUser_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37220 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37221 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_TestPrivateFunctionsUser_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37222 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37223 : { "__ndr_print_in__", (PyCFunction)py_samr_TestPrivateFunctionsUser_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37224 : { "__ndr_print_out__", (PyCFunction)py_samr_TestPrivateFunctionsUser_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37225 : { NULL, NULL, 0, NULL }
37226 : };
37227 :
37228 :
37229 : static PyTypeObject samr_TestPrivateFunctionsUser_Type = {
37230 : PyVarObject_HEAD_INIT(NULL, 0)
37231 : .tp_name = "samr.TestPrivateFunctionsUser",
37232 : .tp_getset = py_samr_TestPrivateFunctionsUser_getsetters,
37233 : .tp_methods = py_samr_TestPrivateFunctionsUser_methods,
37234 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37235 : .tp_new = py_samr_TestPrivateFunctionsUser_new,
37236 : };
37237 :
37238 0 : static bool pack_py_samr_TestPrivateFunctionsUser_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsUser *r)
37239 : {
37240 0 : PyObject *py_user_handle;
37241 0 : const char *kwnames[] = {
37242 : "user_handle", NULL
37243 : };
37244 :
37245 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsUser", discard_const_p(char *, kwnames), &py_user_handle)) {
37246 0 : return false;
37247 : }
37248 :
37249 0 : if (py_user_handle == NULL) {
37250 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
37251 0 : return false;
37252 : }
37253 0 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
37254 0 : if (r->in.user_handle == NULL) {
37255 0 : PyErr_NoMemory();
37256 0 : return false;
37257 : }
37258 0 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
37259 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
37260 0 : PyErr_NoMemory();
37261 0 : return false;
37262 : }
37263 0 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
37264 0 : return true;
37265 : }
37266 :
37267 0 : static PyObject *unpack_py_samr_TestPrivateFunctionsUser_args_out(struct samr_TestPrivateFunctionsUser *r)
37268 : {
37269 0 : PyObject *result;
37270 0 : result = Py_None;
37271 0 : Py_INCREF(result);
37272 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37273 0 : PyErr_SetNTSTATUS(r->out.result);
37274 0 : return NULL;
37275 : }
37276 :
37277 0 : return result;
37278 : }
37279 :
37280 :
37281 0 : static PyObject *py_samr_GetUserPwInfo_in_get_user_handle(PyObject *obj, void *closure)
37282 : {
37283 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj);
37284 0 : PyObject *py_user_handle;
37285 0 : if (object->in.user_handle == NULL) {
37286 0 : Py_RETURN_NONE;
37287 : }
37288 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
37289 0 : return py_user_handle;
37290 : }
37291 :
37292 0 : static int py_samr_GetUserPwInfo_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
37293 : {
37294 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37295 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
37296 0 : if (value == NULL) {
37297 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
37298 0 : return -1;
37299 : }
37300 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
37301 0 : if (object->in.user_handle == NULL) {
37302 0 : PyErr_NoMemory();
37303 0 : return -1;
37304 : }
37305 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37306 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37307 0 : PyErr_NoMemory();
37308 0 : return -1;
37309 : }
37310 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
37311 0 : return 0;
37312 : }
37313 :
37314 0 : static PyObject *py_samr_GetUserPwInfo_out_get_info(PyObject *obj, void *closure)
37315 : {
37316 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj);
37317 0 : PyObject *py_info;
37318 0 : if (object->out.info == NULL) {
37319 0 : Py_RETURN_NONE;
37320 : }
37321 0 : py_info = pytalloc_reference_ex(&samr_PwInfo_Type, object->out.info, object->out.info);
37322 0 : return py_info;
37323 : }
37324 :
37325 0 : static int py_samr_GetUserPwInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
37326 : {
37327 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37328 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
37329 0 : if (value == NULL) {
37330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
37331 0 : return -1;
37332 : }
37333 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
37334 0 : if (object->out.info == NULL) {
37335 0 : PyErr_NoMemory();
37336 0 : return -1;
37337 : }
37338 0 : PY_CHECK_TYPE(&samr_PwInfo_Type, value, return -1;);
37339 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37340 0 : PyErr_NoMemory();
37341 0 : return -1;
37342 : }
37343 0 : object->out.info = (struct samr_PwInfo *)pytalloc_get_ptr(value);
37344 0 : return 0;
37345 : }
37346 :
37347 0 : static PyObject *py_samr_GetUserPwInfo_get_result(PyObject *obj, void *closure)
37348 : {
37349 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(obj);
37350 0 : PyObject *py_result;
37351 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37352 0 : return py_result;
37353 : }
37354 :
37355 0 : static int py_samr_GetUserPwInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
37356 : {
37357 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37358 0 : if (value == NULL) {
37359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37360 0 : return -1;
37361 : }
37362 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37363 0 : return 0;
37364 : }
37365 :
37366 : static PyGetSetDef py_samr_GetUserPwInfo_getsetters[] = {
37367 : {
37368 : .name = discard_const_p(char, "in_user_handle"),
37369 : .get = py_samr_GetUserPwInfo_in_get_user_handle,
37370 : .set = py_samr_GetUserPwInfo_in_set_user_handle,
37371 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37372 : },
37373 : {
37374 : .name = discard_const_p(char, "out_info"),
37375 : .get = py_samr_GetUserPwInfo_out_get_info,
37376 : .set = py_samr_GetUserPwInfo_out_set_info,
37377 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_PwInfo")
37378 : },
37379 : {
37380 : .name = discard_const_p(char, "result"),
37381 : .get = py_samr_GetUserPwInfo_get_result,
37382 : .set = py_samr_GetUserPwInfo_set_result,
37383 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37384 : },
37385 : { .name = NULL }
37386 : };
37387 :
37388 0 : static PyObject *py_samr_GetUserPwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37389 : {
37390 0 : PyObject *self = pytalloc_new(struct samr_GetUserPwInfo, type);
37391 0 : struct samr_GetUserPwInfo *_self = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(self);
37392 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37393 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
37394 0 : _self->out.info = talloc_zero(mem_ctx, struct samr_PwInfo);
37395 0 : return self;
37396 : }
37397 :
37398 0 : static PyObject *py_samr_GetUserPwInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37399 : {
37400 :
37401 :
37402 0 : return PyLong_FromLong(44);
37403 : }
37404 :
37405 0 : static PyObject *py_samr_GetUserPwInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37406 : {
37407 0 : const struct ndr_interface_call *call = NULL;
37408 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37409 0 : PyObject *ret = NULL;
37410 0 : struct ndr_push *push = NULL;
37411 0 : DATA_BLOB blob;
37412 0 : enum ndr_err_code err;
37413 :
37414 0 : if (ndr_table_samr.num_calls < 45) {
37415 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_pack");
37416 0 : return NULL;
37417 : }
37418 0 : call = &ndr_table_samr.calls[44];
37419 :
37420 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37421 0 : if (push == NULL) {
37422 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37423 0 : return NULL;
37424 : }
37425 :
37426 0 : push->flags |= ndr_push_flags;
37427 :
37428 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37429 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37430 0 : TALLOC_FREE(push);
37431 0 : PyErr_SetNdrError(err);
37432 0 : return NULL;
37433 : }
37434 0 : blob = ndr_push_blob(push);
37435 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37436 0 : TALLOC_FREE(push);
37437 0 : return ret;
37438 : }
37439 :
37440 0 : static PyObject *py_samr_GetUserPwInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37441 : {
37442 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37443 0 : PyObject *bigendian_obj = NULL;
37444 0 : PyObject *ndr64_obj = NULL;
37445 0 : libndr_flags ndr_push_flags = 0;
37446 :
37447 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37448 : discard_const_p(char *, kwnames),
37449 : &bigendian_obj,
37450 : &ndr64_obj)) {
37451 0 : return NULL;
37452 : }
37453 :
37454 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37455 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37456 : }
37457 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37458 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37459 : }
37460 :
37461 0 : return py_samr_GetUserPwInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37462 : }
37463 :
37464 0 : static PyObject *py_samr_GetUserPwInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37465 : {
37466 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37467 0 : PyObject *bigendian_obj = NULL;
37468 0 : PyObject *ndr64_obj = NULL;
37469 0 : libndr_flags ndr_push_flags = 0;
37470 :
37471 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37472 : discard_const_p(char *, kwnames),
37473 : &bigendian_obj,
37474 : &ndr64_obj)) {
37475 0 : return NULL;
37476 : }
37477 :
37478 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37479 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37480 : }
37481 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37482 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37483 : }
37484 :
37485 0 : return py_samr_GetUserPwInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37486 : }
37487 :
37488 0 : static PyObject *py_samr_GetUserPwInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37489 : {
37490 0 : const struct ndr_interface_call *call = NULL;
37491 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37492 0 : struct ndr_pull *pull = NULL;
37493 0 : enum ndr_err_code err;
37494 :
37495 0 : if (ndr_table_samr.num_calls < 45) {
37496 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_unpack");
37497 0 : return NULL;
37498 : }
37499 0 : call = &ndr_table_samr.calls[44];
37500 :
37501 0 : pull = ndr_pull_init_blob(blob, object);
37502 0 : if (pull == NULL) {
37503 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37504 0 : return NULL;
37505 : }
37506 :
37507 0 : pull->flags |= ndr_pull_flags;
37508 :
37509 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37510 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37511 0 : TALLOC_FREE(pull);
37512 0 : PyErr_SetNdrError(err);
37513 0 : return NULL;
37514 : }
37515 0 : if (!allow_remaining) {
37516 0 : uint32_t highest_ofs;
37517 :
37518 0 : if (pull->offset > pull->relative_highest_offset) {
37519 0 : highest_ofs = pull->offset;
37520 : } else {
37521 0 : highest_ofs = pull->relative_highest_offset;
37522 : }
37523 0 : if (highest_ofs < pull->data_size) {
37524 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37525 : "not all bytes consumed ofs[%u] size[%u]",
37526 : highest_ofs, pull->data_size);
37527 0 : TALLOC_FREE(pull);
37528 0 : PyErr_SetNdrError(err);
37529 0 : return NULL;
37530 : }
37531 : }
37532 :
37533 0 : TALLOC_FREE(pull);
37534 0 : Py_RETURN_NONE;
37535 : }
37536 :
37537 0 : static PyObject *py_samr_GetUserPwInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37538 : {
37539 0 : DATA_BLOB blob;
37540 0 : Py_ssize_t blob_length = 0;
37541 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37542 0 : PyObject *bigendian_obj = NULL;
37543 0 : PyObject *ndr64_obj = NULL;
37544 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37545 0 : PyObject *allow_remaining_obj = NULL;
37546 0 : bool allow_remaining = false;
37547 :
37548 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37549 : discard_const_p(char *, kwnames),
37550 : &blob.data, &blob_length,
37551 : &bigendian_obj,
37552 : &ndr64_obj,
37553 : &allow_remaining_obj)) {
37554 0 : return NULL;
37555 : }
37556 0 : blob.length = blob_length;
37557 :
37558 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37559 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37560 : }
37561 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37562 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37563 : }
37564 :
37565 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37566 0 : allow_remaining = true;
37567 : }
37568 :
37569 0 : return py_samr_GetUserPwInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37570 : }
37571 :
37572 0 : static PyObject *py_samr_GetUserPwInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37573 : {
37574 0 : DATA_BLOB blob;
37575 0 : Py_ssize_t blob_length = 0;
37576 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37577 0 : PyObject *bigendian_obj = NULL;
37578 0 : PyObject *ndr64_obj = NULL;
37579 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37580 0 : PyObject *allow_remaining_obj = NULL;
37581 0 : bool allow_remaining = false;
37582 :
37583 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
37584 : discard_const_p(char *, kwnames),
37585 : &blob.data, &blob_length,
37586 : &bigendian_obj,
37587 : &ndr64_obj,
37588 : &allow_remaining_obj)) {
37589 0 : return NULL;
37590 : }
37591 0 : blob.length = blob_length;
37592 :
37593 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37594 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37595 : }
37596 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37597 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37598 : }
37599 :
37600 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37601 0 : allow_remaining = true;
37602 : }
37603 :
37604 0 : return py_samr_GetUserPwInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
37605 : }
37606 :
37607 0 : static PyObject *py_samr_GetUserPwInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
37608 : {
37609 0 : const struct ndr_interface_call *call = NULL;
37610 0 : struct samr_GetUserPwInfo *object = (struct samr_GetUserPwInfo *)pytalloc_get_ptr(py_obj);
37611 0 : PyObject *ret;
37612 0 : char *retstr;
37613 :
37614 0 : if (ndr_table_samr.num_calls < 45) {
37615 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetUserPwInfo_ndr_print");
37616 0 : return NULL;
37617 : }
37618 0 : call = &ndr_table_samr.calls[44];
37619 :
37620 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
37621 0 : ret = PyUnicode_FromString(retstr);
37622 0 : TALLOC_FREE(retstr);
37623 :
37624 0 : return ret;
37625 : }
37626 :
37627 0 : static PyObject *py_samr_GetUserPwInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37628 : {
37629 0 : return py_samr_GetUserPwInfo_ndr_print(py_obj, "samr_GetUserPwInfo_in", NDR_IN);
37630 : }
37631 :
37632 0 : static PyObject *py_samr_GetUserPwInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
37633 : {
37634 0 : return py_samr_GetUserPwInfo_ndr_print(py_obj, "samr_GetUserPwInfo_out", NDR_OUT);
37635 : }
37636 :
37637 : static PyMethodDef py_samr_GetUserPwInfo_methods[] = {
37638 : { "opnum", (PyCFunction)py_samr_GetUserPwInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
37639 : "samr.GetUserPwInfo.opnum() -> 44 (0x2c) " },
37640 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetUserPwInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
37641 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
37642 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetUserPwInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
37643 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
37644 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetUserPwInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
37645 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
37646 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetUserPwInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
37647 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
37648 : { "__ndr_print_in__", (PyCFunction)py_samr_GetUserPwInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
37649 : { "__ndr_print_out__", (PyCFunction)py_samr_GetUserPwInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
37650 : { NULL, NULL, 0, NULL }
37651 : };
37652 :
37653 :
37654 : static PyTypeObject samr_GetUserPwInfo_Type = {
37655 : PyVarObject_HEAD_INIT(NULL, 0)
37656 : .tp_name = "samr.GetUserPwInfo",
37657 : .tp_getset = py_samr_GetUserPwInfo_getsetters,
37658 : .tp_methods = py_samr_GetUserPwInfo_methods,
37659 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
37660 : .tp_new = py_samr_GetUserPwInfo_new,
37661 : };
37662 :
37663 0 : static bool pack_py_samr_GetUserPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetUserPwInfo *r)
37664 : {
37665 0 : PyObject *py_user_handle;
37666 0 : const char *kwnames[] = {
37667 : "user_handle", NULL
37668 : };
37669 :
37670 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetUserPwInfo", discard_const_p(char *, kwnames), &py_user_handle)) {
37671 0 : return false;
37672 : }
37673 :
37674 0 : if (py_user_handle == NULL) {
37675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
37676 0 : return false;
37677 : }
37678 0 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
37679 0 : if (r->in.user_handle == NULL) {
37680 0 : PyErr_NoMemory();
37681 0 : return false;
37682 : }
37683 0 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
37684 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
37685 0 : PyErr_NoMemory();
37686 0 : return false;
37687 : }
37688 0 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
37689 0 : return true;
37690 : }
37691 :
37692 0 : static PyObject *unpack_py_samr_GetUserPwInfo_args_out(struct samr_GetUserPwInfo *r)
37693 : {
37694 0 : PyObject *result;
37695 0 : PyObject *py_info;
37696 0 : py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
37697 0 : result = py_info;
37698 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
37699 0 : PyErr_SetNTSTATUS(r->out.result);
37700 0 : return NULL;
37701 : }
37702 :
37703 0 : return result;
37704 : }
37705 :
37706 :
37707 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_in_get_domain_handle(PyObject *obj, void *closure)
37708 : {
37709 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj);
37710 0 : PyObject *py_domain_handle;
37711 0 : if (object->in.domain_handle == NULL) {
37712 0 : Py_RETURN_NONE;
37713 : }
37714 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
37715 0 : return py_domain_handle;
37716 : }
37717 :
37718 0 : static int py_samr_RemoveMemberFromForeignDomain_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
37719 : {
37720 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
37721 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
37722 0 : if (value == NULL) {
37723 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
37724 0 : return -1;
37725 : }
37726 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
37727 0 : if (object->in.domain_handle == NULL) {
37728 0 : PyErr_NoMemory();
37729 0 : return -1;
37730 : }
37731 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
37732 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37733 0 : PyErr_NoMemory();
37734 0 : return -1;
37735 : }
37736 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
37737 0 : return 0;
37738 : }
37739 :
37740 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_in_get_sid(PyObject *obj, void *closure)
37741 : {
37742 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj);
37743 0 : PyObject *py_sid;
37744 0 : if (object->in.sid == NULL) {
37745 0 : Py_RETURN_NONE;
37746 : }
37747 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, object->in.sid, object->in.sid);
37748 0 : return py_sid;
37749 : }
37750 :
37751 0 : static int py_samr_RemoveMemberFromForeignDomain_in_set_sid(PyObject *py_obj, PyObject *value, void *closure)
37752 : {
37753 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
37754 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sid));
37755 0 : if (value == NULL) {
37756 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sid");
37757 0 : return -1;
37758 : }
37759 0 : object->in.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sid);
37760 0 : if (object->in.sid == NULL) {
37761 0 : PyErr_NoMemory();
37762 0 : return -1;
37763 : }
37764 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
37765 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
37766 0 : PyErr_NoMemory();
37767 0 : return -1;
37768 : }
37769 0 : object->in.sid = (struct dom_sid *)pytalloc_get_ptr(value);
37770 0 : return 0;
37771 : }
37772 :
37773 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_get_result(PyObject *obj, void *closure)
37774 : {
37775 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(obj);
37776 0 : PyObject *py_result;
37777 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
37778 0 : return py_result;
37779 : }
37780 :
37781 0 : static int py_samr_RemoveMemberFromForeignDomain_set_result(PyObject *py_obj, PyObject *value, void *closure)
37782 : {
37783 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
37784 0 : if (value == NULL) {
37785 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
37786 0 : return -1;
37787 : }
37788 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
37789 0 : return 0;
37790 : }
37791 :
37792 : static PyGetSetDef py_samr_RemoveMemberFromForeignDomain_getsetters[] = {
37793 : {
37794 : .name = discard_const_p(char, "in_domain_handle"),
37795 : .get = py_samr_RemoveMemberFromForeignDomain_in_get_domain_handle,
37796 : .set = py_samr_RemoveMemberFromForeignDomain_in_set_domain_handle,
37797 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
37798 : },
37799 : {
37800 : .name = discard_const_p(char, "in_sid"),
37801 : .get = py_samr_RemoveMemberFromForeignDomain_in_get_sid,
37802 : .set = py_samr_RemoveMemberFromForeignDomain_in_set_sid,
37803 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
37804 : },
37805 : {
37806 : .name = discard_const_p(char, "result"),
37807 : .get = py_samr_RemoveMemberFromForeignDomain_get_result,
37808 : .set = py_samr_RemoveMemberFromForeignDomain_set_result,
37809 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
37810 : },
37811 : { .name = NULL }
37812 : };
37813 :
37814 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
37815 : {
37816 0 : PyObject *self = pytalloc_new(struct samr_RemoveMemberFromForeignDomain, type);
37817 0 : struct samr_RemoveMemberFromForeignDomain *_self = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(self);
37818 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
37819 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
37820 0 : _self->in.sid = talloc_zero(mem_ctx, struct dom_sid2);
37821 0 : return self;
37822 : }
37823 :
37824 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
37825 : {
37826 :
37827 :
37828 0 : return PyLong_FromLong(45);
37829 : }
37830 :
37831 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
37832 : {
37833 0 : const struct ndr_interface_call *call = NULL;
37834 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
37835 0 : PyObject *ret = NULL;
37836 0 : struct ndr_push *push = NULL;
37837 0 : DATA_BLOB blob;
37838 0 : enum ndr_err_code err;
37839 :
37840 0 : if (ndr_table_samr.num_calls < 46) {
37841 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_pack");
37842 0 : return NULL;
37843 : }
37844 0 : call = &ndr_table_samr.calls[45];
37845 :
37846 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
37847 0 : if (push == NULL) {
37848 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37849 0 : return NULL;
37850 : }
37851 :
37852 0 : push->flags |= ndr_push_flags;
37853 :
37854 0 : err = call->ndr_push(push, ndr_inout_flags, object);
37855 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37856 0 : TALLOC_FREE(push);
37857 0 : PyErr_SetNdrError(err);
37858 0 : return NULL;
37859 : }
37860 0 : blob = ndr_push_blob(push);
37861 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
37862 0 : TALLOC_FREE(push);
37863 0 : return ret;
37864 : }
37865 :
37866 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37867 : {
37868 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37869 0 : PyObject *bigendian_obj = NULL;
37870 0 : PyObject *ndr64_obj = NULL;
37871 0 : libndr_flags ndr_push_flags = 0;
37872 :
37873 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
37874 : discard_const_p(char *, kwnames),
37875 : &bigendian_obj,
37876 : &ndr64_obj)) {
37877 0 : return NULL;
37878 : }
37879 :
37880 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37881 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37882 : }
37883 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37884 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37885 : }
37886 :
37887 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
37888 : }
37889 :
37890 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37891 : {
37892 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
37893 0 : PyObject *bigendian_obj = NULL;
37894 0 : PyObject *ndr64_obj = NULL;
37895 0 : libndr_flags ndr_push_flags = 0;
37896 :
37897 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
37898 : discard_const_p(char *, kwnames),
37899 : &bigendian_obj,
37900 : &ndr64_obj)) {
37901 0 : return NULL;
37902 : }
37903 :
37904 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37905 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
37906 : }
37907 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37908 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
37909 : }
37910 :
37911 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
37912 : }
37913 :
37914 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
37915 : {
37916 0 : const struct ndr_interface_call *call = NULL;
37917 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
37918 0 : struct ndr_pull *pull = NULL;
37919 0 : enum ndr_err_code err;
37920 :
37921 0 : if (ndr_table_samr.num_calls < 46) {
37922 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_unpack");
37923 0 : return NULL;
37924 : }
37925 0 : call = &ndr_table_samr.calls[45];
37926 :
37927 0 : pull = ndr_pull_init_blob(blob, object);
37928 0 : if (pull == NULL) {
37929 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
37930 0 : return NULL;
37931 : }
37932 :
37933 0 : pull->flags |= ndr_pull_flags;
37934 :
37935 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
37936 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
37937 0 : TALLOC_FREE(pull);
37938 0 : PyErr_SetNdrError(err);
37939 0 : return NULL;
37940 : }
37941 0 : if (!allow_remaining) {
37942 0 : uint32_t highest_ofs;
37943 :
37944 0 : if (pull->offset > pull->relative_highest_offset) {
37945 0 : highest_ofs = pull->offset;
37946 : } else {
37947 0 : highest_ofs = pull->relative_highest_offset;
37948 : }
37949 0 : if (highest_ofs < pull->data_size) {
37950 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
37951 : "not all bytes consumed ofs[%u] size[%u]",
37952 : highest_ofs, pull->data_size);
37953 0 : TALLOC_FREE(pull);
37954 0 : PyErr_SetNdrError(err);
37955 0 : return NULL;
37956 : }
37957 : }
37958 :
37959 0 : TALLOC_FREE(pull);
37960 0 : Py_RETURN_NONE;
37961 : }
37962 :
37963 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37964 : {
37965 0 : DATA_BLOB blob;
37966 0 : Py_ssize_t blob_length = 0;
37967 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
37968 0 : PyObject *bigendian_obj = NULL;
37969 0 : PyObject *ndr64_obj = NULL;
37970 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
37971 0 : PyObject *allow_remaining_obj = NULL;
37972 0 : bool allow_remaining = false;
37973 :
37974 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
37975 : discard_const_p(char *, kwnames),
37976 : &blob.data, &blob_length,
37977 : &bigendian_obj,
37978 : &ndr64_obj,
37979 : &allow_remaining_obj)) {
37980 0 : return NULL;
37981 : }
37982 0 : blob.length = blob_length;
37983 :
37984 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
37985 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
37986 : }
37987 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
37988 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
37989 : }
37990 :
37991 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
37992 0 : allow_remaining = true;
37993 : }
37994 :
37995 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
37996 : }
37997 :
37998 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
37999 : {
38000 0 : DATA_BLOB blob;
38001 0 : Py_ssize_t blob_length = 0;
38002 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38003 0 : PyObject *bigendian_obj = NULL;
38004 0 : PyObject *ndr64_obj = NULL;
38005 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38006 0 : PyObject *allow_remaining_obj = NULL;
38007 0 : bool allow_remaining = false;
38008 :
38009 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38010 : discard_const_p(char *, kwnames),
38011 : &blob.data, &blob_length,
38012 : &bigendian_obj,
38013 : &ndr64_obj,
38014 : &allow_remaining_obj)) {
38015 0 : return NULL;
38016 : }
38017 0 : blob.length = blob_length;
38018 :
38019 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38020 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38021 : }
38022 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38023 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38024 : }
38025 :
38026 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38027 0 : allow_remaining = true;
38028 : }
38029 :
38030 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38031 : }
38032 :
38033 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38034 : {
38035 0 : const struct ndr_interface_call *call = NULL;
38036 0 : struct samr_RemoveMemberFromForeignDomain *object = (struct samr_RemoveMemberFromForeignDomain *)pytalloc_get_ptr(py_obj);
38037 0 : PyObject *ret;
38038 0 : char *retstr;
38039 :
38040 0 : if (ndr_table_samr.num_calls < 46) {
38041 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMemberFromForeignDomain_ndr_print");
38042 0 : return NULL;
38043 : }
38044 0 : call = &ndr_table_samr.calls[45];
38045 :
38046 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38047 0 : ret = PyUnicode_FromString(retstr);
38048 0 : TALLOC_FREE(retstr);
38049 :
38050 0 : return ret;
38051 : }
38052 :
38053 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38054 : {
38055 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_print(py_obj, "samr_RemoveMemberFromForeignDomain_in", NDR_IN);
38056 : }
38057 :
38058 0 : static PyObject *py_samr_RemoveMemberFromForeignDomain_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38059 : {
38060 0 : return py_samr_RemoveMemberFromForeignDomain_ndr_print(py_obj, "samr_RemoveMemberFromForeignDomain_out", NDR_OUT);
38061 : }
38062 :
38063 : static PyMethodDef py_samr_RemoveMemberFromForeignDomain_methods[] = {
38064 : { "opnum", (PyCFunction)py_samr_RemoveMemberFromForeignDomain_ndr_opnum, METH_NOARGS|METH_CLASS,
38065 : "samr.RemoveMemberFromForeignDomain.opnum() -> 45 (0x2d) " },
38066 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMemberFromForeignDomain_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38067 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38068 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMemberFromForeignDomain_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38069 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38070 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMemberFromForeignDomain_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38071 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38072 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMemberFromForeignDomain_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38073 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38074 : { "__ndr_print_in__", (PyCFunction)py_samr_RemoveMemberFromForeignDomain_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38075 : { "__ndr_print_out__", (PyCFunction)py_samr_RemoveMemberFromForeignDomain_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38076 : { NULL, NULL, 0, NULL }
38077 : };
38078 :
38079 :
38080 : static PyTypeObject samr_RemoveMemberFromForeignDomain_Type = {
38081 : PyVarObject_HEAD_INIT(NULL, 0)
38082 : .tp_name = "samr.RemoveMemberFromForeignDomain",
38083 : .tp_getset = py_samr_RemoveMemberFromForeignDomain_getsetters,
38084 : .tp_methods = py_samr_RemoveMemberFromForeignDomain_methods,
38085 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38086 : .tp_new = py_samr_RemoveMemberFromForeignDomain_new,
38087 : };
38088 :
38089 0 : static bool pack_py_samr_RemoveMemberFromForeignDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMemberFromForeignDomain *r)
38090 : {
38091 0 : PyObject *py_domain_handle;
38092 0 : PyObject *py_sid;
38093 0 : const char *kwnames[] = {
38094 : "domain_handle", "sid", NULL
38095 : };
38096 :
38097 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMemberFromForeignDomain", discard_const_p(char *, kwnames), &py_domain_handle, &py_sid)) {
38098 0 : return false;
38099 : }
38100 :
38101 0 : if (py_domain_handle == NULL) {
38102 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
38103 0 : return false;
38104 : }
38105 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
38106 0 : if (r->in.domain_handle == NULL) {
38107 0 : PyErr_NoMemory();
38108 0 : return false;
38109 : }
38110 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
38111 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
38112 0 : PyErr_NoMemory();
38113 0 : return false;
38114 : }
38115 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
38116 0 : if (py_sid == NULL) {
38117 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sid");
38118 0 : return false;
38119 : }
38120 0 : r->in.sid = talloc_ptrtype(r, r->in.sid);
38121 0 : if (r->in.sid == NULL) {
38122 0 : PyErr_NoMemory();
38123 0 : return false;
38124 : }
38125 0 : PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
38126 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
38127 0 : PyErr_NoMemory();
38128 0 : return false;
38129 : }
38130 0 : r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
38131 0 : return true;
38132 : }
38133 :
38134 0 : static PyObject *unpack_py_samr_RemoveMemberFromForeignDomain_args_out(struct samr_RemoveMemberFromForeignDomain *r)
38135 : {
38136 0 : PyObject *result;
38137 0 : result = Py_None;
38138 0 : Py_INCREF(result);
38139 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38140 0 : PyErr_SetNTSTATUS(r->out.result);
38141 0 : return NULL;
38142 : }
38143 :
38144 0 : return result;
38145 : }
38146 :
38147 :
38148 0 : static PyObject *py_samr_QueryDomainInfo2_in_get_domain_handle(PyObject *obj, void *closure)
38149 : {
38150 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj);
38151 0 : PyObject *py_domain_handle;
38152 0 : if (object->in.domain_handle == NULL) {
38153 0 : Py_RETURN_NONE;
38154 : }
38155 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
38156 0 : return py_domain_handle;
38157 : }
38158 :
38159 0 : static int py_samr_QueryDomainInfo2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
38160 : {
38161 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38162 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
38163 0 : if (value == NULL) {
38164 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
38165 0 : return -1;
38166 : }
38167 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
38168 0 : if (object->in.domain_handle == NULL) {
38169 0 : PyErr_NoMemory();
38170 0 : return -1;
38171 : }
38172 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38173 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38174 0 : PyErr_NoMemory();
38175 0 : return -1;
38176 : }
38177 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
38178 0 : return 0;
38179 : }
38180 :
38181 0 : static PyObject *py_samr_QueryDomainInfo2_in_get_level(PyObject *obj, void *closure)
38182 : {
38183 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj);
38184 0 : PyObject *py_level;
38185 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
38186 0 : return py_level;
38187 : }
38188 :
38189 0 : static int py_samr_QueryDomainInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
38190 : {
38191 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38192 0 : if (value == NULL) {
38193 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
38194 0 : return -1;
38195 : }
38196 : {
38197 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
38198 0 : if (PyLong_Check(value)) {
38199 0 : unsigned long long test_var;
38200 0 : test_var = PyLong_AsUnsignedLongLong(value);
38201 0 : if (PyErr_Occurred() != NULL) {
38202 0 : return -1;
38203 : }
38204 0 : if (test_var > uint_max) {
38205 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38206 : PyLong_Type.tp_name, uint_max, test_var);
38207 0 : return -1;
38208 : }
38209 0 : object->in.level = test_var;
38210 : } else {
38211 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38212 : PyLong_Type.tp_name);
38213 0 : return -1;
38214 : }
38215 : }
38216 0 : return 0;
38217 : }
38218 :
38219 0 : static PyObject *py_samr_QueryDomainInfo2_out_get_info(PyObject *obj, void *closure)
38220 : {
38221 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj);
38222 0 : PyObject *py_info;
38223 0 : if (object->out.info == NULL) {
38224 0 : Py_RETURN_NONE;
38225 : }
38226 0 : if (*object->out.info == NULL) {
38227 0 : py_info = Py_None;
38228 0 : Py_INCREF(py_info);
38229 : } else {
38230 0 : py_info = pyrpc_import_union(&samr_DomainInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_DomainInfo");
38231 0 : if (py_info == NULL) {
38232 0 : return NULL;
38233 : }
38234 : }
38235 0 : return py_info;
38236 : }
38237 :
38238 0 : static int py_samr_QueryDomainInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
38239 : {
38240 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38241 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
38242 0 : if (value == NULL) {
38243 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
38244 0 : return -1;
38245 : }
38246 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
38247 0 : if (object->out.info == NULL) {
38248 0 : PyErr_NoMemory();
38249 0 : return -1;
38250 : }
38251 0 : if (value == Py_None) {
38252 0 : *object->out.info = NULL;
38253 : } else {
38254 0 : *object->out.info = NULL;
38255 : {
38256 0 : union samr_DomainInfo *info_switch_2;
38257 0 : info_switch_2 = (union samr_DomainInfo *)pyrpc_export_union(&samr_DomainInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DomainInfo");
38258 0 : if (info_switch_2 == NULL) {
38259 0 : return -1;
38260 : }
38261 0 : *object->out.info = info_switch_2;
38262 : }
38263 : }
38264 0 : return 0;
38265 : }
38266 :
38267 0 : static PyObject *py_samr_QueryDomainInfo2_get_result(PyObject *obj, void *closure)
38268 : {
38269 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(obj);
38270 0 : PyObject *py_result;
38271 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38272 0 : return py_result;
38273 : }
38274 :
38275 0 : static int py_samr_QueryDomainInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure)
38276 : {
38277 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38278 0 : if (value == NULL) {
38279 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38280 0 : return -1;
38281 : }
38282 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38283 0 : return 0;
38284 : }
38285 :
38286 : static PyGetSetDef py_samr_QueryDomainInfo2_getsetters[] = {
38287 : {
38288 : .name = discard_const_p(char, "in_domain_handle"),
38289 : .get = py_samr_QueryDomainInfo2_in_get_domain_handle,
38290 : .set = py_samr_QueryDomainInfo2_in_set_domain_handle,
38291 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38292 : },
38293 : {
38294 : .name = discard_const_p(char, "in_level"),
38295 : .get = py_samr_QueryDomainInfo2_in_get_level,
38296 : .set = py_samr_QueryDomainInfo2_in_set_level,
38297 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfoClass")
38298 : },
38299 : {
38300 : .name = discard_const_p(char, "out_info"),
38301 : .get = py_samr_QueryDomainInfo2_out_get_info,
38302 : .set = py_samr_QueryDomainInfo2_out_set_info,
38303 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomainInfo")
38304 : },
38305 : {
38306 : .name = discard_const_p(char, "result"),
38307 : .get = py_samr_QueryDomainInfo2_get_result,
38308 : .set = py_samr_QueryDomainInfo2_set_result,
38309 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38310 : },
38311 : { .name = NULL }
38312 : };
38313 :
38314 0 : static PyObject *py_samr_QueryDomainInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38315 : {
38316 0 : PyObject *self = pytalloc_new(struct samr_QueryDomainInfo2, type);
38317 0 : struct samr_QueryDomainInfo2 *_self = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(self);
38318 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38319 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
38320 : /* a pointer to a NULL pointer */
38321 0 : _self->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *);
38322 0 : return self;
38323 : }
38324 :
38325 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38326 : {
38327 :
38328 :
38329 0 : return PyLong_FromLong(46);
38330 : }
38331 :
38332 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38333 : {
38334 0 : const struct ndr_interface_call *call = NULL;
38335 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38336 0 : PyObject *ret = NULL;
38337 0 : struct ndr_push *push = NULL;
38338 0 : DATA_BLOB blob;
38339 0 : enum ndr_err_code err;
38340 :
38341 0 : if (ndr_table_samr.num_calls < 47) {
38342 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_pack");
38343 0 : return NULL;
38344 : }
38345 0 : call = &ndr_table_samr.calls[46];
38346 :
38347 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38348 0 : if (push == NULL) {
38349 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38350 0 : return NULL;
38351 : }
38352 :
38353 0 : push->flags |= ndr_push_flags;
38354 :
38355 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38356 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38357 0 : TALLOC_FREE(push);
38358 0 : PyErr_SetNdrError(err);
38359 0 : return NULL;
38360 : }
38361 0 : blob = ndr_push_blob(push);
38362 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38363 0 : TALLOC_FREE(push);
38364 0 : return ret;
38365 : }
38366 :
38367 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38368 : {
38369 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38370 0 : PyObject *bigendian_obj = NULL;
38371 0 : PyObject *ndr64_obj = NULL;
38372 0 : libndr_flags ndr_push_flags = 0;
38373 :
38374 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38375 : discard_const_p(char *, kwnames),
38376 : &bigendian_obj,
38377 : &ndr64_obj)) {
38378 0 : return NULL;
38379 : }
38380 :
38381 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38382 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38383 : }
38384 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38385 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38386 : }
38387 :
38388 0 : return py_samr_QueryDomainInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38389 : }
38390 :
38391 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38392 : {
38393 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38394 0 : PyObject *bigendian_obj = NULL;
38395 0 : PyObject *ndr64_obj = NULL;
38396 0 : libndr_flags ndr_push_flags = 0;
38397 :
38398 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38399 : discard_const_p(char *, kwnames),
38400 : &bigendian_obj,
38401 : &ndr64_obj)) {
38402 0 : return NULL;
38403 : }
38404 :
38405 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38406 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38407 : }
38408 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38409 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38410 : }
38411 :
38412 0 : return py_samr_QueryDomainInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38413 : }
38414 :
38415 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38416 : {
38417 0 : const struct ndr_interface_call *call = NULL;
38418 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38419 0 : struct ndr_pull *pull = NULL;
38420 0 : enum ndr_err_code err;
38421 :
38422 0 : if (ndr_table_samr.num_calls < 47) {
38423 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_unpack");
38424 0 : return NULL;
38425 : }
38426 0 : call = &ndr_table_samr.calls[46];
38427 :
38428 0 : pull = ndr_pull_init_blob(blob, object);
38429 0 : if (pull == NULL) {
38430 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38431 0 : return NULL;
38432 : }
38433 :
38434 0 : pull->flags |= ndr_pull_flags;
38435 :
38436 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38437 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38438 0 : TALLOC_FREE(pull);
38439 0 : PyErr_SetNdrError(err);
38440 0 : return NULL;
38441 : }
38442 0 : if (!allow_remaining) {
38443 0 : uint32_t highest_ofs;
38444 :
38445 0 : if (pull->offset > pull->relative_highest_offset) {
38446 0 : highest_ofs = pull->offset;
38447 : } else {
38448 0 : highest_ofs = pull->relative_highest_offset;
38449 : }
38450 0 : if (highest_ofs < pull->data_size) {
38451 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38452 : "not all bytes consumed ofs[%u] size[%u]",
38453 : highest_ofs, pull->data_size);
38454 0 : TALLOC_FREE(pull);
38455 0 : PyErr_SetNdrError(err);
38456 0 : return NULL;
38457 : }
38458 : }
38459 :
38460 0 : TALLOC_FREE(pull);
38461 0 : Py_RETURN_NONE;
38462 : }
38463 :
38464 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38465 : {
38466 0 : DATA_BLOB blob;
38467 0 : Py_ssize_t blob_length = 0;
38468 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38469 0 : PyObject *bigendian_obj = NULL;
38470 0 : PyObject *ndr64_obj = NULL;
38471 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38472 0 : PyObject *allow_remaining_obj = NULL;
38473 0 : bool allow_remaining = false;
38474 :
38475 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38476 : discard_const_p(char *, kwnames),
38477 : &blob.data, &blob_length,
38478 : &bigendian_obj,
38479 : &ndr64_obj,
38480 : &allow_remaining_obj)) {
38481 0 : return NULL;
38482 : }
38483 0 : blob.length = blob_length;
38484 :
38485 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38486 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38487 : }
38488 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38489 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38490 : }
38491 :
38492 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38493 0 : allow_remaining = true;
38494 : }
38495 :
38496 0 : return py_samr_QueryDomainInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
38497 : }
38498 :
38499 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38500 : {
38501 0 : DATA_BLOB blob;
38502 0 : Py_ssize_t blob_length = 0;
38503 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38504 0 : PyObject *bigendian_obj = NULL;
38505 0 : PyObject *ndr64_obj = NULL;
38506 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38507 0 : PyObject *allow_remaining_obj = NULL;
38508 0 : bool allow_remaining = false;
38509 :
38510 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
38511 : discard_const_p(char *, kwnames),
38512 : &blob.data, &blob_length,
38513 : &bigendian_obj,
38514 : &ndr64_obj,
38515 : &allow_remaining_obj)) {
38516 0 : return NULL;
38517 : }
38518 0 : blob.length = blob_length;
38519 :
38520 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38521 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
38522 : }
38523 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38524 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
38525 : }
38526 :
38527 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
38528 0 : allow_remaining = true;
38529 : }
38530 :
38531 0 : return py_samr_QueryDomainInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
38532 : }
38533 :
38534 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
38535 : {
38536 0 : const struct ndr_interface_call *call = NULL;
38537 0 : struct samr_QueryDomainInfo2 *object = (struct samr_QueryDomainInfo2 *)pytalloc_get_ptr(py_obj);
38538 0 : PyObject *ret;
38539 0 : char *retstr;
38540 :
38541 0 : if (ndr_table_samr.num_calls < 47) {
38542 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDomainInfo2_ndr_print");
38543 0 : return NULL;
38544 : }
38545 0 : call = &ndr_table_samr.calls[46];
38546 :
38547 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
38548 0 : ret = PyUnicode_FromString(retstr);
38549 0 : TALLOC_FREE(retstr);
38550 :
38551 0 : return ret;
38552 : }
38553 :
38554 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38555 : {
38556 0 : return py_samr_QueryDomainInfo2_ndr_print(py_obj, "samr_QueryDomainInfo2_in", NDR_IN);
38557 : }
38558 :
38559 0 : static PyObject *py_samr_QueryDomainInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
38560 : {
38561 0 : return py_samr_QueryDomainInfo2_ndr_print(py_obj, "samr_QueryDomainInfo2_out", NDR_OUT);
38562 : }
38563 :
38564 : static PyMethodDef py_samr_QueryDomainInfo2_methods[] = {
38565 : { "opnum", (PyCFunction)py_samr_QueryDomainInfo2_ndr_opnum, METH_NOARGS|METH_CLASS,
38566 : "samr.QueryDomainInfo2.opnum() -> 46 (0x2e) " },
38567 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
38568 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
38569 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
38570 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
38571 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
38572 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
38573 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDomainInfo2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
38574 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
38575 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryDomainInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
38576 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryDomainInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
38577 : { NULL, NULL, 0, NULL }
38578 : };
38579 :
38580 :
38581 : static PyTypeObject samr_QueryDomainInfo2_Type = {
38582 : PyVarObject_HEAD_INIT(NULL, 0)
38583 : .tp_name = "samr.QueryDomainInfo2",
38584 : .tp_getset = py_samr_QueryDomainInfo2_getsetters,
38585 : .tp_methods = py_samr_QueryDomainInfo2_methods,
38586 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
38587 : .tp_new = py_samr_QueryDomainInfo2_new,
38588 : };
38589 :
38590 0 : static bool pack_py_samr_QueryDomainInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo2 *r)
38591 : {
38592 0 : PyObject *py_domain_handle;
38593 0 : PyObject *py_level;
38594 0 : const char *kwnames[] = {
38595 : "domain_handle", "level", NULL
38596 : };
38597 :
38598 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
38599 0 : return false;
38600 : }
38601 :
38602 0 : if (py_domain_handle == NULL) {
38603 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
38604 0 : return false;
38605 : }
38606 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
38607 0 : if (r->in.domain_handle == NULL) {
38608 0 : PyErr_NoMemory();
38609 0 : return false;
38610 : }
38611 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
38612 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
38613 0 : PyErr_NoMemory();
38614 0 : return false;
38615 : }
38616 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
38617 0 : if (py_level == NULL) {
38618 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
38619 0 : return false;
38620 : }
38621 : {
38622 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
38623 0 : if (PyLong_Check(py_level)) {
38624 0 : unsigned long long test_var;
38625 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
38626 0 : if (PyErr_Occurred() != NULL) {
38627 0 : return false;
38628 : }
38629 0 : if (test_var > uint_max) {
38630 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38631 : PyLong_Type.tp_name, uint_max, test_var);
38632 0 : return false;
38633 : }
38634 0 : r->in.level = test_var;
38635 : } else {
38636 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38637 : PyLong_Type.tp_name);
38638 0 : return false;
38639 : }
38640 : }
38641 0 : return true;
38642 : }
38643 :
38644 0 : static PyObject *unpack_py_samr_QueryDomainInfo2_args_out(struct samr_QueryDomainInfo2 *r)
38645 : {
38646 0 : PyObject *result;
38647 0 : PyObject *py_info;
38648 0 : if (*r->out.info == NULL) {
38649 0 : py_info = Py_None;
38650 0 : Py_INCREF(py_info);
38651 : } else {
38652 0 : py_info = pyrpc_import_union(&samr_DomainInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_DomainInfo");
38653 0 : if (py_info == NULL) {
38654 0 : return NULL;
38655 : }
38656 : }
38657 0 : result = py_info;
38658 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
38659 0 : PyErr_SetNTSTATUS(r->out.result);
38660 0 : return NULL;
38661 : }
38662 :
38663 0 : return result;
38664 : }
38665 :
38666 :
38667 0 : static PyObject *py_samr_QueryUserInfo2_in_get_user_handle(PyObject *obj, void *closure)
38668 : {
38669 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj);
38670 0 : PyObject *py_user_handle;
38671 0 : if (object->in.user_handle == NULL) {
38672 0 : Py_RETURN_NONE;
38673 : }
38674 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
38675 0 : return py_user_handle;
38676 : }
38677 :
38678 0 : static int py_samr_QueryUserInfo2_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
38679 : {
38680 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38681 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
38682 0 : if (value == NULL) {
38683 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
38684 0 : return -1;
38685 : }
38686 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
38687 0 : if (object->in.user_handle == NULL) {
38688 0 : PyErr_NoMemory();
38689 0 : return -1;
38690 : }
38691 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
38692 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
38693 0 : PyErr_NoMemory();
38694 0 : return -1;
38695 : }
38696 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
38697 0 : return 0;
38698 : }
38699 :
38700 0 : static PyObject *py_samr_QueryUserInfo2_in_get_level(PyObject *obj, void *closure)
38701 : {
38702 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj);
38703 0 : PyObject *py_level;
38704 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
38705 0 : return py_level;
38706 : }
38707 :
38708 0 : static int py_samr_QueryUserInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
38709 : {
38710 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38711 0 : if (value == NULL) {
38712 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
38713 0 : return -1;
38714 : }
38715 : {
38716 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
38717 0 : if (PyLong_Check(value)) {
38718 0 : unsigned long long test_var;
38719 0 : test_var = PyLong_AsUnsignedLongLong(value);
38720 0 : if (PyErr_Occurred() != NULL) {
38721 0 : return -1;
38722 : }
38723 0 : if (test_var > uint_max) {
38724 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
38725 : PyLong_Type.tp_name, uint_max, test_var);
38726 0 : return -1;
38727 : }
38728 0 : object->in.level = test_var;
38729 : } else {
38730 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
38731 : PyLong_Type.tp_name);
38732 0 : return -1;
38733 : }
38734 : }
38735 0 : return 0;
38736 : }
38737 :
38738 0 : static PyObject *py_samr_QueryUserInfo2_out_get_info(PyObject *obj, void *closure)
38739 : {
38740 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj);
38741 0 : PyObject *py_info;
38742 0 : if (object->out.info == NULL) {
38743 0 : Py_RETURN_NONE;
38744 : }
38745 0 : if (*object->out.info == NULL) {
38746 0 : py_info = Py_None;
38747 0 : Py_INCREF(py_info);
38748 : } else {
38749 0 : py_info = pyrpc_import_union(&samr_UserInfo_Type, *object->out.info, object->in.level, *object->out.info, "union samr_UserInfo");
38750 0 : if (py_info == NULL) {
38751 0 : return NULL;
38752 : }
38753 : }
38754 0 : return py_info;
38755 : }
38756 :
38757 0 : static int py_samr_QueryUserInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
38758 : {
38759 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38760 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
38761 0 : if (value == NULL) {
38762 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
38763 0 : return -1;
38764 : }
38765 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
38766 0 : if (object->out.info == NULL) {
38767 0 : PyErr_NoMemory();
38768 0 : return -1;
38769 : }
38770 0 : if (value == Py_None) {
38771 0 : *object->out.info = NULL;
38772 : } else {
38773 0 : *object->out.info = NULL;
38774 : {
38775 0 : union samr_UserInfo *info_switch_2;
38776 0 : info_switch_2 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo");
38777 0 : if (info_switch_2 == NULL) {
38778 0 : return -1;
38779 : }
38780 0 : *object->out.info = info_switch_2;
38781 : }
38782 : }
38783 0 : return 0;
38784 : }
38785 :
38786 0 : static PyObject *py_samr_QueryUserInfo2_get_result(PyObject *obj, void *closure)
38787 : {
38788 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(obj);
38789 0 : PyObject *py_result;
38790 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
38791 0 : return py_result;
38792 : }
38793 :
38794 0 : static int py_samr_QueryUserInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure)
38795 : {
38796 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38797 0 : if (value == NULL) {
38798 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
38799 0 : return -1;
38800 : }
38801 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
38802 0 : return 0;
38803 : }
38804 :
38805 : static PyGetSetDef py_samr_QueryUserInfo2_getsetters[] = {
38806 : {
38807 : .name = discard_const_p(char, "in_user_handle"),
38808 : .get = py_samr_QueryUserInfo2_in_get_user_handle,
38809 : .set = py_samr_QueryUserInfo2_in_set_user_handle,
38810 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
38811 : },
38812 : {
38813 : .name = discard_const_p(char, "in_level"),
38814 : .get = py_samr_QueryUserInfo2_in_get_level,
38815 : .set = py_samr_QueryUserInfo2_in_set_level,
38816 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel")
38817 : },
38818 : {
38819 : .name = discard_const_p(char, "out_info"),
38820 : .get = py_samr_QueryUserInfo2_out_get_info,
38821 : .set = py_samr_QueryUserInfo2_out_set_info,
38822 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo")
38823 : },
38824 : {
38825 : .name = discard_const_p(char, "result"),
38826 : .get = py_samr_QueryUserInfo2_get_result,
38827 : .set = py_samr_QueryUserInfo2_set_result,
38828 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
38829 : },
38830 : { .name = NULL }
38831 : };
38832 :
38833 0 : static PyObject *py_samr_QueryUserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
38834 : {
38835 0 : PyObject *self = pytalloc_new(struct samr_QueryUserInfo2, type);
38836 0 : struct samr_QueryUserInfo2 *_self = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(self);
38837 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
38838 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
38839 : /* a pointer to a NULL pointer */
38840 0 : _self->out.info = talloc_zero(mem_ctx, union samr_UserInfo *);
38841 0 : return self;
38842 : }
38843 :
38844 0 : static PyObject *py_samr_QueryUserInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
38845 : {
38846 :
38847 :
38848 0 : return PyLong_FromLong(47);
38849 : }
38850 :
38851 0 : static PyObject *py_samr_QueryUserInfo2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
38852 : {
38853 0 : const struct ndr_interface_call *call = NULL;
38854 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38855 0 : PyObject *ret = NULL;
38856 0 : struct ndr_push *push = NULL;
38857 0 : DATA_BLOB blob;
38858 0 : enum ndr_err_code err;
38859 :
38860 0 : if (ndr_table_samr.num_calls < 48) {
38861 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_pack");
38862 0 : return NULL;
38863 : }
38864 0 : call = &ndr_table_samr.calls[47];
38865 :
38866 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
38867 0 : if (push == NULL) {
38868 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38869 0 : return NULL;
38870 : }
38871 :
38872 0 : push->flags |= ndr_push_flags;
38873 :
38874 0 : err = call->ndr_push(push, ndr_inout_flags, object);
38875 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38876 0 : TALLOC_FREE(push);
38877 0 : PyErr_SetNdrError(err);
38878 0 : return NULL;
38879 : }
38880 0 : blob = ndr_push_blob(push);
38881 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
38882 0 : TALLOC_FREE(push);
38883 0 : return ret;
38884 : }
38885 :
38886 0 : static PyObject *py_samr_QueryUserInfo2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38887 : {
38888 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38889 0 : PyObject *bigendian_obj = NULL;
38890 0 : PyObject *ndr64_obj = NULL;
38891 0 : libndr_flags ndr_push_flags = 0;
38892 :
38893 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
38894 : discard_const_p(char *, kwnames),
38895 : &bigendian_obj,
38896 : &ndr64_obj)) {
38897 0 : return NULL;
38898 : }
38899 :
38900 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38901 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38902 : }
38903 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38904 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38905 : }
38906 :
38907 0 : return py_samr_QueryUserInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
38908 : }
38909 :
38910 0 : static PyObject *py_samr_QueryUserInfo2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38911 : {
38912 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
38913 0 : PyObject *bigendian_obj = NULL;
38914 0 : PyObject *ndr64_obj = NULL;
38915 0 : libndr_flags ndr_push_flags = 0;
38916 :
38917 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
38918 : discard_const_p(char *, kwnames),
38919 : &bigendian_obj,
38920 : &ndr64_obj)) {
38921 0 : return NULL;
38922 : }
38923 :
38924 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
38925 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
38926 : }
38927 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
38928 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
38929 : }
38930 :
38931 0 : return py_samr_QueryUserInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
38932 : }
38933 :
38934 0 : static PyObject *py_samr_QueryUserInfo2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
38935 : {
38936 0 : const struct ndr_interface_call *call = NULL;
38937 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
38938 0 : struct ndr_pull *pull = NULL;
38939 0 : enum ndr_err_code err;
38940 :
38941 0 : if (ndr_table_samr.num_calls < 48) {
38942 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_unpack");
38943 0 : return NULL;
38944 : }
38945 0 : call = &ndr_table_samr.calls[47];
38946 :
38947 0 : pull = ndr_pull_init_blob(blob, object);
38948 0 : if (pull == NULL) {
38949 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
38950 0 : return NULL;
38951 : }
38952 :
38953 0 : pull->flags |= ndr_pull_flags;
38954 :
38955 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
38956 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
38957 0 : TALLOC_FREE(pull);
38958 0 : PyErr_SetNdrError(err);
38959 0 : return NULL;
38960 : }
38961 0 : if (!allow_remaining) {
38962 0 : uint32_t highest_ofs;
38963 :
38964 0 : if (pull->offset > pull->relative_highest_offset) {
38965 0 : highest_ofs = pull->offset;
38966 : } else {
38967 0 : highest_ofs = pull->relative_highest_offset;
38968 : }
38969 0 : if (highest_ofs < pull->data_size) {
38970 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
38971 : "not all bytes consumed ofs[%u] size[%u]",
38972 : highest_ofs, pull->data_size);
38973 0 : TALLOC_FREE(pull);
38974 0 : PyErr_SetNdrError(err);
38975 0 : return NULL;
38976 : }
38977 : }
38978 :
38979 0 : TALLOC_FREE(pull);
38980 0 : Py_RETURN_NONE;
38981 : }
38982 :
38983 0 : static PyObject *py_samr_QueryUserInfo2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
38984 : {
38985 0 : DATA_BLOB blob;
38986 0 : Py_ssize_t blob_length = 0;
38987 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
38988 0 : PyObject *bigendian_obj = NULL;
38989 0 : PyObject *ndr64_obj = NULL;
38990 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
38991 0 : PyObject *allow_remaining_obj = NULL;
38992 0 : bool allow_remaining = false;
38993 :
38994 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
38995 : discard_const_p(char *, kwnames),
38996 : &blob.data, &blob_length,
38997 : &bigendian_obj,
38998 : &ndr64_obj,
38999 : &allow_remaining_obj)) {
39000 0 : return NULL;
39001 : }
39002 0 : blob.length = blob_length;
39003 :
39004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39005 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39006 : }
39007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39008 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39009 : }
39010 :
39011 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39012 0 : allow_remaining = true;
39013 : }
39014 :
39015 0 : return py_samr_QueryUserInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39016 : }
39017 :
39018 0 : static PyObject *py_samr_QueryUserInfo2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39019 : {
39020 0 : DATA_BLOB blob;
39021 0 : Py_ssize_t blob_length = 0;
39022 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39023 0 : PyObject *bigendian_obj = NULL;
39024 0 : PyObject *ndr64_obj = NULL;
39025 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39026 0 : PyObject *allow_remaining_obj = NULL;
39027 0 : bool allow_remaining = false;
39028 :
39029 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39030 : discard_const_p(char *, kwnames),
39031 : &blob.data, &blob_length,
39032 : &bigendian_obj,
39033 : &ndr64_obj,
39034 : &allow_remaining_obj)) {
39035 0 : return NULL;
39036 : }
39037 0 : blob.length = blob_length;
39038 :
39039 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39040 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39041 : }
39042 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39043 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39044 : }
39045 :
39046 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39047 0 : allow_remaining = true;
39048 : }
39049 :
39050 0 : return py_samr_QueryUserInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39051 : }
39052 :
39053 0 : static PyObject *py_samr_QueryUserInfo2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39054 : {
39055 0 : const struct ndr_interface_call *call = NULL;
39056 0 : struct samr_QueryUserInfo2 *object = (struct samr_QueryUserInfo2 *)pytalloc_get_ptr(py_obj);
39057 0 : PyObject *ret;
39058 0 : char *retstr;
39059 :
39060 0 : if (ndr_table_samr.num_calls < 48) {
39061 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryUserInfo2_ndr_print");
39062 0 : return NULL;
39063 : }
39064 0 : call = &ndr_table_samr.calls[47];
39065 :
39066 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39067 0 : ret = PyUnicode_FromString(retstr);
39068 0 : TALLOC_FREE(retstr);
39069 :
39070 0 : return ret;
39071 : }
39072 :
39073 0 : static PyObject *py_samr_QueryUserInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39074 : {
39075 0 : return py_samr_QueryUserInfo2_ndr_print(py_obj, "samr_QueryUserInfo2_in", NDR_IN);
39076 : }
39077 :
39078 0 : static PyObject *py_samr_QueryUserInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39079 : {
39080 0 : return py_samr_QueryUserInfo2_ndr_print(py_obj, "samr_QueryUserInfo2_out", NDR_OUT);
39081 : }
39082 :
39083 : static PyMethodDef py_samr_QueryUserInfo2_methods[] = {
39084 : { "opnum", (PyCFunction)py_samr_QueryUserInfo2_ndr_opnum, METH_NOARGS|METH_CLASS,
39085 : "samr.QueryUserInfo2.opnum() -> 47 (0x2f) " },
39086 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39087 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39088 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39089 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39090 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39091 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39092 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryUserInfo2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39093 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39094 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryUserInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39095 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryUserInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39096 : { NULL, NULL, 0, NULL }
39097 : };
39098 :
39099 :
39100 : static PyTypeObject samr_QueryUserInfo2_Type = {
39101 : PyVarObject_HEAD_INIT(NULL, 0)
39102 : .tp_name = "samr.QueryUserInfo2",
39103 : .tp_getset = py_samr_QueryUserInfo2_getsetters,
39104 : .tp_methods = py_samr_QueryUserInfo2_methods,
39105 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39106 : .tp_new = py_samr_QueryUserInfo2_new,
39107 : };
39108 :
39109 0 : static bool pack_py_samr_QueryUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo2 *r)
39110 : {
39111 0 : PyObject *py_user_handle;
39112 0 : PyObject *py_level;
39113 0 : const char *kwnames[] = {
39114 : "user_handle", "level", NULL
39115 : };
39116 :
39117 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
39118 0 : return false;
39119 : }
39120 :
39121 0 : if (py_user_handle == NULL) {
39122 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
39123 0 : return false;
39124 : }
39125 0 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
39126 0 : if (r->in.user_handle == NULL) {
39127 0 : PyErr_NoMemory();
39128 0 : return false;
39129 : }
39130 0 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
39131 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
39132 0 : PyErr_NoMemory();
39133 0 : return false;
39134 : }
39135 0 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
39136 0 : if (py_level == NULL) {
39137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39138 0 : return false;
39139 : }
39140 : {
39141 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39142 0 : if (PyLong_Check(py_level)) {
39143 0 : unsigned long long test_var;
39144 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39145 0 : if (PyErr_Occurred() != NULL) {
39146 0 : return false;
39147 : }
39148 0 : if (test_var > uint_max) {
39149 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39150 : PyLong_Type.tp_name, uint_max, test_var);
39151 0 : return false;
39152 : }
39153 0 : r->in.level = test_var;
39154 : } else {
39155 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39156 : PyLong_Type.tp_name);
39157 0 : return false;
39158 : }
39159 : }
39160 0 : return true;
39161 : }
39162 :
39163 0 : static PyObject *unpack_py_samr_QueryUserInfo2_args_out(struct samr_QueryUserInfo2 *r)
39164 : {
39165 0 : PyObject *result;
39166 0 : PyObject *py_info;
39167 0 : if (*r->out.info == NULL) {
39168 0 : py_info = Py_None;
39169 0 : Py_INCREF(py_info);
39170 : } else {
39171 0 : py_info = pyrpc_import_union(&samr_UserInfo_Type, *r->out.info, r->in.level, *r->out.info, "union samr_UserInfo");
39172 0 : if (py_info == NULL) {
39173 0 : return NULL;
39174 : }
39175 : }
39176 0 : result = py_info;
39177 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
39178 0 : PyErr_SetNTSTATUS(r->out.result);
39179 0 : return NULL;
39180 : }
39181 :
39182 0 : return result;
39183 : }
39184 :
39185 :
39186 0 : static PyObject *py_samr_QueryDisplayInfo2_in_get_domain_handle(PyObject *obj, void *closure)
39187 : {
39188 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39189 0 : PyObject *py_domain_handle;
39190 0 : if (object->in.domain_handle == NULL) {
39191 0 : Py_RETURN_NONE;
39192 : }
39193 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
39194 0 : return py_domain_handle;
39195 : }
39196 :
39197 0 : static int py_samr_QueryDisplayInfo2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
39198 : {
39199 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39200 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
39201 0 : if (value == NULL) {
39202 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
39203 0 : return -1;
39204 : }
39205 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
39206 0 : if (object->in.domain_handle == NULL) {
39207 0 : PyErr_NoMemory();
39208 0 : return -1;
39209 : }
39210 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
39211 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
39212 0 : PyErr_NoMemory();
39213 0 : return -1;
39214 : }
39215 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
39216 0 : return 0;
39217 : }
39218 :
39219 0 : static PyObject *py_samr_QueryDisplayInfo2_in_get_level(PyObject *obj, void *closure)
39220 : {
39221 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39222 0 : PyObject *py_level;
39223 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
39224 0 : return py_level;
39225 : }
39226 :
39227 0 : static int py_samr_QueryDisplayInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
39228 : {
39229 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39230 0 : if (value == NULL) {
39231 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
39232 0 : return -1;
39233 : }
39234 : {
39235 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
39236 0 : if (PyLong_Check(value)) {
39237 0 : unsigned long long test_var;
39238 0 : test_var = PyLong_AsUnsignedLongLong(value);
39239 0 : if (PyErr_Occurred() != NULL) {
39240 0 : return -1;
39241 : }
39242 0 : if (test_var > uint_max) {
39243 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39244 : PyLong_Type.tp_name, uint_max, test_var);
39245 0 : return -1;
39246 : }
39247 0 : object->in.level = test_var;
39248 : } else {
39249 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39250 : PyLong_Type.tp_name);
39251 0 : return -1;
39252 : }
39253 : }
39254 0 : return 0;
39255 : }
39256 :
39257 0 : static PyObject *py_samr_QueryDisplayInfo2_in_get_start_idx(PyObject *obj, void *closure)
39258 : {
39259 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39260 0 : PyObject *py_start_idx;
39261 0 : py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx);
39262 0 : return py_start_idx;
39263 : }
39264 :
39265 0 : static int py_samr_QueryDisplayInfo2_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure)
39266 : {
39267 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39268 0 : if (value == NULL) {
39269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx");
39270 0 : return -1;
39271 : }
39272 : {
39273 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx));
39274 0 : if (PyLong_Check(value)) {
39275 0 : unsigned long long test_var;
39276 0 : test_var = PyLong_AsUnsignedLongLong(value);
39277 0 : if (PyErr_Occurred() != NULL) {
39278 0 : return -1;
39279 : }
39280 0 : if (test_var > uint_max) {
39281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39282 : PyLong_Type.tp_name, uint_max, test_var);
39283 0 : return -1;
39284 : }
39285 0 : object->in.start_idx = test_var;
39286 : } else {
39287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39288 : PyLong_Type.tp_name);
39289 0 : return -1;
39290 : }
39291 : }
39292 0 : return 0;
39293 : }
39294 :
39295 0 : static PyObject *py_samr_QueryDisplayInfo2_in_get_max_entries(PyObject *obj, void *closure)
39296 : {
39297 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39298 0 : PyObject *py_max_entries;
39299 0 : py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries);
39300 0 : return py_max_entries;
39301 : }
39302 :
39303 0 : static int py_samr_QueryDisplayInfo2_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure)
39304 : {
39305 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39306 0 : if (value == NULL) {
39307 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries");
39308 0 : return -1;
39309 : }
39310 : {
39311 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries));
39312 0 : if (PyLong_Check(value)) {
39313 0 : unsigned long long test_var;
39314 0 : test_var = PyLong_AsUnsignedLongLong(value);
39315 0 : if (PyErr_Occurred() != NULL) {
39316 0 : return -1;
39317 : }
39318 0 : if (test_var > uint_max) {
39319 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39320 : PyLong_Type.tp_name, uint_max, test_var);
39321 0 : return -1;
39322 : }
39323 0 : object->in.max_entries = test_var;
39324 : } else {
39325 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39326 : PyLong_Type.tp_name);
39327 0 : return -1;
39328 : }
39329 : }
39330 0 : return 0;
39331 : }
39332 :
39333 0 : static PyObject *py_samr_QueryDisplayInfo2_in_get_buf_size(PyObject *obj, void *closure)
39334 : {
39335 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39336 0 : PyObject *py_buf_size;
39337 0 : py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size);
39338 0 : return py_buf_size;
39339 : }
39340 :
39341 0 : static int py_samr_QueryDisplayInfo2_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure)
39342 : {
39343 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39344 0 : if (value == NULL) {
39345 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size");
39346 0 : return -1;
39347 : }
39348 : {
39349 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size));
39350 0 : if (PyLong_Check(value)) {
39351 0 : unsigned long long test_var;
39352 0 : test_var = PyLong_AsUnsignedLongLong(value);
39353 0 : if (PyErr_Occurred() != NULL) {
39354 0 : return -1;
39355 : }
39356 0 : if (test_var > uint_max) {
39357 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39358 : PyLong_Type.tp_name, uint_max, test_var);
39359 0 : return -1;
39360 : }
39361 0 : object->in.buf_size = test_var;
39362 : } else {
39363 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39364 : PyLong_Type.tp_name);
39365 0 : return -1;
39366 : }
39367 : }
39368 0 : return 0;
39369 : }
39370 :
39371 0 : static PyObject *py_samr_QueryDisplayInfo2_out_get_total_size(PyObject *obj, void *closure)
39372 : {
39373 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39374 0 : PyObject *py_total_size;
39375 0 : if (object->out.total_size == NULL) {
39376 0 : Py_RETURN_NONE;
39377 : }
39378 0 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size);
39379 0 : return py_total_size;
39380 : }
39381 :
39382 0 : static int py_samr_QueryDisplayInfo2_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure)
39383 : {
39384 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39385 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size));
39386 0 : if (value == NULL) {
39387 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size");
39388 0 : return -1;
39389 : }
39390 0 : object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size);
39391 0 : if (object->out.total_size == NULL) {
39392 0 : PyErr_NoMemory();
39393 0 : return -1;
39394 : }
39395 : {
39396 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size));
39397 0 : if (PyLong_Check(value)) {
39398 0 : unsigned long long test_var;
39399 0 : test_var = PyLong_AsUnsignedLongLong(value);
39400 0 : if (PyErr_Occurred() != NULL) {
39401 0 : return -1;
39402 : }
39403 0 : if (test_var > uint_max) {
39404 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39405 : PyLong_Type.tp_name, uint_max, test_var);
39406 0 : return -1;
39407 : }
39408 0 : *object->out.total_size = test_var;
39409 : } else {
39410 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39411 : PyLong_Type.tp_name);
39412 0 : return -1;
39413 : }
39414 : }
39415 0 : return 0;
39416 : }
39417 :
39418 0 : static PyObject *py_samr_QueryDisplayInfo2_out_get_returned_size(PyObject *obj, void *closure)
39419 : {
39420 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39421 0 : PyObject *py_returned_size;
39422 0 : if (object->out.returned_size == NULL) {
39423 0 : Py_RETURN_NONE;
39424 : }
39425 0 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size);
39426 0 : return py_returned_size;
39427 : }
39428 :
39429 0 : static int py_samr_QueryDisplayInfo2_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure)
39430 : {
39431 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39432 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size));
39433 0 : if (value == NULL) {
39434 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size");
39435 0 : return -1;
39436 : }
39437 0 : object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size);
39438 0 : if (object->out.returned_size == NULL) {
39439 0 : PyErr_NoMemory();
39440 0 : return -1;
39441 : }
39442 : {
39443 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size));
39444 0 : if (PyLong_Check(value)) {
39445 0 : unsigned long long test_var;
39446 0 : test_var = PyLong_AsUnsignedLongLong(value);
39447 0 : if (PyErr_Occurred() != NULL) {
39448 0 : return -1;
39449 : }
39450 0 : if (test_var > uint_max) {
39451 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39452 : PyLong_Type.tp_name, uint_max, test_var);
39453 0 : return -1;
39454 : }
39455 0 : *object->out.returned_size = test_var;
39456 : } else {
39457 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39458 : PyLong_Type.tp_name);
39459 0 : return -1;
39460 : }
39461 : }
39462 0 : return 0;
39463 : }
39464 :
39465 0 : static PyObject *py_samr_QueryDisplayInfo2_out_get_info(PyObject *obj, void *closure)
39466 : {
39467 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39468 0 : PyObject *py_info;
39469 0 : if (object->out.info == NULL) {
39470 0 : Py_RETURN_NONE;
39471 : }
39472 0 : py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo");
39473 0 : if (py_info == NULL) {
39474 0 : return NULL;
39475 : }
39476 0 : return py_info;
39477 : }
39478 :
39479 0 : static int py_samr_QueryDisplayInfo2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
39480 : {
39481 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39482 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
39483 0 : if (value == NULL) {
39484 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
39485 0 : return -1;
39486 : }
39487 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
39488 0 : if (object->out.info == NULL) {
39489 0 : PyErr_NoMemory();
39490 0 : return -1;
39491 : }
39492 : {
39493 0 : union samr_DispInfo *info_switch_1;
39494 0 : info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo");
39495 0 : if (info_switch_1 == NULL) {
39496 0 : return -1;
39497 : }
39498 0 : object->out.info = info_switch_1;
39499 : }
39500 0 : return 0;
39501 : }
39502 :
39503 0 : static PyObject *py_samr_QueryDisplayInfo2_get_result(PyObject *obj, void *closure)
39504 : {
39505 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(obj);
39506 0 : PyObject *py_result;
39507 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
39508 0 : return py_result;
39509 : }
39510 :
39511 0 : static int py_samr_QueryDisplayInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure)
39512 : {
39513 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39514 0 : if (value == NULL) {
39515 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
39516 0 : return -1;
39517 : }
39518 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
39519 0 : return 0;
39520 : }
39521 :
39522 : static PyGetSetDef py_samr_QueryDisplayInfo2_getsetters[] = {
39523 : {
39524 : .name = discard_const_p(char, "in_domain_handle"),
39525 : .get = py_samr_QueryDisplayInfo2_in_get_domain_handle,
39526 : .set = py_samr_QueryDisplayInfo2_in_set_domain_handle,
39527 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
39528 : },
39529 : {
39530 : .name = discard_const_p(char, "in_level"),
39531 : .get = py_samr_QueryDisplayInfo2_in_get_level,
39532 : .set = py_samr_QueryDisplayInfo2_in_set_level,
39533 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
39534 : },
39535 : {
39536 : .name = discard_const_p(char, "in_start_idx"),
39537 : .get = py_samr_QueryDisplayInfo2_in_get_start_idx,
39538 : .set = py_samr_QueryDisplayInfo2_in_set_start_idx,
39539 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39540 : },
39541 : {
39542 : .name = discard_const_p(char, "in_max_entries"),
39543 : .get = py_samr_QueryDisplayInfo2_in_get_max_entries,
39544 : .set = py_samr_QueryDisplayInfo2_in_set_max_entries,
39545 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39546 : },
39547 : {
39548 : .name = discard_const_p(char, "in_buf_size"),
39549 : .get = py_samr_QueryDisplayInfo2_in_get_buf_size,
39550 : .set = py_samr_QueryDisplayInfo2_in_set_buf_size,
39551 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39552 : },
39553 : {
39554 : .name = discard_const_p(char, "out_total_size"),
39555 : .get = py_samr_QueryDisplayInfo2_out_get_total_size,
39556 : .set = py_samr_QueryDisplayInfo2_out_set_total_size,
39557 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39558 : },
39559 : {
39560 : .name = discard_const_p(char, "out_returned_size"),
39561 : .get = py_samr_QueryDisplayInfo2_out_get_returned_size,
39562 : .set = py_samr_QueryDisplayInfo2_out_set_returned_size,
39563 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
39564 : },
39565 : {
39566 : .name = discard_const_p(char, "out_info"),
39567 : .get = py_samr_QueryDisplayInfo2_out_get_info,
39568 : .set = py_samr_QueryDisplayInfo2_out_set_info,
39569 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo")
39570 : },
39571 : {
39572 : .name = discard_const_p(char, "result"),
39573 : .get = py_samr_QueryDisplayInfo2_get_result,
39574 : .set = py_samr_QueryDisplayInfo2_set_result,
39575 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
39576 : },
39577 : { .name = NULL }
39578 : };
39579 :
39580 0 : static PyObject *py_samr_QueryDisplayInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
39581 : {
39582 0 : PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo2, type);
39583 0 : struct samr_QueryDisplayInfo2 *_self = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(self);
39584 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
39585 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
39586 0 : _self->out.total_size = talloc_zero(mem_ctx, uint32_t);
39587 0 : _self->out.returned_size = talloc_zero(mem_ctx, uint32_t);
39588 0 : _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
39589 0 : return self;
39590 : }
39591 :
39592 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
39593 : {
39594 :
39595 :
39596 0 : return PyLong_FromLong(48);
39597 : }
39598 :
39599 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
39600 : {
39601 0 : const struct ndr_interface_call *call = NULL;
39602 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39603 0 : PyObject *ret = NULL;
39604 0 : struct ndr_push *push = NULL;
39605 0 : DATA_BLOB blob;
39606 0 : enum ndr_err_code err;
39607 :
39608 0 : if (ndr_table_samr.num_calls < 49) {
39609 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_pack");
39610 0 : return NULL;
39611 : }
39612 0 : call = &ndr_table_samr.calls[48];
39613 :
39614 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
39615 0 : if (push == NULL) {
39616 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39617 0 : return NULL;
39618 : }
39619 :
39620 0 : push->flags |= ndr_push_flags;
39621 :
39622 0 : err = call->ndr_push(push, ndr_inout_flags, object);
39623 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39624 0 : TALLOC_FREE(push);
39625 0 : PyErr_SetNdrError(err);
39626 0 : return NULL;
39627 : }
39628 0 : blob = ndr_push_blob(push);
39629 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
39630 0 : TALLOC_FREE(push);
39631 0 : return ret;
39632 : }
39633 :
39634 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39635 : {
39636 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39637 0 : PyObject *bigendian_obj = NULL;
39638 0 : PyObject *ndr64_obj = NULL;
39639 0 : libndr_flags ndr_push_flags = 0;
39640 :
39641 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
39642 : discard_const_p(char *, kwnames),
39643 : &bigendian_obj,
39644 : &ndr64_obj)) {
39645 0 : return NULL;
39646 : }
39647 :
39648 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39649 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39650 : }
39651 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39652 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39653 : }
39654 :
39655 0 : return py_samr_QueryDisplayInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
39656 : }
39657 :
39658 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39659 : {
39660 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
39661 0 : PyObject *bigendian_obj = NULL;
39662 0 : PyObject *ndr64_obj = NULL;
39663 0 : libndr_flags ndr_push_flags = 0;
39664 :
39665 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
39666 : discard_const_p(char *, kwnames),
39667 : &bigendian_obj,
39668 : &ndr64_obj)) {
39669 0 : return NULL;
39670 : }
39671 :
39672 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39673 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
39674 : }
39675 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39676 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
39677 : }
39678 :
39679 0 : return py_samr_QueryDisplayInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
39680 : }
39681 :
39682 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
39683 : {
39684 0 : const struct ndr_interface_call *call = NULL;
39685 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39686 0 : struct ndr_pull *pull = NULL;
39687 0 : enum ndr_err_code err;
39688 :
39689 0 : if (ndr_table_samr.num_calls < 49) {
39690 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_unpack");
39691 0 : return NULL;
39692 : }
39693 0 : call = &ndr_table_samr.calls[48];
39694 :
39695 0 : pull = ndr_pull_init_blob(blob, object);
39696 0 : if (pull == NULL) {
39697 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
39698 0 : return NULL;
39699 : }
39700 :
39701 0 : pull->flags |= ndr_pull_flags;
39702 :
39703 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
39704 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
39705 0 : TALLOC_FREE(pull);
39706 0 : PyErr_SetNdrError(err);
39707 0 : return NULL;
39708 : }
39709 0 : if (!allow_remaining) {
39710 0 : uint32_t highest_ofs;
39711 :
39712 0 : if (pull->offset > pull->relative_highest_offset) {
39713 0 : highest_ofs = pull->offset;
39714 : } else {
39715 0 : highest_ofs = pull->relative_highest_offset;
39716 : }
39717 0 : if (highest_ofs < pull->data_size) {
39718 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
39719 : "not all bytes consumed ofs[%u] size[%u]",
39720 : highest_ofs, pull->data_size);
39721 0 : TALLOC_FREE(pull);
39722 0 : PyErr_SetNdrError(err);
39723 0 : return NULL;
39724 : }
39725 : }
39726 :
39727 0 : TALLOC_FREE(pull);
39728 0 : Py_RETURN_NONE;
39729 : }
39730 :
39731 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39732 : {
39733 0 : DATA_BLOB blob;
39734 0 : Py_ssize_t blob_length = 0;
39735 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39736 0 : PyObject *bigendian_obj = NULL;
39737 0 : PyObject *ndr64_obj = NULL;
39738 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39739 0 : PyObject *allow_remaining_obj = NULL;
39740 0 : bool allow_remaining = false;
39741 :
39742 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
39743 : discard_const_p(char *, kwnames),
39744 : &blob.data, &blob_length,
39745 : &bigendian_obj,
39746 : &ndr64_obj,
39747 : &allow_remaining_obj)) {
39748 0 : return NULL;
39749 : }
39750 0 : blob.length = blob_length;
39751 :
39752 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39753 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39754 : }
39755 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39756 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39757 : }
39758 :
39759 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39760 0 : allow_remaining = true;
39761 : }
39762 :
39763 0 : return py_samr_QueryDisplayInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
39764 : }
39765 :
39766 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
39767 : {
39768 0 : DATA_BLOB blob;
39769 0 : Py_ssize_t blob_length = 0;
39770 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
39771 0 : PyObject *bigendian_obj = NULL;
39772 0 : PyObject *ndr64_obj = NULL;
39773 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
39774 0 : PyObject *allow_remaining_obj = NULL;
39775 0 : bool allow_remaining = false;
39776 :
39777 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
39778 : discard_const_p(char *, kwnames),
39779 : &blob.data, &blob_length,
39780 : &bigendian_obj,
39781 : &ndr64_obj,
39782 : &allow_remaining_obj)) {
39783 0 : return NULL;
39784 : }
39785 0 : blob.length = blob_length;
39786 :
39787 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
39788 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
39789 : }
39790 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
39791 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
39792 : }
39793 :
39794 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
39795 0 : allow_remaining = true;
39796 : }
39797 :
39798 0 : return py_samr_QueryDisplayInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
39799 : }
39800 :
39801 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
39802 : {
39803 0 : const struct ndr_interface_call *call = NULL;
39804 0 : struct samr_QueryDisplayInfo2 *object = (struct samr_QueryDisplayInfo2 *)pytalloc_get_ptr(py_obj);
39805 0 : PyObject *ret;
39806 0 : char *retstr;
39807 :
39808 0 : if (ndr_table_samr.num_calls < 49) {
39809 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo2_ndr_print");
39810 0 : return NULL;
39811 : }
39812 0 : call = &ndr_table_samr.calls[48];
39813 :
39814 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
39815 0 : ret = PyUnicode_FromString(retstr);
39816 0 : TALLOC_FREE(retstr);
39817 :
39818 0 : return ret;
39819 : }
39820 :
39821 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39822 : {
39823 0 : return py_samr_QueryDisplayInfo2_ndr_print(py_obj, "samr_QueryDisplayInfo2_in", NDR_IN);
39824 : }
39825 :
39826 0 : static PyObject *py_samr_QueryDisplayInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
39827 : {
39828 0 : return py_samr_QueryDisplayInfo2_ndr_print(py_obj, "samr_QueryDisplayInfo2_out", NDR_OUT);
39829 : }
39830 :
39831 : static PyMethodDef py_samr_QueryDisplayInfo2_methods[] = {
39832 : { "opnum", (PyCFunction)py_samr_QueryDisplayInfo2_ndr_opnum, METH_NOARGS|METH_CLASS,
39833 : "samr.QueryDisplayInfo2.opnum() -> 48 (0x30) " },
39834 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
39835 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
39836 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
39837 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
39838 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
39839 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
39840 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
39841 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
39842 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryDisplayInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
39843 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
39844 : { NULL, NULL, 0, NULL }
39845 : };
39846 :
39847 :
39848 : static PyTypeObject samr_QueryDisplayInfo2_Type = {
39849 : PyVarObject_HEAD_INIT(NULL, 0)
39850 : .tp_name = "samr.QueryDisplayInfo2",
39851 : .tp_getset = py_samr_QueryDisplayInfo2_getsetters,
39852 : .tp_methods = py_samr_QueryDisplayInfo2_methods,
39853 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
39854 : .tp_new = py_samr_QueryDisplayInfo2_new,
39855 : };
39856 :
39857 0 : static bool pack_py_samr_QueryDisplayInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo2 *r)
39858 : {
39859 0 : PyObject *py_domain_handle;
39860 0 : PyObject *py_level;
39861 0 : PyObject *py_start_idx;
39862 0 : PyObject *py_max_entries;
39863 0 : PyObject *py_buf_size;
39864 0 : const char *kwnames[] = {
39865 : "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
39866 : };
39867 :
39868 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) {
39869 0 : return false;
39870 : }
39871 :
39872 0 : if (py_domain_handle == NULL) {
39873 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
39874 0 : return false;
39875 : }
39876 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
39877 0 : if (r->in.domain_handle == NULL) {
39878 0 : PyErr_NoMemory();
39879 0 : return false;
39880 : }
39881 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
39882 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
39883 0 : PyErr_NoMemory();
39884 0 : return false;
39885 : }
39886 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
39887 0 : if (py_level == NULL) {
39888 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
39889 0 : return false;
39890 : }
39891 : {
39892 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
39893 0 : if (PyLong_Check(py_level)) {
39894 0 : unsigned long long test_var;
39895 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
39896 0 : if (PyErr_Occurred() != NULL) {
39897 0 : return false;
39898 : }
39899 0 : if (test_var > uint_max) {
39900 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39901 : PyLong_Type.tp_name, uint_max, test_var);
39902 0 : return false;
39903 : }
39904 0 : r->in.level = test_var;
39905 : } else {
39906 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39907 : PyLong_Type.tp_name);
39908 0 : return false;
39909 : }
39910 : }
39911 0 : if (py_start_idx == NULL) {
39912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx");
39913 0 : return false;
39914 : }
39915 : {
39916 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx));
39917 0 : if (PyLong_Check(py_start_idx)) {
39918 0 : unsigned long long test_var;
39919 0 : test_var = PyLong_AsUnsignedLongLong(py_start_idx);
39920 0 : if (PyErr_Occurred() != NULL) {
39921 0 : return false;
39922 : }
39923 0 : if (test_var > uint_max) {
39924 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39925 : PyLong_Type.tp_name, uint_max, test_var);
39926 0 : return false;
39927 : }
39928 0 : r->in.start_idx = test_var;
39929 : } else {
39930 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39931 : PyLong_Type.tp_name);
39932 0 : return false;
39933 : }
39934 : }
39935 0 : if (py_max_entries == NULL) {
39936 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries");
39937 0 : return false;
39938 : }
39939 : {
39940 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries));
39941 0 : if (PyLong_Check(py_max_entries)) {
39942 0 : unsigned long long test_var;
39943 0 : test_var = PyLong_AsUnsignedLongLong(py_max_entries);
39944 0 : if (PyErr_Occurred() != NULL) {
39945 0 : return false;
39946 : }
39947 0 : if (test_var > uint_max) {
39948 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39949 : PyLong_Type.tp_name, uint_max, test_var);
39950 0 : return false;
39951 : }
39952 0 : r->in.max_entries = test_var;
39953 : } else {
39954 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39955 : PyLong_Type.tp_name);
39956 0 : return false;
39957 : }
39958 : }
39959 0 : if (py_buf_size == NULL) {
39960 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size");
39961 0 : return false;
39962 : }
39963 : {
39964 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size));
39965 0 : if (PyLong_Check(py_buf_size)) {
39966 0 : unsigned long long test_var;
39967 0 : test_var = PyLong_AsUnsignedLongLong(py_buf_size);
39968 0 : if (PyErr_Occurred() != NULL) {
39969 0 : return false;
39970 : }
39971 0 : if (test_var > uint_max) {
39972 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
39973 : PyLong_Type.tp_name, uint_max, test_var);
39974 0 : return false;
39975 : }
39976 0 : r->in.buf_size = test_var;
39977 : } else {
39978 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
39979 : PyLong_Type.tp_name);
39980 0 : return false;
39981 : }
39982 : }
39983 0 : return true;
39984 : }
39985 :
39986 0 : static PyObject *unpack_py_samr_QueryDisplayInfo2_args_out(struct samr_QueryDisplayInfo2 *r)
39987 : {
39988 0 : PyObject *result;
39989 0 : PyObject *py_total_size;
39990 0 : PyObject *py_returned_size;
39991 0 : PyObject *py_info;
39992 0 : result = PyTuple_New(3);
39993 0 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size);
39994 0 : PyTuple_SetItem(result, 0, py_total_size);
39995 0 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size);
39996 0 : PyTuple_SetItem(result, 1, py_returned_size);
39997 0 : py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo");
39998 0 : if (py_info == NULL) {
39999 0 : return NULL;
40000 : }
40001 0 : PyTuple_SetItem(result, 2, py_info);
40002 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40003 0 : PyErr_SetNTSTATUS(r->out.result);
40004 0 : return NULL;
40005 : }
40006 :
40007 0 : return result;
40008 : }
40009 :
40010 :
40011 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_in_get_domain_handle(PyObject *obj, void *closure)
40012 : {
40013 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj);
40014 0 : PyObject *py_domain_handle;
40015 0 : if (object->in.domain_handle == NULL) {
40016 0 : Py_RETURN_NONE;
40017 : }
40018 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
40019 0 : return py_domain_handle;
40020 : }
40021 :
40022 0 : static int py_samr_GetDisplayEnumerationIndex2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
40023 : {
40024 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40025 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
40026 0 : if (value == NULL) {
40027 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
40028 0 : return -1;
40029 : }
40030 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
40031 0 : if (object->in.domain_handle == NULL) {
40032 0 : PyErr_NoMemory();
40033 0 : return -1;
40034 : }
40035 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40036 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40037 0 : PyErr_NoMemory();
40038 0 : return -1;
40039 : }
40040 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
40041 0 : return 0;
40042 : }
40043 :
40044 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_in_get_level(PyObject *obj, void *closure)
40045 : {
40046 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj);
40047 0 : PyObject *py_level;
40048 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
40049 0 : return py_level;
40050 : }
40051 :
40052 0 : static int py_samr_GetDisplayEnumerationIndex2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
40053 : {
40054 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40055 0 : if (value == NULL) {
40056 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
40057 0 : return -1;
40058 : }
40059 : {
40060 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
40061 0 : if (PyLong_Check(value)) {
40062 0 : unsigned long long test_var;
40063 0 : test_var = PyLong_AsUnsignedLongLong(value);
40064 0 : if (PyErr_Occurred() != NULL) {
40065 0 : return -1;
40066 : }
40067 0 : if (test_var > uint_max) {
40068 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40069 : PyLong_Type.tp_name, uint_max, test_var);
40070 0 : return -1;
40071 : }
40072 0 : object->in.level = test_var;
40073 : } else {
40074 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40075 : PyLong_Type.tp_name);
40076 0 : return -1;
40077 : }
40078 : }
40079 0 : return 0;
40080 : }
40081 :
40082 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_in_get_name(PyObject *obj, void *closure)
40083 : {
40084 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj);
40085 0 : PyObject *py_name;
40086 0 : if (object->in.name == NULL) {
40087 0 : Py_RETURN_NONE;
40088 : }
40089 0 : py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name);
40090 0 : return py_name;
40091 : }
40092 :
40093 0 : static int py_samr_GetDisplayEnumerationIndex2_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
40094 : {
40095 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40096 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
40097 0 : if (value == NULL) {
40098 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
40099 0 : return -1;
40100 : }
40101 0 : object->in.name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.name);
40102 0 : if (object->in.name == NULL) {
40103 0 : PyErr_NoMemory();
40104 0 : return -1;
40105 : }
40106 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
40107 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40108 0 : PyErr_NoMemory();
40109 0 : return -1;
40110 : }
40111 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
40112 0 : return 0;
40113 : }
40114 :
40115 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_out_get_idx(PyObject *obj, void *closure)
40116 : {
40117 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj);
40118 0 : PyObject *py_idx;
40119 0 : if (object->out.idx == NULL) {
40120 0 : Py_RETURN_NONE;
40121 : }
40122 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)*object->out.idx);
40123 0 : return py_idx;
40124 : }
40125 :
40126 0 : static int py_samr_GetDisplayEnumerationIndex2_out_set_idx(PyObject *py_obj, PyObject *value, void *closure)
40127 : {
40128 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40129 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.idx));
40130 0 : if (value == NULL) {
40131 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.idx");
40132 0 : return -1;
40133 : }
40134 0 : object->out.idx = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.idx);
40135 0 : if (object->out.idx == NULL) {
40136 0 : PyErr_NoMemory();
40137 0 : return -1;
40138 : }
40139 : {
40140 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.idx));
40141 0 : if (PyLong_Check(value)) {
40142 0 : unsigned long long test_var;
40143 0 : test_var = PyLong_AsUnsignedLongLong(value);
40144 0 : if (PyErr_Occurred() != NULL) {
40145 0 : return -1;
40146 : }
40147 0 : if (test_var > uint_max) {
40148 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40149 : PyLong_Type.tp_name, uint_max, test_var);
40150 0 : return -1;
40151 : }
40152 0 : *object->out.idx = test_var;
40153 : } else {
40154 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40155 : PyLong_Type.tp_name);
40156 0 : return -1;
40157 : }
40158 : }
40159 0 : return 0;
40160 : }
40161 :
40162 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_get_result(PyObject *obj, void *closure)
40163 : {
40164 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(obj);
40165 0 : PyObject *py_result;
40166 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40167 0 : return py_result;
40168 : }
40169 :
40170 0 : static int py_samr_GetDisplayEnumerationIndex2_set_result(PyObject *py_obj, PyObject *value, void *closure)
40171 : {
40172 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40173 0 : if (value == NULL) {
40174 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40175 0 : return -1;
40176 : }
40177 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40178 0 : return 0;
40179 : }
40180 :
40181 : static PyGetSetDef py_samr_GetDisplayEnumerationIndex2_getsetters[] = {
40182 : {
40183 : .name = discard_const_p(char, "in_domain_handle"),
40184 : .get = py_samr_GetDisplayEnumerationIndex2_in_get_domain_handle,
40185 : .set = py_samr_GetDisplayEnumerationIndex2_in_set_domain_handle,
40186 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40187 : },
40188 : {
40189 : .name = discard_const_p(char, "in_level"),
40190 : .get = py_samr_GetDisplayEnumerationIndex2_in_get_level,
40191 : .set = py_samr_GetDisplayEnumerationIndex2_in_set_level,
40192 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
40193 : },
40194 : {
40195 : .name = discard_const_p(char, "in_name"),
40196 : .get = py_samr_GetDisplayEnumerationIndex2_in_get_name,
40197 : .set = py_samr_GetDisplayEnumerationIndex2_in_set_name,
40198 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
40199 : },
40200 : {
40201 : .name = discard_const_p(char, "out_idx"),
40202 : .get = py_samr_GetDisplayEnumerationIndex2_out_get_idx,
40203 : .set = py_samr_GetDisplayEnumerationIndex2_out_set_idx,
40204 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40205 : },
40206 : {
40207 : .name = discard_const_p(char, "result"),
40208 : .get = py_samr_GetDisplayEnumerationIndex2_get_result,
40209 : .set = py_samr_GetDisplayEnumerationIndex2_set_result,
40210 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40211 : },
40212 : { .name = NULL }
40213 : };
40214 :
40215 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40216 : {
40217 0 : PyObject *self = pytalloc_new(struct samr_GetDisplayEnumerationIndex2, type);
40218 0 : struct samr_GetDisplayEnumerationIndex2 *_self = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(self);
40219 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40220 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
40221 0 : _self->in.name = talloc_zero(mem_ctx, struct lsa_String);
40222 0 : _self->out.idx = talloc_zero(mem_ctx, uint32_t);
40223 0 : return self;
40224 : }
40225 :
40226 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40227 : {
40228 :
40229 :
40230 0 : return PyLong_FromLong(49);
40231 : }
40232 :
40233 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40234 : {
40235 0 : const struct ndr_interface_call *call = NULL;
40236 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40237 0 : PyObject *ret = NULL;
40238 0 : struct ndr_push *push = NULL;
40239 0 : DATA_BLOB blob;
40240 0 : enum ndr_err_code err;
40241 :
40242 0 : if (ndr_table_samr.num_calls < 50) {
40243 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_pack");
40244 0 : return NULL;
40245 : }
40246 0 : call = &ndr_table_samr.calls[49];
40247 :
40248 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40249 0 : if (push == NULL) {
40250 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40251 0 : return NULL;
40252 : }
40253 :
40254 0 : push->flags |= ndr_push_flags;
40255 :
40256 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40257 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40258 0 : TALLOC_FREE(push);
40259 0 : PyErr_SetNdrError(err);
40260 0 : return NULL;
40261 : }
40262 0 : blob = ndr_push_blob(push);
40263 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40264 0 : TALLOC_FREE(push);
40265 0 : return ret;
40266 : }
40267 :
40268 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40269 : {
40270 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40271 0 : PyObject *bigendian_obj = NULL;
40272 0 : PyObject *ndr64_obj = NULL;
40273 0 : libndr_flags ndr_push_flags = 0;
40274 :
40275 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40276 : discard_const_p(char *, kwnames),
40277 : &bigendian_obj,
40278 : &ndr64_obj)) {
40279 0 : return NULL;
40280 : }
40281 :
40282 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40283 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40284 : }
40285 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40286 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40287 : }
40288 :
40289 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40290 : }
40291 :
40292 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40293 : {
40294 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40295 0 : PyObject *bigendian_obj = NULL;
40296 0 : PyObject *ndr64_obj = NULL;
40297 0 : libndr_flags ndr_push_flags = 0;
40298 :
40299 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
40300 : discard_const_p(char *, kwnames),
40301 : &bigendian_obj,
40302 : &ndr64_obj)) {
40303 0 : return NULL;
40304 : }
40305 :
40306 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40307 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40308 : }
40309 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40310 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40311 : }
40312 :
40313 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
40314 : }
40315 :
40316 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
40317 : {
40318 0 : const struct ndr_interface_call *call = NULL;
40319 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40320 0 : struct ndr_pull *pull = NULL;
40321 0 : enum ndr_err_code err;
40322 :
40323 0 : if (ndr_table_samr.num_calls < 50) {
40324 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_unpack");
40325 0 : return NULL;
40326 : }
40327 0 : call = &ndr_table_samr.calls[49];
40328 :
40329 0 : pull = ndr_pull_init_blob(blob, object);
40330 0 : if (pull == NULL) {
40331 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40332 0 : return NULL;
40333 : }
40334 :
40335 0 : pull->flags |= ndr_pull_flags;
40336 :
40337 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
40338 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40339 0 : TALLOC_FREE(pull);
40340 0 : PyErr_SetNdrError(err);
40341 0 : return NULL;
40342 : }
40343 0 : if (!allow_remaining) {
40344 0 : uint32_t highest_ofs;
40345 :
40346 0 : if (pull->offset > pull->relative_highest_offset) {
40347 0 : highest_ofs = pull->offset;
40348 : } else {
40349 0 : highest_ofs = pull->relative_highest_offset;
40350 : }
40351 0 : if (highest_ofs < pull->data_size) {
40352 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
40353 : "not all bytes consumed ofs[%u] size[%u]",
40354 : highest_ofs, pull->data_size);
40355 0 : TALLOC_FREE(pull);
40356 0 : PyErr_SetNdrError(err);
40357 0 : return NULL;
40358 : }
40359 : }
40360 :
40361 0 : TALLOC_FREE(pull);
40362 0 : Py_RETURN_NONE;
40363 : }
40364 :
40365 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40366 : {
40367 0 : DATA_BLOB blob;
40368 0 : Py_ssize_t blob_length = 0;
40369 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40370 0 : PyObject *bigendian_obj = NULL;
40371 0 : PyObject *ndr64_obj = NULL;
40372 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40373 0 : PyObject *allow_remaining_obj = NULL;
40374 0 : bool allow_remaining = false;
40375 :
40376 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
40377 : discard_const_p(char *, kwnames),
40378 : &blob.data, &blob_length,
40379 : &bigendian_obj,
40380 : &ndr64_obj,
40381 : &allow_remaining_obj)) {
40382 0 : return NULL;
40383 : }
40384 0 : blob.length = blob_length;
40385 :
40386 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40387 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40388 : }
40389 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40390 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40391 : }
40392 :
40393 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40394 0 : allow_remaining = true;
40395 : }
40396 :
40397 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
40398 : }
40399 :
40400 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40401 : {
40402 0 : DATA_BLOB blob;
40403 0 : Py_ssize_t blob_length = 0;
40404 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
40405 0 : PyObject *bigendian_obj = NULL;
40406 0 : PyObject *ndr64_obj = NULL;
40407 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
40408 0 : PyObject *allow_remaining_obj = NULL;
40409 0 : bool allow_remaining = false;
40410 :
40411 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
40412 : discard_const_p(char *, kwnames),
40413 : &blob.data, &blob_length,
40414 : &bigendian_obj,
40415 : &ndr64_obj,
40416 : &allow_remaining_obj)) {
40417 0 : return NULL;
40418 : }
40419 0 : blob.length = blob_length;
40420 :
40421 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40422 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
40423 : }
40424 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40425 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
40426 : }
40427 :
40428 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
40429 0 : allow_remaining = true;
40430 : }
40431 :
40432 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
40433 : }
40434 :
40435 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
40436 : {
40437 0 : const struct ndr_interface_call *call = NULL;
40438 0 : struct samr_GetDisplayEnumerationIndex2 *object = (struct samr_GetDisplayEnumerationIndex2 *)pytalloc_get_ptr(py_obj);
40439 0 : PyObject *ret;
40440 0 : char *retstr;
40441 :
40442 0 : if (ndr_table_samr.num_calls < 50) {
40443 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDisplayEnumerationIndex2_ndr_print");
40444 0 : return NULL;
40445 : }
40446 0 : call = &ndr_table_samr.calls[49];
40447 :
40448 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
40449 0 : ret = PyUnicode_FromString(retstr);
40450 0 : TALLOC_FREE(retstr);
40451 :
40452 0 : return ret;
40453 : }
40454 :
40455 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40456 : {
40457 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex2_in", NDR_IN);
40458 : }
40459 :
40460 0 : static PyObject *py_samr_GetDisplayEnumerationIndex2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
40461 : {
40462 0 : return py_samr_GetDisplayEnumerationIndex2_ndr_print(py_obj, "samr_GetDisplayEnumerationIndex2_out", NDR_OUT);
40463 : }
40464 :
40465 : static PyMethodDef py_samr_GetDisplayEnumerationIndex2_methods[] = {
40466 : { "opnum", (PyCFunction)py_samr_GetDisplayEnumerationIndex2_ndr_opnum, METH_NOARGS|METH_CLASS,
40467 : "samr.GetDisplayEnumerationIndex2.opnum() -> 49 (0x31) " },
40468 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
40469 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
40470 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
40471 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
40472 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
40473 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
40474 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDisplayEnumerationIndex2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
40475 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
40476 : { "__ndr_print_in__", (PyCFunction)py_samr_GetDisplayEnumerationIndex2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
40477 : { "__ndr_print_out__", (PyCFunction)py_samr_GetDisplayEnumerationIndex2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
40478 : { NULL, NULL, 0, NULL }
40479 : };
40480 :
40481 :
40482 : static PyTypeObject samr_GetDisplayEnumerationIndex2_Type = {
40483 : PyVarObject_HEAD_INIT(NULL, 0)
40484 : .tp_name = "samr.GetDisplayEnumerationIndex2",
40485 : .tp_getset = py_samr_GetDisplayEnumerationIndex2_getsetters,
40486 : .tp_methods = py_samr_GetDisplayEnumerationIndex2_methods,
40487 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
40488 : .tp_new = py_samr_GetDisplayEnumerationIndex2_new,
40489 : };
40490 :
40491 0 : static bool pack_py_samr_GetDisplayEnumerationIndex2_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex2 *r)
40492 : {
40493 0 : PyObject *py_domain_handle;
40494 0 : PyObject *py_level;
40495 0 : PyObject *py_name;
40496 0 : const char *kwnames[] = {
40497 : "domain_handle", "level", "name", NULL
40498 : };
40499 :
40500 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
40501 0 : return false;
40502 : }
40503 :
40504 0 : if (py_domain_handle == NULL) {
40505 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
40506 0 : return false;
40507 : }
40508 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
40509 0 : if (r->in.domain_handle == NULL) {
40510 0 : PyErr_NoMemory();
40511 0 : return false;
40512 : }
40513 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
40514 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
40515 0 : PyErr_NoMemory();
40516 0 : return false;
40517 : }
40518 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
40519 0 : if (py_level == NULL) {
40520 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
40521 0 : return false;
40522 : }
40523 : {
40524 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
40525 0 : if (PyLong_Check(py_level)) {
40526 0 : unsigned long long test_var;
40527 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
40528 0 : if (PyErr_Occurred() != NULL) {
40529 0 : return false;
40530 : }
40531 0 : if (test_var > uint_max) {
40532 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40533 : PyLong_Type.tp_name, uint_max, test_var);
40534 0 : return false;
40535 : }
40536 0 : r->in.level = test_var;
40537 : } else {
40538 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40539 : PyLong_Type.tp_name);
40540 0 : return false;
40541 : }
40542 : }
40543 0 : if (py_name == NULL) {
40544 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
40545 0 : return false;
40546 : }
40547 0 : r->in.name = talloc_ptrtype(r, r->in.name);
40548 0 : if (r->in.name == NULL) {
40549 0 : PyErr_NoMemory();
40550 0 : return false;
40551 : }
40552 0 : PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
40553 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
40554 0 : PyErr_NoMemory();
40555 0 : return false;
40556 : }
40557 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
40558 0 : return true;
40559 : }
40560 :
40561 0 : static PyObject *unpack_py_samr_GetDisplayEnumerationIndex2_args_out(struct samr_GetDisplayEnumerationIndex2 *r)
40562 : {
40563 0 : PyObject *result;
40564 0 : PyObject *py_idx;
40565 0 : py_idx = PyLong_FromUnsignedLongLong((uint32_t)*r->out.idx);
40566 0 : result = py_idx;
40567 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
40568 0 : PyErr_SetNTSTATUS(r->out.result);
40569 0 : return NULL;
40570 : }
40571 :
40572 0 : return result;
40573 : }
40574 :
40575 :
40576 0 : static PyObject *py_samr_CreateUser2_in_get_domain_handle(PyObject *obj, void *closure)
40577 : {
40578 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40579 0 : PyObject *py_domain_handle;
40580 0 : if (object->in.domain_handle == NULL) {
40581 0 : Py_RETURN_NONE;
40582 : }
40583 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
40584 0 : return py_domain_handle;
40585 : }
40586 :
40587 0 : static int py_samr_CreateUser2_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
40588 : {
40589 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40590 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
40591 0 : if (value == NULL) {
40592 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
40593 0 : return -1;
40594 : }
40595 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
40596 0 : if (object->in.domain_handle == NULL) {
40597 0 : PyErr_NoMemory();
40598 0 : return -1;
40599 : }
40600 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40601 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40602 0 : PyErr_NoMemory();
40603 0 : return -1;
40604 : }
40605 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
40606 0 : return 0;
40607 : }
40608 :
40609 0 : static PyObject *py_samr_CreateUser2_in_get_account_name(PyObject *obj, void *closure)
40610 : {
40611 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40612 0 : PyObject *py_account_name;
40613 0 : if (object->in.account_name == NULL) {
40614 0 : Py_RETURN_NONE;
40615 : }
40616 0 : py_account_name = pytalloc_reference_ex(lsa_String_Type, object->in.account_name, object->in.account_name);
40617 0 : return py_account_name;
40618 : }
40619 :
40620 0 : static int py_samr_CreateUser2_in_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
40621 : {
40622 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40623 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account_name));
40624 0 : if (value == NULL) {
40625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account_name");
40626 0 : return -1;
40627 : }
40628 0 : object->in.account_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account_name);
40629 0 : if (object->in.account_name == NULL) {
40630 0 : PyErr_NoMemory();
40631 0 : return -1;
40632 : }
40633 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
40634 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40635 0 : PyErr_NoMemory();
40636 0 : return -1;
40637 : }
40638 0 : object->in.account_name = (struct lsa_String *)pytalloc_get_ptr(value);
40639 0 : return 0;
40640 : }
40641 :
40642 0 : static PyObject *py_samr_CreateUser2_in_get_acct_flags(PyObject *obj, void *closure)
40643 : {
40644 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40645 0 : PyObject *py_acct_flags;
40646 0 : py_acct_flags = PyLong_FromUnsignedLongLong((uint32_t)object->in.acct_flags);
40647 0 : return py_acct_flags;
40648 : }
40649 :
40650 0 : static int py_samr_CreateUser2_in_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
40651 : {
40652 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40653 0 : if (value == NULL) {
40654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.acct_flags");
40655 0 : return -1;
40656 : }
40657 : {
40658 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.acct_flags));
40659 0 : if (PyLong_Check(value)) {
40660 0 : unsigned long long test_var;
40661 0 : test_var = PyLong_AsUnsignedLongLong(value);
40662 0 : if (PyErr_Occurred() != NULL) {
40663 0 : return -1;
40664 : }
40665 0 : if (test_var > uint_max) {
40666 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40667 : PyLong_Type.tp_name, uint_max, test_var);
40668 0 : return -1;
40669 : }
40670 0 : object->in.acct_flags = test_var;
40671 : } else {
40672 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40673 : PyLong_Type.tp_name);
40674 0 : return -1;
40675 : }
40676 : }
40677 0 : return 0;
40678 : }
40679 :
40680 0 : static PyObject *py_samr_CreateUser2_in_get_access_mask(PyObject *obj, void *closure)
40681 : {
40682 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40683 0 : PyObject *py_access_mask;
40684 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
40685 0 : return py_access_mask;
40686 : }
40687 :
40688 0 : static int py_samr_CreateUser2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
40689 : {
40690 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40691 0 : if (value == NULL) {
40692 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
40693 0 : return -1;
40694 : }
40695 : {
40696 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
40697 0 : if (PyLong_Check(value)) {
40698 0 : unsigned long long test_var;
40699 0 : test_var = PyLong_AsUnsignedLongLong(value);
40700 0 : if (PyErr_Occurred() != NULL) {
40701 0 : return -1;
40702 : }
40703 0 : if (test_var > uint_max) {
40704 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40705 : PyLong_Type.tp_name, uint_max, test_var);
40706 0 : return -1;
40707 : }
40708 0 : object->in.access_mask = test_var;
40709 : } else {
40710 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40711 : PyLong_Type.tp_name);
40712 0 : return -1;
40713 : }
40714 : }
40715 0 : return 0;
40716 : }
40717 :
40718 0 : static PyObject *py_samr_CreateUser2_out_get_user_handle(PyObject *obj, void *closure)
40719 : {
40720 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40721 0 : PyObject *py_user_handle;
40722 0 : if (object->out.user_handle == NULL) {
40723 0 : Py_RETURN_NONE;
40724 : }
40725 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->out.user_handle, object->out.user_handle);
40726 0 : return py_user_handle;
40727 : }
40728 :
40729 0 : static int py_samr_CreateUser2_out_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
40730 : {
40731 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40732 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.user_handle));
40733 0 : if (value == NULL) {
40734 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.user_handle");
40735 0 : return -1;
40736 : }
40737 0 : object->out.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.user_handle);
40738 0 : if (object->out.user_handle == NULL) {
40739 0 : PyErr_NoMemory();
40740 0 : return -1;
40741 : }
40742 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
40743 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
40744 0 : PyErr_NoMemory();
40745 0 : return -1;
40746 : }
40747 0 : object->out.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
40748 0 : return 0;
40749 : }
40750 :
40751 0 : static PyObject *py_samr_CreateUser2_out_get_access_granted(PyObject *obj, void *closure)
40752 : {
40753 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40754 0 : PyObject *py_access_granted;
40755 0 : if (object->out.access_granted == NULL) {
40756 0 : Py_RETURN_NONE;
40757 : }
40758 0 : py_access_granted = PyLong_FromUnsignedLongLong((uint32_t)*object->out.access_granted);
40759 0 : return py_access_granted;
40760 : }
40761 :
40762 0 : static int py_samr_CreateUser2_out_set_access_granted(PyObject *py_obj, PyObject *value, void *closure)
40763 : {
40764 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40765 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.access_granted));
40766 0 : if (value == NULL) {
40767 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.access_granted");
40768 0 : return -1;
40769 : }
40770 0 : object->out.access_granted = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.access_granted);
40771 0 : if (object->out.access_granted == NULL) {
40772 0 : PyErr_NoMemory();
40773 0 : return -1;
40774 : }
40775 : {
40776 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.access_granted));
40777 0 : if (PyLong_Check(value)) {
40778 0 : unsigned long long test_var;
40779 0 : test_var = PyLong_AsUnsignedLongLong(value);
40780 0 : if (PyErr_Occurred() != NULL) {
40781 0 : return -1;
40782 : }
40783 0 : if (test_var > uint_max) {
40784 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40785 : PyLong_Type.tp_name, uint_max, test_var);
40786 0 : return -1;
40787 : }
40788 0 : *object->out.access_granted = test_var;
40789 : } else {
40790 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40791 : PyLong_Type.tp_name);
40792 0 : return -1;
40793 : }
40794 : }
40795 0 : return 0;
40796 : }
40797 :
40798 0 : static PyObject *py_samr_CreateUser2_out_get_rid(PyObject *obj, void *closure)
40799 : {
40800 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40801 0 : PyObject *py_rid;
40802 0 : if (object->out.rid == NULL) {
40803 0 : Py_RETURN_NONE;
40804 : }
40805 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*object->out.rid);
40806 0 : return py_rid;
40807 : }
40808 :
40809 0 : static int py_samr_CreateUser2_out_set_rid(PyObject *py_obj, PyObject *value, void *closure)
40810 : {
40811 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40812 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rid));
40813 0 : if (value == NULL) {
40814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rid");
40815 0 : return -1;
40816 : }
40817 0 : object->out.rid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rid);
40818 0 : if (object->out.rid == NULL) {
40819 0 : PyErr_NoMemory();
40820 0 : return -1;
40821 : }
40822 : {
40823 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.rid));
40824 0 : if (PyLong_Check(value)) {
40825 0 : unsigned long long test_var;
40826 0 : test_var = PyLong_AsUnsignedLongLong(value);
40827 0 : if (PyErr_Occurred() != NULL) {
40828 0 : return -1;
40829 : }
40830 0 : if (test_var > uint_max) {
40831 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
40832 : PyLong_Type.tp_name, uint_max, test_var);
40833 0 : return -1;
40834 : }
40835 0 : *object->out.rid = test_var;
40836 : } else {
40837 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
40838 : PyLong_Type.tp_name);
40839 0 : return -1;
40840 : }
40841 : }
40842 0 : return 0;
40843 : }
40844 :
40845 0 : static PyObject *py_samr_CreateUser2_get_result(PyObject *obj, void *closure)
40846 : {
40847 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(obj);
40848 0 : PyObject *py_result;
40849 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
40850 0 : return py_result;
40851 : }
40852 :
40853 0 : static int py_samr_CreateUser2_set_result(PyObject *py_obj, PyObject *value, void *closure)
40854 : {
40855 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40856 0 : if (value == NULL) {
40857 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
40858 0 : return -1;
40859 : }
40860 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
40861 0 : return 0;
40862 : }
40863 :
40864 : static PyGetSetDef py_samr_CreateUser2_getsetters[] = {
40865 : {
40866 : .name = discard_const_p(char, "in_domain_handle"),
40867 : .get = py_samr_CreateUser2_in_get_domain_handle,
40868 : .set = py_samr_CreateUser2_in_set_domain_handle,
40869 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40870 : },
40871 : {
40872 : .name = discard_const_p(char, "in_account_name"),
40873 : .get = py_samr_CreateUser2_in_get_account_name,
40874 : .set = py_samr_CreateUser2_in_set_account_name,
40875 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
40876 : },
40877 : {
40878 : .name = discard_const_p(char, "in_acct_flags"),
40879 : .get = py_samr_CreateUser2_in_get_acct_flags,
40880 : .set = py_samr_CreateUser2_in_set_acct_flags,
40881 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_AcctFlags")
40882 : },
40883 : {
40884 : .name = discard_const_p(char, "in_access_mask"),
40885 : .get = py_samr_CreateUser2_in_get_access_mask,
40886 : .set = py_samr_CreateUser2_in_set_access_mask,
40887 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserAccessMask")
40888 : },
40889 : {
40890 : .name = discard_const_p(char, "out_user_handle"),
40891 : .get = py_samr_CreateUser2_out_get_user_handle,
40892 : .set = py_samr_CreateUser2_out_set_user_handle,
40893 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
40894 : },
40895 : {
40896 : .name = discard_const_p(char, "out_access_granted"),
40897 : .get = py_samr_CreateUser2_out_get_access_granted,
40898 : .set = py_samr_CreateUser2_out_set_access_granted,
40899 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40900 : },
40901 : {
40902 : .name = discard_const_p(char, "out_rid"),
40903 : .get = py_samr_CreateUser2_out_get_rid,
40904 : .set = py_samr_CreateUser2_out_set_rid,
40905 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
40906 : },
40907 : {
40908 : .name = discard_const_p(char, "result"),
40909 : .get = py_samr_CreateUser2_get_result,
40910 : .set = py_samr_CreateUser2_set_result,
40911 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
40912 : },
40913 : { .name = NULL }
40914 : };
40915 :
40916 0 : static PyObject *py_samr_CreateUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
40917 : {
40918 0 : PyObject *self = pytalloc_new(struct samr_CreateUser2, type);
40919 0 : struct samr_CreateUser2 *_self = (struct samr_CreateUser2 *)pytalloc_get_ptr(self);
40920 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
40921 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
40922 0 : _self->in.account_name = talloc_zero(mem_ctx, struct lsa_String);
40923 0 : _self->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
40924 0 : _self->out.access_granted = talloc_zero(mem_ctx, uint32_t);
40925 0 : _self->out.rid = talloc_zero(mem_ctx, uint32_t);
40926 0 : return self;
40927 : }
40928 :
40929 0 : static PyObject *py_samr_CreateUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
40930 : {
40931 :
40932 :
40933 0 : return PyLong_FromLong(50);
40934 : }
40935 :
40936 0 : static PyObject *py_samr_CreateUser2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
40937 : {
40938 0 : const struct ndr_interface_call *call = NULL;
40939 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
40940 0 : PyObject *ret = NULL;
40941 0 : struct ndr_push *push = NULL;
40942 0 : DATA_BLOB blob;
40943 0 : enum ndr_err_code err;
40944 :
40945 0 : if (ndr_table_samr.num_calls < 51) {
40946 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_pack");
40947 0 : return NULL;
40948 : }
40949 0 : call = &ndr_table_samr.calls[50];
40950 :
40951 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
40952 0 : if (push == NULL) {
40953 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
40954 0 : return NULL;
40955 : }
40956 :
40957 0 : push->flags |= ndr_push_flags;
40958 :
40959 0 : err = call->ndr_push(push, ndr_inout_flags, object);
40960 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
40961 0 : TALLOC_FREE(push);
40962 0 : PyErr_SetNdrError(err);
40963 0 : return NULL;
40964 : }
40965 0 : blob = ndr_push_blob(push);
40966 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
40967 0 : TALLOC_FREE(push);
40968 0 : return ret;
40969 : }
40970 :
40971 0 : static PyObject *py_samr_CreateUser2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40972 : {
40973 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40974 0 : PyObject *bigendian_obj = NULL;
40975 0 : PyObject *ndr64_obj = NULL;
40976 0 : libndr_flags ndr_push_flags = 0;
40977 :
40978 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
40979 : discard_const_p(char *, kwnames),
40980 : &bigendian_obj,
40981 : &ndr64_obj)) {
40982 0 : return NULL;
40983 : }
40984 :
40985 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
40986 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
40987 : }
40988 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
40989 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
40990 : }
40991 :
40992 0 : return py_samr_CreateUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
40993 : }
40994 :
40995 0 : static PyObject *py_samr_CreateUser2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
40996 : {
40997 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
40998 0 : PyObject *bigendian_obj = NULL;
40999 0 : PyObject *ndr64_obj = NULL;
41000 0 : libndr_flags ndr_push_flags = 0;
41001 :
41002 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41003 : discard_const_p(char *, kwnames),
41004 : &bigendian_obj,
41005 : &ndr64_obj)) {
41006 0 : return NULL;
41007 : }
41008 :
41009 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41010 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41011 : }
41012 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41013 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41014 : }
41015 :
41016 0 : return py_samr_CreateUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41017 : }
41018 :
41019 0 : static PyObject *py_samr_CreateUser2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41020 : {
41021 0 : const struct ndr_interface_call *call = NULL;
41022 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
41023 0 : struct ndr_pull *pull = NULL;
41024 0 : enum ndr_err_code err;
41025 :
41026 0 : if (ndr_table_samr.num_calls < 51) {
41027 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_unpack");
41028 0 : return NULL;
41029 : }
41030 0 : call = &ndr_table_samr.calls[50];
41031 :
41032 0 : pull = ndr_pull_init_blob(blob, object);
41033 0 : if (pull == NULL) {
41034 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41035 0 : return NULL;
41036 : }
41037 :
41038 0 : pull->flags |= ndr_pull_flags;
41039 :
41040 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41041 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41042 0 : TALLOC_FREE(pull);
41043 0 : PyErr_SetNdrError(err);
41044 0 : return NULL;
41045 : }
41046 0 : if (!allow_remaining) {
41047 0 : uint32_t highest_ofs;
41048 :
41049 0 : if (pull->offset > pull->relative_highest_offset) {
41050 0 : highest_ofs = pull->offset;
41051 : } else {
41052 0 : highest_ofs = pull->relative_highest_offset;
41053 : }
41054 0 : if (highest_ofs < pull->data_size) {
41055 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41056 : "not all bytes consumed ofs[%u] size[%u]",
41057 : highest_ofs, pull->data_size);
41058 0 : TALLOC_FREE(pull);
41059 0 : PyErr_SetNdrError(err);
41060 0 : return NULL;
41061 : }
41062 : }
41063 :
41064 0 : TALLOC_FREE(pull);
41065 0 : Py_RETURN_NONE;
41066 : }
41067 :
41068 0 : static PyObject *py_samr_CreateUser2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41069 : {
41070 0 : DATA_BLOB blob;
41071 0 : Py_ssize_t blob_length = 0;
41072 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41073 0 : PyObject *bigendian_obj = NULL;
41074 0 : PyObject *ndr64_obj = NULL;
41075 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41076 0 : PyObject *allow_remaining_obj = NULL;
41077 0 : bool allow_remaining = false;
41078 :
41079 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41080 : discard_const_p(char *, kwnames),
41081 : &blob.data, &blob_length,
41082 : &bigendian_obj,
41083 : &ndr64_obj,
41084 : &allow_remaining_obj)) {
41085 0 : return NULL;
41086 : }
41087 0 : blob.length = blob_length;
41088 :
41089 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41090 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41091 : }
41092 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41093 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41094 : }
41095 :
41096 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41097 0 : allow_remaining = true;
41098 : }
41099 :
41100 0 : return py_samr_CreateUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41101 : }
41102 :
41103 0 : static PyObject *py_samr_CreateUser2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41104 : {
41105 0 : DATA_BLOB blob;
41106 0 : Py_ssize_t blob_length = 0;
41107 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41108 0 : PyObject *bigendian_obj = NULL;
41109 0 : PyObject *ndr64_obj = NULL;
41110 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41111 0 : PyObject *allow_remaining_obj = NULL;
41112 0 : bool allow_remaining = false;
41113 :
41114 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41115 : discard_const_p(char *, kwnames),
41116 : &blob.data, &blob_length,
41117 : &bigendian_obj,
41118 : &ndr64_obj,
41119 : &allow_remaining_obj)) {
41120 0 : return NULL;
41121 : }
41122 0 : blob.length = blob_length;
41123 :
41124 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41125 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41126 : }
41127 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41128 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41129 : }
41130 :
41131 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41132 0 : allow_remaining = true;
41133 : }
41134 :
41135 0 : return py_samr_CreateUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41136 : }
41137 :
41138 0 : static PyObject *py_samr_CreateUser2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41139 : {
41140 0 : const struct ndr_interface_call *call = NULL;
41141 0 : struct samr_CreateUser2 *object = (struct samr_CreateUser2 *)pytalloc_get_ptr(py_obj);
41142 0 : PyObject *ret;
41143 0 : char *retstr;
41144 :
41145 0 : if (ndr_table_samr.num_calls < 51) {
41146 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_CreateUser2_ndr_print");
41147 0 : return NULL;
41148 : }
41149 0 : call = &ndr_table_samr.calls[50];
41150 :
41151 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41152 0 : ret = PyUnicode_FromString(retstr);
41153 0 : TALLOC_FREE(retstr);
41154 :
41155 0 : return ret;
41156 : }
41157 :
41158 0 : static PyObject *py_samr_CreateUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41159 : {
41160 0 : return py_samr_CreateUser2_ndr_print(py_obj, "samr_CreateUser2_in", NDR_IN);
41161 : }
41162 :
41163 0 : static PyObject *py_samr_CreateUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41164 : {
41165 0 : return py_samr_CreateUser2_ndr_print(py_obj, "samr_CreateUser2_out", NDR_OUT);
41166 : }
41167 :
41168 : static PyMethodDef py_samr_CreateUser2_methods[] = {
41169 : { "opnum", (PyCFunction)py_samr_CreateUser2_ndr_opnum, METH_NOARGS|METH_CLASS,
41170 : "samr.CreateUser2.opnum() -> 50 (0x32) " },
41171 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41172 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41173 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41174 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41175 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41176 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41177 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_CreateUser2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41178 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41179 : { "__ndr_print_in__", (PyCFunction)py_samr_CreateUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41180 : { "__ndr_print_out__", (PyCFunction)py_samr_CreateUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41181 : { NULL, NULL, 0, NULL }
41182 : };
41183 :
41184 :
41185 : static PyTypeObject samr_CreateUser2_Type = {
41186 : PyVarObject_HEAD_INIT(NULL, 0)
41187 : .tp_name = "samr.CreateUser2",
41188 : .tp_getset = py_samr_CreateUser2_getsetters,
41189 : .tp_methods = py_samr_CreateUser2_methods,
41190 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41191 : .tp_new = py_samr_CreateUser2_new,
41192 : };
41193 :
41194 0 : static bool pack_py_samr_CreateUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser2 *r)
41195 : {
41196 0 : PyObject *py_domain_handle;
41197 0 : PyObject *py_account_name;
41198 0 : PyObject *py_acct_flags;
41199 0 : PyObject *py_access_mask;
41200 0 : const char *kwnames[] = {
41201 : "domain_handle", "account_name", "acct_flags", "access_mask", NULL
41202 : };
41203 :
41204 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_CreateUser2", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_acct_flags, &py_access_mask)) {
41205 0 : return false;
41206 : }
41207 :
41208 0 : if (py_domain_handle == NULL) {
41209 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
41210 0 : return false;
41211 : }
41212 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
41213 0 : if (r->in.domain_handle == NULL) {
41214 0 : PyErr_NoMemory();
41215 0 : return false;
41216 : }
41217 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
41218 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
41219 0 : PyErr_NoMemory();
41220 0 : return false;
41221 : }
41222 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
41223 0 : if (py_account_name == NULL) {
41224 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account_name");
41225 0 : return false;
41226 : }
41227 0 : r->in.account_name = talloc_ptrtype(r, r->in.account_name);
41228 0 : if (r->in.account_name == NULL) {
41229 0 : PyErr_NoMemory();
41230 0 : return false;
41231 : }
41232 0 : PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;);
41233 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
41234 0 : PyErr_NoMemory();
41235 0 : return false;
41236 : }
41237 0 : r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
41238 0 : if (py_acct_flags == NULL) {
41239 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.acct_flags");
41240 0 : return false;
41241 : }
41242 : {
41243 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.acct_flags));
41244 0 : if (PyLong_Check(py_acct_flags)) {
41245 0 : unsigned long long test_var;
41246 0 : test_var = PyLong_AsUnsignedLongLong(py_acct_flags);
41247 0 : if (PyErr_Occurred() != NULL) {
41248 0 : return false;
41249 : }
41250 0 : if (test_var > uint_max) {
41251 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41252 : PyLong_Type.tp_name, uint_max, test_var);
41253 0 : return false;
41254 : }
41255 0 : r->in.acct_flags = test_var;
41256 : } else {
41257 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41258 : PyLong_Type.tp_name);
41259 0 : return false;
41260 : }
41261 : }
41262 0 : if (py_access_mask == NULL) {
41263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
41264 0 : return false;
41265 : }
41266 : {
41267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
41268 0 : if (PyLong_Check(py_access_mask)) {
41269 0 : unsigned long long test_var;
41270 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
41271 0 : if (PyErr_Occurred() != NULL) {
41272 0 : return false;
41273 : }
41274 0 : if (test_var > uint_max) {
41275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41276 : PyLong_Type.tp_name, uint_max, test_var);
41277 0 : return false;
41278 : }
41279 0 : r->in.access_mask = test_var;
41280 : } else {
41281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41282 : PyLong_Type.tp_name);
41283 0 : return false;
41284 : }
41285 : }
41286 0 : return true;
41287 : }
41288 :
41289 0 : static PyObject *unpack_py_samr_CreateUser2_args_out(struct samr_CreateUser2 *r)
41290 : {
41291 0 : PyObject *result;
41292 0 : PyObject *py_user_handle;
41293 0 : PyObject *py_access_granted;
41294 0 : PyObject *py_rid;
41295 0 : result = PyTuple_New(3);
41296 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
41297 0 : PyTuple_SetItem(result, 0, py_user_handle);
41298 0 : py_access_granted = PyLong_FromUnsignedLongLong((uint32_t)*r->out.access_granted);
41299 0 : PyTuple_SetItem(result, 1, py_access_granted);
41300 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)*r->out.rid);
41301 0 : PyTuple_SetItem(result, 2, py_rid);
41302 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
41303 0 : PyErr_SetNTSTATUS(r->out.result);
41304 0 : return NULL;
41305 : }
41306 :
41307 0 : return result;
41308 : }
41309 :
41310 :
41311 0 : static PyObject *py_samr_QueryDisplayInfo3_in_get_domain_handle(PyObject *obj, void *closure)
41312 : {
41313 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41314 0 : PyObject *py_domain_handle;
41315 0 : if (object->in.domain_handle == NULL) {
41316 0 : Py_RETURN_NONE;
41317 : }
41318 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
41319 0 : return py_domain_handle;
41320 : }
41321 :
41322 0 : static int py_samr_QueryDisplayInfo3_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
41323 : {
41324 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41325 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
41326 0 : if (value == NULL) {
41327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
41328 0 : return -1;
41329 : }
41330 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
41331 0 : if (object->in.domain_handle == NULL) {
41332 0 : PyErr_NoMemory();
41333 0 : return -1;
41334 : }
41335 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
41336 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
41337 0 : PyErr_NoMemory();
41338 0 : return -1;
41339 : }
41340 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
41341 0 : return 0;
41342 : }
41343 :
41344 0 : static PyObject *py_samr_QueryDisplayInfo3_in_get_level(PyObject *obj, void *closure)
41345 : {
41346 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41347 0 : PyObject *py_level;
41348 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
41349 0 : return py_level;
41350 : }
41351 :
41352 0 : static int py_samr_QueryDisplayInfo3_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
41353 : {
41354 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41355 0 : if (value == NULL) {
41356 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
41357 0 : return -1;
41358 : }
41359 : {
41360 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
41361 0 : if (PyLong_Check(value)) {
41362 0 : unsigned long long test_var;
41363 0 : test_var = PyLong_AsUnsignedLongLong(value);
41364 0 : if (PyErr_Occurred() != NULL) {
41365 0 : return -1;
41366 : }
41367 0 : if (test_var > uint_max) {
41368 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41369 : PyLong_Type.tp_name, uint_max, test_var);
41370 0 : return -1;
41371 : }
41372 0 : object->in.level = test_var;
41373 : } else {
41374 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41375 : PyLong_Type.tp_name);
41376 0 : return -1;
41377 : }
41378 : }
41379 0 : return 0;
41380 : }
41381 :
41382 0 : static PyObject *py_samr_QueryDisplayInfo3_in_get_start_idx(PyObject *obj, void *closure)
41383 : {
41384 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41385 0 : PyObject *py_start_idx;
41386 0 : py_start_idx = PyLong_FromUnsignedLongLong((uint32_t)object->in.start_idx);
41387 0 : return py_start_idx;
41388 : }
41389 :
41390 0 : static int py_samr_QueryDisplayInfo3_in_set_start_idx(PyObject *py_obj, PyObject *value, void *closure)
41391 : {
41392 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41393 0 : if (value == NULL) {
41394 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.start_idx");
41395 0 : return -1;
41396 : }
41397 : {
41398 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.start_idx));
41399 0 : if (PyLong_Check(value)) {
41400 0 : unsigned long long test_var;
41401 0 : test_var = PyLong_AsUnsignedLongLong(value);
41402 0 : if (PyErr_Occurred() != NULL) {
41403 0 : return -1;
41404 : }
41405 0 : if (test_var > uint_max) {
41406 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41407 : PyLong_Type.tp_name, uint_max, test_var);
41408 0 : return -1;
41409 : }
41410 0 : object->in.start_idx = test_var;
41411 : } else {
41412 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41413 : PyLong_Type.tp_name);
41414 0 : return -1;
41415 : }
41416 : }
41417 0 : return 0;
41418 : }
41419 :
41420 0 : static PyObject *py_samr_QueryDisplayInfo3_in_get_max_entries(PyObject *obj, void *closure)
41421 : {
41422 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41423 0 : PyObject *py_max_entries;
41424 0 : py_max_entries = PyLong_FromUnsignedLongLong((uint32_t)object->in.max_entries);
41425 0 : return py_max_entries;
41426 : }
41427 :
41428 0 : static int py_samr_QueryDisplayInfo3_in_set_max_entries(PyObject *py_obj, PyObject *value, void *closure)
41429 : {
41430 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41431 0 : if (value == NULL) {
41432 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.max_entries");
41433 0 : return -1;
41434 : }
41435 : {
41436 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.max_entries));
41437 0 : if (PyLong_Check(value)) {
41438 0 : unsigned long long test_var;
41439 0 : test_var = PyLong_AsUnsignedLongLong(value);
41440 0 : if (PyErr_Occurred() != NULL) {
41441 0 : return -1;
41442 : }
41443 0 : if (test_var > uint_max) {
41444 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41445 : PyLong_Type.tp_name, uint_max, test_var);
41446 0 : return -1;
41447 : }
41448 0 : object->in.max_entries = test_var;
41449 : } else {
41450 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41451 : PyLong_Type.tp_name);
41452 0 : return -1;
41453 : }
41454 : }
41455 0 : return 0;
41456 : }
41457 :
41458 0 : static PyObject *py_samr_QueryDisplayInfo3_in_get_buf_size(PyObject *obj, void *closure)
41459 : {
41460 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41461 0 : PyObject *py_buf_size;
41462 0 : py_buf_size = PyLong_FromUnsignedLongLong((uint32_t)object->in.buf_size);
41463 0 : return py_buf_size;
41464 : }
41465 :
41466 0 : static int py_samr_QueryDisplayInfo3_in_set_buf_size(PyObject *py_obj, PyObject *value, void *closure)
41467 : {
41468 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41469 0 : if (value == NULL) {
41470 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.buf_size");
41471 0 : return -1;
41472 : }
41473 : {
41474 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.buf_size));
41475 0 : if (PyLong_Check(value)) {
41476 0 : unsigned long long test_var;
41477 0 : test_var = PyLong_AsUnsignedLongLong(value);
41478 0 : if (PyErr_Occurred() != NULL) {
41479 0 : return -1;
41480 : }
41481 0 : if (test_var > uint_max) {
41482 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41483 : PyLong_Type.tp_name, uint_max, test_var);
41484 0 : return -1;
41485 : }
41486 0 : object->in.buf_size = test_var;
41487 : } else {
41488 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41489 : PyLong_Type.tp_name);
41490 0 : return -1;
41491 : }
41492 : }
41493 0 : return 0;
41494 : }
41495 :
41496 0 : static PyObject *py_samr_QueryDisplayInfo3_out_get_total_size(PyObject *obj, void *closure)
41497 : {
41498 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41499 0 : PyObject *py_total_size;
41500 0 : if (object->out.total_size == NULL) {
41501 0 : Py_RETURN_NONE;
41502 : }
41503 0 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.total_size);
41504 0 : return py_total_size;
41505 : }
41506 :
41507 0 : static int py_samr_QueryDisplayInfo3_out_set_total_size(PyObject *py_obj, PyObject *value, void *closure)
41508 : {
41509 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41510 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.total_size));
41511 0 : if (value == NULL) {
41512 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.total_size");
41513 0 : return -1;
41514 : }
41515 0 : object->out.total_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.total_size);
41516 0 : if (object->out.total_size == NULL) {
41517 0 : PyErr_NoMemory();
41518 0 : return -1;
41519 : }
41520 : {
41521 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.total_size));
41522 0 : if (PyLong_Check(value)) {
41523 0 : unsigned long long test_var;
41524 0 : test_var = PyLong_AsUnsignedLongLong(value);
41525 0 : if (PyErr_Occurred() != NULL) {
41526 0 : return -1;
41527 : }
41528 0 : if (test_var > uint_max) {
41529 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41530 : PyLong_Type.tp_name, uint_max, test_var);
41531 0 : return -1;
41532 : }
41533 0 : *object->out.total_size = test_var;
41534 : } else {
41535 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41536 : PyLong_Type.tp_name);
41537 0 : return -1;
41538 : }
41539 : }
41540 0 : return 0;
41541 : }
41542 :
41543 0 : static PyObject *py_samr_QueryDisplayInfo3_out_get_returned_size(PyObject *obj, void *closure)
41544 : {
41545 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41546 0 : PyObject *py_returned_size;
41547 0 : if (object->out.returned_size == NULL) {
41548 0 : Py_RETURN_NONE;
41549 : }
41550 0 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*object->out.returned_size);
41551 0 : return py_returned_size;
41552 : }
41553 :
41554 0 : static int py_samr_QueryDisplayInfo3_out_set_returned_size(PyObject *py_obj, PyObject *value, void *closure)
41555 : {
41556 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41557 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.returned_size));
41558 0 : if (value == NULL) {
41559 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.returned_size");
41560 0 : return -1;
41561 : }
41562 0 : object->out.returned_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.returned_size);
41563 0 : if (object->out.returned_size == NULL) {
41564 0 : PyErr_NoMemory();
41565 0 : return -1;
41566 : }
41567 : {
41568 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.returned_size));
41569 0 : if (PyLong_Check(value)) {
41570 0 : unsigned long long test_var;
41571 0 : test_var = PyLong_AsUnsignedLongLong(value);
41572 0 : if (PyErr_Occurred() != NULL) {
41573 0 : return -1;
41574 : }
41575 0 : if (test_var > uint_max) {
41576 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
41577 : PyLong_Type.tp_name, uint_max, test_var);
41578 0 : return -1;
41579 : }
41580 0 : *object->out.returned_size = test_var;
41581 : } else {
41582 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
41583 : PyLong_Type.tp_name);
41584 0 : return -1;
41585 : }
41586 : }
41587 0 : return 0;
41588 : }
41589 :
41590 0 : static PyObject *py_samr_QueryDisplayInfo3_out_get_info(PyObject *obj, void *closure)
41591 : {
41592 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41593 0 : PyObject *py_info;
41594 0 : if (object->out.info == NULL) {
41595 0 : Py_RETURN_NONE;
41596 : }
41597 0 : py_info = pyrpc_import_union(&samr_DispInfo_Type, object->out.info, object->in.level, object->out.info, "union samr_DispInfo");
41598 0 : if (py_info == NULL) {
41599 0 : return NULL;
41600 : }
41601 0 : return py_info;
41602 : }
41603 :
41604 0 : static int py_samr_QueryDisplayInfo3_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
41605 : {
41606 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41607 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
41608 0 : if (value == NULL) {
41609 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
41610 0 : return -1;
41611 : }
41612 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
41613 0 : if (object->out.info == NULL) {
41614 0 : PyErr_NoMemory();
41615 0 : return -1;
41616 : }
41617 : {
41618 0 : union samr_DispInfo *info_switch_1;
41619 0 : info_switch_1 = (union samr_DispInfo *)pyrpc_export_union(&samr_DispInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_DispInfo");
41620 0 : if (info_switch_1 == NULL) {
41621 0 : return -1;
41622 : }
41623 0 : object->out.info = info_switch_1;
41624 : }
41625 0 : return 0;
41626 : }
41627 :
41628 0 : static PyObject *py_samr_QueryDisplayInfo3_get_result(PyObject *obj, void *closure)
41629 : {
41630 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(obj);
41631 0 : PyObject *py_result;
41632 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
41633 0 : return py_result;
41634 : }
41635 :
41636 0 : static int py_samr_QueryDisplayInfo3_set_result(PyObject *py_obj, PyObject *value, void *closure)
41637 : {
41638 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41639 0 : if (value == NULL) {
41640 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
41641 0 : return -1;
41642 : }
41643 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
41644 0 : return 0;
41645 : }
41646 :
41647 : static PyGetSetDef py_samr_QueryDisplayInfo3_getsetters[] = {
41648 : {
41649 : .name = discard_const_p(char, "in_domain_handle"),
41650 : .get = py_samr_QueryDisplayInfo3_in_get_domain_handle,
41651 : .set = py_samr_QueryDisplayInfo3_in_set_domain_handle,
41652 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
41653 : },
41654 : {
41655 : .name = discard_const_p(char, "in_level"),
41656 : .get = py_samr_QueryDisplayInfo3_in_get_level,
41657 : .set = py_samr_QueryDisplayInfo3_in_set_level,
41658 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
41659 : },
41660 : {
41661 : .name = discard_const_p(char, "in_start_idx"),
41662 : .get = py_samr_QueryDisplayInfo3_in_get_start_idx,
41663 : .set = py_samr_QueryDisplayInfo3_in_set_start_idx,
41664 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41665 : },
41666 : {
41667 : .name = discard_const_p(char, "in_max_entries"),
41668 : .get = py_samr_QueryDisplayInfo3_in_get_max_entries,
41669 : .set = py_samr_QueryDisplayInfo3_in_set_max_entries,
41670 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41671 : },
41672 : {
41673 : .name = discard_const_p(char, "in_buf_size"),
41674 : .get = py_samr_QueryDisplayInfo3_in_get_buf_size,
41675 : .set = py_samr_QueryDisplayInfo3_in_set_buf_size,
41676 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41677 : },
41678 : {
41679 : .name = discard_const_p(char, "out_total_size"),
41680 : .get = py_samr_QueryDisplayInfo3_out_get_total_size,
41681 : .set = py_samr_QueryDisplayInfo3_out_set_total_size,
41682 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41683 : },
41684 : {
41685 : .name = discard_const_p(char, "out_returned_size"),
41686 : .get = py_samr_QueryDisplayInfo3_out_get_returned_size,
41687 : .set = py_samr_QueryDisplayInfo3_out_set_returned_size,
41688 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
41689 : },
41690 : {
41691 : .name = discard_const_p(char, "out_info"),
41692 : .get = py_samr_QueryDisplayInfo3_out_get_info,
41693 : .set = py_samr_QueryDisplayInfo3_out_set_info,
41694 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DispInfo")
41695 : },
41696 : {
41697 : .name = discard_const_p(char, "result"),
41698 : .get = py_samr_QueryDisplayInfo3_get_result,
41699 : .set = py_samr_QueryDisplayInfo3_set_result,
41700 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
41701 : },
41702 : { .name = NULL }
41703 : };
41704 :
41705 0 : static PyObject *py_samr_QueryDisplayInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
41706 : {
41707 0 : PyObject *self = pytalloc_new(struct samr_QueryDisplayInfo3, type);
41708 0 : struct samr_QueryDisplayInfo3 *_self = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(self);
41709 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
41710 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
41711 0 : _self->out.total_size = talloc_zero(mem_ctx, uint32_t);
41712 0 : _self->out.returned_size = talloc_zero(mem_ctx, uint32_t);
41713 0 : _self->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
41714 0 : return self;
41715 : }
41716 :
41717 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
41718 : {
41719 :
41720 :
41721 0 : return PyLong_FromLong(51);
41722 : }
41723 :
41724 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
41725 : {
41726 0 : const struct ndr_interface_call *call = NULL;
41727 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41728 0 : PyObject *ret = NULL;
41729 0 : struct ndr_push *push = NULL;
41730 0 : DATA_BLOB blob;
41731 0 : enum ndr_err_code err;
41732 :
41733 0 : if (ndr_table_samr.num_calls < 52) {
41734 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_pack");
41735 0 : return NULL;
41736 : }
41737 0 : call = &ndr_table_samr.calls[51];
41738 :
41739 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
41740 0 : if (push == NULL) {
41741 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41742 0 : return NULL;
41743 : }
41744 :
41745 0 : push->flags |= ndr_push_flags;
41746 :
41747 0 : err = call->ndr_push(push, ndr_inout_flags, object);
41748 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41749 0 : TALLOC_FREE(push);
41750 0 : PyErr_SetNdrError(err);
41751 0 : return NULL;
41752 : }
41753 0 : blob = ndr_push_blob(push);
41754 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
41755 0 : TALLOC_FREE(push);
41756 0 : return ret;
41757 : }
41758 :
41759 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41760 : {
41761 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41762 0 : PyObject *bigendian_obj = NULL;
41763 0 : PyObject *ndr64_obj = NULL;
41764 0 : libndr_flags ndr_push_flags = 0;
41765 :
41766 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
41767 : discard_const_p(char *, kwnames),
41768 : &bigendian_obj,
41769 : &ndr64_obj)) {
41770 0 : return NULL;
41771 : }
41772 :
41773 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41774 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41775 : }
41776 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41777 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41778 : }
41779 :
41780 0 : return py_samr_QueryDisplayInfo3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
41781 : }
41782 :
41783 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41784 : {
41785 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
41786 0 : PyObject *bigendian_obj = NULL;
41787 0 : PyObject *ndr64_obj = NULL;
41788 0 : libndr_flags ndr_push_flags = 0;
41789 :
41790 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
41791 : discard_const_p(char *, kwnames),
41792 : &bigendian_obj,
41793 : &ndr64_obj)) {
41794 0 : return NULL;
41795 : }
41796 :
41797 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41798 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
41799 : }
41800 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41801 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
41802 : }
41803 :
41804 0 : return py_samr_QueryDisplayInfo3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
41805 : }
41806 :
41807 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
41808 : {
41809 0 : const struct ndr_interface_call *call = NULL;
41810 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41811 0 : struct ndr_pull *pull = NULL;
41812 0 : enum ndr_err_code err;
41813 :
41814 0 : if (ndr_table_samr.num_calls < 52) {
41815 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_unpack");
41816 0 : return NULL;
41817 : }
41818 0 : call = &ndr_table_samr.calls[51];
41819 :
41820 0 : pull = ndr_pull_init_blob(blob, object);
41821 0 : if (pull == NULL) {
41822 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
41823 0 : return NULL;
41824 : }
41825 :
41826 0 : pull->flags |= ndr_pull_flags;
41827 :
41828 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
41829 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
41830 0 : TALLOC_FREE(pull);
41831 0 : PyErr_SetNdrError(err);
41832 0 : return NULL;
41833 : }
41834 0 : if (!allow_remaining) {
41835 0 : uint32_t highest_ofs;
41836 :
41837 0 : if (pull->offset > pull->relative_highest_offset) {
41838 0 : highest_ofs = pull->offset;
41839 : } else {
41840 0 : highest_ofs = pull->relative_highest_offset;
41841 : }
41842 0 : if (highest_ofs < pull->data_size) {
41843 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
41844 : "not all bytes consumed ofs[%u] size[%u]",
41845 : highest_ofs, pull->data_size);
41846 0 : TALLOC_FREE(pull);
41847 0 : PyErr_SetNdrError(err);
41848 0 : return NULL;
41849 : }
41850 : }
41851 :
41852 0 : TALLOC_FREE(pull);
41853 0 : Py_RETURN_NONE;
41854 : }
41855 :
41856 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41857 : {
41858 0 : DATA_BLOB blob;
41859 0 : Py_ssize_t blob_length = 0;
41860 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41861 0 : PyObject *bigendian_obj = NULL;
41862 0 : PyObject *ndr64_obj = NULL;
41863 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41864 0 : PyObject *allow_remaining_obj = NULL;
41865 0 : bool allow_remaining = false;
41866 :
41867 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
41868 : discard_const_p(char *, kwnames),
41869 : &blob.data, &blob_length,
41870 : &bigendian_obj,
41871 : &ndr64_obj,
41872 : &allow_remaining_obj)) {
41873 0 : return NULL;
41874 : }
41875 0 : blob.length = blob_length;
41876 :
41877 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41878 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41879 : }
41880 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41881 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41882 : }
41883 :
41884 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41885 0 : allow_remaining = true;
41886 : }
41887 :
41888 0 : return py_samr_QueryDisplayInfo3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
41889 : }
41890 :
41891 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
41892 : {
41893 0 : DATA_BLOB blob;
41894 0 : Py_ssize_t blob_length = 0;
41895 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
41896 0 : PyObject *bigendian_obj = NULL;
41897 0 : PyObject *ndr64_obj = NULL;
41898 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
41899 0 : PyObject *allow_remaining_obj = NULL;
41900 0 : bool allow_remaining = false;
41901 :
41902 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
41903 : discard_const_p(char *, kwnames),
41904 : &blob.data, &blob_length,
41905 : &bigendian_obj,
41906 : &ndr64_obj,
41907 : &allow_remaining_obj)) {
41908 0 : return NULL;
41909 : }
41910 0 : blob.length = blob_length;
41911 :
41912 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
41913 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
41914 : }
41915 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
41916 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
41917 : }
41918 :
41919 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
41920 0 : allow_remaining = true;
41921 : }
41922 :
41923 0 : return py_samr_QueryDisplayInfo3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
41924 : }
41925 :
41926 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
41927 : {
41928 0 : const struct ndr_interface_call *call = NULL;
41929 0 : struct samr_QueryDisplayInfo3 *object = (struct samr_QueryDisplayInfo3 *)pytalloc_get_ptr(py_obj);
41930 0 : PyObject *ret;
41931 0 : char *retstr;
41932 :
41933 0 : if (ndr_table_samr.num_calls < 52) {
41934 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_QueryDisplayInfo3_ndr_print");
41935 0 : return NULL;
41936 : }
41937 0 : call = &ndr_table_samr.calls[51];
41938 :
41939 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
41940 0 : ret = PyUnicode_FromString(retstr);
41941 0 : TALLOC_FREE(retstr);
41942 :
41943 0 : return ret;
41944 : }
41945 :
41946 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41947 : {
41948 0 : return py_samr_QueryDisplayInfo3_ndr_print(py_obj, "samr_QueryDisplayInfo3_in", NDR_IN);
41949 : }
41950 :
41951 0 : static PyObject *py_samr_QueryDisplayInfo3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
41952 : {
41953 0 : return py_samr_QueryDisplayInfo3_ndr_print(py_obj, "samr_QueryDisplayInfo3_out", NDR_OUT);
41954 : }
41955 :
41956 : static PyMethodDef py_samr_QueryDisplayInfo3_methods[] = {
41957 : { "opnum", (PyCFunction)py_samr_QueryDisplayInfo3_ndr_opnum, METH_NOARGS|METH_CLASS,
41958 : "samr.QueryDisplayInfo3.opnum() -> 51 (0x33) " },
41959 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
41960 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
41961 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
41962 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
41963 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
41964 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
41965 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_QueryDisplayInfo3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
41966 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
41967 : { "__ndr_print_in__", (PyCFunction)py_samr_QueryDisplayInfo3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
41968 : { "__ndr_print_out__", (PyCFunction)py_samr_QueryDisplayInfo3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
41969 : { NULL, NULL, 0, NULL }
41970 : };
41971 :
41972 :
41973 : static PyTypeObject samr_QueryDisplayInfo3_Type = {
41974 : PyVarObject_HEAD_INIT(NULL, 0)
41975 : .tp_name = "samr.QueryDisplayInfo3",
41976 : .tp_getset = py_samr_QueryDisplayInfo3_getsetters,
41977 : .tp_methods = py_samr_QueryDisplayInfo3_methods,
41978 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
41979 : .tp_new = py_samr_QueryDisplayInfo3_new,
41980 : };
41981 :
41982 0 : static bool pack_py_samr_QueryDisplayInfo3_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo3 *r)
41983 : {
41984 0 : PyObject *py_domain_handle;
41985 0 : PyObject *py_level;
41986 0 : PyObject *py_start_idx;
41987 0 : PyObject *py_max_entries;
41988 0 : PyObject *py_buf_size;
41989 0 : const char *kwnames[] = {
41990 : "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
41991 : };
41992 :
41993 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:samr_QueryDisplayInfo3", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_start_idx, &py_max_entries, &py_buf_size)) {
41994 0 : return false;
41995 : }
41996 :
41997 0 : if (py_domain_handle == NULL) {
41998 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
41999 0 : return false;
42000 : }
42001 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
42002 0 : if (r->in.domain_handle == NULL) {
42003 0 : PyErr_NoMemory();
42004 0 : return false;
42005 : }
42006 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
42007 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
42008 0 : PyErr_NoMemory();
42009 0 : return false;
42010 : }
42011 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
42012 0 : if (py_level == NULL) {
42013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
42014 0 : return false;
42015 : }
42016 : {
42017 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
42018 0 : if (PyLong_Check(py_level)) {
42019 0 : unsigned long long test_var;
42020 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
42021 0 : if (PyErr_Occurred() != NULL) {
42022 0 : return false;
42023 : }
42024 0 : if (test_var > uint_max) {
42025 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42026 : PyLong_Type.tp_name, uint_max, test_var);
42027 0 : return false;
42028 : }
42029 0 : r->in.level = test_var;
42030 : } else {
42031 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42032 : PyLong_Type.tp_name);
42033 0 : return false;
42034 : }
42035 : }
42036 0 : if (py_start_idx == NULL) {
42037 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.start_idx");
42038 0 : return false;
42039 : }
42040 : {
42041 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.start_idx));
42042 0 : if (PyLong_Check(py_start_idx)) {
42043 0 : unsigned long long test_var;
42044 0 : test_var = PyLong_AsUnsignedLongLong(py_start_idx);
42045 0 : if (PyErr_Occurred() != NULL) {
42046 0 : return false;
42047 : }
42048 0 : if (test_var > uint_max) {
42049 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42050 : PyLong_Type.tp_name, uint_max, test_var);
42051 0 : return false;
42052 : }
42053 0 : r->in.start_idx = test_var;
42054 : } else {
42055 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42056 : PyLong_Type.tp_name);
42057 0 : return false;
42058 : }
42059 : }
42060 0 : if (py_max_entries == NULL) {
42061 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.max_entries");
42062 0 : return false;
42063 : }
42064 : {
42065 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.max_entries));
42066 0 : if (PyLong_Check(py_max_entries)) {
42067 0 : unsigned long long test_var;
42068 0 : test_var = PyLong_AsUnsignedLongLong(py_max_entries);
42069 0 : if (PyErr_Occurred() != NULL) {
42070 0 : return false;
42071 : }
42072 0 : if (test_var > uint_max) {
42073 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42074 : PyLong_Type.tp_name, uint_max, test_var);
42075 0 : return false;
42076 : }
42077 0 : r->in.max_entries = test_var;
42078 : } else {
42079 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42080 : PyLong_Type.tp_name);
42081 0 : return false;
42082 : }
42083 : }
42084 0 : if (py_buf_size == NULL) {
42085 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.buf_size");
42086 0 : return false;
42087 : }
42088 : {
42089 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.buf_size));
42090 0 : if (PyLong_Check(py_buf_size)) {
42091 0 : unsigned long long test_var;
42092 0 : test_var = PyLong_AsUnsignedLongLong(py_buf_size);
42093 0 : if (PyErr_Occurred() != NULL) {
42094 0 : return false;
42095 : }
42096 0 : if (test_var > uint_max) {
42097 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
42098 : PyLong_Type.tp_name, uint_max, test_var);
42099 0 : return false;
42100 : }
42101 0 : r->in.buf_size = test_var;
42102 : } else {
42103 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
42104 : PyLong_Type.tp_name);
42105 0 : return false;
42106 : }
42107 : }
42108 0 : return true;
42109 : }
42110 :
42111 0 : static PyObject *unpack_py_samr_QueryDisplayInfo3_args_out(struct samr_QueryDisplayInfo3 *r)
42112 : {
42113 0 : PyObject *result;
42114 0 : PyObject *py_total_size;
42115 0 : PyObject *py_returned_size;
42116 0 : PyObject *py_info;
42117 0 : result = PyTuple_New(3);
42118 0 : py_total_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.total_size);
42119 0 : PyTuple_SetItem(result, 0, py_total_size);
42120 0 : py_returned_size = PyLong_FromUnsignedLongLong((uint32_t)*r->out.returned_size);
42121 0 : PyTuple_SetItem(result, 1, py_returned_size);
42122 0 : py_info = pyrpc_import_union(&samr_DispInfo_Type, r->out.info, r->in.level, r->out.info, "union samr_DispInfo");
42123 0 : if (py_info == NULL) {
42124 0 : return NULL;
42125 : }
42126 0 : PyTuple_SetItem(result, 2, py_info);
42127 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42128 0 : PyErr_SetNTSTATUS(r->out.result);
42129 0 : return NULL;
42130 : }
42131 :
42132 0 : return result;
42133 : }
42134 :
42135 :
42136 0 : static PyObject *py_samr_AddMultipleMembersToAlias_in_get_alias_handle(PyObject *obj, void *closure)
42137 : {
42138 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj);
42139 0 : PyObject *py_alias_handle;
42140 0 : if (object->in.alias_handle == NULL) {
42141 0 : Py_RETURN_NONE;
42142 : }
42143 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
42144 0 : return py_alias_handle;
42145 : }
42146 :
42147 0 : static int py_samr_AddMultipleMembersToAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
42148 : {
42149 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42150 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
42151 0 : if (value == NULL) {
42152 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
42153 0 : return -1;
42154 : }
42155 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
42156 0 : if (object->in.alias_handle == NULL) {
42157 0 : PyErr_NoMemory();
42158 0 : return -1;
42159 : }
42160 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42161 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42162 0 : PyErr_NoMemory();
42163 0 : return -1;
42164 : }
42165 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42166 0 : return 0;
42167 : }
42168 :
42169 0 : static PyObject *py_samr_AddMultipleMembersToAlias_in_get_sids(PyObject *obj, void *closure)
42170 : {
42171 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj);
42172 0 : PyObject *py_sids;
42173 0 : if (object->in.sids == NULL) {
42174 0 : Py_RETURN_NONE;
42175 : }
42176 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
42177 0 : return py_sids;
42178 : }
42179 :
42180 0 : static int py_samr_AddMultipleMembersToAlias_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
42181 : {
42182 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42183 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
42184 0 : if (value == NULL) {
42185 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
42186 0 : return -1;
42187 : }
42188 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
42189 0 : if (object->in.sids == NULL) {
42190 0 : PyErr_NoMemory();
42191 0 : return -1;
42192 : }
42193 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
42194 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42195 0 : PyErr_NoMemory();
42196 0 : return -1;
42197 : }
42198 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
42199 0 : return 0;
42200 : }
42201 :
42202 0 : static PyObject *py_samr_AddMultipleMembersToAlias_get_result(PyObject *obj, void *closure)
42203 : {
42204 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(obj);
42205 0 : PyObject *py_result;
42206 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42207 0 : return py_result;
42208 : }
42209 :
42210 0 : static int py_samr_AddMultipleMembersToAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
42211 : {
42212 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42213 0 : if (value == NULL) {
42214 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42215 0 : return -1;
42216 : }
42217 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42218 0 : return 0;
42219 : }
42220 :
42221 : static PyGetSetDef py_samr_AddMultipleMembersToAlias_getsetters[] = {
42222 : {
42223 : .name = discard_const_p(char, "in_alias_handle"),
42224 : .get = py_samr_AddMultipleMembersToAlias_in_get_alias_handle,
42225 : .set = py_samr_AddMultipleMembersToAlias_in_set_alias_handle,
42226 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42227 : },
42228 : {
42229 : .name = discard_const_p(char, "in_sids"),
42230 : .get = py_samr_AddMultipleMembersToAlias_in_get_sids,
42231 : .set = py_samr_AddMultipleMembersToAlias_in_set_sids,
42232 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
42233 : },
42234 : {
42235 : .name = discard_const_p(char, "result"),
42236 : .get = py_samr_AddMultipleMembersToAlias_get_result,
42237 : .set = py_samr_AddMultipleMembersToAlias_set_result,
42238 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42239 : },
42240 : { .name = NULL }
42241 : };
42242 :
42243 0 : static PyObject *py_samr_AddMultipleMembersToAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42244 : {
42245 0 : PyObject *self = pytalloc_new(struct samr_AddMultipleMembersToAlias, type);
42246 0 : struct samr_AddMultipleMembersToAlias *_self = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(self);
42247 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42248 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
42249 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
42250 0 : return self;
42251 : }
42252 :
42253 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42254 : {
42255 :
42256 :
42257 0 : return PyLong_FromLong(52);
42258 : }
42259 :
42260 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42261 : {
42262 0 : const struct ndr_interface_call *call = NULL;
42263 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42264 0 : PyObject *ret = NULL;
42265 0 : struct ndr_push *push = NULL;
42266 0 : DATA_BLOB blob;
42267 0 : enum ndr_err_code err;
42268 :
42269 0 : if (ndr_table_samr.num_calls < 53) {
42270 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_pack");
42271 0 : return NULL;
42272 : }
42273 0 : call = &ndr_table_samr.calls[52];
42274 :
42275 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42276 0 : if (push == NULL) {
42277 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42278 0 : return NULL;
42279 : }
42280 :
42281 0 : push->flags |= ndr_push_flags;
42282 :
42283 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42284 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42285 0 : TALLOC_FREE(push);
42286 0 : PyErr_SetNdrError(err);
42287 0 : return NULL;
42288 : }
42289 0 : blob = ndr_push_blob(push);
42290 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42291 0 : TALLOC_FREE(push);
42292 0 : return ret;
42293 : }
42294 :
42295 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42296 : {
42297 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42298 0 : PyObject *bigendian_obj = NULL;
42299 0 : PyObject *ndr64_obj = NULL;
42300 0 : libndr_flags ndr_push_flags = 0;
42301 :
42302 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42303 : discard_const_p(char *, kwnames),
42304 : &bigendian_obj,
42305 : &ndr64_obj)) {
42306 0 : return NULL;
42307 : }
42308 :
42309 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42310 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42311 : }
42312 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42313 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42314 : }
42315 :
42316 0 : return py_samr_AddMultipleMembersToAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42317 : }
42318 :
42319 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42320 : {
42321 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42322 0 : PyObject *bigendian_obj = NULL;
42323 0 : PyObject *ndr64_obj = NULL;
42324 0 : libndr_flags ndr_push_flags = 0;
42325 :
42326 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42327 : discard_const_p(char *, kwnames),
42328 : &bigendian_obj,
42329 : &ndr64_obj)) {
42330 0 : return NULL;
42331 : }
42332 :
42333 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42334 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42335 : }
42336 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42337 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42338 : }
42339 :
42340 0 : return py_samr_AddMultipleMembersToAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42341 : }
42342 :
42343 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42344 : {
42345 0 : const struct ndr_interface_call *call = NULL;
42346 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42347 0 : struct ndr_pull *pull = NULL;
42348 0 : enum ndr_err_code err;
42349 :
42350 0 : if (ndr_table_samr.num_calls < 53) {
42351 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_unpack");
42352 0 : return NULL;
42353 : }
42354 0 : call = &ndr_table_samr.calls[52];
42355 :
42356 0 : pull = ndr_pull_init_blob(blob, object);
42357 0 : if (pull == NULL) {
42358 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42359 0 : return NULL;
42360 : }
42361 :
42362 0 : pull->flags |= ndr_pull_flags;
42363 :
42364 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42365 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42366 0 : TALLOC_FREE(pull);
42367 0 : PyErr_SetNdrError(err);
42368 0 : return NULL;
42369 : }
42370 0 : if (!allow_remaining) {
42371 0 : uint32_t highest_ofs;
42372 :
42373 0 : if (pull->offset > pull->relative_highest_offset) {
42374 0 : highest_ofs = pull->offset;
42375 : } else {
42376 0 : highest_ofs = pull->relative_highest_offset;
42377 : }
42378 0 : if (highest_ofs < pull->data_size) {
42379 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42380 : "not all bytes consumed ofs[%u] size[%u]",
42381 : highest_ofs, pull->data_size);
42382 0 : TALLOC_FREE(pull);
42383 0 : PyErr_SetNdrError(err);
42384 0 : return NULL;
42385 : }
42386 : }
42387 :
42388 0 : TALLOC_FREE(pull);
42389 0 : Py_RETURN_NONE;
42390 : }
42391 :
42392 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42393 : {
42394 0 : DATA_BLOB blob;
42395 0 : Py_ssize_t blob_length = 0;
42396 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42397 0 : PyObject *bigendian_obj = NULL;
42398 0 : PyObject *ndr64_obj = NULL;
42399 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42400 0 : PyObject *allow_remaining_obj = NULL;
42401 0 : bool allow_remaining = false;
42402 :
42403 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42404 : discard_const_p(char *, kwnames),
42405 : &blob.data, &blob_length,
42406 : &bigendian_obj,
42407 : &ndr64_obj,
42408 : &allow_remaining_obj)) {
42409 0 : return NULL;
42410 : }
42411 0 : blob.length = blob_length;
42412 :
42413 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42414 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42415 : }
42416 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42417 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42418 : }
42419 :
42420 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42421 0 : allow_remaining = true;
42422 : }
42423 :
42424 0 : return py_samr_AddMultipleMembersToAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42425 : }
42426 :
42427 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42428 : {
42429 0 : DATA_BLOB blob;
42430 0 : Py_ssize_t blob_length = 0;
42431 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42432 0 : PyObject *bigendian_obj = NULL;
42433 0 : PyObject *ndr64_obj = NULL;
42434 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42435 0 : PyObject *allow_remaining_obj = NULL;
42436 0 : bool allow_remaining = false;
42437 :
42438 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42439 : discard_const_p(char *, kwnames),
42440 : &blob.data, &blob_length,
42441 : &bigendian_obj,
42442 : &ndr64_obj,
42443 : &allow_remaining_obj)) {
42444 0 : return NULL;
42445 : }
42446 0 : blob.length = blob_length;
42447 :
42448 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42449 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42450 : }
42451 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42452 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42453 : }
42454 :
42455 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42456 0 : allow_remaining = true;
42457 : }
42458 :
42459 0 : return py_samr_AddMultipleMembersToAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42460 : }
42461 :
42462 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42463 : {
42464 0 : const struct ndr_interface_call *call = NULL;
42465 0 : struct samr_AddMultipleMembersToAlias *object = (struct samr_AddMultipleMembersToAlias *)pytalloc_get_ptr(py_obj);
42466 0 : PyObject *ret;
42467 0 : char *retstr;
42468 :
42469 0 : if (ndr_table_samr.num_calls < 53) {
42470 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_AddMultipleMembersToAlias_ndr_print");
42471 0 : return NULL;
42472 : }
42473 0 : call = &ndr_table_samr.calls[52];
42474 :
42475 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42476 0 : ret = PyUnicode_FromString(retstr);
42477 0 : TALLOC_FREE(retstr);
42478 :
42479 0 : return ret;
42480 : }
42481 :
42482 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42483 : {
42484 0 : return py_samr_AddMultipleMembersToAlias_ndr_print(py_obj, "samr_AddMultipleMembersToAlias_in", NDR_IN);
42485 : }
42486 :
42487 0 : static PyObject *py_samr_AddMultipleMembersToAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42488 : {
42489 0 : return py_samr_AddMultipleMembersToAlias_ndr_print(py_obj, "samr_AddMultipleMembersToAlias_out", NDR_OUT);
42490 : }
42491 :
42492 : static PyMethodDef py_samr_AddMultipleMembersToAlias_methods[] = {
42493 : { "opnum", (PyCFunction)py_samr_AddMultipleMembersToAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
42494 : "samr.AddMultipleMembersToAlias.opnum() -> 52 (0x34) " },
42495 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddMultipleMembersToAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42496 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42497 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddMultipleMembersToAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42498 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42499 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddMultipleMembersToAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42500 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42501 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_AddMultipleMembersToAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42502 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42503 : { "__ndr_print_in__", (PyCFunction)py_samr_AddMultipleMembersToAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42504 : { "__ndr_print_out__", (PyCFunction)py_samr_AddMultipleMembersToAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42505 : { NULL, NULL, 0, NULL }
42506 : };
42507 :
42508 :
42509 : static PyTypeObject samr_AddMultipleMembersToAlias_Type = {
42510 : PyVarObject_HEAD_INIT(NULL, 0)
42511 : .tp_name = "samr.AddMultipleMembersToAlias",
42512 : .tp_getset = py_samr_AddMultipleMembersToAlias_getsetters,
42513 : .tp_methods = py_samr_AddMultipleMembersToAlias_methods,
42514 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42515 : .tp_new = py_samr_AddMultipleMembersToAlias_new,
42516 : };
42517 :
42518 0 : static bool pack_py_samr_AddMultipleMembersToAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_AddMultipleMembersToAlias *r)
42519 : {
42520 0 : PyObject *py_alias_handle;
42521 0 : PyObject *py_sids;
42522 0 : const char *kwnames[] = {
42523 : "alias_handle", "sids", NULL
42524 : };
42525 :
42526 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddMultipleMembersToAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
42527 0 : return false;
42528 : }
42529 :
42530 0 : if (py_alias_handle == NULL) {
42531 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
42532 0 : return false;
42533 : }
42534 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
42535 0 : if (r->in.alias_handle == NULL) {
42536 0 : PyErr_NoMemory();
42537 0 : return false;
42538 : }
42539 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
42540 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
42541 0 : PyErr_NoMemory();
42542 0 : return false;
42543 : }
42544 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
42545 0 : if (py_sids == NULL) {
42546 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
42547 0 : return false;
42548 : }
42549 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
42550 0 : if (r->in.sids == NULL) {
42551 0 : PyErr_NoMemory();
42552 0 : return false;
42553 : }
42554 0 : PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
42555 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
42556 0 : PyErr_NoMemory();
42557 0 : return false;
42558 : }
42559 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
42560 0 : return true;
42561 : }
42562 :
42563 0 : static PyObject *unpack_py_samr_AddMultipleMembersToAlias_args_out(struct samr_AddMultipleMembersToAlias *r)
42564 : {
42565 0 : PyObject *result;
42566 0 : result = Py_None;
42567 0 : Py_INCREF(result);
42568 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
42569 0 : PyErr_SetNTSTATUS(r->out.result);
42570 0 : return NULL;
42571 : }
42572 :
42573 0 : return result;
42574 : }
42575 :
42576 :
42577 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_in_get_alias_handle(PyObject *obj, void *closure)
42578 : {
42579 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj);
42580 0 : PyObject *py_alias_handle;
42581 0 : if (object->in.alias_handle == NULL) {
42582 0 : Py_RETURN_NONE;
42583 : }
42584 0 : py_alias_handle = pytalloc_reference_ex(policy_handle_Type, object->in.alias_handle, object->in.alias_handle);
42585 0 : return py_alias_handle;
42586 : }
42587 :
42588 0 : static int py_samr_RemoveMultipleMembersFromAlias_in_set_alias_handle(PyObject *py_obj, PyObject *value, void *closure)
42589 : {
42590 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42591 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.alias_handle));
42592 0 : if (value == NULL) {
42593 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.alias_handle");
42594 0 : return -1;
42595 : }
42596 0 : object->in.alias_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.alias_handle);
42597 0 : if (object->in.alias_handle == NULL) {
42598 0 : PyErr_NoMemory();
42599 0 : return -1;
42600 : }
42601 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
42602 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42603 0 : PyErr_NoMemory();
42604 0 : return -1;
42605 : }
42606 0 : object->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(value);
42607 0 : return 0;
42608 : }
42609 :
42610 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_in_get_sids(PyObject *obj, void *closure)
42611 : {
42612 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj);
42613 0 : PyObject *py_sids;
42614 0 : if (object->in.sids == NULL) {
42615 0 : Py_RETURN_NONE;
42616 : }
42617 0 : py_sids = pytalloc_reference_ex(lsa_SidArray_Type, object->in.sids, object->in.sids);
42618 0 : return py_sids;
42619 : }
42620 :
42621 0 : static int py_samr_RemoveMultipleMembersFromAlias_in_set_sids(PyObject *py_obj, PyObject *value, void *closure)
42622 : {
42623 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42624 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.sids));
42625 0 : if (value == NULL) {
42626 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.sids");
42627 0 : return -1;
42628 : }
42629 0 : object->in.sids = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.sids);
42630 0 : if (object->in.sids == NULL) {
42631 0 : PyErr_NoMemory();
42632 0 : return -1;
42633 : }
42634 0 : PY_CHECK_TYPE(lsa_SidArray_Type, value, return -1;);
42635 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
42636 0 : PyErr_NoMemory();
42637 0 : return -1;
42638 : }
42639 0 : object->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(value);
42640 0 : return 0;
42641 : }
42642 :
42643 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_get_result(PyObject *obj, void *closure)
42644 : {
42645 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(obj);
42646 0 : PyObject *py_result;
42647 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
42648 0 : return py_result;
42649 : }
42650 :
42651 0 : static int py_samr_RemoveMultipleMembersFromAlias_set_result(PyObject *py_obj, PyObject *value, void *closure)
42652 : {
42653 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42654 0 : if (value == NULL) {
42655 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
42656 0 : return -1;
42657 : }
42658 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
42659 0 : return 0;
42660 : }
42661 :
42662 : static PyGetSetDef py_samr_RemoveMultipleMembersFromAlias_getsetters[] = {
42663 : {
42664 : .name = discard_const_p(char, "in_alias_handle"),
42665 : .get = py_samr_RemoveMultipleMembersFromAlias_in_get_alias_handle,
42666 : .set = py_samr_RemoveMultipleMembersFromAlias_in_set_alias_handle,
42667 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
42668 : },
42669 : {
42670 : .name = discard_const_p(char, "in_sids"),
42671 : .get = py_samr_RemoveMultipleMembersFromAlias_in_get_sids,
42672 : .set = py_samr_RemoveMultipleMembersFromAlias_in_set_sids,
42673 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_SidArray")
42674 : },
42675 : {
42676 : .name = discard_const_p(char, "result"),
42677 : .get = py_samr_RemoveMultipleMembersFromAlias_get_result,
42678 : .set = py_samr_RemoveMultipleMembersFromAlias_set_result,
42679 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
42680 : },
42681 : { .name = NULL }
42682 : };
42683 :
42684 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
42685 : {
42686 0 : PyObject *self = pytalloc_new(struct samr_RemoveMultipleMembersFromAlias, type);
42687 0 : struct samr_RemoveMultipleMembersFromAlias *_self = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(self);
42688 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
42689 0 : _self->in.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
42690 0 : _self->in.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
42691 0 : return self;
42692 : }
42693 :
42694 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
42695 : {
42696 :
42697 :
42698 0 : return PyLong_FromLong(53);
42699 : }
42700 :
42701 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
42702 : {
42703 0 : const struct ndr_interface_call *call = NULL;
42704 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42705 0 : PyObject *ret = NULL;
42706 0 : struct ndr_push *push = NULL;
42707 0 : DATA_BLOB blob;
42708 0 : enum ndr_err_code err;
42709 :
42710 0 : if (ndr_table_samr.num_calls < 54) {
42711 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_pack");
42712 0 : return NULL;
42713 : }
42714 0 : call = &ndr_table_samr.calls[53];
42715 :
42716 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
42717 0 : if (push == NULL) {
42718 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42719 0 : return NULL;
42720 : }
42721 :
42722 0 : push->flags |= ndr_push_flags;
42723 :
42724 0 : err = call->ndr_push(push, ndr_inout_flags, object);
42725 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42726 0 : TALLOC_FREE(push);
42727 0 : PyErr_SetNdrError(err);
42728 0 : return NULL;
42729 : }
42730 0 : blob = ndr_push_blob(push);
42731 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
42732 0 : TALLOC_FREE(push);
42733 0 : return ret;
42734 : }
42735 :
42736 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42737 : {
42738 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42739 0 : PyObject *bigendian_obj = NULL;
42740 0 : PyObject *ndr64_obj = NULL;
42741 0 : libndr_flags ndr_push_flags = 0;
42742 :
42743 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
42744 : discard_const_p(char *, kwnames),
42745 : &bigendian_obj,
42746 : &ndr64_obj)) {
42747 0 : return NULL;
42748 : }
42749 :
42750 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42751 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42752 : }
42753 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42754 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42755 : }
42756 :
42757 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
42758 : }
42759 :
42760 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42761 : {
42762 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
42763 0 : PyObject *bigendian_obj = NULL;
42764 0 : PyObject *ndr64_obj = NULL;
42765 0 : libndr_flags ndr_push_flags = 0;
42766 :
42767 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
42768 : discard_const_p(char *, kwnames),
42769 : &bigendian_obj,
42770 : &ndr64_obj)) {
42771 0 : return NULL;
42772 : }
42773 :
42774 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42775 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
42776 : }
42777 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42778 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
42779 : }
42780 :
42781 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
42782 : }
42783 :
42784 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
42785 : {
42786 0 : const struct ndr_interface_call *call = NULL;
42787 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42788 0 : struct ndr_pull *pull = NULL;
42789 0 : enum ndr_err_code err;
42790 :
42791 0 : if (ndr_table_samr.num_calls < 54) {
42792 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_unpack");
42793 0 : return NULL;
42794 : }
42795 0 : call = &ndr_table_samr.calls[53];
42796 :
42797 0 : pull = ndr_pull_init_blob(blob, object);
42798 0 : if (pull == NULL) {
42799 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
42800 0 : return NULL;
42801 : }
42802 :
42803 0 : pull->flags |= ndr_pull_flags;
42804 :
42805 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
42806 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
42807 0 : TALLOC_FREE(pull);
42808 0 : PyErr_SetNdrError(err);
42809 0 : return NULL;
42810 : }
42811 0 : if (!allow_remaining) {
42812 0 : uint32_t highest_ofs;
42813 :
42814 0 : if (pull->offset > pull->relative_highest_offset) {
42815 0 : highest_ofs = pull->offset;
42816 : } else {
42817 0 : highest_ofs = pull->relative_highest_offset;
42818 : }
42819 0 : if (highest_ofs < pull->data_size) {
42820 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
42821 : "not all bytes consumed ofs[%u] size[%u]",
42822 : highest_ofs, pull->data_size);
42823 0 : TALLOC_FREE(pull);
42824 0 : PyErr_SetNdrError(err);
42825 0 : return NULL;
42826 : }
42827 : }
42828 :
42829 0 : TALLOC_FREE(pull);
42830 0 : Py_RETURN_NONE;
42831 : }
42832 :
42833 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42834 : {
42835 0 : DATA_BLOB blob;
42836 0 : Py_ssize_t blob_length = 0;
42837 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42838 0 : PyObject *bigendian_obj = NULL;
42839 0 : PyObject *ndr64_obj = NULL;
42840 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42841 0 : PyObject *allow_remaining_obj = NULL;
42842 0 : bool allow_remaining = false;
42843 :
42844 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
42845 : discard_const_p(char *, kwnames),
42846 : &blob.data, &blob_length,
42847 : &bigendian_obj,
42848 : &ndr64_obj,
42849 : &allow_remaining_obj)) {
42850 0 : return NULL;
42851 : }
42852 0 : blob.length = blob_length;
42853 :
42854 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42855 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42856 : }
42857 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42858 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42859 : }
42860 :
42861 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42862 0 : allow_remaining = true;
42863 : }
42864 :
42865 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
42866 : }
42867 :
42868 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
42869 : {
42870 0 : DATA_BLOB blob;
42871 0 : Py_ssize_t blob_length = 0;
42872 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
42873 0 : PyObject *bigendian_obj = NULL;
42874 0 : PyObject *ndr64_obj = NULL;
42875 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
42876 0 : PyObject *allow_remaining_obj = NULL;
42877 0 : bool allow_remaining = false;
42878 :
42879 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
42880 : discard_const_p(char *, kwnames),
42881 : &blob.data, &blob_length,
42882 : &bigendian_obj,
42883 : &ndr64_obj,
42884 : &allow_remaining_obj)) {
42885 0 : return NULL;
42886 : }
42887 0 : blob.length = blob_length;
42888 :
42889 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
42890 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
42891 : }
42892 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
42893 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
42894 : }
42895 :
42896 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
42897 0 : allow_remaining = true;
42898 : }
42899 :
42900 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
42901 : }
42902 :
42903 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
42904 : {
42905 0 : const struct ndr_interface_call *call = NULL;
42906 0 : struct samr_RemoveMultipleMembersFromAlias *object = (struct samr_RemoveMultipleMembersFromAlias *)pytalloc_get_ptr(py_obj);
42907 0 : PyObject *ret;
42908 0 : char *retstr;
42909 :
42910 0 : if (ndr_table_samr.num_calls < 54) {
42911 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RemoveMultipleMembersFromAlias_ndr_print");
42912 0 : return NULL;
42913 : }
42914 0 : call = &ndr_table_samr.calls[53];
42915 :
42916 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
42917 0 : ret = PyUnicode_FromString(retstr);
42918 0 : TALLOC_FREE(retstr);
42919 :
42920 0 : return ret;
42921 : }
42922 :
42923 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42924 : {
42925 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_print(py_obj, "samr_RemoveMultipleMembersFromAlias_in", NDR_IN);
42926 : }
42927 :
42928 0 : static PyObject *py_samr_RemoveMultipleMembersFromAlias_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
42929 : {
42930 0 : return py_samr_RemoveMultipleMembersFromAlias_ndr_print(py_obj, "samr_RemoveMultipleMembersFromAlias_out", NDR_OUT);
42931 : }
42932 :
42933 : static PyMethodDef py_samr_RemoveMultipleMembersFromAlias_methods[] = {
42934 : { "opnum", (PyCFunction)py_samr_RemoveMultipleMembersFromAlias_ndr_opnum, METH_NOARGS|METH_CLASS,
42935 : "samr.RemoveMultipleMembersFromAlias.opnum() -> 53 (0x35) " },
42936 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMultipleMembersFromAlias_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
42937 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
42938 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMultipleMembersFromAlias_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
42939 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
42940 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMultipleMembersFromAlias_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
42941 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
42942 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RemoveMultipleMembersFromAlias_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
42943 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
42944 : { "__ndr_print_in__", (PyCFunction)py_samr_RemoveMultipleMembersFromAlias_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
42945 : { "__ndr_print_out__", (PyCFunction)py_samr_RemoveMultipleMembersFromAlias_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
42946 : { NULL, NULL, 0, NULL }
42947 : };
42948 :
42949 :
42950 : static PyTypeObject samr_RemoveMultipleMembersFromAlias_Type = {
42951 : PyVarObject_HEAD_INIT(NULL, 0)
42952 : .tp_name = "samr.RemoveMultipleMembersFromAlias",
42953 : .tp_getset = py_samr_RemoveMultipleMembersFromAlias_getsetters,
42954 : .tp_methods = py_samr_RemoveMultipleMembersFromAlias_methods,
42955 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
42956 : .tp_new = py_samr_RemoveMultipleMembersFromAlias_new,
42957 : };
42958 :
42959 0 : static bool pack_py_samr_RemoveMultipleMembersFromAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMultipleMembersFromAlias *r)
42960 : {
42961 0 : PyObject *py_alias_handle;
42962 0 : PyObject *py_sids;
42963 0 : const char *kwnames[] = {
42964 : "alias_handle", "sids", NULL
42965 : };
42966 :
42967 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMultipleMembersFromAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
42968 0 : return false;
42969 : }
42970 :
42971 0 : if (py_alias_handle == NULL) {
42972 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.alias_handle");
42973 0 : return false;
42974 : }
42975 0 : r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
42976 0 : if (r->in.alias_handle == NULL) {
42977 0 : PyErr_NoMemory();
42978 0 : return false;
42979 : }
42980 0 : PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
42981 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
42982 0 : PyErr_NoMemory();
42983 0 : return false;
42984 : }
42985 0 : r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
42986 0 : if (py_sids == NULL) {
42987 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.sids");
42988 0 : return false;
42989 : }
42990 0 : r->in.sids = talloc_ptrtype(r, r->in.sids);
42991 0 : if (r->in.sids == NULL) {
42992 0 : PyErr_NoMemory();
42993 0 : return false;
42994 : }
42995 0 : PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
42996 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
42997 0 : PyErr_NoMemory();
42998 0 : return false;
42999 : }
43000 0 : r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
43001 0 : return true;
43002 : }
43003 :
43004 0 : static PyObject *unpack_py_samr_RemoveMultipleMembersFromAlias_args_out(struct samr_RemoveMultipleMembersFromAlias *r)
43005 : {
43006 0 : PyObject *result;
43007 0 : result = Py_None;
43008 0 : Py_INCREF(result);
43009 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
43010 0 : PyErr_SetNTSTATUS(r->out.result);
43011 0 : return NULL;
43012 : }
43013 :
43014 0 : return result;
43015 : }
43016 :
43017 :
43018 0 : static PyObject *py_samr_OemChangePasswordUser2_in_get_server(PyObject *obj, void *closure)
43019 : {
43020 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj);
43021 0 : PyObject *py_server;
43022 0 : if (object->in.server == NULL) {
43023 0 : Py_RETURN_NONE;
43024 : }
43025 0 : if (object->in.server == NULL) {
43026 0 : py_server = Py_None;
43027 0 : Py_INCREF(py_server);
43028 : } else {
43029 0 : py_server = pytalloc_reference_ex(lsa_AsciiString_Type, object->in.server, object->in.server);
43030 : }
43031 0 : return py_server;
43032 : }
43033 :
43034 0 : static int py_samr_OemChangePasswordUser2_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
43035 : {
43036 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43037 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server));
43038 0 : if (value == NULL) {
43039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server");
43040 0 : return -1;
43041 : }
43042 0 : if (value == Py_None) {
43043 0 : object->in.server = NULL;
43044 : } else {
43045 0 : object->in.server = NULL;
43046 0 : PY_CHECK_TYPE(lsa_AsciiString_Type, value, return -1;);
43047 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43048 0 : PyErr_NoMemory();
43049 0 : return -1;
43050 : }
43051 0 : object->in.server = (struct lsa_AsciiString *)pytalloc_get_ptr(value);
43052 : }
43053 0 : return 0;
43054 : }
43055 :
43056 0 : static PyObject *py_samr_OemChangePasswordUser2_in_get_account(PyObject *obj, void *closure)
43057 : {
43058 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj);
43059 0 : PyObject *py_account;
43060 0 : if (object->in.account == NULL) {
43061 0 : Py_RETURN_NONE;
43062 : }
43063 0 : py_account = pytalloc_reference_ex(lsa_AsciiString_Type, object->in.account, object->in.account);
43064 0 : return py_account;
43065 : }
43066 :
43067 0 : static int py_samr_OemChangePasswordUser2_in_set_account(PyObject *py_obj, PyObject *value, void *closure)
43068 : {
43069 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43070 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account));
43071 0 : if (value == NULL) {
43072 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account");
43073 0 : return -1;
43074 : }
43075 0 : object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account);
43076 0 : if (object->in.account == NULL) {
43077 0 : PyErr_NoMemory();
43078 0 : return -1;
43079 : }
43080 0 : PY_CHECK_TYPE(lsa_AsciiString_Type, value, return -1;);
43081 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43082 0 : PyErr_NoMemory();
43083 0 : return -1;
43084 : }
43085 0 : object->in.account = (struct lsa_AsciiString *)pytalloc_get_ptr(value);
43086 0 : return 0;
43087 : }
43088 :
43089 0 : static PyObject *py_samr_OemChangePasswordUser2_in_get_password(PyObject *obj, void *closure)
43090 : {
43091 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj);
43092 0 : PyObject *py_password;
43093 0 : if (object->in.password == NULL) {
43094 0 : Py_RETURN_NONE;
43095 : }
43096 0 : if (object->in.password == NULL) {
43097 0 : py_password = Py_None;
43098 0 : Py_INCREF(py_password);
43099 : } else {
43100 0 : py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.password, object->in.password);
43101 : }
43102 0 : return py_password;
43103 : }
43104 :
43105 0 : static int py_samr_OemChangePasswordUser2_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
43106 : {
43107 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43108 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password));
43109 0 : if (value == NULL) {
43110 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
43111 0 : return -1;
43112 : }
43113 0 : if (value == Py_None) {
43114 0 : object->in.password = NULL;
43115 : } else {
43116 0 : object->in.password = NULL;
43117 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
43118 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43119 0 : PyErr_NoMemory();
43120 0 : return -1;
43121 : }
43122 0 : object->in.password = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
43123 : }
43124 0 : return 0;
43125 : }
43126 :
43127 0 : static PyObject *py_samr_OemChangePasswordUser2_in_get_hash(PyObject *obj, void *closure)
43128 : {
43129 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj);
43130 0 : PyObject *py_hash;
43131 0 : if (object->in.hash == NULL) {
43132 0 : Py_RETURN_NONE;
43133 : }
43134 0 : if (object->in.hash == NULL) {
43135 0 : py_hash = Py_None;
43136 0 : Py_INCREF(py_hash);
43137 : } else {
43138 0 : py_hash = pytalloc_reference_ex(&samr_Password_Type, object->in.hash, object->in.hash);
43139 : }
43140 0 : return py_hash;
43141 : }
43142 :
43143 0 : static int py_samr_OemChangePasswordUser2_in_set_hash(PyObject *py_obj, PyObject *value, void *closure)
43144 : {
43145 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43146 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hash));
43147 0 : if (value == NULL) {
43148 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hash");
43149 0 : return -1;
43150 : }
43151 0 : if (value == Py_None) {
43152 0 : object->in.hash = NULL;
43153 : } else {
43154 0 : object->in.hash = NULL;
43155 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
43156 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43157 0 : PyErr_NoMemory();
43158 0 : return -1;
43159 : }
43160 0 : object->in.hash = (struct samr_Password *)pytalloc_get_ptr(value);
43161 : }
43162 0 : return 0;
43163 : }
43164 :
43165 0 : static PyObject *py_samr_OemChangePasswordUser2_get_result(PyObject *obj, void *closure)
43166 : {
43167 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(obj);
43168 0 : PyObject *py_result;
43169 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43170 0 : return py_result;
43171 : }
43172 :
43173 0 : static int py_samr_OemChangePasswordUser2_set_result(PyObject *py_obj, PyObject *value, void *closure)
43174 : {
43175 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43176 0 : if (value == NULL) {
43177 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43178 0 : return -1;
43179 : }
43180 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43181 0 : return 0;
43182 : }
43183 :
43184 : static PyGetSetDef py_samr_OemChangePasswordUser2_getsetters[] = {
43185 : {
43186 : .name = discard_const_p(char, "in_server"),
43187 : .get = py_samr_OemChangePasswordUser2_in_get_server,
43188 : .set = py_samr_OemChangePasswordUser2_in_set_server,
43189 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiString")
43190 : },
43191 : {
43192 : .name = discard_const_p(char, "in_account"),
43193 : .get = py_samr_OemChangePasswordUser2_in_get_account,
43194 : .set = py_samr_OemChangePasswordUser2_in_set_account,
43195 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_AsciiString")
43196 : },
43197 : {
43198 : .name = discard_const_p(char, "in_password"),
43199 : .get = py_samr_OemChangePasswordUser2_in_get_password,
43200 : .set = py_samr_OemChangePasswordUser2_in_set_password,
43201 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
43202 : },
43203 : {
43204 : .name = discard_const_p(char, "in_hash"),
43205 : .get = py_samr_OemChangePasswordUser2_in_get_hash,
43206 : .set = py_samr_OemChangePasswordUser2_in_set_hash,
43207 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
43208 : },
43209 : {
43210 : .name = discard_const_p(char, "result"),
43211 : .get = py_samr_OemChangePasswordUser2_get_result,
43212 : .set = py_samr_OemChangePasswordUser2_set_result,
43213 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43214 : },
43215 : { .name = NULL }
43216 : };
43217 :
43218 0 : static PyObject *py_samr_OemChangePasswordUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43219 : {
43220 0 : PyObject *self = pytalloc_new(struct samr_OemChangePasswordUser2, type);
43221 0 : struct samr_OemChangePasswordUser2 *_self = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(self);
43222 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43223 0 : _self->in.account = talloc_zero(mem_ctx, struct lsa_AsciiString);
43224 0 : return self;
43225 : }
43226 :
43227 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43228 : {
43229 :
43230 :
43231 0 : return PyLong_FromLong(54);
43232 : }
43233 :
43234 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43235 : {
43236 0 : const struct ndr_interface_call *call = NULL;
43237 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43238 0 : PyObject *ret = NULL;
43239 0 : struct ndr_push *push = NULL;
43240 0 : DATA_BLOB blob;
43241 0 : enum ndr_err_code err;
43242 :
43243 0 : if (ndr_table_samr.num_calls < 55) {
43244 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_pack");
43245 0 : return NULL;
43246 : }
43247 0 : call = &ndr_table_samr.calls[54];
43248 :
43249 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43250 0 : if (push == NULL) {
43251 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43252 0 : return NULL;
43253 : }
43254 :
43255 0 : push->flags |= ndr_push_flags;
43256 :
43257 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43258 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43259 0 : TALLOC_FREE(push);
43260 0 : PyErr_SetNdrError(err);
43261 0 : return NULL;
43262 : }
43263 0 : blob = ndr_push_blob(push);
43264 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43265 0 : TALLOC_FREE(push);
43266 0 : return ret;
43267 : }
43268 :
43269 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43270 : {
43271 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43272 0 : PyObject *bigendian_obj = NULL;
43273 0 : PyObject *ndr64_obj = NULL;
43274 0 : libndr_flags ndr_push_flags = 0;
43275 :
43276 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43277 : discard_const_p(char *, kwnames),
43278 : &bigendian_obj,
43279 : &ndr64_obj)) {
43280 0 : return NULL;
43281 : }
43282 :
43283 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43284 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43285 : }
43286 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43287 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43288 : }
43289 :
43290 0 : return py_samr_OemChangePasswordUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43291 : }
43292 :
43293 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43294 : {
43295 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43296 0 : PyObject *bigendian_obj = NULL;
43297 0 : PyObject *ndr64_obj = NULL;
43298 0 : libndr_flags ndr_push_flags = 0;
43299 :
43300 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43301 : discard_const_p(char *, kwnames),
43302 : &bigendian_obj,
43303 : &ndr64_obj)) {
43304 0 : return NULL;
43305 : }
43306 :
43307 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43308 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43309 : }
43310 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43311 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43312 : }
43313 :
43314 0 : return py_samr_OemChangePasswordUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
43315 : }
43316 :
43317 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
43318 : {
43319 0 : const struct ndr_interface_call *call = NULL;
43320 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43321 0 : struct ndr_pull *pull = NULL;
43322 0 : enum ndr_err_code err;
43323 :
43324 0 : if (ndr_table_samr.num_calls < 55) {
43325 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_unpack");
43326 0 : return NULL;
43327 : }
43328 0 : call = &ndr_table_samr.calls[54];
43329 :
43330 0 : pull = ndr_pull_init_blob(blob, object);
43331 0 : if (pull == NULL) {
43332 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43333 0 : return NULL;
43334 : }
43335 :
43336 0 : pull->flags |= ndr_pull_flags;
43337 :
43338 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
43339 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43340 0 : TALLOC_FREE(pull);
43341 0 : PyErr_SetNdrError(err);
43342 0 : return NULL;
43343 : }
43344 0 : if (!allow_remaining) {
43345 0 : uint32_t highest_ofs;
43346 :
43347 0 : if (pull->offset > pull->relative_highest_offset) {
43348 0 : highest_ofs = pull->offset;
43349 : } else {
43350 0 : highest_ofs = pull->relative_highest_offset;
43351 : }
43352 0 : if (highest_ofs < pull->data_size) {
43353 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
43354 : "not all bytes consumed ofs[%u] size[%u]",
43355 : highest_ofs, pull->data_size);
43356 0 : TALLOC_FREE(pull);
43357 0 : PyErr_SetNdrError(err);
43358 0 : return NULL;
43359 : }
43360 : }
43361 :
43362 0 : TALLOC_FREE(pull);
43363 0 : Py_RETURN_NONE;
43364 : }
43365 :
43366 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43367 : {
43368 0 : DATA_BLOB blob;
43369 0 : Py_ssize_t blob_length = 0;
43370 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43371 0 : PyObject *bigendian_obj = NULL;
43372 0 : PyObject *ndr64_obj = NULL;
43373 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43374 0 : PyObject *allow_remaining_obj = NULL;
43375 0 : bool allow_remaining = false;
43376 :
43377 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
43378 : discard_const_p(char *, kwnames),
43379 : &blob.data, &blob_length,
43380 : &bigendian_obj,
43381 : &ndr64_obj,
43382 : &allow_remaining_obj)) {
43383 0 : return NULL;
43384 : }
43385 0 : blob.length = blob_length;
43386 :
43387 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43388 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43389 : }
43390 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43391 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43392 : }
43393 :
43394 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43395 0 : allow_remaining = true;
43396 : }
43397 :
43398 0 : return py_samr_OemChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
43399 : }
43400 :
43401 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43402 : {
43403 0 : DATA_BLOB blob;
43404 0 : Py_ssize_t blob_length = 0;
43405 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
43406 0 : PyObject *bigendian_obj = NULL;
43407 0 : PyObject *ndr64_obj = NULL;
43408 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
43409 0 : PyObject *allow_remaining_obj = NULL;
43410 0 : bool allow_remaining = false;
43411 :
43412 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
43413 : discard_const_p(char *, kwnames),
43414 : &blob.data, &blob_length,
43415 : &bigendian_obj,
43416 : &ndr64_obj,
43417 : &allow_remaining_obj)) {
43418 0 : return NULL;
43419 : }
43420 0 : blob.length = blob_length;
43421 :
43422 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43423 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
43424 : }
43425 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43426 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
43427 : }
43428 :
43429 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
43430 0 : allow_remaining = true;
43431 : }
43432 :
43433 0 : return py_samr_OemChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
43434 : }
43435 :
43436 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
43437 : {
43438 0 : const struct ndr_interface_call *call = NULL;
43439 0 : struct samr_OemChangePasswordUser2 *object = (struct samr_OemChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43440 0 : PyObject *ret;
43441 0 : char *retstr;
43442 :
43443 0 : if (ndr_table_samr.num_calls < 55) {
43444 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_OemChangePasswordUser2_ndr_print");
43445 0 : return NULL;
43446 : }
43447 0 : call = &ndr_table_samr.calls[54];
43448 :
43449 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
43450 0 : ret = PyUnicode_FromString(retstr);
43451 0 : TALLOC_FREE(retstr);
43452 :
43453 0 : return ret;
43454 : }
43455 :
43456 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43457 : {
43458 0 : return py_samr_OemChangePasswordUser2_ndr_print(py_obj, "samr_OemChangePasswordUser2_in", NDR_IN);
43459 : }
43460 :
43461 0 : static PyObject *py_samr_OemChangePasswordUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
43462 : {
43463 0 : return py_samr_OemChangePasswordUser2_ndr_print(py_obj, "samr_OemChangePasswordUser2_out", NDR_OUT);
43464 : }
43465 :
43466 : static PyMethodDef py_samr_OemChangePasswordUser2_methods[] = {
43467 : { "opnum", (PyCFunction)py_samr_OemChangePasswordUser2_ndr_opnum, METH_NOARGS|METH_CLASS,
43468 : "samr.OemChangePasswordUser2.opnum() -> 54 (0x36) " },
43469 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OemChangePasswordUser2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
43470 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
43471 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OemChangePasswordUser2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
43472 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
43473 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OemChangePasswordUser2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
43474 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
43475 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_OemChangePasswordUser2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
43476 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
43477 : { "__ndr_print_in__", (PyCFunction)py_samr_OemChangePasswordUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
43478 : { "__ndr_print_out__", (PyCFunction)py_samr_OemChangePasswordUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
43479 : { NULL, NULL, 0, NULL }
43480 : };
43481 :
43482 :
43483 : static PyTypeObject samr_OemChangePasswordUser2_Type = {
43484 : PyVarObject_HEAD_INIT(NULL, 0)
43485 : .tp_name = "samr.OemChangePasswordUser2",
43486 : .tp_getset = py_samr_OemChangePasswordUser2_getsetters,
43487 : .tp_methods = py_samr_OemChangePasswordUser2_methods,
43488 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
43489 : .tp_new = py_samr_OemChangePasswordUser2_new,
43490 : };
43491 :
43492 0 : static bool pack_py_samr_OemChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_OemChangePasswordUser2 *r)
43493 : {
43494 0 : PyObject *py_server;
43495 0 : PyObject *py_account;
43496 0 : PyObject *py_password;
43497 0 : PyObject *py_hash;
43498 0 : const char *kwnames[] = {
43499 : "server", "account", "password", "hash", NULL
43500 : };
43501 :
43502 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_OemChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_password, &py_hash)) {
43503 0 : return false;
43504 : }
43505 :
43506 0 : if (py_server == NULL) {
43507 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server");
43508 0 : return false;
43509 : }
43510 0 : if (py_server == Py_None) {
43511 0 : r->in.server = NULL;
43512 : } else {
43513 0 : r->in.server = NULL;
43514 0 : PY_CHECK_TYPE(lsa_AsciiString_Type, py_server, return false;);
43515 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
43516 0 : PyErr_NoMemory();
43517 0 : return false;
43518 : }
43519 0 : r->in.server = (struct lsa_AsciiString *)pytalloc_get_ptr(py_server);
43520 : }
43521 0 : if (py_account == NULL) {
43522 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account");
43523 0 : return false;
43524 : }
43525 0 : r->in.account = talloc_ptrtype(r, r->in.account);
43526 0 : if (r->in.account == NULL) {
43527 0 : PyErr_NoMemory();
43528 0 : return false;
43529 : }
43530 0 : PY_CHECK_TYPE(lsa_AsciiString_Type, py_account, return false;);
43531 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
43532 0 : PyErr_NoMemory();
43533 0 : return false;
43534 : }
43535 0 : r->in.account = (struct lsa_AsciiString *)pytalloc_get_ptr(py_account);
43536 0 : if (py_password == NULL) {
43537 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
43538 0 : return false;
43539 : }
43540 0 : if (py_password == Py_None) {
43541 0 : r->in.password = NULL;
43542 : } else {
43543 0 : r->in.password = NULL;
43544 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password, return false;);
43545 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_password)) == NULL) {
43546 0 : PyErr_NoMemory();
43547 0 : return false;
43548 : }
43549 0 : r->in.password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password);
43550 : }
43551 0 : if (py_hash == NULL) {
43552 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hash");
43553 0 : return false;
43554 : }
43555 0 : if (py_hash == Py_None) {
43556 0 : r->in.hash = NULL;
43557 : } else {
43558 0 : r->in.hash = NULL;
43559 0 : PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
43560 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
43561 0 : PyErr_NoMemory();
43562 0 : return false;
43563 : }
43564 0 : r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
43565 : }
43566 0 : return true;
43567 : }
43568 :
43569 0 : static PyObject *unpack_py_samr_OemChangePasswordUser2_args_out(struct samr_OemChangePasswordUser2 *r)
43570 : {
43571 0 : PyObject *result;
43572 0 : result = Py_None;
43573 0 : Py_INCREF(result);
43574 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
43575 0 : PyErr_SetNTSTATUS(r->out.result);
43576 0 : return NULL;
43577 : }
43578 :
43579 0 : return result;
43580 : }
43581 :
43582 :
43583 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_server(PyObject *obj, void *closure)
43584 : {
43585 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43586 0 : PyObject *py_server;
43587 0 : if (object->in.server == NULL) {
43588 0 : Py_RETURN_NONE;
43589 : }
43590 0 : if (object->in.server == NULL) {
43591 0 : py_server = Py_None;
43592 0 : Py_INCREF(py_server);
43593 : } else {
43594 0 : py_server = pytalloc_reference_ex(lsa_String_Type, object->in.server, object->in.server);
43595 : }
43596 0 : return py_server;
43597 : }
43598 :
43599 0 : static int py_samr_ChangePasswordUser2_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
43600 : {
43601 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43602 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server));
43603 0 : if (value == NULL) {
43604 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server");
43605 0 : return -1;
43606 : }
43607 0 : if (value == Py_None) {
43608 0 : object->in.server = NULL;
43609 : } else {
43610 0 : object->in.server = NULL;
43611 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
43612 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43613 0 : PyErr_NoMemory();
43614 0 : return -1;
43615 : }
43616 0 : object->in.server = (struct lsa_String *)pytalloc_get_ptr(value);
43617 : }
43618 0 : return 0;
43619 : }
43620 :
43621 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_account(PyObject *obj, void *closure)
43622 : {
43623 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43624 0 : PyObject *py_account;
43625 0 : if (object->in.account == NULL) {
43626 0 : Py_RETURN_NONE;
43627 : }
43628 0 : py_account = pytalloc_reference_ex(lsa_String_Type, object->in.account, object->in.account);
43629 0 : return py_account;
43630 : }
43631 :
43632 0 : static int py_samr_ChangePasswordUser2_in_set_account(PyObject *py_obj, PyObject *value, void *closure)
43633 : {
43634 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43635 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account));
43636 0 : if (value == NULL) {
43637 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account");
43638 0 : return -1;
43639 : }
43640 0 : object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account);
43641 0 : if (object->in.account == NULL) {
43642 0 : PyErr_NoMemory();
43643 0 : return -1;
43644 : }
43645 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
43646 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43647 0 : PyErr_NoMemory();
43648 0 : return -1;
43649 : }
43650 0 : object->in.account = (struct lsa_String *)pytalloc_get_ptr(value);
43651 0 : return 0;
43652 : }
43653 :
43654 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_nt_password(PyObject *obj, void *closure)
43655 : {
43656 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43657 0 : PyObject *py_nt_password;
43658 0 : if (object->in.nt_password == NULL) {
43659 0 : Py_RETURN_NONE;
43660 : }
43661 0 : if (object->in.nt_password == NULL) {
43662 0 : py_nt_password = Py_None;
43663 0 : Py_INCREF(py_nt_password);
43664 : } else {
43665 0 : py_nt_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.nt_password, object->in.nt_password);
43666 : }
43667 0 : return py_nt_password;
43668 : }
43669 :
43670 0 : static int py_samr_ChangePasswordUser2_in_set_nt_password(PyObject *py_obj, PyObject *value, void *closure)
43671 : {
43672 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43673 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_password));
43674 0 : if (value == NULL) {
43675 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_password");
43676 0 : return -1;
43677 : }
43678 0 : if (value == Py_None) {
43679 0 : object->in.nt_password = NULL;
43680 : } else {
43681 0 : object->in.nt_password = NULL;
43682 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
43683 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43684 0 : PyErr_NoMemory();
43685 0 : return -1;
43686 : }
43687 0 : object->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
43688 : }
43689 0 : return 0;
43690 : }
43691 :
43692 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_nt_verifier(PyObject *obj, void *closure)
43693 : {
43694 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43695 0 : PyObject *py_nt_verifier;
43696 0 : if (object->in.nt_verifier == NULL) {
43697 0 : Py_RETURN_NONE;
43698 : }
43699 0 : if (object->in.nt_verifier == NULL) {
43700 0 : py_nt_verifier = Py_None;
43701 0 : Py_INCREF(py_nt_verifier);
43702 : } else {
43703 0 : py_nt_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_verifier, object->in.nt_verifier);
43704 : }
43705 0 : return py_nt_verifier;
43706 : }
43707 :
43708 0 : static int py_samr_ChangePasswordUser2_in_set_nt_verifier(PyObject *py_obj, PyObject *value, void *closure)
43709 : {
43710 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43711 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_verifier));
43712 0 : if (value == NULL) {
43713 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_verifier");
43714 0 : return -1;
43715 : }
43716 0 : if (value == Py_None) {
43717 0 : object->in.nt_verifier = NULL;
43718 : } else {
43719 0 : object->in.nt_verifier = NULL;
43720 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
43721 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43722 0 : PyErr_NoMemory();
43723 0 : return -1;
43724 : }
43725 0 : object->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(value);
43726 : }
43727 0 : return 0;
43728 : }
43729 :
43730 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_lm_change(PyObject *obj, void *closure)
43731 : {
43732 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43733 0 : PyObject *py_lm_change;
43734 0 : py_lm_change = PyLong_FromLong((uint16_t)object->in.lm_change);
43735 0 : return py_lm_change;
43736 : }
43737 :
43738 0 : static int py_samr_ChangePasswordUser2_in_set_lm_change(PyObject *py_obj, PyObject *value, void *closure)
43739 : {
43740 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43741 0 : if (value == NULL) {
43742 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_change");
43743 0 : return -1;
43744 : }
43745 : {
43746 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_change));
43747 0 : if (PyLong_Check(value)) {
43748 0 : unsigned long long test_var;
43749 0 : test_var = PyLong_AsUnsignedLongLong(value);
43750 0 : if (PyErr_Occurred() != NULL) {
43751 0 : return -1;
43752 : }
43753 0 : if (test_var > uint_max) {
43754 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
43755 : PyLong_Type.tp_name, uint_max, test_var);
43756 0 : return -1;
43757 : }
43758 0 : object->in.lm_change = test_var;
43759 : } else {
43760 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
43761 : PyLong_Type.tp_name);
43762 0 : return -1;
43763 : }
43764 : }
43765 0 : return 0;
43766 : }
43767 :
43768 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_lm_password(PyObject *obj, void *closure)
43769 : {
43770 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43771 0 : PyObject *py_lm_password;
43772 0 : if (object->in.lm_password == NULL) {
43773 0 : Py_RETURN_NONE;
43774 : }
43775 0 : if (object->in.lm_password == NULL) {
43776 0 : py_lm_password = Py_None;
43777 0 : Py_INCREF(py_lm_password);
43778 : } else {
43779 0 : py_lm_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.lm_password, object->in.lm_password);
43780 : }
43781 0 : return py_lm_password;
43782 : }
43783 :
43784 0 : static int py_samr_ChangePasswordUser2_in_set_lm_password(PyObject *py_obj, PyObject *value, void *closure)
43785 : {
43786 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43787 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_password));
43788 0 : if (value == NULL) {
43789 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_password");
43790 0 : return -1;
43791 : }
43792 0 : if (value == Py_None) {
43793 0 : object->in.lm_password = NULL;
43794 : } else {
43795 0 : object->in.lm_password = NULL;
43796 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
43797 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43798 0 : PyErr_NoMemory();
43799 0 : return -1;
43800 : }
43801 0 : object->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
43802 : }
43803 0 : return 0;
43804 : }
43805 :
43806 0 : static PyObject *py_samr_ChangePasswordUser2_in_get_lm_verifier(PyObject *obj, void *closure)
43807 : {
43808 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43809 0 : PyObject *py_lm_verifier;
43810 0 : if (object->in.lm_verifier == NULL) {
43811 0 : Py_RETURN_NONE;
43812 : }
43813 0 : if (object->in.lm_verifier == NULL) {
43814 0 : py_lm_verifier = Py_None;
43815 0 : Py_INCREF(py_lm_verifier);
43816 : } else {
43817 0 : py_lm_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_verifier, object->in.lm_verifier);
43818 : }
43819 0 : return py_lm_verifier;
43820 : }
43821 :
43822 0 : static int py_samr_ChangePasswordUser2_in_set_lm_verifier(PyObject *py_obj, PyObject *value, void *closure)
43823 : {
43824 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43825 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_verifier));
43826 0 : if (value == NULL) {
43827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_verifier");
43828 0 : return -1;
43829 : }
43830 0 : if (value == Py_None) {
43831 0 : object->in.lm_verifier = NULL;
43832 : } else {
43833 0 : object->in.lm_verifier = NULL;
43834 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
43835 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
43836 0 : PyErr_NoMemory();
43837 0 : return -1;
43838 : }
43839 0 : object->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(value);
43840 : }
43841 0 : return 0;
43842 : }
43843 :
43844 0 : static PyObject *py_samr_ChangePasswordUser2_get_result(PyObject *obj, void *closure)
43845 : {
43846 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(obj);
43847 0 : PyObject *py_result;
43848 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
43849 0 : return py_result;
43850 : }
43851 :
43852 0 : static int py_samr_ChangePasswordUser2_set_result(PyObject *py_obj, PyObject *value, void *closure)
43853 : {
43854 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43855 0 : if (value == NULL) {
43856 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
43857 0 : return -1;
43858 : }
43859 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
43860 0 : return 0;
43861 : }
43862 :
43863 : static PyGetSetDef py_samr_ChangePasswordUser2_getsetters[] = {
43864 : {
43865 : .name = discard_const_p(char, "in_server"),
43866 : .get = py_samr_ChangePasswordUser2_in_get_server,
43867 : .set = py_samr_ChangePasswordUser2_in_set_server,
43868 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
43869 : },
43870 : {
43871 : .name = discard_const_p(char, "in_account"),
43872 : .get = py_samr_ChangePasswordUser2_in_get_account,
43873 : .set = py_samr_ChangePasswordUser2_in_set_account,
43874 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
43875 : },
43876 : {
43877 : .name = discard_const_p(char, "in_nt_password"),
43878 : .get = py_samr_ChangePasswordUser2_in_get_nt_password,
43879 : .set = py_samr_ChangePasswordUser2_in_set_nt_password,
43880 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
43881 : },
43882 : {
43883 : .name = discard_const_p(char, "in_nt_verifier"),
43884 : .get = py_samr_ChangePasswordUser2_in_get_nt_verifier,
43885 : .set = py_samr_ChangePasswordUser2_in_set_nt_verifier,
43886 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
43887 : },
43888 : {
43889 : .name = discard_const_p(char, "in_lm_change"),
43890 : .get = py_samr_ChangePasswordUser2_in_get_lm_change,
43891 : .set = py_samr_ChangePasswordUser2_in_set_lm_change,
43892 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
43893 : },
43894 : {
43895 : .name = discard_const_p(char, "in_lm_password"),
43896 : .get = py_samr_ChangePasswordUser2_in_get_lm_password,
43897 : .set = py_samr_ChangePasswordUser2_in_set_lm_password,
43898 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
43899 : },
43900 : {
43901 : .name = discard_const_p(char, "in_lm_verifier"),
43902 : .get = py_samr_ChangePasswordUser2_in_get_lm_verifier,
43903 : .set = py_samr_ChangePasswordUser2_in_set_lm_verifier,
43904 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
43905 : },
43906 : {
43907 : .name = discard_const_p(char, "result"),
43908 : .get = py_samr_ChangePasswordUser2_get_result,
43909 : .set = py_samr_ChangePasswordUser2_set_result,
43910 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
43911 : },
43912 : { .name = NULL }
43913 : };
43914 :
43915 0 : static PyObject *py_samr_ChangePasswordUser2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
43916 : {
43917 0 : PyObject *self = pytalloc_new(struct samr_ChangePasswordUser2, type);
43918 0 : struct samr_ChangePasswordUser2 *_self = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(self);
43919 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
43920 0 : _self->in.account = talloc_zero(mem_ctx, struct lsa_String);
43921 0 : return self;
43922 : }
43923 :
43924 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
43925 : {
43926 :
43927 :
43928 0 : return PyLong_FromLong(55);
43929 : }
43930 :
43931 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
43932 : {
43933 0 : const struct ndr_interface_call *call = NULL;
43934 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
43935 0 : PyObject *ret = NULL;
43936 0 : struct ndr_push *push = NULL;
43937 0 : DATA_BLOB blob;
43938 0 : enum ndr_err_code err;
43939 :
43940 0 : if (ndr_table_samr.num_calls < 56) {
43941 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_pack");
43942 0 : return NULL;
43943 : }
43944 0 : call = &ndr_table_samr.calls[55];
43945 :
43946 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
43947 0 : if (push == NULL) {
43948 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
43949 0 : return NULL;
43950 : }
43951 :
43952 0 : push->flags |= ndr_push_flags;
43953 :
43954 0 : err = call->ndr_push(push, ndr_inout_flags, object);
43955 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
43956 0 : TALLOC_FREE(push);
43957 0 : PyErr_SetNdrError(err);
43958 0 : return NULL;
43959 : }
43960 0 : blob = ndr_push_blob(push);
43961 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
43962 0 : TALLOC_FREE(push);
43963 0 : return ret;
43964 : }
43965 :
43966 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43967 : {
43968 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43969 0 : PyObject *bigendian_obj = NULL;
43970 0 : PyObject *ndr64_obj = NULL;
43971 0 : libndr_flags ndr_push_flags = 0;
43972 :
43973 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
43974 : discard_const_p(char *, kwnames),
43975 : &bigendian_obj,
43976 : &ndr64_obj)) {
43977 0 : return NULL;
43978 : }
43979 :
43980 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
43981 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
43982 : }
43983 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
43984 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
43985 : }
43986 :
43987 0 : return py_samr_ChangePasswordUser2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
43988 : }
43989 :
43990 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
43991 : {
43992 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
43993 0 : PyObject *bigendian_obj = NULL;
43994 0 : PyObject *ndr64_obj = NULL;
43995 0 : libndr_flags ndr_push_flags = 0;
43996 :
43997 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
43998 : discard_const_p(char *, kwnames),
43999 : &bigendian_obj,
44000 : &ndr64_obj)) {
44001 0 : return NULL;
44002 : }
44003 :
44004 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44005 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44006 : }
44007 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44008 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44009 : }
44010 :
44011 0 : return py_samr_ChangePasswordUser2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44012 : }
44013 :
44014 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
44015 : {
44016 0 : const struct ndr_interface_call *call = NULL;
44017 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
44018 0 : struct ndr_pull *pull = NULL;
44019 0 : enum ndr_err_code err;
44020 :
44021 0 : if (ndr_table_samr.num_calls < 56) {
44022 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_unpack");
44023 0 : return NULL;
44024 : }
44025 0 : call = &ndr_table_samr.calls[55];
44026 :
44027 0 : pull = ndr_pull_init_blob(blob, object);
44028 0 : if (pull == NULL) {
44029 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44030 0 : return NULL;
44031 : }
44032 :
44033 0 : pull->flags |= ndr_pull_flags;
44034 :
44035 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44036 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44037 0 : TALLOC_FREE(pull);
44038 0 : PyErr_SetNdrError(err);
44039 0 : return NULL;
44040 : }
44041 0 : if (!allow_remaining) {
44042 0 : uint32_t highest_ofs;
44043 :
44044 0 : if (pull->offset > pull->relative_highest_offset) {
44045 0 : highest_ofs = pull->offset;
44046 : } else {
44047 0 : highest_ofs = pull->relative_highest_offset;
44048 : }
44049 0 : if (highest_ofs < pull->data_size) {
44050 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44051 : "not all bytes consumed ofs[%u] size[%u]",
44052 : highest_ofs, pull->data_size);
44053 0 : TALLOC_FREE(pull);
44054 0 : PyErr_SetNdrError(err);
44055 0 : return NULL;
44056 : }
44057 : }
44058 :
44059 0 : TALLOC_FREE(pull);
44060 0 : Py_RETURN_NONE;
44061 : }
44062 :
44063 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44064 : {
44065 0 : DATA_BLOB blob;
44066 0 : Py_ssize_t blob_length = 0;
44067 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44068 0 : PyObject *bigendian_obj = NULL;
44069 0 : PyObject *ndr64_obj = NULL;
44070 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44071 0 : PyObject *allow_remaining_obj = NULL;
44072 0 : bool allow_remaining = false;
44073 :
44074 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44075 : discard_const_p(char *, kwnames),
44076 : &blob.data, &blob_length,
44077 : &bigendian_obj,
44078 : &ndr64_obj,
44079 : &allow_remaining_obj)) {
44080 0 : return NULL;
44081 : }
44082 0 : blob.length = blob_length;
44083 :
44084 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44085 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44086 : }
44087 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44088 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44089 : }
44090 :
44091 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44092 0 : allow_remaining = true;
44093 : }
44094 :
44095 0 : return py_samr_ChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44096 : }
44097 :
44098 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44099 : {
44100 0 : DATA_BLOB blob;
44101 0 : Py_ssize_t blob_length = 0;
44102 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44103 0 : PyObject *bigendian_obj = NULL;
44104 0 : PyObject *ndr64_obj = NULL;
44105 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44106 0 : PyObject *allow_remaining_obj = NULL;
44107 0 : bool allow_remaining = false;
44108 :
44109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44110 : discard_const_p(char *, kwnames),
44111 : &blob.data, &blob_length,
44112 : &bigendian_obj,
44113 : &ndr64_obj,
44114 : &allow_remaining_obj)) {
44115 0 : return NULL;
44116 : }
44117 0 : blob.length = blob_length;
44118 :
44119 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44120 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44121 : }
44122 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44123 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44124 : }
44125 :
44126 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44127 0 : allow_remaining = true;
44128 : }
44129 :
44130 0 : return py_samr_ChangePasswordUser2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44131 : }
44132 :
44133 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
44134 : {
44135 0 : const struct ndr_interface_call *call = NULL;
44136 0 : struct samr_ChangePasswordUser2 *object = (struct samr_ChangePasswordUser2 *)pytalloc_get_ptr(py_obj);
44137 0 : PyObject *ret;
44138 0 : char *retstr;
44139 :
44140 0 : if (ndr_table_samr.num_calls < 56) {
44141 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser2_ndr_print");
44142 0 : return NULL;
44143 : }
44144 0 : call = &ndr_table_samr.calls[55];
44145 :
44146 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44147 0 : ret = PyUnicode_FromString(retstr);
44148 0 : TALLOC_FREE(retstr);
44149 :
44150 0 : return ret;
44151 : }
44152 :
44153 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44154 : {
44155 0 : return py_samr_ChangePasswordUser2_ndr_print(py_obj, "samr_ChangePasswordUser2_in", NDR_IN);
44156 : }
44157 :
44158 0 : static PyObject *py_samr_ChangePasswordUser2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44159 : {
44160 0 : return py_samr_ChangePasswordUser2_ndr_print(py_obj, "samr_ChangePasswordUser2_out", NDR_OUT);
44161 : }
44162 :
44163 : static PyMethodDef py_samr_ChangePasswordUser2_methods[] = {
44164 : { "opnum", (PyCFunction)py_samr_ChangePasswordUser2_ndr_opnum, METH_NOARGS|METH_CLASS,
44165 : "samr.ChangePasswordUser2.opnum() -> 55 (0x37) " },
44166 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44167 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44168 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44169 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44170 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44171 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44172 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44173 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44174 : { "__ndr_print_in__", (PyCFunction)py_samr_ChangePasswordUser2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44175 : { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44176 : { NULL, NULL, 0, NULL }
44177 : };
44178 :
44179 :
44180 : static PyTypeObject samr_ChangePasswordUser2_Type = {
44181 : PyVarObject_HEAD_INIT(NULL, 0)
44182 : .tp_name = "samr.ChangePasswordUser2",
44183 : .tp_getset = py_samr_ChangePasswordUser2_getsetters,
44184 : .tp_methods = py_samr_ChangePasswordUser2_methods,
44185 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44186 : .tp_new = py_samr_ChangePasswordUser2_new,
44187 : };
44188 :
44189 19 : static bool pack_py_samr_ChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser2 *r)
44190 : {
44191 0 : PyObject *py_server;
44192 0 : PyObject *py_account;
44193 0 : PyObject *py_nt_password;
44194 0 : PyObject *py_nt_verifier;
44195 0 : PyObject *py_lm_change;
44196 0 : PyObject *py_lm_password;
44197 0 : PyObject *py_lm_verifier;
44198 19 : const char *kwnames[] = {
44199 : "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", NULL
44200 : };
44201 :
44202 19 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:samr_ChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_nt_password, &py_nt_verifier, &py_lm_change, &py_lm_password, &py_lm_verifier)) {
44203 0 : return false;
44204 : }
44205 :
44206 19 : if (py_server == NULL) {
44207 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server");
44208 0 : return false;
44209 : }
44210 19 : if (py_server == Py_None) {
44211 0 : r->in.server = NULL;
44212 : } else {
44213 19 : r->in.server = NULL;
44214 19 : PY_CHECK_TYPE(lsa_String_Type, py_server, return false;);
44215 19 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
44216 0 : PyErr_NoMemory();
44217 0 : return false;
44218 : }
44219 19 : r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
44220 : }
44221 19 : if (py_account == NULL) {
44222 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account");
44223 0 : return false;
44224 : }
44225 19 : r->in.account = talloc_ptrtype(r, r->in.account);
44226 19 : if (r->in.account == NULL) {
44227 0 : PyErr_NoMemory();
44228 0 : return false;
44229 : }
44230 19 : PY_CHECK_TYPE(lsa_String_Type, py_account, return false;);
44231 19 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
44232 0 : PyErr_NoMemory();
44233 0 : return false;
44234 : }
44235 19 : r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account);
44236 19 : if (py_nt_password == NULL) {
44237 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_password");
44238 0 : return false;
44239 : }
44240 19 : if (py_nt_password == Py_None) {
44241 7 : r->in.nt_password = NULL;
44242 : } else {
44243 12 : r->in.nt_password = NULL;
44244 12 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;);
44245 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) {
44246 0 : PyErr_NoMemory();
44247 0 : return false;
44248 : }
44249 12 : r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
44250 : }
44251 19 : if (py_nt_verifier == NULL) {
44252 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_verifier");
44253 0 : return false;
44254 : }
44255 19 : if (py_nt_verifier == Py_None) {
44256 7 : r->in.nt_verifier = NULL;
44257 : } else {
44258 12 : r->in.nt_verifier = NULL;
44259 12 : PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;);
44260 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) {
44261 0 : PyErr_NoMemory();
44262 0 : return false;
44263 : }
44264 12 : r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
44265 : }
44266 19 : if (py_lm_change == NULL) {
44267 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_change");
44268 0 : return false;
44269 : }
44270 : {
44271 19 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_change));
44272 19 : if (PyLong_Check(py_lm_change)) {
44273 0 : unsigned long long test_var;
44274 19 : test_var = PyLong_AsUnsignedLongLong(py_lm_change);
44275 19 : if (PyErr_Occurred() != NULL) {
44276 0 : return false;
44277 : }
44278 19 : if (test_var > uint_max) {
44279 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44280 : PyLong_Type.tp_name, uint_max, test_var);
44281 0 : return false;
44282 : }
44283 19 : r->in.lm_change = test_var;
44284 : } else {
44285 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44286 : PyLong_Type.tp_name);
44287 0 : return false;
44288 : }
44289 : }
44290 19 : if (py_lm_password == NULL) {
44291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_password");
44292 0 : return false;
44293 : }
44294 19 : if (py_lm_password == Py_None) {
44295 19 : r->in.lm_password = NULL;
44296 : } else {
44297 0 : r->in.lm_password = NULL;
44298 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;);
44299 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) {
44300 0 : PyErr_NoMemory();
44301 0 : return false;
44302 : }
44303 0 : r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
44304 : }
44305 19 : if (py_lm_verifier == NULL) {
44306 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_verifier");
44307 0 : return false;
44308 : }
44309 19 : if (py_lm_verifier == Py_None) {
44310 19 : r->in.lm_verifier = NULL;
44311 : } else {
44312 0 : r->in.lm_verifier = NULL;
44313 0 : PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;);
44314 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) {
44315 0 : PyErr_NoMemory();
44316 0 : return false;
44317 : }
44318 0 : r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
44319 : }
44320 19 : return true;
44321 : }
44322 :
44323 19 : static PyObject *unpack_py_samr_ChangePasswordUser2_args_out(struct samr_ChangePasswordUser2 *r)
44324 : {
44325 0 : PyObject *result;
44326 19 : result = Py_None;
44327 10 : Py_INCREF(result);
44328 19 : if (NT_STATUS_IS_ERR(r->out.result)) {
44329 7 : PyErr_SetNTSTATUS(r->out.result);
44330 7 : return NULL;
44331 : }
44332 :
44333 12 : return result;
44334 : }
44335 :
44336 :
44337 0 : static PyObject *py_samr_GetDomPwInfo_in_get_domain_name(PyObject *obj, void *closure)
44338 : {
44339 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj);
44340 0 : PyObject *py_domain_name;
44341 0 : if (object->in.domain_name == NULL) {
44342 0 : Py_RETURN_NONE;
44343 : }
44344 0 : if (object->in.domain_name == NULL) {
44345 0 : py_domain_name = Py_None;
44346 0 : Py_INCREF(py_domain_name);
44347 : } else {
44348 0 : py_domain_name = pytalloc_reference_ex(lsa_String_Type, object->in.domain_name, object->in.domain_name);
44349 : }
44350 0 : return py_domain_name;
44351 : }
44352 :
44353 0 : static int py_samr_GetDomPwInfo_in_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
44354 : {
44355 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44356 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_name));
44357 0 : if (value == NULL) {
44358 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_name");
44359 0 : return -1;
44360 : }
44361 0 : if (value == Py_None) {
44362 0 : object->in.domain_name = NULL;
44363 : } else {
44364 0 : object->in.domain_name = NULL;
44365 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
44366 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44367 0 : PyErr_NoMemory();
44368 0 : return -1;
44369 : }
44370 0 : object->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(value);
44371 : }
44372 0 : return 0;
44373 : }
44374 :
44375 0 : static PyObject *py_samr_GetDomPwInfo_out_get_info(PyObject *obj, void *closure)
44376 : {
44377 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj);
44378 0 : PyObject *py_info;
44379 0 : if (object->out.info == NULL) {
44380 0 : Py_RETURN_NONE;
44381 : }
44382 0 : py_info = pytalloc_reference_ex(&samr_PwInfo_Type, object->out.info, object->out.info);
44383 0 : return py_info;
44384 : }
44385 :
44386 0 : static int py_samr_GetDomPwInfo_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
44387 : {
44388 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44389 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
44390 0 : if (value == NULL) {
44391 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info");
44392 0 : return -1;
44393 : }
44394 0 : object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
44395 0 : if (object->out.info == NULL) {
44396 0 : PyErr_NoMemory();
44397 0 : return -1;
44398 : }
44399 0 : PY_CHECK_TYPE(&samr_PwInfo_Type, value, return -1;);
44400 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44401 0 : PyErr_NoMemory();
44402 0 : return -1;
44403 : }
44404 0 : object->out.info = (struct samr_PwInfo *)pytalloc_get_ptr(value);
44405 0 : return 0;
44406 : }
44407 :
44408 0 : static PyObject *py_samr_GetDomPwInfo_get_result(PyObject *obj, void *closure)
44409 : {
44410 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(obj);
44411 0 : PyObject *py_result;
44412 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44413 0 : return py_result;
44414 : }
44415 :
44416 0 : static int py_samr_GetDomPwInfo_set_result(PyObject *py_obj, PyObject *value, void *closure)
44417 : {
44418 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44419 0 : if (value == NULL) {
44420 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44421 0 : return -1;
44422 : }
44423 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44424 0 : return 0;
44425 : }
44426 :
44427 : static PyGetSetDef py_samr_GetDomPwInfo_getsetters[] = {
44428 : {
44429 : .name = discard_const_p(char, "in_domain_name"),
44430 : .get = py_samr_GetDomPwInfo_in_get_domain_name,
44431 : .set = py_samr_GetDomPwInfo_in_set_domain_name,
44432 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
44433 : },
44434 : {
44435 : .name = discard_const_p(char, "out_info"),
44436 : .get = py_samr_GetDomPwInfo_out_get_info,
44437 : .set = py_samr_GetDomPwInfo_out_set_info,
44438 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_PwInfo")
44439 : },
44440 : {
44441 : .name = discard_const_p(char, "result"),
44442 : .get = py_samr_GetDomPwInfo_get_result,
44443 : .set = py_samr_GetDomPwInfo_set_result,
44444 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44445 : },
44446 : { .name = NULL }
44447 : };
44448 :
44449 0 : static PyObject *py_samr_GetDomPwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44450 : {
44451 0 : PyObject *self = pytalloc_new(struct samr_GetDomPwInfo, type);
44452 0 : struct samr_GetDomPwInfo *_self = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(self);
44453 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44454 0 : _self->out.info = talloc_zero(mem_ctx, struct samr_PwInfo);
44455 0 : return self;
44456 : }
44457 :
44458 0 : static PyObject *py_samr_GetDomPwInfo_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44459 : {
44460 :
44461 :
44462 0 : return PyLong_FromLong(56);
44463 : }
44464 :
44465 0 : static PyObject *py_samr_GetDomPwInfo_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44466 : {
44467 0 : const struct ndr_interface_call *call = NULL;
44468 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44469 0 : PyObject *ret = NULL;
44470 0 : struct ndr_push *push = NULL;
44471 0 : DATA_BLOB blob;
44472 0 : enum ndr_err_code err;
44473 :
44474 0 : if (ndr_table_samr.num_calls < 57) {
44475 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_pack");
44476 0 : return NULL;
44477 : }
44478 0 : call = &ndr_table_samr.calls[56];
44479 :
44480 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44481 0 : if (push == NULL) {
44482 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44483 0 : return NULL;
44484 : }
44485 :
44486 0 : push->flags |= ndr_push_flags;
44487 :
44488 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44489 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44490 0 : TALLOC_FREE(push);
44491 0 : PyErr_SetNdrError(err);
44492 0 : return NULL;
44493 : }
44494 0 : blob = ndr_push_blob(push);
44495 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44496 0 : TALLOC_FREE(push);
44497 0 : return ret;
44498 : }
44499 :
44500 0 : static PyObject *py_samr_GetDomPwInfo_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44501 : {
44502 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44503 0 : PyObject *bigendian_obj = NULL;
44504 0 : PyObject *ndr64_obj = NULL;
44505 0 : libndr_flags ndr_push_flags = 0;
44506 :
44507 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
44508 : discard_const_p(char *, kwnames),
44509 : &bigendian_obj,
44510 : &ndr64_obj)) {
44511 0 : return NULL;
44512 : }
44513 :
44514 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44515 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44516 : }
44517 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44518 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44519 : }
44520 :
44521 0 : return py_samr_GetDomPwInfo_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
44522 : }
44523 :
44524 0 : static PyObject *py_samr_GetDomPwInfo_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44525 : {
44526 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
44527 0 : PyObject *bigendian_obj = NULL;
44528 0 : PyObject *ndr64_obj = NULL;
44529 0 : libndr_flags ndr_push_flags = 0;
44530 :
44531 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
44532 : discard_const_p(char *, kwnames),
44533 : &bigendian_obj,
44534 : &ndr64_obj)) {
44535 0 : return NULL;
44536 : }
44537 :
44538 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44539 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
44540 : }
44541 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44542 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
44543 : }
44544 :
44545 0 : return py_samr_GetDomPwInfo_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
44546 : }
44547 :
44548 0 : static PyObject *py_samr_GetDomPwInfo_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
44549 : {
44550 0 : const struct ndr_interface_call *call = NULL;
44551 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44552 0 : struct ndr_pull *pull = NULL;
44553 0 : enum ndr_err_code err;
44554 :
44555 0 : if (ndr_table_samr.num_calls < 57) {
44556 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_unpack");
44557 0 : return NULL;
44558 : }
44559 0 : call = &ndr_table_samr.calls[56];
44560 :
44561 0 : pull = ndr_pull_init_blob(blob, object);
44562 0 : if (pull == NULL) {
44563 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44564 0 : return NULL;
44565 : }
44566 :
44567 0 : pull->flags |= ndr_pull_flags;
44568 :
44569 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
44570 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44571 0 : TALLOC_FREE(pull);
44572 0 : PyErr_SetNdrError(err);
44573 0 : return NULL;
44574 : }
44575 0 : if (!allow_remaining) {
44576 0 : uint32_t highest_ofs;
44577 :
44578 0 : if (pull->offset > pull->relative_highest_offset) {
44579 0 : highest_ofs = pull->offset;
44580 : } else {
44581 0 : highest_ofs = pull->relative_highest_offset;
44582 : }
44583 0 : if (highest_ofs < pull->data_size) {
44584 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
44585 : "not all bytes consumed ofs[%u] size[%u]",
44586 : highest_ofs, pull->data_size);
44587 0 : TALLOC_FREE(pull);
44588 0 : PyErr_SetNdrError(err);
44589 0 : return NULL;
44590 : }
44591 : }
44592 :
44593 0 : TALLOC_FREE(pull);
44594 0 : Py_RETURN_NONE;
44595 : }
44596 :
44597 0 : static PyObject *py_samr_GetDomPwInfo_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44598 : {
44599 0 : DATA_BLOB blob;
44600 0 : Py_ssize_t blob_length = 0;
44601 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44602 0 : PyObject *bigendian_obj = NULL;
44603 0 : PyObject *ndr64_obj = NULL;
44604 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44605 0 : PyObject *allow_remaining_obj = NULL;
44606 0 : bool allow_remaining = false;
44607 :
44608 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
44609 : discard_const_p(char *, kwnames),
44610 : &blob.data, &blob_length,
44611 : &bigendian_obj,
44612 : &ndr64_obj,
44613 : &allow_remaining_obj)) {
44614 0 : return NULL;
44615 : }
44616 0 : blob.length = blob_length;
44617 :
44618 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44619 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44620 : }
44621 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44622 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44623 : }
44624 :
44625 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44626 0 : allow_remaining = true;
44627 : }
44628 :
44629 0 : return py_samr_GetDomPwInfo_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
44630 : }
44631 :
44632 0 : static PyObject *py_samr_GetDomPwInfo_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44633 : {
44634 0 : DATA_BLOB blob;
44635 0 : Py_ssize_t blob_length = 0;
44636 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
44637 0 : PyObject *bigendian_obj = NULL;
44638 0 : PyObject *ndr64_obj = NULL;
44639 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
44640 0 : PyObject *allow_remaining_obj = NULL;
44641 0 : bool allow_remaining = false;
44642 :
44643 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
44644 : discard_const_p(char *, kwnames),
44645 : &blob.data, &blob_length,
44646 : &bigendian_obj,
44647 : &ndr64_obj,
44648 : &allow_remaining_obj)) {
44649 0 : return NULL;
44650 : }
44651 0 : blob.length = blob_length;
44652 :
44653 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
44654 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
44655 : }
44656 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
44657 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
44658 : }
44659 :
44660 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
44661 0 : allow_remaining = true;
44662 : }
44663 :
44664 0 : return py_samr_GetDomPwInfo_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
44665 : }
44666 :
44667 0 : static PyObject *py_samr_GetDomPwInfo_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
44668 : {
44669 0 : const struct ndr_interface_call *call = NULL;
44670 0 : struct samr_GetDomPwInfo *object = (struct samr_GetDomPwInfo *)pytalloc_get_ptr(py_obj);
44671 0 : PyObject *ret;
44672 0 : char *retstr;
44673 :
44674 0 : if (ndr_table_samr.num_calls < 57) {
44675 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetDomPwInfo_ndr_print");
44676 0 : return NULL;
44677 : }
44678 0 : call = &ndr_table_samr.calls[56];
44679 :
44680 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
44681 0 : ret = PyUnicode_FromString(retstr);
44682 0 : TALLOC_FREE(retstr);
44683 :
44684 0 : return ret;
44685 : }
44686 :
44687 0 : static PyObject *py_samr_GetDomPwInfo_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44688 : {
44689 0 : return py_samr_GetDomPwInfo_ndr_print(py_obj, "samr_GetDomPwInfo_in", NDR_IN);
44690 : }
44691 :
44692 0 : static PyObject *py_samr_GetDomPwInfo_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
44693 : {
44694 0 : return py_samr_GetDomPwInfo_ndr_print(py_obj, "samr_GetDomPwInfo_out", NDR_OUT);
44695 : }
44696 :
44697 : static PyMethodDef py_samr_GetDomPwInfo_methods[] = {
44698 : { "opnum", (PyCFunction)py_samr_GetDomPwInfo_ndr_opnum, METH_NOARGS|METH_CLASS,
44699 : "samr.GetDomPwInfo.opnum() -> 56 (0x38) " },
44700 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDomPwInfo_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
44701 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
44702 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDomPwInfo_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
44703 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
44704 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDomPwInfo_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
44705 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
44706 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetDomPwInfo_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
44707 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
44708 : { "__ndr_print_in__", (PyCFunction)py_samr_GetDomPwInfo_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
44709 : { "__ndr_print_out__", (PyCFunction)py_samr_GetDomPwInfo_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
44710 : { NULL, NULL, 0, NULL }
44711 : };
44712 :
44713 :
44714 : static PyTypeObject samr_GetDomPwInfo_Type = {
44715 : PyVarObject_HEAD_INIT(NULL, 0)
44716 : .tp_name = "samr.GetDomPwInfo",
44717 : .tp_getset = py_samr_GetDomPwInfo_getsetters,
44718 : .tp_methods = py_samr_GetDomPwInfo_methods,
44719 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
44720 : .tp_new = py_samr_GetDomPwInfo_new,
44721 : };
44722 :
44723 0 : static bool pack_py_samr_GetDomPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDomPwInfo *r)
44724 : {
44725 0 : PyObject *py_domain_name;
44726 0 : const char *kwnames[] = {
44727 : "domain_name", NULL
44728 : };
44729 :
44730 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetDomPwInfo", discard_const_p(char *, kwnames), &py_domain_name)) {
44731 0 : return false;
44732 : }
44733 :
44734 0 : if (py_domain_name == NULL) {
44735 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_name");
44736 0 : return false;
44737 : }
44738 0 : if (py_domain_name == Py_None) {
44739 0 : r->in.domain_name = NULL;
44740 : } else {
44741 0 : r->in.domain_name = NULL;
44742 0 : PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;);
44743 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) {
44744 0 : PyErr_NoMemory();
44745 0 : return false;
44746 : }
44747 0 : r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
44748 : }
44749 0 : return true;
44750 : }
44751 :
44752 0 : static PyObject *unpack_py_samr_GetDomPwInfo_args_out(struct samr_GetDomPwInfo *r)
44753 : {
44754 0 : PyObject *result;
44755 0 : PyObject *py_info;
44756 0 : py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
44757 0 : result = py_info;
44758 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
44759 0 : PyErr_SetNTSTATUS(r->out.result);
44760 0 : return NULL;
44761 : }
44762 :
44763 0 : return result;
44764 : }
44765 :
44766 :
44767 0 : static PyObject *py_samr_Connect2_in_get_system_name(PyObject *obj, void *closure)
44768 : {
44769 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj);
44770 0 : PyObject *py_system_name;
44771 0 : if (object->in.system_name == NULL) {
44772 0 : Py_RETURN_NONE;
44773 : }
44774 0 : if (object->in.system_name == NULL) {
44775 0 : py_system_name = Py_None;
44776 0 : Py_INCREF(py_system_name);
44777 : } else {
44778 0 : if (object->in.system_name == NULL) {
44779 0 : py_system_name = Py_None;
44780 0 : Py_INCREF(py_system_name);
44781 : } else {
44782 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
44783 : }
44784 : }
44785 0 : return py_system_name;
44786 : }
44787 :
44788 0 : static int py_samr_Connect2_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
44789 : {
44790 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
44791 0 : if (value == NULL) {
44792 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
44793 0 : return -1;
44794 : }
44795 0 : if (value == Py_None) {
44796 0 : object->in.system_name = NULL;
44797 : } else {
44798 0 : object->in.system_name = NULL;
44799 : {
44800 0 : const char *test_str;
44801 0 : const char *talloc_str;
44802 0 : PyObject *unicode = NULL;
44803 0 : if (PyUnicode_Check(value)) {
44804 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
44805 0 : if (unicode == NULL) {
44806 0 : return -1;
44807 : }
44808 0 : test_str = PyBytes_AS_STRING(unicode);
44809 0 : } else if (PyBytes_Check(value)) {
44810 0 : test_str = PyBytes_AS_STRING(value);
44811 : } else {
44812 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
44813 0 : return -1;
44814 : }
44815 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
44816 0 : if (unicode != NULL) {
44817 0 : Py_DECREF(unicode);
44818 : }
44819 0 : if (talloc_str == NULL) {
44820 0 : PyErr_NoMemory();
44821 0 : return -1;
44822 : }
44823 0 : object->in.system_name = talloc_str;
44824 : }
44825 : }
44826 0 : return 0;
44827 : }
44828 :
44829 0 : static PyObject *py_samr_Connect2_in_get_access_mask(PyObject *obj, void *closure)
44830 : {
44831 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj);
44832 0 : PyObject *py_access_mask;
44833 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
44834 0 : return py_access_mask;
44835 : }
44836 :
44837 0 : static int py_samr_Connect2_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
44838 : {
44839 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
44840 0 : if (value == NULL) {
44841 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
44842 0 : return -1;
44843 : }
44844 : {
44845 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
44846 0 : if (PyLong_Check(value)) {
44847 0 : unsigned long long test_var;
44848 0 : test_var = PyLong_AsUnsignedLongLong(value);
44849 0 : if (PyErr_Occurred() != NULL) {
44850 0 : return -1;
44851 : }
44852 0 : if (test_var > uint_max) {
44853 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
44854 : PyLong_Type.tp_name, uint_max, test_var);
44855 0 : return -1;
44856 : }
44857 0 : object->in.access_mask = test_var;
44858 : } else {
44859 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
44860 : PyLong_Type.tp_name);
44861 0 : return -1;
44862 : }
44863 : }
44864 0 : return 0;
44865 : }
44866 :
44867 0 : static PyObject *py_samr_Connect2_out_get_connect_handle(PyObject *obj, void *closure)
44868 : {
44869 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj);
44870 0 : PyObject *py_connect_handle;
44871 0 : if (object->out.connect_handle == NULL) {
44872 0 : Py_RETURN_NONE;
44873 : }
44874 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle);
44875 0 : return py_connect_handle;
44876 : }
44877 :
44878 0 : static int py_samr_Connect2_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
44879 : {
44880 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
44881 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle));
44882 0 : if (value == NULL) {
44883 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle");
44884 0 : return -1;
44885 : }
44886 0 : object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle);
44887 0 : if (object->out.connect_handle == NULL) {
44888 0 : PyErr_NoMemory();
44889 0 : return -1;
44890 : }
44891 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
44892 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
44893 0 : PyErr_NoMemory();
44894 0 : return -1;
44895 : }
44896 0 : object->out.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
44897 0 : return 0;
44898 : }
44899 :
44900 0 : static PyObject *py_samr_Connect2_get_result(PyObject *obj, void *closure)
44901 : {
44902 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(obj);
44903 0 : PyObject *py_result;
44904 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
44905 0 : return py_result;
44906 : }
44907 :
44908 0 : static int py_samr_Connect2_set_result(PyObject *py_obj, PyObject *value, void *closure)
44909 : {
44910 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
44911 0 : if (value == NULL) {
44912 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
44913 0 : return -1;
44914 : }
44915 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
44916 0 : return 0;
44917 : }
44918 :
44919 : static PyGetSetDef py_samr_Connect2_getsetters[] = {
44920 : {
44921 : .name = discard_const_p(char, "in_system_name"),
44922 : .get = py_samr_Connect2_in_get_system_name,
44923 : .set = py_samr_Connect2_in_set_system_name,
44924 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
44925 : },
44926 : {
44927 : .name = discard_const_p(char, "in_access_mask"),
44928 : .get = py_samr_Connect2_in_get_access_mask,
44929 : .set = py_samr_Connect2_in_set_access_mask,
44930 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask")
44931 : },
44932 : {
44933 : .name = discard_const_p(char, "out_connect_handle"),
44934 : .get = py_samr_Connect2_out_get_connect_handle,
44935 : .set = py_samr_Connect2_out_set_connect_handle,
44936 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
44937 : },
44938 : {
44939 : .name = discard_const_p(char, "result"),
44940 : .get = py_samr_Connect2_get_result,
44941 : .set = py_samr_Connect2_set_result,
44942 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
44943 : },
44944 : { .name = NULL }
44945 : };
44946 :
44947 0 : static PyObject *py_samr_Connect2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
44948 : {
44949 0 : PyObject *self = pytalloc_new(struct samr_Connect2, type);
44950 0 : struct samr_Connect2 *_self = (struct samr_Connect2 *)pytalloc_get_ptr(self);
44951 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
44952 0 : _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
44953 0 : return self;
44954 : }
44955 :
44956 0 : static PyObject *py_samr_Connect2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
44957 : {
44958 :
44959 :
44960 0 : return PyLong_FromLong(57);
44961 : }
44962 :
44963 0 : static PyObject *py_samr_Connect2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
44964 : {
44965 0 : const struct ndr_interface_call *call = NULL;
44966 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
44967 0 : PyObject *ret = NULL;
44968 0 : struct ndr_push *push = NULL;
44969 0 : DATA_BLOB blob;
44970 0 : enum ndr_err_code err;
44971 :
44972 0 : if (ndr_table_samr.num_calls < 58) {
44973 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_pack");
44974 0 : return NULL;
44975 : }
44976 0 : call = &ndr_table_samr.calls[57];
44977 :
44978 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
44979 0 : if (push == NULL) {
44980 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
44981 0 : return NULL;
44982 : }
44983 :
44984 0 : push->flags |= ndr_push_flags;
44985 :
44986 0 : err = call->ndr_push(push, ndr_inout_flags, object);
44987 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
44988 0 : TALLOC_FREE(push);
44989 0 : PyErr_SetNdrError(err);
44990 0 : return NULL;
44991 : }
44992 0 : blob = ndr_push_blob(push);
44993 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
44994 0 : TALLOC_FREE(push);
44995 0 : return ret;
44996 : }
44997 :
44998 0 : static PyObject *py_samr_Connect2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
44999 : {
45000 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45001 0 : PyObject *bigendian_obj = NULL;
45002 0 : PyObject *ndr64_obj = NULL;
45003 0 : libndr_flags ndr_push_flags = 0;
45004 :
45005 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45006 : discard_const_p(char *, kwnames),
45007 : &bigendian_obj,
45008 : &ndr64_obj)) {
45009 0 : return NULL;
45010 : }
45011 :
45012 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45013 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45014 : }
45015 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45016 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45017 : }
45018 :
45019 0 : return py_samr_Connect2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45020 : }
45021 :
45022 0 : static PyObject *py_samr_Connect2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45023 : {
45024 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45025 0 : PyObject *bigendian_obj = NULL;
45026 0 : PyObject *ndr64_obj = NULL;
45027 0 : libndr_flags ndr_push_flags = 0;
45028 :
45029 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45030 : discard_const_p(char *, kwnames),
45031 : &bigendian_obj,
45032 : &ndr64_obj)) {
45033 0 : return NULL;
45034 : }
45035 :
45036 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45037 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45038 : }
45039 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45040 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45041 : }
45042 :
45043 0 : return py_samr_Connect2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45044 : }
45045 :
45046 0 : static PyObject *py_samr_Connect2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
45047 : {
45048 0 : const struct ndr_interface_call *call = NULL;
45049 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
45050 0 : struct ndr_pull *pull = NULL;
45051 0 : enum ndr_err_code err;
45052 :
45053 0 : if (ndr_table_samr.num_calls < 58) {
45054 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_unpack");
45055 0 : return NULL;
45056 : }
45057 0 : call = &ndr_table_samr.calls[57];
45058 :
45059 0 : pull = ndr_pull_init_blob(blob, object);
45060 0 : if (pull == NULL) {
45061 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45062 0 : return NULL;
45063 : }
45064 :
45065 0 : pull->flags |= ndr_pull_flags;
45066 :
45067 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45068 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45069 0 : TALLOC_FREE(pull);
45070 0 : PyErr_SetNdrError(err);
45071 0 : return NULL;
45072 : }
45073 0 : if (!allow_remaining) {
45074 0 : uint32_t highest_ofs;
45075 :
45076 0 : if (pull->offset > pull->relative_highest_offset) {
45077 0 : highest_ofs = pull->offset;
45078 : } else {
45079 0 : highest_ofs = pull->relative_highest_offset;
45080 : }
45081 0 : if (highest_ofs < pull->data_size) {
45082 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45083 : "not all bytes consumed ofs[%u] size[%u]",
45084 : highest_ofs, pull->data_size);
45085 0 : TALLOC_FREE(pull);
45086 0 : PyErr_SetNdrError(err);
45087 0 : return NULL;
45088 : }
45089 : }
45090 :
45091 0 : TALLOC_FREE(pull);
45092 0 : Py_RETURN_NONE;
45093 : }
45094 :
45095 0 : static PyObject *py_samr_Connect2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45096 : {
45097 0 : DATA_BLOB blob;
45098 0 : Py_ssize_t blob_length = 0;
45099 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45100 0 : PyObject *bigendian_obj = NULL;
45101 0 : PyObject *ndr64_obj = NULL;
45102 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45103 0 : PyObject *allow_remaining_obj = NULL;
45104 0 : bool allow_remaining = false;
45105 :
45106 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45107 : discard_const_p(char *, kwnames),
45108 : &blob.data, &blob_length,
45109 : &bigendian_obj,
45110 : &ndr64_obj,
45111 : &allow_remaining_obj)) {
45112 0 : return NULL;
45113 : }
45114 0 : blob.length = blob_length;
45115 :
45116 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45117 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45118 : }
45119 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45120 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45121 : }
45122 :
45123 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45124 0 : allow_remaining = true;
45125 : }
45126 :
45127 0 : return py_samr_Connect2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45128 : }
45129 :
45130 0 : static PyObject *py_samr_Connect2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45131 : {
45132 0 : DATA_BLOB blob;
45133 0 : Py_ssize_t blob_length = 0;
45134 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45135 0 : PyObject *bigendian_obj = NULL;
45136 0 : PyObject *ndr64_obj = NULL;
45137 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45138 0 : PyObject *allow_remaining_obj = NULL;
45139 0 : bool allow_remaining = false;
45140 :
45141 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45142 : discard_const_p(char *, kwnames),
45143 : &blob.data, &blob_length,
45144 : &bigendian_obj,
45145 : &ndr64_obj,
45146 : &allow_remaining_obj)) {
45147 0 : return NULL;
45148 : }
45149 0 : blob.length = blob_length;
45150 :
45151 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45152 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45153 : }
45154 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45155 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45156 : }
45157 :
45158 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45159 0 : allow_remaining = true;
45160 : }
45161 :
45162 0 : return py_samr_Connect2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45163 : }
45164 :
45165 0 : static PyObject *py_samr_Connect2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45166 : {
45167 0 : const struct ndr_interface_call *call = NULL;
45168 0 : struct samr_Connect2 *object = (struct samr_Connect2 *)pytalloc_get_ptr(py_obj);
45169 0 : PyObject *ret;
45170 0 : char *retstr;
45171 :
45172 0 : if (ndr_table_samr.num_calls < 58) {
45173 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect2_ndr_print");
45174 0 : return NULL;
45175 : }
45176 0 : call = &ndr_table_samr.calls[57];
45177 :
45178 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45179 0 : ret = PyUnicode_FromString(retstr);
45180 0 : TALLOC_FREE(retstr);
45181 :
45182 0 : return ret;
45183 : }
45184 :
45185 0 : static PyObject *py_samr_Connect2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45186 : {
45187 0 : return py_samr_Connect2_ndr_print(py_obj, "samr_Connect2_in", NDR_IN);
45188 : }
45189 :
45190 0 : static PyObject *py_samr_Connect2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45191 : {
45192 0 : return py_samr_Connect2_ndr_print(py_obj, "samr_Connect2_out", NDR_OUT);
45193 : }
45194 :
45195 : static PyMethodDef py_samr_Connect2_methods[] = {
45196 : { "opnum", (PyCFunction)py_samr_Connect2_ndr_opnum, METH_NOARGS|METH_CLASS,
45197 : "samr.Connect2.opnum() -> 57 (0x39) " },
45198 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45199 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45200 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45201 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45202 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45203 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45204 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45205 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45206 : { "__ndr_print_in__", (PyCFunction)py_samr_Connect2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45207 : { "__ndr_print_out__", (PyCFunction)py_samr_Connect2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45208 : { NULL, NULL, 0, NULL }
45209 : };
45210 :
45211 :
45212 : static PyTypeObject samr_Connect2_Type = {
45213 : PyVarObject_HEAD_INIT(NULL, 0)
45214 : .tp_name = "samr.Connect2",
45215 : .tp_getset = py_samr_Connect2_getsetters,
45216 : .tp_methods = py_samr_Connect2_methods,
45217 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45218 : .tp_new = py_samr_Connect2_new,
45219 : };
45220 :
45221 467 : static bool pack_py_samr_Connect2_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect2 *r)
45222 : {
45223 0 : PyObject *py_system_name;
45224 0 : PyObject *py_access_mask;
45225 467 : const char *kwnames[] = {
45226 : "system_name", "access_mask", NULL
45227 : };
45228 :
45229 467 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect2", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
45230 0 : return false;
45231 : }
45232 :
45233 467 : if (py_system_name == NULL) {
45234 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
45235 0 : return false;
45236 : }
45237 467 : if (py_system_name == Py_None) {
45238 467 : r->in.system_name = NULL;
45239 : } else {
45240 0 : r->in.system_name = NULL;
45241 : {
45242 0 : const char *test_str;
45243 0 : const char *talloc_str;
45244 0 : PyObject *unicode = NULL;
45245 0 : if (PyUnicode_Check(py_system_name)) {
45246 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
45247 0 : if (unicode == NULL) {
45248 0 : return false;
45249 : }
45250 0 : test_str = PyBytes_AS_STRING(unicode);
45251 0 : } else if (PyBytes_Check(py_system_name)) {
45252 0 : test_str = PyBytes_AS_STRING(py_system_name);
45253 : } else {
45254 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
45255 0 : return false;
45256 : }
45257 0 : talloc_str = talloc_strdup(r, test_str);
45258 0 : if (unicode != NULL) {
45259 0 : Py_DECREF(unicode);
45260 : }
45261 0 : if (talloc_str == NULL) {
45262 0 : PyErr_NoMemory();
45263 0 : return false;
45264 : }
45265 0 : r->in.system_name = talloc_str;
45266 : }
45267 : }
45268 467 : if (py_access_mask == NULL) {
45269 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
45270 0 : return false;
45271 : }
45272 : {
45273 467 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
45274 467 : if (PyLong_Check(py_access_mask)) {
45275 0 : unsigned long long test_var;
45276 467 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
45277 467 : if (PyErr_Occurred() != NULL) {
45278 0 : return false;
45279 : }
45280 467 : if (test_var > uint_max) {
45281 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45282 : PyLong_Type.tp_name, uint_max, test_var);
45283 0 : return false;
45284 : }
45285 467 : r->in.access_mask = test_var;
45286 : } else {
45287 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45288 : PyLong_Type.tp_name);
45289 0 : return false;
45290 : }
45291 : }
45292 467 : return true;
45293 : }
45294 :
45295 467 : static PyObject *unpack_py_samr_Connect2_args_out(struct samr_Connect2 *r)
45296 : {
45297 0 : PyObject *result;
45298 0 : PyObject *py_connect_handle;
45299 467 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
45300 467 : result = py_connect_handle;
45301 467 : if (NT_STATUS_IS_ERR(r->out.result)) {
45302 0 : PyErr_SetNTSTATUS(r->out.result);
45303 0 : return NULL;
45304 : }
45305 :
45306 467 : return result;
45307 : }
45308 :
45309 :
45310 0 : static PyObject *py_samr_SetUserInfo2_in_get_user_handle(PyObject *obj, void *closure)
45311 : {
45312 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj);
45313 0 : PyObject *py_user_handle;
45314 0 : if (object->in.user_handle == NULL) {
45315 0 : Py_RETURN_NONE;
45316 : }
45317 0 : py_user_handle = pytalloc_reference_ex(policy_handle_Type, object->in.user_handle, object->in.user_handle);
45318 0 : return py_user_handle;
45319 : }
45320 :
45321 0 : static int py_samr_SetUserInfo2_in_set_user_handle(PyObject *py_obj, PyObject *value, void *closure)
45322 : {
45323 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45324 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.user_handle));
45325 0 : if (value == NULL) {
45326 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.user_handle");
45327 0 : return -1;
45328 : }
45329 0 : object->in.user_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.user_handle);
45330 0 : if (object->in.user_handle == NULL) {
45331 0 : PyErr_NoMemory();
45332 0 : return -1;
45333 : }
45334 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45335 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45336 0 : PyErr_NoMemory();
45337 0 : return -1;
45338 : }
45339 0 : object->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(value);
45340 0 : return 0;
45341 : }
45342 :
45343 0 : static PyObject *py_samr_SetUserInfo2_in_get_level(PyObject *obj, void *closure)
45344 : {
45345 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj);
45346 0 : PyObject *py_level;
45347 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
45348 0 : return py_level;
45349 : }
45350 :
45351 0 : static int py_samr_SetUserInfo2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
45352 : {
45353 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45354 0 : if (value == NULL) {
45355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
45356 0 : return -1;
45357 : }
45358 : {
45359 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
45360 0 : if (PyLong_Check(value)) {
45361 0 : unsigned long long test_var;
45362 0 : test_var = PyLong_AsUnsignedLongLong(value);
45363 0 : if (PyErr_Occurred() != NULL) {
45364 0 : return -1;
45365 : }
45366 0 : if (test_var > uint_max) {
45367 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45368 : PyLong_Type.tp_name, uint_max, test_var);
45369 0 : return -1;
45370 : }
45371 0 : object->in.level = test_var;
45372 : } else {
45373 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45374 : PyLong_Type.tp_name);
45375 0 : return -1;
45376 : }
45377 : }
45378 0 : return 0;
45379 : }
45380 :
45381 0 : static PyObject *py_samr_SetUserInfo2_in_get_info(PyObject *obj, void *closure)
45382 : {
45383 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj);
45384 0 : PyObject *py_info;
45385 0 : if (object->in.info == NULL) {
45386 0 : Py_RETURN_NONE;
45387 : }
45388 0 : py_info = pyrpc_import_union(&samr_UserInfo_Type, object->in.info, object->in.level, object->in.info, "union samr_UserInfo");
45389 0 : if (py_info == NULL) {
45390 0 : return NULL;
45391 : }
45392 0 : return py_info;
45393 : }
45394 :
45395 0 : static int py_samr_SetUserInfo2_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
45396 : {
45397 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45398 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info));
45399 0 : if (value == NULL) {
45400 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info");
45401 0 : return -1;
45402 : }
45403 0 : object->in.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info);
45404 0 : if (object->in.info == NULL) {
45405 0 : PyErr_NoMemory();
45406 0 : return -1;
45407 : }
45408 : {
45409 0 : union samr_UserInfo *info_switch_1;
45410 0 : info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_UserInfo");
45411 0 : if (info_switch_1 == NULL) {
45412 0 : return -1;
45413 : }
45414 0 : object->in.info = info_switch_1;
45415 : }
45416 0 : return 0;
45417 : }
45418 :
45419 0 : static PyObject *py_samr_SetUserInfo2_get_result(PyObject *obj, void *closure)
45420 : {
45421 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(obj);
45422 0 : PyObject *py_result;
45423 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45424 0 : return py_result;
45425 : }
45426 :
45427 0 : static int py_samr_SetUserInfo2_set_result(PyObject *py_obj, PyObject *value, void *closure)
45428 : {
45429 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45430 0 : if (value == NULL) {
45431 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45432 0 : return -1;
45433 : }
45434 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45435 0 : return 0;
45436 : }
45437 :
45438 : static PyGetSetDef py_samr_SetUserInfo2_getsetters[] = {
45439 : {
45440 : .name = discard_const_p(char, "in_user_handle"),
45441 : .get = py_samr_SetUserInfo2_in_get_user_handle,
45442 : .set = py_samr_SetUserInfo2_in_set_user_handle,
45443 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
45444 : },
45445 : {
45446 : .name = discard_const_p(char, "in_level"),
45447 : .get = py_samr_SetUserInfo2_in_get_level,
45448 : .set = py_samr_SetUserInfo2_in_set_level,
45449 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfoLevel")
45450 : },
45451 : {
45452 : .name = discard_const_p(char, "in_info"),
45453 : .get = py_samr_SetUserInfo2_in_get_info,
45454 : .set = py_samr_SetUserInfo2_in_set_info,
45455 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_UserInfo")
45456 : },
45457 : {
45458 : .name = discard_const_p(char, "result"),
45459 : .get = py_samr_SetUserInfo2_get_result,
45460 : .set = py_samr_SetUserInfo2_set_result,
45461 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
45462 : },
45463 : { .name = NULL }
45464 : };
45465 :
45466 0 : static PyObject *py_samr_SetUserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
45467 : {
45468 0 : PyObject *self = pytalloc_new(struct samr_SetUserInfo2, type);
45469 0 : struct samr_SetUserInfo2 *_self = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(self);
45470 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
45471 0 : _self->in.user_handle = talloc_zero(mem_ctx, struct policy_handle);
45472 0 : _self->in.info = talloc_zero(mem_ctx, union samr_UserInfo);
45473 0 : return self;
45474 : }
45475 :
45476 0 : static PyObject *py_samr_SetUserInfo2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
45477 : {
45478 :
45479 :
45480 0 : return PyLong_FromLong(58);
45481 : }
45482 :
45483 0 : static PyObject *py_samr_SetUserInfo2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
45484 : {
45485 0 : const struct ndr_interface_call *call = NULL;
45486 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45487 0 : PyObject *ret = NULL;
45488 0 : struct ndr_push *push = NULL;
45489 0 : DATA_BLOB blob;
45490 0 : enum ndr_err_code err;
45491 :
45492 0 : if (ndr_table_samr.num_calls < 59) {
45493 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_pack");
45494 0 : return NULL;
45495 : }
45496 0 : call = &ndr_table_samr.calls[58];
45497 :
45498 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
45499 0 : if (push == NULL) {
45500 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45501 0 : return NULL;
45502 : }
45503 :
45504 0 : push->flags |= ndr_push_flags;
45505 :
45506 0 : err = call->ndr_push(push, ndr_inout_flags, object);
45507 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45508 0 : TALLOC_FREE(push);
45509 0 : PyErr_SetNdrError(err);
45510 0 : return NULL;
45511 : }
45512 0 : blob = ndr_push_blob(push);
45513 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
45514 0 : TALLOC_FREE(push);
45515 0 : return ret;
45516 : }
45517 :
45518 0 : static PyObject *py_samr_SetUserInfo2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45519 : {
45520 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45521 0 : PyObject *bigendian_obj = NULL;
45522 0 : PyObject *ndr64_obj = NULL;
45523 0 : libndr_flags ndr_push_flags = 0;
45524 :
45525 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
45526 : discard_const_p(char *, kwnames),
45527 : &bigendian_obj,
45528 : &ndr64_obj)) {
45529 0 : return NULL;
45530 : }
45531 :
45532 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45533 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45534 : }
45535 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45536 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45537 : }
45538 :
45539 0 : return py_samr_SetUserInfo2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
45540 : }
45541 :
45542 0 : static PyObject *py_samr_SetUserInfo2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45543 : {
45544 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
45545 0 : PyObject *bigendian_obj = NULL;
45546 0 : PyObject *ndr64_obj = NULL;
45547 0 : libndr_flags ndr_push_flags = 0;
45548 :
45549 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
45550 : discard_const_p(char *, kwnames),
45551 : &bigendian_obj,
45552 : &ndr64_obj)) {
45553 0 : return NULL;
45554 : }
45555 :
45556 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45557 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
45558 : }
45559 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45560 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
45561 : }
45562 :
45563 0 : return py_samr_SetUserInfo2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
45564 : }
45565 :
45566 0 : static PyObject *py_samr_SetUserInfo2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
45567 : {
45568 0 : const struct ndr_interface_call *call = NULL;
45569 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45570 0 : struct ndr_pull *pull = NULL;
45571 0 : enum ndr_err_code err;
45572 :
45573 0 : if (ndr_table_samr.num_calls < 59) {
45574 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_unpack");
45575 0 : return NULL;
45576 : }
45577 0 : call = &ndr_table_samr.calls[58];
45578 :
45579 0 : pull = ndr_pull_init_blob(blob, object);
45580 0 : if (pull == NULL) {
45581 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
45582 0 : return NULL;
45583 : }
45584 :
45585 0 : pull->flags |= ndr_pull_flags;
45586 :
45587 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
45588 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
45589 0 : TALLOC_FREE(pull);
45590 0 : PyErr_SetNdrError(err);
45591 0 : return NULL;
45592 : }
45593 0 : if (!allow_remaining) {
45594 0 : uint32_t highest_ofs;
45595 :
45596 0 : if (pull->offset > pull->relative_highest_offset) {
45597 0 : highest_ofs = pull->offset;
45598 : } else {
45599 0 : highest_ofs = pull->relative_highest_offset;
45600 : }
45601 0 : if (highest_ofs < pull->data_size) {
45602 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
45603 : "not all bytes consumed ofs[%u] size[%u]",
45604 : highest_ofs, pull->data_size);
45605 0 : TALLOC_FREE(pull);
45606 0 : PyErr_SetNdrError(err);
45607 0 : return NULL;
45608 : }
45609 : }
45610 :
45611 0 : TALLOC_FREE(pull);
45612 0 : Py_RETURN_NONE;
45613 : }
45614 :
45615 0 : static PyObject *py_samr_SetUserInfo2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45616 : {
45617 0 : DATA_BLOB blob;
45618 0 : Py_ssize_t blob_length = 0;
45619 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45620 0 : PyObject *bigendian_obj = NULL;
45621 0 : PyObject *ndr64_obj = NULL;
45622 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45623 0 : PyObject *allow_remaining_obj = NULL;
45624 0 : bool allow_remaining = false;
45625 :
45626 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
45627 : discard_const_p(char *, kwnames),
45628 : &blob.data, &blob_length,
45629 : &bigendian_obj,
45630 : &ndr64_obj,
45631 : &allow_remaining_obj)) {
45632 0 : return NULL;
45633 : }
45634 0 : blob.length = blob_length;
45635 :
45636 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45637 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45638 : }
45639 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45640 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45641 : }
45642 :
45643 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45644 0 : allow_remaining = true;
45645 : }
45646 :
45647 0 : return py_samr_SetUserInfo2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
45648 : }
45649 :
45650 0 : static PyObject *py_samr_SetUserInfo2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
45651 : {
45652 0 : DATA_BLOB blob;
45653 0 : Py_ssize_t blob_length = 0;
45654 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
45655 0 : PyObject *bigendian_obj = NULL;
45656 0 : PyObject *ndr64_obj = NULL;
45657 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
45658 0 : PyObject *allow_remaining_obj = NULL;
45659 0 : bool allow_remaining = false;
45660 :
45661 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
45662 : discard_const_p(char *, kwnames),
45663 : &blob.data, &blob_length,
45664 : &bigendian_obj,
45665 : &ndr64_obj,
45666 : &allow_remaining_obj)) {
45667 0 : return NULL;
45668 : }
45669 0 : blob.length = blob_length;
45670 :
45671 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
45672 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
45673 : }
45674 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
45675 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
45676 : }
45677 :
45678 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
45679 0 : allow_remaining = true;
45680 : }
45681 :
45682 0 : return py_samr_SetUserInfo2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
45683 : }
45684 :
45685 0 : static PyObject *py_samr_SetUserInfo2_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
45686 : {
45687 0 : const struct ndr_interface_call *call = NULL;
45688 0 : struct samr_SetUserInfo2 *object = (struct samr_SetUserInfo2 *)pytalloc_get_ptr(py_obj);
45689 0 : PyObject *ret;
45690 0 : char *retstr;
45691 :
45692 0 : if (ndr_table_samr.num_calls < 59) {
45693 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetUserInfo2_ndr_print");
45694 0 : return NULL;
45695 : }
45696 0 : call = &ndr_table_samr.calls[58];
45697 :
45698 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
45699 0 : ret = PyUnicode_FromString(retstr);
45700 0 : TALLOC_FREE(retstr);
45701 :
45702 0 : return ret;
45703 : }
45704 :
45705 0 : static PyObject *py_samr_SetUserInfo2_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45706 : {
45707 0 : return py_samr_SetUserInfo2_ndr_print(py_obj, "samr_SetUserInfo2_in", NDR_IN);
45708 : }
45709 :
45710 0 : static PyObject *py_samr_SetUserInfo2_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
45711 : {
45712 0 : return py_samr_SetUserInfo2_ndr_print(py_obj, "samr_SetUserInfo2_out", NDR_OUT);
45713 : }
45714 :
45715 : static PyMethodDef py_samr_SetUserInfo2_methods[] = {
45716 : { "opnum", (PyCFunction)py_samr_SetUserInfo2_ndr_opnum, METH_NOARGS|METH_CLASS,
45717 : "samr.SetUserInfo2.opnum() -> 58 (0x3a) " },
45718 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
45719 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
45720 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
45721 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
45722 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
45723 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
45724 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetUserInfo2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
45725 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
45726 : { "__ndr_print_in__", (PyCFunction)py_samr_SetUserInfo2_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
45727 : { "__ndr_print_out__", (PyCFunction)py_samr_SetUserInfo2_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
45728 : { NULL, NULL, 0, NULL }
45729 : };
45730 :
45731 :
45732 : static PyTypeObject samr_SetUserInfo2_Type = {
45733 : PyVarObject_HEAD_INIT(NULL, 0)
45734 : .tp_name = "samr.SetUserInfo2",
45735 : .tp_getset = py_samr_SetUserInfo2_getsetters,
45736 : .tp_methods = py_samr_SetUserInfo2_methods,
45737 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
45738 : .tp_new = py_samr_SetUserInfo2_new,
45739 : };
45740 :
45741 4 : static bool pack_py_samr_SetUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo2 *r)
45742 : {
45743 0 : PyObject *py_user_handle;
45744 0 : PyObject *py_level;
45745 0 : PyObject *py_info;
45746 4 : const char *kwnames[] = {
45747 : "user_handle", "level", "info", NULL
45748 : };
45749 :
45750 4 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
45751 0 : return false;
45752 : }
45753 :
45754 4 : if (py_user_handle == NULL) {
45755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.user_handle");
45756 0 : return false;
45757 : }
45758 4 : r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
45759 4 : if (r->in.user_handle == NULL) {
45760 0 : PyErr_NoMemory();
45761 0 : return false;
45762 : }
45763 4 : PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
45764 4 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
45765 0 : PyErr_NoMemory();
45766 0 : return false;
45767 : }
45768 4 : r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
45769 4 : if (py_level == NULL) {
45770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
45771 0 : return false;
45772 : }
45773 : {
45774 4 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
45775 4 : if (PyLong_Check(py_level)) {
45776 0 : unsigned long long test_var;
45777 4 : test_var = PyLong_AsUnsignedLongLong(py_level);
45778 4 : if (PyErr_Occurred() != NULL) {
45779 0 : return false;
45780 : }
45781 4 : if (test_var > uint_max) {
45782 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45783 : PyLong_Type.tp_name, uint_max, test_var);
45784 0 : return false;
45785 : }
45786 4 : r->in.level = test_var;
45787 : } else {
45788 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45789 : PyLong_Type.tp_name);
45790 0 : return false;
45791 : }
45792 : }
45793 4 : if (py_info == NULL) {
45794 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info");
45795 0 : return false;
45796 : }
45797 4 : r->in.info = talloc_ptrtype(r, r->in.info);
45798 4 : if (r->in.info == NULL) {
45799 0 : PyErr_NoMemory();
45800 0 : return false;
45801 : }
45802 : {
45803 0 : union samr_UserInfo *info_switch_1;
45804 4 : info_switch_1 = (union samr_UserInfo *)pyrpc_export_union(&samr_UserInfo_Type, r, r->in.level, py_info, "union samr_UserInfo");
45805 4 : if (info_switch_1 == NULL) {
45806 0 : return false;
45807 : }
45808 4 : r->in.info = info_switch_1;
45809 : }
45810 4 : return true;
45811 : }
45812 :
45813 4 : static PyObject *unpack_py_samr_SetUserInfo2_args_out(struct samr_SetUserInfo2 *r)
45814 : {
45815 0 : PyObject *result;
45816 4 : result = Py_None;
45817 2 : Py_INCREF(result);
45818 4 : if (NT_STATUS_IS_ERR(r->out.result)) {
45819 0 : PyErr_SetNTSTATUS(r->out.result);
45820 0 : return NULL;
45821 : }
45822 :
45823 4 : return result;
45824 : }
45825 :
45826 :
45827 0 : static PyObject *py_samr_SetBootKeyInformation_in_get_connect_handle(PyObject *obj, void *closure)
45828 : {
45829 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj);
45830 0 : PyObject *py_connect_handle;
45831 0 : if (object->in.connect_handle == NULL) {
45832 0 : Py_RETURN_NONE;
45833 : }
45834 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->in.connect_handle, object->in.connect_handle);
45835 0 : return py_connect_handle;
45836 : }
45837 :
45838 0 : static int py_samr_SetBootKeyInformation_in_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
45839 : {
45840 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
45841 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.connect_handle));
45842 0 : if (value == NULL) {
45843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.connect_handle");
45844 0 : return -1;
45845 : }
45846 0 : object->in.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.connect_handle);
45847 0 : if (object->in.connect_handle == NULL) {
45848 0 : PyErr_NoMemory();
45849 0 : return -1;
45850 : }
45851 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
45852 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
45853 0 : PyErr_NoMemory();
45854 0 : return -1;
45855 : }
45856 0 : object->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
45857 0 : return 0;
45858 : }
45859 :
45860 0 : static PyObject *py_samr_SetBootKeyInformation_in_get_unknown1(PyObject *obj, void *closure)
45861 : {
45862 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj);
45863 0 : PyObject *py_unknown1;
45864 0 : py_unknown1 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown1);
45865 0 : return py_unknown1;
45866 : }
45867 :
45868 0 : static int py_samr_SetBootKeyInformation_in_set_unknown1(PyObject *py_obj, PyObject *value, void *closure)
45869 : {
45870 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
45871 0 : if (value == NULL) {
45872 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown1");
45873 0 : return -1;
45874 : }
45875 : {
45876 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown1));
45877 0 : if (PyLong_Check(value)) {
45878 0 : unsigned long long test_var;
45879 0 : test_var = PyLong_AsUnsignedLongLong(value);
45880 0 : if (PyErr_Occurred() != NULL) {
45881 0 : return -1;
45882 : }
45883 0 : if (test_var > uint_max) {
45884 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45885 : PyLong_Type.tp_name, uint_max, test_var);
45886 0 : return -1;
45887 : }
45888 0 : object->in.unknown1 = test_var;
45889 : } else {
45890 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45891 : PyLong_Type.tp_name);
45892 0 : return -1;
45893 : }
45894 : }
45895 0 : return 0;
45896 : }
45897 :
45898 0 : static PyObject *py_samr_SetBootKeyInformation_in_get_unknown2(PyObject *obj, void *closure)
45899 : {
45900 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj);
45901 0 : PyObject *py_unknown2;
45902 0 : py_unknown2 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown2);
45903 0 : return py_unknown2;
45904 : }
45905 :
45906 0 : static int py_samr_SetBootKeyInformation_in_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
45907 : {
45908 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
45909 0 : if (value == NULL) {
45910 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown2");
45911 0 : return -1;
45912 : }
45913 : {
45914 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown2));
45915 0 : if (PyLong_Check(value)) {
45916 0 : unsigned long long test_var;
45917 0 : test_var = PyLong_AsUnsignedLongLong(value);
45918 0 : if (PyErr_Occurred() != NULL) {
45919 0 : return -1;
45920 : }
45921 0 : if (test_var > uint_max) {
45922 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45923 : PyLong_Type.tp_name, uint_max, test_var);
45924 0 : return -1;
45925 : }
45926 0 : object->in.unknown2 = test_var;
45927 : } else {
45928 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45929 : PyLong_Type.tp_name);
45930 0 : return -1;
45931 : }
45932 : }
45933 0 : return 0;
45934 : }
45935 :
45936 0 : static PyObject *py_samr_SetBootKeyInformation_in_get_unknown3(PyObject *obj, void *closure)
45937 : {
45938 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj);
45939 0 : PyObject *py_unknown3;
45940 0 : py_unknown3 = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown3);
45941 0 : return py_unknown3;
45942 : }
45943 :
45944 0 : static int py_samr_SetBootKeyInformation_in_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
45945 : {
45946 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
45947 0 : if (value == NULL) {
45948 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown3");
45949 0 : return -1;
45950 : }
45951 : {
45952 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown3));
45953 0 : if (PyLong_Check(value)) {
45954 0 : unsigned long long test_var;
45955 0 : test_var = PyLong_AsUnsignedLongLong(value);
45956 0 : if (PyErr_Occurred() != NULL) {
45957 0 : return -1;
45958 : }
45959 0 : if (test_var > uint_max) {
45960 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
45961 : PyLong_Type.tp_name, uint_max, test_var);
45962 0 : return -1;
45963 : }
45964 0 : object->in.unknown3 = test_var;
45965 : } else {
45966 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
45967 : PyLong_Type.tp_name);
45968 0 : return -1;
45969 : }
45970 : }
45971 0 : return 0;
45972 : }
45973 :
45974 0 : static PyObject *py_samr_SetBootKeyInformation_get_result(PyObject *obj, void *closure)
45975 : {
45976 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(obj);
45977 0 : PyObject *py_result;
45978 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
45979 0 : return py_result;
45980 : }
45981 :
45982 0 : static int py_samr_SetBootKeyInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
45983 : {
45984 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
45985 0 : if (value == NULL) {
45986 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
45987 0 : return -1;
45988 : }
45989 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
45990 0 : return 0;
45991 : }
45992 :
45993 : static PyGetSetDef py_samr_SetBootKeyInformation_getsetters[] = {
45994 : {
45995 : .name = discard_const_p(char, "in_connect_handle"),
45996 : .get = py_samr_SetBootKeyInformation_in_get_connect_handle,
45997 : .set = py_samr_SetBootKeyInformation_in_set_connect_handle,
45998 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
45999 : },
46000 : {
46001 : .name = discard_const_p(char, "in_unknown1"),
46002 : .get = py_samr_SetBootKeyInformation_in_get_unknown1,
46003 : .set = py_samr_SetBootKeyInformation_in_set_unknown1,
46004 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46005 : },
46006 : {
46007 : .name = discard_const_p(char, "in_unknown2"),
46008 : .get = py_samr_SetBootKeyInformation_in_get_unknown2,
46009 : .set = py_samr_SetBootKeyInformation_in_set_unknown2,
46010 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46011 : },
46012 : {
46013 : .name = discard_const_p(char, "in_unknown3"),
46014 : .get = py_samr_SetBootKeyInformation_in_get_unknown3,
46015 : .set = py_samr_SetBootKeyInformation_in_set_unknown3,
46016 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46017 : },
46018 : {
46019 : .name = discard_const_p(char, "result"),
46020 : .get = py_samr_SetBootKeyInformation_get_result,
46021 : .set = py_samr_SetBootKeyInformation_set_result,
46022 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
46023 : },
46024 : { .name = NULL }
46025 : };
46026 :
46027 0 : static PyObject *py_samr_SetBootKeyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46028 : {
46029 0 : PyObject *self = pytalloc_new(struct samr_SetBootKeyInformation, type);
46030 0 : struct samr_SetBootKeyInformation *_self = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(self);
46031 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46032 0 : _self->in.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
46033 0 : return self;
46034 : }
46035 :
46036 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46037 : {
46038 :
46039 :
46040 0 : return PyLong_FromLong(59);
46041 : }
46042 :
46043 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
46044 : {
46045 0 : const struct ndr_interface_call *call = NULL;
46046 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46047 0 : PyObject *ret = NULL;
46048 0 : struct ndr_push *push = NULL;
46049 0 : DATA_BLOB blob;
46050 0 : enum ndr_err_code err;
46051 :
46052 0 : if (ndr_table_samr.num_calls < 60) {
46053 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_pack");
46054 0 : return NULL;
46055 : }
46056 0 : call = &ndr_table_samr.calls[59];
46057 :
46058 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46059 0 : if (push == NULL) {
46060 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46061 0 : return NULL;
46062 : }
46063 :
46064 0 : push->flags |= ndr_push_flags;
46065 :
46066 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46067 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46068 0 : TALLOC_FREE(push);
46069 0 : PyErr_SetNdrError(err);
46070 0 : return NULL;
46071 : }
46072 0 : blob = ndr_push_blob(push);
46073 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46074 0 : TALLOC_FREE(push);
46075 0 : return ret;
46076 : }
46077 :
46078 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46079 : {
46080 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46081 0 : PyObject *bigendian_obj = NULL;
46082 0 : PyObject *ndr64_obj = NULL;
46083 0 : libndr_flags ndr_push_flags = 0;
46084 :
46085 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46086 : discard_const_p(char *, kwnames),
46087 : &bigendian_obj,
46088 : &ndr64_obj)) {
46089 0 : return NULL;
46090 : }
46091 :
46092 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46093 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46094 : }
46095 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46096 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46097 : }
46098 :
46099 0 : return py_samr_SetBootKeyInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46100 : }
46101 :
46102 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46103 : {
46104 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46105 0 : PyObject *bigendian_obj = NULL;
46106 0 : PyObject *ndr64_obj = NULL;
46107 0 : libndr_flags ndr_push_flags = 0;
46108 :
46109 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46110 : discard_const_p(char *, kwnames),
46111 : &bigendian_obj,
46112 : &ndr64_obj)) {
46113 0 : return NULL;
46114 : }
46115 :
46116 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46117 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46118 : }
46119 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46120 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46121 : }
46122 :
46123 0 : return py_samr_SetBootKeyInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46124 : }
46125 :
46126 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
46127 : {
46128 0 : const struct ndr_interface_call *call = NULL;
46129 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46130 0 : struct ndr_pull *pull = NULL;
46131 0 : enum ndr_err_code err;
46132 :
46133 0 : if (ndr_table_samr.num_calls < 60) {
46134 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_unpack");
46135 0 : return NULL;
46136 : }
46137 0 : call = &ndr_table_samr.calls[59];
46138 :
46139 0 : pull = ndr_pull_init_blob(blob, object);
46140 0 : if (pull == NULL) {
46141 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46142 0 : return NULL;
46143 : }
46144 :
46145 0 : pull->flags |= ndr_pull_flags;
46146 :
46147 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46148 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46149 0 : TALLOC_FREE(pull);
46150 0 : PyErr_SetNdrError(err);
46151 0 : return NULL;
46152 : }
46153 0 : if (!allow_remaining) {
46154 0 : uint32_t highest_ofs;
46155 :
46156 0 : if (pull->offset > pull->relative_highest_offset) {
46157 0 : highest_ofs = pull->offset;
46158 : } else {
46159 0 : highest_ofs = pull->relative_highest_offset;
46160 : }
46161 0 : if (highest_ofs < pull->data_size) {
46162 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46163 : "not all bytes consumed ofs[%u] size[%u]",
46164 : highest_ofs, pull->data_size);
46165 0 : TALLOC_FREE(pull);
46166 0 : PyErr_SetNdrError(err);
46167 0 : return NULL;
46168 : }
46169 : }
46170 :
46171 0 : TALLOC_FREE(pull);
46172 0 : Py_RETURN_NONE;
46173 : }
46174 :
46175 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46176 : {
46177 0 : DATA_BLOB blob;
46178 0 : Py_ssize_t blob_length = 0;
46179 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46180 0 : PyObject *bigendian_obj = NULL;
46181 0 : PyObject *ndr64_obj = NULL;
46182 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46183 0 : PyObject *allow_remaining_obj = NULL;
46184 0 : bool allow_remaining = false;
46185 :
46186 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46187 : discard_const_p(char *, kwnames),
46188 : &blob.data, &blob_length,
46189 : &bigendian_obj,
46190 : &ndr64_obj,
46191 : &allow_remaining_obj)) {
46192 0 : return NULL;
46193 : }
46194 0 : blob.length = blob_length;
46195 :
46196 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46197 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46198 : }
46199 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46200 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46201 : }
46202 :
46203 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46204 0 : allow_remaining = true;
46205 : }
46206 :
46207 0 : return py_samr_SetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46208 : }
46209 :
46210 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46211 : {
46212 0 : DATA_BLOB blob;
46213 0 : Py_ssize_t blob_length = 0;
46214 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46215 0 : PyObject *bigendian_obj = NULL;
46216 0 : PyObject *ndr64_obj = NULL;
46217 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46218 0 : PyObject *allow_remaining_obj = NULL;
46219 0 : bool allow_remaining = false;
46220 :
46221 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46222 : discard_const_p(char *, kwnames),
46223 : &blob.data, &blob_length,
46224 : &bigendian_obj,
46225 : &ndr64_obj,
46226 : &allow_remaining_obj)) {
46227 0 : return NULL;
46228 : }
46229 0 : blob.length = blob_length;
46230 :
46231 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46232 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46233 : }
46234 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46235 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46236 : }
46237 :
46238 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46239 0 : allow_remaining = true;
46240 : }
46241 :
46242 0 : return py_samr_SetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46243 : }
46244 :
46245 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46246 : {
46247 0 : const struct ndr_interface_call *call = NULL;
46248 0 : struct samr_SetBootKeyInformation *object = (struct samr_SetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46249 0 : PyObject *ret;
46250 0 : char *retstr;
46251 :
46252 0 : if (ndr_table_samr.num_calls < 60) {
46253 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetBootKeyInformation_ndr_print");
46254 0 : return NULL;
46255 : }
46256 0 : call = &ndr_table_samr.calls[59];
46257 :
46258 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46259 0 : ret = PyUnicode_FromString(retstr);
46260 0 : TALLOC_FREE(retstr);
46261 :
46262 0 : return ret;
46263 : }
46264 :
46265 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46266 : {
46267 0 : return py_samr_SetBootKeyInformation_ndr_print(py_obj, "samr_SetBootKeyInformation_in", NDR_IN);
46268 : }
46269 :
46270 0 : static PyObject *py_samr_SetBootKeyInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46271 : {
46272 0 : return py_samr_SetBootKeyInformation_ndr_print(py_obj, "samr_SetBootKeyInformation_out", NDR_OUT);
46273 : }
46274 :
46275 : static PyMethodDef py_samr_SetBootKeyInformation_methods[] = {
46276 : { "opnum", (PyCFunction)py_samr_SetBootKeyInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
46277 : "samr.SetBootKeyInformation.opnum() -> 59 (0x3b) " },
46278 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetBootKeyInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46279 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46280 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetBootKeyInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46281 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46282 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetBootKeyInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46283 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46284 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetBootKeyInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46285 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46286 : { "__ndr_print_in__", (PyCFunction)py_samr_SetBootKeyInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46287 : { "__ndr_print_out__", (PyCFunction)py_samr_SetBootKeyInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46288 : { NULL, NULL, 0, NULL }
46289 : };
46290 :
46291 :
46292 : static PyTypeObject samr_SetBootKeyInformation_Type = {
46293 : PyVarObject_HEAD_INIT(NULL, 0)
46294 : .tp_name = "samr.SetBootKeyInformation",
46295 : .tp_getset = py_samr_SetBootKeyInformation_getsetters,
46296 : .tp_methods = py_samr_SetBootKeyInformation_methods,
46297 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46298 : .tp_new = py_samr_SetBootKeyInformation_new,
46299 : };
46300 :
46301 0 : static bool pack_py_samr_SetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_SetBootKeyInformation *r)
46302 : {
46303 0 : PyObject *py_connect_handle;
46304 0 : PyObject *py_unknown1;
46305 0 : PyObject *py_unknown2;
46306 0 : PyObject *py_unknown3;
46307 0 : const char *kwnames[] = {
46308 : "connect_handle", "unknown1", "unknown2", "unknown3", NULL
46309 : };
46310 :
46311 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_SetBootKeyInformation", discard_const_p(char *, kwnames), &py_connect_handle, &py_unknown1, &py_unknown2, &py_unknown3)) {
46312 0 : return false;
46313 : }
46314 :
46315 0 : if (py_connect_handle == NULL) {
46316 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.connect_handle");
46317 0 : return false;
46318 : }
46319 0 : r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
46320 0 : if (r->in.connect_handle == NULL) {
46321 0 : PyErr_NoMemory();
46322 0 : return false;
46323 : }
46324 0 : PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
46325 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
46326 0 : PyErr_NoMemory();
46327 0 : return false;
46328 : }
46329 0 : r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
46330 0 : if (py_unknown1 == NULL) {
46331 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown1");
46332 0 : return false;
46333 : }
46334 : {
46335 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown1));
46336 0 : if (PyLong_Check(py_unknown1)) {
46337 0 : unsigned long long test_var;
46338 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown1);
46339 0 : if (PyErr_Occurred() != NULL) {
46340 0 : return false;
46341 : }
46342 0 : if (test_var > uint_max) {
46343 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46344 : PyLong_Type.tp_name, uint_max, test_var);
46345 0 : return false;
46346 : }
46347 0 : r->in.unknown1 = test_var;
46348 : } else {
46349 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46350 : PyLong_Type.tp_name);
46351 0 : return false;
46352 : }
46353 : }
46354 0 : if (py_unknown2 == NULL) {
46355 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown2");
46356 0 : return false;
46357 : }
46358 : {
46359 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown2));
46360 0 : if (PyLong_Check(py_unknown2)) {
46361 0 : unsigned long long test_var;
46362 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown2);
46363 0 : if (PyErr_Occurred() != NULL) {
46364 0 : return false;
46365 : }
46366 0 : if (test_var > uint_max) {
46367 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46368 : PyLong_Type.tp_name, uint_max, test_var);
46369 0 : return false;
46370 : }
46371 0 : r->in.unknown2 = test_var;
46372 : } else {
46373 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46374 : PyLong_Type.tp_name);
46375 0 : return false;
46376 : }
46377 : }
46378 0 : if (py_unknown3 == NULL) {
46379 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown3");
46380 0 : return false;
46381 : }
46382 : {
46383 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown3));
46384 0 : if (PyLong_Check(py_unknown3)) {
46385 0 : unsigned long long test_var;
46386 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown3);
46387 0 : if (PyErr_Occurred() != NULL) {
46388 0 : return false;
46389 : }
46390 0 : if (test_var > uint_max) {
46391 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46392 : PyLong_Type.tp_name, uint_max, test_var);
46393 0 : return false;
46394 : }
46395 0 : r->in.unknown3 = test_var;
46396 : } else {
46397 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46398 : PyLong_Type.tp_name);
46399 0 : return false;
46400 : }
46401 : }
46402 0 : return true;
46403 : }
46404 :
46405 0 : static PyObject *unpack_py_samr_SetBootKeyInformation_args_out(struct samr_SetBootKeyInformation *r)
46406 : {
46407 0 : PyObject *result;
46408 0 : result = Py_None;
46409 0 : Py_INCREF(result);
46410 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
46411 0 : PyErr_SetNTSTATUS(r->out.result);
46412 0 : return NULL;
46413 : }
46414 :
46415 0 : return result;
46416 : }
46417 :
46418 :
46419 0 : static PyObject *py_samr_GetBootKeyInformation_in_get_domain_handle(PyObject *obj, void *closure)
46420 : {
46421 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj);
46422 0 : PyObject *py_domain_handle;
46423 0 : if (object->in.domain_handle == NULL) {
46424 0 : Py_RETURN_NONE;
46425 : }
46426 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
46427 0 : return py_domain_handle;
46428 : }
46429 :
46430 0 : static int py_samr_GetBootKeyInformation_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
46431 : {
46432 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46433 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
46434 0 : if (value == NULL) {
46435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
46436 0 : return -1;
46437 : }
46438 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
46439 0 : if (object->in.domain_handle == NULL) {
46440 0 : PyErr_NoMemory();
46441 0 : return -1;
46442 : }
46443 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
46444 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
46445 0 : PyErr_NoMemory();
46446 0 : return -1;
46447 : }
46448 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
46449 0 : return 0;
46450 : }
46451 :
46452 0 : static PyObject *py_samr_GetBootKeyInformation_out_get_unknown(PyObject *obj, void *closure)
46453 : {
46454 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj);
46455 0 : PyObject *py_unknown;
46456 0 : if (object->out.unknown == NULL) {
46457 0 : Py_RETURN_NONE;
46458 : }
46459 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)*object->out.unknown);
46460 0 : return py_unknown;
46461 : }
46462 :
46463 0 : static int py_samr_GetBootKeyInformation_out_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
46464 : {
46465 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46466 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.unknown));
46467 0 : if (value == NULL) {
46468 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.unknown");
46469 0 : return -1;
46470 : }
46471 0 : object->out.unknown = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.unknown);
46472 0 : if (object->out.unknown == NULL) {
46473 0 : PyErr_NoMemory();
46474 0 : return -1;
46475 : }
46476 : {
46477 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.unknown));
46478 0 : if (PyLong_Check(value)) {
46479 0 : unsigned long long test_var;
46480 0 : test_var = PyLong_AsUnsignedLongLong(value);
46481 0 : if (PyErr_Occurred() != NULL) {
46482 0 : return -1;
46483 : }
46484 0 : if (test_var > uint_max) {
46485 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46486 : PyLong_Type.tp_name, uint_max, test_var);
46487 0 : return -1;
46488 : }
46489 0 : *object->out.unknown = test_var;
46490 : } else {
46491 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46492 : PyLong_Type.tp_name);
46493 0 : return -1;
46494 : }
46495 : }
46496 0 : return 0;
46497 : }
46498 :
46499 0 : static PyObject *py_samr_GetBootKeyInformation_get_result(PyObject *obj, void *closure)
46500 : {
46501 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(obj);
46502 0 : PyObject *py_result;
46503 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
46504 0 : return py_result;
46505 : }
46506 :
46507 0 : static int py_samr_GetBootKeyInformation_set_result(PyObject *py_obj, PyObject *value, void *closure)
46508 : {
46509 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46510 0 : if (value == NULL) {
46511 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
46512 0 : return -1;
46513 : }
46514 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
46515 0 : return 0;
46516 : }
46517 :
46518 : static PyGetSetDef py_samr_GetBootKeyInformation_getsetters[] = {
46519 : {
46520 : .name = discard_const_p(char, "in_domain_handle"),
46521 : .get = py_samr_GetBootKeyInformation_in_get_domain_handle,
46522 : .set = py_samr_GetBootKeyInformation_in_set_domain_handle,
46523 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
46524 : },
46525 : {
46526 : .name = discard_const_p(char, "out_unknown"),
46527 : .get = py_samr_GetBootKeyInformation_out_get_unknown,
46528 : .set = py_samr_GetBootKeyInformation_out_set_unknown,
46529 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
46530 : },
46531 : {
46532 : .name = discard_const_p(char, "result"),
46533 : .get = py_samr_GetBootKeyInformation_get_result,
46534 : .set = py_samr_GetBootKeyInformation_set_result,
46535 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
46536 : },
46537 : { .name = NULL }
46538 : };
46539 :
46540 0 : static PyObject *py_samr_GetBootKeyInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
46541 : {
46542 0 : PyObject *self = pytalloc_new(struct samr_GetBootKeyInformation, type);
46543 0 : struct samr_GetBootKeyInformation *_self = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(self);
46544 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
46545 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
46546 0 : _self->out.unknown = talloc_zero(mem_ctx, uint32_t);
46547 0 : return self;
46548 : }
46549 :
46550 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
46551 : {
46552 :
46553 :
46554 0 : return PyLong_FromLong(60);
46555 : }
46556 :
46557 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
46558 : {
46559 0 : const struct ndr_interface_call *call = NULL;
46560 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46561 0 : PyObject *ret = NULL;
46562 0 : struct ndr_push *push = NULL;
46563 0 : DATA_BLOB blob;
46564 0 : enum ndr_err_code err;
46565 :
46566 0 : if (ndr_table_samr.num_calls < 61) {
46567 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_pack");
46568 0 : return NULL;
46569 : }
46570 0 : call = &ndr_table_samr.calls[60];
46571 :
46572 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
46573 0 : if (push == NULL) {
46574 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46575 0 : return NULL;
46576 : }
46577 :
46578 0 : push->flags |= ndr_push_flags;
46579 :
46580 0 : err = call->ndr_push(push, ndr_inout_flags, object);
46581 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46582 0 : TALLOC_FREE(push);
46583 0 : PyErr_SetNdrError(err);
46584 0 : return NULL;
46585 : }
46586 0 : blob = ndr_push_blob(push);
46587 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
46588 0 : TALLOC_FREE(push);
46589 0 : return ret;
46590 : }
46591 :
46592 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46593 : {
46594 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46595 0 : PyObject *bigendian_obj = NULL;
46596 0 : PyObject *ndr64_obj = NULL;
46597 0 : libndr_flags ndr_push_flags = 0;
46598 :
46599 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
46600 : discard_const_p(char *, kwnames),
46601 : &bigendian_obj,
46602 : &ndr64_obj)) {
46603 0 : return NULL;
46604 : }
46605 :
46606 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46607 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46608 : }
46609 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46610 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46611 : }
46612 :
46613 0 : return py_samr_GetBootKeyInformation_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
46614 : }
46615 :
46616 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46617 : {
46618 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
46619 0 : PyObject *bigendian_obj = NULL;
46620 0 : PyObject *ndr64_obj = NULL;
46621 0 : libndr_flags ndr_push_flags = 0;
46622 :
46623 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
46624 : discard_const_p(char *, kwnames),
46625 : &bigendian_obj,
46626 : &ndr64_obj)) {
46627 0 : return NULL;
46628 : }
46629 :
46630 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46631 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
46632 : }
46633 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46634 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
46635 : }
46636 :
46637 0 : return py_samr_GetBootKeyInformation_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
46638 : }
46639 :
46640 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
46641 : {
46642 0 : const struct ndr_interface_call *call = NULL;
46643 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46644 0 : struct ndr_pull *pull = NULL;
46645 0 : enum ndr_err_code err;
46646 :
46647 0 : if (ndr_table_samr.num_calls < 61) {
46648 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_unpack");
46649 0 : return NULL;
46650 : }
46651 0 : call = &ndr_table_samr.calls[60];
46652 :
46653 0 : pull = ndr_pull_init_blob(blob, object);
46654 0 : if (pull == NULL) {
46655 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
46656 0 : return NULL;
46657 : }
46658 :
46659 0 : pull->flags |= ndr_pull_flags;
46660 :
46661 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
46662 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
46663 0 : TALLOC_FREE(pull);
46664 0 : PyErr_SetNdrError(err);
46665 0 : return NULL;
46666 : }
46667 0 : if (!allow_remaining) {
46668 0 : uint32_t highest_ofs;
46669 :
46670 0 : if (pull->offset > pull->relative_highest_offset) {
46671 0 : highest_ofs = pull->offset;
46672 : } else {
46673 0 : highest_ofs = pull->relative_highest_offset;
46674 : }
46675 0 : if (highest_ofs < pull->data_size) {
46676 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
46677 : "not all bytes consumed ofs[%u] size[%u]",
46678 : highest_ofs, pull->data_size);
46679 0 : TALLOC_FREE(pull);
46680 0 : PyErr_SetNdrError(err);
46681 0 : return NULL;
46682 : }
46683 : }
46684 :
46685 0 : TALLOC_FREE(pull);
46686 0 : Py_RETURN_NONE;
46687 : }
46688 :
46689 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46690 : {
46691 0 : DATA_BLOB blob;
46692 0 : Py_ssize_t blob_length = 0;
46693 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46694 0 : PyObject *bigendian_obj = NULL;
46695 0 : PyObject *ndr64_obj = NULL;
46696 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46697 0 : PyObject *allow_remaining_obj = NULL;
46698 0 : bool allow_remaining = false;
46699 :
46700 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
46701 : discard_const_p(char *, kwnames),
46702 : &blob.data, &blob_length,
46703 : &bigendian_obj,
46704 : &ndr64_obj,
46705 : &allow_remaining_obj)) {
46706 0 : return NULL;
46707 : }
46708 0 : blob.length = blob_length;
46709 :
46710 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46711 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46712 : }
46713 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46714 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46715 : }
46716 :
46717 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46718 0 : allow_remaining = true;
46719 : }
46720 :
46721 0 : return py_samr_GetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
46722 : }
46723 :
46724 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
46725 : {
46726 0 : DATA_BLOB blob;
46727 0 : Py_ssize_t blob_length = 0;
46728 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
46729 0 : PyObject *bigendian_obj = NULL;
46730 0 : PyObject *ndr64_obj = NULL;
46731 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
46732 0 : PyObject *allow_remaining_obj = NULL;
46733 0 : bool allow_remaining = false;
46734 :
46735 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
46736 : discard_const_p(char *, kwnames),
46737 : &blob.data, &blob_length,
46738 : &bigendian_obj,
46739 : &ndr64_obj,
46740 : &allow_remaining_obj)) {
46741 0 : return NULL;
46742 : }
46743 0 : blob.length = blob_length;
46744 :
46745 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
46746 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
46747 : }
46748 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
46749 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
46750 : }
46751 :
46752 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
46753 0 : allow_remaining = true;
46754 : }
46755 :
46756 0 : return py_samr_GetBootKeyInformation_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
46757 : }
46758 :
46759 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
46760 : {
46761 0 : const struct ndr_interface_call *call = NULL;
46762 0 : struct samr_GetBootKeyInformation *object = (struct samr_GetBootKeyInformation *)pytalloc_get_ptr(py_obj);
46763 0 : PyObject *ret;
46764 0 : char *retstr;
46765 :
46766 0 : if (ndr_table_samr.num_calls < 61) {
46767 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_GetBootKeyInformation_ndr_print");
46768 0 : return NULL;
46769 : }
46770 0 : call = &ndr_table_samr.calls[60];
46771 :
46772 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
46773 0 : ret = PyUnicode_FromString(retstr);
46774 0 : TALLOC_FREE(retstr);
46775 :
46776 0 : return ret;
46777 : }
46778 :
46779 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46780 : {
46781 0 : return py_samr_GetBootKeyInformation_ndr_print(py_obj, "samr_GetBootKeyInformation_in", NDR_IN);
46782 : }
46783 :
46784 0 : static PyObject *py_samr_GetBootKeyInformation_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
46785 : {
46786 0 : return py_samr_GetBootKeyInformation_ndr_print(py_obj, "samr_GetBootKeyInformation_out", NDR_OUT);
46787 : }
46788 :
46789 : static PyMethodDef py_samr_GetBootKeyInformation_methods[] = {
46790 : { "opnum", (PyCFunction)py_samr_GetBootKeyInformation_ndr_opnum, METH_NOARGS|METH_CLASS,
46791 : "samr.GetBootKeyInformation.opnum() -> 60 (0x3c) " },
46792 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetBootKeyInformation_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
46793 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
46794 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetBootKeyInformation_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
46795 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
46796 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetBootKeyInformation_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
46797 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
46798 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_GetBootKeyInformation_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
46799 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
46800 : { "__ndr_print_in__", (PyCFunction)py_samr_GetBootKeyInformation_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
46801 : { "__ndr_print_out__", (PyCFunction)py_samr_GetBootKeyInformation_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
46802 : { NULL, NULL, 0, NULL }
46803 : };
46804 :
46805 :
46806 : static PyTypeObject samr_GetBootKeyInformation_Type = {
46807 : PyVarObject_HEAD_INIT(NULL, 0)
46808 : .tp_name = "samr.GetBootKeyInformation",
46809 : .tp_getset = py_samr_GetBootKeyInformation_getsetters,
46810 : .tp_methods = py_samr_GetBootKeyInformation_methods,
46811 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
46812 : .tp_new = py_samr_GetBootKeyInformation_new,
46813 : };
46814 :
46815 0 : static bool pack_py_samr_GetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_GetBootKeyInformation *r)
46816 : {
46817 0 : PyObject *py_domain_handle;
46818 0 : const char *kwnames[] = {
46819 : "domain_handle", NULL
46820 : };
46821 :
46822 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetBootKeyInformation", discard_const_p(char *, kwnames), &py_domain_handle)) {
46823 0 : return false;
46824 : }
46825 :
46826 0 : if (py_domain_handle == NULL) {
46827 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
46828 0 : return false;
46829 : }
46830 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
46831 0 : if (r->in.domain_handle == NULL) {
46832 0 : PyErr_NoMemory();
46833 0 : return false;
46834 : }
46835 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
46836 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
46837 0 : PyErr_NoMemory();
46838 0 : return false;
46839 : }
46840 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
46841 0 : return true;
46842 : }
46843 :
46844 0 : static PyObject *unpack_py_samr_GetBootKeyInformation_args_out(struct samr_GetBootKeyInformation *r)
46845 : {
46846 0 : PyObject *result;
46847 0 : PyObject *py_unknown;
46848 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)*r->out.unknown);
46849 0 : result = py_unknown;
46850 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
46851 0 : PyErr_SetNTSTATUS(r->out.result);
46852 0 : return NULL;
46853 : }
46854 :
46855 0 : return result;
46856 : }
46857 :
46858 :
46859 0 : static PyObject *py_samr_Connect3_in_get_system_name(PyObject *obj, void *closure)
46860 : {
46861 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj);
46862 0 : PyObject *py_system_name;
46863 0 : if (object->in.system_name == NULL) {
46864 0 : Py_RETURN_NONE;
46865 : }
46866 0 : if (object->in.system_name == NULL) {
46867 0 : py_system_name = Py_None;
46868 0 : Py_INCREF(py_system_name);
46869 : } else {
46870 0 : if (object->in.system_name == NULL) {
46871 0 : py_system_name = Py_None;
46872 0 : Py_INCREF(py_system_name);
46873 : } else {
46874 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
46875 : }
46876 : }
46877 0 : return py_system_name;
46878 : }
46879 :
46880 0 : static int py_samr_Connect3_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
46881 : {
46882 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
46883 0 : if (value == NULL) {
46884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
46885 0 : return -1;
46886 : }
46887 0 : if (value == Py_None) {
46888 0 : object->in.system_name = NULL;
46889 : } else {
46890 0 : object->in.system_name = NULL;
46891 : {
46892 0 : const char *test_str;
46893 0 : const char *talloc_str;
46894 0 : PyObject *unicode = NULL;
46895 0 : if (PyUnicode_Check(value)) {
46896 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
46897 0 : if (unicode == NULL) {
46898 0 : return -1;
46899 : }
46900 0 : test_str = PyBytes_AS_STRING(unicode);
46901 0 : } else if (PyBytes_Check(value)) {
46902 0 : test_str = PyBytes_AS_STRING(value);
46903 : } else {
46904 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
46905 0 : return -1;
46906 : }
46907 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
46908 0 : if (unicode != NULL) {
46909 0 : Py_DECREF(unicode);
46910 : }
46911 0 : if (talloc_str == NULL) {
46912 0 : PyErr_NoMemory();
46913 0 : return -1;
46914 : }
46915 0 : object->in.system_name = talloc_str;
46916 : }
46917 : }
46918 0 : return 0;
46919 : }
46920 :
46921 0 : static PyObject *py_samr_Connect3_in_get_unknown(PyObject *obj, void *closure)
46922 : {
46923 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj);
46924 0 : PyObject *py_unknown;
46925 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown);
46926 0 : return py_unknown;
46927 : }
46928 :
46929 0 : static int py_samr_Connect3_in_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
46930 : {
46931 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
46932 0 : if (value == NULL) {
46933 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown");
46934 0 : return -1;
46935 : }
46936 : {
46937 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown));
46938 0 : if (PyLong_Check(value)) {
46939 0 : unsigned long long test_var;
46940 0 : test_var = PyLong_AsUnsignedLongLong(value);
46941 0 : if (PyErr_Occurred() != NULL) {
46942 0 : return -1;
46943 : }
46944 0 : if (test_var > uint_max) {
46945 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46946 : PyLong_Type.tp_name, uint_max, test_var);
46947 0 : return -1;
46948 : }
46949 0 : object->in.unknown = test_var;
46950 : } else {
46951 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46952 : PyLong_Type.tp_name);
46953 0 : return -1;
46954 : }
46955 : }
46956 0 : return 0;
46957 : }
46958 :
46959 0 : static PyObject *py_samr_Connect3_in_get_access_mask(PyObject *obj, void *closure)
46960 : {
46961 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj);
46962 0 : PyObject *py_access_mask;
46963 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
46964 0 : return py_access_mask;
46965 : }
46966 :
46967 0 : static int py_samr_Connect3_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
46968 : {
46969 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
46970 0 : if (value == NULL) {
46971 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
46972 0 : return -1;
46973 : }
46974 : {
46975 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
46976 0 : if (PyLong_Check(value)) {
46977 0 : unsigned long long test_var;
46978 0 : test_var = PyLong_AsUnsignedLongLong(value);
46979 0 : if (PyErr_Occurred() != NULL) {
46980 0 : return -1;
46981 : }
46982 0 : if (test_var > uint_max) {
46983 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
46984 : PyLong_Type.tp_name, uint_max, test_var);
46985 0 : return -1;
46986 : }
46987 0 : object->in.access_mask = test_var;
46988 : } else {
46989 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
46990 : PyLong_Type.tp_name);
46991 0 : return -1;
46992 : }
46993 : }
46994 0 : return 0;
46995 : }
46996 :
46997 0 : static PyObject *py_samr_Connect3_out_get_connect_handle(PyObject *obj, void *closure)
46998 : {
46999 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj);
47000 0 : PyObject *py_connect_handle;
47001 0 : if (object->out.connect_handle == NULL) {
47002 0 : Py_RETURN_NONE;
47003 : }
47004 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle);
47005 0 : return py_connect_handle;
47006 : }
47007 :
47008 0 : static int py_samr_Connect3_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
47009 : {
47010 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
47011 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle));
47012 0 : if (value == NULL) {
47013 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle");
47014 0 : return -1;
47015 : }
47016 0 : object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle);
47017 0 : if (object->out.connect_handle == NULL) {
47018 0 : PyErr_NoMemory();
47019 0 : return -1;
47020 : }
47021 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
47022 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47023 0 : PyErr_NoMemory();
47024 0 : return -1;
47025 : }
47026 0 : object->out.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
47027 0 : return 0;
47028 : }
47029 :
47030 0 : static PyObject *py_samr_Connect3_get_result(PyObject *obj, void *closure)
47031 : {
47032 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(obj);
47033 0 : PyObject *py_result;
47034 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
47035 0 : return py_result;
47036 : }
47037 :
47038 0 : static int py_samr_Connect3_set_result(PyObject *py_obj, PyObject *value, void *closure)
47039 : {
47040 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
47041 0 : if (value == NULL) {
47042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
47043 0 : return -1;
47044 : }
47045 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
47046 0 : return 0;
47047 : }
47048 :
47049 : static PyGetSetDef py_samr_Connect3_getsetters[] = {
47050 : {
47051 : .name = discard_const_p(char, "in_system_name"),
47052 : .get = py_samr_Connect3_in_get_system_name,
47053 : .set = py_samr_Connect3_in_set_system_name,
47054 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47055 : },
47056 : {
47057 : .name = discard_const_p(char, "in_unknown"),
47058 : .get = py_samr_Connect3_in_get_unknown,
47059 : .set = py_samr_Connect3_in_set_unknown,
47060 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
47061 : },
47062 : {
47063 : .name = discard_const_p(char, "in_access_mask"),
47064 : .get = py_samr_Connect3_in_get_access_mask,
47065 : .set = py_samr_Connect3_in_set_access_mask,
47066 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask")
47067 : },
47068 : {
47069 : .name = discard_const_p(char, "out_connect_handle"),
47070 : .get = py_samr_Connect3_out_get_connect_handle,
47071 : .set = py_samr_Connect3_out_set_connect_handle,
47072 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
47073 : },
47074 : {
47075 : .name = discard_const_p(char, "result"),
47076 : .get = py_samr_Connect3_get_result,
47077 : .set = py_samr_Connect3_set_result,
47078 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
47079 : },
47080 : { .name = NULL }
47081 : };
47082 :
47083 0 : static PyObject *py_samr_Connect3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47084 : {
47085 0 : PyObject *self = pytalloc_new(struct samr_Connect3, type);
47086 0 : struct samr_Connect3 *_self = (struct samr_Connect3 *)pytalloc_get_ptr(self);
47087 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
47088 0 : _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
47089 0 : return self;
47090 : }
47091 :
47092 0 : static PyObject *py_samr_Connect3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
47093 : {
47094 :
47095 :
47096 0 : return PyLong_FromLong(61);
47097 : }
47098 :
47099 0 : static PyObject *py_samr_Connect3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
47100 : {
47101 0 : const struct ndr_interface_call *call = NULL;
47102 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
47103 0 : PyObject *ret = NULL;
47104 0 : struct ndr_push *push = NULL;
47105 0 : DATA_BLOB blob;
47106 0 : enum ndr_err_code err;
47107 :
47108 0 : if (ndr_table_samr.num_calls < 62) {
47109 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_pack");
47110 0 : return NULL;
47111 : }
47112 0 : call = &ndr_table_samr.calls[61];
47113 :
47114 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
47115 0 : if (push == NULL) {
47116 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47117 0 : return NULL;
47118 : }
47119 :
47120 0 : push->flags |= ndr_push_flags;
47121 :
47122 0 : err = call->ndr_push(push, ndr_inout_flags, object);
47123 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47124 0 : TALLOC_FREE(push);
47125 0 : PyErr_SetNdrError(err);
47126 0 : return NULL;
47127 : }
47128 0 : blob = ndr_push_blob(push);
47129 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
47130 0 : TALLOC_FREE(push);
47131 0 : return ret;
47132 : }
47133 :
47134 0 : static PyObject *py_samr_Connect3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47135 : {
47136 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47137 0 : PyObject *bigendian_obj = NULL;
47138 0 : PyObject *ndr64_obj = NULL;
47139 0 : libndr_flags ndr_push_flags = 0;
47140 :
47141 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
47142 : discard_const_p(char *, kwnames),
47143 : &bigendian_obj,
47144 : &ndr64_obj)) {
47145 0 : return NULL;
47146 : }
47147 :
47148 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47149 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47150 : }
47151 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47152 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47153 : }
47154 :
47155 0 : return py_samr_Connect3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
47156 : }
47157 :
47158 0 : static PyObject *py_samr_Connect3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47159 : {
47160 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47161 0 : PyObject *bigendian_obj = NULL;
47162 0 : PyObject *ndr64_obj = NULL;
47163 0 : libndr_flags ndr_push_flags = 0;
47164 :
47165 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
47166 : discard_const_p(char *, kwnames),
47167 : &bigendian_obj,
47168 : &ndr64_obj)) {
47169 0 : return NULL;
47170 : }
47171 :
47172 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47173 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47174 : }
47175 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47176 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47177 : }
47178 :
47179 0 : return py_samr_Connect3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
47180 : }
47181 :
47182 0 : static PyObject *py_samr_Connect3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
47183 : {
47184 0 : const struct ndr_interface_call *call = NULL;
47185 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
47186 0 : struct ndr_pull *pull = NULL;
47187 0 : enum ndr_err_code err;
47188 :
47189 0 : if (ndr_table_samr.num_calls < 62) {
47190 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_unpack");
47191 0 : return NULL;
47192 : }
47193 0 : call = &ndr_table_samr.calls[61];
47194 :
47195 0 : pull = ndr_pull_init_blob(blob, object);
47196 0 : if (pull == NULL) {
47197 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47198 0 : return NULL;
47199 : }
47200 :
47201 0 : pull->flags |= ndr_pull_flags;
47202 :
47203 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
47204 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47205 0 : TALLOC_FREE(pull);
47206 0 : PyErr_SetNdrError(err);
47207 0 : return NULL;
47208 : }
47209 0 : if (!allow_remaining) {
47210 0 : uint32_t highest_ofs;
47211 :
47212 0 : if (pull->offset > pull->relative_highest_offset) {
47213 0 : highest_ofs = pull->offset;
47214 : } else {
47215 0 : highest_ofs = pull->relative_highest_offset;
47216 : }
47217 0 : if (highest_ofs < pull->data_size) {
47218 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
47219 : "not all bytes consumed ofs[%u] size[%u]",
47220 : highest_ofs, pull->data_size);
47221 0 : TALLOC_FREE(pull);
47222 0 : PyErr_SetNdrError(err);
47223 0 : return NULL;
47224 : }
47225 : }
47226 :
47227 0 : TALLOC_FREE(pull);
47228 0 : Py_RETURN_NONE;
47229 : }
47230 :
47231 0 : static PyObject *py_samr_Connect3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47232 : {
47233 0 : DATA_BLOB blob;
47234 0 : Py_ssize_t blob_length = 0;
47235 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47236 0 : PyObject *bigendian_obj = NULL;
47237 0 : PyObject *ndr64_obj = NULL;
47238 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47239 0 : PyObject *allow_remaining_obj = NULL;
47240 0 : bool allow_remaining = false;
47241 :
47242 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
47243 : discard_const_p(char *, kwnames),
47244 : &blob.data, &blob_length,
47245 : &bigendian_obj,
47246 : &ndr64_obj,
47247 : &allow_remaining_obj)) {
47248 0 : return NULL;
47249 : }
47250 0 : blob.length = blob_length;
47251 :
47252 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47253 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47254 : }
47255 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47256 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47257 : }
47258 :
47259 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47260 0 : allow_remaining = true;
47261 : }
47262 :
47263 0 : return py_samr_Connect3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
47264 : }
47265 :
47266 0 : static PyObject *py_samr_Connect3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47267 : {
47268 0 : DATA_BLOB blob;
47269 0 : Py_ssize_t blob_length = 0;
47270 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47271 0 : PyObject *bigendian_obj = NULL;
47272 0 : PyObject *ndr64_obj = NULL;
47273 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47274 0 : PyObject *allow_remaining_obj = NULL;
47275 0 : bool allow_remaining = false;
47276 :
47277 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
47278 : discard_const_p(char *, kwnames),
47279 : &blob.data, &blob_length,
47280 : &bigendian_obj,
47281 : &ndr64_obj,
47282 : &allow_remaining_obj)) {
47283 0 : return NULL;
47284 : }
47285 0 : blob.length = blob_length;
47286 :
47287 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47288 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47289 : }
47290 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47291 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47292 : }
47293 :
47294 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47295 0 : allow_remaining = true;
47296 : }
47297 :
47298 0 : return py_samr_Connect3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
47299 : }
47300 :
47301 0 : static PyObject *py_samr_Connect3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
47302 : {
47303 0 : const struct ndr_interface_call *call = NULL;
47304 0 : struct samr_Connect3 *object = (struct samr_Connect3 *)pytalloc_get_ptr(py_obj);
47305 0 : PyObject *ret;
47306 0 : char *retstr;
47307 :
47308 0 : if (ndr_table_samr.num_calls < 62) {
47309 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect3_ndr_print");
47310 0 : return NULL;
47311 : }
47312 0 : call = &ndr_table_samr.calls[61];
47313 :
47314 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47315 0 : ret = PyUnicode_FromString(retstr);
47316 0 : TALLOC_FREE(retstr);
47317 :
47318 0 : return ret;
47319 : }
47320 :
47321 0 : static PyObject *py_samr_Connect3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47322 : {
47323 0 : return py_samr_Connect3_ndr_print(py_obj, "samr_Connect3_in", NDR_IN);
47324 : }
47325 :
47326 0 : static PyObject *py_samr_Connect3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47327 : {
47328 0 : return py_samr_Connect3_ndr_print(py_obj, "samr_Connect3_out", NDR_OUT);
47329 : }
47330 :
47331 : static PyMethodDef py_samr_Connect3_methods[] = {
47332 : { "opnum", (PyCFunction)py_samr_Connect3_ndr_opnum, METH_NOARGS|METH_CLASS,
47333 : "samr.Connect3.opnum() -> 61 (0x3d) " },
47334 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47335 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47336 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47337 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47338 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47339 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47340 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47341 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47342 : { "__ndr_print_in__", (PyCFunction)py_samr_Connect3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47343 : { "__ndr_print_out__", (PyCFunction)py_samr_Connect3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47344 : { NULL, NULL, 0, NULL }
47345 : };
47346 :
47347 :
47348 : static PyTypeObject samr_Connect3_Type = {
47349 : PyVarObject_HEAD_INIT(NULL, 0)
47350 : .tp_name = "samr.Connect3",
47351 : .tp_getset = py_samr_Connect3_getsetters,
47352 : .tp_methods = py_samr_Connect3_methods,
47353 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47354 : .tp_new = py_samr_Connect3_new,
47355 : };
47356 :
47357 0 : static bool pack_py_samr_Connect3_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect3 *r)
47358 : {
47359 0 : PyObject *py_system_name;
47360 0 : PyObject *py_unknown;
47361 0 : PyObject *py_access_mask;
47362 0 : const char *kwnames[] = {
47363 : "system_name", "unknown", "access_mask", NULL
47364 : };
47365 :
47366 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect3", discard_const_p(char *, kwnames), &py_system_name, &py_unknown, &py_access_mask)) {
47367 0 : return false;
47368 : }
47369 :
47370 0 : if (py_system_name == NULL) {
47371 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
47372 0 : return false;
47373 : }
47374 0 : if (py_system_name == Py_None) {
47375 0 : r->in.system_name = NULL;
47376 : } else {
47377 0 : r->in.system_name = NULL;
47378 : {
47379 0 : const char *test_str;
47380 0 : const char *talloc_str;
47381 0 : PyObject *unicode = NULL;
47382 0 : if (PyUnicode_Check(py_system_name)) {
47383 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
47384 0 : if (unicode == NULL) {
47385 0 : return false;
47386 : }
47387 0 : test_str = PyBytes_AS_STRING(unicode);
47388 0 : } else if (PyBytes_Check(py_system_name)) {
47389 0 : test_str = PyBytes_AS_STRING(py_system_name);
47390 : } else {
47391 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
47392 0 : return false;
47393 : }
47394 0 : talloc_str = talloc_strdup(r, test_str);
47395 0 : if (unicode != NULL) {
47396 0 : Py_DECREF(unicode);
47397 : }
47398 0 : if (talloc_str == NULL) {
47399 0 : PyErr_NoMemory();
47400 0 : return false;
47401 : }
47402 0 : r->in.system_name = talloc_str;
47403 : }
47404 : }
47405 0 : if (py_unknown == NULL) {
47406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown");
47407 0 : return false;
47408 : }
47409 : {
47410 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown));
47411 0 : if (PyLong_Check(py_unknown)) {
47412 0 : unsigned long long test_var;
47413 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown);
47414 0 : if (PyErr_Occurred() != NULL) {
47415 0 : return false;
47416 : }
47417 0 : if (test_var > uint_max) {
47418 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47419 : PyLong_Type.tp_name, uint_max, test_var);
47420 0 : return false;
47421 : }
47422 0 : r->in.unknown = test_var;
47423 : } else {
47424 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47425 : PyLong_Type.tp_name);
47426 0 : return false;
47427 : }
47428 : }
47429 0 : if (py_access_mask == NULL) {
47430 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
47431 0 : return false;
47432 : }
47433 : {
47434 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
47435 0 : if (PyLong_Check(py_access_mask)) {
47436 0 : unsigned long long test_var;
47437 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
47438 0 : if (PyErr_Occurred() != NULL) {
47439 0 : return false;
47440 : }
47441 0 : if (test_var > uint_max) {
47442 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47443 : PyLong_Type.tp_name, uint_max, test_var);
47444 0 : return false;
47445 : }
47446 0 : r->in.access_mask = test_var;
47447 : } else {
47448 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47449 : PyLong_Type.tp_name);
47450 0 : return false;
47451 : }
47452 : }
47453 0 : return true;
47454 : }
47455 :
47456 0 : static PyObject *unpack_py_samr_Connect3_args_out(struct samr_Connect3 *r)
47457 : {
47458 0 : PyObject *result;
47459 0 : PyObject *py_connect_handle;
47460 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
47461 0 : result = py_connect_handle;
47462 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
47463 0 : PyErr_SetNTSTATUS(r->out.result);
47464 0 : return NULL;
47465 : }
47466 :
47467 0 : return result;
47468 : }
47469 :
47470 :
47471 0 : static PyObject *py_samr_Connect4_in_get_system_name(PyObject *obj, void *closure)
47472 : {
47473 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj);
47474 0 : PyObject *py_system_name;
47475 0 : if (object->in.system_name == NULL) {
47476 0 : Py_RETURN_NONE;
47477 : }
47478 0 : if (object->in.system_name == NULL) {
47479 0 : py_system_name = Py_None;
47480 0 : Py_INCREF(py_system_name);
47481 : } else {
47482 0 : if (object->in.system_name == NULL) {
47483 0 : py_system_name = Py_None;
47484 0 : Py_INCREF(py_system_name);
47485 : } else {
47486 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
47487 : }
47488 : }
47489 0 : return py_system_name;
47490 : }
47491 :
47492 0 : static int py_samr_Connect4_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
47493 : {
47494 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47495 0 : if (value == NULL) {
47496 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
47497 0 : return -1;
47498 : }
47499 0 : if (value == Py_None) {
47500 0 : object->in.system_name = NULL;
47501 : } else {
47502 0 : object->in.system_name = NULL;
47503 : {
47504 0 : const char *test_str;
47505 0 : const char *talloc_str;
47506 0 : PyObject *unicode = NULL;
47507 0 : if (PyUnicode_Check(value)) {
47508 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
47509 0 : if (unicode == NULL) {
47510 0 : return -1;
47511 : }
47512 0 : test_str = PyBytes_AS_STRING(unicode);
47513 0 : } else if (PyBytes_Check(value)) {
47514 0 : test_str = PyBytes_AS_STRING(value);
47515 : } else {
47516 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
47517 0 : return -1;
47518 : }
47519 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
47520 0 : if (unicode != NULL) {
47521 0 : Py_DECREF(unicode);
47522 : }
47523 0 : if (talloc_str == NULL) {
47524 0 : PyErr_NoMemory();
47525 0 : return -1;
47526 : }
47527 0 : object->in.system_name = talloc_str;
47528 : }
47529 : }
47530 0 : return 0;
47531 : }
47532 :
47533 0 : static PyObject *py_samr_Connect4_in_get_client_version(PyObject *obj, void *closure)
47534 : {
47535 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj);
47536 0 : PyObject *py_client_version;
47537 0 : py_client_version = PyLong_FromUnsignedLongLong((uint32_t)object->in.client_version);
47538 0 : return py_client_version;
47539 : }
47540 :
47541 0 : static int py_samr_Connect4_in_set_client_version(PyObject *py_obj, PyObject *value, void *closure)
47542 : {
47543 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47544 0 : if (value == NULL) {
47545 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.client_version");
47546 0 : return -1;
47547 : }
47548 : {
47549 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_version));
47550 0 : if (PyLong_Check(value)) {
47551 0 : unsigned long long test_var;
47552 0 : test_var = PyLong_AsUnsignedLongLong(value);
47553 0 : if (PyErr_Occurred() != NULL) {
47554 0 : return -1;
47555 : }
47556 0 : if (test_var > uint_max) {
47557 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47558 : PyLong_Type.tp_name, uint_max, test_var);
47559 0 : return -1;
47560 : }
47561 0 : object->in.client_version = test_var;
47562 : } else {
47563 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47564 : PyLong_Type.tp_name);
47565 0 : return -1;
47566 : }
47567 : }
47568 0 : return 0;
47569 : }
47570 :
47571 0 : static PyObject *py_samr_Connect4_in_get_access_mask(PyObject *obj, void *closure)
47572 : {
47573 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj);
47574 0 : PyObject *py_access_mask;
47575 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
47576 0 : return py_access_mask;
47577 : }
47578 :
47579 0 : static int py_samr_Connect4_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
47580 : {
47581 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47582 0 : if (value == NULL) {
47583 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
47584 0 : return -1;
47585 : }
47586 : {
47587 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
47588 0 : if (PyLong_Check(value)) {
47589 0 : unsigned long long test_var;
47590 0 : test_var = PyLong_AsUnsignedLongLong(value);
47591 0 : if (PyErr_Occurred() != NULL) {
47592 0 : return -1;
47593 : }
47594 0 : if (test_var > uint_max) {
47595 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
47596 : PyLong_Type.tp_name, uint_max, test_var);
47597 0 : return -1;
47598 : }
47599 0 : object->in.access_mask = test_var;
47600 : } else {
47601 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
47602 : PyLong_Type.tp_name);
47603 0 : return -1;
47604 : }
47605 : }
47606 0 : return 0;
47607 : }
47608 :
47609 0 : static PyObject *py_samr_Connect4_out_get_connect_handle(PyObject *obj, void *closure)
47610 : {
47611 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj);
47612 0 : PyObject *py_connect_handle;
47613 0 : if (object->out.connect_handle == NULL) {
47614 0 : Py_RETURN_NONE;
47615 : }
47616 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle);
47617 0 : return py_connect_handle;
47618 : }
47619 :
47620 0 : static int py_samr_Connect4_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
47621 : {
47622 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47623 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle));
47624 0 : if (value == NULL) {
47625 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle");
47626 0 : return -1;
47627 : }
47628 0 : object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle);
47629 0 : if (object->out.connect_handle == NULL) {
47630 0 : PyErr_NoMemory();
47631 0 : return -1;
47632 : }
47633 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
47634 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
47635 0 : PyErr_NoMemory();
47636 0 : return -1;
47637 : }
47638 0 : object->out.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
47639 0 : return 0;
47640 : }
47641 :
47642 0 : static PyObject *py_samr_Connect4_get_result(PyObject *obj, void *closure)
47643 : {
47644 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(obj);
47645 0 : PyObject *py_result;
47646 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
47647 0 : return py_result;
47648 : }
47649 :
47650 0 : static int py_samr_Connect4_set_result(PyObject *py_obj, PyObject *value, void *closure)
47651 : {
47652 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47653 0 : if (value == NULL) {
47654 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
47655 0 : return -1;
47656 : }
47657 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
47658 0 : return 0;
47659 : }
47660 :
47661 : static PyGetSetDef py_samr_Connect4_getsetters[] = {
47662 : {
47663 : .name = discard_const_p(char, "in_system_name"),
47664 : .get = py_samr_Connect4_in_get_system_name,
47665 : .set = py_samr_Connect4_in_set_system_name,
47666 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
47667 : },
47668 : {
47669 : .name = discard_const_p(char, "in_client_version"),
47670 : .get = py_samr_Connect4_in_get_client_version,
47671 : .set = py_samr_Connect4_in_set_client_version,
47672 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectVersion")
47673 : },
47674 : {
47675 : .name = discard_const_p(char, "in_access_mask"),
47676 : .get = py_samr_Connect4_in_get_access_mask,
47677 : .set = py_samr_Connect4_in_set_access_mask,
47678 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask")
47679 : },
47680 : {
47681 : .name = discard_const_p(char, "out_connect_handle"),
47682 : .get = py_samr_Connect4_out_get_connect_handle,
47683 : .set = py_samr_Connect4_out_set_connect_handle,
47684 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
47685 : },
47686 : {
47687 : .name = discard_const_p(char, "result"),
47688 : .get = py_samr_Connect4_get_result,
47689 : .set = py_samr_Connect4_set_result,
47690 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
47691 : },
47692 : { .name = NULL }
47693 : };
47694 :
47695 0 : static PyObject *py_samr_Connect4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
47696 : {
47697 0 : PyObject *self = pytalloc_new(struct samr_Connect4, type);
47698 0 : struct samr_Connect4 *_self = (struct samr_Connect4 *)pytalloc_get_ptr(self);
47699 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
47700 0 : _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
47701 0 : return self;
47702 : }
47703 :
47704 0 : static PyObject *py_samr_Connect4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
47705 : {
47706 :
47707 :
47708 0 : return PyLong_FromLong(62);
47709 : }
47710 :
47711 0 : static PyObject *py_samr_Connect4_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
47712 : {
47713 0 : const struct ndr_interface_call *call = NULL;
47714 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47715 0 : PyObject *ret = NULL;
47716 0 : struct ndr_push *push = NULL;
47717 0 : DATA_BLOB blob;
47718 0 : enum ndr_err_code err;
47719 :
47720 0 : if (ndr_table_samr.num_calls < 63) {
47721 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_pack");
47722 0 : return NULL;
47723 : }
47724 0 : call = &ndr_table_samr.calls[62];
47725 :
47726 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
47727 0 : if (push == NULL) {
47728 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47729 0 : return NULL;
47730 : }
47731 :
47732 0 : push->flags |= ndr_push_flags;
47733 :
47734 0 : err = call->ndr_push(push, ndr_inout_flags, object);
47735 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47736 0 : TALLOC_FREE(push);
47737 0 : PyErr_SetNdrError(err);
47738 0 : return NULL;
47739 : }
47740 0 : blob = ndr_push_blob(push);
47741 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
47742 0 : TALLOC_FREE(push);
47743 0 : return ret;
47744 : }
47745 :
47746 0 : static PyObject *py_samr_Connect4_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47747 : {
47748 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47749 0 : PyObject *bigendian_obj = NULL;
47750 0 : PyObject *ndr64_obj = NULL;
47751 0 : libndr_flags ndr_push_flags = 0;
47752 :
47753 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
47754 : discard_const_p(char *, kwnames),
47755 : &bigendian_obj,
47756 : &ndr64_obj)) {
47757 0 : return NULL;
47758 : }
47759 :
47760 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47761 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47762 : }
47763 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47764 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47765 : }
47766 :
47767 0 : return py_samr_Connect4_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
47768 : }
47769 :
47770 0 : static PyObject *py_samr_Connect4_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47771 : {
47772 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
47773 0 : PyObject *bigendian_obj = NULL;
47774 0 : PyObject *ndr64_obj = NULL;
47775 0 : libndr_flags ndr_push_flags = 0;
47776 :
47777 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
47778 : discard_const_p(char *, kwnames),
47779 : &bigendian_obj,
47780 : &ndr64_obj)) {
47781 0 : return NULL;
47782 : }
47783 :
47784 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47785 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
47786 : }
47787 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47788 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
47789 : }
47790 :
47791 0 : return py_samr_Connect4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
47792 : }
47793 :
47794 0 : static PyObject *py_samr_Connect4_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
47795 : {
47796 0 : const struct ndr_interface_call *call = NULL;
47797 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47798 0 : struct ndr_pull *pull = NULL;
47799 0 : enum ndr_err_code err;
47800 :
47801 0 : if (ndr_table_samr.num_calls < 63) {
47802 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_unpack");
47803 0 : return NULL;
47804 : }
47805 0 : call = &ndr_table_samr.calls[62];
47806 :
47807 0 : pull = ndr_pull_init_blob(blob, object);
47808 0 : if (pull == NULL) {
47809 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
47810 0 : return NULL;
47811 : }
47812 :
47813 0 : pull->flags |= ndr_pull_flags;
47814 :
47815 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
47816 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
47817 0 : TALLOC_FREE(pull);
47818 0 : PyErr_SetNdrError(err);
47819 0 : return NULL;
47820 : }
47821 0 : if (!allow_remaining) {
47822 0 : uint32_t highest_ofs;
47823 :
47824 0 : if (pull->offset > pull->relative_highest_offset) {
47825 0 : highest_ofs = pull->offset;
47826 : } else {
47827 0 : highest_ofs = pull->relative_highest_offset;
47828 : }
47829 0 : if (highest_ofs < pull->data_size) {
47830 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
47831 : "not all bytes consumed ofs[%u] size[%u]",
47832 : highest_ofs, pull->data_size);
47833 0 : TALLOC_FREE(pull);
47834 0 : PyErr_SetNdrError(err);
47835 0 : return NULL;
47836 : }
47837 : }
47838 :
47839 0 : TALLOC_FREE(pull);
47840 0 : Py_RETURN_NONE;
47841 : }
47842 :
47843 0 : static PyObject *py_samr_Connect4_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47844 : {
47845 0 : DATA_BLOB blob;
47846 0 : Py_ssize_t blob_length = 0;
47847 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47848 0 : PyObject *bigendian_obj = NULL;
47849 0 : PyObject *ndr64_obj = NULL;
47850 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47851 0 : PyObject *allow_remaining_obj = NULL;
47852 0 : bool allow_remaining = false;
47853 :
47854 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
47855 : discard_const_p(char *, kwnames),
47856 : &blob.data, &blob_length,
47857 : &bigendian_obj,
47858 : &ndr64_obj,
47859 : &allow_remaining_obj)) {
47860 0 : return NULL;
47861 : }
47862 0 : blob.length = blob_length;
47863 :
47864 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47865 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47866 : }
47867 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47868 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47869 : }
47870 :
47871 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47872 0 : allow_remaining = true;
47873 : }
47874 :
47875 0 : return py_samr_Connect4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
47876 : }
47877 :
47878 0 : static PyObject *py_samr_Connect4_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
47879 : {
47880 0 : DATA_BLOB blob;
47881 0 : Py_ssize_t blob_length = 0;
47882 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
47883 0 : PyObject *bigendian_obj = NULL;
47884 0 : PyObject *ndr64_obj = NULL;
47885 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
47886 0 : PyObject *allow_remaining_obj = NULL;
47887 0 : bool allow_remaining = false;
47888 :
47889 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
47890 : discard_const_p(char *, kwnames),
47891 : &blob.data, &blob_length,
47892 : &bigendian_obj,
47893 : &ndr64_obj,
47894 : &allow_remaining_obj)) {
47895 0 : return NULL;
47896 : }
47897 0 : blob.length = blob_length;
47898 :
47899 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
47900 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
47901 : }
47902 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
47903 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
47904 : }
47905 :
47906 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
47907 0 : allow_remaining = true;
47908 : }
47909 :
47910 0 : return py_samr_Connect4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
47911 : }
47912 :
47913 0 : static PyObject *py_samr_Connect4_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
47914 : {
47915 0 : const struct ndr_interface_call *call = NULL;
47916 0 : struct samr_Connect4 *object = (struct samr_Connect4 *)pytalloc_get_ptr(py_obj);
47917 0 : PyObject *ret;
47918 0 : char *retstr;
47919 :
47920 0 : if (ndr_table_samr.num_calls < 63) {
47921 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect4_ndr_print");
47922 0 : return NULL;
47923 : }
47924 0 : call = &ndr_table_samr.calls[62];
47925 :
47926 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
47927 0 : ret = PyUnicode_FromString(retstr);
47928 0 : TALLOC_FREE(retstr);
47929 :
47930 0 : return ret;
47931 : }
47932 :
47933 0 : static PyObject *py_samr_Connect4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47934 : {
47935 0 : return py_samr_Connect4_ndr_print(py_obj, "samr_Connect4_in", NDR_IN);
47936 : }
47937 :
47938 0 : static PyObject *py_samr_Connect4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
47939 : {
47940 0 : return py_samr_Connect4_ndr_print(py_obj, "samr_Connect4_out", NDR_OUT);
47941 : }
47942 :
47943 : static PyMethodDef py_samr_Connect4_methods[] = {
47944 : { "opnum", (PyCFunction)py_samr_Connect4_ndr_opnum, METH_NOARGS|METH_CLASS,
47945 : "samr.Connect4.opnum() -> 62 (0x3e) " },
47946 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect4_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
47947 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
47948 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect4_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
47949 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
47950 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect4_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
47951 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
47952 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect4_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
47953 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
47954 : { "__ndr_print_in__", (PyCFunction)py_samr_Connect4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
47955 : { "__ndr_print_out__", (PyCFunction)py_samr_Connect4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
47956 : { NULL, NULL, 0, NULL }
47957 : };
47958 :
47959 :
47960 : static PyTypeObject samr_Connect4_Type = {
47961 : PyVarObject_HEAD_INIT(NULL, 0)
47962 : .tp_name = "samr.Connect4",
47963 : .tp_getset = py_samr_Connect4_getsetters,
47964 : .tp_methods = py_samr_Connect4_methods,
47965 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
47966 : .tp_new = py_samr_Connect4_new,
47967 : };
47968 :
47969 0 : static bool pack_py_samr_Connect4_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect4 *r)
47970 : {
47971 0 : PyObject *py_system_name;
47972 0 : PyObject *py_client_version;
47973 0 : PyObject *py_access_mask;
47974 0 : const char *kwnames[] = {
47975 : "system_name", "client_version", "access_mask", NULL
47976 : };
47977 :
47978 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect4", discard_const_p(char *, kwnames), &py_system_name, &py_client_version, &py_access_mask)) {
47979 0 : return false;
47980 : }
47981 :
47982 0 : if (py_system_name == NULL) {
47983 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
47984 0 : return false;
47985 : }
47986 0 : if (py_system_name == Py_None) {
47987 0 : r->in.system_name = NULL;
47988 : } else {
47989 0 : r->in.system_name = NULL;
47990 : {
47991 0 : const char *test_str;
47992 0 : const char *talloc_str;
47993 0 : PyObject *unicode = NULL;
47994 0 : if (PyUnicode_Check(py_system_name)) {
47995 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
47996 0 : if (unicode == NULL) {
47997 0 : return false;
47998 : }
47999 0 : test_str = PyBytes_AS_STRING(unicode);
48000 0 : } else if (PyBytes_Check(py_system_name)) {
48001 0 : test_str = PyBytes_AS_STRING(py_system_name);
48002 : } else {
48003 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
48004 0 : return false;
48005 : }
48006 0 : talloc_str = talloc_strdup(r, test_str);
48007 0 : if (unicode != NULL) {
48008 0 : Py_DECREF(unicode);
48009 : }
48010 0 : if (talloc_str == NULL) {
48011 0 : PyErr_NoMemory();
48012 0 : return false;
48013 : }
48014 0 : r->in.system_name = talloc_str;
48015 : }
48016 : }
48017 0 : if (py_client_version == NULL) {
48018 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.client_version");
48019 0 : return false;
48020 : }
48021 : {
48022 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_version));
48023 0 : if (PyLong_Check(py_client_version)) {
48024 0 : unsigned long long test_var;
48025 0 : test_var = PyLong_AsUnsignedLongLong(py_client_version);
48026 0 : if (PyErr_Occurred() != NULL) {
48027 0 : return false;
48028 : }
48029 0 : if (test_var > uint_max) {
48030 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48031 : PyLong_Type.tp_name, uint_max, test_var);
48032 0 : return false;
48033 : }
48034 0 : r->in.client_version = test_var;
48035 : } else {
48036 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48037 : PyLong_Type.tp_name);
48038 0 : return false;
48039 : }
48040 : }
48041 0 : if (py_access_mask == NULL) {
48042 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
48043 0 : return false;
48044 : }
48045 : {
48046 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
48047 0 : if (PyLong_Check(py_access_mask)) {
48048 0 : unsigned long long test_var;
48049 0 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
48050 0 : if (PyErr_Occurred() != NULL) {
48051 0 : return false;
48052 : }
48053 0 : if (test_var > uint_max) {
48054 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48055 : PyLong_Type.tp_name, uint_max, test_var);
48056 0 : return false;
48057 : }
48058 0 : r->in.access_mask = test_var;
48059 : } else {
48060 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48061 : PyLong_Type.tp_name);
48062 0 : return false;
48063 : }
48064 : }
48065 0 : return true;
48066 : }
48067 :
48068 0 : static PyObject *unpack_py_samr_Connect4_args_out(struct samr_Connect4 *r)
48069 : {
48070 0 : PyObject *result;
48071 0 : PyObject *py_connect_handle;
48072 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
48073 0 : result = py_connect_handle;
48074 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
48075 0 : PyErr_SetNTSTATUS(r->out.result);
48076 0 : return NULL;
48077 : }
48078 :
48079 0 : return result;
48080 : }
48081 :
48082 :
48083 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_server(PyObject *obj, void *closure)
48084 : {
48085 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48086 0 : PyObject *py_server;
48087 0 : if (object->in.server == NULL) {
48088 0 : Py_RETURN_NONE;
48089 : }
48090 0 : if (object->in.server == NULL) {
48091 0 : py_server = Py_None;
48092 0 : Py_INCREF(py_server);
48093 : } else {
48094 0 : py_server = pytalloc_reference_ex(lsa_String_Type, object->in.server, object->in.server);
48095 : }
48096 0 : return py_server;
48097 : }
48098 :
48099 0 : static int py_samr_ChangePasswordUser3_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
48100 : {
48101 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48102 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server));
48103 0 : if (value == NULL) {
48104 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server");
48105 0 : return -1;
48106 : }
48107 0 : if (value == Py_None) {
48108 0 : object->in.server = NULL;
48109 : } else {
48110 0 : object->in.server = NULL;
48111 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
48112 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48113 0 : PyErr_NoMemory();
48114 0 : return -1;
48115 : }
48116 0 : object->in.server = (struct lsa_String *)pytalloc_get_ptr(value);
48117 : }
48118 0 : return 0;
48119 : }
48120 :
48121 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_account(PyObject *obj, void *closure)
48122 : {
48123 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48124 0 : PyObject *py_account;
48125 0 : if (object->in.account == NULL) {
48126 0 : Py_RETURN_NONE;
48127 : }
48128 0 : py_account = pytalloc_reference_ex(lsa_String_Type, object->in.account, object->in.account);
48129 0 : return py_account;
48130 : }
48131 :
48132 0 : static int py_samr_ChangePasswordUser3_in_set_account(PyObject *py_obj, PyObject *value, void *closure)
48133 : {
48134 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48135 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account));
48136 0 : if (value == NULL) {
48137 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account");
48138 0 : return -1;
48139 : }
48140 0 : object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account);
48141 0 : if (object->in.account == NULL) {
48142 0 : PyErr_NoMemory();
48143 0 : return -1;
48144 : }
48145 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
48146 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48147 0 : PyErr_NoMemory();
48148 0 : return -1;
48149 : }
48150 0 : object->in.account = (struct lsa_String *)pytalloc_get_ptr(value);
48151 0 : return 0;
48152 : }
48153 :
48154 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_nt_password(PyObject *obj, void *closure)
48155 : {
48156 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48157 0 : PyObject *py_nt_password;
48158 0 : if (object->in.nt_password == NULL) {
48159 0 : Py_RETURN_NONE;
48160 : }
48161 0 : if (object->in.nt_password == NULL) {
48162 0 : py_nt_password = Py_None;
48163 0 : Py_INCREF(py_nt_password);
48164 : } else {
48165 0 : py_nt_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.nt_password, object->in.nt_password);
48166 : }
48167 0 : return py_nt_password;
48168 : }
48169 :
48170 0 : static int py_samr_ChangePasswordUser3_in_set_nt_password(PyObject *py_obj, PyObject *value, void *closure)
48171 : {
48172 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48173 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_password));
48174 0 : if (value == NULL) {
48175 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_password");
48176 0 : return -1;
48177 : }
48178 0 : if (value == Py_None) {
48179 0 : object->in.nt_password = NULL;
48180 : } else {
48181 0 : object->in.nt_password = NULL;
48182 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
48183 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48184 0 : PyErr_NoMemory();
48185 0 : return -1;
48186 : }
48187 0 : object->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
48188 : }
48189 0 : return 0;
48190 : }
48191 :
48192 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_nt_verifier(PyObject *obj, void *closure)
48193 : {
48194 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48195 0 : PyObject *py_nt_verifier;
48196 0 : if (object->in.nt_verifier == NULL) {
48197 0 : Py_RETURN_NONE;
48198 : }
48199 0 : if (object->in.nt_verifier == NULL) {
48200 0 : py_nt_verifier = Py_None;
48201 0 : Py_INCREF(py_nt_verifier);
48202 : } else {
48203 0 : py_nt_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.nt_verifier, object->in.nt_verifier);
48204 : }
48205 0 : return py_nt_verifier;
48206 : }
48207 :
48208 0 : static int py_samr_ChangePasswordUser3_in_set_nt_verifier(PyObject *py_obj, PyObject *value, void *closure)
48209 : {
48210 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48211 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.nt_verifier));
48212 0 : if (value == NULL) {
48213 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.nt_verifier");
48214 0 : return -1;
48215 : }
48216 0 : if (value == Py_None) {
48217 0 : object->in.nt_verifier = NULL;
48218 : } else {
48219 0 : object->in.nt_verifier = NULL;
48220 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
48221 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48222 0 : PyErr_NoMemory();
48223 0 : return -1;
48224 : }
48225 0 : object->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(value);
48226 : }
48227 0 : return 0;
48228 : }
48229 :
48230 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_lm_change(PyObject *obj, void *closure)
48231 : {
48232 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48233 0 : PyObject *py_lm_change;
48234 0 : py_lm_change = PyLong_FromLong((uint16_t)object->in.lm_change);
48235 0 : return py_lm_change;
48236 : }
48237 :
48238 0 : static int py_samr_ChangePasswordUser3_in_set_lm_change(PyObject *py_obj, PyObject *value, void *closure)
48239 : {
48240 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48241 0 : if (value == NULL) {
48242 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_change");
48243 0 : return -1;
48244 : }
48245 : {
48246 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.lm_change));
48247 0 : if (PyLong_Check(value)) {
48248 0 : unsigned long long test_var;
48249 0 : test_var = PyLong_AsUnsignedLongLong(value);
48250 0 : if (PyErr_Occurred() != NULL) {
48251 0 : return -1;
48252 : }
48253 0 : if (test_var > uint_max) {
48254 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48255 : PyLong_Type.tp_name, uint_max, test_var);
48256 0 : return -1;
48257 : }
48258 0 : object->in.lm_change = test_var;
48259 : } else {
48260 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48261 : PyLong_Type.tp_name);
48262 0 : return -1;
48263 : }
48264 : }
48265 0 : return 0;
48266 : }
48267 :
48268 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_lm_password(PyObject *obj, void *closure)
48269 : {
48270 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48271 0 : PyObject *py_lm_password;
48272 0 : if (object->in.lm_password == NULL) {
48273 0 : Py_RETURN_NONE;
48274 : }
48275 0 : if (object->in.lm_password == NULL) {
48276 0 : py_lm_password = Py_None;
48277 0 : Py_INCREF(py_lm_password);
48278 : } else {
48279 0 : py_lm_password = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.lm_password, object->in.lm_password);
48280 : }
48281 0 : return py_lm_password;
48282 : }
48283 :
48284 0 : static int py_samr_ChangePasswordUser3_in_set_lm_password(PyObject *py_obj, PyObject *value, void *closure)
48285 : {
48286 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48287 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_password));
48288 0 : if (value == NULL) {
48289 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_password");
48290 0 : return -1;
48291 : }
48292 0 : if (value == Py_None) {
48293 0 : object->in.lm_password = NULL;
48294 : } else {
48295 0 : object->in.lm_password = NULL;
48296 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
48297 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48298 0 : PyErr_NoMemory();
48299 0 : return -1;
48300 : }
48301 0 : object->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
48302 : }
48303 0 : return 0;
48304 : }
48305 :
48306 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_lm_verifier(PyObject *obj, void *closure)
48307 : {
48308 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48309 0 : PyObject *py_lm_verifier;
48310 0 : if (object->in.lm_verifier == NULL) {
48311 0 : Py_RETURN_NONE;
48312 : }
48313 0 : if (object->in.lm_verifier == NULL) {
48314 0 : py_lm_verifier = Py_None;
48315 0 : Py_INCREF(py_lm_verifier);
48316 : } else {
48317 0 : py_lm_verifier = pytalloc_reference_ex(&samr_Password_Type, object->in.lm_verifier, object->in.lm_verifier);
48318 : }
48319 0 : return py_lm_verifier;
48320 : }
48321 :
48322 0 : static int py_samr_ChangePasswordUser3_in_set_lm_verifier(PyObject *py_obj, PyObject *value, void *closure)
48323 : {
48324 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48325 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.lm_verifier));
48326 0 : if (value == NULL) {
48327 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.lm_verifier");
48328 0 : return -1;
48329 : }
48330 0 : if (value == Py_None) {
48331 0 : object->in.lm_verifier = NULL;
48332 : } else {
48333 0 : object->in.lm_verifier = NULL;
48334 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
48335 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48336 0 : PyErr_NoMemory();
48337 0 : return -1;
48338 : }
48339 0 : object->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(value);
48340 : }
48341 0 : return 0;
48342 : }
48343 :
48344 0 : static PyObject *py_samr_ChangePasswordUser3_in_get_password3(PyObject *obj, void *closure)
48345 : {
48346 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48347 0 : PyObject *py_password3;
48348 0 : if (object->in.password3 == NULL) {
48349 0 : Py_RETURN_NONE;
48350 : }
48351 0 : if (object->in.password3 == NULL) {
48352 0 : py_password3 = Py_None;
48353 0 : Py_INCREF(py_password3);
48354 : } else {
48355 0 : py_password3 = pytalloc_reference_ex(&samr_CryptPassword_Type, object->in.password3, object->in.password3);
48356 : }
48357 0 : return py_password3;
48358 : }
48359 :
48360 0 : static int py_samr_ChangePasswordUser3_in_set_password3(PyObject *py_obj, PyObject *value, void *closure)
48361 : {
48362 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48363 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password3));
48364 0 : if (value == NULL) {
48365 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password3");
48366 0 : return -1;
48367 : }
48368 0 : if (value == Py_None) {
48369 0 : object->in.password3 = NULL;
48370 : } else {
48371 0 : object->in.password3 = NULL;
48372 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
48373 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48374 0 : PyErr_NoMemory();
48375 0 : return -1;
48376 : }
48377 0 : object->in.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(value);
48378 : }
48379 0 : return 0;
48380 : }
48381 :
48382 0 : static PyObject *py_samr_ChangePasswordUser3_out_get_dominfo(PyObject *obj, void *closure)
48383 : {
48384 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48385 0 : PyObject *py_dominfo;
48386 0 : if (object->out.dominfo == NULL) {
48387 0 : Py_RETURN_NONE;
48388 : }
48389 0 : if (*object->out.dominfo == NULL) {
48390 0 : py_dominfo = Py_None;
48391 0 : Py_INCREF(py_dominfo);
48392 : } else {
48393 0 : py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *object->out.dominfo, *object->out.dominfo);
48394 : }
48395 0 : return py_dominfo;
48396 : }
48397 :
48398 0 : static int py_samr_ChangePasswordUser3_out_set_dominfo(PyObject *py_obj, PyObject *value, void *closure)
48399 : {
48400 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48401 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.dominfo));
48402 0 : if (value == NULL) {
48403 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.dominfo");
48404 0 : return -1;
48405 : }
48406 0 : object->out.dominfo = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.dominfo);
48407 0 : if (object->out.dominfo == NULL) {
48408 0 : PyErr_NoMemory();
48409 0 : return -1;
48410 : }
48411 0 : if (value == Py_None) {
48412 0 : *object->out.dominfo = NULL;
48413 : } else {
48414 0 : *object->out.dominfo = NULL;
48415 0 : PY_CHECK_TYPE(&samr_DomInfo1_Type, value, return -1;);
48416 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48417 0 : PyErr_NoMemory();
48418 0 : return -1;
48419 : }
48420 0 : *object->out.dominfo = (struct samr_DomInfo1 *)pytalloc_get_ptr(value);
48421 : }
48422 0 : return 0;
48423 : }
48424 :
48425 0 : static PyObject *py_samr_ChangePasswordUser3_out_get_reject(PyObject *obj, void *closure)
48426 : {
48427 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48428 0 : PyObject *py_reject;
48429 0 : if (object->out.reject == NULL) {
48430 0 : Py_RETURN_NONE;
48431 : }
48432 0 : if (*object->out.reject == NULL) {
48433 0 : py_reject = Py_None;
48434 0 : Py_INCREF(py_reject);
48435 : } else {
48436 0 : py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *object->out.reject, *object->out.reject);
48437 : }
48438 0 : return py_reject;
48439 : }
48440 :
48441 0 : static int py_samr_ChangePasswordUser3_out_set_reject(PyObject *py_obj, PyObject *value, void *closure)
48442 : {
48443 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48444 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.reject));
48445 0 : if (value == NULL) {
48446 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.reject");
48447 0 : return -1;
48448 : }
48449 0 : object->out.reject = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.reject);
48450 0 : if (object->out.reject == NULL) {
48451 0 : PyErr_NoMemory();
48452 0 : return -1;
48453 : }
48454 0 : if (value == Py_None) {
48455 0 : *object->out.reject = NULL;
48456 : } else {
48457 0 : *object->out.reject = NULL;
48458 0 : PY_CHECK_TYPE(&userPwdChangeFailureInformation_Type, value, return -1;);
48459 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
48460 0 : PyErr_NoMemory();
48461 0 : return -1;
48462 : }
48463 0 : *object->out.reject = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(value);
48464 : }
48465 0 : return 0;
48466 : }
48467 :
48468 0 : static PyObject *py_samr_ChangePasswordUser3_get_result(PyObject *obj, void *closure)
48469 : {
48470 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(obj);
48471 0 : PyObject *py_result;
48472 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
48473 0 : return py_result;
48474 : }
48475 :
48476 0 : static int py_samr_ChangePasswordUser3_set_result(PyObject *py_obj, PyObject *value, void *closure)
48477 : {
48478 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48479 0 : if (value == NULL) {
48480 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
48481 0 : return -1;
48482 : }
48483 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
48484 0 : return 0;
48485 : }
48486 :
48487 : static PyGetSetDef py_samr_ChangePasswordUser3_getsetters[] = {
48488 : {
48489 : .name = discard_const_p(char, "in_server"),
48490 : .get = py_samr_ChangePasswordUser3_in_get_server,
48491 : .set = py_samr_ChangePasswordUser3_in_set_server,
48492 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
48493 : },
48494 : {
48495 : .name = discard_const_p(char, "in_account"),
48496 : .get = py_samr_ChangePasswordUser3_in_get_account,
48497 : .set = py_samr_ChangePasswordUser3_in_set_account,
48498 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
48499 : },
48500 : {
48501 : .name = discard_const_p(char, "in_nt_password"),
48502 : .get = py_samr_ChangePasswordUser3_in_get_nt_password,
48503 : .set = py_samr_ChangePasswordUser3_in_set_nt_password,
48504 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
48505 : },
48506 : {
48507 : .name = discard_const_p(char, "in_nt_verifier"),
48508 : .get = py_samr_ChangePasswordUser3_in_get_nt_verifier,
48509 : .set = py_samr_ChangePasswordUser3_in_set_nt_verifier,
48510 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
48511 : },
48512 : {
48513 : .name = discard_const_p(char, "in_lm_change"),
48514 : .get = py_samr_ChangePasswordUser3_in_get_lm_change,
48515 : .set = py_samr_ChangePasswordUser3_in_set_lm_change,
48516 : .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
48517 : },
48518 : {
48519 : .name = discard_const_p(char, "in_lm_password"),
48520 : .get = py_samr_ChangePasswordUser3_in_get_lm_password,
48521 : .set = py_samr_ChangePasswordUser3_in_set_lm_password,
48522 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
48523 : },
48524 : {
48525 : .name = discard_const_p(char, "in_lm_verifier"),
48526 : .get = py_samr_ChangePasswordUser3_in_get_lm_verifier,
48527 : .set = py_samr_ChangePasswordUser3_in_set_lm_verifier,
48528 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
48529 : },
48530 : {
48531 : .name = discard_const_p(char, "in_password3"),
48532 : .get = py_samr_ChangePasswordUser3_in_get_password3,
48533 : .set = py_samr_ChangePasswordUser3_in_set_password3,
48534 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_CryptPassword")
48535 : },
48536 : {
48537 : .name = discard_const_p(char, "out_dominfo"),
48538 : .get = py_samr_ChangePasswordUser3_out_get_dominfo,
48539 : .set = py_samr_ChangePasswordUser3_out_set_dominfo,
48540 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_DomInfo1")
48541 : },
48542 : {
48543 : .name = discard_const_p(char, "out_reject"),
48544 : .get = py_samr_ChangePasswordUser3_out_get_reject,
48545 : .set = py_samr_ChangePasswordUser3_out_set_reject,
48546 : .doc = discard_const_p(char, "PIDL-generated element of base type userPwdChangeFailureInformation")
48547 : },
48548 : {
48549 : .name = discard_const_p(char, "result"),
48550 : .get = py_samr_ChangePasswordUser3_get_result,
48551 : .set = py_samr_ChangePasswordUser3_set_result,
48552 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
48553 : },
48554 : { .name = NULL }
48555 : };
48556 :
48557 0 : static PyObject *py_samr_ChangePasswordUser3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
48558 : {
48559 0 : PyObject *self = pytalloc_new(struct samr_ChangePasswordUser3, type);
48560 0 : struct samr_ChangePasswordUser3 *_self = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(self);
48561 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
48562 0 : _self->in.account = talloc_zero(mem_ctx, struct lsa_String);
48563 : /* a pointer to a NULL pointer */
48564 0 : _self->out.dominfo = talloc_zero(mem_ctx, struct samr_DomInfo1 *);
48565 : /* a pointer to a NULL pointer */
48566 0 : _self->out.reject = talloc_zero(mem_ctx, struct userPwdChangeFailureInformation *);
48567 0 : return self;
48568 : }
48569 :
48570 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
48571 : {
48572 :
48573 :
48574 0 : return PyLong_FromLong(63);
48575 : }
48576 :
48577 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
48578 : {
48579 0 : const struct ndr_interface_call *call = NULL;
48580 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48581 0 : PyObject *ret = NULL;
48582 0 : struct ndr_push *push = NULL;
48583 0 : DATA_BLOB blob;
48584 0 : enum ndr_err_code err;
48585 :
48586 0 : if (ndr_table_samr.num_calls < 64) {
48587 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_pack");
48588 0 : return NULL;
48589 : }
48590 0 : call = &ndr_table_samr.calls[63];
48591 :
48592 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
48593 0 : if (push == NULL) {
48594 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48595 0 : return NULL;
48596 : }
48597 :
48598 0 : push->flags |= ndr_push_flags;
48599 :
48600 0 : err = call->ndr_push(push, ndr_inout_flags, object);
48601 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48602 0 : TALLOC_FREE(push);
48603 0 : PyErr_SetNdrError(err);
48604 0 : return NULL;
48605 : }
48606 0 : blob = ndr_push_blob(push);
48607 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
48608 0 : TALLOC_FREE(push);
48609 0 : return ret;
48610 : }
48611 :
48612 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48613 : {
48614 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48615 0 : PyObject *bigendian_obj = NULL;
48616 0 : PyObject *ndr64_obj = NULL;
48617 0 : libndr_flags ndr_push_flags = 0;
48618 :
48619 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
48620 : discard_const_p(char *, kwnames),
48621 : &bigendian_obj,
48622 : &ndr64_obj)) {
48623 0 : return NULL;
48624 : }
48625 :
48626 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48627 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48628 : }
48629 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48630 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48631 : }
48632 :
48633 0 : return py_samr_ChangePasswordUser3_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
48634 : }
48635 :
48636 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48637 : {
48638 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
48639 0 : PyObject *bigendian_obj = NULL;
48640 0 : PyObject *ndr64_obj = NULL;
48641 0 : libndr_flags ndr_push_flags = 0;
48642 :
48643 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
48644 : discard_const_p(char *, kwnames),
48645 : &bigendian_obj,
48646 : &ndr64_obj)) {
48647 0 : return NULL;
48648 : }
48649 :
48650 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48651 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
48652 : }
48653 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48654 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
48655 : }
48656 :
48657 0 : return py_samr_ChangePasswordUser3_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
48658 : }
48659 :
48660 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
48661 : {
48662 0 : const struct ndr_interface_call *call = NULL;
48663 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48664 0 : struct ndr_pull *pull = NULL;
48665 0 : enum ndr_err_code err;
48666 :
48667 0 : if (ndr_table_samr.num_calls < 64) {
48668 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_unpack");
48669 0 : return NULL;
48670 : }
48671 0 : call = &ndr_table_samr.calls[63];
48672 :
48673 0 : pull = ndr_pull_init_blob(blob, object);
48674 0 : if (pull == NULL) {
48675 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
48676 0 : return NULL;
48677 : }
48678 :
48679 0 : pull->flags |= ndr_pull_flags;
48680 :
48681 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
48682 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
48683 0 : TALLOC_FREE(pull);
48684 0 : PyErr_SetNdrError(err);
48685 0 : return NULL;
48686 : }
48687 0 : if (!allow_remaining) {
48688 0 : uint32_t highest_ofs;
48689 :
48690 0 : if (pull->offset > pull->relative_highest_offset) {
48691 0 : highest_ofs = pull->offset;
48692 : } else {
48693 0 : highest_ofs = pull->relative_highest_offset;
48694 : }
48695 0 : if (highest_ofs < pull->data_size) {
48696 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
48697 : "not all bytes consumed ofs[%u] size[%u]",
48698 : highest_ofs, pull->data_size);
48699 0 : TALLOC_FREE(pull);
48700 0 : PyErr_SetNdrError(err);
48701 0 : return NULL;
48702 : }
48703 : }
48704 :
48705 0 : TALLOC_FREE(pull);
48706 0 : Py_RETURN_NONE;
48707 : }
48708 :
48709 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48710 : {
48711 0 : DATA_BLOB blob;
48712 0 : Py_ssize_t blob_length = 0;
48713 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48714 0 : PyObject *bigendian_obj = NULL;
48715 0 : PyObject *ndr64_obj = NULL;
48716 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48717 0 : PyObject *allow_remaining_obj = NULL;
48718 0 : bool allow_remaining = false;
48719 :
48720 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
48721 : discard_const_p(char *, kwnames),
48722 : &blob.data, &blob_length,
48723 : &bigendian_obj,
48724 : &ndr64_obj,
48725 : &allow_remaining_obj)) {
48726 0 : return NULL;
48727 : }
48728 0 : blob.length = blob_length;
48729 :
48730 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48731 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48732 : }
48733 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48734 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48735 : }
48736 :
48737 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48738 0 : allow_remaining = true;
48739 : }
48740 :
48741 0 : return py_samr_ChangePasswordUser3_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
48742 : }
48743 :
48744 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
48745 : {
48746 0 : DATA_BLOB blob;
48747 0 : Py_ssize_t blob_length = 0;
48748 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
48749 0 : PyObject *bigendian_obj = NULL;
48750 0 : PyObject *ndr64_obj = NULL;
48751 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
48752 0 : PyObject *allow_remaining_obj = NULL;
48753 0 : bool allow_remaining = false;
48754 :
48755 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
48756 : discard_const_p(char *, kwnames),
48757 : &blob.data, &blob_length,
48758 : &bigendian_obj,
48759 : &ndr64_obj,
48760 : &allow_remaining_obj)) {
48761 0 : return NULL;
48762 : }
48763 0 : blob.length = blob_length;
48764 :
48765 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
48766 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
48767 : }
48768 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
48769 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
48770 : }
48771 :
48772 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
48773 0 : allow_remaining = true;
48774 : }
48775 :
48776 0 : return py_samr_ChangePasswordUser3_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
48777 : }
48778 :
48779 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
48780 : {
48781 0 : const struct ndr_interface_call *call = NULL;
48782 0 : struct samr_ChangePasswordUser3 *object = (struct samr_ChangePasswordUser3 *)pytalloc_get_ptr(py_obj);
48783 0 : PyObject *ret;
48784 0 : char *retstr;
48785 :
48786 0 : if (ndr_table_samr.num_calls < 64) {
48787 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser3_ndr_print");
48788 0 : return NULL;
48789 : }
48790 0 : call = &ndr_table_samr.calls[63];
48791 :
48792 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
48793 0 : ret = PyUnicode_FromString(retstr);
48794 0 : TALLOC_FREE(retstr);
48795 :
48796 0 : return ret;
48797 : }
48798 :
48799 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48800 : {
48801 0 : return py_samr_ChangePasswordUser3_ndr_print(py_obj, "samr_ChangePasswordUser3_in", NDR_IN);
48802 : }
48803 :
48804 0 : static PyObject *py_samr_ChangePasswordUser3_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
48805 : {
48806 0 : return py_samr_ChangePasswordUser3_ndr_print(py_obj, "samr_ChangePasswordUser3_out", NDR_OUT);
48807 : }
48808 :
48809 : static PyMethodDef py_samr_ChangePasswordUser3_methods[] = {
48810 : { "opnum", (PyCFunction)py_samr_ChangePasswordUser3_ndr_opnum, METH_NOARGS|METH_CLASS,
48811 : "samr.ChangePasswordUser3.opnum() -> 63 (0x3f) " },
48812 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser3_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
48813 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
48814 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser3_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
48815 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
48816 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser3_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
48817 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
48818 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser3_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
48819 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
48820 : { "__ndr_print_in__", (PyCFunction)py_samr_ChangePasswordUser3_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
48821 : { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser3_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
48822 : { NULL, NULL, 0, NULL }
48823 : };
48824 :
48825 :
48826 : static PyTypeObject samr_ChangePasswordUser3_Type = {
48827 : PyVarObject_HEAD_INIT(NULL, 0)
48828 : .tp_name = "samr.ChangePasswordUser3",
48829 : .tp_getset = py_samr_ChangePasswordUser3_getsetters,
48830 : .tp_methods = py_samr_ChangePasswordUser3_methods,
48831 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
48832 : .tp_new = py_samr_ChangePasswordUser3_new,
48833 : };
48834 :
48835 12 : static bool pack_py_samr_ChangePasswordUser3_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser3 *r)
48836 : {
48837 0 : PyObject *py_server;
48838 0 : PyObject *py_account;
48839 0 : PyObject *py_nt_password;
48840 0 : PyObject *py_nt_verifier;
48841 0 : PyObject *py_lm_change;
48842 0 : PyObject *py_lm_password;
48843 0 : PyObject *py_lm_verifier;
48844 0 : PyObject *py_password3;
48845 12 : const char *kwnames[] = {
48846 : "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", "password3", NULL
48847 : };
48848 :
48849 12 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:samr_ChangePasswordUser3", discard_const_p(char *, kwnames), &py_server, &py_account, &py_nt_password, &py_nt_verifier, &py_lm_change, &py_lm_password, &py_lm_verifier, &py_password3)) {
48850 0 : return false;
48851 : }
48852 :
48853 12 : if (py_server == NULL) {
48854 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server");
48855 0 : return false;
48856 : }
48857 12 : if (py_server == Py_None) {
48858 0 : r->in.server = NULL;
48859 : } else {
48860 12 : r->in.server = NULL;
48861 12 : PY_CHECK_TYPE(lsa_String_Type, py_server, return false;);
48862 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
48863 0 : PyErr_NoMemory();
48864 0 : return false;
48865 : }
48866 12 : r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
48867 : }
48868 12 : if (py_account == NULL) {
48869 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account");
48870 0 : return false;
48871 : }
48872 12 : r->in.account = talloc_ptrtype(r, r->in.account);
48873 12 : if (r->in.account == NULL) {
48874 0 : PyErr_NoMemory();
48875 0 : return false;
48876 : }
48877 12 : PY_CHECK_TYPE(lsa_String_Type, py_account, return false;);
48878 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
48879 0 : PyErr_NoMemory();
48880 0 : return false;
48881 : }
48882 12 : r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account);
48883 12 : if (py_nt_password == NULL) {
48884 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_password");
48885 0 : return false;
48886 : }
48887 12 : if (py_nt_password == Py_None) {
48888 0 : r->in.nt_password = NULL;
48889 : } else {
48890 12 : r->in.nt_password = NULL;
48891 12 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;);
48892 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) {
48893 0 : PyErr_NoMemory();
48894 0 : return false;
48895 : }
48896 12 : r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
48897 : }
48898 12 : if (py_nt_verifier == NULL) {
48899 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.nt_verifier");
48900 0 : return false;
48901 : }
48902 12 : if (py_nt_verifier == Py_None) {
48903 0 : r->in.nt_verifier = NULL;
48904 : } else {
48905 12 : r->in.nt_verifier = NULL;
48906 12 : PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;);
48907 12 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) {
48908 0 : PyErr_NoMemory();
48909 0 : return false;
48910 : }
48911 12 : r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
48912 : }
48913 12 : if (py_lm_change == NULL) {
48914 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_change");
48915 0 : return false;
48916 : }
48917 : {
48918 12 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.lm_change));
48919 12 : if (PyLong_Check(py_lm_change)) {
48920 0 : unsigned long long test_var;
48921 12 : test_var = PyLong_AsUnsignedLongLong(py_lm_change);
48922 12 : if (PyErr_Occurred() != NULL) {
48923 0 : return false;
48924 : }
48925 12 : if (test_var > uint_max) {
48926 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
48927 : PyLong_Type.tp_name, uint_max, test_var);
48928 0 : return false;
48929 : }
48930 12 : r->in.lm_change = test_var;
48931 : } else {
48932 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
48933 : PyLong_Type.tp_name);
48934 0 : return false;
48935 : }
48936 : }
48937 12 : if (py_lm_password == NULL) {
48938 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_password");
48939 0 : return false;
48940 : }
48941 12 : if (py_lm_password == Py_None) {
48942 12 : r->in.lm_password = NULL;
48943 : } else {
48944 0 : r->in.lm_password = NULL;
48945 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;);
48946 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) {
48947 0 : PyErr_NoMemory();
48948 0 : return false;
48949 : }
48950 0 : r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
48951 : }
48952 12 : if (py_lm_verifier == NULL) {
48953 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.lm_verifier");
48954 0 : return false;
48955 : }
48956 12 : if (py_lm_verifier == Py_None) {
48957 12 : r->in.lm_verifier = NULL;
48958 : } else {
48959 0 : r->in.lm_verifier = NULL;
48960 0 : PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;);
48961 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) {
48962 0 : PyErr_NoMemory();
48963 0 : return false;
48964 : }
48965 0 : r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
48966 : }
48967 12 : if (py_password3 == NULL) {
48968 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password3");
48969 0 : return false;
48970 : }
48971 12 : if (py_password3 == Py_None) {
48972 12 : r->in.password3 = NULL;
48973 : } else {
48974 0 : r->in.password3 = NULL;
48975 0 : PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password3, return false;);
48976 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_password3)) == NULL) {
48977 0 : PyErr_NoMemory();
48978 0 : return false;
48979 : }
48980 0 : r->in.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password3);
48981 : }
48982 12 : return true;
48983 : }
48984 :
48985 12 : static PyObject *unpack_py_samr_ChangePasswordUser3_args_out(struct samr_ChangePasswordUser3 *r)
48986 : {
48987 0 : PyObject *result;
48988 0 : PyObject *py_dominfo;
48989 0 : PyObject *py_reject;
48990 12 : result = PyTuple_New(2);
48991 12 : if (*r->out.dominfo == NULL) {
48992 12 : py_dominfo = Py_None;
48993 6 : Py_INCREF(py_dominfo);
48994 : } else {
48995 0 : py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo);
48996 : }
48997 12 : PyTuple_SetItem(result, 0, py_dominfo);
48998 12 : if (*r->out.reject == NULL) {
48999 12 : py_reject = Py_None;
49000 6 : Py_INCREF(py_reject);
49001 : } else {
49002 0 : py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *r->out.reject, *r->out.reject);
49003 : }
49004 12 : PyTuple_SetItem(result, 1, py_reject);
49005 12 : if (NT_STATUS_IS_ERR(r->out.result)) {
49006 0 : PyErr_SetNTSTATUS(r->out.result);
49007 0 : return NULL;
49008 : }
49009 :
49010 12 : return result;
49011 : }
49012 :
49013 :
49014 0 : static PyObject *py_samr_Connect5_in_get_system_name(PyObject *obj, void *closure)
49015 : {
49016 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49017 0 : PyObject *py_system_name;
49018 0 : if (object->in.system_name == NULL) {
49019 0 : Py_RETURN_NONE;
49020 : }
49021 0 : if (object->in.system_name == NULL) {
49022 0 : py_system_name = Py_None;
49023 0 : Py_INCREF(py_system_name);
49024 : } else {
49025 0 : if (object->in.system_name == NULL) {
49026 0 : py_system_name = Py_None;
49027 0 : Py_INCREF(py_system_name);
49028 : } else {
49029 0 : py_system_name = PyUnicode_Decode(object->in.system_name, strlen(object->in.system_name), "utf-8", "ignore");
49030 : }
49031 : }
49032 0 : return py_system_name;
49033 : }
49034 :
49035 0 : static int py_samr_Connect5_in_set_system_name(PyObject *py_obj, PyObject *value, void *closure)
49036 : {
49037 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49038 0 : if (value == NULL) {
49039 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.system_name");
49040 0 : return -1;
49041 : }
49042 0 : if (value == Py_None) {
49043 0 : object->in.system_name = NULL;
49044 : } else {
49045 0 : object->in.system_name = NULL;
49046 : {
49047 0 : const char *test_str;
49048 0 : const char *talloc_str;
49049 0 : PyObject *unicode = NULL;
49050 0 : if (PyUnicode_Check(value)) {
49051 0 : unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
49052 0 : if (unicode == NULL) {
49053 0 : return -1;
49054 : }
49055 0 : test_str = PyBytes_AS_STRING(unicode);
49056 0 : } else if (PyBytes_Check(value)) {
49057 0 : test_str = PyBytes_AS_STRING(value);
49058 : } else {
49059 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
49060 0 : return -1;
49061 : }
49062 0 : talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
49063 0 : if (unicode != NULL) {
49064 0 : Py_DECREF(unicode);
49065 : }
49066 0 : if (talloc_str == NULL) {
49067 0 : PyErr_NoMemory();
49068 0 : return -1;
49069 : }
49070 0 : object->in.system_name = talloc_str;
49071 : }
49072 : }
49073 0 : return 0;
49074 : }
49075 :
49076 0 : static PyObject *py_samr_Connect5_in_get_access_mask(PyObject *obj, void *closure)
49077 : {
49078 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49079 0 : PyObject *py_access_mask;
49080 0 : py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)object->in.access_mask);
49081 0 : return py_access_mask;
49082 : }
49083 :
49084 0 : static int py_samr_Connect5_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
49085 : {
49086 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49087 0 : if (value == NULL) {
49088 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.access_mask");
49089 0 : return -1;
49090 : }
49091 : {
49092 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
49093 0 : if (PyLong_Check(value)) {
49094 0 : unsigned long long test_var;
49095 0 : test_var = PyLong_AsUnsignedLongLong(value);
49096 0 : if (PyErr_Occurred() != NULL) {
49097 0 : return -1;
49098 : }
49099 0 : if (test_var > uint_max) {
49100 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49101 : PyLong_Type.tp_name, uint_max, test_var);
49102 0 : return -1;
49103 : }
49104 0 : object->in.access_mask = test_var;
49105 : } else {
49106 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49107 : PyLong_Type.tp_name);
49108 0 : return -1;
49109 : }
49110 : }
49111 0 : return 0;
49112 : }
49113 :
49114 0 : static PyObject *py_samr_Connect5_in_get_level_in(PyObject *obj, void *closure)
49115 : {
49116 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49117 0 : PyObject *py_level_in;
49118 0 : py_level_in = PyLong_FromUnsignedLongLong((uint32_t)object->in.level_in);
49119 0 : return py_level_in;
49120 : }
49121 :
49122 0 : static int py_samr_Connect5_in_set_level_in(PyObject *py_obj, PyObject *value, void *closure)
49123 : {
49124 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49125 0 : if (value == NULL) {
49126 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level_in");
49127 0 : return -1;
49128 : }
49129 : {
49130 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level_in));
49131 0 : if (PyLong_Check(value)) {
49132 0 : unsigned long long test_var;
49133 0 : test_var = PyLong_AsUnsignedLongLong(value);
49134 0 : if (PyErr_Occurred() != NULL) {
49135 0 : return -1;
49136 : }
49137 0 : if (test_var > uint_max) {
49138 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49139 : PyLong_Type.tp_name, uint_max, test_var);
49140 0 : return -1;
49141 : }
49142 0 : object->in.level_in = test_var;
49143 : } else {
49144 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49145 : PyLong_Type.tp_name);
49146 0 : return -1;
49147 : }
49148 : }
49149 0 : return 0;
49150 : }
49151 :
49152 0 : static PyObject *py_samr_Connect5_in_get_info_in(PyObject *obj, void *closure)
49153 : {
49154 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49155 0 : PyObject *py_info_in;
49156 0 : if (object->in.info_in == NULL) {
49157 0 : Py_RETURN_NONE;
49158 : }
49159 0 : py_info_in = pyrpc_import_union(&samr_ConnectInfo_Type, object->in.info_in, object->in.level_in, object->in.info_in, "union samr_ConnectInfo");
49160 0 : if (py_info_in == NULL) {
49161 0 : return NULL;
49162 : }
49163 0 : return py_info_in;
49164 : }
49165 :
49166 0 : static int py_samr_Connect5_in_set_info_in(PyObject *py_obj, PyObject *value, void *closure)
49167 : {
49168 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49169 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_in));
49170 0 : if (value == NULL) {
49171 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.info_in");
49172 0 : return -1;
49173 : }
49174 0 : object->in.info_in = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_in);
49175 0 : if (object->in.info_in == NULL) {
49176 0 : PyErr_NoMemory();
49177 0 : return -1;
49178 : }
49179 : {
49180 0 : union samr_ConnectInfo *info_in_switch_1;
49181 0 : info_in_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level_in, value, "union samr_ConnectInfo");
49182 0 : if (info_in_switch_1 == NULL) {
49183 0 : return -1;
49184 : }
49185 0 : object->in.info_in = info_in_switch_1;
49186 : }
49187 0 : return 0;
49188 : }
49189 :
49190 0 : static PyObject *py_samr_Connect5_out_get_level_out(PyObject *obj, void *closure)
49191 : {
49192 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49193 0 : PyObject *py_level_out;
49194 0 : if (object->out.level_out == NULL) {
49195 0 : Py_RETURN_NONE;
49196 : }
49197 0 : py_level_out = PyLong_FromUnsignedLongLong((uint32_t)*object->out.level_out);
49198 0 : return py_level_out;
49199 : }
49200 :
49201 0 : static int py_samr_Connect5_out_set_level_out(PyObject *py_obj, PyObject *value, void *closure)
49202 : {
49203 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49204 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.level_out));
49205 0 : if (value == NULL) {
49206 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.level_out");
49207 0 : return -1;
49208 : }
49209 0 : object->out.level_out = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.level_out);
49210 0 : if (object->out.level_out == NULL) {
49211 0 : PyErr_NoMemory();
49212 0 : return -1;
49213 : }
49214 : {
49215 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.level_out));
49216 0 : if (PyLong_Check(value)) {
49217 0 : unsigned long long test_var;
49218 0 : test_var = PyLong_AsUnsignedLongLong(value);
49219 0 : if (PyErr_Occurred() != NULL) {
49220 0 : return -1;
49221 : }
49222 0 : if (test_var > uint_max) {
49223 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49224 : PyLong_Type.tp_name, uint_max, test_var);
49225 0 : return -1;
49226 : }
49227 0 : *object->out.level_out = test_var;
49228 : } else {
49229 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49230 : PyLong_Type.tp_name);
49231 0 : return -1;
49232 : }
49233 : }
49234 0 : return 0;
49235 : }
49236 :
49237 0 : static PyObject *py_samr_Connect5_out_get_info_out(PyObject *obj, void *closure)
49238 : {
49239 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49240 0 : PyObject *py_info_out;
49241 0 : if (object->out.info_out == NULL) {
49242 0 : Py_RETURN_NONE;
49243 : }
49244 0 : py_info_out = pyrpc_import_union(&samr_ConnectInfo_Type, object->out.info_out, *object->out.level_out, object->out.info_out, "union samr_ConnectInfo");
49245 0 : if (py_info_out == NULL) {
49246 0 : return NULL;
49247 : }
49248 0 : return py_info_out;
49249 : }
49250 :
49251 0 : static int py_samr_Connect5_out_set_info_out(PyObject *py_obj, PyObject *value, void *closure)
49252 : {
49253 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49254 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info_out));
49255 0 : if (value == NULL) {
49256 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.info_out");
49257 0 : return -1;
49258 : }
49259 0 : object->out.info_out = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info_out);
49260 0 : if (object->out.info_out == NULL) {
49261 0 : PyErr_NoMemory();
49262 0 : return -1;
49263 : }
49264 : {
49265 0 : union samr_ConnectInfo *info_out_switch_1;
49266 0 : info_out_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, pytalloc_get_mem_ctx(py_obj), *object->out.level_out, value, "union samr_ConnectInfo");
49267 0 : if (info_out_switch_1 == NULL) {
49268 0 : return -1;
49269 : }
49270 0 : object->out.info_out = info_out_switch_1;
49271 : }
49272 0 : return 0;
49273 : }
49274 :
49275 0 : static PyObject *py_samr_Connect5_out_get_connect_handle(PyObject *obj, void *closure)
49276 : {
49277 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49278 0 : PyObject *py_connect_handle;
49279 0 : if (object->out.connect_handle == NULL) {
49280 0 : Py_RETURN_NONE;
49281 : }
49282 0 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, object->out.connect_handle, object->out.connect_handle);
49283 0 : return py_connect_handle;
49284 : }
49285 :
49286 0 : static int py_samr_Connect5_out_set_connect_handle(PyObject *py_obj, PyObject *value, void *closure)
49287 : {
49288 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49289 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.connect_handle));
49290 0 : if (value == NULL) {
49291 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.connect_handle");
49292 0 : return -1;
49293 : }
49294 0 : object->out.connect_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.connect_handle);
49295 0 : if (object->out.connect_handle == NULL) {
49296 0 : PyErr_NoMemory();
49297 0 : return -1;
49298 : }
49299 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
49300 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49301 0 : PyErr_NoMemory();
49302 0 : return -1;
49303 : }
49304 0 : object->out.connect_handle = (struct policy_handle *)pytalloc_get_ptr(value);
49305 0 : return 0;
49306 : }
49307 :
49308 0 : static PyObject *py_samr_Connect5_get_result(PyObject *obj, void *closure)
49309 : {
49310 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(obj);
49311 0 : PyObject *py_result;
49312 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
49313 0 : return py_result;
49314 : }
49315 :
49316 0 : static int py_samr_Connect5_set_result(PyObject *py_obj, PyObject *value, void *closure)
49317 : {
49318 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49319 0 : if (value == NULL) {
49320 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
49321 0 : return -1;
49322 : }
49323 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
49324 0 : return 0;
49325 : }
49326 :
49327 : static PyGetSetDef py_samr_Connect5_getsetters[] = {
49328 : {
49329 : .name = discard_const_p(char, "in_system_name"),
49330 : .get = py_samr_Connect5_in_get_system_name,
49331 : .set = py_samr_Connect5_in_set_system_name,
49332 : .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
49333 : },
49334 : {
49335 : .name = discard_const_p(char, "in_access_mask"),
49336 : .get = py_samr_Connect5_in_get_access_mask,
49337 : .set = py_samr_Connect5_in_set_access_mask,
49338 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectAccessMask")
49339 : },
49340 : {
49341 : .name = discard_const_p(char, "in_level_in"),
49342 : .get = py_samr_Connect5_in_get_level_in,
49343 : .set = py_samr_Connect5_in_set_level_in,
49344 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
49345 : },
49346 : {
49347 : .name = discard_const_p(char, "in_info_in"),
49348 : .get = py_samr_Connect5_in_get_info_in,
49349 : .set = py_samr_Connect5_in_set_info_in,
49350 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectInfo")
49351 : },
49352 : {
49353 : .name = discard_const_p(char, "out_level_out"),
49354 : .get = py_samr_Connect5_out_get_level_out,
49355 : .set = py_samr_Connect5_out_set_level_out,
49356 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
49357 : },
49358 : {
49359 : .name = discard_const_p(char, "out_info_out"),
49360 : .get = py_samr_Connect5_out_get_info_out,
49361 : .set = py_samr_Connect5_out_set_info_out,
49362 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ConnectInfo")
49363 : },
49364 : {
49365 : .name = discard_const_p(char, "out_connect_handle"),
49366 : .get = py_samr_Connect5_out_get_connect_handle,
49367 : .set = py_samr_Connect5_out_set_connect_handle,
49368 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
49369 : },
49370 : {
49371 : .name = discard_const_p(char, "result"),
49372 : .get = py_samr_Connect5_get_result,
49373 : .set = py_samr_Connect5_set_result,
49374 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
49375 : },
49376 : { .name = NULL }
49377 : };
49378 :
49379 0 : static PyObject *py_samr_Connect5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
49380 : {
49381 0 : PyObject *self = pytalloc_new(struct samr_Connect5, type);
49382 0 : struct samr_Connect5 *_self = (struct samr_Connect5 *)pytalloc_get_ptr(self);
49383 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
49384 0 : _self->in.info_in = talloc_zero(mem_ctx, union samr_ConnectInfo);
49385 0 : _self->out.level_out = talloc_zero(mem_ctx, uint32_t);
49386 0 : _self->out.info_out = talloc_zero(mem_ctx, union samr_ConnectInfo);
49387 0 : _self->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
49388 0 : return self;
49389 : }
49390 :
49391 0 : static PyObject *py_samr_Connect5_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
49392 : {
49393 :
49394 :
49395 0 : return PyLong_FromLong(64);
49396 : }
49397 :
49398 0 : static PyObject *py_samr_Connect5_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
49399 : {
49400 0 : const struct ndr_interface_call *call = NULL;
49401 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49402 0 : PyObject *ret = NULL;
49403 0 : struct ndr_push *push = NULL;
49404 0 : DATA_BLOB blob;
49405 0 : enum ndr_err_code err;
49406 :
49407 0 : if (ndr_table_samr.num_calls < 65) {
49408 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_pack");
49409 0 : return NULL;
49410 : }
49411 0 : call = &ndr_table_samr.calls[64];
49412 :
49413 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
49414 0 : if (push == NULL) {
49415 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49416 0 : return NULL;
49417 : }
49418 :
49419 0 : push->flags |= ndr_push_flags;
49420 :
49421 0 : err = call->ndr_push(push, ndr_inout_flags, object);
49422 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49423 0 : TALLOC_FREE(push);
49424 0 : PyErr_SetNdrError(err);
49425 0 : return NULL;
49426 : }
49427 0 : blob = ndr_push_blob(push);
49428 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
49429 0 : TALLOC_FREE(push);
49430 0 : return ret;
49431 : }
49432 :
49433 0 : static PyObject *py_samr_Connect5_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49434 : {
49435 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49436 0 : PyObject *bigendian_obj = NULL;
49437 0 : PyObject *ndr64_obj = NULL;
49438 0 : libndr_flags ndr_push_flags = 0;
49439 :
49440 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
49441 : discard_const_p(char *, kwnames),
49442 : &bigendian_obj,
49443 : &ndr64_obj)) {
49444 0 : return NULL;
49445 : }
49446 :
49447 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49448 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49449 : }
49450 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49451 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49452 : }
49453 :
49454 0 : return py_samr_Connect5_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
49455 : }
49456 :
49457 0 : static PyObject *py_samr_Connect5_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49458 : {
49459 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
49460 0 : PyObject *bigendian_obj = NULL;
49461 0 : PyObject *ndr64_obj = NULL;
49462 0 : libndr_flags ndr_push_flags = 0;
49463 :
49464 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
49465 : discard_const_p(char *, kwnames),
49466 : &bigendian_obj,
49467 : &ndr64_obj)) {
49468 0 : return NULL;
49469 : }
49470 :
49471 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49472 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
49473 : }
49474 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49475 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
49476 : }
49477 :
49478 0 : return py_samr_Connect5_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
49479 : }
49480 :
49481 0 : static PyObject *py_samr_Connect5_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
49482 : {
49483 0 : const struct ndr_interface_call *call = NULL;
49484 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49485 0 : struct ndr_pull *pull = NULL;
49486 0 : enum ndr_err_code err;
49487 :
49488 0 : if (ndr_table_samr.num_calls < 65) {
49489 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_unpack");
49490 0 : return NULL;
49491 : }
49492 0 : call = &ndr_table_samr.calls[64];
49493 :
49494 0 : pull = ndr_pull_init_blob(blob, object);
49495 0 : if (pull == NULL) {
49496 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49497 0 : return NULL;
49498 : }
49499 :
49500 0 : pull->flags |= ndr_pull_flags;
49501 :
49502 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
49503 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
49504 0 : TALLOC_FREE(pull);
49505 0 : PyErr_SetNdrError(err);
49506 0 : return NULL;
49507 : }
49508 0 : if (!allow_remaining) {
49509 0 : uint32_t highest_ofs;
49510 :
49511 0 : if (pull->offset > pull->relative_highest_offset) {
49512 0 : highest_ofs = pull->offset;
49513 : } else {
49514 0 : highest_ofs = pull->relative_highest_offset;
49515 : }
49516 0 : if (highest_ofs < pull->data_size) {
49517 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
49518 : "not all bytes consumed ofs[%u] size[%u]",
49519 : highest_ofs, pull->data_size);
49520 0 : TALLOC_FREE(pull);
49521 0 : PyErr_SetNdrError(err);
49522 0 : return NULL;
49523 : }
49524 : }
49525 :
49526 0 : TALLOC_FREE(pull);
49527 0 : Py_RETURN_NONE;
49528 : }
49529 :
49530 0 : static PyObject *py_samr_Connect5_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49531 : {
49532 0 : DATA_BLOB blob;
49533 0 : Py_ssize_t blob_length = 0;
49534 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49535 0 : PyObject *bigendian_obj = NULL;
49536 0 : PyObject *ndr64_obj = NULL;
49537 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49538 0 : PyObject *allow_remaining_obj = NULL;
49539 0 : bool allow_remaining = false;
49540 :
49541 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
49542 : discard_const_p(char *, kwnames),
49543 : &blob.data, &blob_length,
49544 : &bigendian_obj,
49545 : &ndr64_obj,
49546 : &allow_remaining_obj)) {
49547 0 : return NULL;
49548 : }
49549 0 : blob.length = blob_length;
49550 :
49551 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49552 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49553 : }
49554 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49555 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49556 : }
49557 :
49558 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49559 0 : allow_remaining = true;
49560 : }
49561 :
49562 0 : return py_samr_Connect5_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
49563 : }
49564 :
49565 0 : static PyObject *py_samr_Connect5_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
49566 : {
49567 0 : DATA_BLOB blob;
49568 0 : Py_ssize_t blob_length = 0;
49569 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
49570 0 : PyObject *bigendian_obj = NULL;
49571 0 : PyObject *ndr64_obj = NULL;
49572 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
49573 0 : PyObject *allow_remaining_obj = NULL;
49574 0 : bool allow_remaining = false;
49575 :
49576 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
49577 : discard_const_p(char *, kwnames),
49578 : &blob.data, &blob_length,
49579 : &bigendian_obj,
49580 : &ndr64_obj,
49581 : &allow_remaining_obj)) {
49582 0 : return NULL;
49583 : }
49584 0 : blob.length = blob_length;
49585 :
49586 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
49587 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
49588 : }
49589 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
49590 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
49591 : }
49592 :
49593 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
49594 0 : allow_remaining = true;
49595 : }
49596 :
49597 0 : return py_samr_Connect5_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
49598 : }
49599 :
49600 0 : static PyObject *py_samr_Connect5_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
49601 : {
49602 0 : const struct ndr_interface_call *call = NULL;
49603 0 : struct samr_Connect5 *object = (struct samr_Connect5 *)pytalloc_get_ptr(py_obj);
49604 0 : PyObject *ret;
49605 0 : char *retstr;
49606 :
49607 0 : if (ndr_table_samr.num_calls < 65) {
49608 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_Connect5_ndr_print");
49609 0 : return NULL;
49610 : }
49611 0 : call = &ndr_table_samr.calls[64];
49612 :
49613 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
49614 0 : ret = PyUnicode_FromString(retstr);
49615 0 : TALLOC_FREE(retstr);
49616 :
49617 0 : return ret;
49618 : }
49619 :
49620 0 : static PyObject *py_samr_Connect5_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49621 : {
49622 0 : return py_samr_Connect5_ndr_print(py_obj, "samr_Connect5_in", NDR_IN);
49623 : }
49624 :
49625 0 : static PyObject *py_samr_Connect5_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
49626 : {
49627 0 : return py_samr_Connect5_ndr_print(py_obj, "samr_Connect5_out", NDR_OUT);
49628 : }
49629 :
49630 : static PyMethodDef py_samr_Connect5_methods[] = {
49631 : { "opnum", (PyCFunction)py_samr_Connect5_ndr_opnum, METH_NOARGS|METH_CLASS,
49632 : "samr.Connect5.opnum() -> 64 (0x40) " },
49633 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect5_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
49634 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
49635 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect5_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
49636 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
49637 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect5_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
49638 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
49639 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_Connect5_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
49640 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
49641 : { "__ndr_print_in__", (PyCFunction)py_samr_Connect5_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
49642 : { "__ndr_print_out__", (PyCFunction)py_samr_Connect5_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
49643 : { NULL, NULL, 0, NULL }
49644 : };
49645 :
49646 :
49647 : static PyTypeObject samr_Connect5_Type = {
49648 : PyVarObject_HEAD_INIT(NULL, 0)
49649 : .tp_name = "samr.Connect5",
49650 : .tp_getset = py_samr_Connect5_getsetters,
49651 : .tp_methods = py_samr_Connect5_methods,
49652 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
49653 : .tp_new = py_samr_Connect5_new,
49654 : };
49655 :
49656 1 : static bool pack_py_samr_Connect5_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect5 *r)
49657 : {
49658 0 : PyObject *py_system_name;
49659 0 : PyObject *py_access_mask;
49660 0 : PyObject *py_level_in;
49661 0 : PyObject *py_info_in;
49662 1 : const char *kwnames[] = {
49663 : "system_name", "access_mask", "level_in", "info_in", NULL
49664 : };
49665 :
49666 1 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_Connect5", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask, &py_level_in, &py_info_in)) {
49667 0 : return false;
49668 : }
49669 :
49670 1 : if (py_system_name == NULL) {
49671 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.system_name");
49672 0 : return false;
49673 : }
49674 1 : if (py_system_name == Py_None) {
49675 1 : r->in.system_name = NULL;
49676 : } else {
49677 0 : r->in.system_name = NULL;
49678 : {
49679 0 : const char *test_str;
49680 0 : const char *talloc_str;
49681 0 : PyObject *unicode = NULL;
49682 0 : if (PyUnicode_Check(py_system_name)) {
49683 0 : unicode = PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore");
49684 0 : if (unicode == NULL) {
49685 0 : return false;
49686 : }
49687 0 : test_str = PyBytes_AS_STRING(unicode);
49688 0 : } else if (PyBytes_Check(py_system_name)) {
49689 0 : test_str = PyBytes_AS_STRING(py_system_name);
49690 : } else {
49691 0 : PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
49692 0 : return false;
49693 : }
49694 0 : talloc_str = talloc_strdup(r, test_str);
49695 0 : if (unicode != NULL) {
49696 0 : Py_DECREF(unicode);
49697 : }
49698 0 : if (talloc_str == NULL) {
49699 0 : PyErr_NoMemory();
49700 0 : return false;
49701 : }
49702 0 : r->in.system_name = talloc_str;
49703 : }
49704 : }
49705 1 : if (py_access_mask == NULL) {
49706 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.access_mask");
49707 0 : return false;
49708 : }
49709 : {
49710 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
49711 1 : if (PyLong_Check(py_access_mask)) {
49712 0 : unsigned long long test_var;
49713 1 : test_var = PyLong_AsUnsignedLongLong(py_access_mask);
49714 1 : if (PyErr_Occurred() != NULL) {
49715 0 : return false;
49716 : }
49717 1 : if (test_var > uint_max) {
49718 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49719 : PyLong_Type.tp_name, uint_max, test_var);
49720 0 : return false;
49721 : }
49722 1 : r->in.access_mask = test_var;
49723 : } else {
49724 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49725 : PyLong_Type.tp_name);
49726 0 : return false;
49727 : }
49728 : }
49729 1 : if (py_level_in == NULL) {
49730 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level_in");
49731 0 : return false;
49732 : }
49733 : {
49734 1 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level_in));
49735 1 : if (PyLong_Check(py_level_in)) {
49736 0 : unsigned long long test_var;
49737 1 : test_var = PyLong_AsUnsignedLongLong(py_level_in);
49738 1 : if (PyErr_Occurred() != NULL) {
49739 0 : return false;
49740 : }
49741 1 : if (test_var > uint_max) {
49742 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49743 : PyLong_Type.tp_name, uint_max, test_var);
49744 0 : return false;
49745 : }
49746 1 : r->in.level_in = test_var;
49747 : } else {
49748 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49749 : PyLong_Type.tp_name);
49750 0 : return false;
49751 : }
49752 : }
49753 1 : if (py_info_in == NULL) {
49754 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.info_in");
49755 0 : return false;
49756 : }
49757 1 : r->in.info_in = talloc_ptrtype(r, r->in.info_in);
49758 1 : if (r->in.info_in == NULL) {
49759 0 : PyErr_NoMemory();
49760 0 : return false;
49761 : }
49762 : {
49763 0 : union samr_ConnectInfo *info_in_switch_1;
49764 1 : info_in_switch_1 = (union samr_ConnectInfo *)pyrpc_export_union(&samr_ConnectInfo_Type, r, r->in.level_in, py_info_in, "union samr_ConnectInfo");
49765 1 : if (info_in_switch_1 == NULL) {
49766 0 : return false;
49767 : }
49768 1 : r->in.info_in = info_in_switch_1;
49769 : }
49770 1 : return true;
49771 : }
49772 :
49773 1 : static PyObject *unpack_py_samr_Connect5_args_out(struct samr_Connect5 *r)
49774 : {
49775 0 : PyObject *result;
49776 0 : PyObject *py_level_out;
49777 0 : PyObject *py_info_out;
49778 0 : PyObject *py_connect_handle;
49779 1 : result = PyTuple_New(3);
49780 1 : py_level_out = PyLong_FromUnsignedLongLong((uint32_t)*r->out.level_out);
49781 1 : PyTuple_SetItem(result, 0, py_level_out);
49782 1 : py_info_out = pyrpc_import_union(&samr_ConnectInfo_Type, r->out.info_out, *r->out.level_out, r->out.info_out, "union samr_ConnectInfo");
49783 1 : if (py_info_out == NULL) {
49784 0 : return NULL;
49785 : }
49786 1 : PyTuple_SetItem(result, 1, py_info_out);
49787 1 : py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
49788 1 : PyTuple_SetItem(result, 2, py_connect_handle);
49789 1 : if (NT_STATUS_IS_ERR(r->out.result)) {
49790 0 : PyErr_SetNTSTATUS(r->out.result);
49791 0 : return NULL;
49792 : }
49793 :
49794 1 : return result;
49795 : }
49796 :
49797 :
49798 0 : static PyObject *py_samr_RidToSid_in_get_domain_handle(PyObject *obj, void *closure)
49799 : {
49800 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj);
49801 0 : PyObject *py_domain_handle;
49802 0 : if (object->in.domain_handle == NULL) {
49803 0 : Py_RETURN_NONE;
49804 : }
49805 0 : py_domain_handle = pytalloc_reference_ex(policy_handle_Type, object->in.domain_handle, object->in.domain_handle);
49806 0 : return py_domain_handle;
49807 : }
49808 :
49809 0 : static int py_samr_RidToSid_in_set_domain_handle(PyObject *py_obj, PyObject *value, void *closure)
49810 : {
49811 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
49812 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.domain_handle));
49813 0 : if (value == NULL) {
49814 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.domain_handle");
49815 0 : return -1;
49816 : }
49817 0 : object->in.domain_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.domain_handle);
49818 0 : if (object->in.domain_handle == NULL) {
49819 0 : PyErr_NoMemory();
49820 0 : return -1;
49821 : }
49822 0 : PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
49823 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49824 0 : PyErr_NoMemory();
49825 0 : return -1;
49826 : }
49827 0 : object->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(value);
49828 0 : return 0;
49829 : }
49830 :
49831 0 : static PyObject *py_samr_RidToSid_in_get_rid(PyObject *obj, void *closure)
49832 : {
49833 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj);
49834 0 : PyObject *py_rid;
49835 0 : py_rid = PyLong_FromUnsignedLongLong((uint32_t)object->in.rid);
49836 0 : return py_rid;
49837 : }
49838 :
49839 0 : static int py_samr_RidToSid_in_set_rid(PyObject *py_obj, PyObject *value, void *closure)
49840 : {
49841 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
49842 0 : if (value == NULL) {
49843 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.rid");
49844 0 : return -1;
49845 : }
49846 : {
49847 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.rid));
49848 0 : if (PyLong_Check(value)) {
49849 0 : unsigned long long test_var;
49850 0 : test_var = PyLong_AsUnsignedLongLong(value);
49851 0 : if (PyErr_Occurred() != NULL) {
49852 0 : return -1;
49853 : }
49854 0 : if (test_var > uint_max) {
49855 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
49856 : PyLong_Type.tp_name, uint_max, test_var);
49857 0 : return -1;
49858 : }
49859 0 : object->in.rid = test_var;
49860 : } else {
49861 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
49862 : PyLong_Type.tp_name);
49863 0 : return -1;
49864 : }
49865 : }
49866 0 : return 0;
49867 : }
49868 :
49869 0 : static PyObject *py_samr_RidToSid_out_get_sid(PyObject *obj, void *closure)
49870 : {
49871 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj);
49872 0 : PyObject *py_sid;
49873 0 : if (object->out.sid == NULL) {
49874 0 : Py_RETURN_NONE;
49875 : }
49876 0 : if (*object->out.sid == NULL) {
49877 0 : py_sid = Py_None;
49878 0 : Py_INCREF(py_sid);
49879 : } else {
49880 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, *object->out.sid, *object->out.sid);
49881 : }
49882 0 : return py_sid;
49883 : }
49884 :
49885 0 : static int py_samr_RidToSid_out_set_sid(PyObject *py_obj, PyObject *value, void *closure)
49886 : {
49887 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
49888 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.sid));
49889 0 : if (value == NULL) {
49890 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.sid");
49891 0 : return -1;
49892 : }
49893 0 : object->out.sid = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.sid);
49894 0 : if (object->out.sid == NULL) {
49895 0 : PyErr_NoMemory();
49896 0 : return -1;
49897 : }
49898 0 : if (value == Py_None) {
49899 0 : *object->out.sid = NULL;
49900 : } else {
49901 0 : *object->out.sid = NULL;
49902 0 : PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
49903 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
49904 0 : PyErr_NoMemory();
49905 0 : return -1;
49906 : }
49907 0 : *object->out.sid = (struct dom_sid *)pytalloc_get_ptr(value);
49908 : }
49909 0 : return 0;
49910 : }
49911 :
49912 0 : static PyObject *py_samr_RidToSid_get_result(PyObject *obj, void *closure)
49913 : {
49914 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(obj);
49915 0 : PyObject *py_result;
49916 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
49917 0 : return py_result;
49918 : }
49919 :
49920 0 : static int py_samr_RidToSid_set_result(PyObject *py_obj, PyObject *value, void *closure)
49921 : {
49922 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
49923 0 : if (value == NULL) {
49924 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
49925 0 : return -1;
49926 : }
49927 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
49928 0 : return 0;
49929 : }
49930 :
49931 : static PyGetSetDef py_samr_RidToSid_getsetters[] = {
49932 : {
49933 : .name = discard_const_p(char, "in_domain_handle"),
49934 : .get = py_samr_RidToSid_in_get_domain_handle,
49935 : .set = py_samr_RidToSid_in_set_domain_handle,
49936 : .doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
49937 : },
49938 : {
49939 : .name = discard_const_p(char, "in_rid"),
49940 : .get = py_samr_RidToSid_in_get_rid,
49941 : .set = py_samr_RidToSid_in_set_rid,
49942 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
49943 : },
49944 : {
49945 : .name = discard_const_p(char, "out_sid"),
49946 : .get = py_samr_RidToSid_out_get_sid,
49947 : .set = py_samr_RidToSid_out_set_sid,
49948 : .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
49949 : },
49950 : {
49951 : .name = discard_const_p(char, "result"),
49952 : .get = py_samr_RidToSid_get_result,
49953 : .set = py_samr_RidToSid_set_result,
49954 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
49955 : },
49956 : { .name = NULL }
49957 : };
49958 :
49959 0 : static PyObject *py_samr_RidToSid_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
49960 : {
49961 0 : PyObject *self = pytalloc_new(struct samr_RidToSid, type);
49962 0 : struct samr_RidToSid *_self = (struct samr_RidToSid *)pytalloc_get_ptr(self);
49963 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
49964 0 : _self->in.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
49965 : /* a pointer to a NULL pointer */
49966 0 : _self->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *);
49967 0 : return self;
49968 : }
49969 :
49970 0 : static PyObject *py_samr_RidToSid_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
49971 : {
49972 :
49973 :
49974 0 : return PyLong_FromLong(65);
49975 : }
49976 :
49977 0 : static PyObject *py_samr_RidToSid_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
49978 : {
49979 0 : const struct ndr_interface_call *call = NULL;
49980 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
49981 0 : PyObject *ret = NULL;
49982 0 : struct ndr_push *push = NULL;
49983 0 : DATA_BLOB blob;
49984 0 : enum ndr_err_code err;
49985 :
49986 0 : if (ndr_table_samr.num_calls < 66) {
49987 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_pack");
49988 0 : return NULL;
49989 : }
49990 0 : call = &ndr_table_samr.calls[65];
49991 :
49992 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
49993 0 : if (push == NULL) {
49994 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
49995 0 : return NULL;
49996 : }
49997 :
49998 0 : push->flags |= ndr_push_flags;
49999 :
50000 0 : err = call->ndr_push(push, ndr_inout_flags, object);
50001 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50002 0 : TALLOC_FREE(push);
50003 0 : PyErr_SetNdrError(err);
50004 0 : return NULL;
50005 : }
50006 0 : blob = ndr_push_blob(push);
50007 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
50008 0 : TALLOC_FREE(push);
50009 0 : return ret;
50010 : }
50011 :
50012 0 : static PyObject *py_samr_RidToSid_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50013 : {
50014 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50015 0 : PyObject *bigendian_obj = NULL;
50016 0 : PyObject *ndr64_obj = NULL;
50017 0 : libndr_flags ndr_push_flags = 0;
50018 :
50019 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
50020 : discard_const_p(char *, kwnames),
50021 : &bigendian_obj,
50022 : &ndr64_obj)) {
50023 0 : return NULL;
50024 : }
50025 :
50026 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50027 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50028 : }
50029 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50030 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50031 : }
50032 :
50033 0 : return py_samr_RidToSid_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
50034 : }
50035 :
50036 0 : static PyObject *py_samr_RidToSid_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50037 : {
50038 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50039 0 : PyObject *bigendian_obj = NULL;
50040 0 : PyObject *ndr64_obj = NULL;
50041 0 : libndr_flags ndr_push_flags = 0;
50042 :
50043 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
50044 : discard_const_p(char *, kwnames),
50045 : &bigendian_obj,
50046 : &ndr64_obj)) {
50047 0 : return NULL;
50048 : }
50049 :
50050 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50051 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50052 : }
50053 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50054 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50055 : }
50056 :
50057 0 : return py_samr_RidToSid_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
50058 : }
50059 :
50060 0 : static PyObject *py_samr_RidToSid_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
50061 : {
50062 0 : const struct ndr_interface_call *call = NULL;
50063 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
50064 0 : struct ndr_pull *pull = NULL;
50065 0 : enum ndr_err_code err;
50066 :
50067 0 : if (ndr_table_samr.num_calls < 66) {
50068 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_unpack");
50069 0 : return NULL;
50070 : }
50071 0 : call = &ndr_table_samr.calls[65];
50072 :
50073 0 : pull = ndr_pull_init_blob(blob, object);
50074 0 : if (pull == NULL) {
50075 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50076 0 : return NULL;
50077 : }
50078 :
50079 0 : pull->flags |= ndr_pull_flags;
50080 :
50081 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
50082 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50083 0 : TALLOC_FREE(pull);
50084 0 : PyErr_SetNdrError(err);
50085 0 : return NULL;
50086 : }
50087 0 : if (!allow_remaining) {
50088 0 : uint32_t highest_ofs;
50089 :
50090 0 : if (pull->offset > pull->relative_highest_offset) {
50091 0 : highest_ofs = pull->offset;
50092 : } else {
50093 0 : highest_ofs = pull->relative_highest_offset;
50094 : }
50095 0 : if (highest_ofs < pull->data_size) {
50096 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
50097 : "not all bytes consumed ofs[%u] size[%u]",
50098 : highest_ofs, pull->data_size);
50099 0 : TALLOC_FREE(pull);
50100 0 : PyErr_SetNdrError(err);
50101 0 : return NULL;
50102 : }
50103 : }
50104 :
50105 0 : TALLOC_FREE(pull);
50106 0 : Py_RETURN_NONE;
50107 : }
50108 :
50109 0 : static PyObject *py_samr_RidToSid_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50110 : {
50111 0 : DATA_BLOB blob;
50112 0 : Py_ssize_t blob_length = 0;
50113 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50114 0 : PyObject *bigendian_obj = NULL;
50115 0 : PyObject *ndr64_obj = NULL;
50116 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50117 0 : PyObject *allow_remaining_obj = NULL;
50118 0 : bool allow_remaining = false;
50119 :
50120 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
50121 : discard_const_p(char *, kwnames),
50122 : &blob.data, &blob_length,
50123 : &bigendian_obj,
50124 : &ndr64_obj,
50125 : &allow_remaining_obj)) {
50126 0 : return NULL;
50127 : }
50128 0 : blob.length = blob_length;
50129 :
50130 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50131 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50132 : }
50133 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50134 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50135 : }
50136 :
50137 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50138 0 : allow_remaining = true;
50139 : }
50140 :
50141 0 : return py_samr_RidToSid_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
50142 : }
50143 :
50144 0 : static PyObject *py_samr_RidToSid_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50145 : {
50146 0 : DATA_BLOB blob;
50147 0 : Py_ssize_t blob_length = 0;
50148 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50149 0 : PyObject *bigendian_obj = NULL;
50150 0 : PyObject *ndr64_obj = NULL;
50151 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50152 0 : PyObject *allow_remaining_obj = NULL;
50153 0 : bool allow_remaining = false;
50154 :
50155 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
50156 : discard_const_p(char *, kwnames),
50157 : &blob.data, &blob_length,
50158 : &bigendian_obj,
50159 : &ndr64_obj,
50160 : &allow_remaining_obj)) {
50161 0 : return NULL;
50162 : }
50163 0 : blob.length = blob_length;
50164 :
50165 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50166 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50167 : }
50168 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50169 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50170 : }
50171 :
50172 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50173 0 : allow_remaining = true;
50174 : }
50175 :
50176 0 : return py_samr_RidToSid_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
50177 : }
50178 :
50179 0 : static PyObject *py_samr_RidToSid_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
50180 : {
50181 0 : const struct ndr_interface_call *call = NULL;
50182 0 : struct samr_RidToSid *object = (struct samr_RidToSid *)pytalloc_get_ptr(py_obj);
50183 0 : PyObject *ret;
50184 0 : char *retstr;
50185 :
50186 0 : if (ndr_table_samr.num_calls < 66) {
50187 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_RidToSid_ndr_print");
50188 0 : return NULL;
50189 : }
50190 0 : call = &ndr_table_samr.calls[65];
50191 :
50192 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
50193 0 : ret = PyUnicode_FromString(retstr);
50194 0 : TALLOC_FREE(retstr);
50195 :
50196 0 : return ret;
50197 : }
50198 :
50199 0 : static PyObject *py_samr_RidToSid_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50200 : {
50201 0 : return py_samr_RidToSid_ndr_print(py_obj, "samr_RidToSid_in", NDR_IN);
50202 : }
50203 :
50204 0 : static PyObject *py_samr_RidToSid_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50205 : {
50206 0 : return py_samr_RidToSid_ndr_print(py_obj, "samr_RidToSid_out", NDR_OUT);
50207 : }
50208 :
50209 : static PyMethodDef py_samr_RidToSid_methods[] = {
50210 : { "opnum", (PyCFunction)py_samr_RidToSid_ndr_opnum, METH_NOARGS|METH_CLASS,
50211 : "samr.RidToSid.opnum() -> 65 (0x41) " },
50212 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidToSid_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
50213 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
50214 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidToSid_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
50215 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
50216 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidToSid_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
50217 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
50218 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_RidToSid_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
50219 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
50220 : { "__ndr_print_in__", (PyCFunction)py_samr_RidToSid_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
50221 : { "__ndr_print_out__", (PyCFunction)py_samr_RidToSid_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
50222 : { NULL, NULL, 0, NULL }
50223 : };
50224 :
50225 :
50226 : static PyTypeObject samr_RidToSid_Type = {
50227 : PyVarObject_HEAD_INIT(NULL, 0)
50228 : .tp_name = "samr.RidToSid",
50229 : .tp_getset = py_samr_RidToSid_getsetters,
50230 : .tp_methods = py_samr_RidToSid_methods,
50231 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
50232 : .tp_new = py_samr_RidToSid_new,
50233 : };
50234 :
50235 0 : static bool pack_py_samr_RidToSid_args_in(PyObject *args, PyObject *kwargs, struct samr_RidToSid *r)
50236 : {
50237 0 : PyObject *py_domain_handle;
50238 0 : PyObject *py_rid;
50239 0 : const char *kwnames[] = {
50240 : "domain_handle", "rid", NULL
50241 : };
50242 :
50243 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RidToSid", discard_const_p(char *, kwnames), &py_domain_handle, &py_rid)) {
50244 0 : return false;
50245 : }
50246 :
50247 0 : if (py_domain_handle == NULL) {
50248 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.domain_handle");
50249 0 : return false;
50250 : }
50251 0 : r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
50252 0 : if (r->in.domain_handle == NULL) {
50253 0 : PyErr_NoMemory();
50254 0 : return false;
50255 : }
50256 0 : PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
50257 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
50258 0 : PyErr_NoMemory();
50259 0 : return false;
50260 : }
50261 0 : r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
50262 0 : if (py_rid == NULL) {
50263 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.rid");
50264 0 : return false;
50265 : }
50266 : {
50267 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.rid));
50268 0 : if (PyLong_Check(py_rid)) {
50269 0 : unsigned long long test_var;
50270 0 : test_var = PyLong_AsUnsignedLongLong(py_rid);
50271 0 : if (PyErr_Occurred() != NULL) {
50272 0 : return false;
50273 : }
50274 0 : if (test_var > uint_max) {
50275 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50276 : PyLong_Type.tp_name, uint_max, test_var);
50277 0 : return false;
50278 : }
50279 0 : r->in.rid = test_var;
50280 : } else {
50281 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50282 : PyLong_Type.tp_name);
50283 0 : return false;
50284 : }
50285 : }
50286 0 : return true;
50287 : }
50288 :
50289 0 : static PyObject *unpack_py_samr_RidToSid_args_out(struct samr_RidToSid *r)
50290 : {
50291 0 : PyObject *result;
50292 0 : PyObject *py_sid;
50293 0 : if (*r->out.sid == NULL) {
50294 0 : py_sid = Py_None;
50295 0 : Py_INCREF(py_sid);
50296 : } else {
50297 0 : py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
50298 : }
50299 0 : result = py_sid;
50300 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
50301 0 : PyErr_SetNTSTATUS(r->out.result);
50302 0 : return NULL;
50303 : }
50304 :
50305 0 : return result;
50306 : }
50307 :
50308 :
50309 0 : static PyObject *py_samr_SetDsrmPassword_in_get_name(PyObject *obj, void *closure)
50310 : {
50311 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj);
50312 0 : PyObject *py_name;
50313 0 : if (object->in.name == NULL) {
50314 0 : Py_RETURN_NONE;
50315 : }
50316 0 : if (object->in.name == NULL) {
50317 0 : py_name = Py_None;
50318 0 : Py_INCREF(py_name);
50319 : } else {
50320 0 : py_name = pytalloc_reference_ex(lsa_String_Type, object->in.name, object->in.name);
50321 : }
50322 0 : return py_name;
50323 : }
50324 :
50325 0 : static int py_samr_SetDsrmPassword_in_set_name(PyObject *py_obj, PyObject *value, void *closure)
50326 : {
50327 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50328 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.name));
50329 0 : if (value == NULL) {
50330 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.name");
50331 0 : return -1;
50332 : }
50333 0 : if (value == Py_None) {
50334 0 : object->in.name = NULL;
50335 : } else {
50336 0 : object->in.name = NULL;
50337 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
50338 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50339 0 : PyErr_NoMemory();
50340 0 : return -1;
50341 : }
50342 0 : object->in.name = (struct lsa_String *)pytalloc_get_ptr(value);
50343 : }
50344 0 : return 0;
50345 : }
50346 :
50347 0 : static PyObject *py_samr_SetDsrmPassword_in_get_unknown(PyObject *obj, void *closure)
50348 : {
50349 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj);
50350 0 : PyObject *py_unknown;
50351 0 : py_unknown = PyLong_FromUnsignedLongLong((uint32_t)object->in.unknown);
50352 0 : return py_unknown;
50353 : }
50354 :
50355 0 : static int py_samr_SetDsrmPassword_in_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
50356 : {
50357 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50358 0 : if (value == NULL) {
50359 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.unknown");
50360 0 : return -1;
50361 : }
50362 : {
50363 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown));
50364 0 : if (PyLong_Check(value)) {
50365 0 : unsigned long long test_var;
50366 0 : test_var = PyLong_AsUnsignedLongLong(value);
50367 0 : if (PyErr_Occurred() != NULL) {
50368 0 : return -1;
50369 : }
50370 0 : if (test_var > uint_max) {
50371 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50372 : PyLong_Type.tp_name, uint_max, test_var);
50373 0 : return -1;
50374 : }
50375 0 : object->in.unknown = test_var;
50376 : } else {
50377 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50378 : PyLong_Type.tp_name);
50379 0 : return -1;
50380 : }
50381 : }
50382 0 : return 0;
50383 : }
50384 :
50385 0 : static PyObject *py_samr_SetDsrmPassword_in_get_hash(PyObject *obj, void *closure)
50386 : {
50387 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj);
50388 0 : PyObject *py_hash;
50389 0 : if (object->in.hash == NULL) {
50390 0 : Py_RETURN_NONE;
50391 : }
50392 0 : if (object->in.hash == NULL) {
50393 0 : py_hash = Py_None;
50394 0 : Py_INCREF(py_hash);
50395 : } else {
50396 0 : py_hash = pytalloc_reference_ex(&samr_Password_Type, object->in.hash, object->in.hash);
50397 : }
50398 0 : return py_hash;
50399 : }
50400 :
50401 0 : static int py_samr_SetDsrmPassword_in_set_hash(PyObject *py_obj, PyObject *value, void *closure)
50402 : {
50403 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50404 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hash));
50405 0 : if (value == NULL) {
50406 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.hash");
50407 0 : return -1;
50408 : }
50409 0 : if (value == Py_None) {
50410 0 : object->in.hash = NULL;
50411 : } else {
50412 0 : object->in.hash = NULL;
50413 0 : PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
50414 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
50415 0 : PyErr_NoMemory();
50416 0 : return -1;
50417 : }
50418 0 : object->in.hash = (struct samr_Password *)pytalloc_get_ptr(value);
50419 : }
50420 0 : return 0;
50421 : }
50422 :
50423 0 : static PyObject *py_samr_SetDsrmPassword_get_result(PyObject *obj, void *closure)
50424 : {
50425 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(obj);
50426 0 : PyObject *py_result;
50427 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
50428 0 : return py_result;
50429 : }
50430 :
50431 0 : static int py_samr_SetDsrmPassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
50432 : {
50433 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50434 0 : if (value == NULL) {
50435 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
50436 0 : return -1;
50437 : }
50438 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
50439 0 : return 0;
50440 : }
50441 :
50442 : static PyGetSetDef py_samr_SetDsrmPassword_getsetters[] = {
50443 : {
50444 : .name = discard_const_p(char, "in_name"),
50445 : .get = py_samr_SetDsrmPassword_in_get_name,
50446 : .set = py_samr_SetDsrmPassword_in_set_name,
50447 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
50448 : },
50449 : {
50450 : .name = discard_const_p(char, "in_unknown"),
50451 : .get = py_samr_SetDsrmPassword_in_get_unknown,
50452 : .set = py_samr_SetDsrmPassword_in_set_unknown,
50453 : .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
50454 : },
50455 : {
50456 : .name = discard_const_p(char, "in_hash"),
50457 : .get = py_samr_SetDsrmPassword_in_get_hash,
50458 : .set = py_samr_SetDsrmPassword_in_set_hash,
50459 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
50460 : },
50461 : {
50462 : .name = discard_const_p(char, "result"),
50463 : .get = py_samr_SetDsrmPassword_get_result,
50464 : .set = py_samr_SetDsrmPassword_set_result,
50465 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
50466 : },
50467 : { .name = NULL }
50468 : };
50469 :
50470 0 : static PyObject *py_samr_SetDsrmPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50471 : {
50472 0 : PyObject *self = pytalloc_new(struct samr_SetDsrmPassword, type);
50473 0 : return self;
50474 : }
50475 :
50476 0 : static PyObject *py_samr_SetDsrmPassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
50477 : {
50478 :
50479 :
50480 0 : return PyLong_FromLong(66);
50481 : }
50482 :
50483 0 : static PyObject *py_samr_SetDsrmPassword_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
50484 : {
50485 0 : const struct ndr_interface_call *call = NULL;
50486 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50487 0 : PyObject *ret = NULL;
50488 0 : struct ndr_push *push = NULL;
50489 0 : DATA_BLOB blob;
50490 0 : enum ndr_err_code err;
50491 :
50492 0 : if (ndr_table_samr.num_calls < 67) {
50493 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_pack");
50494 0 : return NULL;
50495 : }
50496 0 : call = &ndr_table_samr.calls[66];
50497 :
50498 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
50499 0 : if (push == NULL) {
50500 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50501 0 : return NULL;
50502 : }
50503 :
50504 0 : push->flags |= ndr_push_flags;
50505 :
50506 0 : err = call->ndr_push(push, ndr_inout_flags, object);
50507 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50508 0 : TALLOC_FREE(push);
50509 0 : PyErr_SetNdrError(err);
50510 0 : return NULL;
50511 : }
50512 0 : blob = ndr_push_blob(push);
50513 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
50514 0 : TALLOC_FREE(push);
50515 0 : return ret;
50516 : }
50517 :
50518 0 : static PyObject *py_samr_SetDsrmPassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50519 : {
50520 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50521 0 : PyObject *bigendian_obj = NULL;
50522 0 : PyObject *ndr64_obj = NULL;
50523 0 : libndr_flags ndr_push_flags = 0;
50524 :
50525 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
50526 : discard_const_p(char *, kwnames),
50527 : &bigendian_obj,
50528 : &ndr64_obj)) {
50529 0 : return NULL;
50530 : }
50531 :
50532 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50533 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50534 : }
50535 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50536 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50537 : }
50538 :
50539 0 : return py_samr_SetDsrmPassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
50540 : }
50541 :
50542 0 : static PyObject *py_samr_SetDsrmPassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50543 : {
50544 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
50545 0 : PyObject *bigendian_obj = NULL;
50546 0 : PyObject *ndr64_obj = NULL;
50547 0 : libndr_flags ndr_push_flags = 0;
50548 :
50549 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
50550 : discard_const_p(char *, kwnames),
50551 : &bigendian_obj,
50552 : &ndr64_obj)) {
50553 0 : return NULL;
50554 : }
50555 :
50556 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50557 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
50558 : }
50559 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50560 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
50561 : }
50562 :
50563 0 : return py_samr_SetDsrmPassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
50564 : }
50565 :
50566 0 : static PyObject *py_samr_SetDsrmPassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
50567 : {
50568 0 : const struct ndr_interface_call *call = NULL;
50569 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50570 0 : struct ndr_pull *pull = NULL;
50571 0 : enum ndr_err_code err;
50572 :
50573 0 : if (ndr_table_samr.num_calls < 67) {
50574 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_unpack");
50575 0 : return NULL;
50576 : }
50577 0 : call = &ndr_table_samr.calls[66];
50578 :
50579 0 : pull = ndr_pull_init_blob(blob, object);
50580 0 : if (pull == NULL) {
50581 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
50582 0 : return NULL;
50583 : }
50584 :
50585 0 : pull->flags |= ndr_pull_flags;
50586 :
50587 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
50588 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
50589 0 : TALLOC_FREE(pull);
50590 0 : PyErr_SetNdrError(err);
50591 0 : return NULL;
50592 : }
50593 0 : if (!allow_remaining) {
50594 0 : uint32_t highest_ofs;
50595 :
50596 0 : if (pull->offset > pull->relative_highest_offset) {
50597 0 : highest_ofs = pull->offset;
50598 : } else {
50599 0 : highest_ofs = pull->relative_highest_offset;
50600 : }
50601 0 : if (highest_ofs < pull->data_size) {
50602 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
50603 : "not all bytes consumed ofs[%u] size[%u]",
50604 : highest_ofs, pull->data_size);
50605 0 : TALLOC_FREE(pull);
50606 0 : PyErr_SetNdrError(err);
50607 0 : return NULL;
50608 : }
50609 : }
50610 :
50611 0 : TALLOC_FREE(pull);
50612 0 : Py_RETURN_NONE;
50613 : }
50614 :
50615 0 : static PyObject *py_samr_SetDsrmPassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50616 : {
50617 0 : DATA_BLOB blob;
50618 0 : Py_ssize_t blob_length = 0;
50619 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50620 0 : PyObject *bigendian_obj = NULL;
50621 0 : PyObject *ndr64_obj = NULL;
50622 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50623 0 : PyObject *allow_remaining_obj = NULL;
50624 0 : bool allow_remaining = false;
50625 :
50626 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
50627 : discard_const_p(char *, kwnames),
50628 : &blob.data, &blob_length,
50629 : &bigendian_obj,
50630 : &ndr64_obj,
50631 : &allow_remaining_obj)) {
50632 0 : return NULL;
50633 : }
50634 0 : blob.length = blob_length;
50635 :
50636 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50637 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50638 : }
50639 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50640 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50641 : }
50642 :
50643 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50644 0 : allow_remaining = true;
50645 : }
50646 :
50647 0 : return py_samr_SetDsrmPassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
50648 : }
50649 :
50650 0 : static PyObject *py_samr_SetDsrmPassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
50651 : {
50652 0 : DATA_BLOB blob;
50653 0 : Py_ssize_t blob_length = 0;
50654 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
50655 0 : PyObject *bigendian_obj = NULL;
50656 0 : PyObject *ndr64_obj = NULL;
50657 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
50658 0 : PyObject *allow_remaining_obj = NULL;
50659 0 : bool allow_remaining = false;
50660 :
50661 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
50662 : discard_const_p(char *, kwnames),
50663 : &blob.data, &blob_length,
50664 : &bigendian_obj,
50665 : &ndr64_obj,
50666 : &allow_remaining_obj)) {
50667 0 : return NULL;
50668 : }
50669 0 : blob.length = blob_length;
50670 :
50671 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
50672 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
50673 : }
50674 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
50675 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
50676 : }
50677 :
50678 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
50679 0 : allow_remaining = true;
50680 : }
50681 :
50682 0 : return py_samr_SetDsrmPassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
50683 : }
50684 :
50685 0 : static PyObject *py_samr_SetDsrmPassword_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
50686 : {
50687 0 : const struct ndr_interface_call *call = NULL;
50688 0 : struct samr_SetDsrmPassword *object = (struct samr_SetDsrmPassword *)pytalloc_get_ptr(py_obj);
50689 0 : PyObject *ret;
50690 0 : char *retstr;
50691 :
50692 0 : if (ndr_table_samr.num_calls < 67) {
50693 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_SetDsrmPassword_ndr_print");
50694 0 : return NULL;
50695 : }
50696 0 : call = &ndr_table_samr.calls[66];
50697 :
50698 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
50699 0 : ret = PyUnicode_FromString(retstr);
50700 0 : TALLOC_FREE(retstr);
50701 :
50702 0 : return ret;
50703 : }
50704 :
50705 0 : static PyObject *py_samr_SetDsrmPassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50706 : {
50707 0 : return py_samr_SetDsrmPassword_ndr_print(py_obj, "samr_SetDsrmPassword_in", NDR_IN);
50708 : }
50709 :
50710 0 : static PyObject *py_samr_SetDsrmPassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
50711 : {
50712 0 : return py_samr_SetDsrmPassword_ndr_print(py_obj, "samr_SetDsrmPassword_out", NDR_OUT);
50713 : }
50714 :
50715 : static PyMethodDef py_samr_SetDsrmPassword_methods[] = {
50716 : { "opnum", (PyCFunction)py_samr_SetDsrmPassword_ndr_opnum, METH_NOARGS|METH_CLASS,
50717 : "samr.SetDsrmPassword.opnum() -> 66 (0x42) " },
50718 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDsrmPassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
50719 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
50720 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDsrmPassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
50721 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
50722 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDsrmPassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
50723 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
50724 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_SetDsrmPassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
50725 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
50726 : { "__ndr_print_in__", (PyCFunction)py_samr_SetDsrmPassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
50727 : { "__ndr_print_out__", (PyCFunction)py_samr_SetDsrmPassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
50728 : { NULL, NULL, 0, NULL }
50729 : };
50730 :
50731 :
50732 : static PyTypeObject samr_SetDsrmPassword_Type = {
50733 : PyVarObject_HEAD_INIT(NULL, 0)
50734 : .tp_name = "samr.SetDsrmPassword",
50735 : .tp_getset = py_samr_SetDsrmPassword_getsetters,
50736 : .tp_methods = py_samr_SetDsrmPassword_methods,
50737 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
50738 : .tp_new = py_samr_SetDsrmPassword_new,
50739 : };
50740 :
50741 0 : static bool pack_py_samr_SetDsrmPassword_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDsrmPassword *r)
50742 : {
50743 0 : PyObject *py_name;
50744 0 : PyObject *py_unknown;
50745 0 : PyObject *py_hash;
50746 0 : const char *kwnames[] = {
50747 : "name", "unknown", "hash", NULL
50748 : };
50749 :
50750 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDsrmPassword", discard_const_p(char *, kwnames), &py_name, &py_unknown, &py_hash)) {
50751 0 : return false;
50752 : }
50753 :
50754 0 : if (py_name == NULL) {
50755 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.name");
50756 0 : return false;
50757 : }
50758 0 : if (py_name == Py_None) {
50759 0 : r->in.name = NULL;
50760 : } else {
50761 0 : r->in.name = NULL;
50762 0 : PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
50763 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
50764 0 : PyErr_NoMemory();
50765 0 : return false;
50766 : }
50767 0 : r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
50768 : }
50769 0 : if (py_unknown == NULL) {
50770 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.unknown");
50771 0 : return false;
50772 : }
50773 : {
50774 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown));
50775 0 : if (PyLong_Check(py_unknown)) {
50776 0 : unsigned long long test_var;
50777 0 : test_var = PyLong_AsUnsignedLongLong(py_unknown);
50778 0 : if (PyErr_Occurred() != NULL) {
50779 0 : return false;
50780 : }
50781 0 : if (test_var > uint_max) {
50782 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50783 : PyLong_Type.tp_name, uint_max, test_var);
50784 0 : return false;
50785 : }
50786 0 : r->in.unknown = test_var;
50787 : } else {
50788 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50789 : PyLong_Type.tp_name);
50790 0 : return false;
50791 : }
50792 : }
50793 0 : if (py_hash == NULL) {
50794 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.hash");
50795 0 : return false;
50796 : }
50797 0 : if (py_hash == Py_None) {
50798 0 : r->in.hash = NULL;
50799 : } else {
50800 0 : r->in.hash = NULL;
50801 0 : PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
50802 0 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
50803 0 : PyErr_NoMemory();
50804 0 : return false;
50805 : }
50806 0 : r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
50807 : }
50808 0 : return true;
50809 : }
50810 :
50811 0 : static PyObject *unpack_py_samr_SetDsrmPassword_args_out(struct samr_SetDsrmPassword *r)
50812 : {
50813 0 : PyObject *result;
50814 0 : result = Py_None;
50815 0 : Py_INCREF(result);
50816 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
50817 0 : PyErr_SetNTSTATUS(r->out.result);
50818 0 : return NULL;
50819 : }
50820 :
50821 0 : return result;
50822 : }
50823 :
50824 :
50825 0 : static PyObject *py_samr_ValidatePassword_in_get_level(PyObject *obj, void *closure)
50826 : {
50827 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj);
50828 0 : PyObject *py_level;
50829 0 : py_level = PyLong_FromLong((uint16_t)object->in.level);
50830 0 : return py_level;
50831 : }
50832 :
50833 0 : static int py_samr_ValidatePassword_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
50834 : {
50835 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
50836 0 : if (value == NULL) {
50837 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.level");
50838 0 : return -1;
50839 : }
50840 : {
50841 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
50842 0 : if (PyLong_Check(value)) {
50843 0 : unsigned long long test_var;
50844 0 : test_var = PyLong_AsUnsignedLongLong(value);
50845 0 : if (PyErr_Occurred() != NULL) {
50846 0 : return -1;
50847 : }
50848 0 : if (test_var > uint_max) {
50849 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
50850 : PyLong_Type.tp_name, uint_max, test_var);
50851 0 : return -1;
50852 : }
50853 0 : object->in.level = test_var;
50854 : } else {
50855 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
50856 : PyLong_Type.tp_name);
50857 0 : return -1;
50858 : }
50859 : }
50860 0 : return 0;
50861 : }
50862 :
50863 0 : static PyObject *py_samr_ValidatePassword_in_get_req(PyObject *obj, void *closure)
50864 : {
50865 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj);
50866 0 : PyObject *py_req;
50867 0 : if (object->in.req == NULL) {
50868 0 : Py_RETURN_NONE;
50869 : }
50870 0 : py_req = pyrpc_import_union(&samr_ValidatePasswordReq_Type, object->in.req, object->in.level, object->in.req, "union samr_ValidatePasswordReq");
50871 0 : if (py_req == NULL) {
50872 0 : return NULL;
50873 : }
50874 0 : return py_req;
50875 : }
50876 :
50877 0 : static int py_samr_ValidatePassword_in_set_req(PyObject *py_obj, PyObject *value, void *closure)
50878 : {
50879 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
50880 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.req));
50881 0 : if (value == NULL) {
50882 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.req");
50883 0 : return -1;
50884 : }
50885 0 : object->in.req = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.req);
50886 0 : if (object->in.req == NULL) {
50887 0 : PyErr_NoMemory();
50888 0 : return -1;
50889 : }
50890 : {
50891 0 : union samr_ValidatePasswordReq *req_switch_1;
50892 0 : req_switch_1 = (union samr_ValidatePasswordReq *)pyrpc_export_union(&samr_ValidatePasswordReq_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_ValidatePasswordReq");
50893 0 : if (req_switch_1 == NULL) {
50894 0 : return -1;
50895 : }
50896 0 : object->in.req = req_switch_1;
50897 : }
50898 0 : return 0;
50899 : }
50900 :
50901 0 : static PyObject *py_samr_ValidatePassword_out_get_rep(PyObject *obj, void *closure)
50902 : {
50903 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj);
50904 0 : PyObject *py_rep;
50905 0 : if (object->out.rep == NULL) {
50906 0 : Py_RETURN_NONE;
50907 : }
50908 0 : if (*object->out.rep == NULL) {
50909 0 : py_rep = Py_None;
50910 0 : Py_INCREF(py_rep);
50911 : } else {
50912 0 : py_rep = pyrpc_import_union(&samr_ValidatePasswordRep_Type, *object->out.rep, object->in.level, *object->out.rep, "union samr_ValidatePasswordRep");
50913 0 : if (py_rep == NULL) {
50914 0 : return NULL;
50915 : }
50916 : }
50917 0 : return py_rep;
50918 : }
50919 :
50920 0 : static int py_samr_ValidatePassword_out_set_rep(PyObject *py_obj, PyObject *value, void *closure)
50921 : {
50922 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
50923 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.rep));
50924 0 : if (value == NULL) {
50925 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.rep");
50926 0 : return -1;
50927 : }
50928 0 : object->out.rep = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.rep);
50929 0 : if (object->out.rep == NULL) {
50930 0 : PyErr_NoMemory();
50931 0 : return -1;
50932 : }
50933 0 : if (value == Py_None) {
50934 0 : *object->out.rep = NULL;
50935 : } else {
50936 0 : *object->out.rep = NULL;
50937 : {
50938 0 : union samr_ValidatePasswordRep *rep_switch_2;
50939 0 : rep_switch_2 = (union samr_ValidatePasswordRep *)pyrpc_export_union(&samr_ValidatePasswordRep_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union samr_ValidatePasswordRep");
50940 0 : if (rep_switch_2 == NULL) {
50941 0 : return -1;
50942 : }
50943 0 : *object->out.rep = rep_switch_2;
50944 : }
50945 : }
50946 0 : return 0;
50947 : }
50948 :
50949 0 : static PyObject *py_samr_ValidatePassword_get_result(PyObject *obj, void *closure)
50950 : {
50951 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(obj);
50952 0 : PyObject *py_result;
50953 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
50954 0 : return py_result;
50955 : }
50956 :
50957 0 : static int py_samr_ValidatePassword_set_result(PyObject *py_obj, PyObject *value, void *closure)
50958 : {
50959 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
50960 0 : if (value == NULL) {
50961 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
50962 0 : return -1;
50963 : }
50964 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
50965 0 : return 0;
50966 : }
50967 :
50968 : static PyGetSetDef py_samr_ValidatePassword_getsetters[] = {
50969 : {
50970 : .name = discard_const_p(char, "in_level"),
50971 : .get = py_samr_ValidatePassword_in_get_level,
50972 : .set = py_samr_ValidatePassword_in_set_level,
50973 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordLevel")
50974 : },
50975 : {
50976 : .name = discard_const_p(char, "in_req"),
50977 : .get = py_samr_ValidatePassword_in_get_req,
50978 : .set = py_samr_ValidatePassword_in_set_req,
50979 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordReq")
50980 : },
50981 : {
50982 : .name = discard_const_p(char, "out_rep"),
50983 : .get = py_samr_ValidatePassword_out_get_rep,
50984 : .set = py_samr_ValidatePassword_out_set_rep,
50985 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_ValidatePasswordRep")
50986 : },
50987 : {
50988 : .name = discard_const_p(char, "result"),
50989 : .get = py_samr_ValidatePassword_get_result,
50990 : .set = py_samr_ValidatePassword_set_result,
50991 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
50992 : },
50993 : { .name = NULL }
50994 : };
50995 :
50996 0 : static PyObject *py_samr_ValidatePassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50997 : {
50998 0 : PyObject *self = pytalloc_new(struct samr_ValidatePassword, type);
50999 0 : struct samr_ValidatePassword *_self = (struct samr_ValidatePassword *)pytalloc_get_ptr(self);
51000 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
51001 0 : _self->in.req = talloc_zero(mem_ctx, union samr_ValidatePasswordReq);
51002 : /* a pointer to a NULL pointer */
51003 0 : _self->out.rep = talloc_zero(mem_ctx, union samr_ValidatePasswordRep *);
51004 0 : return self;
51005 : }
51006 :
51007 0 : static PyObject *py_samr_ValidatePassword_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
51008 : {
51009 :
51010 :
51011 0 : return PyLong_FromLong(67);
51012 : }
51013 :
51014 0 : static PyObject *py_samr_ValidatePassword_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
51015 : {
51016 0 : const struct ndr_interface_call *call = NULL;
51017 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
51018 0 : PyObject *ret = NULL;
51019 0 : struct ndr_push *push = NULL;
51020 0 : DATA_BLOB blob;
51021 0 : enum ndr_err_code err;
51022 :
51023 0 : if (ndr_table_samr.num_calls < 68) {
51024 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_pack");
51025 0 : return NULL;
51026 : }
51027 0 : call = &ndr_table_samr.calls[67];
51028 :
51029 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
51030 0 : if (push == NULL) {
51031 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51032 0 : return NULL;
51033 : }
51034 :
51035 0 : push->flags |= ndr_push_flags;
51036 :
51037 0 : err = call->ndr_push(push, ndr_inout_flags, object);
51038 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51039 0 : TALLOC_FREE(push);
51040 0 : PyErr_SetNdrError(err);
51041 0 : return NULL;
51042 : }
51043 0 : blob = ndr_push_blob(push);
51044 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
51045 0 : TALLOC_FREE(push);
51046 0 : return ret;
51047 : }
51048 :
51049 0 : static PyObject *py_samr_ValidatePassword_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51050 : {
51051 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51052 0 : PyObject *bigendian_obj = NULL;
51053 0 : PyObject *ndr64_obj = NULL;
51054 0 : libndr_flags ndr_push_flags = 0;
51055 :
51056 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
51057 : discard_const_p(char *, kwnames),
51058 : &bigendian_obj,
51059 : &ndr64_obj)) {
51060 0 : return NULL;
51061 : }
51062 :
51063 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51064 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51065 : }
51066 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51067 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51068 : }
51069 :
51070 0 : return py_samr_ValidatePassword_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
51071 : }
51072 :
51073 0 : static PyObject *py_samr_ValidatePassword_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51074 : {
51075 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51076 0 : PyObject *bigendian_obj = NULL;
51077 0 : PyObject *ndr64_obj = NULL;
51078 0 : libndr_flags ndr_push_flags = 0;
51079 :
51080 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
51081 : discard_const_p(char *, kwnames),
51082 : &bigendian_obj,
51083 : &ndr64_obj)) {
51084 0 : return NULL;
51085 : }
51086 :
51087 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51088 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51089 : }
51090 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51091 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51092 : }
51093 :
51094 0 : return py_samr_ValidatePassword_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
51095 : }
51096 :
51097 0 : static PyObject *py_samr_ValidatePassword_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
51098 : {
51099 0 : const struct ndr_interface_call *call = NULL;
51100 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
51101 0 : struct ndr_pull *pull = NULL;
51102 0 : enum ndr_err_code err;
51103 :
51104 0 : if (ndr_table_samr.num_calls < 68) {
51105 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_unpack");
51106 0 : return NULL;
51107 : }
51108 0 : call = &ndr_table_samr.calls[67];
51109 :
51110 0 : pull = ndr_pull_init_blob(blob, object);
51111 0 : if (pull == NULL) {
51112 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51113 0 : return NULL;
51114 : }
51115 :
51116 0 : pull->flags |= ndr_pull_flags;
51117 :
51118 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
51119 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51120 0 : TALLOC_FREE(pull);
51121 0 : PyErr_SetNdrError(err);
51122 0 : return NULL;
51123 : }
51124 0 : if (!allow_remaining) {
51125 0 : uint32_t highest_ofs;
51126 :
51127 0 : if (pull->offset > pull->relative_highest_offset) {
51128 0 : highest_ofs = pull->offset;
51129 : } else {
51130 0 : highest_ofs = pull->relative_highest_offset;
51131 : }
51132 0 : if (highest_ofs < pull->data_size) {
51133 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
51134 : "not all bytes consumed ofs[%u] size[%u]",
51135 : highest_ofs, pull->data_size);
51136 0 : TALLOC_FREE(pull);
51137 0 : PyErr_SetNdrError(err);
51138 0 : return NULL;
51139 : }
51140 : }
51141 :
51142 0 : TALLOC_FREE(pull);
51143 0 : Py_RETURN_NONE;
51144 : }
51145 :
51146 0 : static PyObject *py_samr_ValidatePassword_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51147 : {
51148 0 : DATA_BLOB blob;
51149 0 : Py_ssize_t blob_length = 0;
51150 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51151 0 : PyObject *bigendian_obj = NULL;
51152 0 : PyObject *ndr64_obj = NULL;
51153 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51154 0 : PyObject *allow_remaining_obj = NULL;
51155 0 : bool allow_remaining = false;
51156 :
51157 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
51158 : discard_const_p(char *, kwnames),
51159 : &blob.data, &blob_length,
51160 : &bigendian_obj,
51161 : &ndr64_obj,
51162 : &allow_remaining_obj)) {
51163 0 : return NULL;
51164 : }
51165 0 : blob.length = blob_length;
51166 :
51167 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51168 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51169 : }
51170 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51171 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51172 : }
51173 :
51174 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51175 0 : allow_remaining = true;
51176 : }
51177 :
51178 0 : return py_samr_ValidatePassword_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
51179 : }
51180 :
51181 0 : static PyObject *py_samr_ValidatePassword_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51182 : {
51183 0 : DATA_BLOB blob;
51184 0 : Py_ssize_t blob_length = 0;
51185 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51186 0 : PyObject *bigendian_obj = NULL;
51187 0 : PyObject *ndr64_obj = NULL;
51188 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51189 0 : PyObject *allow_remaining_obj = NULL;
51190 0 : bool allow_remaining = false;
51191 :
51192 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
51193 : discard_const_p(char *, kwnames),
51194 : &blob.data, &blob_length,
51195 : &bigendian_obj,
51196 : &ndr64_obj,
51197 : &allow_remaining_obj)) {
51198 0 : return NULL;
51199 : }
51200 0 : blob.length = blob_length;
51201 :
51202 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51203 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51204 : }
51205 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51206 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51207 : }
51208 :
51209 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51210 0 : allow_remaining = true;
51211 : }
51212 :
51213 0 : return py_samr_ValidatePassword_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
51214 : }
51215 :
51216 0 : static PyObject *py_samr_ValidatePassword_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
51217 : {
51218 0 : const struct ndr_interface_call *call = NULL;
51219 0 : struct samr_ValidatePassword *object = (struct samr_ValidatePassword *)pytalloc_get_ptr(py_obj);
51220 0 : PyObject *ret;
51221 0 : char *retstr;
51222 :
51223 0 : if (ndr_table_samr.num_calls < 68) {
51224 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ValidatePassword_ndr_print");
51225 0 : return NULL;
51226 : }
51227 0 : call = &ndr_table_samr.calls[67];
51228 :
51229 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
51230 0 : ret = PyUnicode_FromString(retstr);
51231 0 : TALLOC_FREE(retstr);
51232 :
51233 0 : return ret;
51234 : }
51235 :
51236 0 : static PyObject *py_samr_ValidatePassword_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51237 : {
51238 0 : return py_samr_ValidatePassword_ndr_print(py_obj, "samr_ValidatePassword_in", NDR_IN);
51239 : }
51240 :
51241 0 : static PyObject *py_samr_ValidatePassword_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51242 : {
51243 0 : return py_samr_ValidatePassword_ndr_print(py_obj, "samr_ValidatePassword_out", NDR_OUT);
51244 : }
51245 :
51246 : static PyMethodDef py_samr_ValidatePassword_methods[] = {
51247 : { "opnum", (PyCFunction)py_samr_ValidatePassword_ndr_opnum, METH_NOARGS|METH_CLASS,
51248 : "samr.ValidatePassword.opnum() -> 67 (0x43) " },
51249 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePassword_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
51250 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
51251 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePassword_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
51252 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
51253 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePassword_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
51254 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
51255 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ValidatePassword_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
51256 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
51257 : { "__ndr_print_in__", (PyCFunction)py_samr_ValidatePassword_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
51258 : { "__ndr_print_out__", (PyCFunction)py_samr_ValidatePassword_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
51259 : { NULL, NULL, 0, NULL }
51260 : };
51261 :
51262 :
51263 : static PyTypeObject samr_ValidatePassword_Type = {
51264 : PyVarObject_HEAD_INIT(NULL, 0)
51265 : .tp_name = "samr.ValidatePassword",
51266 : .tp_getset = py_samr_ValidatePassword_getsetters,
51267 : .tp_methods = py_samr_ValidatePassword_methods,
51268 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51269 : .tp_new = py_samr_ValidatePassword_new,
51270 : };
51271 :
51272 0 : static bool pack_py_samr_ValidatePassword_args_in(PyObject *args, PyObject *kwargs, struct samr_ValidatePassword *r)
51273 : {
51274 0 : PyObject *py_level;
51275 0 : PyObject *py_req;
51276 0 : const char *kwnames[] = {
51277 : "level", "req", NULL
51278 : };
51279 :
51280 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_ValidatePassword", discard_const_p(char *, kwnames), &py_level, &py_req)) {
51281 0 : return false;
51282 : }
51283 :
51284 0 : if (py_level == NULL) {
51285 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.level");
51286 0 : return false;
51287 : }
51288 : {
51289 0 : const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
51290 0 : if (PyLong_Check(py_level)) {
51291 0 : unsigned long long test_var;
51292 0 : test_var = PyLong_AsUnsignedLongLong(py_level);
51293 0 : if (PyErr_Occurred() != NULL) {
51294 0 : return false;
51295 : }
51296 0 : if (test_var > uint_max) {
51297 0 : PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
51298 : PyLong_Type.tp_name, uint_max, test_var);
51299 0 : return false;
51300 : }
51301 0 : r->in.level = test_var;
51302 : } else {
51303 0 : PyErr_Format(PyExc_TypeError, "Expected type %s",
51304 : PyLong_Type.tp_name);
51305 0 : return false;
51306 : }
51307 : }
51308 0 : if (py_req == NULL) {
51309 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.req");
51310 0 : return false;
51311 : }
51312 0 : r->in.req = talloc_ptrtype(r, r->in.req);
51313 0 : if (r->in.req == NULL) {
51314 0 : PyErr_NoMemory();
51315 0 : return false;
51316 : }
51317 : {
51318 0 : union samr_ValidatePasswordReq *req_switch_1;
51319 0 : req_switch_1 = (union samr_ValidatePasswordReq *)pyrpc_export_union(&samr_ValidatePasswordReq_Type, r, r->in.level, py_req, "union samr_ValidatePasswordReq");
51320 0 : if (req_switch_1 == NULL) {
51321 0 : return false;
51322 : }
51323 0 : r->in.req = req_switch_1;
51324 : }
51325 0 : return true;
51326 : }
51327 :
51328 0 : static PyObject *unpack_py_samr_ValidatePassword_args_out(struct samr_ValidatePassword *r)
51329 : {
51330 0 : PyObject *result;
51331 0 : PyObject *py_rep;
51332 0 : if (*r->out.rep == NULL) {
51333 0 : py_rep = Py_None;
51334 0 : Py_INCREF(py_rep);
51335 : } else {
51336 0 : py_rep = pyrpc_import_union(&samr_ValidatePasswordRep_Type, *r->out.rep, r->in.level, *r->out.rep, "union samr_ValidatePasswordRep");
51337 0 : if (py_rep == NULL) {
51338 0 : return NULL;
51339 : }
51340 : }
51341 0 : result = py_rep;
51342 0 : if (NT_STATUS_IS_ERR(r->out.result)) {
51343 0 : PyErr_SetNTSTATUS(r->out.result);
51344 0 : return NULL;
51345 : }
51346 :
51347 0 : return result;
51348 : }
51349 :
51350 :
51351 0 : static PyObject *py_samr_ChangePasswordUser4_in_get_server(PyObject *obj, void *closure)
51352 : {
51353 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(obj);
51354 0 : PyObject *py_server;
51355 0 : if (object->in.server == NULL) {
51356 0 : Py_RETURN_NONE;
51357 : }
51358 0 : if (object->in.server == NULL) {
51359 0 : py_server = Py_None;
51360 0 : Py_INCREF(py_server);
51361 : } else {
51362 0 : py_server = pytalloc_reference_ex(lsa_String_Type, object->in.server, object->in.server);
51363 : }
51364 0 : return py_server;
51365 : }
51366 :
51367 0 : static int py_samr_ChangePasswordUser4_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
51368 : {
51369 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51370 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.server));
51371 0 : if (value == NULL) {
51372 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.server");
51373 0 : return -1;
51374 : }
51375 0 : if (value == Py_None) {
51376 0 : object->in.server = NULL;
51377 : } else {
51378 0 : object->in.server = NULL;
51379 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
51380 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
51381 0 : PyErr_NoMemory();
51382 0 : return -1;
51383 : }
51384 0 : object->in.server = (struct lsa_String *)pytalloc_get_ptr(value);
51385 : }
51386 0 : return 0;
51387 : }
51388 :
51389 0 : static PyObject *py_samr_ChangePasswordUser4_in_get_account(PyObject *obj, void *closure)
51390 : {
51391 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(obj);
51392 0 : PyObject *py_account;
51393 0 : if (object->in.account == NULL) {
51394 0 : Py_RETURN_NONE;
51395 : }
51396 0 : py_account = pytalloc_reference_ex(lsa_String_Type, object->in.account, object->in.account);
51397 0 : return py_account;
51398 : }
51399 :
51400 0 : static int py_samr_ChangePasswordUser4_in_set_account(PyObject *py_obj, PyObject *value, void *closure)
51401 : {
51402 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51403 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.account));
51404 0 : if (value == NULL) {
51405 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.account");
51406 0 : return -1;
51407 : }
51408 0 : object->in.account = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.account);
51409 0 : if (object->in.account == NULL) {
51410 0 : PyErr_NoMemory();
51411 0 : return -1;
51412 : }
51413 0 : PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
51414 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
51415 0 : PyErr_NoMemory();
51416 0 : return -1;
51417 : }
51418 0 : object->in.account = (struct lsa_String *)pytalloc_get_ptr(value);
51419 0 : return 0;
51420 : }
51421 :
51422 0 : static PyObject *py_samr_ChangePasswordUser4_in_get_password(PyObject *obj, void *closure)
51423 : {
51424 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(obj);
51425 0 : PyObject *py_password;
51426 0 : if (object->in.password == NULL) {
51427 0 : Py_RETURN_NONE;
51428 : }
51429 0 : py_password = pytalloc_reference_ex(&samr_EncryptedPasswordAES_Type, object->in.password, object->in.password);
51430 0 : return py_password;
51431 : }
51432 :
51433 0 : static int py_samr_ChangePasswordUser4_in_set_password(PyObject *py_obj, PyObject *value, void *closure)
51434 : {
51435 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51436 0 : talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.password));
51437 0 : if (value == NULL) {
51438 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->in.password");
51439 0 : return -1;
51440 : }
51441 0 : object->in.password = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.password);
51442 0 : if (object->in.password == NULL) {
51443 0 : PyErr_NoMemory();
51444 0 : return -1;
51445 : }
51446 0 : PY_CHECK_TYPE(&samr_EncryptedPasswordAES_Type, value, return -1;);
51447 0 : if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
51448 0 : PyErr_NoMemory();
51449 0 : return -1;
51450 : }
51451 0 : object->in.password = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(value);
51452 0 : return 0;
51453 : }
51454 :
51455 0 : static PyObject *py_samr_ChangePasswordUser4_get_result(PyObject *obj, void *closure)
51456 : {
51457 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(obj);
51458 0 : PyObject *py_result;
51459 0 : py_result = PyErr_FromNTSTATUS(object->out.result);
51460 0 : return py_result;
51461 : }
51462 :
51463 0 : static int py_samr_ChangePasswordUser4_set_result(PyObject *py_obj, PyObject *value, void *closure)
51464 : {
51465 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51466 0 : if (value == NULL) {
51467 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->out.result");
51468 0 : return -1;
51469 : }
51470 0 : object->out.result = NT_STATUS(PyLong_AsLong(value));
51471 0 : return 0;
51472 : }
51473 :
51474 : static PyGetSetDef py_samr_ChangePasswordUser4_getsetters[] = {
51475 : {
51476 : .name = discard_const_p(char, "in_server"),
51477 : .get = py_samr_ChangePasswordUser4_in_get_server,
51478 : .set = py_samr_ChangePasswordUser4_in_set_server,
51479 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
51480 : },
51481 : {
51482 : .name = discard_const_p(char, "in_account"),
51483 : .get = py_samr_ChangePasswordUser4_in_get_account,
51484 : .set = py_samr_ChangePasswordUser4_in_set_account,
51485 : .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
51486 : },
51487 : {
51488 : .name = discard_const_p(char, "in_password"),
51489 : .get = py_samr_ChangePasswordUser4_in_get_password,
51490 : .set = py_samr_ChangePasswordUser4_in_set_password,
51491 : .doc = discard_const_p(char, "PIDL-generated element of base type samr_EncryptedPasswordAES")
51492 : },
51493 : {
51494 : .name = discard_const_p(char, "result"),
51495 : .get = py_samr_ChangePasswordUser4_get_result,
51496 : .set = py_samr_ChangePasswordUser4_set_result,
51497 : .doc = discard_const_p(char, "PIDL-generated element of type NTSTATUS")
51498 : },
51499 : { .name = NULL }
51500 : };
51501 :
51502 0 : static PyObject *py_samr_ChangePasswordUser4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51503 : {
51504 0 : PyObject *self = pytalloc_new(struct samr_ChangePasswordUser4, type);
51505 0 : struct samr_ChangePasswordUser4 *_self = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(self);
51506 0 : TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
51507 0 : _self->in.account = talloc_zero(mem_ctx, struct lsa_String);
51508 0 : _self->in.password = talloc_zero(mem_ctx, struct samr_EncryptedPasswordAES);
51509 0 : return self;
51510 : }
51511 :
51512 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
51513 : {
51514 :
51515 :
51516 0 : return PyLong_FromLong(73);
51517 : }
51518 :
51519 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
51520 : {
51521 0 : const struct ndr_interface_call *call = NULL;
51522 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51523 0 : PyObject *ret = NULL;
51524 0 : struct ndr_push *push = NULL;
51525 0 : DATA_BLOB blob;
51526 0 : enum ndr_err_code err;
51527 :
51528 0 : if (ndr_table_samr.num_calls < 74) {
51529 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser4_ndr_pack");
51530 0 : return NULL;
51531 : }
51532 0 : call = &ndr_table_samr.calls[73];
51533 :
51534 0 : push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
51535 0 : if (push == NULL) {
51536 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51537 0 : return NULL;
51538 : }
51539 :
51540 0 : push->flags |= ndr_push_flags;
51541 :
51542 0 : err = call->ndr_push(push, ndr_inout_flags, object);
51543 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51544 0 : TALLOC_FREE(push);
51545 0 : PyErr_SetNdrError(err);
51546 0 : return NULL;
51547 : }
51548 0 : blob = ndr_push_blob(push);
51549 0 : ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
51550 0 : TALLOC_FREE(push);
51551 0 : return ret;
51552 : }
51553 :
51554 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51555 : {
51556 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51557 0 : PyObject *bigendian_obj = NULL;
51558 0 : PyObject *ndr64_obj = NULL;
51559 0 : libndr_flags ndr_push_flags = 0;
51560 :
51561 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
51562 : discard_const_p(char *, kwnames),
51563 : &bigendian_obj,
51564 : &ndr64_obj)) {
51565 0 : return NULL;
51566 : }
51567 :
51568 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51569 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51570 : }
51571 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51572 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51573 : }
51574 :
51575 0 : return py_samr_ChangePasswordUser4_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
51576 : }
51577 :
51578 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51579 : {
51580 0 : const char * const kwnames[] = { "bigendian", "ndr64", NULL };
51581 0 : PyObject *bigendian_obj = NULL;
51582 0 : PyObject *ndr64_obj = NULL;
51583 0 : libndr_flags ndr_push_flags = 0;
51584 :
51585 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
51586 : discard_const_p(char *, kwnames),
51587 : &bigendian_obj,
51588 : &ndr64_obj)) {
51589 0 : return NULL;
51590 : }
51591 :
51592 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51593 0 : ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
51594 : }
51595 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51596 0 : ndr_push_flags |= LIBNDR_FLAG_NDR64;
51597 : }
51598 :
51599 0 : return py_samr_ChangePasswordUser4_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
51600 : }
51601 :
51602 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
51603 : {
51604 0 : const struct ndr_interface_call *call = NULL;
51605 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51606 0 : struct ndr_pull *pull = NULL;
51607 0 : enum ndr_err_code err;
51608 :
51609 0 : if (ndr_table_samr.num_calls < 74) {
51610 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser4_ndr_unpack");
51611 0 : return NULL;
51612 : }
51613 0 : call = &ndr_table_samr.calls[73];
51614 :
51615 0 : pull = ndr_pull_init_blob(blob, object);
51616 0 : if (pull == NULL) {
51617 0 : PyErr_SetNdrError(NDR_ERR_ALLOC);
51618 0 : return NULL;
51619 : }
51620 :
51621 0 : pull->flags |= ndr_pull_flags;
51622 :
51623 0 : err = call->ndr_pull(pull, ndr_inout_flags, object);
51624 0 : if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
51625 0 : TALLOC_FREE(pull);
51626 0 : PyErr_SetNdrError(err);
51627 0 : return NULL;
51628 : }
51629 0 : if (!allow_remaining) {
51630 0 : uint32_t highest_ofs;
51631 :
51632 0 : if (pull->offset > pull->relative_highest_offset) {
51633 0 : highest_ofs = pull->offset;
51634 : } else {
51635 0 : highest_ofs = pull->relative_highest_offset;
51636 : }
51637 0 : if (highest_ofs < pull->data_size) {
51638 0 : err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
51639 : "not all bytes consumed ofs[%u] size[%u]",
51640 : highest_ofs, pull->data_size);
51641 0 : TALLOC_FREE(pull);
51642 0 : PyErr_SetNdrError(err);
51643 0 : return NULL;
51644 : }
51645 : }
51646 :
51647 0 : TALLOC_FREE(pull);
51648 0 : Py_RETURN_NONE;
51649 : }
51650 :
51651 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51652 : {
51653 0 : DATA_BLOB blob;
51654 0 : Py_ssize_t blob_length = 0;
51655 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51656 0 : PyObject *bigendian_obj = NULL;
51657 0 : PyObject *ndr64_obj = NULL;
51658 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51659 0 : PyObject *allow_remaining_obj = NULL;
51660 0 : bool allow_remaining = false;
51661 :
51662 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
51663 : discard_const_p(char *, kwnames),
51664 : &blob.data, &blob_length,
51665 : &bigendian_obj,
51666 : &ndr64_obj,
51667 : &allow_remaining_obj)) {
51668 0 : return NULL;
51669 : }
51670 0 : blob.length = blob_length;
51671 :
51672 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51673 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51674 : }
51675 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51676 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51677 : }
51678 :
51679 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51680 0 : allow_remaining = true;
51681 : }
51682 :
51683 0 : return py_samr_ChangePasswordUser4_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
51684 : }
51685 :
51686 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
51687 : {
51688 0 : DATA_BLOB blob;
51689 0 : Py_ssize_t blob_length = 0;
51690 0 : const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
51691 0 : PyObject *bigendian_obj = NULL;
51692 0 : PyObject *ndr64_obj = NULL;
51693 0 : libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
51694 0 : PyObject *allow_remaining_obj = NULL;
51695 0 : bool allow_remaining = false;
51696 :
51697 0 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
51698 : discard_const_p(char *, kwnames),
51699 : &blob.data, &blob_length,
51700 : &bigendian_obj,
51701 : &ndr64_obj,
51702 : &allow_remaining_obj)) {
51703 0 : return NULL;
51704 : }
51705 0 : blob.length = blob_length;
51706 :
51707 0 : if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
51708 0 : ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
51709 : }
51710 0 : if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
51711 0 : ndr_pull_flags |= LIBNDR_FLAG_NDR64;
51712 : }
51713 :
51714 0 : if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
51715 0 : allow_remaining = true;
51716 : }
51717 :
51718 0 : return py_samr_ChangePasswordUser4_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
51719 : }
51720 :
51721 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_print(PyObject *py_obj, const char *name, ndr_flags_type ndr_inout_flags)
51722 : {
51723 0 : const struct ndr_interface_call *call = NULL;
51724 0 : struct samr_ChangePasswordUser4 *object = (struct samr_ChangePasswordUser4 *)pytalloc_get_ptr(py_obj);
51725 0 : PyObject *ret;
51726 0 : char *retstr;
51727 :
51728 0 : if (ndr_table_samr.num_calls < 74) {
51729 0 : PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_samr_ChangePasswordUser4_ndr_print");
51730 0 : return NULL;
51731 : }
51732 0 : call = &ndr_table_samr.calls[73];
51733 :
51734 0 : retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
51735 0 : ret = PyUnicode_FromString(retstr);
51736 0 : TALLOC_FREE(retstr);
51737 :
51738 0 : return ret;
51739 : }
51740 :
51741 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_print_in(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51742 : {
51743 0 : return py_samr_ChangePasswordUser4_ndr_print(py_obj, "samr_ChangePasswordUser4_in", NDR_IN);
51744 : }
51745 :
51746 0 : static PyObject *py_samr_ChangePasswordUser4_ndr_print_out(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
51747 : {
51748 0 : return py_samr_ChangePasswordUser4_ndr_print(py_obj, "samr_ChangePasswordUser4_out", NDR_OUT);
51749 : }
51750 :
51751 : static PyMethodDef py_samr_ChangePasswordUser4_methods[] = {
51752 : { "opnum", (PyCFunction)py_samr_ChangePasswordUser4_ndr_opnum, METH_NOARGS|METH_CLASS,
51753 : "samr.ChangePasswordUser4.opnum() -> 73 (0x49) " },
51754 : { "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser4_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
51755 : "S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
51756 : { "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser4_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
51757 : "S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
51758 : { "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser4_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
51759 : "S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
51760 : { "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_samr_ChangePasswordUser4_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
51761 : "S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
51762 : { "__ndr_print_in__", (PyCFunction)py_samr_ChangePasswordUser4_ndr_print_in, METH_NOARGS, "S.ndr_print_in(object) -> None\nNDR print input" },
51763 : { "__ndr_print_out__", (PyCFunction)py_samr_ChangePasswordUser4_ndr_print_out, METH_NOARGS, "S.ndr_print_out(object) -> None\nNDR print output" },
51764 : { NULL, NULL, 0, NULL }
51765 : };
51766 :
51767 :
51768 : static PyTypeObject samr_ChangePasswordUser4_Type = {
51769 : PyVarObject_HEAD_INIT(NULL, 0)
51770 : .tp_name = "samr.ChangePasswordUser4",
51771 : .tp_getset = py_samr_ChangePasswordUser4_getsetters,
51772 : .tp_methods = py_samr_ChangePasswordUser4_methods,
51773 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51774 : .tp_new = py_samr_ChangePasswordUser4_new,
51775 : };
51776 :
51777 2 : static bool pack_py_samr_ChangePasswordUser4_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser4 *r)
51778 : {
51779 0 : PyObject *py_server;
51780 0 : PyObject *py_account;
51781 0 : PyObject *py_password;
51782 2 : const char *kwnames[] = {
51783 : "server", "account", "password", NULL
51784 : };
51785 :
51786 2 : if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_ChangePasswordUser4", discard_const_p(char *, kwnames), &py_server, &py_account, &py_password)) {
51787 0 : return false;
51788 : }
51789 :
51790 2 : if (py_server == NULL) {
51791 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.server");
51792 0 : return false;
51793 : }
51794 2 : if (py_server == Py_None) {
51795 0 : r->in.server = NULL;
51796 : } else {
51797 2 : r->in.server = NULL;
51798 2 : PY_CHECK_TYPE(lsa_String_Type, py_server, return false;);
51799 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
51800 0 : PyErr_NoMemory();
51801 0 : return false;
51802 : }
51803 2 : r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
51804 : }
51805 2 : if (py_account == NULL) {
51806 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.account");
51807 0 : return false;
51808 : }
51809 2 : r->in.account = talloc_ptrtype(r, r->in.account);
51810 2 : if (r->in.account == NULL) {
51811 0 : PyErr_NoMemory();
51812 0 : return false;
51813 : }
51814 2 : PY_CHECK_TYPE(lsa_String_Type, py_account, return false;);
51815 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
51816 0 : PyErr_NoMemory();
51817 0 : return false;
51818 : }
51819 2 : r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account);
51820 2 : if (py_password == NULL) {
51821 0 : PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct r->in.password");
51822 0 : return false;
51823 : }
51824 2 : r->in.password = talloc_ptrtype(r, r->in.password);
51825 2 : if (r->in.password == NULL) {
51826 0 : PyErr_NoMemory();
51827 0 : return false;
51828 : }
51829 2 : PY_CHECK_TYPE(&samr_EncryptedPasswordAES_Type, py_password, return false;);
51830 2 : if (talloc_reference(r, pytalloc_get_mem_ctx(py_password)) == NULL) {
51831 0 : PyErr_NoMemory();
51832 0 : return false;
51833 : }
51834 2 : r->in.password = (struct samr_EncryptedPasswordAES *)pytalloc_get_ptr(py_password);
51835 2 : return true;
51836 : }
51837 :
51838 2 : static PyObject *unpack_py_samr_ChangePasswordUser4_args_out(struct samr_ChangePasswordUser4 *r)
51839 : {
51840 0 : PyObject *result;
51841 2 : result = Py_None;
51842 1 : Py_INCREF(result);
51843 2 : if (NT_STATUS_IS_ERR(r->out.result)) {
51844 0 : PyErr_SetNTSTATUS(r->out.result);
51845 0 : return NULL;
51846 : }
51847 :
51848 2 : return result;
51849 : }
51850 :
51851 : const struct PyNdrRpcMethodDef py_ndr_samr_methods[] = {
51852 : { "Connect", "S.Connect(system_name, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect_r, (py_data_pack_fn)pack_py_samr_Connect_args_in, (py_data_unpack_fn)unpack_py_samr_Connect_args_out, 0, &ndr_table_samr },
51853 : { "Close", "S.Close(handle) -> handle", (py_dcerpc_call_fn)dcerpc_samr_Close_r, (py_data_pack_fn)pack_py_samr_Close_args_in, (py_data_unpack_fn)unpack_py_samr_Close_args_out, 1, &ndr_table_samr },
51854 : { "SetSecurity", "S.SetSecurity(handle, sec_info, sdbuf) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetSecurity_r, (py_data_pack_fn)pack_py_samr_SetSecurity_args_in, (py_data_unpack_fn)unpack_py_samr_SetSecurity_args_out, 2, &ndr_table_samr },
51855 : { "QuerySecurity", "S.QuerySecurity(handle, sec_info) -> sdbuf", (py_dcerpc_call_fn)dcerpc_samr_QuerySecurity_r, (py_data_pack_fn)pack_py_samr_QuerySecurity_args_in, (py_data_unpack_fn)unpack_py_samr_QuerySecurity_args_out, 3, &ndr_table_samr },
51856 : { "Shutdown", "S.Shutdown(connect_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_Shutdown_r, (py_data_pack_fn)pack_py_samr_Shutdown_args_in, (py_data_unpack_fn)unpack_py_samr_Shutdown_args_out, 4, &ndr_table_samr },
51857 : { "LookupDomain", "S.LookupDomain(connect_handle, domain_name) -> sid", (py_dcerpc_call_fn)dcerpc_samr_LookupDomain_r, (py_data_pack_fn)pack_py_samr_LookupDomain_args_in, (py_data_unpack_fn)unpack_py_samr_LookupDomain_args_out, 5, &ndr_table_samr },
51858 : { "EnumDomains", "S.EnumDomains(connect_handle, resume_handle, buf_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomains_r, (py_data_pack_fn)pack_py_samr_EnumDomains_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomains_args_out, 6, &ndr_table_samr },
51859 : { "OpenDomain", "S.OpenDomain(connect_handle, access_mask, sid) -> domain_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenDomain_r, (py_data_pack_fn)pack_py_samr_OpenDomain_args_in, (py_data_unpack_fn)unpack_py_samr_OpenDomain_args_out, 7, &ndr_table_samr },
51860 : { "QueryDomainInfo", "S.QueryDomainInfo(domain_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryDomainInfo_r, (py_data_pack_fn)pack_py_samr_QueryDomainInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDomainInfo_args_out, 8, &ndr_table_samr },
51861 : { "SetDomainInfo", "S.SetDomainInfo(domain_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetDomainInfo_r, (py_data_pack_fn)pack_py_samr_SetDomainInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetDomainInfo_args_out, 9, &ndr_table_samr },
51862 : { "CreateDomainGroup", "S.CreateDomainGroup(domain_handle, name, access_mask) -> (group_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateDomainGroup_r, (py_data_pack_fn)pack_py_samr_CreateDomainGroup_args_in, (py_data_unpack_fn)unpack_py_samr_CreateDomainGroup_args_out, 10, &ndr_table_samr },
51863 : { "EnumDomainGroups", "S.EnumDomainGroups(domain_handle, resume_handle, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainGroups_r, (py_data_pack_fn)pack_py_samr_EnumDomainGroups_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainGroups_args_out, 11, &ndr_table_samr },
51864 : { "CreateUser", "S.CreateUser(domain_handle, account_name, access_mask) -> (user_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateUser_r, (py_data_pack_fn)pack_py_samr_CreateUser_args_in, (py_data_unpack_fn)unpack_py_samr_CreateUser_args_out, 12, &ndr_table_samr },
51865 : { "EnumDomainUsers", "S.EnumDomainUsers(domain_handle, resume_handle, acct_flags, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainUsers_r, (py_data_pack_fn)pack_py_samr_EnumDomainUsers_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainUsers_args_out, 13, &ndr_table_samr },
51866 : { "CreateDomAlias", "S.CreateDomAlias(domain_handle, alias_name, access_mask) -> (alias_handle, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateDomAlias_r, (py_data_pack_fn)pack_py_samr_CreateDomAlias_args_in, (py_data_unpack_fn)unpack_py_samr_CreateDomAlias_args_out, 14, &ndr_table_samr },
51867 : { "EnumDomainAliases", "S.EnumDomainAliases(domain_handle, resume_handle, max_size) -> (resume_handle, sam, num_entries)", (py_dcerpc_call_fn)dcerpc_samr_EnumDomainAliases_r, (py_data_pack_fn)pack_py_samr_EnumDomainAliases_args_in, (py_data_unpack_fn)unpack_py_samr_EnumDomainAliases_args_out, 15, &ndr_table_samr },
51868 : { "GetAliasMembership", "S.GetAliasMembership(domain_handle, sids) -> rids", (py_dcerpc_call_fn)dcerpc_samr_GetAliasMembership_r, (py_data_pack_fn)pack_py_samr_GetAliasMembership_args_in, (py_data_unpack_fn)unpack_py_samr_GetAliasMembership_args_out, 16, &ndr_table_samr },
51869 : { "LookupNames", "S.LookupNames(domain_handle, names) -> (rids, types)", (py_dcerpc_call_fn)dcerpc_samr_LookupNames_r, (py_data_pack_fn)pack_py_samr_LookupNames_args_in, (py_data_unpack_fn)unpack_py_samr_LookupNames_args_out, 17, &ndr_table_samr },
51870 : { "LookupRids", "S.LookupRids(domain_handle, rids) -> (names, types)", (py_dcerpc_call_fn)dcerpc_samr_LookupRids_r, (py_data_pack_fn)pack_py_samr_LookupRids_args_in, (py_data_unpack_fn)unpack_py_samr_LookupRids_args_out, 18, &ndr_table_samr },
51871 : { "OpenGroup", "S.OpenGroup(domain_handle, access_mask, rid) -> group_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenGroup_r, (py_data_pack_fn)pack_py_samr_OpenGroup_args_in, (py_data_unpack_fn)unpack_py_samr_OpenGroup_args_out, 19, &ndr_table_samr },
51872 : { "QueryGroupInfo", "S.QueryGroupInfo(group_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryGroupInfo_r, (py_data_pack_fn)pack_py_samr_QueryGroupInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryGroupInfo_args_out, 20, &ndr_table_samr },
51873 : { "SetGroupInfo", "S.SetGroupInfo(group_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetGroupInfo_r, (py_data_pack_fn)pack_py_samr_SetGroupInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetGroupInfo_args_out, 21, &ndr_table_samr },
51874 : { "AddGroupMember", "S.AddGroupMember(group_handle, rid, flags) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddGroupMember_r, (py_data_pack_fn)pack_py_samr_AddGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_AddGroupMember_args_out, 22, &ndr_table_samr },
51875 : { "DeleteDomainGroup", "S.DeleteDomainGroup(group_handle) -> group_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteDomainGroup_r, (py_data_pack_fn)pack_py_samr_DeleteDomainGroup_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteDomainGroup_args_out, 23, &ndr_table_samr },
51876 : { "DeleteGroupMember", "S.DeleteGroupMember(group_handle, rid) -> None", (py_dcerpc_call_fn)dcerpc_samr_DeleteGroupMember_r, (py_data_pack_fn)pack_py_samr_DeleteGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteGroupMember_args_out, 24, &ndr_table_samr },
51877 : { "QueryGroupMember", "S.QueryGroupMember(group_handle) -> rids", (py_dcerpc_call_fn)dcerpc_samr_QueryGroupMember_r, (py_data_pack_fn)pack_py_samr_QueryGroupMember_args_in, (py_data_unpack_fn)unpack_py_samr_QueryGroupMember_args_out, 25, &ndr_table_samr },
51878 : { "SetMemberAttributesOfGroup", "S.SetMemberAttributesOfGroup(group_handle, unknown1, unknown2) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetMemberAttributesOfGroup_r, (py_data_pack_fn)pack_py_samr_SetMemberAttributesOfGroup_args_in, (py_data_unpack_fn)unpack_py_samr_SetMemberAttributesOfGroup_args_out, 26, &ndr_table_samr },
51879 : { "OpenAlias", "S.OpenAlias(domain_handle, access_mask, rid) -> alias_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenAlias_r, (py_data_pack_fn)pack_py_samr_OpenAlias_args_in, (py_data_unpack_fn)unpack_py_samr_OpenAlias_args_out, 27, &ndr_table_samr },
51880 : { "QueryAliasInfo", "S.QueryAliasInfo(alias_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryAliasInfo_r, (py_data_pack_fn)pack_py_samr_QueryAliasInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryAliasInfo_args_out, 28, &ndr_table_samr },
51881 : { "SetAliasInfo", "S.SetAliasInfo(alias_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetAliasInfo_r, (py_data_pack_fn)pack_py_samr_SetAliasInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetAliasInfo_args_out, 29, &ndr_table_samr },
51882 : { "DeleteDomAlias", "S.DeleteDomAlias(alias_handle) -> alias_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteDomAlias_r, (py_data_pack_fn)pack_py_samr_DeleteDomAlias_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteDomAlias_args_out, 30, &ndr_table_samr },
51883 : { "AddAliasMember", "S.AddAliasMember(alias_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddAliasMember_r, (py_data_pack_fn)pack_py_samr_AddAliasMember_args_in, (py_data_unpack_fn)unpack_py_samr_AddAliasMember_args_out, 31, &ndr_table_samr },
51884 : { "DeleteAliasMember", "S.DeleteAliasMember(alias_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_DeleteAliasMember_r, (py_data_pack_fn)pack_py_samr_DeleteAliasMember_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteAliasMember_args_out, 32, &ndr_table_samr },
51885 : { "GetMembersInAlias", "S.GetMembersInAlias(alias_handle) -> sids", (py_dcerpc_call_fn)dcerpc_samr_GetMembersInAlias_r, (py_data_pack_fn)pack_py_samr_GetMembersInAlias_args_in, (py_data_unpack_fn)unpack_py_samr_GetMembersInAlias_args_out, 33, &ndr_table_samr },
51886 : { "OpenUser", "S.OpenUser(domain_handle, access_mask, rid) -> user_handle", (py_dcerpc_call_fn)dcerpc_samr_OpenUser_r, (py_data_pack_fn)pack_py_samr_OpenUser_args_in, (py_data_unpack_fn)unpack_py_samr_OpenUser_args_out, 34, &ndr_table_samr },
51887 : { "DeleteUser", "S.DeleteUser(user_handle) -> user_handle", (py_dcerpc_call_fn)dcerpc_samr_DeleteUser_r, (py_data_pack_fn)pack_py_samr_DeleteUser_args_in, (py_data_unpack_fn)unpack_py_samr_DeleteUser_args_out, 35, &ndr_table_samr },
51888 : { "QueryUserInfo", "S.QueryUserInfo(user_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryUserInfo_r, (py_data_pack_fn)pack_py_samr_QueryUserInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryUserInfo_args_out, 36, &ndr_table_samr },
51889 : { "SetUserInfo", "S.SetUserInfo(user_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetUserInfo_r, (py_data_pack_fn)pack_py_samr_SetUserInfo_args_in, (py_data_unpack_fn)unpack_py_samr_SetUserInfo_args_out, 37, &ndr_table_samr },
51890 : { "ChangePasswordUser", "S.ChangePasswordUser(user_handle, lm_present, old_lm_crypted, new_lm_crypted, nt_present, old_nt_crypted, new_nt_crypted, cross1_present, nt_cross, cross2_present, lm_cross) -> None", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser_args_out, 38, &ndr_table_samr },
51891 : { "GetGroupsForUser", "S.GetGroupsForUser(user_handle) -> rids", (py_dcerpc_call_fn)dcerpc_samr_GetGroupsForUser_r, (py_data_pack_fn)pack_py_samr_GetGroupsForUser_args_in, (py_data_unpack_fn)unpack_py_samr_GetGroupsForUser_args_out, 39, &ndr_table_samr },
51892 : { "QueryDisplayInfo", "S.QueryDisplayInfo(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo_args_out, 40, &ndr_table_samr },
51893 : { "GetDisplayEnumerationIndex", "S.GetDisplayEnumerationIndex(domain_handle, level, name) -> idx", (py_dcerpc_call_fn)dcerpc_samr_GetDisplayEnumerationIndex_r, (py_data_pack_fn)pack_py_samr_GetDisplayEnumerationIndex_args_in, (py_data_unpack_fn)unpack_py_samr_GetDisplayEnumerationIndex_args_out, 41, &ndr_table_samr },
51894 : { "TestPrivateFunctionsDomain", "S.TestPrivateFunctionsDomain(domain_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_TestPrivateFunctionsDomain_r, (py_data_pack_fn)pack_py_samr_TestPrivateFunctionsDomain_args_in, (py_data_unpack_fn)unpack_py_samr_TestPrivateFunctionsDomain_args_out, 42, &ndr_table_samr },
51895 : { "TestPrivateFunctionsUser", "S.TestPrivateFunctionsUser(user_handle) -> None", (py_dcerpc_call_fn)dcerpc_samr_TestPrivateFunctionsUser_r, (py_data_pack_fn)pack_py_samr_TestPrivateFunctionsUser_args_in, (py_data_unpack_fn)unpack_py_samr_TestPrivateFunctionsUser_args_out, 43, &ndr_table_samr },
51896 : { "GetUserPwInfo", "S.GetUserPwInfo(user_handle) -> info", (py_dcerpc_call_fn)dcerpc_samr_GetUserPwInfo_r, (py_data_pack_fn)pack_py_samr_GetUserPwInfo_args_in, (py_data_unpack_fn)unpack_py_samr_GetUserPwInfo_args_out, 44, &ndr_table_samr },
51897 : { "RemoveMemberFromForeignDomain", "S.RemoveMemberFromForeignDomain(domain_handle, sid) -> None", (py_dcerpc_call_fn)dcerpc_samr_RemoveMemberFromForeignDomain_r, (py_data_pack_fn)pack_py_samr_RemoveMemberFromForeignDomain_args_in, (py_data_unpack_fn)unpack_py_samr_RemoveMemberFromForeignDomain_args_out, 45, &ndr_table_samr },
51898 : { "QueryDomainInfo2", "S.QueryDomainInfo2(domain_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryDomainInfo2_r, (py_data_pack_fn)pack_py_samr_QueryDomainInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDomainInfo2_args_out, 46, &ndr_table_samr },
51899 : { "QueryUserInfo2", "S.QueryUserInfo2(user_handle, level) -> info", (py_dcerpc_call_fn)dcerpc_samr_QueryUserInfo2_r, (py_data_pack_fn)pack_py_samr_QueryUserInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryUserInfo2_args_out, 47, &ndr_table_samr },
51900 : { "QueryDisplayInfo2", "S.QueryDisplayInfo2(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo2_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo2_args_out, 48, &ndr_table_samr },
51901 : { "GetDisplayEnumerationIndex2", "S.GetDisplayEnumerationIndex2(domain_handle, level, name) -> idx", (py_dcerpc_call_fn)dcerpc_samr_GetDisplayEnumerationIndex2_r, (py_data_pack_fn)pack_py_samr_GetDisplayEnumerationIndex2_args_in, (py_data_unpack_fn)unpack_py_samr_GetDisplayEnumerationIndex2_args_out, 49, &ndr_table_samr },
51902 : { "CreateUser2", "S.CreateUser2(domain_handle, account_name, acct_flags, access_mask) -> (user_handle, access_granted, rid)", (py_dcerpc_call_fn)dcerpc_samr_CreateUser2_r, (py_data_pack_fn)pack_py_samr_CreateUser2_args_in, (py_data_unpack_fn)unpack_py_samr_CreateUser2_args_out, 50, &ndr_table_samr },
51903 : { "QueryDisplayInfo3", "S.QueryDisplayInfo3(domain_handle, level, start_idx, max_entries, buf_size) -> (total_size, returned_size, info)", (py_dcerpc_call_fn)dcerpc_samr_QueryDisplayInfo3_r, (py_data_pack_fn)pack_py_samr_QueryDisplayInfo3_args_in, (py_data_unpack_fn)unpack_py_samr_QueryDisplayInfo3_args_out, 51, &ndr_table_samr },
51904 : { "AddMultipleMembersToAlias", "S.AddMultipleMembersToAlias(alias_handle, sids) -> None", (py_dcerpc_call_fn)dcerpc_samr_AddMultipleMembersToAlias_r, (py_data_pack_fn)pack_py_samr_AddMultipleMembersToAlias_args_in, (py_data_unpack_fn)unpack_py_samr_AddMultipleMembersToAlias_args_out, 52, &ndr_table_samr },
51905 : { "RemoveMultipleMembersFromAlias", "S.RemoveMultipleMembersFromAlias(alias_handle, sids) -> None", (py_dcerpc_call_fn)dcerpc_samr_RemoveMultipleMembersFromAlias_r, (py_data_pack_fn)pack_py_samr_RemoveMultipleMembersFromAlias_args_in, (py_data_unpack_fn)unpack_py_samr_RemoveMultipleMembersFromAlias_args_out, 53, &ndr_table_samr },
51906 : { "OemChangePasswordUser2", "S.OemChangePasswordUser2(server, account, password, hash) -> None", (py_dcerpc_call_fn)dcerpc_samr_OemChangePasswordUser2_r, (py_data_pack_fn)pack_py_samr_OemChangePasswordUser2_args_in, (py_data_unpack_fn)unpack_py_samr_OemChangePasswordUser2_args_out, 54, &ndr_table_samr },
51907 : { "ChangePasswordUser2", "S.ChangePasswordUser2(server, account, nt_password, nt_verifier, lm_change, lm_password, lm_verifier) -> None", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser2_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser2_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser2_args_out, 55, &ndr_table_samr },
51908 : { "GetDomPwInfo", "S.GetDomPwInfo(domain_name) -> info", (py_dcerpc_call_fn)dcerpc_samr_GetDomPwInfo_r, (py_data_pack_fn)pack_py_samr_GetDomPwInfo_args_in, (py_data_unpack_fn)unpack_py_samr_GetDomPwInfo_args_out, 56, &ndr_table_samr },
51909 : { "Connect2", "S.Connect2(system_name, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect2_r, (py_data_pack_fn)pack_py_samr_Connect2_args_in, (py_data_unpack_fn)unpack_py_samr_Connect2_args_out, 57, &ndr_table_samr },
51910 : { "SetUserInfo2", "S.SetUserInfo2(user_handle, level, info) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetUserInfo2_r, (py_data_pack_fn)pack_py_samr_SetUserInfo2_args_in, (py_data_unpack_fn)unpack_py_samr_SetUserInfo2_args_out, 58, &ndr_table_samr },
51911 : { "SetBootKeyInformation", "S.SetBootKeyInformation(connect_handle, unknown1, unknown2, unknown3) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetBootKeyInformation_r, (py_data_pack_fn)pack_py_samr_SetBootKeyInformation_args_in, (py_data_unpack_fn)unpack_py_samr_SetBootKeyInformation_args_out, 59, &ndr_table_samr },
51912 : { "GetBootKeyInformation", "S.GetBootKeyInformation(domain_handle) -> unknown", (py_dcerpc_call_fn)dcerpc_samr_GetBootKeyInformation_r, (py_data_pack_fn)pack_py_samr_GetBootKeyInformation_args_in, (py_data_unpack_fn)unpack_py_samr_GetBootKeyInformation_args_out, 60, &ndr_table_samr },
51913 : { "Connect3", "S.Connect3(system_name, unknown, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect3_r, (py_data_pack_fn)pack_py_samr_Connect3_args_in, (py_data_unpack_fn)unpack_py_samr_Connect3_args_out, 61, &ndr_table_samr },
51914 : { "Connect4", "S.Connect4(system_name, client_version, access_mask) -> connect_handle", (py_dcerpc_call_fn)dcerpc_samr_Connect4_r, (py_data_pack_fn)pack_py_samr_Connect4_args_in, (py_data_unpack_fn)unpack_py_samr_Connect4_args_out, 62, &ndr_table_samr },
51915 : { "ChangePasswordUser3", "S.ChangePasswordUser3(server, account, nt_password, nt_verifier, lm_change, lm_password, lm_verifier, password3) -> (dominfo, reject)", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser3_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser3_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser3_args_out, 63, &ndr_table_samr },
51916 : { "Connect5", "S.Connect5(system_name, access_mask, level_in, info_in) -> (level_out, info_out, connect_handle)", (py_dcerpc_call_fn)dcerpc_samr_Connect5_r, (py_data_pack_fn)pack_py_samr_Connect5_args_in, (py_data_unpack_fn)unpack_py_samr_Connect5_args_out, 64, &ndr_table_samr },
51917 : { "RidToSid", "S.RidToSid(domain_handle, rid) -> sid", (py_dcerpc_call_fn)dcerpc_samr_RidToSid_r, (py_data_pack_fn)pack_py_samr_RidToSid_args_in, (py_data_unpack_fn)unpack_py_samr_RidToSid_args_out, 65, &ndr_table_samr },
51918 : { "SetDsrmPassword", "S.SetDsrmPassword(name, unknown, hash) -> None", (py_dcerpc_call_fn)dcerpc_samr_SetDsrmPassword_r, (py_data_pack_fn)pack_py_samr_SetDsrmPassword_args_in, (py_data_unpack_fn)unpack_py_samr_SetDsrmPassword_args_out, 66, &ndr_table_samr },
51919 : { "ValidatePassword", "S.ValidatePassword(level, req) -> rep", (py_dcerpc_call_fn)dcerpc_samr_ValidatePassword_r, (py_data_pack_fn)pack_py_samr_ValidatePassword_args_in, (py_data_unpack_fn)unpack_py_samr_ValidatePassword_args_out, 67, &ndr_table_samr },
51920 : { "ChangePasswordUser4", "S.ChangePasswordUser4(server, account, password) -> None", (py_dcerpc_call_fn)dcerpc_samr_ChangePasswordUser4_r, (py_data_pack_fn)pack_py_samr_ChangePasswordUser4_args_in, (py_data_unpack_fn)unpack_py_samr_ChangePasswordUser4_args_out, 73, &ndr_table_samr },
51921 : {0}
51922 : };
51923 :
51924 497 : static PyObject *interface_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51925 : {
51926 497 : return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_samr);
51927 : }
51928 :
51929 : static PyTypeObject samr_InterfaceType = {
51930 : PyVarObject_HEAD_INIT(NULL, 0)
51931 : .tp_name = "samr.samr",
51932 : .tp_basicsize = sizeof(dcerpc_InterfaceObject),
51933 : .tp_doc = "samr(binding, lp_ctx=None, credentials=None) -> connection\n"
51934 : "\n"
51935 : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
51936 : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
51937 : "credentials should be a credentials.Credentials object.\n\n",
51938 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51939 : .tp_new = interface_samr_new,
51940 : };
51941 :
51942 0 : static PyObject *syntax_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
51943 : {
51944 0 : return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_samr.syntax_id);
51945 : }
51946 :
51947 : static PyTypeObject samr_SyntaxType = {
51948 : PyVarObject_HEAD_INIT(NULL, 0)
51949 : .tp_name = "samr.samr_abstract_syntax",
51950 : .tp_doc = "samr_abstract_syntax()\n",
51951 : .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
51952 : .tp_new = syntax_samr_new,
51953 : };
51954 :
51955 : static PyMethodDef samr_methods[] = {
51956 : { NULL, NULL, 0, NULL }
51957 : };
51958 :
51959 : static struct PyModuleDef moduledef = {
51960 : PyModuleDef_HEAD_INIT,
51961 : .m_name = "samr",
51962 : .m_doc = "samr DCE/RPC",
51963 : .m_size = -1,
51964 : .m_methods = samr_methods,
51965 : };
51966 7399 : MODULE_INIT_FUNC(samr)
51967 : {
51968 7399 : PyObject *m = NULL;
51969 7399 : PyObject *dep_samba_dcerpc_misc = NULL;
51970 7399 : PyObject *dep_samba_dcerpc_lsa = NULL;
51971 7399 : PyObject *dep_samba_dcerpc_security = NULL;
51972 7399 : PyObject *dep_talloc = NULL;
51973 7399 : PyObject *dep_samba_dcerpc_base = NULL;
51974 :
51975 7399 : dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
51976 7399 : if (dep_samba_dcerpc_misc == NULL)
51977 0 : goto out;
51978 :
51979 7399 : dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
51980 7399 : if (dep_samba_dcerpc_lsa == NULL)
51981 0 : goto out;
51982 :
51983 7399 : dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
51984 7399 : if (dep_samba_dcerpc_security == NULL)
51985 0 : goto out;
51986 :
51987 7399 : dep_talloc = PyImport_ImportModule("talloc");
51988 7399 : if (dep_talloc == NULL)
51989 0 : goto out;
51990 :
51991 7399 : dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
51992 7399 : if (dep_samba_dcerpc_base == NULL)
51993 0 : goto out;
51994 :
51995 7399 : lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
51996 7399 : if (lsa_String_Type == NULL)
51997 0 : goto out;
51998 :
51999 7399 : BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
52000 7399 : if (BaseObject_Type == NULL)
52001 0 : goto out;
52002 :
52003 7399 : lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString");
52004 7399 : if (lsa_BinaryString_Type == NULL)
52005 0 : goto out;
52006 :
52007 7399 : lsa_AsciiStringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiStringLarge");
52008 7399 : if (lsa_AsciiStringLarge_Type == NULL)
52009 0 : goto out;
52010 :
52011 7399 : lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge");
52012 7399 : if (lsa_StringLarge_Type == NULL)
52013 0 : goto out;
52014 :
52015 7399 : policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
52016 7399 : if (policy_handle_Type == NULL)
52017 0 : goto out;
52018 :
52019 7399 : sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
52020 7399 : if (sec_desc_buf_Type == NULL)
52021 0 : goto out;
52022 :
52023 7399 : dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
52024 7399 : if (dom_sid_Type == NULL)
52025 0 : goto out;
52026 :
52027 7399 : lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
52028 7399 : if (lsa_SidArray_Type == NULL)
52029 0 : goto out;
52030 :
52031 7399 : lsa_Strings_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "Strings");
52032 7399 : if (lsa_Strings_Type == NULL)
52033 0 : goto out;
52034 :
52035 7399 : lsa_AsciiString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiString");
52036 7399 : if (lsa_AsciiString_Type == NULL)
52037 0 : goto out;
52038 :
52039 7399 : ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
52040 7399 : if (ClientConnection_Type == NULL)
52041 0 : goto out;
52042 :
52043 7399 : ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
52044 7399 : if (ndr_syntax_id_Type == NULL)
52045 0 : goto out;
52046 :
52047 7399 : samr_SamEntry_Type.tp_base = BaseObject_Type;
52048 7399 : samr_SamEntry_Type.tp_basicsize = pytalloc_BaseObject_size();
52049 :
52050 7399 : samr_SamArray_Type.tp_base = BaseObject_Type;
52051 7399 : samr_SamArray_Type.tp_basicsize = pytalloc_BaseObject_size();
52052 :
52053 7399 : samr_DomInfo1_Type.tp_base = BaseObject_Type;
52054 7399 : samr_DomInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();
52055 :
52056 7399 : samr_DomGeneralInformation_Type.tp_base = BaseObject_Type;
52057 7399 : samr_DomGeneralInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
52058 :
52059 7399 : samr_DomInfo3_Type.tp_base = BaseObject_Type;
52060 7399 : samr_DomInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();
52061 :
52062 7399 : samr_DomOEMInformation_Type.tp_base = BaseObject_Type;
52063 7399 : samr_DomOEMInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
52064 :
52065 7399 : samr_DomInfo5_Type.tp_base = BaseObject_Type;
52066 7399 : samr_DomInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();
52067 :
52068 7399 : samr_DomInfo6_Type.tp_base = BaseObject_Type;
52069 7399 : samr_DomInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();
52070 :
52071 7399 : samr_DomInfo7_Type.tp_base = BaseObject_Type;
52072 7399 : samr_DomInfo7_Type.tp_basicsize = pytalloc_BaseObject_size();
52073 :
52074 7399 : samr_DomInfo8_Type.tp_base = BaseObject_Type;
52075 7399 : samr_DomInfo8_Type.tp_basicsize = pytalloc_BaseObject_size();
52076 :
52077 7399 : samr_DomInfo9_Type.tp_base = BaseObject_Type;
52078 7399 : samr_DomInfo9_Type.tp_basicsize = pytalloc_BaseObject_size();
52079 :
52080 7399 : samr_DomGeneralInformation2_Type.tp_base = BaseObject_Type;
52081 7399 : samr_DomGeneralInformation2_Type.tp_basicsize = pytalloc_BaseObject_size();
52082 :
52083 7399 : samr_DomInfo12_Type.tp_base = BaseObject_Type;
52084 7399 : samr_DomInfo12_Type.tp_basicsize = pytalloc_BaseObject_size();
52085 :
52086 7399 : samr_DomInfo13_Type.tp_base = BaseObject_Type;
52087 7399 : samr_DomInfo13_Type.tp_basicsize = pytalloc_BaseObject_size();
52088 :
52089 7399 : samr_DomainInfo_Type.tp_base = BaseObject_Type;
52090 7399 : samr_DomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52091 :
52092 7399 : samr_Ids_Type.tp_base = BaseObject_Type;
52093 7399 : samr_Ids_Type.tp_basicsize = pytalloc_BaseObject_size();
52094 :
52095 7399 : samr_GroupInfoAll_Type.tp_base = BaseObject_Type;
52096 7399 : samr_GroupInfoAll_Type.tp_basicsize = pytalloc_BaseObject_size();
52097 :
52098 7399 : samr_GroupInfoAttributes_Type.tp_base = BaseObject_Type;
52099 7399 : samr_GroupInfoAttributes_Type.tp_basicsize = pytalloc_BaseObject_size();
52100 :
52101 7399 : samr_GroupInfoDescription_Type.tp_base = BaseObject_Type;
52102 7399 : samr_GroupInfoDescription_Type.tp_basicsize = pytalloc_BaseObject_size();
52103 :
52104 7399 : samr_GroupInfo_Type.tp_base = BaseObject_Type;
52105 7399 : samr_GroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52106 :
52107 7399 : samr_RidAttrArray_Type.tp_base = BaseObject_Type;
52108 7399 : samr_RidAttrArray_Type.tp_basicsize = pytalloc_BaseObject_size();
52109 :
52110 7399 : samr_AliasInfoAll_Type.tp_base = BaseObject_Type;
52111 7399 : samr_AliasInfoAll_Type.tp_basicsize = pytalloc_BaseObject_size();
52112 :
52113 7399 : samr_AliasInfo_Type.tp_base = BaseObject_Type;
52114 7399 : samr_AliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52115 :
52116 7399 : samr_UserInfo1_Type.tp_base = BaseObject_Type;
52117 7399 : samr_UserInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();
52118 :
52119 7399 : samr_UserInfo2_Type.tp_base = BaseObject_Type;
52120 7399 : samr_UserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
52121 :
52122 7399 : samr_LogonHours_Type.tp_base = BaseObject_Type;
52123 7399 : samr_LogonHours_Type.tp_basicsize = pytalloc_BaseObject_size();
52124 :
52125 7399 : samr_UserInfo3_Type.tp_base = BaseObject_Type;
52126 7399 : samr_UserInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();
52127 :
52128 7399 : samr_UserInfo4_Type.tp_base = BaseObject_Type;
52129 7399 : samr_UserInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();
52130 :
52131 7399 : samr_UserInfo5_Type.tp_base = BaseObject_Type;
52132 7399 : samr_UserInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();
52133 :
52134 7399 : samr_UserInfo6_Type.tp_base = BaseObject_Type;
52135 7399 : samr_UserInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();
52136 :
52137 7399 : samr_UserInfo7_Type.tp_base = BaseObject_Type;
52138 7399 : samr_UserInfo7_Type.tp_basicsize = pytalloc_BaseObject_size();
52139 :
52140 7399 : samr_UserInfo8_Type.tp_base = BaseObject_Type;
52141 7399 : samr_UserInfo8_Type.tp_basicsize = pytalloc_BaseObject_size();
52142 :
52143 7399 : samr_UserInfo9_Type.tp_base = BaseObject_Type;
52144 7399 : samr_UserInfo9_Type.tp_basicsize = pytalloc_BaseObject_size();
52145 :
52146 7399 : samr_UserInfo10_Type.tp_base = BaseObject_Type;
52147 7399 : samr_UserInfo10_Type.tp_basicsize = pytalloc_BaseObject_size();
52148 :
52149 7399 : samr_UserInfo11_Type.tp_base = BaseObject_Type;
52150 7399 : samr_UserInfo11_Type.tp_basicsize = pytalloc_BaseObject_size();
52151 :
52152 7399 : samr_UserInfo12_Type.tp_base = BaseObject_Type;
52153 7399 : samr_UserInfo12_Type.tp_basicsize = pytalloc_BaseObject_size();
52154 :
52155 7399 : samr_UserInfo13_Type.tp_base = BaseObject_Type;
52156 7399 : samr_UserInfo13_Type.tp_basicsize = pytalloc_BaseObject_size();
52157 :
52158 7399 : samr_UserInfo14_Type.tp_base = BaseObject_Type;
52159 7399 : samr_UserInfo14_Type.tp_basicsize = pytalloc_BaseObject_size();
52160 :
52161 7399 : samr_UserInfo16_Type.tp_base = BaseObject_Type;
52162 7399 : samr_UserInfo16_Type.tp_basicsize = pytalloc_BaseObject_size();
52163 :
52164 7399 : samr_UserInfo17_Type.tp_base = BaseObject_Type;
52165 7399 : samr_UserInfo17_Type.tp_basicsize = pytalloc_BaseObject_size();
52166 :
52167 7399 : samr_Password_Type.tp_base = BaseObject_Type;
52168 7399 : samr_Password_Type.tp_basicsize = pytalloc_BaseObject_size();
52169 :
52170 7399 : samr_UserInfo18_Type.tp_base = BaseObject_Type;
52171 7399 : samr_UserInfo18_Type.tp_basicsize = pytalloc_BaseObject_size();
52172 :
52173 7399 : samr_UserInfo20_Type.tp_base = BaseObject_Type;
52174 7399 : samr_UserInfo20_Type.tp_basicsize = pytalloc_BaseObject_size();
52175 :
52176 7399 : samr_UserInfo21_Type.tp_base = BaseObject_Type;
52177 7399 : samr_UserInfo21_Type.tp_basicsize = pytalloc_BaseObject_size();
52178 :
52179 7399 : samr_CryptPassword_Type.tp_base = BaseObject_Type;
52180 7399 : samr_CryptPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
52181 :
52182 7399 : samr_UserInfo23_Type.tp_base = BaseObject_Type;
52183 7399 : samr_UserInfo23_Type.tp_basicsize = pytalloc_BaseObject_size();
52184 :
52185 7399 : samr_UserInfo24_Type.tp_base = BaseObject_Type;
52186 7399 : samr_UserInfo24_Type.tp_basicsize = pytalloc_BaseObject_size();
52187 :
52188 7399 : samr_CryptPasswordEx_Type.tp_base = BaseObject_Type;
52189 7399 : samr_CryptPasswordEx_Type.tp_basicsize = pytalloc_BaseObject_size();
52190 :
52191 7399 : samr_UserInfo25_Type.tp_base = BaseObject_Type;
52192 7399 : samr_UserInfo25_Type.tp_basicsize = pytalloc_BaseObject_size();
52193 :
52194 7399 : samr_UserInfo26_Type.tp_base = BaseObject_Type;
52195 7399 : samr_UserInfo26_Type.tp_basicsize = pytalloc_BaseObject_size();
52196 :
52197 7399 : samr_EncryptedPasswordAES_Type.tp_base = BaseObject_Type;
52198 7399 : samr_EncryptedPasswordAES_Type.tp_basicsize = pytalloc_BaseObject_size();
52199 :
52200 7399 : samr_UserInfo31_Type.tp_base = BaseObject_Type;
52201 7399 : samr_UserInfo31_Type.tp_basicsize = pytalloc_BaseObject_size();
52202 :
52203 7399 : samr_UserInfo32_Type.tp_base = BaseObject_Type;
52204 7399 : samr_UserInfo32_Type.tp_basicsize = pytalloc_BaseObject_size();
52205 :
52206 7399 : samr_UserInfo_Type.tp_base = BaseObject_Type;
52207 7399 : samr_UserInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52208 :
52209 7399 : samr_RidWithAttribute_Type.tp_base = BaseObject_Type;
52210 7399 : samr_RidWithAttribute_Type.tp_basicsize = pytalloc_BaseObject_size();
52211 :
52212 7399 : samr_RidWithAttributeArray_Type.tp_base = BaseObject_Type;
52213 7399 : samr_RidWithAttributeArray_Type.tp_basicsize = pytalloc_BaseObject_size();
52214 :
52215 7399 : samr_DispEntryGeneral_Type.tp_base = BaseObject_Type;
52216 7399 : samr_DispEntryGeneral_Type.tp_basicsize = pytalloc_BaseObject_size();
52217 :
52218 7399 : samr_DispInfoGeneral_Type.tp_base = BaseObject_Type;
52219 7399 : samr_DispInfoGeneral_Type.tp_basicsize = pytalloc_BaseObject_size();
52220 :
52221 7399 : samr_DispEntryFull_Type.tp_base = BaseObject_Type;
52222 7399 : samr_DispEntryFull_Type.tp_basicsize = pytalloc_BaseObject_size();
52223 :
52224 7399 : samr_DispInfoFull_Type.tp_base = BaseObject_Type;
52225 7399 : samr_DispInfoFull_Type.tp_basicsize = pytalloc_BaseObject_size();
52226 :
52227 7399 : samr_DispEntryFullGroup_Type.tp_base = BaseObject_Type;
52228 7399 : samr_DispEntryFullGroup_Type.tp_basicsize = pytalloc_BaseObject_size();
52229 :
52230 7399 : samr_DispInfoFullGroups_Type.tp_base = BaseObject_Type;
52231 7399 : samr_DispInfoFullGroups_Type.tp_basicsize = pytalloc_BaseObject_size();
52232 :
52233 7399 : samr_DispEntryAscii_Type.tp_base = BaseObject_Type;
52234 7399 : samr_DispEntryAscii_Type.tp_basicsize = pytalloc_BaseObject_size();
52235 :
52236 7399 : samr_DispInfoAscii_Type.tp_base = BaseObject_Type;
52237 7399 : samr_DispInfoAscii_Type.tp_basicsize = pytalloc_BaseObject_size();
52238 :
52239 7399 : samr_DispInfo_Type.tp_base = BaseObject_Type;
52240 7399 : samr_DispInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52241 :
52242 7399 : samr_PwInfo_Type.tp_base = BaseObject_Type;
52243 7399 : samr_PwInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52244 :
52245 7399 : userPwdChangeFailureInformation_Type.tp_base = BaseObject_Type;
52246 7399 : userPwdChangeFailureInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
52247 :
52248 7399 : samr_ConnectInfo1_Type.tp_base = BaseObject_Type;
52249 7399 : samr_ConnectInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();
52250 :
52251 7399 : samr_ConnectInfo_Type.tp_base = BaseObject_Type;
52252 7399 : samr_ConnectInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52253 :
52254 7399 : samr_ValidationBlob_Type.tp_base = BaseObject_Type;
52255 7399 : samr_ValidationBlob_Type.tp_basicsize = pytalloc_BaseObject_size();
52256 :
52257 7399 : samr_ValidatePasswordInfo_Type.tp_base = BaseObject_Type;
52258 7399 : samr_ValidatePasswordInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52259 :
52260 7399 : samr_ValidatePasswordRepCtr_Type.tp_base = BaseObject_Type;
52261 7399 : samr_ValidatePasswordRepCtr_Type.tp_basicsize = pytalloc_BaseObject_size();
52262 :
52263 7399 : samr_ValidatePasswordRep_Type.tp_base = BaseObject_Type;
52264 7399 : samr_ValidatePasswordRep_Type.tp_basicsize = pytalloc_BaseObject_size();
52265 :
52266 7399 : samr_ValidatePasswordReq3_Type.tp_base = BaseObject_Type;
52267 7399 : samr_ValidatePasswordReq3_Type.tp_basicsize = pytalloc_BaseObject_size();
52268 :
52269 7399 : samr_ValidatePasswordReq2_Type.tp_base = BaseObject_Type;
52270 7399 : samr_ValidatePasswordReq2_Type.tp_basicsize = pytalloc_BaseObject_size();
52271 :
52272 7399 : samr_ValidatePasswordReq1_Type.tp_base = BaseObject_Type;
52273 7399 : samr_ValidatePasswordReq1_Type.tp_basicsize = pytalloc_BaseObject_size();
52274 :
52275 7399 : samr_ValidatePasswordReq_Type.tp_base = BaseObject_Type;
52276 7399 : samr_ValidatePasswordReq_Type.tp_basicsize = pytalloc_BaseObject_size();
52277 :
52278 7399 : samr_Connect_Type.tp_base = BaseObject_Type;
52279 7399 : samr_Connect_Type.tp_basicsize = pytalloc_BaseObject_size();
52280 :
52281 7399 : samr_Close_Type.tp_base = BaseObject_Type;
52282 7399 : samr_Close_Type.tp_basicsize = pytalloc_BaseObject_size();
52283 :
52284 7399 : samr_SetSecurity_Type.tp_base = BaseObject_Type;
52285 7399 : samr_SetSecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
52286 :
52287 7399 : samr_QuerySecurity_Type.tp_base = BaseObject_Type;
52288 7399 : samr_QuerySecurity_Type.tp_basicsize = pytalloc_BaseObject_size();
52289 :
52290 7399 : samr_Shutdown_Type.tp_base = BaseObject_Type;
52291 7399 : samr_Shutdown_Type.tp_basicsize = pytalloc_BaseObject_size();
52292 :
52293 7399 : samr_LookupDomain_Type.tp_base = BaseObject_Type;
52294 7399 : samr_LookupDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
52295 :
52296 7399 : samr_EnumDomains_Type.tp_base = BaseObject_Type;
52297 7399 : samr_EnumDomains_Type.tp_basicsize = pytalloc_BaseObject_size();
52298 :
52299 7399 : samr_OpenDomain_Type.tp_base = BaseObject_Type;
52300 7399 : samr_OpenDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
52301 :
52302 7399 : samr_QueryDomainInfo_Type.tp_base = BaseObject_Type;
52303 7399 : samr_QueryDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52304 :
52305 7399 : samr_SetDomainInfo_Type.tp_base = BaseObject_Type;
52306 7399 : samr_SetDomainInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52307 :
52308 7399 : samr_CreateDomainGroup_Type.tp_base = BaseObject_Type;
52309 7399 : samr_CreateDomainGroup_Type.tp_basicsize = pytalloc_BaseObject_size();
52310 :
52311 7399 : samr_EnumDomainGroups_Type.tp_base = BaseObject_Type;
52312 7399 : samr_EnumDomainGroups_Type.tp_basicsize = pytalloc_BaseObject_size();
52313 :
52314 7399 : samr_CreateUser_Type.tp_base = BaseObject_Type;
52315 7399 : samr_CreateUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52316 :
52317 7399 : samr_EnumDomainUsers_Type.tp_base = BaseObject_Type;
52318 7399 : samr_EnumDomainUsers_Type.tp_basicsize = pytalloc_BaseObject_size();
52319 :
52320 7399 : samr_CreateDomAlias_Type.tp_base = BaseObject_Type;
52321 7399 : samr_CreateDomAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52322 :
52323 7399 : samr_EnumDomainAliases_Type.tp_base = BaseObject_Type;
52324 7399 : samr_EnumDomainAliases_Type.tp_basicsize = pytalloc_BaseObject_size();
52325 :
52326 7399 : samr_GetAliasMembership_Type.tp_base = BaseObject_Type;
52327 7399 : samr_GetAliasMembership_Type.tp_basicsize = pytalloc_BaseObject_size();
52328 :
52329 7399 : samr_LookupNames_Type.tp_base = BaseObject_Type;
52330 7399 : samr_LookupNames_Type.tp_basicsize = pytalloc_BaseObject_size();
52331 :
52332 7399 : samr_LookupRids_Type.tp_base = BaseObject_Type;
52333 7399 : samr_LookupRids_Type.tp_basicsize = pytalloc_BaseObject_size();
52334 :
52335 7399 : samr_OpenGroup_Type.tp_base = BaseObject_Type;
52336 7399 : samr_OpenGroup_Type.tp_basicsize = pytalloc_BaseObject_size();
52337 :
52338 7399 : samr_QueryGroupInfo_Type.tp_base = BaseObject_Type;
52339 7399 : samr_QueryGroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52340 :
52341 7399 : samr_SetGroupInfo_Type.tp_base = BaseObject_Type;
52342 7399 : samr_SetGroupInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52343 :
52344 7399 : samr_AddGroupMember_Type.tp_base = BaseObject_Type;
52345 7399 : samr_AddGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size();
52346 :
52347 7399 : samr_DeleteDomainGroup_Type.tp_base = BaseObject_Type;
52348 7399 : samr_DeleteDomainGroup_Type.tp_basicsize = pytalloc_BaseObject_size();
52349 :
52350 7399 : samr_DeleteGroupMember_Type.tp_base = BaseObject_Type;
52351 7399 : samr_DeleteGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size();
52352 :
52353 7399 : samr_QueryGroupMember_Type.tp_base = BaseObject_Type;
52354 7399 : samr_QueryGroupMember_Type.tp_basicsize = pytalloc_BaseObject_size();
52355 :
52356 7399 : samr_SetMemberAttributesOfGroup_Type.tp_base = BaseObject_Type;
52357 7399 : samr_SetMemberAttributesOfGroup_Type.tp_basicsize = pytalloc_BaseObject_size();
52358 :
52359 7399 : samr_OpenAlias_Type.tp_base = BaseObject_Type;
52360 7399 : samr_OpenAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52361 :
52362 7399 : samr_QueryAliasInfo_Type.tp_base = BaseObject_Type;
52363 7399 : samr_QueryAliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52364 :
52365 7399 : samr_SetAliasInfo_Type.tp_base = BaseObject_Type;
52366 7399 : samr_SetAliasInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52367 :
52368 7399 : samr_DeleteDomAlias_Type.tp_base = BaseObject_Type;
52369 7399 : samr_DeleteDomAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52370 :
52371 7399 : samr_AddAliasMember_Type.tp_base = BaseObject_Type;
52372 7399 : samr_AddAliasMember_Type.tp_basicsize = pytalloc_BaseObject_size();
52373 :
52374 7399 : samr_DeleteAliasMember_Type.tp_base = BaseObject_Type;
52375 7399 : samr_DeleteAliasMember_Type.tp_basicsize = pytalloc_BaseObject_size();
52376 :
52377 7399 : samr_GetMembersInAlias_Type.tp_base = BaseObject_Type;
52378 7399 : samr_GetMembersInAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52379 :
52380 7399 : samr_OpenUser_Type.tp_base = BaseObject_Type;
52381 7399 : samr_OpenUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52382 :
52383 7399 : samr_DeleteUser_Type.tp_base = BaseObject_Type;
52384 7399 : samr_DeleteUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52385 :
52386 7399 : samr_QueryUserInfo_Type.tp_base = BaseObject_Type;
52387 7399 : samr_QueryUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52388 :
52389 7399 : samr_SetUserInfo_Type.tp_base = BaseObject_Type;
52390 7399 : samr_SetUserInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52391 :
52392 7399 : samr_ChangePasswordUser_Type.tp_base = BaseObject_Type;
52393 7399 : samr_ChangePasswordUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52394 :
52395 7399 : samr_GetGroupsForUser_Type.tp_base = BaseObject_Type;
52396 7399 : samr_GetGroupsForUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52397 :
52398 7399 : samr_QueryDisplayInfo_Type.tp_base = BaseObject_Type;
52399 7399 : samr_QueryDisplayInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52400 :
52401 7399 : samr_GetDisplayEnumerationIndex_Type.tp_base = BaseObject_Type;
52402 7399 : samr_GetDisplayEnumerationIndex_Type.tp_basicsize = pytalloc_BaseObject_size();
52403 :
52404 7399 : samr_TestPrivateFunctionsDomain_Type.tp_base = BaseObject_Type;
52405 7399 : samr_TestPrivateFunctionsDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
52406 :
52407 7399 : samr_TestPrivateFunctionsUser_Type.tp_base = BaseObject_Type;
52408 7399 : samr_TestPrivateFunctionsUser_Type.tp_basicsize = pytalloc_BaseObject_size();
52409 :
52410 7399 : samr_GetUserPwInfo_Type.tp_base = BaseObject_Type;
52411 7399 : samr_GetUserPwInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52412 :
52413 7399 : samr_RemoveMemberFromForeignDomain_Type.tp_base = BaseObject_Type;
52414 7399 : samr_RemoveMemberFromForeignDomain_Type.tp_basicsize = pytalloc_BaseObject_size();
52415 :
52416 7399 : samr_QueryDomainInfo2_Type.tp_base = BaseObject_Type;
52417 7399 : samr_QueryDomainInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
52418 :
52419 7399 : samr_QueryUserInfo2_Type.tp_base = BaseObject_Type;
52420 7399 : samr_QueryUserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
52421 :
52422 7399 : samr_QueryDisplayInfo2_Type.tp_base = BaseObject_Type;
52423 7399 : samr_QueryDisplayInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
52424 :
52425 7399 : samr_GetDisplayEnumerationIndex2_Type.tp_base = BaseObject_Type;
52426 7399 : samr_GetDisplayEnumerationIndex2_Type.tp_basicsize = pytalloc_BaseObject_size();
52427 :
52428 7399 : samr_CreateUser2_Type.tp_base = BaseObject_Type;
52429 7399 : samr_CreateUser2_Type.tp_basicsize = pytalloc_BaseObject_size();
52430 :
52431 7399 : samr_QueryDisplayInfo3_Type.tp_base = BaseObject_Type;
52432 7399 : samr_QueryDisplayInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();
52433 :
52434 7399 : samr_AddMultipleMembersToAlias_Type.tp_base = BaseObject_Type;
52435 7399 : samr_AddMultipleMembersToAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52436 :
52437 7399 : samr_RemoveMultipleMembersFromAlias_Type.tp_base = BaseObject_Type;
52438 7399 : samr_RemoveMultipleMembersFromAlias_Type.tp_basicsize = pytalloc_BaseObject_size();
52439 :
52440 7399 : samr_OemChangePasswordUser2_Type.tp_base = BaseObject_Type;
52441 7399 : samr_OemChangePasswordUser2_Type.tp_basicsize = pytalloc_BaseObject_size();
52442 :
52443 7399 : samr_ChangePasswordUser2_Type.tp_base = BaseObject_Type;
52444 7399 : samr_ChangePasswordUser2_Type.tp_basicsize = pytalloc_BaseObject_size();
52445 :
52446 7399 : samr_GetDomPwInfo_Type.tp_base = BaseObject_Type;
52447 7399 : samr_GetDomPwInfo_Type.tp_basicsize = pytalloc_BaseObject_size();
52448 :
52449 7399 : samr_Connect2_Type.tp_base = BaseObject_Type;
52450 7399 : samr_Connect2_Type.tp_basicsize = pytalloc_BaseObject_size();
52451 :
52452 7399 : samr_SetUserInfo2_Type.tp_base = BaseObject_Type;
52453 7399 : samr_SetUserInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();
52454 :
52455 7399 : samr_SetBootKeyInformation_Type.tp_base = BaseObject_Type;
52456 7399 : samr_SetBootKeyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
52457 :
52458 7399 : samr_GetBootKeyInformation_Type.tp_base = BaseObject_Type;
52459 7399 : samr_GetBootKeyInformation_Type.tp_basicsize = pytalloc_BaseObject_size();
52460 :
52461 7399 : samr_Connect3_Type.tp_base = BaseObject_Type;
52462 7399 : samr_Connect3_Type.tp_basicsize = pytalloc_BaseObject_size();
52463 :
52464 7399 : samr_Connect4_Type.tp_base = BaseObject_Type;
52465 7399 : samr_Connect4_Type.tp_basicsize = pytalloc_BaseObject_size();
52466 :
52467 7399 : samr_ChangePasswordUser3_Type.tp_base = BaseObject_Type;
52468 7399 : samr_ChangePasswordUser3_Type.tp_basicsize = pytalloc_BaseObject_size();
52469 :
52470 7399 : samr_Connect5_Type.tp_base = BaseObject_Type;
52471 7399 : samr_Connect5_Type.tp_basicsize = pytalloc_BaseObject_size();
52472 :
52473 7399 : samr_RidToSid_Type.tp_base = BaseObject_Type;
52474 7399 : samr_RidToSid_Type.tp_basicsize = pytalloc_BaseObject_size();
52475 :
52476 7399 : samr_SetDsrmPassword_Type.tp_base = BaseObject_Type;
52477 7399 : samr_SetDsrmPassword_Type.tp_basicsize = pytalloc_BaseObject_size();
52478 :
52479 7399 : samr_ValidatePassword_Type.tp_base = BaseObject_Type;
52480 7399 : samr_ValidatePassword_Type.tp_basicsize = pytalloc_BaseObject_size();
52481 :
52482 7399 : samr_ChangePasswordUser4_Type.tp_base = BaseObject_Type;
52483 7399 : samr_ChangePasswordUser4_Type.tp_basicsize = pytalloc_BaseObject_size();
52484 :
52485 7399 : samr_InterfaceType.tp_base = ClientConnection_Type;
52486 :
52487 7399 : samr_SyntaxType.tp_base = ndr_syntax_id_Type;
52488 7399 : samr_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
52489 :
52490 7399 : if (PyType_Ready(&samr_SamEntry_Type) < 0)
52491 0 : goto out;
52492 7399 : if (PyType_Ready(&samr_SamArray_Type) < 0)
52493 0 : goto out;
52494 7399 : if (PyType_Ready(&samr_DomInfo1_Type) < 0)
52495 0 : goto out;
52496 7399 : if (PyType_Ready(&samr_DomGeneralInformation_Type) < 0)
52497 0 : goto out;
52498 7399 : if (PyType_Ready(&samr_DomInfo3_Type) < 0)
52499 0 : goto out;
52500 7399 : if (PyType_Ready(&samr_DomOEMInformation_Type) < 0)
52501 0 : goto out;
52502 7399 : if (PyType_Ready(&samr_DomInfo5_Type) < 0)
52503 0 : goto out;
52504 7399 : if (PyType_Ready(&samr_DomInfo6_Type) < 0)
52505 0 : goto out;
52506 7399 : if (PyType_Ready(&samr_DomInfo7_Type) < 0)
52507 0 : goto out;
52508 7399 : if (PyType_Ready(&samr_DomInfo8_Type) < 0)
52509 0 : goto out;
52510 7399 : if (PyType_Ready(&samr_DomInfo9_Type) < 0)
52511 0 : goto out;
52512 7399 : if (PyType_Ready(&samr_DomGeneralInformation2_Type) < 0)
52513 0 : goto out;
52514 7399 : if (PyType_Ready(&samr_DomInfo12_Type) < 0)
52515 0 : goto out;
52516 7399 : if (PyType_Ready(&samr_DomInfo13_Type) < 0)
52517 0 : goto out;
52518 7399 : if (PyType_Ready(&samr_DomainInfo_Type) < 0)
52519 0 : goto out;
52520 7399 : if (PyType_Ready(&samr_Ids_Type) < 0)
52521 0 : goto out;
52522 7399 : if (PyType_Ready(&samr_GroupInfoAll_Type) < 0)
52523 0 : goto out;
52524 7399 : if (PyType_Ready(&samr_GroupInfoAttributes_Type) < 0)
52525 0 : goto out;
52526 7399 : if (PyType_Ready(&samr_GroupInfoDescription_Type) < 0)
52527 0 : goto out;
52528 7399 : if (PyType_Ready(&samr_GroupInfo_Type) < 0)
52529 0 : goto out;
52530 7399 : if (PyType_Ready(&samr_RidAttrArray_Type) < 0)
52531 0 : goto out;
52532 7399 : if (PyType_Ready(&samr_AliasInfoAll_Type) < 0)
52533 0 : goto out;
52534 7399 : if (PyType_Ready(&samr_AliasInfo_Type) < 0)
52535 0 : goto out;
52536 7399 : if (PyType_Ready(&samr_UserInfo1_Type) < 0)
52537 0 : goto out;
52538 7399 : if (PyType_Ready(&samr_UserInfo2_Type) < 0)
52539 0 : goto out;
52540 7399 : if (PyType_Ready(&samr_LogonHours_Type) < 0)
52541 0 : goto out;
52542 7399 : if (PyType_Ready(&samr_UserInfo3_Type) < 0)
52543 0 : goto out;
52544 7399 : if (PyType_Ready(&samr_UserInfo4_Type) < 0)
52545 0 : goto out;
52546 7399 : if (PyType_Ready(&samr_UserInfo5_Type) < 0)
52547 0 : goto out;
52548 7399 : if (PyType_Ready(&samr_UserInfo6_Type) < 0)
52549 0 : goto out;
52550 7399 : if (PyType_Ready(&samr_UserInfo7_Type) < 0)
52551 0 : goto out;
52552 7399 : if (PyType_Ready(&samr_UserInfo8_Type) < 0)
52553 0 : goto out;
52554 7399 : if (PyType_Ready(&samr_UserInfo9_Type) < 0)
52555 0 : goto out;
52556 7399 : if (PyType_Ready(&samr_UserInfo10_Type) < 0)
52557 0 : goto out;
52558 7399 : if (PyType_Ready(&samr_UserInfo11_Type) < 0)
52559 0 : goto out;
52560 7399 : if (PyType_Ready(&samr_UserInfo12_Type) < 0)
52561 0 : goto out;
52562 7399 : if (PyType_Ready(&samr_UserInfo13_Type) < 0)
52563 0 : goto out;
52564 7399 : if (PyType_Ready(&samr_UserInfo14_Type) < 0)
52565 0 : goto out;
52566 7399 : if (PyType_Ready(&samr_UserInfo16_Type) < 0)
52567 0 : goto out;
52568 7399 : if (PyType_Ready(&samr_UserInfo17_Type) < 0)
52569 0 : goto out;
52570 7399 : if (PyType_Ready(&samr_Password_Type) < 0)
52571 0 : goto out;
52572 7399 : if (PyType_Ready(&samr_UserInfo18_Type) < 0)
52573 0 : goto out;
52574 7399 : if (PyType_Ready(&samr_UserInfo20_Type) < 0)
52575 0 : goto out;
52576 7399 : if (PyType_Ready(&samr_UserInfo21_Type) < 0)
52577 0 : goto out;
52578 7399 : if (PyType_Ready(&samr_CryptPassword_Type) < 0)
52579 0 : goto out;
52580 7399 : if (PyType_Ready(&samr_UserInfo23_Type) < 0)
52581 0 : goto out;
52582 7399 : if (PyType_Ready(&samr_UserInfo24_Type) < 0)
52583 0 : goto out;
52584 7399 : if (PyType_Ready(&samr_CryptPasswordEx_Type) < 0)
52585 0 : goto out;
52586 7399 : if (PyType_Ready(&samr_UserInfo25_Type) < 0)
52587 0 : goto out;
52588 7399 : if (PyType_Ready(&samr_UserInfo26_Type) < 0)
52589 0 : goto out;
52590 7399 : if (PyType_Ready(&samr_EncryptedPasswordAES_Type) < 0)
52591 0 : goto out;
52592 7399 : if (PyType_Ready(&samr_UserInfo31_Type) < 0)
52593 0 : goto out;
52594 7399 : if (PyType_Ready(&samr_UserInfo32_Type) < 0)
52595 0 : goto out;
52596 7399 : if (PyType_Ready(&samr_UserInfo_Type) < 0)
52597 0 : goto out;
52598 7399 : if (PyType_Ready(&samr_RidWithAttribute_Type) < 0)
52599 0 : goto out;
52600 7399 : if (PyType_Ready(&samr_RidWithAttributeArray_Type) < 0)
52601 0 : goto out;
52602 7399 : if (PyType_Ready(&samr_DispEntryGeneral_Type) < 0)
52603 0 : goto out;
52604 7399 : if (PyType_Ready(&samr_DispInfoGeneral_Type) < 0)
52605 0 : goto out;
52606 7399 : if (PyType_Ready(&samr_DispEntryFull_Type) < 0)
52607 0 : goto out;
52608 7399 : if (PyType_Ready(&samr_DispInfoFull_Type) < 0)
52609 0 : goto out;
52610 7399 : if (PyType_Ready(&samr_DispEntryFullGroup_Type) < 0)
52611 0 : goto out;
52612 7399 : if (PyType_Ready(&samr_DispInfoFullGroups_Type) < 0)
52613 0 : goto out;
52614 7399 : if (PyType_Ready(&samr_DispEntryAscii_Type) < 0)
52615 0 : goto out;
52616 7399 : if (PyType_Ready(&samr_DispInfoAscii_Type) < 0)
52617 0 : goto out;
52618 7399 : if (PyType_Ready(&samr_DispInfo_Type) < 0)
52619 0 : goto out;
52620 7399 : if (PyType_Ready(&samr_PwInfo_Type) < 0)
52621 0 : goto out;
52622 7399 : if (PyType_Ready(&userPwdChangeFailureInformation_Type) < 0)
52623 0 : goto out;
52624 7399 : if (PyType_Ready(&samr_ConnectInfo1_Type) < 0)
52625 0 : goto out;
52626 7399 : if (PyType_Ready(&samr_ConnectInfo_Type) < 0)
52627 0 : goto out;
52628 7399 : if (PyType_Ready(&samr_ValidationBlob_Type) < 0)
52629 0 : goto out;
52630 7399 : if (PyType_Ready(&samr_ValidatePasswordInfo_Type) < 0)
52631 0 : goto out;
52632 7399 : if (PyType_Ready(&samr_ValidatePasswordRepCtr_Type) < 0)
52633 0 : goto out;
52634 7399 : if (PyType_Ready(&samr_ValidatePasswordRep_Type) < 0)
52635 0 : goto out;
52636 7399 : if (PyType_Ready(&samr_ValidatePasswordReq3_Type) < 0)
52637 0 : goto out;
52638 7399 : if (PyType_Ready(&samr_ValidatePasswordReq2_Type) < 0)
52639 0 : goto out;
52640 7399 : if (PyType_Ready(&samr_ValidatePasswordReq1_Type) < 0)
52641 0 : goto out;
52642 7399 : if (PyType_Ready(&samr_ValidatePasswordReq_Type) < 0)
52643 0 : goto out;
52644 7399 : if (PyType_Ready(&samr_Connect_Type) < 0)
52645 0 : goto out;
52646 7399 : if (PyType_Ready(&samr_Close_Type) < 0)
52647 0 : goto out;
52648 7399 : if (PyType_Ready(&samr_SetSecurity_Type) < 0)
52649 0 : goto out;
52650 7399 : if (PyType_Ready(&samr_QuerySecurity_Type) < 0)
52651 0 : goto out;
52652 7399 : if (PyType_Ready(&samr_Shutdown_Type) < 0)
52653 0 : goto out;
52654 7399 : if (PyType_Ready(&samr_LookupDomain_Type) < 0)
52655 0 : goto out;
52656 7399 : if (PyType_Ready(&samr_EnumDomains_Type) < 0)
52657 0 : goto out;
52658 7399 : if (PyType_Ready(&samr_OpenDomain_Type) < 0)
52659 0 : goto out;
52660 7399 : if (PyType_Ready(&samr_QueryDomainInfo_Type) < 0)
52661 0 : goto out;
52662 7399 : if (PyType_Ready(&samr_SetDomainInfo_Type) < 0)
52663 0 : goto out;
52664 7399 : if (PyType_Ready(&samr_CreateDomainGroup_Type) < 0)
52665 0 : goto out;
52666 7399 : if (PyType_Ready(&samr_EnumDomainGroups_Type) < 0)
52667 0 : goto out;
52668 7399 : if (PyType_Ready(&samr_CreateUser_Type) < 0)
52669 0 : goto out;
52670 7399 : if (PyType_Ready(&samr_EnumDomainUsers_Type) < 0)
52671 0 : goto out;
52672 7399 : if (PyType_Ready(&samr_CreateDomAlias_Type) < 0)
52673 0 : goto out;
52674 7399 : if (PyType_Ready(&samr_EnumDomainAliases_Type) < 0)
52675 0 : goto out;
52676 7399 : if (PyType_Ready(&samr_GetAliasMembership_Type) < 0)
52677 0 : goto out;
52678 7399 : if (PyType_Ready(&samr_LookupNames_Type) < 0)
52679 0 : goto out;
52680 7399 : if (PyType_Ready(&samr_LookupRids_Type) < 0)
52681 0 : goto out;
52682 7399 : if (PyType_Ready(&samr_OpenGroup_Type) < 0)
52683 0 : goto out;
52684 7399 : if (PyType_Ready(&samr_QueryGroupInfo_Type) < 0)
52685 0 : goto out;
52686 7399 : if (PyType_Ready(&samr_SetGroupInfo_Type) < 0)
52687 0 : goto out;
52688 7399 : if (PyType_Ready(&samr_AddGroupMember_Type) < 0)
52689 0 : goto out;
52690 7399 : if (PyType_Ready(&samr_DeleteDomainGroup_Type) < 0)
52691 0 : goto out;
52692 7399 : if (PyType_Ready(&samr_DeleteGroupMember_Type) < 0)
52693 0 : goto out;
52694 7399 : if (PyType_Ready(&samr_QueryGroupMember_Type) < 0)
52695 0 : goto out;
52696 7399 : if (PyType_Ready(&samr_SetMemberAttributesOfGroup_Type) < 0)
52697 0 : goto out;
52698 7399 : if (PyType_Ready(&samr_OpenAlias_Type) < 0)
52699 0 : goto out;
52700 7399 : if (PyType_Ready(&samr_QueryAliasInfo_Type) < 0)
52701 0 : goto out;
52702 7399 : if (PyType_Ready(&samr_SetAliasInfo_Type) < 0)
52703 0 : goto out;
52704 7399 : if (PyType_Ready(&samr_DeleteDomAlias_Type) < 0)
52705 0 : goto out;
52706 7399 : if (PyType_Ready(&samr_AddAliasMember_Type) < 0)
52707 0 : goto out;
52708 7399 : if (PyType_Ready(&samr_DeleteAliasMember_Type) < 0)
52709 0 : goto out;
52710 7399 : if (PyType_Ready(&samr_GetMembersInAlias_Type) < 0)
52711 0 : goto out;
52712 7399 : if (PyType_Ready(&samr_OpenUser_Type) < 0)
52713 0 : goto out;
52714 7399 : if (PyType_Ready(&samr_DeleteUser_Type) < 0)
52715 0 : goto out;
52716 7399 : if (PyType_Ready(&samr_QueryUserInfo_Type) < 0)
52717 0 : goto out;
52718 7399 : if (PyType_Ready(&samr_SetUserInfo_Type) < 0)
52719 0 : goto out;
52720 7399 : if (PyType_Ready(&samr_ChangePasswordUser_Type) < 0)
52721 0 : goto out;
52722 7399 : if (PyType_Ready(&samr_GetGroupsForUser_Type) < 0)
52723 0 : goto out;
52724 7399 : if (PyType_Ready(&samr_QueryDisplayInfo_Type) < 0)
52725 0 : goto out;
52726 7399 : if (PyType_Ready(&samr_GetDisplayEnumerationIndex_Type) < 0)
52727 0 : goto out;
52728 7399 : if (PyType_Ready(&samr_TestPrivateFunctionsDomain_Type) < 0)
52729 0 : goto out;
52730 7399 : if (PyType_Ready(&samr_TestPrivateFunctionsUser_Type) < 0)
52731 0 : goto out;
52732 7399 : if (PyType_Ready(&samr_GetUserPwInfo_Type) < 0)
52733 0 : goto out;
52734 7399 : if (PyType_Ready(&samr_RemoveMemberFromForeignDomain_Type) < 0)
52735 0 : goto out;
52736 7399 : if (PyType_Ready(&samr_QueryDomainInfo2_Type) < 0)
52737 0 : goto out;
52738 7399 : if (PyType_Ready(&samr_QueryUserInfo2_Type) < 0)
52739 0 : goto out;
52740 7399 : if (PyType_Ready(&samr_QueryDisplayInfo2_Type) < 0)
52741 0 : goto out;
52742 7399 : if (PyType_Ready(&samr_GetDisplayEnumerationIndex2_Type) < 0)
52743 0 : goto out;
52744 7399 : if (PyType_Ready(&samr_CreateUser2_Type) < 0)
52745 0 : goto out;
52746 7399 : if (PyType_Ready(&samr_QueryDisplayInfo3_Type) < 0)
52747 0 : goto out;
52748 7399 : if (PyType_Ready(&samr_AddMultipleMembersToAlias_Type) < 0)
52749 0 : goto out;
52750 7399 : if (PyType_Ready(&samr_RemoveMultipleMembersFromAlias_Type) < 0)
52751 0 : goto out;
52752 7399 : if (PyType_Ready(&samr_OemChangePasswordUser2_Type) < 0)
52753 0 : goto out;
52754 7399 : if (PyType_Ready(&samr_ChangePasswordUser2_Type) < 0)
52755 0 : goto out;
52756 7399 : if (PyType_Ready(&samr_GetDomPwInfo_Type) < 0)
52757 0 : goto out;
52758 7399 : if (PyType_Ready(&samr_Connect2_Type) < 0)
52759 0 : goto out;
52760 7399 : if (PyType_Ready(&samr_SetUserInfo2_Type) < 0)
52761 0 : goto out;
52762 7399 : if (PyType_Ready(&samr_SetBootKeyInformation_Type) < 0)
52763 0 : goto out;
52764 7399 : if (PyType_Ready(&samr_GetBootKeyInformation_Type) < 0)
52765 0 : goto out;
52766 7399 : if (PyType_Ready(&samr_Connect3_Type) < 0)
52767 0 : goto out;
52768 7399 : if (PyType_Ready(&samr_Connect4_Type) < 0)
52769 0 : goto out;
52770 7399 : if (PyType_Ready(&samr_ChangePasswordUser3_Type) < 0)
52771 0 : goto out;
52772 7399 : if (PyType_Ready(&samr_Connect5_Type) < 0)
52773 0 : goto out;
52774 7399 : if (PyType_Ready(&samr_RidToSid_Type) < 0)
52775 0 : goto out;
52776 7399 : if (PyType_Ready(&samr_SetDsrmPassword_Type) < 0)
52777 0 : goto out;
52778 7399 : if (PyType_Ready(&samr_ValidatePassword_Type) < 0)
52779 0 : goto out;
52780 7399 : if (PyType_Ready(&samr_ChangePasswordUser4_Type) < 0)
52781 0 : goto out;
52782 7399 : if (PyType_Ready(&samr_InterfaceType) < 0)
52783 0 : goto out;
52784 7399 : if (PyType_Ready(&samr_SyntaxType) < 0)
52785 0 : goto out;
52786 7399 : if (!PyInterface_AddNdrRpcMethods(&samr_InterfaceType, py_ndr_samr_methods))
52787 0 : return NULL;
52788 :
52789 : #ifdef PY_SAMENTRY_PATCH
52790 : PY_SAMENTRY_PATCH(&samr_SamEntry_Type);
52791 : #endif
52792 : #ifdef PY_SAMARRAY_PATCH
52793 : PY_SAMARRAY_PATCH(&samr_SamArray_Type);
52794 : #endif
52795 : #ifdef PY_DOMINFO1_PATCH
52796 : PY_DOMINFO1_PATCH(&samr_DomInfo1_Type);
52797 : #endif
52798 : #ifdef PY_DOMGENERALINFORMATION_PATCH
52799 : PY_DOMGENERALINFORMATION_PATCH(&samr_DomGeneralInformation_Type);
52800 : #endif
52801 : #ifdef PY_DOMINFO3_PATCH
52802 : PY_DOMINFO3_PATCH(&samr_DomInfo3_Type);
52803 : #endif
52804 : #ifdef PY_DOMOEMINFORMATION_PATCH
52805 : PY_DOMOEMINFORMATION_PATCH(&samr_DomOEMInformation_Type);
52806 : #endif
52807 : #ifdef PY_DOMINFO5_PATCH
52808 : PY_DOMINFO5_PATCH(&samr_DomInfo5_Type);
52809 : #endif
52810 : #ifdef PY_DOMINFO6_PATCH
52811 : PY_DOMINFO6_PATCH(&samr_DomInfo6_Type);
52812 : #endif
52813 : #ifdef PY_DOMINFO7_PATCH
52814 : PY_DOMINFO7_PATCH(&samr_DomInfo7_Type);
52815 : #endif
52816 : #ifdef PY_DOMINFO8_PATCH
52817 : PY_DOMINFO8_PATCH(&samr_DomInfo8_Type);
52818 : #endif
52819 : #ifdef PY_DOMINFO9_PATCH
52820 : PY_DOMINFO9_PATCH(&samr_DomInfo9_Type);
52821 : #endif
52822 : #ifdef PY_DOMGENERALINFORMATION2_PATCH
52823 : PY_DOMGENERALINFORMATION2_PATCH(&samr_DomGeneralInformation2_Type);
52824 : #endif
52825 : #ifdef PY_DOMINFO12_PATCH
52826 : PY_DOMINFO12_PATCH(&samr_DomInfo12_Type);
52827 : #endif
52828 : #ifdef PY_DOMINFO13_PATCH
52829 : PY_DOMINFO13_PATCH(&samr_DomInfo13_Type);
52830 : #endif
52831 : #ifdef PY_DOMAININFO_PATCH
52832 : PY_DOMAININFO_PATCH(&samr_DomainInfo_Type);
52833 : #endif
52834 : #ifdef PY_IDS_PATCH
52835 : PY_IDS_PATCH(&samr_Ids_Type);
52836 : #endif
52837 : #ifdef PY_GROUPINFOALL_PATCH
52838 : PY_GROUPINFOALL_PATCH(&samr_GroupInfoAll_Type);
52839 : #endif
52840 : #ifdef PY_GROUPINFOATTRIBUTES_PATCH
52841 : PY_GROUPINFOATTRIBUTES_PATCH(&samr_GroupInfoAttributes_Type);
52842 : #endif
52843 : #ifdef PY_GROUPINFODESCRIPTION_PATCH
52844 : PY_GROUPINFODESCRIPTION_PATCH(&samr_GroupInfoDescription_Type);
52845 : #endif
52846 : #ifdef PY_GROUPINFO_PATCH
52847 : PY_GROUPINFO_PATCH(&samr_GroupInfo_Type);
52848 : #endif
52849 : #ifdef PY_RIDATTRARRAY_PATCH
52850 : PY_RIDATTRARRAY_PATCH(&samr_RidAttrArray_Type);
52851 : #endif
52852 : #ifdef PY_ALIASINFOALL_PATCH
52853 : PY_ALIASINFOALL_PATCH(&samr_AliasInfoAll_Type);
52854 : #endif
52855 : #ifdef PY_ALIASINFO_PATCH
52856 : PY_ALIASINFO_PATCH(&samr_AliasInfo_Type);
52857 : #endif
52858 : #ifdef PY_USERINFO1_PATCH
52859 : PY_USERINFO1_PATCH(&samr_UserInfo1_Type);
52860 : #endif
52861 : #ifdef PY_USERINFO2_PATCH
52862 : PY_USERINFO2_PATCH(&samr_UserInfo2_Type);
52863 : #endif
52864 : #ifdef PY_LOGONHOURS_PATCH
52865 : PY_LOGONHOURS_PATCH(&samr_LogonHours_Type);
52866 : #endif
52867 : #ifdef PY_USERINFO3_PATCH
52868 : PY_USERINFO3_PATCH(&samr_UserInfo3_Type);
52869 : #endif
52870 : #ifdef PY_USERINFO4_PATCH
52871 : PY_USERINFO4_PATCH(&samr_UserInfo4_Type);
52872 : #endif
52873 : #ifdef PY_USERINFO5_PATCH
52874 : PY_USERINFO5_PATCH(&samr_UserInfo5_Type);
52875 : #endif
52876 : #ifdef PY_USERINFO6_PATCH
52877 : PY_USERINFO6_PATCH(&samr_UserInfo6_Type);
52878 : #endif
52879 : #ifdef PY_USERINFO7_PATCH
52880 : PY_USERINFO7_PATCH(&samr_UserInfo7_Type);
52881 : #endif
52882 : #ifdef PY_USERINFO8_PATCH
52883 : PY_USERINFO8_PATCH(&samr_UserInfo8_Type);
52884 : #endif
52885 : #ifdef PY_USERINFO9_PATCH
52886 : PY_USERINFO9_PATCH(&samr_UserInfo9_Type);
52887 : #endif
52888 : #ifdef PY_USERINFO10_PATCH
52889 : PY_USERINFO10_PATCH(&samr_UserInfo10_Type);
52890 : #endif
52891 : #ifdef PY_USERINFO11_PATCH
52892 : PY_USERINFO11_PATCH(&samr_UserInfo11_Type);
52893 : #endif
52894 : #ifdef PY_USERINFO12_PATCH
52895 : PY_USERINFO12_PATCH(&samr_UserInfo12_Type);
52896 : #endif
52897 : #ifdef PY_USERINFO13_PATCH
52898 : PY_USERINFO13_PATCH(&samr_UserInfo13_Type);
52899 : #endif
52900 : #ifdef PY_USERINFO14_PATCH
52901 : PY_USERINFO14_PATCH(&samr_UserInfo14_Type);
52902 : #endif
52903 : #ifdef PY_USERINFO16_PATCH
52904 : PY_USERINFO16_PATCH(&samr_UserInfo16_Type);
52905 : #endif
52906 : #ifdef PY_USERINFO17_PATCH
52907 : PY_USERINFO17_PATCH(&samr_UserInfo17_Type);
52908 : #endif
52909 : #ifdef PY_PASSWORD_PATCH
52910 : PY_PASSWORD_PATCH(&samr_Password_Type);
52911 : #endif
52912 : #ifdef PY_USERINFO18_PATCH
52913 : PY_USERINFO18_PATCH(&samr_UserInfo18_Type);
52914 : #endif
52915 : #ifdef PY_USERINFO20_PATCH
52916 : PY_USERINFO20_PATCH(&samr_UserInfo20_Type);
52917 : #endif
52918 : #ifdef PY_USERINFO21_PATCH
52919 : PY_USERINFO21_PATCH(&samr_UserInfo21_Type);
52920 : #endif
52921 : #ifdef PY_CRYPTPASSWORD_PATCH
52922 : PY_CRYPTPASSWORD_PATCH(&samr_CryptPassword_Type);
52923 : #endif
52924 : #ifdef PY_USERINFO23_PATCH
52925 : PY_USERINFO23_PATCH(&samr_UserInfo23_Type);
52926 : #endif
52927 : #ifdef PY_USERINFO24_PATCH
52928 : PY_USERINFO24_PATCH(&samr_UserInfo24_Type);
52929 : #endif
52930 : #ifdef PY_CRYPTPASSWORDEX_PATCH
52931 : PY_CRYPTPASSWORDEX_PATCH(&samr_CryptPasswordEx_Type);
52932 : #endif
52933 : #ifdef PY_USERINFO25_PATCH
52934 : PY_USERINFO25_PATCH(&samr_UserInfo25_Type);
52935 : #endif
52936 : #ifdef PY_USERINFO26_PATCH
52937 : PY_USERINFO26_PATCH(&samr_UserInfo26_Type);
52938 : #endif
52939 : #ifdef PY_ENCRYPTEDPASSWORDAES_PATCH
52940 : PY_ENCRYPTEDPASSWORDAES_PATCH(&samr_EncryptedPasswordAES_Type);
52941 : #endif
52942 : #ifdef PY_USERINFO31_PATCH
52943 : PY_USERINFO31_PATCH(&samr_UserInfo31_Type);
52944 : #endif
52945 : #ifdef PY_USERINFO32_PATCH
52946 : PY_USERINFO32_PATCH(&samr_UserInfo32_Type);
52947 : #endif
52948 : #ifdef PY_USERINFO_PATCH
52949 : PY_USERINFO_PATCH(&samr_UserInfo_Type);
52950 : #endif
52951 : #ifdef PY_RIDWITHATTRIBUTE_PATCH
52952 : PY_RIDWITHATTRIBUTE_PATCH(&samr_RidWithAttribute_Type);
52953 : #endif
52954 : #ifdef PY_RIDWITHATTRIBUTEARRAY_PATCH
52955 : PY_RIDWITHATTRIBUTEARRAY_PATCH(&samr_RidWithAttributeArray_Type);
52956 : #endif
52957 : #ifdef PY_DISPENTRYGENERAL_PATCH
52958 : PY_DISPENTRYGENERAL_PATCH(&samr_DispEntryGeneral_Type);
52959 : #endif
52960 : #ifdef PY_DISPINFOGENERAL_PATCH
52961 : PY_DISPINFOGENERAL_PATCH(&samr_DispInfoGeneral_Type);
52962 : #endif
52963 : #ifdef PY_DISPENTRYFULL_PATCH
52964 : PY_DISPENTRYFULL_PATCH(&samr_DispEntryFull_Type);
52965 : #endif
52966 : #ifdef PY_DISPINFOFULL_PATCH
52967 : PY_DISPINFOFULL_PATCH(&samr_DispInfoFull_Type);
52968 : #endif
52969 : #ifdef PY_DISPENTRYFULLGROUP_PATCH
52970 : PY_DISPENTRYFULLGROUP_PATCH(&samr_DispEntryFullGroup_Type);
52971 : #endif
52972 : #ifdef PY_DISPINFOFULLGROUPS_PATCH
52973 : PY_DISPINFOFULLGROUPS_PATCH(&samr_DispInfoFullGroups_Type);
52974 : #endif
52975 : #ifdef PY_DISPENTRYASCII_PATCH
52976 : PY_DISPENTRYASCII_PATCH(&samr_DispEntryAscii_Type);
52977 : #endif
52978 : #ifdef PY_DISPINFOASCII_PATCH
52979 : PY_DISPINFOASCII_PATCH(&samr_DispInfoAscii_Type);
52980 : #endif
52981 : #ifdef PY_DISPINFO_PATCH
52982 : PY_DISPINFO_PATCH(&samr_DispInfo_Type);
52983 : #endif
52984 : #ifdef PY_PWINFO_PATCH
52985 : PY_PWINFO_PATCH(&samr_PwInfo_Type);
52986 : #endif
52987 : #ifdef PY_USERPWDCHANGEFAILUREINFORMATION_PATCH
52988 : PY_USERPWDCHANGEFAILUREINFORMATION_PATCH(&userPwdChangeFailureInformation_Type);
52989 : #endif
52990 : #ifdef PY_CONNECTINFO1_PATCH
52991 : PY_CONNECTINFO1_PATCH(&samr_ConnectInfo1_Type);
52992 : #endif
52993 : #ifdef PY_CONNECTINFO_PATCH
52994 : PY_CONNECTINFO_PATCH(&samr_ConnectInfo_Type);
52995 : #endif
52996 : #ifdef PY_VALIDATIONBLOB_PATCH
52997 : PY_VALIDATIONBLOB_PATCH(&samr_ValidationBlob_Type);
52998 : #endif
52999 : #ifdef PY_VALIDATEPASSWORDINFO_PATCH
53000 : PY_VALIDATEPASSWORDINFO_PATCH(&samr_ValidatePasswordInfo_Type);
53001 : #endif
53002 : #ifdef PY_VALIDATEPASSWORDREPCTR_PATCH
53003 : PY_VALIDATEPASSWORDREPCTR_PATCH(&samr_ValidatePasswordRepCtr_Type);
53004 : #endif
53005 : #ifdef PY_VALIDATEPASSWORDREP_PATCH
53006 : PY_VALIDATEPASSWORDREP_PATCH(&samr_ValidatePasswordRep_Type);
53007 : #endif
53008 : #ifdef PY_VALIDATEPASSWORDREQ3_PATCH
53009 : PY_VALIDATEPASSWORDREQ3_PATCH(&samr_ValidatePasswordReq3_Type);
53010 : #endif
53011 : #ifdef PY_VALIDATEPASSWORDREQ2_PATCH
53012 : PY_VALIDATEPASSWORDREQ2_PATCH(&samr_ValidatePasswordReq2_Type);
53013 : #endif
53014 : #ifdef PY_VALIDATEPASSWORDREQ1_PATCH
53015 : PY_VALIDATEPASSWORDREQ1_PATCH(&samr_ValidatePasswordReq1_Type);
53016 : #endif
53017 : #ifdef PY_VALIDATEPASSWORDREQ_PATCH
53018 : PY_VALIDATEPASSWORDREQ_PATCH(&samr_ValidatePasswordReq_Type);
53019 : #endif
53020 : #ifdef PY_CONNECT_PATCH
53021 : PY_CONNECT_PATCH(&samr_Connect_Type);
53022 : #endif
53023 : #ifdef PY_CLOSE_PATCH
53024 : PY_CLOSE_PATCH(&samr_Close_Type);
53025 : #endif
53026 : #ifdef PY_SETSECURITY_PATCH
53027 : PY_SETSECURITY_PATCH(&samr_SetSecurity_Type);
53028 : #endif
53029 : #ifdef PY_QUERYSECURITY_PATCH
53030 : PY_QUERYSECURITY_PATCH(&samr_QuerySecurity_Type);
53031 : #endif
53032 : #ifdef PY_SHUTDOWN_PATCH
53033 : PY_SHUTDOWN_PATCH(&samr_Shutdown_Type);
53034 : #endif
53035 : #ifdef PY_LOOKUPDOMAIN_PATCH
53036 : PY_LOOKUPDOMAIN_PATCH(&samr_LookupDomain_Type);
53037 : #endif
53038 : #ifdef PY_ENUMDOMAINS_PATCH
53039 : PY_ENUMDOMAINS_PATCH(&samr_EnumDomains_Type);
53040 : #endif
53041 : #ifdef PY_OPENDOMAIN_PATCH
53042 : PY_OPENDOMAIN_PATCH(&samr_OpenDomain_Type);
53043 : #endif
53044 : #ifdef PY_QUERYDOMAININFO_PATCH
53045 : PY_QUERYDOMAININFO_PATCH(&samr_QueryDomainInfo_Type);
53046 : #endif
53047 : #ifdef PY_SETDOMAININFO_PATCH
53048 : PY_SETDOMAININFO_PATCH(&samr_SetDomainInfo_Type);
53049 : #endif
53050 : #ifdef PY_CREATEDOMAINGROUP_PATCH
53051 : PY_CREATEDOMAINGROUP_PATCH(&samr_CreateDomainGroup_Type);
53052 : #endif
53053 : #ifdef PY_ENUMDOMAINGROUPS_PATCH
53054 : PY_ENUMDOMAINGROUPS_PATCH(&samr_EnumDomainGroups_Type);
53055 : #endif
53056 : #ifdef PY_CREATEUSER_PATCH
53057 : PY_CREATEUSER_PATCH(&samr_CreateUser_Type);
53058 : #endif
53059 : #ifdef PY_ENUMDOMAINUSERS_PATCH
53060 : PY_ENUMDOMAINUSERS_PATCH(&samr_EnumDomainUsers_Type);
53061 : #endif
53062 : #ifdef PY_CREATEDOMALIAS_PATCH
53063 : PY_CREATEDOMALIAS_PATCH(&samr_CreateDomAlias_Type);
53064 : #endif
53065 : #ifdef PY_ENUMDOMAINALIASES_PATCH
53066 : PY_ENUMDOMAINALIASES_PATCH(&samr_EnumDomainAliases_Type);
53067 : #endif
53068 : #ifdef PY_GETALIASMEMBERSHIP_PATCH
53069 : PY_GETALIASMEMBERSHIP_PATCH(&samr_GetAliasMembership_Type);
53070 : #endif
53071 : #ifdef PY_LOOKUPNAMES_PATCH
53072 : PY_LOOKUPNAMES_PATCH(&samr_LookupNames_Type);
53073 : #endif
53074 : #ifdef PY_LOOKUPRIDS_PATCH
53075 : PY_LOOKUPRIDS_PATCH(&samr_LookupRids_Type);
53076 : #endif
53077 : #ifdef PY_OPENGROUP_PATCH
53078 : PY_OPENGROUP_PATCH(&samr_OpenGroup_Type);
53079 : #endif
53080 : #ifdef PY_QUERYGROUPINFO_PATCH
53081 : PY_QUERYGROUPINFO_PATCH(&samr_QueryGroupInfo_Type);
53082 : #endif
53083 : #ifdef PY_SETGROUPINFO_PATCH
53084 : PY_SETGROUPINFO_PATCH(&samr_SetGroupInfo_Type);
53085 : #endif
53086 : #ifdef PY_ADDGROUPMEMBER_PATCH
53087 : PY_ADDGROUPMEMBER_PATCH(&samr_AddGroupMember_Type);
53088 : #endif
53089 : #ifdef PY_DELETEDOMAINGROUP_PATCH
53090 : PY_DELETEDOMAINGROUP_PATCH(&samr_DeleteDomainGroup_Type);
53091 : #endif
53092 : #ifdef PY_DELETEGROUPMEMBER_PATCH
53093 : PY_DELETEGROUPMEMBER_PATCH(&samr_DeleteGroupMember_Type);
53094 : #endif
53095 : #ifdef PY_QUERYGROUPMEMBER_PATCH
53096 : PY_QUERYGROUPMEMBER_PATCH(&samr_QueryGroupMember_Type);
53097 : #endif
53098 : #ifdef PY_SETMEMBERATTRIBUTESOFGROUP_PATCH
53099 : PY_SETMEMBERATTRIBUTESOFGROUP_PATCH(&samr_SetMemberAttributesOfGroup_Type);
53100 : #endif
53101 : #ifdef PY_OPENALIAS_PATCH
53102 : PY_OPENALIAS_PATCH(&samr_OpenAlias_Type);
53103 : #endif
53104 : #ifdef PY_QUERYALIASINFO_PATCH
53105 : PY_QUERYALIASINFO_PATCH(&samr_QueryAliasInfo_Type);
53106 : #endif
53107 : #ifdef PY_SETALIASINFO_PATCH
53108 : PY_SETALIASINFO_PATCH(&samr_SetAliasInfo_Type);
53109 : #endif
53110 : #ifdef PY_DELETEDOMALIAS_PATCH
53111 : PY_DELETEDOMALIAS_PATCH(&samr_DeleteDomAlias_Type);
53112 : #endif
53113 : #ifdef PY_ADDALIASMEMBER_PATCH
53114 : PY_ADDALIASMEMBER_PATCH(&samr_AddAliasMember_Type);
53115 : #endif
53116 : #ifdef PY_DELETEALIASMEMBER_PATCH
53117 : PY_DELETEALIASMEMBER_PATCH(&samr_DeleteAliasMember_Type);
53118 : #endif
53119 : #ifdef PY_GETMEMBERSINALIAS_PATCH
53120 : PY_GETMEMBERSINALIAS_PATCH(&samr_GetMembersInAlias_Type);
53121 : #endif
53122 : #ifdef PY_OPENUSER_PATCH
53123 : PY_OPENUSER_PATCH(&samr_OpenUser_Type);
53124 : #endif
53125 : #ifdef PY_DELETEUSER_PATCH
53126 : PY_DELETEUSER_PATCH(&samr_DeleteUser_Type);
53127 : #endif
53128 : #ifdef PY_QUERYUSERINFO_PATCH
53129 : PY_QUERYUSERINFO_PATCH(&samr_QueryUserInfo_Type);
53130 : #endif
53131 : #ifdef PY_SETUSERINFO_PATCH
53132 : PY_SETUSERINFO_PATCH(&samr_SetUserInfo_Type);
53133 : #endif
53134 : #ifdef PY_CHANGEPASSWORDUSER_PATCH
53135 : PY_CHANGEPASSWORDUSER_PATCH(&samr_ChangePasswordUser_Type);
53136 : #endif
53137 : #ifdef PY_GETGROUPSFORUSER_PATCH
53138 : PY_GETGROUPSFORUSER_PATCH(&samr_GetGroupsForUser_Type);
53139 : #endif
53140 : #ifdef PY_QUERYDISPLAYINFO_PATCH
53141 : PY_QUERYDISPLAYINFO_PATCH(&samr_QueryDisplayInfo_Type);
53142 : #endif
53143 : #ifdef PY_GETDISPLAYENUMERATIONINDEX_PATCH
53144 : PY_GETDISPLAYENUMERATIONINDEX_PATCH(&samr_GetDisplayEnumerationIndex_Type);
53145 : #endif
53146 : #ifdef PY_TESTPRIVATEFUNCTIONSDOMAIN_PATCH
53147 : PY_TESTPRIVATEFUNCTIONSDOMAIN_PATCH(&samr_TestPrivateFunctionsDomain_Type);
53148 : #endif
53149 : #ifdef PY_TESTPRIVATEFUNCTIONSUSER_PATCH
53150 : PY_TESTPRIVATEFUNCTIONSUSER_PATCH(&samr_TestPrivateFunctionsUser_Type);
53151 : #endif
53152 : #ifdef PY_GETUSERPWINFO_PATCH
53153 : PY_GETUSERPWINFO_PATCH(&samr_GetUserPwInfo_Type);
53154 : #endif
53155 : #ifdef PY_REMOVEMEMBERFROMFOREIGNDOMAIN_PATCH
53156 : PY_REMOVEMEMBERFROMFOREIGNDOMAIN_PATCH(&samr_RemoveMemberFromForeignDomain_Type);
53157 : #endif
53158 : #ifdef PY_QUERYDOMAININFO2_PATCH
53159 : PY_QUERYDOMAININFO2_PATCH(&samr_QueryDomainInfo2_Type);
53160 : #endif
53161 : #ifdef PY_QUERYUSERINFO2_PATCH
53162 : PY_QUERYUSERINFO2_PATCH(&samr_QueryUserInfo2_Type);
53163 : #endif
53164 : #ifdef PY_QUERYDISPLAYINFO2_PATCH
53165 : PY_QUERYDISPLAYINFO2_PATCH(&samr_QueryDisplayInfo2_Type);
53166 : #endif
53167 : #ifdef PY_GETDISPLAYENUMERATIONINDEX2_PATCH
53168 : PY_GETDISPLAYENUMERATIONINDEX2_PATCH(&samr_GetDisplayEnumerationIndex2_Type);
53169 : #endif
53170 : #ifdef PY_CREATEUSER2_PATCH
53171 : PY_CREATEUSER2_PATCH(&samr_CreateUser2_Type);
53172 : #endif
53173 : #ifdef PY_QUERYDISPLAYINFO3_PATCH
53174 : PY_QUERYDISPLAYINFO3_PATCH(&samr_QueryDisplayInfo3_Type);
53175 : #endif
53176 : #ifdef PY_ADDMULTIPLEMEMBERSTOALIAS_PATCH
53177 : PY_ADDMULTIPLEMEMBERSTOALIAS_PATCH(&samr_AddMultipleMembersToAlias_Type);
53178 : #endif
53179 : #ifdef PY_REMOVEMULTIPLEMEMBERSFROMALIAS_PATCH
53180 : PY_REMOVEMULTIPLEMEMBERSFROMALIAS_PATCH(&samr_RemoveMultipleMembersFromAlias_Type);
53181 : #endif
53182 : #ifdef PY_OEMCHANGEPASSWORDUSER2_PATCH
53183 : PY_OEMCHANGEPASSWORDUSER2_PATCH(&samr_OemChangePasswordUser2_Type);
53184 : #endif
53185 : #ifdef PY_CHANGEPASSWORDUSER2_PATCH
53186 : PY_CHANGEPASSWORDUSER2_PATCH(&samr_ChangePasswordUser2_Type);
53187 : #endif
53188 : #ifdef PY_GETDOMPWINFO_PATCH
53189 : PY_GETDOMPWINFO_PATCH(&samr_GetDomPwInfo_Type);
53190 : #endif
53191 : #ifdef PY_CONNECT2_PATCH
53192 : PY_CONNECT2_PATCH(&samr_Connect2_Type);
53193 : #endif
53194 : #ifdef PY_SETUSERINFO2_PATCH
53195 : PY_SETUSERINFO2_PATCH(&samr_SetUserInfo2_Type);
53196 : #endif
53197 : #ifdef PY_SETBOOTKEYINFORMATION_PATCH
53198 : PY_SETBOOTKEYINFORMATION_PATCH(&samr_SetBootKeyInformation_Type);
53199 : #endif
53200 : #ifdef PY_GETBOOTKEYINFORMATION_PATCH
53201 : PY_GETBOOTKEYINFORMATION_PATCH(&samr_GetBootKeyInformation_Type);
53202 : #endif
53203 : #ifdef PY_CONNECT3_PATCH
53204 : PY_CONNECT3_PATCH(&samr_Connect3_Type);
53205 : #endif
53206 : #ifdef PY_CONNECT4_PATCH
53207 : PY_CONNECT4_PATCH(&samr_Connect4_Type);
53208 : #endif
53209 : #ifdef PY_CHANGEPASSWORDUSER3_PATCH
53210 : PY_CHANGEPASSWORDUSER3_PATCH(&samr_ChangePasswordUser3_Type);
53211 : #endif
53212 : #ifdef PY_CONNECT5_PATCH
53213 : PY_CONNECT5_PATCH(&samr_Connect5_Type);
53214 : #endif
53215 : #ifdef PY_RIDTOSID_PATCH
53216 : PY_RIDTOSID_PATCH(&samr_RidToSid_Type);
53217 : #endif
53218 : #ifdef PY_SETDSRMPASSWORD_PATCH
53219 : PY_SETDSRMPASSWORD_PATCH(&samr_SetDsrmPassword_Type);
53220 : #endif
53221 : #ifdef PY_VALIDATEPASSWORD_PATCH
53222 : PY_VALIDATEPASSWORD_PATCH(&samr_ValidatePassword_Type);
53223 : #endif
53224 : #ifdef PY_CHANGEPASSWORDUSER4_PATCH
53225 : PY_CHANGEPASSWORDUSER4_PATCH(&samr_ChangePasswordUser4_Type);
53226 : #endif
53227 : #ifdef PY_SAMR_PATCH
53228 : PY_SAMR_PATCH(&samr_InterfaceType);
53229 : #endif
53230 : #ifdef PY_SAMR_ABSTRACT_SYNTAX_PATCH
53231 : PY_SAMR_ABSTRACT_SYNTAX_PATCH(&samr_SyntaxType);
53232 : #endif
53233 : #ifdef PY_ABSTRACT_SYNTAX_PATCH
53234 : PY_ABSTRACT_SYNTAX_PATCH(&samr_SyntaxType);
53235 : #endif
53236 :
53237 7399 : m = PyModule_Create(&moduledef);
53238 7399 : if (m == NULL)
53239 0 : goto out;
53240 :
53241 7399 : PyModule_AddObject(m, "SAMR_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000003F));
53242 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ACCESS_ALL_ACCESS)));
53243 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ACCESS_ENUM_DOMAINS)));
53244 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ACCESS_CREATE_DOMAIN|SAMR_ACCESS_INITIALIZE_SERVER|SAMR_ACCESS_SHUTDOWN_SERVER)));
53245 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ACCESS_LOOKUP_DOMAIN|SAMR_ACCESS_CONNECT_TO_SERVER)));
53246 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x000007FF));
53247 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_USER_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_USER_ACCESS_ALL_ACCESS)));
53248 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_USER_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP|SAMR_USER_ACCESS_GET_GROUPS|SAMR_USER_ACCESS_GET_ATTRIBUTES|SAMR_USER_ACCESS_GET_LOGONINFO|SAMR_USER_ACCESS_GET_LOCALE)));
53249 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_USER_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_SET_LOC_COM|SAMR_USER_ACCESS_SET_ATTRIBUTES|SAMR_USER_ACCESS_SET_PASSWORD|SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP)));
53250 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_USER_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_GET_NAME_ETC)));
53251 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x000007FF));
53252 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_DOMAIN_ACCESS_ALL_ACCESS)));
53253 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2)));
53254 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_DOMAIN_ACCESS_SET_INFO_3|SAMR_DOMAIN_ACCESS_CREATE_ALIAS|SAMR_DOMAIN_ACCESS_CREATE_GROUP|SAMR_DOMAIN_ACCESS_CREATE_USER|SAMR_DOMAIN_ACCESS_SET_INFO_2|SAMR_DOMAIN_ACCESS_SET_INFO_1)));
53255 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT|SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1)));
53256 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000001F));
53257 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_GROUP_ACCESS_ALL_ACCESS)));
53258 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_GROUP_ACCESS_GET_MEMBERS)));
53259 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_GROUP_ACCESS_REMOVE_MEMBER|SAMR_GROUP_ACCESS_ADD_MEMBER|SAMR_GROUP_ACCESS_SET_INFO)));
53260 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_GROUP_ACCESS_LOOKUP_INFO)));
53261 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ALL_ACCESS", PyLong_FromUnsignedLongLong(0x0000001F));
53262 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_ALL_ACCESS", PyLong_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ALIAS_ACCESS_ALL_ACCESS)));
53263 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_READ", PyLong_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ALIAS_ACCESS_GET_MEMBERS)));
53264 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_WRITE", PyLong_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ALIAS_ACCESS_REMOVE_MEMBER|SAMR_ALIAS_ACCESS_ADD_MEMBER|SAMR_ALIAS_ACCESS_SET_INFO)));
53265 7399 : PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_EXECUTE", PyLong_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ALIAS_ACCESS_LOOKUP_INFO)));
53266 7399 : PyModule_AddObject(m, "SAMR_ENUM_USERS_MULTIPLIER", PyLong_FromUnsignedLongLong(54));
53267 7399 : PyModule_AddObject(m, "PASS_MUST_CHANGE_AT_NEXT_LOGON", PyLong_FromUnsignedLongLong(0x01));
53268 7399 : PyModule_AddObject(m, "PASS_DONT_CHANGE_AT_NEXT_LOGON", PyLong_FromUnsignedLongLong(0x00));
53269 7399 : PyModule_AddObject(m, "ACB_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)ACB_DISABLED));
53270 7399 : PyModule_AddObject(m, "ACB_HOMDIRREQ", PyLong_FromUnsignedLongLong((uint32_t)ACB_HOMDIRREQ));
53271 7399 : PyModule_AddObject(m, "ACB_PWNOTREQ", PyLong_FromUnsignedLongLong((uint32_t)ACB_PWNOTREQ));
53272 7399 : PyModule_AddObject(m, "ACB_TEMPDUP", PyLong_FromUnsignedLongLong((uint32_t)ACB_TEMPDUP));
53273 7399 : PyModule_AddObject(m, "ACB_NORMAL", PyLong_FromUnsignedLongLong((uint32_t)ACB_NORMAL));
53274 7399 : PyModule_AddObject(m, "ACB_MNS", PyLong_FromUnsignedLongLong((uint32_t)ACB_MNS));
53275 7399 : PyModule_AddObject(m, "ACB_DOMTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_DOMTRUST));
53276 7399 : PyModule_AddObject(m, "ACB_WSTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_WSTRUST));
53277 7399 : PyModule_AddObject(m, "ACB_SVRTRUST", PyLong_FromUnsignedLongLong((uint32_t)ACB_SVRTRUST));
53278 7399 : PyModule_AddObject(m, "ACB_PWNOEXP", PyLong_FromUnsignedLongLong((uint32_t)ACB_PWNOEXP));
53279 7399 : PyModule_AddObject(m, "ACB_AUTOLOCK", PyLong_FromUnsignedLongLong((uint32_t)ACB_AUTOLOCK));
53280 7399 : PyModule_AddObject(m, "ACB_ENC_TXT_PWD_ALLOWED", PyLong_FromUnsignedLongLong((uint32_t)ACB_ENC_TXT_PWD_ALLOWED));
53281 7399 : PyModule_AddObject(m, "ACB_SMARTCARD_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)ACB_SMARTCARD_REQUIRED));
53282 7399 : PyModule_AddObject(m, "ACB_TRUSTED_FOR_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)ACB_TRUSTED_FOR_DELEGATION));
53283 7399 : PyModule_AddObject(m, "ACB_NOT_DELEGATED", PyLong_FromUnsignedLongLong((uint32_t)ACB_NOT_DELEGATED));
53284 7399 : PyModule_AddObject(m, "ACB_USE_DES_KEY_ONLY", PyLong_FromUnsignedLongLong((uint32_t)ACB_USE_DES_KEY_ONLY));
53285 7399 : PyModule_AddObject(m, "ACB_DONT_REQUIRE_PREAUTH", PyLong_FromUnsignedLongLong((uint32_t)ACB_DONT_REQUIRE_PREAUTH));
53286 7399 : PyModule_AddObject(m, "ACB_PW_EXPIRED", PyLong_FromUnsignedLongLong((uint32_t)ACB_PW_EXPIRED));
53287 7399 : PyModule_AddObject(m, "ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION));
53288 7399 : PyModule_AddObject(m, "ACB_NO_AUTH_DATA_REQD", PyLong_FromUnsignedLongLong((uint32_t)ACB_NO_AUTH_DATA_REQD));
53289 7399 : PyModule_AddObject(m, "ACB_PARTIAL_SECRETS_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)ACB_PARTIAL_SECRETS_ACCOUNT));
53290 7399 : PyModule_AddObject(m, "ACB_USE_AES_KEYS", PyLong_FromUnsignedLongLong((uint32_t)ACB_USE_AES_KEYS));
53291 7399 : PyModule_AddObject(m, "SAMR_ACCESS_CONNECT_TO_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_CONNECT_TO_SERVER));
53292 7399 : PyModule_AddObject(m, "SAMR_ACCESS_SHUTDOWN_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_SHUTDOWN_SERVER));
53293 7399 : PyModule_AddObject(m, "SAMR_ACCESS_INITIALIZE_SERVER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_INITIALIZE_SERVER));
53294 7399 : PyModule_AddObject(m, "SAMR_ACCESS_CREATE_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_CREATE_DOMAIN));
53295 7399 : PyModule_AddObject(m, "SAMR_ACCESS_ENUM_DOMAINS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_ENUM_DOMAINS));
53296 7399 : PyModule_AddObject(m, "SAMR_ACCESS_LOOKUP_DOMAIN", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ACCESS_LOOKUP_DOMAIN));
53297 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_NAME_ETC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_NAME_ETC));
53298 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOCALE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_LOCALE));
53299 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_LOC_COM", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_LOC_COM));
53300 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOGONINFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_LOGONINFO));
53301 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_ATTRIBUTES", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_ATTRIBUTES));
53302 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_ATTRIBUTES", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_ATTRIBUTES));
53303 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_CHANGE_PASSWORD));
53304 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_SET_PASSWORD));
53305 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUPS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_GROUPS));
53306 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP));
53307 7399 : PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP));
53308 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1));
53309 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_1", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_1));
53310 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2));
53311 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_2", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_2));
53312 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_USER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_USER));
53313 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_GROUP", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_GROUP));
53314 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_CREATE_ALIAS));
53315 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS));
53316 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS));
53317 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT));
53318 7399 : PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_3", PyLong_FromUnsignedLongLong((uint32_t)SAMR_DOMAIN_ACCESS_SET_INFO_3));
53319 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_LOOKUP_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_LOOKUP_INFO));
53320 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_SET_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_SET_INFO));
53321 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ADD_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_ADD_MEMBER));
53322 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_REMOVE_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_REMOVE_MEMBER));
53323 7399 : PyModule_AddObject(m, "SAMR_GROUP_ACCESS_GET_MEMBERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_GROUP_ACCESS_GET_MEMBERS));
53324 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ADD_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_ADD_MEMBER));
53325 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_REMOVE_MEMBER));
53326 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_GET_MEMBERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_GET_MEMBERS));
53327 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_LOOKUP_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_LOOKUP_INFO));
53328 7399 : PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_SET_INFO", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ALIAS_ACCESS_SET_INFO));
53329 7399 : PyModule_AddObject(m, "DomainPasswordInformation", PyLong_FromLong((uint16_t)DomainPasswordInformation));
53330 7399 : PyModule_AddObject(m, "DomainGeneralInformation", PyLong_FromLong((uint16_t)DomainGeneralInformation));
53331 7399 : PyModule_AddObject(m, "DomainLogoffInformation", PyLong_FromLong((uint16_t)DomainLogoffInformation));
53332 7399 : PyModule_AddObject(m, "DomainOemInformation", PyLong_FromLong((uint16_t)DomainOemInformation));
53333 7399 : PyModule_AddObject(m, "DomainNameInformation", PyLong_FromLong((uint16_t)DomainNameInformation));
53334 7399 : PyModule_AddObject(m, "DomainReplicationInformation", PyLong_FromLong((uint16_t)DomainReplicationInformation));
53335 7399 : PyModule_AddObject(m, "DomainServerRoleInformation", PyLong_FromLong((uint16_t)DomainServerRoleInformation));
53336 7399 : PyModule_AddObject(m, "DomainModifiedInformation", PyLong_FromLong((uint16_t)DomainModifiedInformation));
53337 7399 : PyModule_AddObject(m, "DomainStateInformation", PyLong_FromLong((uint16_t)DomainStateInformation));
53338 7399 : PyModule_AddObject(m, "DomainUasInformation", PyLong_FromLong((uint16_t)DomainUasInformation));
53339 7399 : PyModule_AddObject(m, "DomainGeneralInformation2", PyLong_FromLong((uint16_t)DomainGeneralInformation2));
53340 7399 : PyModule_AddObject(m, "DomainLockoutInformation", PyLong_FromLong((uint16_t)DomainLockoutInformation));
53341 7399 : PyModule_AddObject(m, "DomainModifiedInformation2", PyLong_FromLong((uint16_t)DomainModifiedInformation2));
53342 7399 : PyModule_AddObject(m, "SAMR_ROLE_STANDALONE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_STANDALONE));
53343 7399 : PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_MEMBER", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_MEMBER));
53344 7399 : PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_BDC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_BDC));
53345 7399 : PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_PDC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_ROLE_DOMAIN_PDC));
53346 7399 : PyModule_AddObject(m, "DOMAIN_PASSWORD_COMPLEX", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_COMPLEX));
53347 7399 : PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_ANON_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_NO_ANON_CHANGE));
53348 7399 : PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_NO_CLEAR_CHANGE));
53349 7399 : PyModule_AddObject(m, "DOMAIN_PASSWORD_LOCKOUT_ADMINS", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_LOCKOUT_ADMINS));
53350 7399 : PyModule_AddObject(m, "DOMAIN_PASSWORD_STORE_CLEARTEXT", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_PASSWORD_STORE_CLEARTEXT));
53351 7399 : PyModule_AddObject(m, "DOMAIN_REFUSE_PASSWORD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_REFUSE_PASSWORD_CHANGE));
53352 7399 : PyModule_AddObject(m, "DOMAIN_SERVER_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_SERVER_ENABLED));
53353 7399 : PyModule_AddObject(m, "DOMAIN_SERVER_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)DOMAIN_SERVER_DISABLED));
53354 7399 : PyModule_AddObject(m, "GROUPINFOALL", PyLong_FromLong((uint16_t)GROUPINFOALL));
53355 7399 : PyModule_AddObject(m, "GROUPINFONAME", PyLong_FromLong((uint16_t)GROUPINFONAME));
53356 7399 : PyModule_AddObject(m, "GROUPINFOATTRIBUTES", PyLong_FromLong((uint16_t)GROUPINFOATTRIBUTES));
53357 7399 : PyModule_AddObject(m, "GROUPINFODESCRIPTION", PyLong_FromLong((uint16_t)GROUPINFODESCRIPTION));
53358 7399 : PyModule_AddObject(m, "GROUPINFOALL2", PyLong_FromLong((uint16_t)GROUPINFOALL2));
53359 7399 : PyModule_AddObject(m, "ALIASINFOALL", PyLong_FromLong((uint16_t)ALIASINFOALL));
53360 7399 : PyModule_AddObject(m, "ALIASINFONAME", PyLong_FromLong((uint16_t)ALIASINFONAME));
53361 7399 : PyModule_AddObject(m, "ALIASINFODESCRIPTION", PyLong_FromLong((uint16_t)ALIASINFODESCRIPTION));
53362 7399 : PyModule_AddObject(m, "UserGeneralInformation", PyLong_FromLong((uint16_t)UserGeneralInformation));
53363 7399 : PyModule_AddObject(m, "UserPreferencesInformation", PyLong_FromLong((uint16_t)UserPreferencesInformation));
53364 7399 : PyModule_AddObject(m, "UserLogonInformation", PyLong_FromLong((uint16_t)UserLogonInformation));
53365 7399 : PyModule_AddObject(m, "UserLogonHoursInformation", PyLong_FromLong((uint16_t)UserLogonHoursInformation));
53366 7399 : PyModule_AddObject(m, "UserAccountInformation", PyLong_FromLong((uint16_t)UserAccountInformation));
53367 7399 : PyModule_AddObject(m, "UserNameInformation", PyLong_FromLong((uint16_t)UserNameInformation));
53368 7399 : PyModule_AddObject(m, "UserAccountNameInformation", PyLong_FromLong((uint16_t)UserAccountNameInformation));
53369 7399 : PyModule_AddObject(m, "UserFullNameInformation", PyLong_FromLong((uint16_t)UserFullNameInformation));
53370 7399 : PyModule_AddObject(m, "UserPrimaryGroupInformation", PyLong_FromLong((uint16_t)UserPrimaryGroupInformation));
53371 7399 : PyModule_AddObject(m, "UserHomeInformation", PyLong_FromLong((uint16_t)UserHomeInformation));
53372 7399 : PyModule_AddObject(m, "UserScriptInformation", PyLong_FromLong((uint16_t)UserScriptInformation));
53373 7399 : PyModule_AddObject(m, "UserProfileInformation", PyLong_FromLong((uint16_t)UserProfileInformation));
53374 7399 : PyModule_AddObject(m, "UserAdminCommentInformation", PyLong_FromLong((uint16_t)UserAdminCommentInformation));
53375 7399 : PyModule_AddObject(m, "UserWorkStationsInformation", PyLong_FromLong((uint16_t)UserWorkStationsInformation));
53376 7399 : PyModule_AddObject(m, "UserControlInformation", PyLong_FromLong((uint16_t)UserControlInformation));
53377 7399 : PyModule_AddObject(m, "UserExpiresInformation", PyLong_FromLong((uint16_t)UserExpiresInformation));
53378 7399 : PyModule_AddObject(m, "UserInternal1Information", PyLong_FromLong((uint16_t)UserInternal1Information));
53379 7399 : PyModule_AddObject(m, "UserParametersInformation", PyLong_FromLong((uint16_t)UserParametersInformation));
53380 7399 : PyModule_AddObject(m, "UserAllInformation", PyLong_FromLong((uint16_t)UserAllInformation));
53381 7399 : PyModule_AddObject(m, "UserInternal4Information", PyLong_FromLong((uint16_t)UserInternal4Information));
53382 7399 : PyModule_AddObject(m, "UserInternal5Information", PyLong_FromLong((uint16_t)UserInternal5Information));
53383 7399 : PyModule_AddObject(m, "UserInternal4InformationNew", PyLong_FromLong((uint16_t)UserInternal4InformationNew));
53384 7399 : PyModule_AddObject(m, "UserInternal5InformationNew", PyLong_FromLong((uint16_t)UserInternal5InformationNew));
53385 7399 : PyModule_AddObject(m, "UserInternal7InformationNew", PyLong_FromLong((uint16_t)UserInternal7InformationNew));
53386 7399 : PyModule_AddObject(m, "UserInternal8InformationNew", PyLong_FromLong((uint16_t)UserInternal8InformationNew));
53387 7399 : PyModule_AddObject(m, "SAMR_FIELD_ACCOUNT_NAME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCOUNT_NAME));
53388 7399 : PyModule_AddObject(m, "SAMR_FIELD_FULL_NAME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_FULL_NAME));
53389 7399 : PyModule_AddObject(m, "SAMR_FIELD_RID", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_RID));
53390 7399 : PyModule_AddObject(m, "SAMR_FIELD_PRIMARY_GID", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PRIMARY_GID));
53391 7399 : PyModule_AddObject(m, "SAMR_FIELD_DESCRIPTION", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_DESCRIPTION));
53392 7399 : PyModule_AddObject(m, "SAMR_FIELD_COMMENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_COMMENT));
53393 7399 : PyModule_AddObject(m, "SAMR_FIELD_HOME_DIRECTORY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_HOME_DIRECTORY));
53394 7399 : PyModule_AddObject(m, "SAMR_FIELD_HOME_DRIVE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_HOME_DRIVE));
53395 7399 : PyModule_AddObject(m, "SAMR_FIELD_LOGON_SCRIPT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LOGON_SCRIPT));
53396 7399 : PyModule_AddObject(m, "SAMR_FIELD_PROFILE_PATH", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PROFILE_PATH));
53397 7399 : PyModule_AddObject(m, "SAMR_FIELD_WORKSTATIONS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_WORKSTATIONS));
53398 7399 : PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGON", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_LOGON));
53399 7399 : PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGOFF", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_LOGOFF));
53400 7399 : PyModule_AddObject(m, "SAMR_FIELD_LOGON_HOURS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LOGON_HOURS));
53401 7399 : PyModule_AddObject(m, "SAMR_FIELD_BAD_PWD_COUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_BAD_PWD_COUNT));
53402 7399 : PyModule_AddObject(m, "SAMR_FIELD_NUM_LOGONS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_NUM_LOGONS));
53403 7399 : PyModule_AddObject(m, "SAMR_FIELD_ALLOW_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ALLOW_PWD_CHANGE));
53404 7399 : PyModule_AddObject(m, "SAMR_FIELD_FORCE_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_FORCE_PWD_CHANGE));
53405 7399 : PyModule_AddObject(m, "SAMR_FIELD_LAST_PWD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LAST_PWD_CHANGE));
53406 7399 : PyModule_AddObject(m, "SAMR_FIELD_ACCT_EXPIRY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCT_EXPIRY));
53407 7399 : PyModule_AddObject(m, "SAMR_FIELD_ACCT_FLAGS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_ACCT_FLAGS));
53408 7399 : PyModule_AddObject(m, "SAMR_FIELD_PARAMETERS", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PARAMETERS));
53409 7399 : PyModule_AddObject(m, "SAMR_FIELD_COUNTRY_CODE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_COUNTRY_CODE));
53410 7399 : PyModule_AddObject(m, "SAMR_FIELD_CODE_PAGE", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_CODE_PAGE));
53411 7399 : PyModule_AddObject(m, "SAMR_FIELD_NT_PASSWORD_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_NT_PASSWORD_PRESENT));
53412 7399 : PyModule_AddObject(m, "SAMR_FIELD_LM_PASSWORD_PRESENT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_LM_PASSWORD_PRESENT));
53413 7399 : PyModule_AddObject(m, "SAMR_FIELD_PRIVATE_DATA", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_PRIVATE_DATA));
53414 7399 : PyModule_AddObject(m, "SAMR_FIELD_EXPIRED_FLAG", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_EXPIRED_FLAG));
53415 7399 : PyModule_AddObject(m, "SAMR_FIELD_SEC_DESC", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_SEC_DESC));
53416 7399 : PyModule_AddObject(m, "SAMR_FIELD_OWF_PWD", PyLong_FromUnsignedLongLong((uint32_t)SAMR_FIELD_OWF_PWD));
53417 7399 : PyModule_AddObject(m, "SAMR_CONNECT_PRE_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_PRE_W2K));
53418 7399 : PyModule_AddObject(m, "SAMR_CONNECT_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_W2K));
53419 7399 : PyModule_AddObject(m, "SAMR_CONNECT_AFTER_W2K", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_AFTER_W2K));
53420 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_NO_ERROR", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_NO_ERROR));
53421 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_SHORT", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PASSWORD_TOO_SHORT));
53422 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_PWD_IN_HISTORY", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PWD_IN_HISTORY));
53423 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_USERNAME_IN_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_USERNAME_IN_PASSWORD));
53424 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD));
53425 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_NOT_COMPLEX", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_NOT_COMPLEX));
53426 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT));
53427 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_FAILED_BY_FILTER", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_FAILED_BY_FILTER));
53428 7399 : PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_LONG", PyLong_FromUnsignedLongLong((uint32_t)SAM_PWD_CHANGE_PASSWORD_TOO_LONG));
53429 7399 : PyModule_AddObject(m, "SAMR_CONNECT_FEATURE_RID_ONLY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_FEATURE_RID_ONLY));
53430 7399 : PyModule_AddObject(m, "SAMR_CONNECT_FEATURE_RESRVED1", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_FEATURE_RESRVED1));
53431 7399 : PyModule_AddObject(m, "SAMR_CONNECT_FEATURE_RESRVED2", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_FEATURE_RESRVED2));
53432 7399 : PyModule_AddObject(m, "SAMR_CONNECT_FEATURE_USE_AES", PyLong_FromUnsignedLongLong((uint32_t)SAMR_CONNECT_FEATURE_USE_AES));
53433 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET));
53434 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME));
53435 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_LOCKOUT_TIME));
53436 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT));
53437 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH));
53438 7399 : PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", PyLong_FromUnsignedLongLong((uint32_t)SAMR_VALIDATE_FIELD_PASSWORD_HISTORY));
53439 7399 : PyModule_AddObject(m, "NetValidateAuthentication", PyLong_FromLong((uint16_t)NetValidateAuthentication));
53440 7399 : PyModule_AddObject(m, "NetValidatePasswordChange", PyLong_FromLong((uint16_t)NetValidatePasswordChange));
53441 7399 : PyModule_AddObject(m, "NetValidatePasswordReset", PyLong_FromLong((uint16_t)NetValidatePasswordReset));
53442 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_SUCCESS", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_SUCCESS));
53443 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE));
53444 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT));
53445 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED));
53446 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_BAD_PASSWORD", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_BAD_PASSWORD));
53447 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT));
53448 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_TOO_SHORT));
53449 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_LONG", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PWD_TOO_LONG));
53450 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH));
53451 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT));
53452 7399 : PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR", PyLong_FromLong((uint16_t)SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR));
53453 6162 : Py_INCREF((PyObject *)(void *)&samr_SamEntry_Type);
53454 7399 : PyModule_AddObject(m, "SamEntry", (PyObject *)(void *)&samr_SamEntry_Type);
53455 6162 : Py_INCREF((PyObject *)(void *)&samr_SamArray_Type);
53456 7399 : PyModule_AddObject(m, "SamArray", (PyObject *)(void *)&samr_SamArray_Type);
53457 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo1_Type);
53458 7399 : PyModule_AddObject(m, "DomInfo1", (PyObject *)(void *)&samr_DomInfo1_Type);
53459 6162 : Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation_Type);
53460 7399 : PyModule_AddObject(m, "DomGeneralInformation", (PyObject *)(void *)&samr_DomGeneralInformation_Type);
53461 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo3_Type);
53462 7399 : PyModule_AddObject(m, "DomInfo3", (PyObject *)(void *)&samr_DomInfo3_Type);
53463 6162 : Py_INCREF((PyObject *)(void *)&samr_DomOEMInformation_Type);
53464 7399 : PyModule_AddObject(m, "DomOEMInformation", (PyObject *)(void *)&samr_DomOEMInformation_Type);
53465 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo5_Type);
53466 7399 : PyModule_AddObject(m, "DomInfo5", (PyObject *)(void *)&samr_DomInfo5_Type);
53467 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo6_Type);
53468 7399 : PyModule_AddObject(m, "DomInfo6", (PyObject *)(void *)&samr_DomInfo6_Type);
53469 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo7_Type);
53470 7399 : PyModule_AddObject(m, "DomInfo7", (PyObject *)(void *)&samr_DomInfo7_Type);
53471 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo8_Type);
53472 7399 : PyModule_AddObject(m, "DomInfo8", (PyObject *)(void *)&samr_DomInfo8_Type);
53473 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo9_Type);
53474 7399 : PyModule_AddObject(m, "DomInfo9", (PyObject *)(void *)&samr_DomInfo9_Type);
53475 6162 : Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation2_Type);
53476 7399 : PyModule_AddObject(m, "DomGeneralInformation2", (PyObject *)(void *)&samr_DomGeneralInformation2_Type);
53477 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo12_Type);
53478 7399 : PyModule_AddObject(m, "DomInfo12", (PyObject *)(void *)&samr_DomInfo12_Type);
53479 6162 : Py_INCREF((PyObject *)(void *)&samr_DomInfo13_Type);
53480 7399 : PyModule_AddObject(m, "DomInfo13", (PyObject *)(void *)&samr_DomInfo13_Type);
53481 6162 : Py_INCREF((PyObject *)(void *)&samr_DomainInfo_Type);
53482 7399 : PyModule_AddObject(m, "DomainInfo", (PyObject *)(void *)&samr_DomainInfo_Type);
53483 6162 : Py_INCREF((PyObject *)(void *)&samr_Ids_Type);
53484 7399 : PyModule_AddObject(m, "Ids", (PyObject *)(void *)&samr_Ids_Type);
53485 6162 : Py_INCREF((PyObject *)(void *)&samr_GroupInfoAll_Type);
53486 7399 : PyModule_AddObject(m, "GroupInfoAll", (PyObject *)(void *)&samr_GroupInfoAll_Type);
53487 6162 : Py_INCREF((PyObject *)(void *)&samr_GroupInfoAttributes_Type);
53488 7399 : PyModule_AddObject(m, "GroupInfoAttributes", (PyObject *)(void *)&samr_GroupInfoAttributes_Type);
53489 6162 : Py_INCREF((PyObject *)(void *)&samr_GroupInfoDescription_Type);
53490 7399 : PyModule_AddObject(m, "GroupInfoDescription", (PyObject *)(void *)&samr_GroupInfoDescription_Type);
53491 6162 : Py_INCREF((PyObject *)(void *)&samr_GroupInfo_Type);
53492 7399 : PyModule_AddObject(m, "GroupInfo", (PyObject *)(void *)&samr_GroupInfo_Type);
53493 6162 : Py_INCREF((PyObject *)(void *)&samr_RidAttrArray_Type);
53494 7399 : PyModule_AddObject(m, "RidAttrArray", (PyObject *)(void *)&samr_RidAttrArray_Type);
53495 6162 : Py_INCREF((PyObject *)(void *)&samr_AliasInfoAll_Type);
53496 7399 : PyModule_AddObject(m, "AliasInfoAll", (PyObject *)(void *)&samr_AliasInfoAll_Type);
53497 6162 : Py_INCREF((PyObject *)(void *)&samr_AliasInfo_Type);
53498 7399 : PyModule_AddObject(m, "AliasInfo", (PyObject *)(void *)&samr_AliasInfo_Type);
53499 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo1_Type);
53500 7399 : PyModule_AddObject(m, "UserInfo1", (PyObject *)(void *)&samr_UserInfo1_Type);
53501 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo2_Type);
53502 7399 : PyModule_AddObject(m, "UserInfo2", (PyObject *)(void *)&samr_UserInfo2_Type);
53503 6162 : Py_INCREF((PyObject *)(void *)&samr_LogonHours_Type);
53504 7399 : PyModule_AddObject(m, "LogonHours", (PyObject *)(void *)&samr_LogonHours_Type);
53505 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo3_Type);
53506 7399 : PyModule_AddObject(m, "UserInfo3", (PyObject *)(void *)&samr_UserInfo3_Type);
53507 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo4_Type);
53508 7399 : PyModule_AddObject(m, "UserInfo4", (PyObject *)(void *)&samr_UserInfo4_Type);
53509 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo5_Type);
53510 7399 : PyModule_AddObject(m, "UserInfo5", (PyObject *)(void *)&samr_UserInfo5_Type);
53511 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo6_Type);
53512 7399 : PyModule_AddObject(m, "UserInfo6", (PyObject *)(void *)&samr_UserInfo6_Type);
53513 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo7_Type);
53514 7399 : PyModule_AddObject(m, "UserInfo7", (PyObject *)(void *)&samr_UserInfo7_Type);
53515 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo8_Type);
53516 7399 : PyModule_AddObject(m, "UserInfo8", (PyObject *)(void *)&samr_UserInfo8_Type);
53517 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo9_Type);
53518 7399 : PyModule_AddObject(m, "UserInfo9", (PyObject *)(void *)&samr_UserInfo9_Type);
53519 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo10_Type);
53520 7399 : PyModule_AddObject(m, "UserInfo10", (PyObject *)(void *)&samr_UserInfo10_Type);
53521 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo11_Type);
53522 7399 : PyModule_AddObject(m, "UserInfo11", (PyObject *)(void *)&samr_UserInfo11_Type);
53523 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo12_Type);
53524 7399 : PyModule_AddObject(m, "UserInfo12", (PyObject *)(void *)&samr_UserInfo12_Type);
53525 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo13_Type);
53526 7399 : PyModule_AddObject(m, "UserInfo13", (PyObject *)(void *)&samr_UserInfo13_Type);
53527 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo14_Type);
53528 7399 : PyModule_AddObject(m, "UserInfo14", (PyObject *)(void *)&samr_UserInfo14_Type);
53529 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo16_Type);
53530 7399 : PyModule_AddObject(m, "UserInfo16", (PyObject *)(void *)&samr_UserInfo16_Type);
53531 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo17_Type);
53532 7399 : PyModule_AddObject(m, "UserInfo17", (PyObject *)(void *)&samr_UserInfo17_Type);
53533 6162 : Py_INCREF((PyObject *)(void *)&samr_Password_Type);
53534 7399 : PyModule_AddObject(m, "Password", (PyObject *)(void *)&samr_Password_Type);
53535 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo18_Type);
53536 7399 : PyModule_AddObject(m, "UserInfo18", (PyObject *)(void *)&samr_UserInfo18_Type);
53537 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo20_Type);
53538 7399 : PyModule_AddObject(m, "UserInfo20", (PyObject *)(void *)&samr_UserInfo20_Type);
53539 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo21_Type);
53540 7399 : PyModule_AddObject(m, "UserInfo21", (PyObject *)(void *)&samr_UserInfo21_Type);
53541 6162 : Py_INCREF((PyObject *)(void *)&samr_CryptPassword_Type);
53542 7399 : PyModule_AddObject(m, "CryptPassword", (PyObject *)(void *)&samr_CryptPassword_Type);
53543 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo23_Type);
53544 7399 : PyModule_AddObject(m, "UserInfo23", (PyObject *)(void *)&samr_UserInfo23_Type);
53545 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo24_Type);
53546 7399 : PyModule_AddObject(m, "UserInfo24", (PyObject *)(void *)&samr_UserInfo24_Type);
53547 6162 : Py_INCREF((PyObject *)(void *)&samr_CryptPasswordEx_Type);
53548 7399 : PyModule_AddObject(m, "CryptPasswordEx", (PyObject *)(void *)&samr_CryptPasswordEx_Type);
53549 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo25_Type);
53550 7399 : PyModule_AddObject(m, "UserInfo25", (PyObject *)(void *)&samr_UserInfo25_Type);
53551 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo26_Type);
53552 7399 : PyModule_AddObject(m, "UserInfo26", (PyObject *)(void *)&samr_UserInfo26_Type);
53553 6162 : Py_INCREF((PyObject *)(void *)&samr_EncryptedPasswordAES_Type);
53554 7399 : PyModule_AddObject(m, "EncryptedPasswordAES", (PyObject *)(void *)&samr_EncryptedPasswordAES_Type);
53555 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo31_Type);
53556 7399 : PyModule_AddObject(m, "UserInfo31", (PyObject *)(void *)&samr_UserInfo31_Type);
53557 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo32_Type);
53558 7399 : PyModule_AddObject(m, "UserInfo32", (PyObject *)(void *)&samr_UserInfo32_Type);
53559 6162 : Py_INCREF((PyObject *)(void *)&samr_UserInfo_Type);
53560 7399 : PyModule_AddObject(m, "UserInfo", (PyObject *)(void *)&samr_UserInfo_Type);
53561 6162 : Py_INCREF((PyObject *)(void *)&samr_RidWithAttribute_Type);
53562 7399 : PyModule_AddObject(m, "RidWithAttribute", (PyObject *)(void *)&samr_RidWithAttribute_Type);
53563 6162 : Py_INCREF((PyObject *)(void *)&samr_RidWithAttributeArray_Type);
53564 7399 : PyModule_AddObject(m, "RidWithAttributeArray", (PyObject *)(void *)&samr_RidWithAttributeArray_Type);
53565 6162 : Py_INCREF((PyObject *)(void *)&samr_DispEntryGeneral_Type);
53566 7399 : PyModule_AddObject(m, "DispEntryGeneral", (PyObject *)(void *)&samr_DispEntryGeneral_Type);
53567 6162 : Py_INCREF((PyObject *)(void *)&samr_DispInfoGeneral_Type);
53568 7399 : PyModule_AddObject(m, "DispInfoGeneral", (PyObject *)(void *)&samr_DispInfoGeneral_Type);
53569 6162 : Py_INCREF((PyObject *)(void *)&samr_DispEntryFull_Type);
53570 7399 : PyModule_AddObject(m, "DispEntryFull", (PyObject *)(void *)&samr_DispEntryFull_Type);
53571 6162 : Py_INCREF((PyObject *)(void *)&samr_DispInfoFull_Type);
53572 7399 : PyModule_AddObject(m, "DispInfoFull", (PyObject *)(void *)&samr_DispInfoFull_Type);
53573 6162 : Py_INCREF((PyObject *)(void *)&samr_DispEntryFullGroup_Type);
53574 7399 : PyModule_AddObject(m, "DispEntryFullGroup", (PyObject *)(void *)&samr_DispEntryFullGroup_Type);
53575 6162 : Py_INCREF((PyObject *)(void *)&samr_DispInfoFullGroups_Type);
53576 7399 : PyModule_AddObject(m, "DispInfoFullGroups", (PyObject *)(void *)&samr_DispInfoFullGroups_Type);
53577 6162 : Py_INCREF((PyObject *)(void *)&samr_DispEntryAscii_Type);
53578 7399 : PyModule_AddObject(m, "DispEntryAscii", (PyObject *)(void *)&samr_DispEntryAscii_Type);
53579 6162 : Py_INCREF((PyObject *)(void *)&samr_DispInfoAscii_Type);
53580 7399 : PyModule_AddObject(m, "DispInfoAscii", (PyObject *)(void *)&samr_DispInfoAscii_Type);
53581 6162 : Py_INCREF((PyObject *)(void *)&samr_DispInfo_Type);
53582 7399 : PyModule_AddObject(m, "DispInfo", (PyObject *)(void *)&samr_DispInfo_Type);
53583 6162 : Py_INCREF((PyObject *)(void *)&samr_PwInfo_Type);
53584 7399 : PyModule_AddObject(m, "PwInfo", (PyObject *)(void *)&samr_PwInfo_Type);
53585 6162 : Py_INCREF((PyObject *)(void *)&userPwdChangeFailureInformation_Type);
53586 7399 : PyModule_AddObject(m, "userPwdChangeFailureInformation", (PyObject *)(void *)&userPwdChangeFailureInformation_Type);
53587 6162 : Py_INCREF((PyObject *)(void *)&samr_ConnectInfo1_Type);
53588 7399 : PyModule_AddObject(m, "ConnectInfo1", (PyObject *)(void *)&samr_ConnectInfo1_Type);
53589 6162 : Py_INCREF((PyObject *)(void *)&samr_ConnectInfo_Type);
53590 7399 : PyModule_AddObject(m, "ConnectInfo", (PyObject *)(void *)&samr_ConnectInfo_Type);
53591 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidationBlob_Type);
53592 7399 : PyModule_AddObject(m, "ValidationBlob", (PyObject *)(void *)&samr_ValidationBlob_Type);
53593 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordInfo_Type);
53594 7399 : PyModule_AddObject(m, "ValidatePasswordInfo", (PyObject *)(void *)&samr_ValidatePasswordInfo_Type);
53595 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type);
53596 7399 : PyModule_AddObject(m, "ValidatePasswordRepCtr", (PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type);
53597 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordRep_Type);
53598 7399 : PyModule_AddObject(m, "ValidatePasswordRep", (PyObject *)(void *)&samr_ValidatePasswordRep_Type);
53599 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq3_Type);
53600 7399 : PyModule_AddObject(m, "ValidatePasswordReq3", (PyObject *)(void *)&samr_ValidatePasswordReq3_Type);
53601 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq2_Type);
53602 7399 : PyModule_AddObject(m, "ValidatePasswordReq2", (PyObject *)(void *)&samr_ValidatePasswordReq2_Type);
53603 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq1_Type);
53604 7399 : PyModule_AddObject(m, "ValidatePasswordReq1", (PyObject *)(void *)&samr_ValidatePasswordReq1_Type);
53605 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq_Type);
53606 7399 : PyModule_AddObject(m, "ValidatePasswordReq", (PyObject *)(void *)&samr_ValidatePasswordReq_Type);
53607 6162 : Py_INCREF((PyObject *)(void *)&samr_Connect_Type);
53608 7399 : PyModule_AddObject(m, "Connect", (PyObject *)(void *)&samr_Connect_Type);
53609 6162 : Py_INCREF((PyObject *)(void *)&samr_Close_Type);
53610 7399 : PyModule_AddObject(m, "Close", (PyObject *)(void *)&samr_Close_Type);
53611 6162 : Py_INCREF((PyObject *)(void *)&samr_SetSecurity_Type);
53612 7399 : PyModule_AddObject(m, "SetSecurity", (PyObject *)(void *)&samr_SetSecurity_Type);
53613 6162 : Py_INCREF((PyObject *)(void *)&samr_QuerySecurity_Type);
53614 7399 : PyModule_AddObject(m, "QuerySecurity", (PyObject *)(void *)&samr_QuerySecurity_Type);
53615 6162 : Py_INCREF((PyObject *)(void *)&samr_Shutdown_Type);
53616 7399 : PyModule_AddObject(m, "Shutdown", (PyObject *)(void *)&samr_Shutdown_Type);
53617 6162 : Py_INCREF((PyObject *)(void *)&samr_LookupDomain_Type);
53618 7399 : PyModule_AddObject(m, "LookupDomain", (PyObject *)(void *)&samr_LookupDomain_Type);
53619 6162 : Py_INCREF((PyObject *)(void *)&samr_EnumDomains_Type);
53620 7399 : PyModule_AddObject(m, "EnumDomains", (PyObject *)(void *)&samr_EnumDomains_Type);
53621 6162 : Py_INCREF((PyObject *)(void *)&samr_OpenDomain_Type);
53622 7399 : PyModule_AddObject(m, "OpenDomain", (PyObject *)(void *)&samr_OpenDomain_Type);
53623 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryDomainInfo_Type);
53624 7399 : PyModule_AddObject(m, "QueryDomainInfo", (PyObject *)(void *)&samr_QueryDomainInfo_Type);
53625 6162 : Py_INCREF((PyObject *)(void *)&samr_SetDomainInfo_Type);
53626 7399 : PyModule_AddObject(m, "SetDomainInfo", (PyObject *)(void *)&samr_SetDomainInfo_Type);
53627 6162 : Py_INCREF((PyObject *)(void *)&samr_CreateDomainGroup_Type);
53628 7399 : PyModule_AddObject(m, "CreateDomainGroup", (PyObject *)(void *)&samr_CreateDomainGroup_Type);
53629 6162 : Py_INCREF((PyObject *)(void *)&samr_EnumDomainGroups_Type);
53630 7399 : PyModule_AddObject(m, "EnumDomainGroups", (PyObject *)(void *)&samr_EnumDomainGroups_Type);
53631 6162 : Py_INCREF((PyObject *)(void *)&samr_CreateUser_Type);
53632 7399 : PyModule_AddObject(m, "CreateUser", (PyObject *)(void *)&samr_CreateUser_Type);
53633 6162 : Py_INCREF((PyObject *)(void *)&samr_EnumDomainUsers_Type);
53634 7399 : PyModule_AddObject(m, "EnumDomainUsers", (PyObject *)(void *)&samr_EnumDomainUsers_Type);
53635 6162 : Py_INCREF((PyObject *)(void *)&samr_CreateDomAlias_Type);
53636 7399 : PyModule_AddObject(m, "CreateDomAlias", (PyObject *)(void *)&samr_CreateDomAlias_Type);
53637 6162 : Py_INCREF((PyObject *)(void *)&samr_EnumDomainAliases_Type);
53638 7399 : PyModule_AddObject(m, "EnumDomainAliases", (PyObject *)(void *)&samr_EnumDomainAliases_Type);
53639 6162 : Py_INCREF((PyObject *)(void *)&samr_GetAliasMembership_Type);
53640 7399 : PyModule_AddObject(m, "GetAliasMembership", (PyObject *)(void *)&samr_GetAliasMembership_Type);
53641 6162 : Py_INCREF((PyObject *)(void *)&samr_LookupNames_Type);
53642 7399 : PyModule_AddObject(m, "LookupNames", (PyObject *)(void *)&samr_LookupNames_Type);
53643 6162 : Py_INCREF((PyObject *)(void *)&samr_LookupRids_Type);
53644 7399 : PyModule_AddObject(m, "LookupRids", (PyObject *)(void *)&samr_LookupRids_Type);
53645 6162 : Py_INCREF((PyObject *)(void *)&samr_OpenGroup_Type);
53646 7399 : PyModule_AddObject(m, "OpenGroup", (PyObject *)(void *)&samr_OpenGroup_Type);
53647 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryGroupInfo_Type);
53648 7399 : PyModule_AddObject(m, "QueryGroupInfo", (PyObject *)(void *)&samr_QueryGroupInfo_Type);
53649 6162 : Py_INCREF((PyObject *)(void *)&samr_SetGroupInfo_Type);
53650 7399 : PyModule_AddObject(m, "SetGroupInfo", (PyObject *)(void *)&samr_SetGroupInfo_Type);
53651 6162 : Py_INCREF((PyObject *)(void *)&samr_AddGroupMember_Type);
53652 7399 : PyModule_AddObject(m, "AddGroupMember", (PyObject *)(void *)&samr_AddGroupMember_Type);
53653 6162 : Py_INCREF((PyObject *)(void *)&samr_DeleteDomainGroup_Type);
53654 7399 : PyModule_AddObject(m, "DeleteDomainGroup", (PyObject *)(void *)&samr_DeleteDomainGroup_Type);
53655 6162 : Py_INCREF((PyObject *)(void *)&samr_DeleteGroupMember_Type);
53656 7399 : PyModule_AddObject(m, "DeleteGroupMember", (PyObject *)(void *)&samr_DeleteGroupMember_Type);
53657 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryGroupMember_Type);
53658 7399 : PyModule_AddObject(m, "QueryGroupMember", (PyObject *)(void *)&samr_QueryGroupMember_Type);
53659 6162 : Py_INCREF((PyObject *)(void *)&samr_SetMemberAttributesOfGroup_Type);
53660 7399 : PyModule_AddObject(m, "SetMemberAttributesOfGroup", (PyObject *)(void *)&samr_SetMemberAttributesOfGroup_Type);
53661 6162 : Py_INCREF((PyObject *)(void *)&samr_OpenAlias_Type);
53662 7399 : PyModule_AddObject(m, "OpenAlias", (PyObject *)(void *)&samr_OpenAlias_Type);
53663 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryAliasInfo_Type);
53664 7399 : PyModule_AddObject(m, "QueryAliasInfo", (PyObject *)(void *)&samr_QueryAliasInfo_Type);
53665 6162 : Py_INCREF((PyObject *)(void *)&samr_SetAliasInfo_Type);
53666 7399 : PyModule_AddObject(m, "SetAliasInfo", (PyObject *)(void *)&samr_SetAliasInfo_Type);
53667 6162 : Py_INCREF((PyObject *)(void *)&samr_DeleteDomAlias_Type);
53668 7399 : PyModule_AddObject(m, "DeleteDomAlias", (PyObject *)(void *)&samr_DeleteDomAlias_Type);
53669 6162 : Py_INCREF((PyObject *)(void *)&samr_AddAliasMember_Type);
53670 7399 : PyModule_AddObject(m, "AddAliasMember", (PyObject *)(void *)&samr_AddAliasMember_Type);
53671 6162 : Py_INCREF((PyObject *)(void *)&samr_DeleteAliasMember_Type);
53672 7399 : PyModule_AddObject(m, "DeleteAliasMember", (PyObject *)(void *)&samr_DeleteAliasMember_Type);
53673 6162 : Py_INCREF((PyObject *)(void *)&samr_GetMembersInAlias_Type);
53674 7399 : PyModule_AddObject(m, "GetMembersInAlias", (PyObject *)(void *)&samr_GetMembersInAlias_Type);
53675 6162 : Py_INCREF((PyObject *)(void *)&samr_OpenUser_Type);
53676 7399 : PyModule_AddObject(m, "OpenUser", (PyObject *)(void *)&samr_OpenUser_Type);
53677 6162 : Py_INCREF((PyObject *)(void *)&samr_DeleteUser_Type);
53678 7399 : PyModule_AddObject(m, "DeleteUser", (PyObject *)(void *)&samr_DeleteUser_Type);
53679 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryUserInfo_Type);
53680 7399 : PyModule_AddObject(m, "QueryUserInfo", (PyObject *)(void *)&samr_QueryUserInfo_Type);
53681 6162 : Py_INCREF((PyObject *)(void *)&samr_SetUserInfo_Type);
53682 7399 : PyModule_AddObject(m, "SetUserInfo", (PyObject *)(void *)&samr_SetUserInfo_Type);
53683 6162 : Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser_Type);
53684 7399 : PyModule_AddObject(m, "ChangePasswordUser", (PyObject *)(void *)&samr_ChangePasswordUser_Type);
53685 6162 : Py_INCREF((PyObject *)(void *)&samr_GetGroupsForUser_Type);
53686 7399 : PyModule_AddObject(m, "GetGroupsForUser", (PyObject *)(void *)&samr_GetGroupsForUser_Type);
53687 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo_Type);
53688 7399 : PyModule_AddObject(m, "QueryDisplayInfo", (PyObject *)(void *)&samr_QueryDisplayInfo_Type);
53689 6162 : Py_INCREF((PyObject *)(void *)&samr_GetDisplayEnumerationIndex_Type);
53690 7399 : PyModule_AddObject(m, "GetDisplayEnumerationIndex", (PyObject *)(void *)&samr_GetDisplayEnumerationIndex_Type);
53691 6162 : Py_INCREF((PyObject *)(void *)&samr_TestPrivateFunctionsDomain_Type);
53692 7399 : PyModule_AddObject(m, "TestPrivateFunctionsDomain", (PyObject *)(void *)&samr_TestPrivateFunctionsDomain_Type);
53693 6162 : Py_INCREF((PyObject *)(void *)&samr_TestPrivateFunctionsUser_Type);
53694 7399 : PyModule_AddObject(m, "TestPrivateFunctionsUser", (PyObject *)(void *)&samr_TestPrivateFunctionsUser_Type);
53695 6162 : Py_INCREF((PyObject *)(void *)&samr_GetUserPwInfo_Type);
53696 7399 : PyModule_AddObject(m, "GetUserPwInfo", (PyObject *)(void *)&samr_GetUserPwInfo_Type);
53697 6162 : Py_INCREF((PyObject *)(void *)&samr_RemoveMemberFromForeignDomain_Type);
53698 7399 : PyModule_AddObject(m, "RemoveMemberFromForeignDomain", (PyObject *)(void *)&samr_RemoveMemberFromForeignDomain_Type);
53699 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryDomainInfo2_Type);
53700 7399 : PyModule_AddObject(m, "QueryDomainInfo2", (PyObject *)(void *)&samr_QueryDomainInfo2_Type);
53701 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryUserInfo2_Type);
53702 7399 : PyModule_AddObject(m, "QueryUserInfo2", (PyObject *)(void *)&samr_QueryUserInfo2_Type);
53703 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo2_Type);
53704 7399 : PyModule_AddObject(m, "QueryDisplayInfo2", (PyObject *)(void *)&samr_QueryDisplayInfo2_Type);
53705 6162 : Py_INCREF((PyObject *)(void *)&samr_GetDisplayEnumerationIndex2_Type);
53706 7399 : PyModule_AddObject(m, "GetDisplayEnumerationIndex2", (PyObject *)(void *)&samr_GetDisplayEnumerationIndex2_Type);
53707 6162 : Py_INCREF((PyObject *)(void *)&samr_CreateUser2_Type);
53708 7399 : PyModule_AddObject(m, "CreateUser2", (PyObject *)(void *)&samr_CreateUser2_Type);
53709 6162 : Py_INCREF((PyObject *)(void *)&samr_QueryDisplayInfo3_Type);
53710 7399 : PyModule_AddObject(m, "QueryDisplayInfo3", (PyObject *)(void *)&samr_QueryDisplayInfo3_Type);
53711 6162 : Py_INCREF((PyObject *)(void *)&samr_AddMultipleMembersToAlias_Type);
53712 7399 : PyModule_AddObject(m, "AddMultipleMembersToAlias", (PyObject *)(void *)&samr_AddMultipleMembersToAlias_Type);
53713 6162 : Py_INCREF((PyObject *)(void *)&samr_RemoveMultipleMembersFromAlias_Type);
53714 7399 : PyModule_AddObject(m, "RemoveMultipleMembersFromAlias", (PyObject *)(void *)&samr_RemoveMultipleMembersFromAlias_Type);
53715 6162 : Py_INCREF((PyObject *)(void *)&samr_OemChangePasswordUser2_Type);
53716 7399 : PyModule_AddObject(m, "OemChangePasswordUser2", (PyObject *)(void *)&samr_OemChangePasswordUser2_Type);
53717 6162 : Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser2_Type);
53718 7399 : PyModule_AddObject(m, "ChangePasswordUser2", (PyObject *)(void *)&samr_ChangePasswordUser2_Type);
53719 6162 : Py_INCREF((PyObject *)(void *)&samr_GetDomPwInfo_Type);
53720 7399 : PyModule_AddObject(m, "GetDomPwInfo", (PyObject *)(void *)&samr_GetDomPwInfo_Type);
53721 6162 : Py_INCREF((PyObject *)(void *)&samr_Connect2_Type);
53722 7399 : PyModule_AddObject(m, "Connect2", (PyObject *)(void *)&samr_Connect2_Type);
53723 6162 : Py_INCREF((PyObject *)(void *)&samr_SetUserInfo2_Type);
53724 7399 : PyModule_AddObject(m, "SetUserInfo2", (PyObject *)(void *)&samr_SetUserInfo2_Type);
53725 6162 : Py_INCREF((PyObject *)(void *)&samr_SetBootKeyInformation_Type);
53726 7399 : PyModule_AddObject(m, "SetBootKeyInformation", (PyObject *)(void *)&samr_SetBootKeyInformation_Type);
53727 6162 : Py_INCREF((PyObject *)(void *)&samr_GetBootKeyInformation_Type);
53728 7399 : PyModule_AddObject(m, "GetBootKeyInformation", (PyObject *)(void *)&samr_GetBootKeyInformation_Type);
53729 6162 : Py_INCREF((PyObject *)(void *)&samr_Connect3_Type);
53730 7399 : PyModule_AddObject(m, "Connect3", (PyObject *)(void *)&samr_Connect3_Type);
53731 6162 : Py_INCREF((PyObject *)(void *)&samr_Connect4_Type);
53732 7399 : PyModule_AddObject(m, "Connect4", (PyObject *)(void *)&samr_Connect4_Type);
53733 6162 : Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser3_Type);
53734 7399 : PyModule_AddObject(m, "ChangePasswordUser3", (PyObject *)(void *)&samr_ChangePasswordUser3_Type);
53735 6162 : Py_INCREF((PyObject *)(void *)&samr_Connect5_Type);
53736 7399 : PyModule_AddObject(m, "Connect5", (PyObject *)(void *)&samr_Connect5_Type);
53737 6162 : Py_INCREF((PyObject *)(void *)&samr_RidToSid_Type);
53738 7399 : PyModule_AddObject(m, "RidToSid", (PyObject *)(void *)&samr_RidToSid_Type);
53739 6162 : Py_INCREF((PyObject *)(void *)&samr_SetDsrmPassword_Type);
53740 7399 : PyModule_AddObject(m, "SetDsrmPassword", (PyObject *)(void *)&samr_SetDsrmPassword_Type);
53741 6162 : Py_INCREF((PyObject *)(void *)&samr_ValidatePassword_Type);
53742 7399 : PyModule_AddObject(m, "ValidatePassword", (PyObject *)(void *)&samr_ValidatePassword_Type);
53743 6162 : Py_INCREF((PyObject *)(void *)&samr_ChangePasswordUser4_Type);
53744 7399 : PyModule_AddObject(m, "ChangePasswordUser4", (PyObject *)(void *)&samr_ChangePasswordUser4_Type);
53745 6162 : Py_INCREF((PyObject *)(void *)&samr_InterfaceType);
53746 7399 : PyModule_AddObject(m, "samr", (PyObject *)(void *)&samr_InterfaceType);
53747 6162 : Py_INCREF((PyObject *)(void *)&samr_SyntaxType);
53748 7399 : PyModule_AddObject(m, "samr_abstract_syntax", (PyObject *)(void *)&samr_SyntaxType);
53749 6162 : Py_INCREF((PyObject *)(void *)&samr_SyntaxType);
53750 7399 : PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&samr_SyntaxType);
53751 : #ifdef PY_MOD_SAMR_PATCH
53752 : PY_MOD_SAMR_PATCH(m);
53753 : #endif
53754 7399 : out:
53755 7399 : Py_XDECREF(dep_samba_dcerpc_misc);
53756 7399 : Py_XDECREF(dep_samba_dcerpc_lsa);
53757 7399 : Py_XDECREF(dep_samba_dcerpc_security);
53758 7399 : Py_XDECREF(dep_talloc);
53759 7399 : Py_XDECREF(dep_samba_dcerpc_base);
53760 7208 : return m;
53761 :
53762 : }
|