2 /* Python wrapper functions auto-generated by pidl */
6 #include "librpc/rpc/pyrpc.h"
7 #include "librpc/rpc/pyrpc_util.h"
8 #include "bin/default/librpc/gen_ndr/ndr_samr.h"
9 #include "bin/default/librpc/gen_ndr/ndr_samr_c.h"
11 #include "librpc/gen_ndr/misc.h"
12 #include "librpc/gen_ndr/lsa.h"
13 #include "librpc/gen_ndr/security.h"
14 staticforward PyTypeObject samr_SamEntry_Type;
15 staticforward PyTypeObject samr_SamArray_Type;
16 staticforward PyTypeObject samr_DomInfo1_Type;
17 staticforward PyTypeObject samr_DomGeneralInformation_Type;
18 staticforward PyTypeObject samr_DomInfo3_Type;
19 staticforward PyTypeObject samr_DomOEMInformation_Type;
20 staticforward PyTypeObject samr_DomInfo5_Type;
21 staticforward PyTypeObject samr_DomInfo6_Type;
22 staticforward PyTypeObject samr_DomInfo7_Type;
23 staticforward PyTypeObject samr_DomInfo8_Type;
24 staticforward PyTypeObject samr_DomInfo9_Type;
25 staticforward PyTypeObject samr_DomGeneralInformation2_Type;
26 staticforward PyTypeObject samr_DomInfo12_Type;
27 staticforward PyTypeObject samr_DomInfo13_Type;
28 staticforward PyTypeObject samr_Ids_Type;
29 staticforward PyTypeObject samr_GroupInfoAll_Type;
30 staticforward PyTypeObject samr_GroupInfoAttributes_Type;
31 staticforward PyTypeObject samr_GroupInfoDescription_Type;
32 staticforward PyTypeObject samr_RidAttrArray_Type;
33 staticforward PyTypeObject samr_AliasInfoAll_Type;
34 staticforward PyTypeObject samr_UserInfo1_Type;
35 staticforward PyTypeObject samr_UserInfo2_Type;
36 staticforward PyTypeObject samr_LogonHours_Type;
37 staticforward PyTypeObject samr_UserInfo3_Type;
38 staticforward PyTypeObject samr_UserInfo4_Type;
39 staticforward PyTypeObject samr_UserInfo5_Type;
40 staticforward PyTypeObject samr_UserInfo6_Type;
41 staticforward PyTypeObject samr_UserInfo7_Type;
42 staticforward PyTypeObject samr_UserInfo8_Type;
43 staticforward PyTypeObject samr_UserInfo9_Type;
44 staticforward PyTypeObject samr_UserInfo10_Type;
45 staticforward PyTypeObject samr_UserInfo11_Type;
46 staticforward PyTypeObject samr_UserInfo12_Type;
47 staticforward PyTypeObject samr_UserInfo13_Type;
48 staticforward PyTypeObject samr_UserInfo14_Type;
49 staticforward PyTypeObject samr_UserInfo16_Type;
50 staticforward PyTypeObject samr_UserInfo17_Type;
51 staticforward PyTypeObject samr_Password_Type;
52 staticforward PyTypeObject samr_UserInfo18_Type;
53 staticforward PyTypeObject samr_UserInfo20_Type;
54 staticforward PyTypeObject samr_UserInfo21_Type;
55 staticforward PyTypeObject samr_CryptPassword_Type;
56 staticforward PyTypeObject samr_UserInfo23_Type;
57 staticforward PyTypeObject samr_UserInfo24_Type;
58 staticforward PyTypeObject samr_CryptPasswordEx_Type;
59 staticforward PyTypeObject samr_UserInfo25_Type;
60 staticforward PyTypeObject samr_UserInfo26_Type;
61 staticforward PyTypeObject samr_RidWithAttribute_Type;
62 staticforward PyTypeObject samr_RidWithAttributeArray_Type;
63 staticforward PyTypeObject samr_DispEntryGeneral_Type;
64 staticforward PyTypeObject samr_DispInfoGeneral_Type;
65 staticforward PyTypeObject samr_DispEntryFull_Type;
66 staticforward PyTypeObject samr_DispInfoFull_Type;
67 staticforward PyTypeObject samr_DispEntryFullGroup_Type;
68 staticforward PyTypeObject samr_DispInfoFullGroups_Type;
69 staticforward PyTypeObject samr_DispEntryAscii_Type;
70 staticforward PyTypeObject samr_DispInfoAscii_Type;
71 staticforward PyTypeObject samr_PwInfo_Type;
72 staticforward PyTypeObject userPwdChangeFailureInformation_Type;
73 staticforward PyTypeObject samr_ConnectInfo1_Type;
74 staticforward PyTypeObject samr_ValidationBlob_Type;
75 staticforward PyTypeObject samr_ValidatePasswordInfo_Type;
76 staticforward PyTypeObject samr_ValidatePasswordRepCtr_Type;
77 staticforward PyTypeObject samr_ValidatePasswordReq3_Type;
78 staticforward PyTypeObject samr_ValidatePasswordReq2_Type;
79 staticforward PyTypeObject samr_ValidatePasswordReq1_Type;
80 staticforward PyTypeObject samr_InterfaceType;
82 void initsamr(void);static PyTypeObject *dom_sid_Type;
83 static PyTypeObject *lsa_BinaryString_Type;
84 static PyTypeObject *lsa_AsciiString_Type;
85 static PyTypeObject *lsa_Strings_Type;
86 static PyTypeObject *ClientConnection_Type;
87 static PyTypeObject *lsa_String_Type;
88 static PyTypeObject *lsa_AsciiStringLarge_Type;
89 static PyTypeObject *lsa_StringLarge_Type;
90 static PyTypeObject *sec_desc_buf_Type;
91 static PyTypeObject *lsa_SidArray_Type;
92 static PyTypeObject *policy_handle_Type;
93 static PyTypeObject *Object_Type;
95 static PyObject *py_samr_SamEntry_get_idx(PyObject *obj, void *closure)
97 struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
99 py_idx = PyInt_FromLong(object->idx);
103 static int py_samr_SamEntry_set_idx(PyObject *py_obj, PyObject *value, void *closure)
105 struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj);
106 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
107 object->idx = PyInt_AsLong(value);
111 static PyObject *py_samr_SamEntry_get_name(PyObject *obj, void *closure)
113 struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
115 py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
119 static int py_samr_SamEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
121 struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(py_obj);
122 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
123 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
127 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
131 static PyGetSetDef py_samr_SamEntry_getsetters[] = {
132 { discard_const_p(char, "idx"), py_samr_SamEntry_get_idx, py_samr_SamEntry_set_idx },
133 { discard_const_p(char, "name"), py_samr_SamEntry_get_name, py_samr_SamEntry_set_name },
137 static PyObject *py_samr_SamEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
139 return pytalloc_new(struct samr_SamEntry, type);
143 static PyTypeObject samr_SamEntry_Type = {
144 PyObject_HEAD_INIT(NULL) 0,
145 .tp_name = "samr.SamEntry",
146 .tp_getset = py_samr_SamEntry_getsetters,
148 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
149 .tp_basicsize = sizeof(pytalloc_Object),
150 .tp_new = py_samr_SamEntry_new,
154 static PyObject *py_samr_SamArray_get_count(PyObject *obj, void *closure)
156 struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj);
158 py_count = PyInt_FromLong(object->count);
162 static int py_samr_SamArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
164 struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj);
165 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
166 object->count = PyInt_AsLong(value);
170 static PyObject *py_samr_SamArray_get_entries(PyObject *obj, void *closure)
172 struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj);
173 PyObject *py_entries;
174 if (object->entries == NULL) {
175 py_entries = Py_None;
176 Py_INCREF(py_entries);
178 py_entries = PyList_New(object->count);
179 if (py_entries == NULL) {
184 for (entries_cntr_1 = 0; entries_cntr_1 < object->count; entries_cntr_1++) {
185 PyObject *py_entries_1;
186 py_entries_1 = pytalloc_reference_ex(&samr_SamEntry_Type, object->entries, &object->entries[entries_cntr_1]);
187 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
194 static int py_samr_SamArray_set_entries(PyObject *py_obj, PyObject *value, void *closure)
196 struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(py_obj);
197 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->entries);
198 if (value == Py_None) {
199 object->entries = NULL;
201 object->entries = NULL;
202 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
205 object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
206 if (!object->entries) { return -1;; }
207 talloc_set_name_const(object->entries, "ARRAY: object->entries");
208 for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
209 PY_CHECK_TYPE(&samr_SamEntry_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
210 if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
214 object->entries[entries_cntr_1] = *(struct samr_SamEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
221 static PyGetSetDef py_samr_SamArray_getsetters[] = {
222 { discard_const_p(char, "count"), py_samr_SamArray_get_count, py_samr_SamArray_set_count },
223 { discard_const_p(char, "entries"), py_samr_SamArray_get_entries, py_samr_SamArray_set_entries },
227 static PyObject *py_samr_SamArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
229 return pytalloc_new(struct samr_SamArray, type);
233 static PyTypeObject samr_SamArray_Type = {
234 PyObject_HEAD_INIT(NULL) 0,
235 .tp_name = "samr.SamArray",
236 .tp_getset = py_samr_SamArray_getsetters,
238 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
239 .tp_basicsize = sizeof(pytalloc_Object),
240 .tp_new = py_samr_SamArray_new,
244 static PyObject *py_samr_DomInfo1_get_min_password_length(PyObject *obj, void *closure)
246 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
247 PyObject *py_min_password_length;
248 py_min_password_length = PyInt_FromLong(object->min_password_length);
249 return py_min_password_length;
252 static int py_samr_DomInfo1_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
254 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
255 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
256 object->min_password_length = PyInt_AsLong(value);
260 static PyObject *py_samr_DomInfo1_get_password_history_length(PyObject *obj, void *closure)
262 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
263 PyObject *py_password_history_length;
264 py_password_history_length = PyInt_FromLong(object->password_history_length);
265 return py_password_history_length;
268 static int py_samr_DomInfo1_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure)
270 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
271 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
272 object->password_history_length = PyInt_AsLong(value);
276 static PyObject *py_samr_DomInfo1_get_password_properties(PyObject *obj, void *closure)
278 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
279 PyObject *py_password_properties;
280 py_password_properties = PyInt_FromLong(object->password_properties);
281 return py_password_properties;
284 static int py_samr_DomInfo1_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
286 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
287 if (PyLong_Check(value)) {
288 object->password_properties = PyLong_AsLongLong(value);
289 } else if (PyInt_Check(value)) {
290 object->password_properties = PyInt_AsLong(value);
292 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
293 PyInt_Type.tp_name, PyLong_Type.tp_name);
299 static PyObject *py_samr_DomInfo1_get_max_password_age(PyObject *obj, void *closure)
301 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
302 PyObject *py_max_password_age;
303 py_max_password_age = PyLong_FromLongLong(object->max_password_age);
304 return py_max_password_age;
307 static int py_samr_DomInfo1_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure)
309 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
310 if (PyLong_Check(value)) {
311 object->max_password_age = PyLong_AsLongLong(value);
312 } else if (PyInt_Check(value)) {
313 object->max_password_age = PyInt_AsLong(value);
315 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
316 PyInt_Type.tp_name, PyLong_Type.tp_name);
322 static PyObject *py_samr_DomInfo1_get_min_password_age(PyObject *obj, void *closure)
324 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(obj);
325 PyObject *py_min_password_age;
326 py_min_password_age = PyLong_FromLongLong(object->min_password_age);
327 return py_min_password_age;
330 static int py_samr_DomInfo1_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure)
332 struct samr_DomInfo1 *object = (struct samr_DomInfo1 *)pytalloc_get_ptr(py_obj);
333 if (PyLong_Check(value)) {
334 object->min_password_age = PyLong_AsLongLong(value);
335 } else if (PyInt_Check(value)) {
336 object->min_password_age = PyInt_AsLong(value);
338 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
339 PyInt_Type.tp_name, PyLong_Type.tp_name);
345 static PyGetSetDef py_samr_DomInfo1_getsetters[] = {
346 { discard_const_p(char, "min_password_length"), py_samr_DomInfo1_get_min_password_length, py_samr_DomInfo1_set_min_password_length },
347 { discard_const_p(char, "password_history_length"), py_samr_DomInfo1_get_password_history_length, py_samr_DomInfo1_set_password_history_length },
348 { discard_const_p(char, "password_properties"), py_samr_DomInfo1_get_password_properties, py_samr_DomInfo1_set_password_properties },
349 { discard_const_p(char, "max_password_age"), py_samr_DomInfo1_get_max_password_age, py_samr_DomInfo1_set_max_password_age },
350 { discard_const_p(char, "min_password_age"), py_samr_DomInfo1_get_min_password_age, py_samr_DomInfo1_set_min_password_age },
354 static PyObject *py_samr_DomInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
356 return pytalloc_new(struct samr_DomInfo1, type);
360 static PyTypeObject samr_DomInfo1_Type = {
361 PyObject_HEAD_INIT(NULL) 0,
362 .tp_name = "samr.DomInfo1",
363 .tp_getset = py_samr_DomInfo1_getsetters,
365 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
366 .tp_basicsize = sizeof(pytalloc_Object),
367 .tp_new = py_samr_DomInfo1_new,
371 static PyObject *py_samr_DomGeneralInformation_get_force_logoff_time(PyObject *obj, void *closure)
373 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
374 PyObject *py_force_logoff_time;
375 py_force_logoff_time = PyLong_FromLongLong(object->force_logoff_time);
376 return py_force_logoff_time;
379 static int py_samr_DomGeneralInformation_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
381 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
382 if (PyLong_Check(value)) {
383 object->force_logoff_time = PyLong_AsLongLong(value);
384 } else if (PyInt_Check(value)) {
385 object->force_logoff_time = PyInt_AsLong(value);
387 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
388 PyInt_Type.tp_name, PyLong_Type.tp_name);
394 static PyObject *py_samr_DomGeneralInformation_get_oem_information(PyObject *obj, void *closure)
396 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
397 PyObject *py_oem_information;
398 py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information);
399 return py_oem_information;
402 static int py_samr_DomGeneralInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
404 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
405 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
406 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
410 object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
414 static PyObject *py_samr_DomGeneralInformation_get_domain_name(PyObject *obj, void *closure)
416 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
417 PyObject *py_domain_name;
418 py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
419 return py_domain_name;
422 static int py_samr_DomGeneralInformation_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
424 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
425 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
426 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
430 object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
434 static PyObject *py_samr_DomGeneralInformation_get_primary(PyObject *obj, void *closure)
436 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
437 PyObject *py_primary;
438 py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary);
442 static int py_samr_DomGeneralInformation_set_primary(PyObject *py_obj, PyObject *value, void *closure)
444 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
445 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
446 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
450 object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
454 static PyObject *py_samr_DomGeneralInformation_get_sequence_num(PyObject *obj, void *closure)
456 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
457 PyObject *py_sequence_num;
458 py_sequence_num = PyLong_FromLongLong(object->sequence_num);
459 return py_sequence_num;
462 static int py_samr_DomGeneralInformation_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
464 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
465 if (PyLong_Check(value)) {
466 object->sequence_num = PyLong_AsLongLong(value);
467 } else if (PyInt_Check(value)) {
468 object->sequence_num = PyInt_AsLong(value);
470 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
471 PyInt_Type.tp_name, PyLong_Type.tp_name);
477 static PyObject *py_samr_DomGeneralInformation_get_domain_server_state(PyObject *obj, void *closure)
479 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
480 PyObject *py_domain_server_state;
481 py_domain_server_state = PyInt_FromLong(object->domain_server_state);
482 return py_domain_server_state;
485 static int py_samr_DomGeneralInformation_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
487 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
488 if (PyLong_Check(value)) {
489 object->domain_server_state = PyLong_AsLongLong(value);
490 } else if (PyInt_Check(value)) {
491 object->domain_server_state = PyInt_AsLong(value);
493 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
494 PyInt_Type.tp_name, PyLong_Type.tp_name);
500 static PyObject *py_samr_DomGeneralInformation_get_role(PyObject *obj, void *closure)
502 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
504 py_role = PyInt_FromLong(object->role);
508 static int py_samr_DomGeneralInformation_set_role(PyObject *py_obj, PyObject *value, void *closure)
510 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
511 if (PyLong_Check(value)) {
512 object->role = PyLong_AsLongLong(value);
513 } else if (PyInt_Check(value)) {
514 object->role = PyInt_AsLong(value);
516 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
517 PyInt_Type.tp_name, PyLong_Type.tp_name);
523 static PyObject *py_samr_DomGeneralInformation_get_unknown3(PyObject *obj, void *closure)
525 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
526 PyObject *py_unknown3;
527 py_unknown3 = PyInt_FromLong(object->unknown3);
531 static int py_samr_DomGeneralInformation_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
533 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
534 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
535 object->unknown3 = PyInt_AsLong(value);
539 static PyObject *py_samr_DomGeneralInformation_get_num_users(PyObject *obj, void *closure)
541 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
542 PyObject *py_num_users;
543 py_num_users = PyInt_FromLong(object->num_users);
547 static int py_samr_DomGeneralInformation_set_num_users(PyObject *py_obj, PyObject *value, void *closure)
549 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
550 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
551 object->num_users = PyInt_AsLong(value);
555 static PyObject *py_samr_DomGeneralInformation_get_num_groups(PyObject *obj, void *closure)
557 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
558 PyObject *py_num_groups;
559 py_num_groups = PyInt_FromLong(object->num_groups);
560 return py_num_groups;
563 static int py_samr_DomGeneralInformation_set_num_groups(PyObject *py_obj, PyObject *value, void *closure)
565 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
566 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
567 object->num_groups = PyInt_AsLong(value);
571 static PyObject *py_samr_DomGeneralInformation_get_num_aliases(PyObject *obj, void *closure)
573 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
574 PyObject *py_num_aliases;
575 py_num_aliases = PyInt_FromLong(object->num_aliases);
576 return py_num_aliases;
579 static int py_samr_DomGeneralInformation_set_num_aliases(PyObject *py_obj, PyObject *value, void *closure)
581 struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(py_obj);
582 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
583 object->num_aliases = PyInt_AsLong(value);
587 static PyGetSetDef py_samr_DomGeneralInformation_getsetters[] = {
588 { discard_const_p(char, "force_logoff_time"), py_samr_DomGeneralInformation_get_force_logoff_time, py_samr_DomGeneralInformation_set_force_logoff_time },
589 { discard_const_p(char, "oem_information"), py_samr_DomGeneralInformation_get_oem_information, py_samr_DomGeneralInformation_set_oem_information },
590 { discard_const_p(char, "domain_name"), py_samr_DomGeneralInformation_get_domain_name, py_samr_DomGeneralInformation_set_domain_name },
591 { discard_const_p(char, "primary"), py_samr_DomGeneralInformation_get_primary, py_samr_DomGeneralInformation_set_primary },
592 { discard_const_p(char, "sequence_num"), py_samr_DomGeneralInformation_get_sequence_num, py_samr_DomGeneralInformation_set_sequence_num },
593 { discard_const_p(char, "domain_server_state"), py_samr_DomGeneralInformation_get_domain_server_state, py_samr_DomGeneralInformation_set_domain_server_state },
594 { discard_const_p(char, "role"), py_samr_DomGeneralInformation_get_role, py_samr_DomGeneralInformation_set_role },
595 { discard_const_p(char, "unknown3"), py_samr_DomGeneralInformation_get_unknown3, py_samr_DomGeneralInformation_set_unknown3 },
596 { discard_const_p(char, "num_users"), py_samr_DomGeneralInformation_get_num_users, py_samr_DomGeneralInformation_set_num_users },
597 { discard_const_p(char, "num_groups"), py_samr_DomGeneralInformation_get_num_groups, py_samr_DomGeneralInformation_set_num_groups },
598 { discard_const_p(char, "num_aliases"), py_samr_DomGeneralInformation_get_num_aliases, py_samr_DomGeneralInformation_set_num_aliases },
602 static PyObject *py_samr_DomGeneralInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
604 return pytalloc_new(struct samr_DomGeneralInformation, type);
608 static PyTypeObject samr_DomGeneralInformation_Type = {
609 PyObject_HEAD_INIT(NULL) 0,
610 .tp_name = "samr.DomGeneralInformation",
611 .tp_getset = py_samr_DomGeneralInformation_getsetters,
613 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
614 .tp_basicsize = sizeof(pytalloc_Object),
615 .tp_new = py_samr_DomGeneralInformation_new,
619 static PyObject *py_samr_DomInfo3_get_force_logoff_time(PyObject *obj, void *closure)
621 struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(obj);
622 PyObject *py_force_logoff_time;
623 py_force_logoff_time = PyLong_FromLongLong(object->force_logoff_time);
624 return py_force_logoff_time;
627 static int py_samr_DomInfo3_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
629 struct samr_DomInfo3 *object = (struct samr_DomInfo3 *)pytalloc_get_ptr(py_obj);
630 if (PyLong_Check(value)) {
631 object->force_logoff_time = PyLong_AsLongLong(value);
632 } else if (PyInt_Check(value)) {
633 object->force_logoff_time = PyInt_AsLong(value);
635 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
636 PyInt_Type.tp_name, PyLong_Type.tp_name);
642 static PyGetSetDef py_samr_DomInfo3_getsetters[] = {
643 { discard_const_p(char, "force_logoff_time"), py_samr_DomInfo3_get_force_logoff_time, py_samr_DomInfo3_set_force_logoff_time },
647 static PyObject *py_samr_DomInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
649 return pytalloc_new(struct samr_DomInfo3, type);
653 static PyTypeObject samr_DomInfo3_Type = {
654 PyObject_HEAD_INIT(NULL) 0,
655 .tp_name = "samr.DomInfo3",
656 .tp_getset = py_samr_DomInfo3_getsetters,
658 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
659 .tp_basicsize = sizeof(pytalloc_Object),
660 .tp_new = py_samr_DomInfo3_new,
664 static PyObject *py_samr_DomOEMInformation_get_oem_information(PyObject *obj, void *closure)
666 struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(obj);
667 PyObject *py_oem_information;
668 py_oem_information = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->oem_information);
669 return py_oem_information;
672 static int py_samr_DomOEMInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
674 struct samr_DomOEMInformation *object = (struct samr_DomOEMInformation *)pytalloc_get_ptr(py_obj);
675 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
676 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
680 object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
684 static PyGetSetDef py_samr_DomOEMInformation_getsetters[] = {
685 { discard_const_p(char, "oem_information"), py_samr_DomOEMInformation_get_oem_information, py_samr_DomOEMInformation_set_oem_information },
689 static PyObject *py_samr_DomOEMInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
691 return pytalloc_new(struct samr_DomOEMInformation, type);
695 static PyTypeObject samr_DomOEMInformation_Type = {
696 PyObject_HEAD_INIT(NULL) 0,
697 .tp_name = "samr.DomOEMInformation",
698 .tp_getset = py_samr_DomOEMInformation_getsetters,
700 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
701 .tp_basicsize = sizeof(pytalloc_Object),
702 .tp_new = py_samr_DomOEMInformation_new,
706 static PyObject *py_samr_DomInfo5_get_domain_name(PyObject *obj, void *closure)
708 struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(obj);
709 PyObject *py_domain_name;
710 py_domain_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->domain_name);
711 return py_domain_name;
714 static int py_samr_DomInfo5_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
716 struct samr_DomInfo5 *object = (struct samr_DomInfo5 *)pytalloc_get_ptr(py_obj);
717 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
718 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
722 object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
726 static PyGetSetDef py_samr_DomInfo5_getsetters[] = {
727 { discard_const_p(char, "domain_name"), py_samr_DomInfo5_get_domain_name, py_samr_DomInfo5_set_domain_name },
731 static PyObject *py_samr_DomInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
733 return pytalloc_new(struct samr_DomInfo5, type);
737 static PyTypeObject samr_DomInfo5_Type = {
738 PyObject_HEAD_INIT(NULL) 0,
739 .tp_name = "samr.DomInfo5",
740 .tp_getset = py_samr_DomInfo5_getsetters,
742 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
743 .tp_basicsize = sizeof(pytalloc_Object),
744 .tp_new = py_samr_DomInfo5_new,
748 static PyObject *py_samr_DomInfo6_get_primary(PyObject *obj, void *closure)
750 struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(obj);
751 PyObject *py_primary;
752 py_primary = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->primary);
756 static int py_samr_DomInfo6_set_primary(PyObject *py_obj, PyObject *value, void *closure)
758 struct samr_DomInfo6 *object = (struct samr_DomInfo6 *)pytalloc_get_ptr(py_obj);
759 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
760 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
764 object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
768 static PyGetSetDef py_samr_DomInfo6_getsetters[] = {
769 { discard_const_p(char, "primary"), py_samr_DomInfo6_get_primary, py_samr_DomInfo6_set_primary },
773 static PyObject *py_samr_DomInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
775 return pytalloc_new(struct samr_DomInfo6, type);
779 static PyTypeObject samr_DomInfo6_Type = {
780 PyObject_HEAD_INIT(NULL) 0,
781 .tp_name = "samr.DomInfo6",
782 .tp_getset = py_samr_DomInfo6_getsetters,
784 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
785 .tp_basicsize = sizeof(pytalloc_Object),
786 .tp_new = py_samr_DomInfo6_new,
790 static PyObject *py_samr_DomInfo7_get_role(PyObject *obj, void *closure)
792 struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(obj);
794 py_role = PyInt_FromLong(object->role);
798 static int py_samr_DomInfo7_set_role(PyObject *py_obj, PyObject *value, void *closure)
800 struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(py_obj);
801 if (PyLong_Check(value)) {
802 object->role = PyLong_AsLongLong(value);
803 } else if (PyInt_Check(value)) {
804 object->role = PyInt_AsLong(value);
806 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
807 PyInt_Type.tp_name, PyLong_Type.tp_name);
813 static PyGetSetDef py_samr_DomInfo7_getsetters[] = {
814 { discard_const_p(char, "role"), py_samr_DomInfo7_get_role, py_samr_DomInfo7_set_role },
818 static PyObject *py_samr_DomInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
820 return pytalloc_new(struct samr_DomInfo7, type);
824 static PyTypeObject samr_DomInfo7_Type = {
825 PyObject_HEAD_INIT(NULL) 0,
826 .tp_name = "samr.DomInfo7",
827 .tp_getset = py_samr_DomInfo7_getsetters,
829 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
830 .tp_basicsize = sizeof(pytalloc_Object),
831 .tp_new = py_samr_DomInfo7_new,
835 static PyObject *py_samr_DomInfo8_get_sequence_num(PyObject *obj, void *closure)
837 struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj);
838 PyObject *py_sequence_num;
839 py_sequence_num = PyLong_FromLongLong(object->sequence_num);
840 return py_sequence_num;
843 static int py_samr_DomInfo8_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
845 struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj);
846 if (PyLong_Check(value)) {
847 object->sequence_num = PyLong_AsLongLong(value);
848 } else if (PyInt_Check(value)) {
849 object->sequence_num = PyInt_AsLong(value);
851 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
852 PyInt_Type.tp_name, PyLong_Type.tp_name);
858 static PyObject *py_samr_DomInfo8_get_domain_create_time(PyObject *obj, void *closure)
860 struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(obj);
861 PyObject *py_domain_create_time;
862 py_domain_create_time = PyLong_FromLongLong(object->domain_create_time);
863 return py_domain_create_time;
866 static int py_samr_DomInfo8_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
868 struct samr_DomInfo8 *object = (struct samr_DomInfo8 *)pytalloc_get_ptr(py_obj);
869 if (PyLong_Check(value)) {
870 object->domain_create_time = PyLong_AsLongLong(value);
871 } else if (PyInt_Check(value)) {
872 object->domain_create_time = PyInt_AsLong(value);
874 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
875 PyInt_Type.tp_name, PyLong_Type.tp_name);
881 static PyGetSetDef py_samr_DomInfo8_getsetters[] = {
882 { discard_const_p(char, "sequence_num"), py_samr_DomInfo8_get_sequence_num, py_samr_DomInfo8_set_sequence_num },
883 { discard_const_p(char, "domain_create_time"), py_samr_DomInfo8_get_domain_create_time, py_samr_DomInfo8_set_domain_create_time },
887 static PyObject *py_samr_DomInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
889 return pytalloc_new(struct samr_DomInfo8, type);
893 static PyTypeObject samr_DomInfo8_Type = {
894 PyObject_HEAD_INIT(NULL) 0,
895 .tp_name = "samr.DomInfo8",
896 .tp_getset = py_samr_DomInfo8_getsetters,
898 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
899 .tp_basicsize = sizeof(pytalloc_Object),
900 .tp_new = py_samr_DomInfo8_new,
904 static PyObject *py_samr_DomInfo9_get_domain_server_state(PyObject *obj, void *closure)
906 struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(obj);
907 PyObject *py_domain_server_state;
908 py_domain_server_state = PyInt_FromLong(object->domain_server_state);
909 return py_domain_server_state;
912 static int py_samr_DomInfo9_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
914 struct samr_DomInfo9 *object = (struct samr_DomInfo9 *)pytalloc_get_ptr(py_obj);
915 if (PyLong_Check(value)) {
916 object->domain_server_state = PyLong_AsLongLong(value);
917 } else if (PyInt_Check(value)) {
918 object->domain_server_state = PyInt_AsLong(value);
920 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
921 PyInt_Type.tp_name, PyLong_Type.tp_name);
927 static PyGetSetDef py_samr_DomInfo9_getsetters[] = {
928 { discard_const_p(char, "domain_server_state"), py_samr_DomInfo9_get_domain_server_state, py_samr_DomInfo9_set_domain_server_state },
932 static PyObject *py_samr_DomInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
934 return pytalloc_new(struct samr_DomInfo9, type);
938 static PyTypeObject samr_DomInfo9_Type = {
939 PyObject_HEAD_INIT(NULL) 0,
940 .tp_name = "samr.DomInfo9",
941 .tp_getset = py_samr_DomInfo9_getsetters,
943 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
944 .tp_basicsize = sizeof(pytalloc_Object),
945 .tp_new = py_samr_DomInfo9_new,
949 static PyObject *py_samr_DomGeneralInformation2_get_general(PyObject *obj, void *closure)
951 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
952 PyObject *py_general;
953 py_general = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, pytalloc_get_mem_ctx(obj), &object->general);
957 static int py_samr_DomGeneralInformation2_set_general(PyObject *py_obj, PyObject *value, void *closure)
959 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
960 PY_CHECK_TYPE(&samr_DomGeneralInformation_Type, value, return -1;);
961 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
965 object->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(value);
969 static PyObject *py_samr_DomGeneralInformation2_get_lockout_duration(PyObject *obj, void *closure)
971 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
972 PyObject *py_lockout_duration;
973 py_lockout_duration = PyLong_FromLongLong(object->lockout_duration);
974 return py_lockout_duration;
977 static int py_samr_DomGeneralInformation2_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
979 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
980 if (PyLong_Check(value)) {
981 object->lockout_duration = PyLong_AsLongLong(value);
982 } else if (PyInt_Check(value)) {
983 object->lockout_duration = PyInt_AsLong(value);
985 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
986 PyInt_Type.tp_name, PyLong_Type.tp_name);
992 static PyObject *py_samr_DomGeneralInformation2_get_lockout_window(PyObject *obj, void *closure)
994 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
995 PyObject *py_lockout_window;
996 py_lockout_window = PyLong_FromLongLong(object->lockout_window);
997 return py_lockout_window;
1000 static int py_samr_DomGeneralInformation2_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1002 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1003 if (PyLong_Check(value)) {
1004 object->lockout_window = PyLong_AsLongLong(value);
1005 } else if (PyInt_Check(value)) {
1006 object->lockout_window = PyInt_AsLong(value);
1008 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1009 PyInt_Type.tp_name, PyLong_Type.tp_name);
1015 static PyObject *py_samr_DomGeneralInformation2_get_lockout_threshold(PyObject *obj, void *closure)
1017 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(obj);
1018 PyObject *py_lockout_threshold;
1019 py_lockout_threshold = PyInt_FromLong(object->lockout_threshold);
1020 return py_lockout_threshold;
1023 static int py_samr_DomGeneralInformation2_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1025 struct samr_DomGeneralInformation2 *object = (struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(py_obj);
1026 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1027 object->lockout_threshold = PyInt_AsLong(value);
1031 static PyGetSetDef py_samr_DomGeneralInformation2_getsetters[] = {
1032 { discard_const_p(char, "general"), py_samr_DomGeneralInformation2_get_general, py_samr_DomGeneralInformation2_set_general },
1033 { discard_const_p(char, "lockout_duration"), py_samr_DomGeneralInformation2_get_lockout_duration, py_samr_DomGeneralInformation2_set_lockout_duration },
1034 { discard_const_p(char, "lockout_window"), py_samr_DomGeneralInformation2_get_lockout_window, py_samr_DomGeneralInformation2_set_lockout_window },
1035 { discard_const_p(char, "lockout_threshold"), py_samr_DomGeneralInformation2_get_lockout_threshold, py_samr_DomGeneralInformation2_set_lockout_threshold },
1039 static PyObject *py_samr_DomGeneralInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1041 return pytalloc_new(struct samr_DomGeneralInformation2, type);
1045 static PyTypeObject samr_DomGeneralInformation2_Type = {
1046 PyObject_HEAD_INIT(NULL) 0,
1047 .tp_name = "samr.DomGeneralInformation2",
1048 .tp_getset = py_samr_DomGeneralInformation2_getsetters,
1050 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1051 .tp_basicsize = sizeof(pytalloc_Object),
1052 .tp_new = py_samr_DomGeneralInformation2_new,
1056 static PyObject *py_samr_DomInfo12_get_lockout_duration(PyObject *obj, void *closure)
1058 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1059 PyObject *py_lockout_duration;
1060 py_lockout_duration = PyLong_FromLongLong(object->lockout_duration);
1061 return py_lockout_duration;
1064 static int py_samr_DomInfo12_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
1066 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1067 if (PyLong_Check(value)) {
1068 object->lockout_duration = PyLong_AsLongLong(value);
1069 } else if (PyInt_Check(value)) {
1070 object->lockout_duration = PyInt_AsLong(value);
1072 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1073 PyInt_Type.tp_name, PyLong_Type.tp_name);
1079 static PyObject *py_samr_DomInfo12_get_lockout_window(PyObject *obj, void *closure)
1081 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1082 PyObject *py_lockout_window;
1083 py_lockout_window = PyLong_FromLongLong(object->lockout_window);
1084 return py_lockout_window;
1087 static int py_samr_DomInfo12_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1089 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1090 if (PyLong_Check(value)) {
1091 object->lockout_window = PyLong_AsLongLong(value);
1092 } else if (PyInt_Check(value)) {
1093 object->lockout_window = PyInt_AsLong(value);
1095 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1096 PyInt_Type.tp_name, PyLong_Type.tp_name);
1102 static PyObject *py_samr_DomInfo12_get_lockout_threshold(PyObject *obj, void *closure)
1104 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(obj);
1105 PyObject *py_lockout_threshold;
1106 py_lockout_threshold = PyInt_FromLong(object->lockout_threshold);
1107 return py_lockout_threshold;
1110 static int py_samr_DomInfo12_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1112 struct samr_DomInfo12 *object = (struct samr_DomInfo12 *)pytalloc_get_ptr(py_obj);
1113 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1114 object->lockout_threshold = PyInt_AsLong(value);
1118 static PyGetSetDef py_samr_DomInfo12_getsetters[] = {
1119 { discard_const_p(char, "lockout_duration"), py_samr_DomInfo12_get_lockout_duration, py_samr_DomInfo12_set_lockout_duration },
1120 { discard_const_p(char, "lockout_window"), py_samr_DomInfo12_get_lockout_window, py_samr_DomInfo12_set_lockout_window },
1121 { discard_const_p(char, "lockout_threshold"), py_samr_DomInfo12_get_lockout_threshold, py_samr_DomInfo12_set_lockout_threshold },
1125 static PyObject *py_samr_DomInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1127 return pytalloc_new(struct samr_DomInfo12, type);
1131 static PyTypeObject samr_DomInfo12_Type = {
1132 PyObject_HEAD_INIT(NULL) 0,
1133 .tp_name = "samr.DomInfo12",
1134 .tp_getset = py_samr_DomInfo12_getsetters,
1136 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1137 .tp_basicsize = sizeof(pytalloc_Object),
1138 .tp_new = py_samr_DomInfo12_new,
1142 static PyObject *py_samr_DomInfo13_get_sequence_num(PyObject *obj, void *closure)
1144 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
1145 PyObject *py_sequence_num;
1146 py_sequence_num = PyLong_FromLongLong(object->sequence_num);
1147 return py_sequence_num;
1150 static int py_samr_DomInfo13_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
1152 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
1153 if (PyLong_Check(value)) {
1154 object->sequence_num = PyLong_AsLongLong(value);
1155 } else if (PyInt_Check(value)) {
1156 object->sequence_num = PyInt_AsLong(value);
1158 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1159 PyInt_Type.tp_name, PyLong_Type.tp_name);
1165 static PyObject *py_samr_DomInfo13_get_domain_create_time(PyObject *obj, void *closure)
1167 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
1168 PyObject *py_domain_create_time;
1169 py_domain_create_time = PyLong_FromLongLong(object->domain_create_time);
1170 return py_domain_create_time;
1173 static int py_samr_DomInfo13_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
1175 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
1176 if (PyLong_Check(value)) {
1177 object->domain_create_time = PyLong_AsLongLong(value);
1178 } else if (PyInt_Check(value)) {
1179 object->domain_create_time = PyInt_AsLong(value);
1181 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1182 PyInt_Type.tp_name, PyLong_Type.tp_name);
1188 static PyObject *py_samr_DomInfo13_get_modified_count_at_last_promotion(PyObject *obj, void *closure)
1190 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(obj);
1191 PyObject *py_modified_count_at_last_promotion;
1192 py_modified_count_at_last_promotion = PyLong_FromLongLong(object->modified_count_at_last_promotion);
1193 return py_modified_count_at_last_promotion;
1196 static int py_samr_DomInfo13_set_modified_count_at_last_promotion(PyObject *py_obj, PyObject *value, void *closure)
1198 struct samr_DomInfo13 *object = (struct samr_DomInfo13 *)pytalloc_get_ptr(py_obj);
1199 if (PyLong_Check(value)) {
1200 object->modified_count_at_last_promotion = PyLong_AsLongLong(value);
1201 } else if (PyInt_Check(value)) {
1202 object->modified_count_at_last_promotion = PyInt_AsLong(value);
1204 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1205 PyInt_Type.tp_name, PyLong_Type.tp_name);
1211 static PyGetSetDef py_samr_DomInfo13_getsetters[] = {
1212 { discard_const_p(char, "sequence_num"), py_samr_DomInfo13_get_sequence_num, py_samr_DomInfo13_set_sequence_num },
1213 { discard_const_p(char, "domain_create_time"), py_samr_DomInfo13_get_domain_create_time, py_samr_DomInfo13_set_domain_create_time },
1214 { discard_const_p(char, "modified_count_at_last_promotion"), py_samr_DomInfo13_get_modified_count_at_last_promotion, py_samr_DomInfo13_set_modified_count_at_last_promotion },
1218 static PyObject *py_samr_DomInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1220 return pytalloc_new(struct samr_DomInfo13, type);
1224 static PyTypeObject samr_DomInfo13_Type = {
1225 PyObject_HEAD_INIT(NULL) 0,
1226 .tp_name = "samr.DomInfo13",
1227 .tp_getset = py_samr_DomInfo13_getsetters,
1229 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1230 .tp_basicsize = sizeof(pytalloc_Object),
1231 .tp_new = py_samr_DomInfo13_new,
1234 PyObject *py_import_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union samr_DomainInfo *in)
1240 ret = pytalloc_reference_ex(&samr_DomInfo1_Type, mem_ctx, &in->info1);
1244 ret = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, mem_ctx, &in->general);
1248 ret = pytalloc_reference_ex(&samr_DomInfo3_Type, mem_ctx, &in->info3);
1252 ret = pytalloc_reference_ex(&samr_DomOEMInformation_Type, mem_ctx, &in->oem);
1256 ret = pytalloc_reference_ex(&samr_DomInfo5_Type, mem_ctx, &in->info5);
1260 ret = pytalloc_reference_ex(&samr_DomInfo6_Type, mem_ctx, &in->info6);
1264 ret = pytalloc_reference_ex(&samr_DomInfo7_Type, mem_ctx, &in->info7);
1268 ret = pytalloc_reference_ex(&samr_DomInfo8_Type, mem_ctx, &in->info8);
1272 ret = pytalloc_reference_ex(&samr_DomInfo9_Type, mem_ctx, &in->info9);
1276 ret = pytalloc_reference_ex(&samr_DomGeneralInformation2_Type, mem_ctx, &in->general2);
1280 ret = pytalloc_reference_ex(&samr_DomInfo12_Type, mem_ctx, &in->info12);
1284 ret = pytalloc_reference_ex(&samr_DomInfo13_Type, mem_ctx, &in->info13);
1288 PyErr_SetString(PyExc_TypeError, "unknown union level");
1292 union samr_DomainInfo *py_export_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1294 union samr_DomainInfo *ret = talloc_zero(mem_ctx, union samr_DomainInfo);
1297 PY_CHECK_TYPE(&samr_DomInfo1_Type, in, talloc_free(ret); return NULL;);
1298 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1300 talloc_free(ret); return NULL;
1302 ret->info1 = *(struct samr_DomInfo1 *)pytalloc_get_ptr(in);
1306 PY_CHECK_TYPE(&samr_DomGeneralInformation_Type, in, talloc_free(ret); return NULL;);
1307 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1309 talloc_free(ret); return NULL;
1311 ret->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(in);
1315 PY_CHECK_TYPE(&samr_DomInfo3_Type, in, talloc_free(ret); return NULL;);
1316 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1318 talloc_free(ret); return NULL;
1320 ret->info3 = *(struct samr_DomInfo3 *)pytalloc_get_ptr(in);
1324 PY_CHECK_TYPE(&samr_DomOEMInformation_Type, in, talloc_free(ret); return NULL;);
1325 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1327 talloc_free(ret); return NULL;
1329 ret->oem = *(struct samr_DomOEMInformation *)pytalloc_get_ptr(in);
1333 PY_CHECK_TYPE(&samr_DomInfo5_Type, in, talloc_free(ret); return NULL;);
1334 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1336 talloc_free(ret); return NULL;
1338 ret->info5 = *(struct samr_DomInfo5 *)pytalloc_get_ptr(in);
1342 PY_CHECK_TYPE(&samr_DomInfo6_Type, in, talloc_free(ret); return NULL;);
1343 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1345 talloc_free(ret); return NULL;
1347 ret->info6 = *(struct samr_DomInfo6 *)pytalloc_get_ptr(in);
1351 PY_CHECK_TYPE(&samr_DomInfo7_Type, in, talloc_free(ret); return NULL;);
1352 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1354 talloc_free(ret); return NULL;
1356 ret->info7 = *(struct samr_DomInfo7 *)pytalloc_get_ptr(in);
1360 PY_CHECK_TYPE(&samr_DomInfo8_Type, in, talloc_free(ret); return NULL;);
1361 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1363 talloc_free(ret); return NULL;
1365 ret->info8 = *(struct samr_DomInfo8 *)pytalloc_get_ptr(in);
1369 PY_CHECK_TYPE(&samr_DomInfo9_Type, in, talloc_free(ret); return NULL;);
1370 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1372 talloc_free(ret); return NULL;
1374 ret->info9 = *(struct samr_DomInfo9 *)pytalloc_get_ptr(in);
1378 PY_CHECK_TYPE(&samr_DomGeneralInformation2_Type, in, talloc_free(ret); return NULL;);
1379 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1381 talloc_free(ret); return NULL;
1383 ret->general2 = *(struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(in);
1387 PY_CHECK_TYPE(&samr_DomInfo12_Type, in, talloc_free(ret); return NULL;);
1388 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1390 talloc_free(ret); return NULL;
1392 ret->info12 = *(struct samr_DomInfo12 *)pytalloc_get_ptr(in);
1396 PY_CHECK_TYPE(&samr_DomInfo13_Type, in, talloc_free(ret); return NULL;);
1397 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1399 talloc_free(ret); return NULL;
1401 ret->info13 = *(struct samr_DomInfo13 *)pytalloc_get_ptr(in);
1405 PyErr_SetString(PyExc_TypeError, "invalid union level value");
1414 static PyObject *py_samr_Ids_get_count(PyObject *obj, void *closure)
1416 struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
1418 py_count = PyInt_FromLong(object->count);
1422 static int py_samr_Ids_set_count(PyObject *py_obj, PyObject *value, void *closure)
1424 struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj);
1425 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1426 object->count = PyInt_AsLong(value);
1430 static PyObject *py_samr_Ids_get_ids(PyObject *obj, void *closure)
1432 struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
1434 if (object->ids == NULL) {
1438 py_ids = PyList_New(object->count);
1439 if (py_ids == NULL) {
1444 for (ids_cntr_1 = 0; ids_cntr_1 < object->count; ids_cntr_1++) {
1446 py_ids_1 = PyInt_FromLong(object->ids[ids_cntr_1]);
1447 PyList_SetItem(py_ids, ids_cntr_1, py_ids_1);
1454 static int py_samr_Ids_set_ids(PyObject *py_obj, PyObject *value, void *closure)
1456 struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(py_obj);
1457 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->ids);
1458 if (value == Py_None) {
1462 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1465 object->ids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->ids, PyList_GET_SIZE(value));
1466 if (!object->ids) { return -1;; }
1467 talloc_set_name_const(object->ids, "ARRAY: object->ids");
1468 for (ids_cntr_1 = 0; ids_cntr_1 < PyList_GET_SIZE(value); ids_cntr_1++) {
1469 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, ids_cntr_1), return -1;);
1470 object->ids[ids_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, ids_cntr_1));
1477 static PyGetSetDef py_samr_Ids_getsetters[] = {
1478 { discard_const_p(char, "count"), py_samr_Ids_get_count, py_samr_Ids_set_count },
1479 { discard_const_p(char, "ids"), py_samr_Ids_get_ids, py_samr_Ids_set_ids },
1483 static PyObject *py_samr_Ids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1485 return pytalloc_new(struct samr_Ids, type);
1489 static PyTypeObject samr_Ids_Type = {
1490 PyObject_HEAD_INIT(NULL) 0,
1491 .tp_name = "samr.Ids",
1492 .tp_getset = py_samr_Ids_getsetters,
1494 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1495 .tp_basicsize = sizeof(pytalloc_Object),
1496 .tp_new = py_samr_Ids_new,
1500 static PyObject *py_samr_GroupInfoAll_get_name(PyObject *obj, void *closure)
1502 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
1504 py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
1508 static int py_samr_GroupInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
1510 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
1511 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1512 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1516 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
1520 static PyObject *py_samr_GroupInfoAll_get_attributes(PyObject *obj, void *closure)
1522 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
1523 PyObject *py_attributes;
1524 py_attributes = PyInt_FromLong(object->attributes);
1525 return py_attributes;
1528 static int py_samr_GroupInfoAll_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1530 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
1531 if (PyLong_Check(value)) {
1532 object->attributes = PyLong_AsLongLong(value);
1533 } else if (PyInt_Check(value)) {
1534 object->attributes = PyInt_AsLong(value);
1536 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1537 PyInt_Type.tp_name, PyLong_Type.tp_name);
1543 static PyObject *py_samr_GroupInfoAll_get_num_members(PyObject *obj, void *closure)
1545 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
1546 PyObject *py_num_members;
1547 py_num_members = PyInt_FromLong(object->num_members);
1548 return py_num_members;
1551 static int py_samr_GroupInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
1553 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
1554 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1555 object->num_members = PyInt_AsLong(value);
1559 static PyObject *py_samr_GroupInfoAll_get_description(PyObject *obj, void *closure)
1561 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
1562 PyObject *py_description;
1563 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
1564 return py_description;
1567 static int py_samr_GroupInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
1569 struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(py_obj);
1570 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1571 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1575 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1579 static PyGetSetDef py_samr_GroupInfoAll_getsetters[] = {
1580 { discard_const_p(char, "name"), py_samr_GroupInfoAll_get_name, py_samr_GroupInfoAll_set_name },
1581 { discard_const_p(char, "attributes"), py_samr_GroupInfoAll_get_attributes, py_samr_GroupInfoAll_set_attributes },
1582 { discard_const_p(char, "num_members"), py_samr_GroupInfoAll_get_num_members, py_samr_GroupInfoAll_set_num_members },
1583 { discard_const_p(char, "description"), py_samr_GroupInfoAll_get_description, py_samr_GroupInfoAll_set_description },
1587 static PyObject *py_samr_GroupInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1589 return pytalloc_new(struct samr_GroupInfoAll, type);
1593 static PyTypeObject samr_GroupInfoAll_Type = {
1594 PyObject_HEAD_INIT(NULL) 0,
1595 .tp_name = "samr.GroupInfoAll",
1596 .tp_getset = py_samr_GroupInfoAll_getsetters,
1598 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1599 .tp_basicsize = sizeof(pytalloc_Object),
1600 .tp_new = py_samr_GroupInfoAll_new,
1604 static PyObject *py_samr_GroupInfoAttributes_get_attributes(PyObject *obj, void *closure)
1606 struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(obj);
1607 PyObject *py_attributes;
1608 py_attributes = PyInt_FromLong(object->attributes);
1609 return py_attributes;
1612 static int py_samr_GroupInfoAttributes_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1614 struct samr_GroupInfoAttributes *object = (struct samr_GroupInfoAttributes *)pytalloc_get_ptr(py_obj);
1615 if (PyLong_Check(value)) {
1616 object->attributes = PyLong_AsLongLong(value);
1617 } else if (PyInt_Check(value)) {
1618 object->attributes = PyInt_AsLong(value);
1620 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1621 PyInt_Type.tp_name, PyLong_Type.tp_name);
1627 static PyGetSetDef py_samr_GroupInfoAttributes_getsetters[] = {
1628 { discard_const_p(char, "attributes"), py_samr_GroupInfoAttributes_get_attributes, py_samr_GroupInfoAttributes_set_attributes },
1632 static PyObject *py_samr_GroupInfoAttributes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1634 return pytalloc_new(struct samr_GroupInfoAttributes, type);
1638 static PyTypeObject samr_GroupInfoAttributes_Type = {
1639 PyObject_HEAD_INIT(NULL) 0,
1640 .tp_name = "samr.GroupInfoAttributes",
1641 .tp_getset = py_samr_GroupInfoAttributes_getsetters,
1643 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1644 .tp_basicsize = sizeof(pytalloc_Object),
1645 .tp_new = py_samr_GroupInfoAttributes_new,
1649 static PyObject *py_samr_GroupInfoDescription_get_description(PyObject *obj, void *closure)
1651 struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(obj);
1652 PyObject *py_description;
1653 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
1654 return py_description;
1657 static int py_samr_GroupInfoDescription_set_description(PyObject *py_obj, PyObject *value, void *closure)
1659 struct samr_GroupInfoDescription *object = (struct samr_GroupInfoDescription *)pytalloc_get_ptr(py_obj);
1660 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1661 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1665 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1669 static PyGetSetDef py_samr_GroupInfoDescription_getsetters[] = {
1670 { discard_const_p(char, "description"), py_samr_GroupInfoDescription_get_description, py_samr_GroupInfoDescription_set_description },
1674 static PyObject *py_samr_GroupInfoDescription_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1676 return pytalloc_new(struct samr_GroupInfoDescription, type);
1680 static PyTypeObject samr_GroupInfoDescription_Type = {
1681 PyObject_HEAD_INIT(NULL) 0,
1682 .tp_name = "samr.GroupInfoDescription",
1683 .tp_getset = py_samr_GroupInfoDescription_getsetters,
1685 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1686 .tp_basicsize = sizeof(pytalloc_Object),
1687 .tp_new = py_samr_GroupInfoDescription_new,
1690 PyObject *py_import_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, union samr_GroupInfo *in)
1696 ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all);
1700 ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
1703 case GROUPINFOATTRIBUTES:
1704 ret = pytalloc_reference_ex(&samr_GroupInfoAttributes_Type, mem_ctx, &in->attributes);
1707 case GROUPINFODESCRIPTION:
1708 ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
1712 ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all2);
1716 PyErr_SetString(PyExc_TypeError, "unknown union level");
1720 union samr_GroupInfo *py_export_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1722 union samr_GroupInfo *ret = talloc_zero(mem_ctx, union samr_GroupInfo);
1725 PY_CHECK_TYPE(&samr_GroupInfoAll_Type, in, talloc_free(ret); return NULL;);
1726 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1728 talloc_free(ret); return NULL;
1730 ret->all = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
1734 PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
1735 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1737 talloc_free(ret); return NULL;
1739 ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
1742 case GROUPINFOATTRIBUTES:
1743 PY_CHECK_TYPE(&samr_GroupInfoAttributes_Type, in, talloc_free(ret); return NULL;);
1744 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1746 talloc_free(ret); return NULL;
1748 ret->attributes = *(struct samr_GroupInfoAttributes *)pytalloc_get_ptr(in);
1751 case GROUPINFODESCRIPTION:
1752 PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
1753 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1755 talloc_free(ret); return NULL;
1757 ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
1761 PY_CHECK_TYPE(&samr_GroupInfoAll_Type, in, talloc_free(ret); return NULL;);
1762 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
1764 talloc_free(ret); return NULL;
1766 ret->all2 = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
1770 PyErr_SetString(PyExc_TypeError, "invalid union level value");
1779 static PyObject *py_samr_RidAttrArray_get_count(PyObject *obj, void *closure)
1781 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
1783 py_count = PyInt_FromLong(object->count);
1787 static int py_samr_RidAttrArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1789 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
1790 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1791 object->count = PyInt_AsLong(value);
1795 static PyObject *py_samr_RidAttrArray_get_rids(PyObject *obj, void *closure)
1797 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
1799 if (object->rids == NULL) {
1803 py_rids = PyList_New(object->count);
1804 if (py_rids == NULL) {
1809 for (rids_cntr_1 = 0; rids_cntr_1 < object->count; rids_cntr_1++) {
1810 PyObject *py_rids_1;
1811 py_rids_1 = PyInt_FromLong(object->rids[rids_cntr_1]);
1812 PyList_SetItem(py_rids, rids_cntr_1, py_rids_1);
1819 static int py_samr_RidAttrArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
1821 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
1822 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->rids);
1823 if (value == Py_None) {
1824 object->rids = NULL;
1826 object->rids = NULL;
1827 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1830 object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
1831 if (!object->rids) { return -1;; }
1832 talloc_set_name_const(object->rids, "ARRAY: object->rids");
1833 for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) {
1834 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, rids_cntr_1), return -1;);
1835 object->rids[rids_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, rids_cntr_1));
1842 static PyObject *py_samr_RidAttrArray_get_attributes(PyObject *obj, void *closure)
1844 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
1845 PyObject *py_attributes;
1846 if (object->attributes == NULL) {
1847 py_attributes = Py_None;
1848 Py_INCREF(py_attributes);
1850 py_attributes = PyList_New(object->count);
1851 if (py_attributes == NULL) {
1855 int attributes_cntr_1;
1856 for (attributes_cntr_1 = 0; attributes_cntr_1 < object->count; attributes_cntr_1++) {
1857 PyObject *py_attributes_1;
1858 py_attributes_1 = PyInt_FromLong(object->attributes[attributes_cntr_1]);
1859 PyList_SetItem(py_attributes, attributes_cntr_1, py_attributes_1);
1863 return py_attributes;
1866 static int py_samr_RidAttrArray_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1868 struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(py_obj);
1869 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->attributes);
1870 if (value == Py_None) {
1871 object->attributes = NULL;
1873 object->attributes = NULL;
1874 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1876 int attributes_cntr_1;
1877 object->attributes = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->attributes, PyList_GET_SIZE(value));
1878 if (!object->attributes) { return -1;; }
1879 talloc_set_name_const(object->attributes, "ARRAY: object->attributes");
1880 for (attributes_cntr_1 = 0; attributes_cntr_1 < PyList_GET_SIZE(value); attributes_cntr_1++) {
1881 if (PyLong_Check(PyList_GET_ITEM(value, attributes_cntr_1))) {
1882 object->attributes[attributes_cntr_1] = PyLong_AsLongLong(PyList_GET_ITEM(value, attributes_cntr_1));
1883 } else if (PyInt_Check(PyList_GET_ITEM(value, attributes_cntr_1))) {
1884 object->attributes[attributes_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, attributes_cntr_1));
1886 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1887 PyInt_Type.tp_name, PyLong_Type.tp_name);
1896 static PyGetSetDef py_samr_RidAttrArray_getsetters[] = {
1897 { discard_const_p(char, "count"), py_samr_RidAttrArray_get_count, py_samr_RidAttrArray_set_count },
1898 { discard_const_p(char, "rids"), py_samr_RidAttrArray_get_rids, py_samr_RidAttrArray_set_rids },
1899 { discard_const_p(char, "attributes"), py_samr_RidAttrArray_get_attributes, py_samr_RidAttrArray_set_attributes },
1903 static PyObject *py_samr_RidAttrArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1905 return pytalloc_new(struct samr_RidAttrArray, type);
1909 static PyTypeObject samr_RidAttrArray_Type = {
1910 PyObject_HEAD_INIT(NULL) 0,
1911 .tp_name = "samr.RidAttrArray",
1912 .tp_getset = py_samr_RidAttrArray_getsetters,
1914 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1915 .tp_basicsize = sizeof(pytalloc_Object),
1916 .tp_new = py_samr_RidAttrArray_new,
1920 static PyObject *py_samr_AliasInfoAll_get_name(PyObject *obj, void *closure)
1922 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
1924 py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
1928 static int py_samr_AliasInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
1930 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
1931 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1932 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1936 object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
1940 static PyObject *py_samr_AliasInfoAll_get_num_members(PyObject *obj, void *closure)
1942 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
1943 PyObject *py_num_members;
1944 py_num_members = PyInt_FromLong(object->num_members);
1945 return py_num_members;
1948 static int py_samr_AliasInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
1950 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
1951 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
1952 object->num_members = PyInt_AsLong(value);
1956 static PyObject *py_samr_AliasInfoAll_get_description(PyObject *obj, void *closure)
1958 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
1959 PyObject *py_description;
1960 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
1961 return py_description;
1964 static int py_samr_AliasInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
1966 struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(py_obj);
1967 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
1968 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
1972 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1976 static PyGetSetDef py_samr_AliasInfoAll_getsetters[] = {
1977 { discard_const_p(char, "name"), py_samr_AliasInfoAll_get_name, py_samr_AliasInfoAll_set_name },
1978 { discard_const_p(char, "num_members"), py_samr_AliasInfoAll_get_num_members, py_samr_AliasInfoAll_set_num_members },
1979 { discard_const_p(char, "description"), py_samr_AliasInfoAll_get_description, py_samr_AliasInfoAll_set_description },
1983 static PyObject *py_samr_AliasInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1985 return pytalloc_new(struct samr_AliasInfoAll, type);
1989 static PyTypeObject samr_AliasInfoAll_Type = {
1990 PyObject_HEAD_INIT(NULL) 0,
1991 .tp_name = "samr.AliasInfoAll",
1992 .tp_getset = py_samr_AliasInfoAll_getsetters,
1994 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1995 .tp_basicsize = sizeof(pytalloc_Object),
1996 .tp_new = py_samr_AliasInfoAll_new,
1999 PyObject *py_import_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, union samr_AliasInfo *in)
2005 ret = pytalloc_reference_ex(&samr_AliasInfoAll_Type, mem_ctx, &in->all);
2009 ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
2012 case ALIASINFODESCRIPTION:
2013 ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
2017 PyErr_SetString(PyExc_TypeError, "unknown union level");
2021 union samr_AliasInfo *py_export_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2023 union samr_AliasInfo *ret = talloc_zero(mem_ctx, union samr_AliasInfo);
2026 PY_CHECK_TYPE(&samr_AliasInfoAll_Type, in, talloc_free(ret); return NULL;);
2027 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2029 talloc_free(ret); return NULL;
2031 ret->all = *(struct samr_AliasInfoAll *)pytalloc_get_ptr(in);
2035 PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
2036 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2038 talloc_free(ret); return NULL;
2040 ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
2043 case ALIASINFODESCRIPTION:
2044 PY_CHECK_TYPE(lsa_String_Type, in, talloc_free(ret); return NULL;);
2045 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
2047 talloc_free(ret); return NULL;
2049 ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
2053 PyErr_SetString(PyExc_TypeError, "invalid union level value");
2062 static PyObject *py_samr_UserInfo1_get_account_name(PyObject *obj, void *closure)
2064 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
2065 PyObject *py_account_name;
2066 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
2067 return py_account_name;
2070 static int py_samr_UserInfo1_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2072 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
2073 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2074 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2078 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2082 static PyObject *py_samr_UserInfo1_get_full_name(PyObject *obj, void *closure)
2084 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
2085 PyObject *py_full_name;
2086 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
2087 return py_full_name;
2090 static int py_samr_UserInfo1_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2092 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
2093 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2094 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2098 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2102 static PyObject *py_samr_UserInfo1_get_primary_gid(PyObject *obj, void *closure)
2104 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
2105 PyObject *py_primary_gid;
2106 py_primary_gid = PyInt_FromLong(object->primary_gid);
2107 return py_primary_gid;
2110 static int py_samr_UserInfo1_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2112 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
2113 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2114 object->primary_gid = PyInt_AsLong(value);
2118 static PyObject *py_samr_UserInfo1_get_description(PyObject *obj, void *closure)
2120 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
2121 PyObject *py_description;
2122 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
2123 return py_description;
2126 static int py_samr_UserInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure)
2128 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
2129 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2130 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2134 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
2138 static PyObject *py_samr_UserInfo1_get_comment(PyObject *obj, void *closure)
2140 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(obj);
2141 PyObject *py_comment;
2142 py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
2146 static int py_samr_UserInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
2148 struct samr_UserInfo1 *object = (struct samr_UserInfo1 *)pytalloc_get_ptr(py_obj);
2149 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2150 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2154 object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
2158 static PyGetSetDef py_samr_UserInfo1_getsetters[] = {
2159 { discard_const_p(char, "account_name"), py_samr_UserInfo1_get_account_name, py_samr_UserInfo1_set_account_name },
2160 { discard_const_p(char, "full_name"), py_samr_UserInfo1_get_full_name, py_samr_UserInfo1_set_full_name },
2161 { discard_const_p(char, "primary_gid"), py_samr_UserInfo1_get_primary_gid, py_samr_UserInfo1_set_primary_gid },
2162 { discard_const_p(char, "description"), py_samr_UserInfo1_get_description, py_samr_UserInfo1_set_description },
2163 { discard_const_p(char, "comment"), py_samr_UserInfo1_get_comment, py_samr_UserInfo1_set_comment },
2167 static PyObject *py_samr_UserInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2169 return pytalloc_new(struct samr_UserInfo1, type);
2173 static PyTypeObject samr_UserInfo1_Type = {
2174 PyObject_HEAD_INIT(NULL) 0,
2175 .tp_name = "samr.UserInfo1",
2176 .tp_getset = py_samr_UserInfo1_getsetters,
2178 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2179 .tp_basicsize = sizeof(pytalloc_Object),
2180 .tp_new = py_samr_UserInfo1_new,
2184 static PyObject *py_samr_UserInfo2_get_comment(PyObject *obj, void *closure)
2186 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
2187 PyObject *py_comment;
2188 py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
2192 static int py_samr_UserInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
2194 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
2195 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2196 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2200 object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
2204 static PyObject *py_samr_UserInfo2_get_reserved(PyObject *obj, void *closure)
2206 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
2207 PyObject *py_reserved;
2208 py_reserved = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->reserved);
2212 static int py_samr_UserInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
2214 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
2215 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2216 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2220 object->reserved = *(struct lsa_String *)pytalloc_get_ptr(value);
2224 static PyObject *py_samr_UserInfo2_get_country_code(PyObject *obj, void *closure)
2226 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
2227 PyObject *py_country_code;
2228 py_country_code = PyInt_FromLong(object->country_code);
2229 return py_country_code;
2232 static int py_samr_UserInfo2_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
2234 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
2235 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2236 object->country_code = PyInt_AsLong(value);
2240 static PyObject *py_samr_UserInfo2_get_code_page(PyObject *obj, void *closure)
2242 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(obj);
2243 PyObject *py_code_page;
2244 py_code_page = PyInt_FromLong(object->code_page);
2245 return py_code_page;
2248 static int py_samr_UserInfo2_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
2250 struct samr_UserInfo2 *object = (struct samr_UserInfo2 *)pytalloc_get_ptr(py_obj);
2251 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2252 object->code_page = PyInt_AsLong(value);
2256 static PyGetSetDef py_samr_UserInfo2_getsetters[] = {
2257 { discard_const_p(char, "comment"), py_samr_UserInfo2_get_comment, py_samr_UserInfo2_set_comment },
2258 { discard_const_p(char, "reserved"), py_samr_UserInfo2_get_reserved, py_samr_UserInfo2_set_reserved },
2259 { discard_const_p(char, "country_code"), py_samr_UserInfo2_get_country_code, py_samr_UserInfo2_set_country_code },
2260 { discard_const_p(char, "code_page"), py_samr_UserInfo2_get_code_page, py_samr_UserInfo2_set_code_page },
2264 static PyObject *py_samr_UserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2266 return pytalloc_new(struct samr_UserInfo2, type);
2270 static PyTypeObject samr_UserInfo2_Type = {
2271 PyObject_HEAD_INIT(NULL) 0,
2272 .tp_name = "samr.UserInfo2",
2273 .tp_getset = py_samr_UserInfo2_getsetters,
2275 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2276 .tp_basicsize = sizeof(pytalloc_Object),
2277 .tp_new = py_samr_UserInfo2_new,
2281 static PyObject *py_samr_LogonHours_get_units_per_week(PyObject *obj, void *closure)
2283 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj);
2284 PyObject *py_units_per_week;
2285 py_units_per_week = PyInt_FromLong(object->units_per_week);
2286 return py_units_per_week;
2289 static int py_samr_LogonHours_set_units_per_week(PyObject *py_obj, PyObject *value, void *closure)
2291 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2292 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2293 object->units_per_week = PyInt_AsLong(value);
2297 static PyObject *py_samr_LogonHours_get_bits(PyObject *obj, void *closure)
2299 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj);
2301 if (object->bits == NULL) {
2305 py_bits = PyList_New(object->units_per_week / 8);
2306 if (py_bits == NULL) {
2311 for (bits_cntr_1 = 0; bits_cntr_1 < object->units_per_week / 8; bits_cntr_1++) {
2312 PyObject *py_bits_1;
2313 py_bits_1 = PyInt_FromLong(object->bits[bits_cntr_1]);
2314 PyList_SetItem(py_bits, bits_cntr_1, py_bits_1);
2321 static int py_samr_LogonHours_set_bits(PyObject *py_obj, PyObject *value, void *closure)
2323 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2324 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->bits);
2325 if (value == Py_None) {
2326 object->bits = NULL;
2328 object->bits = NULL;
2329 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2332 object->bits = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->bits, PyList_GET_SIZE(value));
2333 if (!object->bits) { return -1;; }
2334 talloc_set_name_const(object->bits, "ARRAY: object->bits");
2335 for (bits_cntr_1 = 0; bits_cntr_1 < PyList_GET_SIZE(value); bits_cntr_1++) {
2336 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, bits_cntr_1), return -1;);
2337 object->bits[bits_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, bits_cntr_1));
2344 static PyGetSetDef py_samr_LogonHours_getsetters[] = {
2345 { discard_const_p(char, "units_per_week"), py_samr_LogonHours_get_units_per_week, py_samr_LogonHours_set_units_per_week },
2346 { discard_const_p(char, "bits"), py_samr_LogonHours_get_bits, py_samr_LogonHours_set_bits },
2350 static PyObject *py_samr_LogonHours_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2352 return pytalloc_new(struct samr_LogonHours, type);
2355 static PyObject *py_samr_LogonHours_ndr_pack(PyObject *py_obj)
2357 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2359 enum ndr_err_code err;
2360 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_samr_LogonHours);
2361 if (err != NDR_ERR_SUCCESS) {
2362 PyErr_SetNdrError(err);
2366 return PyString_FromStringAndSize((char *)blob.data, blob.length);
2369 static PyObject *py_samr_LogonHours_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2371 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2373 int blob_length = 0;
2374 enum ndr_err_code err;
2375 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
2376 PyObject *allow_remaining_obj = NULL;
2377 bool allow_remaining = false;
2379 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
2380 discard_const_p(char *, kwnames),
2381 &blob.data, &blob_length,
2382 &allow_remaining_obj)) {
2385 blob.length = blob_length;
2387 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2388 allow_remaining = true;
2391 if (allow_remaining) {
2392 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours);
2394 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours);
2396 if (err != NDR_ERR_SUCCESS) {
2397 PyErr_SetNdrError(err);
2404 static PyObject *py_samr_LogonHours_ndr_print(PyObject *py_obj)
2406 struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2410 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_LogonHours, "samr_LogonHours", object);
2411 ret = PyString_FromString(retstr);
2412 talloc_free(retstr);
2417 static PyMethodDef py_samr_LogonHours_methods[] = {
2418 { "__ndr_pack__", (PyCFunction)py_samr_LogonHours_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
2419 { "__ndr_unpack__", (PyCFunction)py_samr_LogonHours_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
2420 { "__ndr_print__", (PyCFunction)py_samr_LogonHours_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
2421 { NULL, NULL, 0, NULL }
2425 static PyTypeObject samr_LogonHours_Type = {
2426 PyObject_HEAD_INIT(NULL) 0,
2427 .tp_name = "samr.LogonHours",
2428 .tp_getset = py_samr_LogonHours_getsetters,
2429 .tp_methods = py_samr_LogonHours_methods,
2430 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2431 .tp_basicsize = sizeof(pytalloc_Object),
2432 .tp_new = py_samr_LogonHours_new,
2436 static PyObject *py_samr_UserInfo3_get_account_name(PyObject *obj, void *closure)
2438 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2439 PyObject *py_account_name;
2440 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
2441 return py_account_name;
2444 static int py_samr_UserInfo3_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2446 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2447 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2448 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2452 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2456 static PyObject *py_samr_UserInfo3_get_full_name(PyObject *obj, void *closure)
2458 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2459 PyObject *py_full_name;
2460 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
2461 return py_full_name;
2464 static int py_samr_UserInfo3_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2466 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2467 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2468 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2472 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2476 static PyObject *py_samr_UserInfo3_get_rid(PyObject *obj, void *closure)
2478 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2480 py_rid = PyInt_FromLong(object->rid);
2484 static int py_samr_UserInfo3_set_rid(PyObject *py_obj, PyObject *value, void *closure)
2486 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2487 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2488 object->rid = PyInt_AsLong(value);
2492 static PyObject *py_samr_UserInfo3_get_primary_gid(PyObject *obj, void *closure)
2494 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2495 PyObject *py_primary_gid;
2496 py_primary_gid = PyInt_FromLong(object->primary_gid);
2497 return py_primary_gid;
2500 static int py_samr_UserInfo3_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2502 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2503 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2504 object->primary_gid = PyInt_AsLong(value);
2508 static PyObject *py_samr_UserInfo3_get_home_directory(PyObject *obj, void *closure)
2510 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2511 PyObject *py_home_directory;
2512 py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
2513 return py_home_directory;
2516 static int py_samr_UserInfo3_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
2518 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2519 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2520 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2524 object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
2528 static PyObject *py_samr_UserInfo3_get_home_drive(PyObject *obj, void *closure)
2530 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2531 PyObject *py_home_drive;
2532 py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
2533 return py_home_drive;
2536 static int py_samr_UserInfo3_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
2538 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2539 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2540 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2544 object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
2548 static PyObject *py_samr_UserInfo3_get_logon_script(PyObject *obj, void *closure)
2550 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2551 PyObject *py_logon_script;
2552 py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
2553 return py_logon_script;
2556 static int py_samr_UserInfo3_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
2558 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2559 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2560 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2564 object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
2568 static PyObject *py_samr_UserInfo3_get_profile_path(PyObject *obj, void *closure)
2570 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2571 PyObject *py_profile_path;
2572 py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
2573 return py_profile_path;
2576 static int py_samr_UserInfo3_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
2578 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2579 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2580 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2584 object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
2588 static PyObject *py_samr_UserInfo3_get_workstations(PyObject *obj, void *closure)
2590 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2591 PyObject *py_workstations;
2592 py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
2593 return py_workstations;
2596 static int py_samr_UserInfo3_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
2598 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2599 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2600 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2604 object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
2608 static PyObject *py_samr_UserInfo3_get_last_logon(PyObject *obj, void *closure)
2610 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2611 PyObject *py_last_logon;
2612 py_last_logon = PyLong_FromLongLong(object->last_logon);
2613 return py_last_logon;
2616 static int py_samr_UserInfo3_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
2618 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2619 if (PyLong_Check(value)) {
2620 object->last_logon = PyLong_AsLongLong(value);
2621 } else if (PyInt_Check(value)) {
2622 object->last_logon = PyInt_AsLong(value);
2624 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2625 PyInt_Type.tp_name, PyLong_Type.tp_name);
2631 static PyObject *py_samr_UserInfo3_get_last_logoff(PyObject *obj, void *closure)
2633 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2634 PyObject *py_last_logoff;
2635 py_last_logoff = PyLong_FromLongLong(object->last_logoff);
2636 return py_last_logoff;
2639 static int py_samr_UserInfo3_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
2641 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2642 if (PyLong_Check(value)) {
2643 object->last_logoff = PyLong_AsLongLong(value);
2644 } else if (PyInt_Check(value)) {
2645 object->last_logoff = PyInt_AsLong(value);
2647 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2648 PyInt_Type.tp_name, PyLong_Type.tp_name);
2654 static PyObject *py_samr_UserInfo3_get_last_password_change(PyObject *obj, void *closure)
2656 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2657 PyObject *py_last_password_change;
2658 py_last_password_change = PyLong_FromLongLong(object->last_password_change);
2659 return py_last_password_change;
2662 static int py_samr_UserInfo3_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
2664 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2665 if (PyLong_Check(value)) {
2666 object->last_password_change = PyLong_AsLongLong(value);
2667 } else if (PyInt_Check(value)) {
2668 object->last_password_change = PyInt_AsLong(value);
2670 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2671 PyInt_Type.tp_name, PyLong_Type.tp_name);
2677 static PyObject *py_samr_UserInfo3_get_allow_password_change(PyObject *obj, void *closure)
2679 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2680 PyObject *py_allow_password_change;
2681 py_allow_password_change = PyLong_FromLongLong(object->allow_password_change);
2682 return py_allow_password_change;
2685 static int py_samr_UserInfo3_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
2687 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2688 if (PyLong_Check(value)) {
2689 object->allow_password_change = PyLong_AsLongLong(value);
2690 } else if (PyInt_Check(value)) {
2691 object->allow_password_change = PyInt_AsLong(value);
2693 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2694 PyInt_Type.tp_name, PyLong_Type.tp_name);
2700 static PyObject *py_samr_UserInfo3_get_force_password_change(PyObject *obj, void *closure)
2702 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2703 PyObject *py_force_password_change;
2704 py_force_password_change = PyLong_FromLongLong(object->force_password_change);
2705 return py_force_password_change;
2708 static int py_samr_UserInfo3_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
2710 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2711 if (PyLong_Check(value)) {
2712 object->force_password_change = PyLong_AsLongLong(value);
2713 } else if (PyInt_Check(value)) {
2714 object->force_password_change = PyInt_AsLong(value);
2716 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2717 PyInt_Type.tp_name, PyLong_Type.tp_name);
2723 static PyObject *py_samr_UserInfo3_get_logon_hours(PyObject *obj, void *closure)
2725 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2726 PyObject *py_logon_hours;
2727 py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
2728 return py_logon_hours;
2731 static int py_samr_UserInfo3_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
2733 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2734 PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
2735 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2739 object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
2743 static PyObject *py_samr_UserInfo3_get_bad_password_count(PyObject *obj, void *closure)
2745 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2746 PyObject *py_bad_password_count;
2747 py_bad_password_count = PyInt_FromLong(object->bad_password_count);
2748 return py_bad_password_count;
2751 static int py_samr_UserInfo3_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
2753 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2754 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2755 object->bad_password_count = PyInt_AsLong(value);
2759 static PyObject *py_samr_UserInfo3_get_logon_count(PyObject *obj, void *closure)
2761 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2762 PyObject *py_logon_count;
2763 py_logon_count = PyInt_FromLong(object->logon_count);
2764 return py_logon_count;
2767 static int py_samr_UserInfo3_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
2769 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2770 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2771 object->logon_count = PyInt_AsLong(value);
2775 static PyObject *py_samr_UserInfo3_get_acct_flags(PyObject *obj, void *closure)
2777 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2778 PyObject *py_acct_flags;
2779 py_acct_flags = PyInt_FromLong(object->acct_flags);
2780 return py_acct_flags;
2783 static int py_samr_UserInfo3_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
2785 struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(py_obj);
2786 if (PyLong_Check(value)) {
2787 object->acct_flags = PyLong_AsLongLong(value);
2788 } else if (PyInt_Check(value)) {
2789 object->acct_flags = PyInt_AsLong(value);
2791 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2792 PyInt_Type.tp_name, PyLong_Type.tp_name);
2798 static PyGetSetDef py_samr_UserInfo3_getsetters[] = {
2799 { discard_const_p(char, "account_name"), py_samr_UserInfo3_get_account_name, py_samr_UserInfo3_set_account_name },
2800 { discard_const_p(char, "full_name"), py_samr_UserInfo3_get_full_name, py_samr_UserInfo3_set_full_name },
2801 { discard_const_p(char, "rid"), py_samr_UserInfo3_get_rid, py_samr_UserInfo3_set_rid },
2802 { discard_const_p(char, "primary_gid"), py_samr_UserInfo3_get_primary_gid, py_samr_UserInfo3_set_primary_gid },
2803 { discard_const_p(char, "home_directory"), py_samr_UserInfo3_get_home_directory, py_samr_UserInfo3_set_home_directory },
2804 { discard_const_p(char, "home_drive"), py_samr_UserInfo3_get_home_drive, py_samr_UserInfo3_set_home_drive },
2805 { discard_const_p(char, "logon_script"), py_samr_UserInfo3_get_logon_script, py_samr_UserInfo3_set_logon_script },
2806 { discard_const_p(char, "profile_path"), py_samr_UserInfo3_get_profile_path, py_samr_UserInfo3_set_profile_path },
2807 { discard_const_p(char, "workstations"), py_samr_UserInfo3_get_workstations, py_samr_UserInfo3_set_workstations },
2808 { discard_const_p(char, "last_logon"), py_samr_UserInfo3_get_last_logon, py_samr_UserInfo3_set_last_logon },
2809 { discard_const_p(char, "last_logoff"), py_samr_UserInfo3_get_last_logoff, py_samr_UserInfo3_set_last_logoff },
2810 { discard_const_p(char, "last_password_change"), py_samr_UserInfo3_get_last_password_change, py_samr_UserInfo3_set_last_password_change },
2811 { discard_const_p(char, "allow_password_change"), py_samr_UserInfo3_get_allow_password_change, py_samr_UserInfo3_set_allow_password_change },
2812 { discard_const_p(char, "force_password_change"), py_samr_UserInfo3_get_force_password_change, py_samr_UserInfo3_set_force_password_change },
2813 { discard_const_p(char, "logon_hours"), py_samr_UserInfo3_get_logon_hours, py_samr_UserInfo3_set_logon_hours },
2814 { discard_const_p(char, "bad_password_count"), py_samr_UserInfo3_get_bad_password_count, py_samr_UserInfo3_set_bad_password_count },
2815 { discard_const_p(char, "logon_count"), py_samr_UserInfo3_get_logon_count, py_samr_UserInfo3_set_logon_count },
2816 { discard_const_p(char, "acct_flags"), py_samr_UserInfo3_get_acct_flags, py_samr_UserInfo3_set_acct_flags },
2820 static PyObject *py_samr_UserInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2822 return pytalloc_new(struct samr_UserInfo3, type);
2826 static PyTypeObject samr_UserInfo3_Type = {
2827 PyObject_HEAD_INIT(NULL) 0,
2828 .tp_name = "samr.UserInfo3",
2829 .tp_getset = py_samr_UserInfo3_getsetters,
2831 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2832 .tp_basicsize = sizeof(pytalloc_Object),
2833 .tp_new = py_samr_UserInfo3_new,
2837 static PyObject *py_samr_UserInfo4_get_logon_hours(PyObject *obj, void *closure)
2839 struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(obj);
2840 PyObject *py_logon_hours;
2841 py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
2842 return py_logon_hours;
2845 static int py_samr_UserInfo4_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
2847 struct samr_UserInfo4 *object = (struct samr_UserInfo4 *)pytalloc_get_ptr(py_obj);
2848 PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
2849 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2853 object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
2857 static PyGetSetDef py_samr_UserInfo4_getsetters[] = {
2858 { discard_const_p(char, "logon_hours"), py_samr_UserInfo4_get_logon_hours, py_samr_UserInfo4_set_logon_hours },
2862 static PyObject *py_samr_UserInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2864 return pytalloc_new(struct samr_UserInfo4, type);
2868 static PyTypeObject samr_UserInfo4_Type = {
2869 PyObject_HEAD_INIT(NULL) 0,
2870 .tp_name = "samr.UserInfo4",
2871 .tp_getset = py_samr_UserInfo4_getsetters,
2873 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2874 .tp_basicsize = sizeof(pytalloc_Object),
2875 .tp_new = py_samr_UserInfo4_new,
2879 static PyObject *py_samr_UserInfo5_get_account_name(PyObject *obj, void *closure)
2881 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2882 PyObject *py_account_name;
2883 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
2884 return py_account_name;
2887 static int py_samr_UserInfo5_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2889 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2890 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2891 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2895 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2899 static PyObject *py_samr_UserInfo5_get_full_name(PyObject *obj, void *closure)
2901 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2902 PyObject *py_full_name;
2903 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
2904 return py_full_name;
2907 static int py_samr_UserInfo5_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2909 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2910 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2911 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2915 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2919 static PyObject *py_samr_UserInfo5_get_rid(PyObject *obj, void *closure)
2921 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2923 py_rid = PyInt_FromLong(object->rid);
2927 static int py_samr_UserInfo5_set_rid(PyObject *py_obj, PyObject *value, void *closure)
2929 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2930 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2931 object->rid = PyInt_AsLong(value);
2935 static PyObject *py_samr_UserInfo5_get_primary_gid(PyObject *obj, void *closure)
2937 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2938 PyObject *py_primary_gid;
2939 py_primary_gid = PyInt_FromLong(object->primary_gid);
2940 return py_primary_gid;
2943 static int py_samr_UserInfo5_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2945 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2946 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
2947 object->primary_gid = PyInt_AsLong(value);
2951 static PyObject *py_samr_UserInfo5_get_home_directory(PyObject *obj, void *closure)
2953 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2954 PyObject *py_home_directory;
2955 py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
2956 return py_home_directory;
2959 static int py_samr_UserInfo5_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
2961 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2962 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2963 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2967 object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
2971 static PyObject *py_samr_UserInfo5_get_home_drive(PyObject *obj, void *closure)
2973 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2974 PyObject *py_home_drive;
2975 py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
2976 return py_home_drive;
2979 static int py_samr_UserInfo5_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
2981 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
2982 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
2983 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
2987 object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
2991 static PyObject *py_samr_UserInfo5_get_logon_script(PyObject *obj, void *closure)
2993 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2994 PyObject *py_logon_script;
2995 py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
2996 return py_logon_script;
2999 static int py_samr_UserInfo5_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
3001 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3002 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3003 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3007 object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
3011 static PyObject *py_samr_UserInfo5_get_profile_path(PyObject *obj, void *closure)
3013 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3014 PyObject *py_profile_path;
3015 py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
3016 return py_profile_path;
3019 static int py_samr_UserInfo5_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
3021 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3022 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3023 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3027 object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
3031 static PyObject *py_samr_UserInfo5_get_description(PyObject *obj, void *closure)
3033 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3034 PyObject *py_description;
3035 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
3036 return py_description;
3039 static int py_samr_UserInfo5_set_description(PyObject *py_obj, PyObject *value, void *closure)
3041 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3042 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3043 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3047 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3051 static PyObject *py_samr_UserInfo5_get_workstations(PyObject *obj, void *closure)
3053 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3054 PyObject *py_workstations;
3055 py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
3056 return py_workstations;
3059 static int py_samr_UserInfo5_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
3061 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3062 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3063 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3067 object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
3071 static PyObject *py_samr_UserInfo5_get_last_logon(PyObject *obj, void *closure)
3073 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3074 PyObject *py_last_logon;
3075 py_last_logon = PyLong_FromLongLong(object->last_logon);
3076 return py_last_logon;
3079 static int py_samr_UserInfo5_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
3081 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3082 if (PyLong_Check(value)) {
3083 object->last_logon = PyLong_AsLongLong(value);
3084 } else if (PyInt_Check(value)) {
3085 object->last_logon = PyInt_AsLong(value);
3087 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3088 PyInt_Type.tp_name, PyLong_Type.tp_name);
3094 static PyObject *py_samr_UserInfo5_get_last_logoff(PyObject *obj, void *closure)
3096 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3097 PyObject *py_last_logoff;
3098 py_last_logoff = PyLong_FromLongLong(object->last_logoff);
3099 return py_last_logoff;
3102 static int py_samr_UserInfo5_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
3104 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3105 if (PyLong_Check(value)) {
3106 object->last_logoff = PyLong_AsLongLong(value);
3107 } else if (PyInt_Check(value)) {
3108 object->last_logoff = PyInt_AsLong(value);
3110 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3111 PyInt_Type.tp_name, PyLong_Type.tp_name);
3117 static PyObject *py_samr_UserInfo5_get_logon_hours(PyObject *obj, void *closure)
3119 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3120 PyObject *py_logon_hours;
3121 py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
3122 return py_logon_hours;
3125 static int py_samr_UserInfo5_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
3127 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3128 PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
3129 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3133 object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
3137 static PyObject *py_samr_UserInfo5_get_bad_password_count(PyObject *obj, void *closure)
3139 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3140 PyObject *py_bad_password_count;
3141 py_bad_password_count = PyInt_FromLong(object->bad_password_count);
3142 return py_bad_password_count;
3145 static int py_samr_UserInfo5_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
3147 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3148 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3149 object->bad_password_count = PyInt_AsLong(value);
3153 static PyObject *py_samr_UserInfo5_get_logon_count(PyObject *obj, void *closure)
3155 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3156 PyObject *py_logon_count;
3157 py_logon_count = PyInt_FromLong(object->logon_count);
3158 return py_logon_count;
3161 static int py_samr_UserInfo5_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
3163 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3164 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3165 object->logon_count = PyInt_AsLong(value);
3169 static PyObject *py_samr_UserInfo5_get_last_password_change(PyObject *obj, void *closure)
3171 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3172 PyObject *py_last_password_change;
3173 py_last_password_change = PyLong_FromLongLong(object->last_password_change);
3174 return py_last_password_change;
3177 static int py_samr_UserInfo5_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
3179 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3180 if (PyLong_Check(value)) {
3181 object->last_password_change = PyLong_AsLongLong(value);
3182 } else if (PyInt_Check(value)) {
3183 object->last_password_change = PyInt_AsLong(value);
3185 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3186 PyInt_Type.tp_name, PyLong_Type.tp_name);
3192 static PyObject *py_samr_UserInfo5_get_acct_expiry(PyObject *obj, void *closure)
3194 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3195 PyObject *py_acct_expiry;
3196 py_acct_expiry = PyLong_FromLongLong(object->acct_expiry);
3197 return py_acct_expiry;
3200 static int py_samr_UserInfo5_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
3202 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3203 if (PyLong_Check(value)) {
3204 object->acct_expiry = PyLong_AsLongLong(value);
3205 } else if (PyInt_Check(value)) {
3206 object->acct_expiry = PyInt_AsLong(value);
3208 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3209 PyInt_Type.tp_name, PyLong_Type.tp_name);
3215 static PyObject *py_samr_UserInfo5_get_acct_flags(PyObject *obj, void *closure)
3217 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
3218 PyObject *py_acct_flags;
3219 py_acct_flags = PyInt_FromLong(object->acct_flags);
3220 return py_acct_flags;
3223 static int py_samr_UserInfo5_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
3225 struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(py_obj);
3226 if (PyLong_Check(value)) {
3227 object->acct_flags = PyLong_AsLongLong(value);
3228 } else if (PyInt_Check(value)) {
3229 object->acct_flags = PyInt_AsLong(value);
3231 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3232 PyInt_Type.tp_name, PyLong_Type.tp_name);
3238 static PyGetSetDef py_samr_UserInfo5_getsetters[] = {
3239 { discard_const_p(char, "account_name"), py_samr_UserInfo5_get_account_name, py_samr_UserInfo5_set_account_name },
3240 { discard_const_p(char, "full_name"), py_samr_UserInfo5_get_full_name, py_samr_UserInfo5_set_full_name },
3241 { discard_const_p(char, "rid"), py_samr_UserInfo5_get_rid, py_samr_UserInfo5_set_rid },
3242 { discard_const_p(char, "primary_gid"), py_samr_UserInfo5_get_primary_gid, py_samr_UserInfo5_set_primary_gid },
3243 { discard_const_p(char, "home_directory"), py_samr_UserInfo5_get_home_directory, py_samr_UserInfo5_set_home_directory },
3244 { discard_const_p(char, "home_drive"), py_samr_UserInfo5_get_home_drive, py_samr_UserInfo5_set_home_drive },
3245 { discard_const_p(char, "logon_script"), py_samr_UserInfo5_get_logon_script, py_samr_UserInfo5_set_logon_script },
3246 { discard_const_p(char, "profile_path"), py_samr_UserInfo5_get_profile_path, py_samr_UserInfo5_set_profile_path },
3247 { discard_const_p(char, "description"), py_samr_UserInfo5_get_description, py_samr_UserInfo5_set_description },
3248 { discard_const_p(char, "workstations"), py_samr_UserInfo5_get_workstations, py_samr_UserInfo5_set_workstations },
3249 { discard_const_p(char, "last_logon"), py_samr_UserInfo5_get_last_logon, py_samr_UserInfo5_set_last_logon },
3250 { discard_const_p(char, "last_logoff"), py_samr_UserInfo5_get_last_logoff, py_samr_UserInfo5_set_last_logoff },
3251 { discard_const_p(char, "logon_hours"), py_samr_UserInfo5_get_logon_hours, py_samr_UserInfo5_set_logon_hours },
3252 { discard_const_p(char, "bad_password_count"), py_samr_UserInfo5_get_bad_password_count, py_samr_UserInfo5_set_bad_password_count },
3253 { discard_const_p(char, "logon_count"), py_samr_UserInfo5_get_logon_count, py_samr_UserInfo5_set_logon_count },
3254 { discard_const_p(char, "last_password_change"), py_samr_UserInfo5_get_last_password_change, py_samr_UserInfo5_set_last_password_change },
3255 { discard_const_p(char, "acct_expiry"), py_samr_UserInfo5_get_acct_expiry, py_samr_UserInfo5_set_acct_expiry },
3256 { discard_const_p(char, "acct_flags"), py_samr_UserInfo5_get_acct_flags, py_samr_UserInfo5_set_acct_flags },
3260 static PyObject *py_samr_UserInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3262 return pytalloc_new(struct samr_UserInfo5, type);
3266 static PyTypeObject samr_UserInfo5_Type = {
3267 PyObject_HEAD_INIT(NULL) 0,
3268 .tp_name = "samr.UserInfo5",
3269 .tp_getset = py_samr_UserInfo5_getsetters,
3271 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3272 .tp_basicsize = sizeof(pytalloc_Object),
3273 .tp_new = py_samr_UserInfo5_new,
3277 static PyObject *py_samr_UserInfo6_get_account_name(PyObject *obj, void *closure)
3279 struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj);
3280 PyObject *py_account_name;
3281 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
3282 return py_account_name;
3285 static int py_samr_UserInfo6_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3287 struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj);
3288 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3289 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3293 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3297 static PyObject *py_samr_UserInfo6_get_full_name(PyObject *obj, void *closure)
3299 struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(obj);
3300 PyObject *py_full_name;
3301 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
3302 return py_full_name;
3305 static int py_samr_UserInfo6_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3307 struct samr_UserInfo6 *object = (struct samr_UserInfo6 *)pytalloc_get_ptr(py_obj);
3308 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3309 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3313 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3317 static PyGetSetDef py_samr_UserInfo6_getsetters[] = {
3318 { discard_const_p(char, "account_name"), py_samr_UserInfo6_get_account_name, py_samr_UserInfo6_set_account_name },
3319 { discard_const_p(char, "full_name"), py_samr_UserInfo6_get_full_name, py_samr_UserInfo6_set_full_name },
3323 static PyObject *py_samr_UserInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3325 return pytalloc_new(struct samr_UserInfo6, type);
3329 static PyTypeObject samr_UserInfo6_Type = {
3330 PyObject_HEAD_INIT(NULL) 0,
3331 .tp_name = "samr.UserInfo6",
3332 .tp_getset = py_samr_UserInfo6_getsetters,
3334 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3335 .tp_basicsize = sizeof(pytalloc_Object),
3336 .tp_new = py_samr_UserInfo6_new,
3340 static PyObject *py_samr_UserInfo7_get_account_name(PyObject *obj, void *closure)
3342 struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(obj);
3343 PyObject *py_account_name;
3344 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
3345 return py_account_name;
3348 static int py_samr_UserInfo7_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3350 struct samr_UserInfo7 *object = (struct samr_UserInfo7 *)pytalloc_get_ptr(py_obj);
3351 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3352 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3356 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3360 static PyGetSetDef py_samr_UserInfo7_getsetters[] = {
3361 { discard_const_p(char, "account_name"), py_samr_UserInfo7_get_account_name, py_samr_UserInfo7_set_account_name },
3365 static PyObject *py_samr_UserInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3367 return pytalloc_new(struct samr_UserInfo7, type);
3371 static PyTypeObject samr_UserInfo7_Type = {
3372 PyObject_HEAD_INIT(NULL) 0,
3373 .tp_name = "samr.UserInfo7",
3374 .tp_getset = py_samr_UserInfo7_getsetters,
3376 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3377 .tp_basicsize = sizeof(pytalloc_Object),
3378 .tp_new = py_samr_UserInfo7_new,
3382 static PyObject *py_samr_UserInfo8_get_full_name(PyObject *obj, void *closure)
3384 struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(obj);
3385 PyObject *py_full_name;
3386 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
3387 return py_full_name;
3390 static int py_samr_UserInfo8_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3392 struct samr_UserInfo8 *object = (struct samr_UserInfo8 *)pytalloc_get_ptr(py_obj);
3393 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3394 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3398 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3402 static PyGetSetDef py_samr_UserInfo8_getsetters[] = {
3403 { discard_const_p(char, "full_name"), py_samr_UserInfo8_get_full_name, py_samr_UserInfo8_set_full_name },
3407 static PyObject *py_samr_UserInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3409 return pytalloc_new(struct samr_UserInfo8, type);
3413 static PyTypeObject samr_UserInfo8_Type = {
3414 PyObject_HEAD_INIT(NULL) 0,
3415 .tp_name = "samr.UserInfo8",
3416 .tp_getset = py_samr_UserInfo8_getsetters,
3418 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3419 .tp_basicsize = sizeof(pytalloc_Object),
3420 .tp_new = py_samr_UserInfo8_new,
3424 static PyObject *py_samr_UserInfo9_get_primary_gid(PyObject *obj, void *closure)
3426 struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(obj);
3427 PyObject *py_primary_gid;
3428 py_primary_gid = PyInt_FromLong(object->primary_gid);
3429 return py_primary_gid;
3432 static int py_samr_UserInfo9_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
3434 struct samr_UserInfo9 *object = (struct samr_UserInfo9 *)pytalloc_get_ptr(py_obj);
3435 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3436 object->primary_gid = PyInt_AsLong(value);
3440 static PyGetSetDef py_samr_UserInfo9_getsetters[] = {
3441 { discard_const_p(char, "primary_gid"), py_samr_UserInfo9_get_primary_gid, py_samr_UserInfo9_set_primary_gid },
3445 static PyObject *py_samr_UserInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3447 return pytalloc_new(struct samr_UserInfo9, type);
3451 static PyTypeObject samr_UserInfo9_Type = {
3452 PyObject_HEAD_INIT(NULL) 0,
3453 .tp_name = "samr.UserInfo9",
3454 .tp_getset = py_samr_UserInfo9_getsetters,
3456 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3457 .tp_basicsize = sizeof(pytalloc_Object),
3458 .tp_new = py_samr_UserInfo9_new,
3462 static PyObject *py_samr_UserInfo10_get_home_directory(PyObject *obj, void *closure)
3464 struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj);
3465 PyObject *py_home_directory;
3466 py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
3467 return py_home_directory;
3470 static int py_samr_UserInfo10_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
3472 struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj);
3473 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3474 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3478 object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
3482 static PyObject *py_samr_UserInfo10_get_home_drive(PyObject *obj, void *closure)
3484 struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(obj);
3485 PyObject *py_home_drive;
3486 py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
3487 return py_home_drive;
3490 static int py_samr_UserInfo10_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
3492 struct samr_UserInfo10 *object = (struct samr_UserInfo10 *)pytalloc_get_ptr(py_obj);
3493 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3494 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3498 object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
3502 static PyGetSetDef py_samr_UserInfo10_getsetters[] = {
3503 { discard_const_p(char, "home_directory"), py_samr_UserInfo10_get_home_directory, py_samr_UserInfo10_set_home_directory },
3504 { discard_const_p(char, "home_drive"), py_samr_UserInfo10_get_home_drive, py_samr_UserInfo10_set_home_drive },
3508 static PyObject *py_samr_UserInfo10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3510 return pytalloc_new(struct samr_UserInfo10, type);
3514 static PyTypeObject samr_UserInfo10_Type = {
3515 PyObject_HEAD_INIT(NULL) 0,
3516 .tp_name = "samr.UserInfo10",
3517 .tp_getset = py_samr_UserInfo10_getsetters,
3519 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3520 .tp_basicsize = sizeof(pytalloc_Object),
3521 .tp_new = py_samr_UserInfo10_new,
3525 static PyObject *py_samr_UserInfo11_get_logon_script(PyObject *obj, void *closure)
3527 struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(obj);
3528 PyObject *py_logon_script;
3529 py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
3530 return py_logon_script;
3533 static int py_samr_UserInfo11_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
3535 struct samr_UserInfo11 *object = (struct samr_UserInfo11 *)pytalloc_get_ptr(py_obj);
3536 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3537 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3541 object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
3545 static PyGetSetDef py_samr_UserInfo11_getsetters[] = {
3546 { discard_const_p(char, "logon_script"), py_samr_UserInfo11_get_logon_script, py_samr_UserInfo11_set_logon_script },
3550 static PyObject *py_samr_UserInfo11_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3552 return pytalloc_new(struct samr_UserInfo11, type);
3556 static PyTypeObject samr_UserInfo11_Type = {
3557 PyObject_HEAD_INIT(NULL) 0,
3558 .tp_name = "samr.UserInfo11",
3559 .tp_getset = py_samr_UserInfo11_getsetters,
3561 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3562 .tp_basicsize = sizeof(pytalloc_Object),
3563 .tp_new = py_samr_UserInfo11_new,
3567 static PyObject *py_samr_UserInfo12_get_profile_path(PyObject *obj, void *closure)
3569 struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(obj);
3570 PyObject *py_profile_path;
3571 py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
3572 return py_profile_path;
3575 static int py_samr_UserInfo12_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
3577 struct samr_UserInfo12 *object = (struct samr_UserInfo12 *)pytalloc_get_ptr(py_obj);
3578 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3579 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3583 object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
3587 static PyGetSetDef py_samr_UserInfo12_getsetters[] = {
3588 { discard_const_p(char, "profile_path"), py_samr_UserInfo12_get_profile_path, py_samr_UserInfo12_set_profile_path },
3592 static PyObject *py_samr_UserInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3594 return pytalloc_new(struct samr_UserInfo12, type);
3598 static PyTypeObject samr_UserInfo12_Type = {
3599 PyObject_HEAD_INIT(NULL) 0,
3600 .tp_name = "samr.UserInfo12",
3601 .tp_getset = py_samr_UserInfo12_getsetters,
3603 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3604 .tp_basicsize = sizeof(pytalloc_Object),
3605 .tp_new = py_samr_UserInfo12_new,
3609 static PyObject *py_samr_UserInfo13_get_description(PyObject *obj, void *closure)
3611 struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(obj);
3612 PyObject *py_description;
3613 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
3614 return py_description;
3617 static int py_samr_UserInfo13_set_description(PyObject *py_obj, PyObject *value, void *closure)
3619 struct samr_UserInfo13 *object = (struct samr_UserInfo13 *)pytalloc_get_ptr(py_obj);
3620 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3621 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3625 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3629 static PyGetSetDef py_samr_UserInfo13_getsetters[] = {
3630 { discard_const_p(char, "description"), py_samr_UserInfo13_get_description, py_samr_UserInfo13_set_description },
3634 static PyObject *py_samr_UserInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3636 return pytalloc_new(struct samr_UserInfo13, type);
3640 static PyTypeObject samr_UserInfo13_Type = {
3641 PyObject_HEAD_INIT(NULL) 0,
3642 .tp_name = "samr.UserInfo13",
3643 .tp_getset = py_samr_UserInfo13_getsetters,
3645 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3646 .tp_basicsize = sizeof(pytalloc_Object),
3647 .tp_new = py_samr_UserInfo13_new,
3651 static PyObject *py_samr_UserInfo14_get_workstations(PyObject *obj, void *closure)
3653 struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(obj);
3654 PyObject *py_workstations;
3655 py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
3656 return py_workstations;
3659 static int py_samr_UserInfo14_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
3661 struct samr_UserInfo14 *object = (struct samr_UserInfo14 *)pytalloc_get_ptr(py_obj);
3662 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
3663 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3667 object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
3671 static PyGetSetDef py_samr_UserInfo14_getsetters[] = {
3672 { discard_const_p(char, "workstations"), py_samr_UserInfo14_get_workstations, py_samr_UserInfo14_set_workstations },
3676 static PyObject *py_samr_UserInfo14_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3678 return pytalloc_new(struct samr_UserInfo14, type);
3682 static PyTypeObject samr_UserInfo14_Type = {
3683 PyObject_HEAD_INIT(NULL) 0,
3684 .tp_name = "samr.UserInfo14",
3685 .tp_getset = py_samr_UserInfo14_getsetters,
3687 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3688 .tp_basicsize = sizeof(pytalloc_Object),
3689 .tp_new = py_samr_UserInfo14_new,
3693 static PyObject *py_samr_UserInfo16_get_acct_flags(PyObject *obj, void *closure)
3695 struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(obj);
3696 PyObject *py_acct_flags;
3697 py_acct_flags = PyInt_FromLong(object->acct_flags);
3698 return py_acct_flags;
3701 static int py_samr_UserInfo16_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
3703 struct samr_UserInfo16 *object = (struct samr_UserInfo16 *)pytalloc_get_ptr(py_obj);
3704 if (PyLong_Check(value)) {
3705 object->acct_flags = PyLong_AsLongLong(value);
3706 } else if (PyInt_Check(value)) {
3707 object->acct_flags = PyInt_AsLong(value);
3709 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3710 PyInt_Type.tp_name, PyLong_Type.tp_name);
3716 static PyGetSetDef py_samr_UserInfo16_getsetters[] = {
3717 { discard_const_p(char, "acct_flags"), py_samr_UserInfo16_get_acct_flags, py_samr_UserInfo16_set_acct_flags },
3721 static PyObject *py_samr_UserInfo16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3723 return pytalloc_new(struct samr_UserInfo16, type);
3727 static PyTypeObject samr_UserInfo16_Type = {
3728 PyObject_HEAD_INIT(NULL) 0,
3729 .tp_name = "samr.UserInfo16",
3730 .tp_getset = py_samr_UserInfo16_getsetters,
3732 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3733 .tp_basicsize = sizeof(pytalloc_Object),
3734 .tp_new = py_samr_UserInfo16_new,
3738 static PyObject *py_samr_UserInfo17_get_acct_expiry(PyObject *obj, void *closure)
3740 struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(obj);
3741 PyObject *py_acct_expiry;
3742 py_acct_expiry = PyLong_FromLongLong(object->acct_expiry);
3743 return py_acct_expiry;
3746 static int py_samr_UserInfo17_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
3748 struct samr_UserInfo17 *object = (struct samr_UserInfo17 *)pytalloc_get_ptr(py_obj);
3749 if (PyLong_Check(value)) {
3750 object->acct_expiry = PyLong_AsLongLong(value);
3751 } else if (PyInt_Check(value)) {
3752 object->acct_expiry = PyInt_AsLong(value);
3754 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3755 PyInt_Type.tp_name, PyLong_Type.tp_name);
3761 static PyGetSetDef py_samr_UserInfo17_getsetters[] = {
3762 { discard_const_p(char, "acct_expiry"), py_samr_UserInfo17_get_acct_expiry, py_samr_UserInfo17_set_acct_expiry },
3766 static PyObject *py_samr_UserInfo17_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3768 return pytalloc_new(struct samr_UserInfo17, type);
3772 static PyTypeObject samr_UserInfo17_Type = {
3773 PyObject_HEAD_INIT(NULL) 0,
3774 .tp_name = "samr.UserInfo17",
3775 .tp_getset = py_samr_UserInfo17_getsetters,
3777 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3778 .tp_basicsize = sizeof(pytalloc_Object),
3779 .tp_new = py_samr_UserInfo17_new,
3783 static PyObject *py_samr_Password_get_hash(PyObject *obj, void *closure)
3785 struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(obj);
3787 py_hash = PyList_New(16);
3788 if (py_hash == NULL) {
3793 for (hash_cntr_0 = 0; hash_cntr_0 < 16; hash_cntr_0++) {
3794 PyObject *py_hash_0;
3795 py_hash_0 = PyInt_FromLong(object->hash[hash_cntr_0]);
3796 PyList_SetItem(py_hash, hash_cntr_0, py_hash_0);
3802 static int py_samr_Password_set_hash(PyObject *py_obj, PyObject *value, void *closure)
3804 struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3805 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3808 for (hash_cntr_0 = 0; hash_cntr_0 < PyList_GET_SIZE(value); hash_cntr_0++) {
3809 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, hash_cntr_0), return -1;);
3810 object->hash[hash_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, hash_cntr_0));
3816 static PyGetSetDef py_samr_Password_getsetters[] = {
3817 { discard_const_p(char, "hash"), py_samr_Password_get_hash, py_samr_Password_set_hash },
3821 static PyObject *py_samr_Password_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3823 return pytalloc_new(struct samr_Password, type);
3826 static PyObject *py_samr_Password_ndr_pack(PyObject *py_obj)
3828 struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3830 enum ndr_err_code err;
3831 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_samr_Password);
3832 if (err != NDR_ERR_SUCCESS) {
3833 PyErr_SetNdrError(err);
3837 return PyString_FromStringAndSize((char *)blob.data, blob.length);
3840 static PyObject *py_samr_Password_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3842 struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3844 int blob_length = 0;
3845 enum ndr_err_code err;
3846 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
3847 PyObject *allow_remaining_obj = NULL;
3848 bool allow_remaining = false;
3850 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
3851 discard_const_p(char *, kwnames),
3852 &blob.data, &blob_length,
3853 &allow_remaining_obj)) {
3856 blob.length = blob_length;
3858 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3859 allow_remaining = true;
3862 if (allow_remaining) {
3863 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password);
3865 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password);
3867 if (err != NDR_ERR_SUCCESS) {
3868 PyErr_SetNdrError(err);
3875 static PyObject *py_samr_Password_ndr_print(PyObject *py_obj)
3877 struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3881 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_Password, "samr_Password", object);
3882 ret = PyString_FromString(retstr);
3883 talloc_free(retstr);
3888 static PyMethodDef py_samr_Password_methods[] = {
3889 { "__ndr_pack__", (PyCFunction)py_samr_Password_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
3890 { "__ndr_unpack__", (PyCFunction)py_samr_Password_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
3891 { "__ndr_print__", (PyCFunction)py_samr_Password_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
3892 { NULL, NULL, 0, NULL }
3896 static PyTypeObject samr_Password_Type = {
3897 PyObject_HEAD_INIT(NULL) 0,
3898 .tp_name = "samr.Password",
3899 .tp_getset = py_samr_Password_getsetters,
3900 .tp_methods = py_samr_Password_methods,
3901 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3902 .tp_basicsize = sizeof(pytalloc_Object),
3903 .tp_new = py_samr_Password_new,
3907 static PyObject *py_samr_UserInfo18_get_nt_pwd(PyObject *obj, void *closure)
3909 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
3910 PyObject *py_nt_pwd;
3911 py_nt_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->nt_pwd);
3915 static int py_samr_UserInfo18_set_nt_pwd(PyObject *py_obj, PyObject *value, void *closure)
3917 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
3918 PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
3919 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3923 object->nt_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
3927 static PyObject *py_samr_UserInfo18_get_lm_pwd(PyObject *obj, void *closure)
3929 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
3930 PyObject *py_lm_pwd;
3931 py_lm_pwd = pytalloc_reference_ex(&samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lm_pwd);
3935 static int py_samr_UserInfo18_set_lm_pwd(PyObject *py_obj, PyObject *value, void *closure)
3937 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
3938 PY_CHECK_TYPE(&samr_Password_Type, value, return -1;);
3939 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
3943 object->lm_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
3947 static PyObject *py_samr_UserInfo18_get_nt_pwd_active(PyObject *obj, void *closure)
3949 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
3950 PyObject *py_nt_pwd_active;
3951 py_nt_pwd_active = PyInt_FromLong(object->nt_pwd_active);
3952 return py_nt_pwd_active;
3955 static int py_samr_UserInfo18_set_nt_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
3957 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
3958 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3959 object->nt_pwd_active = PyInt_AsLong(value);
3963 static PyObject *py_samr_UserInfo18_get_lm_pwd_active(PyObject *obj, void *closure)
3965 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
3966 PyObject *py_lm_pwd_active;
3967 py_lm_pwd_active = PyInt_FromLong(object->lm_pwd_active);
3968 return py_lm_pwd_active;
3971 static int py_samr_UserInfo18_set_lm_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
3973 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
3974 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3975 object->lm_pwd_active = PyInt_AsLong(value);
3979 static PyObject *py_samr_UserInfo18_get_password_expired(PyObject *obj, void *closure)
3981 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(obj);
3982 PyObject *py_password_expired;
3983 py_password_expired = PyInt_FromLong(object->password_expired);
3984 return py_password_expired;
3987 static int py_samr_UserInfo18_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
3989 struct samr_UserInfo18 *object = (struct samr_UserInfo18 *)pytalloc_get_ptr(py_obj);
3990 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
3991 object->password_expired = PyInt_AsLong(value);
3995 static PyGetSetDef py_samr_UserInfo18_getsetters[] = {
3996 { discard_const_p(char, "nt_pwd"), py_samr_UserInfo18_get_nt_pwd, py_samr_UserInfo18_set_nt_pwd },
3997 { discard_const_p(char, "lm_pwd"), py_samr_UserInfo18_get_lm_pwd, py_samr_UserInfo18_set_lm_pwd },
3998 { discard_const_p(char, "nt_pwd_active"), py_samr_UserInfo18_get_nt_pwd_active, py_samr_UserInfo18_set_nt_pwd_active },
3999 { discard_const_p(char, "lm_pwd_active"), py_samr_UserInfo18_get_lm_pwd_active, py_samr_UserInfo18_set_lm_pwd_active },
4000 { discard_const_p(char, "password_expired"), py_samr_UserInfo18_get_password_expired, py_samr_UserInfo18_set_password_expired },
4004 static PyObject *py_samr_UserInfo18_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4006 return pytalloc_new(struct samr_UserInfo18, type);
4010 static PyTypeObject samr_UserInfo18_Type = {
4011 PyObject_HEAD_INIT(NULL) 0,
4012 .tp_name = "samr.UserInfo18",
4013 .tp_getset = py_samr_UserInfo18_getsetters,
4015 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4016 .tp_basicsize = sizeof(pytalloc_Object),
4017 .tp_new = py_samr_UserInfo18_new,
4021 static PyObject *py_samr_UserInfo20_get_parameters(PyObject *obj, void *closure)
4023 struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(obj);
4024 PyObject *py_parameters;
4025 py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters);
4026 return py_parameters;
4029 static int py_samr_UserInfo20_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
4031 struct samr_UserInfo20 *object = (struct samr_UserInfo20 *)pytalloc_get_ptr(py_obj);
4032 PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
4033 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4037 object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4041 static PyGetSetDef py_samr_UserInfo20_getsetters[] = {
4042 { discard_const_p(char, "parameters"), py_samr_UserInfo20_get_parameters, py_samr_UserInfo20_set_parameters },
4046 static PyObject *py_samr_UserInfo20_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4048 return pytalloc_new(struct samr_UserInfo20, type);
4052 static PyTypeObject samr_UserInfo20_Type = {
4053 PyObject_HEAD_INIT(NULL) 0,
4054 .tp_name = "samr.UserInfo20",
4055 .tp_getset = py_samr_UserInfo20_getsetters,
4057 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4058 .tp_basicsize = sizeof(pytalloc_Object),
4059 .tp_new = py_samr_UserInfo20_new,
4063 static PyObject *py_samr_UserInfo21_get_last_logon(PyObject *obj, void *closure)
4065 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4066 PyObject *py_last_logon;
4067 py_last_logon = PyLong_FromLongLong(object->last_logon);
4068 return py_last_logon;
4071 static int py_samr_UserInfo21_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
4073 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4074 if (PyLong_Check(value)) {
4075 object->last_logon = PyLong_AsLongLong(value);
4076 } else if (PyInt_Check(value)) {
4077 object->last_logon = PyInt_AsLong(value);
4079 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4080 PyInt_Type.tp_name, PyLong_Type.tp_name);
4086 static PyObject *py_samr_UserInfo21_get_last_logoff(PyObject *obj, void *closure)
4088 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4089 PyObject *py_last_logoff;
4090 py_last_logoff = PyLong_FromLongLong(object->last_logoff);
4091 return py_last_logoff;
4094 static int py_samr_UserInfo21_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
4096 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4097 if (PyLong_Check(value)) {
4098 object->last_logoff = PyLong_AsLongLong(value);
4099 } else if (PyInt_Check(value)) {
4100 object->last_logoff = PyInt_AsLong(value);
4102 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4103 PyInt_Type.tp_name, PyLong_Type.tp_name);
4109 static PyObject *py_samr_UserInfo21_get_last_password_change(PyObject *obj, void *closure)
4111 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4112 PyObject *py_last_password_change;
4113 py_last_password_change = PyLong_FromLongLong(object->last_password_change);
4114 return py_last_password_change;
4117 static int py_samr_UserInfo21_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
4119 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4120 if (PyLong_Check(value)) {
4121 object->last_password_change = PyLong_AsLongLong(value);
4122 } else if (PyInt_Check(value)) {
4123 object->last_password_change = PyInt_AsLong(value);
4125 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4126 PyInt_Type.tp_name, PyLong_Type.tp_name);
4132 static PyObject *py_samr_UserInfo21_get_acct_expiry(PyObject *obj, void *closure)
4134 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4135 PyObject *py_acct_expiry;
4136 py_acct_expiry = PyLong_FromLongLong(object->acct_expiry);
4137 return py_acct_expiry;
4140 static int py_samr_UserInfo21_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
4142 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4143 if (PyLong_Check(value)) {
4144 object->acct_expiry = PyLong_AsLongLong(value);
4145 } else if (PyInt_Check(value)) {
4146 object->acct_expiry = PyInt_AsLong(value);
4148 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4149 PyInt_Type.tp_name, PyLong_Type.tp_name);
4155 static PyObject *py_samr_UserInfo21_get_allow_password_change(PyObject *obj, void *closure)
4157 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4158 PyObject *py_allow_password_change;
4159 py_allow_password_change = PyLong_FromLongLong(object->allow_password_change);
4160 return py_allow_password_change;
4163 static int py_samr_UserInfo21_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
4165 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4166 if (PyLong_Check(value)) {
4167 object->allow_password_change = PyLong_AsLongLong(value);
4168 } else if (PyInt_Check(value)) {
4169 object->allow_password_change = PyInt_AsLong(value);
4171 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4172 PyInt_Type.tp_name, PyLong_Type.tp_name);
4178 static PyObject *py_samr_UserInfo21_get_force_password_change(PyObject *obj, void *closure)
4180 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4181 PyObject *py_force_password_change;
4182 py_force_password_change = PyLong_FromLongLong(object->force_password_change);
4183 return py_force_password_change;
4186 static int py_samr_UserInfo21_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
4188 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4189 if (PyLong_Check(value)) {
4190 object->force_password_change = PyLong_AsLongLong(value);
4191 } else if (PyInt_Check(value)) {
4192 object->force_password_change = PyInt_AsLong(value);
4194 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4195 PyInt_Type.tp_name, PyLong_Type.tp_name);
4201 static PyObject *py_samr_UserInfo21_get_account_name(PyObject *obj, void *closure)
4203 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4204 PyObject *py_account_name;
4205 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
4206 return py_account_name;
4209 static int py_samr_UserInfo21_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
4211 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4212 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4213 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4217 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4221 static PyObject *py_samr_UserInfo21_get_full_name(PyObject *obj, void *closure)
4223 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4224 PyObject *py_full_name;
4225 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
4226 return py_full_name;
4229 static int py_samr_UserInfo21_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
4231 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4232 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4233 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4237 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4241 static PyObject *py_samr_UserInfo21_get_home_directory(PyObject *obj, void *closure)
4243 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4244 PyObject *py_home_directory;
4245 py_home_directory = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_directory);
4246 return py_home_directory;
4249 static int py_samr_UserInfo21_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
4251 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4252 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4253 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4257 object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
4261 static PyObject *py_samr_UserInfo21_get_home_drive(PyObject *obj, void *closure)
4263 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4264 PyObject *py_home_drive;
4265 py_home_drive = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->home_drive);
4266 return py_home_drive;
4269 static int py_samr_UserInfo21_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
4271 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4272 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4273 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4277 object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
4281 static PyObject *py_samr_UserInfo21_get_logon_script(PyObject *obj, void *closure)
4283 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4284 PyObject *py_logon_script;
4285 py_logon_script = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->logon_script);
4286 return py_logon_script;
4289 static int py_samr_UserInfo21_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
4291 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4292 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4293 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4297 object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
4301 static PyObject *py_samr_UserInfo21_get_profile_path(PyObject *obj, void *closure)
4303 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4304 PyObject *py_profile_path;
4305 py_profile_path = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->profile_path);
4306 return py_profile_path;
4309 static int py_samr_UserInfo21_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
4311 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4312 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4313 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4317 object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
4321 static PyObject *py_samr_UserInfo21_get_description(PyObject *obj, void *closure)
4323 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4324 PyObject *py_description;
4325 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
4326 return py_description;
4329 static int py_samr_UserInfo21_set_description(PyObject *py_obj, PyObject *value, void *closure)
4331 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4332 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4333 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4337 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
4341 static PyObject *py_samr_UserInfo21_get_workstations(PyObject *obj, void *closure)
4343 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4344 PyObject *py_workstations;
4345 py_workstations = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->workstations);
4346 return py_workstations;
4349 static int py_samr_UserInfo21_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
4351 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4352 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4353 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4357 object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
4361 static PyObject *py_samr_UserInfo21_get_comment(PyObject *obj, void *closure)
4363 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4364 PyObject *py_comment;
4365 py_comment = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->comment);
4369 static int py_samr_UserInfo21_set_comment(PyObject *py_obj, PyObject *value, void *closure)
4371 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4372 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4373 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4377 object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
4381 static PyObject *py_samr_UserInfo21_get_parameters(PyObject *obj, void *closure)
4383 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4384 PyObject *py_parameters;
4385 py_parameters = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->parameters);
4386 return py_parameters;
4389 static int py_samr_UserInfo21_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
4391 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4392 PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
4393 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4397 object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4401 static PyObject *py_samr_UserInfo21_get_lm_owf_password(PyObject *obj, void *closure)
4403 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4404 PyObject *py_lm_owf_password;
4405 py_lm_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->lm_owf_password);
4406 return py_lm_owf_password;
4409 static int py_samr_UserInfo21_set_lm_owf_password(PyObject *py_obj, PyObject *value, void *closure)
4411 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4412 PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
4413 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4417 object->lm_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4421 static PyObject *py_samr_UserInfo21_get_nt_owf_password(PyObject *obj, void *closure)
4423 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4424 PyObject *py_nt_owf_password;
4425 py_nt_owf_password = pytalloc_reference_ex(lsa_BinaryString_Type, pytalloc_get_mem_ctx(obj), &object->nt_owf_password);
4426 return py_nt_owf_password;
4429 static int py_samr_UserInfo21_set_nt_owf_password(PyObject *py_obj, PyObject *value, void *closure)
4431 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4432 PY_CHECK_TYPE(lsa_BinaryString_Type, value, return -1;);
4433 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4437 object->nt_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4441 static PyObject *py_samr_UserInfo21_get_private_data(PyObject *obj, void *closure)
4443 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4444 PyObject *py_private_data;
4445 py_private_data = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->private_data);
4446 return py_private_data;
4449 static int py_samr_UserInfo21_set_private_data(PyObject *py_obj, PyObject *value, void *closure)
4451 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4452 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
4453 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4457 object->private_data = *(struct lsa_String *)pytalloc_get_ptr(value);
4461 static PyObject *py_samr_UserInfo21_get_buf_count(PyObject *obj, void *closure)
4463 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4464 PyObject *py_buf_count;
4465 py_buf_count = PyInt_FromLong(object->buf_count);
4466 return py_buf_count;
4469 static int py_samr_UserInfo21_set_buf_count(PyObject *py_obj, PyObject *value, void *closure)
4471 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4472 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4473 object->buf_count = PyInt_AsLong(value);
4477 static PyObject *py_samr_UserInfo21_get_buffer(PyObject *obj, void *closure)
4479 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4480 PyObject *py_buffer;
4481 if (object->buffer == NULL) {
4482 py_buffer = Py_None;
4483 Py_INCREF(py_buffer);
4485 py_buffer = PyList_New(object->buf_count);
4486 if (py_buffer == NULL) {
4491 for (buffer_cntr_1 = 0; buffer_cntr_1 < object->buf_count; buffer_cntr_1++) {
4492 PyObject *py_buffer_1;
4493 py_buffer_1 = PyInt_FromLong(object->buffer[buffer_cntr_1]);
4494 PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
4501 static int py_samr_UserInfo21_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
4503 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4504 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->buffer);
4505 if (value == Py_None) {
4506 object->buffer = NULL;
4508 object->buffer = NULL;
4509 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4512 object->buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffer, PyList_GET_SIZE(value));
4513 if (!object->buffer) { return -1;; }
4514 talloc_set_name_const(object->buffer, "ARRAY: object->buffer");
4515 for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
4516 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, buffer_cntr_1), return -1;);
4517 object->buffer[buffer_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, buffer_cntr_1));
4524 static PyObject *py_samr_UserInfo21_get_rid(PyObject *obj, void *closure)
4526 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4528 py_rid = PyInt_FromLong(object->rid);
4532 static int py_samr_UserInfo21_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4534 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4535 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4536 object->rid = PyInt_AsLong(value);
4540 static PyObject *py_samr_UserInfo21_get_primary_gid(PyObject *obj, void *closure)
4542 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4543 PyObject *py_primary_gid;
4544 py_primary_gid = PyInt_FromLong(object->primary_gid);
4545 return py_primary_gid;
4548 static int py_samr_UserInfo21_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
4550 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4551 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4552 object->primary_gid = PyInt_AsLong(value);
4556 static PyObject *py_samr_UserInfo21_get_acct_flags(PyObject *obj, void *closure)
4558 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4559 PyObject *py_acct_flags;
4560 py_acct_flags = PyInt_FromLong(object->acct_flags);
4561 return py_acct_flags;
4564 static int py_samr_UserInfo21_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
4566 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4567 if (PyLong_Check(value)) {
4568 object->acct_flags = PyLong_AsLongLong(value);
4569 } else if (PyInt_Check(value)) {
4570 object->acct_flags = PyInt_AsLong(value);
4572 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4573 PyInt_Type.tp_name, PyLong_Type.tp_name);
4579 static PyObject *py_samr_UserInfo21_get_fields_present(PyObject *obj, void *closure)
4581 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4582 PyObject *py_fields_present;
4583 py_fields_present = PyInt_FromLong(object->fields_present);
4584 return py_fields_present;
4587 static int py_samr_UserInfo21_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
4589 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4590 if (PyLong_Check(value)) {
4591 object->fields_present = PyLong_AsLongLong(value);
4592 } else if (PyInt_Check(value)) {
4593 object->fields_present = PyInt_AsLong(value);
4595 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4596 PyInt_Type.tp_name, PyLong_Type.tp_name);
4602 static PyObject *py_samr_UserInfo21_get_logon_hours(PyObject *obj, void *closure)
4604 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4605 PyObject *py_logon_hours;
4606 py_logon_hours = pytalloc_reference_ex(&samr_LogonHours_Type, pytalloc_get_mem_ctx(obj), &object->logon_hours);
4607 return py_logon_hours;
4610 static int py_samr_UserInfo21_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
4612 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4613 PY_CHECK_TYPE(&samr_LogonHours_Type, value, return -1;);
4614 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4618 object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
4622 static PyObject *py_samr_UserInfo21_get_bad_password_count(PyObject *obj, void *closure)
4624 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4625 PyObject *py_bad_password_count;
4626 py_bad_password_count = PyInt_FromLong(object->bad_password_count);
4627 return py_bad_password_count;
4630 static int py_samr_UserInfo21_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
4632 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4633 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4634 object->bad_password_count = PyInt_AsLong(value);
4638 static PyObject *py_samr_UserInfo21_get_logon_count(PyObject *obj, void *closure)
4640 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4641 PyObject *py_logon_count;
4642 py_logon_count = PyInt_FromLong(object->logon_count);
4643 return py_logon_count;
4646 static int py_samr_UserInfo21_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
4648 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4649 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4650 object->logon_count = PyInt_AsLong(value);
4654 static PyObject *py_samr_UserInfo21_get_country_code(PyObject *obj, void *closure)
4656 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4657 PyObject *py_country_code;
4658 py_country_code = PyInt_FromLong(object->country_code);
4659 return py_country_code;
4662 static int py_samr_UserInfo21_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
4664 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4665 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4666 object->country_code = PyInt_AsLong(value);
4670 static PyObject *py_samr_UserInfo21_get_code_page(PyObject *obj, void *closure)
4672 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4673 PyObject *py_code_page;
4674 py_code_page = PyInt_FromLong(object->code_page);
4675 return py_code_page;
4678 static int py_samr_UserInfo21_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
4680 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4681 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4682 object->code_page = PyInt_AsLong(value);
4686 static PyObject *py_samr_UserInfo21_get_lm_password_set(PyObject *obj, void *closure)
4688 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4689 PyObject *py_lm_password_set;
4690 py_lm_password_set = PyInt_FromLong(object->lm_password_set);
4691 return py_lm_password_set;
4694 static int py_samr_UserInfo21_set_lm_password_set(PyObject *py_obj, PyObject *value, void *closure)
4696 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4697 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4698 object->lm_password_set = PyInt_AsLong(value);
4702 static PyObject *py_samr_UserInfo21_get_nt_password_set(PyObject *obj, void *closure)
4704 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4705 PyObject *py_nt_password_set;
4706 py_nt_password_set = PyInt_FromLong(object->nt_password_set);
4707 return py_nt_password_set;
4710 static int py_samr_UserInfo21_set_nt_password_set(PyObject *py_obj, PyObject *value, void *closure)
4712 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4713 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4714 object->nt_password_set = PyInt_AsLong(value);
4718 static PyObject *py_samr_UserInfo21_get_password_expired(PyObject *obj, void *closure)
4720 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4721 PyObject *py_password_expired;
4722 py_password_expired = PyInt_FromLong(object->password_expired);
4723 return py_password_expired;
4726 static int py_samr_UserInfo21_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
4728 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4729 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4730 object->password_expired = PyInt_AsLong(value);
4734 static PyObject *py_samr_UserInfo21_get_private_data_sensitive(PyObject *obj, void *closure)
4736 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4737 PyObject *py_private_data_sensitive;
4738 py_private_data_sensitive = PyInt_FromLong(object->private_data_sensitive);
4739 return py_private_data_sensitive;
4742 static int py_samr_UserInfo21_set_private_data_sensitive(PyObject *py_obj, PyObject *value, void *closure)
4744 struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(py_obj);
4745 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
4746 object->private_data_sensitive = PyInt_AsLong(value);
4750 static PyGetSetDef py_samr_UserInfo21_getsetters[] = {
4751 { discard_const_p(char, "last_logon"), py_samr_UserInfo21_get_last_logon, py_samr_UserInfo21_set_last_logon },
4752 { discard_const_p(char, "last_logoff"), py_samr_UserInfo21_get_last_logoff, py_samr_UserInfo21_set_last_logoff },
4753 { discard_const_p(char, "last_password_change"), py_samr_UserInfo21_get_last_password_change, py_samr_UserInfo21_set_last_password_change },
4754 { discard_const_p(char, "acct_expiry"), py_samr_UserInfo21_get_acct_expiry, py_samr_UserInfo21_set_acct_expiry },
4755 { discard_const_p(char, "allow_password_change"), py_samr_UserInfo21_get_allow_password_change, py_samr_UserInfo21_set_allow_password_change },
4756 { discard_const_p(char, "force_password_change"), py_samr_UserInfo21_get_force_password_change, py_samr_UserInfo21_set_force_password_change },
4757 { discard_const_p(char, "account_name"), py_samr_UserInfo21_get_account_name, py_samr_UserInfo21_set_account_name },
4758 { discard_const_p(char, "full_name"), py_samr_UserInfo21_get_full_name, py_samr_UserInfo21_set_full_name },
4759 { discard_const_p(char, "home_directory"), py_samr_UserInfo21_get_home_directory, py_samr_UserInfo21_set_home_directory },
4760 { discard_const_p(char, "home_drive"), py_samr_UserInfo21_get_home_drive, py_samr_UserInfo21_set_home_drive },
4761 { discard_const_p(char, "logon_script"), py_samr_UserInfo21_get_logon_script, py_samr_UserInfo21_set_logon_script },
4762 { discard_const_p(char, "profile_path"), py_samr_UserInfo21_get_profile_path, py_samr_UserInfo21_set_profile_path },
4763 { discard_const_p(char, "description"), py_samr_UserInfo21_get_description, py_samr_UserInfo21_set_description },
4764 { discard_const_p(char, "workstations"), py_samr_UserInfo21_get_workstations, py_samr_UserInfo21_set_workstations },
4765 { discard_const_p(char, "comment"), py_samr_UserInfo21_get_comment, py_samr_UserInfo21_set_comment },
4766 { discard_const_p(char, "parameters"), py_samr_UserInfo21_get_parameters, py_samr_UserInfo21_set_parameters },
4767 { discard_const_p(char, "lm_owf_password"), py_samr_UserInfo21_get_lm_owf_password, py_samr_UserInfo21_set_lm_owf_password },
4768 { discard_const_p(char, "nt_owf_password"), py_samr_UserInfo21_get_nt_owf_password, py_samr_UserInfo21_set_nt_owf_password },
4769 { discard_const_p(char, "private_data"), py_samr_UserInfo21_get_private_data, py_samr_UserInfo21_set_private_data },
4770 { discard_const_p(char, "buf_count"), py_samr_UserInfo21_get_buf_count, py_samr_UserInfo21_set_buf_count },
4771 { discard_const_p(char, "buffer"), py_samr_UserInfo21_get_buffer, py_samr_UserInfo21_set_buffer },
4772 { discard_const_p(char, "rid"), py_samr_UserInfo21_get_rid, py_samr_UserInfo21_set_rid },
4773 { discard_const_p(char, "primary_gid"), py_samr_UserInfo21_get_primary_gid, py_samr_UserInfo21_set_primary_gid },
4774 { discard_const_p(char, "acct_flags"), py_samr_UserInfo21_get_acct_flags, py_samr_UserInfo21_set_acct_flags },
4775 { discard_const_p(char, "fields_present"), py_samr_UserInfo21_get_fields_present, py_samr_UserInfo21_set_fields_present },
4776 { discard_const_p(char, "logon_hours"), py_samr_UserInfo21_get_logon_hours, py_samr_UserInfo21_set_logon_hours },
4777 { discard_const_p(char, "bad_password_count"), py_samr_UserInfo21_get_bad_password_count, py_samr_UserInfo21_set_bad_password_count },
4778 { discard_const_p(char, "logon_count"), py_samr_UserInfo21_get_logon_count, py_samr_UserInfo21_set_logon_count },
4779 { discard_const_p(char, "country_code"), py_samr_UserInfo21_get_country_code, py_samr_UserInfo21_set_country_code },
4780 { discard_const_p(char, "code_page"), py_samr_UserInfo21_get_code_page, py_samr_UserInfo21_set_code_page },
4781 { discard_const_p(char, "lm_password_set"), py_samr_UserInfo21_get_lm_password_set, py_samr_UserInfo21_set_lm_password_set },
4782 { discard_const_p(char, "nt_password_set"), py_samr_UserInfo21_get_nt_password_set, py_samr_UserInfo21_set_nt_password_set },
4783 { discard_const_p(char, "password_expired"), py_samr_UserInfo21_get_password_expired, py_samr_UserInfo21_set_password_expired },
4784 { discard_const_p(char, "private_data_sensitive"), py_samr_UserInfo21_get_private_data_sensitive, py_samr_UserInfo21_set_private_data_sensitive },
4788 static PyObject *py_samr_UserInfo21_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4790 return pytalloc_new(struct samr_UserInfo21, type);
4794 static PyTypeObject samr_UserInfo21_Type = {
4795 PyObject_HEAD_INIT(NULL) 0,
4796 .tp_name = "samr.UserInfo21",
4797 .tp_getset = py_samr_UserInfo21_getsetters,
4799 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4800 .tp_basicsize = sizeof(pytalloc_Object),
4801 .tp_new = py_samr_UserInfo21_new,
4805 static PyObject *py_samr_CryptPassword_get_data(PyObject *obj, void *closure)
4807 struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(obj);
4809 py_data = PyList_New(516);
4810 if (py_data == NULL) {
4815 for (data_cntr_0 = 0; data_cntr_0 < 516; data_cntr_0++) {
4816 PyObject *py_data_0;
4817 py_data_0 = PyInt_FromLong(object->data[data_cntr_0]);
4818 PyList_SetItem(py_data, data_cntr_0, py_data_0);
4824 static int py_samr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure)
4826 struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4827 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4830 for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
4831 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, data_cntr_0), return -1;);
4832 object->data[data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_0));
4838 static PyGetSetDef py_samr_CryptPassword_getsetters[] = {
4839 { discard_const_p(char, "data"), py_samr_CryptPassword_get_data, py_samr_CryptPassword_set_data },
4843 static PyObject *py_samr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4845 return pytalloc_new(struct samr_CryptPassword, type);
4848 static PyObject *py_samr_CryptPassword_ndr_pack(PyObject *py_obj)
4850 struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4852 enum ndr_err_code err;
4853 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_samr_CryptPassword);
4854 if (err != NDR_ERR_SUCCESS) {
4855 PyErr_SetNdrError(err);
4859 return PyString_FromStringAndSize((char *)blob.data, blob.length);
4862 static PyObject *py_samr_CryptPassword_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4864 struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4866 int blob_length = 0;
4867 enum ndr_err_code err;
4868 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
4869 PyObject *allow_remaining_obj = NULL;
4870 bool allow_remaining = false;
4872 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
4873 discard_const_p(char *, kwnames),
4874 &blob.data, &blob_length,
4875 &allow_remaining_obj)) {
4878 blob.length = blob_length;
4880 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4881 allow_remaining = true;
4884 if (allow_remaining) {
4885 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword);
4887 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword);
4889 if (err != NDR_ERR_SUCCESS) {
4890 PyErr_SetNdrError(err);
4897 static PyObject *py_samr_CryptPassword_ndr_print(PyObject *py_obj)
4899 struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4903 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_CryptPassword, "samr_CryptPassword", object);
4904 ret = PyString_FromString(retstr);
4905 talloc_free(retstr);
4910 static PyMethodDef py_samr_CryptPassword_methods[] = {
4911 { "__ndr_pack__", (PyCFunction)py_samr_CryptPassword_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
4912 { "__ndr_unpack__", (PyCFunction)py_samr_CryptPassword_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
4913 { "__ndr_print__", (PyCFunction)py_samr_CryptPassword_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
4914 { NULL, NULL, 0, NULL }
4918 static PyTypeObject samr_CryptPassword_Type = {
4919 PyObject_HEAD_INIT(NULL) 0,
4920 .tp_name = "samr.CryptPassword",
4921 .tp_getset = py_samr_CryptPassword_getsetters,
4922 .tp_methods = py_samr_CryptPassword_methods,
4923 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4924 .tp_basicsize = sizeof(pytalloc_Object),
4925 .tp_new = py_samr_CryptPassword_new,
4929 static PyObject *py_samr_UserInfo23_get_info(PyObject *obj, void *closure)
4931 struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj);
4933 py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
4937 static int py_samr_UserInfo23_set_info(PyObject *py_obj, PyObject *value, void *closure)
4939 struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj);
4940 PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;);
4941 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4945 object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
4949 static PyObject *py_samr_UserInfo23_get_password(PyObject *obj, void *closure)
4951 struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj);
4952 PyObject *py_password;
4953 py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password);
4957 static int py_samr_UserInfo23_set_password(PyObject *py_obj, PyObject *value, void *closure)
4959 struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(py_obj);
4960 PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
4961 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
4965 object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
4969 static PyGetSetDef py_samr_UserInfo23_getsetters[] = {
4970 { discard_const_p(char, "info"), py_samr_UserInfo23_get_info, py_samr_UserInfo23_set_info },
4971 { discard_const_p(char, "password"), py_samr_UserInfo23_get_password, py_samr_UserInfo23_set_password },
4975 static PyObject *py_samr_UserInfo23_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4977 return pytalloc_new(struct samr_UserInfo23, type);
4981 static PyTypeObject samr_UserInfo23_Type = {
4982 PyObject_HEAD_INIT(NULL) 0,
4983 .tp_name = "samr.UserInfo23",
4984 .tp_getset = py_samr_UserInfo23_getsetters,
4986 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4987 .tp_basicsize = sizeof(pytalloc_Object),
4988 .tp_new = py_samr_UserInfo23_new,
4992 static PyObject *py_samr_UserInfo24_get_password(PyObject *obj, void *closure)
4994 struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj);
4995 PyObject *py_password;
4996 py_password = pytalloc_reference_ex(&samr_CryptPassword_Type, pytalloc_get_mem_ctx(obj), &object->password);
5000 static int py_samr_UserInfo24_set_password(PyObject *py_obj, PyObject *value, void *closure)
5002 struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj);
5003 PY_CHECK_TYPE(&samr_CryptPassword_Type, value, return -1;);
5004 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5008 object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
5012 static PyObject *py_samr_UserInfo24_get_password_expired(PyObject *obj, void *closure)
5014 struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(obj);
5015 PyObject *py_password_expired;
5016 py_password_expired = PyInt_FromLong(object->password_expired);
5017 return py_password_expired;
5020 static int py_samr_UserInfo24_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
5022 struct samr_UserInfo24 *object = (struct samr_UserInfo24 *)pytalloc_get_ptr(py_obj);
5023 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5024 object->password_expired = PyInt_AsLong(value);
5028 static PyGetSetDef py_samr_UserInfo24_getsetters[] = {
5029 { discard_const_p(char, "password"), py_samr_UserInfo24_get_password, py_samr_UserInfo24_set_password },
5030 { discard_const_p(char, "password_expired"), py_samr_UserInfo24_get_password_expired, py_samr_UserInfo24_set_password_expired },
5034 static PyObject *py_samr_UserInfo24_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5036 return pytalloc_new(struct samr_UserInfo24, type);
5040 static PyTypeObject samr_UserInfo24_Type = {
5041 PyObject_HEAD_INIT(NULL) 0,
5042 .tp_name = "samr.UserInfo24",
5043 .tp_getset = py_samr_UserInfo24_getsetters,
5045 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5046 .tp_basicsize = sizeof(pytalloc_Object),
5047 .tp_new = py_samr_UserInfo24_new,
5051 static PyObject *py_samr_CryptPasswordEx_get_data(PyObject *obj, void *closure)
5053 struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(obj);
5055 py_data = PyList_New(532);
5056 if (py_data == NULL) {
5061 for (data_cntr_0 = 0; data_cntr_0 < 532; data_cntr_0++) {
5062 PyObject *py_data_0;
5063 py_data_0 = PyInt_FromLong(object->data[data_cntr_0]);
5064 PyList_SetItem(py_data, data_cntr_0, py_data_0);
5070 static int py_samr_CryptPasswordEx_set_data(PyObject *py_obj, PyObject *value, void *closure)
5072 struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(py_obj);
5073 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5076 for (data_cntr_0 = 0; data_cntr_0 < PyList_GET_SIZE(value); data_cntr_0++) {
5077 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, data_cntr_0), return -1;);
5078 object->data[data_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_0));
5084 static PyGetSetDef py_samr_CryptPasswordEx_getsetters[] = {
5085 { discard_const_p(char, "data"), py_samr_CryptPasswordEx_get_data, py_samr_CryptPasswordEx_set_data },
5089 static PyObject *py_samr_CryptPasswordEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5091 return pytalloc_new(struct samr_CryptPasswordEx, type);
5095 static PyTypeObject samr_CryptPasswordEx_Type = {
5096 PyObject_HEAD_INIT(NULL) 0,
5097 .tp_name = "samr.CryptPasswordEx",
5098 .tp_getset = py_samr_CryptPasswordEx_getsetters,
5100 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5101 .tp_basicsize = sizeof(pytalloc_Object),
5102 .tp_new = py_samr_CryptPasswordEx_new,
5106 static PyObject *py_samr_UserInfo25_get_info(PyObject *obj, void *closure)
5108 struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj);
5110 py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
5114 static int py_samr_UserInfo25_set_info(PyObject *py_obj, PyObject *value, void *closure)
5116 struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj);
5117 PY_CHECK_TYPE(&samr_UserInfo21_Type, value, return -1;);
5118 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5122 object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
5126 static PyObject *py_samr_UserInfo25_get_password(PyObject *obj, void *closure)
5128 struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj);
5129 PyObject *py_password;
5130 py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password);
5134 static int py_samr_UserInfo25_set_password(PyObject *py_obj, PyObject *value, void *closure)
5136 struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(py_obj);
5137 PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;);
5138 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5142 object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
5146 static PyGetSetDef py_samr_UserInfo25_getsetters[] = {
5147 { discard_const_p(char, "info"), py_samr_UserInfo25_get_info, py_samr_UserInfo25_set_info },
5148 { discard_const_p(char, "password"), py_samr_UserInfo25_get_password, py_samr_UserInfo25_set_password },
5152 static PyObject *py_samr_UserInfo25_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5154 return pytalloc_new(struct samr_UserInfo25, type);
5158 static PyTypeObject samr_UserInfo25_Type = {
5159 PyObject_HEAD_INIT(NULL) 0,
5160 .tp_name = "samr.UserInfo25",
5161 .tp_getset = py_samr_UserInfo25_getsetters,
5163 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5164 .tp_basicsize = sizeof(pytalloc_Object),
5165 .tp_new = py_samr_UserInfo25_new,
5169 static PyObject *py_samr_UserInfo26_get_password(PyObject *obj, void *closure)
5171 struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj);
5172 PyObject *py_password;
5173 py_password = pytalloc_reference_ex(&samr_CryptPasswordEx_Type, pytalloc_get_mem_ctx(obj), &object->password);
5177 static int py_samr_UserInfo26_set_password(PyObject *py_obj, PyObject *value, void *closure)
5179 struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj);
5180 PY_CHECK_TYPE(&samr_CryptPasswordEx_Type, value, return -1;);
5181 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5185 object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
5189 static PyObject *py_samr_UserInfo26_get_password_expired(PyObject *obj, void *closure)
5191 struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(obj);
5192 PyObject *py_password_expired;
5193 py_password_expired = PyInt_FromLong(object->password_expired);
5194 return py_password_expired;
5197 static int py_samr_UserInfo26_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
5199 struct samr_UserInfo26 *object = (struct samr_UserInfo26 *)pytalloc_get_ptr(py_obj);
5200 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5201 object->password_expired = PyInt_AsLong(value);
5205 static PyGetSetDef py_samr_UserInfo26_getsetters[] = {
5206 { discard_const_p(char, "password"), py_samr_UserInfo26_get_password, py_samr_UserInfo26_set_password },
5207 { discard_const_p(char, "password_expired"), py_samr_UserInfo26_get_password_expired, py_samr_UserInfo26_set_password_expired },
5211 static PyObject *py_samr_UserInfo26_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5213 return pytalloc_new(struct samr_UserInfo26, type);
5217 static PyTypeObject samr_UserInfo26_Type = {
5218 PyObject_HEAD_INIT(NULL) 0,
5219 .tp_name = "samr.UserInfo26",
5220 .tp_getset = py_samr_UserInfo26_getsetters,
5222 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5223 .tp_basicsize = sizeof(pytalloc_Object),
5224 .tp_new = py_samr_UserInfo26_new,
5227 PyObject *py_import_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, union samr_UserInfo *in)
5233 ret = pytalloc_reference_ex(&samr_UserInfo1_Type, mem_ctx, &in->info1);
5237 ret = pytalloc_reference_ex(&samr_UserInfo2_Type, mem_ctx, &in->info2);
5241 ret = pytalloc_reference_ex(&samr_UserInfo3_Type, mem_ctx, &in->info3);
5245 ret = pytalloc_reference_ex(&samr_UserInfo4_Type, mem_ctx, &in->info4);
5249 ret = pytalloc_reference_ex(&samr_UserInfo5_Type, mem_ctx, &in->info5);
5253 ret = pytalloc_reference_ex(&samr_UserInfo6_Type, mem_ctx, &in->info6);
5257 ret = pytalloc_reference_ex(&samr_UserInfo7_Type, mem_ctx, &in->info7);
5261 ret = pytalloc_reference_ex(&samr_UserInfo8_Type, mem_ctx, &in->info8);
5265 ret = pytalloc_reference_ex(&samr_UserInfo9_Type, mem_ctx, &in->info9);
5269 ret = pytalloc_reference_ex(&samr_UserInfo10_Type, mem_ctx, &in->info10);
5273 ret = pytalloc_reference_ex(&samr_UserInfo11_Type, mem_ctx, &in->info11);
5277 ret = pytalloc_reference_ex(&samr_UserInfo12_Type, mem_ctx, &in->info12);
5281 ret = pytalloc_reference_ex(&samr_UserInfo13_Type, mem_ctx, &in->info13);
5285 ret = pytalloc_reference_ex(&samr_UserInfo14_Type, mem_ctx, &in->info14);
5289 ret = pytalloc_reference_ex(&samr_UserInfo16_Type, mem_ctx, &in->info16);
5293 ret = pytalloc_reference_ex(&samr_UserInfo17_Type, mem_ctx, &in->info17);
5297 ret = pytalloc_reference_ex(&samr_UserInfo18_Type, mem_ctx, &in->info18);
5301 ret = pytalloc_reference_ex(&samr_UserInfo20_Type, mem_ctx, &in->info20);
5305 ret = pytalloc_reference_ex(&samr_UserInfo21_Type, mem_ctx, &in->info21);
5309 ret = pytalloc_reference_ex(&samr_UserInfo23_Type, mem_ctx, &in->info23);
5313 ret = pytalloc_reference_ex(&samr_UserInfo24_Type, mem_ctx, &in->info24);
5317 ret = pytalloc_reference_ex(&samr_UserInfo25_Type, mem_ctx, &in->info25);
5321 ret = pytalloc_reference_ex(&samr_UserInfo26_Type, mem_ctx, &in->info26);
5325 PyErr_SetString(PyExc_TypeError, "unknown union level");
5329 union samr_UserInfo *py_export_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5331 union samr_UserInfo *ret = talloc_zero(mem_ctx, union samr_UserInfo);
5334 PY_CHECK_TYPE(&samr_UserInfo1_Type, in, talloc_free(ret); return NULL;);
5335 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5337 talloc_free(ret); return NULL;
5339 ret->info1 = *(struct samr_UserInfo1 *)pytalloc_get_ptr(in);
5343 PY_CHECK_TYPE(&samr_UserInfo2_Type, in, talloc_free(ret); return NULL;);
5344 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5346 talloc_free(ret); return NULL;
5348 ret->info2 = *(struct samr_UserInfo2 *)pytalloc_get_ptr(in);
5352 PY_CHECK_TYPE(&samr_UserInfo3_Type, in, talloc_free(ret); return NULL;);
5353 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5355 talloc_free(ret); return NULL;
5357 ret->info3 = *(struct samr_UserInfo3 *)pytalloc_get_ptr(in);
5361 PY_CHECK_TYPE(&samr_UserInfo4_Type, in, talloc_free(ret); return NULL;);
5362 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5364 talloc_free(ret); return NULL;
5366 ret->info4 = *(struct samr_UserInfo4 *)pytalloc_get_ptr(in);
5370 PY_CHECK_TYPE(&samr_UserInfo5_Type, in, talloc_free(ret); return NULL;);
5371 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5373 talloc_free(ret); return NULL;
5375 ret->info5 = *(struct samr_UserInfo5 *)pytalloc_get_ptr(in);
5379 PY_CHECK_TYPE(&samr_UserInfo6_Type, in, talloc_free(ret); return NULL;);
5380 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5382 talloc_free(ret); return NULL;
5384 ret->info6 = *(struct samr_UserInfo6 *)pytalloc_get_ptr(in);
5388 PY_CHECK_TYPE(&samr_UserInfo7_Type, in, talloc_free(ret); return NULL;);
5389 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5391 talloc_free(ret); return NULL;
5393 ret->info7 = *(struct samr_UserInfo7 *)pytalloc_get_ptr(in);
5397 PY_CHECK_TYPE(&samr_UserInfo8_Type, in, talloc_free(ret); return NULL;);
5398 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5400 talloc_free(ret); return NULL;
5402 ret->info8 = *(struct samr_UserInfo8 *)pytalloc_get_ptr(in);
5406 PY_CHECK_TYPE(&samr_UserInfo9_Type, in, talloc_free(ret); return NULL;);
5407 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5409 talloc_free(ret); return NULL;
5411 ret->info9 = *(struct samr_UserInfo9 *)pytalloc_get_ptr(in);
5415 PY_CHECK_TYPE(&samr_UserInfo10_Type, in, talloc_free(ret); return NULL;);
5416 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5418 talloc_free(ret); return NULL;
5420 ret->info10 = *(struct samr_UserInfo10 *)pytalloc_get_ptr(in);
5424 PY_CHECK_TYPE(&samr_UserInfo11_Type, in, talloc_free(ret); return NULL;);
5425 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5427 talloc_free(ret); return NULL;
5429 ret->info11 = *(struct samr_UserInfo11 *)pytalloc_get_ptr(in);
5433 PY_CHECK_TYPE(&samr_UserInfo12_Type, in, talloc_free(ret); return NULL;);
5434 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5436 talloc_free(ret); return NULL;
5438 ret->info12 = *(struct samr_UserInfo12 *)pytalloc_get_ptr(in);
5442 PY_CHECK_TYPE(&samr_UserInfo13_Type, in, talloc_free(ret); return NULL;);
5443 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5445 talloc_free(ret); return NULL;
5447 ret->info13 = *(struct samr_UserInfo13 *)pytalloc_get_ptr(in);
5451 PY_CHECK_TYPE(&samr_UserInfo14_Type, in, talloc_free(ret); return NULL;);
5452 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5454 talloc_free(ret); return NULL;
5456 ret->info14 = *(struct samr_UserInfo14 *)pytalloc_get_ptr(in);
5460 PY_CHECK_TYPE(&samr_UserInfo16_Type, in, talloc_free(ret); return NULL;);
5461 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5463 talloc_free(ret); return NULL;
5465 ret->info16 = *(struct samr_UserInfo16 *)pytalloc_get_ptr(in);
5469 PY_CHECK_TYPE(&samr_UserInfo17_Type, in, talloc_free(ret); return NULL;);
5470 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5472 talloc_free(ret); return NULL;
5474 ret->info17 = *(struct samr_UserInfo17 *)pytalloc_get_ptr(in);
5478 PY_CHECK_TYPE(&samr_UserInfo18_Type, in, talloc_free(ret); return NULL;);
5479 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5481 talloc_free(ret); return NULL;
5483 ret->info18 = *(struct samr_UserInfo18 *)pytalloc_get_ptr(in);
5487 PY_CHECK_TYPE(&samr_UserInfo20_Type, in, talloc_free(ret); return NULL;);
5488 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5490 talloc_free(ret); return NULL;
5492 ret->info20 = *(struct samr_UserInfo20 *)pytalloc_get_ptr(in);
5496 PY_CHECK_TYPE(&samr_UserInfo21_Type, in, talloc_free(ret); return NULL;);
5497 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5499 talloc_free(ret); return NULL;
5501 ret->info21 = *(struct samr_UserInfo21 *)pytalloc_get_ptr(in);
5505 PY_CHECK_TYPE(&samr_UserInfo23_Type, in, talloc_free(ret); return NULL;);
5506 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5508 talloc_free(ret); return NULL;
5510 ret->info23 = *(struct samr_UserInfo23 *)pytalloc_get_ptr(in);
5514 PY_CHECK_TYPE(&samr_UserInfo24_Type, in, talloc_free(ret); return NULL;);
5515 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5517 talloc_free(ret); return NULL;
5519 ret->info24 = *(struct samr_UserInfo24 *)pytalloc_get_ptr(in);
5523 PY_CHECK_TYPE(&samr_UserInfo25_Type, in, talloc_free(ret); return NULL;);
5524 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5526 talloc_free(ret); return NULL;
5528 ret->info25 = *(struct samr_UserInfo25 *)pytalloc_get_ptr(in);
5532 PY_CHECK_TYPE(&samr_UserInfo26_Type, in, talloc_free(ret); return NULL;);
5533 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
5535 talloc_free(ret); return NULL;
5537 ret->info26 = *(struct samr_UserInfo26 *)pytalloc_get_ptr(in);
5541 PyErr_SetString(PyExc_TypeError, "invalid union level value");
5550 static PyObject *py_samr_RidWithAttribute_get_rid(PyObject *obj, void *closure)
5552 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj);
5554 py_rid = PyInt_FromLong(object->rid);
5558 static int py_samr_RidWithAttribute_set_rid(PyObject *py_obj, PyObject *value, void *closure)
5560 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5561 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5562 object->rid = PyInt_AsLong(value);
5566 static PyObject *py_samr_RidWithAttribute_get_attributes(PyObject *obj, void *closure)
5568 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj);
5569 PyObject *py_attributes;
5570 py_attributes = PyInt_FromLong(object->attributes);
5571 return py_attributes;
5574 static int py_samr_RidWithAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
5576 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5577 if (PyLong_Check(value)) {
5578 object->attributes = PyLong_AsLongLong(value);
5579 } else if (PyInt_Check(value)) {
5580 object->attributes = PyInt_AsLong(value);
5582 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5583 PyInt_Type.tp_name, PyLong_Type.tp_name);
5589 static PyGetSetDef py_samr_RidWithAttribute_getsetters[] = {
5590 { discard_const_p(char, "rid"), py_samr_RidWithAttribute_get_rid, py_samr_RidWithAttribute_set_rid },
5591 { discard_const_p(char, "attributes"), py_samr_RidWithAttribute_get_attributes, py_samr_RidWithAttribute_set_attributes },
5595 static PyObject *py_samr_RidWithAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5597 return pytalloc_new(struct samr_RidWithAttribute, type);
5600 static PyObject *py_samr_RidWithAttribute_ndr_pack(PyObject *py_obj)
5602 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5604 enum ndr_err_code err;
5605 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttribute);
5606 if (err != NDR_ERR_SUCCESS) {
5607 PyErr_SetNdrError(err);
5611 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5614 static PyObject *py_samr_RidWithAttribute_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5616 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5618 int blob_length = 0;
5619 enum ndr_err_code err;
5620 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5621 PyObject *allow_remaining_obj = NULL;
5622 bool allow_remaining = false;
5624 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5625 discard_const_p(char *, kwnames),
5626 &blob.data, &blob_length,
5627 &allow_remaining_obj)) {
5630 blob.length = blob_length;
5632 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5633 allow_remaining = true;
5636 if (allow_remaining) {
5637 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute);
5639 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute);
5641 if (err != NDR_ERR_SUCCESS) {
5642 PyErr_SetNdrError(err);
5649 static PyObject *py_samr_RidWithAttribute_ndr_print(PyObject *py_obj)
5651 struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5655 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttribute, "samr_RidWithAttribute", object);
5656 ret = PyString_FromString(retstr);
5657 talloc_free(retstr);
5662 static PyMethodDef py_samr_RidWithAttribute_methods[] = {
5663 { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttribute_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5664 { "__ndr_unpack__", (PyCFunction)py_samr_RidWithAttribute_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5665 { "__ndr_print__", (PyCFunction)py_samr_RidWithAttribute_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5666 { NULL, NULL, 0, NULL }
5670 static PyTypeObject samr_RidWithAttribute_Type = {
5671 PyObject_HEAD_INIT(NULL) 0,
5672 .tp_name = "samr.RidWithAttribute",
5673 .tp_getset = py_samr_RidWithAttribute_getsetters,
5674 .tp_methods = py_samr_RidWithAttribute_methods,
5675 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5676 .tp_basicsize = sizeof(pytalloc_Object),
5677 .tp_new = py_samr_RidWithAttribute_new,
5681 static PyObject *py_samr_RidWithAttributeArray_get_count(PyObject *obj, void *closure)
5683 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
5685 py_count = PyInt_FromLong(object->count);
5689 static int py_samr_RidWithAttributeArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5691 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5692 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5693 object->count = PyInt_AsLong(value);
5697 static PyObject *py_samr_RidWithAttributeArray_get_rids(PyObject *obj, void *closure)
5699 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
5701 if (object->rids == NULL) {
5705 py_rids = PyList_New(object->count);
5706 if (py_rids == NULL) {
5711 for (rids_cntr_1 = 0; rids_cntr_1 < object->count; rids_cntr_1++) {
5712 PyObject *py_rids_1;
5713 py_rids_1 = pytalloc_reference_ex(&samr_RidWithAttribute_Type, object->rids, &object->rids[rids_cntr_1]);
5714 PyList_SetItem(py_rids, rids_cntr_1, py_rids_1);
5721 static int py_samr_RidWithAttributeArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
5723 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5724 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->rids);
5725 if (value == Py_None) {
5726 object->rids = NULL;
5728 object->rids = NULL;
5729 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5732 object->rids = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->rids, PyList_GET_SIZE(value));
5733 if (!object->rids) { return -1;; }
5734 talloc_set_name_const(object->rids, "ARRAY: object->rids");
5735 for (rids_cntr_1 = 0; rids_cntr_1 < PyList_GET_SIZE(value); rids_cntr_1++) {
5736 PY_CHECK_TYPE(&samr_RidWithAttribute_Type, PyList_GET_ITEM(value, rids_cntr_1), return -1;);
5737 if (talloc_reference(object->rids, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, rids_cntr_1))) == NULL) {
5741 object->rids[rids_cntr_1] = *(struct samr_RidWithAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, rids_cntr_1));
5748 static PyGetSetDef py_samr_RidWithAttributeArray_getsetters[] = {
5749 { discard_const_p(char, "count"), py_samr_RidWithAttributeArray_get_count, py_samr_RidWithAttributeArray_set_count },
5750 { discard_const_p(char, "rids"), py_samr_RidWithAttributeArray_get_rids, py_samr_RidWithAttributeArray_set_rids },
5754 static PyObject *py_samr_RidWithAttributeArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5756 return pytalloc_new(struct samr_RidWithAttributeArray, type);
5759 static PyObject *py_samr_RidWithAttributeArray_ndr_pack(PyObject *py_obj)
5761 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5763 enum ndr_err_code err;
5764 err = ndr_push_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_push_flags_fn_t)ndr_push_samr_RidWithAttributeArray);
5765 if (err != NDR_ERR_SUCCESS) {
5766 PyErr_SetNdrError(err);
5770 return PyString_FromStringAndSize((char *)blob.data, blob.length);
5773 static PyObject *py_samr_RidWithAttributeArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5775 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5777 int blob_length = 0;
5778 enum ndr_err_code err;
5779 const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
5780 PyObject *allow_remaining_obj = NULL;
5781 bool allow_remaining = false;
5783 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|O:__ndr_unpack__",
5784 discard_const_p(char *, kwnames),
5785 &blob.data, &blob_length,
5786 &allow_remaining_obj)) {
5789 blob.length = blob_length;
5791 if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5792 allow_remaining = true;
5795 if (allow_remaining) {
5796 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray);
5798 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray);
5800 if (err != NDR_ERR_SUCCESS) {
5801 PyErr_SetNdrError(err);
5808 static PyObject *py_samr_RidWithAttributeArray_ndr_print(PyObject *py_obj)
5810 struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5814 retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_samr_RidWithAttributeArray, "samr_RidWithAttributeArray", object);
5815 ret = PyString_FromString(retstr);
5816 talloc_free(retstr);
5821 static PyMethodDef py_samr_RidWithAttributeArray_methods[] = {
5822 { "__ndr_pack__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
5823 { "__ndr_unpack__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_unpack, METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
5824 { "__ndr_print__", (PyCFunction)py_samr_RidWithAttributeArray_ndr_print, METH_VARARGS, "S.ndr_print(object) -> None\nNDR print" },
5825 { NULL, NULL, 0, NULL }
5829 static PyTypeObject samr_RidWithAttributeArray_Type = {
5830 PyObject_HEAD_INIT(NULL) 0,
5831 .tp_name = "samr.RidWithAttributeArray",
5832 .tp_getset = py_samr_RidWithAttributeArray_getsetters,
5833 .tp_methods = py_samr_RidWithAttributeArray_methods,
5834 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5835 .tp_basicsize = sizeof(pytalloc_Object),
5836 .tp_new = py_samr_RidWithAttributeArray_new,
5840 static PyObject *py_samr_DispEntryGeneral_get_idx(PyObject *obj, void *closure)
5842 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5844 py_idx = PyInt_FromLong(object->idx);
5848 static int py_samr_DispEntryGeneral_set_idx(PyObject *py_obj, PyObject *value, void *closure)
5850 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5851 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5852 object->idx = PyInt_AsLong(value);
5856 static PyObject *py_samr_DispEntryGeneral_get_rid(PyObject *obj, void *closure)
5858 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5860 py_rid = PyInt_FromLong(object->rid);
5864 static int py_samr_DispEntryGeneral_set_rid(PyObject *py_obj, PyObject *value, void *closure)
5866 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5867 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5868 object->rid = PyInt_AsLong(value);
5872 static PyObject *py_samr_DispEntryGeneral_get_acct_flags(PyObject *obj, void *closure)
5874 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5875 PyObject *py_acct_flags;
5876 py_acct_flags = PyInt_FromLong(object->acct_flags);
5877 return py_acct_flags;
5880 static int py_samr_DispEntryGeneral_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
5882 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5883 if (PyLong_Check(value)) {
5884 object->acct_flags = PyLong_AsLongLong(value);
5885 } else if (PyInt_Check(value)) {
5886 object->acct_flags = PyInt_AsLong(value);
5888 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5889 PyInt_Type.tp_name, PyLong_Type.tp_name);
5895 static PyObject *py_samr_DispEntryGeneral_get_account_name(PyObject *obj, void *closure)
5897 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5898 PyObject *py_account_name;
5899 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
5900 return py_account_name;
5903 static int py_samr_DispEntryGeneral_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
5905 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5906 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5907 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5911 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5915 static PyObject *py_samr_DispEntryGeneral_get_description(PyObject *obj, void *closure)
5917 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5918 PyObject *py_description;
5919 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
5920 return py_description;
5923 static int py_samr_DispEntryGeneral_set_description(PyObject *py_obj, PyObject *value, void *closure)
5925 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5926 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5927 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5931 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
5935 static PyObject *py_samr_DispEntryGeneral_get_full_name(PyObject *obj, void *closure)
5937 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5938 PyObject *py_full_name;
5939 py_full_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->full_name);
5940 return py_full_name;
5943 static int py_samr_DispEntryGeneral_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
5945 struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(py_obj);
5946 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
5947 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
5951 object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5955 static PyGetSetDef py_samr_DispEntryGeneral_getsetters[] = {
5956 { discard_const_p(char, "idx"), py_samr_DispEntryGeneral_get_idx, py_samr_DispEntryGeneral_set_idx },
5957 { discard_const_p(char, "rid"), py_samr_DispEntryGeneral_get_rid, py_samr_DispEntryGeneral_set_rid },
5958 { discard_const_p(char, "acct_flags"), py_samr_DispEntryGeneral_get_acct_flags, py_samr_DispEntryGeneral_set_acct_flags },
5959 { discard_const_p(char, "account_name"), py_samr_DispEntryGeneral_get_account_name, py_samr_DispEntryGeneral_set_account_name },
5960 { discard_const_p(char, "description"), py_samr_DispEntryGeneral_get_description, py_samr_DispEntryGeneral_set_description },
5961 { discard_const_p(char, "full_name"), py_samr_DispEntryGeneral_get_full_name, py_samr_DispEntryGeneral_set_full_name },
5965 static PyObject *py_samr_DispEntryGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5967 return pytalloc_new(struct samr_DispEntryGeneral, type);
5971 static PyTypeObject samr_DispEntryGeneral_Type = {
5972 PyObject_HEAD_INIT(NULL) 0,
5973 .tp_name = "samr.DispEntryGeneral",
5974 .tp_getset = py_samr_DispEntryGeneral_getsetters,
5976 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5977 .tp_basicsize = sizeof(pytalloc_Object),
5978 .tp_new = py_samr_DispEntryGeneral_new,
5982 static PyObject *py_samr_DispInfoGeneral_get_count(PyObject *obj, void *closure)
5984 struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj);
5986 py_count = PyInt_FromLong(object->count);
5990 static int py_samr_DispInfoGeneral_set_count(PyObject *py_obj, PyObject *value, void *closure)
5992 struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj);
5993 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
5994 object->count = PyInt_AsLong(value);
5998 static PyObject *py_samr_DispInfoGeneral_get_entries(PyObject *obj, void *closure)
6000 struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj);
6001 PyObject *py_entries;
6002 if (object->entries == NULL) {
6003 py_entries = Py_None;
6004 Py_INCREF(py_entries);
6006 py_entries = PyList_New(object->count);
6007 if (py_entries == NULL) {
6012 for (entries_cntr_1 = 0; entries_cntr_1 < object->count; entries_cntr_1++) {
6013 PyObject *py_entries_1;
6014 py_entries_1 = pytalloc_reference_ex(&samr_DispEntryGeneral_Type, object->entries, &object->entries[entries_cntr_1]);
6015 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
6022 static int py_samr_DispInfoGeneral_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6024 struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(py_obj);
6025 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->entries);
6026 if (value == Py_None) {
6027 object->entries = NULL;
6029 object->entries = NULL;
6030 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6033 object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
6034 if (!object->entries) { return -1;; }
6035 talloc_set_name_const(object->entries, "ARRAY: object->entries");
6036 for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
6037 PY_CHECK_TYPE(&samr_DispEntryGeneral_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
6038 if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
6042 object->entries[entries_cntr_1] = *(struct samr_DispEntryGeneral *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6049 static PyGetSetDef py_samr_DispInfoGeneral_getsetters[] = {
6050 { discard_const_p(char, "count"), py_samr_DispInfoGeneral_get_count, py_samr_DispInfoGeneral_set_count },
6051 { discard_const_p(char, "entries"), py_samr_DispInfoGeneral_get_entries, py_samr_DispInfoGeneral_set_entries },
6055 static PyObject *py_samr_DispInfoGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6057 return pytalloc_new(struct samr_DispInfoGeneral, type);
6061 static PyTypeObject samr_DispInfoGeneral_Type = {
6062 PyObject_HEAD_INIT(NULL) 0,
6063 .tp_name = "samr.DispInfoGeneral",
6064 .tp_getset = py_samr_DispInfoGeneral_getsetters,
6066 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6067 .tp_basicsize = sizeof(pytalloc_Object),
6068 .tp_new = py_samr_DispInfoGeneral_new,
6072 static PyObject *py_samr_DispEntryFull_get_idx(PyObject *obj, void *closure)
6074 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6076 py_idx = PyInt_FromLong(object->idx);
6080 static int py_samr_DispEntryFull_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6082 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
6083 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6084 object->idx = PyInt_AsLong(value);
6088 static PyObject *py_samr_DispEntryFull_get_rid(PyObject *obj, void *closure)
6090 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6092 py_rid = PyInt_FromLong(object->rid);
6096 static int py_samr_DispEntryFull_set_rid(PyObject *py_obj, PyObject *value, void *closure)
6098 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
6099 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6100 object->rid = PyInt_AsLong(value);
6104 static PyObject *py_samr_DispEntryFull_get_acct_flags(PyObject *obj, void *closure)
6106 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6107 PyObject *py_acct_flags;
6108 py_acct_flags = PyInt_FromLong(object->acct_flags);
6109 return py_acct_flags;
6112 static int py_samr_DispEntryFull_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
6114 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
6115 if (PyLong_Check(value)) {
6116 object->acct_flags = PyLong_AsLongLong(value);
6117 } else if (PyInt_Check(value)) {
6118 object->acct_flags = PyInt_AsLong(value);
6120 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6121 PyInt_Type.tp_name, PyLong_Type.tp_name);
6127 static PyObject *py_samr_DispEntryFull_get_account_name(PyObject *obj, void *closure)
6129 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6130 PyObject *py_account_name;
6131 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
6132 return py_account_name;
6135 static int py_samr_DispEntryFull_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6137 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
6138 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6139 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6143 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6147 static PyObject *py_samr_DispEntryFull_get_description(PyObject *obj, void *closure)
6149 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6150 PyObject *py_description;
6151 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
6152 return py_description;
6155 static int py_samr_DispEntryFull_set_description(PyObject *py_obj, PyObject *value, void *closure)
6157 struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(py_obj);
6158 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6159 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6163 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
6167 static PyGetSetDef py_samr_DispEntryFull_getsetters[] = {
6168 { discard_const_p(char, "idx"), py_samr_DispEntryFull_get_idx, py_samr_DispEntryFull_set_idx },
6169 { discard_const_p(char, "rid"), py_samr_DispEntryFull_get_rid, py_samr_DispEntryFull_set_rid },
6170 { discard_const_p(char, "acct_flags"), py_samr_DispEntryFull_get_acct_flags, py_samr_DispEntryFull_set_acct_flags },
6171 { discard_const_p(char, "account_name"), py_samr_DispEntryFull_get_account_name, py_samr_DispEntryFull_set_account_name },
6172 { discard_const_p(char, "description"), py_samr_DispEntryFull_get_description, py_samr_DispEntryFull_set_description },
6176 static PyObject *py_samr_DispEntryFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6178 return pytalloc_new(struct samr_DispEntryFull, type);
6182 static PyTypeObject samr_DispEntryFull_Type = {
6183 PyObject_HEAD_INIT(NULL) 0,
6184 .tp_name = "samr.DispEntryFull",
6185 .tp_getset = py_samr_DispEntryFull_getsetters,
6187 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6188 .tp_basicsize = sizeof(pytalloc_Object),
6189 .tp_new = py_samr_DispEntryFull_new,
6193 static PyObject *py_samr_DispInfoFull_get_count(PyObject *obj, void *closure)
6195 struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj);
6197 py_count = PyInt_FromLong(object->count);
6201 static int py_samr_DispInfoFull_set_count(PyObject *py_obj, PyObject *value, void *closure)
6203 struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj);
6204 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6205 object->count = PyInt_AsLong(value);
6209 static PyObject *py_samr_DispInfoFull_get_entries(PyObject *obj, void *closure)
6211 struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj);
6212 PyObject *py_entries;
6213 if (object->entries == NULL) {
6214 py_entries = Py_None;
6215 Py_INCREF(py_entries);
6217 py_entries = PyList_New(object->count);
6218 if (py_entries == NULL) {
6223 for (entries_cntr_1 = 0; entries_cntr_1 < object->count; entries_cntr_1++) {
6224 PyObject *py_entries_1;
6225 py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFull_Type, object->entries, &object->entries[entries_cntr_1]);
6226 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
6233 static int py_samr_DispInfoFull_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6235 struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(py_obj);
6236 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->entries);
6237 if (value == Py_None) {
6238 object->entries = NULL;
6240 object->entries = NULL;
6241 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6244 object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
6245 if (!object->entries) { return -1;; }
6246 talloc_set_name_const(object->entries, "ARRAY: object->entries");
6247 for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
6248 PY_CHECK_TYPE(&samr_DispEntryFull_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
6249 if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
6253 object->entries[entries_cntr_1] = *(struct samr_DispEntryFull *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6260 static PyGetSetDef py_samr_DispInfoFull_getsetters[] = {
6261 { discard_const_p(char, "count"), py_samr_DispInfoFull_get_count, py_samr_DispInfoFull_set_count },
6262 { discard_const_p(char, "entries"), py_samr_DispInfoFull_get_entries, py_samr_DispInfoFull_set_entries },
6266 static PyObject *py_samr_DispInfoFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6268 return pytalloc_new(struct samr_DispInfoFull, type);
6272 static PyTypeObject samr_DispInfoFull_Type = {
6273 PyObject_HEAD_INIT(NULL) 0,
6274 .tp_name = "samr.DispInfoFull",
6275 .tp_getset = py_samr_DispInfoFull_getsetters,
6277 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6278 .tp_basicsize = sizeof(pytalloc_Object),
6279 .tp_new = py_samr_DispInfoFull_new,
6283 static PyObject *py_samr_DispEntryFullGroup_get_idx(PyObject *obj, void *closure)
6285 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6287 py_idx = PyInt_FromLong(object->idx);
6291 static int py_samr_DispEntryFullGroup_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6293 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
6294 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6295 object->idx = PyInt_AsLong(value);
6299 static PyObject *py_samr_DispEntryFullGroup_get_rid(PyObject *obj, void *closure)
6301 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6303 py_rid = PyInt_FromLong(object->rid);
6307 static int py_samr_DispEntryFullGroup_set_rid(PyObject *py_obj, PyObject *value, void *closure)
6309 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
6310 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6311 object->rid = PyInt_AsLong(value);
6315 static PyObject *py_samr_DispEntryFullGroup_get_acct_flags(PyObject *obj, void *closure)
6317 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6318 PyObject *py_acct_flags;
6319 py_acct_flags = PyInt_FromLong(object->acct_flags);
6320 return py_acct_flags;
6323 static int py_samr_DispEntryFullGroup_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
6325 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
6326 if (PyLong_Check(value)) {
6327 object->acct_flags = PyLong_AsLongLong(value);
6328 } else if (PyInt_Check(value)) {
6329 object->acct_flags = PyInt_AsLong(value);
6331 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6332 PyInt_Type.tp_name, PyLong_Type.tp_name);
6338 static PyObject *py_samr_DispEntryFullGroup_get_account_name(PyObject *obj, void *closure)
6340 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6341 PyObject *py_account_name;
6342 py_account_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
6343 return py_account_name;
6346 static int py_samr_DispEntryFullGroup_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6348 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
6349 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6350 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6354 object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6358 static PyObject *py_samr_DispEntryFullGroup_get_description(PyObject *obj, void *closure)
6360 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6361 PyObject *py_description;
6362 py_description = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->description);
6363 return py_description;
6366 static int py_samr_DispEntryFullGroup_set_description(PyObject *py_obj, PyObject *value, void *closure)
6368 struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(py_obj);
6369 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6370 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6374 object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
6378 static PyGetSetDef py_samr_DispEntryFullGroup_getsetters[] = {
6379 { discard_const_p(char, "idx"), py_samr_DispEntryFullGroup_get_idx, py_samr_DispEntryFullGroup_set_idx },
6380 { discard_const_p(char, "rid"), py_samr_DispEntryFullGroup_get_rid, py_samr_DispEntryFullGroup_set_rid },
6381 { discard_const_p(char, "acct_flags"), py_samr_DispEntryFullGroup_get_acct_flags, py_samr_DispEntryFullGroup_set_acct_flags },
6382 { discard_const_p(char, "account_name"), py_samr_DispEntryFullGroup_get_account_name, py_samr_DispEntryFullGroup_set_account_name },
6383 { discard_const_p(char, "description"), py_samr_DispEntryFullGroup_get_description, py_samr_DispEntryFullGroup_set_description },
6387 static PyObject *py_samr_DispEntryFullGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6389 return pytalloc_new(struct samr_DispEntryFullGroup, type);
6393 static PyTypeObject samr_DispEntryFullGroup_Type = {
6394 PyObject_HEAD_INIT(NULL) 0,
6395 .tp_name = "samr.DispEntryFullGroup",
6396 .tp_getset = py_samr_DispEntryFullGroup_getsetters,
6398 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6399 .tp_basicsize = sizeof(pytalloc_Object),
6400 .tp_new = py_samr_DispEntryFullGroup_new,
6404 static PyObject *py_samr_DispInfoFullGroups_get_count(PyObject *obj, void *closure)
6406 struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj);
6408 py_count = PyInt_FromLong(object->count);
6412 static int py_samr_DispInfoFullGroups_set_count(PyObject *py_obj, PyObject *value, void *closure)
6414 struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj);
6415 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6416 object->count = PyInt_AsLong(value);
6420 static PyObject *py_samr_DispInfoFullGroups_get_entries(PyObject *obj, void *closure)
6422 struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj);
6423 PyObject *py_entries;
6424 if (object->entries == NULL) {
6425 py_entries = Py_None;
6426 Py_INCREF(py_entries);
6428 py_entries = PyList_New(object->count);
6429 if (py_entries == NULL) {
6434 for (entries_cntr_1 = 0; entries_cntr_1 < object->count; entries_cntr_1++) {
6435 PyObject *py_entries_1;
6436 py_entries_1 = pytalloc_reference_ex(&samr_DispEntryFullGroup_Type, object->entries, &object->entries[entries_cntr_1]);
6437 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
6444 static int py_samr_DispInfoFullGroups_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6446 struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(py_obj);
6447 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->entries);
6448 if (value == Py_None) {
6449 object->entries = NULL;
6451 object->entries = NULL;
6452 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6455 object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
6456 if (!object->entries) { return -1;; }
6457 talloc_set_name_const(object->entries, "ARRAY: object->entries");
6458 for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
6459 PY_CHECK_TYPE(&samr_DispEntryFullGroup_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
6460 if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
6464 object->entries[entries_cntr_1] = *(struct samr_DispEntryFullGroup *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6471 static PyGetSetDef py_samr_DispInfoFullGroups_getsetters[] = {
6472 { discard_const_p(char, "count"), py_samr_DispInfoFullGroups_get_count, py_samr_DispInfoFullGroups_set_count },
6473 { discard_const_p(char, "entries"), py_samr_DispInfoFullGroups_get_entries, py_samr_DispInfoFullGroups_set_entries },
6477 static PyObject *py_samr_DispInfoFullGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6479 return pytalloc_new(struct samr_DispInfoFullGroups, type);
6483 static PyTypeObject samr_DispInfoFullGroups_Type = {
6484 PyObject_HEAD_INIT(NULL) 0,
6485 .tp_name = "samr.DispInfoFullGroups",
6486 .tp_getset = py_samr_DispInfoFullGroups_getsetters,
6488 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6489 .tp_basicsize = sizeof(pytalloc_Object),
6490 .tp_new = py_samr_DispInfoFullGroups_new,
6494 static PyObject *py_samr_DispEntryAscii_get_idx(PyObject *obj, void *closure)
6496 struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj);
6498 py_idx = PyInt_FromLong(object->idx);
6502 static int py_samr_DispEntryAscii_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6504 struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj);
6505 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6506 object->idx = PyInt_AsLong(value);
6510 static PyObject *py_samr_DispEntryAscii_get_account_name(PyObject *obj, void *closure)
6512 struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj);
6513 PyObject *py_account_name;
6514 py_account_name = pytalloc_reference_ex(lsa_AsciiStringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account_name);
6515 return py_account_name;
6518 static int py_samr_DispEntryAscii_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6520 struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(py_obj);
6521 PY_CHECK_TYPE(lsa_AsciiStringLarge_Type, value, return -1;);
6522 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6526 object->account_name = *(struct lsa_AsciiStringLarge *)pytalloc_get_ptr(value);
6530 static PyGetSetDef py_samr_DispEntryAscii_getsetters[] = {
6531 { discard_const_p(char, "idx"), py_samr_DispEntryAscii_get_idx, py_samr_DispEntryAscii_set_idx },
6532 { discard_const_p(char, "account_name"), py_samr_DispEntryAscii_get_account_name, py_samr_DispEntryAscii_set_account_name },
6536 static PyObject *py_samr_DispEntryAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6538 return pytalloc_new(struct samr_DispEntryAscii, type);
6542 static PyTypeObject samr_DispEntryAscii_Type = {
6543 PyObject_HEAD_INIT(NULL) 0,
6544 .tp_name = "samr.DispEntryAscii",
6545 .tp_getset = py_samr_DispEntryAscii_getsetters,
6547 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6548 .tp_basicsize = sizeof(pytalloc_Object),
6549 .tp_new = py_samr_DispEntryAscii_new,
6553 static PyObject *py_samr_DispInfoAscii_get_count(PyObject *obj, void *closure)
6555 struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj);
6557 py_count = PyInt_FromLong(object->count);
6561 static int py_samr_DispInfoAscii_set_count(PyObject *py_obj, PyObject *value, void *closure)
6563 struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj);
6564 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6565 object->count = PyInt_AsLong(value);
6569 static PyObject *py_samr_DispInfoAscii_get_entries(PyObject *obj, void *closure)
6571 struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj);
6572 PyObject *py_entries;
6573 if (object->entries == NULL) {
6574 py_entries = Py_None;
6575 Py_INCREF(py_entries);
6577 py_entries = PyList_New(object->count);
6578 if (py_entries == NULL) {
6583 for (entries_cntr_1 = 0; entries_cntr_1 < object->count; entries_cntr_1++) {
6584 PyObject *py_entries_1;
6585 py_entries_1 = pytalloc_reference_ex(&samr_DispEntryAscii_Type, object->entries, &object->entries[entries_cntr_1]);
6586 PyList_SetItem(py_entries, entries_cntr_1, py_entries_1);
6593 static int py_samr_DispInfoAscii_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6595 struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(py_obj);
6596 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->entries);
6597 if (value == Py_None) {
6598 object->entries = NULL;
6600 object->entries = NULL;
6601 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6604 object->entries = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->entries, PyList_GET_SIZE(value));
6605 if (!object->entries) { return -1;; }
6606 talloc_set_name_const(object->entries, "ARRAY: object->entries");
6607 for (entries_cntr_1 = 0; entries_cntr_1 < PyList_GET_SIZE(value); entries_cntr_1++) {
6608 PY_CHECK_TYPE(&samr_DispEntryAscii_Type, PyList_GET_ITEM(value, entries_cntr_1), return -1;);
6609 if (talloc_reference(object->entries, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, entries_cntr_1))) == NULL) {
6613 object->entries[entries_cntr_1] = *(struct samr_DispEntryAscii *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6620 static PyGetSetDef py_samr_DispInfoAscii_getsetters[] = {
6621 { discard_const_p(char, "count"), py_samr_DispInfoAscii_get_count, py_samr_DispInfoAscii_set_count },
6622 { discard_const_p(char, "entries"), py_samr_DispInfoAscii_get_entries, py_samr_DispInfoAscii_set_entries },
6626 static PyObject *py_samr_DispInfoAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6628 return pytalloc_new(struct samr_DispInfoAscii, type);
6632 static PyTypeObject samr_DispInfoAscii_Type = {
6633 PyObject_HEAD_INIT(NULL) 0,
6634 .tp_name = "samr.DispInfoAscii",
6635 .tp_getset = py_samr_DispInfoAscii_getsetters,
6637 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6638 .tp_basicsize = sizeof(pytalloc_Object),
6639 .tp_new = py_samr_DispInfoAscii_new,
6642 PyObject *py_import_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, union samr_DispInfo *in)
6648 ret = pytalloc_reference_ex(&samr_DispInfoGeneral_Type, mem_ctx, &in->info1);
6652 ret = pytalloc_reference_ex(&samr_DispInfoFull_Type, mem_ctx, &in->info2);
6656 ret = pytalloc_reference_ex(&samr_DispInfoFullGroups_Type, mem_ctx, &in->info3);
6660 ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info4);
6664 ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info5);
6668 PyErr_SetString(PyExc_TypeError, "unknown union level");
6672 union samr_DispInfo *py_export_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6674 union samr_DispInfo *ret = talloc_zero(mem_ctx, union samr_DispInfo);
6677 PY_CHECK_TYPE(&samr_DispInfoGeneral_Type, in, talloc_free(ret); return NULL;);
6678 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6680 talloc_free(ret); return NULL;
6682 ret->info1 = *(struct samr_DispInfoGeneral *)pytalloc_get_ptr(in);
6686 PY_CHECK_TYPE(&samr_DispInfoFull_Type, in, talloc_free(ret); return NULL;);
6687 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6689 talloc_free(ret); return NULL;
6691 ret->info2 = *(struct samr_DispInfoFull *)pytalloc_get_ptr(in);
6695 PY_CHECK_TYPE(&samr_DispInfoFullGroups_Type, in, talloc_free(ret); return NULL;);
6696 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6698 talloc_free(ret); return NULL;
6700 ret->info3 = *(struct samr_DispInfoFullGroups *)pytalloc_get_ptr(in);
6704 PY_CHECK_TYPE(&samr_DispInfoAscii_Type, in, talloc_free(ret); return NULL;);
6705 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6707 talloc_free(ret); return NULL;
6709 ret->info4 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
6713 PY_CHECK_TYPE(&samr_DispInfoAscii_Type, in, talloc_free(ret); return NULL;);
6714 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6716 talloc_free(ret); return NULL;
6718 ret->info5 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
6722 PyErr_SetString(PyExc_TypeError, "invalid union level value");
6731 static PyObject *py_samr_PwInfo_get_min_password_length(PyObject *obj, void *closure)
6733 struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj);
6734 PyObject *py_min_password_length;
6735 py_min_password_length = PyInt_FromLong(object->min_password_length);
6736 return py_min_password_length;
6739 static int py_samr_PwInfo_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
6741 struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj);
6742 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6743 object->min_password_length = PyInt_AsLong(value);
6747 static PyObject *py_samr_PwInfo_get_password_properties(PyObject *obj, void *closure)
6749 struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(obj);
6750 PyObject *py_password_properties;
6751 py_password_properties = PyInt_FromLong(object->password_properties);
6752 return py_password_properties;
6755 static int py_samr_PwInfo_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
6757 struct samr_PwInfo *object = (struct samr_PwInfo *)pytalloc_get_ptr(py_obj);
6758 if (PyLong_Check(value)) {
6759 object->password_properties = PyLong_AsLongLong(value);
6760 } else if (PyInt_Check(value)) {
6761 object->password_properties = PyInt_AsLong(value);
6763 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6764 PyInt_Type.tp_name, PyLong_Type.tp_name);
6770 static PyGetSetDef py_samr_PwInfo_getsetters[] = {
6771 { discard_const_p(char, "min_password_length"), py_samr_PwInfo_get_min_password_length, py_samr_PwInfo_set_min_password_length },
6772 { discard_const_p(char, "password_properties"), py_samr_PwInfo_get_password_properties, py_samr_PwInfo_set_password_properties },
6776 static PyObject *py_samr_PwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6778 return pytalloc_new(struct samr_PwInfo, type);
6782 static PyTypeObject samr_PwInfo_Type = {
6783 PyObject_HEAD_INIT(NULL) 0,
6784 .tp_name = "samr.PwInfo",
6785 .tp_getset = py_samr_PwInfo_getsetters,
6787 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6788 .tp_basicsize = sizeof(pytalloc_Object),
6789 .tp_new = py_samr_PwInfo_new,
6793 static PyObject *py_userPwdChangeFailureInformation_get_extendedFailureReason(PyObject *obj, void *closure)
6795 struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj);
6796 PyObject *py_extendedFailureReason;
6797 py_extendedFailureReason = PyInt_FromLong(object->extendedFailureReason);
6798 return py_extendedFailureReason;
6801 static int py_userPwdChangeFailureInformation_set_extendedFailureReason(PyObject *py_obj, PyObject *value, void *closure)
6803 struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj);
6804 if (PyLong_Check(value)) {
6805 object->extendedFailureReason = PyLong_AsLongLong(value);
6806 } else if (PyInt_Check(value)) {
6807 object->extendedFailureReason = PyInt_AsLong(value);
6809 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6810 PyInt_Type.tp_name, PyLong_Type.tp_name);
6816 static PyObject *py_userPwdChangeFailureInformation_get_filterModuleName(PyObject *obj, void *closure)
6818 struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(obj);
6819 PyObject *py_filterModuleName;
6820 py_filterModuleName = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->filterModuleName);
6821 return py_filterModuleName;
6824 static int py_userPwdChangeFailureInformation_set_filterModuleName(PyObject *py_obj, PyObject *value, void *closure)
6826 struct userPwdChangeFailureInformation *object = (struct userPwdChangeFailureInformation *)pytalloc_get_ptr(py_obj);
6827 PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
6828 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
6832 object->filterModuleName = *(struct lsa_String *)pytalloc_get_ptr(value);
6836 static PyGetSetDef py_userPwdChangeFailureInformation_getsetters[] = {
6837 { discard_const_p(char, "extendedFailureReason"), py_userPwdChangeFailureInformation_get_extendedFailureReason, py_userPwdChangeFailureInformation_set_extendedFailureReason },
6838 { discard_const_p(char, "filterModuleName"), py_userPwdChangeFailureInformation_get_filterModuleName, py_userPwdChangeFailureInformation_set_filterModuleName },
6842 static PyObject *py_userPwdChangeFailureInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6844 return pytalloc_new(struct userPwdChangeFailureInformation, type);
6848 static PyTypeObject userPwdChangeFailureInformation_Type = {
6849 PyObject_HEAD_INIT(NULL) 0,
6850 .tp_name = "samr.userPwdChangeFailureInformation",
6851 .tp_getset = py_userPwdChangeFailureInformation_getsetters,
6853 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6854 .tp_basicsize = sizeof(pytalloc_Object),
6855 .tp_new = py_userPwdChangeFailureInformation_new,
6859 static PyObject *py_samr_ConnectInfo1_get_client_version(PyObject *obj, void *closure)
6861 struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj);
6862 PyObject *py_client_version;
6863 py_client_version = PyInt_FromLong(object->client_version);
6864 return py_client_version;
6867 static int py_samr_ConnectInfo1_set_client_version(PyObject *py_obj, PyObject *value, void *closure)
6869 struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj);
6870 if (PyLong_Check(value)) {
6871 object->client_version = PyLong_AsLongLong(value);
6872 } else if (PyInt_Check(value)) {
6873 object->client_version = PyInt_AsLong(value);
6875 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6876 PyInt_Type.tp_name, PyLong_Type.tp_name);
6882 static PyObject *py_samr_ConnectInfo1_get_unknown2(PyObject *obj, void *closure)
6884 struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj);
6885 PyObject *py_unknown2;
6886 py_unknown2 = PyInt_FromLong(object->unknown2);
6890 static int py_samr_ConnectInfo1_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
6892 struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(py_obj);
6893 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6894 object->unknown2 = PyInt_AsLong(value);
6898 static PyGetSetDef py_samr_ConnectInfo1_getsetters[] = {
6899 { discard_const_p(char, "client_version"), py_samr_ConnectInfo1_get_client_version, py_samr_ConnectInfo1_set_client_version },
6900 { discard_const_p(char, "unknown2"), py_samr_ConnectInfo1_get_unknown2, py_samr_ConnectInfo1_set_unknown2 },
6904 static PyObject *py_samr_ConnectInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6906 return pytalloc_new(struct samr_ConnectInfo1, type);
6910 static PyTypeObject samr_ConnectInfo1_Type = {
6911 PyObject_HEAD_INIT(NULL) 0,
6912 .tp_name = "samr.ConnectInfo1",
6913 .tp_getset = py_samr_ConnectInfo1_getsetters,
6915 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6916 .tp_basicsize = sizeof(pytalloc_Object),
6917 .tp_new = py_samr_ConnectInfo1_new,
6920 PyObject *py_import_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, union samr_ConnectInfo *in)
6926 ret = pytalloc_reference_ex(&samr_ConnectInfo1_Type, mem_ctx, &in->info1);
6930 PyErr_SetString(PyExc_TypeError, "unknown union level");
6934 union samr_ConnectInfo *py_export_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6936 union samr_ConnectInfo *ret = talloc_zero(mem_ctx, union samr_ConnectInfo);
6939 PY_CHECK_TYPE(&samr_ConnectInfo1_Type, in, talloc_free(ret); return NULL;);
6940 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
6942 talloc_free(ret); return NULL;
6944 ret->info1 = *(struct samr_ConnectInfo1 *)pytalloc_get_ptr(in);
6948 PyErr_SetString(PyExc_TypeError, "invalid union level value");
6957 static PyObject *py_samr_ValidationBlob_get_length(PyObject *obj, void *closure)
6959 struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
6960 PyObject *py_length;
6961 py_length = PyInt_FromLong(object->length);
6965 static int py_samr_ValidationBlob_set_length(PyObject *py_obj, PyObject *value, void *closure)
6967 struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj);
6968 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
6969 object->length = PyInt_AsLong(value);
6973 static PyObject *py_samr_ValidationBlob_get_data(PyObject *obj, void *closure)
6975 struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
6977 if (object->data == NULL) {
6981 py_data = PyList_New(object->length);
6982 if (py_data == NULL) {
6987 for (data_cntr_1 = 0; data_cntr_1 < object->length; data_cntr_1++) {
6988 PyObject *py_data_1;
6989 py_data_1 = PyInt_FromLong(object->data[data_cntr_1]);
6990 PyList_SetItem(py_data, data_cntr_1, py_data_1);
6997 static int py_samr_ValidationBlob_set_data(PyObject *py_obj, PyObject *value, void *closure)
6999 struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(py_obj);
7000 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->data);
7001 if (value == Py_None) {
7002 object->data = NULL;
7004 object->data = NULL;
7005 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7008 object->data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data, PyList_GET_SIZE(value));
7009 if (!object->data) { return -1;; }
7010 talloc_set_name_const(object->data, "ARRAY: object->data");
7011 for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
7012 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(value, data_cntr_1), return -1;);
7013 object->data[data_cntr_1] = PyInt_AsLong(PyList_GET_ITEM(value, data_cntr_1));
7020 static PyGetSetDef py_samr_ValidationBlob_getsetters[] = {
7021 { discard_const_p(char, "length"), py_samr_ValidationBlob_get_length, py_samr_ValidationBlob_set_length },
7022 { discard_const_p(char, "data"), py_samr_ValidationBlob_get_data, py_samr_ValidationBlob_set_data },
7026 static PyObject *py_samr_ValidationBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7028 return pytalloc_new(struct samr_ValidationBlob, type);
7032 static PyTypeObject samr_ValidationBlob_Type = {
7033 PyObject_HEAD_INIT(NULL) 0,
7034 .tp_name = "samr.ValidationBlob",
7035 .tp_getset = py_samr_ValidationBlob_getsetters,
7037 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7038 .tp_basicsize = sizeof(pytalloc_Object),
7039 .tp_new = py_samr_ValidationBlob_new,
7043 static PyObject *py_samr_ValidatePasswordInfo_get_fields_present(PyObject *obj, void *closure)
7045 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7046 PyObject *py_fields_present;
7047 py_fields_present = PyInt_FromLong(object->fields_present);
7048 return py_fields_present;
7051 static int py_samr_ValidatePasswordInfo_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
7053 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7054 if (PyLong_Check(value)) {
7055 object->fields_present = PyLong_AsLongLong(value);
7056 } else if (PyInt_Check(value)) {
7057 object->fields_present = PyInt_AsLong(value);
7059 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7060 PyInt_Type.tp_name, PyLong_Type.tp_name);
7066 static PyObject *py_samr_ValidatePasswordInfo_get_last_password_change(PyObject *obj, void *closure)
7068 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7069 PyObject *py_last_password_change;
7070 py_last_password_change = PyLong_FromLongLong(object->last_password_change);
7071 return py_last_password_change;
7074 static int py_samr_ValidatePasswordInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
7076 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7077 if (PyLong_Check(value)) {
7078 object->last_password_change = PyLong_AsLongLong(value);
7079 } else if (PyInt_Check(value)) {
7080 object->last_password_change = PyInt_AsLong(value);
7082 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7083 PyInt_Type.tp_name, PyLong_Type.tp_name);
7089 static PyObject *py_samr_ValidatePasswordInfo_get_bad_password_time(PyObject *obj, void *closure)
7091 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7092 PyObject *py_bad_password_time;
7093 py_bad_password_time = PyLong_FromLongLong(object->bad_password_time);
7094 return py_bad_password_time;
7097 static int py_samr_ValidatePasswordInfo_set_bad_password_time(PyObject *py_obj, PyObject *value, void *closure)
7099 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7100 if (PyLong_Check(value)) {
7101 object->bad_password_time = PyLong_AsLongLong(value);
7102 } else if (PyInt_Check(value)) {
7103 object->bad_password_time = PyInt_AsLong(value);
7105 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7106 PyInt_Type.tp_name, PyLong_Type.tp_name);
7112 static PyObject *py_samr_ValidatePasswordInfo_get_lockout_time(PyObject *obj, void *closure)
7114 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7115 PyObject *py_lockout_time;
7116 py_lockout_time = PyLong_FromLongLong(object->lockout_time);
7117 return py_lockout_time;
7120 static int py_samr_ValidatePasswordInfo_set_lockout_time(PyObject *py_obj, PyObject *value, void *closure)
7122 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7123 if (PyLong_Check(value)) {
7124 object->lockout_time = PyLong_AsLongLong(value);
7125 } else if (PyInt_Check(value)) {
7126 object->lockout_time = PyInt_AsLong(value);
7128 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7129 PyInt_Type.tp_name, PyLong_Type.tp_name);
7135 static PyObject *py_samr_ValidatePasswordInfo_get_bad_pwd_count(PyObject *obj, void *closure)
7137 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7138 PyObject *py_bad_pwd_count;
7139 py_bad_pwd_count = PyInt_FromLong(object->bad_pwd_count);
7140 return py_bad_pwd_count;
7143 static int py_samr_ValidatePasswordInfo_set_bad_pwd_count(PyObject *py_obj, PyObject *value, void *closure)
7145 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7146 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7147 object->bad_pwd_count = PyInt_AsLong(value);
7151 static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history_len(PyObject *obj, void *closure)
7153 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7154 PyObject *py_pwd_history_len;
7155 py_pwd_history_len = PyInt_FromLong(object->pwd_history_len);
7156 return py_pwd_history_len;
7159 static int py_samr_ValidatePasswordInfo_set_pwd_history_len(PyObject *py_obj, PyObject *value, void *closure)
7161 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7162 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7163 object->pwd_history_len = PyInt_AsLong(value);
7167 static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history(PyObject *obj, void *closure)
7169 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(obj);
7170 PyObject *py_pwd_history;
7171 if (object->pwd_history == NULL) {
7172 py_pwd_history = Py_None;
7173 Py_INCREF(py_pwd_history);
7175 py_pwd_history = PyList_New(object->pwd_history_len);
7176 if (py_pwd_history == NULL) {
7180 int pwd_history_cntr_1;
7181 for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < object->pwd_history_len; pwd_history_cntr_1++) {
7182 PyObject *py_pwd_history_1;
7183 py_pwd_history_1 = pytalloc_reference_ex(&samr_ValidationBlob_Type, object->pwd_history, &object->pwd_history[pwd_history_cntr_1]);
7184 PyList_SetItem(py_pwd_history, pwd_history_cntr_1, py_pwd_history_1);
7188 return py_pwd_history;
7191 static int py_samr_ValidatePasswordInfo_set_pwd_history(PyObject *py_obj, PyObject *value, void *closure)
7193 struct samr_ValidatePasswordInfo *object = (struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(py_obj);
7194 talloc_unlink(pytalloc_get_mem_ctx(py_obj), object->pwd_history);
7195 if (value == Py_None) {
7196 object->pwd_history = NULL;
7198 object->pwd_history = NULL;
7199 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7201 int pwd_history_cntr_1;
7202 object->pwd_history = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pwd_history, PyList_GET_SIZE(value));
7203 if (!object->pwd_history) { return -1;; }
7204 talloc_set_name_const(object->pwd_history, "ARRAY: object->pwd_history");
7205 for (pwd_history_cntr_1 = 0; pwd_history_cntr_1 < PyList_GET_SIZE(value); pwd_history_cntr_1++) {
7206 PY_CHECK_TYPE(&samr_ValidationBlob_Type, PyList_GET_ITEM(value, pwd_history_cntr_1), return -1;);
7207 if (talloc_reference(object->pwd_history, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, pwd_history_cntr_1))) == NULL) {
7211 object->pwd_history[pwd_history_cntr_1] = *(struct samr_ValidationBlob *)pytalloc_get_ptr(PyList_GET_ITEM(value, pwd_history_cntr_1));
7218 static PyGetSetDef py_samr_ValidatePasswordInfo_getsetters[] = {
7219 { discard_const_p(char, "fields_present"), py_samr_ValidatePasswordInfo_get_fields_present, py_samr_ValidatePasswordInfo_set_fields_present },
7220 { discard_const_p(char, "last_password_change"), py_samr_ValidatePasswordInfo_get_last_password_change, py_samr_ValidatePasswordInfo_set_last_password_change },
7221 { discard_const_p(char, "bad_password_time"), py_samr_ValidatePasswordInfo_get_bad_password_time, py_samr_ValidatePasswordInfo_set_bad_password_time },
7222 { discard_const_p(char, "lockout_time"), py_samr_ValidatePasswordInfo_get_lockout_time, py_samr_ValidatePasswordInfo_set_lockout_time },
7223 { discard_const_p(char, "bad_pwd_count"), py_samr_ValidatePasswordInfo_get_bad_pwd_count, py_samr_ValidatePasswordInfo_set_bad_pwd_count },
7224 { discard_const_p(char, "pwd_history_len"), py_samr_ValidatePasswordInfo_get_pwd_history_len, py_samr_ValidatePasswordInfo_set_pwd_history_len },
7225 { discard_const_p(char, "pwd_history"), py_samr_ValidatePasswordInfo_get_pwd_history, py_samr_ValidatePasswordInfo_set_pwd_history },
7229 static PyObject *py_samr_ValidatePasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7231 return pytalloc_new(struct samr_ValidatePasswordInfo, type);
7235 static PyTypeObject samr_ValidatePasswordInfo_Type = {
7236 PyObject_HEAD_INIT(NULL) 0,
7237 .tp_name = "samr.ValidatePasswordInfo",
7238 .tp_getset = py_samr_ValidatePasswordInfo_getsetters,
7240 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7241 .tp_basicsize = sizeof(pytalloc_Object),
7242 .tp_new = py_samr_ValidatePasswordInfo_new,
7246 static PyObject *py_samr_ValidatePasswordRepCtr_get_info(PyObject *obj, void *closure)
7248 struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
7250 py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7254 static int py_samr_ValidatePasswordRepCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
7256 struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj);
7257 PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
7258 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7262 object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7266 static PyObject *py_samr_ValidatePasswordRepCtr_get_status(PyObject *obj, void *closure)
7268 struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
7269 PyObject *py_status;
7270 py_status = PyInt_FromLong(object->status);
7274 static int py_samr_ValidatePasswordRepCtr_set_status(PyObject *py_obj, PyObject *value, void *closure)
7276 struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(py_obj);
7277 if (PyLong_Check(value)) {
7278 object->status = PyLong_AsLongLong(value);
7279 } else if (PyInt_Check(value)) {
7280 object->status = PyInt_AsLong(value);
7282 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7283 PyInt_Type.tp_name, PyLong_Type.tp_name);
7289 static PyGetSetDef py_samr_ValidatePasswordRepCtr_getsetters[] = {
7290 { discard_const_p(char, "info"), py_samr_ValidatePasswordRepCtr_get_info, py_samr_ValidatePasswordRepCtr_set_info },
7291 { discard_const_p(char, "status"), py_samr_ValidatePasswordRepCtr_get_status, py_samr_ValidatePasswordRepCtr_set_status },
7295 static PyObject *py_samr_ValidatePasswordRepCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7297 return pytalloc_new(struct samr_ValidatePasswordRepCtr, type);
7301 static PyTypeObject samr_ValidatePasswordRepCtr_Type = {
7302 PyObject_HEAD_INIT(NULL) 0,
7303 .tp_name = "samr.ValidatePasswordRepCtr",
7304 .tp_getset = py_samr_ValidatePasswordRepCtr_getsetters,
7306 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7307 .tp_basicsize = sizeof(pytalloc_Object),
7308 .tp_new = py_samr_ValidatePasswordRepCtr_new,
7311 PyObject *py_import_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordRep *in)
7317 ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr1);
7321 ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr2);
7325 ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr3);
7329 PyErr_SetString(PyExc_TypeError, "unknown union level");
7333 union samr_ValidatePasswordRep *py_export_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7335 union samr_ValidatePasswordRep *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordRep);
7338 PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
7339 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7341 talloc_free(ret); return NULL;
7343 ret->ctr1 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7347 PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
7348 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7350 talloc_free(ret); return NULL;
7352 ret->ctr2 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7356 PY_CHECK_TYPE(&samr_ValidatePasswordRepCtr_Type, in, talloc_free(ret); return NULL;);
7357 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7359 talloc_free(ret); return NULL;
7361 ret->ctr3 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7365 PyErr_SetString(PyExc_TypeError, "invalid union level value");
7374 static PyObject *py_samr_ValidatePasswordReq3_get_info(PyObject *obj, void *closure)
7376 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7378 py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7382 static int py_samr_ValidatePasswordReq3_set_info(PyObject *py_obj, PyObject *value, void *closure)
7384 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7385 PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
7386 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7390 object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7394 static PyObject *py_samr_ValidatePasswordReq3_get_password(PyObject *obj, void *closure)
7396 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7397 PyObject *py_password;
7398 py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password);
7402 static int py_samr_ValidatePasswordReq3_set_password(PyObject *py_obj, PyObject *value, void *closure)
7404 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7405 PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
7406 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7410 object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7414 static PyObject *py_samr_ValidatePasswordReq3_get_account(PyObject *obj, void *closure)
7416 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7417 PyObject *py_account;
7418 py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account);
7422 static int py_samr_ValidatePasswordReq3_set_account(PyObject *py_obj, PyObject *value, void *closure)
7424 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7425 PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
7426 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7430 object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7434 static PyObject *py_samr_ValidatePasswordReq3_get_hash(PyObject *obj, void *closure)
7436 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7438 py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
7442 static int py_samr_ValidatePasswordReq3_set_hash(PyObject *py_obj, PyObject *value, void *closure)
7444 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7445 PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;);
7446 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7450 object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
7454 static PyObject *py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon(PyObject *obj, void *closure)
7456 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7457 PyObject *py_pwd_must_change_at_next_logon;
7458 py_pwd_must_change_at_next_logon = PyInt_FromLong(object->pwd_must_change_at_next_logon);
7459 return py_pwd_must_change_at_next_logon;
7462 static int py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon(PyObject *py_obj, PyObject *value, void *closure)
7464 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7465 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7466 object->pwd_must_change_at_next_logon = PyInt_AsLong(value);
7470 static PyObject *py_samr_ValidatePasswordReq3_get_clear_lockout(PyObject *obj, void *closure)
7472 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7473 PyObject *py_clear_lockout;
7474 py_clear_lockout = PyInt_FromLong(object->clear_lockout);
7475 return py_clear_lockout;
7478 static int py_samr_ValidatePasswordReq3_set_clear_lockout(PyObject *py_obj, PyObject *value, void *closure)
7480 struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(py_obj);
7481 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7482 object->clear_lockout = PyInt_AsLong(value);
7486 static PyGetSetDef py_samr_ValidatePasswordReq3_getsetters[] = {
7487 { discard_const_p(char, "info"), py_samr_ValidatePasswordReq3_get_info, py_samr_ValidatePasswordReq3_set_info },
7488 { discard_const_p(char, "password"), py_samr_ValidatePasswordReq3_get_password, py_samr_ValidatePasswordReq3_set_password },
7489 { discard_const_p(char, "account"), py_samr_ValidatePasswordReq3_get_account, py_samr_ValidatePasswordReq3_set_account },
7490 { discard_const_p(char, "hash"), py_samr_ValidatePasswordReq3_get_hash, py_samr_ValidatePasswordReq3_set_hash },
7491 { discard_const_p(char, "pwd_must_change_at_next_logon"), py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon, py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon },
7492 { discard_const_p(char, "clear_lockout"), py_samr_ValidatePasswordReq3_get_clear_lockout, py_samr_ValidatePasswordReq3_set_clear_lockout },
7496 static PyObject *py_samr_ValidatePasswordReq3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7498 return pytalloc_new(struct samr_ValidatePasswordReq3, type);
7502 static PyTypeObject samr_ValidatePasswordReq3_Type = {
7503 PyObject_HEAD_INIT(NULL) 0,
7504 .tp_name = "samr.ValidatePasswordReq3",
7505 .tp_getset = py_samr_ValidatePasswordReq3_getsetters,
7507 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7508 .tp_basicsize = sizeof(pytalloc_Object),
7509 .tp_new = py_samr_ValidatePasswordReq3_new,
7513 static PyObject *py_samr_ValidatePasswordReq2_get_info(PyObject *obj, void *closure)
7515 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7517 py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7521 static int py_samr_ValidatePasswordReq2_set_info(PyObject *py_obj, PyObject *value, void *closure)
7523 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
7524 PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
7525 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7529 object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7533 static PyObject *py_samr_ValidatePasswordReq2_get_password(PyObject *obj, void *closure)
7535 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7536 PyObject *py_password;
7537 py_password = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->password);
7541 static int py_samr_ValidatePasswordReq2_set_password(PyObject *py_obj, PyObject *value, void *closure)
7543 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
7544 PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
7545 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7549 object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7553 static PyObject *py_samr_ValidatePasswordReq2_get_account(PyObject *obj, void *closure)
7555 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7556 PyObject *py_account;
7557 py_account = pytalloc_reference_ex(lsa_StringLarge_Type, pytalloc_get_mem_ctx(obj), &object->account);
7561 static int py_samr_ValidatePasswordReq2_set_account(PyObject *py_obj, PyObject *value, void *closure)
7563 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
7564 PY_CHECK_TYPE(lsa_StringLarge_Type, value, return -1;);
7565 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7569 object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7573 static PyObject *py_samr_ValidatePasswordReq2_get_hash(PyObject *obj, void *closure)
7575 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7577 py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
7581 static int py_samr_ValidatePasswordReq2_set_hash(PyObject *py_obj, PyObject *value, void *closure)
7583 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
7584 PY_CHECK_TYPE(&samr_ValidationBlob_Type, value, return -1;);
7585 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7589 object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
7593 static PyObject *py_samr_ValidatePasswordReq2_get_password_matched(PyObject *obj, void *closure)
7595 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7596 PyObject *py_password_matched;
7597 py_password_matched = PyInt_FromLong(object->password_matched);
7598 return py_password_matched;
7601 static int py_samr_ValidatePasswordReq2_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
7603 struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(py_obj);
7604 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7605 object->password_matched = PyInt_AsLong(value);
7609 static PyGetSetDef py_samr_ValidatePasswordReq2_getsetters[] = {
7610 { discard_const_p(char, "info"), py_samr_ValidatePasswordReq2_get_info, py_samr_ValidatePasswordReq2_set_info },
7611 { discard_const_p(char, "password"), py_samr_ValidatePasswordReq2_get_password, py_samr_ValidatePasswordReq2_set_password },
7612 { discard_const_p(char, "account"), py_samr_ValidatePasswordReq2_get_account, py_samr_ValidatePasswordReq2_set_account },
7613 { discard_const_p(char, "hash"), py_samr_ValidatePasswordReq2_get_hash, py_samr_ValidatePasswordReq2_set_hash },
7614 { discard_const_p(char, "password_matched"), py_samr_ValidatePasswordReq2_get_password_matched, py_samr_ValidatePasswordReq2_set_password_matched },
7618 static PyObject *py_samr_ValidatePasswordReq2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7620 return pytalloc_new(struct samr_ValidatePasswordReq2, type);
7624 static PyTypeObject samr_ValidatePasswordReq2_Type = {
7625 PyObject_HEAD_INIT(NULL) 0,
7626 .tp_name = "samr.ValidatePasswordReq2",
7627 .tp_getset = py_samr_ValidatePasswordReq2_getsetters,
7629 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7630 .tp_basicsize = sizeof(pytalloc_Object),
7631 .tp_new = py_samr_ValidatePasswordReq2_new,
7635 static PyObject *py_samr_ValidatePasswordReq1_get_info(PyObject *obj, void *closure)
7637 struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj);
7639 py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7643 static int py_samr_ValidatePasswordReq1_set_info(PyObject *py_obj, PyObject *value, void *closure)
7645 struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj);
7646 PY_CHECK_TYPE(&samr_ValidatePasswordInfo_Type, value, return -1;);
7647 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
7651 object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7655 static PyObject *py_samr_ValidatePasswordReq1_get_password_matched(PyObject *obj, void *closure)
7657 struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj);
7658 PyObject *py_password_matched;
7659 py_password_matched = PyInt_FromLong(object->password_matched);
7660 return py_password_matched;
7663 static int py_samr_ValidatePasswordReq1_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
7665 struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(py_obj);
7666 PY_CHECK_TYPE(&PyInt_Type, value, return -1;);
7667 object->password_matched = PyInt_AsLong(value);
7671 static PyGetSetDef py_samr_ValidatePasswordReq1_getsetters[] = {
7672 { discard_const_p(char, "info"), py_samr_ValidatePasswordReq1_get_info, py_samr_ValidatePasswordReq1_set_info },
7673 { discard_const_p(char, "password_matched"), py_samr_ValidatePasswordReq1_get_password_matched, py_samr_ValidatePasswordReq1_set_password_matched },
7677 static PyObject *py_samr_ValidatePasswordReq1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7679 return pytalloc_new(struct samr_ValidatePasswordReq1, type);
7683 static PyTypeObject samr_ValidatePasswordReq1_Type = {
7684 PyObject_HEAD_INIT(NULL) 0,
7685 .tp_name = "samr.ValidatePasswordReq1",
7686 .tp_getset = py_samr_ValidatePasswordReq1_getsetters,
7688 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7689 .tp_basicsize = sizeof(pytalloc_Object),
7690 .tp_new = py_samr_ValidatePasswordReq1_new,
7693 PyObject *py_import_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordReq *in)
7699 ret = pytalloc_reference_ex(&samr_ValidatePasswordReq1_Type, mem_ctx, &in->req1);
7703 ret = pytalloc_reference_ex(&samr_ValidatePasswordReq2_Type, mem_ctx, &in->req2);
7707 ret = pytalloc_reference_ex(&samr_ValidatePasswordReq3_Type, mem_ctx, &in->req3);
7711 PyErr_SetString(PyExc_TypeError, "unknown union level");
7715 union samr_ValidatePasswordReq *py_export_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7717 union samr_ValidatePasswordReq *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordReq);
7720 PY_CHECK_TYPE(&samr_ValidatePasswordReq1_Type, in, talloc_free(ret); return NULL;);
7721 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7723 talloc_free(ret); return NULL;
7725 ret->req1 = *(struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(in);
7729 PY_CHECK_TYPE(&samr_ValidatePasswordReq2_Type, in, talloc_free(ret); return NULL;);
7730 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7732 talloc_free(ret); return NULL;
7734 ret->req2 = *(struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(in);
7738 PY_CHECK_TYPE(&samr_ValidatePasswordReq3_Type, in, talloc_free(ret); return NULL;);
7739 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
7741 talloc_free(ret); return NULL;
7743 ret->req3 = *(struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(in);
7747 PyErr_SetString(PyExc_TypeError, "invalid union level value");
7756 static bool pack_py_samr_Connect_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect *r)
7758 PyObject *py_system_name;
7759 PyObject *py_access_mask;
7760 const char *kwnames[] = {
7761 "system_name", "access_mask", NULL
7764 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
7768 if (py_system_name == Py_None) {
7769 r->in.system_name = NULL;
7771 r->in.system_name = talloc_ptrtype(r, r->in.system_name);
7772 PY_CHECK_TYPE(&PyInt_Type, py_system_name, return false;);
7773 *r->in.system_name = PyInt_AsLong(py_system_name);
7775 if (PyLong_Check(py_access_mask)) {
7776 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
7777 } else if (PyInt_Check(py_access_mask)) {
7778 r->in.access_mask = PyInt_AsLong(py_access_mask);
7780 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7781 PyInt_Type.tp_name, PyLong_Type.tp_name);
7787 static PyObject *unpack_py_samr_Connect_args_out(struct samr_Connect *r)
7790 PyObject *py_connect_handle;
7791 py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
7792 result = py_connect_handle;
7793 if (NT_STATUS_IS_ERR(r->out.result)) {
7794 PyErr_SetNTSTATUS(r->out.result);
7801 static bool pack_py_samr_Close_args_in(PyObject *args, PyObject *kwargs, struct samr_Close *r)
7803 PyObject *py_handle;
7804 const char *kwnames[] = {
7808 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Close", discard_const_p(char *, kwnames), &py_handle)) {
7812 r->in.handle = talloc_ptrtype(r, r->in.handle);
7813 PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7814 if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7818 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7822 static PyObject *unpack_py_samr_Close_args_out(struct samr_Close *r)
7825 PyObject *py_handle;
7826 py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
7828 if (NT_STATUS_IS_ERR(r->out.result)) {
7829 PyErr_SetNTSTATUS(r->out.result);
7836 static bool pack_py_samr_SetSecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_SetSecurity *r)
7838 PyObject *py_handle;
7839 PyObject *py_sec_info;
7841 const char *kwnames[] = {
7842 "handle", "sec_info", "sdbuf", NULL
7845 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetSecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
7849 r->in.handle = talloc_ptrtype(r, r->in.handle);
7850 PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7851 if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7855 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7856 if (PyLong_Check(py_sec_info)) {
7857 r->in.sec_info = PyLong_AsLongLong(py_sec_info);
7858 } else if (PyInt_Check(py_sec_info)) {
7859 r->in.sec_info = PyInt_AsLong(py_sec_info);
7861 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7862 PyInt_Type.tp_name, PyLong_Type.tp_name);
7865 r->in.sdbuf = talloc_ptrtype(r, r->in.sdbuf);
7866 PY_CHECK_TYPE(sec_desc_buf_Type, py_sdbuf, return false;);
7867 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sdbuf)) == NULL) {
7871 r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
7875 static PyObject *unpack_py_samr_SetSecurity_args_out(struct samr_SetSecurity *r)
7880 if (NT_STATUS_IS_ERR(r->out.result)) {
7881 PyErr_SetNTSTATUS(r->out.result);
7888 static bool pack_py_samr_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_QuerySecurity *r)
7890 PyObject *py_handle;
7891 PyObject *py_sec_info;
7892 const char *kwnames[] = {
7893 "handle", "sec_info", NULL
7896 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
7900 r->in.handle = talloc_ptrtype(r, r->in.handle);
7901 PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
7902 if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
7906 r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7907 if (PyLong_Check(py_sec_info)) {
7908 r->in.sec_info = PyLong_AsLongLong(py_sec_info);
7909 } else if (PyInt_Check(py_sec_info)) {
7910 r->in.sec_info = PyInt_AsLong(py_sec_info);
7912 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7913 PyInt_Type.tp_name, PyLong_Type.tp_name);
7919 static PyObject *unpack_py_samr_QuerySecurity_args_out(struct samr_QuerySecurity *r)
7923 if (*r->out.sdbuf == NULL) {
7925 Py_INCREF(py_sdbuf);
7927 py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
7930 if (NT_STATUS_IS_ERR(r->out.result)) {
7931 PyErr_SetNTSTATUS(r->out.result);
7938 static bool pack_py_samr_Shutdown_args_in(PyObject *args, PyObject *kwargs, struct samr_Shutdown *r)
7940 PyObject *py_connect_handle;
7941 const char *kwnames[] = {
7942 "connect_handle", NULL
7945 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Shutdown", discard_const_p(char *, kwnames), &py_connect_handle)) {
7949 r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
7950 PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
7951 if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
7955 r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
7959 static PyObject *unpack_py_samr_Shutdown_args_out(struct samr_Shutdown *r)
7964 if (NT_STATUS_IS_ERR(r->out.result)) {
7965 PyErr_SetNTSTATUS(r->out.result);
7972 static bool pack_py_samr_LookupDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupDomain *r)
7974 PyObject *py_connect_handle;
7975 PyObject *py_domain_name;
7976 const char *kwnames[] = {
7977 "connect_handle", "domain_name", NULL
7980 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_domain_name)) {
7984 r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
7985 PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
7986 if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
7990 r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
7991 r->in.domain_name = talloc_ptrtype(r, r->in.domain_name);
7992 PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;);
7993 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) {
7997 r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
8001 static PyObject *unpack_py_samr_LookupDomain_args_out(struct samr_LookupDomain *r)
8005 if (*r->out.sid == NULL) {
8009 py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
8012 if (NT_STATUS_IS_ERR(r->out.result)) {
8013 PyErr_SetNTSTATUS(r->out.result);
8020 static bool pack_py_samr_EnumDomains_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomains *r)
8022 PyObject *py_connect_handle;
8023 PyObject *py_resume_handle;
8024 PyObject *py_buf_size;
8025 const char *kwnames[] = {
8026 "connect_handle", "resume_handle", "buf_size", NULL
8029 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomains", discard_const_p(char *, kwnames), &py_connect_handle, &py_resume_handle, &py_buf_size)) {
8033 r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
8034 PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
8035 if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
8039 r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
8040 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
8041 PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;);
8042 *r->in.resume_handle = PyInt_AsLong(py_resume_handle);
8043 PY_CHECK_TYPE(&PyInt_Type, py_buf_size, return false;);
8044 r->in.buf_size = PyInt_AsLong(py_buf_size);
8048 static PyObject *unpack_py_samr_EnumDomains_args_out(struct samr_EnumDomains *r)
8051 PyObject *py_resume_handle;
8053 PyObject *py_num_entries;
8054 result = PyTuple_New(3);
8055 py_resume_handle = PyInt_FromLong(*r->out.resume_handle);
8056 PyTuple_SetItem(result, 0, py_resume_handle);
8057 if (*r->out.sam == NULL) {
8061 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8063 PyTuple_SetItem(result, 1, py_sam);
8064 py_num_entries = PyInt_FromLong(*r->out.num_entries);
8065 PyTuple_SetItem(result, 2, py_num_entries);
8066 if (NT_STATUS_IS_ERR(r->out.result)) {
8067 PyErr_SetNTSTATUS(r->out.result);
8074 static bool pack_py_samr_OpenDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenDomain *r)
8076 PyObject *py_connect_handle;
8077 PyObject *py_access_mask;
8079 const char *kwnames[] = {
8080 "connect_handle", "access_mask", "sid", NULL
8083 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_access_mask, &py_sid)) {
8087 r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
8088 PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
8089 if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
8093 r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
8094 if (PyLong_Check(py_access_mask)) {
8095 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
8096 } else if (PyInt_Check(py_access_mask)) {
8097 r->in.access_mask = PyInt_AsLong(py_access_mask);
8099 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8100 PyInt_Type.tp_name, PyLong_Type.tp_name);
8103 r->in.sid = talloc_ptrtype(r, r->in.sid);
8104 PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
8105 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
8109 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
8113 static PyObject *unpack_py_samr_OpenDomain_args_out(struct samr_OpenDomain *r)
8116 PyObject *py_domain_handle;
8117 py_domain_handle = pytalloc_reference_ex(policy_handle_Type, r->out.domain_handle, r->out.domain_handle);
8118 result = py_domain_handle;
8119 if (NT_STATUS_IS_ERR(r->out.result)) {
8120 PyErr_SetNTSTATUS(r->out.result);
8127 static bool pack_py_samr_QueryDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo *r)
8129 PyObject *py_domain_handle;
8131 const char *kwnames[] = {
8132 "domain_handle", "level", NULL
8135 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
8139 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8140 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8141 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8145 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8146 if (PyLong_Check(py_level)) {
8147 r->in.level = PyLong_AsLongLong(py_level);
8148 } else if (PyInt_Check(py_level)) {
8149 r->in.level = PyInt_AsLong(py_level);
8151 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8152 PyInt_Type.tp_name, PyLong_Type.tp_name);
8158 static PyObject *unpack_py_samr_QueryDomainInfo_args_out(struct samr_QueryDomainInfo *r)
8162 if (*r->out.info == NULL) {
8166 py_info = py_import_samr_DomainInfo(*r->out.info, r->in.level, *r->out.info);
8167 if (py_info == NULL) {
8172 if (NT_STATUS_IS_ERR(r->out.result)) {
8173 PyErr_SetNTSTATUS(r->out.result);
8180 static bool pack_py_samr_SetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDomainInfo *r)
8182 PyObject *py_domain_handle;
8185 const char *kwnames[] = {
8186 "domain_handle", "level", "info", NULL
8189 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_info)) {
8193 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8194 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8195 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8199 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8200 if (PyLong_Check(py_level)) {
8201 r->in.level = PyLong_AsLongLong(py_level);
8202 } else if (PyInt_Check(py_level)) {
8203 r->in.level = PyInt_AsLong(py_level);
8205 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8206 PyInt_Type.tp_name, PyLong_Type.tp_name);
8209 r->in.info = talloc_ptrtype(r, r->in.info);
8211 union samr_DomainInfo *info_switch_1;
8212 info_switch_1 = py_export_samr_DomainInfo(r, r->in.level, py_info);
8213 if (info_switch_1 == NULL) {
8216 r->in.info = info_switch_1;
8221 static PyObject *unpack_py_samr_SetDomainInfo_args_out(struct samr_SetDomainInfo *r)
8226 if (NT_STATUS_IS_ERR(r->out.result)) {
8227 PyErr_SetNTSTATUS(r->out.result);
8234 static bool pack_py_samr_CreateDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomainGroup *r)
8236 PyObject *py_domain_handle;
8238 PyObject *py_access_mask;
8239 const char *kwnames[] = {
8240 "domain_handle", "name", "access_mask", NULL
8243 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomainGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_name, &py_access_mask)) {
8247 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8248 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8249 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8253 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8254 r->in.name = talloc_ptrtype(r, r->in.name);
8255 PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
8256 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
8260 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
8261 if (PyLong_Check(py_access_mask)) {
8262 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
8263 } else if (PyInt_Check(py_access_mask)) {
8264 r->in.access_mask = PyInt_AsLong(py_access_mask);
8266 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8267 PyInt_Type.tp_name, PyLong_Type.tp_name);
8273 static PyObject *unpack_py_samr_CreateDomainGroup_args_out(struct samr_CreateDomainGroup *r)
8276 PyObject *py_group_handle;
8278 result = PyTuple_New(2);
8279 py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
8280 PyTuple_SetItem(result, 0, py_group_handle);
8281 py_rid = PyInt_FromLong(*r->out.rid);
8282 PyTuple_SetItem(result, 1, py_rid);
8283 if (NT_STATUS_IS_ERR(r->out.result)) {
8284 PyErr_SetNTSTATUS(r->out.result);
8291 static bool pack_py_samr_EnumDomainGroups_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainGroups *r)
8293 PyObject *py_domain_handle;
8294 PyObject *py_resume_handle;
8295 PyObject *py_max_size;
8296 const char *kwnames[] = {
8297 "domain_handle", "resume_handle", "max_size", NULL
8300 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainGroups", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
8304 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8305 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8306 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8310 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8311 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
8312 PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;);
8313 *r->in.resume_handle = PyInt_AsLong(py_resume_handle);
8314 PY_CHECK_TYPE(&PyInt_Type, py_max_size, return false;);
8315 r->in.max_size = PyInt_AsLong(py_max_size);
8319 static PyObject *unpack_py_samr_EnumDomainGroups_args_out(struct samr_EnumDomainGroups *r)
8322 PyObject *py_resume_handle;
8324 PyObject *py_num_entries;
8325 result = PyTuple_New(3);
8326 py_resume_handle = PyInt_FromLong(*r->out.resume_handle);
8327 PyTuple_SetItem(result, 0, py_resume_handle);
8328 if (*r->out.sam == NULL) {
8332 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8334 PyTuple_SetItem(result, 1, py_sam);
8335 py_num_entries = PyInt_FromLong(*r->out.num_entries);
8336 PyTuple_SetItem(result, 2, py_num_entries);
8337 if (NT_STATUS_IS_ERR(r->out.result)) {
8338 PyErr_SetNTSTATUS(r->out.result);
8345 static bool pack_py_samr_CreateUser_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser *r)
8347 PyObject *py_domain_handle;
8348 PyObject *py_account_name;
8349 PyObject *py_access_mask;
8350 const char *kwnames[] = {
8351 "domain_handle", "account_name", "access_mask", NULL
8354 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_access_mask)) {
8358 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8359 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8360 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8364 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8365 r->in.account_name = talloc_ptrtype(r, r->in.account_name);
8366 PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;);
8367 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
8371 r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
8372 if (PyLong_Check(py_access_mask)) {
8373 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
8374 } else if (PyInt_Check(py_access_mask)) {
8375 r->in.access_mask = PyInt_AsLong(py_access_mask);
8377 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8378 PyInt_Type.tp_name, PyLong_Type.tp_name);
8384 static PyObject *unpack_py_samr_CreateUser_args_out(struct samr_CreateUser *r)
8387 PyObject *py_user_handle;
8389 result = PyTuple_New(2);
8390 py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
8391 PyTuple_SetItem(result, 0, py_user_handle);
8392 py_rid = PyInt_FromLong(*r->out.rid);
8393 PyTuple_SetItem(result, 1, py_rid);
8394 if (NT_STATUS_IS_ERR(r->out.result)) {
8395 PyErr_SetNTSTATUS(r->out.result);
8402 static bool pack_py_samr_EnumDomainUsers_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainUsers *r)
8404 PyObject *py_domain_handle;
8405 PyObject *py_resume_handle;
8406 PyObject *py_acct_flags;
8407 PyObject *py_max_size;
8408 const char *kwnames[] = {
8409 "domain_handle", "resume_handle", "acct_flags", "max_size", NULL
8412 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)) {
8416 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8417 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8418 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8422 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8423 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
8424 PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;);
8425 *r->in.resume_handle = PyInt_AsLong(py_resume_handle);
8426 if (PyLong_Check(py_acct_flags)) {
8427 r->in.acct_flags = PyLong_AsLongLong(py_acct_flags);
8428 } else if (PyInt_Check(py_acct_flags)) {
8429 r->in.acct_flags = PyInt_AsLong(py_acct_flags);
8431 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8432 PyInt_Type.tp_name, PyLong_Type.tp_name);
8435 PY_CHECK_TYPE(&PyInt_Type, py_max_size, return false;);
8436 r->in.max_size = PyInt_AsLong(py_max_size);
8440 static PyObject *unpack_py_samr_EnumDomainUsers_args_out(struct samr_EnumDomainUsers *r)
8443 PyObject *py_resume_handle;
8445 PyObject *py_num_entries;
8446 result = PyTuple_New(3);
8447 py_resume_handle = PyInt_FromLong(*r->out.resume_handle);
8448 PyTuple_SetItem(result, 0, py_resume_handle);
8449 if (*r->out.sam == NULL) {
8453 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8455 PyTuple_SetItem(result, 1, py_sam);
8456 py_num_entries = PyInt_FromLong(*r->out.num_entries);
8457 PyTuple_SetItem(result, 2, py_num_entries);
8458 if (NT_STATUS_IS_ERR(r->out.result)) {
8459 PyErr_SetNTSTATUS(r->out.result);
8466 static bool pack_py_samr_CreateDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomAlias *r)
8468 PyObject *py_domain_handle;
8469 PyObject *py_alias_name;
8470 PyObject *py_access_mask;
8471 const char *kwnames[] = {
8472 "domain_handle", "alias_name", "access_mask", NULL
8475 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_alias_name, &py_access_mask)) {
8479 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8480 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8481 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8485 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8486 r->in.alias_name = talloc_ptrtype(r, r->in.alias_name);
8487 PY_CHECK_TYPE(lsa_String_Type, py_alias_name, return false;);
8488 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_name)) == NULL) {
8492 r->in.alias_name = (struct lsa_String *)pytalloc_get_ptr(py_alias_name);
8493 if (PyLong_Check(py_access_mask)) {
8494 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
8495 } else if (PyInt_Check(py_access_mask)) {
8496 r->in.access_mask = PyInt_AsLong(py_access_mask);
8498 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8499 PyInt_Type.tp_name, PyLong_Type.tp_name);
8505 static PyObject *unpack_py_samr_CreateDomAlias_args_out(struct samr_CreateDomAlias *r)
8508 PyObject *py_alias_handle;
8510 result = PyTuple_New(2);
8511 py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
8512 PyTuple_SetItem(result, 0, py_alias_handle);
8513 py_rid = PyInt_FromLong(*r->out.rid);
8514 PyTuple_SetItem(result, 1, py_rid);
8515 if (NT_STATUS_IS_ERR(r->out.result)) {
8516 PyErr_SetNTSTATUS(r->out.result);
8523 static bool pack_py_samr_EnumDomainAliases_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainAliases *r)
8525 PyObject *py_domain_handle;
8526 PyObject *py_resume_handle;
8527 PyObject *py_max_size;
8528 const char *kwnames[] = {
8529 "domain_handle", "resume_handle", "max_size", NULL
8532 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainAliases", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
8536 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8537 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8538 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8542 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8543 r->in.resume_handle = talloc_ptrtype(r, r->in.resume_handle);
8544 PY_CHECK_TYPE(&PyInt_Type, py_resume_handle, return false;);
8545 *r->in.resume_handle = PyInt_AsLong(py_resume_handle);
8546 PY_CHECK_TYPE(&PyInt_Type, py_max_size, return false;);
8547 r->in.max_size = PyInt_AsLong(py_max_size);
8551 static PyObject *unpack_py_samr_EnumDomainAliases_args_out(struct samr_EnumDomainAliases *r)
8554 PyObject *py_resume_handle;
8556 PyObject *py_num_entries;
8557 result = PyTuple_New(3);
8558 py_resume_handle = PyInt_FromLong(*r->out.resume_handle);
8559 PyTuple_SetItem(result, 0, py_resume_handle);
8560 if (*r->out.sam == NULL) {
8564 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8566 PyTuple_SetItem(result, 1, py_sam);
8567 py_num_entries = PyInt_FromLong(*r->out.num_entries);
8568 PyTuple_SetItem(result, 2, py_num_entries);
8569 if (NT_STATUS_IS_ERR(r->out.result)) {
8570 PyErr_SetNTSTATUS(r->out.result);
8577 static bool pack_py_samr_GetAliasMembership_args_in(PyObject *args, PyObject *kwargs, struct samr_GetAliasMembership *r)
8579 PyObject *py_domain_handle;
8581 const char *kwnames[] = {
8582 "domain_handle", "sids", NULL
8585 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_GetAliasMembership", discard_const_p(char *, kwnames), &py_domain_handle, &py_sids)) {
8589 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8590 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8591 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8595 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8596 r->in.sids = talloc_ptrtype(r, r->in.sids);
8597 PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
8598 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
8602 r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
8606 static PyObject *unpack_py_samr_GetAliasMembership_args_out(struct samr_GetAliasMembership *r)
8610 py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids);
8612 if (NT_STATUS_IS_ERR(r->out.result)) {
8613 PyErr_SetNTSTATUS(r->out.result);
8620 static bool pack_py_samr_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupNames *r)
8622 PyObject *py_domain_handle;
8624 const char *kwnames[] = {
8625 "domain_handle", "names", NULL
8628 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupNames", discard_const_p(char *, kwnames), &py_domain_handle, &py_names)) {
8632 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8633 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8634 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8638 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8639 PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
8640 r->in.num_names = PyList_GET_SIZE(py_names);
8641 PY_CHECK_TYPE(&PyList_Type, py_names, return false;);
8644 r->in.names = talloc_array_ptrtype(r, r->in.names, PyList_GET_SIZE(py_names));
8645 if (!r->in.names) { return false;; }
8646 talloc_set_name_const(r->in.names, "ARRAY: r->in.names");
8647 for (names_cntr_0 = 0; names_cntr_0 < PyList_GET_SIZE(py_names); names_cntr_0++) {
8648 PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(py_names, names_cntr_0), return false;);
8649 if (talloc_reference(r->in.names, pytalloc_get_mem_ctx(PyList_GET_ITEM(py_names, names_cntr_0))) == NULL) {
8653 r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
8659 static PyObject *unpack_py_samr_LookupNames_args_out(struct samr_LookupNames *r)
8664 result = PyTuple_New(2);
8665 py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids);
8666 PyTuple_SetItem(result, 0, py_rids);
8667 py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types);
8668 PyTuple_SetItem(result, 1, py_types);
8669 if (NT_STATUS_IS_ERR(r->out.result)) {
8670 PyErr_SetNTSTATUS(r->out.result);
8677 static bool pack_py_samr_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupRids *r)
8679 PyObject *py_domain_handle;
8681 const char *kwnames[] = {
8682 "domain_handle", "rids", NULL
8685 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupRids", discard_const_p(char *, kwnames), &py_domain_handle, &py_rids)) {
8689 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8690 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8691 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8695 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8696 PY_CHECK_TYPE(&PyList_Type, py_rids, return false;);
8697 r->in.num_rids = PyList_GET_SIZE(py_rids);
8698 PY_CHECK_TYPE(&PyList_Type, py_rids, return false;);
8701 r->in.rids = talloc_array_ptrtype(r, r->in.rids, PyList_GET_SIZE(py_rids));
8702 if (!r->in.rids) { return false;; }
8703 talloc_set_name_const(r->in.rids, "ARRAY: r->in.rids");
8704 for (rids_cntr_0 = 0; rids_cntr_0 < PyList_GET_SIZE(py_rids); rids_cntr_0++) {
8705 PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(py_rids, rids_cntr_0), return false;);
8706 r->in.rids[rids_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(py_rids, rids_cntr_0));
8712 static PyObject *unpack_py_samr_LookupRids_args_out(struct samr_LookupRids *r)
8717 result = PyTuple_New(2);
8718 py_names = pytalloc_reference_ex(lsa_Strings_Type, r->out.names, r->out.names);
8719 PyTuple_SetItem(result, 0, py_names);
8720 py_types = pytalloc_reference_ex(&samr_Ids_Type, r->out.types, r->out.types);
8721 PyTuple_SetItem(result, 1, py_types);
8722 if (NT_STATUS_IS_ERR(r->out.result)) {
8723 PyErr_SetNTSTATUS(r->out.result);
8730 static bool pack_py_samr_OpenGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenGroup *r)
8732 PyObject *py_domain_handle;
8733 PyObject *py_access_mask;
8735 const char *kwnames[] = {
8736 "domain_handle", "access_mask", "rid", NULL
8739 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
8743 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
8744 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
8745 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
8749 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
8750 if (PyLong_Check(py_access_mask)) {
8751 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
8752 } else if (PyInt_Check(py_access_mask)) {
8753 r->in.access_mask = PyInt_AsLong(py_access_mask);
8755 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8756 PyInt_Type.tp_name, PyLong_Type.tp_name);
8759 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
8760 r->in.rid = PyInt_AsLong(py_rid);
8764 static PyObject *unpack_py_samr_OpenGroup_args_out(struct samr_OpenGroup *r)
8767 PyObject *py_group_handle;
8768 py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
8769 result = py_group_handle;
8770 if (NT_STATUS_IS_ERR(r->out.result)) {
8771 PyErr_SetNTSTATUS(r->out.result);
8778 static bool pack_py_samr_QueryGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupInfo *r)
8780 PyObject *py_group_handle;
8782 const char *kwnames[] = {
8783 "group_handle", "level", NULL
8786 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level)) {
8790 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
8791 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
8792 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
8796 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8797 if (PyLong_Check(py_level)) {
8798 r->in.level = PyLong_AsLongLong(py_level);
8799 } else if (PyInt_Check(py_level)) {
8800 r->in.level = PyInt_AsLong(py_level);
8802 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8803 PyInt_Type.tp_name, PyLong_Type.tp_name);
8809 static PyObject *unpack_py_samr_QueryGroupInfo_args_out(struct samr_QueryGroupInfo *r)
8813 if (*r->out.info == NULL) {
8817 py_info = py_import_samr_GroupInfo(*r->out.info, r->in.level, *r->out.info);
8818 if (py_info == NULL) {
8823 if (NT_STATUS_IS_ERR(r->out.result)) {
8824 PyErr_SetNTSTATUS(r->out.result);
8831 static bool pack_py_samr_SetGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetGroupInfo *r)
8833 PyObject *py_group_handle;
8836 const char *kwnames[] = {
8837 "group_handle", "level", "info", NULL
8840 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level, &py_info)) {
8844 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
8845 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
8846 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
8850 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8851 if (PyLong_Check(py_level)) {
8852 r->in.level = PyLong_AsLongLong(py_level);
8853 } else if (PyInt_Check(py_level)) {
8854 r->in.level = PyInt_AsLong(py_level);
8856 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8857 PyInt_Type.tp_name, PyLong_Type.tp_name);
8860 r->in.info = talloc_ptrtype(r, r->in.info);
8862 union samr_GroupInfo *info_switch_1;
8863 info_switch_1 = py_export_samr_GroupInfo(r, r->in.level, py_info);
8864 if (info_switch_1 == NULL) {
8867 r->in.info = info_switch_1;
8872 static PyObject *unpack_py_samr_SetGroupInfo_args_out(struct samr_SetGroupInfo *r)
8877 if (NT_STATUS_IS_ERR(r->out.result)) {
8878 PyErr_SetNTSTATUS(r->out.result);
8885 static bool pack_py_samr_AddGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddGroupMember *r)
8887 PyObject *py_group_handle;
8890 const char *kwnames[] = {
8891 "group_handle", "rid", "flags", NULL
8894 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_AddGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid, &py_flags)) {
8898 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
8899 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
8900 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
8904 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8905 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
8906 r->in.rid = PyInt_AsLong(py_rid);
8907 PY_CHECK_TYPE(&PyInt_Type, py_flags, return false;);
8908 r->in.flags = PyInt_AsLong(py_flags);
8912 static PyObject *unpack_py_samr_AddGroupMember_args_out(struct samr_AddGroupMember *r)
8917 if (NT_STATUS_IS_ERR(r->out.result)) {
8918 PyErr_SetNTSTATUS(r->out.result);
8925 static bool pack_py_samr_DeleteDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomainGroup *r)
8927 PyObject *py_group_handle;
8928 const char *kwnames[] = {
8929 "group_handle", NULL
8932 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomainGroup", discard_const_p(char *, kwnames), &py_group_handle)) {
8936 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
8937 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
8938 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
8942 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8946 static PyObject *unpack_py_samr_DeleteDomainGroup_args_out(struct samr_DeleteDomainGroup *r)
8949 PyObject *py_group_handle;
8950 py_group_handle = pytalloc_reference_ex(policy_handle_Type, r->out.group_handle, r->out.group_handle);
8951 result = py_group_handle;
8952 if (NT_STATUS_IS_ERR(r->out.result)) {
8953 PyErr_SetNTSTATUS(r->out.result);
8960 static bool pack_py_samr_DeleteGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteGroupMember *r)
8962 PyObject *py_group_handle;
8964 const char *kwnames[] = {
8965 "group_handle", "rid", NULL
8968 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid)) {
8972 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
8973 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
8974 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
8978 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8979 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
8980 r->in.rid = PyInt_AsLong(py_rid);
8984 static PyObject *unpack_py_samr_DeleteGroupMember_args_out(struct samr_DeleteGroupMember *r)
8989 if (NT_STATUS_IS_ERR(r->out.result)) {
8990 PyErr_SetNTSTATUS(r->out.result);
8997 static bool pack_py_samr_QueryGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupMember *r)
8999 PyObject *py_group_handle;
9000 const char *kwnames[] = {
9001 "group_handle", NULL
9004 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_QueryGroupMember", discard_const_p(char *, kwnames), &py_group_handle)) {
9008 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
9009 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
9010 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
9014 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
9018 static PyObject *unpack_py_samr_QueryGroupMember_args_out(struct samr_QueryGroupMember *r)
9022 if (*r->out.rids == NULL) {
9026 py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *r->out.rids, *r->out.rids);
9029 if (NT_STATUS_IS_ERR(r->out.result)) {
9030 PyErr_SetNTSTATUS(r->out.result);
9037 static bool pack_py_samr_SetMemberAttributesOfGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_SetMemberAttributesOfGroup *r)
9039 PyObject *py_group_handle;
9040 PyObject *py_unknown1;
9041 PyObject *py_unknown2;
9042 const char *kwnames[] = {
9043 "group_handle", "unknown1", "unknown2", NULL
9046 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetMemberAttributesOfGroup", discard_const_p(char *, kwnames), &py_group_handle, &py_unknown1, &py_unknown2)) {
9050 r->in.group_handle = talloc_ptrtype(r, r->in.group_handle);
9051 PY_CHECK_TYPE(policy_handle_Type, py_group_handle, return false;);
9052 if (talloc_reference(r, pytalloc_get_mem_ctx(py_group_handle)) == NULL) {
9056 r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
9057 PY_CHECK_TYPE(&PyInt_Type, py_unknown1, return false;);
9058 r->in.unknown1 = PyInt_AsLong(py_unknown1);
9059 PY_CHECK_TYPE(&PyInt_Type, py_unknown2, return false;);
9060 r->in.unknown2 = PyInt_AsLong(py_unknown2);
9064 static PyObject *unpack_py_samr_SetMemberAttributesOfGroup_args_out(struct samr_SetMemberAttributesOfGroup *r)
9069 if (NT_STATUS_IS_ERR(r->out.result)) {
9070 PyErr_SetNTSTATUS(r->out.result);
9077 static bool pack_py_samr_OpenAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenAlias *r)
9079 PyObject *py_domain_handle;
9080 PyObject *py_access_mask;
9082 const char *kwnames[] = {
9083 "domain_handle", "access_mask", "rid", NULL
9086 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
9090 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9091 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9092 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9096 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9097 if (PyLong_Check(py_access_mask)) {
9098 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
9099 } else if (PyInt_Check(py_access_mask)) {
9100 r->in.access_mask = PyInt_AsLong(py_access_mask);
9102 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9103 PyInt_Type.tp_name, PyLong_Type.tp_name);
9106 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
9107 r->in.rid = PyInt_AsLong(py_rid);
9111 static PyObject *unpack_py_samr_OpenAlias_args_out(struct samr_OpenAlias *r)
9114 PyObject *py_alias_handle;
9115 py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
9116 result = py_alias_handle;
9117 if (NT_STATUS_IS_ERR(r->out.result)) {
9118 PyErr_SetNTSTATUS(r->out.result);
9125 static bool pack_py_samr_QueryAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryAliasInfo *r)
9127 PyObject *py_alias_handle;
9129 const char *kwnames[] = {
9130 "alias_handle", "level", NULL
9133 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level)) {
9137 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9138 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9139 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9143 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9144 if (PyLong_Check(py_level)) {
9145 r->in.level = PyLong_AsLongLong(py_level);
9146 } else if (PyInt_Check(py_level)) {
9147 r->in.level = PyInt_AsLong(py_level);
9149 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9150 PyInt_Type.tp_name, PyLong_Type.tp_name);
9156 static PyObject *unpack_py_samr_QueryAliasInfo_args_out(struct samr_QueryAliasInfo *r)
9160 if (*r->out.info == NULL) {
9164 py_info = py_import_samr_AliasInfo(*r->out.info, r->in.level, *r->out.info);
9165 if (py_info == NULL) {
9170 if (NT_STATUS_IS_ERR(r->out.result)) {
9171 PyErr_SetNTSTATUS(r->out.result);
9178 static bool pack_py_samr_SetAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetAliasInfo *r)
9180 PyObject *py_alias_handle;
9183 const char *kwnames[] = {
9184 "alias_handle", "level", "info", NULL
9187 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level, &py_info)) {
9191 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9192 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9193 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9197 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9198 if (PyLong_Check(py_level)) {
9199 r->in.level = PyLong_AsLongLong(py_level);
9200 } else if (PyInt_Check(py_level)) {
9201 r->in.level = PyInt_AsLong(py_level);
9203 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9204 PyInt_Type.tp_name, PyLong_Type.tp_name);
9207 r->in.info = talloc_ptrtype(r, r->in.info);
9209 union samr_AliasInfo *info_switch_1;
9210 info_switch_1 = py_export_samr_AliasInfo(r, r->in.level, py_info);
9211 if (info_switch_1 == NULL) {
9214 r->in.info = info_switch_1;
9219 static PyObject *unpack_py_samr_SetAliasInfo_args_out(struct samr_SetAliasInfo *r)
9224 if (NT_STATUS_IS_ERR(r->out.result)) {
9225 PyErr_SetNTSTATUS(r->out.result);
9232 static bool pack_py_samr_DeleteDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomAlias *r)
9234 PyObject *py_alias_handle;
9235 const char *kwnames[] = {
9236 "alias_handle", NULL
9239 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
9243 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9244 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9245 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9249 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9253 static PyObject *unpack_py_samr_DeleteDomAlias_args_out(struct samr_DeleteDomAlias *r)
9256 PyObject *py_alias_handle;
9257 py_alias_handle = pytalloc_reference_ex(policy_handle_Type, r->out.alias_handle, r->out.alias_handle);
9258 result = py_alias_handle;
9259 if (NT_STATUS_IS_ERR(r->out.result)) {
9260 PyErr_SetNTSTATUS(r->out.result);
9267 static bool pack_py_samr_AddAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddAliasMember *r)
9269 PyObject *py_alias_handle;
9271 const char *kwnames[] = {
9272 "alias_handle", "sid", NULL
9275 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
9279 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9280 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9281 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9285 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9286 r->in.sid = talloc_ptrtype(r, r->in.sid);
9287 PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
9288 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
9292 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9296 static PyObject *unpack_py_samr_AddAliasMember_args_out(struct samr_AddAliasMember *r)
9301 if (NT_STATUS_IS_ERR(r->out.result)) {
9302 PyErr_SetNTSTATUS(r->out.result);
9309 static bool pack_py_samr_DeleteAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteAliasMember *r)
9311 PyObject *py_alias_handle;
9313 const char *kwnames[] = {
9314 "alias_handle", "sid", NULL
9317 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
9321 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9322 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9323 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9327 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9328 r->in.sid = talloc_ptrtype(r, r->in.sid);
9329 PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
9330 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
9334 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9338 static PyObject *unpack_py_samr_DeleteAliasMember_args_out(struct samr_DeleteAliasMember *r)
9343 if (NT_STATUS_IS_ERR(r->out.result)) {
9344 PyErr_SetNTSTATUS(r->out.result);
9351 static bool pack_py_samr_GetMembersInAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_GetMembersInAlias *r)
9353 PyObject *py_alias_handle;
9354 const char *kwnames[] = {
9355 "alias_handle", NULL
9358 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetMembersInAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
9362 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
9363 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
9364 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
9368 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9372 static PyObject *unpack_py_samr_GetMembersInAlias_args_out(struct samr_GetMembersInAlias *r)
9376 py_sids = pytalloc_reference_ex(lsa_SidArray_Type, r->out.sids, r->out.sids);
9378 if (NT_STATUS_IS_ERR(r->out.result)) {
9379 PyErr_SetNTSTATUS(r->out.result);
9386 static bool pack_py_samr_OpenUser_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenUser *r)
9388 PyObject *py_domain_handle;
9389 PyObject *py_access_mask;
9391 const char *kwnames[] = {
9392 "domain_handle", "access_mask", "rid", NULL
9395 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
9399 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9400 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9401 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9405 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9406 if (PyLong_Check(py_access_mask)) {
9407 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
9408 } else if (PyInt_Check(py_access_mask)) {
9409 r->in.access_mask = PyInt_AsLong(py_access_mask);
9411 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9412 PyInt_Type.tp_name, PyLong_Type.tp_name);
9415 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
9416 r->in.rid = PyInt_AsLong(py_rid);
9420 static PyObject *unpack_py_samr_OpenUser_args_out(struct samr_OpenUser *r)
9423 PyObject *py_user_handle;
9424 py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
9425 result = py_user_handle;
9426 if (NT_STATUS_IS_ERR(r->out.result)) {
9427 PyErr_SetNTSTATUS(r->out.result);
9434 static bool pack_py_samr_DeleteUser_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteUser *r)
9436 PyObject *py_user_handle;
9437 const char *kwnames[] = {
9441 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9445 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9446 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9447 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9451 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9455 static PyObject *unpack_py_samr_DeleteUser_args_out(struct samr_DeleteUser *r)
9458 PyObject *py_user_handle;
9459 py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
9460 result = py_user_handle;
9461 if (NT_STATUS_IS_ERR(r->out.result)) {
9462 PyErr_SetNTSTATUS(r->out.result);
9469 static bool pack_py_samr_QueryUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo *r)
9471 PyObject *py_user_handle;
9473 const char *kwnames[] = {
9474 "user_handle", "level", NULL
9477 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
9481 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9482 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9483 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9487 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9488 if (PyLong_Check(py_level)) {
9489 r->in.level = PyLong_AsLongLong(py_level);
9490 } else if (PyInt_Check(py_level)) {
9491 r->in.level = PyInt_AsLong(py_level);
9493 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9494 PyInt_Type.tp_name, PyLong_Type.tp_name);
9500 static PyObject *unpack_py_samr_QueryUserInfo_args_out(struct samr_QueryUserInfo *r)
9504 if (*r->out.info == NULL) {
9508 py_info = py_import_samr_UserInfo(*r->out.info, r->in.level, *r->out.info);
9509 if (py_info == NULL) {
9514 if (NT_STATUS_IS_ERR(r->out.result)) {
9515 PyErr_SetNTSTATUS(r->out.result);
9522 static bool pack_py_samr_SetUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo *r)
9524 PyObject *py_user_handle;
9527 const char *kwnames[] = {
9528 "user_handle", "level", "info", NULL
9531 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
9535 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9536 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9537 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9541 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9542 if (PyLong_Check(py_level)) {
9543 r->in.level = PyLong_AsLongLong(py_level);
9544 } else if (PyInt_Check(py_level)) {
9545 r->in.level = PyInt_AsLong(py_level);
9547 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9548 PyInt_Type.tp_name, PyLong_Type.tp_name);
9551 r->in.info = talloc_ptrtype(r, r->in.info);
9553 union samr_UserInfo *info_switch_1;
9554 info_switch_1 = py_export_samr_UserInfo(r, r->in.level, py_info);
9555 if (info_switch_1 == NULL) {
9558 r->in.info = info_switch_1;
9563 static PyObject *unpack_py_samr_SetUserInfo_args_out(struct samr_SetUserInfo *r)
9568 if (NT_STATUS_IS_ERR(r->out.result)) {
9569 PyErr_SetNTSTATUS(r->out.result);
9576 static bool pack_py_samr_ChangePasswordUser_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser *r)
9578 PyObject *py_user_handle;
9579 PyObject *py_lm_present;
9580 PyObject *py_old_lm_crypted;
9581 PyObject *py_new_lm_crypted;
9582 PyObject *py_nt_present;
9583 PyObject *py_old_nt_crypted;
9584 PyObject *py_new_nt_crypted;
9585 PyObject *py_cross1_present;
9586 PyObject *py_nt_cross;
9587 PyObject *py_cross2_present;
9588 PyObject *py_lm_cross;
9589 const char *kwnames[] = {
9590 "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
9593 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)) {
9597 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9598 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9599 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9603 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9604 PY_CHECK_TYPE(&PyInt_Type, py_lm_present, return false;);
9605 r->in.lm_present = PyInt_AsLong(py_lm_present);
9606 if (py_old_lm_crypted == Py_None) {
9607 r->in.old_lm_crypted = NULL;
9609 r->in.old_lm_crypted = NULL;
9610 PY_CHECK_TYPE(&samr_Password_Type, py_old_lm_crypted, return false;);
9611 if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_lm_crypted)) == NULL) {
9615 r->in.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_lm_crypted);
9617 if (py_new_lm_crypted == Py_None) {
9618 r->in.new_lm_crypted = NULL;
9620 r->in.new_lm_crypted = NULL;
9621 PY_CHECK_TYPE(&samr_Password_Type, py_new_lm_crypted, return false;);
9622 if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_lm_crypted)) == NULL) {
9626 r->in.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_lm_crypted);
9628 PY_CHECK_TYPE(&PyInt_Type, py_nt_present, return false;);
9629 r->in.nt_present = PyInt_AsLong(py_nt_present);
9630 if (py_old_nt_crypted == Py_None) {
9631 r->in.old_nt_crypted = NULL;
9633 r->in.old_nt_crypted = NULL;
9634 PY_CHECK_TYPE(&samr_Password_Type, py_old_nt_crypted, return false;);
9635 if (talloc_reference(r, pytalloc_get_mem_ctx(py_old_nt_crypted)) == NULL) {
9639 r->in.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_nt_crypted);
9641 if (py_new_nt_crypted == Py_None) {
9642 r->in.new_nt_crypted = NULL;
9644 r->in.new_nt_crypted = NULL;
9645 PY_CHECK_TYPE(&samr_Password_Type, py_new_nt_crypted, return false;);
9646 if (talloc_reference(r, pytalloc_get_mem_ctx(py_new_nt_crypted)) == NULL) {
9650 r->in.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_nt_crypted);
9652 PY_CHECK_TYPE(&PyInt_Type, py_cross1_present, return false;);
9653 r->in.cross1_present = PyInt_AsLong(py_cross1_present);
9654 if (py_nt_cross == Py_None) {
9655 r->in.nt_cross = NULL;
9657 r->in.nt_cross = NULL;
9658 PY_CHECK_TYPE(&samr_Password_Type, py_nt_cross, return false;);
9659 if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_cross)) == NULL) {
9663 r->in.nt_cross = (struct samr_Password *)pytalloc_get_ptr(py_nt_cross);
9665 PY_CHECK_TYPE(&PyInt_Type, py_cross2_present, return false;);
9666 r->in.cross2_present = PyInt_AsLong(py_cross2_present);
9667 if (py_lm_cross == Py_None) {
9668 r->in.lm_cross = NULL;
9670 r->in.lm_cross = NULL;
9671 PY_CHECK_TYPE(&samr_Password_Type, py_lm_cross, return false;);
9672 if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_cross)) == NULL) {
9676 r->in.lm_cross = (struct samr_Password *)pytalloc_get_ptr(py_lm_cross);
9681 static PyObject *unpack_py_samr_ChangePasswordUser_args_out(struct samr_ChangePasswordUser *r)
9686 if (NT_STATUS_IS_ERR(r->out.result)) {
9687 PyErr_SetNTSTATUS(r->out.result);
9694 static bool pack_py_samr_GetGroupsForUser_args_in(PyObject *args, PyObject *kwargs, struct samr_GetGroupsForUser *r)
9696 PyObject *py_user_handle;
9697 const char *kwnames[] = {
9701 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetGroupsForUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9705 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9706 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9707 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9711 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9715 static PyObject *unpack_py_samr_GetGroupsForUser_args_out(struct samr_GetGroupsForUser *r)
9719 if (*r->out.rids == NULL) {
9723 py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *r->out.rids, *r->out.rids);
9726 if (NT_STATUS_IS_ERR(r->out.result)) {
9727 PyErr_SetNTSTATUS(r->out.result);
9734 static bool pack_py_samr_QueryDisplayInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo *r)
9736 PyObject *py_domain_handle;
9738 PyObject *py_start_idx;
9739 PyObject *py_max_entries;
9740 PyObject *py_buf_size;
9741 const char *kwnames[] = {
9742 "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
9745 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)) {
9749 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9750 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9751 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9755 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9756 PY_CHECK_TYPE(&PyInt_Type, py_level, return false;);
9757 r->in.level = PyInt_AsLong(py_level);
9758 PY_CHECK_TYPE(&PyInt_Type, py_start_idx, return false;);
9759 r->in.start_idx = PyInt_AsLong(py_start_idx);
9760 PY_CHECK_TYPE(&PyInt_Type, py_max_entries, return false;);
9761 r->in.max_entries = PyInt_AsLong(py_max_entries);
9762 PY_CHECK_TYPE(&PyInt_Type, py_buf_size, return false;);
9763 r->in.buf_size = PyInt_AsLong(py_buf_size);
9767 static PyObject *unpack_py_samr_QueryDisplayInfo_args_out(struct samr_QueryDisplayInfo *r)
9770 PyObject *py_total_size;
9771 PyObject *py_returned_size;
9773 result = PyTuple_New(3);
9774 py_total_size = PyInt_FromLong(*r->out.total_size);
9775 PyTuple_SetItem(result, 0, py_total_size);
9776 py_returned_size = PyInt_FromLong(*r->out.returned_size);
9777 PyTuple_SetItem(result, 1, py_returned_size);
9778 py_info = py_import_samr_DispInfo(r->out.info, r->in.level, r->out.info);
9779 if (py_info == NULL) {
9782 PyTuple_SetItem(result, 2, py_info);
9783 if (NT_STATUS_IS_ERR(r->out.result)) {
9784 PyErr_SetNTSTATUS(r->out.result);
9791 static bool pack_py_samr_GetDisplayEnumerationIndex_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex *r)
9793 PyObject *py_domain_handle;
9796 const char *kwnames[] = {
9797 "domain_handle", "level", "name", NULL
9800 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
9804 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9805 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9806 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9810 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9811 PY_CHECK_TYPE(&PyInt_Type, py_level, return false;);
9812 r->in.level = PyInt_AsLong(py_level);
9813 r->in.name = talloc_ptrtype(r, r->in.name);
9814 PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
9815 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
9819 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
9823 static PyObject *unpack_py_samr_GetDisplayEnumerationIndex_args_out(struct samr_GetDisplayEnumerationIndex *r)
9827 py_idx = PyInt_FromLong(*r->out.idx);
9829 if (NT_STATUS_IS_ERR(r->out.result)) {
9830 PyErr_SetNTSTATUS(r->out.result);
9837 static bool pack_py_samr_TestPrivateFunctionsDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsDomain *r)
9839 PyObject *py_domain_handle;
9840 const char *kwnames[] = {
9841 "domain_handle", NULL
9844 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsDomain", discard_const_p(char *, kwnames), &py_domain_handle)) {
9848 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9849 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9850 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9854 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9858 static PyObject *unpack_py_samr_TestPrivateFunctionsDomain_args_out(struct samr_TestPrivateFunctionsDomain *r)
9863 if (NT_STATUS_IS_ERR(r->out.result)) {
9864 PyErr_SetNTSTATUS(r->out.result);
9871 static bool pack_py_samr_TestPrivateFunctionsUser_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsUser *r)
9873 PyObject *py_user_handle;
9874 const char *kwnames[] = {
9878 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9882 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9883 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9884 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9888 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9892 static PyObject *unpack_py_samr_TestPrivateFunctionsUser_args_out(struct samr_TestPrivateFunctionsUser *r)
9897 if (NT_STATUS_IS_ERR(r->out.result)) {
9898 PyErr_SetNTSTATUS(r->out.result);
9905 static bool pack_py_samr_GetUserPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetUserPwInfo *r)
9907 PyObject *py_user_handle;
9908 const char *kwnames[] = {
9912 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetUserPwInfo", discard_const_p(char *, kwnames), &py_user_handle)) {
9916 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
9917 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
9918 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
9922 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9926 static PyObject *unpack_py_samr_GetUserPwInfo_args_out(struct samr_GetUserPwInfo *r)
9930 py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
9932 if (NT_STATUS_IS_ERR(r->out.result)) {
9933 PyErr_SetNTSTATUS(r->out.result);
9940 static bool pack_py_samr_RemoveMemberFromForeignDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMemberFromForeignDomain *r)
9942 PyObject *py_domain_handle;
9944 const char *kwnames[] = {
9945 "domain_handle", "sid", NULL
9948 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMemberFromForeignDomain", discard_const_p(char *, kwnames), &py_domain_handle, &py_sid)) {
9952 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9953 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9954 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
9958 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9959 r->in.sid = talloc_ptrtype(r, r->in.sid);
9960 PY_CHECK_TYPE(dom_sid_Type, py_sid, return false;);
9961 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sid)) == NULL) {
9965 r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9969 static PyObject *unpack_py_samr_RemoveMemberFromForeignDomain_args_out(struct samr_RemoveMemberFromForeignDomain *r)
9974 if (NT_STATUS_IS_ERR(r->out.result)) {
9975 PyErr_SetNTSTATUS(r->out.result);
9982 static bool pack_py_samr_QueryDomainInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo2 *r)
9984 PyObject *py_domain_handle;
9986 const char *kwnames[] = {
9987 "domain_handle", "level", NULL
9990 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
9994 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
9995 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
9996 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10000 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10001 if (PyLong_Check(py_level)) {
10002 r->in.level = PyLong_AsLongLong(py_level);
10003 } else if (PyInt_Check(py_level)) {
10004 r->in.level = PyInt_AsLong(py_level);
10006 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10007 PyInt_Type.tp_name, PyLong_Type.tp_name);
10013 static PyObject *unpack_py_samr_QueryDomainInfo2_args_out(struct samr_QueryDomainInfo2 *r)
10017 if (*r->out.info == NULL) {
10019 Py_INCREF(py_info);
10021 py_info = py_import_samr_DomainInfo(*r->out.info, r->in.level, *r->out.info);
10022 if (py_info == NULL) {
10027 if (NT_STATUS_IS_ERR(r->out.result)) {
10028 PyErr_SetNTSTATUS(r->out.result);
10035 static bool pack_py_samr_QueryUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo2 *r)
10037 PyObject *py_user_handle;
10038 PyObject *py_level;
10039 const char *kwnames[] = {
10040 "user_handle", "level", NULL
10043 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
10047 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
10048 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
10049 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
10053 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
10054 if (PyLong_Check(py_level)) {
10055 r->in.level = PyLong_AsLongLong(py_level);
10056 } else if (PyInt_Check(py_level)) {
10057 r->in.level = PyInt_AsLong(py_level);
10059 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10060 PyInt_Type.tp_name, PyLong_Type.tp_name);
10066 static PyObject *unpack_py_samr_QueryUserInfo2_args_out(struct samr_QueryUserInfo2 *r)
10070 if (*r->out.info == NULL) {
10072 Py_INCREF(py_info);
10074 py_info = py_import_samr_UserInfo(*r->out.info, r->in.level, *r->out.info);
10075 if (py_info == NULL) {
10080 if (NT_STATUS_IS_ERR(r->out.result)) {
10081 PyErr_SetNTSTATUS(r->out.result);
10088 static bool pack_py_samr_QueryDisplayInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo2 *r)
10090 PyObject *py_domain_handle;
10091 PyObject *py_level;
10092 PyObject *py_start_idx;
10093 PyObject *py_max_entries;
10094 PyObject *py_buf_size;
10095 const char *kwnames[] = {
10096 "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
10099 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)) {
10103 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
10104 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
10105 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10109 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10110 PY_CHECK_TYPE(&PyInt_Type, py_level, return false;);
10111 r->in.level = PyInt_AsLong(py_level);
10112 PY_CHECK_TYPE(&PyInt_Type, py_start_idx, return false;);
10113 r->in.start_idx = PyInt_AsLong(py_start_idx);
10114 PY_CHECK_TYPE(&PyInt_Type, py_max_entries, return false;);
10115 r->in.max_entries = PyInt_AsLong(py_max_entries);
10116 PY_CHECK_TYPE(&PyInt_Type, py_buf_size, return false;);
10117 r->in.buf_size = PyInt_AsLong(py_buf_size);
10121 static PyObject *unpack_py_samr_QueryDisplayInfo2_args_out(struct samr_QueryDisplayInfo2 *r)
10124 PyObject *py_total_size;
10125 PyObject *py_returned_size;
10127 result = PyTuple_New(3);
10128 py_total_size = PyInt_FromLong(*r->out.total_size);
10129 PyTuple_SetItem(result, 0, py_total_size);
10130 py_returned_size = PyInt_FromLong(*r->out.returned_size);
10131 PyTuple_SetItem(result, 1, py_returned_size);
10132 py_info = py_import_samr_DispInfo(r->out.info, r->in.level, r->out.info);
10133 if (py_info == NULL) {
10136 PyTuple_SetItem(result, 2, py_info);
10137 if (NT_STATUS_IS_ERR(r->out.result)) {
10138 PyErr_SetNTSTATUS(r->out.result);
10145 static bool pack_py_samr_GetDisplayEnumerationIndex2_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex2 *r)
10147 PyObject *py_domain_handle;
10148 PyObject *py_level;
10150 const char *kwnames[] = {
10151 "domain_handle", "level", "name", NULL
10154 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
10158 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
10159 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
10160 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10164 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10165 PY_CHECK_TYPE(&PyInt_Type, py_level, return false;);
10166 r->in.level = PyInt_AsLong(py_level);
10167 r->in.name = talloc_ptrtype(r, r->in.name);
10168 PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
10169 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
10173 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
10177 static PyObject *unpack_py_samr_GetDisplayEnumerationIndex2_args_out(struct samr_GetDisplayEnumerationIndex2 *r)
10181 py_idx = PyInt_FromLong(*r->out.idx);
10183 if (NT_STATUS_IS_ERR(r->out.result)) {
10184 PyErr_SetNTSTATUS(r->out.result);
10191 static bool pack_py_samr_CreateUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser2 *r)
10193 PyObject *py_domain_handle;
10194 PyObject *py_account_name;
10195 PyObject *py_acct_flags;
10196 PyObject *py_access_mask;
10197 const char *kwnames[] = {
10198 "domain_handle", "account_name", "acct_flags", "access_mask", NULL
10201 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)) {
10205 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
10206 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
10207 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10211 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10212 r->in.account_name = talloc_ptrtype(r, r->in.account_name);
10213 PY_CHECK_TYPE(lsa_String_Type, py_account_name, return false;);
10214 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account_name)) == NULL) {
10218 r->in.account_name = (struct lsa_String *)pytalloc_get_ptr(py_account_name);
10219 if (PyLong_Check(py_acct_flags)) {
10220 r->in.acct_flags = PyLong_AsLongLong(py_acct_flags);
10221 } else if (PyInt_Check(py_acct_flags)) {
10222 r->in.acct_flags = PyInt_AsLong(py_acct_flags);
10224 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10225 PyInt_Type.tp_name, PyLong_Type.tp_name);
10228 if (PyLong_Check(py_access_mask)) {
10229 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
10230 } else if (PyInt_Check(py_access_mask)) {
10231 r->in.access_mask = PyInt_AsLong(py_access_mask);
10233 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10234 PyInt_Type.tp_name, PyLong_Type.tp_name);
10240 static PyObject *unpack_py_samr_CreateUser2_args_out(struct samr_CreateUser2 *r)
10243 PyObject *py_user_handle;
10244 PyObject *py_access_granted;
10246 result = PyTuple_New(3);
10247 py_user_handle = pytalloc_reference_ex(policy_handle_Type, r->out.user_handle, r->out.user_handle);
10248 PyTuple_SetItem(result, 0, py_user_handle);
10249 py_access_granted = PyInt_FromLong(*r->out.access_granted);
10250 PyTuple_SetItem(result, 1, py_access_granted);
10251 py_rid = PyInt_FromLong(*r->out.rid);
10252 PyTuple_SetItem(result, 2, py_rid);
10253 if (NT_STATUS_IS_ERR(r->out.result)) {
10254 PyErr_SetNTSTATUS(r->out.result);
10261 static bool pack_py_samr_QueryDisplayInfo3_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo3 *r)
10263 PyObject *py_domain_handle;
10264 PyObject *py_level;
10265 PyObject *py_start_idx;
10266 PyObject *py_max_entries;
10267 PyObject *py_buf_size;
10268 const char *kwnames[] = {
10269 "domain_handle", "level", "start_idx", "max_entries", "buf_size", NULL
10272 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)) {
10276 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
10277 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
10278 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10282 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10283 PY_CHECK_TYPE(&PyInt_Type, py_level, return false;);
10284 r->in.level = PyInt_AsLong(py_level);
10285 PY_CHECK_TYPE(&PyInt_Type, py_start_idx, return false;);
10286 r->in.start_idx = PyInt_AsLong(py_start_idx);
10287 PY_CHECK_TYPE(&PyInt_Type, py_max_entries, return false;);
10288 r->in.max_entries = PyInt_AsLong(py_max_entries);
10289 PY_CHECK_TYPE(&PyInt_Type, py_buf_size, return false;);
10290 r->in.buf_size = PyInt_AsLong(py_buf_size);
10294 static PyObject *unpack_py_samr_QueryDisplayInfo3_args_out(struct samr_QueryDisplayInfo3 *r)
10297 PyObject *py_total_size;
10298 PyObject *py_returned_size;
10300 result = PyTuple_New(3);
10301 py_total_size = PyInt_FromLong(*r->out.total_size);
10302 PyTuple_SetItem(result, 0, py_total_size);
10303 py_returned_size = PyInt_FromLong(*r->out.returned_size);
10304 PyTuple_SetItem(result, 1, py_returned_size);
10305 py_info = py_import_samr_DispInfo(r->out.info, r->in.level, r->out.info);
10306 if (py_info == NULL) {
10309 PyTuple_SetItem(result, 2, py_info);
10310 if (NT_STATUS_IS_ERR(r->out.result)) {
10311 PyErr_SetNTSTATUS(r->out.result);
10318 static bool pack_py_samr_AddMultipleMembersToAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_AddMultipleMembersToAlias *r)
10320 PyObject *py_alias_handle;
10322 const char *kwnames[] = {
10323 "alias_handle", "sids", NULL
10326 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddMultipleMembersToAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
10330 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
10331 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
10332 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
10336 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
10337 r->in.sids = talloc_ptrtype(r, r->in.sids);
10338 PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
10339 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
10343 r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
10347 static PyObject *unpack_py_samr_AddMultipleMembersToAlias_args_out(struct samr_AddMultipleMembersToAlias *r)
10352 if (NT_STATUS_IS_ERR(r->out.result)) {
10353 PyErr_SetNTSTATUS(r->out.result);
10360 static bool pack_py_samr_RemoveMultipleMembersFromAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMultipleMembersFromAlias *r)
10362 PyObject *py_alias_handle;
10364 const char *kwnames[] = {
10365 "alias_handle", "sids", NULL
10368 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMultipleMembersFromAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
10372 r->in.alias_handle = talloc_ptrtype(r, r->in.alias_handle);
10373 PY_CHECK_TYPE(policy_handle_Type, py_alias_handle, return false;);
10374 if (talloc_reference(r, pytalloc_get_mem_ctx(py_alias_handle)) == NULL) {
10378 r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
10379 r->in.sids = talloc_ptrtype(r, r->in.sids);
10380 PY_CHECK_TYPE(lsa_SidArray_Type, py_sids, return false;);
10381 if (talloc_reference(r, pytalloc_get_mem_ctx(py_sids)) == NULL) {
10385 r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
10389 static PyObject *unpack_py_samr_RemoveMultipleMembersFromAlias_args_out(struct samr_RemoveMultipleMembersFromAlias *r)
10394 if (NT_STATUS_IS_ERR(r->out.result)) {
10395 PyErr_SetNTSTATUS(r->out.result);
10402 static bool pack_py_samr_OemChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_OemChangePasswordUser2 *r)
10404 PyObject *py_server;
10405 PyObject *py_account;
10406 PyObject *py_password;
10408 const char *kwnames[] = {
10409 "server", "account", "password", "hash", NULL
10412 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_OemChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_password, &py_hash)) {
10416 if (py_server == Py_None) {
10417 r->in.server = NULL;
10419 r->in.server = NULL;
10420 PY_CHECK_TYPE(lsa_AsciiString_Type, py_server, return false;);
10421 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
10425 r->in.server = (struct lsa_AsciiString *)pytalloc_get_ptr(py_server);
10427 r->in.account = talloc_ptrtype(r, r->in.account);
10428 PY_CHECK_TYPE(lsa_AsciiString_Type, py_account, return false;);
10429 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
10433 r->in.account = (struct lsa_AsciiString *)pytalloc_get_ptr(py_account);
10434 if (py_password == Py_None) {
10435 r->in.password = NULL;
10437 r->in.password = NULL;
10438 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password, return false;);
10439 if (talloc_reference(r, pytalloc_get_mem_ctx(py_password)) == NULL) {
10443 r->in.password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password);
10445 if (py_hash == Py_None) {
10449 PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
10450 if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
10454 r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
10459 static PyObject *unpack_py_samr_OemChangePasswordUser2_args_out(struct samr_OemChangePasswordUser2 *r)
10464 if (NT_STATUS_IS_ERR(r->out.result)) {
10465 PyErr_SetNTSTATUS(r->out.result);
10472 static bool pack_py_samr_ChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser2 *r)
10474 PyObject *py_server;
10475 PyObject *py_account;
10476 PyObject *py_nt_password;
10477 PyObject *py_nt_verifier;
10478 PyObject *py_lm_change;
10479 PyObject *py_lm_password;
10480 PyObject *py_lm_verifier;
10481 const char *kwnames[] = {
10482 "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", NULL
10485 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)) {
10489 if (py_server == Py_None) {
10490 r->in.server = NULL;
10492 r->in.server = NULL;
10493 PY_CHECK_TYPE(lsa_String_Type, py_server, return false;);
10494 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
10498 r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
10500 r->in.account = talloc_ptrtype(r, r->in.account);
10501 PY_CHECK_TYPE(lsa_String_Type, py_account, return false;);
10502 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
10506 r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account);
10507 if (py_nt_password == Py_None) {
10508 r->in.nt_password = NULL;
10510 r->in.nt_password = NULL;
10511 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;);
10512 if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) {
10516 r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
10518 if (py_nt_verifier == Py_None) {
10519 r->in.nt_verifier = NULL;
10521 r->in.nt_verifier = NULL;
10522 PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;);
10523 if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) {
10527 r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
10529 PY_CHECK_TYPE(&PyInt_Type, py_lm_change, return false;);
10530 r->in.lm_change = PyInt_AsLong(py_lm_change);
10531 if (py_lm_password == Py_None) {
10532 r->in.lm_password = NULL;
10534 r->in.lm_password = NULL;
10535 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;);
10536 if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) {
10540 r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
10542 if (py_lm_verifier == Py_None) {
10543 r->in.lm_verifier = NULL;
10545 r->in.lm_verifier = NULL;
10546 PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;);
10547 if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) {
10551 r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
10556 static PyObject *unpack_py_samr_ChangePasswordUser2_args_out(struct samr_ChangePasswordUser2 *r)
10561 if (NT_STATUS_IS_ERR(r->out.result)) {
10562 PyErr_SetNTSTATUS(r->out.result);
10569 static bool pack_py_samr_GetDomPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDomPwInfo *r)
10571 PyObject *py_domain_name;
10572 const char *kwnames[] = {
10573 "domain_name", NULL
10576 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetDomPwInfo", discard_const_p(char *, kwnames), &py_domain_name)) {
10580 if (py_domain_name == Py_None) {
10581 r->in.domain_name = NULL;
10583 r->in.domain_name = NULL;
10584 PY_CHECK_TYPE(lsa_String_Type, py_domain_name, return false;);
10585 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_name)) == NULL) {
10589 r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
10594 static PyObject *unpack_py_samr_GetDomPwInfo_args_out(struct samr_GetDomPwInfo *r)
10598 py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
10600 if (NT_STATUS_IS_ERR(r->out.result)) {
10601 PyErr_SetNTSTATUS(r->out.result);
10608 static bool pack_py_samr_Connect2_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect2 *r)
10610 PyObject *py_system_name;
10611 PyObject *py_access_mask;
10612 const char *kwnames[] = {
10613 "system_name", "access_mask", NULL
10616 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect2", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
10620 if (py_system_name == Py_None) {
10621 r->in.system_name = NULL;
10623 r->in.system_name = NULL;
10624 if (PyUnicode_Check(py_system_name)) {
10625 r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
10626 } else if (PyString_Check(py_system_name)) {
10627 r->in.system_name = PyString_AS_STRING(py_system_name);
10629 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10633 if (PyLong_Check(py_access_mask)) {
10634 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
10635 } else if (PyInt_Check(py_access_mask)) {
10636 r->in.access_mask = PyInt_AsLong(py_access_mask);
10638 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10639 PyInt_Type.tp_name, PyLong_Type.tp_name);
10645 static PyObject *unpack_py_samr_Connect2_args_out(struct samr_Connect2 *r)
10648 PyObject *py_connect_handle;
10649 py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
10650 result = py_connect_handle;
10651 if (NT_STATUS_IS_ERR(r->out.result)) {
10652 PyErr_SetNTSTATUS(r->out.result);
10659 static bool pack_py_samr_SetUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo2 *r)
10661 PyObject *py_user_handle;
10662 PyObject *py_level;
10664 const char *kwnames[] = {
10665 "user_handle", "level", "info", NULL
10668 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
10672 r->in.user_handle = talloc_ptrtype(r, r->in.user_handle);
10673 PY_CHECK_TYPE(policy_handle_Type, py_user_handle, return false;);
10674 if (talloc_reference(r, pytalloc_get_mem_ctx(py_user_handle)) == NULL) {
10678 r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
10679 if (PyLong_Check(py_level)) {
10680 r->in.level = PyLong_AsLongLong(py_level);
10681 } else if (PyInt_Check(py_level)) {
10682 r->in.level = PyInt_AsLong(py_level);
10684 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10685 PyInt_Type.tp_name, PyLong_Type.tp_name);
10688 r->in.info = talloc_ptrtype(r, r->in.info);
10690 union samr_UserInfo *info_switch_1;
10691 info_switch_1 = py_export_samr_UserInfo(r, r->in.level, py_info);
10692 if (info_switch_1 == NULL) {
10695 r->in.info = info_switch_1;
10700 static PyObject *unpack_py_samr_SetUserInfo2_args_out(struct samr_SetUserInfo2 *r)
10705 if (NT_STATUS_IS_ERR(r->out.result)) {
10706 PyErr_SetNTSTATUS(r->out.result);
10713 static bool pack_py_samr_SetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_SetBootKeyInformation *r)
10715 PyObject *py_connect_handle;
10716 PyObject *py_unknown1;
10717 PyObject *py_unknown2;
10718 PyObject *py_unknown3;
10719 const char *kwnames[] = {
10720 "connect_handle", "unknown1", "unknown2", "unknown3", NULL
10723 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_SetBootKeyInformation", discard_const_p(char *, kwnames), &py_connect_handle, &py_unknown1, &py_unknown2, &py_unknown3)) {
10727 r->in.connect_handle = talloc_ptrtype(r, r->in.connect_handle);
10728 PY_CHECK_TYPE(policy_handle_Type, py_connect_handle, return false;);
10729 if (talloc_reference(r, pytalloc_get_mem_ctx(py_connect_handle)) == NULL) {
10733 r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
10734 PY_CHECK_TYPE(&PyInt_Type, py_unknown1, return false;);
10735 r->in.unknown1 = PyInt_AsLong(py_unknown1);
10736 PY_CHECK_TYPE(&PyInt_Type, py_unknown2, return false;);
10737 r->in.unknown2 = PyInt_AsLong(py_unknown2);
10738 PY_CHECK_TYPE(&PyInt_Type, py_unknown3, return false;);
10739 r->in.unknown3 = PyInt_AsLong(py_unknown3);
10743 static PyObject *unpack_py_samr_SetBootKeyInformation_args_out(struct samr_SetBootKeyInformation *r)
10748 if (NT_STATUS_IS_ERR(r->out.result)) {
10749 PyErr_SetNTSTATUS(r->out.result);
10756 static bool pack_py_samr_GetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_GetBootKeyInformation *r)
10758 PyObject *py_domain_handle;
10759 const char *kwnames[] = {
10760 "domain_handle", NULL
10763 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetBootKeyInformation", discard_const_p(char *, kwnames), &py_domain_handle)) {
10767 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
10768 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
10769 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
10773 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10777 static PyObject *unpack_py_samr_GetBootKeyInformation_args_out(struct samr_GetBootKeyInformation *r)
10780 PyObject *py_unknown;
10781 py_unknown = PyInt_FromLong(*r->out.unknown);
10782 result = py_unknown;
10783 if (NT_STATUS_IS_ERR(r->out.result)) {
10784 PyErr_SetNTSTATUS(r->out.result);
10791 static bool pack_py_samr_Connect3_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect3 *r)
10793 PyObject *py_system_name;
10794 PyObject *py_unknown;
10795 PyObject *py_access_mask;
10796 const char *kwnames[] = {
10797 "system_name", "unknown", "access_mask", NULL
10800 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect3", discard_const_p(char *, kwnames), &py_system_name, &py_unknown, &py_access_mask)) {
10804 if (py_system_name == Py_None) {
10805 r->in.system_name = NULL;
10807 r->in.system_name = NULL;
10808 if (PyUnicode_Check(py_system_name)) {
10809 r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
10810 } else if (PyString_Check(py_system_name)) {
10811 r->in.system_name = PyString_AS_STRING(py_system_name);
10813 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10817 PY_CHECK_TYPE(&PyInt_Type, py_unknown, return false;);
10818 r->in.unknown = PyInt_AsLong(py_unknown);
10819 if (PyLong_Check(py_access_mask)) {
10820 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
10821 } else if (PyInt_Check(py_access_mask)) {
10822 r->in.access_mask = PyInt_AsLong(py_access_mask);
10824 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10825 PyInt_Type.tp_name, PyLong_Type.tp_name);
10831 static PyObject *unpack_py_samr_Connect3_args_out(struct samr_Connect3 *r)
10834 PyObject *py_connect_handle;
10835 py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
10836 result = py_connect_handle;
10837 if (NT_STATUS_IS_ERR(r->out.result)) {
10838 PyErr_SetNTSTATUS(r->out.result);
10845 static bool pack_py_samr_Connect4_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect4 *r)
10847 PyObject *py_system_name;
10848 PyObject *py_client_version;
10849 PyObject *py_access_mask;
10850 const char *kwnames[] = {
10851 "system_name", "client_version", "access_mask", NULL
10854 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect4", discard_const_p(char *, kwnames), &py_system_name, &py_client_version, &py_access_mask)) {
10858 if (py_system_name == Py_None) {
10859 r->in.system_name = NULL;
10861 r->in.system_name = NULL;
10862 if (PyUnicode_Check(py_system_name)) {
10863 r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
10864 } else if (PyString_Check(py_system_name)) {
10865 r->in.system_name = PyString_AS_STRING(py_system_name);
10867 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10871 if (PyLong_Check(py_client_version)) {
10872 r->in.client_version = PyLong_AsLongLong(py_client_version);
10873 } else if (PyInt_Check(py_client_version)) {
10874 r->in.client_version = PyInt_AsLong(py_client_version);
10876 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10877 PyInt_Type.tp_name, PyLong_Type.tp_name);
10880 if (PyLong_Check(py_access_mask)) {
10881 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
10882 } else if (PyInt_Check(py_access_mask)) {
10883 r->in.access_mask = PyInt_AsLong(py_access_mask);
10885 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10886 PyInt_Type.tp_name, PyLong_Type.tp_name);
10892 static PyObject *unpack_py_samr_Connect4_args_out(struct samr_Connect4 *r)
10895 PyObject *py_connect_handle;
10896 py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
10897 result = py_connect_handle;
10898 if (NT_STATUS_IS_ERR(r->out.result)) {
10899 PyErr_SetNTSTATUS(r->out.result);
10906 static bool pack_py_samr_ChangePasswordUser3_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser3 *r)
10908 PyObject *py_server;
10909 PyObject *py_account;
10910 PyObject *py_nt_password;
10911 PyObject *py_nt_verifier;
10912 PyObject *py_lm_change;
10913 PyObject *py_lm_password;
10914 PyObject *py_lm_verifier;
10915 PyObject *py_password3;
10916 const char *kwnames[] = {
10917 "server", "account", "nt_password", "nt_verifier", "lm_change", "lm_password", "lm_verifier", "password3", NULL
10920 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)) {
10924 if (py_server == Py_None) {
10925 r->in.server = NULL;
10927 r->in.server = NULL;
10928 PY_CHECK_TYPE(lsa_String_Type, py_server, return false;);
10929 if (talloc_reference(r, pytalloc_get_mem_ctx(py_server)) == NULL) {
10933 r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
10935 r->in.account = talloc_ptrtype(r, r->in.account);
10936 PY_CHECK_TYPE(lsa_String_Type, py_account, return false;);
10937 if (talloc_reference(r, pytalloc_get_mem_ctx(py_account)) == NULL) {
10941 r->in.account = (struct lsa_String *)pytalloc_get_ptr(py_account);
10942 if (py_nt_password == Py_None) {
10943 r->in.nt_password = NULL;
10945 r->in.nt_password = NULL;
10946 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_nt_password, return false;);
10947 if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_password)) == NULL) {
10951 r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
10953 if (py_nt_verifier == Py_None) {
10954 r->in.nt_verifier = NULL;
10956 r->in.nt_verifier = NULL;
10957 PY_CHECK_TYPE(&samr_Password_Type, py_nt_verifier, return false;);
10958 if (talloc_reference(r, pytalloc_get_mem_ctx(py_nt_verifier)) == NULL) {
10962 r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
10964 PY_CHECK_TYPE(&PyInt_Type, py_lm_change, return false;);
10965 r->in.lm_change = PyInt_AsLong(py_lm_change);
10966 if (py_lm_password == Py_None) {
10967 r->in.lm_password = NULL;
10969 r->in.lm_password = NULL;
10970 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_lm_password, return false;);
10971 if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_password)) == NULL) {
10975 r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
10977 if (py_lm_verifier == Py_None) {
10978 r->in.lm_verifier = NULL;
10980 r->in.lm_verifier = NULL;
10981 PY_CHECK_TYPE(&samr_Password_Type, py_lm_verifier, return false;);
10982 if (talloc_reference(r, pytalloc_get_mem_ctx(py_lm_verifier)) == NULL) {
10986 r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
10988 if (py_password3 == Py_None) {
10989 r->in.password3 = NULL;
10991 r->in.password3 = NULL;
10992 PY_CHECK_TYPE(&samr_CryptPassword_Type, py_password3, return false;);
10993 if (talloc_reference(r, pytalloc_get_mem_ctx(py_password3)) == NULL) {
10997 r->in.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password3);
11002 static PyObject *unpack_py_samr_ChangePasswordUser3_args_out(struct samr_ChangePasswordUser3 *r)
11005 PyObject *py_dominfo;
11006 PyObject *py_reject;
11007 result = PyTuple_New(2);
11008 if (*r->out.dominfo == NULL) {
11009 py_dominfo = Py_None;
11010 Py_INCREF(py_dominfo);
11012 py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo);
11014 PyTuple_SetItem(result, 0, py_dominfo);
11015 if (*r->out.reject == NULL) {
11016 py_reject = Py_None;
11017 Py_INCREF(py_reject);
11019 py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *r->out.reject, *r->out.reject);
11021 PyTuple_SetItem(result, 1, py_reject);
11022 if (NT_STATUS_IS_ERR(r->out.result)) {
11023 PyErr_SetNTSTATUS(r->out.result);
11030 static bool pack_py_samr_Connect5_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect5 *r)
11032 PyObject *py_system_name;
11033 PyObject *py_access_mask;
11034 PyObject *py_level_in;
11035 PyObject *py_info_in;
11036 const char *kwnames[] = {
11037 "system_name", "access_mask", "level_in", "info_in", NULL
11040 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)) {
11044 if (py_system_name == Py_None) {
11045 r->in.system_name = NULL;
11047 r->in.system_name = NULL;
11048 if (PyUnicode_Check(py_system_name)) {
11049 r->in.system_name = PyString_AS_STRING(PyUnicode_AsEncodedString(py_system_name, "utf-8", "ignore"));
11050 } else if (PyString_Check(py_system_name)) {
11051 r->in.system_name = PyString_AS_STRING(py_system_name);
11053 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
11057 if (PyLong_Check(py_access_mask)) {
11058 r->in.access_mask = PyLong_AsLongLong(py_access_mask);
11059 } else if (PyInt_Check(py_access_mask)) {
11060 r->in.access_mask = PyInt_AsLong(py_access_mask);
11062 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11063 PyInt_Type.tp_name, PyLong_Type.tp_name);
11066 PY_CHECK_TYPE(&PyInt_Type, py_level_in, return false;);
11067 r->in.level_in = PyInt_AsLong(py_level_in);
11068 r->in.info_in = talloc_ptrtype(r, r->in.info_in);
11070 union samr_ConnectInfo *info_in_switch_1;
11071 info_in_switch_1 = py_export_samr_ConnectInfo(r, r->in.level_in, py_info_in);
11072 if (info_in_switch_1 == NULL) {
11075 r->in.info_in = info_in_switch_1;
11080 static PyObject *unpack_py_samr_Connect5_args_out(struct samr_Connect5 *r)
11083 PyObject *py_level_out;
11084 PyObject *py_info_out;
11085 PyObject *py_connect_handle;
11086 result = PyTuple_New(3);
11087 py_level_out = PyInt_FromLong(*r->out.level_out);
11088 PyTuple_SetItem(result, 0, py_level_out);
11089 py_info_out = py_import_samr_ConnectInfo(r->out.info_out, *r->out.level_out, r->out.info_out);
11090 if (py_info_out == NULL) {
11093 PyTuple_SetItem(result, 1, py_info_out);
11094 py_connect_handle = pytalloc_reference_ex(policy_handle_Type, r->out.connect_handle, r->out.connect_handle);
11095 PyTuple_SetItem(result, 2, py_connect_handle);
11096 if (NT_STATUS_IS_ERR(r->out.result)) {
11097 PyErr_SetNTSTATUS(r->out.result);
11104 static bool pack_py_samr_RidToSid_args_in(PyObject *args, PyObject *kwargs, struct samr_RidToSid *r)
11106 PyObject *py_domain_handle;
11108 const char *kwnames[] = {
11109 "domain_handle", "rid", NULL
11112 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RidToSid", discard_const_p(char *, kwnames), &py_domain_handle, &py_rid)) {
11116 r->in.domain_handle = talloc_ptrtype(r, r->in.domain_handle);
11117 PY_CHECK_TYPE(policy_handle_Type, py_domain_handle, return false;);
11118 if (talloc_reference(r, pytalloc_get_mem_ctx(py_domain_handle)) == NULL) {
11122 r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
11123 PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
11124 r->in.rid = PyInt_AsLong(py_rid);
11128 static PyObject *unpack_py_samr_RidToSid_args_out(struct samr_RidToSid *r)
11132 if (*r->out.sid == NULL) {
11136 py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
11139 if (NT_STATUS_IS_ERR(r->out.result)) {
11140 PyErr_SetNTSTATUS(r->out.result);
11147 static bool pack_py_samr_SetDsrmPassword_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDsrmPassword *r)
11150 PyObject *py_unknown;
11152 const char *kwnames[] = {
11153 "name", "unknown", "hash", NULL
11156 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDsrmPassword", discard_const_p(char *, kwnames), &py_name, &py_unknown, &py_hash)) {
11160 if (py_name == Py_None) {
11164 PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
11165 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
11169 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
11171 PY_CHECK_TYPE(&PyInt_Type, py_unknown, return false;);
11172 r->in.unknown = PyInt_AsLong(py_unknown);
11173 if (py_hash == Py_None) {
11177 PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
11178 if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
11182 r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
11187 static PyObject *unpack_py_samr_SetDsrmPassword_args_out(struct samr_SetDsrmPassword *r)
11192 if (NT_STATUS_IS_ERR(r->out.result)) {
11193 PyErr_SetNTSTATUS(r->out.result);
11200 static bool pack_py_samr_ValidatePassword_args_in(PyObject *args, PyObject *kwargs, struct samr_ValidatePassword *r)
11202 PyObject *py_level;
11204 const char *kwnames[] = {
11205 "level", "req", NULL
11208 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_ValidatePassword", discard_const_p(char *, kwnames), &py_level, &py_req)) {
11212 if (PyLong_Check(py_level)) {
11213 r->in.level = PyLong_AsLongLong(py_level);
11214 } else if (PyInt_Check(py_level)) {
11215 r->in.level = PyInt_AsLong(py_level);
11217 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11218 PyInt_Type.tp_name, PyLong_Type.tp_name);
11221 r->in.req = talloc_ptrtype(r, r->in.req);
11223 union samr_ValidatePasswordReq *req_switch_1;
11224 req_switch_1 = py_export_samr_ValidatePasswordReq(r, r->in.level, py_req);
11225 if (req_switch_1 == NULL) {
11228 r->in.req = req_switch_1;
11233 static PyObject *unpack_py_samr_ValidatePassword_args_out(struct samr_ValidatePassword *r)
11237 if (*r->out.rep == NULL) {
11241 py_rep = py_import_samr_ValidatePasswordRep(*r->out.rep, r->in.level, *r->out.rep);
11242 if (py_rep == NULL) {
11247 if (NT_STATUS_IS_ERR(r->out.result)) {
11248 PyErr_SetNTSTATUS(r->out.result);
11255 const struct PyNdrRpcMethodDef py_ndr_samr_methods[] = {
11256 { "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 },
11257 { "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 },
11258 { "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 },
11259 { "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 },
11260 { "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 },
11261 { "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 },
11262 { "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 },
11263 { "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 },
11264 { "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 },
11265 { "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 },
11266 { "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 },
11267 { "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 },
11268 { "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 },
11269 { "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 },
11270 { "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 },
11271 { "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 },
11272 { "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 },
11273 { "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 },
11274 { "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 },
11275 { "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 },
11276 { "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 },
11277 { "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 },
11278 { "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 },
11279 { "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 },
11280 { "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 },
11281 { "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 },
11282 { "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 },
11283 { "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 },
11284 { "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 },
11285 { "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 },
11286 { "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 },
11287 { "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 },
11288 { "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 },
11289 { "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 },
11290 { "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 },
11291 { "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 },
11292 { "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 },
11293 { "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 },
11294 { "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 },
11295 { "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 },
11296 { "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 },
11297 { "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 },
11298 { "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 },
11299 { "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 },
11300 { "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 },
11301 { "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 },
11302 { "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 },
11303 { "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 },
11304 { "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 },
11305 { "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 },
11306 { "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 },
11307 { "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 },
11308 { "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 },
11309 { "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 },
11310 { "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 },
11311 { "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 },
11312 { "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 },
11313 { "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 },
11314 { "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 },
11315 { "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 },
11316 { "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 },
11317 { "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 },
11318 { "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 },
11319 { "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 },
11320 { "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 },
11321 { "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 },
11322 { "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 },
11323 { "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 },
11327 static PyObject *interface_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11329 return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_samr);
11332 static PyTypeObject samr_InterfaceType = {
11333 PyObject_HEAD_INIT(NULL) 0,
11334 .tp_name = "samr.samr",
11335 .tp_basicsize = sizeof(dcerpc_InterfaceObject),
11336 .tp_doc = "samr(binding, lp_ctx=None, credentials=None) -> connection\n"
11338 "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
11339 "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
11340 "credentials should be a credentials.Credentials object.\n\n",
11341 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
11342 .tp_new = interface_samr_new,
11345 static PyMethodDef samr_methods[] = {
11346 { NULL, NULL, 0, NULL }
11349 void initsamr(void)
11352 PyObject *dep_samba_dcerpc_security;
11353 PyObject *dep_talloc;
11354 PyObject *dep_samba_dcerpc_misc;
11355 PyObject *dep_samba_dcerpc_base;
11356 PyObject *dep_samba_dcerpc_lsa;
11358 dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
11359 if (dep_samba_dcerpc_security == NULL)
11362 dep_talloc = PyImport_ImportModule("talloc");
11363 if (dep_talloc == NULL)
11366 dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
11367 if (dep_samba_dcerpc_misc == NULL)
11370 dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
11371 if (dep_samba_dcerpc_base == NULL)
11374 dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
11375 if (dep_samba_dcerpc_lsa == NULL)
11378 dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
11379 if (dom_sid_Type == NULL)
11382 lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString");
11383 if (lsa_BinaryString_Type == NULL)
11386 lsa_AsciiString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiString");
11387 if (lsa_AsciiString_Type == NULL)
11390 lsa_Strings_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "Strings");
11391 if (lsa_Strings_Type == NULL)
11394 ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
11395 if (ClientConnection_Type == NULL)
11398 lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
11399 if (lsa_String_Type == NULL)
11402 lsa_AsciiStringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiStringLarge");
11403 if (lsa_AsciiStringLarge_Type == NULL)
11406 lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge");
11407 if (lsa_StringLarge_Type == NULL)
11410 sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
11411 if (sec_desc_buf_Type == NULL)
11414 lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
11415 if (lsa_SidArray_Type == NULL)
11418 policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
11419 if (policy_handle_Type == NULL)
11422 Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
11423 if (Object_Type == NULL)
11426 samr_SamEntry_Type.tp_base = Object_Type;
11428 samr_SamArray_Type.tp_base = Object_Type;
11430 samr_DomInfo1_Type.tp_base = Object_Type;
11432 samr_DomGeneralInformation_Type.tp_base = Object_Type;
11434 samr_DomInfo3_Type.tp_base = Object_Type;
11436 samr_DomOEMInformation_Type.tp_base = Object_Type;
11438 samr_DomInfo5_Type.tp_base = Object_Type;
11440 samr_DomInfo6_Type.tp_base = Object_Type;
11442 samr_DomInfo7_Type.tp_base = Object_Type;
11444 samr_DomInfo8_Type.tp_base = Object_Type;
11446 samr_DomInfo9_Type.tp_base = Object_Type;
11448 samr_DomGeneralInformation2_Type.tp_base = Object_Type;
11450 samr_DomInfo12_Type.tp_base = Object_Type;
11452 samr_DomInfo13_Type.tp_base = Object_Type;
11454 samr_Ids_Type.tp_base = Object_Type;
11456 samr_GroupInfoAll_Type.tp_base = Object_Type;
11458 samr_GroupInfoAttributes_Type.tp_base = Object_Type;
11460 samr_GroupInfoDescription_Type.tp_base = Object_Type;
11462 samr_RidAttrArray_Type.tp_base = Object_Type;
11464 samr_AliasInfoAll_Type.tp_base = Object_Type;
11466 samr_UserInfo1_Type.tp_base = Object_Type;
11468 samr_UserInfo2_Type.tp_base = Object_Type;
11470 samr_LogonHours_Type.tp_base = Object_Type;
11472 samr_UserInfo3_Type.tp_base = Object_Type;
11474 samr_UserInfo4_Type.tp_base = Object_Type;
11476 samr_UserInfo5_Type.tp_base = Object_Type;
11478 samr_UserInfo6_Type.tp_base = Object_Type;
11480 samr_UserInfo7_Type.tp_base = Object_Type;
11482 samr_UserInfo8_Type.tp_base = Object_Type;
11484 samr_UserInfo9_Type.tp_base = Object_Type;
11486 samr_UserInfo10_Type.tp_base = Object_Type;
11488 samr_UserInfo11_Type.tp_base = Object_Type;
11490 samr_UserInfo12_Type.tp_base = Object_Type;
11492 samr_UserInfo13_Type.tp_base = Object_Type;
11494 samr_UserInfo14_Type.tp_base = Object_Type;
11496 samr_UserInfo16_Type.tp_base = Object_Type;
11498 samr_UserInfo17_Type.tp_base = Object_Type;
11500 samr_Password_Type.tp_base = Object_Type;
11502 samr_UserInfo18_Type.tp_base = Object_Type;
11504 samr_UserInfo20_Type.tp_base = Object_Type;
11506 samr_UserInfo21_Type.tp_base = Object_Type;
11508 samr_CryptPassword_Type.tp_base = Object_Type;
11510 samr_UserInfo23_Type.tp_base = Object_Type;
11512 samr_UserInfo24_Type.tp_base = Object_Type;
11514 samr_CryptPasswordEx_Type.tp_base = Object_Type;
11516 samr_UserInfo25_Type.tp_base = Object_Type;
11518 samr_UserInfo26_Type.tp_base = Object_Type;
11520 samr_RidWithAttribute_Type.tp_base = Object_Type;
11522 samr_RidWithAttributeArray_Type.tp_base = Object_Type;
11524 samr_DispEntryGeneral_Type.tp_base = Object_Type;
11526 samr_DispInfoGeneral_Type.tp_base = Object_Type;
11528 samr_DispEntryFull_Type.tp_base = Object_Type;
11530 samr_DispInfoFull_Type.tp_base = Object_Type;
11532 samr_DispEntryFullGroup_Type.tp_base = Object_Type;
11534 samr_DispInfoFullGroups_Type.tp_base = Object_Type;
11536 samr_DispEntryAscii_Type.tp_base = Object_Type;
11538 samr_DispInfoAscii_Type.tp_base = Object_Type;
11540 samr_PwInfo_Type.tp_base = Object_Type;
11542 userPwdChangeFailureInformation_Type.tp_base = Object_Type;
11544 samr_ConnectInfo1_Type.tp_base = Object_Type;
11546 samr_ValidationBlob_Type.tp_base = Object_Type;
11548 samr_ValidatePasswordInfo_Type.tp_base = Object_Type;
11550 samr_ValidatePasswordRepCtr_Type.tp_base = Object_Type;
11552 samr_ValidatePasswordReq3_Type.tp_base = Object_Type;
11554 samr_ValidatePasswordReq2_Type.tp_base = Object_Type;
11556 samr_ValidatePasswordReq1_Type.tp_base = Object_Type;
11558 samr_InterfaceType.tp_base = ClientConnection_Type;
11560 if (PyType_Ready(&samr_SamEntry_Type) < 0)
11562 if (PyType_Ready(&samr_SamArray_Type) < 0)
11564 if (PyType_Ready(&samr_DomInfo1_Type) < 0)
11566 if (PyType_Ready(&samr_DomGeneralInformation_Type) < 0)
11568 if (PyType_Ready(&samr_DomInfo3_Type) < 0)
11570 if (PyType_Ready(&samr_DomOEMInformation_Type) < 0)
11572 if (PyType_Ready(&samr_DomInfo5_Type) < 0)
11574 if (PyType_Ready(&samr_DomInfo6_Type) < 0)
11576 if (PyType_Ready(&samr_DomInfo7_Type) < 0)
11578 if (PyType_Ready(&samr_DomInfo8_Type) < 0)
11580 if (PyType_Ready(&samr_DomInfo9_Type) < 0)
11582 if (PyType_Ready(&samr_DomGeneralInformation2_Type) < 0)
11584 if (PyType_Ready(&samr_DomInfo12_Type) < 0)
11586 if (PyType_Ready(&samr_DomInfo13_Type) < 0)
11588 if (PyType_Ready(&samr_Ids_Type) < 0)
11590 if (PyType_Ready(&samr_GroupInfoAll_Type) < 0)
11592 if (PyType_Ready(&samr_GroupInfoAttributes_Type) < 0)
11594 if (PyType_Ready(&samr_GroupInfoDescription_Type) < 0)
11596 if (PyType_Ready(&samr_RidAttrArray_Type) < 0)
11598 if (PyType_Ready(&samr_AliasInfoAll_Type) < 0)
11600 if (PyType_Ready(&samr_UserInfo1_Type) < 0)
11602 if (PyType_Ready(&samr_UserInfo2_Type) < 0)
11604 if (PyType_Ready(&samr_LogonHours_Type) < 0)
11606 if (PyType_Ready(&samr_UserInfo3_Type) < 0)
11608 if (PyType_Ready(&samr_UserInfo4_Type) < 0)
11610 if (PyType_Ready(&samr_UserInfo5_Type) < 0)
11612 if (PyType_Ready(&samr_UserInfo6_Type) < 0)
11614 if (PyType_Ready(&samr_UserInfo7_Type) < 0)
11616 if (PyType_Ready(&samr_UserInfo8_Type) < 0)
11618 if (PyType_Ready(&samr_UserInfo9_Type) < 0)
11620 if (PyType_Ready(&samr_UserInfo10_Type) < 0)
11622 if (PyType_Ready(&samr_UserInfo11_Type) < 0)
11624 if (PyType_Ready(&samr_UserInfo12_Type) < 0)
11626 if (PyType_Ready(&samr_UserInfo13_Type) < 0)
11628 if (PyType_Ready(&samr_UserInfo14_Type) < 0)
11630 if (PyType_Ready(&samr_UserInfo16_Type) < 0)
11632 if (PyType_Ready(&samr_UserInfo17_Type) < 0)
11634 if (PyType_Ready(&samr_Password_Type) < 0)
11636 if (PyType_Ready(&samr_UserInfo18_Type) < 0)
11638 if (PyType_Ready(&samr_UserInfo20_Type) < 0)
11640 if (PyType_Ready(&samr_UserInfo21_Type) < 0)
11642 if (PyType_Ready(&samr_CryptPassword_Type) < 0)
11644 if (PyType_Ready(&samr_UserInfo23_Type) < 0)
11646 if (PyType_Ready(&samr_UserInfo24_Type) < 0)
11648 if (PyType_Ready(&samr_CryptPasswordEx_Type) < 0)
11650 if (PyType_Ready(&samr_UserInfo25_Type) < 0)
11652 if (PyType_Ready(&samr_UserInfo26_Type) < 0)
11654 if (PyType_Ready(&samr_RidWithAttribute_Type) < 0)
11656 if (PyType_Ready(&samr_RidWithAttributeArray_Type) < 0)
11658 if (PyType_Ready(&samr_DispEntryGeneral_Type) < 0)
11660 if (PyType_Ready(&samr_DispInfoGeneral_Type) < 0)
11662 if (PyType_Ready(&samr_DispEntryFull_Type) < 0)
11664 if (PyType_Ready(&samr_DispInfoFull_Type) < 0)
11666 if (PyType_Ready(&samr_DispEntryFullGroup_Type) < 0)
11668 if (PyType_Ready(&samr_DispInfoFullGroups_Type) < 0)
11670 if (PyType_Ready(&samr_DispEntryAscii_Type) < 0)
11672 if (PyType_Ready(&samr_DispInfoAscii_Type) < 0)
11674 if (PyType_Ready(&samr_PwInfo_Type) < 0)
11676 if (PyType_Ready(&userPwdChangeFailureInformation_Type) < 0)
11678 if (PyType_Ready(&samr_ConnectInfo1_Type) < 0)
11680 if (PyType_Ready(&samr_ValidationBlob_Type) < 0)
11682 if (PyType_Ready(&samr_ValidatePasswordInfo_Type) < 0)
11684 if (PyType_Ready(&samr_ValidatePasswordRepCtr_Type) < 0)
11686 if (PyType_Ready(&samr_ValidatePasswordReq3_Type) < 0)
11688 if (PyType_Ready(&samr_ValidatePasswordReq2_Type) < 0)
11690 if (PyType_Ready(&samr_ValidatePasswordReq1_Type) < 0)
11692 if (PyType_Ready(&samr_InterfaceType) < 0)
11694 if (!PyInterface_AddNdrRpcMethods(&samr_InterfaceType, py_ndr_samr_methods))
11697 #ifdef PY_SAMENTRY_PATCH
11698 PY_SAMENTRY_PATCH(&samr_SamEntry_Type);
11700 #ifdef PY_SAMARRAY_PATCH
11701 PY_SAMARRAY_PATCH(&samr_SamArray_Type);
11703 #ifdef PY_DOMINFO1_PATCH
11704 PY_DOMINFO1_PATCH(&samr_DomInfo1_Type);
11706 #ifdef PY_DOMGENERALINFORMATION_PATCH
11707 PY_DOMGENERALINFORMATION_PATCH(&samr_DomGeneralInformation_Type);
11709 #ifdef PY_DOMINFO3_PATCH
11710 PY_DOMINFO3_PATCH(&samr_DomInfo3_Type);
11712 #ifdef PY_DOMOEMINFORMATION_PATCH
11713 PY_DOMOEMINFORMATION_PATCH(&samr_DomOEMInformation_Type);
11715 #ifdef PY_DOMINFO5_PATCH
11716 PY_DOMINFO5_PATCH(&samr_DomInfo5_Type);
11718 #ifdef PY_DOMINFO6_PATCH
11719 PY_DOMINFO6_PATCH(&samr_DomInfo6_Type);
11721 #ifdef PY_DOMINFO7_PATCH
11722 PY_DOMINFO7_PATCH(&samr_DomInfo7_Type);
11724 #ifdef PY_DOMINFO8_PATCH
11725 PY_DOMINFO8_PATCH(&samr_DomInfo8_Type);
11727 #ifdef PY_DOMINFO9_PATCH
11728 PY_DOMINFO9_PATCH(&samr_DomInfo9_Type);
11730 #ifdef PY_DOMGENERALINFORMATION2_PATCH
11731 PY_DOMGENERALINFORMATION2_PATCH(&samr_DomGeneralInformation2_Type);
11733 #ifdef PY_DOMINFO12_PATCH
11734 PY_DOMINFO12_PATCH(&samr_DomInfo12_Type);
11736 #ifdef PY_DOMINFO13_PATCH
11737 PY_DOMINFO13_PATCH(&samr_DomInfo13_Type);
11739 #ifdef PY_IDS_PATCH
11740 PY_IDS_PATCH(&samr_Ids_Type);
11742 #ifdef PY_GROUPINFOALL_PATCH
11743 PY_GROUPINFOALL_PATCH(&samr_GroupInfoAll_Type);
11745 #ifdef PY_GROUPINFOATTRIBUTES_PATCH
11746 PY_GROUPINFOATTRIBUTES_PATCH(&samr_GroupInfoAttributes_Type);
11748 #ifdef PY_GROUPINFODESCRIPTION_PATCH
11749 PY_GROUPINFODESCRIPTION_PATCH(&samr_GroupInfoDescription_Type);
11751 #ifdef PY_RIDATTRARRAY_PATCH
11752 PY_RIDATTRARRAY_PATCH(&samr_RidAttrArray_Type);
11754 #ifdef PY_ALIASINFOALL_PATCH
11755 PY_ALIASINFOALL_PATCH(&samr_AliasInfoAll_Type);
11757 #ifdef PY_USERINFO1_PATCH
11758 PY_USERINFO1_PATCH(&samr_UserInfo1_Type);
11760 #ifdef PY_USERINFO2_PATCH
11761 PY_USERINFO2_PATCH(&samr_UserInfo2_Type);
11763 #ifdef PY_LOGONHOURS_PATCH
11764 PY_LOGONHOURS_PATCH(&samr_LogonHours_Type);
11766 #ifdef PY_USERINFO3_PATCH
11767 PY_USERINFO3_PATCH(&samr_UserInfo3_Type);
11769 #ifdef PY_USERINFO4_PATCH
11770 PY_USERINFO4_PATCH(&samr_UserInfo4_Type);
11772 #ifdef PY_USERINFO5_PATCH
11773 PY_USERINFO5_PATCH(&samr_UserInfo5_Type);
11775 #ifdef PY_USERINFO6_PATCH
11776 PY_USERINFO6_PATCH(&samr_UserInfo6_Type);
11778 #ifdef PY_USERINFO7_PATCH
11779 PY_USERINFO7_PATCH(&samr_UserInfo7_Type);
11781 #ifdef PY_USERINFO8_PATCH
11782 PY_USERINFO8_PATCH(&samr_UserInfo8_Type);
11784 #ifdef PY_USERINFO9_PATCH
11785 PY_USERINFO9_PATCH(&samr_UserInfo9_Type);
11787 #ifdef PY_USERINFO10_PATCH
11788 PY_USERINFO10_PATCH(&samr_UserInfo10_Type);
11790 #ifdef PY_USERINFO11_PATCH
11791 PY_USERINFO11_PATCH(&samr_UserInfo11_Type);
11793 #ifdef PY_USERINFO12_PATCH
11794 PY_USERINFO12_PATCH(&samr_UserInfo12_Type);
11796 #ifdef PY_USERINFO13_PATCH
11797 PY_USERINFO13_PATCH(&samr_UserInfo13_Type);
11799 #ifdef PY_USERINFO14_PATCH
11800 PY_USERINFO14_PATCH(&samr_UserInfo14_Type);
11802 #ifdef PY_USERINFO16_PATCH
11803 PY_USERINFO16_PATCH(&samr_UserInfo16_Type);
11805 #ifdef PY_USERINFO17_PATCH
11806 PY_USERINFO17_PATCH(&samr_UserInfo17_Type);
11808 #ifdef PY_PASSWORD_PATCH
11809 PY_PASSWORD_PATCH(&samr_Password_Type);
11811 #ifdef PY_USERINFO18_PATCH
11812 PY_USERINFO18_PATCH(&samr_UserInfo18_Type);
11814 #ifdef PY_USERINFO20_PATCH
11815 PY_USERINFO20_PATCH(&samr_UserInfo20_Type);
11817 #ifdef PY_USERINFO21_PATCH
11818 PY_USERINFO21_PATCH(&samr_UserInfo21_Type);
11820 #ifdef PY_CRYPTPASSWORD_PATCH
11821 PY_CRYPTPASSWORD_PATCH(&samr_CryptPassword_Type);
11823 #ifdef PY_USERINFO23_PATCH
11824 PY_USERINFO23_PATCH(&samr_UserInfo23_Type);
11826 #ifdef PY_USERINFO24_PATCH
11827 PY_USERINFO24_PATCH(&samr_UserInfo24_Type);
11829 #ifdef PY_CRYPTPASSWORDEX_PATCH
11830 PY_CRYPTPASSWORDEX_PATCH(&samr_CryptPasswordEx_Type);
11832 #ifdef PY_USERINFO25_PATCH
11833 PY_USERINFO25_PATCH(&samr_UserInfo25_Type);
11835 #ifdef PY_USERINFO26_PATCH
11836 PY_USERINFO26_PATCH(&samr_UserInfo26_Type);
11838 #ifdef PY_RIDWITHATTRIBUTE_PATCH
11839 PY_RIDWITHATTRIBUTE_PATCH(&samr_RidWithAttribute_Type);
11841 #ifdef PY_RIDWITHATTRIBUTEARRAY_PATCH
11842 PY_RIDWITHATTRIBUTEARRAY_PATCH(&samr_RidWithAttributeArray_Type);
11844 #ifdef PY_DISPENTRYGENERAL_PATCH
11845 PY_DISPENTRYGENERAL_PATCH(&samr_DispEntryGeneral_Type);
11847 #ifdef PY_DISPINFOGENERAL_PATCH
11848 PY_DISPINFOGENERAL_PATCH(&samr_DispInfoGeneral_Type);
11850 #ifdef PY_DISPENTRYFULL_PATCH
11851 PY_DISPENTRYFULL_PATCH(&samr_DispEntryFull_Type);
11853 #ifdef PY_DISPINFOFULL_PATCH
11854 PY_DISPINFOFULL_PATCH(&samr_DispInfoFull_Type);
11856 #ifdef PY_DISPENTRYFULLGROUP_PATCH
11857 PY_DISPENTRYFULLGROUP_PATCH(&samr_DispEntryFullGroup_Type);
11859 #ifdef PY_DISPINFOFULLGROUPS_PATCH
11860 PY_DISPINFOFULLGROUPS_PATCH(&samr_DispInfoFullGroups_Type);
11862 #ifdef PY_DISPENTRYASCII_PATCH
11863 PY_DISPENTRYASCII_PATCH(&samr_DispEntryAscii_Type);
11865 #ifdef PY_DISPINFOASCII_PATCH
11866 PY_DISPINFOASCII_PATCH(&samr_DispInfoAscii_Type);
11868 #ifdef PY_PWINFO_PATCH
11869 PY_PWINFO_PATCH(&samr_PwInfo_Type);
11871 #ifdef PY_USERPWDCHANGEFAILUREINFORMATION_PATCH
11872 PY_USERPWDCHANGEFAILUREINFORMATION_PATCH(&userPwdChangeFailureInformation_Type);
11874 #ifdef PY_CONNECTINFO1_PATCH
11875 PY_CONNECTINFO1_PATCH(&samr_ConnectInfo1_Type);
11877 #ifdef PY_VALIDATIONBLOB_PATCH
11878 PY_VALIDATIONBLOB_PATCH(&samr_ValidationBlob_Type);
11880 #ifdef PY_VALIDATEPASSWORDINFO_PATCH
11881 PY_VALIDATEPASSWORDINFO_PATCH(&samr_ValidatePasswordInfo_Type);
11883 #ifdef PY_VALIDATEPASSWORDREPCTR_PATCH
11884 PY_VALIDATEPASSWORDREPCTR_PATCH(&samr_ValidatePasswordRepCtr_Type);
11886 #ifdef PY_VALIDATEPASSWORDREQ3_PATCH
11887 PY_VALIDATEPASSWORDREQ3_PATCH(&samr_ValidatePasswordReq3_Type);
11889 #ifdef PY_VALIDATEPASSWORDREQ2_PATCH
11890 PY_VALIDATEPASSWORDREQ2_PATCH(&samr_ValidatePasswordReq2_Type);
11892 #ifdef PY_VALIDATEPASSWORDREQ1_PATCH
11893 PY_VALIDATEPASSWORDREQ1_PATCH(&samr_ValidatePasswordReq1_Type);
11895 #ifdef PY_SAMR_PATCH
11896 PY_SAMR_PATCH(&samr_InterfaceType);
11899 m = Py_InitModule3("samr", samr_methods, "samr DCE/RPC");
11903 PyModule_AddObject(m, "PASS_DONT_CHANGE_AT_NEXT_LOGON", PyInt_FromLong(0x00));
11904 PyModule_AddObject(m, "SAMR_FIELD_NT_PASSWORD_PRESENT", PyInt_FromLong(SAMR_FIELD_NT_PASSWORD_PRESENT));
11905 PyModule_AddObject(m, "DomainModifiedInformation2", PyInt_FromLong(DomainModifiedInformation2));
11906 PyModule_AddObject(m, "ACB_SMARTCARD_REQUIRED", PyInt_FromLong(ACB_SMARTCARD_REQUIRED));
11907 PyModule_AddObject(m, "UserLogonHoursInformation", PyInt_FromLong(UserLogonHoursInformation));
11908 PyModule_AddObject(m, "DomainGeneralInformation", PyInt_FromLong(DomainGeneralInformation));
11909 PyModule_AddObject(m, "SAMR_ACCESS_CREATE_DOMAIN", PyInt_FromLong(SAMR_ACCESS_CREATE_DOMAIN));
11910 PyModule_AddObject(m, "SAMR_FIELD_FORCE_PWD_CHANGE", PyInt_FromLong(SAMR_FIELD_FORCE_PWD_CHANGE));
11911 PyModule_AddObject(m, "DomainLockoutInformation", PyInt_FromLong(DomainLockoutInformation));
11912 PyModule_AddObject(m, "DOMAIN_PASSWORD_LOCKOUT_ADMINS", PyInt_FromLong(DOMAIN_PASSWORD_LOCKOUT_ADMINS));
11913 PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ACCESS_ENUM_DOMAINS)));
11914 PyModule_AddObject(m, "SAMR_ACCESS_LOOKUP_DOMAIN", PyInt_FromLong(SAMR_ACCESS_LOOKUP_DOMAIN));
11915 PyModule_AddObject(m, "SAMR_FIELD_PRIVATE_DATA", PyInt_FromLong(SAMR_FIELD_PRIVATE_DATA));
11916 PyModule_AddObject(m, "ACB_PARTIAL_SECRETS_ACCOUNT", PyInt_FromLong(ACB_PARTIAL_SECRETS_ACCOUNT));
11917 PyModule_AddObject(m, "UserControlInformation", PyInt_FromLong(UserControlInformation));
11918 PyModule_AddObject(m, "DomainLogoffInformation", PyInt_FromLong(DomainLogoffInformation));
11919 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_GET_MEMBERS", PyInt_FromLong(SAMR_GROUP_ACCESS_GET_MEMBERS));
11920 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_SUCCESS", PyInt_FromLong(SAMR_VALIDATION_STATUS_SUCCESS));
11921 PyModule_AddObject(m, "SAMR_FIELD_CODE_PAGE", PyInt_FromLong(SAMR_FIELD_CODE_PAGE));
11922 PyModule_AddObject(m, "ACB_HOMDIRREQ", PyInt_FromLong(ACB_HOMDIRREQ));
11923 PyModule_AddObject(m, "GROUPINFOALL2", PyInt_FromLong(GROUPINFOALL2));
11924 PyModule_AddObject(m, "UserScriptInformation", PyInt_FromLong(UserScriptInformation));
11925 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY", PyInt_FromLong(SAMR_VALIDATE_FIELD_PASSWORD_HISTORY));
11926 PyModule_AddObject(m, "UserPrimaryGroupInformation", PyInt_FromLong(UserPrimaryGroupInformation));
11927 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_NAME_ETC", PyInt_FromLong(SAMR_USER_ACCESS_GET_NAME_ETC));
11928 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH", PyInt_FromLong(SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH));
11929 PyModule_AddObject(m, "UserInternal1Information", PyInt_FromLong(UserInternal1Information));
11930 PyModule_AddObject(m, "DOMAIN_SERVER_DISABLED", PyInt_FromLong(DOMAIN_SERVER_DISABLED));
11931 PyModule_AddObject(m, "SE_GROUP_USE_FOR_DENY_ONLY", PyInt_FromLong(SE_GROUP_USE_FOR_DENY_ONLY));
11932 PyModule_AddObject(m, "UserAccountNameInformation", PyInt_FromLong(UserAccountNameInformation));
11933 PyModule_AddObject(m, "UserAccountInformation", PyInt_FromLong(UserAccountInformation));
11934 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_USER", PyInt_FromLong(SAMR_DOMAIN_ACCESS_CREATE_USER));
11935 PyModule_AddObject(m, "NetValidateAuthentication", PyInt_FromLong(NetValidateAuthentication));
11936 PyModule_AddObject(m, "SAMR_FIELD_ACCOUNT_NAME", PyInt_FromLong(SAMR_FIELD_ACCOUNT_NAME));
11937 PyModule_AddObject(m, "DomainPasswordInformation", PyInt_FromLong(DomainPasswordInformation));
11938 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ADD_MEMBER", PyInt_FromLong(SAMR_GROUP_ACCESS_ADD_MEMBER));
11939 PyModule_AddObject(m, "NetValidatePasswordReset", PyInt_FromLong(NetValidatePasswordReset));
11940 PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGON", PyInt_FromLong(SAMR_FIELD_LAST_LOGON));
11941 PyModule_AddObject(m, "SE_GROUP_MANDATORY", PyInt_FromLong(SE_GROUP_MANDATORY));
11942 PyModule_AddObject(m, "SAM_PWD_CHANGE_NOT_COMPLEX", PyInt_FromLong(SAM_PWD_CHANGE_NOT_COMPLEX));
11943 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", PyInt_FromLong(SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP));
11944 PyModule_AddObject(m, "SAMR_FIELD_EXPIRED_FLAG", PyInt_FromLong(SAMR_FIELD_EXPIRED_FLAG));
11945 PyModule_AddObject(m, "SAMR_FIELD_LAST_PWD_CHANGE", PyInt_FromLong(SAMR_FIELD_LAST_PWD_CHANGE));
11946 PyModule_AddObject(m, "GENERIC_RIGHTS_USER_READ", PyInt_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)));
11947 PyModule_AddObject(m, "SAMR_FIELD_LM_PASSWORD_PRESENT", PyInt_FromLong(SAMR_FIELD_LM_PASSWORD_PRESENT));
11948 PyModule_AddObject(m, "SAMR_FIELD_PARAMETERS", PyInt_FromLong(SAMR_FIELD_PARAMETERS));
11949 PyModule_AddObject(m, "UserPreferencesInformation", PyInt_FromLong(UserPreferencesInformation));
11950 PyModule_AddObject(m, "SAMR_FIELD_LOGON_SCRIPT", PyInt_FromLong(SAMR_FIELD_LOGON_SCRIPT));
11951 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", PyInt_FromLong(SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT));
11952 PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_LONG", PyInt_FromLong(SAM_PWD_CHANGE_PASSWORD_TOO_LONG));
11953 PyModule_AddObject(m, "ACB_DONT_REQUIRE_PREAUTH", PyInt_FromLong(ACB_DONT_REQUIRE_PREAUTH));
11954 PyModule_AddObject(m, "SAM_PWD_CHANGE_PWD_IN_HISTORY", PyInt_FromLong(SAM_PWD_CHANGE_PWD_IN_HISTORY));
11955 PyModule_AddObject(m, "UserInternal4InformationNew", PyInt_FromLong(UserInternal4InformationNew));
11956 PyModule_AddObject(m, "UserInternal5Information", PyInt_FromLong(UserInternal5Information));
11957 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_LOCKOUT_TIME", PyInt_FromLong(SAMR_VALIDATE_FIELD_LOCKOUT_TIME));
11958 PyModule_AddObject(m, "SE_GROUP_LOGON_ID", PyInt_FromLong(SE_GROUP_LOGON_ID));
11959 PyModule_AddObject(m, "UserFullNameInformation", PyInt_FromLong(UserFullNameInformation));
11960 PyModule_AddObject(m, "DOMAIN_PASSWORD_COMPLEX", PyInt_FromLong(DOMAIN_PASSWORD_COMPLEX));
11961 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_GET_MEMBERS", PyInt_FromLong(SAMR_ALIAS_ACCESS_GET_MEMBERS));
11962 PyModule_AddObject(m, "SE_GROUP_OWNER", PyInt_FromLong(SE_GROUP_OWNER));
11963 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_2", PyInt_FromLong(SAMR_DOMAIN_ACCESS_SET_INFO_2));
11964 PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_GROUP_ACCESS_ALL_ACCESS)));
11965 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_BAD_PASSWORD", PyInt_FromLong(SAMR_VALIDATION_STATUS_BAD_PASSWORD));
11966 PyModule_AddObject(m, "GROUPINFOATTRIBUTES", PyInt_FromLong(GROUPINFOATTRIBUTES));
11967 PyModule_AddObject(m, "DomainStateInformation", PyInt_FromLong(DomainStateInformation));
11968 PyModule_AddObject(m, "ACB_SVRTRUST", PyInt_FromLong(ACB_SVRTRUST));
11969 PyModule_AddObject(m, "SAM_PWD_CHANGE_NO_ERROR", PyInt_FromLong(SAM_PWD_CHANGE_NO_ERROR));
11970 PyModule_AddObject(m, "SAMR_ACCESS_INITIALIZE_SERVER", PyInt_FromLong(SAMR_ACCESS_INITIALIZE_SERVER));
11971 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR", PyInt_FromLong(SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR));
11972 PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ALIAS_ACCESS_ALL_ACCESS)));
11973 PyModule_AddObject(m, "DomainReplicationInformation", PyInt_FromLong(DomainReplicationInformation));
11974 PyModule_AddObject(m, "ACB_USE_AES_KEYS", PyInt_FromLong(ACB_USE_AES_KEYS));
11975 PyModule_AddObject(m, "DOMAIN_REFUSE_PASSWORD_CHANGE", PyInt_FromLong(DOMAIN_REFUSE_PASSWORD_CHANGE));
11976 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_REMOVE_MEMBER", PyInt_FromLong(SAMR_GROUP_ACCESS_REMOVE_MEMBER));
11977 PyModule_AddObject(m, "GROUPINFODESCRIPTION", PyInt_FromLong(GROUPINFODESCRIPTION));
11978 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_GROUPS", PyInt_FromLong(SAMR_USER_ACCESS_GET_GROUPS));
11979 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", PyInt_FromLong(SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS));
11980 PyModule_AddObject(m, "ACB_ENC_TXT_PWD_ALLOWED", PyInt_FromLong(ACB_ENC_TXT_PWD_ALLOWED));
11981 PyModule_AddObject(m, "SAMR_FIELD_ACCT_FLAGS", PyInt_FromLong(SAMR_FIELD_ACCT_FLAGS));
11982 PyModule_AddObject(m, "DomainNameInformation", PyInt_FromLong(DomainNameInformation));
11983 PyModule_AddObject(m, "SAMR_FIELD_SEC_DESC", PyInt_FromLong(SAMR_FIELD_SEC_DESC));
11984 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOCALE", PyInt_FromLong(SAMR_USER_ACCESS_GET_LOCALE));
11985 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET", PyInt_FromLong(SAMR_VALIDATE_FIELD_PASSWORD_LAST_SET));
11986 PyModule_AddObject(m, "DomainOemInformation", PyInt_FromLong(DomainOemInformation));
11987 PyModule_AddObject(m, "DOMAIN_SERVER_ENABLED", PyInt_FromLong(DOMAIN_SERVER_ENABLED));
11988 PyModule_AddObject(m, "SAMR_FIELD_NUM_LOGONS", PyInt_FromLong(SAMR_FIELD_NUM_LOGONS));
11989 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_GROUP", PyInt_FromLong(SAMR_DOMAIN_ACCESS_CREATE_GROUP));
11990 PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_ANON_CHANGE", PyInt_FromLong(DOMAIN_PASSWORD_NO_ANON_CHANGE));
11991 PyModule_AddObject(m, "SE_GROUP_RESOURCE", PyInt_FromLong(SE_GROUP_RESOURCE));
11992 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_LOGONINFO", PyInt_FromLong(SAMR_USER_ACCESS_GET_LOGONINFO));
11993 PyModule_AddObject(m, "ALIASINFONAME", PyInt_FromLong(ALIASINFONAME));
11994 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ADD_MEMBER", PyInt_FromLong(SAMR_ALIAS_ACCESS_ADD_MEMBER));
11995 PyModule_AddObject(m, "DOMAIN_PASSWORD_STORE_CLEARTEXT", PyInt_FromLong(DOMAIN_PASSWORD_STORE_CLEARTEXT));
11996 PyModule_AddObject(m, "DomainModifiedInformation", PyInt_FromLong(DomainModifiedInformation));
11997 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", PyInt_FromLong(SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1));
11998 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT", PyInt_FromLong(SAMR_VALIDATE_FIELD_BAD_PASSWORD_COUNT));
11999 PyModule_AddObject(m, "PASS_MUST_CHANGE_AT_NEXT_LOGON", PyInt_FromLong(0x01));
12000 PyModule_AddObject(m, "ACB_AUTOLOCK", PyInt_FromLong(ACB_AUTOLOCK));
12001 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", PyInt_FromLong(SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2));
12002 PyModule_AddObject(m, "SAMR_FIELD_ACCT_EXPIRY", PyInt_FromLong(SAMR_FIELD_ACCT_EXPIRY));
12003 PyModule_AddObject(m, "UserExpiresInformation", PyInt_FromLong(UserExpiresInformation));
12004 PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_BDC", PyInt_FromLong(SAMR_ROLE_DOMAIN_BDC));
12005 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT", PyInt_FromLong(SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT));
12006 PyModule_AddObject(m, "SAMR_FIELD_HOME_DRIVE", PyInt_FromLong(SAMR_FIELD_HOME_DRIVE));
12007 PyModule_AddObject(m, "UserAllInformation", PyInt_FromLong(UserAllInformation));
12008 PyModule_AddObject(m, "UserParametersInformation", PyInt_FromLong(UserParametersInformation));
12009 PyModule_AddObject(m, "SAMR_ACCESS_CONNECT_TO_SERVER", PyInt_FromLong(SAMR_ACCESS_CONNECT_TO_SERVER));
12010 PyModule_AddObject(m, "UserNameInformation", PyInt_FromLong(UserNameInformation));
12011 PyModule_AddObject(m, "ALIASINFODESCRIPTION", PyInt_FromLong(ALIASINFODESCRIPTION));
12012 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_LOOKUP_INFO", PyInt_FromLong(SAMR_ALIAS_ACCESS_LOOKUP_INFO));
12013 PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_WRITE", PyInt_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ACCESS_CREATE_DOMAIN|SAMR_ACCESS_INITIALIZE_SERVER|SAMR_ACCESS_SHUTDOWN_SERVER)));
12014 PyModule_AddObject(m, "SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT", PyInt_FromLong(SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT));
12015 PyModule_AddObject(m, "GROUPINFOALL", PyInt_FromLong(GROUPINFOALL));
12016 PyModule_AddObject(m, "GENERIC_RIGHTS_USER_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_USER_ACCESS_CHANGE_PASSWORD|SAMR_USER_ACCESS_GET_NAME_ETC)));
12017 PyModule_AddObject(m, "ACB_NOT_DELEGATED", PyInt_FromLong(ACB_NOT_DELEGATED));
12018 PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_GROUP_ACCESS_GET_MEMBERS)));
12019 PyModule_AddObject(m, "SAMR_CONNECT_W2K", PyInt_FromLong(SAMR_CONNECT_W2K));
12020 PyModule_AddObject(m, "SAMR_FIELD_FULL_NAME", PyInt_FromLong(SAMR_FIELD_FULL_NAME));
12021 PyModule_AddObject(m, "SAMR_ACCESS_ALL_ACCESS", PyInt_FromLong(0x0000003F));
12022 PyModule_AddObject(m, "SAMR_ROLE_STANDALONE", PyInt_FromLong(SAMR_ROLE_STANDALONE));
12023 PyModule_AddObject(m, "SAMR_ACCESS_ENUM_DOMAINS", PyInt_FromLong(SAMR_ACCESS_ENUM_DOMAINS));
12024 PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_ALIAS_ACCESS_GET_MEMBERS)));
12025 PyModule_AddObject(m, "ACB_TEMPDUP", PyInt_FromLong(ACB_TEMPDUP));
12026 PyModule_AddObject(m, "UserHomeInformation", PyInt_FromLong(UserHomeInformation));
12027 PyModule_AddObject(m, "DomainUasInformation", PyInt_FromLong(DomainUasInformation));
12028 PyModule_AddObject(m, "SAMR_USER_ACCESS_GET_ATTRIBUTES", PyInt_FromLong(SAMR_USER_ACCESS_GET_ATTRIBUTES));
12029 PyModule_AddObject(m, "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", PyInt_FromLong(DOMAIN_PASSWORD_NO_CLEAR_CHANGE));
12030 PyModule_AddObject(m, "SAMR_ENUM_USERS_MULTIPLIER", PyInt_FromLong(54));
12031 PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_ATTRIBUTES", PyInt_FromLong(SAMR_USER_ACCESS_SET_ATTRIBUTES));
12032 PyModule_AddObject(m, "ALIASINFOALL", PyInt_FromLong(ALIASINFOALL));
12033 PyModule_AddObject(m, "SAMR_CONNECT_PRE_W2K", PyInt_FromLong(SAMR_CONNECT_PRE_W2K));
12034 PyModule_AddObject(m, "SAMR_FIELD_HOME_DIRECTORY", PyInt_FromLong(SAMR_FIELD_HOME_DIRECTORY));
12035 PyModule_AddObject(m, "UserGeneralInformation", PyInt_FromLong(UserGeneralInformation));
12036 PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ALIAS_ACCESS_LOOKUP_INFO)));
12037 PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_ACCESS_LOOKUP_DOMAIN|SAMR_ACCESS_CONNECT_TO_SERVER)));
12038 PyModule_AddObject(m, "DomainServerRoleInformation", PyInt_FromLong(DomainServerRoleInformation));
12039 PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_PDC", PyInt_FromLong(SAMR_ROLE_DOMAIN_PDC));
12040 PyModule_AddObject(m, "UserProfileInformation", PyInt_FromLong(UserProfileInformation));
12041 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT", PyInt_FromLong(SAMR_VALIDATION_STATUS_PWD_TOO_SHORT));
12042 PyModule_AddObject(m, "ACB_PWNOTREQ", PyInt_FromLong(ACB_PWNOTREQ));
12043 PyModule_AddObject(m, "ACB_TRUSTED_FOR_DELEGATION", PyInt_FromLong(ACB_TRUSTED_FOR_DELEGATION));
12044 PyModule_AddObject(m, "ACB_NO_AUTH_DATA_REQD", PyInt_FromLong(ACB_NO_AUTH_DATA_REQD));
12045 PyModule_AddObject(m, "ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION", PyInt_FromLong(ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION));
12046 PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_GROUP_ACCESS_LOOKUP_INFO)));
12047 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT", PyInt_FromLong(SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT));
12048 PyModule_AddObject(m, "ACB_DOMTRUST", PyInt_FromLong(ACB_DOMTRUST));
12049 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", PyInt_FromLong(SAMR_ALIAS_ACCESS_REMOVE_MEMBER));
12050 PyModule_AddObject(m, "SAMR_FIELD_COUNTRY_CODE", PyInt_FromLong(SAMR_FIELD_COUNTRY_CODE));
12051 PyModule_AddObject(m, "DomainGeneralInformation2", PyInt_FromLong(DomainGeneralInformation2));
12052 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", PyInt_FromLong(SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS));
12053 PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_WRITE", PyInt_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)));
12054 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME", PyInt_FromLong(SAMR_VALIDATE_FIELD_BAD_PASSWORD_TIME));
12055 PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_LOC_COM", PyInt_FromLong(SAMR_USER_ACCESS_SET_LOC_COM));
12056 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PWD_TOO_LONG", PyInt_FromLong(SAMR_VALIDATION_STATUS_PWD_TOO_LONG));
12057 PyModule_AddObject(m, "ACB_NORMAL", PyInt_FromLong(ACB_NORMAL));
12058 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_LOOKUP_INFO", PyInt_FromLong(SAMR_GROUP_ACCESS_LOOKUP_INFO));
12059 PyModule_AddObject(m, "SAMR_ROLE_DOMAIN_MEMBER", PyInt_FromLong(SAMR_ROLE_DOMAIN_MEMBER));
12060 PyModule_AddObject(m, "SAMR_FIELD_PROFILE_PATH", PyInt_FromLong(SAMR_FIELD_PROFILE_PATH));
12061 PyModule_AddObject(m, "SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD", PyInt_FromLong(SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD));
12062 PyModule_AddObject(m, "UserInternal4Information", PyInt_FromLong(UserInternal4Information));
12063 PyModule_AddObject(m, "GROUPINFONAME", PyInt_FromLong(GROUPINFONAME));
12064 PyModule_AddObject(m, "NetValidatePasswordChange", PyInt_FromLong(NetValidatePasswordChange));
12065 PyModule_AddObject(m, "ACB_PWNOEXP", PyInt_FromLong(ACB_PWNOEXP));
12066 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", PyInt_FromLong(SAMR_DOMAIN_ACCESS_CREATE_ALIAS));
12067 PyModule_AddObject(m, "SAMR_FIELD_PRIMARY_GID", PyInt_FromLong(SAMR_FIELD_PRIMARY_GID));
12068 PyModule_AddObject(m, "SAMR_ACCESS_SHUTDOWN_SERVER", PyInt_FromLong(SAMR_ACCESS_SHUTDOWN_SERVER));
12069 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED", PyInt_FromLong(SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED));
12070 PyModule_AddObject(m, "ACB_PW_EXPIRED", PyInt_FromLong(ACB_PW_EXPIRED));
12071 PyModule_AddObject(m, "SAM_PWD_CHANGE_USERNAME_IN_PASSWORD", PyInt_FromLong(SAM_PWD_CHANGE_USERNAME_IN_PASSWORD));
12072 PyModule_AddObject(m, "GENERIC_RIGHTS_SAM_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_ACCESS_ALL_ACCESS)));
12073 PyModule_AddObject(m, "ACB_USE_DES_KEY_ONLY", PyInt_FromLong(ACB_USE_DES_KEY_ONLY));
12074 PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_DOMAIN_ACCESS_ALL_ACCESS)));
12075 PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", PyInt_FromLong(SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP));
12076 PyModule_AddObject(m, "ACB_MNS", PyInt_FromLong(ACB_MNS));
12077 PyModule_AddObject(m, "SAMR_FIELD_BAD_PWD_COUNT", PyInt_FromLong(SAMR_FIELD_BAD_PWD_COUNT));
12078 PyModule_AddObject(m, "ACB_DISABLED", PyInt_FromLong(ACB_DISABLED));
12079 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_ALL_ACCESS", PyInt_FromLong(0x0000001F));
12080 PyModule_AddObject(m, "GENERIC_RIGHTS_ALIAS_WRITE", PyInt_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_ALIAS_ACCESS_REMOVE_MEMBER|SAMR_ALIAS_ACCESS_ADD_MEMBER|SAMR_ALIAS_ACCESS_SET_INFO)));
12081 PyModule_AddObject(m, "UserInternal5InformationNew", PyInt_FromLong(UserInternal5InformationNew));
12082 PyModule_AddObject(m, "UserAdminCommentInformation", PyInt_FromLong(UserAdminCommentInformation));
12083 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_ALL_ACCESS", PyInt_FromLong(0x000007FF));
12084 PyModule_AddObject(m, "UserLogonInformation", PyInt_FromLong(UserLogonInformation));
12085 PyModule_AddObject(m, "SAMR_FIELD_OWF_PWD", PyInt_FromLong(SAMR_FIELD_OWF_PWD));
12086 PyModule_AddObject(m, "SAMR_FIELD_LOGON_HOURS", PyInt_FromLong(SAMR_FIELD_LOGON_HOURS));
12087 PyModule_AddObject(m, "SAMR_FIELD_ALLOW_PWD_CHANGE", PyInt_FromLong(SAMR_FIELD_ALLOW_PWD_CHANGE));
12088 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT", PyInt_FromLong(SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT));
12089 PyModule_AddObject(m, "GENERIC_RIGHTS_GROUP_WRITE", PyInt_FromLong((STANDARD_RIGHTS_WRITE_ACCESS|SAMR_GROUP_ACCESS_REMOVE_MEMBER|SAMR_GROUP_ACCESS_ADD_MEMBER|SAMR_GROUP_ACCESS_SET_INFO)));
12090 PyModule_AddObject(m, "SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH", PyInt_FromLong(SAMR_VALIDATE_FIELD_PASSWORD_HISTORY_LENGTH));
12091 PyModule_AddObject(m, "SAM_PWD_CHANGE_PASSWORD_TOO_SHORT", PyInt_FromLong(SAM_PWD_CHANGE_PASSWORD_TOO_SHORT));
12092 PyModule_AddObject(m, "SAMR_FIELD_RID", PyInt_FromLong(SAMR_FIELD_RID));
12093 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_SET_INFO", PyInt_FromLong(SAMR_GROUP_ACCESS_SET_INFO));
12094 PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_EXECUTE", PyInt_FromLong((STANDARD_RIGHTS_EXECUTE_ACCESS|SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT|SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1)));
12095 PyModule_AddObject(m, "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE", PyInt_FromLong(SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE));
12096 PyModule_AddObject(m, "SAM_PWD_CHANGE_FAILED_BY_FILTER", PyInt_FromLong(SAM_PWD_CHANGE_FAILED_BY_FILTER));
12097 PyModule_AddObject(m, "ACB_WSTRUST", PyInt_FromLong(ACB_WSTRUST));
12098 PyModule_AddObject(m, "SAMR_CONNECT_AFTER_W2K", PyInt_FromLong(SAMR_CONNECT_AFTER_W2K));
12099 PyModule_AddObject(m, "SAMR_USER_ACCESS_SET_PASSWORD", PyInt_FromLong(SAMR_USER_ACCESS_SET_PASSWORD));
12100 PyModule_AddObject(m, "SAMR_USER_ACCESS_CHANGE_PASSWORD", PyInt_FromLong(SAMR_USER_ACCESS_CHANGE_PASSWORD));
12101 PyModule_AddObject(m, "GENERIC_RIGHTS_DOMAIN_READ", PyInt_FromLong((STANDARD_RIGHTS_READ_ACCESS|SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS|SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2)));
12102 PyModule_AddObject(m, "SAMR_USER_ACCESS_ALL_ACCESS", PyInt_FromLong(0x000007FF));
12103 PyModule_AddObject(m, "SAMR_FIELD_LAST_LOGOFF", PyInt_FromLong(SAMR_FIELD_LAST_LOGOFF));
12104 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_1", PyInt_FromLong(SAMR_DOMAIN_ACCESS_SET_INFO_1));
12105 PyModule_AddObject(m, "UserWorkStationsInformation", PyInt_FromLong(UserWorkStationsInformation));
12106 PyModule_AddObject(m, "SAMR_ALIAS_ACCESS_SET_INFO", PyInt_FromLong(SAMR_ALIAS_ACCESS_SET_INFO));
12107 PyModule_AddObject(m, "GENERIC_RIGHTS_USER_ALL_ACCESS", PyInt_FromLong((STANDARD_RIGHTS_REQUIRED_ACCESS|SAMR_USER_ACCESS_ALL_ACCESS)));
12108 PyModule_AddObject(m, "SE_GROUP_ENABLED", PyInt_FromLong(SE_GROUP_ENABLED));
12109 PyModule_AddObject(m, "SAMR_FIELD_DESCRIPTION", PyInt_FromLong(SAMR_FIELD_DESCRIPTION));
12110 PyModule_AddObject(m, "GENERIC_RIGHTS_USER_WRITE", PyInt_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)));
12111 PyModule_AddObject(m, "SAMR_DOMAIN_ACCESS_SET_INFO_3", PyInt_FromLong(SAMR_DOMAIN_ACCESS_SET_INFO_3));
12112 PyModule_AddObject(m, "SAMR_FIELD_COMMENT", PyInt_FromLong(SAMR_FIELD_COMMENT));
12113 PyModule_AddObject(m, "SE_GROUP_ENABLED_BY_DEFAULT", PyInt_FromLong(SE_GROUP_ENABLED_BY_DEFAULT));
12114 PyModule_AddObject(m, "SAMR_FIELD_WORKSTATIONS", PyInt_FromLong(SAMR_FIELD_WORKSTATIONS));
12115 PyModule_AddObject(m, "SAMR_GROUP_ACCESS_ALL_ACCESS", PyInt_FromLong(0x0000001F));
12116 Py_INCREF((PyObject *)(void *)&samr_SamEntry_Type);
12117 PyModule_AddObject(m, "SamEntry", (PyObject *)(void *)&samr_SamEntry_Type);
12118 Py_INCREF((PyObject *)(void *)&samr_SamArray_Type);
12119 PyModule_AddObject(m, "SamArray", (PyObject *)(void *)&samr_SamArray_Type);
12120 Py_INCREF((PyObject *)(void *)&samr_DomInfo1_Type);
12121 PyModule_AddObject(m, "DomInfo1", (PyObject *)(void *)&samr_DomInfo1_Type);
12122 Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation_Type);
12123 PyModule_AddObject(m, "DomGeneralInformation", (PyObject *)(void *)&samr_DomGeneralInformation_Type);
12124 Py_INCREF((PyObject *)(void *)&samr_DomInfo3_Type);
12125 PyModule_AddObject(m, "DomInfo3", (PyObject *)(void *)&samr_DomInfo3_Type);
12126 Py_INCREF((PyObject *)(void *)&samr_DomOEMInformation_Type);
12127 PyModule_AddObject(m, "DomOEMInformation", (PyObject *)(void *)&samr_DomOEMInformation_Type);
12128 Py_INCREF((PyObject *)(void *)&samr_DomInfo5_Type);
12129 PyModule_AddObject(m, "DomInfo5", (PyObject *)(void *)&samr_DomInfo5_Type);
12130 Py_INCREF((PyObject *)(void *)&samr_DomInfo6_Type);
12131 PyModule_AddObject(m, "DomInfo6", (PyObject *)(void *)&samr_DomInfo6_Type);
12132 Py_INCREF((PyObject *)(void *)&samr_DomInfo7_Type);
12133 PyModule_AddObject(m, "DomInfo7", (PyObject *)(void *)&samr_DomInfo7_Type);
12134 Py_INCREF((PyObject *)(void *)&samr_DomInfo8_Type);
12135 PyModule_AddObject(m, "DomInfo8", (PyObject *)(void *)&samr_DomInfo8_Type);
12136 Py_INCREF((PyObject *)(void *)&samr_DomInfo9_Type);
12137 PyModule_AddObject(m, "DomInfo9", (PyObject *)(void *)&samr_DomInfo9_Type);
12138 Py_INCREF((PyObject *)(void *)&samr_DomGeneralInformation2_Type);
12139 PyModule_AddObject(m, "DomGeneralInformation2", (PyObject *)(void *)&samr_DomGeneralInformation2_Type);
12140 Py_INCREF((PyObject *)(void *)&samr_DomInfo12_Type);
12141 PyModule_AddObject(m, "DomInfo12", (PyObject *)(void *)&samr_DomInfo12_Type);
12142 Py_INCREF((PyObject *)(void *)&samr_DomInfo13_Type);
12143 PyModule_AddObject(m, "DomInfo13", (PyObject *)(void *)&samr_DomInfo13_Type);
12144 Py_INCREF((PyObject *)(void *)&samr_Ids_Type);
12145 PyModule_AddObject(m, "Ids", (PyObject *)(void *)&samr_Ids_Type);
12146 Py_INCREF((PyObject *)(void *)&samr_GroupInfoAll_Type);
12147 PyModule_AddObject(m, "GroupInfoAll", (PyObject *)(void *)&samr_GroupInfoAll_Type);
12148 Py_INCREF((PyObject *)(void *)&samr_GroupInfoAttributes_Type);
12149 PyModule_AddObject(m, "GroupInfoAttributes", (PyObject *)(void *)&samr_GroupInfoAttributes_Type);
12150 Py_INCREF((PyObject *)(void *)&samr_GroupInfoDescription_Type);
12151 PyModule_AddObject(m, "GroupInfoDescription", (PyObject *)(void *)&samr_GroupInfoDescription_Type);
12152 Py_INCREF((PyObject *)(void *)&samr_RidAttrArray_Type);
12153 PyModule_AddObject(m, "RidAttrArray", (PyObject *)(void *)&samr_RidAttrArray_Type);
12154 Py_INCREF((PyObject *)(void *)&samr_AliasInfoAll_Type);
12155 PyModule_AddObject(m, "AliasInfoAll", (PyObject *)(void *)&samr_AliasInfoAll_Type);
12156 Py_INCREF((PyObject *)(void *)&samr_UserInfo1_Type);
12157 PyModule_AddObject(m, "UserInfo1", (PyObject *)(void *)&samr_UserInfo1_Type);
12158 Py_INCREF((PyObject *)(void *)&samr_UserInfo2_Type);
12159 PyModule_AddObject(m, "UserInfo2", (PyObject *)(void *)&samr_UserInfo2_Type);
12160 Py_INCREF((PyObject *)(void *)&samr_LogonHours_Type);
12161 PyModule_AddObject(m, "LogonHours", (PyObject *)(void *)&samr_LogonHours_Type);
12162 Py_INCREF((PyObject *)(void *)&samr_UserInfo3_Type);
12163 PyModule_AddObject(m, "UserInfo3", (PyObject *)(void *)&samr_UserInfo3_Type);
12164 Py_INCREF((PyObject *)(void *)&samr_UserInfo4_Type);
12165 PyModule_AddObject(m, "UserInfo4", (PyObject *)(void *)&samr_UserInfo4_Type);
12166 Py_INCREF((PyObject *)(void *)&samr_UserInfo5_Type);
12167 PyModule_AddObject(m, "UserInfo5", (PyObject *)(void *)&samr_UserInfo5_Type);
12168 Py_INCREF((PyObject *)(void *)&samr_UserInfo6_Type);
12169 PyModule_AddObject(m, "UserInfo6", (PyObject *)(void *)&samr_UserInfo6_Type);
12170 Py_INCREF((PyObject *)(void *)&samr_UserInfo7_Type);
12171 PyModule_AddObject(m, "UserInfo7", (PyObject *)(void *)&samr_UserInfo7_Type);
12172 Py_INCREF((PyObject *)(void *)&samr_UserInfo8_Type);
12173 PyModule_AddObject(m, "UserInfo8", (PyObject *)(void *)&samr_UserInfo8_Type);
12174 Py_INCREF((PyObject *)(void *)&samr_UserInfo9_Type);
12175 PyModule_AddObject(m, "UserInfo9", (PyObject *)(void *)&samr_UserInfo9_Type);
12176 Py_INCREF((PyObject *)(void *)&samr_UserInfo10_Type);
12177 PyModule_AddObject(m, "UserInfo10", (PyObject *)(void *)&samr_UserInfo10_Type);
12178 Py_INCREF((PyObject *)(void *)&samr_UserInfo11_Type);
12179 PyModule_AddObject(m, "UserInfo11", (PyObject *)(void *)&samr_UserInfo11_Type);
12180 Py_INCREF((PyObject *)(void *)&samr_UserInfo12_Type);
12181 PyModule_AddObject(m, "UserInfo12", (PyObject *)(void *)&samr_UserInfo12_Type);
12182 Py_INCREF((PyObject *)(void *)&samr_UserInfo13_Type);
12183 PyModule_AddObject(m, "UserInfo13", (PyObject *)(void *)&samr_UserInfo13_Type);
12184 Py_INCREF((PyObject *)(void *)&samr_UserInfo14_Type);
12185 PyModule_AddObject(m, "UserInfo14", (PyObject *)(void *)&samr_UserInfo14_Type);
12186 Py_INCREF((PyObject *)(void *)&samr_UserInfo16_Type);
12187 PyModule_AddObject(m, "UserInfo16", (PyObject *)(void *)&samr_UserInfo16_Type);
12188 Py_INCREF((PyObject *)(void *)&samr_UserInfo17_Type);
12189 PyModule_AddObject(m, "UserInfo17", (PyObject *)(void *)&samr_UserInfo17_Type);
12190 Py_INCREF((PyObject *)(void *)&samr_Password_Type);
12191 PyModule_AddObject(m, "Password", (PyObject *)(void *)&samr_Password_Type);
12192 Py_INCREF((PyObject *)(void *)&samr_UserInfo18_Type);
12193 PyModule_AddObject(m, "UserInfo18", (PyObject *)(void *)&samr_UserInfo18_Type);
12194 Py_INCREF((PyObject *)(void *)&samr_UserInfo20_Type);
12195 PyModule_AddObject(m, "UserInfo20", (PyObject *)(void *)&samr_UserInfo20_Type);
12196 Py_INCREF((PyObject *)(void *)&samr_UserInfo21_Type);
12197 PyModule_AddObject(m, "UserInfo21", (PyObject *)(void *)&samr_UserInfo21_Type);
12198 Py_INCREF((PyObject *)(void *)&samr_CryptPassword_Type);
12199 PyModule_AddObject(m, "CryptPassword", (PyObject *)(void *)&samr_CryptPassword_Type);
12200 Py_INCREF((PyObject *)(void *)&samr_UserInfo23_Type);
12201 PyModule_AddObject(m, "UserInfo23", (PyObject *)(void *)&samr_UserInfo23_Type);
12202 Py_INCREF((PyObject *)(void *)&samr_UserInfo24_Type);
12203 PyModule_AddObject(m, "UserInfo24", (PyObject *)(void *)&samr_UserInfo24_Type);
12204 Py_INCREF((PyObject *)(void *)&samr_CryptPasswordEx_Type);
12205 PyModule_AddObject(m, "CryptPasswordEx", (PyObject *)(void *)&samr_CryptPasswordEx_Type);
12206 Py_INCREF((PyObject *)(void *)&samr_UserInfo25_Type);
12207 PyModule_AddObject(m, "UserInfo25", (PyObject *)(void *)&samr_UserInfo25_Type);
12208 Py_INCREF((PyObject *)(void *)&samr_UserInfo26_Type);
12209 PyModule_AddObject(m, "UserInfo26", (PyObject *)(void *)&samr_UserInfo26_Type);
12210 Py_INCREF((PyObject *)(void *)&samr_RidWithAttribute_Type);
12211 PyModule_AddObject(m, "RidWithAttribute", (PyObject *)(void *)&samr_RidWithAttribute_Type);
12212 Py_INCREF((PyObject *)(void *)&samr_RidWithAttributeArray_Type);
12213 PyModule_AddObject(m, "RidWithAttributeArray", (PyObject *)(void *)&samr_RidWithAttributeArray_Type);
12214 Py_INCREF((PyObject *)(void *)&samr_DispEntryGeneral_Type);
12215 PyModule_AddObject(m, "DispEntryGeneral", (PyObject *)(void *)&samr_DispEntryGeneral_Type);
12216 Py_INCREF((PyObject *)(void *)&samr_DispInfoGeneral_Type);
12217 PyModule_AddObject(m, "DispInfoGeneral", (PyObject *)(void *)&samr_DispInfoGeneral_Type);
12218 Py_INCREF((PyObject *)(void *)&samr_DispEntryFull_Type);
12219 PyModule_AddObject(m, "DispEntryFull", (PyObject *)(void *)&samr_DispEntryFull_Type);
12220 Py_INCREF((PyObject *)(void *)&samr_DispInfoFull_Type);
12221 PyModule_AddObject(m, "DispInfoFull", (PyObject *)(void *)&samr_DispInfoFull_Type);
12222 Py_INCREF((PyObject *)(void *)&samr_DispEntryFullGroup_Type);
12223 PyModule_AddObject(m, "DispEntryFullGroup", (PyObject *)(void *)&samr_DispEntryFullGroup_Type);
12224 Py_INCREF((PyObject *)(void *)&samr_DispInfoFullGroups_Type);
12225 PyModule_AddObject(m, "DispInfoFullGroups", (PyObject *)(void *)&samr_DispInfoFullGroups_Type);
12226 Py_INCREF((PyObject *)(void *)&samr_DispEntryAscii_Type);
12227 PyModule_AddObject(m, "DispEntryAscii", (PyObject *)(void *)&samr_DispEntryAscii_Type);
12228 Py_INCREF((PyObject *)(void *)&samr_DispInfoAscii_Type);
12229 PyModule_AddObject(m, "DispInfoAscii", (PyObject *)(void *)&samr_DispInfoAscii_Type);
12230 Py_INCREF((PyObject *)(void *)&samr_PwInfo_Type);
12231 PyModule_AddObject(m, "PwInfo", (PyObject *)(void *)&samr_PwInfo_Type);
12232 Py_INCREF((PyObject *)(void *)&userPwdChangeFailureInformation_Type);
12233 PyModule_AddObject(m, "userPwdChangeFailureInformation", (PyObject *)(void *)&userPwdChangeFailureInformation_Type);
12234 Py_INCREF((PyObject *)(void *)&samr_ConnectInfo1_Type);
12235 PyModule_AddObject(m, "ConnectInfo1", (PyObject *)(void *)&samr_ConnectInfo1_Type);
12236 Py_INCREF((PyObject *)(void *)&samr_ValidationBlob_Type);
12237 PyModule_AddObject(m, "ValidationBlob", (PyObject *)(void *)&samr_ValidationBlob_Type);
12238 Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordInfo_Type);
12239 PyModule_AddObject(m, "ValidatePasswordInfo", (PyObject *)(void *)&samr_ValidatePasswordInfo_Type);
12240 Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type);
12241 PyModule_AddObject(m, "ValidatePasswordRepCtr", (PyObject *)(void *)&samr_ValidatePasswordRepCtr_Type);
12242 Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq3_Type);
12243 PyModule_AddObject(m, "ValidatePasswordReq3", (PyObject *)(void *)&samr_ValidatePasswordReq3_Type);
12244 Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq2_Type);
12245 PyModule_AddObject(m, "ValidatePasswordReq2", (PyObject *)(void *)&samr_ValidatePasswordReq2_Type);
12246 Py_INCREF((PyObject *)(void *)&samr_ValidatePasswordReq1_Type);
12247 PyModule_AddObject(m, "ValidatePasswordReq1", (PyObject *)(void *)&samr_ValidatePasswordReq1_Type);
12248 Py_INCREF((PyObject *)(void *)&samr_InterfaceType);
12249 PyModule_AddObject(m, "samr", (PyObject *)(void *)&samr_InterfaceType);
12250 #ifdef PY_MOD_SAMR_PATCH
12251 PY_MOD_SAMR_PATCH(m);