8e6e0059c032050b11b5093987e8fea98d662977
[ira/wip.git] / librpc / gen_ndr / ndr_samr.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_samr.h"
5
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_lsa.h"
8 #include "librpc/gen_ndr/ndr_security.h"
9 _PUBLIC_ enum ndr_err_code ndr_push_netr_SamDatabaseID(struct ndr_push *ndr, int ndr_flags, enum netr_SamDatabaseID r)
10 {
11         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
12         return NDR_ERR_SUCCESS;
13 }
14
15 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamDatabaseID(struct ndr_pull *ndr, int ndr_flags, enum netr_SamDatabaseID *r)
16 {
17         uint32_t v;
18         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
19         *r = v;
20         return NDR_ERR_SUCCESS;
21 }
22
23 _PUBLIC_ void ndr_print_netr_SamDatabaseID(struct ndr_print *ndr, const char *name, enum netr_SamDatabaseID r)
24 {
25         const char *val = NULL;
26
27         switch (r) {
28                 case SAM_DATABASE_DOMAIN: val = "SAM_DATABASE_DOMAIN"; break;
29                 case SAM_DATABASE_BUILTIN: val = "SAM_DATABASE_BUILTIN"; break;
30                 case SAM_DATABASE_PRIVS: val = "SAM_DATABASE_PRIVS"; break;
31         }
32         ndr_print_enum(ndr, name, "ENUM", val, r);
33 }
34
35 _PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int ndr_flags, enum samr_RejectReason r)
36 {
37         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
38         return NDR_ERR_SUCCESS;
39 }
40
41 _PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r)
42 {
43         uint32_t v;
44         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
45         *r = v;
46         return NDR_ERR_SUCCESS;
47 }
48
49 _PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r)
50 {
51         const char *val = NULL;
52
53         switch (r) {
54                 case SAMR_REJECT_OTHER: val = "SAMR_REJECT_OTHER"; break;
55                 case SAMR_REJECT_TOO_SHORT: val = "SAMR_REJECT_TOO_SHORT"; break;
56                 case SAMR_REJECT_IN_HISTORY: val = "SAMR_REJECT_IN_HISTORY"; break;
57                 case SAMR_REJECT_COMPLEXITY: val = "SAMR_REJECT_COMPLEXITY"; break;
58         }
59         ndr_print_enum(ndr, name, "ENUM", val, r);
60 }
61
62 _PUBLIC_ enum ndr_err_code ndr_push_samr_AcctFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
63 {
64         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
65         return NDR_ERR_SUCCESS;
66 }
67
68 _PUBLIC_ enum ndr_err_code ndr_pull_samr_AcctFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
69 {
70         uint32_t v;
71         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
72         *r = v;
73         return NDR_ERR_SUCCESS;
74 }
75
76 _PUBLIC_ void ndr_print_samr_AcctFlags(struct ndr_print *ndr, const char *name, uint32_t r)
77 {
78         ndr_print_uint32(ndr, name, r);
79         ndr->depth++;
80         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DISABLED", ACB_DISABLED, r);
81         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_HOMDIRREQ", ACB_HOMDIRREQ, r);
82         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOTREQ", ACB_PWNOTREQ, r);
83         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TEMPDUP", ACB_TEMPDUP, r);
84         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NORMAL", ACB_NORMAL, r);
85         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_MNS", ACB_MNS, r);
86         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DOMTRUST", ACB_DOMTRUST, r);
87         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_WSTRUST", ACB_WSTRUST, r);
88         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SVRTRUST", ACB_SVRTRUST, r);
89         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PWNOEXP", ACB_PWNOEXP, r);
90         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_AUTOLOCK", ACB_AUTOLOCK, r);
91         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_ENC_TXT_PWD_ALLOWED", ACB_ENC_TXT_PWD_ALLOWED, r);
92         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_SMARTCARD_REQUIRED", ACB_SMARTCARD_REQUIRED, r);
93         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_TRUSTED_FOR_DELEGATION", ACB_TRUSTED_FOR_DELEGATION, r);
94         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NOT_DELEGATED", ACB_NOT_DELEGATED, r);
95         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_USE_DES_KEY_ONLY", ACB_USE_DES_KEY_ONLY, r);
96         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_DONT_REQUIRE_PREAUTH", ACB_DONT_REQUIRE_PREAUTH, r);
97         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_PW_EXPIRED", ACB_PW_EXPIRED, r);
98         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ACB_NO_AUTH_DATA_REQD", ACB_NO_AUTH_DATA_REQD, r);
99         ndr->depth--;
100 }
101
102 static enum ndr_err_code ndr_push_samr_ConnectAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
103 {
104         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
105         return NDR_ERR_SUCCESS;
106 }
107
108 static enum ndr_err_code ndr_pull_samr_ConnectAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
109 {
110         uint32_t v;
111         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
112         *r = v;
113         return NDR_ERR_SUCCESS;
114 }
115
116 _PUBLIC_ void ndr_print_samr_ConnectAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
117 {
118         ndr_print_uint32(ndr, name, r);
119         ndr->depth++;
120         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CONNECT_TO_SERVER", SAMR_ACCESS_CONNECT_TO_SERVER, r);
121         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_SHUTDOWN_SERVER", SAMR_ACCESS_SHUTDOWN_SERVER, r);
122         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_INITIALIZE_SERVER", SAMR_ACCESS_INITIALIZE_SERVER, r);
123         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_CREATE_DOMAIN", SAMR_ACCESS_CREATE_DOMAIN, r);
124         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_ENUM_DOMAINS", SAMR_ACCESS_ENUM_DOMAINS, r);
125         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ACCESS_LOOKUP_DOMAIN", SAMR_ACCESS_LOOKUP_DOMAIN, r);
126         ndr->depth--;
127 }
128
129 static enum ndr_err_code ndr_push_samr_UserAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
130 {
131         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
132         return NDR_ERR_SUCCESS;
133 }
134
135 static enum ndr_err_code ndr_pull_samr_UserAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
136 {
137         uint32_t v;
138         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
139         *r = v;
140         return NDR_ERR_SUCCESS;
141 }
142
143 _PUBLIC_ void ndr_print_samr_UserAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
144 {
145         ndr_print_uint32(ndr, name, r);
146         ndr->depth++;
147         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_NAME_ETC", SAMR_USER_ACCESS_GET_NAME_ETC, r);
148         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOCALE", SAMR_USER_ACCESS_GET_LOCALE, r);
149         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_LOC_COM", SAMR_USER_ACCESS_SET_LOC_COM, r);
150         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_LOGONINFO", SAMR_USER_ACCESS_GET_LOGONINFO, r);
151         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_ATTRIBUTES", SAMR_USER_ACCESS_GET_ATTRIBUTES, r);
152         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_ATTRIBUTES", SAMR_USER_ACCESS_SET_ATTRIBUTES, r);
153         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_PASSWORD", SAMR_USER_ACCESS_CHANGE_PASSWORD, r);
154         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_SET_PASSWORD", SAMR_USER_ACCESS_SET_PASSWORD, r);
155         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUPS", SAMR_USER_ACCESS_GET_GROUPS, r);
156         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_GET_GROUP_MEMBERSHIP, r);
157         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP", SAMR_USER_ACCESS_CHANGE_GROUP_MEMBERSHIP, r);
158         ndr->depth--;
159 }
160
161 static enum ndr_err_code ndr_push_samr_DomainAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
162 {
163         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
164         return NDR_ERR_SUCCESS;
165 }
166
167 static enum ndr_err_code ndr_pull_samr_DomainAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
168 {
169         uint32_t v;
170         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
171         *r = v;
172         return NDR_ERR_SUCCESS;
173 }
174
175 _PUBLIC_ void ndr_print_samr_DomainAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
176 {
177         ndr_print_uint32(ndr, name, r);
178         ndr->depth++;
179         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1, r);
180         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_1", SAMR_DOMAIN_ACCESS_SET_INFO_1, r);
181         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2", SAMR_DOMAIN_ACCESS_LOOKUP_INFO_2, r);
182         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_2", SAMR_DOMAIN_ACCESS_SET_INFO_2, r);
183         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_USER", SAMR_DOMAIN_ACCESS_CREATE_USER, r);
184         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_GROUP", SAMR_DOMAIN_ACCESS_CREATE_GROUP, r);
185         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_CREATE_ALIAS", SAMR_DOMAIN_ACCESS_CREATE_ALIAS, r);
186         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS", SAMR_DOMAIN_ACCESS_LOOKUP_ALIAS, r);
187         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS", SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS, r);
188         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT", SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, r);
189         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_DOMAIN_ACCESS_SET_INFO_3", SAMR_DOMAIN_ACCESS_SET_INFO_3, r);
190         ndr->depth--;
191 }
192
193 static enum ndr_err_code ndr_push_samr_GroupAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
194 {
195         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
196         return NDR_ERR_SUCCESS;
197 }
198
199 static enum ndr_err_code ndr_pull_samr_GroupAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
200 {
201         uint32_t v;
202         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
203         *r = v;
204         return NDR_ERR_SUCCESS;
205 }
206
207 _PUBLIC_ void ndr_print_samr_GroupAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
208 {
209         ndr_print_uint32(ndr, name, r);
210         ndr->depth++;
211         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_LOOKUP_INFO", SAMR_GROUP_ACCESS_LOOKUP_INFO, r);
212         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_SET_INFO", SAMR_GROUP_ACCESS_SET_INFO, r);
213         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_ADD_MEMBER", SAMR_GROUP_ACCESS_ADD_MEMBER, r);
214         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_REMOVE_MEMBER", SAMR_GROUP_ACCESS_REMOVE_MEMBER, r);
215         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_GROUP_ACCESS_GET_MEMBERS", SAMR_GROUP_ACCESS_GET_MEMBERS, r);
216         ndr->depth--;
217 }
218
219 static enum ndr_err_code ndr_push_samr_AliasAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
220 {
221         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
222         return NDR_ERR_SUCCESS;
223 }
224
225 static enum ndr_err_code ndr_pull_samr_AliasAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
226 {
227         uint32_t v;
228         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
229         *r = v;
230         return NDR_ERR_SUCCESS;
231 }
232
233 _PUBLIC_ void ndr_print_samr_AliasAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
234 {
235         ndr_print_uint32(ndr, name, r);
236         ndr->depth++;
237         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_ADD_MEMBER", SAMR_ALIAS_ACCESS_ADD_MEMBER, r);
238         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_REMOVE_MEMBER", SAMR_ALIAS_ACCESS_REMOVE_MEMBER, r);
239         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_GET_MEMBERS", SAMR_ALIAS_ACCESS_GET_MEMBERS, r);
240         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_LOOKUP_INFO", SAMR_ALIAS_ACCESS_LOOKUP_INFO, r);
241         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_ALIAS_ACCESS_SET_INFO", SAMR_ALIAS_ACCESS_SET_INFO, r);
242         ndr->depth--;
243 }
244
245 static enum ndr_err_code ndr_push_samr_SamEntry(struct ndr_push *ndr, int ndr_flags, const struct samr_SamEntry *r)
246 {
247         if (ndr_flags & NDR_SCALARS) {
248                 NDR_CHECK(ndr_push_align(ndr, 5));
249                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx));
250                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
251                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
252         }
253         if (ndr_flags & NDR_BUFFERS) {
254                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
255         }
256         return NDR_ERR_SUCCESS;
257 }
258
259 static enum ndr_err_code ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r)
260 {
261         if (ndr_flags & NDR_SCALARS) {
262                 NDR_CHECK(ndr_pull_align(ndr, 5));
263                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx));
264                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
265                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
266         }
267         if (ndr_flags & NDR_BUFFERS) {
268                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
269         }
270         return NDR_ERR_SUCCESS;
271 }
272
273 _PUBLIC_ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r)
274 {
275         ndr_print_struct(ndr, name, "samr_SamEntry");
276         ndr->depth++;
277         ndr_print_uint32(ndr, "idx", r->idx);
278         ndr_print_lsa_String(ndr, "name", &r->name);
279         ndr->depth--;
280 }
281
282 static enum ndr_err_code ndr_push_samr_SamArray(struct ndr_push *ndr, int ndr_flags, const struct samr_SamArray *r)
283 {
284         uint32_t cntr_entries_1;
285         if (ndr_flags & NDR_SCALARS) {
286                 NDR_CHECK(ndr_push_align(ndr, 5));
287                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
288                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries));
289                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
290         }
291         if (ndr_flags & NDR_BUFFERS) {
292                 if (r->entries) {
293                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
294                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
295                                 NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
296                         }
297                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
298                                 NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
299                         }
300                 }
301         }
302         return NDR_ERR_SUCCESS;
303 }
304
305 static enum ndr_err_code ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r)
306 {
307         uint32_t _ptr_entries;
308         uint32_t cntr_entries_1;
309         TALLOC_CTX *_mem_save_entries_0;
310         TALLOC_CTX *_mem_save_entries_1;
311         if (ndr_flags & NDR_SCALARS) {
312                 NDR_CHECK(ndr_pull_align(ndr, 5));
313                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
314                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries));
315                 if (_ptr_entries) {
316                         NDR_PULL_ALLOC(ndr, r->entries);
317                 } else {
318                         r->entries = NULL;
319                 }
320                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
321         }
322         if (ndr_flags & NDR_BUFFERS) {
323                 if (r->entries) {
324                         _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
325                         NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
326                         NDR_CHECK(ndr_pull_array_size(ndr, &r->entries));
327                         NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries));
328                         _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr);
329                         NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
330                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
331                                 NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
332                         }
333                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
334                                 NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
335                         }
336                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0);
337                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
338                 }
339                 if (r->entries) {
340                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count));
341                 }
342         }
343         return NDR_ERR_SUCCESS;
344 }
345
346 _PUBLIC_ void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r)
347 {
348         uint32_t cntr_entries_1;
349         ndr_print_struct(ndr, name, "samr_SamArray");
350         ndr->depth++;
351         ndr_print_uint32(ndr, "count", r->count);
352         ndr_print_ptr(ndr, "entries", r->entries);
353         ndr->depth++;
354         if (r->entries) {
355                 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count);
356                 ndr->depth++;
357                 for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) {
358                         char *idx_1=NULL;
359                         if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) {
360                                 ndr_print_samr_SamEntry(ndr, "entries", &r->entries[cntr_entries_1]);
361                                 free(idx_1);
362                         }
363                 }
364                 ndr->depth--;
365         }
366         ndr->depth--;
367         ndr->depth--;
368 }
369
370 static enum ndr_err_code ndr_push_samr_DomainInfoClass(struct ndr_push *ndr, int ndr_flags, enum samr_DomainInfoClass r)
371 {
372         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
373         return NDR_ERR_SUCCESS;
374 }
375
376 static enum ndr_err_code ndr_pull_samr_DomainInfoClass(struct ndr_pull *ndr, int ndr_flags, enum samr_DomainInfoClass *r)
377 {
378         uint16_t v;
379         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
380         *r = v;
381         return NDR_ERR_SUCCESS;
382 }
383
384 _PUBLIC_ void ndr_print_samr_DomainInfoClass(struct ndr_print *ndr, const char *name, enum samr_DomainInfoClass r)
385 {
386         const char *val = NULL;
387
388         switch (r) {
389                 case DomainPasswordInformation: val = "DomainPasswordInformation"; break;
390                 case DomainGeneralInformation: val = "DomainGeneralInformation"; break;
391                 case DomainLogoffInformation: val = "DomainLogoffInformation"; break;
392                 case DomainOemInformation: val = "DomainOemInformation"; break;
393                 case DomainNameInformation: val = "DomainNameInformation"; break;
394                 case DomainReplicationInformation: val = "DomainReplicationInformation"; break;
395                 case DomainServerRoleInformation: val = "DomainServerRoleInformation"; break;
396                 case DomainModifiedInformation: val = "DomainModifiedInformation"; break;
397                 case DomainStateInformation: val = "DomainStateInformation"; break;
398                 case DomainUasInformation: val = "DomainUasInformation"; break;
399                 case DomainGeneralInformation2: val = "DomainGeneralInformation2"; break;
400                 case DomainLockoutInformation: val = "DomainLockoutInformation"; break;
401                 case DomainModifiedInformation2: val = "DomainModifiedInformation2"; break;
402         }
403         ndr_print_enum(ndr, name, "ENUM", val, r);
404 }
405
406 static enum ndr_err_code ndr_push_samr_Role(struct ndr_push *ndr, int ndr_flags, enum samr_Role r)
407 {
408         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
409         return NDR_ERR_SUCCESS;
410 }
411
412 static enum ndr_err_code ndr_pull_samr_Role(struct ndr_pull *ndr, int ndr_flags, enum samr_Role *r)
413 {
414         uint32_t v;
415         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
416         *r = v;
417         return NDR_ERR_SUCCESS;
418 }
419
420 _PUBLIC_ void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r)
421 {
422         const char *val = NULL;
423
424         switch (r) {
425                 case SAMR_ROLE_STANDALONE: val = "SAMR_ROLE_STANDALONE"; break;
426                 case SAMR_ROLE_DOMAIN_MEMBER: val = "SAMR_ROLE_DOMAIN_MEMBER"; break;
427                 case SAMR_ROLE_DOMAIN_BDC: val = "SAMR_ROLE_DOMAIN_BDC"; break;
428                 case SAMR_ROLE_DOMAIN_PDC: val = "SAMR_ROLE_DOMAIN_PDC"; break;
429         }
430         ndr_print_enum(ndr, name, "ENUM", val, r);
431 }
432
433 _PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r)
434 {
435         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
436         return NDR_ERR_SUCCESS;
437 }
438
439 _PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
440 {
441         uint32_t v;
442         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
443         *r = v;
444         return NDR_ERR_SUCCESS;
445 }
446
447 _PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r)
448 {
449         ndr_print_uint32(ndr, name, r);
450         ndr->depth++;
451         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_COMPLEX", DOMAIN_PASSWORD_COMPLEX, r);
452         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_ANON_CHANGE", DOMAIN_PASSWORD_NO_ANON_CHANGE, r);
453         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", DOMAIN_PASSWORD_NO_CLEAR_CHANGE, r);
454         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_LOCKOUT_ADMINS", DOMAIN_PASSWORD_LOCKOUT_ADMINS, r);
455         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_STORE_CLEARTEXT", DOMAIN_PASSWORD_STORE_CLEARTEXT, r);
456         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_REFUSE_PASSWORD_CHANGE", DOMAIN_REFUSE_PASSWORD_CHANGE, r);
457         ndr->depth--;
458 }
459
460 static enum ndr_err_code ndr_push_samr_DomainServerState(struct ndr_push *ndr, int ndr_flags, enum samr_DomainServerState r)
461 {
462         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
463         return NDR_ERR_SUCCESS;
464 }
465
466 static enum ndr_err_code ndr_pull_samr_DomainServerState(struct ndr_pull *ndr, int ndr_flags, enum samr_DomainServerState *r)
467 {
468         uint32_t v;
469         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
470         *r = v;
471         return NDR_ERR_SUCCESS;
472 }
473
474 _PUBLIC_ void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r)
475 {
476         const char *val = NULL;
477
478         switch (r) {
479                 case DOMAIN_SERVER_ENABLED: val = "DOMAIN_SERVER_ENABLED"; break;
480                 case DOMAIN_SERVER_DISABLED: val = "DOMAIN_SERVER_DISABLED"; break;
481         }
482         ndr_print_enum(ndr, name, "ENUM", val, r);
483 }
484
485 static enum ndr_err_code ndr_push_samr_DomInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo1 *r)
486 {
487         if (ndr_flags & NDR_SCALARS) {
488                 NDR_CHECK(ndr_push_align(ndr, 4));
489                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
490                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
491                 NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties));
492                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
493                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
494                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
495         }
496         if (ndr_flags & NDR_BUFFERS) {
497         }
498         return NDR_ERR_SUCCESS;
499 }
500
501 static enum ndr_err_code ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r)
502 {
503         if (ndr_flags & NDR_SCALARS) {
504                 NDR_CHECK(ndr_pull_align(ndr, 4));
505                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
506                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
507                 NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties));
508                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
509                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
510                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
511         }
512         if (ndr_flags & NDR_BUFFERS) {
513         }
514         return NDR_ERR_SUCCESS;
515 }
516
517 _PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r)
518 {
519         ndr_print_struct(ndr, name, "samr_DomInfo1");
520         ndr->depth++;
521         ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
522         ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
523         ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties);
524         ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
525         ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
526         ndr->depth--;
527 }
528
529 static enum ndr_err_code ndr_push_samr_DomGeneralInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation *r)
530 {
531         if (ndr_flags & NDR_SCALARS) {
532                 NDR_CHECK(ndr_push_align(ndr, 5));
533                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time));
534                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
535                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
536                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary));
537                 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
538                 NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state));
539                 NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role));
540                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
541                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users));
542                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_groups));
543                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases));
544                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
545         }
546         if (ndr_flags & NDR_BUFFERS) {
547                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
548                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
549                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary));
550         }
551         return NDR_ERR_SUCCESS;
552 }
553
554 static enum ndr_err_code ndr_pull_samr_DomGeneralInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation *r)
555 {
556         if (ndr_flags & NDR_SCALARS) {
557                 NDR_CHECK(ndr_pull_align(ndr, 5));
558                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time));
559                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
560                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
561                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary));
562                 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
563                 NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state));
564                 NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role));
565                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
566                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users));
567                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_groups));
568                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases));
569                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
570         }
571         if (ndr_flags & NDR_BUFFERS) {
572                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
573                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
574                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary));
575         }
576         return NDR_ERR_SUCCESS;
577 }
578
579 _PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r)
580 {
581         ndr_print_struct(ndr, name, "samr_DomGeneralInformation");
582         ndr->depth++;
583         ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time);
584         ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
585         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
586         ndr_print_lsa_String(ndr, "primary", &r->primary);
587         ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
588         ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state);
589         ndr_print_samr_Role(ndr, "role", r->role);
590         ndr_print_uint32(ndr, "unknown3", r->unknown3);
591         ndr_print_uint32(ndr, "num_users", r->num_users);
592         ndr_print_uint32(ndr, "num_groups", r->num_groups);
593         ndr_print_uint32(ndr, "num_aliases", r->num_aliases);
594         ndr->depth--;
595 }
596
597 static enum ndr_err_code ndr_push_samr_DomInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo3 *r)
598 {
599         if (ndr_flags & NDR_SCALARS) {
600                 NDR_CHECK(ndr_push_align(ndr, 4));
601                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time));
602                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
603         }
604         if (ndr_flags & NDR_BUFFERS) {
605         }
606         return NDR_ERR_SUCCESS;
607 }
608
609 static enum ndr_err_code ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r)
610 {
611         if (ndr_flags & NDR_SCALARS) {
612                 NDR_CHECK(ndr_pull_align(ndr, 4));
613                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time));
614                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
615         }
616         if (ndr_flags & NDR_BUFFERS) {
617         }
618         return NDR_ERR_SUCCESS;
619 }
620
621 _PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r)
622 {
623         ndr_print_struct(ndr, name, "samr_DomInfo3");
624         ndr->depth++;
625         ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time);
626         ndr->depth--;
627 }
628
629 static enum ndr_err_code ndr_push_samr_DomOEMInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomOEMInformation *r)
630 {
631         if (ndr_flags & NDR_SCALARS) {
632                 NDR_CHECK(ndr_push_align(ndr, 5));
633                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
634                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
635         }
636         if (ndr_flags & NDR_BUFFERS) {
637                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
638         }
639         return NDR_ERR_SUCCESS;
640 }
641
642 static enum ndr_err_code ndr_pull_samr_DomOEMInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomOEMInformation *r)
643 {
644         if (ndr_flags & NDR_SCALARS) {
645                 NDR_CHECK(ndr_pull_align(ndr, 5));
646                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
647                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
648         }
649         if (ndr_flags & NDR_BUFFERS) {
650                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
651         }
652         return NDR_ERR_SUCCESS;
653 }
654
655 _PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r)
656 {
657         ndr_print_struct(ndr, name, "samr_DomOEMInformation");
658         ndr->depth++;
659         ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
660         ndr->depth--;
661 }
662
663 static enum ndr_err_code ndr_push_samr_DomInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo5 *r)
664 {
665         if (ndr_flags & NDR_SCALARS) {
666                 NDR_CHECK(ndr_push_align(ndr, 5));
667                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
668                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
669         }
670         if (ndr_flags & NDR_BUFFERS) {
671                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
672         }
673         return NDR_ERR_SUCCESS;
674 }
675
676 static enum ndr_err_code ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r)
677 {
678         if (ndr_flags & NDR_SCALARS) {
679                 NDR_CHECK(ndr_pull_align(ndr, 5));
680                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
681                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
682         }
683         if (ndr_flags & NDR_BUFFERS) {
684                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
685         }
686         return NDR_ERR_SUCCESS;
687 }
688
689 _PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r)
690 {
691         ndr_print_struct(ndr, name, "samr_DomInfo5");
692         ndr->depth++;
693         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
694         ndr->depth--;
695 }
696
697 static enum ndr_err_code ndr_push_samr_DomInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo6 *r)
698 {
699         if (ndr_flags & NDR_SCALARS) {
700                 NDR_CHECK(ndr_push_align(ndr, 5));
701                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary));
702                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
703         }
704         if (ndr_flags & NDR_BUFFERS) {
705                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary));
706         }
707         return NDR_ERR_SUCCESS;
708 }
709
710 static enum ndr_err_code ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r)
711 {
712         if (ndr_flags & NDR_SCALARS) {
713                 NDR_CHECK(ndr_pull_align(ndr, 5));
714                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary));
715                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
716         }
717         if (ndr_flags & NDR_BUFFERS) {
718                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary));
719         }
720         return NDR_ERR_SUCCESS;
721 }
722
723 _PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r)
724 {
725         ndr_print_struct(ndr, name, "samr_DomInfo6");
726         ndr->depth++;
727         ndr_print_lsa_String(ndr, "primary", &r->primary);
728         ndr->depth--;
729 }
730
731 static enum ndr_err_code ndr_push_samr_DomInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo7 *r)
732 {
733         if (ndr_flags & NDR_SCALARS) {
734                 NDR_CHECK(ndr_push_align(ndr, 4));
735                 NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role));
736                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
737         }
738         if (ndr_flags & NDR_BUFFERS) {
739         }
740         return NDR_ERR_SUCCESS;
741 }
742
743 static enum ndr_err_code ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r)
744 {
745         if (ndr_flags & NDR_SCALARS) {
746                 NDR_CHECK(ndr_pull_align(ndr, 4));
747                 NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role));
748                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
749         }
750         if (ndr_flags & NDR_BUFFERS) {
751         }
752         return NDR_ERR_SUCCESS;
753 }
754
755 _PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r)
756 {
757         ndr_print_struct(ndr, name, "samr_DomInfo7");
758         ndr->depth++;
759         ndr_print_samr_Role(ndr, "role", r->role);
760         ndr->depth--;
761 }
762
763 static enum ndr_err_code ndr_push_samr_DomInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo8 *r)
764 {
765         if (ndr_flags & NDR_SCALARS) {
766                 NDR_CHECK(ndr_push_align(ndr, 8));
767                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
768                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
769                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
770         }
771         if (ndr_flags & NDR_BUFFERS) {
772         }
773         return NDR_ERR_SUCCESS;
774 }
775
776 static enum ndr_err_code ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r)
777 {
778         if (ndr_flags & NDR_SCALARS) {
779                 NDR_CHECK(ndr_pull_align(ndr, 8));
780                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
781                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
782                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
783         }
784         if (ndr_flags & NDR_BUFFERS) {
785         }
786         return NDR_ERR_SUCCESS;
787 }
788
789 _PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r)
790 {
791         ndr_print_struct(ndr, name, "samr_DomInfo8");
792         ndr->depth++;
793         ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
794         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
795         ndr->depth--;
796 }
797
798 static enum ndr_err_code ndr_push_samr_DomInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo9 *r)
799 {
800         if (ndr_flags & NDR_SCALARS) {
801                 NDR_CHECK(ndr_push_align(ndr, 4));
802                 NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state));
803                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
804         }
805         if (ndr_flags & NDR_BUFFERS) {
806         }
807         return NDR_ERR_SUCCESS;
808 }
809
810 static enum ndr_err_code ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r)
811 {
812         if (ndr_flags & NDR_SCALARS) {
813                 NDR_CHECK(ndr_pull_align(ndr, 4));
814                 NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state));
815                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
816         }
817         if (ndr_flags & NDR_BUFFERS) {
818         }
819         return NDR_ERR_SUCCESS;
820 }
821
822 _PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r)
823 {
824         ndr_print_struct(ndr, name, "samr_DomInfo9");
825         ndr->depth++;
826         ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state);
827         ndr->depth--;
828 }
829
830 static enum ndr_err_code ndr_push_samr_DomGeneralInformation2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation2 *r)
831 {
832         if (ndr_flags & NDR_SCALARS) {
833                 NDR_CHECK(ndr_push_align(ndr, 8));
834                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
835                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration));
836                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window));
837                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold));
838                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
839         }
840         if (ndr_flags & NDR_BUFFERS) {
841                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
842         }
843         return NDR_ERR_SUCCESS;
844 }
845
846 static enum ndr_err_code ndr_pull_samr_DomGeneralInformation2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation2 *r)
847 {
848         if (ndr_flags & NDR_SCALARS) {
849                 NDR_CHECK(ndr_pull_align(ndr, 8));
850                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
851                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration));
852                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window));
853                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold));
854                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
855         }
856         if (ndr_flags & NDR_BUFFERS) {
857                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
858         }
859         return NDR_ERR_SUCCESS;
860 }
861
862 _PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r)
863 {
864         ndr_print_struct(ndr, name, "samr_DomGeneralInformation2");
865         ndr->depth++;
866         ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
867         ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration);
868         ndr_print_hyper(ndr, "lockout_window", r->lockout_window);
869         ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold);
870         ndr->depth--;
871 }
872
873 static enum ndr_err_code ndr_push_samr_DomInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo12 *r)
874 {
875         if (ndr_flags & NDR_SCALARS) {
876                 NDR_CHECK(ndr_push_align(ndr, 8));
877                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration));
878                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window));
879                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold));
880                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
881         }
882         if (ndr_flags & NDR_BUFFERS) {
883         }
884         return NDR_ERR_SUCCESS;
885 }
886
887 static enum ndr_err_code ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r)
888 {
889         if (ndr_flags & NDR_SCALARS) {
890                 NDR_CHECK(ndr_pull_align(ndr, 8));
891                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration));
892                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window));
893                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold));
894                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
895         }
896         if (ndr_flags & NDR_BUFFERS) {
897         }
898         return NDR_ERR_SUCCESS;
899 }
900
901 _PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r)
902 {
903         ndr_print_struct(ndr, name, "samr_DomInfo12");
904         ndr->depth++;
905         ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration);
906         ndr_print_hyper(ndr, "lockout_window", r->lockout_window);
907         ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold);
908         ndr->depth--;
909 }
910
911 static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo13 *r)
912 {
913         if (ndr_flags & NDR_SCALARS) {
914                 NDR_CHECK(ndr_push_align(ndr, 8));
915                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
916                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
917                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_count_at_last_promotion));
918                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
919         }
920         if (ndr_flags & NDR_BUFFERS) {
921         }
922         return NDR_ERR_SUCCESS;
923 }
924
925 static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r)
926 {
927         if (ndr_flags & NDR_SCALARS) {
928                 NDR_CHECK(ndr_pull_align(ndr, 8));
929                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
930                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
931                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_count_at_last_promotion));
932                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
933         }
934         if (ndr_flags & NDR_BUFFERS) {
935         }
936         return NDR_ERR_SUCCESS;
937 }
938
939 _PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r)
940 {
941         ndr_print_struct(ndr, name, "samr_DomInfo13");
942         ndr->depth++;
943         ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
944         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
945         ndr_print_hyper(ndr, "modified_count_at_last_promotion", r->modified_count_at_last_promotion);
946         ndr->depth--;
947 }
948
949 static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DomainInfo *r)
950 {
951         if (ndr_flags & NDR_SCALARS) {
952                 int level = ndr_push_get_switch_value(ndr, r);
953                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
954                 NDR_CHECK(ndr_push_union_align(ndr, 8));
955                 switch (level) {
956                         case 1: {
957                                 NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1));
958                         break; }
959
960                         case 2: {
961                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
962                         break; }
963
964                         case 3: {
965                                 NDR_CHECK(ndr_push_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3));
966                         break; }
967
968                         case 4: {
969                                 NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
970                         break; }
971
972                         case 5: {
973                                 NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5));
974                         break; }
975
976                         case 6: {
977                                 NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6));
978                         break; }
979
980                         case 7: {
981                                 NDR_CHECK(ndr_push_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7));
982                         break; }
983
984                         case 8: {
985                                 NDR_CHECK(ndr_push_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8));
986                         break; }
987
988                         case 9: {
989                                 NDR_CHECK(ndr_push_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9));
990                         break; }
991
992                         case 11: {
993                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
994                         break; }
995
996                         case 12: {
997                                 NDR_CHECK(ndr_push_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12));
998                         break; }
999
1000                         case 13: {
1001                                 NDR_CHECK(ndr_push_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13));
1002                         break; }
1003
1004                         default:
1005                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1006                 }
1007         }
1008         if (ndr_flags & NDR_BUFFERS) {
1009                 int level = ndr_push_get_switch_value(ndr, r);
1010                 switch (level) {
1011                         case 1:
1012                         break;
1013
1014                         case 2:
1015                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
1016                         break;
1017
1018                         case 3:
1019                         break;
1020
1021                         case 4:
1022                                 NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
1023                         break;
1024
1025                         case 5:
1026                                 NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5));
1027                         break;
1028
1029                         case 6:
1030                                 NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6));
1031                         break;
1032
1033                         case 7:
1034                         break;
1035
1036                         case 8:
1037                         break;
1038
1039                         case 9:
1040                         break;
1041
1042                         case 11:
1043                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
1044                         break;
1045
1046                         case 12:
1047                         break;
1048
1049                         case 13:
1050                         break;
1051
1052                         default:
1053                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1054                 }
1055         }
1056         return NDR_ERR_SUCCESS;
1057 }
1058
1059 static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DomainInfo *r)
1060 {
1061         int level;
1062         uint16_t _level;
1063         level = ndr_pull_get_switch_value(ndr, r);
1064         if (ndr_flags & NDR_SCALARS) {
1065                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1066                 if (_level != level) {
1067                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1068                 }
1069                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
1070                 switch (level) {
1071                         case 1: {
1072                                 NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1));
1073                         break; }
1074
1075                         case 2: {
1076                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
1077                         break; }
1078
1079                         case 3: {
1080                                 NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3));
1081                         break; }
1082
1083                         case 4: {
1084                                 NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
1085                         break; }
1086
1087                         case 5: {
1088                                 NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5));
1089                         break; }
1090
1091                         case 6: {
1092                                 NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6));
1093                         break; }
1094
1095                         case 7: {
1096                                 NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7));
1097                         break; }
1098
1099                         case 8: {
1100                                 NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8));
1101                         break; }
1102
1103                         case 9: {
1104                                 NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9));
1105                         break; }
1106
1107                         case 11: {
1108                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
1109                         break; }
1110
1111                         case 12: {
1112                                 NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12));
1113                         break; }
1114
1115                         case 13: {
1116                                 NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13));
1117                         break; }
1118
1119                         default:
1120                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1121                 }
1122         }
1123         if (ndr_flags & NDR_BUFFERS) {
1124                 switch (level) {
1125                         case 1:
1126                         break;
1127
1128                         case 2:
1129                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
1130                         break;
1131
1132                         case 3:
1133                         break;
1134
1135                         case 4:
1136                                 NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
1137                         break;
1138
1139                         case 5:
1140                                 NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5));
1141                         break;
1142
1143                         case 6:
1144                                 NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6));
1145                         break;
1146
1147                         case 7:
1148                         break;
1149
1150                         case 8:
1151                         break;
1152
1153                         case 9:
1154                         break;
1155
1156                         case 11:
1157                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
1158                         break;
1159
1160                         case 12:
1161                         break;
1162
1163                         case 13:
1164                         break;
1165
1166                         default:
1167                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1168                 }
1169         }
1170         return NDR_ERR_SUCCESS;
1171 }
1172
1173 _PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r)
1174 {
1175         int level;
1176         level = ndr_print_get_switch_value(ndr, r);
1177         ndr_print_union(ndr, name, level, "samr_DomainInfo");
1178         switch (level) {
1179                 case 1:
1180                         ndr_print_samr_DomInfo1(ndr, "info1", &r->info1);
1181                 break;
1182
1183                 case 2:
1184                         ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
1185                 break;
1186
1187                 case 3:
1188                         ndr_print_samr_DomInfo3(ndr, "info3", &r->info3);
1189                 break;
1190
1191                 case 4:
1192                         ndr_print_samr_DomOEMInformation(ndr, "oem", &r->oem);
1193                 break;
1194
1195                 case 5:
1196                         ndr_print_samr_DomInfo5(ndr, "info5", &r->info5);
1197                 break;
1198
1199                 case 6:
1200                         ndr_print_samr_DomInfo6(ndr, "info6", &r->info6);
1201                 break;
1202
1203                 case 7:
1204                         ndr_print_samr_DomInfo7(ndr, "info7", &r->info7);
1205                 break;
1206
1207                 case 8:
1208                         ndr_print_samr_DomInfo8(ndr, "info8", &r->info8);
1209                 break;
1210
1211                 case 9:
1212                         ndr_print_samr_DomInfo9(ndr, "info9", &r->info9);
1213                 break;
1214
1215                 case 11:
1216                         ndr_print_samr_DomGeneralInformation2(ndr, "general2", &r->general2);
1217                 break;
1218
1219                 case 12:
1220                         ndr_print_samr_DomInfo12(ndr, "info12", &r->info12);
1221                 break;
1222
1223                 case 13:
1224                         ndr_print_samr_DomInfo13(ndr, "info13", &r->info13);
1225                 break;
1226
1227                 default:
1228                         ndr_print_bad_level(ndr, name, level);
1229         }
1230 }
1231
1232 static enum ndr_err_code ndr_push_samr_Ids(struct ndr_push *ndr, int ndr_flags, const struct samr_Ids *r)
1233 {
1234         uint32_t cntr_ids_1;
1235         if (ndr_flags & NDR_SCALARS) {
1236                 NDR_CHECK(ndr_push_align(ndr, 5));
1237                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1238                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ids));
1239                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1240         }
1241         if (ndr_flags & NDR_BUFFERS) {
1242                 if (r->ids) {
1243                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1244                         for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) {
1245                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ids[cntr_ids_1]));
1246                         }
1247                 }
1248         }
1249         return NDR_ERR_SUCCESS;
1250 }
1251
1252 static enum ndr_err_code ndr_pull_samr_Ids(struct ndr_pull *ndr, int ndr_flags, struct samr_Ids *r)
1253 {
1254         uint32_t _ptr_ids;
1255         uint32_t cntr_ids_1;
1256         TALLOC_CTX *_mem_save_ids_0;
1257         TALLOC_CTX *_mem_save_ids_1;
1258         if (ndr_flags & NDR_SCALARS) {
1259                 NDR_CHECK(ndr_pull_align(ndr, 5));
1260                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1261                 if (r->count > 1024) {
1262                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1263                 }
1264                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ids));
1265                 if (_ptr_ids) {
1266                         NDR_PULL_ALLOC(ndr, r->ids);
1267                 } else {
1268                         r->ids = NULL;
1269                 }
1270                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1271         }
1272         if (ndr_flags & NDR_BUFFERS) {
1273                 if (r->ids) {
1274                         _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1275                         NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0);
1276                         NDR_CHECK(ndr_pull_array_size(ndr, &r->ids));
1277                         NDR_PULL_ALLOC_N(ndr, r->ids, ndr_get_array_size(ndr, &r->ids));
1278                         _mem_save_ids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1279                         NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0);
1280                         for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) {
1281                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ids[cntr_ids_1]));
1282                         }
1283                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_1, 0);
1284                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0);
1285                 }
1286                 if (r->ids) {
1287                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->count));
1288                 }
1289         }
1290         return NDR_ERR_SUCCESS;
1291 }
1292
1293 _PUBLIC_ void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r)
1294 {
1295         uint32_t cntr_ids_1;
1296         ndr_print_struct(ndr, name, "samr_Ids");
1297         ndr->depth++;
1298         ndr_print_uint32(ndr, "count", r->count);
1299         ndr_print_ptr(ndr, "ids", r->ids);
1300         ndr->depth++;
1301         if (r->ids) {
1302                 ndr->print(ndr, "%s: ARRAY(%d)", "ids", (int)r->count);
1303                 ndr->depth++;
1304                 for (cntr_ids_1=0;cntr_ids_1<r->count;cntr_ids_1++) {
1305                         char *idx_1=NULL;
1306                         if (asprintf(&idx_1, "[%d]", cntr_ids_1) != -1) {
1307                                 ndr_print_uint32(ndr, "ids", r->ids[cntr_ids_1]);
1308                                 free(idx_1);
1309                         }
1310                 }
1311                 ndr->depth--;
1312         }
1313         ndr->depth--;
1314         ndr->depth--;
1315 }
1316
1317 _PUBLIC_ enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1318 {
1319         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1320         return NDR_ERR_SUCCESS;
1321 }
1322
1323 _PUBLIC_ enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1324 {
1325         uint32_t v;
1326         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1327         *r = v;
1328         return NDR_ERR_SUCCESS;
1329 }
1330
1331 _PUBLIC_ void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r)
1332 {
1333         ndr_print_uint32(ndr, name, r);
1334         ndr->depth++;
1335         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_MANDATORY", SE_GROUP_MANDATORY, r);
1336         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED_BY_DEFAULT", SE_GROUP_ENABLED_BY_DEFAULT, r);
1337         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED", SE_GROUP_ENABLED, r);
1338         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_OWNER", SE_GROUP_OWNER, r);
1339         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_USE_FOR_DENY_ONLY", SE_GROUP_USE_FOR_DENY_ONLY, r);
1340         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_RESOURCE", SE_GROUP_RESOURCE, r);
1341         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_LOGON_ID", SE_GROUP_LOGON_ID, r);
1342         ndr->depth--;
1343 }
1344
1345 static enum ndr_err_code ndr_push_samr_GroupInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAll *r)
1346 {
1347         if (ndr_flags & NDR_SCALARS) {
1348                 NDR_CHECK(ndr_push_align(ndr, 5));
1349                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1350                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1351                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members));
1352                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1353                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1354         }
1355         if (ndr_flags & NDR_BUFFERS) {
1356                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1357                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1358         }
1359         return NDR_ERR_SUCCESS;
1360 }
1361
1362 static enum ndr_err_code ndr_pull_samr_GroupInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAll *r)
1363 {
1364         if (ndr_flags & NDR_SCALARS) {
1365                 NDR_CHECK(ndr_pull_align(ndr, 5));
1366                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1367                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1368                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members));
1369                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1370                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1371         }
1372         if (ndr_flags & NDR_BUFFERS) {
1373                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1374                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1375         }
1376         return NDR_ERR_SUCCESS;
1377 }
1378
1379 _PUBLIC_ void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r)
1380 {
1381         ndr_print_struct(ndr, name, "samr_GroupInfoAll");
1382         ndr->depth++;
1383         ndr_print_lsa_String(ndr, "name", &r->name);
1384         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1385         ndr_print_uint32(ndr, "num_members", r->num_members);
1386         ndr_print_lsa_String(ndr, "description", &r->description);
1387         ndr->depth--;
1388 }
1389
1390 static enum ndr_err_code ndr_push_samr_GroupInfoAttributes(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAttributes *r)
1391 {
1392         if (ndr_flags & NDR_SCALARS) {
1393                 NDR_CHECK(ndr_push_align(ndr, 4));
1394                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1395                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1396         }
1397         if (ndr_flags & NDR_BUFFERS) {
1398         }
1399         return NDR_ERR_SUCCESS;
1400 }
1401
1402 static enum ndr_err_code ndr_pull_samr_GroupInfoAttributes(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAttributes *r)
1403 {
1404         if (ndr_flags & NDR_SCALARS) {
1405                 NDR_CHECK(ndr_pull_align(ndr, 4));
1406                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1407                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1408         }
1409         if (ndr_flags & NDR_BUFFERS) {
1410         }
1411         return NDR_ERR_SUCCESS;
1412 }
1413
1414 _PUBLIC_ void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r)
1415 {
1416         ndr_print_struct(ndr, name, "samr_GroupInfoAttributes");
1417         ndr->depth++;
1418         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1419         ndr->depth--;
1420 }
1421
1422 static enum ndr_err_code ndr_push_samr_GroupInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_GroupInfoEnum r)
1423 {
1424         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
1425         return NDR_ERR_SUCCESS;
1426 }
1427
1428 static enum ndr_err_code ndr_pull_samr_GroupInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_GroupInfoEnum *r)
1429 {
1430         uint16_t v;
1431         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
1432         *r = v;
1433         return NDR_ERR_SUCCESS;
1434 }
1435
1436 _PUBLIC_ void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r)
1437 {
1438         const char *val = NULL;
1439
1440         switch (r) {
1441                 case GROUPINFOALL: val = "GROUPINFOALL"; break;
1442                 case GROUPINFONAME: val = "GROUPINFONAME"; break;
1443                 case GROUPINFOATTRIBUTES: val = "GROUPINFOATTRIBUTES"; break;
1444                 case GROUPINFODESCRIPTION: val = "GROUPINFODESCRIPTION"; break;
1445                 case GROUPINFOALL2: val = "GROUPINFOALL2"; break;
1446         }
1447         ndr_print_enum(ndr, name, "ENUM", val, r);
1448 }
1449
1450 static enum ndr_err_code ndr_push_samr_GroupInfo(struct ndr_push *ndr, int ndr_flags, const union samr_GroupInfo *r)
1451 {
1452         if (ndr_flags & NDR_SCALARS) {
1453                 int level = ndr_push_get_switch_value(ndr, r);
1454                 NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, level));
1455                 NDR_CHECK(ndr_push_union_align(ndr, 5));
1456                 switch (level) {
1457                         case GROUPINFOALL: {
1458                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all));
1459                         break; }
1460
1461                         case GROUPINFONAME: {
1462                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1463                         break; }
1464
1465                         case GROUPINFOATTRIBUTES: {
1466                                 NDR_CHECK(ndr_push_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes));
1467                         break; }
1468
1469                         case GROUPINFODESCRIPTION: {
1470                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1471                         break; }
1472
1473                         case GROUPINFOALL2: {
1474                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2));
1475                         break; }
1476
1477                         default:
1478                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1479                 }
1480         }
1481         if (ndr_flags & NDR_BUFFERS) {
1482                 int level = ndr_push_get_switch_value(ndr, r);
1483                 switch (level) {
1484                         case GROUPINFOALL:
1485                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all));
1486                         break;
1487
1488                         case GROUPINFONAME:
1489                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1490                         break;
1491
1492                         case GROUPINFOATTRIBUTES:
1493                         break;
1494
1495                         case GROUPINFODESCRIPTION:
1496                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1497                         break;
1498
1499                         case GROUPINFOALL2:
1500                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2));
1501                         break;
1502
1503                         default:
1504                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1505                 }
1506         }
1507         return NDR_ERR_SUCCESS;
1508 }
1509
1510 static enum ndr_err_code ndr_pull_samr_GroupInfo(struct ndr_pull *ndr, int ndr_flags, union samr_GroupInfo *r)
1511 {
1512         int level;
1513         uint16_t _level;
1514         level = ndr_pull_get_switch_value(ndr, r);
1515         if (ndr_flags & NDR_SCALARS) {
1516                 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
1517                 if (_level != level) {
1518                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1519                 }
1520                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
1521                 switch (level) {
1522                         case GROUPINFOALL: {
1523                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all));
1524                         break; }
1525
1526                         case GROUPINFONAME: {
1527                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1528                         break; }
1529
1530                         case GROUPINFOATTRIBUTES: {
1531                                 NDR_CHECK(ndr_pull_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes));
1532                         break; }
1533
1534                         case GROUPINFODESCRIPTION: {
1535                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1536                         break; }
1537
1538                         case GROUPINFOALL2: {
1539                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2));
1540                         break; }
1541
1542                         default:
1543                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1544                 }
1545         }
1546         if (ndr_flags & NDR_BUFFERS) {
1547                 switch (level) {
1548                         case GROUPINFOALL:
1549                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all));
1550                         break;
1551
1552                         case GROUPINFONAME:
1553                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1554                         break;
1555
1556                         case GROUPINFOATTRIBUTES:
1557                         break;
1558
1559                         case GROUPINFODESCRIPTION:
1560                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1561                         break;
1562
1563                         case GROUPINFOALL2:
1564                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2));
1565                         break;
1566
1567                         default:
1568                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1569                 }
1570         }
1571         return NDR_ERR_SUCCESS;
1572 }
1573
1574 _PUBLIC_ void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r)
1575 {
1576         int level;
1577         level = ndr_print_get_switch_value(ndr, r);
1578         ndr_print_union(ndr, name, level, "samr_GroupInfo");
1579         switch (level) {
1580                 case GROUPINFOALL:
1581                         ndr_print_samr_GroupInfoAll(ndr, "all", &r->all);
1582                 break;
1583
1584                 case GROUPINFONAME:
1585                         ndr_print_lsa_String(ndr, "name", &r->name);
1586                 break;
1587
1588                 case GROUPINFOATTRIBUTES:
1589                         ndr_print_samr_GroupInfoAttributes(ndr, "attributes", &r->attributes);
1590                 break;
1591
1592                 case GROUPINFODESCRIPTION:
1593                         ndr_print_lsa_String(ndr, "description", &r->description);
1594                 break;
1595
1596                 case GROUPINFOALL2:
1597                         ndr_print_samr_GroupInfoAll(ndr, "all2", &r->all2);
1598                 break;
1599
1600                 default:
1601                         ndr_print_bad_level(ndr, name, level);
1602         }
1603 }
1604
1605 static enum ndr_err_code ndr_push_samr_RidTypeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidTypeArray *r)
1606 {
1607         uint32_t cntr_rids_1;
1608         uint32_t cntr_types_1;
1609         if (ndr_flags & NDR_SCALARS) {
1610                 NDR_CHECK(ndr_push_align(ndr, 5));
1611                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1612                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
1613                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->types));
1614                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1615         }
1616         if (ndr_flags & NDR_BUFFERS) {
1617                 if (r->rids) {
1618                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1619                         for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) {
1620                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
1621                         }
1622                 }
1623                 if (r->types) {
1624                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
1625                         for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) {
1626                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->types[cntr_types_1]));
1627                         }
1628                 }
1629         }
1630         return NDR_ERR_SUCCESS;
1631 }
1632
1633 static enum ndr_err_code ndr_pull_samr_RidTypeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidTypeArray *r)
1634 {
1635         uint32_t _ptr_rids;
1636         uint32_t cntr_rids_1;
1637         TALLOC_CTX *_mem_save_rids_0;
1638         TALLOC_CTX *_mem_save_rids_1;
1639         uint32_t _ptr_types;
1640         uint32_t cntr_types_1;
1641         TALLOC_CTX *_mem_save_types_0;
1642         TALLOC_CTX *_mem_save_types_1;
1643         if (ndr_flags & NDR_SCALARS) {
1644                 NDR_CHECK(ndr_pull_align(ndr, 5));
1645                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1646                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
1647                 if (_ptr_rids) {
1648                         NDR_PULL_ALLOC(ndr, r->rids);
1649                 } else {
1650                         r->rids = NULL;
1651                 }
1652                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types));
1653                 if (_ptr_types) {
1654                         NDR_PULL_ALLOC(ndr, r->types);
1655                 } else {
1656                         r->types = NULL;
1657                 }
1658                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1659         }
1660         if (ndr_flags & NDR_BUFFERS) {
1661                 if (r->rids) {
1662                         _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1663                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
1664                         NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
1665                         NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
1666                         _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1667                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
1668                         for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) {
1669                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
1670                         }
1671                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
1672                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
1673                 }
1674                 if (r->types) {
1675                         _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr);
1676                         NDR_PULL_SET_MEM_CTX(ndr, r->types, 0);
1677                         NDR_CHECK(ndr_pull_array_size(ndr, &r->types));
1678                         NDR_PULL_ALLOC_N(ndr, r->types, ndr_get_array_size(ndr, &r->types));
1679                         _mem_save_types_1 = NDR_PULL_GET_MEM_CTX(ndr);
1680                         NDR_PULL_SET_MEM_CTX(ndr, r->types, 0);
1681                         for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) {
1682                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->types[cntr_types_1]));
1683                         }
1684                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_1, 0);
1685                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, 0);
1686                 }
1687                 if (r->rids) {
1688                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count));
1689                 }
1690                 if (r->types) {
1691                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->types, r->count));
1692                 }
1693         }
1694         return NDR_ERR_SUCCESS;
1695 }
1696
1697 _PUBLIC_ void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r)
1698 {
1699         uint32_t cntr_rids_1;
1700         uint32_t cntr_types_1;
1701         ndr_print_struct(ndr, name, "samr_RidTypeArray");
1702         ndr->depth++;
1703         ndr_print_uint32(ndr, "count", r->count);
1704         ndr_print_ptr(ndr, "rids", r->rids);
1705         ndr->depth++;
1706         if (r->rids) {
1707                 ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count);
1708                 ndr->depth++;
1709                 for (cntr_rids_1=0;cntr_rids_1<r->count;cntr_rids_1++) {
1710                         char *idx_1=NULL;
1711                         if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
1712                                 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
1713                                 free(idx_1);
1714                         }
1715                 }
1716                 ndr->depth--;
1717         }
1718         ndr->depth--;
1719         ndr_print_ptr(ndr, "types", r->types);
1720         ndr->depth++;
1721         if (r->types) {
1722                 ndr->print(ndr, "%s: ARRAY(%d)", "types", (int)r->count);
1723                 ndr->depth++;
1724                 for (cntr_types_1=0;cntr_types_1<r->count;cntr_types_1++) {
1725                         char *idx_1=NULL;
1726                         if (asprintf(&idx_1, "[%d]", cntr_types_1) != -1) {
1727                                 ndr_print_uint32(ndr, "types", r->types[cntr_types_1]);
1728                                 free(idx_1);
1729                         }
1730                 }
1731                 ndr->depth--;
1732         }
1733         ndr->depth--;
1734         ndr->depth--;
1735 }
1736
1737 static enum ndr_err_code ndr_push_samr_AliasInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_AliasInfoAll *r)
1738 {
1739         if (ndr_flags & NDR_SCALARS) {
1740                 NDR_CHECK(ndr_push_align(ndr, 5));
1741                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1742                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members));
1743                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1744                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1745         }
1746         if (ndr_flags & NDR_BUFFERS) {
1747                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1748                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1749         }
1750         return NDR_ERR_SUCCESS;
1751 }
1752
1753 static enum ndr_err_code ndr_pull_samr_AliasInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_AliasInfoAll *r)
1754 {
1755         if (ndr_flags & NDR_SCALARS) {
1756                 NDR_CHECK(ndr_pull_align(ndr, 5));
1757                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1758                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members));
1759                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1760                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1761         }
1762         if (ndr_flags & NDR_BUFFERS) {
1763                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1764                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1765         }
1766         return NDR_ERR_SUCCESS;
1767 }
1768
1769 _PUBLIC_ void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r)
1770 {
1771         ndr_print_struct(ndr, name, "samr_AliasInfoAll");
1772         ndr->depth++;
1773         ndr_print_lsa_String(ndr, "name", &r->name);
1774         ndr_print_uint32(ndr, "num_members", r->num_members);
1775         ndr_print_lsa_String(ndr, "description", &r->description);
1776         ndr->depth--;
1777 }
1778
1779 static enum ndr_err_code ndr_push_samr_AliasInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_AliasInfoEnum r)
1780 {
1781         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
1782         return NDR_ERR_SUCCESS;
1783 }
1784
1785 static enum ndr_err_code ndr_pull_samr_AliasInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_AliasInfoEnum *r)
1786 {
1787         uint16_t v;
1788         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
1789         *r = v;
1790         return NDR_ERR_SUCCESS;
1791 }
1792
1793 _PUBLIC_ void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r)
1794 {
1795         const char *val = NULL;
1796
1797         switch (r) {
1798                 case ALIASINFOALL: val = "ALIASINFOALL"; break;
1799                 case ALIASINFONAME: val = "ALIASINFONAME"; break;
1800                 case ALIASINFODESCRIPTION: val = "ALIASINFODESCRIPTION"; break;
1801         }
1802         ndr_print_enum(ndr, name, "ENUM", val, r);
1803 }
1804
1805 static enum ndr_err_code ndr_push_samr_AliasInfo(struct ndr_push *ndr, int ndr_flags, const union samr_AliasInfo *r)
1806 {
1807         if (ndr_flags & NDR_SCALARS) {
1808                 int level = ndr_push_get_switch_value(ndr, r);
1809                 NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, level));
1810                 NDR_CHECK(ndr_push_union_align(ndr, 5));
1811                 switch (level) {
1812                         case ALIASINFOALL: {
1813                                 NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all));
1814                         break; }
1815
1816                         case ALIASINFONAME: {
1817                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1818                         break; }
1819
1820                         case ALIASINFODESCRIPTION: {
1821                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1822                         break; }
1823
1824                         default:
1825                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1826                 }
1827         }
1828         if (ndr_flags & NDR_BUFFERS) {
1829                 int level = ndr_push_get_switch_value(ndr, r);
1830                 switch (level) {
1831                         case ALIASINFOALL:
1832                                 NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all));
1833                         break;
1834
1835                         case ALIASINFONAME:
1836                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1837                         break;
1838
1839                         case ALIASINFODESCRIPTION:
1840                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1841                         break;
1842
1843                         default:
1844                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1845                 }
1846         }
1847         return NDR_ERR_SUCCESS;
1848 }
1849
1850 static enum ndr_err_code ndr_pull_samr_AliasInfo(struct ndr_pull *ndr, int ndr_flags, union samr_AliasInfo *r)
1851 {
1852         int level;
1853         uint16_t _level;
1854         level = ndr_pull_get_switch_value(ndr, r);
1855         if (ndr_flags & NDR_SCALARS) {
1856                 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
1857                 if (_level != level) {
1858                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1859                 }
1860                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
1861                 switch (level) {
1862                         case ALIASINFOALL: {
1863                                 NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all));
1864                         break; }
1865
1866                         case ALIASINFONAME: {
1867                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1868                         break; }
1869
1870                         case ALIASINFODESCRIPTION: {
1871                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1872                         break; }
1873
1874                         default:
1875                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1876                 }
1877         }
1878         if (ndr_flags & NDR_BUFFERS) {
1879                 switch (level) {
1880                         case ALIASINFOALL:
1881                                 NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all));
1882                         break;
1883
1884                         case ALIASINFONAME:
1885                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1886                         break;
1887
1888                         case ALIASINFODESCRIPTION:
1889                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1890                         break;
1891
1892                         default:
1893                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1894                 }
1895         }
1896         return NDR_ERR_SUCCESS;
1897 }
1898
1899 _PUBLIC_ void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r)
1900 {
1901         int level;
1902         level = ndr_print_get_switch_value(ndr, r);
1903         ndr_print_union(ndr, name, level, "samr_AliasInfo");
1904         switch (level) {
1905                 case ALIASINFOALL:
1906                         ndr_print_samr_AliasInfoAll(ndr, "all", &r->all);
1907                 break;
1908
1909                 case ALIASINFONAME:
1910                         ndr_print_lsa_String(ndr, "name", &r->name);
1911                 break;
1912
1913                 case ALIASINFODESCRIPTION:
1914                         ndr_print_lsa_String(ndr, "description", &r->description);
1915                 break;
1916
1917                 default:
1918                         ndr_print_bad_level(ndr, name, level);
1919         }
1920 }
1921
1922 static enum ndr_err_code ndr_push_samr_UserInfoLevel(struct ndr_push *ndr, int ndr_flags, enum samr_UserInfoLevel r)
1923 {
1924         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
1925         return NDR_ERR_SUCCESS;
1926 }
1927
1928 static enum ndr_err_code ndr_pull_samr_UserInfoLevel(struct ndr_pull *ndr, int ndr_flags, enum samr_UserInfoLevel *r)
1929 {
1930         uint16_t v;
1931         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
1932         *r = v;
1933         return NDR_ERR_SUCCESS;
1934 }
1935
1936 _PUBLIC_ void ndr_print_samr_UserInfoLevel(struct ndr_print *ndr, const char *name, enum samr_UserInfoLevel r)
1937 {
1938         const char *val = NULL;
1939
1940         switch (r) {
1941                 case UserGeneralInformation: val = "UserGeneralInformation"; break;
1942                 case UserPreferencesInformation: val = "UserPreferencesInformation"; break;
1943                 case UserLogonInformation: val = "UserLogonInformation"; break;
1944                 case UserLogonHoursInformation: val = "UserLogonHoursInformation"; break;
1945                 case UserAccountInformation: val = "UserAccountInformation"; break;
1946                 case UserNameInformation: val = "UserNameInformation"; break;
1947                 case UserAccountNameInformation: val = "UserAccountNameInformation"; break;
1948                 case UserFullNameInformation: val = "UserFullNameInformation"; break;
1949                 case UserPrimaryGroupInformation: val = "UserPrimaryGroupInformation"; break;
1950                 case UserHomeInformation: val = "UserHomeInformation"; break;
1951                 case UserScriptInformation: val = "UserScriptInformation"; break;
1952                 case UserProfileInformation: val = "UserProfileInformation"; break;
1953                 case UserAdminCommentInformation: val = "UserAdminCommentInformation"; break;
1954                 case UserWorkStationsInformation: val = "UserWorkStationsInformation"; break;
1955                 case UserControlInformation: val = "UserControlInformation"; break;
1956                 case UserExpiresInformation: val = "UserExpiresInformation"; break;
1957                 case UserInternal1Information: val = "UserInternal1Information"; break;
1958                 case UserParametersInformation: val = "UserParametersInformation"; break;
1959                 case UserAllInformation: val = "UserAllInformation"; break;
1960                 case UserInternal4Information: val = "UserInternal4Information"; break;
1961                 case UserInternal5Information: val = "UserInternal5Information"; break;
1962                 case UserInternal4InformationNew: val = "UserInternal4InformationNew"; break;
1963                 case UserInternal5InformationNew: val = "UserInternal5InformationNew"; break;
1964         }
1965         ndr_print_enum(ndr, name, "ENUM", val, r);
1966 }
1967
1968 static enum ndr_err_code ndr_push_samr_UserInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo1 *r)
1969 {
1970         if (ndr_flags & NDR_SCALARS) {
1971                 NDR_CHECK(ndr_push_align(ndr, 5));
1972                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1973                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1974                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
1975                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1976                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
1977                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1978         }
1979         if (ndr_flags & NDR_BUFFERS) {
1980                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1981                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1982                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1983                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
1984         }
1985         return NDR_ERR_SUCCESS;
1986 }
1987
1988 static enum ndr_err_code ndr_pull_samr_UserInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo1 *r)
1989 {
1990         if (ndr_flags & NDR_SCALARS) {
1991                 NDR_CHECK(ndr_pull_align(ndr, 5));
1992                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1993                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1994                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1995                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1996                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
1997                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1998         }
1999         if (ndr_flags & NDR_BUFFERS) {
2000                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2001                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2002                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2003                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2004         }
2005         return NDR_ERR_SUCCESS;
2006 }
2007
2008 _PUBLIC_ void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r)
2009 {
2010         ndr_print_struct(ndr, name, "samr_UserInfo1");
2011         ndr->depth++;
2012         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2013         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2014         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2015         ndr_print_lsa_String(ndr, "description", &r->description);
2016         ndr_print_lsa_String(ndr, "comment", &r->comment);
2017         ndr->depth--;
2018 }
2019
2020 static enum ndr_err_code ndr_push_samr_UserInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo2 *r)
2021 {
2022         if (ndr_flags & NDR_SCALARS) {
2023                 NDR_CHECK(ndr_push_align(ndr, 5));
2024                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2025                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown));
2026                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2027                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2028                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2029         }
2030         if (ndr_flags & NDR_BUFFERS) {
2031                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2032                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown));
2033         }
2034         return NDR_ERR_SUCCESS;
2035 }
2036
2037 static enum ndr_err_code ndr_pull_samr_UserInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo2 *r)
2038 {
2039         if (ndr_flags & NDR_SCALARS) {
2040                 NDR_CHECK(ndr_pull_align(ndr, 5));
2041                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2042                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown));
2043                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2044                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2045                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2046         }
2047         if (ndr_flags & NDR_BUFFERS) {
2048                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2049                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown));
2050         }
2051         return NDR_ERR_SUCCESS;
2052 }
2053
2054 _PUBLIC_ void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r)
2055 {
2056         ndr_print_struct(ndr, name, "samr_UserInfo2");
2057         ndr->depth++;
2058         ndr_print_lsa_String(ndr, "comment", &r->comment);
2059         ndr_print_lsa_String(ndr, "unknown", &r->unknown);
2060         ndr_print_uint16(ndr, "country_code", r->country_code);
2061         ndr_print_uint16(ndr, "code_page", r->code_page);
2062         ndr->depth--;
2063 }
2064
2065 _PUBLIC_ enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r)
2066 {
2067         {
2068                 uint32_t _flags_save_STRUCT = ndr->flags;
2069                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2070                 if (ndr_flags & NDR_SCALARS) {
2071                         NDR_CHECK(ndr_push_align(ndr, 5));
2072                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->units_per_week));
2073                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->bits));
2074                         NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2075                 }
2076                 if (ndr_flags & NDR_BUFFERS) {
2077                         if (r->bits) {
2078                                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 1260));
2079                                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2080                                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->units_per_week / 8));
2081                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->bits, r->units_per_week / 8));
2082                         }
2083                 }
2084                 ndr->flags = _flags_save_STRUCT;
2085         }
2086         return NDR_ERR_SUCCESS;
2087 }
2088
2089 _PUBLIC_ enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r)
2090 {
2091         uint32_t _ptr_bits;
2092         TALLOC_CTX *_mem_save_bits_0;
2093         {
2094                 uint32_t _flags_save_STRUCT = ndr->flags;
2095                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2096                 if (ndr_flags & NDR_SCALARS) {
2097                         NDR_CHECK(ndr_pull_align(ndr, 5));
2098                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->units_per_week));
2099                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bits));
2100                         if (_ptr_bits) {
2101                                 NDR_PULL_ALLOC(ndr, r->bits);
2102                         } else {
2103                                 r->bits = NULL;
2104                         }
2105                         NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2106                 }
2107                 if (ndr_flags & NDR_BUFFERS) {
2108                         if (r->bits) {
2109                                 _mem_save_bits_0 = NDR_PULL_GET_MEM_CTX(ndr);
2110                                 NDR_PULL_SET_MEM_CTX(ndr, r->bits, 0);
2111                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->bits));
2112                                 NDR_CHECK(ndr_pull_array_length(ndr, &r->bits));
2113                                 if (ndr_get_array_length(ndr, &r->bits) > ndr_get_array_size(ndr, &r->bits)) {
2114                                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bits), ndr_get_array_length(ndr, &r->bits));
2115                                 }
2116                                 NDR_PULL_ALLOC_N(ndr, r->bits, ndr_get_array_size(ndr, &r->bits));
2117                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->bits, ndr_get_array_length(ndr, &r->bits)));
2118                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bits_0, 0);
2119                         }
2120                         if (r->bits) {
2121                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bits, 1260));
2122                         }
2123                         if (r->bits) {
2124                                 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bits, r->units_per_week / 8));
2125                         }
2126                 }
2127                 ndr->flags = _flags_save_STRUCT;
2128         }
2129         return NDR_ERR_SUCCESS;
2130 }
2131
2132 _PUBLIC_ void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r)
2133 {
2134         ndr_print_struct(ndr, name, "samr_LogonHours");
2135         {
2136                 uint32_t _flags_save_STRUCT = ndr->flags;
2137                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2138                 ndr->depth++;
2139                 ndr_print_uint16(ndr, "units_per_week", r->units_per_week);
2140                 ndr_print_ptr(ndr, "bits", r->bits);
2141                 ndr->depth++;
2142                 if (r->bits) {
2143                         ndr_print_array_uint8(ndr, "bits", r->bits, r->units_per_week / 8);
2144                 }
2145                 ndr->depth--;
2146                 ndr->depth--;
2147                 ndr->flags = _flags_save_STRUCT;
2148         }
2149 }
2150
2151 static enum ndr_err_code ndr_push_samr_UserInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo3 *r)
2152 {
2153         if (ndr_flags & NDR_SCALARS) {
2154                 NDR_CHECK(ndr_push_align(ndr, 5));
2155                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2156                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2157                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2158                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2159                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2160                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2161                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2162                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2163                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2164                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2165                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2166                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2167                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
2168                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
2169                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2170                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2171                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2172                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2173                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2174         }
2175         if (ndr_flags & NDR_BUFFERS) {
2176                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2177                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2178                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2179                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2180                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2181                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2182                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2183                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2184         }
2185         return NDR_ERR_SUCCESS;
2186 }
2187
2188 static enum ndr_err_code ndr_pull_samr_UserInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo3 *r)
2189 {
2190         if (ndr_flags & NDR_SCALARS) {
2191                 NDR_CHECK(ndr_pull_align(ndr, 5));
2192                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2193                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2194                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2195                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2196                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2197                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2198                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2199                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2200                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2201                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2202                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2203                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2204                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
2205                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
2206                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2207                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2208                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2209                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2210                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2211         }
2212         if (ndr_flags & NDR_BUFFERS) {
2213                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2214                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2215                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2216                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2217                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2218                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2219                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2220                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2221         }
2222         return NDR_ERR_SUCCESS;
2223 }
2224
2225 _PUBLIC_ void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r)
2226 {
2227         ndr_print_struct(ndr, name, "samr_UserInfo3");
2228         ndr->depth++;
2229         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2230         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2231         ndr_print_uint32(ndr, "rid", r->rid);
2232         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2233         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2234         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2235         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2236         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2237         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2238         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2239         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2240         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2241         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
2242         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
2243         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2244         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2245         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2246         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2247         ndr->depth--;
2248 }
2249
2250 static enum ndr_err_code ndr_push_samr_UserInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo4 *r)
2251 {
2252         if (ndr_flags & NDR_SCALARS) {
2253                 NDR_CHECK(ndr_push_align(ndr, 5));
2254                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2255                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2256         }
2257         if (ndr_flags & NDR_BUFFERS) {
2258                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2259         }
2260         return NDR_ERR_SUCCESS;
2261 }
2262
2263 static enum ndr_err_code ndr_pull_samr_UserInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo4 *r)
2264 {
2265         if (ndr_flags & NDR_SCALARS) {
2266                 NDR_CHECK(ndr_pull_align(ndr, 5));
2267                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2268                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2269         }
2270         if (ndr_flags & NDR_BUFFERS) {
2271                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2272         }
2273         return NDR_ERR_SUCCESS;
2274 }
2275
2276 _PUBLIC_ void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r)
2277 {
2278         ndr_print_struct(ndr, name, "samr_UserInfo4");
2279         ndr->depth++;
2280         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2281         ndr->depth--;
2282 }
2283
2284 static enum ndr_err_code ndr_push_samr_UserInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo5 *r)
2285 {
2286         if (ndr_flags & NDR_SCALARS) {
2287                 NDR_CHECK(ndr_push_align(ndr, 5));
2288                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2289                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2290                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2291                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2292                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2293                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2294                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2295                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2296                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2297                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2298                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2299                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2300                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2301                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2302                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2303                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2304                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2305                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2306                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2307         }
2308         if (ndr_flags & NDR_BUFFERS) {
2309                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2310                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2311                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2312                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2313                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2314                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2315                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2316                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2317                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2318         }
2319         return NDR_ERR_SUCCESS;
2320 }
2321
2322 static enum ndr_err_code ndr_pull_samr_UserInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo5 *r)
2323 {
2324         if (ndr_flags & NDR_SCALARS) {
2325                 NDR_CHECK(ndr_pull_align(ndr, 5));
2326                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2327                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2328                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2329                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2330                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2331                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2332                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2333                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2334                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2335                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2336                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2337                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2338                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2339                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2340                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2341                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2342                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2343                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2344                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2345         }
2346         if (ndr_flags & NDR_BUFFERS) {
2347                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2348                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2349                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2350                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2351                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2352                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2353                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2354                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2355                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2356         }
2357         return NDR_ERR_SUCCESS;
2358 }
2359
2360 _PUBLIC_ void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r)
2361 {
2362         ndr_print_struct(ndr, name, "samr_UserInfo5");
2363         ndr->depth++;
2364         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2365         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2366         ndr_print_uint32(ndr, "rid", r->rid);
2367         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2368         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2369         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2370         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2371         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2372         ndr_print_lsa_String(ndr, "description", &r->description);
2373         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2374         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2375         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2376         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2377         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2378         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2379         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2380         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2381         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2382         ndr->depth--;
2383 }
2384
2385 static enum ndr_err_code ndr_push_samr_UserInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo6 *r)
2386 {
2387         if (ndr_flags & NDR_SCALARS) {
2388                 NDR_CHECK(ndr_push_align(ndr, 5));
2389                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2390                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2391                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2392         }
2393         if (ndr_flags & NDR_BUFFERS) {
2394                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2395                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2396         }
2397         return NDR_ERR_SUCCESS;
2398 }
2399
2400 static enum ndr_err_code ndr_pull_samr_UserInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo6 *r)
2401 {
2402         if (ndr_flags & NDR_SCALARS) {
2403                 NDR_CHECK(ndr_pull_align(ndr, 5));
2404                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2405                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2406                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2407         }
2408         if (ndr_flags & NDR_BUFFERS) {
2409                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2410                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2411         }
2412         return NDR_ERR_SUCCESS;
2413 }
2414
2415 _PUBLIC_ void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r)
2416 {
2417         ndr_print_struct(ndr, name, "samr_UserInfo6");
2418         ndr->depth++;
2419         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2420         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2421         ndr->depth--;
2422 }
2423
2424 static enum ndr_err_code ndr_push_samr_UserInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo7 *r)
2425 {
2426         if (ndr_flags & NDR_SCALARS) {
2427                 NDR_CHECK(ndr_push_align(ndr, 5));
2428                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2429                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2430         }
2431         if (ndr_flags & NDR_BUFFERS) {
2432                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2433         }
2434         return NDR_ERR_SUCCESS;
2435 }
2436
2437 static enum ndr_err_code ndr_pull_samr_UserInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo7 *r)
2438 {
2439         if (ndr_flags & NDR_SCALARS) {
2440                 NDR_CHECK(ndr_pull_align(ndr, 5));
2441                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2442                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2443         }
2444         if (ndr_flags & NDR_BUFFERS) {
2445                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2446         }
2447         return NDR_ERR_SUCCESS;
2448 }
2449
2450 _PUBLIC_ void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r)
2451 {
2452         ndr_print_struct(ndr, name, "samr_UserInfo7");
2453         ndr->depth++;
2454         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2455         ndr->depth--;
2456 }
2457
2458 static enum ndr_err_code ndr_push_samr_UserInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo8 *r)
2459 {
2460         if (ndr_flags & NDR_SCALARS) {
2461                 NDR_CHECK(ndr_push_align(ndr, 5));
2462                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2463                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2464         }
2465         if (ndr_flags & NDR_BUFFERS) {
2466                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2467         }
2468         return NDR_ERR_SUCCESS;
2469 }
2470
2471 static enum ndr_err_code ndr_pull_samr_UserInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo8 *r)
2472 {
2473         if (ndr_flags & NDR_SCALARS) {
2474                 NDR_CHECK(ndr_pull_align(ndr, 5));
2475                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2476                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2477         }
2478         if (ndr_flags & NDR_BUFFERS) {
2479                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2480         }
2481         return NDR_ERR_SUCCESS;
2482 }
2483
2484 _PUBLIC_ void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r)
2485 {
2486         ndr_print_struct(ndr, name, "samr_UserInfo8");
2487         ndr->depth++;
2488         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2489         ndr->depth--;
2490 }
2491
2492 static enum ndr_err_code ndr_push_samr_UserInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo9 *r)
2493 {
2494         if (ndr_flags & NDR_SCALARS) {
2495                 NDR_CHECK(ndr_push_align(ndr, 4));
2496                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2497                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2498         }
2499         if (ndr_flags & NDR_BUFFERS) {
2500         }
2501         return NDR_ERR_SUCCESS;
2502 }
2503
2504 static enum ndr_err_code ndr_pull_samr_UserInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo9 *r)
2505 {
2506         if (ndr_flags & NDR_SCALARS) {
2507                 NDR_CHECK(ndr_pull_align(ndr, 4));
2508                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2509                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2510         }
2511         if (ndr_flags & NDR_BUFFERS) {
2512         }
2513         return NDR_ERR_SUCCESS;
2514 }
2515
2516 _PUBLIC_ void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r)
2517 {
2518         ndr_print_struct(ndr, name, "samr_UserInfo9");
2519         ndr->depth++;
2520         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2521         ndr->depth--;
2522 }
2523
2524 static enum ndr_err_code ndr_push_samr_UserInfo10(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo10 *r)
2525 {
2526         if (ndr_flags & NDR_SCALARS) {
2527                 NDR_CHECK(ndr_push_align(ndr, 5));
2528                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2529                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2530                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2531         }
2532         if (ndr_flags & NDR_BUFFERS) {
2533                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2534                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2535         }
2536         return NDR_ERR_SUCCESS;
2537 }
2538
2539 static enum ndr_err_code ndr_pull_samr_UserInfo10(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo10 *r)
2540 {
2541         if (ndr_flags & NDR_SCALARS) {
2542                 NDR_CHECK(ndr_pull_align(ndr, 5));
2543                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2544                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2545                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2546         }
2547         if (ndr_flags & NDR_BUFFERS) {
2548                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2549                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2550         }
2551         return NDR_ERR_SUCCESS;
2552 }
2553
2554 _PUBLIC_ void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r)
2555 {
2556         ndr_print_struct(ndr, name, "samr_UserInfo10");
2557         ndr->depth++;
2558         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2559         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2560         ndr->depth--;
2561 }
2562
2563 static enum ndr_err_code ndr_push_samr_UserInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo11 *r)
2564 {
2565         if (ndr_flags & NDR_SCALARS) {
2566                 NDR_CHECK(ndr_push_align(ndr, 5));
2567                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2568                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2569         }
2570         if (ndr_flags & NDR_BUFFERS) {
2571                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2572         }
2573         return NDR_ERR_SUCCESS;
2574 }
2575
2576 static enum ndr_err_code ndr_pull_samr_UserInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo11 *r)
2577 {
2578         if (ndr_flags & NDR_SCALARS) {
2579                 NDR_CHECK(ndr_pull_align(ndr, 5));
2580                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2581                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2582         }
2583         if (ndr_flags & NDR_BUFFERS) {
2584                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2585         }
2586         return NDR_ERR_SUCCESS;
2587 }
2588
2589 _PUBLIC_ void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r)
2590 {
2591         ndr_print_struct(ndr, name, "samr_UserInfo11");
2592         ndr->depth++;
2593         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2594         ndr->depth--;
2595 }
2596
2597 static enum ndr_err_code ndr_push_samr_UserInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo12 *r)
2598 {
2599         if (ndr_flags & NDR_SCALARS) {
2600                 NDR_CHECK(ndr_push_align(ndr, 5));
2601                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2602                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2603         }
2604         if (ndr_flags & NDR_BUFFERS) {
2605                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2606         }
2607         return NDR_ERR_SUCCESS;
2608 }
2609
2610 static enum ndr_err_code ndr_pull_samr_UserInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo12 *r)
2611 {
2612         if (ndr_flags & NDR_SCALARS) {
2613                 NDR_CHECK(ndr_pull_align(ndr, 5));
2614                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2615                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2616         }
2617         if (ndr_flags & NDR_BUFFERS) {
2618                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2619         }
2620         return NDR_ERR_SUCCESS;
2621 }
2622
2623 _PUBLIC_ void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r)
2624 {
2625         ndr_print_struct(ndr, name, "samr_UserInfo12");
2626         ndr->depth++;
2627         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2628         ndr->depth--;
2629 }
2630
2631 static enum ndr_err_code ndr_push_samr_UserInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo13 *r)
2632 {
2633         if (ndr_flags & NDR_SCALARS) {
2634                 NDR_CHECK(ndr_push_align(ndr, 5));
2635                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2636                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2637         }
2638         if (ndr_flags & NDR_BUFFERS) {
2639                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2640         }
2641         return NDR_ERR_SUCCESS;
2642 }
2643
2644 static enum ndr_err_code ndr_pull_samr_UserInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo13 *r)
2645 {
2646         if (ndr_flags & NDR_SCALARS) {
2647                 NDR_CHECK(ndr_pull_align(ndr, 5));
2648                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2649                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2650         }
2651         if (ndr_flags & NDR_BUFFERS) {
2652                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2653         }
2654         return NDR_ERR_SUCCESS;
2655 }
2656
2657 _PUBLIC_ void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r)
2658 {
2659         ndr_print_struct(ndr, name, "samr_UserInfo13");
2660         ndr->depth++;
2661         ndr_print_lsa_String(ndr, "description", &r->description);
2662         ndr->depth--;
2663 }
2664
2665 static enum ndr_err_code ndr_push_samr_UserInfo14(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo14 *r)
2666 {
2667         if (ndr_flags & NDR_SCALARS) {
2668                 NDR_CHECK(ndr_push_align(ndr, 5));
2669                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2670                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2671         }
2672         if (ndr_flags & NDR_BUFFERS) {
2673                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2674         }
2675         return NDR_ERR_SUCCESS;
2676 }
2677
2678 static enum ndr_err_code ndr_pull_samr_UserInfo14(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo14 *r)
2679 {
2680         if (ndr_flags & NDR_SCALARS) {
2681                 NDR_CHECK(ndr_pull_align(ndr, 5));
2682                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2683                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2684         }
2685         if (ndr_flags & NDR_BUFFERS) {
2686                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2687         }
2688         return NDR_ERR_SUCCESS;
2689 }
2690
2691 _PUBLIC_ void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r)
2692 {
2693         ndr_print_struct(ndr, name, "samr_UserInfo14");
2694         ndr->depth++;
2695         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2696         ndr->depth--;
2697 }
2698
2699 static enum ndr_err_code ndr_push_samr_UserInfo16(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo16 *r)
2700 {
2701         if (ndr_flags & NDR_SCALARS) {
2702                 NDR_CHECK(ndr_push_align(ndr, 4));
2703                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2704                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2705         }
2706         if (ndr_flags & NDR_BUFFERS) {
2707         }
2708         return NDR_ERR_SUCCESS;
2709 }
2710
2711 static enum ndr_err_code ndr_pull_samr_UserInfo16(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo16 *r)
2712 {
2713         if (ndr_flags & NDR_SCALARS) {
2714                 NDR_CHECK(ndr_pull_align(ndr, 4));
2715                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2716                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2717         }
2718         if (ndr_flags & NDR_BUFFERS) {
2719         }
2720         return NDR_ERR_SUCCESS;
2721 }
2722
2723 _PUBLIC_ void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r)
2724 {
2725         ndr_print_struct(ndr, name, "samr_UserInfo16");
2726         ndr->depth++;
2727         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2728         ndr->depth--;
2729 }
2730
2731 static enum ndr_err_code ndr_push_samr_UserInfo17(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo17 *r)
2732 {
2733         if (ndr_flags & NDR_SCALARS) {
2734                 NDR_CHECK(ndr_push_align(ndr, 4));
2735                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2736                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2737         }
2738         if (ndr_flags & NDR_BUFFERS) {
2739         }
2740         return NDR_ERR_SUCCESS;
2741 }
2742
2743 static enum ndr_err_code ndr_pull_samr_UserInfo17(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo17 *r)
2744 {
2745         if (ndr_flags & NDR_SCALARS) {
2746                 NDR_CHECK(ndr_pull_align(ndr, 4));
2747                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2748                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2749         }
2750         if (ndr_flags & NDR_BUFFERS) {
2751         }
2752         return NDR_ERR_SUCCESS;
2753 }
2754
2755 _PUBLIC_ void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r)
2756 {
2757         ndr_print_struct(ndr, name, "samr_UserInfo17");
2758         ndr->depth++;
2759         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2760         ndr->depth--;
2761 }
2762
2763 _PUBLIC_ enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r)
2764 {
2765         {
2766                 uint32_t _flags_save_STRUCT = ndr->flags;
2767                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2768                 if (ndr_flags & NDR_SCALARS) {
2769                         NDR_CHECK(ndr_push_align(ndr, 1));
2770                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
2771                         NDR_CHECK(ndr_push_trailer_align(ndr, 1));
2772                 }
2773                 if (ndr_flags & NDR_BUFFERS) {
2774                 }
2775                 ndr->flags = _flags_save_STRUCT;
2776         }
2777         return NDR_ERR_SUCCESS;
2778 }
2779
2780 _PUBLIC_ enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r)
2781 {
2782         {
2783                 uint32_t _flags_save_STRUCT = ndr->flags;
2784                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2785                 if (ndr_flags & NDR_SCALARS) {
2786                         NDR_CHECK(ndr_pull_align(ndr, 1));
2787                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
2788                         NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
2789                 }
2790                 if (ndr_flags & NDR_BUFFERS) {
2791                 }
2792                 ndr->flags = _flags_save_STRUCT;
2793         }
2794         return NDR_ERR_SUCCESS;
2795 }
2796
2797 _PUBLIC_ void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r)
2798 {
2799         ndr_print_struct(ndr, name, "samr_Password");
2800         {
2801                 uint32_t _flags_save_STRUCT = ndr->flags;
2802                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2803                 ndr->depth++;
2804                 ndr_print_array_uint8(ndr, "hash", r->hash, 16);
2805                 ndr->depth--;
2806                 ndr->flags = _flags_save_STRUCT;
2807         }
2808 }
2809
2810 static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo18 *r)
2811 {
2812         if (ndr_flags & NDR_SCALARS) {
2813                 NDR_CHECK(ndr_push_align(ndr, 1));
2814                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
2815                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
2816                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active));
2817                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
2818                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2819                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
2820         }
2821         if (ndr_flags & NDR_BUFFERS) {
2822         }
2823         return NDR_ERR_SUCCESS;
2824 }
2825
2826 static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo18 *r)
2827 {
2828         if (ndr_flags & NDR_SCALARS) {
2829                 NDR_CHECK(ndr_pull_align(ndr, 1));
2830                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
2831                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
2832                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active));
2833                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
2834                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2835                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
2836         }
2837         if (ndr_flags & NDR_BUFFERS) {
2838         }
2839         return NDR_ERR_SUCCESS;
2840 }
2841
2842 _PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r)
2843 {
2844         ndr_print_struct(ndr, name, "samr_UserInfo18");
2845         ndr->depth++;
2846         ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd);
2847         ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
2848         ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active);
2849         ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
2850         ndr_print_uint8(ndr, "password_expired", r->password_expired);
2851         ndr->depth--;
2852 }
2853
2854 static enum ndr_err_code ndr_push_samr_UserInfo20(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo20 *r)
2855 {
2856         if (ndr_flags & NDR_SCALARS) {
2857                 NDR_CHECK(ndr_push_align(ndr, 5));
2858                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2859                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2860         }
2861         if (ndr_flags & NDR_BUFFERS) {
2862                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2863         }
2864         return NDR_ERR_SUCCESS;
2865 }
2866
2867 static enum ndr_err_code ndr_pull_samr_UserInfo20(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo20 *r)
2868 {
2869         if (ndr_flags & NDR_SCALARS) {
2870                 NDR_CHECK(ndr_pull_align(ndr, 5));
2871                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2872                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
2873         }
2874         if (ndr_flags & NDR_BUFFERS) {
2875                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2876         }
2877         return NDR_ERR_SUCCESS;
2878 }
2879
2880 _PUBLIC_ void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r)
2881 {
2882         ndr_print_struct(ndr, name, "samr_UserInfo20");
2883         ndr->depth++;
2884         ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2885         ndr->depth--;
2886 }
2887
2888 static enum ndr_err_code ndr_push_samr_FieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2889 {
2890         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2891         return NDR_ERR_SUCCESS;
2892 }
2893
2894 static enum ndr_err_code ndr_pull_samr_FieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2895 {
2896         uint32_t v;
2897         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2898         *r = v;
2899         return NDR_ERR_SUCCESS;
2900 }
2901
2902 _PUBLIC_ void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r)
2903 {
2904         ndr_print_uint32(ndr, name, r);
2905         ndr->depth++;
2906         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCOUNT_NAME", SAMR_FIELD_ACCOUNT_NAME, r);
2907         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FULL_NAME", SAMR_FIELD_FULL_NAME, r);
2908         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_RID", SAMR_FIELD_RID, r);
2909         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIMARY_GID", SAMR_FIELD_PRIMARY_GID, r);
2910         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_DESCRIPTION", SAMR_FIELD_DESCRIPTION, r);
2911         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COMMENT", SAMR_FIELD_COMMENT, r);
2912         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DIRECTORY", SAMR_FIELD_HOME_DIRECTORY, r);
2913         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DRIVE", SAMR_FIELD_HOME_DRIVE, r);
2914         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_SCRIPT", SAMR_FIELD_LOGON_SCRIPT, r);
2915         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PROFILE_PATH", SAMR_FIELD_PROFILE_PATH, r);
2916         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_WORKSTATIONS", SAMR_FIELD_WORKSTATIONS, r);
2917         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGON", SAMR_FIELD_LAST_LOGON, r);
2918         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGOFF", SAMR_FIELD_LAST_LOGOFF, r);
2919         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_HOURS", SAMR_FIELD_LOGON_HOURS, r);
2920         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_BAD_PWD_COUNT", SAMR_FIELD_BAD_PWD_COUNT, r);
2921         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NUM_LOGONS", SAMR_FIELD_NUM_LOGONS, r);
2922         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ALLOW_PWD_CHANGE", SAMR_FIELD_ALLOW_PWD_CHANGE, r);
2923         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FORCE_PWD_CHANGE", SAMR_FIELD_FORCE_PWD_CHANGE, r);
2924         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_PWD_CHANGE", SAMR_FIELD_LAST_PWD_CHANGE, r);
2925         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_EXPIRY", SAMR_FIELD_ACCT_EXPIRY, r);
2926         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_FLAGS", SAMR_FIELD_ACCT_FLAGS, r);
2927         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", SAMR_FIELD_PARAMETERS, r);
2928         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", SAMR_FIELD_COUNTRY_CODE, r);
2929         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", SAMR_FIELD_CODE_PAGE, r);
2930         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NT_PASSWORD_PRESENT", SAMR_FIELD_NT_PASSWORD_PRESENT, r);
2931         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LM_PASSWORD_PRESENT", SAMR_FIELD_LM_PASSWORD_PRESENT, r);
2932         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", SAMR_FIELD_PRIVATE_DATA, r);
2933         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", SAMR_FIELD_EXPIRED_FLAG, r);
2934         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", SAMR_FIELD_SEC_DESC, r);
2935         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_OWF_PWD", SAMR_FIELD_OWF_PWD, r);
2936         ndr->depth--;
2937 }
2938
2939 static enum ndr_err_code ndr_push_samr_UserInfo21(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo21 *r)
2940 {
2941         if (ndr_flags & NDR_SCALARS) {
2942                 NDR_CHECK(ndr_push_align(ndr, 5));
2943                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2944                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2945                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2946                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2947                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
2948                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
2949                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2950                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2951                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2952                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2953                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2954                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2955                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2956                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2957                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2958                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2959                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password));
2960                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password));
2961                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2962                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count));
2963                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
2964                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2965                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2966                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2967                 NDR_CHECK(ndr_push_samr_FieldsPresent(ndr, NDR_SCALARS, r->fields_present));
2968                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2969                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2970                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2971                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2972                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2973                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set));
2974                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set));
2975                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2976                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4));
2977                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
2978         }
2979         if (ndr_flags & NDR_BUFFERS) {
2980                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2981                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2982                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2983                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2984                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2985                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2986                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2987                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2988                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2989                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2990                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password));
2991                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password));
2992                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2993                 if (r->buffer) {
2994                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->buf_count));
2995                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->buf_count));
2996                 }
2997                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2998         }
2999         return NDR_ERR_SUCCESS;
3000 }
3001
3002 static enum ndr_err_code ndr_pull_samr_UserInfo21(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo21 *r)
3003 {
3004         uint32_t _ptr_buffer;
3005         TALLOC_CTX *_mem_save_buffer_0;
3006         if (ndr_flags & NDR_SCALARS) {
3007                 NDR_CHECK(ndr_pull_align(ndr, 5));
3008                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
3009                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
3010                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
3011                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
3012                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
3013                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
3014                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
3015                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
3016                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
3017                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
3018                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
3019                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
3020                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
3021                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
3022                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
3023                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
3024                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password));
3025                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password));
3026                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3027                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count));
3028                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
3029                 if (_ptr_buffer) {
3030                         NDR_PULL_ALLOC(ndr, r->buffer);
3031                 } else {
3032                         r->buffer = NULL;
3033                 }
3034                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
3035                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
3036                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
3037                 NDR_CHECK(ndr_pull_samr_FieldsPresent(ndr, NDR_SCALARS, &r->fields_present));
3038                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
3039                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
3040                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
3041                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
3042                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
3043                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_set));
3044                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_set));
3045                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
3046                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4));
3047                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3048         }
3049         if (ndr_flags & NDR_BUFFERS) {
3050                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
3051                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
3052                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
3053                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
3054                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
3055                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
3056                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
3057                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
3058                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
3059                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
3060                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password));
3061                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password));
3062                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3063                 if (r->buffer) {
3064                         _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
3065                         NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0);
3066                         NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer));
3067                         NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer));
3068                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer)));
3069                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
3070                 }
3071                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
3072                 if (r->buffer) {
3073                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->buf_count));
3074                 }
3075         }
3076         return NDR_ERR_SUCCESS;
3077 }
3078
3079 _PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r)
3080 {
3081         ndr_print_struct(ndr, name, "samr_UserInfo21");
3082         ndr->depth++;
3083         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
3084         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
3085         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
3086         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
3087         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
3088         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
3089         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
3090         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
3091         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
3092         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
3093         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
3094         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
3095         ndr_print_lsa_String(ndr, "description", &r->description);
3096         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
3097         ndr_print_lsa_String(ndr, "comment", &r->comment);
3098         ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
3099         ndr_print_lsa_BinaryString(ndr, "lm_owf_password", &r->lm_owf_password);
3100         ndr_print_lsa_BinaryString(ndr, "nt_owf_password", &r->nt_owf_password);
3101         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3102         ndr_print_uint32(ndr, "buf_count", r->buf_count);
3103         ndr_print_ptr(ndr, "buffer", r->buffer);
3104         ndr->depth++;
3105         if (r->buffer) {
3106                 ndr_print_array_uint8(ndr, "buffer", r->buffer, r->buf_count);
3107         }
3108         ndr->depth--;
3109         ndr_print_uint32(ndr, "rid", r->rid);
3110         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
3111         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
3112         ndr_print_samr_FieldsPresent(ndr, "fields_present", r->fields_present);
3113         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
3114         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
3115         ndr_print_uint16(ndr, "logon_count", r->logon_count);
3116         ndr_print_uint16(ndr, "country_code", r->country_code);
3117         ndr_print_uint16(ndr, "code_page", r->code_page);
3118         ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set);
3119         ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set);
3120         ndr_print_uint8(ndr, "password_expired", r->password_expired);
3121         ndr_print_uint8(ndr, "unknown4", r->unknown4);
3122         ndr->depth--;
3123 }
3124
3125 _PUBLIC_ enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r)
3126 {
3127         {
3128                 uint32_t _flags_save_STRUCT = ndr->flags;
3129                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3130                 if (ndr_flags & NDR_SCALARS) {
3131                         NDR_CHECK(ndr_push_align(ndr, 1));
3132                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 516));
3133                         NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3134                 }
3135                 if (ndr_flags & NDR_BUFFERS) {
3136                 }
3137                 ndr->flags = _flags_save_STRUCT;
3138         }
3139         return NDR_ERR_SUCCESS;
3140 }
3141
3142 _PUBLIC_ enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r)
3143 {
3144         {
3145                 uint32_t _flags_save_STRUCT = ndr->flags;
3146                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3147                 if (ndr_flags & NDR_SCALARS) {
3148                         NDR_CHECK(ndr_pull_align(ndr, 1));
3149                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 516));
3150                         NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3151                 }
3152                 if (ndr_flags & NDR_BUFFERS) {
3153                 }
3154                 ndr->flags = _flags_save_STRUCT;
3155         }
3156         return NDR_ERR_SUCCESS;
3157 }
3158
3159 _PUBLIC_ void ndr_print_samr_CryptPassword(struct ndr_print *ndr, const char *name, const struct samr_CryptPassword *r)
3160 {
3161         ndr_print_struct(ndr, name, "samr_CryptPassword");
3162         {
3163                 uint32_t _flags_save_STRUCT = ndr->flags;
3164                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3165                 ndr->depth++;
3166                 ndr_print_array_uint8(ndr, "data", r->data, 516);
3167                 ndr->depth--;
3168                 ndr->flags = _flags_save_STRUCT;
3169         }
3170 }
3171
3172 static enum ndr_err_code ndr_push_samr_UserInfo23(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo23 *r)
3173 {
3174         if (ndr_flags & NDR_SCALARS) {
3175                 NDR_CHECK(ndr_push_align(ndr, 5));
3176                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info));
3177                 NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
3178                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3179         }
3180         if (ndr_flags & NDR_BUFFERS) {
3181                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info));
3182         }
3183         return NDR_ERR_SUCCESS;
3184 }
3185
3186 static enum ndr_err_code ndr_pull_samr_UserInfo23(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo23 *r)
3187 {
3188         if (ndr_flags & NDR_SCALARS) {
3189                 NDR_CHECK(ndr_pull_align(ndr, 5));
3190                 NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info));
3191                 NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
3192                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3193         }
3194         if (ndr_flags & NDR_BUFFERS) {
3195                 NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info));
3196         }
3197         return NDR_ERR_SUCCESS;
3198 }
3199
3200 _PUBLIC_ void ndr_print_samr_UserInfo23(struct ndr_print *ndr, const char *name, const struct samr_UserInfo23 *r)
3201 {
3202         ndr_print_struct(ndr, name, "samr_UserInfo23");
3203         ndr->depth++;
3204         ndr_print_samr_UserInfo21(ndr, "info", &r->info);
3205         ndr_print_samr_CryptPassword(ndr, "password", &r->password);
3206         ndr->depth--;
3207 }
3208
3209 static enum ndr_err_code ndr_push_samr_UserInfo24(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo24 *r)
3210 {
3211         if (ndr_flags & NDR_SCALARS) {
3212                 NDR_CHECK(ndr_push_align(ndr, 1));
3213                 NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
3214                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
3215                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3216         }
3217         if (ndr_flags & NDR_BUFFERS) {
3218         }
3219         return NDR_ERR_SUCCESS;
3220 }
3221
3222 static enum ndr_err_code ndr_pull_samr_UserInfo24(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo24 *r)
3223 {
3224         if (ndr_flags & NDR_SCALARS) {
3225                 NDR_CHECK(ndr_pull_align(ndr, 1));
3226                 NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
3227                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
3228                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3229         }
3230         if (ndr_flags & NDR_BUFFERS) {
3231         }
3232         return NDR_ERR_SUCCESS;
3233 }
3234
3235 _PUBLIC_ void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name, const struct samr_UserInfo24 *r)
3236 {
3237         ndr_print_struct(ndr, name, "samr_UserInfo24");
3238         ndr->depth++;
3239         ndr_print_samr_CryptPassword(ndr, "password", &r->password);
3240         ndr_print_uint8(ndr, "password_expired", r->password_expired);
3241         ndr->depth--;
3242 }
3243
3244 static enum ndr_err_code ndr_push_samr_CryptPasswordEx(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPasswordEx *r)
3245 {
3246         {
3247                 uint32_t _flags_save_STRUCT = ndr->flags;
3248                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3249                 if (ndr_flags & NDR_SCALARS) {
3250                         NDR_CHECK(ndr_push_align(ndr, 1));
3251                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 532));
3252                         NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3253                 }
3254                 if (ndr_flags & NDR_BUFFERS) {
3255                 }
3256                 ndr->flags = _flags_save_STRUCT;
3257         }
3258         return NDR_ERR_SUCCESS;
3259 }
3260
3261 static enum ndr_err_code ndr_pull_samr_CryptPasswordEx(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPasswordEx *r)
3262 {
3263         {
3264                 uint32_t _flags_save_STRUCT = ndr->flags;
3265                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3266                 if (ndr_flags & NDR_SCALARS) {
3267                         NDR_CHECK(ndr_pull_align(ndr, 1));
3268                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 532));
3269                         NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3270                 }
3271                 if (ndr_flags & NDR_BUFFERS) {
3272                 }
3273                 ndr->flags = _flags_save_STRUCT;
3274         }
3275         return NDR_ERR_SUCCESS;
3276 }
3277
3278 _PUBLIC_ void ndr_print_samr_CryptPasswordEx(struct ndr_print *ndr, const char *name, const struct samr_CryptPasswordEx *r)
3279 {
3280         ndr_print_struct(ndr, name, "samr_CryptPasswordEx");
3281         {
3282                 uint32_t _flags_save_STRUCT = ndr->flags;
3283                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
3284                 ndr->depth++;
3285                 ndr_print_array_uint8(ndr, "data", r->data, 532);
3286                 ndr->depth--;
3287                 ndr->flags = _flags_save_STRUCT;
3288         }
3289 }
3290
3291 static enum ndr_err_code ndr_push_samr_UserInfo25(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo25 *r)
3292 {
3293         if (ndr_flags & NDR_SCALARS) {
3294                 NDR_CHECK(ndr_push_align(ndr, 5));
3295                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info));
3296                 NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
3297                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
3298         }
3299         if (ndr_flags & NDR_BUFFERS) {
3300                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info));
3301         }
3302         return NDR_ERR_SUCCESS;
3303 }
3304
3305 static enum ndr_err_code ndr_pull_samr_UserInfo25(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo25 *r)
3306 {
3307         if (ndr_flags & NDR_SCALARS) {
3308                 NDR_CHECK(ndr_pull_align(ndr, 5));
3309                 NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_SCALARS, &r->info));
3310                 NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
3311                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
3312         }
3313         if (ndr_flags & NDR_BUFFERS) {
3314                 NDR_CHECK(ndr_pull_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info));
3315         }
3316         return NDR_ERR_SUCCESS;
3317 }
3318
3319 _PUBLIC_ void ndr_print_samr_UserInfo25(struct ndr_print *ndr, const char *name, const struct samr_UserInfo25 *r)
3320 {
3321         ndr_print_struct(ndr, name, "samr_UserInfo25");
3322         ndr->depth++;
3323         ndr_print_samr_UserInfo21(ndr, "info", &r->info);
3324         ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password);
3325         ndr->depth--;
3326 }
3327
3328 static enum ndr_err_code ndr_push_samr_UserInfo26(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo26 *r)
3329 {
3330         if (ndr_flags & NDR_SCALARS) {
3331                 NDR_CHECK(ndr_push_align(ndr, 1));
3332                 NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
3333                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
3334                 NDR_CHECK(ndr_push_trailer_align(ndr, 1));
3335         }
3336         if (ndr_flags & NDR_BUFFERS) {
3337         }
3338         return NDR_ERR_SUCCESS;
3339 }
3340
3341 static enum ndr_err_code ndr_pull_samr_UserInfo26(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo26 *r)
3342 {
3343         if (ndr_flags & NDR_SCALARS) {
3344                 NDR_CHECK(ndr_pull_align(ndr, 1));
3345                 NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
3346                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
3347                 NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
3348         }
3349         if (ndr_flags & NDR_BUFFERS) {
3350         }
3351         return NDR_ERR_SUCCESS;
3352 }
3353
3354 _PUBLIC_ void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name, const struct samr_UserInfo26 *r)
3355 {
3356         ndr_print_struct(ndr, name, "samr_UserInfo26");
3357         ndr->depth++;
3358         ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password);
3359         ndr_print_uint8(ndr, "password_expired", r->password_expired);
3360         ndr->depth--;
3361 }
3362
3363 static enum ndr_err_code ndr_push_samr_UserInfo(struct ndr_push *ndr, int ndr_flags, const union samr_UserInfo *r)
3364 {
3365         if (ndr_flags & NDR_SCALARS) {
3366                 int level = ndr_push_get_switch_value(ndr, r);
3367                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
3368                 NDR_CHECK(ndr_push_union_align(ndr, 5));
3369                 switch (level) {
3370                         case 1: {
3371                                 NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1));
3372                         break; }
3373
3374                         case 2: {
3375                                 NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2));
3376                         break; }
3377
3378                         case 3: {
3379                                 NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3));
3380                         break; }
3381
3382                         case 4: {
3383                                 NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4));
3384                         break; }
3385
3386                         case 5: {
3387                                 NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5));
3388                         break; }
3389
3390                         case 6: {
3391                                 NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_SCALARS, &r->info6));
3392                         break; }
3393
3394                         case 7: {
3395                                 NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_SCALARS, &r->info7));
3396                         break; }
3397
3398                         case 8: {
3399                                 NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_SCALARS, &r->info8));
3400                         break; }
3401
3402                         case 9: {
3403                                 NDR_CHECK(ndr_push_samr_UserInfo9(ndr, NDR_SCALARS, &r->info9));
3404                         break; }
3405
3406                         case 10: {
3407                                 NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_SCALARS, &r->info10));
3408                         break; }
3409
3410                         case 11: {
3411                                 NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_SCALARS, &r->info11));
3412                         break; }
3413
3414                         case 12: {
3415                                 NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_SCALARS, &r->info12));
3416                         break; }
3417
3418                         case 13: {
3419                                 NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_SCALARS, &r->info13));
3420                         break; }
3421
3422                         case 14: {
3423                                 NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_SCALARS, &r->info14));
3424                         break; }
3425
3426                         case 16: {
3427                                 NDR_CHECK(ndr_push_samr_UserInfo16(ndr, NDR_SCALARS, &r->info16));
3428                         break; }
3429
3430                         case 17: {
3431                                 NDR_CHECK(ndr_push_samr_UserInfo17(ndr, NDR_SCALARS, &r->info17));
3432                         break; }
3433
3434                         case 18: {
3435                                 NDR_CHECK(ndr_push_samr_UserInfo18(ndr, NDR_SCALARS, &r->info18));
3436                         break; }
3437
3438                         case 20: {
3439                                 NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_SCALARS, &r->info20));
3440                         break; }
3441
3442                         case 21: {
3443                                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_SCALARS, &r->info21));
3444                         break; }
3445
3446                         case 23: {
3447                                 NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_SCALARS, &r->info23));
3448                         break; }
3449
3450                         case 24: {
3451                                 NDR_CHECK(ndr_push_samr_UserInfo24(ndr, NDR_SCALARS, &r->info24));
3452                         break; }
3453
3454                         case 25: {
3455                                 NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_SCALARS, &r->info25));
3456                         break; }
3457
3458                         case 26: {
3459                                 NDR_CHECK(ndr_push_samr_UserInfo26(ndr, NDR_SCALARS, &r->info26));
3460                         break; }
3461
3462                         default:
3463                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3464                 }
3465         }
3466         if (ndr_flags & NDR_BUFFERS) {
3467                 int level = ndr_push_get_switch_value(ndr, r);
3468                 switch (level) {
3469                         case 1:
3470                                 NDR_CHECK(ndr_push_samr_UserInfo1(ndr, NDR_BUFFERS, &r->info1));
3471                         break;
3472
3473                         case 2:
3474                                 NDR_CHECK(ndr_push_samr_UserInfo2(ndr, NDR_BUFFERS, &r->info2));
3475                         break;
3476
3477                         case 3:
3478                                 NDR_CHECK(ndr_push_samr_UserInfo3(ndr, NDR_BUFFERS, &r->info3));
3479                         break;
3480
3481                         case 4:
3482                                 NDR_CHECK(ndr_push_samr_UserInfo4(ndr, NDR_BUFFERS, &r->info4));
3483                         break;
3484
3485                         case 5:
3486                                 NDR_CHECK(ndr_push_samr_UserInfo5(ndr, NDR_BUFFERS, &r->info5));
3487                         break;
3488
3489                         case 6:
3490                                 NDR_CHECK(ndr_push_samr_UserInfo6(ndr, NDR_BUFFERS, &r->info6));
3491                         break;
3492
3493                         case 7:
3494                                 NDR_CHECK(ndr_push_samr_UserInfo7(ndr, NDR_BUFFERS, &r->info7));
3495                         break;
3496
3497                         case 8:
3498                                 NDR_CHECK(ndr_push_samr_UserInfo8(ndr, NDR_BUFFERS, &r->info8));
3499                         break;
3500
3501                         case 9:
3502                         break;
3503
3504                         case 10:
3505                                 NDR_CHECK(ndr_push_samr_UserInfo10(ndr, NDR_BUFFERS, &r->info10));
3506                         break;
3507
3508                         case 11:
3509                                 NDR_CHECK(ndr_push_samr_UserInfo11(ndr, NDR_BUFFERS, &r->info11));
3510                         break;
3511
3512                         case 12:
3513                                 NDR_CHECK(ndr_push_samr_UserInfo12(ndr, NDR_BUFFERS, &r->info12));
3514                         break;
3515
3516                         case 13:
3517                                 NDR_CHECK(ndr_push_samr_UserInfo13(ndr, NDR_BUFFERS, &r->info13));
3518                         break;
3519
3520                         case 14:
3521                                 NDR_CHECK(ndr_push_samr_UserInfo14(ndr, NDR_BUFFERS, &r->info14));
3522                         break;
3523
3524                         case 16:
3525                         break;
3526
3527                         case 17:
3528                         break;
3529
3530                         case 18:
3531                         break;
3532
3533                         case 20:
3534                                 NDR_CHECK(ndr_push_samr_UserInfo20(ndr, NDR_BUFFERS, &r->info20));
3535                         break;
3536
3537                         case 21:
3538                                 NDR_CHECK(ndr_push_samr_UserInfo21(ndr, NDR_BUFFERS, &r->info21));
3539                         break;
3540
3541                         case 23:
3542                                 NDR_CHECK(ndr_push_samr_UserInfo23(ndr, NDR_BUFFERS, &r->info23));
3543                         break;
3544
3545                         case 24:
3546                         break;
3547
3548                         case 25:
3549                                 NDR_CHECK(ndr_push_samr_UserInfo25(ndr, NDR_BUFFERS, &r->info25));
3550                         break;
3551
3552                         case 26:
3553                         break;
3554
3555                         default:
3556                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
3557                 }
3558         }
3559         return NDR_ERR_SUCCESS;
3560 }
3561
3562 static enum ndr_err_code ndr_pull_samr_UserInfo(struct ndr_pull *ndr, int ndr_flags, union samr_UserInfo *r)
3563 {
3564         int level;
3565         uint16_t _level;
3566         level = ndr_pull_get_switch_value(ndr, r);
3567         if (ndr_flags & NDR_SCALARS) {
3568                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
3569                 if (_level != level) {
3570                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
3571                 }
3572                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
3573                 switch (level) {
3574                         case 1: {
3575                                 NDR_CHECK(ndr_pull_samr_UserInfo1(ndr, NDR_SCALARS, &r->info1));
3576                         break; }
3577
3578                         case 2: {
3579                                 NDR_CHECK(ndr_pull_samr_UserInfo2(ndr, NDR_SCALARS, &r->info2));
3580                         break; }
3581
3582                         case 3: {
3583                                 NDR_CHECK(ndr_pull_samr_UserInfo3(ndr, NDR_SCALARS, &r->info3));
3584                         break; }
3585
3586                         case 4: {
3587                                 NDR_CHECK(ndr_pull_samr_UserInfo4(ndr, NDR_SCALARS, &r->info4));
3588                         break; }
3589
3590                         case 5: {
3591                                 NDR_CHECK(ndr_pull_samr_UserInfo5(ndr, NDR_SCALARS, &r->info5));
3592                         break; }
3593
3594                         case 6: {
3595                           &n