git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / py_samr.c
1
2 /* Python wrapper functions auto-generated by pidl */
3 #include <Python.h>
4 #include "includes.h"
5 #include <pytalloc.h>
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"
10
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;
81
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;
94
95 static PyObject *py_samr_SamEntry_get_idx(PyObject *obj, void *closure)
96 {
97         struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
98         PyObject *py_idx;
99         py_idx = PyInt_FromLong(object->idx);
100         return py_idx;
101 }
102
103 static int py_samr_SamEntry_set_idx(PyObject *py_obj, PyObject *value, void *closure)
104 {
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);
108         return 0;
109 }
110
111 static PyObject *py_samr_SamEntry_get_name(PyObject *obj, void *closure)
112 {
113         struct samr_SamEntry *object = (struct samr_SamEntry *)pytalloc_get_ptr(obj);
114         PyObject *py_name;
115         py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
116         return py_name;
117 }
118
119 static int py_samr_SamEntry_set_name(PyObject *py_obj, PyObject *value, void *closure)
120 {
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) {
124                 PyErr_NoMemory();
125                 return -1;
126         }
127         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
128         return 0;
129 }
130
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 },
134         { NULL }
135 };
136
137 static PyObject *py_samr_SamEntry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
138 {
139         return pytalloc_new(struct samr_SamEntry, type);
140 }
141
142
143 static PyTypeObject samr_SamEntry_Type = {
144         PyObject_HEAD_INIT(NULL) 0,
145         .tp_name = "samr.SamEntry",
146         .tp_getset = py_samr_SamEntry_getsetters,
147         .tp_methods = NULL,
148         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
149         .tp_basicsize = sizeof(pytalloc_Object),
150         .tp_new = py_samr_SamEntry_new,
151 };
152
153
154 static PyObject *py_samr_SamArray_get_count(PyObject *obj, void *closure)
155 {
156         struct samr_SamArray *object = (struct samr_SamArray *)pytalloc_get_ptr(obj);
157         PyObject *py_count;
158         py_count = PyInt_FromLong(object->count);
159         return py_count;
160 }
161
162 static int py_samr_SamArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
163 {
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);
167         return 0;
168 }
169
170 static PyObject *py_samr_SamArray_get_entries(PyObject *obj, void *closure)
171 {
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);
177         } else {
178                 py_entries = PyList_New(object->count);
179                 if (py_entries == NULL) {
180                         return NULL;
181                 }
182                 {
183                         int entries_cntr_1;
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);
188                         }
189                 }
190         }
191         return py_entries;
192 }
193
194 static int py_samr_SamArray_set_entries(PyObject *py_obj, PyObject *value, void *closure)
195 {
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;
200         } else {
201                 object->entries = NULL;
202                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
203                 {
204                         int entries_cntr_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) {
211                                         PyErr_NoMemory();
212                                         return -1;
213                                 }
214                                 object->entries[entries_cntr_1] = *(struct samr_SamEntry *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
215                         }
216                 }
217         }
218         return 0;
219 }
220
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 },
224         { NULL }
225 };
226
227 static PyObject *py_samr_SamArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
228 {
229         return pytalloc_new(struct samr_SamArray, type);
230 }
231
232
233 static PyTypeObject samr_SamArray_Type = {
234         PyObject_HEAD_INIT(NULL) 0,
235         .tp_name = "samr.SamArray",
236         .tp_getset = py_samr_SamArray_getsetters,
237         .tp_methods = NULL,
238         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
239         .tp_basicsize = sizeof(pytalloc_Object),
240         .tp_new = py_samr_SamArray_new,
241 };
242
243
244 static PyObject *py_samr_DomInfo1_get_min_password_length(PyObject *obj, void *closure)
245 {
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;
250 }
251
252 static int py_samr_DomInfo1_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
253 {
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);
257         return 0;
258 }
259
260 static PyObject *py_samr_DomInfo1_get_password_history_length(PyObject *obj, void *closure)
261 {
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;
266 }
267
268 static int py_samr_DomInfo1_set_password_history_length(PyObject *py_obj, PyObject *value, void *closure)
269 {
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);
273         return 0;
274 }
275
276 static PyObject *py_samr_DomInfo1_get_password_properties(PyObject *obj, void *closure)
277 {
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;
282 }
283
284 static int py_samr_DomInfo1_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
285 {
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);
291         } else {
292                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
293                   PyInt_Type.tp_name, PyLong_Type.tp_name);
294                 return -1;
295         }
296         return 0;
297 }
298
299 static PyObject *py_samr_DomInfo1_get_max_password_age(PyObject *obj, void *closure)
300 {
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;
305 }
306
307 static int py_samr_DomInfo1_set_max_password_age(PyObject *py_obj, PyObject *value, void *closure)
308 {
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);
314         } else {
315                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
316                   PyInt_Type.tp_name, PyLong_Type.tp_name);
317                 return -1;
318         }
319         return 0;
320 }
321
322 static PyObject *py_samr_DomInfo1_get_min_password_age(PyObject *obj, void *closure)
323 {
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;
328 }
329
330 static int py_samr_DomInfo1_set_min_password_age(PyObject *py_obj, PyObject *value, void *closure)
331 {
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);
337         } else {
338                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
339                   PyInt_Type.tp_name, PyLong_Type.tp_name);
340                 return -1;
341         }
342         return 0;
343 }
344
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 },
351         { NULL }
352 };
353
354 static PyObject *py_samr_DomInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
355 {
356         return pytalloc_new(struct samr_DomInfo1, type);
357 }
358
359
360 static PyTypeObject samr_DomInfo1_Type = {
361         PyObject_HEAD_INIT(NULL) 0,
362         .tp_name = "samr.DomInfo1",
363         .tp_getset = py_samr_DomInfo1_getsetters,
364         .tp_methods = NULL,
365         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
366         .tp_basicsize = sizeof(pytalloc_Object),
367         .tp_new = py_samr_DomInfo1_new,
368 };
369
370
371 static PyObject *py_samr_DomGeneralInformation_get_force_logoff_time(PyObject *obj, void *closure)
372 {
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;
377 }
378
379 static int py_samr_DomGeneralInformation_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
380 {
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);
386         } else {
387                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
388                   PyInt_Type.tp_name, PyLong_Type.tp_name);
389                 return -1;
390         }
391         return 0;
392 }
393
394 static PyObject *py_samr_DomGeneralInformation_get_oem_information(PyObject *obj, void *closure)
395 {
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;
400 }
401
402 static int py_samr_DomGeneralInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
403 {
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) {
407                 PyErr_NoMemory();
408                 return -1;
409         }
410         object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
411         return 0;
412 }
413
414 static PyObject *py_samr_DomGeneralInformation_get_domain_name(PyObject *obj, void *closure)
415 {
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;
420 }
421
422 static int py_samr_DomGeneralInformation_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
423 {
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) {
427                 PyErr_NoMemory();
428                 return -1;
429         }
430         object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
431         return 0;
432 }
433
434 static PyObject *py_samr_DomGeneralInformation_get_primary(PyObject *obj, void *closure)
435 {
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);
439         return py_primary;
440 }
441
442 static int py_samr_DomGeneralInformation_set_primary(PyObject *py_obj, PyObject *value, void *closure)
443 {
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) {
447                 PyErr_NoMemory();
448                 return -1;
449         }
450         object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
451         return 0;
452 }
453
454 static PyObject *py_samr_DomGeneralInformation_get_sequence_num(PyObject *obj, void *closure)
455 {
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;
460 }
461
462 static int py_samr_DomGeneralInformation_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
463 {
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);
469         } else {
470                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
471                   PyInt_Type.tp_name, PyLong_Type.tp_name);
472                 return -1;
473         }
474         return 0;
475 }
476
477 static PyObject *py_samr_DomGeneralInformation_get_domain_server_state(PyObject *obj, void *closure)
478 {
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;
483 }
484
485 static int py_samr_DomGeneralInformation_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
486 {
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);
492         } else {
493                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
494                   PyInt_Type.tp_name, PyLong_Type.tp_name);
495                 return -1;
496         }
497         return 0;
498 }
499
500 static PyObject *py_samr_DomGeneralInformation_get_role(PyObject *obj, void *closure)
501 {
502         struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
503         PyObject *py_role;
504         py_role = PyInt_FromLong(object->role);
505         return py_role;
506 }
507
508 static int py_samr_DomGeneralInformation_set_role(PyObject *py_obj, PyObject *value, void *closure)
509 {
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);
515         } else {
516                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
517                   PyInt_Type.tp_name, PyLong_Type.tp_name);
518                 return -1;
519         }
520         return 0;
521 }
522
523 static PyObject *py_samr_DomGeneralInformation_get_unknown3(PyObject *obj, void *closure)
524 {
525         struct samr_DomGeneralInformation *object = (struct samr_DomGeneralInformation *)pytalloc_get_ptr(obj);
526         PyObject *py_unknown3;
527         py_unknown3 = PyInt_FromLong(object->unknown3);
528         return py_unknown3;
529 }
530
531 static int py_samr_DomGeneralInformation_set_unknown3(PyObject *py_obj, PyObject *value, void *closure)
532 {
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);
536         return 0;
537 }
538
539 static PyObject *py_samr_DomGeneralInformation_get_num_users(PyObject *obj, void *closure)
540 {
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);
544         return py_num_users;
545 }
546
547 static int py_samr_DomGeneralInformation_set_num_users(PyObject *py_obj, PyObject *value, void *closure)
548 {
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);
552         return 0;
553 }
554
555 static PyObject *py_samr_DomGeneralInformation_get_num_groups(PyObject *obj, void *closure)
556 {
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;
561 }
562
563 static int py_samr_DomGeneralInformation_set_num_groups(PyObject *py_obj, PyObject *value, void *closure)
564 {
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);
568         return 0;
569 }
570
571 static PyObject *py_samr_DomGeneralInformation_get_num_aliases(PyObject *obj, void *closure)
572 {
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;
577 }
578
579 static int py_samr_DomGeneralInformation_set_num_aliases(PyObject *py_obj, PyObject *value, void *closure)
580 {
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);
584         return 0;
585 }
586
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 },
599         { NULL }
600 };
601
602 static PyObject *py_samr_DomGeneralInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
603 {
604         return pytalloc_new(struct samr_DomGeneralInformation, type);
605 }
606
607
608 static PyTypeObject samr_DomGeneralInformation_Type = {
609         PyObject_HEAD_INIT(NULL) 0,
610         .tp_name = "samr.DomGeneralInformation",
611         .tp_getset = py_samr_DomGeneralInformation_getsetters,
612         .tp_methods = NULL,
613         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
614         .tp_basicsize = sizeof(pytalloc_Object),
615         .tp_new = py_samr_DomGeneralInformation_new,
616 };
617
618
619 static PyObject *py_samr_DomInfo3_get_force_logoff_time(PyObject *obj, void *closure)
620 {
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;
625 }
626
627 static int py_samr_DomInfo3_set_force_logoff_time(PyObject *py_obj, PyObject *value, void *closure)
628 {
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);
634         } else {
635                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
636                   PyInt_Type.tp_name, PyLong_Type.tp_name);
637                 return -1;
638         }
639         return 0;
640 }
641
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 },
644         { NULL }
645 };
646
647 static PyObject *py_samr_DomInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
648 {
649         return pytalloc_new(struct samr_DomInfo3, type);
650 }
651
652
653 static PyTypeObject samr_DomInfo3_Type = {
654         PyObject_HEAD_INIT(NULL) 0,
655         .tp_name = "samr.DomInfo3",
656         .tp_getset = py_samr_DomInfo3_getsetters,
657         .tp_methods = NULL,
658         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
659         .tp_basicsize = sizeof(pytalloc_Object),
660         .tp_new = py_samr_DomInfo3_new,
661 };
662
663
664 static PyObject *py_samr_DomOEMInformation_get_oem_information(PyObject *obj, void *closure)
665 {
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;
670 }
671
672 static int py_samr_DomOEMInformation_set_oem_information(PyObject *py_obj, PyObject *value, void *closure)
673 {
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) {
677                 PyErr_NoMemory();
678                 return -1;
679         }
680         object->oem_information = *(struct lsa_String *)pytalloc_get_ptr(value);
681         return 0;
682 }
683
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 },
686         { NULL }
687 };
688
689 static PyObject *py_samr_DomOEMInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
690 {
691         return pytalloc_new(struct samr_DomOEMInformation, type);
692 }
693
694
695 static PyTypeObject samr_DomOEMInformation_Type = {
696         PyObject_HEAD_INIT(NULL) 0,
697         .tp_name = "samr.DomOEMInformation",
698         .tp_getset = py_samr_DomOEMInformation_getsetters,
699         .tp_methods = NULL,
700         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
701         .tp_basicsize = sizeof(pytalloc_Object),
702         .tp_new = py_samr_DomOEMInformation_new,
703 };
704
705
706 static PyObject *py_samr_DomInfo5_get_domain_name(PyObject *obj, void *closure)
707 {
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;
712 }
713
714 static int py_samr_DomInfo5_set_domain_name(PyObject *py_obj, PyObject *value, void *closure)
715 {
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) {
719                 PyErr_NoMemory();
720                 return -1;
721         }
722         object->domain_name = *(struct lsa_String *)pytalloc_get_ptr(value);
723         return 0;
724 }
725
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 },
728         { NULL }
729 };
730
731 static PyObject *py_samr_DomInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
732 {
733         return pytalloc_new(struct samr_DomInfo5, type);
734 }
735
736
737 static PyTypeObject samr_DomInfo5_Type = {
738         PyObject_HEAD_INIT(NULL) 0,
739         .tp_name = "samr.DomInfo5",
740         .tp_getset = py_samr_DomInfo5_getsetters,
741         .tp_methods = NULL,
742         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
743         .tp_basicsize = sizeof(pytalloc_Object),
744         .tp_new = py_samr_DomInfo5_new,
745 };
746
747
748 static PyObject *py_samr_DomInfo6_get_primary(PyObject *obj, void *closure)
749 {
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);
753         return py_primary;
754 }
755
756 static int py_samr_DomInfo6_set_primary(PyObject *py_obj, PyObject *value, void *closure)
757 {
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) {
761                 PyErr_NoMemory();
762                 return -1;
763         }
764         object->primary = *(struct lsa_String *)pytalloc_get_ptr(value);
765         return 0;
766 }
767
768 static PyGetSetDef py_samr_DomInfo6_getsetters[] = {
769         { discard_const_p(char, "primary"), py_samr_DomInfo6_get_primary, py_samr_DomInfo6_set_primary },
770         { NULL }
771 };
772
773 static PyObject *py_samr_DomInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
774 {
775         return pytalloc_new(struct samr_DomInfo6, type);
776 }
777
778
779 static PyTypeObject samr_DomInfo6_Type = {
780         PyObject_HEAD_INIT(NULL) 0,
781         .tp_name = "samr.DomInfo6",
782         .tp_getset = py_samr_DomInfo6_getsetters,
783         .tp_methods = NULL,
784         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
785         .tp_basicsize = sizeof(pytalloc_Object),
786         .tp_new = py_samr_DomInfo6_new,
787 };
788
789
790 static PyObject *py_samr_DomInfo7_get_role(PyObject *obj, void *closure)
791 {
792         struct samr_DomInfo7 *object = (struct samr_DomInfo7 *)pytalloc_get_ptr(obj);
793         PyObject *py_role;
794         py_role = PyInt_FromLong(object->role);
795         return py_role;
796 }
797
798 static int py_samr_DomInfo7_set_role(PyObject *py_obj, PyObject *value, void *closure)
799 {
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);
805         } else {
806                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
807                   PyInt_Type.tp_name, PyLong_Type.tp_name);
808                 return -1;
809         }
810         return 0;
811 }
812
813 static PyGetSetDef py_samr_DomInfo7_getsetters[] = {
814         { discard_const_p(char, "role"), py_samr_DomInfo7_get_role, py_samr_DomInfo7_set_role },
815         { NULL }
816 };
817
818 static PyObject *py_samr_DomInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
819 {
820         return pytalloc_new(struct samr_DomInfo7, type);
821 }
822
823
824 static PyTypeObject samr_DomInfo7_Type = {
825         PyObject_HEAD_INIT(NULL) 0,
826         .tp_name = "samr.DomInfo7",
827         .tp_getset = py_samr_DomInfo7_getsetters,
828         .tp_methods = NULL,
829         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
830         .tp_basicsize = sizeof(pytalloc_Object),
831         .tp_new = py_samr_DomInfo7_new,
832 };
833
834
835 static PyObject *py_samr_DomInfo8_get_sequence_num(PyObject *obj, void *closure)
836 {
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;
841 }
842
843 static int py_samr_DomInfo8_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
844 {
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);
850         } else {
851                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
852                   PyInt_Type.tp_name, PyLong_Type.tp_name);
853                 return -1;
854         }
855         return 0;
856 }
857
858 static PyObject *py_samr_DomInfo8_get_domain_create_time(PyObject *obj, void *closure)
859 {
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;
864 }
865
866 static int py_samr_DomInfo8_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
867 {
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);
873         } else {
874                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
875                   PyInt_Type.tp_name, PyLong_Type.tp_name);
876                 return -1;
877         }
878         return 0;
879 }
880
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 },
884         { NULL }
885 };
886
887 static PyObject *py_samr_DomInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
888 {
889         return pytalloc_new(struct samr_DomInfo8, type);
890 }
891
892
893 static PyTypeObject samr_DomInfo8_Type = {
894         PyObject_HEAD_INIT(NULL) 0,
895         .tp_name = "samr.DomInfo8",
896         .tp_getset = py_samr_DomInfo8_getsetters,
897         .tp_methods = NULL,
898         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
899         .tp_basicsize = sizeof(pytalloc_Object),
900         .tp_new = py_samr_DomInfo8_new,
901 };
902
903
904 static PyObject *py_samr_DomInfo9_get_domain_server_state(PyObject *obj, void *closure)
905 {
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;
910 }
911
912 static int py_samr_DomInfo9_set_domain_server_state(PyObject *py_obj, PyObject *value, void *closure)
913 {
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);
919         } else {
920                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
921                   PyInt_Type.tp_name, PyLong_Type.tp_name);
922                 return -1;
923         }
924         return 0;
925 }
926
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 },
929         { NULL }
930 };
931
932 static PyObject *py_samr_DomInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
933 {
934         return pytalloc_new(struct samr_DomInfo9, type);
935 }
936
937
938 static PyTypeObject samr_DomInfo9_Type = {
939         PyObject_HEAD_INIT(NULL) 0,
940         .tp_name = "samr.DomInfo9",
941         .tp_getset = py_samr_DomInfo9_getsetters,
942         .tp_methods = NULL,
943         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
944         .tp_basicsize = sizeof(pytalloc_Object),
945         .tp_new = py_samr_DomInfo9_new,
946 };
947
948
949 static PyObject *py_samr_DomGeneralInformation2_get_general(PyObject *obj, void *closure)
950 {
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);
954         return py_general;
955 }
956
957 static int py_samr_DomGeneralInformation2_set_general(PyObject *py_obj, PyObject *value, void *closure)
958 {
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) {
962                 PyErr_NoMemory();
963                 return -1;
964         }
965         object->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(value);
966         return 0;
967 }
968
969 static PyObject *py_samr_DomGeneralInformation2_get_lockout_duration(PyObject *obj, void *closure)
970 {
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;
975 }
976
977 static int py_samr_DomGeneralInformation2_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
978 {
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);
984         } else {
985                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
986                   PyInt_Type.tp_name, PyLong_Type.tp_name);
987                 return -1;
988         }
989         return 0;
990 }
991
992 static PyObject *py_samr_DomGeneralInformation2_get_lockout_window(PyObject *obj, void *closure)
993 {
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;
998 }
999
1000 static int py_samr_DomGeneralInformation2_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1001 {
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);
1007         } else {
1008                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1009                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1010                 return -1;
1011         }
1012         return 0;
1013 }
1014
1015 static PyObject *py_samr_DomGeneralInformation2_get_lockout_threshold(PyObject *obj, void *closure)
1016 {
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;
1021 }
1022
1023 static int py_samr_DomGeneralInformation2_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1024 {
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);
1028         return 0;
1029 }
1030
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 },
1036         { NULL }
1037 };
1038
1039 static PyObject *py_samr_DomGeneralInformation2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1040 {
1041         return pytalloc_new(struct samr_DomGeneralInformation2, type);
1042 }
1043
1044
1045 static PyTypeObject samr_DomGeneralInformation2_Type = {
1046         PyObject_HEAD_INIT(NULL) 0,
1047         .tp_name = "samr.DomGeneralInformation2",
1048         .tp_getset = py_samr_DomGeneralInformation2_getsetters,
1049         .tp_methods = NULL,
1050         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1051         .tp_basicsize = sizeof(pytalloc_Object),
1052         .tp_new = py_samr_DomGeneralInformation2_new,
1053 };
1054
1055
1056 static PyObject *py_samr_DomInfo12_get_lockout_duration(PyObject *obj, void *closure)
1057 {
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;
1062 }
1063
1064 static int py_samr_DomInfo12_set_lockout_duration(PyObject *py_obj, PyObject *value, void *closure)
1065 {
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);
1071         } else {
1072                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1073                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1074                 return -1;
1075         }
1076         return 0;
1077 }
1078
1079 static PyObject *py_samr_DomInfo12_get_lockout_window(PyObject *obj, void *closure)
1080 {
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;
1085 }
1086
1087 static int py_samr_DomInfo12_set_lockout_window(PyObject *py_obj, PyObject *value, void *closure)
1088 {
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);
1094         } else {
1095                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1096                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1097                 return -1;
1098         }
1099         return 0;
1100 }
1101
1102 static PyObject *py_samr_DomInfo12_get_lockout_threshold(PyObject *obj, void *closure)
1103 {
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;
1108 }
1109
1110 static int py_samr_DomInfo12_set_lockout_threshold(PyObject *py_obj, PyObject *value, void *closure)
1111 {
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);
1115         return 0;
1116 }
1117
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 },
1122         { NULL }
1123 };
1124
1125 static PyObject *py_samr_DomInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1126 {
1127         return pytalloc_new(struct samr_DomInfo12, type);
1128 }
1129
1130
1131 static PyTypeObject samr_DomInfo12_Type = {
1132         PyObject_HEAD_INIT(NULL) 0,
1133         .tp_name = "samr.DomInfo12",
1134         .tp_getset = py_samr_DomInfo12_getsetters,
1135         .tp_methods = NULL,
1136         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1137         .tp_basicsize = sizeof(pytalloc_Object),
1138         .tp_new = py_samr_DomInfo12_new,
1139 };
1140
1141
1142 static PyObject *py_samr_DomInfo13_get_sequence_num(PyObject *obj, void *closure)
1143 {
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;
1148 }
1149
1150 static int py_samr_DomInfo13_set_sequence_num(PyObject *py_obj, PyObject *value, void *closure)
1151 {
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);
1157         } else {
1158                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1159                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1160                 return -1;
1161         }
1162         return 0;
1163 }
1164
1165 static PyObject *py_samr_DomInfo13_get_domain_create_time(PyObject *obj, void *closure)
1166 {
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;
1171 }
1172
1173 static int py_samr_DomInfo13_set_domain_create_time(PyObject *py_obj, PyObject *value, void *closure)
1174 {
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);
1180         } else {
1181                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1182                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1183                 return -1;
1184         }
1185         return 0;
1186 }
1187
1188 static PyObject *py_samr_DomInfo13_get_modified_count_at_last_promotion(PyObject *obj, void *closure)
1189 {
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;
1194 }
1195
1196 static int py_samr_DomInfo13_set_modified_count_at_last_promotion(PyObject *py_obj, PyObject *value, void *closure)
1197 {
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);
1203         } else {
1204                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1205                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1206                 return -1;
1207         }
1208         return 0;
1209 }
1210
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 },
1215         { NULL }
1216 };
1217
1218 static PyObject *py_samr_DomInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1219 {
1220         return pytalloc_new(struct samr_DomInfo13, type);
1221 }
1222
1223
1224 static PyTypeObject samr_DomInfo13_Type = {
1225         PyObject_HEAD_INIT(NULL) 0,
1226         .tp_name = "samr.DomInfo13",
1227         .tp_getset = py_samr_DomInfo13_getsetters,
1228         .tp_methods = NULL,
1229         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1230         .tp_basicsize = sizeof(pytalloc_Object),
1231         .tp_new = py_samr_DomInfo13_new,
1232 };
1233
1234 PyObject *py_import_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, union samr_DomainInfo *in)
1235 {
1236         PyObject *ret;
1237
1238         switch (level) {
1239                 case 1:
1240                         ret = pytalloc_reference_ex(&samr_DomInfo1_Type, mem_ctx, &in->info1);
1241                         return ret;
1242
1243                 case 2:
1244                         ret = pytalloc_reference_ex(&samr_DomGeneralInformation_Type, mem_ctx, &in->general);
1245                         return ret;
1246
1247                 case 3:
1248                         ret = pytalloc_reference_ex(&samr_DomInfo3_Type, mem_ctx, &in->info3);
1249                         return ret;
1250
1251                 case 4:
1252                         ret = pytalloc_reference_ex(&samr_DomOEMInformation_Type, mem_ctx, &in->oem);
1253                         return ret;
1254
1255                 case 5:
1256                         ret = pytalloc_reference_ex(&samr_DomInfo5_Type, mem_ctx, &in->info5);
1257                         return ret;
1258
1259                 case 6:
1260                         ret = pytalloc_reference_ex(&samr_DomInfo6_Type, mem_ctx, &in->info6);
1261                         return ret;
1262
1263                 case 7:
1264                         ret = pytalloc_reference_ex(&samr_DomInfo7_Type, mem_ctx, &in->info7);
1265                         return ret;
1266
1267                 case 8:
1268                         ret = pytalloc_reference_ex(&samr_DomInfo8_Type, mem_ctx, &in->info8);
1269                         return ret;
1270
1271                 case 9:
1272                         ret = pytalloc_reference_ex(&samr_DomInfo9_Type, mem_ctx, &in->info9);
1273                         return ret;
1274
1275                 case 11:
1276                         ret = pytalloc_reference_ex(&samr_DomGeneralInformation2_Type, mem_ctx, &in->general2);
1277                         return ret;
1278
1279                 case 12:
1280                         ret = pytalloc_reference_ex(&samr_DomInfo12_Type, mem_ctx, &in->info12);
1281                         return ret;
1282
1283                 case 13:
1284                         ret = pytalloc_reference_ex(&samr_DomInfo13_Type, mem_ctx, &in->info13);
1285                         return ret;
1286
1287         }
1288         PyErr_SetString(PyExc_TypeError, "unknown union level");
1289         return NULL;
1290 }
1291
1292 union samr_DomainInfo *py_export_samr_DomainInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1293 {
1294         union samr_DomainInfo *ret = talloc_zero(mem_ctx, union samr_DomainInfo);
1295         switch (level) {
1296                 case 1:
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) {
1299                                 PyErr_NoMemory();
1300                                 talloc_free(ret); return NULL;
1301                         }
1302                         ret->info1 = *(struct samr_DomInfo1 *)pytalloc_get_ptr(in);
1303                         break;
1304
1305                 case 2:
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) {
1308                                 PyErr_NoMemory();
1309                                 talloc_free(ret); return NULL;
1310                         }
1311                         ret->general = *(struct samr_DomGeneralInformation *)pytalloc_get_ptr(in);
1312                         break;
1313
1314                 case 3:
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) {
1317                                 PyErr_NoMemory();
1318                                 talloc_free(ret); return NULL;
1319                         }
1320                         ret->info3 = *(struct samr_DomInfo3 *)pytalloc_get_ptr(in);
1321                         break;
1322
1323                 case 4:
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) {
1326                                 PyErr_NoMemory();
1327                                 talloc_free(ret); return NULL;
1328                         }
1329                         ret->oem = *(struct samr_DomOEMInformation *)pytalloc_get_ptr(in);
1330                         break;
1331
1332                 case 5:
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) {
1335                                 PyErr_NoMemory();
1336                                 talloc_free(ret); return NULL;
1337                         }
1338                         ret->info5 = *(struct samr_DomInfo5 *)pytalloc_get_ptr(in);
1339                         break;
1340
1341                 case 6:
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) {
1344                                 PyErr_NoMemory();
1345                                 talloc_free(ret); return NULL;
1346                         }
1347                         ret->info6 = *(struct samr_DomInfo6 *)pytalloc_get_ptr(in);
1348                         break;
1349
1350                 case 7:
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) {
1353                                 PyErr_NoMemory();
1354                                 talloc_free(ret); return NULL;
1355                         }
1356                         ret->info7 = *(struct samr_DomInfo7 *)pytalloc_get_ptr(in);
1357                         break;
1358
1359                 case 8:
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) {
1362                                 PyErr_NoMemory();
1363                                 talloc_free(ret); return NULL;
1364                         }
1365                         ret->info8 = *(struct samr_DomInfo8 *)pytalloc_get_ptr(in);
1366                         break;
1367
1368                 case 9:
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) {
1371                                 PyErr_NoMemory();
1372                                 talloc_free(ret); return NULL;
1373                         }
1374                         ret->info9 = *(struct samr_DomInfo9 *)pytalloc_get_ptr(in);
1375                         break;
1376
1377                 case 11:
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) {
1380                                 PyErr_NoMemory();
1381                                 talloc_free(ret); return NULL;
1382                         }
1383                         ret->general2 = *(struct samr_DomGeneralInformation2 *)pytalloc_get_ptr(in);
1384                         break;
1385
1386                 case 12:
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) {
1389                                 PyErr_NoMemory();
1390                                 talloc_free(ret); return NULL;
1391                         }
1392                         ret->info12 = *(struct samr_DomInfo12 *)pytalloc_get_ptr(in);
1393                         break;
1394
1395                 case 13:
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) {
1398                                 PyErr_NoMemory();
1399                                 talloc_free(ret); return NULL;
1400                         }
1401                         ret->info13 = *(struct samr_DomInfo13 *)pytalloc_get_ptr(in);
1402                         break;
1403
1404                 default:
1405                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
1406                         talloc_free(ret);
1407                         ret = NULL;
1408         }
1409
1410         return ret;
1411 }
1412
1413
1414 static PyObject *py_samr_Ids_get_count(PyObject *obj, void *closure)
1415 {
1416         struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
1417         PyObject *py_count;
1418         py_count = PyInt_FromLong(object->count);
1419         return py_count;
1420 }
1421
1422 static int py_samr_Ids_set_count(PyObject *py_obj, PyObject *value, void *closure)
1423 {
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);
1427         return 0;
1428 }
1429
1430 static PyObject *py_samr_Ids_get_ids(PyObject *obj, void *closure)
1431 {
1432         struct samr_Ids *object = (struct samr_Ids *)pytalloc_get_ptr(obj);
1433         PyObject *py_ids;
1434         if (object->ids == NULL) {
1435                 py_ids = Py_None;
1436                 Py_INCREF(py_ids);
1437         } else {
1438                 py_ids = PyList_New(object->count);
1439                 if (py_ids == NULL) {
1440                         return NULL;
1441                 }
1442                 {
1443                         int ids_cntr_1;
1444                         for (ids_cntr_1 = 0; ids_cntr_1 < object->count; ids_cntr_1++) {
1445                                 PyObject *py_ids_1;
1446                                 py_ids_1 = PyInt_FromLong(object->ids[ids_cntr_1]);
1447                                 PyList_SetItem(py_ids, ids_cntr_1, py_ids_1);
1448                         }
1449                 }
1450         }
1451         return py_ids;
1452 }
1453
1454 static int py_samr_Ids_set_ids(PyObject *py_obj, PyObject *value, void *closure)
1455 {
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) {
1459                 object->ids = NULL;
1460         } else {
1461                 object->ids = NULL;
1462                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1463                 {
1464                         int ids_cntr_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));
1471                         }
1472                 }
1473         }
1474         return 0;
1475 }
1476
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 },
1480         { NULL }
1481 };
1482
1483 static PyObject *py_samr_Ids_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1484 {
1485         return pytalloc_new(struct samr_Ids, type);
1486 }
1487
1488
1489 static PyTypeObject samr_Ids_Type = {
1490         PyObject_HEAD_INIT(NULL) 0,
1491         .tp_name = "samr.Ids",
1492         .tp_getset = py_samr_Ids_getsetters,
1493         .tp_methods = NULL,
1494         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1495         .tp_basicsize = sizeof(pytalloc_Object),
1496         .tp_new = py_samr_Ids_new,
1497 };
1498
1499
1500 static PyObject *py_samr_GroupInfoAll_get_name(PyObject *obj, void *closure)
1501 {
1502         struct samr_GroupInfoAll *object = (struct samr_GroupInfoAll *)pytalloc_get_ptr(obj);
1503         PyObject *py_name;
1504         py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
1505         return py_name;
1506 }
1507
1508 static int py_samr_GroupInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
1509 {
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) {
1513                 PyErr_NoMemory();
1514                 return -1;
1515         }
1516         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
1517         return 0;
1518 }
1519
1520 static PyObject *py_samr_GroupInfoAll_get_attributes(PyObject *obj, void *closure)
1521 {
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;
1526 }
1527
1528 static int py_samr_GroupInfoAll_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1529 {
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);
1535         } else {
1536                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1537                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1538                 return -1;
1539         }
1540         return 0;
1541 }
1542
1543 static PyObject *py_samr_GroupInfoAll_get_num_members(PyObject *obj, void *closure)
1544 {
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;
1549 }
1550
1551 static int py_samr_GroupInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
1552 {
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);
1556         return 0;
1557 }
1558
1559 static PyObject *py_samr_GroupInfoAll_get_description(PyObject *obj, void *closure)
1560 {
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;
1565 }
1566
1567 static int py_samr_GroupInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
1568 {
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) {
1572                 PyErr_NoMemory();
1573                 return -1;
1574         }
1575         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1576         return 0;
1577 }
1578
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 },
1584         { NULL }
1585 };
1586
1587 static PyObject *py_samr_GroupInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1588 {
1589         return pytalloc_new(struct samr_GroupInfoAll, type);
1590 }
1591
1592
1593 static PyTypeObject samr_GroupInfoAll_Type = {
1594         PyObject_HEAD_INIT(NULL) 0,
1595         .tp_name = "samr.GroupInfoAll",
1596         .tp_getset = py_samr_GroupInfoAll_getsetters,
1597         .tp_methods = NULL,
1598         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1599         .tp_basicsize = sizeof(pytalloc_Object),
1600         .tp_new = py_samr_GroupInfoAll_new,
1601 };
1602
1603
1604 static PyObject *py_samr_GroupInfoAttributes_get_attributes(PyObject *obj, void *closure)
1605 {
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;
1610 }
1611
1612 static int py_samr_GroupInfoAttributes_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1613 {
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);
1619         } else {
1620                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1621                   PyInt_Type.tp_name, PyLong_Type.tp_name);
1622                 return -1;
1623         }
1624         return 0;
1625 }
1626
1627 static PyGetSetDef py_samr_GroupInfoAttributes_getsetters[] = {
1628         { discard_const_p(char, "attributes"), py_samr_GroupInfoAttributes_get_attributes, py_samr_GroupInfoAttributes_set_attributes },
1629         { NULL }
1630 };
1631
1632 static PyObject *py_samr_GroupInfoAttributes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1633 {
1634         return pytalloc_new(struct samr_GroupInfoAttributes, type);
1635 }
1636
1637
1638 static PyTypeObject samr_GroupInfoAttributes_Type = {
1639         PyObject_HEAD_INIT(NULL) 0,
1640         .tp_name = "samr.GroupInfoAttributes",
1641         .tp_getset = py_samr_GroupInfoAttributes_getsetters,
1642         .tp_methods = NULL,
1643         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1644         .tp_basicsize = sizeof(pytalloc_Object),
1645         .tp_new = py_samr_GroupInfoAttributes_new,
1646 };
1647
1648
1649 static PyObject *py_samr_GroupInfoDescription_get_description(PyObject *obj, void *closure)
1650 {
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;
1655 }
1656
1657 static int py_samr_GroupInfoDescription_set_description(PyObject *py_obj, PyObject *value, void *closure)
1658 {
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) {
1662                 PyErr_NoMemory();
1663                 return -1;
1664         }
1665         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1666         return 0;
1667 }
1668
1669 static PyGetSetDef py_samr_GroupInfoDescription_getsetters[] = {
1670         { discard_const_p(char, "description"), py_samr_GroupInfoDescription_get_description, py_samr_GroupInfoDescription_set_description },
1671         { NULL }
1672 };
1673
1674 static PyObject *py_samr_GroupInfoDescription_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1675 {
1676         return pytalloc_new(struct samr_GroupInfoDescription, type);
1677 }
1678
1679
1680 static PyTypeObject samr_GroupInfoDescription_Type = {
1681         PyObject_HEAD_INIT(NULL) 0,
1682         .tp_name = "samr.GroupInfoDescription",
1683         .tp_getset = py_samr_GroupInfoDescription_getsetters,
1684         .tp_methods = NULL,
1685         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1686         .tp_basicsize = sizeof(pytalloc_Object),
1687         .tp_new = py_samr_GroupInfoDescription_new,
1688 };
1689
1690 PyObject *py_import_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, union samr_GroupInfo *in)
1691 {
1692         PyObject *ret;
1693
1694         switch (level) {
1695                 case GROUPINFOALL:
1696                         ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all);
1697                         return ret;
1698
1699                 case GROUPINFONAME:
1700                         ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
1701                         return ret;
1702
1703                 case GROUPINFOATTRIBUTES:
1704                         ret = pytalloc_reference_ex(&samr_GroupInfoAttributes_Type, mem_ctx, &in->attributes);
1705                         return ret;
1706
1707                 case GROUPINFODESCRIPTION:
1708                         ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
1709                         return ret;
1710
1711                 case GROUPINFOALL2:
1712                         ret = pytalloc_reference_ex(&samr_GroupInfoAll_Type, mem_ctx, &in->all2);
1713                         return ret;
1714
1715         }
1716         PyErr_SetString(PyExc_TypeError, "unknown union level");
1717         return NULL;
1718 }
1719
1720 union samr_GroupInfo *py_export_samr_GroupInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
1721 {
1722         union samr_GroupInfo *ret = talloc_zero(mem_ctx, union samr_GroupInfo);
1723         switch (level) {
1724                 case GROUPINFOALL:
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) {
1727                                 PyErr_NoMemory();
1728                                 talloc_free(ret); return NULL;
1729                         }
1730                         ret->all = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
1731                         break;
1732
1733                 case GROUPINFONAME:
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) {
1736                                 PyErr_NoMemory();
1737                                 talloc_free(ret); return NULL;
1738                         }
1739                         ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
1740                         break;
1741
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) {
1745                                 PyErr_NoMemory();
1746                                 talloc_free(ret); return NULL;
1747                         }
1748                         ret->attributes = *(struct samr_GroupInfoAttributes *)pytalloc_get_ptr(in);
1749                         break;
1750
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) {
1754                                 PyErr_NoMemory();
1755                                 talloc_free(ret); return NULL;
1756                         }
1757                         ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
1758                         break;
1759
1760                 case GROUPINFOALL2:
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) {
1763                                 PyErr_NoMemory();
1764                                 talloc_free(ret); return NULL;
1765                         }
1766                         ret->all2 = *(struct samr_GroupInfoAll *)pytalloc_get_ptr(in);
1767                         break;
1768
1769                 default:
1770                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
1771                         talloc_free(ret);
1772                         ret = NULL;
1773         }
1774
1775         return ret;
1776 }
1777
1778
1779 static PyObject *py_samr_RidAttrArray_get_count(PyObject *obj, void *closure)
1780 {
1781         struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
1782         PyObject *py_count;
1783         py_count = PyInt_FromLong(object->count);
1784         return py_count;
1785 }
1786
1787 static int py_samr_RidAttrArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
1788 {
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);
1792         return 0;
1793 }
1794
1795 static PyObject *py_samr_RidAttrArray_get_rids(PyObject *obj, void *closure)
1796 {
1797         struct samr_RidAttrArray *object = (struct samr_RidAttrArray *)pytalloc_get_ptr(obj);
1798         PyObject *py_rids;
1799         if (object->rids == NULL) {
1800                 py_rids = Py_None;
1801                 Py_INCREF(py_rids);
1802         } else {
1803                 py_rids = PyList_New(object->count);
1804                 if (py_rids == NULL) {
1805                         return NULL;
1806                 }
1807                 {
1808                         int rids_cntr_1;
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);
1813                         }
1814                 }
1815         }
1816         return py_rids;
1817 }
1818
1819 static int py_samr_RidAttrArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
1820 {
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;
1825         } else {
1826                 object->rids = NULL;
1827                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1828                 {
1829                         int rids_cntr_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));
1836                         }
1837                 }
1838         }
1839         return 0;
1840 }
1841
1842 static PyObject *py_samr_RidAttrArray_get_attributes(PyObject *obj, void *closure)
1843 {
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);
1849         } else {
1850                 py_attributes = PyList_New(object->count);
1851                 if (py_attributes == NULL) {
1852                         return NULL;
1853                 }
1854                 {
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);
1860                         }
1861                 }
1862         }
1863         return py_attributes;
1864 }
1865
1866 static int py_samr_RidAttrArray_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
1867 {
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;
1872         } else {
1873                 object->attributes = NULL;
1874                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
1875                 {
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));
1885                                 } else {
1886                                         PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
1887                                           PyInt_Type.tp_name, PyLong_Type.tp_name);
1888                                         return -1;
1889                                 }
1890                         }
1891                 }
1892         }
1893         return 0;
1894 }
1895
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 },
1900         { NULL }
1901 };
1902
1903 static PyObject *py_samr_RidAttrArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1904 {
1905         return pytalloc_new(struct samr_RidAttrArray, type);
1906 }
1907
1908
1909 static PyTypeObject samr_RidAttrArray_Type = {
1910         PyObject_HEAD_INIT(NULL) 0,
1911         .tp_name = "samr.RidAttrArray",
1912         .tp_getset = py_samr_RidAttrArray_getsetters,
1913         .tp_methods = NULL,
1914         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1915         .tp_basicsize = sizeof(pytalloc_Object),
1916         .tp_new = py_samr_RidAttrArray_new,
1917 };
1918
1919
1920 static PyObject *py_samr_AliasInfoAll_get_name(PyObject *obj, void *closure)
1921 {
1922         struct samr_AliasInfoAll *object = (struct samr_AliasInfoAll *)pytalloc_get_ptr(obj);
1923         PyObject *py_name;
1924         py_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->name);
1925         return py_name;
1926 }
1927
1928 static int py_samr_AliasInfoAll_set_name(PyObject *py_obj, PyObject *value, void *closure)
1929 {
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) {
1933                 PyErr_NoMemory();
1934                 return -1;
1935         }
1936         object->name = *(struct lsa_String *)pytalloc_get_ptr(value);
1937         return 0;
1938 }
1939
1940 static PyObject *py_samr_AliasInfoAll_get_num_members(PyObject *obj, void *closure)
1941 {
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;
1946 }
1947
1948 static int py_samr_AliasInfoAll_set_num_members(PyObject *py_obj, PyObject *value, void *closure)
1949 {
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);
1953         return 0;
1954 }
1955
1956 static PyObject *py_samr_AliasInfoAll_get_description(PyObject *obj, void *closure)
1957 {
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;
1962 }
1963
1964 static int py_samr_AliasInfoAll_set_description(PyObject *py_obj, PyObject *value, void *closure)
1965 {
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) {
1969                 PyErr_NoMemory();
1970                 return -1;
1971         }
1972         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
1973         return 0;
1974 }
1975
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 },
1980         { NULL }
1981 };
1982
1983 static PyObject *py_samr_AliasInfoAll_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
1984 {
1985         return pytalloc_new(struct samr_AliasInfoAll, type);
1986 }
1987
1988
1989 static PyTypeObject samr_AliasInfoAll_Type = {
1990         PyObject_HEAD_INIT(NULL) 0,
1991         .tp_name = "samr.AliasInfoAll",
1992         .tp_getset = py_samr_AliasInfoAll_getsetters,
1993         .tp_methods = NULL,
1994         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1995         .tp_basicsize = sizeof(pytalloc_Object),
1996         .tp_new = py_samr_AliasInfoAll_new,
1997 };
1998
1999 PyObject *py_import_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, union samr_AliasInfo *in)
2000 {
2001         PyObject *ret;
2002
2003         switch (level) {
2004                 case ALIASINFOALL:
2005                         ret = pytalloc_reference_ex(&samr_AliasInfoAll_Type, mem_ctx, &in->all);
2006                         return ret;
2007
2008                 case ALIASINFONAME:
2009                         ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->name);
2010                         return ret;
2011
2012                 case ALIASINFODESCRIPTION:
2013                         ret = pytalloc_reference_ex(lsa_String_Type, mem_ctx, &in->description);
2014                         return ret;
2015
2016         }
2017         PyErr_SetString(PyExc_TypeError, "unknown union level");
2018         return NULL;
2019 }
2020
2021 union samr_AliasInfo *py_export_samr_AliasInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
2022 {
2023         union samr_AliasInfo *ret = talloc_zero(mem_ctx, union samr_AliasInfo);
2024         switch (level) {
2025                 case ALIASINFOALL:
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) {
2028                                 PyErr_NoMemory();
2029                                 talloc_free(ret); return NULL;
2030                         }
2031                         ret->all = *(struct samr_AliasInfoAll *)pytalloc_get_ptr(in);
2032                         break;
2033
2034                 case ALIASINFONAME:
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) {
2037                                 PyErr_NoMemory();
2038                                 talloc_free(ret); return NULL;
2039                         }
2040                         ret->name = *(struct lsa_String *)pytalloc_get_ptr(in);
2041                         break;
2042
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) {
2046                                 PyErr_NoMemory();
2047                                 talloc_free(ret); return NULL;
2048                         }
2049                         ret->description = *(struct lsa_String *)pytalloc_get_ptr(in);
2050                         break;
2051
2052                 default:
2053                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
2054                         talloc_free(ret);
2055                         ret = NULL;
2056         }
2057
2058         return ret;
2059 }
2060
2061
2062 static PyObject *py_samr_UserInfo1_get_account_name(PyObject *obj, void *closure)
2063 {
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;
2068 }
2069
2070 static int py_samr_UserInfo1_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2071 {
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) {
2075                 PyErr_NoMemory();
2076                 return -1;
2077         }
2078         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2079         return 0;
2080 }
2081
2082 static PyObject *py_samr_UserInfo1_get_full_name(PyObject *obj, void *closure)
2083 {
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;
2088 }
2089
2090 static int py_samr_UserInfo1_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2091 {
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) {
2095                 PyErr_NoMemory();
2096                 return -1;
2097         }
2098         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2099         return 0;
2100 }
2101
2102 static PyObject *py_samr_UserInfo1_get_primary_gid(PyObject *obj, void *closure)
2103 {
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;
2108 }
2109
2110 static int py_samr_UserInfo1_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2111 {
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);
2115         return 0;
2116 }
2117
2118 static PyObject *py_samr_UserInfo1_get_description(PyObject *obj, void *closure)
2119 {
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;
2124 }
2125
2126 static int py_samr_UserInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure)
2127 {
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) {
2131                 PyErr_NoMemory();
2132                 return -1;
2133         }
2134         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
2135         return 0;
2136 }
2137
2138 static PyObject *py_samr_UserInfo1_get_comment(PyObject *obj, void *closure)
2139 {
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);
2143         return py_comment;
2144 }
2145
2146 static int py_samr_UserInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
2147 {
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) {
2151                 PyErr_NoMemory();
2152                 return -1;
2153         }
2154         object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
2155         return 0;
2156 }
2157
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 },
2164         { NULL }
2165 };
2166
2167 static PyObject *py_samr_UserInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2168 {
2169         return pytalloc_new(struct samr_UserInfo1, type);
2170 }
2171
2172
2173 static PyTypeObject samr_UserInfo1_Type = {
2174         PyObject_HEAD_INIT(NULL) 0,
2175         .tp_name = "samr.UserInfo1",
2176         .tp_getset = py_samr_UserInfo1_getsetters,
2177         .tp_methods = NULL,
2178         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2179         .tp_basicsize = sizeof(pytalloc_Object),
2180         .tp_new = py_samr_UserInfo1_new,
2181 };
2182
2183
2184 static PyObject *py_samr_UserInfo2_get_comment(PyObject *obj, void *closure)
2185 {
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);
2189         return py_comment;
2190 }
2191
2192 static int py_samr_UserInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
2193 {
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) {
2197                 PyErr_NoMemory();
2198                 return -1;
2199         }
2200         object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
2201         return 0;
2202 }
2203
2204 static PyObject *py_samr_UserInfo2_get_reserved(PyObject *obj, void *closure)
2205 {
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);
2209         return py_reserved;
2210 }
2211
2212 static int py_samr_UserInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
2213 {
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) {
2217                 PyErr_NoMemory();
2218                 return -1;
2219         }
2220         object->reserved = *(struct lsa_String *)pytalloc_get_ptr(value);
2221         return 0;
2222 }
2223
2224 static PyObject *py_samr_UserInfo2_get_country_code(PyObject *obj, void *closure)
2225 {
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;
2230 }
2231
2232 static int py_samr_UserInfo2_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
2233 {
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);
2237         return 0;
2238 }
2239
2240 static PyObject *py_samr_UserInfo2_get_code_page(PyObject *obj, void *closure)
2241 {
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;
2246 }
2247
2248 static int py_samr_UserInfo2_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
2249 {
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);
2253         return 0;
2254 }
2255
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 },
2261         { NULL }
2262 };
2263
2264 static PyObject *py_samr_UserInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2265 {
2266         return pytalloc_new(struct samr_UserInfo2, type);
2267 }
2268
2269
2270 static PyTypeObject samr_UserInfo2_Type = {
2271         PyObject_HEAD_INIT(NULL) 0,
2272         .tp_name = "samr.UserInfo2",
2273         .tp_getset = py_samr_UserInfo2_getsetters,
2274         .tp_methods = NULL,
2275         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2276         .tp_basicsize = sizeof(pytalloc_Object),
2277         .tp_new = py_samr_UserInfo2_new,
2278 };
2279
2280
2281 static PyObject *py_samr_LogonHours_get_units_per_week(PyObject *obj, void *closure)
2282 {
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;
2287 }
2288
2289 static int py_samr_LogonHours_set_units_per_week(PyObject *py_obj, PyObject *value, void *closure)
2290 {
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);
2294         return 0;
2295 }
2296
2297 static PyObject *py_samr_LogonHours_get_bits(PyObject *obj, void *closure)
2298 {
2299         struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(obj);
2300         PyObject *py_bits;
2301         if (object->bits == NULL) {
2302                 py_bits = Py_None;
2303                 Py_INCREF(py_bits);
2304         } else {
2305                 py_bits = PyList_New(object->units_per_week / 8);
2306                 if (py_bits == NULL) {
2307                         return NULL;
2308                 }
2309                 {
2310                         int bits_cntr_1;
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);
2315                         }
2316                 }
2317         }
2318         return py_bits;
2319 }
2320
2321 static int py_samr_LogonHours_set_bits(PyObject *py_obj, PyObject *value, void *closure)
2322 {
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;
2327         } else {
2328                 object->bits = NULL;
2329                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
2330                 {
2331                         int bits_cntr_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));
2338                         }
2339                 }
2340         }
2341         return 0;
2342 }
2343
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 },
2347         { NULL }
2348 };
2349
2350 static PyObject *py_samr_LogonHours_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2351 {
2352         return pytalloc_new(struct samr_LogonHours, type);
2353 }
2354
2355 static PyObject *py_samr_LogonHours_ndr_pack(PyObject *py_obj)
2356 {
2357         struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2358         DATA_BLOB blob;
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);
2363                 return NULL;
2364         }
2365
2366         return PyString_FromStringAndSize((char *)blob.data, blob.length);
2367 }
2368
2369 static PyObject *py_samr_LogonHours_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
2370 {
2371         struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2372         DATA_BLOB blob;
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;
2378
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)) {
2383                 return NULL;
2384         }
2385         blob.length = blob_length;
2386
2387         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
2388                 allow_remaining = true;
2389         }
2390
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);
2393         } else {
2394                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_LogonHours);
2395         }
2396         if (err != NDR_ERR_SUCCESS) {
2397                 PyErr_SetNdrError(err);
2398                 return NULL;
2399         }
2400
2401         Py_RETURN_NONE;
2402 }
2403
2404 static PyObject *py_samr_LogonHours_ndr_print(PyObject *py_obj)
2405 {
2406         struct samr_LogonHours *object = (struct samr_LogonHours *)pytalloc_get_ptr(py_obj);
2407         PyObject *ret;
2408         char *retstr;
2409
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);
2413
2414         return ret;
2415 }
2416
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 }
2422 };
2423
2424
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,
2433 };
2434
2435
2436 static PyObject *py_samr_UserInfo3_get_account_name(PyObject *obj, void *closure)
2437 {
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;
2442 }
2443
2444 static int py_samr_UserInfo3_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2445 {
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) {
2449                 PyErr_NoMemory();
2450                 return -1;
2451         }
2452         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2453         return 0;
2454 }
2455
2456 static PyObject *py_samr_UserInfo3_get_full_name(PyObject *obj, void *closure)
2457 {
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;
2462 }
2463
2464 static int py_samr_UserInfo3_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2465 {
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) {
2469                 PyErr_NoMemory();
2470                 return -1;
2471         }
2472         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2473         return 0;
2474 }
2475
2476 static PyObject *py_samr_UserInfo3_get_rid(PyObject *obj, void *closure)
2477 {
2478         struct samr_UserInfo3 *object = (struct samr_UserInfo3 *)pytalloc_get_ptr(obj);
2479         PyObject *py_rid;
2480         py_rid = PyInt_FromLong(object->rid);
2481         return py_rid;
2482 }
2483
2484 static int py_samr_UserInfo3_set_rid(PyObject *py_obj, PyObject *value, void *closure)
2485 {
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);
2489         return 0;
2490 }
2491
2492 static PyObject *py_samr_UserInfo3_get_primary_gid(PyObject *obj, void *closure)
2493 {
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;
2498 }
2499
2500 static int py_samr_UserInfo3_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2501 {
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);
2505         return 0;
2506 }
2507
2508 static PyObject *py_samr_UserInfo3_get_home_directory(PyObject *obj, void *closure)
2509 {
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;
2514 }
2515
2516 static int py_samr_UserInfo3_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
2517 {
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) {
2521                 PyErr_NoMemory();
2522                 return -1;
2523         }
2524         object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
2525         return 0;
2526 }
2527
2528 static PyObject *py_samr_UserInfo3_get_home_drive(PyObject *obj, void *closure)
2529 {
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;
2534 }
2535
2536 static int py_samr_UserInfo3_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
2537 {
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) {
2541                 PyErr_NoMemory();
2542                 return -1;
2543         }
2544         object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
2545         return 0;
2546 }
2547
2548 static PyObject *py_samr_UserInfo3_get_logon_script(PyObject *obj, void *closure)
2549 {
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;
2554 }
2555
2556 static int py_samr_UserInfo3_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
2557 {
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) {
2561                 PyErr_NoMemory();
2562                 return -1;
2563         }
2564         object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
2565         return 0;
2566 }
2567
2568 static PyObject *py_samr_UserInfo3_get_profile_path(PyObject *obj, void *closure)
2569 {
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;
2574 }
2575
2576 static int py_samr_UserInfo3_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
2577 {
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) {
2581                 PyErr_NoMemory();
2582                 return -1;
2583         }
2584         object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
2585         return 0;
2586 }
2587
2588 static PyObject *py_samr_UserInfo3_get_workstations(PyObject *obj, void *closure)
2589 {
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;
2594 }
2595
2596 static int py_samr_UserInfo3_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
2597 {
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) {
2601                 PyErr_NoMemory();
2602                 return -1;
2603         }
2604         object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
2605         return 0;
2606 }
2607
2608 static PyObject *py_samr_UserInfo3_get_last_logon(PyObject *obj, void *closure)
2609 {
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;
2614 }
2615
2616 static int py_samr_UserInfo3_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
2617 {
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);
2623         } else {
2624                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2625                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2626                 return -1;
2627         }
2628         return 0;
2629 }
2630
2631 static PyObject *py_samr_UserInfo3_get_last_logoff(PyObject *obj, void *closure)
2632 {
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;
2637 }
2638
2639 static int py_samr_UserInfo3_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
2640 {
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);
2646         } else {
2647                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2648                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2649                 return -1;
2650         }
2651         return 0;
2652 }
2653
2654 static PyObject *py_samr_UserInfo3_get_last_password_change(PyObject *obj, void *closure)
2655 {
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;
2660 }
2661
2662 static int py_samr_UserInfo3_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
2663 {
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);
2669         } else {
2670                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2671                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2672                 return -1;
2673         }
2674         return 0;
2675 }
2676
2677 static PyObject *py_samr_UserInfo3_get_allow_password_change(PyObject *obj, void *closure)
2678 {
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;
2683 }
2684
2685 static int py_samr_UserInfo3_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
2686 {
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);
2692         } else {
2693                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2694                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2695                 return -1;
2696         }
2697         return 0;
2698 }
2699
2700 static PyObject *py_samr_UserInfo3_get_force_password_change(PyObject *obj, void *closure)
2701 {
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;
2706 }
2707
2708 static int py_samr_UserInfo3_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
2709 {
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);
2715         } else {
2716                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2717                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2718                 return -1;
2719         }
2720         return 0;
2721 }
2722
2723 static PyObject *py_samr_UserInfo3_get_logon_hours(PyObject *obj, void *closure)
2724 {
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;
2729 }
2730
2731 static int py_samr_UserInfo3_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
2732 {
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) {
2736                 PyErr_NoMemory();
2737                 return -1;
2738         }
2739         object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
2740         return 0;
2741 }
2742
2743 static PyObject *py_samr_UserInfo3_get_bad_password_count(PyObject *obj, void *closure)
2744 {
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;
2749 }
2750
2751 static int py_samr_UserInfo3_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
2752 {
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);
2756         return 0;
2757 }
2758
2759 static PyObject *py_samr_UserInfo3_get_logon_count(PyObject *obj, void *closure)
2760 {
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;
2765 }
2766
2767 static int py_samr_UserInfo3_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
2768 {
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);
2772         return 0;
2773 }
2774
2775 static PyObject *py_samr_UserInfo3_get_acct_flags(PyObject *obj, void *closure)
2776 {
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;
2781 }
2782
2783 static int py_samr_UserInfo3_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
2784 {
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);
2790         } else {
2791                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
2792                   PyInt_Type.tp_name, PyLong_Type.tp_name);
2793                 return -1;
2794         }
2795         return 0;
2796 }
2797
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 },
2817         { NULL }
2818 };
2819
2820 static PyObject *py_samr_UserInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2821 {
2822         return pytalloc_new(struct samr_UserInfo3, type);
2823 }
2824
2825
2826 static PyTypeObject samr_UserInfo3_Type = {
2827         PyObject_HEAD_INIT(NULL) 0,
2828         .tp_name = "samr.UserInfo3",
2829         .tp_getset = py_samr_UserInfo3_getsetters,
2830         .tp_methods = NULL,
2831         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2832         .tp_basicsize = sizeof(pytalloc_Object),
2833         .tp_new = py_samr_UserInfo3_new,
2834 };
2835
2836
2837 static PyObject *py_samr_UserInfo4_get_logon_hours(PyObject *obj, void *closure)
2838 {
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;
2843 }
2844
2845 static int py_samr_UserInfo4_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
2846 {
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) {
2850                 PyErr_NoMemory();
2851                 return -1;
2852         }
2853         object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
2854         return 0;
2855 }
2856
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 },
2859         { NULL }
2860 };
2861
2862 static PyObject *py_samr_UserInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
2863 {
2864         return pytalloc_new(struct samr_UserInfo4, type);
2865 }
2866
2867
2868 static PyTypeObject samr_UserInfo4_Type = {
2869         PyObject_HEAD_INIT(NULL) 0,
2870         .tp_name = "samr.UserInfo4",
2871         .tp_getset = py_samr_UserInfo4_getsetters,
2872         .tp_methods = NULL,
2873         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
2874         .tp_basicsize = sizeof(pytalloc_Object),
2875         .tp_new = py_samr_UserInfo4_new,
2876 };
2877
2878
2879 static PyObject *py_samr_UserInfo5_get_account_name(PyObject *obj, void *closure)
2880 {
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;
2885 }
2886
2887 static int py_samr_UserInfo5_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
2888 {
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) {
2892                 PyErr_NoMemory();
2893                 return -1;
2894         }
2895         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2896         return 0;
2897 }
2898
2899 static PyObject *py_samr_UserInfo5_get_full_name(PyObject *obj, void *closure)
2900 {
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;
2905 }
2906
2907 static int py_samr_UserInfo5_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
2908 {
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) {
2912                 PyErr_NoMemory();
2913                 return -1;
2914         }
2915         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
2916         return 0;
2917 }
2918
2919 static PyObject *py_samr_UserInfo5_get_rid(PyObject *obj, void *closure)
2920 {
2921         struct samr_UserInfo5 *object = (struct samr_UserInfo5 *)pytalloc_get_ptr(obj);
2922         PyObject *py_rid;
2923         py_rid = PyInt_FromLong(object->rid);
2924         return py_rid;
2925 }
2926
2927 static int py_samr_UserInfo5_set_rid(PyObject *py_obj, PyObject *value, void *closure)
2928 {
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);
2932         return 0;
2933 }
2934
2935 static PyObject *py_samr_UserInfo5_get_primary_gid(PyObject *obj, void *closure)
2936 {
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;
2941 }
2942
2943 static int py_samr_UserInfo5_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
2944 {
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);
2948         return 0;
2949 }
2950
2951 static PyObject *py_samr_UserInfo5_get_home_directory(PyObject *obj, void *closure)
2952 {
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;
2957 }
2958
2959 static int py_samr_UserInfo5_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
2960 {
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) {
2964                 PyErr_NoMemory();
2965                 return -1;
2966         }
2967         object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
2968         return 0;
2969 }
2970
2971 static PyObject *py_samr_UserInfo5_get_home_drive(PyObject *obj, void *closure)
2972 {
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;
2977 }
2978
2979 static int py_samr_UserInfo5_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
2980 {
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) {
2984                 PyErr_NoMemory();
2985                 return -1;
2986         }
2987         object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
2988         return 0;
2989 }
2990
2991 static PyObject *py_samr_UserInfo5_get_logon_script(PyObject *obj, void *closure)
2992 {
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;
2997 }
2998
2999 static int py_samr_UserInfo5_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
3000 {
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) {
3004                 PyErr_NoMemory();
3005                 return -1;
3006         }
3007         object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
3008         return 0;
3009 }
3010
3011 static PyObject *py_samr_UserInfo5_get_profile_path(PyObject *obj, void *closure)
3012 {
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;
3017 }
3018
3019 static int py_samr_UserInfo5_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
3020 {
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) {
3024                 PyErr_NoMemory();
3025                 return -1;
3026         }
3027         object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
3028         return 0;
3029 }
3030
3031 static PyObject *py_samr_UserInfo5_get_description(PyObject *obj, void *closure)
3032 {
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;
3037 }
3038
3039 static int py_samr_UserInfo5_set_description(PyObject *py_obj, PyObject *value, void *closure)
3040 {
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) {
3044                 PyErr_NoMemory();
3045                 return -1;
3046         }
3047         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3048         return 0;
3049 }
3050
3051 static PyObject *py_samr_UserInfo5_get_workstations(PyObject *obj, void *closure)
3052 {
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;
3057 }
3058
3059 static int py_samr_UserInfo5_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
3060 {
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) {
3064                 PyErr_NoMemory();
3065                 return -1;
3066         }
3067         object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
3068         return 0;
3069 }
3070
3071 static PyObject *py_samr_UserInfo5_get_last_logon(PyObject *obj, void *closure)
3072 {
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;
3077 }
3078
3079 static int py_samr_UserInfo5_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
3080 {
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);
3086         } else {
3087                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3088                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3089                 return -1;
3090         }
3091         return 0;
3092 }
3093
3094 static PyObject *py_samr_UserInfo5_get_last_logoff(PyObject *obj, void *closure)
3095 {
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;
3100 }
3101
3102 static int py_samr_UserInfo5_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
3103 {
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);
3109         } else {
3110                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3111                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3112                 return -1;
3113         }
3114         return 0;
3115 }
3116
3117 static PyObject *py_samr_UserInfo5_get_logon_hours(PyObject *obj, void *closure)
3118 {
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;
3123 }
3124
3125 static int py_samr_UserInfo5_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
3126 {
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) {
3130                 PyErr_NoMemory();
3131                 return -1;
3132         }
3133         object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
3134         return 0;
3135 }
3136
3137 static PyObject *py_samr_UserInfo5_get_bad_password_count(PyObject *obj, void *closure)
3138 {
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;
3143 }
3144
3145 static int py_samr_UserInfo5_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
3146 {
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);
3150         return 0;
3151 }
3152
3153 static PyObject *py_samr_UserInfo5_get_logon_count(PyObject *obj, void *closure)
3154 {
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;
3159 }
3160
3161 static int py_samr_UserInfo5_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
3162 {
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);
3166         return 0;
3167 }
3168
3169 static PyObject *py_samr_UserInfo5_get_last_password_change(PyObject *obj, void *closure)
3170 {
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;
3175 }
3176
3177 static int py_samr_UserInfo5_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
3178 {
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);
3184         } else {
3185                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3186                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3187                 return -1;
3188         }
3189         return 0;
3190 }
3191
3192 static PyObject *py_samr_UserInfo5_get_acct_expiry(PyObject *obj, void *closure)
3193 {
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;
3198 }
3199
3200 static int py_samr_UserInfo5_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
3201 {
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);
3207         } else {
3208                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3209                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3210                 return -1;
3211         }
3212         return 0;
3213 }
3214
3215 static PyObject *py_samr_UserInfo5_get_acct_flags(PyObject *obj, void *closure)
3216 {
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;
3221 }
3222
3223 static int py_samr_UserInfo5_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
3224 {
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);
3230         } else {
3231                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3232                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3233                 return -1;
3234         }
3235         return 0;
3236 }
3237
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 },
3257         { NULL }
3258 };
3259
3260 static PyObject *py_samr_UserInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3261 {
3262         return pytalloc_new(struct samr_UserInfo5, type);
3263 }
3264
3265
3266 static PyTypeObject samr_UserInfo5_Type = {
3267         PyObject_HEAD_INIT(NULL) 0,
3268         .tp_name = "samr.UserInfo5",
3269         .tp_getset = py_samr_UserInfo5_getsetters,
3270         .tp_methods = NULL,
3271         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3272         .tp_basicsize = sizeof(pytalloc_Object),
3273         .tp_new = py_samr_UserInfo5_new,
3274 };
3275
3276
3277 static PyObject *py_samr_UserInfo6_get_account_name(PyObject *obj, void *closure)
3278 {
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;
3283 }
3284
3285 static int py_samr_UserInfo6_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3286 {
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) {
3290                 PyErr_NoMemory();
3291                 return -1;
3292         }
3293         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3294         return 0;
3295 }
3296
3297 static PyObject *py_samr_UserInfo6_get_full_name(PyObject *obj, void *closure)
3298 {
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;
3303 }
3304
3305 static int py_samr_UserInfo6_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3306 {
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) {
3310                 PyErr_NoMemory();
3311                 return -1;
3312         }
3313         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3314         return 0;
3315 }
3316
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 },
3320         { NULL }
3321 };
3322
3323 static PyObject *py_samr_UserInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3324 {
3325         return pytalloc_new(struct samr_UserInfo6, type);
3326 }
3327
3328
3329 static PyTypeObject samr_UserInfo6_Type = {
3330         PyObject_HEAD_INIT(NULL) 0,
3331         .tp_name = "samr.UserInfo6",
3332         .tp_getset = py_samr_UserInfo6_getsetters,
3333         .tp_methods = NULL,
3334         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3335         .tp_basicsize = sizeof(pytalloc_Object),
3336         .tp_new = py_samr_UserInfo6_new,
3337 };
3338
3339
3340 static PyObject *py_samr_UserInfo7_get_account_name(PyObject *obj, void *closure)
3341 {
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;
3346 }
3347
3348 static int py_samr_UserInfo7_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
3349 {
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) {
3353                 PyErr_NoMemory();
3354                 return -1;
3355         }
3356         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3357         return 0;
3358 }
3359
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 },
3362         { NULL }
3363 };
3364
3365 static PyObject *py_samr_UserInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3366 {
3367         return pytalloc_new(struct samr_UserInfo7, type);
3368 }
3369
3370
3371 static PyTypeObject samr_UserInfo7_Type = {
3372         PyObject_HEAD_INIT(NULL) 0,
3373         .tp_name = "samr.UserInfo7",
3374         .tp_getset = py_samr_UserInfo7_getsetters,
3375         .tp_methods = NULL,
3376         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3377         .tp_basicsize = sizeof(pytalloc_Object),
3378         .tp_new = py_samr_UserInfo7_new,
3379 };
3380
3381
3382 static PyObject *py_samr_UserInfo8_get_full_name(PyObject *obj, void *closure)
3383 {
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;
3388 }
3389
3390 static int py_samr_UserInfo8_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
3391 {
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) {
3395                 PyErr_NoMemory();
3396                 return -1;
3397         }
3398         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
3399         return 0;
3400 }
3401
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 },
3404         { NULL }
3405 };
3406
3407 static PyObject *py_samr_UserInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3408 {
3409         return pytalloc_new(struct samr_UserInfo8, type);
3410 }
3411
3412
3413 static PyTypeObject samr_UserInfo8_Type = {
3414         PyObject_HEAD_INIT(NULL) 0,
3415         .tp_name = "samr.UserInfo8",
3416         .tp_getset = py_samr_UserInfo8_getsetters,
3417         .tp_methods = NULL,
3418         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3419         .tp_basicsize = sizeof(pytalloc_Object),
3420         .tp_new = py_samr_UserInfo8_new,
3421 };
3422
3423
3424 static PyObject *py_samr_UserInfo9_get_primary_gid(PyObject *obj, void *closure)
3425 {
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;
3430 }
3431
3432 static int py_samr_UserInfo9_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
3433 {
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);
3437         return 0;
3438 }
3439
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 },
3442         { NULL }
3443 };
3444
3445 static PyObject *py_samr_UserInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3446 {
3447         return pytalloc_new(struct samr_UserInfo9, type);
3448 }
3449
3450
3451 static PyTypeObject samr_UserInfo9_Type = {
3452         PyObject_HEAD_INIT(NULL) 0,
3453         .tp_name = "samr.UserInfo9",
3454         .tp_getset = py_samr_UserInfo9_getsetters,
3455         .tp_methods = NULL,
3456         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3457         .tp_basicsize = sizeof(pytalloc_Object),
3458         .tp_new = py_samr_UserInfo9_new,
3459 };
3460
3461
3462 static PyObject *py_samr_UserInfo10_get_home_directory(PyObject *obj, void *closure)
3463 {
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;
3468 }
3469
3470 static int py_samr_UserInfo10_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
3471 {
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) {
3475                 PyErr_NoMemory();
3476                 return -1;
3477         }
3478         object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
3479         return 0;
3480 }
3481
3482 static PyObject *py_samr_UserInfo10_get_home_drive(PyObject *obj, void *closure)
3483 {
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;
3488 }
3489
3490 static int py_samr_UserInfo10_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
3491 {
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) {
3495                 PyErr_NoMemory();
3496                 return -1;
3497         }
3498         object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
3499         return 0;
3500 }
3501
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 },
3505         { NULL }
3506 };
3507
3508 static PyObject *py_samr_UserInfo10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3509 {
3510         return pytalloc_new(struct samr_UserInfo10, type);
3511 }
3512
3513
3514 static PyTypeObject samr_UserInfo10_Type = {
3515         PyObject_HEAD_INIT(NULL) 0,
3516         .tp_name = "samr.UserInfo10",
3517         .tp_getset = py_samr_UserInfo10_getsetters,
3518         .tp_methods = NULL,
3519         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3520         .tp_basicsize = sizeof(pytalloc_Object),
3521         .tp_new = py_samr_UserInfo10_new,
3522 };
3523
3524
3525 static PyObject *py_samr_UserInfo11_get_logon_script(PyObject *obj, void *closure)
3526 {
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;
3531 }
3532
3533 static int py_samr_UserInfo11_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
3534 {
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) {
3538                 PyErr_NoMemory();
3539                 return -1;
3540         }
3541         object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
3542         return 0;
3543 }
3544
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 },
3547         { NULL }
3548 };
3549
3550 static PyObject *py_samr_UserInfo11_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3551 {
3552         return pytalloc_new(struct samr_UserInfo11, type);
3553 }
3554
3555
3556 static PyTypeObject samr_UserInfo11_Type = {
3557         PyObject_HEAD_INIT(NULL) 0,
3558         .tp_name = "samr.UserInfo11",
3559         .tp_getset = py_samr_UserInfo11_getsetters,
3560         .tp_methods = NULL,
3561         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3562         .tp_basicsize = sizeof(pytalloc_Object),
3563         .tp_new = py_samr_UserInfo11_new,
3564 };
3565
3566
3567 static PyObject *py_samr_UserInfo12_get_profile_path(PyObject *obj, void *closure)
3568 {
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;
3573 }
3574
3575 static int py_samr_UserInfo12_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
3576 {
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) {
3580                 PyErr_NoMemory();
3581                 return -1;
3582         }
3583         object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
3584         return 0;
3585 }
3586
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 },
3589         { NULL }
3590 };
3591
3592 static PyObject *py_samr_UserInfo12_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3593 {
3594         return pytalloc_new(struct samr_UserInfo12, type);
3595 }
3596
3597
3598 static PyTypeObject samr_UserInfo12_Type = {
3599         PyObject_HEAD_INIT(NULL) 0,
3600         .tp_name = "samr.UserInfo12",
3601         .tp_getset = py_samr_UserInfo12_getsetters,
3602         .tp_methods = NULL,
3603         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3604         .tp_basicsize = sizeof(pytalloc_Object),
3605         .tp_new = py_samr_UserInfo12_new,
3606 };
3607
3608
3609 static PyObject *py_samr_UserInfo13_get_description(PyObject *obj, void *closure)
3610 {
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;
3615 }
3616
3617 static int py_samr_UserInfo13_set_description(PyObject *py_obj, PyObject *value, void *closure)
3618 {
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) {
3622                 PyErr_NoMemory();
3623                 return -1;
3624         }
3625         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
3626         return 0;
3627 }
3628
3629 static PyGetSetDef py_samr_UserInfo13_getsetters[] = {
3630         { discard_const_p(char, "description"), py_samr_UserInfo13_get_description, py_samr_UserInfo13_set_description },
3631         { NULL }
3632 };
3633
3634 static PyObject *py_samr_UserInfo13_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3635 {
3636         return pytalloc_new(struct samr_UserInfo13, type);
3637 }
3638
3639
3640 static PyTypeObject samr_UserInfo13_Type = {
3641         PyObject_HEAD_INIT(NULL) 0,
3642         .tp_name = "samr.UserInfo13",
3643         .tp_getset = py_samr_UserInfo13_getsetters,
3644         .tp_methods = NULL,
3645         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3646         .tp_basicsize = sizeof(pytalloc_Object),
3647         .tp_new = py_samr_UserInfo13_new,
3648 };
3649
3650
3651 static PyObject *py_samr_UserInfo14_get_workstations(PyObject *obj, void *closure)
3652 {
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;
3657 }
3658
3659 static int py_samr_UserInfo14_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
3660 {
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) {
3664                 PyErr_NoMemory();
3665                 return -1;
3666         }
3667         object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
3668         return 0;
3669 }
3670
3671 static PyGetSetDef py_samr_UserInfo14_getsetters[] = {
3672         { discard_const_p(char, "workstations"), py_samr_UserInfo14_get_workstations, py_samr_UserInfo14_set_workstations },
3673         { NULL }
3674 };
3675
3676 static PyObject *py_samr_UserInfo14_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3677 {
3678         return pytalloc_new(struct samr_UserInfo14, type);
3679 }
3680
3681
3682 static PyTypeObject samr_UserInfo14_Type = {
3683         PyObject_HEAD_INIT(NULL) 0,
3684         .tp_name = "samr.UserInfo14",
3685         .tp_getset = py_samr_UserInfo14_getsetters,
3686         .tp_methods = NULL,
3687         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3688         .tp_basicsize = sizeof(pytalloc_Object),
3689         .tp_new = py_samr_UserInfo14_new,
3690 };
3691
3692
3693 static PyObject *py_samr_UserInfo16_get_acct_flags(PyObject *obj, void *closure)
3694 {
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;
3699 }
3700
3701 static int py_samr_UserInfo16_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
3702 {
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);
3708         } else {
3709                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3710                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3711                 return -1;
3712         }
3713         return 0;
3714 }
3715
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 },
3718         { NULL }
3719 };
3720
3721 static PyObject *py_samr_UserInfo16_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3722 {
3723         return pytalloc_new(struct samr_UserInfo16, type);
3724 }
3725
3726
3727 static PyTypeObject samr_UserInfo16_Type = {
3728         PyObject_HEAD_INIT(NULL) 0,
3729         .tp_name = "samr.UserInfo16",
3730         .tp_getset = py_samr_UserInfo16_getsetters,
3731         .tp_methods = NULL,
3732         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3733         .tp_basicsize = sizeof(pytalloc_Object),
3734         .tp_new = py_samr_UserInfo16_new,
3735 };
3736
3737
3738 static PyObject *py_samr_UserInfo17_get_acct_expiry(PyObject *obj, void *closure)
3739 {
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;
3744 }
3745
3746 static int py_samr_UserInfo17_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
3747 {
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);
3753         } else {
3754                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
3755                   PyInt_Type.tp_name, PyLong_Type.tp_name);
3756                 return -1;
3757         }
3758         return 0;
3759 }
3760
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 },
3763         { NULL }
3764 };
3765
3766 static PyObject *py_samr_UserInfo17_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3767 {
3768         return pytalloc_new(struct samr_UserInfo17, type);
3769 }
3770
3771
3772 static PyTypeObject samr_UserInfo17_Type = {
3773         PyObject_HEAD_INIT(NULL) 0,
3774         .tp_name = "samr.UserInfo17",
3775         .tp_getset = py_samr_UserInfo17_getsetters,
3776         .tp_methods = NULL,
3777         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
3778         .tp_basicsize = sizeof(pytalloc_Object),
3779         .tp_new = py_samr_UserInfo17_new,
3780 };
3781
3782
3783 static PyObject *py_samr_Password_get_hash(PyObject *obj, void *closure)
3784 {
3785         struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(obj);
3786         PyObject *py_hash;
3787         py_hash = PyList_New(16);
3788         if (py_hash == NULL) {
3789                 return NULL;
3790         }
3791         {
3792                 int hash_cntr_0;
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);
3797                 }
3798         }
3799         return py_hash;
3800 }
3801
3802 static int py_samr_Password_set_hash(PyObject *py_obj, PyObject *value, void *closure)
3803 {
3804         struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3805         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
3806         {
3807                 int hash_cntr_0;
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));
3811                 }
3812         }
3813         return 0;
3814 }
3815
3816 static PyGetSetDef py_samr_Password_getsetters[] = {
3817         { discard_const_p(char, "hash"), py_samr_Password_get_hash, py_samr_Password_set_hash },
3818         { NULL }
3819 };
3820
3821 static PyObject *py_samr_Password_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
3822 {
3823         return pytalloc_new(struct samr_Password, type);
3824 }
3825
3826 static PyObject *py_samr_Password_ndr_pack(PyObject *py_obj)
3827 {
3828         struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3829         DATA_BLOB blob;
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);
3834                 return NULL;
3835         }
3836
3837         return PyString_FromStringAndSize((char *)blob.data, blob.length);
3838 }
3839
3840 static PyObject *py_samr_Password_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
3841 {
3842         struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3843         DATA_BLOB blob;
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;
3849
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)) {
3854                 return NULL;
3855         }
3856         blob.length = blob_length;
3857
3858         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
3859                 allow_remaining = true;
3860         }
3861
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);
3864         } else {
3865                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_Password);
3866         }
3867         if (err != NDR_ERR_SUCCESS) {
3868                 PyErr_SetNdrError(err);
3869                 return NULL;
3870         }
3871
3872         Py_RETURN_NONE;
3873 }
3874
3875 static PyObject *py_samr_Password_ndr_print(PyObject *py_obj)
3876 {
3877         struct samr_Password *object = (struct samr_Password *)pytalloc_get_ptr(py_obj);
3878         PyObject *ret;
3879         char *retstr;
3880
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);
3884
3885         return ret;
3886 }
3887
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 }
3893 };
3894
3895
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,
3904 };
3905
3906
3907 static PyObject *py_samr_UserInfo18_get_nt_pwd(PyObject *obj, void *closure)
3908 {
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);
3912         return py_nt_pwd;
3913 }
3914
3915 static int py_samr_UserInfo18_set_nt_pwd(PyObject *py_obj, PyObject *value, void *closure)
3916 {
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) {
3920                 PyErr_NoMemory();
3921                 return -1;
3922         }
3923         object->nt_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
3924         return 0;
3925 }
3926
3927 static PyObject *py_samr_UserInfo18_get_lm_pwd(PyObject *obj, void *closure)
3928 {
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);
3932         return py_lm_pwd;
3933 }
3934
3935 static int py_samr_UserInfo18_set_lm_pwd(PyObject *py_obj, PyObject *value, void *closure)
3936 {
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) {
3940                 PyErr_NoMemory();
3941                 return -1;
3942         }
3943         object->lm_pwd = *(struct samr_Password *)pytalloc_get_ptr(value);
3944         return 0;
3945 }
3946
3947 static PyObject *py_samr_UserInfo18_get_nt_pwd_active(PyObject *obj, void *closure)
3948 {
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;
3953 }
3954
3955 static int py_samr_UserInfo18_set_nt_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
3956 {
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);
3960         return 0;
3961 }
3962
3963 static PyObject *py_samr_UserInfo18_get_lm_pwd_active(PyObject *obj, void *closure)
3964 {
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;
3969 }
3970
3971 static int py_samr_UserInfo18_set_lm_pwd_active(PyObject *py_obj, PyObject *value, void *closure)
3972 {
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);
3976         return 0;
3977 }
3978
3979 static PyObject *py_samr_UserInfo18_get_password_expired(PyObject *obj, void *closure)
3980 {
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;
3985 }
3986
3987 static int py_samr_UserInfo18_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
3988 {
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);
3992         return 0;
3993 }
3994
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 },
4001         { NULL }
4002 };
4003
4004 static PyObject *py_samr_UserInfo18_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4005 {
4006         return pytalloc_new(struct samr_UserInfo18, type);
4007 }
4008
4009
4010 static PyTypeObject samr_UserInfo18_Type = {
4011         PyObject_HEAD_INIT(NULL) 0,
4012         .tp_name = "samr.UserInfo18",
4013         .tp_getset = py_samr_UserInfo18_getsetters,
4014         .tp_methods = NULL,
4015         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4016         .tp_basicsize = sizeof(pytalloc_Object),
4017         .tp_new = py_samr_UserInfo18_new,
4018 };
4019
4020
4021 static PyObject *py_samr_UserInfo20_get_parameters(PyObject *obj, void *closure)
4022 {
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;
4027 }
4028
4029 static int py_samr_UserInfo20_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
4030 {
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) {
4034                 PyErr_NoMemory();
4035                 return -1;
4036         }
4037         object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4038         return 0;
4039 }
4040
4041 static PyGetSetDef py_samr_UserInfo20_getsetters[] = {
4042         { discard_const_p(char, "parameters"), py_samr_UserInfo20_get_parameters, py_samr_UserInfo20_set_parameters },
4043         { NULL }
4044 };
4045
4046 static PyObject *py_samr_UserInfo20_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4047 {
4048         return pytalloc_new(struct samr_UserInfo20, type);
4049 }
4050
4051
4052 static PyTypeObject samr_UserInfo20_Type = {
4053         PyObject_HEAD_INIT(NULL) 0,
4054         .tp_name = "samr.UserInfo20",
4055         .tp_getset = py_samr_UserInfo20_getsetters,
4056         .tp_methods = NULL,
4057         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4058         .tp_basicsize = sizeof(pytalloc_Object),
4059         .tp_new = py_samr_UserInfo20_new,
4060 };
4061
4062
4063 static PyObject *py_samr_UserInfo21_get_last_logon(PyObject *obj, void *closure)
4064 {
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;
4069 }
4070
4071 static int py_samr_UserInfo21_set_last_logon(PyObject *py_obj, PyObject *value, void *closure)
4072 {
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);
4078         } else {
4079                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4080                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4081                 return -1;
4082         }
4083         return 0;
4084 }
4085
4086 static PyObject *py_samr_UserInfo21_get_last_logoff(PyObject *obj, void *closure)
4087 {
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;
4092 }
4093
4094 static int py_samr_UserInfo21_set_last_logoff(PyObject *py_obj, PyObject *value, void *closure)
4095 {
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);
4101         } else {
4102                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4103                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4104                 return -1;
4105         }
4106         return 0;
4107 }
4108
4109 static PyObject *py_samr_UserInfo21_get_last_password_change(PyObject *obj, void *closure)
4110 {
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;
4115 }
4116
4117 static int py_samr_UserInfo21_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
4118 {
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);
4124         } else {
4125                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4126                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4127                 return -1;
4128         }
4129         return 0;
4130 }
4131
4132 static PyObject *py_samr_UserInfo21_get_acct_expiry(PyObject *obj, void *closure)
4133 {
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;
4138 }
4139
4140 static int py_samr_UserInfo21_set_acct_expiry(PyObject *py_obj, PyObject *value, void *closure)
4141 {
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);
4147         } else {
4148                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4149                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4150                 return -1;
4151         }
4152         return 0;
4153 }
4154
4155 static PyObject *py_samr_UserInfo21_get_allow_password_change(PyObject *obj, void *closure)
4156 {
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;
4161 }
4162
4163 static int py_samr_UserInfo21_set_allow_password_change(PyObject *py_obj, PyObject *value, void *closure)
4164 {
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);
4170         } else {
4171                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4172                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4173                 return -1;
4174         }
4175         return 0;
4176 }
4177
4178 static PyObject *py_samr_UserInfo21_get_force_password_change(PyObject *obj, void *closure)
4179 {
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;
4184 }
4185
4186 static int py_samr_UserInfo21_set_force_password_change(PyObject *py_obj, PyObject *value, void *closure)
4187 {
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);
4193         } else {
4194                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4195                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4196                 return -1;
4197         }
4198         return 0;
4199 }
4200
4201 static PyObject *py_samr_UserInfo21_get_account_name(PyObject *obj, void *closure)
4202 {
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;
4207 }
4208
4209 static int py_samr_UserInfo21_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
4210 {
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) {
4214                 PyErr_NoMemory();
4215                 return -1;
4216         }
4217         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4218         return 0;
4219 }
4220
4221 static PyObject *py_samr_UserInfo21_get_full_name(PyObject *obj, void *closure)
4222 {
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;
4227 }
4228
4229 static int py_samr_UserInfo21_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
4230 {
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) {
4234                 PyErr_NoMemory();
4235                 return -1;
4236         }
4237         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
4238         return 0;
4239 }
4240
4241 static PyObject *py_samr_UserInfo21_get_home_directory(PyObject *obj, void *closure)
4242 {
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;
4247 }
4248
4249 static int py_samr_UserInfo21_set_home_directory(PyObject *py_obj, PyObject *value, void *closure)
4250 {
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) {
4254                 PyErr_NoMemory();
4255                 return -1;
4256         }
4257         object->home_directory = *(struct lsa_String *)pytalloc_get_ptr(value);
4258         return 0;
4259 }
4260
4261 static PyObject *py_samr_UserInfo21_get_home_drive(PyObject *obj, void *closure)
4262 {
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;
4267 }
4268
4269 static int py_samr_UserInfo21_set_home_drive(PyObject *py_obj, PyObject *value, void *closure)
4270 {
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) {
4274                 PyErr_NoMemory();
4275                 return -1;
4276         }
4277         object->home_drive = *(struct lsa_String *)pytalloc_get_ptr(value);
4278         return 0;
4279 }
4280
4281 static PyObject *py_samr_UserInfo21_get_logon_script(PyObject *obj, void *closure)
4282 {
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;
4287 }
4288
4289 static int py_samr_UserInfo21_set_logon_script(PyObject *py_obj, PyObject *value, void *closure)
4290 {
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) {
4294                 PyErr_NoMemory();
4295                 return -1;
4296         }
4297         object->logon_script = *(struct lsa_String *)pytalloc_get_ptr(value);
4298         return 0;
4299 }
4300
4301 static PyObject *py_samr_UserInfo21_get_profile_path(PyObject *obj, void *closure)
4302 {
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;
4307 }
4308
4309 static int py_samr_UserInfo21_set_profile_path(PyObject *py_obj, PyObject *value, void *closure)
4310 {
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) {
4314                 PyErr_NoMemory();
4315                 return -1;
4316         }
4317         object->profile_path = *(struct lsa_String *)pytalloc_get_ptr(value);
4318         return 0;
4319 }
4320
4321 static PyObject *py_samr_UserInfo21_get_description(PyObject *obj, void *closure)
4322 {
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;
4327 }
4328
4329 static int py_samr_UserInfo21_set_description(PyObject *py_obj, PyObject *value, void *closure)
4330 {
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) {
4334                 PyErr_NoMemory();
4335                 return -1;
4336         }
4337         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
4338         return 0;
4339 }
4340
4341 static PyObject *py_samr_UserInfo21_get_workstations(PyObject *obj, void *closure)
4342 {
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;
4347 }
4348
4349 static int py_samr_UserInfo21_set_workstations(PyObject *py_obj, PyObject *value, void *closure)
4350 {
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) {
4354                 PyErr_NoMemory();
4355                 return -1;
4356         }
4357         object->workstations = *(struct lsa_String *)pytalloc_get_ptr(value);
4358         return 0;
4359 }
4360
4361 static PyObject *py_samr_UserInfo21_get_comment(PyObject *obj, void *closure)
4362 {
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);
4366         return py_comment;
4367 }
4368
4369 static int py_samr_UserInfo21_set_comment(PyObject *py_obj, PyObject *value, void *closure)
4370 {
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) {
4374                 PyErr_NoMemory();
4375                 return -1;
4376         }
4377         object->comment = *(struct lsa_String *)pytalloc_get_ptr(value);
4378         return 0;
4379 }
4380
4381 static PyObject *py_samr_UserInfo21_get_parameters(PyObject *obj, void *closure)
4382 {
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;
4387 }
4388
4389 static int py_samr_UserInfo21_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
4390 {
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) {
4394                 PyErr_NoMemory();
4395                 return -1;
4396         }
4397         object->parameters = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4398         return 0;
4399 }
4400
4401 static PyObject *py_samr_UserInfo21_get_lm_owf_password(PyObject *obj, void *closure)
4402 {
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;
4407 }
4408
4409 static int py_samr_UserInfo21_set_lm_owf_password(PyObject *py_obj, PyObject *value, void *closure)
4410 {
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) {
4414                 PyErr_NoMemory();
4415                 return -1;
4416         }
4417         object->lm_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4418         return 0;
4419 }
4420
4421 static PyObject *py_samr_UserInfo21_get_nt_owf_password(PyObject *obj, void *closure)
4422 {
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;
4427 }
4428
4429 static int py_samr_UserInfo21_set_nt_owf_password(PyObject *py_obj, PyObject *value, void *closure)
4430 {
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) {
4434                 PyErr_NoMemory();
4435                 return -1;
4436         }
4437         object->nt_owf_password = *(struct lsa_BinaryString *)pytalloc_get_ptr(value);
4438         return 0;
4439 }
4440
4441 static PyObject *py_samr_UserInfo21_get_private_data(PyObject *obj, void *closure)
4442 {
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;
4447 }
4448
4449 static int py_samr_UserInfo21_set_private_data(PyObject *py_obj, PyObject *value, void *closure)
4450 {
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) {
4454                 PyErr_NoMemory();
4455                 return -1;
4456         }
4457         object->private_data = *(struct lsa_String *)pytalloc_get_ptr(value);
4458         return 0;
4459 }
4460
4461 static PyObject *py_samr_UserInfo21_get_buf_count(PyObject *obj, void *closure)
4462 {
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;
4467 }
4468
4469 static int py_samr_UserInfo21_set_buf_count(PyObject *py_obj, PyObject *value, void *closure)
4470 {
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);
4474         return 0;
4475 }
4476
4477 static PyObject *py_samr_UserInfo21_get_buffer(PyObject *obj, void *closure)
4478 {
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);
4484         } else {
4485                 py_buffer = PyList_New(object->buf_count);
4486                 if (py_buffer == NULL) {
4487                         return NULL;
4488                 }
4489                 {
4490                         int buffer_cntr_1;
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);
4495                         }
4496                 }
4497         }
4498         return py_buffer;
4499 }
4500
4501 static int py_samr_UserInfo21_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
4502 {
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;
4507         } else {
4508                 object->buffer = NULL;
4509                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4510                 {
4511                         int buffer_cntr_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));
4518                         }
4519                 }
4520         }
4521         return 0;
4522 }
4523
4524 static PyObject *py_samr_UserInfo21_get_rid(PyObject *obj, void *closure)
4525 {
4526         struct samr_UserInfo21 *object = (struct samr_UserInfo21 *)pytalloc_get_ptr(obj);
4527         PyObject *py_rid;
4528         py_rid = PyInt_FromLong(object->rid);
4529         return py_rid;
4530 }
4531
4532 static int py_samr_UserInfo21_set_rid(PyObject *py_obj, PyObject *value, void *closure)
4533 {
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);
4537         return 0;
4538 }
4539
4540 static PyObject *py_samr_UserInfo21_get_primary_gid(PyObject *obj, void *closure)
4541 {
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;
4546 }
4547
4548 static int py_samr_UserInfo21_set_primary_gid(PyObject *py_obj, PyObject *value, void *closure)
4549 {
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);
4553         return 0;
4554 }
4555
4556 static PyObject *py_samr_UserInfo21_get_acct_flags(PyObject *obj, void *closure)
4557 {
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;
4562 }
4563
4564 static int py_samr_UserInfo21_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
4565 {
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);
4571         } else {
4572                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4573                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4574                 return -1;
4575         }
4576         return 0;
4577 }
4578
4579 static PyObject *py_samr_UserInfo21_get_fields_present(PyObject *obj, void *closure)
4580 {
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;
4585 }
4586
4587 static int py_samr_UserInfo21_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
4588 {
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);
4594         } else {
4595                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
4596                   PyInt_Type.tp_name, PyLong_Type.tp_name);
4597                 return -1;
4598         }
4599         return 0;
4600 }
4601
4602 static PyObject *py_samr_UserInfo21_get_logon_hours(PyObject *obj, void *closure)
4603 {
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;
4608 }
4609
4610 static int py_samr_UserInfo21_set_logon_hours(PyObject *py_obj, PyObject *value, void *closure)
4611 {
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) {
4615                 PyErr_NoMemory();
4616                 return -1;
4617         }
4618         object->logon_hours = *(struct samr_LogonHours *)pytalloc_get_ptr(value);
4619         return 0;
4620 }
4621
4622 static PyObject *py_samr_UserInfo21_get_bad_password_count(PyObject *obj, void *closure)
4623 {
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;
4628 }
4629
4630 static int py_samr_UserInfo21_set_bad_password_count(PyObject *py_obj, PyObject *value, void *closure)
4631 {
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);
4635         return 0;
4636 }
4637
4638 static PyObject *py_samr_UserInfo21_get_logon_count(PyObject *obj, void *closure)
4639 {
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;
4644 }
4645
4646 static int py_samr_UserInfo21_set_logon_count(PyObject *py_obj, PyObject *value, void *closure)
4647 {
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);
4651         return 0;
4652 }
4653
4654 static PyObject *py_samr_UserInfo21_get_country_code(PyObject *obj, void *closure)
4655 {
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;
4660 }
4661
4662 static int py_samr_UserInfo21_set_country_code(PyObject *py_obj, PyObject *value, void *closure)
4663 {
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);
4667         return 0;
4668 }
4669
4670 static PyObject *py_samr_UserInfo21_get_code_page(PyObject *obj, void *closure)
4671 {
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;
4676 }
4677
4678 static int py_samr_UserInfo21_set_code_page(PyObject *py_obj, PyObject *value, void *closure)
4679 {
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);
4683         return 0;
4684 }
4685
4686 static PyObject *py_samr_UserInfo21_get_lm_password_set(PyObject *obj, void *closure)
4687 {
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;
4692 }
4693
4694 static int py_samr_UserInfo21_set_lm_password_set(PyObject *py_obj, PyObject *value, void *closure)
4695 {
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);
4699         return 0;
4700 }
4701
4702 static PyObject *py_samr_UserInfo21_get_nt_password_set(PyObject *obj, void *closure)
4703 {
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;
4708 }
4709
4710 static int py_samr_UserInfo21_set_nt_password_set(PyObject *py_obj, PyObject *value, void *closure)
4711 {
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);
4715         return 0;
4716 }
4717
4718 static PyObject *py_samr_UserInfo21_get_password_expired(PyObject *obj, void *closure)
4719 {
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;
4724 }
4725
4726 static int py_samr_UserInfo21_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
4727 {
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);
4731         return 0;
4732 }
4733
4734 static PyObject *py_samr_UserInfo21_get_private_data_sensitive(PyObject *obj, void *closure)
4735 {
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;
4740 }
4741
4742 static int py_samr_UserInfo21_set_private_data_sensitive(PyObject *py_obj, PyObject *value, void *closure)
4743 {
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);
4747         return 0;
4748 }
4749
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 },
4785         { NULL }
4786 };
4787
4788 static PyObject *py_samr_UserInfo21_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4789 {
4790         return pytalloc_new(struct samr_UserInfo21, type);
4791 }
4792
4793
4794 static PyTypeObject samr_UserInfo21_Type = {
4795         PyObject_HEAD_INIT(NULL) 0,
4796         .tp_name = "samr.UserInfo21",
4797         .tp_getset = py_samr_UserInfo21_getsetters,
4798         .tp_methods = NULL,
4799         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4800         .tp_basicsize = sizeof(pytalloc_Object),
4801         .tp_new = py_samr_UserInfo21_new,
4802 };
4803
4804
4805 static PyObject *py_samr_CryptPassword_get_data(PyObject *obj, void *closure)
4806 {
4807         struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(obj);
4808         PyObject *py_data;
4809         py_data = PyList_New(516);
4810         if (py_data == NULL) {
4811                 return NULL;
4812         }
4813         {
4814                 int data_cntr_0;
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);
4819                 }
4820         }
4821         return py_data;
4822 }
4823
4824 static int py_samr_CryptPassword_set_data(PyObject *py_obj, PyObject *value, void *closure)
4825 {
4826         struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4827         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
4828         {
4829                 int data_cntr_0;
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));
4833                 }
4834         }
4835         return 0;
4836 }
4837
4838 static PyGetSetDef py_samr_CryptPassword_getsetters[] = {
4839         { discard_const_p(char, "data"), py_samr_CryptPassword_get_data, py_samr_CryptPassword_set_data },
4840         { NULL }
4841 };
4842
4843 static PyObject *py_samr_CryptPassword_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4844 {
4845         return pytalloc_new(struct samr_CryptPassword, type);
4846 }
4847
4848 static PyObject *py_samr_CryptPassword_ndr_pack(PyObject *py_obj)
4849 {
4850         struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4851         DATA_BLOB blob;
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);
4856                 return NULL;
4857         }
4858
4859         return PyString_FromStringAndSize((char *)blob.data, blob.length);
4860 }
4861
4862 static PyObject *py_samr_CryptPassword_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
4863 {
4864         struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4865         DATA_BLOB blob;
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;
4871
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)) {
4876                 return NULL;
4877         }
4878         blob.length = blob_length;
4879
4880         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
4881                 allow_remaining = true;
4882         }
4883
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);
4886         } else {
4887                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_CryptPassword);
4888         }
4889         if (err != NDR_ERR_SUCCESS) {
4890                 PyErr_SetNdrError(err);
4891                 return NULL;
4892         }
4893
4894         Py_RETURN_NONE;
4895 }
4896
4897 static PyObject *py_samr_CryptPassword_ndr_print(PyObject *py_obj)
4898 {
4899         struct samr_CryptPassword *object = (struct samr_CryptPassword *)pytalloc_get_ptr(py_obj);
4900         PyObject *ret;
4901         char *retstr;
4902
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);
4906
4907         return ret;
4908 }
4909
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 }
4915 };
4916
4917
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,
4926 };
4927
4928
4929 static PyObject *py_samr_UserInfo23_get_info(PyObject *obj, void *closure)
4930 {
4931         struct samr_UserInfo23 *object = (struct samr_UserInfo23 *)pytalloc_get_ptr(obj);
4932         PyObject *py_info;
4933         py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
4934         return py_info;
4935 }
4936
4937 static int py_samr_UserInfo23_set_info(PyObject *py_obj, PyObject *value, void *closure)
4938 {
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) {
4942                 PyErr_NoMemory();
4943                 return -1;
4944         }
4945         object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
4946         return 0;
4947 }
4948
4949 static PyObject *py_samr_UserInfo23_get_password(PyObject *obj, void *closure)
4950 {
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);
4954         return py_password;
4955 }
4956
4957 static int py_samr_UserInfo23_set_password(PyObject *py_obj, PyObject *value, void *closure)
4958 {
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) {
4962                 PyErr_NoMemory();
4963                 return -1;
4964         }
4965         object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
4966         return 0;
4967 }
4968
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 },
4972         { NULL }
4973 };
4974
4975 static PyObject *py_samr_UserInfo23_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
4976 {
4977         return pytalloc_new(struct samr_UserInfo23, type);
4978 }
4979
4980
4981 static PyTypeObject samr_UserInfo23_Type = {
4982         PyObject_HEAD_INIT(NULL) 0,
4983         .tp_name = "samr.UserInfo23",
4984         .tp_getset = py_samr_UserInfo23_getsetters,
4985         .tp_methods = NULL,
4986         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
4987         .tp_basicsize = sizeof(pytalloc_Object),
4988         .tp_new = py_samr_UserInfo23_new,
4989 };
4990
4991
4992 static PyObject *py_samr_UserInfo24_get_password(PyObject *obj, void *closure)
4993 {
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);
4997         return py_password;
4998 }
4999
5000 static int py_samr_UserInfo24_set_password(PyObject *py_obj, PyObject *value, void *closure)
5001 {
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) {
5005                 PyErr_NoMemory();
5006                 return -1;
5007         }
5008         object->password = *(struct samr_CryptPassword *)pytalloc_get_ptr(value);
5009         return 0;
5010 }
5011
5012 static PyObject *py_samr_UserInfo24_get_password_expired(PyObject *obj, void *closure)
5013 {
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;
5018 }
5019
5020 static int py_samr_UserInfo24_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
5021 {
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);
5025         return 0;
5026 }
5027
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 },
5031         { NULL }
5032 };
5033
5034 static PyObject *py_samr_UserInfo24_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5035 {
5036         return pytalloc_new(struct samr_UserInfo24, type);
5037 }
5038
5039
5040 static PyTypeObject samr_UserInfo24_Type = {
5041         PyObject_HEAD_INIT(NULL) 0,
5042         .tp_name = "samr.UserInfo24",
5043         .tp_getset = py_samr_UserInfo24_getsetters,
5044         .tp_methods = NULL,
5045         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5046         .tp_basicsize = sizeof(pytalloc_Object),
5047         .tp_new = py_samr_UserInfo24_new,
5048 };
5049
5050
5051 static PyObject *py_samr_CryptPasswordEx_get_data(PyObject *obj, void *closure)
5052 {
5053         struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(obj);
5054         PyObject *py_data;
5055         py_data = PyList_New(532);
5056         if (py_data == NULL) {
5057                 return NULL;
5058         }
5059         {
5060                 int data_cntr_0;
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);
5065                 }
5066         }
5067         return py_data;
5068 }
5069
5070 static int py_samr_CryptPasswordEx_set_data(PyObject *py_obj, PyObject *value, void *closure)
5071 {
5072         struct samr_CryptPasswordEx *object = (struct samr_CryptPasswordEx *)pytalloc_get_ptr(py_obj);
5073         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5074         {
5075                 int data_cntr_0;
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));
5079                 }
5080         }
5081         return 0;
5082 }
5083
5084 static PyGetSetDef py_samr_CryptPasswordEx_getsetters[] = {
5085         { discard_const_p(char, "data"), py_samr_CryptPasswordEx_get_data, py_samr_CryptPasswordEx_set_data },
5086         { NULL }
5087 };
5088
5089 static PyObject *py_samr_CryptPasswordEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5090 {
5091         return pytalloc_new(struct samr_CryptPasswordEx, type);
5092 }
5093
5094
5095 static PyTypeObject samr_CryptPasswordEx_Type = {
5096         PyObject_HEAD_INIT(NULL) 0,
5097         .tp_name = "samr.CryptPasswordEx",
5098         .tp_getset = py_samr_CryptPasswordEx_getsetters,
5099         .tp_methods = NULL,
5100         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5101         .tp_basicsize = sizeof(pytalloc_Object),
5102         .tp_new = py_samr_CryptPasswordEx_new,
5103 };
5104
5105
5106 static PyObject *py_samr_UserInfo25_get_info(PyObject *obj, void *closure)
5107 {
5108         struct samr_UserInfo25 *object = (struct samr_UserInfo25 *)pytalloc_get_ptr(obj);
5109         PyObject *py_info;
5110         py_info = pytalloc_reference_ex(&samr_UserInfo21_Type, pytalloc_get_mem_ctx(obj), &object->info);
5111         return py_info;
5112 }
5113
5114 static int py_samr_UserInfo25_set_info(PyObject *py_obj, PyObject *value, void *closure)
5115 {
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) {
5119                 PyErr_NoMemory();
5120                 return -1;
5121         }
5122         object->info = *(struct samr_UserInfo21 *)pytalloc_get_ptr(value);
5123         return 0;
5124 }
5125
5126 static PyObject *py_samr_UserInfo25_get_password(PyObject *obj, void *closure)
5127 {
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);
5131         return py_password;
5132 }
5133
5134 static int py_samr_UserInfo25_set_password(PyObject *py_obj, PyObject *value, void *closure)
5135 {
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) {
5139                 PyErr_NoMemory();
5140                 return -1;
5141         }
5142         object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
5143         return 0;
5144 }
5145
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 },
5149         { NULL }
5150 };
5151
5152 static PyObject *py_samr_UserInfo25_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5153 {
5154         return pytalloc_new(struct samr_UserInfo25, type);
5155 }
5156
5157
5158 static PyTypeObject samr_UserInfo25_Type = {
5159         PyObject_HEAD_INIT(NULL) 0,
5160         .tp_name = "samr.UserInfo25",
5161         .tp_getset = py_samr_UserInfo25_getsetters,
5162         .tp_methods = NULL,
5163         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5164         .tp_basicsize = sizeof(pytalloc_Object),
5165         .tp_new = py_samr_UserInfo25_new,
5166 };
5167
5168
5169 static PyObject *py_samr_UserInfo26_get_password(PyObject *obj, void *closure)
5170 {
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);
5174         return py_password;
5175 }
5176
5177 static int py_samr_UserInfo26_set_password(PyObject *py_obj, PyObject *value, void *closure)
5178 {
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) {
5182                 PyErr_NoMemory();
5183                 return -1;
5184         }
5185         object->password = *(struct samr_CryptPasswordEx *)pytalloc_get_ptr(value);
5186         return 0;
5187 }
5188
5189 static PyObject *py_samr_UserInfo26_get_password_expired(PyObject *obj, void *closure)
5190 {
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;
5195 }
5196
5197 static int py_samr_UserInfo26_set_password_expired(PyObject *py_obj, PyObject *value, void *closure)
5198 {
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);
5202         return 0;
5203 }
5204
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 },
5208         { NULL }
5209 };
5210
5211 static PyObject *py_samr_UserInfo26_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5212 {
5213         return pytalloc_new(struct samr_UserInfo26, type);
5214 }
5215
5216
5217 static PyTypeObject samr_UserInfo26_Type = {
5218         PyObject_HEAD_INIT(NULL) 0,
5219         .tp_name = "samr.UserInfo26",
5220         .tp_getset = py_samr_UserInfo26_getsetters,
5221         .tp_methods = NULL,
5222         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5223         .tp_basicsize = sizeof(pytalloc_Object),
5224         .tp_new = py_samr_UserInfo26_new,
5225 };
5226
5227 PyObject *py_import_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, union samr_UserInfo *in)
5228 {
5229         PyObject *ret;
5230
5231         switch (level) {
5232                 case 1:
5233                         ret = pytalloc_reference_ex(&samr_UserInfo1_Type, mem_ctx, &in->info1);
5234                         return ret;
5235
5236                 case 2:
5237                         ret = pytalloc_reference_ex(&samr_UserInfo2_Type, mem_ctx, &in->info2);
5238                         return ret;
5239
5240                 case 3:
5241                         ret = pytalloc_reference_ex(&samr_UserInfo3_Type, mem_ctx, &in->info3);
5242                         return ret;
5243
5244                 case 4:
5245                         ret = pytalloc_reference_ex(&samr_UserInfo4_Type, mem_ctx, &in->info4);
5246                         return ret;
5247
5248                 case 5:
5249                         ret = pytalloc_reference_ex(&samr_UserInfo5_Type, mem_ctx, &in->info5);
5250                         return ret;
5251
5252                 case 6:
5253                         ret = pytalloc_reference_ex(&samr_UserInfo6_Type, mem_ctx, &in->info6);
5254                         return ret;
5255
5256                 case 7:
5257                         ret = pytalloc_reference_ex(&samr_UserInfo7_Type, mem_ctx, &in->info7);
5258                         return ret;
5259
5260                 case 8:
5261                         ret = pytalloc_reference_ex(&samr_UserInfo8_Type, mem_ctx, &in->info8);
5262                         return ret;
5263
5264                 case 9:
5265                         ret = pytalloc_reference_ex(&samr_UserInfo9_Type, mem_ctx, &in->info9);
5266                         return ret;
5267
5268                 case 10:
5269                         ret = pytalloc_reference_ex(&samr_UserInfo10_Type, mem_ctx, &in->info10);
5270                         return ret;
5271
5272                 case 11:
5273                         ret = pytalloc_reference_ex(&samr_UserInfo11_Type, mem_ctx, &in->info11);
5274                         return ret;
5275
5276                 case 12:
5277                         ret = pytalloc_reference_ex(&samr_UserInfo12_Type, mem_ctx, &in->info12);
5278                         return ret;
5279
5280                 case 13:
5281                         ret = pytalloc_reference_ex(&samr_UserInfo13_Type, mem_ctx, &in->info13);
5282                         return ret;
5283
5284                 case 14:
5285                         ret = pytalloc_reference_ex(&samr_UserInfo14_Type, mem_ctx, &in->info14);
5286                         return ret;
5287
5288                 case 16:
5289                         ret = pytalloc_reference_ex(&samr_UserInfo16_Type, mem_ctx, &in->info16);
5290                         return ret;
5291
5292                 case 17:
5293                         ret = pytalloc_reference_ex(&samr_UserInfo17_Type, mem_ctx, &in->info17);
5294                         return ret;
5295
5296                 case 18:
5297                         ret = pytalloc_reference_ex(&samr_UserInfo18_Type, mem_ctx, &in->info18);
5298                         return ret;
5299
5300                 case 20:
5301                         ret = pytalloc_reference_ex(&samr_UserInfo20_Type, mem_ctx, &in->info20);
5302                         return ret;
5303
5304                 case 21:
5305                         ret = pytalloc_reference_ex(&samr_UserInfo21_Type, mem_ctx, &in->info21);
5306                         return ret;
5307
5308                 case 23:
5309                         ret = pytalloc_reference_ex(&samr_UserInfo23_Type, mem_ctx, &in->info23);
5310                         return ret;
5311
5312                 case 24:
5313                         ret = pytalloc_reference_ex(&samr_UserInfo24_Type, mem_ctx, &in->info24);
5314                         return ret;
5315
5316                 case 25:
5317                         ret = pytalloc_reference_ex(&samr_UserInfo25_Type, mem_ctx, &in->info25);
5318                         return ret;
5319
5320                 case 26:
5321                         ret = pytalloc_reference_ex(&samr_UserInfo26_Type, mem_ctx, &in->info26);
5322                         return ret;
5323
5324         }
5325         PyErr_SetString(PyExc_TypeError, "unknown union level");
5326         return NULL;
5327 }
5328
5329 union samr_UserInfo *py_export_samr_UserInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
5330 {
5331         union samr_UserInfo *ret = talloc_zero(mem_ctx, union samr_UserInfo);
5332         switch (level) {
5333                 case 1:
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) {
5336                                 PyErr_NoMemory();
5337                                 talloc_free(ret); return NULL;
5338                         }
5339                         ret->info1 = *(struct samr_UserInfo1 *)pytalloc_get_ptr(in);
5340                         break;
5341
5342                 case 2:
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) {
5345                                 PyErr_NoMemory();
5346                                 talloc_free(ret); return NULL;
5347                         }
5348                         ret->info2 = *(struct samr_UserInfo2 *)pytalloc_get_ptr(in);
5349                         break;
5350
5351                 case 3:
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) {
5354                                 PyErr_NoMemory();
5355                                 talloc_free(ret); return NULL;
5356                         }
5357                         ret->info3 = *(struct samr_UserInfo3 *)pytalloc_get_ptr(in);
5358                         break;
5359
5360                 case 4:
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) {
5363                                 PyErr_NoMemory();
5364                                 talloc_free(ret); return NULL;
5365                         }
5366                         ret->info4 = *(struct samr_UserInfo4 *)pytalloc_get_ptr(in);
5367                         break;
5368
5369                 case 5:
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) {
5372                                 PyErr_NoMemory();
5373                                 talloc_free(ret); return NULL;
5374                         }
5375                         ret->info5 = *(struct samr_UserInfo5 *)pytalloc_get_ptr(in);
5376                         break;
5377
5378                 case 6:
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) {
5381                                 PyErr_NoMemory();
5382                                 talloc_free(ret); return NULL;
5383                         }
5384                         ret->info6 = *(struct samr_UserInfo6 *)pytalloc_get_ptr(in);
5385                         break;
5386
5387                 case 7:
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) {
5390                                 PyErr_NoMemory();
5391                                 talloc_free(ret); return NULL;
5392                         }
5393                         ret->info7 = *(struct samr_UserInfo7 *)pytalloc_get_ptr(in);
5394                         break;
5395
5396                 case 8:
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) {
5399                                 PyErr_NoMemory();
5400                                 talloc_free(ret); return NULL;
5401                         }
5402                         ret->info8 = *(struct samr_UserInfo8 *)pytalloc_get_ptr(in);
5403                         break;
5404
5405                 case 9:
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) {
5408                                 PyErr_NoMemory();
5409                                 talloc_free(ret); return NULL;
5410                         }
5411                         ret->info9 = *(struct samr_UserInfo9 *)pytalloc_get_ptr(in);
5412                         break;
5413
5414                 case 10:
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) {
5417                                 PyErr_NoMemory();
5418                                 talloc_free(ret); return NULL;
5419                         }
5420                         ret->info10 = *(struct samr_UserInfo10 *)pytalloc_get_ptr(in);
5421                         break;
5422
5423                 case 11:
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) {
5426                                 PyErr_NoMemory();
5427                                 talloc_free(ret); return NULL;
5428                         }
5429                         ret->info11 = *(struct samr_UserInfo11 *)pytalloc_get_ptr(in);
5430                         break;
5431
5432                 case 12:
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) {
5435                                 PyErr_NoMemory();
5436                                 talloc_free(ret); return NULL;
5437                         }
5438                         ret->info12 = *(struct samr_UserInfo12 *)pytalloc_get_ptr(in);
5439                         break;
5440
5441                 case 13:
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) {
5444                                 PyErr_NoMemory();
5445                                 talloc_free(ret); return NULL;
5446                         }
5447                         ret->info13 = *(struct samr_UserInfo13 *)pytalloc_get_ptr(in);
5448                         break;
5449
5450                 case 14:
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) {
5453                                 PyErr_NoMemory();
5454                                 talloc_free(ret); return NULL;
5455                         }
5456                         ret->info14 = *(struct samr_UserInfo14 *)pytalloc_get_ptr(in);
5457                         break;
5458
5459                 case 16:
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) {
5462                                 PyErr_NoMemory();
5463                                 talloc_free(ret); return NULL;
5464                         }
5465                         ret->info16 = *(struct samr_UserInfo16 *)pytalloc_get_ptr(in);
5466                         break;
5467
5468                 case 17:
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) {
5471                                 PyErr_NoMemory();
5472                                 talloc_free(ret); return NULL;
5473                         }
5474                         ret->info17 = *(struct samr_UserInfo17 *)pytalloc_get_ptr(in);
5475                         break;
5476
5477                 case 18:
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) {
5480                                 PyErr_NoMemory();
5481                                 talloc_free(ret); return NULL;
5482                         }
5483                         ret->info18 = *(struct samr_UserInfo18 *)pytalloc_get_ptr(in);
5484                         break;
5485
5486                 case 20:
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) {
5489                                 PyErr_NoMemory();
5490                                 talloc_free(ret); return NULL;
5491                         }
5492                         ret->info20 = *(struct samr_UserInfo20 *)pytalloc_get_ptr(in);
5493                         break;
5494
5495                 case 21:
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) {
5498                                 PyErr_NoMemory();
5499                                 talloc_free(ret); return NULL;
5500                         }
5501                         ret->info21 = *(struct samr_UserInfo21 *)pytalloc_get_ptr(in);
5502                         break;
5503
5504                 case 23:
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) {
5507                                 PyErr_NoMemory();
5508                                 talloc_free(ret); return NULL;
5509                         }
5510                         ret->info23 = *(struct samr_UserInfo23 *)pytalloc_get_ptr(in);
5511                         break;
5512
5513                 case 24:
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) {
5516                                 PyErr_NoMemory();
5517                                 talloc_free(ret); return NULL;
5518                         }
5519                         ret->info24 = *(struct samr_UserInfo24 *)pytalloc_get_ptr(in);
5520                         break;
5521
5522                 case 25:
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) {
5525                                 PyErr_NoMemory();
5526                                 talloc_free(ret); return NULL;
5527                         }
5528                         ret->info25 = *(struct samr_UserInfo25 *)pytalloc_get_ptr(in);
5529                         break;
5530
5531                 case 26:
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) {
5534                                 PyErr_NoMemory();
5535                                 talloc_free(ret); return NULL;
5536                         }
5537                         ret->info26 = *(struct samr_UserInfo26 *)pytalloc_get_ptr(in);
5538                         break;
5539
5540                 default:
5541                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
5542                         talloc_free(ret);
5543                         ret = NULL;
5544         }
5545
5546         return ret;
5547 }
5548
5549
5550 static PyObject *py_samr_RidWithAttribute_get_rid(PyObject *obj, void *closure)
5551 {
5552         struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(obj);
5553         PyObject *py_rid;
5554         py_rid = PyInt_FromLong(object->rid);
5555         return py_rid;
5556 }
5557
5558 static int py_samr_RidWithAttribute_set_rid(PyObject *py_obj, PyObject *value, void *closure)
5559 {
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);
5563         return 0;
5564 }
5565
5566 static PyObject *py_samr_RidWithAttribute_get_attributes(PyObject *obj, void *closure)
5567 {
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;
5572 }
5573
5574 static int py_samr_RidWithAttribute_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
5575 {
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);
5581         } else {
5582                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5583                   PyInt_Type.tp_name, PyLong_Type.tp_name);
5584                 return -1;
5585         }
5586         return 0;
5587 }
5588
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 },
5592         { NULL }
5593 };
5594
5595 static PyObject *py_samr_RidWithAttribute_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5596 {
5597         return pytalloc_new(struct samr_RidWithAttribute, type);
5598 }
5599
5600 static PyObject *py_samr_RidWithAttribute_ndr_pack(PyObject *py_obj)
5601 {
5602         struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5603         DATA_BLOB blob;
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);
5608                 return NULL;
5609         }
5610
5611         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5612 }
5613
5614 static PyObject *py_samr_RidWithAttribute_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5615 {
5616         struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5617         DATA_BLOB blob;
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;
5623
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)) {
5628                 return NULL;
5629         }
5630         blob.length = blob_length;
5631
5632         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5633                 allow_remaining = true;
5634         }
5635
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);
5638         } else {
5639                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttribute);
5640         }
5641         if (err != NDR_ERR_SUCCESS) {
5642                 PyErr_SetNdrError(err);
5643                 return NULL;
5644         }
5645
5646         Py_RETURN_NONE;
5647 }
5648
5649 static PyObject *py_samr_RidWithAttribute_ndr_print(PyObject *py_obj)
5650 {
5651         struct samr_RidWithAttribute *object = (struct samr_RidWithAttribute *)pytalloc_get_ptr(py_obj);
5652         PyObject *ret;
5653         char *retstr;
5654
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);
5658
5659         return ret;
5660 }
5661
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 }
5667 };
5668
5669
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,
5678 };
5679
5680
5681 static PyObject *py_samr_RidWithAttributeArray_get_count(PyObject *obj, void *closure)
5682 {
5683         struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
5684         PyObject *py_count;
5685         py_count = PyInt_FromLong(object->count);
5686         return py_count;
5687 }
5688
5689 static int py_samr_RidWithAttributeArray_set_count(PyObject *py_obj, PyObject *value, void *closure)
5690 {
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);
5694         return 0;
5695 }
5696
5697 static PyObject *py_samr_RidWithAttributeArray_get_rids(PyObject *obj, void *closure)
5698 {
5699         struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(obj);
5700         PyObject *py_rids;
5701         if (object->rids == NULL) {
5702                 py_rids = Py_None;
5703                 Py_INCREF(py_rids);
5704         } else {
5705                 py_rids = PyList_New(object->count);
5706                 if (py_rids == NULL) {
5707                         return NULL;
5708                 }
5709                 {
5710                         int rids_cntr_1;
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);
5715                         }
5716                 }
5717         }
5718         return py_rids;
5719 }
5720
5721 static int py_samr_RidWithAttributeArray_set_rids(PyObject *py_obj, PyObject *value, void *closure)
5722 {
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;
5727         } else {
5728                 object->rids = NULL;
5729                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
5730                 {
5731                         int rids_cntr_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) {
5738                                         PyErr_NoMemory();
5739                                         return -1;
5740                                 }
5741                                 object->rids[rids_cntr_1] = *(struct samr_RidWithAttribute *)pytalloc_get_ptr(PyList_GET_ITEM(value, rids_cntr_1));
5742                         }
5743                 }
5744         }
5745         return 0;
5746 }
5747
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 },
5751         { NULL }
5752 };
5753
5754 static PyObject *py_samr_RidWithAttributeArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5755 {
5756         return pytalloc_new(struct samr_RidWithAttributeArray, type);
5757 }
5758
5759 static PyObject *py_samr_RidWithAttributeArray_ndr_pack(PyObject *py_obj)
5760 {
5761         struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5762         DATA_BLOB blob;
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);
5767                 return NULL;
5768         }
5769
5770         return PyString_FromStringAndSize((char *)blob.data, blob.length);
5771 }
5772
5773 static PyObject *py_samr_RidWithAttributeArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
5774 {
5775         struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5776         DATA_BLOB blob;
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;
5782
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)) {
5787                 return NULL;
5788         }
5789         blob.length = blob_length;
5790
5791         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
5792                 allow_remaining = true;
5793         }
5794
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);
5797         } else {
5798                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_samr_RidWithAttributeArray);
5799         }
5800         if (err != NDR_ERR_SUCCESS) {
5801                 PyErr_SetNdrError(err);
5802                 return NULL;
5803         }
5804
5805         Py_RETURN_NONE;
5806 }
5807
5808 static PyObject *py_samr_RidWithAttributeArray_ndr_print(PyObject *py_obj)
5809 {
5810         struct samr_RidWithAttributeArray *object = (struct samr_RidWithAttributeArray *)pytalloc_get_ptr(py_obj);
5811         PyObject *ret;
5812         char *retstr;
5813
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);
5817
5818         return ret;
5819 }
5820
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 }
5826 };
5827
5828
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,
5837 };
5838
5839
5840 static PyObject *py_samr_DispEntryGeneral_get_idx(PyObject *obj, void *closure)
5841 {
5842         struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5843         PyObject *py_idx;
5844         py_idx = PyInt_FromLong(object->idx);
5845         return py_idx;
5846 }
5847
5848 static int py_samr_DispEntryGeneral_set_idx(PyObject *py_obj, PyObject *value, void *closure)
5849 {
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);
5853         return 0;
5854 }
5855
5856 static PyObject *py_samr_DispEntryGeneral_get_rid(PyObject *obj, void *closure)
5857 {
5858         struct samr_DispEntryGeneral *object = (struct samr_DispEntryGeneral *)pytalloc_get_ptr(obj);
5859         PyObject *py_rid;
5860         py_rid = PyInt_FromLong(object->rid);
5861         return py_rid;
5862 }
5863
5864 static int py_samr_DispEntryGeneral_set_rid(PyObject *py_obj, PyObject *value, void *closure)
5865 {
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);
5869         return 0;
5870 }
5871
5872 static PyObject *py_samr_DispEntryGeneral_get_acct_flags(PyObject *obj, void *closure)
5873 {
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;
5878 }
5879
5880 static int py_samr_DispEntryGeneral_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
5881 {
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);
5887         } else {
5888                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
5889                   PyInt_Type.tp_name, PyLong_Type.tp_name);
5890                 return -1;
5891         }
5892         return 0;
5893 }
5894
5895 static PyObject *py_samr_DispEntryGeneral_get_account_name(PyObject *obj, void *closure)
5896 {
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;
5901 }
5902
5903 static int py_samr_DispEntryGeneral_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
5904 {
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) {
5908                 PyErr_NoMemory();
5909                 return -1;
5910         }
5911         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5912         return 0;
5913 }
5914
5915 static PyObject *py_samr_DispEntryGeneral_get_description(PyObject *obj, void *closure)
5916 {
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;
5921 }
5922
5923 static int py_samr_DispEntryGeneral_set_description(PyObject *py_obj, PyObject *value, void *closure)
5924 {
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) {
5928                 PyErr_NoMemory();
5929                 return -1;
5930         }
5931         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
5932         return 0;
5933 }
5934
5935 static PyObject *py_samr_DispEntryGeneral_get_full_name(PyObject *obj, void *closure)
5936 {
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;
5941 }
5942
5943 static int py_samr_DispEntryGeneral_set_full_name(PyObject *py_obj, PyObject *value, void *closure)
5944 {
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) {
5948                 PyErr_NoMemory();
5949                 return -1;
5950         }
5951         object->full_name = *(struct lsa_String *)pytalloc_get_ptr(value);
5952         return 0;
5953 }
5954
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 },
5962         { NULL }
5963 };
5964
5965 static PyObject *py_samr_DispEntryGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
5966 {
5967         return pytalloc_new(struct samr_DispEntryGeneral, type);
5968 }
5969
5970
5971 static PyTypeObject samr_DispEntryGeneral_Type = {
5972         PyObject_HEAD_INIT(NULL) 0,
5973         .tp_name = "samr.DispEntryGeneral",
5974         .tp_getset = py_samr_DispEntryGeneral_getsetters,
5975         .tp_methods = NULL,
5976         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
5977         .tp_basicsize = sizeof(pytalloc_Object),
5978         .tp_new = py_samr_DispEntryGeneral_new,
5979 };
5980
5981
5982 static PyObject *py_samr_DispInfoGeneral_get_count(PyObject *obj, void *closure)
5983 {
5984         struct samr_DispInfoGeneral *object = (struct samr_DispInfoGeneral *)pytalloc_get_ptr(obj);
5985         PyObject *py_count;
5986         py_count = PyInt_FromLong(object->count);
5987         return py_count;
5988 }
5989
5990 static int py_samr_DispInfoGeneral_set_count(PyObject *py_obj, PyObject *value, void *closure)
5991 {
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);
5995         return 0;
5996 }
5997
5998 static PyObject *py_samr_DispInfoGeneral_get_entries(PyObject *obj, void *closure)
5999 {
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);
6005         } else {
6006                 py_entries = PyList_New(object->count);
6007                 if (py_entries == NULL) {
6008                         return NULL;
6009                 }
6010                 {
6011                         int entries_cntr_1;
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);
6016                         }
6017                 }
6018         }
6019         return py_entries;
6020 }
6021
6022 static int py_samr_DispInfoGeneral_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6023 {
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;
6028         } else {
6029                 object->entries = NULL;
6030                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6031                 {
6032                         int entries_cntr_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) {
6039                                         PyErr_NoMemory();
6040                                         return -1;
6041                                 }
6042                                 object->entries[entries_cntr_1] = *(struct samr_DispEntryGeneral *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6043                         }
6044                 }
6045         }
6046         return 0;
6047 }
6048
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 },
6052         { NULL }
6053 };
6054
6055 static PyObject *py_samr_DispInfoGeneral_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6056 {
6057         return pytalloc_new(struct samr_DispInfoGeneral, type);
6058 }
6059
6060
6061 static PyTypeObject samr_DispInfoGeneral_Type = {
6062         PyObject_HEAD_INIT(NULL) 0,
6063         .tp_name = "samr.DispInfoGeneral",
6064         .tp_getset = py_samr_DispInfoGeneral_getsetters,
6065         .tp_methods = NULL,
6066         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6067         .tp_basicsize = sizeof(pytalloc_Object),
6068         .tp_new = py_samr_DispInfoGeneral_new,
6069 };
6070
6071
6072 static PyObject *py_samr_DispEntryFull_get_idx(PyObject *obj, void *closure)
6073 {
6074         struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6075         PyObject *py_idx;
6076         py_idx = PyInt_FromLong(object->idx);
6077         return py_idx;
6078 }
6079
6080 static int py_samr_DispEntryFull_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6081 {
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);
6085         return 0;
6086 }
6087
6088 static PyObject *py_samr_DispEntryFull_get_rid(PyObject *obj, void *closure)
6089 {
6090         struct samr_DispEntryFull *object = (struct samr_DispEntryFull *)pytalloc_get_ptr(obj);
6091         PyObject *py_rid;
6092         py_rid = PyInt_FromLong(object->rid);
6093         return py_rid;
6094 }
6095
6096 static int py_samr_DispEntryFull_set_rid(PyObject *py_obj, PyObject *value, void *closure)
6097 {
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);
6101         return 0;
6102 }
6103
6104 static PyObject *py_samr_DispEntryFull_get_acct_flags(PyObject *obj, void *closure)
6105 {
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;
6110 }
6111
6112 static int py_samr_DispEntryFull_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
6113 {
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);
6119         } else {
6120                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6121                   PyInt_Type.tp_name, PyLong_Type.tp_name);
6122                 return -1;
6123         }
6124         return 0;
6125 }
6126
6127 static PyObject *py_samr_DispEntryFull_get_account_name(PyObject *obj, void *closure)
6128 {
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;
6133 }
6134
6135 static int py_samr_DispEntryFull_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6136 {
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) {
6140                 PyErr_NoMemory();
6141                 return -1;
6142         }
6143         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6144         return 0;
6145 }
6146
6147 static PyObject *py_samr_DispEntryFull_get_description(PyObject *obj, void *closure)
6148 {
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;
6153 }
6154
6155 static int py_samr_DispEntryFull_set_description(PyObject *py_obj, PyObject *value, void *closure)
6156 {
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) {
6160                 PyErr_NoMemory();
6161                 return -1;
6162         }
6163         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
6164         return 0;
6165 }
6166
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 },
6173         { NULL }
6174 };
6175
6176 static PyObject *py_samr_DispEntryFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6177 {
6178         return pytalloc_new(struct samr_DispEntryFull, type);
6179 }
6180
6181
6182 static PyTypeObject samr_DispEntryFull_Type = {
6183         PyObject_HEAD_INIT(NULL) 0,
6184         .tp_name = "samr.DispEntryFull",
6185         .tp_getset = py_samr_DispEntryFull_getsetters,
6186         .tp_methods = NULL,
6187         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6188         .tp_basicsize = sizeof(pytalloc_Object),
6189         .tp_new = py_samr_DispEntryFull_new,
6190 };
6191
6192
6193 static PyObject *py_samr_DispInfoFull_get_count(PyObject *obj, void *closure)
6194 {
6195         struct samr_DispInfoFull *object = (struct samr_DispInfoFull *)pytalloc_get_ptr(obj);
6196         PyObject *py_count;
6197         py_count = PyInt_FromLong(object->count);
6198         return py_count;
6199 }
6200
6201 static int py_samr_DispInfoFull_set_count(PyObject *py_obj, PyObject *value, void *closure)
6202 {
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);
6206         return 0;
6207 }
6208
6209 static PyObject *py_samr_DispInfoFull_get_entries(PyObject *obj, void *closure)
6210 {
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);
6216         } else {
6217                 py_entries = PyList_New(object->count);
6218                 if (py_entries == NULL) {
6219                         return NULL;
6220                 }
6221                 {
6222                         int entries_cntr_1;
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);
6227                         }
6228                 }
6229         }
6230         return py_entries;
6231 }
6232
6233 static int py_samr_DispInfoFull_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6234 {
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;
6239         } else {
6240                 object->entries = NULL;
6241                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6242                 {
6243                         int entries_cntr_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) {
6250                                         PyErr_NoMemory();
6251                                         return -1;
6252                                 }
6253                                 object->entries[entries_cntr_1] = *(struct samr_DispEntryFull *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6254                         }
6255                 }
6256         }
6257         return 0;
6258 }
6259
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 },
6263         { NULL }
6264 };
6265
6266 static PyObject *py_samr_DispInfoFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6267 {
6268         return pytalloc_new(struct samr_DispInfoFull, type);
6269 }
6270
6271
6272 static PyTypeObject samr_DispInfoFull_Type = {
6273         PyObject_HEAD_INIT(NULL) 0,
6274         .tp_name = "samr.DispInfoFull",
6275         .tp_getset = py_samr_DispInfoFull_getsetters,
6276         .tp_methods = NULL,
6277         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6278         .tp_basicsize = sizeof(pytalloc_Object),
6279         .tp_new = py_samr_DispInfoFull_new,
6280 };
6281
6282
6283 static PyObject *py_samr_DispEntryFullGroup_get_idx(PyObject *obj, void *closure)
6284 {
6285         struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6286         PyObject *py_idx;
6287         py_idx = PyInt_FromLong(object->idx);
6288         return py_idx;
6289 }
6290
6291 static int py_samr_DispEntryFullGroup_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6292 {
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);
6296         return 0;
6297 }
6298
6299 static PyObject *py_samr_DispEntryFullGroup_get_rid(PyObject *obj, void *closure)
6300 {
6301         struct samr_DispEntryFullGroup *object = (struct samr_DispEntryFullGroup *)pytalloc_get_ptr(obj);
6302         PyObject *py_rid;
6303         py_rid = PyInt_FromLong(object->rid);
6304         return py_rid;
6305 }
6306
6307 static int py_samr_DispEntryFullGroup_set_rid(PyObject *py_obj, PyObject *value, void *closure)
6308 {
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);
6312         return 0;
6313 }
6314
6315 static PyObject *py_samr_DispEntryFullGroup_get_acct_flags(PyObject *obj, void *closure)
6316 {
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;
6321 }
6322
6323 static int py_samr_DispEntryFullGroup_set_acct_flags(PyObject *py_obj, PyObject *value, void *closure)
6324 {
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);
6330         } else {
6331                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6332                   PyInt_Type.tp_name, PyLong_Type.tp_name);
6333                 return -1;
6334         }
6335         return 0;
6336 }
6337
6338 static PyObject *py_samr_DispEntryFullGroup_get_account_name(PyObject *obj, void *closure)
6339 {
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;
6344 }
6345
6346 static int py_samr_DispEntryFullGroup_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6347 {
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) {
6351                 PyErr_NoMemory();
6352                 return -1;
6353         }
6354         object->account_name = *(struct lsa_String *)pytalloc_get_ptr(value);
6355         return 0;
6356 }
6357
6358 static PyObject *py_samr_DispEntryFullGroup_get_description(PyObject *obj, void *closure)
6359 {
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;
6364 }
6365
6366 static int py_samr_DispEntryFullGroup_set_description(PyObject *py_obj, PyObject *value, void *closure)
6367 {
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) {
6371                 PyErr_NoMemory();
6372                 return -1;
6373         }
6374         object->description = *(struct lsa_String *)pytalloc_get_ptr(value);
6375         return 0;
6376 }
6377
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 },
6384         { NULL }
6385 };
6386
6387 static PyObject *py_samr_DispEntryFullGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6388 {
6389         return pytalloc_new(struct samr_DispEntryFullGroup, type);
6390 }
6391
6392
6393 static PyTypeObject samr_DispEntryFullGroup_Type = {
6394         PyObject_HEAD_INIT(NULL) 0,
6395         .tp_name = "samr.DispEntryFullGroup",
6396         .tp_getset = py_samr_DispEntryFullGroup_getsetters,
6397         .tp_methods = NULL,
6398         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6399         .tp_basicsize = sizeof(pytalloc_Object),
6400         .tp_new = py_samr_DispEntryFullGroup_new,
6401 };
6402
6403
6404 static PyObject *py_samr_DispInfoFullGroups_get_count(PyObject *obj, void *closure)
6405 {
6406         struct samr_DispInfoFullGroups *object = (struct samr_DispInfoFullGroups *)pytalloc_get_ptr(obj);
6407         PyObject *py_count;
6408         py_count = PyInt_FromLong(object->count);
6409         return py_count;
6410 }
6411
6412 static int py_samr_DispInfoFullGroups_set_count(PyObject *py_obj, PyObject *value, void *closure)
6413 {
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);
6417         return 0;
6418 }
6419
6420 static PyObject *py_samr_DispInfoFullGroups_get_entries(PyObject *obj, void *closure)
6421 {
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);
6427         } else {
6428                 py_entries = PyList_New(object->count);
6429                 if (py_entries == NULL) {
6430                         return NULL;
6431                 }
6432                 {
6433                         int entries_cntr_1;
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);
6438                         }
6439                 }
6440         }
6441         return py_entries;
6442 }
6443
6444 static int py_samr_DispInfoFullGroups_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6445 {
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;
6450         } else {
6451                 object->entries = NULL;
6452                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6453                 {
6454                         int entries_cntr_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) {
6461                                         PyErr_NoMemory();
6462                                         return -1;
6463                                 }
6464                                 object->entries[entries_cntr_1] = *(struct samr_DispEntryFullGroup *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6465                         }
6466                 }
6467         }
6468         return 0;
6469 }
6470
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 },
6474         { NULL }
6475 };
6476
6477 static PyObject *py_samr_DispInfoFullGroups_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6478 {
6479         return pytalloc_new(struct samr_DispInfoFullGroups, type);
6480 }
6481
6482
6483 static PyTypeObject samr_DispInfoFullGroups_Type = {
6484         PyObject_HEAD_INIT(NULL) 0,
6485         .tp_name = "samr.DispInfoFullGroups",
6486         .tp_getset = py_samr_DispInfoFullGroups_getsetters,
6487         .tp_methods = NULL,
6488         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6489         .tp_basicsize = sizeof(pytalloc_Object),
6490         .tp_new = py_samr_DispInfoFullGroups_new,
6491 };
6492
6493
6494 static PyObject *py_samr_DispEntryAscii_get_idx(PyObject *obj, void *closure)
6495 {
6496         struct samr_DispEntryAscii *object = (struct samr_DispEntryAscii *)pytalloc_get_ptr(obj);
6497         PyObject *py_idx;
6498         py_idx = PyInt_FromLong(object->idx);
6499         return py_idx;
6500 }
6501
6502 static int py_samr_DispEntryAscii_set_idx(PyObject *py_obj, PyObject *value, void *closure)
6503 {
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);
6507         return 0;
6508 }
6509
6510 static PyObject *py_samr_DispEntryAscii_get_account_name(PyObject *obj, void *closure)
6511 {
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;
6516 }
6517
6518 static int py_samr_DispEntryAscii_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
6519 {
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) {
6523                 PyErr_NoMemory();
6524                 return -1;
6525         }
6526         object->account_name = *(struct lsa_AsciiStringLarge *)pytalloc_get_ptr(value);
6527         return 0;
6528 }
6529
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 },
6533         { NULL }
6534 };
6535
6536 static PyObject *py_samr_DispEntryAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6537 {
6538         return pytalloc_new(struct samr_DispEntryAscii, type);
6539 }
6540
6541
6542 static PyTypeObject samr_DispEntryAscii_Type = {
6543         PyObject_HEAD_INIT(NULL) 0,
6544         .tp_name = "samr.DispEntryAscii",
6545         .tp_getset = py_samr_DispEntryAscii_getsetters,
6546         .tp_methods = NULL,
6547         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6548         .tp_basicsize = sizeof(pytalloc_Object),
6549         .tp_new = py_samr_DispEntryAscii_new,
6550 };
6551
6552
6553 static PyObject *py_samr_DispInfoAscii_get_count(PyObject *obj, void *closure)
6554 {
6555         struct samr_DispInfoAscii *object = (struct samr_DispInfoAscii *)pytalloc_get_ptr(obj);
6556         PyObject *py_count;
6557         py_count = PyInt_FromLong(object->count);
6558         return py_count;
6559 }
6560
6561 static int py_samr_DispInfoAscii_set_count(PyObject *py_obj, PyObject *value, void *closure)
6562 {
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);
6566         return 0;
6567 }
6568
6569 static PyObject *py_samr_DispInfoAscii_get_entries(PyObject *obj, void *closure)
6570 {
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);
6576         } else {
6577                 py_entries = PyList_New(object->count);
6578                 if (py_entries == NULL) {
6579                         return NULL;
6580                 }
6581                 {
6582                         int entries_cntr_1;
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);
6587                         }
6588                 }
6589         }
6590         return py_entries;
6591 }
6592
6593 static int py_samr_DispInfoAscii_set_entries(PyObject *py_obj, PyObject *value, void *closure)
6594 {
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;
6599         } else {
6600                 object->entries = NULL;
6601                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
6602                 {
6603                         int entries_cntr_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) {
6610                                         PyErr_NoMemory();
6611                                         return -1;
6612                                 }
6613                                 object->entries[entries_cntr_1] = *(struct samr_DispEntryAscii *)pytalloc_get_ptr(PyList_GET_ITEM(value, entries_cntr_1));
6614                         }
6615                 }
6616         }
6617         return 0;
6618 }
6619
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 },
6623         { NULL }
6624 };
6625
6626 static PyObject *py_samr_DispInfoAscii_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6627 {
6628         return pytalloc_new(struct samr_DispInfoAscii, type);
6629 }
6630
6631
6632 static PyTypeObject samr_DispInfoAscii_Type = {
6633         PyObject_HEAD_INIT(NULL) 0,
6634         .tp_name = "samr.DispInfoAscii",
6635         .tp_getset = py_samr_DispInfoAscii_getsetters,
6636         .tp_methods = NULL,
6637         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6638         .tp_basicsize = sizeof(pytalloc_Object),
6639         .tp_new = py_samr_DispInfoAscii_new,
6640 };
6641
6642 PyObject *py_import_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, union samr_DispInfo *in)
6643 {
6644         PyObject *ret;
6645
6646         switch (level) {
6647                 case 1:
6648                         ret = pytalloc_reference_ex(&samr_DispInfoGeneral_Type, mem_ctx, &in->info1);
6649                         return ret;
6650
6651                 case 2:
6652                         ret = pytalloc_reference_ex(&samr_DispInfoFull_Type, mem_ctx, &in->info2);
6653                         return ret;
6654
6655                 case 3:
6656                         ret = pytalloc_reference_ex(&samr_DispInfoFullGroups_Type, mem_ctx, &in->info3);
6657                         return ret;
6658
6659                 case 4:
6660                         ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info4);
6661                         return ret;
6662
6663                 case 5:
6664                         ret = pytalloc_reference_ex(&samr_DispInfoAscii_Type, mem_ctx, &in->info5);
6665                         return ret;
6666
6667         }
6668         PyErr_SetString(PyExc_TypeError, "unknown union level");
6669         return NULL;
6670 }
6671
6672 union samr_DispInfo *py_export_samr_DispInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6673 {
6674         union samr_DispInfo *ret = talloc_zero(mem_ctx, union samr_DispInfo);
6675         switch (level) {
6676                 case 1:
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) {
6679                                 PyErr_NoMemory();
6680                                 talloc_free(ret); return NULL;
6681                         }
6682                         ret->info1 = *(struct samr_DispInfoGeneral *)pytalloc_get_ptr(in);
6683                         break;
6684
6685                 case 2:
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) {
6688                                 PyErr_NoMemory();
6689                                 talloc_free(ret); return NULL;
6690                         }
6691                         ret->info2 = *(struct samr_DispInfoFull *)pytalloc_get_ptr(in);
6692                         break;
6693
6694                 case 3:
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) {
6697                                 PyErr_NoMemory();
6698                                 talloc_free(ret); return NULL;
6699                         }
6700                         ret->info3 = *(struct samr_DispInfoFullGroups *)pytalloc_get_ptr(in);
6701                         break;
6702
6703                 case 4:
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) {
6706                                 PyErr_NoMemory();
6707                                 talloc_free(ret); return NULL;
6708                         }
6709                         ret->info4 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
6710                         break;
6711
6712                 case 5:
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) {
6715                                 PyErr_NoMemory();
6716                                 talloc_free(ret); return NULL;
6717                         }
6718                         ret->info5 = *(struct samr_DispInfoAscii *)pytalloc_get_ptr(in);
6719                         break;
6720
6721                 default:
6722                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
6723                         talloc_free(ret);
6724                         ret = NULL;
6725         }
6726
6727         return ret;
6728 }
6729
6730
6731 static PyObject *py_samr_PwInfo_get_min_password_length(PyObject *obj, void *closure)
6732 {
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;
6737 }
6738
6739 static int py_samr_PwInfo_set_min_password_length(PyObject *py_obj, PyObject *value, void *closure)
6740 {
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);
6744         return 0;
6745 }
6746
6747 static PyObject *py_samr_PwInfo_get_password_properties(PyObject *obj, void *closure)
6748 {
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;
6753 }
6754
6755 static int py_samr_PwInfo_set_password_properties(PyObject *py_obj, PyObject *value, void *closure)
6756 {
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);
6762         } else {
6763                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6764                   PyInt_Type.tp_name, PyLong_Type.tp_name);
6765                 return -1;
6766         }
6767         return 0;
6768 }
6769
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 },
6773         { NULL }
6774 };
6775
6776 static PyObject *py_samr_PwInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6777 {
6778         return pytalloc_new(struct samr_PwInfo, type);
6779 }
6780
6781
6782 static PyTypeObject samr_PwInfo_Type = {
6783         PyObject_HEAD_INIT(NULL) 0,
6784         .tp_name = "samr.PwInfo",
6785         .tp_getset = py_samr_PwInfo_getsetters,
6786         .tp_methods = NULL,
6787         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6788         .tp_basicsize = sizeof(pytalloc_Object),
6789         .tp_new = py_samr_PwInfo_new,
6790 };
6791
6792
6793 static PyObject *py_userPwdChangeFailureInformation_get_extendedFailureReason(PyObject *obj, void *closure)
6794 {
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;
6799 }
6800
6801 static int py_userPwdChangeFailureInformation_set_extendedFailureReason(PyObject *py_obj, PyObject *value, void *closure)
6802 {
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);
6808         } else {
6809                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6810                   PyInt_Type.tp_name, PyLong_Type.tp_name);
6811                 return -1;
6812         }
6813         return 0;
6814 }
6815
6816 static PyObject *py_userPwdChangeFailureInformation_get_filterModuleName(PyObject *obj, void *closure)
6817 {
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;
6822 }
6823
6824 static int py_userPwdChangeFailureInformation_set_filterModuleName(PyObject *py_obj, PyObject *value, void *closure)
6825 {
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) {
6829                 PyErr_NoMemory();
6830                 return -1;
6831         }
6832         object->filterModuleName = *(struct lsa_String *)pytalloc_get_ptr(value);
6833         return 0;
6834 }
6835
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 },
6839         { NULL }
6840 };
6841
6842 static PyObject *py_userPwdChangeFailureInformation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6843 {
6844         return pytalloc_new(struct userPwdChangeFailureInformation, type);
6845 }
6846
6847
6848 static PyTypeObject userPwdChangeFailureInformation_Type = {
6849         PyObject_HEAD_INIT(NULL) 0,
6850         .tp_name = "samr.userPwdChangeFailureInformation",
6851         .tp_getset = py_userPwdChangeFailureInformation_getsetters,
6852         .tp_methods = NULL,
6853         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6854         .tp_basicsize = sizeof(pytalloc_Object),
6855         .tp_new = py_userPwdChangeFailureInformation_new,
6856 };
6857
6858
6859 static PyObject *py_samr_ConnectInfo1_get_client_version(PyObject *obj, void *closure)
6860 {
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;
6865 }
6866
6867 static int py_samr_ConnectInfo1_set_client_version(PyObject *py_obj, PyObject *value, void *closure)
6868 {
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);
6874         } else {
6875                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
6876                   PyInt_Type.tp_name, PyLong_Type.tp_name);
6877                 return -1;
6878         }
6879         return 0;
6880 }
6881
6882 static PyObject *py_samr_ConnectInfo1_get_unknown2(PyObject *obj, void *closure)
6883 {
6884         struct samr_ConnectInfo1 *object = (struct samr_ConnectInfo1 *)pytalloc_get_ptr(obj);
6885         PyObject *py_unknown2;
6886         py_unknown2 = PyInt_FromLong(object->unknown2);
6887         return py_unknown2;
6888 }
6889
6890 static int py_samr_ConnectInfo1_set_unknown2(PyObject *py_obj, PyObject *value, void *closure)
6891 {
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);
6895         return 0;
6896 }
6897
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 },
6901         { NULL }
6902 };
6903
6904 static PyObject *py_samr_ConnectInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
6905 {
6906         return pytalloc_new(struct samr_ConnectInfo1, type);
6907 }
6908
6909
6910 static PyTypeObject samr_ConnectInfo1_Type = {
6911         PyObject_HEAD_INIT(NULL) 0,
6912         .tp_name = "samr.ConnectInfo1",
6913         .tp_getset = py_samr_ConnectInfo1_getsetters,
6914         .tp_methods = NULL,
6915         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
6916         .tp_basicsize = sizeof(pytalloc_Object),
6917         .tp_new = py_samr_ConnectInfo1_new,
6918 };
6919
6920 PyObject *py_import_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, union samr_ConnectInfo *in)
6921 {
6922         PyObject *ret;
6923
6924         switch (level) {
6925                 case 1:
6926                         ret = pytalloc_reference_ex(&samr_ConnectInfo1_Type, mem_ctx, &in->info1);
6927                         return ret;
6928
6929         }
6930         PyErr_SetString(PyExc_TypeError, "unknown union level");
6931         return NULL;
6932 }
6933
6934 union samr_ConnectInfo *py_export_samr_ConnectInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
6935 {
6936         union samr_ConnectInfo *ret = talloc_zero(mem_ctx, union samr_ConnectInfo);
6937         switch (level) {
6938                 case 1:
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) {
6941                                 PyErr_NoMemory();
6942                                 talloc_free(ret); return NULL;
6943                         }
6944                         ret->info1 = *(struct samr_ConnectInfo1 *)pytalloc_get_ptr(in);
6945                         break;
6946
6947                 default:
6948                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
6949                         talloc_free(ret);
6950                         ret = NULL;
6951         }
6952
6953         return ret;
6954 }
6955
6956
6957 static PyObject *py_samr_ValidationBlob_get_length(PyObject *obj, void *closure)
6958 {
6959         struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
6960         PyObject *py_length;
6961         py_length = PyInt_FromLong(object->length);
6962         return py_length;
6963 }
6964
6965 static int py_samr_ValidationBlob_set_length(PyObject *py_obj, PyObject *value, void *closure)
6966 {
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);
6970         return 0;
6971 }
6972
6973 static PyObject *py_samr_ValidationBlob_get_data(PyObject *obj, void *closure)
6974 {
6975         struct samr_ValidationBlob *object = (struct samr_ValidationBlob *)pytalloc_get_ptr(obj);
6976         PyObject *py_data;
6977         if (object->data == NULL) {
6978                 py_data = Py_None;
6979                 Py_INCREF(py_data);
6980         } else {
6981                 py_data = PyList_New(object->length);
6982                 if (py_data == NULL) {
6983                         return NULL;
6984                 }
6985                 {
6986                         int data_cntr_1;
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);
6991                         }
6992                 }
6993         }
6994         return py_data;
6995 }
6996
6997 static int py_samr_ValidationBlob_set_data(PyObject *py_obj, PyObject *value, void *closure)
6998 {
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;
7003         } else {
7004                 object->data = NULL;
7005                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7006                 {
7007                         int data_cntr_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));
7014                         }
7015                 }
7016         }
7017         return 0;
7018 }
7019
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 },
7023         { NULL }
7024 };
7025
7026 static PyObject *py_samr_ValidationBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7027 {
7028         return pytalloc_new(struct samr_ValidationBlob, type);
7029 }
7030
7031
7032 static PyTypeObject samr_ValidationBlob_Type = {
7033         PyObject_HEAD_INIT(NULL) 0,
7034         .tp_name = "samr.ValidationBlob",
7035         .tp_getset = py_samr_ValidationBlob_getsetters,
7036         .tp_methods = NULL,
7037         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7038         .tp_basicsize = sizeof(pytalloc_Object),
7039         .tp_new = py_samr_ValidationBlob_new,
7040 };
7041
7042
7043 static PyObject *py_samr_ValidatePasswordInfo_get_fields_present(PyObject *obj, void *closure)
7044 {
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;
7049 }
7050
7051 static int py_samr_ValidatePasswordInfo_set_fields_present(PyObject *py_obj, PyObject *value, void *closure)
7052 {
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);
7058         } else {
7059                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7060                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7061                 return -1;
7062         }
7063         return 0;
7064 }
7065
7066 static PyObject *py_samr_ValidatePasswordInfo_get_last_password_change(PyObject *obj, void *closure)
7067 {
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;
7072 }
7073
7074 static int py_samr_ValidatePasswordInfo_set_last_password_change(PyObject *py_obj, PyObject *value, void *closure)
7075 {
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);
7081         } else {
7082                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7083                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7084                 return -1;
7085         }
7086         return 0;
7087 }
7088
7089 static PyObject *py_samr_ValidatePasswordInfo_get_bad_password_time(PyObject *obj, void *closure)
7090 {
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;
7095 }
7096
7097 static int py_samr_ValidatePasswordInfo_set_bad_password_time(PyObject *py_obj, PyObject *value, void *closure)
7098 {
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);
7104         } else {
7105                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7106                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7107                 return -1;
7108         }
7109         return 0;
7110 }
7111
7112 static PyObject *py_samr_ValidatePasswordInfo_get_lockout_time(PyObject *obj, void *closure)
7113 {
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;
7118 }
7119
7120 static int py_samr_ValidatePasswordInfo_set_lockout_time(PyObject *py_obj, PyObject *value, void *closure)
7121 {
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);
7127         } else {
7128                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7129                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7130                 return -1;
7131         }
7132         return 0;
7133 }
7134
7135 static PyObject *py_samr_ValidatePasswordInfo_get_bad_pwd_count(PyObject *obj, void *closure)
7136 {
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;
7141 }
7142
7143 static int py_samr_ValidatePasswordInfo_set_bad_pwd_count(PyObject *py_obj, PyObject *value, void *closure)
7144 {
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);
7148         return 0;
7149 }
7150
7151 static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history_len(PyObject *obj, void *closure)
7152 {
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;
7157 }
7158
7159 static int py_samr_ValidatePasswordInfo_set_pwd_history_len(PyObject *py_obj, PyObject *value, void *closure)
7160 {
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);
7164         return 0;
7165 }
7166
7167 static PyObject *py_samr_ValidatePasswordInfo_get_pwd_history(PyObject *obj, void *closure)
7168 {
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);
7174         } else {
7175                 py_pwd_history = PyList_New(object->pwd_history_len);
7176                 if (py_pwd_history == NULL) {
7177                         return NULL;
7178                 }
7179                 {
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);
7185                         }
7186                 }
7187         }
7188         return py_pwd_history;
7189 }
7190
7191 static int py_samr_ValidatePasswordInfo_set_pwd_history(PyObject *py_obj, PyObject *value, void *closure)
7192 {
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;
7197         } else {
7198                 object->pwd_history = NULL;
7199                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
7200                 {
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) {
7208                                         PyErr_NoMemory();
7209                                         return -1;
7210                                 }
7211                                 object->pwd_history[pwd_history_cntr_1] = *(struct samr_ValidationBlob *)pytalloc_get_ptr(PyList_GET_ITEM(value, pwd_history_cntr_1));
7212                         }
7213                 }
7214         }
7215         return 0;
7216 }
7217
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 },
7226         { NULL }
7227 };
7228
7229 static PyObject *py_samr_ValidatePasswordInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7230 {
7231         return pytalloc_new(struct samr_ValidatePasswordInfo, type);
7232 }
7233
7234
7235 static PyTypeObject samr_ValidatePasswordInfo_Type = {
7236         PyObject_HEAD_INIT(NULL) 0,
7237         .tp_name = "samr.ValidatePasswordInfo",
7238         .tp_getset = py_samr_ValidatePasswordInfo_getsetters,
7239         .tp_methods = NULL,
7240         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7241         .tp_basicsize = sizeof(pytalloc_Object),
7242         .tp_new = py_samr_ValidatePasswordInfo_new,
7243 };
7244
7245
7246 static PyObject *py_samr_ValidatePasswordRepCtr_get_info(PyObject *obj, void *closure)
7247 {
7248         struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
7249         PyObject *py_info;
7250         py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7251         return py_info;
7252 }
7253
7254 static int py_samr_ValidatePasswordRepCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
7255 {
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) {
7259                 PyErr_NoMemory();
7260                 return -1;
7261         }
7262         object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7263         return 0;
7264 }
7265
7266 static PyObject *py_samr_ValidatePasswordRepCtr_get_status(PyObject *obj, void *closure)
7267 {
7268         struct samr_ValidatePasswordRepCtr *object = (struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(obj);
7269         PyObject *py_status;
7270         py_status = PyInt_FromLong(object->status);
7271         return py_status;
7272 }
7273
7274 static int py_samr_ValidatePasswordRepCtr_set_status(PyObject *py_obj, PyObject *value, void *closure)
7275 {
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);
7281         } else {
7282                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7283                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7284                 return -1;
7285         }
7286         return 0;
7287 }
7288
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 },
7292         { NULL }
7293 };
7294
7295 static PyObject *py_samr_ValidatePasswordRepCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7296 {
7297         return pytalloc_new(struct samr_ValidatePasswordRepCtr, type);
7298 }
7299
7300
7301 static PyTypeObject samr_ValidatePasswordRepCtr_Type = {
7302         PyObject_HEAD_INIT(NULL) 0,
7303         .tp_name = "samr.ValidatePasswordRepCtr",
7304         .tp_getset = py_samr_ValidatePasswordRepCtr_getsetters,
7305         .tp_methods = NULL,
7306         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7307         .tp_basicsize = sizeof(pytalloc_Object),
7308         .tp_new = py_samr_ValidatePasswordRepCtr_new,
7309 };
7310
7311 PyObject *py_import_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordRep *in)
7312 {
7313         PyObject *ret;
7314
7315         switch (level) {
7316                 case 1:
7317                         ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr1);
7318                         return ret;
7319
7320                 case 2:
7321                         ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr2);
7322                         return ret;
7323
7324                 case 3:
7325                         ret = pytalloc_reference_ex(&samr_ValidatePasswordRepCtr_Type, mem_ctx, &in->ctr3);
7326                         return ret;
7327
7328         }
7329         PyErr_SetString(PyExc_TypeError, "unknown union level");
7330         return NULL;
7331 }
7332
7333 union samr_ValidatePasswordRep *py_export_samr_ValidatePasswordRep(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7334 {
7335         union samr_ValidatePasswordRep *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordRep);
7336         switch (level) {
7337                 case 1:
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) {
7340                                 PyErr_NoMemory();
7341                                 talloc_free(ret); return NULL;
7342                         }
7343                         ret->ctr1 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7344                         break;
7345
7346                 case 2:
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) {
7349                                 PyErr_NoMemory();
7350                                 talloc_free(ret); return NULL;
7351                         }
7352                         ret->ctr2 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7353                         break;
7354
7355                 case 3:
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) {
7358                                 PyErr_NoMemory();
7359                                 talloc_free(ret); return NULL;
7360                         }
7361                         ret->ctr3 = *(struct samr_ValidatePasswordRepCtr *)pytalloc_get_ptr(in);
7362                         break;
7363
7364                 default:
7365                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
7366                         talloc_free(ret);
7367                         ret = NULL;
7368         }
7369
7370         return ret;
7371 }
7372
7373
7374 static PyObject *py_samr_ValidatePasswordReq3_get_info(PyObject *obj, void *closure)
7375 {
7376         struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7377         PyObject *py_info;
7378         py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7379         return py_info;
7380 }
7381
7382 static int py_samr_ValidatePasswordReq3_set_info(PyObject *py_obj, PyObject *value, void *closure)
7383 {
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) {
7387                 PyErr_NoMemory();
7388                 return -1;
7389         }
7390         object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7391         return 0;
7392 }
7393
7394 static PyObject *py_samr_ValidatePasswordReq3_get_password(PyObject *obj, void *closure)
7395 {
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);
7399         return py_password;
7400 }
7401
7402 static int py_samr_ValidatePasswordReq3_set_password(PyObject *py_obj, PyObject *value, void *closure)
7403 {
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) {
7407                 PyErr_NoMemory();
7408                 return -1;
7409         }
7410         object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7411         return 0;
7412 }
7413
7414 static PyObject *py_samr_ValidatePasswordReq3_get_account(PyObject *obj, void *closure)
7415 {
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);
7419         return py_account;
7420 }
7421
7422 static int py_samr_ValidatePasswordReq3_set_account(PyObject *py_obj, PyObject *value, void *closure)
7423 {
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) {
7427                 PyErr_NoMemory();
7428                 return -1;
7429         }
7430         object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7431         return 0;
7432 }
7433
7434 static PyObject *py_samr_ValidatePasswordReq3_get_hash(PyObject *obj, void *closure)
7435 {
7436         struct samr_ValidatePasswordReq3 *object = (struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(obj);
7437         PyObject *py_hash;
7438         py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
7439         return py_hash;
7440 }
7441
7442 static int py_samr_ValidatePasswordReq3_set_hash(PyObject *py_obj, PyObject *value, void *closure)
7443 {
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) {
7447                 PyErr_NoMemory();
7448                 return -1;
7449         }
7450         object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
7451         return 0;
7452 }
7453
7454 static PyObject *py_samr_ValidatePasswordReq3_get_pwd_must_change_at_next_logon(PyObject *obj, void *closure)
7455 {
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;
7460 }
7461
7462 static int py_samr_ValidatePasswordReq3_set_pwd_must_change_at_next_logon(PyObject *py_obj, PyObject *value, void *closure)
7463 {
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);
7467         return 0;
7468 }
7469
7470 static PyObject *py_samr_ValidatePasswordReq3_get_clear_lockout(PyObject *obj, void *closure)
7471 {
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;
7476 }
7477
7478 static int py_samr_ValidatePasswordReq3_set_clear_lockout(PyObject *py_obj, PyObject *value, void *closure)
7479 {
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);
7483         return 0;
7484 }
7485
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 },
7493         { NULL }
7494 };
7495
7496 static PyObject *py_samr_ValidatePasswordReq3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7497 {
7498         return pytalloc_new(struct samr_ValidatePasswordReq3, type);
7499 }
7500
7501
7502 static PyTypeObject samr_ValidatePasswordReq3_Type = {
7503         PyObject_HEAD_INIT(NULL) 0,
7504         .tp_name = "samr.ValidatePasswordReq3",
7505         .tp_getset = py_samr_ValidatePasswordReq3_getsetters,
7506         .tp_methods = NULL,
7507         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7508         .tp_basicsize = sizeof(pytalloc_Object),
7509         .tp_new = py_samr_ValidatePasswordReq3_new,
7510 };
7511
7512
7513 static PyObject *py_samr_ValidatePasswordReq2_get_info(PyObject *obj, void *closure)
7514 {
7515         struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7516         PyObject *py_info;
7517         py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7518         return py_info;
7519 }
7520
7521 static int py_samr_ValidatePasswordReq2_set_info(PyObject *py_obj, PyObject *value, void *closure)
7522 {
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) {
7526                 PyErr_NoMemory();
7527                 return -1;
7528         }
7529         object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7530         return 0;
7531 }
7532
7533 static PyObject *py_samr_ValidatePasswordReq2_get_password(PyObject *obj, void *closure)
7534 {
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);
7538         return py_password;
7539 }
7540
7541 static int py_samr_ValidatePasswordReq2_set_password(PyObject *py_obj, PyObject *value, void *closure)
7542 {
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) {
7546                 PyErr_NoMemory();
7547                 return -1;
7548         }
7549         object->password = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7550         return 0;
7551 }
7552
7553 static PyObject *py_samr_ValidatePasswordReq2_get_account(PyObject *obj, void *closure)
7554 {
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);
7558         return py_account;
7559 }
7560
7561 static int py_samr_ValidatePasswordReq2_set_account(PyObject *py_obj, PyObject *value, void *closure)
7562 {
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) {
7566                 PyErr_NoMemory();
7567                 return -1;
7568         }
7569         object->account = *(struct lsa_StringLarge *)pytalloc_get_ptr(value);
7570         return 0;
7571 }
7572
7573 static PyObject *py_samr_ValidatePasswordReq2_get_hash(PyObject *obj, void *closure)
7574 {
7575         struct samr_ValidatePasswordReq2 *object = (struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(obj);
7576         PyObject *py_hash;
7577         py_hash = pytalloc_reference_ex(&samr_ValidationBlob_Type, pytalloc_get_mem_ctx(obj), &object->hash);
7578         return py_hash;
7579 }
7580
7581 static int py_samr_ValidatePasswordReq2_set_hash(PyObject *py_obj, PyObject *value, void *closure)
7582 {
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) {
7586                 PyErr_NoMemory();
7587                 return -1;
7588         }
7589         object->hash = *(struct samr_ValidationBlob *)pytalloc_get_ptr(value);
7590         return 0;
7591 }
7592
7593 static PyObject *py_samr_ValidatePasswordReq2_get_password_matched(PyObject *obj, void *closure)
7594 {
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;
7599 }
7600
7601 static int py_samr_ValidatePasswordReq2_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
7602 {
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);
7606         return 0;
7607 }
7608
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 },
7615         { NULL }
7616 };
7617
7618 static PyObject *py_samr_ValidatePasswordReq2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7619 {
7620         return pytalloc_new(struct samr_ValidatePasswordReq2, type);
7621 }
7622
7623
7624 static PyTypeObject samr_ValidatePasswordReq2_Type = {
7625         PyObject_HEAD_INIT(NULL) 0,
7626         .tp_name = "samr.ValidatePasswordReq2",
7627         .tp_getset = py_samr_ValidatePasswordReq2_getsetters,
7628         .tp_methods = NULL,
7629         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7630         .tp_basicsize = sizeof(pytalloc_Object),
7631         .tp_new = py_samr_ValidatePasswordReq2_new,
7632 };
7633
7634
7635 static PyObject *py_samr_ValidatePasswordReq1_get_info(PyObject *obj, void *closure)
7636 {
7637         struct samr_ValidatePasswordReq1 *object = (struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(obj);
7638         PyObject *py_info;
7639         py_info = pytalloc_reference_ex(&samr_ValidatePasswordInfo_Type, pytalloc_get_mem_ctx(obj), &object->info);
7640         return py_info;
7641 }
7642
7643 static int py_samr_ValidatePasswordReq1_set_info(PyObject *py_obj, PyObject *value, void *closure)
7644 {
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) {
7648                 PyErr_NoMemory();
7649                 return -1;
7650         }
7651         object->info = *(struct samr_ValidatePasswordInfo *)pytalloc_get_ptr(value);
7652         return 0;
7653 }
7654
7655 static PyObject *py_samr_ValidatePasswordReq1_get_password_matched(PyObject *obj, void *closure)
7656 {
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;
7661 }
7662
7663 static int py_samr_ValidatePasswordReq1_set_password_matched(PyObject *py_obj, PyObject *value, void *closure)
7664 {
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);
7668         return 0;
7669 }
7670
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 },
7674         { NULL }
7675 };
7676
7677 static PyObject *py_samr_ValidatePasswordReq1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
7678 {
7679         return pytalloc_new(struct samr_ValidatePasswordReq1, type);
7680 }
7681
7682
7683 static PyTypeObject samr_ValidatePasswordReq1_Type = {
7684         PyObject_HEAD_INIT(NULL) 0,
7685         .tp_name = "samr.ValidatePasswordReq1",
7686         .tp_getset = py_samr_ValidatePasswordReq1_getsetters,
7687         .tp_methods = NULL,
7688         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
7689         .tp_basicsize = sizeof(pytalloc_Object),
7690         .tp_new = py_samr_ValidatePasswordReq1_new,
7691 };
7692
7693 PyObject *py_import_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, union samr_ValidatePasswordReq *in)
7694 {
7695         PyObject *ret;
7696
7697         switch (level) {
7698                 case 1:
7699                         ret = pytalloc_reference_ex(&samr_ValidatePasswordReq1_Type, mem_ctx, &in->req1);
7700                         return ret;
7701
7702                 case 2:
7703                         ret = pytalloc_reference_ex(&samr_ValidatePasswordReq2_Type, mem_ctx, &in->req2);
7704                         return ret;
7705
7706                 case 3:
7707                         ret = pytalloc_reference_ex(&samr_ValidatePasswordReq3_Type, mem_ctx, &in->req3);
7708                         return ret;
7709
7710         }
7711         PyErr_SetString(PyExc_TypeError, "unknown union level");
7712         return NULL;
7713 }
7714
7715 union samr_ValidatePasswordReq *py_export_samr_ValidatePasswordReq(TALLOC_CTX *mem_ctx, int level, PyObject *in)
7716 {
7717         union samr_ValidatePasswordReq *ret = talloc_zero(mem_ctx, union samr_ValidatePasswordReq);
7718         switch (level) {
7719                 case 1:
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) {
7722                                 PyErr_NoMemory();
7723                                 talloc_free(ret); return NULL;
7724                         }
7725                         ret->req1 = *(struct samr_ValidatePasswordReq1 *)pytalloc_get_ptr(in);
7726                         break;
7727
7728                 case 2:
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) {
7731                                 PyErr_NoMemory();
7732                                 talloc_free(ret); return NULL;
7733                         }
7734                         ret->req2 = *(struct samr_ValidatePasswordReq2 *)pytalloc_get_ptr(in);
7735                         break;
7736
7737                 case 3:
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) {
7740                                 PyErr_NoMemory();
7741                                 talloc_free(ret); return NULL;
7742                         }
7743                         ret->req3 = *(struct samr_ValidatePasswordReq3 *)pytalloc_get_ptr(in);
7744                         break;
7745
7746                 default:
7747                         PyErr_SetString(PyExc_TypeError, "invalid union level value");
7748                         talloc_free(ret);
7749                         ret = NULL;
7750         }
7751
7752         return ret;
7753 }
7754
7755
7756 static bool pack_py_samr_Connect_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect *r)
7757 {
7758         PyObject *py_system_name;
7759         PyObject *py_access_mask;
7760         const char *kwnames[] = {
7761                 "system_name", "access_mask", NULL
7762         };
7763
7764         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
7765                 return false;
7766         }
7767
7768         if (py_system_name == Py_None) {
7769                 r->in.system_name = NULL;
7770         } else {
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);
7774         }
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);
7779         } else {
7780                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7781                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7782                 return false;
7783         }
7784         return true;
7785 }
7786
7787 static PyObject *unpack_py_samr_Connect_args_out(struct samr_Connect *r)
7788 {
7789         PyObject *result;
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);
7795                 return NULL;
7796         }
7797
7798         return result;
7799 }
7800
7801 static bool pack_py_samr_Close_args_in(PyObject *args, PyObject *kwargs, struct samr_Close *r)
7802 {
7803         PyObject *py_handle;
7804         const char *kwnames[] = {
7805                 "handle", NULL
7806         };
7807
7808         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Close", discard_const_p(char *, kwnames), &py_handle)) {
7809                 return false;
7810         }
7811
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) {
7815                 PyErr_NoMemory();
7816                 return false;
7817         }
7818         r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
7819         return true;
7820 }
7821
7822 static PyObject *unpack_py_samr_Close_args_out(struct samr_Close *r)
7823 {
7824         PyObject *result;
7825         PyObject *py_handle;
7826         py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
7827         result = py_handle;
7828         if (NT_STATUS_IS_ERR(r->out.result)) {
7829                 PyErr_SetNTSTATUS(r->out.result);
7830                 return NULL;
7831         }
7832
7833         return result;
7834 }
7835
7836 static bool pack_py_samr_SetSecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_SetSecurity *r)
7837 {
7838         PyObject *py_handle;
7839         PyObject *py_sec_info;
7840         PyObject *py_sdbuf;
7841         const char *kwnames[] = {
7842                 "handle", "sec_info", "sdbuf", NULL
7843         };
7844
7845         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetSecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info, &py_sdbuf)) {
7846                 return false;
7847         }
7848
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) {
7852                 PyErr_NoMemory();
7853                 return false;
7854         }
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);
7860         } else {
7861                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7862                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7863                 return false;
7864         }
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) {
7868                 PyErr_NoMemory();
7869                 return false;
7870         }
7871         r->in.sdbuf = (struct sec_desc_buf *)pytalloc_get_ptr(py_sdbuf);
7872         return true;
7873 }
7874
7875 static PyObject *unpack_py_samr_SetSecurity_args_out(struct samr_SetSecurity *r)
7876 {
7877         PyObject *result;
7878         result = Py_None;
7879         Py_INCREF(result);
7880         if (NT_STATUS_IS_ERR(r->out.result)) {
7881                 PyErr_SetNTSTATUS(r->out.result);
7882                 return NULL;
7883         }
7884
7885         return result;
7886 }
7887
7888 static bool pack_py_samr_QuerySecurity_args_in(PyObject *args, PyObject *kwargs, struct samr_QuerySecurity *r)
7889 {
7890         PyObject *py_handle;
7891         PyObject *py_sec_info;
7892         const char *kwnames[] = {
7893                 "handle", "sec_info", NULL
7894         };
7895
7896         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QuerySecurity", discard_const_p(char *, kwnames), &py_handle, &py_sec_info)) {
7897                 return false;
7898         }
7899
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) {
7903                 PyErr_NoMemory();
7904                 return false;
7905         }
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);
7911         } else {
7912                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
7913                   PyInt_Type.tp_name, PyLong_Type.tp_name);
7914                 return false;
7915         }
7916         return true;
7917 }
7918
7919 static PyObject *unpack_py_samr_QuerySecurity_args_out(struct samr_QuerySecurity *r)
7920 {
7921         PyObject *result;
7922         PyObject *py_sdbuf;
7923         if (*r->out.sdbuf == NULL) {
7924                 py_sdbuf = Py_None;
7925                 Py_INCREF(py_sdbuf);
7926         } else {
7927                 py_sdbuf = pytalloc_reference_ex(sec_desc_buf_Type, *r->out.sdbuf, *r->out.sdbuf);
7928         }
7929         result = py_sdbuf;
7930         if (NT_STATUS_IS_ERR(r->out.result)) {
7931                 PyErr_SetNTSTATUS(r->out.result);
7932                 return NULL;
7933         }
7934
7935         return result;
7936 }
7937
7938 static bool pack_py_samr_Shutdown_args_in(PyObject *args, PyObject *kwargs, struct samr_Shutdown *r)
7939 {
7940         PyObject *py_connect_handle;
7941         const char *kwnames[] = {
7942                 "connect_handle", NULL
7943         };
7944
7945         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_Shutdown", discard_const_p(char *, kwnames), &py_connect_handle)) {
7946                 return false;
7947         }
7948
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) {
7952                 PyErr_NoMemory();
7953                 return false;
7954         }
7955         r->in.connect_handle = (struct policy_handle *)pytalloc_get_ptr(py_connect_handle);
7956         return true;
7957 }
7958
7959 static PyObject *unpack_py_samr_Shutdown_args_out(struct samr_Shutdown *r)
7960 {
7961         PyObject *result;
7962         result = Py_None;
7963         Py_INCREF(result);
7964         if (NT_STATUS_IS_ERR(r->out.result)) {
7965                 PyErr_SetNTSTATUS(r->out.result);
7966                 return NULL;
7967         }
7968
7969         return result;
7970 }
7971
7972 static bool pack_py_samr_LookupDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupDomain *r)
7973 {
7974         PyObject *py_connect_handle;
7975         PyObject *py_domain_name;
7976         const char *kwnames[] = {
7977                 "connect_handle", "domain_name", NULL
7978         };
7979
7980         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_domain_name)) {
7981                 return false;
7982         }
7983
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) {
7987                 PyErr_NoMemory();
7988                 return false;
7989         }
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) {
7994                 PyErr_NoMemory();
7995                 return false;
7996         }
7997         r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
7998         return true;
7999 }
8000
8001 static PyObject *unpack_py_samr_LookupDomain_args_out(struct samr_LookupDomain *r)
8002 {
8003         PyObject *result;
8004         PyObject *py_sid;
8005         if (*r->out.sid == NULL) {
8006                 py_sid = Py_None;
8007                 Py_INCREF(py_sid);
8008         } else {
8009                 py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
8010         }
8011         result = py_sid;
8012         if (NT_STATUS_IS_ERR(r->out.result)) {
8013                 PyErr_SetNTSTATUS(r->out.result);
8014                 return NULL;
8015         }
8016
8017         return result;
8018 }
8019
8020 static bool pack_py_samr_EnumDomains_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomains *r)
8021 {
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
8027         };
8028
8029         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomains", discard_const_p(char *, kwnames), &py_connect_handle, &py_resume_handle, &py_buf_size)) {
8030                 return false;
8031         }
8032
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) {
8036                 PyErr_NoMemory();
8037                 return false;
8038         }
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);
8045         return true;
8046 }
8047
8048 static PyObject *unpack_py_samr_EnumDomains_args_out(struct samr_EnumDomains *r)
8049 {
8050         PyObject *result;
8051         PyObject *py_resume_handle;
8052         PyObject *py_sam;
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) {
8058                 py_sam = Py_None;
8059                 Py_INCREF(py_sam);
8060         } else {
8061                 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8062         }
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);
8068                 return NULL;
8069         }
8070
8071         return result;
8072 }
8073
8074 static bool pack_py_samr_OpenDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenDomain *r)
8075 {
8076         PyObject *py_connect_handle;
8077         PyObject *py_access_mask;
8078         PyObject *py_sid;
8079         const char *kwnames[] = {
8080                 "connect_handle", "access_mask", "sid", NULL
8081         };
8082
8083         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenDomain", discard_const_p(char *, kwnames), &py_connect_handle, &py_access_mask, &py_sid)) {
8084                 return false;
8085         }
8086
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) {
8090                 PyErr_NoMemory();
8091                 return false;
8092         }
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);
8098         } else {
8099                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8100                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8101                 return false;
8102         }
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) {
8106                 PyErr_NoMemory();
8107                 return false;
8108         }
8109         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
8110         return true;
8111 }
8112
8113 static PyObject *unpack_py_samr_OpenDomain_args_out(struct samr_OpenDomain *r)
8114 {
8115         PyObject *result;
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);
8121                 return NULL;
8122         }
8123
8124         return result;
8125 }
8126
8127 static bool pack_py_samr_QueryDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo *r)
8128 {
8129         PyObject *py_domain_handle;
8130         PyObject *py_level;
8131         const char *kwnames[] = {
8132                 "domain_handle", "level", NULL
8133         };
8134
8135         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
8136                 return false;
8137         }
8138
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) {
8142                 PyErr_NoMemory();
8143                 return false;
8144         }
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);
8150         } else {
8151                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8152                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8153                 return false;
8154         }
8155         return true;
8156 }
8157
8158 static PyObject *unpack_py_samr_QueryDomainInfo_args_out(struct samr_QueryDomainInfo *r)
8159 {
8160         PyObject *result;
8161         PyObject *py_info;
8162         if (*r->out.info == NULL) {
8163                 py_info = Py_None;
8164                 Py_INCREF(py_info);
8165         } else {
8166                 py_info = py_import_samr_DomainInfo(*r->out.info, r->in.level, *r->out.info);
8167                 if (py_info == NULL) {
8168                         return NULL;
8169                 }
8170         }
8171         result = py_info;
8172         if (NT_STATUS_IS_ERR(r->out.result)) {
8173                 PyErr_SetNTSTATUS(r->out.result);
8174                 return NULL;
8175         }
8176
8177         return result;
8178 }
8179
8180 static bool pack_py_samr_SetDomainInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDomainInfo *r)
8181 {
8182         PyObject *py_domain_handle;
8183         PyObject *py_level;
8184         PyObject *py_info;
8185         const char *kwnames[] = {
8186                 "domain_handle", "level", "info", NULL
8187         };
8188
8189         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDomainInfo", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_info)) {
8190                 return false;
8191         }
8192
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) {
8196                 PyErr_NoMemory();
8197                 return false;
8198         }
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);
8204         } else {
8205                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8206                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8207                 return false;
8208         }
8209         r->in.info = talloc_ptrtype(r, r->in.info);
8210         {
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) {
8214                         return false;
8215                 }
8216                 r->in.info = info_switch_1;
8217         }
8218         return true;
8219 }
8220
8221 static PyObject *unpack_py_samr_SetDomainInfo_args_out(struct samr_SetDomainInfo *r)
8222 {
8223         PyObject *result;
8224         result = Py_None;
8225         Py_INCREF(result);
8226         if (NT_STATUS_IS_ERR(r->out.result)) {
8227                 PyErr_SetNTSTATUS(r->out.result);
8228                 return NULL;
8229         }
8230
8231         return result;
8232 }
8233
8234 static bool pack_py_samr_CreateDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomainGroup *r)
8235 {
8236         PyObject *py_domain_handle;
8237         PyObject *py_name;
8238         PyObject *py_access_mask;
8239         const char *kwnames[] = {
8240                 "domain_handle", "name", "access_mask", NULL
8241         };
8242
8243         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomainGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_name, &py_access_mask)) {
8244                 return false;
8245         }
8246
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) {
8250                 PyErr_NoMemory();
8251                 return false;
8252         }
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) {
8257                 PyErr_NoMemory();
8258                 return false;
8259         }
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);
8265         } else {
8266                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8267                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8268                 return false;
8269         }
8270         return true;
8271 }
8272
8273 static PyObject *unpack_py_samr_CreateDomainGroup_args_out(struct samr_CreateDomainGroup *r)
8274 {
8275         PyObject *result;
8276         PyObject *py_group_handle;
8277         PyObject *py_rid;
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);
8285                 return NULL;
8286         }
8287
8288         return result;
8289 }
8290
8291 static bool pack_py_samr_EnumDomainGroups_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainGroups *r)
8292 {
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
8298         };
8299
8300         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainGroups", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
8301                 return false;
8302         }
8303
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) {
8307                 PyErr_NoMemory();
8308                 return false;
8309         }
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);
8316         return true;
8317 }
8318
8319 static PyObject *unpack_py_samr_EnumDomainGroups_args_out(struct samr_EnumDomainGroups *r)
8320 {
8321         PyObject *result;
8322         PyObject *py_resume_handle;
8323         PyObject *py_sam;
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) {
8329                 py_sam = Py_None;
8330                 Py_INCREF(py_sam);
8331         } else {
8332                 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8333         }
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);
8339                 return NULL;
8340         }
8341
8342         return result;
8343 }
8344
8345 static bool pack_py_samr_CreateUser_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser *r)
8346 {
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
8352         };
8353
8354         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_account_name, &py_access_mask)) {
8355                 return false;
8356         }
8357
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) {
8361                 PyErr_NoMemory();
8362                 return false;
8363         }
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) {
8368                 PyErr_NoMemory();
8369                 return false;
8370         }
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);
8376         } else {
8377                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8378                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8379                 return false;
8380         }
8381         return true;
8382 }
8383
8384 static PyObject *unpack_py_samr_CreateUser_args_out(struct samr_CreateUser *r)
8385 {
8386         PyObject *result;
8387         PyObject *py_user_handle;
8388         PyObject *py_rid;
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);
8396                 return NULL;
8397         }
8398
8399         return result;
8400 }
8401
8402 static bool pack_py_samr_EnumDomainUsers_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainUsers *r)
8403 {
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
8410         };
8411
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)) {
8413                 return false;
8414         }
8415
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) {
8419                 PyErr_NoMemory();
8420                 return false;
8421         }
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);
8430         } else {
8431                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8432                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8433                 return false;
8434         }
8435         PY_CHECK_TYPE(&PyInt_Type, py_max_size, return false;);
8436         r->in.max_size = PyInt_AsLong(py_max_size);
8437         return true;
8438 }
8439
8440 static PyObject *unpack_py_samr_EnumDomainUsers_args_out(struct samr_EnumDomainUsers *r)
8441 {
8442         PyObject *result;
8443         PyObject *py_resume_handle;
8444         PyObject *py_sam;
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) {
8450                 py_sam = Py_None;
8451                 Py_INCREF(py_sam);
8452         } else {
8453                 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8454         }
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);
8460                 return NULL;
8461         }
8462
8463         return result;
8464 }
8465
8466 static bool pack_py_samr_CreateDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateDomAlias *r)
8467 {
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
8473         };
8474
8475         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_CreateDomAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_alias_name, &py_access_mask)) {
8476                 return false;
8477         }
8478
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) {
8482                 PyErr_NoMemory();
8483                 return false;
8484         }
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) {
8489                 PyErr_NoMemory();
8490                 return false;
8491         }
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);
8497         } else {
8498                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8499                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8500                 return false;
8501         }
8502         return true;
8503 }
8504
8505 static PyObject *unpack_py_samr_CreateDomAlias_args_out(struct samr_CreateDomAlias *r)
8506 {
8507         PyObject *result;
8508         PyObject *py_alias_handle;
8509         PyObject *py_rid;
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);
8517                 return NULL;
8518         }
8519
8520         return result;
8521 }
8522
8523 static bool pack_py_samr_EnumDomainAliases_args_in(PyObject *args, PyObject *kwargs, struct samr_EnumDomainAliases *r)
8524 {
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
8530         };
8531
8532         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_EnumDomainAliases", discard_const_p(char *, kwnames), &py_domain_handle, &py_resume_handle, &py_max_size)) {
8533                 return false;
8534         }
8535
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) {
8539                 PyErr_NoMemory();
8540                 return false;
8541         }
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);
8548         return true;
8549 }
8550
8551 static PyObject *unpack_py_samr_EnumDomainAliases_args_out(struct samr_EnumDomainAliases *r)
8552 {
8553         PyObject *result;
8554         PyObject *py_resume_handle;
8555         PyObject *py_sam;
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) {
8561                 py_sam = Py_None;
8562                 Py_INCREF(py_sam);
8563         } else {
8564                 py_sam = pytalloc_reference_ex(&samr_SamArray_Type, *r->out.sam, *r->out.sam);
8565         }
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);
8571                 return NULL;
8572         }
8573
8574         return result;
8575 }
8576
8577 static bool pack_py_samr_GetAliasMembership_args_in(PyObject *args, PyObject *kwargs, struct samr_GetAliasMembership *r)
8578 {
8579         PyObject *py_domain_handle;
8580         PyObject *py_sids;
8581         const char *kwnames[] = {
8582                 "domain_handle", "sids", NULL
8583         };
8584
8585         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_GetAliasMembership", discard_const_p(char *, kwnames), &py_domain_handle, &py_sids)) {
8586                 return false;
8587         }
8588
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) {
8592                 PyErr_NoMemory();
8593                 return false;
8594         }
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) {
8599                 PyErr_NoMemory();
8600                 return false;
8601         }
8602         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
8603         return true;
8604 }
8605
8606 static PyObject *unpack_py_samr_GetAliasMembership_args_out(struct samr_GetAliasMembership *r)
8607 {
8608         PyObject *result;
8609         PyObject *py_rids;
8610         py_rids = pytalloc_reference_ex(&samr_Ids_Type, r->out.rids, r->out.rids);
8611         result = py_rids;
8612         if (NT_STATUS_IS_ERR(r->out.result)) {
8613                 PyErr_SetNTSTATUS(r->out.result);
8614                 return NULL;
8615         }
8616
8617         return result;
8618 }
8619
8620 static bool pack_py_samr_LookupNames_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupNames *r)
8621 {
8622         PyObject *py_domain_handle;
8623         PyObject *py_names;
8624         const char *kwnames[] = {
8625                 "domain_handle", "names", NULL
8626         };
8627
8628         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupNames", discard_const_p(char *, kwnames), &py_domain_handle, &py_names)) {
8629                 return false;
8630         }
8631
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) {
8635                 PyErr_NoMemory();
8636                 return false;
8637         }
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;);
8642         {
8643                 int names_cntr_0;
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) {
8650                                 PyErr_NoMemory();
8651                                 return false;
8652                         }
8653                         r->in.names[names_cntr_0] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(py_names, names_cntr_0));
8654                 }
8655         }
8656         return true;
8657 }
8658
8659 static PyObject *unpack_py_samr_LookupNames_args_out(struct samr_LookupNames *r)
8660 {
8661         PyObject *result;
8662         PyObject *py_rids;
8663         PyObject *py_types;
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);
8671                 return NULL;
8672         }
8673
8674         return result;
8675 }
8676
8677 static bool pack_py_samr_LookupRids_args_in(PyObject *args, PyObject *kwargs, struct samr_LookupRids *r)
8678 {
8679         PyObject *py_domain_handle;
8680         PyObject *py_rids;
8681         const char *kwnames[] = {
8682                 "domain_handle", "rids", NULL
8683         };
8684
8685         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_LookupRids", discard_const_p(char *, kwnames), &py_domain_handle, &py_rids)) {
8686                 return false;
8687         }
8688
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) {
8692                 PyErr_NoMemory();
8693                 return false;
8694         }
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;);
8699         {
8700                 int rids_cntr_0;
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));
8707                 }
8708         }
8709         return true;
8710 }
8711
8712 static PyObject *unpack_py_samr_LookupRids_args_out(struct samr_LookupRids *r)
8713 {
8714         PyObject *result;
8715         PyObject *py_names;
8716         PyObject *py_types;
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);
8724                 return NULL;
8725         }
8726
8727         return result;
8728 }
8729
8730 static bool pack_py_samr_OpenGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenGroup *r)
8731 {
8732         PyObject *py_domain_handle;
8733         PyObject *py_access_mask;
8734         PyObject *py_rid;
8735         const char *kwnames[] = {
8736                 "domain_handle", "access_mask", "rid", NULL
8737         };
8738
8739         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenGroup", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
8740                 return false;
8741         }
8742
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) {
8746                 PyErr_NoMemory();
8747                 return false;
8748         }
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);
8754         } else {
8755                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8756                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8757                 return false;
8758         }
8759         PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
8760         r->in.rid = PyInt_AsLong(py_rid);
8761         return true;
8762 }
8763
8764 static PyObject *unpack_py_samr_OpenGroup_args_out(struct samr_OpenGroup *r)
8765 {
8766         PyObject *result;
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);
8772                 return NULL;
8773         }
8774
8775         return result;
8776 }
8777
8778 static bool pack_py_samr_QueryGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupInfo *r)
8779 {
8780         PyObject *py_group_handle;
8781         PyObject *py_level;
8782         const char *kwnames[] = {
8783                 "group_handle", "level", NULL
8784         };
8785
8786         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level)) {
8787                 return false;
8788         }
8789
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) {
8793                 PyErr_NoMemory();
8794                 return false;
8795         }
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);
8801         } else {
8802                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8803                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8804                 return false;
8805         }
8806         return true;
8807 }
8808
8809 static PyObject *unpack_py_samr_QueryGroupInfo_args_out(struct samr_QueryGroupInfo *r)
8810 {
8811         PyObject *result;
8812         PyObject *py_info;
8813         if (*r->out.info == NULL) {
8814                 py_info = Py_None;
8815                 Py_INCREF(py_info);
8816         } else {
8817                 py_info = py_import_samr_GroupInfo(*r->out.info, r->in.level, *r->out.info);
8818                 if (py_info == NULL) {
8819                         return NULL;
8820                 }
8821         }
8822         result = py_info;
8823         if (NT_STATUS_IS_ERR(r->out.result)) {
8824                 PyErr_SetNTSTATUS(r->out.result);
8825                 return NULL;
8826         }
8827
8828         return result;
8829 }
8830
8831 static bool pack_py_samr_SetGroupInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetGroupInfo *r)
8832 {
8833         PyObject *py_group_handle;
8834         PyObject *py_level;
8835         PyObject *py_info;
8836         const char *kwnames[] = {
8837                 "group_handle", "level", "info", NULL
8838         };
8839
8840         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetGroupInfo", discard_const_p(char *, kwnames), &py_group_handle, &py_level, &py_info)) {
8841                 return false;
8842         }
8843
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) {
8847                 PyErr_NoMemory();
8848                 return false;
8849         }
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);
8855         } else {
8856                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
8857                   PyInt_Type.tp_name, PyLong_Type.tp_name);
8858                 return false;
8859         }
8860         r->in.info = talloc_ptrtype(r, r->in.info);
8861         {
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) {
8865                         return false;
8866                 }
8867                 r->in.info = info_switch_1;
8868         }
8869         return true;
8870 }
8871
8872 static PyObject *unpack_py_samr_SetGroupInfo_args_out(struct samr_SetGroupInfo *r)
8873 {
8874         PyObject *result;
8875         result = Py_None;
8876         Py_INCREF(result);
8877         if (NT_STATUS_IS_ERR(r->out.result)) {
8878                 PyErr_SetNTSTATUS(r->out.result);
8879                 return NULL;
8880         }
8881
8882         return result;
8883 }
8884
8885 static bool pack_py_samr_AddGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddGroupMember *r)
8886 {
8887         PyObject *py_group_handle;
8888         PyObject *py_rid;
8889         PyObject *py_flags;
8890         const char *kwnames[] = {
8891                 "group_handle", "rid", "flags", NULL
8892         };
8893
8894         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_AddGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid, &py_flags)) {
8895                 return false;
8896         }
8897
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) {
8901                 PyErr_NoMemory();
8902                 return false;
8903         }
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);
8909         return true;
8910 }
8911
8912 static PyObject *unpack_py_samr_AddGroupMember_args_out(struct samr_AddGroupMember *r)
8913 {
8914         PyObject *result;
8915         result = Py_None;
8916         Py_INCREF(result);
8917         if (NT_STATUS_IS_ERR(r->out.result)) {
8918                 PyErr_SetNTSTATUS(r->out.result);
8919                 return NULL;
8920         }
8921
8922         return result;
8923 }
8924
8925 static bool pack_py_samr_DeleteDomainGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomainGroup *r)
8926 {
8927         PyObject *py_group_handle;
8928         const char *kwnames[] = {
8929                 "group_handle", NULL
8930         };
8931
8932         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomainGroup", discard_const_p(char *, kwnames), &py_group_handle)) {
8933                 return false;
8934         }
8935
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) {
8939                 PyErr_NoMemory();
8940                 return false;
8941         }
8942         r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
8943         return true;
8944 }
8945
8946 static PyObject *unpack_py_samr_DeleteDomainGroup_args_out(struct samr_DeleteDomainGroup *r)
8947 {
8948         PyObject *result;
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);
8954                 return NULL;
8955         }
8956
8957         return result;
8958 }
8959
8960 static bool pack_py_samr_DeleteGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteGroupMember *r)
8961 {
8962         PyObject *py_group_handle;
8963         PyObject *py_rid;
8964         const char *kwnames[] = {
8965                 "group_handle", "rid", NULL
8966         };
8967
8968         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteGroupMember", discard_const_p(char *, kwnames), &py_group_handle, &py_rid)) {
8969                 return false;
8970         }
8971
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) {
8975                 PyErr_NoMemory();
8976                 return false;
8977         }
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);
8981         return true;
8982 }
8983
8984 static PyObject *unpack_py_samr_DeleteGroupMember_args_out(struct samr_DeleteGroupMember *r)
8985 {
8986         PyObject *result;
8987         result = Py_None;
8988         Py_INCREF(result);
8989         if (NT_STATUS_IS_ERR(r->out.result)) {
8990                 PyErr_SetNTSTATUS(r->out.result);
8991                 return NULL;
8992         }
8993
8994         return result;
8995 }
8996
8997 static bool pack_py_samr_QueryGroupMember_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryGroupMember *r)
8998 {
8999         PyObject *py_group_handle;
9000         const char *kwnames[] = {
9001                 "group_handle", NULL
9002         };
9003
9004         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_QueryGroupMember", discard_const_p(char *, kwnames), &py_group_handle)) {
9005                 return false;
9006         }
9007
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) {
9011                 PyErr_NoMemory();
9012                 return false;
9013         }
9014         r->in.group_handle = (struct policy_handle *)pytalloc_get_ptr(py_group_handle);
9015         return true;
9016 }
9017
9018 static PyObject *unpack_py_samr_QueryGroupMember_args_out(struct samr_QueryGroupMember *r)
9019 {
9020         PyObject *result;
9021         PyObject *py_rids;
9022         if (*r->out.rids == NULL) {
9023                 py_rids = Py_None;
9024                 Py_INCREF(py_rids);
9025         } else {
9026                 py_rids = pytalloc_reference_ex(&samr_RidAttrArray_Type, *r->out.rids, *r->out.rids);
9027         }
9028         result = py_rids;
9029         if (NT_STATUS_IS_ERR(r->out.result)) {
9030                 PyErr_SetNTSTATUS(r->out.result);
9031                 return NULL;
9032         }
9033
9034         return result;
9035 }
9036
9037 static bool pack_py_samr_SetMemberAttributesOfGroup_args_in(PyObject *args, PyObject *kwargs, struct samr_SetMemberAttributesOfGroup *r)
9038 {
9039         PyObject *py_group_handle;
9040         PyObject *py_unknown1;
9041         PyObject *py_unknown2;
9042         const char *kwnames[] = {
9043                 "group_handle", "unknown1", "unknown2", NULL
9044         };
9045
9046         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetMemberAttributesOfGroup", discard_const_p(char *, kwnames), &py_group_handle, &py_unknown1, &py_unknown2)) {
9047                 return false;
9048         }
9049
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) {
9053                 PyErr_NoMemory();
9054                 return false;
9055         }
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);
9061         return true;
9062 }
9063
9064 static PyObject *unpack_py_samr_SetMemberAttributesOfGroup_args_out(struct samr_SetMemberAttributesOfGroup *r)
9065 {
9066         PyObject *result;
9067         result = Py_None;
9068         Py_INCREF(result);
9069         if (NT_STATUS_IS_ERR(r->out.result)) {
9070                 PyErr_SetNTSTATUS(r->out.result);
9071                 return NULL;
9072         }
9073
9074         return result;
9075 }
9076
9077 static bool pack_py_samr_OpenAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenAlias *r)
9078 {
9079         PyObject *py_domain_handle;
9080         PyObject *py_access_mask;
9081         PyObject *py_rid;
9082         const char *kwnames[] = {
9083                 "domain_handle", "access_mask", "rid", NULL
9084         };
9085
9086         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenAlias", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
9087                 return false;
9088         }
9089
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) {
9093                 PyErr_NoMemory();
9094                 return false;
9095         }
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);
9101         } else {
9102                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9103                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9104                 return false;
9105         }
9106         PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
9107         r->in.rid = PyInt_AsLong(py_rid);
9108         return true;
9109 }
9110
9111 static PyObject *unpack_py_samr_OpenAlias_args_out(struct samr_OpenAlias *r)
9112 {
9113         PyObject *result;
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);
9119                 return NULL;
9120         }
9121
9122         return result;
9123 }
9124
9125 static bool pack_py_samr_QueryAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryAliasInfo *r)
9126 {
9127         PyObject *py_alias_handle;
9128         PyObject *py_level;
9129         const char *kwnames[] = {
9130                 "alias_handle", "level", NULL
9131         };
9132
9133         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level)) {
9134                 return false;
9135         }
9136
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) {
9140                 PyErr_NoMemory();
9141                 return false;
9142         }
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);
9148         } else {
9149                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9150                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9151                 return false;
9152         }
9153         return true;
9154 }
9155
9156 static PyObject *unpack_py_samr_QueryAliasInfo_args_out(struct samr_QueryAliasInfo *r)
9157 {
9158         PyObject *result;
9159         PyObject *py_info;
9160         if (*r->out.info == NULL) {
9161                 py_info = Py_None;
9162                 Py_INCREF(py_info);
9163         } else {
9164                 py_info = py_import_samr_AliasInfo(*r->out.info, r->in.level, *r->out.info);
9165                 if (py_info == NULL) {
9166                         return NULL;
9167                 }
9168         }
9169         result = py_info;
9170         if (NT_STATUS_IS_ERR(r->out.result)) {
9171                 PyErr_SetNTSTATUS(r->out.result);
9172                 return NULL;
9173         }
9174
9175         return result;
9176 }
9177
9178 static bool pack_py_samr_SetAliasInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetAliasInfo *r)
9179 {
9180         PyObject *py_alias_handle;
9181         PyObject *py_level;
9182         PyObject *py_info;
9183         const char *kwnames[] = {
9184                 "alias_handle", "level", "info", NULL
9185         };
9186
9187         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetAliasInfo", discard_const_p(char *, kwnames), &py_alias_handle, &py_level, &py_info)) {
9188                 return false;
9189         }
9190
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) {
9194                 PyErr_NoMemory();
9195                 return false;
9196         }
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);
9202         } else {
9203                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9204                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9205                 return false;
9206         }
9207         r->in.info = talloc_ptrtype(r, r->in.info);
9208         {
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) {
9212                         return false;
9213                 }
9214                 r->in.info = info_switch_1;
9215         }
9216         return true;
9217 }
9218
9219 static PyObject *unpack_py_samr_SetAliasInfo_args_out(struct samr_SetAliasInfo *r)
9220 {
9221         PyObject *result;
9222         result = Py_None;
9223         Py_INCREF(result);
9224         if (NT_STATUS_IS_ERR(r->out.result)) {
9225                 PyErr_SetNTSTATUS(r->out.result);
9226                 return NULL;
9227         }
9228
9229         return result;
9230 }
9231
9232 static bool pack_py_samr_DeleteDomAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteDomAlias *r)
9233 {
9234         PyObject *py_alias_handle;
9235         const char *kwnames[] = {
9236                 "alias_handle", NULL
9237         };
9238
9239         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteDomAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
9240                 return false;
9241         }
9242
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) {
9246                 PyErr_NoMemory();
9247                 return false;
9248         }
9249         r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9250         return true;
9251 }
9252
9253 static PyObject *unpack_py_samr_DeleteDomAlias_args_out(struct samr_DeleteDomAlias *r)
9254 {
9255         PyObject *result;
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);
9261                 return NULL;
9262         }
9263
9264         return result;
9265 }
9266
9267 static bool pack_py_samr_AddAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_AddAliasMember *r)
9268 {
9269         PyObject *py_alias_handle;
9270         PyObject *py_sid;
9271         const char *kwnames[] = {
9272                 "alias_handle", "sid", NULL
9273         };
9274
9275         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
9276                 return false;
9277         }
9278
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) {
9282                 PyErr_NoMemory();
9283                 return false;
9284         }
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) {
9289                 PyErr_NoMemory();
9290                 return false;
9291         }
9292         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9293         return true;
9294 }
9295
9296 static PyObject *unpack_py_samr_AddAliasMember_args_out(struct samr_AddAliasMember *r)
9297 {
9298         PyObject *result;
9299         result = Py_None;
9300         Py_INCREF(result);
9301         if (NT_STATUS_IS_ERR(r->out.result)) {
9302                 PyErr_SetNTSTATUS(r->out.result);
9303                 return NULL;
9304         }
9305
9306         return result;
9307 }
9308
9309 static bool pack_py_samr_DeleteAliasMember_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteAliasMember *r)
9310 {
9311         PyObject *py_alias_handle;
9312         PyObject *py_sid;
9313         const char *kwnames[] = {
9314                 "alias_handle", "sid", NULL
9315         };
9316
9317         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_DeleteAliasMember", discard_const_p(char *, kwnames), &py_alias_handle, &py_sid)) {
9318                 return false;
9319         }
9320
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) {
9324                 PyErr_NoMemory();
9325                 return false;
9326         }
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) {
9331                 PyErr_NoMemory();
9332                 return false;
9333         }
9334         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9335         return true;
9336 }
9337
9338 static PyObject *unpack_py_samr_DeleteAliasMember_args_out(struct samr_DeleteAliasMember *r)
9339 {
9340         PyObject *result;
9341         result = Py_None;
9342         Py_INCREF(result);
9343         if (NT_STATUS_IS_ERR(r->out.result)) {
9344                 PyErr_SetNTSTATUS(r->out.result);
9345                 return NULL;
9346         }
9347
9348         return result;
9349 }
9350
9351 static bool pack_py_samr_GetMembersInAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_GetMembersInAlias *r)
9352 {
9353         PyObject *py_alias_handle;
9354         const char *kwnames[] = {
9355                 "alias_handle", NULL
9356         };
9357
9358         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetMembersInAlias", discard_const_p(char *, kwnames), &py_alias_handle)) {
9359                 return false;
9360         }
9361
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) {
9365                 PyErr_NoMemory();
9366                 return false;
9367         }
9368         r->in.alias_handle = (struct policy_handle *)pytalloc_get_ptr(py_alias_handle);
9369         return true;
9370 }
9371
9372 static PyObject *unpack_py_samr_GetMembersInAlias_args_out(struct samr_GetMembersInAlias *r)
9373 {
9374         PyObject *result;
9375         PyObject *py_sids;
9376         py_sids = pytalloc_reference_ex(lsa_SidArray_Type, r->out.sids, r->out.sids);
9377         result = py_sids;
9378         if (NT_STATUS_IS_ERR(r->out.result)) {
9379                 PyErr_SetNTSTATUS(r->out.result);
9380                 return NULL;
9381         }
9382
9383         return result;
9384 }
9385
9386 static bool pack_py_samr_OpenUser_args_in(PyObject *args, PyObject *kwargs, struct samr_OpenUser *r)
9387 {
9388         PyObject *py_domain_handle;
9389         PyObject *py_access_mask;
9390         PyObject *py_rid;
9391         const char *kwnames[] = {
9392                 "domain_handle", "access_mask", "rid", NULL
9393         };
9394
9395         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_OpenUser", discard_const_p(char *, kwnames), &py_domain_handle, &py_access_mask, &py_rid)) {
9396                 return false;
9397         }
9398
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) {
9402                 PyErr_NoMemory();
9403                 return false;
9404         }
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);
9410         } else {
9411                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9412                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9413                 return false;
9414         }
9415         PY_CHECK_TYPE(&PyInt_Type, py_rid, return false;);
9416         r->in.rid = PyInt_AsLong(py_rid);
9417         return true;
9418 }
9419
9420 static PyObject *unpack_py_samr_OpenUser_args_out(struct samr_OpenUser *r)
9421 {
9422         PyObject *result;
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);
9428                 return NULL;
9429         }
9430
9431         return result;
9432 }
9433
9434 static bool pack_py_samr_DeleteUser_args_in(PyObject *args, PyObject *kwargs, struct samr_DeleteUser *r)
9435 {
9436         PyObject *py_user_handle;
9437         const char *kwnames[] = {
9438                 "user_handle", NULL
9439         };
9440
9441         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_DeleteUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9442                 return false;
9443         }
9444
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) {
9448                 PyErr_NoMemory();
9449                 return false;
9450         }
9451         r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9452         return true;
9453 }
9454
9455 static PyObject *unpack_py_samr_DeleteUser_args_out(struct samr_DeleteUser *r)
9456 {
9457         PyObject *result;
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);
9463                 return NULL;
9464         }
9465
9466         return result;
9467 }
9468
9469 static bool pack_py_samr_QueryUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo *r)
9470 {
9471         PyObject *py_user_handle;
9472         PyObject *py_level;
9473         const char *kwnames[] = {
9474                 "user_handle", "level", NULL
9475         };
9476
9477         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
9478                 return false;
9479         }
9480
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) {
9484                 PyErr_NoMemory();
9485                 return false;
9486         }
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);
9492         } else {
9493                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9494                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9495                 return false;
9496         }
9497         return true;
9498 }
9499
9500 static PyObject *unpack_py_samr_QueryUserInfo_args_out(struct samr_QueryUserInfo *r)
9501 {
9502         PyObject *result;
9503         PyObject *py_info;
9504         if (*r->out.info == NULL) {
9505                 py_info = Py_None;
9506                 Py_INCREF(py_info);
9507         } else {
9508                 py_info = py_import_samr_UserInfo(*r->out.info, r->in.level, *r->out.info);
9509                 if (py_info == NULL) {
9510                         return NULL;
9511                 }
9512         }
9513         result = py_info;
9514         if (NT_STATUS_IS_ERR(r->out.result)) {
9515                 PyErr_SetNTSTATUS(r->out.result);
9516                 return NULL;
9517         }
9518
9519         return result;
9520 }
9521
9522 static bool pack_py_samr_SetUserInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo *r)
9523 {
9524         PyObject *py_user_handle;
9525         PyObject *py_level;
9526         PyObject *py_info;
9527         const char *kwnames[] = {
9528                 "user_handle", "level", "info", NULL
9529         };
9530
9531         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
9532                 return false;
9533         }
9534
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) {
9538                 PyErr_NoMemory();
9539                 return false;
9540         }
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);
9546         } else {
9547                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
9548                   PyInt_Type.tp_name, PyLong_Type.tp_name);
9549                 return false;
9550         }
9551         r->in.info = talloc_ptrtype(r, r->in.info);
9552         {
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) {
9556                         return false;
9557                 }
9558                 r->in.info = info_switch_1;
9559         }
9560         return true;
9561 }
9562
9563 static PyObject *unpack_py_samr_SetUserInfo_args_out(struct samr_SetUserInfo *r)
9564 {
9565         PyObject *result;
9566         result = Py_None;
9567         Py_INCREF(result);
9568         if (NT_STATUS_IS_ERR(r->out.result)) {
9569                 PyErr_SetNTSTATUS(r->out.result);
9570                 return NULL;
9571         }
9572
9573         return result;
9574 }
9575
9576 static bool pack_py_samr_ChangePasswordUser_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser *r)
9577 {
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
9591         };
9592
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)) {
9594                 return false;
9595         }
9596
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) {
9600                 PyErr_NoMemory();
9601                 return false;
9602         }
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;
9608         } else {
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) {
9612                         PyErr_NoMemory();
9613                         return false;
9614                 }
9615                 r->in.old_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_lm_crypted);
9616         }
9617         if (py_new_lm_crypted == Py_None) {
9618                 r->in.new_lm_crypted = NULL;
9619         } else {
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) {
9623                         PyErr_NoMemory();
9624                         return false;
9625                 }
9626                 r->in.new_lm_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_lm_crypted);
9627         }
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;
9632         } else {
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) {
9636                         PyErr_NoMemory();
9637                         return false;
9638                 }
9639                 r->in.old_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_old_nt_crypted);
9640         }
9641         if (py_new_nt_crypted == Py_None) {
9642                 r->in.new_nt_crypted = NULL;
9643         } else {
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) {
9647                         PyErr_NoMemory();
9648                         return false;
9649                 }
9650                 r->in.new_nt_crypted = (struct samr_Password *)pytalloc_get_ptr(py_new_nt_crypted);
9651         }
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;
9656         } else {
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) {
9660                         PyErr_NoMemory();
9661                         return false;
9662                 }
9663                 r->in.nt_cross = (struct samr_Password *)pytalloc_get_ptr(py_nt_cross);
9664         }
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;
9669         } else {
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) {
9673                         PyErr_NoMemory();
9674                         return false;
9675                 }
9676                 r->in.lm_cross = (struct samr_Password *)pytalloc_get_ptr(py_lm_cross);
9677         }
9678         return true;
9679 }
9680
9681 static PyObject *unpack_py_samr_ChangePasswordUser_args_out(struct samr_ChangePasswordUser *r)
9682 {
9683         PyObject *result;
9684         result = Py_None;
9685         Py_INCREF(result);
9686         if (NT_STATUS_IS_ERR(r->out.result)) {
9687                 PyErr_SetNTSTATUS(r->out.result);
9688                 return NULL;
9689         }
9690
9691         return result;
9692 }
9693
9694 static bool pack_py_samr_GetGroupsForUser_args_in(PyObject *args, PyObject *kwargs, struct samr_GetGroupsForUser *r)
9695 {
9696         PyObject *py_user_handle;
9697         const char *kwnames[] = {
9698                 "user_handle", NULL
9699         };
9700
9701         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetGroupsForUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9702                 return false;
9703         }
9704
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) {
9708                 PyErr_NoMemory();
9709                 return false;
9710         }
9711         r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9712         return true;
9713 }
9714
9715 static PyObject *unpack_py_samr_GetGroupsForUser_args_out(struct samr_GetGroupsForUser *r)
9716 {
9717         PyObject *result;
9718         PyObject *py_rids;
9719         if (*r->out.rids == NULL) {
9720                 py_rids = Py_None;
9721                 Py_INCREF(py_rids);
9722         } else {
9723                 py_rids = pytalloc_reference_ex(&samr_RidWithAttributeArray_Type, *r->out.rids, *r->out.rids);
9724         }
9725         result = py_rids;
9726         if (NT_STATUS_IS_ERR(r->out.result)) {
9727                 PyErr_SetNTSTATUS(r->out.result);
9728                 return NULL;
9729         }
9730
9731         return result;
9732 }
9733
9734 static bool pack_py_samr_QueryDisplayInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo *r)
9735 {
9736         PyObject *py_domain_handle;
9737         PyObject *py_level;
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
9743         };
9744
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)) {
9746                 return false;
9747         }
9748
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) {
9752                 PyErr_NoMemory();
9753                 return false;
9754         }
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);
9764         return true;
9765 }
9766
9767 static PyObject *unpack_py_samr_QueryDisplayInfo_args_out(struct samr_QueryDisplayInfo *r)
9768 {
9769         PyObject *result;
9770         PyObject *py_total_size;
9771         PyObject *py_returned_size;
9772         PyObject *py_info;
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) {
9780                 return NULL;
9781         }
9782         PyTuple_SetItem(result, 2, py_info);
9783         if (NT_STATUS_IS_ERR(r->out.result)) {
9784                 PyErr_SetNTSTATUS(r->out.result);
9785                 return NULL;
9786         }
9787
9788         return result;
9789 }
9790
9791 static bool pack_py_samr_GetDisplayEnumerationIndex_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex *r)
9792 {
9793         PyObject *py_domain_handle;
9794         PyObject *py_level;
9795         PyObject *py_name;
9796         const char *kwnames[] = {
9797                 "domain_handle", "level", "name", NULL
9798         };
9799
9800         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
9801                 return false;
9802         }
9803
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) {
9807                 PyErr_NoMemory();
9808                 return false;
9809         }
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) {
9816                 PyErr_NoMemory();
9817                 return false;
9818         }
9819         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
9820         return true;
9821 }
9822
9823 static PyObject *unpack_py_samr_GetDisplayEnumerationIndex_args_out(struct samr_GetDisplayEnumerationIndex *r)
9824 {
9825         PyObject *result;
9826         PyObject *py_idx;
9827         py_idx = PyInt_FromLong(*r->out.idx);
9828         result = py_idx;
9829         if (NT_STATUS_IS_ERR(r->out.result)) {
9830                 PyErr_SetNTSTATUS(r->out.result);
9831                 return NULL;
9832         }
9833
9834         return result;
9835 }
9836
9837 static bool pack_py_samr_TestPrivateFunctionsDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsDomain *r)
9838 {
9839         PyObject *py_domain_handle;
9840         const char *kwnames[] = {
9841                 "domain_handle", NULL
9842         };
9843
9844         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsDomain", discard_const_p(char *, kwnames), &py_domain_handle)) {
9845                 return false;
9846         }
9847
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) {
9851                 PyErr_NoMemory();
9852                 return false;
9853         }
9854         r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
9855         return true;
9856 }
9857
9858 static PyObject *unpack_py_samr_TestPrivateFunctionsDomain_args_out(struct samr_TestPrivateFunctionsDomain *r)
9859 {
9860         PyObject *result;
9861         result = Py_None;
9862         Py_INCREF(result);
9863         if (NT_STATUS_IS_ERR(r->out.result)) {
9864                 PyErr_SetNTSTATUS(r->out.result);
9865                 return NULL;
9866         }
9867
9868         return result;
9869 }
9870
9871 static bool pack_py_samr_TestPrivateFunctionsUser_args_in(PyObject *args, PyObject *kwargs, struct samr_TestPrivateFunctionsUser *r)
9872 {
9873         PyObject *py_user_handle;
9874         const char *kwnames[] = {
9875                 "user_handle", NULL
9876         };
9877
9878         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_TestPrivateFunctionsUser", discard_const_p(char *, kwnames), &py_user_handle)) {
9879                 return false;
9880         }
9881
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) {
9885                 PyErr_NoMemory();
9886                 return false;
9887         }
9888         r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9889         return true;
9890 }
9891
9892 static PyObject *unpack_py_samr_TestPrivateFunctionsUser_args_out(struct samr_TestPrivateFunctionsUser *r)
9893 {
9894         PyObject *result;
9895         result = Py_None;
9896         Py_INCREF(result);
9897         if (NT_STATUS_IS_ERR(r->out.result)) {
9898                 PyErr_SetNTSTATUS(r->out.result);
9899                 return NULL;
9900         }
9901
9902         return result;
9903 }
9904
9905 static bool pack_py_samr_GetUserPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetUserPwInfo *r)
9906 {
9907         PyObject *py_user_handle;
9908         const char *kwnames[] = {
9909                 "user_handle", NULL
9910         };
9911
9912         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetUserPwInfo", discard_const_p(char *, kwnames), &py_user_handle)) {
9913                 return false;
9914         }
9915
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) {
9919                 PyErr_NoMemory();
9920                 return false;
9921         }
9922         r->in.user_handle = (struct policy_handle *)pytalloc_get_ptr(py_user_handle);
9923         return true;
9924 }
9925
9926 static PyObject *unpack_py_samr_GetUserPwInfo_args_out(struct samr_GetUserPwInfo *r)
9927 {
9928         PyObject *result;
9929         PyObject *py_info;
9930         py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
9931         result = py_info;
9932         if (NT_STATUS_IS_ERR(r->out.result)) {
9933                 PyErr_SetNTSTATUS(r->out.result);
9934                 return NULL;
9935         }
9936
9937         return result;
9938 }
9939
9940 static bool pack_py_samr_RemoveMemberFromForeignDomain_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMemberFromForeignDomain *r)
9941 {
9942         PyObject *py_domain_handle;
9943         PyObject *py_sid;
9944         const char *kwnames[] = {
9945                 "domain_handle", "sid", NULL
9946         };
9947
9948         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMemberFromForeignDomain", discard_const_p(char *, kwnames), &py_domain_handle, &py_sid)) {
9949                 return false;
9950         }
9951
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) {
9955                 PyErr_NoMemory();
9956                 return false;
9957         }
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) {
9962                 PyErr_NoMemory();
9963                 return false;
9964         }
9965         r->in.sid = (struct dom_sid *)pytalloc_get_ptr(py_sid);
9966         return true;
9967 }
9968
9969 static PyObject *unpack_py_samr_RemoveMemberFromForeignDomain_args_out(struct samr_RemoveMemberFromForeignDomain *r)
9970 {
9971         PyObject *result;
9972         result = Py_None;
9973         Py_INCREF(result);
9974         if (NT_STATUS_IS_ERR(r->out.result)) {
9975                 PyErr_SetNTSTATUS(r->out.result);
9976                 return NULL;
9977         }
9978
9979         return result;
9980 }
9981
9982 static bool pack_py_samr_QueryDomainInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDomainInfo2 *r)
9983 {
9984         PyObject *py_domain_handle;
9985         PyObject *py_level;
9986         const char *kwnames[] = {
9987                 "domain_handle", "level", NULL
9988         };
9989
9990         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryDomainInfo2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level)) {
9991                 return false;
9992         }
9993
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) {
9997                 PyErr_NoMemory();
9998                 return false;
9999         }
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);
10005         } else {
10006                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10007                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10008                 return false;
10009         }
10010         return true;
10011 }
10012
10013 static PyObject *unpack_py_samr_QueryDomainInfo2_args_out(struct samr_QueryDomainInfo2 *r)
10014 {
10015         PyObject *result;
10016         PyObject *py_info;
10017         if (*r->out.info == NULL) {
10018                 py_info = Py_None;
10019                 Py_INCREF(py_info);
10020         } else {
10021                 py_info = py_import_samr_DomainInfo(*r->out.info, r->in.level, *r->out.info);
10022                 if (py_info == NULL) {
10023                         return NULL;
10024                 }
10025         }
10026         result = py_info;
10027         if (NT_STATUS_IS_ERR(r->out.result)) {
10028                 PyErr_SetNTSTATUS(r->out.result);
10029                 return NULL;
10030         }
10031
10032         return result;
10033 }
10034
10035 static bool pack_py_samr_QueryUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryUserInfo2 *r)
10036 {
10037         PyObject *py_user_handle;
10038         PyObject *py_level;
10039         const char *kwnames[] = {
10040                 "user_handle", "level", NULL
10041         };
10042
10043         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_QueryUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level)) {
10044                 return false;
10045         }
10046
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) {
10050                 PyErr_NoMemory();
10051                 return false;
10052         }
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);
10058         } else {
10059                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10060                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10061                 return false;
10062         }
10063         return true;
10064 }
10065
10066 static PyObject *unpack_py_samr_QueryUserInfo2_args_out(struct samr_QueryUserInfo2 *r)
10067 {
10068         PyObject *result;
10069         PyObject *py_info;
10070         if (*r->out.info == NULL) {
10071                 py_info = Py_None;
10072                 Py_INCREF(py_info);
10073         } else {
10074                 py_info = py_import_samr_UserInfo(*r->out.info, r->in.level, *r->out.info);
10075                 if (py_info == NULL) {
10076                         return NULL;
10077                 }
10078         }
10079         result = py_info;
10080         if (NT_STATUS_IS_ERR(r->out.result)) {
10081                 PyErr_SetNTSTATUS(r->out.result);
10082                 return NULL;
10083         }
10084
10085         return result;
10086 }
10087
10088 static bool pack_py_samr_QueryDisplayInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo2 *r)
10089 {
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
10097         };
10098
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)) {
10100                 return false;
10101         }
10102
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) {
10106                 PyErr_NoMemory();
10107                 return false;
10108         }
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);
10118         return true;
10119 }
10120
10121 static PyObject *unpack_py_samr_QueryDisplayInfo2_args_out(struct samr_QueryDisplayInfo2 *r)
10122 {
10123         PyObject *result;
10124         PyObject *py_total_size;
10125         PyObject *py_returned_size;
10126         PyObject *py_info;
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) {
10134                 return NULL;
10135         }
10136         PyTuple_SetItem(result, 2, py_info);
10137         if (NT_STATUS_IS_ERR(r->out.result)) {
10138                 PyErr_SetNTSTATUS(r->out.result);
10139                 return NULL;
10140         }
10141
10142         return result;
10143 }
10144
10145 static bool pack_py_samr_GetDisplayEnumerationIndex2_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDisplayEnumerationIndex2 *r)
10146 {
10147         PyObject *py_domain_handle;
10148         PyObject *py_level;
10149         PyObject *py_name;
10150         const char *kwnames[] = {
10151                 "domain_handle", "level", "name", NULL
10152         };
10153
10154         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_GetDisplayEnumerationIndex2", discard_const_p(char *, kwnames), &py_domain_handle, &py_level, &py_name)) {
10155                 return false;
10156         }
10157
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) {
10161                 PyErr_NoMemory();
10162                 return false;
10163         }
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) {
10170                 PyErr_NoMemory();
10171                 return false;
10172         }
10173         r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
10174         return true;
10175 }
10176
10177 static PyObject *unpack_py_samr_GetDisplayEnumerationIndex2_args_out(struct samr_GetDisplayEnumerationIndex2 *r)
10178 {
10179         PyObject *result;
10180         PyObject *py_idx;
10181         py_idx = PyInt_FromLong(*r->out.idx);
10182         result = py_idx;
10183         if (NT_STATUS_IS_ERR(r->out.result)) {
10184                 PyErr_SetNTSTATUS(r->out.result);
10185                 return NULL;
10186         }
10187
10188         return result;
10189 }
10190
10191 static bool pack_py_samr_CreateUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_CreateUser2 *r)
10192 {
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
10199         };
10200
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)) {
10202                 return false;
10203         }
10204
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) {
10208                 PyErr_NoMemory();
10209                 return false;
10210         }
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) {
10215                 PyErr_NoMemory();
10216                 return false;
10217         }
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);
10223         } else {
10224                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10225                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10226                 return false;
10227         }
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);
10232         } else {
10233                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10234                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10235                 return false;
10236         }
10237         return true;
10238 }
10239
10240 static PyObject *unpack_py_samr_CreateUser2_args_out(struct samr_CreateUser2 *r)
10241 {
10242         PyObject *result;
10243         PyObject *py_user_handle;
10244         PyObject *py_access_granted;
10245         PyObject *py_rid;
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);
10255                 return NULL;
10256         }
10257
10258         return result;
10259 }
10260
10261 static bool pack_py_samr_QueryDisplayInfo3_args_in(PyObject *args, PyObject *kwargs, struct samr_QueryDisplayInfo3 *r)
10262 {
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
10270         };
10271
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)) {
10273                 return false;
10274         }
10275
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) {
10279                 PyErr_NoMemory();
10280                 return false;
10281         }
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);
10291         return true;
10292 }
10293
10294 static PyObject *unpack_py_samr_QueryDisplayInfo3_args_out(struct samr_QueryDisplayInfo3 *r)
10295 {
10296         PyObject *result;
10297         PyObject *py_total_size;
10298         PyObject *py_returned_size;
10299         PyObject *py_info;
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) {
10307                 return NULL;
10308         }
10309         PyTuple_SetItem(result, 2, py_info);
10310         if (NT_STATUS_IS_ERR(r->out.result)) {
10311                 PyErr_SetNTSTATUS(r->out.result);
10312                 return NULL;
10313         }
10314
10315         return result;
10316 }
10317
10318 static bool pack_py_samr_AddMultipleMembersToAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_AddMultipleMembersToAlias *r)
10319 {
10320         PyObject *py_alias_handle;
10321         PyObject *py_sids;
10322         const char *kwnames[] = {
10323                 "alias_handle", "sids", NULL
10324         };
10325
10326         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_AddMultipleMembersToAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
10327                 return false;
10328         }
10329
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) {
10333                 PyErr_NoMemory();
10334                 return false;
10335         }
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) {
10340                 PyErr_NoMemory();
10341                 return false;
10342         }
10343         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
10344         return true;
10345 }
10346
10347 static PyObject *unpack_py_samr_AddMultipleMembersToAlias_args_out(struct samr_AddMultipleMembersToAlias *r)
10348 {
10349         PyObject *result;
10350         result = Py_None;
10351         Py_INCREF(result);
10352         if (NT_STATUS_IS_ERR(r->out.result)) {
10353                 PyErr_SetNTSTATUS(r->out.result);
10354                 return NULL;
10355         }
10356
10357         return result;
10358 }
10359
10360 static bool pack_py_samr_RemoveMultipleMembersFromAlias_args_in(PyObject *args, PyObject *kwargs, struct samr_RemoveMultipleMembersFromAlias *r)
10361 {
10362         PyObject *py_alias_handle;
10363         PyObject *py_sids;
10364         const char *kwnames[] = {
10365                 "alias_handle", "sids", NULL
10366         };
10367
10368         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RemoveMultipleMembersFromAlias", discard_const_p(char *, kwnames), &py_alias_handle, &py_sids)) {
10369                 return false;
10370         }
10371
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) {
10375                 PyErr_NoMemory();
10376                 return false;
10377         }
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) {
10382                 PyErr_NoMemory();
10383                 return false;
10384         }
10385         r->in.sids = (struct lsa_SidArray *)pytalloc_get_ptr(py_sids);
10386         return true;
10387 }
10388
10389 static PyObject *unpack_py_samr_RemoveMultipleMembersFromAlias_args_out(struct samr_RemoveMultipleMembersFromAlias *r)
10390 {
10391         PyObject *result;
10392         result = Py_None;
10393         Py_INCREF(result);
10394         if (NT_STATUS_IS_ERR(r->out.result)) {
10395                 PyErr_SetNTSTATUS(r->out.result);
10396                 return NULL;
10397         }
10398
10399         return result;
10400 }
10401
10402 static bool pack_py_samr_OemChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_OemChangePasswordUser2 *r)
10403 {
10404         PyObject *py_server;
10405         PyObject *py_account;
10406         PyObject *py_password;
10407         PyObject *py_hash;
10408         const char *kwnames[] = {
10409                 "server", "account", "password", "hash", NULL
10410         };
10411
10412         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_OemChangePasswordUser2", discard_const_p(char *, kwnames), &py_server, &py_account, &py_password, &py_hash)) {
10413                 return false;
10414         }
10415
10416         if (py_server == Py_None) {
10417                 r->in.server = NULL;
10418         } else {
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) {
10422                         PyErr_NoMemory();
10423                         return false;
10424                 }
10425                 r->in.server = (struct lsa_AsciiString *)pytalloc_get_ptr(py_server);
10426         }
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) {
10430                 PyErr_NoMemory();
10431                 return false;
10432         }
10433         r->in.account = (struct lsa_AsciiString *)pytalloc_get_ptr(py_account);
10434         if (py_password == Py_None) {
10435                 r->in.password = NULL;
10436         } else {
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) {
10440                         PyErr_NoMemory();
10441                         return false;
10442                 }
10443                 r->in.password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password);
10444         }
10445         if (py_hash == Py_None) {
10446                 r->in.hash = NULL;
10447         } else {
10448                 r->in.hash = NULL;
10449                 PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
10450                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
10451                         PyErr_NoMemory();
10452                         return false;
10453                 }
10454                 r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
10455         }
10456         return true;
10457 }
10458
10459 static PyObject *unpack_py_samr_OemChangePasswordUser2_args_out(struct samr_OemChangePasswordUser2 *r)
10460 {
10461         PyObject *result;
10462         result = Py_None;
10463         Py_INCREF(result);
10464         if (NT_STATUS_IS_ERR(r->out.result)) {
10465                 PyErr_SetNTSTATUS(r->out.result);
10466                 return NULL;
10467         }
10468
10469         return result;
10470 }
10471
10472 static bool pack_py_samr_ChangePasswordUser2_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser2 *r)
10473 {
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
10483         };
10484
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)) {
10486                 return false;
10487         }
10488
10489         if (py_server == Py_None) {
10490                 r->in.server = NULL;
10491         } else {
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) {
10495                         PyErr_NoMemory();
10496                         return false;
10497                 }
10498                 r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
10499         }
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) {
10503                 PyErr_NoMemory();
10504                 return false;
10505         }
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;
10509         } else {
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) {
10513                         PyErr_NoMemory();
10514                         return false;
10515                 }
10516                 r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
10517         }
10518         if (py_nt_verifier == Py_None) {
10519                 r->in.nt_verifier = NULL;
10520         } else {
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) {
10524                         PyErr_NoMemory();
10525                         return false;
10526                 }
10527                 r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
10528         }
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;
10533         } else {
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) {
10537                         PyErr_NoMemory();
10538                         return false;
10539                 }
10540                 r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
10541         }
10542         if (py_lm_verifier == Py_None) {
10543                 r->in.lm_verifier = NULL;
10544         } else {
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) {
10548                         PyErr_NoMemory();
10549                         return false;
10550                 }
10551                 r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
10552         }
10553         return true;
10554 }
10555
10556 static PyObject *unpack_py_samr_ChangePasswordUser2_args_out(struct samr_ChangePasswordUser2 *r)
10557 {
10558         PyObject *result;
10559         result = Py_None;
10560         Py_INCREF(result);
10561         if (NT_STATUS_IS_ERR(r->out.result)) {
10562                 PyErr_SetNTSTATUS(r->out.result);
10563                 return NULL;
10564         }
10565
10566         return result;
10567 }
10568
10569 static bool pack_py_samr_GetDomPwInfo_args_in(PyObject *args, PyObject *kwargs, struct samr_GetDomPwInfo *r)
10570 {
10571         PyObject *py_domain_name;
10572         const char *kwnames[] = {
10573                 "domain_name", NULL
10574         };
10575
10576         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetDomPwInfo", discard_const_p(char *, kwnames), &py_domain_name)) {
10577                 return false;
10578         }
10579
10580         if (py_domain_name == Py_None) {
10581                 r->in.domain_name = NULL;
10582         } else {
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) {
10586                         PyErr_NoMemory();
10587                         return false;
10588                 }
10589                 r->in.domain_name = (struct lsa_String *)pytalloc_get_ptr(py_domain_name);
10590         }
10591         return true;
10592 }
10593
10594 static PyObject *unpack_py_samr_GetDomPwInfo_args_out(struct samr_GetDomPwInfo *r)
10595 {
10596         PyObject *result;
10597         PyObject *py_info;
10598         py_info = pytalloc_reference_ex(&samr_PwInfo_Type, r->out.info, r->out.info);
10599         result = py_info;
10600         if (NT_STATUS_IS_ERR(r->out.result)) {
10601                 PyErr_SetNTSTATUS(r->out.result);
10602                 return NULL;
10603         }
10604
10605         return result;
10606 }
10607
10608 static bool pack_py_samr_Connect2_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect2 *r)
10609 {
10610         PyObject *py_system_name;
10611         PyObject *py_access_mask;
10612         const char *kwnames[] = {
10613                 "system_name", "access_mask", NULL
10614         };
10615
10616         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_Connect2", discard_const_p(char *, kwnames), &py_system_name, &py_access_mask)) {
10617                 return false;
10618         }
10619
10620         if (py_system_name == Py_None) {
10621                 r->in.system_name = NULL;
10622         } else {
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);
10628                 } else {
10629                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10630                         return false;
10631                 }
10632         }
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);
10637         } else {
10638                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10639                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10640                 return false;
10641         }
10642         return true;
10643 }
10644
10645 static PyObject *unpack_py_samr_Connect2_args_out(struct samr_Connect2 *r)
10646 {
10647         PyObject *result;
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);
10653                 return NULL;
10654         }
10655
10656         return result;
10657 }
10658
10659 static bool pack_py_samr_SetUserInfo2_args_in(PyObject *args, PyObject *kwargs, struct samr_SetUserInfo2 *r)
10660 {
10661         PyObject *py_user_handle;
10662         PyObject *py_level;
10663         PyObject *py_info;
10664         const char *kwnames[] = {
10665                 "user_handle", "level", "info", NULL
10666         };
10667
10668         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetUserInfo2", discard_const_p(char *, kwnames), &py_user_handle, &py_level, &py_info)) {
10669                 return false;
10670         }
10671
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) {
10675                 PyErr_NoMemory();
10676                 return false;
10677         }
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);
10683         } else {
10684                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10685                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10686                 return false;
10687         }
10688         r->in.info = talloc_ptrtype(r, r->in.info);
10689         {
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) {
10693                         return false;
10694                 }
10695                 r->in.info = info_switch_1;
10696         }
10697         return true;
10698 }
10699
10700 static PyObject *unpack_py_samr_SetUserInfo2_args_out(struct samr_SetUserInfo2 *r)
10701 {
10702         PyObject *result;
10703         result = Py_None;
10704         Py_INCREF(result);
10705         if (NT_STATUS_IS_ERR(r->out.result)) {
10706                 PyErr_SetNTSTATUS(r->out.result);
10707                 return NULL;
10708         }
10709
10710         return result;
10711 }
10712
10713 static bool pack_py_samr_SetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_SetBootKeyInformation *r)
10714 {
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
10721         };
10722
10723         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:samr_SetBootKeyInformation", discard_const_p(char *, kwnames), &py_connect_handle, &py_unknown1, &py_unknown2, &py_unknown3)) {
10724                 return false;
10725         }
10726
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) {
10730                 PyErr_NoMemory();
10731                 return false;
10732         }
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);
10740         return true;
10741 }
10742
10743 static PyObject *unpack_py_samr_SetBootKeyInformation_args_out(struct samr_SetBootKeyInformation *r)
10744 {
10745         PyObject *result;
10746         result = Py_None;
10747         Py_INCREF(result);
10748         if (NT_STATUS_IS_ERR(r->out.result)) {
10749                 PyErr_SetNTSTATUS(r->out.result);
10750                 return NULL;
10751         }
10752
10753         return result;
10754 }
10755
10756 static bool pack_py_samr_GetBootKeyInformation_args_in(PyObject *args, PyObject *kwargs, struct samr_GetBootKeyInformation *r)
10757 {
10758         PyObject *py_domain_handle;
10759         const char *kwnames[] = {
10760                 "domain_handle", NULL
10761         };
10762
10763         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:samr_GetBootKeyInformation", discard_const_p(char *, kwnames), &py_domain_handle)) {
10764                 return false;
10765         }
10766
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) {
10770                 PyErr_NoMemory();
10771                 return false;
10772         }
10773         r->in.domain_handle = (struct policy_handle *)pytalloc_get_ptr(py_domain_handle);
10774         return true;
10775 }
10776
10777 static PyObject *unpack_py_samr_GetBootKeyInformation_args_out(struct samr_GetBootKeyInformation *r)
10778 {
10779         PyObject *result;
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);
10785                 return NULL;
10786         }
10787
10788         return result;
10789 }
10790
10791 static bool pack_py_samr_Connect3_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect3 *r)
10792 {
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
10798         };
10799
10800         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect3", discard_const_p(char *, kwnames), &py_system_name, &py_unknown, &py_access_mask)) {
10801                 return false;
10802         }
10803
10804         if (py_system_name == Py_None) {
10805                 r->in.system_name = NULL;
10806         } else {
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);
10812                 } else {
10813                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10814                         return false;
10815                 }
10816         }
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);
10823         } else {
10824                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10825                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10826                 return false;
10827         }
10828         return true;
10829 }
10830
10831 static PyObject *unpack_py_samr_Connect3_args_out(struct samr_Connect3 *r)
10832 {
10833         PyObject *result;
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);
10839                 return NULL;
10840         }
10841
10842         return result;
10843 }
10844
10845 static bool pack_py_samr_Connect4_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect4 *r)
10846 {
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
10852         };
10853
10854         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_Connect4", discard_const_p(char *, kwnames), &py_system_name, &py_client_version, &py_access_mask)) {
10855                 return false;
10856         }
10857
10858         if (py_system_name == Py_None) {
10859                 r->in.system_name = NULL;
10860         } else {
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);
10866                 } else {
10867                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
10868                         return false;
10869                 }
10870         }
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);
10875         } else {
10876                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10877                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10878                 return false;
10879         }
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);
10884         } else {
10885                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
10886                   PyInt_Type.tp_name, PyLong_Type.tp_name);
10887                 return false;
10888         }
10889         return true;
10890 }
10891
10892 static PyObject *unpack_py_samr_Connect4_args_out(struct samr_Connect4 *r)
10893 {
10894         PyObject *result;
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);
10900                 return NULL;
10901         }
10902
10903         return result;
10904 }
10905
10906 static bool pack_py_samr_ChangePasswordUser3_args_in(PyObject *args, PyObject *kwargs, struct samr_ChangePasswordUser3 *r)
10907 {
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
10918         };
10919
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)) {
10921                 return false;
10922         }
10923
10924         if (py_server == Py_None) {
10925                 r->in.server = NULL;
10926         } else {
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) {
10930                         PyErr_NoMemory();
10931                         return false;
10932                 }
10933                 r->in.server = (struct lsa_String *)pytalloc_get_ptr(py_server);
10934         }
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) {
10938                 PyErr_NoMemory();
10939                 return false;
10940         }
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;
10944         } else {
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) {
10948                         PyErr_NoMemory();
10949                         return false;
10950                 }
10951                 r->in.nt_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_nt_password);
10952         }
10953         if (py_nt_verifier == Py_None) {
10954                 r->in.nt_verifier = NULL;
10955         } else {
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) {
10959                         PyErr_NoMemory();
10960                         return false;
10961                 }
10962                 r->in.nt_verifier = (struct samr_Password *)pytalloc_get_ptr(py_nt_verifier);
10963         }
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;
10968         } else {
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) {
10972                         PyErr_NoMemory();
10973                         return false;
10974                 }
10975                 r->in.lm_password = (struct samr_CryptPassword *)pytalloc_get_ptr(py_lm_password);
10976         }
10977         if (py_lm_verifier == Py_None) {
10978                 r->in.lm_verifier = NULL;
10979         } else {
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) {
10983                         PyErr_NoMemory();
10984                         return false;
10985                 }
10986                 r->in.lm_verifier = (struct samr_Password *)pytalloc_get_ptr(py_lm_verifier);
10987         }
10988         if (py_password3 == Py_None) {
10989                 r->in.password3 = NULL;
10990         } else {
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) {
10994                         PyErr_NoMemory();
10995                         return false;
10996                 }
10997                 r->in.password3 = (struct samr_CryptPassword *)pytalloc_get_ptr(py_password3);
10998         }
10999         return true;
11000 }
11001
11002 static PyObject *unpack_py_samr_ChangePasswordUser3_args_out(struct samr_ChangePasswordUser3 *r)
11003 {
11004         PyObject *result;
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);
11011         } else {
11012                 py_dominfo = pytalloc_reference_ex(&samr_DomInfo1_Type, *r->out.dominfo, *r->out.dominfo);
11013         }
11014         PyTuple_SetItem(result, 0, py_dominfo);
11015         if (*r->out.reject == NULL) {
11016                 py_reject = Py_None;
11017                 Py_INCREF(py_reject);
11018         } else {
11019                 py_reject = pytalloc_reference_ex(&userPwdChangeFailureInformation_Type, *r->out.reject, *r->out.reject);
11020         }
11021         PyTuple_SetItem(result, 1, py_reject);
11022         if (NT_STATUS_IS_ERR(r->out.result)) {
11023                 PyErr_SetNTSTATUS(r->out.result);
11024                 return NULL;
11025         }
11026
11027         return result;
11028 }
11029
11030 static bool pack_py_samr_Connect5_args_in(PyObject *args, PyObject *kwargs, struct samr_Connect5 *r)
11031 {
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
11038         };
11039
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)) {
11041                 return false;
11042         }
11043
11044         if (py_system_name == Py_None) {
11045                 r->in.system_name = NULL;
11046         } else {
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);
11052                 } else {
11053                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_system_name)->tp_name);
11054                         return false;
11055                 }
11056         }
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);
11061         } else {
11062                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11063                   PyInt_Type.tp_name, PyLong_Type.tp_name);
11064                 return false;
11065         }
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);
11069         {
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) {
11073                         return false;
11074                 }
11075                 r->in.info_in = info_in_switch_1;
11076         }
11077         return true;
11078 }
11079
11080 static PyObject *unpack_py_samr_Connect5_args_out(struct samr_Connect5 *r)
11081 {
11082         PyObject *result;
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) {
11091                 return NULL;
11092         }
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);
11098                 return NULL;
11099         }
11100
11101         return result;
11102 }
11103
11104 static bool pack_py_samr_RidToSid_args_in(PyObject *args, PyObject *kwargs, struct samr_RidToSid *r)
11105 {
11106         PyObject *py_domain_handle;
11107         PyObject *py_rid;
11108         const char *kwnames[] = {
11109                 "domain_handle", "rid", NULL
11110         };
11111
11112         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_RidToSid", discard_const_p(char *, kwnames), &py_domain_handle, &py_rid)) {
11113                 return false;
11114         }
11115
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) {
11119                 PyErr_NoMemory();
11120                 return false;
11121         }
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);
11125         return true;
11126 }
11127
11128 static PyObject *unpack_py_samr_RidToSid_args_out(struct samr_RidToSid *r)
11129 {
11130         PyObject *result;
11131         PyObject *py_sid;
11132         if (*r->out.sid == NULL) {
11133                 py_sid = Py_None;
11134                 Py_INCREF(py_sid);
11135         } else {
11136                 py_sid = pytalloc_reference_ex(dom_sid_Type, *r->out.sid, *r->out.sid);
11137         }
11138         result = py_sid;
11139         if (NT_STATUS_IS_ERR(r->out.result)) {
11140                 PyErr_SetNTSTATUS(r->out.result);
11141                 return NULL;
11142         }
11143
11144         return result;
11145 }
11146
11147 static bool pack_py_samr_SetDsrmPassword_args_in(PyObject *args, PyObject *kwargs, struct samr_SetDsrmPassword *r)
11148 {
11149         PyObject *py_name;
11150         PyObject *py_unknown;
11151         PyObject *py_hash;
11152         const char *kwnames[] = {
11153                 "name", "unknown", "hash", NULL
11154         };
11155
11156         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:samr_SetDsrmPassword", discard_const_p(char *, kwnames), &py_name, &py_unknown, &py_hash)) {
11157                 return false;
11158         }
11159
11160         if (py_name == Py_None) {
11161                 r->in.name = NULL;
11162         } else {
11163                 r->in.name = NULL;
11164                 PY_CHECK_TYPE(lsa_String_Type, py_name, return false;);
11165                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_name)) == NULL) {
11166                         PyErr_NoMemory();
11167                         return false;
11168                 }
11169                 r->in.name = (struct lsa_String *)pytalloc_get_ptr(py_name);
11170         }
11171         PY_CHECK_TYPE(&PyInt_Type, py_unknown, return false;);
11172         r->in.unknown = PyInt_AsLong(py_unknown);
11173         if (py_hash == Py_None) {
11174                 r->in.hash = NULL;
11175         } else {
11176                 r->in.hash = NULL;
11177                 PY_CHECK_TYPE(&samr_Password_Type, py_hash, return false;);
11178                 if (talloc_reference(r, pytalloc_get_mem_ctx(py_hash)) == NULL) {
11179                         PyErr_NoMemory();
11180                         return false;
11181                 }
11182                 r->in.hash = (struct samr_Password *)pytalloc_get_ptr(py_hash);
11183         }
11184         return true;
11185 }
11186
11187 static PyObject *unpack_py_samr_SetDsrmPassword_args_out(struct samr_SetDsrmPassword *r)
11188 {
11189         PyObject *result;
11190         result = Py_None;
11191         Py_INCREF(result);
11192         if (NT_STATUS_IS_ERR(r->out.result)) {
11193                 PyErr_SetNTSTATUS(r->out.result);
11194                 return NULL;
11195         }
11196
11197         return result;
11198 }
11199
11200 static bool pack_py_samr_ValidatePassword_args_in(PyObject *args, PyObject *kwargs, struct samr_ValidatePassword *r)
11201 {
11202         PyObject *py_level;
11203         PyObject *py_req;
11204         const char *kwnames[] = {
11205                 "level", "req", NULL
11206         };
11207
11208         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:samr_ValidatePassword", discard_const_p(char *, kwnames), &py_level, &py_req)) {
11209                 return false;
11210         }
11211
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);
11216         } else {
11217                 PyErr_Format(PyExc_TypeError, "Expected type %s or %s",\
11218                   PyInt_Type.tp_name, PyLong_Type.tp_name);
11219                 return false;
11220         }
11221         r->in.req = talloc_ptrtype(r, r->in.req);
11222         {
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) {
11226                         return false;
11227                 }
11228                 r->in.req = req_switch_1;
11229         }
11230         return true;
11231 }
11232
11233 static PyObject *unpack_py_samr_ValidatePassword_args_out(struct samr_ValidatePassword *r)
11234 {
11235         PyObject *result;
11236         PyObject *py_rep;
11237         if (*r->out.rep == NULL) {
11238                 py_rep = Py_None;
11239                 Py_INCREF(py_rep);
11240         } else {
11241                 py_rep = py_import_samr_ValidatePasswordRep(*r->out.rep, r->in.level, *r->out.rep);
11242                 if (py_rep == NULL) {
11243                         return NULL;
11244                 }
11245         }
11246         result = py_rep;
11247         if (NT_STATUS_IS_ERR(r->out.result)) {
11248                 PyErr_SetNTSTATUS(r->out.result);
11249                 return NULL;
11250         }
11251
11252         return result;
11253 }
11254
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 },
11324         { NULL }
11325 };
11326
11327 static PyObject *interface_samr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
11328 {
11329         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_samr);
11330 }
11331
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"
11337 "\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,
11343 };
11344
11345 static PyMethodDef samr_methods[] = {
11346         { NULL, NULL, 0, NULL }
11347 };
11348
11349 void initsamr(void)
11350 {
11351         PyObject *m;
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;
11357
11358         dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
11359         if (dep_samba_dcerpc_security == NULL)
11360                 return;
11361
11362         dep_talloc = PyImport_ImportModule("talloc");
11363         if (dep_talloc == NULL)
11364                 return;
11365
11366         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
11367         if (dep_samba_dcerpc_misc == NULL)
11368                 return;
11369
11370         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
11371         if (dep_samba_dcerpc_base == NULL)
11372                 return;
11373
11374         dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
11375         if (dep_samba_dcerpc_lsa == NULL)
11376                 return;
11377
11378         dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
11379         if (dom_sid_Type == NULL)
11380                 return;
11381
11382         lsa_BinaryString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "BinaryString");
11383         if (lsa_BinaryString_Type == NULL)
11384                 return;
11385
11386         lsa_AsciiString_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiString");
11387         if (lsa_AsciiString_Type == NULL)
11388                 return;
11389
11390         lsa_Strings_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "Strings");
11391         if (lsa_Strings_Type == NULL)
11392                 return;
11393
11394         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
11395         if (ClientConnection_Type == NULL)
11396                 return;
11397
11398         lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
11399         if (lsa_String_Type == NULL)
11400                 return;
11401
11402         lsa_AsciiStringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "AsciiStringLarge");
11403         if (lsa_AsciiStringLarge_Type == NULL)
11404                 return;
11405
11406         lsa_StringLarge_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "StringLarge");
11407         if (lsa_StringLarge_Type == NULL)
11408                 return;
11409
11410         sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
11411         if (sec_desc_buf_Type == NULL)
11412                 return;
11413
11414         lsa_SidArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "SidArray");
11415         if (lsa_SidArray_Type == NULL)
11416                 return;
11417
11418         policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
11419         if (policy_handle_Type == NULL)
11420                 return;
11421
11422         Object_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "Object");
11423         if (Object_Type == NULL)
11424                 return;
11425
11426         samr_SamEntry_Type.tp_base = Object_Type;
11427
11428         samr_SamArray_Type.tp_base = Object_Type;
11429
11430         samr_DomInfo1_Type.tp_base = Object_Type;
11431
11432         samr_DomGeneralInformation_Type.tp_base = Object_Type;
11433
11434         samr_DomInfo3_Type.tp_base = Object_Type;
11435
11436         samr_DomOEMInformation_Type.tp_base = Object_Type;
11437
11438         samr_DomInfo5_Type.tp_base = Object_Type;
11439
11440         samr_DomInfo6_Type.tp_base = Object_Type;
11441
11442         samr_DomInfo7_Type.tp_base = Object_Type;
11443
11444         samr_DomInfo8_Type.tp_base = Object_Type;
11445
11446         samr_DomInfo9_Type.tp_base = Object_Type;
11447
11448         samr_DomGeneralInformation2_Type.tp_base = Object_Type;
11449
11450         samr_DomInfo12_Type.tp_base = Object_Type;
11451
11452         samr_DomInfo13_Type.tp_base = Object_Type;
11453
11454         samr_Ids_Type.tp_base = Object_Type;
11455
11456         samr_GroupInfoAll_Type.tp_base = Object_Type;
11457
11458         samr_GroupInfoAttributes_Type.tp_base = Object_Type;
11459
11460         samr_GroupInfoDescription_Type.tp_base = Object_Type;
11461
11462         samr_RidAttrArray_Type.tp_base = Object_Type;
11463
11464         samr_AliasInfoAll_Type.tp_base = Object_Type;
11465
11466         samr_UserInfo1_Type.tp_base = Object_Type;
11467
11468         samr_UserInfo2_Type.tp_base = Object_Type;
11469
11470         samr_LogonHours_Type.tp_base = Object_Type;
11471
11472         samr_UserInfo3_Type.tp_base = Object_Type;
11473
11474         samr_UserInfo4_Type.tp_base = Object_Type;
11475
11476         samr_UserInfo5_Type.tp_base = Object_Type;
11477
11478         samr_UserInfo6_Type.tp_base = Object_Type;
11479
11480         samr_UserInfo7_Type.tp_base = Object_Type;
11481
11482         samr_UserInfo8_Type.tp_base = Object_Type;
11483
11484         samr_UserInfo9_Type.tp_base = Object_Type;
11485
11486         samr_UserInfo10_Type.tp_base = Object_Type;
11487
11488         samr_UserInfo11_Type.tp_base = Object_Type;
11489
11490         samr_UserInfo12_Type.tp_base = Object_Type;
11491
11492         samr_UserInfo13_Type.tp_base = Object_Type;
11493
11494         samr_UserInfo14_Type.tp_base = Object_Type;
11495
11496         samr_UserInfo16_Type.tp_base = Object_Type;
11497
11498         samr_UserInfo17_Type.tp_base = Object_Type;
11499
11500         samr_Password_Type.tp_base = Object_Type;
11501
11502         samr_UserInfo18_Type.tp_base = Object_Type;
11503
11504         samr_UserInfo20_Type.tp_base = Object_Type;
11505
11506         samr_UserInfo21_Type.tp_base = Object_Type;
11507
11508         samr_CryptPassword_Type.tp_base = Object_Type;
11509
11510         samr_UserInfo23_Type.tp_base = Object_Type;
11511
11512         samr_UserInfo24_Type.tp_base = Object_Type;
11513
11514         samr_CryptPasswordEx_Type.tp_base = Object_Type;
11515
11516         samr_UserInfo25_Type.tp_base = Object_Type;
11517
11518         samr_UserInfo26_Type.tp_base = Object_Type;
11519
11520         samr_RidWithAttribute_Type.tp_base = Object_Type;
11521
11522         samr_RidWithAttributeArray_Type.tp_base = Object_Type;
11523
11524         samr_DispEntryGeneral_Type.tp_base = Object_Type;
11525
11526         samr_DispInfoGeneral_Type.tp_base = Object_Type;
11527
11528         samr_DispEntryFull_Type.tp_base = Object_Type;
11529
11530         samr_DispInfoFull_Type.tp_base = Object_Type;
11531
11532         samr_DispEntryFullGroup_Type.tp_base = Object_Type;
11533
11534         samr_DispInfoFullGroups_Type.tp_base = Object_Type;
11535
11536         samr_DispEntryAscii_Type.tp_base = Object_Type;
11537
11538         samr_DispInfoAscii_Type.tp_base = Object_Type;
11539
11540         samr_PwInfo_Type.tp_base = Object_Type;
11541
11542         userPwdChangeFailureInformation_Type.tp_base = Object_Type;
11543
11544         samr_ConnectInfo1_Type.tp_base = Object_Type;
11545
11546         samr_ValidationBlob_Type.tp_base = Object_Type;
11547
11548         samr_ValidatePasswordInfo_Type.tp_base = Object_Type;
11549
11550         samr_ValidatePasswordRepCtr_Type.tp_base = Object_Type;
11551
11552         samr_ValidatePasswordReq3_Type.tp_base = Object_Type;
11553
11554         samr_ValidatePasswordReq2_Type.tp_base = Object_Type;
11555
11556         samr_ValidatePasswordReq1_Type.tp_base = Object_Type;
11557
11558         samr_InterfaceType.tp_base = ClientConnection_Type;
11559
11560         if (PyType_Ready(&samr_SamEntry_Type) < 0)
11561                 return;
11562         if (PyType_Ready(&samr_SamArray_Type) < 0)
11563                 return;
11564         if (PyType_Ready(&samr_DomInfo1_Type) < 0)
11565                 return;
11566         if (PyType_Ready(&samr_DomGeneralInformation_Type) < 0)
11567                 return;
11568         if (PyType_Ready(&samr_DomInfo3_Type) < 0)
11569                 return;
11570         if (PyType_Ready(&samr_DomOEMInformation_Type) < 0)
11571                 return;
11572         if (PyType_Ready(&samr_DomInfo5_Type) < 0)
11573                 return;
11574         if (PyType_Ready(&samr_DomInfo6_Type) < 0)
11575                 return;
11576         if (PyType_Ready(&samr_DomInfo7_Type) < 0)
11577                 return;
11578         if (PyType_Ready(&samr_DomInfo8_Type) < 0)
11579                 return;
11580         if (PyType_Ready(&samr_DomInfo9_Type) < 0)
11581                 return;
11582         if (PyType_Ready(&samr_DomGeneralInformation2_Type) < 0)
11583                 return;
11584         if (PyType_Ready(&samr_DomInfo12_Type) < 0)
11585                 return;
11586         if (PyType_Ready(&samr_DomInfo13_Type) < 0)
11587                 return;
11588         if (PyType_Ready(&samr_Ids_Type) < 0)
11589                 return;
11590         if (PyType_Ready(&samr_GroupInfoAll_Type) < 0)
11591                 return;
11592         if (PyType_Ready(&samr_GroupInfoAttributes_Type) < 0)
11593                 return;
11594         if (PyType_Ready(&samr_GroupInfoDescription_Type) < 0)
11595                 return;
11596         if (PyType_Ready(&samr_RidAttrArray_Type) < 0)
11597                 return;
11598         if (PyType_Ready(&samr_AliasInfoAll_Type) < 0)
11599                 return;
11600         if (PyType_Ready(&samr_UserInfo1_Type) < 0)
11601                 return;
11602         if (PyType_Ready(&samr_UserInfo2_Type) < 0)
11603                 return;
11604         if (PyType_Ready(&samr_LogonHours_Type) < 0)
11605                 return;
11606         if (PyType_Ready(&samr_UserInfo3_Type) < 0)
11607                 return;
11608         if (PyType_Ready(&samr_UserInfo4_Type) < 0)
11609                 return;
11610         if (PyType_Ready(&samr_UserInfo5_Type) < 0)
11611                 return;
11612         if (PyType_Ready(&samr_UserInfo6_Type) < 0)
11613                 return;
11614         if (PyType_Ready(&samr_UserInfo7_Type) < 0)
11615                 return;
11616         if (PyType_Ready(&samr_UserInfo8_Type) < 0)
11617                 return;
11618         if (PyType_Ready(&samr_UserInfo9_Type) < 0)
11619                 return;
11620         if (PyType_Ready(&samr_UserInfo10_Type) < 0)
11621                 return;
11622         if (PyType_Ready(&samr_UserInfo11_Type) < 0)
11623                 return;
11624         if (PyType_Ready(&samr_UserInfo12_Type) < 0)
11625                 return;
11626         if (PyType_Ready(&samr_UserInfo13_Type) < 0)
11627                 return;
11628         if (PyType_Ready(&samr_UserInfo14_Type) < 0)
11629                 return;
11630         if (PyType_Ready(&samr_UserInfo16_Type) < 0)
11631                 return;
11632         if (PyType_Ready(&samr_UserInfo17_Type) < 0)
11633                 return;
11634         if (PyType_Ready(&samr_Password_Type) < 0)
11635                 return;
11636         if (PyType_Ready(&samr_UserInfo18_Type) < 0)
11637                 return;
11638         if (PyType_Ready(&samr_UserInfo20_Type) < 0)
11639                 return;
11640         if (PyType_Ready(&samr_UserInfo21_Type) < 0)
11641                 return;
11642         if (PyType_Ready(&samr_CryptPassword_Type) < 0)
11643                 return;
11644         if (PyType_Ready(&samr_UserInfo23_Type) < 0)
11645                 return;
11646         if (PyType_Ready(&samr_UserInfo24_Type) < 0)
11647                 return;
11648         if (PyType_Ready(&samr_CryptPasswordEx_Type) < 0)
11649                 return;
11650         if (PyType_Ready(&samr_UserInfo25_Type) < 0)
11651                 return;
11652         if (PyType_Ready(&samr_UserInfo26_Type) < 0)
11653                 return;
11654         if (PyType_Ready(&samr_RidWithAttribute_Type) < 0)
11655                 return;
11656         if (PyType_Ready(&samr_RidWithAttributeArray_Type) < 0)
11657                 return;
11658         if (PyType_Ready(&samr_DispEntryGeneral_Type) < 0)
11659                 return;
11660         if (PyType_Ready(&samr_DispInfoGeneral_Type) < 0)
11661                 return;
11662         if (PyType_Ready(&samr_DispEntryFull_Type) < 0)
11663                 return;
11664         if (PyType_Ready(&samr_DispInfoFull_Type) < 0)
11665                 return;
11666         if (PyType_Ready(&samr_DispEntryFullGroup_Type) < 0)
11667                 return;
11668         if (PyType_Ready(&samr_DispInfoFullGroups_Type) < 0)
11669                 return;
11670         if (PyType_Ready(&samr_DispEntryAscii_Type) < 0)
11671                 return;
11672         if (PyType_Ready(&samr_DispInfoAscii_Type) < 0)
11673                 return;
11674         if (PyType_Ready(&samr_PwInfo_Type) < 0)
11675                 return;
11676         if (PyType_Ready(&userPwdChangeFailureInformation_Type) < 0)
11677                 return;
11678         if (PyType_Ready(&samr_ConnectInfo1_Type) < 0)
11679                 return;
11680         if (PyType_Ready(&samr_ValidationBlob_Type) < 0)
11681                 return;
11682         if (PyType_Ready(&samr_ValidatePasswordInfo_Type) < 0)
11683                 return;
11684         if (PyType_Ready(&samr_ValidatePasswordRepCtr_Type) < 0)
11685                 return;
11686         if (PyType_Ready(&samr_ValidatePasswordReq3_Type) < 0)
11687                 return;
11688         if (PyType_Ready(&samr_ValidatePasswordReq2_Type) < 0)
11689                 return;
11690         if (PyType_Ready(&samr_ValidatePasswordReq1_Type) < 0)
11691                 return;
11692         if (PyType_Ready(&samr_InterfaceType) < 0)
11693                 return;
11694         if (!PyInterface_AddNdrRpcMethods(&samr_InterfaceType, py_ndr_samr_methods))
11695                 return;
11696
11697 #ifdef PY_SAMENTRY_PATCH
11698         PY_SAMENTRY_PATCH(&samr_SamEntry_Type);
11699 #endif
11700 #ifdef PY_SAMARRAY_PATCH
11701         PY_SAMARRAY_PATCH(&samr_SamArray_Type);
11702 #endif
11703 #ifdef PY_DOMINFO1_PATCH
11704         PY_DOMINFO1_PATCH(&samr_DomInfo1_Type);
11705 #endif
11706 #ifdef PY_DOMGENERALINFORMATION_PATCH
11707         PY_DOMGENERALINFORMATION_PATCH(&samr_DomGeneralInformation_Type);
11708 #endif
11709 #ifdef PY_DOMINFO3_PATCH
11710         PY_DOMINFO3_PATCH(&samr_DomInfo3_Type);
11711 #endif
11712 #ifdef PY_DOMOEMINFORMATION_PATCH
11713         PY_DOMOEMINFORMATION_PATCH(&samr_DomOEMInformation_Type);
11714 #endif
11715 #ifdef PY_DOMINFO5_PATCH
11716         PY_DOMINFO5_PATCH(&samr_DomInfo5_Type);
11717 #endif
11718 #ifdef PY_DOMINFO6_PATCH
11719         PY_DOMINFO6_PATCH(&samr_DomInfo6_Type);
11720 #endif
11721 #ifdef PY_DOMINFO7_PATCH
11722         PY_DOMINFO7_PATCH(&samr_DomInfo7_Type);
11723 #endif
11724 #ifdef PY_DOMINFO8_PATCH
11725         PY_DOMINFO8_PATCH(&samr_DomInfo8_Type);
11726 #endif
11727 #ifdef PY_DOMINFO9_PATCH
11728         PY_DOMINFO9_PATCH(&samr_DomInfo9_Type);
11729 #endif
11730 #ifdef PY_DOMGENERALINFORMATION2_PATCH
11731         PY_DOMGENERALINFORMATION2_PATCH(&samr_DomGeneralInformation2_Type);
11732 #endif
11733 #ifdef PY_DOMINFO12_PATCH
11734         PY_DOMINFO12_PATCH(&samr_DomInfo12_Type);
11735 #endif
11736 #ifdef PY_DOMINFO13_PATCH
11737         PY_DOMINFO13_PATCH(&samr_DomInfo13_Type);
11738 #endif
11739 #ifdef PY_IDS_PATCH
11740         PY_IDS_PATCH(&samr_Ids_Type);
11741 #endif
11742 #ifdef PY_GROUPINFOALL_PATCH
11743         PY_GROUPINFOALL_PATCH(&samr_GroupInfoAll_Type);
11744 #endif
11745 #ifdef PY_GROUPINFOATTRIBUTES_PATCH
11746         PY_GROUPINFOATTRIBUTES_PATCH(&samr_GroupInfoAttributes_Type);
11747 #endif
11748 #ifdef PY_GROUPINFODESCRIPTION_PATCH
11749         PY_GROUPINFODESCRIPTION_PATCH(&samr_GroupInfoDescription_Type);
11750 #endif
11751 #ifdef PY_RIDATTRARRAY_PATCH
11752         PY_RIDATTRARRAY_PATCH(&samr_RidAttrArray_Type);
11753 #endif
11754 #ifdef PY_ALIASINFOALL_PATCH
11755         PY_ALIASINFOALL_PATCH(&samr_AliasInfoAll_Type);
11756 #endif
11757 #ifdef PY_USERINFO1_PATCH
11758         PY_USERINFO1_PATCH(&samr_UserInfo1_Type);
11759 #endif
11760 #ifdef PY_USERINFO2_PATCH
11761         PY_USERINFO2_PATCH(&samr_UserInfo2_Type);
11762 #endif
11763 #ifdef PY_LOGONHOURS_PATCH
11764         PY_LOGONHOURS_PATCH(&samr_LogonHours_Type);
11765 #endif
11766 #ifdef PY_USERINFO3_PATCH
11767         PY_USERINFO3_PATCH(&samr_UserInfo3_Type);
11768 #endif
11769 #ifdef PY_USERINFO4_PATCH
11770         PY_USERINFO4_PATCH(&samr_UserInfo4_Type);
11771 #endif
11772 #ifdef PY_USERINFO5_PATCH
11773         PY_USERINFO5_PATCH(&samr_UserInfo5_Type);
11774 #endif
11775 #ifdef PY_USERINFO6_PATCH
11776         PY_USERINFO6_PATCH(&samr_UserInfo6_Type);
11777 #endif
11778 #ifdef PY_USERINFO7_PATCH
11779         PY_USERINFO7_PATCH(&samr_UserInfo7_Type);
11780 #endif
11781 #ifdef PY_USERINFO8_PATCH
11782         PY_USERINFO8_PATCH(&samr_UserInfo8_Type);
11783 #endif
11784 #ifdef PY_USERINFO9_PATCH
11785         PY_USERINFO9_PATCH(&samr_UserInfo9_Type);
11786 #endif
11787 #ifdef PY_USERINFO10_PATCH
11788         PY_USERINFO10_PATCH(&samr_UserInfo10_Type);
11789 #endif
11790 #ifdef PY_USERINFO11_PATCH
11791         PY_USERINFO11_PATCH(&samr_UserInfo11_Type);
11792 #endif
11793 #ifdef PY_USERINFO12_PATCH
11794         PY_USERINFO12_PATCH(&samr_UserInfo12_Type);
11795 #endif
11796 #ifdef PY_USERINFO13_PATCH
11797         PY_USERINFO13_PATCH(&samr_UserInfo13_Type);
11798 #endif
11799 #ifdef PY_USERINFO14_PATCH
11800         PY_USERINFO14_PATCH(&samr_UserInfo14_Type);
11801 #endif
11802 #ifdef PY_USERINFO16_PATCH
11803         PY_USERINFO16_PATCH(&samr_UserInfo16_Type);
11804 #endif
11805 #ifdef PY_USERINFO17_PATCH
11806         PY_USERINFO17_PATCH(&samr_UserInfo17_Type);
11807 #endif
11808 #ifdef PY_PASSWORD_PATCH
11809         PY_PASSWORD_PATCH(&samr_Password_Type);
11810 #endif
11811 #ifdef PY_USERINFO18_PATCH
11812         PY_USERINFO18_PATCH(&samr_UserInfo18_Type);
11813 #endif
11814 #ifdef PY_USERINFO20_PATCH
11815         PY_USERINFO20_PATCH(&samr_UserInfo20_Type);
11816 #endif
11817 #ifdef PY_USERINFO21_PATCH
11818         PY_USERINFO21_PATCH(&samr_UserInfo21_Type);
11819 #endif
11820 #ifdef PY_CRYPTPASSWORD_PATCH
11821         PY_CRYPTPASSWORD_PATCH(&samr_CryptPassword_Type);
11822 #endif
11823 #ifdef PY_USERINFO23_PATCH
11824         PY_USERINFO23_PATCH(&samr_UserInfo23_Type);
11825 #endif
11826 #ifdef PY_USERINFO24_PATCH
11827         PY_USERINFO24_PATCH(&samr_UserInfo24_Type);
11828 #endif
11829 #ifdef PY_CRYPTPASSWORDEX_PATCH
11830         PY_CRYPTPASSWORDEX_PATCH(&samr_CryptPasswordEx_Type);
11831 #endif
11832 #ifdef PY_USERINFO25_PATCH
11833         PY_USERINFO25_PATCH(&samr_UserInfo25_Type);
11834 #endif
11835 #ifdef PY_USERINFO26_PATCH
11836         PY_USERINFO26_PATCH(&samr_UserInfo26_Type);
11837 #endif
11838 #ifdef PY_RIDWITHATTRIBUTE_PATCH
11839         PY_RIDWITHATTRIBUTE_PATCH(&samr_RidWithAttribute_Type);
11840 #endif
11841 #ifdef PY_RIDWITHATTRIBUTEARRAY_PATCH
11842         PY_RIDWITHATTRIBUTEARRAY_PATCH(&samr_RidWithAttributeArray_Type);
11843 #endif
11844 #ifdef PY_DISPENTRYGENERAL_PATCH
11845         PY_DISPENTRYGENERAL_PATCH(&samr_DispEntryGeneral_Type);
11846 #endif
11847 #ifdef PY_DISPINFOGENERAL_PATCH
11848         PY_DISPINFOGENERAL_PATCH(&samr_DispInfoGeneral_Type);
11849 #endif
11850 #ifdef PY_DISPENTRYFULL_PATCH
11851         PY_DISPENTRYFULL_PATCH(&samr_DispEntryFull_Type);
11852 #endif
11853 #ifdef PY_DISPINFOFULL_PATCH
11854         PY_DISPINFOFULL_PATCH(&samr_DispInfoFull_Type);
11855 #endif
11856 #ifdef PY_DISPENTRYFULLGROUP_PATCH
11857         PY_DISPENTRYFULLGROUP_PATCH(&samr_DispEntryFullGroup_Type);
11858 #endif
11859 #ifdef PY_DISPINFOFULLGROUPS_PATCH
11860         PY_DISPINFOFULLGROUPS_PATCH(&samr_DispInfoFullGroups_Type);
11861 #endif
11862 #ifdef PY_DISPENTRYASCII_PATCH
11863         PY_DISPENTRYASCII_PATCH(&samr_DispEntryAscii_Type);
11864 #endif
11865 #ifdef PY_DISPINFOASCII_PATCH
11866         PY_DISPINFOASCII_PATCH(&samr_DispInfoAscii_Type);
11867 #endif
11868 #ifdef PY_PWINFO_PATCH
11869         PY_PWINFO_PATCH(&samr_PwInfo_Type);
11870 #endif
11871 #ifdef PY_USERPWDCHANGEFAILUREINFORMATION_PATCH
11872         PY_USERPWDCHANGEFAILUREINFORMATION_PATCH(&userPwdChangeFailureInformation_Type);
11873 #endif
11874 #ifdef PY_CONNECTINFO1_PATCH
11875         PY_CONNECTINFO1_PATCH(&samr_ConnectInfo1_Type);
11876 #endif
11877 #ifdef PY_VALIDATIONBLOB_PATCH
11878         PY_VALIDATIONBLOB_PATCH(&samr_ValidationBlob_Type);
11879 #endif
11880 #ifdef PY_VALIDATEPASSWORDINFO_PATCH
11881         PY_VALIDATEPASSWORDINFO_PATCH(&samr_ValidatePasswordInfo_Type);
11882 #endif
11883 #ifdef PY_VALIDATEPASSWORDREPCTR_PATCH
11884         PY_VALIDATEPASSWORDREPCTR_PATCH(&samr_ValidatePasswordRepCtr_Type);
11885 #endif
11886 #ifdef PY_VALIDATEPASSWORDREQ3_PATCH
11887         PY_VALIDATEPASSWORDREQ3_PATCH(&samr_ValidatePasswordReq3_Type);
11888 #endif
11889 #ifdef PY_VALIDATEPASSWORDREQ2_PATCH
11890         PY_VALIDATEPASSWORDREQ2_PATCH(&samr_ValidatePasswordReq2_Type);
11891 #endif
11892 #ifdef PY_VALIDATEPASSWORDREQ1_PATCH
11893         PY_VALIDATEPASSWORDREQ1_PATCH(&samr_ValidatePasswordReq1_Type);
11894 #endif
11895 #ifdef PY_SAMR_PATCH
11896         PY_SAMR_PATCH(&samr_InterfaceType);
11897 #endif
11898
11899         m = Py_InitModule3("samr", samr_methods, "samr DCE/RPC");
11900         if (m == NULL)
11901                 return;
11902
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);
12252 #endif
12253
12254 }