Add new script for building IDL files in librpc/idl, generating both
[sfrench/samba-autobuild/.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_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_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_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_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_OPEN_DOMAIN", SAMR_ACCESS_OPEN_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, 4));
249                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->idx));
250                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
251         }
252         if (ndr_flags & NDR_BUFFERS) {
253                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
254         }
255         return NDR_ERR_SUCCESS;
256 }
257
258 static enum ndr_err_code ndr_pull_samr_SamEntry(struct ndr_pull *ndr, int ndr_flags, struct samr_SamEntry *r)
259 {
260         if (ndr_flags & NDR_SCALARS) {
261                 NDR_CHECK(ndr_pull_align(ndr, 4));
262                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->idx));
263                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
264         }
265         if (ndr_flags & NDR_BUFFERS) {
266                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
267         }
268         return NDR_ERR_SUCCESS;
269 }
270
271 _PUBLIC_ void ndr_print_samr_SamEntry(struct ndr_print *ndr, const char *name, const struct samr_SamEntry *r)
272 {
273         ndr_print_struct(ndr, name, "samr_SamEntry");
274         ndr->depth++;
275         ndr_print_uint32(ndr, "idx", r->idx);
276         ndr_print_lsa_String(ndr, "name", &r->name);
277         ndr->depth--;
278 }
279
280 static enum ndr_err_code ndr_push_samr_SamArray(struct ndr_push *ndr, int ndr_flags, const struct samr_SamArray *r)
281 {
282         uint32_t cntr_entries_1;
283         if (ndr_flags & NDR_SCALARS) {
284                 NDR_CHECK(ndr_push_align(ndr, 4));
285                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
286                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->entries));
287         }
288         if (ndr_flags & NDR_BUFFERS) {
289                 if (r->entries) {
290                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
291                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
292                                 NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
293                         }
294                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
295                                 NDR_CHECK(ndr_push_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
296                         }
297                 }
298         }
299         return NDR_ERR_SUCCESS;
300 }
301
302 static enum ndr_err_code ndr_pull_samr_SamArray(struct ndr_pull *ndr, int ndr_flags, struct samr_SamArray *r)
303 {
304         uint32_t _ptr_entries;
305         uint32_t cntr_entries_1;
306         TALLOC_CTX *_mem_save_entries_0;
307         TALLOC_CTX *_mem_save_entries_1;
308         if (ndr_flags & NDR_SCALARS) {
309                 NDR_CHECK(ndr_pull_align(ndr, 4));
310                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
311                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_entries));
312                 if (_ptr_entries) {
313                         NDR_PULL_ALLOC(ndr, r->entries);
314                 } else {
315                         r->entries = NULL;
316                 }
317         }
318         if (ndr_flags & NDR_BUFFERS) {
319                 if (r->entries) {
320                         _mem_save_entries_0 = NDR_PULL_GET_MEM_CTX(ndr);
321                         NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
322                         NDR_CHECK(ndr_pull_array_size(ndr, &r->entries));
323                         NDR_PULL_ALLOC_N(ndr, r->entries, ndr_get_array_size(ndr, &r->entries));
324                         _mem_save_entries_1 = NDR_PULL_GET_MEM_CTX(ndr);
325                         NDR_PULL_SET_MEM_CTX(ndr, r->entries, 0);
326                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
327                                 NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_SCALARS, &r->entries[cntr_entries_1]));
328                         }
329                         for (cntr_entries_1 = 0; cntr_entries_1 < r->count; cntr_entries_1++) {
330                                 NDR_CHECK(ndr_pull_samr_SamEntry(ndr, NDR_BUFFERS, &r->entries[cntr_entries_1]));
331                         }
332                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_1, 0);
333                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_entries_0, 0);
334                 }
335                 if (r->entries) {
336                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->entries, r->count));
337                 }
338         }
339         return NDR_ERR_SUCCESS;
340 }
341
342 _PUBLIC_ void ndr_print_samr_SamArray(struct ndr_print *ndr, const char *name, const struct samr_SamArray *r)
343 {
344         uint32_t cntr_entries_1;
345         ndr_print_struct(ndr, name, "samr_SamArray");
346         ndr->depth++;
347         ndr_print_uint32(ndr, "count", r->count);
348         ndr_print_ptr(ndr, "entries", r->entries);
349         ndr->depth++;
350         if (r->entries) {
351                 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->count);
352                 ndr->depth++;
353                 for (cntr_entries_1=0;cntr_entries_1<r->count;cntr_entries_1++) {
354                         char *idx_1=NULL;
355                         if (asprintf(&idx_1, "[%d]", cntr_entries_1) != -1) {
356                                 ndr_print_samr_SamEntry(ndr, "entries", &r->entries[cntr_entries_1]);
357                                 free(idx_1);
358                         }
359                 }
360                 ndr->depth--;
361         }
362         ndr->depth--;
363         ndr->depth--;
364 }
365
366 static enum ndr_err_code ndr_push_samr_Role(struct ndr_push *ndr, int ndr_flags, enum samr_Role r)
367 {
368         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
369         return NDR_ERR_SUCCESS;
370 }
371
372 static enum ndr_err_code ndr_pull_samr_Role(struct ndr_pull *ndr, int ndr_flags, enum samr_Role *r)
373 {
374         uint32_t v;
375         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
376         *r = v;
377         return NDR_ERR_SUCCESS;
378 }
379
380 _PUBLIC_ void ndr_print_samr_Role(struct ndr_print *ndr, const char *name, enum samr_Role r)
381 {
382         const char *val = NULL;
383
384         switch (r) {
385                 case SAMR_ROLE_STANDALONE: val = "SAMR_ROLE_STANDALONE"; break;
386                 case SAMR_ROLE_DOMAIN_MEMBER: val = "SAMR_ROLE_DOMAIN_MEMBER"; break;
387                 case SAMR_ROLE_DOMAIN_BDC: val = "SAMR_ROLE_DOMAIN_BDC"; break;
388                 case SAMR_ROLE_DOMAIN_PDC: val = "SAMR_ROLE_DOMAIN_PDC"; break;
389         }
390         ndr_print_enum(ndr, name, "ENUM", val, r);
391 }
392
393 _PUBLIC_ enum ndr_err_code ndr_push_samr_PasswordProperties(struct ndr_push *ndr, int ndr_flags, uint32_t r)
394 {
395         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
396         return NDR_ERR_SUCCESS;
397 }
398
399 _PUBLIC_ enum ndr_err_code ndr_pull_samr_PasswordProperties(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
400 {
401         uint32_t v;
402         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
403         *r = v;
404         return NDR_ERR_SUCCESS;
405 }
406
407 _PUBLIC_ void ndr_print_samr_PasswordProperties(struct ndr_print *ndr, const char *name, uint32_t r)
408 {
409         ndr_print_uint32(ndr, name, r);
410         ndr->depth++;
411         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_COMPLEX", DOMAIN_PASSWORD_COMPLEX, r);
412         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_ANON_CHANGE", DOMAIN_PASSWORD_NO_ANON_CHANGE, r);
413         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_NO_CLEAR_CHANGE", DOMAIN_PASSWORD_NO_CLEAR_CHANGE, r);
414         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_LOCKOUT_ADMINS", DOMAIN_PASSWORD_LOCKOUT_ADMINS, r);
415         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_PASSWORD_STORE_CLEARTEXT", DOMAIN_PASSWORD_STORE_CLEARTEXT, r);
416         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DOMAIN_REFUSE_PASSWORD_CHANGE", DOMAIN_REFUSE_PASSWORD_CHANGE, r);
417         ndr->depth--;
418 }
419
420 static enum ndr_err_code ndr_push_samr_DomainServerState(struct ndr_push *ndr, int ndr_flags, enum samr_DomainServerState r)
421 {
422         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
423         return NDR_ERR_SUCCESS;
424 }
425
426 static enum ndr_err_code ndr_pull_samr_DomainServerState(struct ndr_pull *ndr, int ndr_flags, enum samr_DomainServerState *r)
427 {
428         uint32_t v;
429         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
430         *r = v;
431         return NDR_ERR_SUCCESS;
432 }
433
434 _PUBLIC_ void ndr_print_samr_DomainServerState(struct ndr_print *ndr, const char *name, enum samr_DomainServerState r)
435 {
436         const char *val = NULL;
437
438         switch (r) {
439                 case DOMAIN_SERVER_ENABLED: val = "DOMAIN_SERVER_ENABLED"; break;
440                 case DOMAIN_SERVER_DISABLED: val = "DOMAIN_SERVER_DISABLED"; break;
441         }
442         ndr_print_enum(ndr, name, "ENUM", val, r);
443 }
444
445 static enum ndr_err_code ndr_push_samr_DomInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo1 *r)
446 {
447         if (ndr_flags & NDR_SCALARS) {
448                 NDR_CHECK(ndr_push_align(ndr, 4));
449                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
450                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
451                 NDR_CHECK(ndr_push_samr_PasswordProperties(ndr, NDR_SCALARS, r->password_properties));
452                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
453                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
454         }
455         if (ndr_flags & NDR_BUFFERS) {
456         }
457         return NDR_ERR_SUCCESS;
458 }
459
460 static enum ndr_err_code ndr_pull_samr_DomInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo1 *r)
461 {
462         if (ndr_flags & NDR_SCALARS) {
463                 NDR_CHECK(ndr_pull_align(ndr, 4));
464                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
465                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
466                 NDR_CHECK(ndr_pull_samr_PasswordProperties(ndr, NDR_SCALARS, &r->password_properties));
467                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
468                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
469         }
470         if (ndr_flags & NDR_BUFFERS) {
471         }
472         return NDR_ERR_SUCCESS;
473 }
474
475 _PUBLIC_ void ndr_print_samr_DomInfo1(struct ndr_print *ndr, const char *name, const struct samr_DomInfo1 *r)
476 {
477         ndr_print_struct(ndr, name, "samr_DomInfo1");
478         ndr->depth++;
479         ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
480         ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
481         ndr_print_samr_PasswordProperties(ndr, "password_properties", r->password_properties);
482         ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
483         ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
484         ndr->depth--;
485 }
486
487 static enum ndr_err_code ndr_push_samr_DomGeneralInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation *r)
488 {
489         if (ndr_flags & NDR_SCALARS) {
490                 NDR_CHECK(ndr_push_align(ndr, 4));
491                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time));
492                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
493                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
494                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary));
495                 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
496                 NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state));
497                 NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role));
498                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
499                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_users));
500                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_groups));
501                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_aliases));
502         }
503         if (ndr_flags & NDR_BUFFERS) {
504                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
505                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
506                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary));
507         }
508         return NDR_ERR_SUCCESS;
509 }
510
511 static enum ndr_err_code ndr_pull_samr_DomGeneralInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation *r)
512 {
513         if (ndr_flags & NDR_SCALARS) {
514                 NDR_CHECK(ndr_pull_align(ndr, 4));
515                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time));
516                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
517                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
518                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary));
519                 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
520                 NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state));
521                 NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role));
522                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
523                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_users));
524                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_groups));
525                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_aliases));
526         }
527         if (ndr_flags & NDR_BUFFERS) {
528                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
529                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
530                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary));
531         }
532         return NDR_ERR_SUCCESS;
533 }
534
535 _PUBLIC_ void ndr_print_samr_DomGeneralInformation(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation *r)
536 {
537         ndr_print_struct(ndr, name, "samr_DomGeneralInformation");
538         ndr->depth++;
539         ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time);
540         ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
541         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
542         ndr_print_lsa_String(ndr, "primary", &r->primary);
543         ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
544         ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state);
545         ndr_print_samr_Role(ndr, "role", r->role);
546         ndr_print_uint32(ndr, "unknown3", r->unknown3);
547         ndr_print_uint32(ndr, "num_users", r->num_users);
548         ndr_print_uint32(ndr, "num_groups", r->num_groups);
549         ndr_print_uint32(ndr, "num_aliases", r->num_aliases);
550         ndr->depth--;
551 }
552
553 static enum ndr_err_code ndr_push_samr_DomInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo3 *r)
554 {
555         if (ndr_flags & NDR_SCALARS) {
556                 NDR_CHECK(ndr_push_align(ndr, 4));
557                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_logoff_time));
558         }
559         if (ndr_flags & NDR_BUFFERS) {
560         }
561         return NDR_ERR_SUCCESS;
562 }
563
564 static enum ndr_err_code ndr_pull_samr_DomInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo3 *r)
565 {
566         if (ndr_flags & NDR_SCALARS) {
567                 NDR_CHECK(ndr_pull_align(ndr, 4));
568                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_logoff_time));
569         }
570         if (ndr_flags & NDR_BUFFERS) {
571         }
572         return NDR_ERR_SUCCESS;
573 }
574
575 _PUBLIC_ void ndr_print_samr_DomInfo3(struct ndr_print *ndr, const char *name, const struct samr_DomInfo3 *r)
576 {
577         ndr_print_struct(ndr, name, "samr_DomInfo3");
578         ndr->depth++;
579         ndr_print_NTTIME(ndr, "force_logoff_time", r->force_logoff_time);
580         ndr->depth--;
581 }
582
583 static enum ndr_err_code ndr_push_samr_DomOEMInformation(struct ndr_push *ndr, int ndr_flags, const struct samr_DomOEMInformation *r)
584 {
585         if (ndr_flags & NDR_SCALARS) {
586                 NDR_CHECK(ndr_push_align(ndr, 4));
587                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
588         }
589         if (ndr_flags & NDR_BUFFERS) {
590                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
591         }
592         return NDR_ERR_SUCCESS;
593 }
594
595 static enum ndr_err_code ndr_pull_samr_DomOEMInformation(struct ndr_pull *ndr, int ndr_flags, struct samr_DomOEMInformation *r)
596 {
597         if (ndr_flags & NDR_SCALARS) {
598                 NDR_CHECK(ndr_pull_align(ndr, 4));
599                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
600         }
601         if (ndr_flags & NDR_BUFFERS) {
602                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
603         }
604         return NDR_ERR_SUCCESS;
605 }
606
607 _PUBLIC_ void ndr_print_samr_DomOEMInformation(struct ndr_print *ndr, const char *name, const struct samr_DomOEMInformation *r)
608 {
609         ndr_print_struct(ndr, name, "samr_DomOEMInformation");
610         ndr->depth++;
611         ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
612         ndr->depth--;
613 }
614
615 static enum ndr_err_code ndr_push_samr_DomInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo5 *r)
616 {
617         if (ndr_flags & NDR_SCALARS) {
618                 NDR_CHECK(ndr_push_align(ndr, 4));
619                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
620         }
621         if (ndr_flags & NDR_BUFFERS) {
622                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
623         }
624         return NDR_ERR_SUCCESS;
625 }
626
627 static enum ndr_err_code ndr_pull_samr_DomInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo5 *r)
628 {
629         if (ndr_flags & NDR_SCALARS) {
630                 NDR_CHECK(ndr_pull_align(ndr, 4));
631                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
632         }
633         if (ndr_flags & NDR_BUFFERS) {
634                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
635         }
636         return NDR_ERR_SUCCESS;
637 }
638
639 _PUBLIC_ void ndr_print_samr_DomInfo5(struct ndr_print *ndr, const char *name, const struct samr_DomInfo5 *r)
640 {
641         ndr_print_struct(ndr, name, "samr_DomInfo5");
642         ndr->depth++;
643         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
644         ndr->depth--;
645 }
646
647 static enum ndr_err_code ndr_push_samr_DomInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo6 *r)
648 {
649         if (ndr_flags & NDR_SCALARS) {
650                 NDR_CHECK(ndr_push_align(ndr, 4));
651                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary));
652         }
653         if (ndr_flags & NDR_BUFFERS) {
654                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary));
655         }
656         return NDR_ERR_SUCCESS;
657 }
658
659 static enum ndr_err_code ndr_pull_samr_DomInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo6 *r)
660 {
661         if (ndr_flags & NDR_SCALARS) {
662                 NDR_CHECK(ndr_pull_align(ndr, 4));
663                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary));
664         }
665         if (ndr_flags & NDR_BUFFERS) {
666                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->primary));
667         }
668         return NDR_ERR_SUCCESS;
669 }
670
671 _PUBLIC_ void ndr_print_samr_DomInfo6(struct ndr_print *ndr, const char *name, const struct samr_DomInfo6 *r)
672 {
673         ndr_print_struct(ndr, name, "samr_DomInfo6");
674         ndr->depth++;
675         ndr_print_lsa_String(ndr, "primary", &r->primary);
676         ndr->depth--;
677 }
678
679 static enum ndr_err_code ndr_push_samr_DomInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo7 *r)
680 {
681         if (ndr_flags & NDR_SCALARS) {
682                 NDR_CHECK(ndr_push_align(ndr, 4));
683                 NDR_CHECK(ndr_push_samr_Role(ndr, NDR_SCALARS, r->role));
684         }
685         if (ndr_flags & NDR_BUFFERS) {
686         }
687         return NDR_ERR_SUCCESS;
688 }
689
690 static enum ndr_err_code ndr_pull_samr_DomInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo7 *r)
691 {
692         if (ndr_flags & NDR_SCALARS) {
693                 NDR_CHECK(ndr_pull_align(ndr, 4));
694                 NDR_CHECK(ndr_pull_samr_Role(ndr, NDR_SCALARS, &r->role));
695         }
696         if (ndr_flags & NDR_BUFFERS) {
697         }
698         return NDR_ERR_SUCCESS;
699 }
700
701 _PUBLIC_ void ndr_print_samr_DomInfo7(struct ndr_print *ndr, const char *name, const struct samr_DomInfo7 *r)
702 {
703         ndr_print_struct(ndr, name, "samr_DomInfo7");
704         ndr->depth++;
705         ndr_print_samr_Role(ndr, "role", r->role);
706         ndr->depth--;
707 }
708
709 static enum ndr_err_code ndr_push_samr_DomInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo8 *r)
710 {
711         if (ndr_flags & NDR_SCALARS) {
712                 NDR_CHECK(ndr_push_align(ndr, 8));
713                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
714                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
715         }
716         if (ndr_flags & NDR_BUFFERS) {
717         }
718         return NDR_ERR_SUCCESS;
719 }
720
721 static enum ndr_err_code ndr_pull_samr_DomInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo8 *r)
722 {
723         if (ndr_flags & NDR_SCALARS) {
724                 NDR_CHECK(ndr_pull_align(ndr, 8));
725                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
726                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
727         }
728         if (ndr_flags & NDR_BUFFERS) {
729         }
730         return NDR_ERR_SUCCESS;
731 }
732
733 _PUBLIC_ void ndr_print_samr_DomInfo8(struct ndr_print *ndr, const char *name, const struct samr_DomInfo8 *r)
734 {
735         ndr_print_struct(ndr, name, "samr_DomInfo8");
736         ndr->depth++;
737         ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
738         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
739         ndr->depth--;
740 }
741
742 static enum ndr_err_code ndr_push_samr_DomInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo9 *r)
743 {
744         if (ndr_flags & NDR_SCALARS) {
745                 NDR_CHECK(ndr_push_align(ndr, 4));
746                 NDR_CHECK(ndr_push_samr_DomainServerState(ndr, NDR_SCALARS, r->domain_server_state));
747         }
748         if (ndr_flags & NDR_BUFFERS) {
749         }
750         return NDR_ERR_SUCCESS;
751 }
752
753 static enum ndr_err_code ndr_pull_samr_DomInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo9 *r)
754 {
755         if (ndr_flags & NDR_SCALARS) {
756                 NDR_CHECK(ndr_pull_align(ndr, 4));
757                 NDR_CHECK(ndr_pull_samr_DomainServerState(ndr, NDR_SCALARS, &r->domain_server_state));
758         }
759         if (ndr_flags & NDR_BUFFERS) {
760         }
761         return NDR_ERR_SUCCESS;
762 }
763
764 _PUBLIC_ void ndr_print_samr_DomInfo9(struct ndr_print *ndr, const char *name, const struct samr_DomInfo9 *r)
765 {
766         ndr_print_struct(ndr, name, "samr_DomInfo9");
767         ndr->depth++;
768         ndr_print_samr_DomainServerState(ndr, "domain_server_state", r->domain_server_state);
769         ndr->depth--;
770 }
771
772 static enum ndr_err_code ndr_push_samr_DomGeneralInformation2(struct ndr_push *ndr, int ndr_flags, const struct samr_DomGeneralInformation2 *r)
773 {
774         if (ndr_flags & NDR_SCALARS) {
775                 NDR_CHECK(ndr_push_align(ndr, 8));
776                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
777                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration));
778                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window));
779                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold));
780         }
781         if (ndr_flags & NDR_BUFFERS) {
782                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
783         }
784         return NDR_ERR_SUCCESS;
785 }
786
787 static enum ndr_err_code ndr_pull_samr_DomGeneralInformation2(struct ndr_pull *ndr, int ndr_flags, struct samr_DomGeneralInformation2 *r)
788 {
789         if (ndr_flags & NDR_SCALARS) {
790                 NDR_CHECK(ndr_pull_align(ndr, 8));
791                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
792                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration));
793                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window));
794                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold));
795         }
796         if (ndr_flags & NDR_BUFFERS) {
797                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
798         }
799         return NDR_ERR_SUCCESS;
800 }
801
802 _PUBLIC_ void ndr_print_samr_DomGeneralInformation2(struct ndr_print *ndr, const char *name, const struct samr_DomGeneralInformation2 *r)
803 {
804         ndr_print_struct(ndr, name, "samr_DomGeneralInformation2");
805         ndr->depth++;
806         ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
807         ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration);
808         ndr_print_hyper(ndr, "lockout_window", r->lockout_window);
809         ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold);
810         ndr->depth--;
811 }
812
813 static enum ndr_err_code ndr_push_samr_DomInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo12 *r)
814 {
815         if (ndr_flags & NDR_SCALARS) {
816                 NDR_CHECK(ndr_push_align(ndr, 8));
817                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_duration));
818                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->lockout_window));
819                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lockout_threshold));
820         }
821         if (ndr_flags & NDR_BUFFERS) {
822         }
823         return NDR_ERR_SUCCESS;
824 }
825
826 static enum ndr_err_code ndr_pull_samr_DomInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo12 *r)
827 {
828         if (ndr_flags & NDR_SCALARS) {
829                 NDR_CHECK(ndr_pull_align(ndr, 8));
830                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_duration));
831                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->lockout_window));
832                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lockout_threshold));
833         }
834         if (ndr_flags & NDR_BUFFERS) {
835         }
836         return NDR_ERR_SUCCESS;
837 }
838
839 _PUBLIC_ void ndr_print_samr_DomInfo12(struct ndr_print *ndr, const char *name, const struct samr_DomInfo12 *r)
840 {
841         ndr_print_struct(ndr, name, "samr_DomInfo12");
842         ndr->depth++;
843         ndr_print_hyper(ndr, "lockout_duration", r->lockout_duration);
844         ndr_print_hyper(ndr, "lockout_window", r->lockout_window);
845         ndr_print_uint16(ndr, "lockout_threshold", r->lockout_threshold);
846         ndr->depth--;
847 }
848
849 static enum ndr_err_code ndr_push_samr_DomInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_DomInfo13 *r)
850 {
851         if (ndr_flags & NDR_SCALARS) {
852                 NDR_CHECK(ndr_push_align(ndr, 8));
853                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->sequence_num));
854                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
855                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_count_at_last_promotion));
856         }
857         if (ndr_flags & NDR_BUFFERS) {
858         }
859         return NDR_ERR_SUCCESS;
860 }
861
862 static enum ndr_err_code ndr_pull_samr_DomInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_DomInfo13 *r)
863 {
864         if (ndr_flags & NDR_SCALARS) {
865                 NDR_CHECK(ndr_pull_align(ndr, 8));
866                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->sequence_num));
867                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
868                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_count_at_last_promotion));
869         }
870         if (ndr_flags & NDR_BUFFERS) {
871         }
872         return NDR_ERR_SUCCESS;
873 }
874
875 _PUBLIC_ void ndr_print_samr_DomInfo13(struct ndr_print *ndr, const char *name, const struct samr_DomInfo13 *r)
876 {
877         ndr_print_struct(ndr, name, "samr_DomInfo13");
878         ndr->depth++;
879         ndr_print_hyper(ndr, "sequence_num", r->sequence_num);
880         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
881         ndr_print_hyper(ndr, "modified_count_at_last_promotion", r->modified_count_at_last_promotion);
882         ndr->depth--;
883 }
884
885 static enum ndr_err_code ndr_push_samr_DomainInfo(struct ndr_push *ndr, int ndr_flags, const union samr_DomainInfo *r)
886 {
887         if (ndr_flags & NDR_SCALARS) {
888                 int level = ndr_push_get_switch_value(ndr, r);
889                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
890                 switch (level) {
891                         case 1: {
892                                 NDR_CHECK(ndr_push_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1));
893                         break; }
894
895                         case 2: {
896                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
897                         break; }
898
899                         case 3: {
900                                 NDR_CHECK(ndr_push_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3));
901                         break; }
902
903                         case 4: {
904                                 NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
905                         break; }
906
907                         case 5: {
908                                 NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5));
909                         break; }
910
911                         case 6: {
912                                 NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6));
913                         break; }
914
915                         case 7: {
916                                 NDR_CHECK(ndr_push_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7));
917                         break; }
918
919                         case 8: {
920                                 NDR_CHECK(ndr_push_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8));
921                         break; }
922
923                         case 9: {
924                                 NDR_CHECK(ndr_push_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9));
925                         break; }
926
927                         case 11: {
928                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
929                         break; }
930
931                         case 12: {
932                                 NDR_CHECK(ndr_push_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12));
933                         break; }
934
935                         case 13: {
936                                 NDR_CHECK(ndr_push_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13));
937                         break; }
938
939                         default:
940                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
941                 }
942         }
943         if (ndr_flags & NDR_BUFFERS) {
944                 int level = ndr_push_get_switch_value(ndr, r);
945                 switch (level) {
946                         case 1:
947                         break;
948
949                         case 2:
950                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
951                         break;
952
953                         case 3:
954                         break;
955
956                         case 4:
957                                 NDR_CHECK(ndr_push_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
958                         break;
959
960                         case 5:
961                                 NDR_CHECK(ndr_push_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5));
962                         break;
963
964                         case 6:
965                                 NDR_CHECK(ndr_push_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6));
966                         break;
967
968                         case 7:
969                         break;
970
971                         case 8:
972                         break;
973
974                         case 9:
975                         break;
976
977                         case 11:
978                                 NDR_CHECK(ndr_push_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
979                         break;
980
981                         case 12:
982                         break;
983
984                         case 13:
985                         break;
986
987                         default:
988                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
989                 }
990         }
991         return NDR_ERR_SUCCESS;
992 }
993
994 static enum ndr_err_code ndr_pull_samr_DomainInfo(struct ndr_pull *ndr, int ndr_flags, union samr_DomainInfo *r)
995 {
996         int level;
997         uint16_t _level;
998         level = ndr_pull_get_switch_value(ndr, r);
999         if (ndr_flags & NDR_SCALARS) {
1000                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1001                 if (_level != level) {
1002                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1003                 }
1004                 switch (level) {
1005                         case 1: {
1006                                 NDR_CHECK(ndr_pull_samr_DomInfo1(ndr, NDR_SCALARS, &r->info1));
1007                         break; }
1008
1009                         case 2: {
1010                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_SCALARS, &r->general));
1011                         break; }
1012
1013                         case 3: {
1014                                 NDR_CHECK(ndr_pull_samr_DomInfo3(ndr, NDR_SCALARS, &r->info3));
1015                         break; }
1016
1017                         case 4: {
1018                                 NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_SCALARS, &r->oem));
1019                         break; }
1020
1021                         case 5: {
1022                                 NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_SCALARS, &r->info5));
1023                         break; }
1024
1025                         case 6: {
1026                                 NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_SCALARS, &r->info6));
1027                         break; }
1028
1029                         case 7: {
1030                                 NDR_CHECK(ndr_pull_samr_DomInfo7(ndr, NDR_SCALARS, &r->info7));
1031                         break; }
1032
1033                         case 8: {
1034                                 NDR_CHECK(ndr_pull_samr_DomInfo8(ndr, NDR_SCALARS, &r->info8));
1035                         break; }
1036
1037                         case 9: {
1038                                 NDR_CHECK(ndr_pull_samr_DomInfo9(ndr, NDR_SCALARS, &r->info9));
1039                         break; }
1040
1041                         case 11: {
1042                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_SCALARS, &r->general2));
1043                         break; }
1044
1045                         case 12: {
1046                                 NDR_CHECK(ndr_pull_samr_DomInfo12(ndr, NDR_SCALARS, &r->info12));
1047                         break; }
1048
1049                         case 13: {
1050                                 NDR_CHECK(ndr_pull_samr_DomInfo13(ndr, NDR_SCALARS, &r->info13));
1051                         break; }
1052
1053                         default:
1054                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1055                 }
1056         }
1057         if (ndr_flags & NDR_BUFFERS) {
1058                 switch (level) {
1059                         case 1:
1060                         break;
1061
1062                         case 2:
1063                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation(ndr, NDR_BUFFERS, &r->general));
1064                         break;
1065
1066                         case 3:
1067                         break;
1068
1069                         case 4:
1070                                 NDR_CHECK(ndr_pull_samr_DomOEMInformation(ndr, NDR_BUFFERS, &r->oem));
1071                         break;
1072
1073                         case 5:
1074                                 NDR_CHECK(ndr_pull_samr_DomInfo5(ndr, NDR_BUFFERS, &r->info5));
1075                         break;
1076
1077                         case 6:
1078                                 NDR_CHECK(ndr_pull_samr_DomInfo6(ndr, NDR_BUFFERS, &r->info6));
1079                         break;
1080
1081                         case 7:
1082                         break;
1083
1084                         case 8:
1085                         break;
1086
1087                         case 9:
1088                         break;
1089
1090                         case 11:
1091                                 NDR_CHECK(ndr_pull_samr_DomGeneralInformation2(ndr, NDR_BUFFERS, &r->general2));
1092                         break;
1093
1094                         case 12:
1095                         break;
1096
1097                         case 13:
1098                         break;
1099
1100                         default:
1101                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1102                 }
1103         }
1104         return NDR_ERR_SUCCESS;
1105 }
1106
1107 _PUBLIC_ void ndr_print_samr_DomainInfo(struct ndr_print *ndr, const char *name, const union samr_DomainInfo *r)
1108 {
1109         int level;
1110         level = ndr_print_get_switch_value(ndr, r);
1111         ndr_print_union(ndr, name, level, "samr_DomainInfo");
1112         switch (level) {
1113                 case 1:
1114                         ndr_print_samr_DomInfo1(ndr, "info1", &r->info1);
1115                 break;
1116
1117                 case 2:
1118                         ndr_print_samr_DomGeneralInformation(ndr, "general", &r->general);
1119                 break;
1120
1121                 case 3:
1122                         ndr_print_samr_DomInfo3(ndr, "info3", &r->info3);
1123                 break;
1124
1125                 case 4:
1126                         ndr_print_samr_DomOEMInformation(ndr, "oem", &r->oem);
1127                 break;
1128
1129                 case 5:
1130                         ndr_print_samr_DomInfo5(ndr, "info5", &r->info5);
1131                 break;
1132
1133                 case 6:
1134                         ndr_print_samr_DomInfo6(ndr, "info6", &r->info6);
1135                 break;
1136
1137                 case 7:
1138                         ndr_print_samr_DomInfo7(ndr, "info7", &r->info7);
1139                 break;
1140
1141                 case 8:
1142                         ndr_print_samr_DomInfo8(ndr, "info8", &r->info8);
1143                 break;
1144
1145                 case 9:
1146                         ndr_print_samr_DomInfo9(ndr, "info9", &r->info9);
1147                 break;
1148
1149                 case 11:
1150                         ndr_print_samr_DomGeneralInformation2(ndr, "general2", &r->general2);
1151                 break;
1152
1153                 case 12:
1154                         ndr_print_samr_DomInfo12(ndr, "info12", &r->info12);
1155                 break;
1156
1157                 case 13:
1158                         ndr_print_samr_DomInfo13(ndr, "info13", &r->info13);
1159                 break;
1160
1161                 default:
1162                         ndr_print_bad_level(ndr, name, level);
1163         }
1164 }
1165
1166 static enum ndr_err_code ndr_push_samr_Ids(struct ndr_push *ndr, int ndr_flags, const struct samr_Ids *r)
1167 {
1168         uint32_t cntr_ids_1;
1169         if (ndr_flags & NDR_SCALARS) {
1170                 NDR_CHECK(ndr_push_align(ndr, 4));
1171                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1172                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->ids));
1173         }
1174         if (ndr_flags & NDR_BUFFERS) {
1175                 if (r->ids) {
1176                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1177                         for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) {
1178                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ids[cntr_ids_1]));
1179                         }
1180                 }
1181         }
1182         return NDR_ERR_SUCCESS;
1183 }
1184
1185 static enum ndr_err_code ndr_pull_samr_Ids(struct ndr_pull *ndr, int ndr_flags, struct samr_Ids *r)
1186 {
1187         uint32_t _ptr_ids;
1188         uint32_t cntr_ids_1;
1189         TALLOC_CTX *_mem_save_ids_0;
1190         TALLOC_CTX *_mem_save_ids_1;
1191         if (ndr_flags & NDR_SCALARS) {
1192                 NDR_CHECK(ndr_pull_align(ndr, 4));
1193                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1194                 if (r->count < 0 || r->count > 1024) {
1195                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1196                 }
1197                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ids));
1198                 if (_ptr_ids) {
1199                         NDR_PULL_ALLOC(ndr, r->ids);
1200                 } else {
1201                         r->ids = NULL;
1202                 }
1203         }
1204         if (ndr_flags & NDR_BUFFERS) {
1205                 if (r->ids) {
1206                         _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1207                         NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0);
1208                         NDR_CHECK(ndr_pull_array_size(ndr, &r->ids));
1209                         NDR_PULL_ALLOC_N(ndr, r->ids, ndr_get_array_size(ndr, &r->ids));
1210                         _mem_save_ids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1211                         NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0);
1212                         for (cntr_ids_1 = 0; cntr_ids_1 < r->count; cntr_ids_1++) {
1213                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ids[cntr_ids_1]));
1214                         }
1215                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_1, 0);
1216                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0);
1217                 }
1218                 if (r->ids) {
1219                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->count));
1220                 }
1221         }
1222         return NDR_ERR_SUCCESS;
1223 }
1224
1225 _PUBLIC_ void ndr_print_samr_Ids(struct ndr_print *ndr, const char *name, const struct samr_Ids *r)
1226 {
1227         uint32_t cntr_ids_1;
1228         ndr_print_struct(ndr, name, "samr_Ids");
1229         ndr->depth++;
1230         ndr_print_uint32(ndr, "count", r->count);
1231         ndr_print_ptr(ndr, "ids", r->ids);
1232         ndr->depth++;
1233         if (r->ids) {
1234                 ndr->print(ndr, "%s: ARRAY(%d)", "ids", (int)r->count);
1235                 ndr->depth++;
1236                 for (cntr_ids_1=0;cntr_ids_1<r->count;cntr_ids_1++) {
1237                         char *idx_1=NULL;
1238                         if (asprintf(&idx_1, "[%d]", cntr_ids_1) != -1) {
1239                                 ndr_print_uint32(ndr, "ids", r->ids[cntr_ids_1]);
1240                                 free(idx_1);
1241                         }
1242                 }
1243                 ndr->depth--;
1244         }
1245         ndr->depth--;
1246         ndr->depth--;
1247 }
1248
1249 _PUBLIC_ enum ndr_err_code ndr_push_samr_GroupAttrs(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1250 {
1251         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1252         return NDR_ERR_SUCCESS;
1253 }
1254
1255 _PUBLIC_ enum ndr_err_code ndr_pull_samr_GroupAttrs(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1256 {
1257         uint32_t v;
1258         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1259         *r = v;
1260         return NDR_ERR_SUCCESS;
1261 }
1262
1263 _PUBLIC_ void ndr_print_samr_GroupAttrs(struct ndr_print *ndr, const char *name, uint32_t r)
1264 {
1265         ndr_print_uint32(ndr, name, r);
1266         ndr->depth++;
1267         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_MANDATORY", SE_GROUP_MANDATORY, r);
1268         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED_BY_DEFAULT", SE_GROUP_ENABLED_BY_DEFAULT, r);
1269         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_ENABLED", SE_GROUP_ENABLED, r);
1270         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_OWNER", SE_GROUP_OWNER, r);
1271         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_USE_FOR_DENY_ONLY", SE_GROUP_USE_FOR_DENY_ONLY, r);
1272         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_RESOURCE", SE_GROUP_RESOURCE, r);
1273         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SE_GROUP_LOGON_ID", SE_GROUP_LOGON_ID, r);
1274         ndr->depth--;
1275 }
1276
1277 static enum ndr_err_code ndr_push_samr_GroupInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAll *r)
1278 {
1279         if (ndr_flags & NDR_SCALARS) {
1280                 NDR_CHECK(ndr_push_align(ndr, 4));
1281                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1282                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1283                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members));
1284                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1285         }
1286         if (ndr_flags & NDR_BUFFERS) {
1287                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1288                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1289         }
1290         return NDR_ERR_SUCCESS;
1291 }
1292
1293 static enum ndr_err_code ndr_pull_samr_GroupInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAll *r)
1294 {
1295         if (ndr_flags & NDR_SCALARS) {
1296                 NDR_CHECK(ndr_pull_align(ndr, 4));
1297                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1298                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1299                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members));
1300                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1301         }
1302         if (ndr_flags & NDR_BUFFERS) {
1303                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1304                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1305         }
1306         return NDR_ERR_SUCCESS;
1307 }
1308
1309 _PUBLIC_ void ndr_print_samr_GroupInfoAll(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAll *r)
1310 {
1311         ndr_print_struct(ndr, name, "samr_GroupInfoAll");
1312         ndr->depth++;
1313         ndr_print_lsa_String(ndr, "name", &r->name);
1314         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1315         ndr_print_uint32(ndr, "num_members", r->num_members);
1316         ndr_print_lsa_String(ndr, "description", &r->description);
1317         ndr->depth--;
1318 }
1319
1320 static enum ndr_err_code ndr_push_samr_GroupInfoAttributes(struct ndr_push *ndr, int ndr_flags, const struct samr_GroupInfoAttributes *r)
1321 {
1322         if (ndr_flags & NDR_SCALARS) {
1323                 NDR_CHECK(ndr_push_align(ndr, 4));
1324                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1325         }
1326         if (ndr_flags & NDR_BUFFERS) {
1327         }
1328         return NDR_ERR_SUCCESS;
1329 }
1330
1331 static enum ndr_err_code ndr_pull_samr_GroupInfoAttributes(struct ndr_pull *ndr, int ndr_flags, struct samr_GroupInfoAttributes *r)
1332 {
1333         if (ndr_flags & NDR_SCALARS) {
1334                 NDR_CHECK(ndr_pull_align(ndr, 4));
1335                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1336         }
1337         if (ndr_flags & NDR_BUFFERS) {
1338         }
1339         return NDR_ERR_SUCCESS;
1340 }
1341
1342 _PUBLIC_ void ndr_print_samr_GroupInfoAttributes(struct ndr_print *ndr, const char *name, const struct samr_GroupInfoAttributes *r)
1343 {
1344         ndr_print_struct(ndr, name, "samr_GroupInfoAttributes");
1345         ndr->depth++;
1346         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1347         ndr->depth--;
1348 }
1349
1350 static enum ndr_err_code ndr_push_samr_GroupInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_GroupInfoEnum r)
1351 {
1352         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
1353         return NDR_ERR_SUCCESS;
1354 }
1355
1356 static enum ndr_err_code ndr_pull_samr_GroupInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_GroupInfoEnum *r)
1357 {
1358         uint16_t v;
1359         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
1360         *r = v;
1361         return NDR_ERR_SUCCESS;
1362 }
1363
1364 _PUBLIC_ void ndr_print_samr_GroupInfoEnum(struct ndr_print *ndr, const char *name, enum samr_GroupInfoEnum r)
1365 {
1366         const char *val = NULL;
1367
1368         switch (r) {
1369                 case GROUPINFOALL: val = "GROUPINFOALL"; break;
1370                 case GROUPINFONAME: val = "GROUPINFONAME"; break;
1371                 case GROUPINFOATTRIBUTES: val = "GROUPINFOATTRIBUTES"; break;
1372                 case GROUPINFODESCRIPTION: val = "GROUPINFODESCRIPTION"; break;
1373                 case GROUPINFOALL2: val = "GROUPINFOALL2"; break;
1374         }
1375         ndr_print_enum(ndr, name, "ENUM", val, r);
1376 }
1377
1378 static enum ndr_err_code ndr_push_samr_GroupInfo(struct ndr_push *ndr, int ndr_flags, const union samr_GroupInfo *r)
1379 {
1380         if (ndr_flags & NDR_SCALARS) {
1381                 int level = ndr_push_get_switch_value(ndr, r);
1382                 NDR_CHECK(ndr_push_samr_GroupInfoEnum(ndr, NDR_SCALARS, level));
1383                 switch (level) {
1384                         case GROUPINFOALL: {
1385                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all));
1386                         break; }
1387
1388                         case GROUPINFONAME: {
1389                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1390                         break; }
1391
1392                         case GROUPINFOATTRIBUTES: {
1393                                 NDR_CHECK(ndr_push_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes));
1394                         break; }
1395
1396                         case GROUPINFODESCRIPTION: {
1397                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1398                         break; }
1399
1400                         case GROUPINFOALL2: {
1401                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2));
1402                         break; }
1403
1404                         default:
1405                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1406                 }
1407         }
1408         if (ndr_flags & NDR_BUFFERS) {
1409                 int level = ndr_push_get_switch_value(ndr, r);
1410                 switch (level) {
1411                         case GROUPINFOALL:
1412                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all));
1413                         break;
1414
1415                         case GROUPINFONAME:
1416                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1417                         break;
1418
1419                         case GROUPINFOATTRIBUTES:
1420                         break;
1421
1422                         case GROUPINFODESCRIPTION:
1423                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1424                         break;
1425
1426                         case GROUPINFOALL2:
1427                                 NDR_CHECK(ndr_push_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2));
1428                         break;
1429
1430                         default:
1431                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1432                 }
1433         }
1434         return NDR_ERR_SUCCESS;
1435 }
1436
1437 static enum ndr_err_code ndr_pull_samr_GroupInfo(struct ndr_pull *ndr, int ndr_flags, union samr_GroupInfo *r)
1438 {
1439         int level;
1440         uint16_t _level;
1441         level = ndr_pull_get_switch_value(ndr, r);
1442         if (ndr_flags & NDR_SCALARS) {
1443                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1444                 if (_level != level) {
1445                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1446                 }
1447                 switch (level) {
1448                         case GROUPINFOALL: {
1449                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all));
1450                         break; }
1451
1452                         case GROUPINFONAME: {
1453                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1454                         break; }
1455
1456                         case GROUPINFOATTRIBUTES: {
1457                                 NDR_CHECK(ndr_pull_samr_GroupInfoAttributes(ndr, NDR_SCALARS, &r->attributes));
1458                         break; }
1459
1460                         case GROUPINFODESCRIPTION: {
1461                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1462                         break; }
1463
1464                         case GROUPINFOALL2: {
1465                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_SCALARS, &r->all2));
1466                         break; }
1467
1468                         default:
1469                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1470                 }
1471         }
1472         if (ndr_flags & NDR_BUFFERS) {
1473                 switch (level) {
1474                         case GROUPINFOALL:
1475                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all));
1476                         break;
1477
1478                         case GROUPINFONAME:
1479                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1480                         break;
1481
1482                         case GROUPINFOATTRIBUTES:
1483                         break;
1484
1485                         case GROUPINFODESCRIPTION:
1486                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1487                         break;
1488
1489                         case GROUPINFOALL2:
1490                                 NDR_CHECK(ndr_pull_samr_GroupInfoAll(ndr, NDR_BUFFERS, &r->all2));
1491                         break;
1492
1493                         default:
1494                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1495                 }
1496         }
1497         return NDR_ERR_SUCCESS;
1498 }
1499
1500 _PUBLIC_ void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r)
1501 {
1502         int level;
1503         level = ndr_print_get_switch_value(ndr, r);
1504         ndr_print_union(ndr, name, level, "samr_GroupInfo");
1505         switch (level) {
1506                 case GROUPINFOALL:
1507                         ndr_print_samr_GroupInfoAll(ndr, "all", &r->all);
1508                 break;
1509
1510                 case GROUPINFONAME:
1511                         ndr_print_lsa_String(ndr, "name", &r->name);
1512                 break;
1513
1514                 case GROUPINFOATTRIBUTES:
1515                         ndr_print_samr_GroupInfoAttributes(ndr, "attributes", &r->attributes);
1516                 break;
1517
1518                 case GROUPINFODESCRIPTION:
1519                         ndr_print_lsa_String(ndr, "description", &r->description);
1520                 break;
1521
1522                 case GROUPINFOALL2:
1523                         ndr_print_samr_GroupInfoAll(ndr, "all2", &r->all2);
1524                 break;
1525
1526                 default:
1527                         ndr_print_bad_level(ndr, name, level);
1528         }
1529 }
1530
1531 static enum ndr_err_code ndr_push_samr_RidTypeArray(struct ndr_push *ndr, int ndr_flags, const struct samr_RidTypeArray *r)
1532 {
1533         uint32_t cntr_rids_1;
1534         uint32_t cntr_types_1;
1535         if (ndr_flags & NDR_SCALARS) {
1536                 NDR_CHECK(ndr_push_align(ndr, 4));
1537                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1538                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
1539                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->types));
1540         }
1541         if (ndr_flags & NDR_BUFFERS) {
1542                 if (r->rids) {
1543                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1544                         for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) {
1545                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
1546                         }
1547                 }
1548                 if (r->types) {
1549                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1550                         for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) {
1551                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->types[cntr_types_1]));
1552                         }
1553                 }
1554         }
1555         return NDR_ERR_SUCCESS;
1556 }
1557
1558 static enum ndr_err_code ndr_pull_samr_RidTypeArray(struct ndr_pull *ndr, int ndr_flags, struct samr_RidTypeArray *r)
1559 {
1560         uint32_t _ptr_rids;
1561         uint32_t cntr_rids_1;
1562         TALLOC_CTX *_mem_save_rids_0;
1563         TALLOC_CTX *_mem_save_rids_1;
1564         uint32_t _ptr_types;
1565         uint32_t cntr_types_1;
1566         TALLOC_CTX *_mem_save_types_0;
1567         TALLOC_CTX *_mem_save_types_1;
1568         if (ndr_flags & NDR_SCALARS) {
1569                 NDR_CHECK(ndr_pull_align(ndr, 4));
1570                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1571                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
1572                 if (_ptr_rids) {
1573                         NDR_PULL_ALLOC(ndr, r->rids);
1574                 } else {
1575                         r->rids = NULL;
1576                 }
1577                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types));
1578                 if (_ptr_types) {
1579                         NDR_PULL_ALLOC(ndr, r->types);
1580                 } else {
1581                         r->types = NULL;
1582                 }
1583         }
1584         if (ndr_flags & NDR_BUFFERS) {
1585                 if (r->rids) {
1586                         _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1587                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
1588                         NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
1589                         NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
1590                         _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1591                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
1592                         for (cntr_rids_1 = 0; cntr_rids_1 < r->count; cntr_rids_1++) {
1593                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
1594                         }
1595                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
1596                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
1597                 }
1598                 if (r->types) {
1599                         _mem_save_types_0 = NDR_PULL_GET_MEM_CTX(ndr);
1600                         NDR_PULL_SET_MEM_CTX(ndr, r->types, 0);
1601                         NDR_CHECK(ndr_pull_array_size(ndr, &r->types));
1602                         NDR_PULL_ALLOC_N(ndr, r->types, ndr_get_array_size(ndr, &r->types));
1603                         _mem_save_types_1 = NDR_PULL_GET_MEM_CTX(ndr);
1604                         NDR_PULL_SET_MEM_CTX(ndr, r->types, 0);
1605                         for (cntr_types_1 = 0; cntr_types_1 < r->count; cntr_types_1++) {
1606                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->types[cntr_types_1]));
1607                         }
1608                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_1, 0);
1609                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_types_0, 0);
1610                 }
1611                 if (r->rids) {
1612                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->count));
1613                 }
1614                 if (r->types) {
1615                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->types, r->count));
1616                 }
1617         }
1618         return NDR_ERR_SUCCESS;
1619 }
1620
1621 _PUBLIC_ void ndr_print_samr_RidTypeArray(struct ndr_print *ndr, const char *name, const struct samr_RidTypeArray *r)
1622 {
1623         uint32_t cntr_rids_1;
1624         uint32_t cntr_types_1;
1625         ndr_print_struct(ndr, name, "samr_RidTypeArray");
1626         ndr->depth++;
1627         ndr_print_uint32(ndr, "count", r->count);
1628         ndr_print_ptr(ndr, "rids", r->rids);
1629         ndr->depth++;
1630         if (r->rids) {
1631                 ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->count);
1632                 ndr->depth++;
1633                 for (cntr_rids_1=0;cntr_rids_1<r->count;cntr_rids_1++) {
1634                         char *idx_1=NULL;
1635                         if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
1636                                 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
1637                                 free(idx_1);
1638                         }
1639                 }
1640                 ndr->depth--;
1641         }
1642         ndr->depth--;
1643         ndr_print_ptr(ndr, "types", r->types);
1644         ndr->depth++;
1645         if (r->types) {
1646                 ndr->print(ndr, "%s: ARRAY(%d)", "types", (int)r->count);
1647                 ndr->depth++;
1648                 for (cntr_types_1=0;cntr_types_1<r->count;cntr_types_1++) {
1649                         char *idx_1=NULL;
1650                         if (asprintf(&idx_1, "[%d]", cntr_types_1) != -1) {
1651                                 ndr_print_uint32(ndr, "types", r->types[cntr_types_1]);
1652                                 free(idx_1);
1653                         }
1654                 }
1655                 ndr->depth--;
1656         }
1657         ndr->depth--;
1658         ndr->depth--;
1659 }
1660
1661 static enum ndr_err_code ndr_push_samr_AliasInfoAll(struct ndr_push *ndr, int ndr_flags, const struct samr_AliasInfoAll *r)
1662 {
1663         if (ndr_flags & NDR_SCALARS) {
1664                 NDR_CHECK(ndr_push_align(ndr, 4));
1665                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1666                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_members));
1667                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1668         }
1669         if (ndr_flags & NDR_BUFFERS) {
1670                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1671                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1672         }
1673         return NDR_ERR_SUCCESS;
1674 }
1675
1676 static enum ndr_err_code ndr_pull_samr_AliasInfoAll(struct ndr_pull *ndr, int ndr_flags, struct samr_AliasInfoAll *r)
1677 {
1678         if (ndr_flags & NDR_SCALARS) {
1679                 NDR_CHECK(ndr_pull_align(ndr, 4));
1680                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1681                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_members));
1682                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1683         }
1684         if (ndr_flags & NDR_BUFFERS) {
1685                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1686                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1687         }
1688         return NDR_ERR_SUCCESS;
1689 }
1690
1691 _PUBLIC_ void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r)
1692 {
1693         ndr_print_struct(ndr, name, "samr_AliasInfoAll");
1694         ndr->depth++;
1695         ndr_print_lsa_String(ndr, "name", &r->name);
1696         ndr_print_uint32(ndr, "num_members", r->num_members);
1697         ndr_print_lsa_String(ndr, "description", &r->description);
1698         ndr->depth--;
1699 }
1700
1701 static enum ndr_err_code ndr_push_samr_AliasInfoEnum(struct ndr_push *ndr, int ndr_flags, enum samr_AliasInfoEnum r)
1702 {
1703         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
1704         return NDR_ERR_SUCCESS;
1705 }
1706
1707 static enum ndr_err_code ndr_pull_samr_AliasInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum samr_AliasInfoEnum *r)
1708 {
1709         uint16_t v;
1710         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
1711         *r = v;
1712         return NDR_ERR_SUCCESS;
1713 }
1714
1715 _PUBLIC_ void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r)
1716 {
1717         const char *val = NULL;
1718
1719         switch (r) {
1720                 case ALIASINFOALL: val = "ALIASINFOALL"; break;
1721                 case ALIASINFONAME: val = "ALIASINFONAME"; break;
1722                 case ALIASINFODESCRIPTION: val = "ALIASINFODESCRIPTION"; break;
1723         }
1724         ndr_print_enum(ndr, name, "ENUM", val, r);
1725 }
1726
1727 static enum ndr_err_code ndr_push_samr_AliasInfo(struct ndr_push *ndr, int ndr_flags, const union samr_AliasInfo *r)
1728 {
1729         if (ndr_flags & NDR_SCALARS) {
1730                 int level = ndr_push_get_switch_value(ndr, r);
1731                 NDR_CHECK(ndr_push_samr_AliasInfoEnum(ndr, NDR_SCALARS, level));
1732                 switch (level) {
1733                         case ALIASINFOALL: {
1734                                 NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all));
1735                         break; }
1736
1737                         case ALIASINFONAME: {
1738                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1739                         break; }
1740
1741                         case ALIASINFODESCRIPTION: {
1742                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1743                         break; }
1744
1745                         default:
1746                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1747                 }
1748         }
1749         if (ndr_flags & NDR_BUFFERS) {
1750                 int level = ndr_push_get_switch_value(ndr, r);
1751                 switch (level) {
1752                         case ALIASINFOALL:
1753                                 NDR_CHECK(ndr_push_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all));
1754                         break;
1755
1756                         case ALIASINFONAME:
1757                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1758                         break;
1759
1760                         case ALIASINFODESCRIPTION:
1761                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1762                         break;
1763
1764                         default:
1765                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1766                 }
1767         }
1768         return NDR_ERR_SUCCESS;
1769 }
1770
1771 static enum ndr_err_code ndr_pull_samr_AliasInfo(struct ndr_pull *ndr, int ndr_flags, union samr_AliasInfo *r)
1772 {
1773         int level;
1774         uint16_t _level;
1775         level = ndr_pull_get_switch_value(ndr, r);
1776         if (ndr_flags & NDR_SCALARS) {
1777                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1778                 if (_level != level) {
1779                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1780                 }
1781                 switch (level) {
1782                         case ALIASINFOALL: {
1783                                 NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_SCALARS, &r->all));
1784                         break; }
1785
1786                         case ALIASINFONAME: {
1787                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1788                         break; }
1789
1790                         case ALIASINFODESCRIPTION: {
1791                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1792                         break; }
1793
1794                         default:
1795                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1796                 }
1797         }
1798         if (ndr_flags & NDR_BUFFERS) {
1799                 switch (level) {
1800                         case ALIASINFOALL:
1801                                 NDR_CHECK(ndr_pull_samr_AliasInfoAll(ndr, NDR_BUFFERS, &r->all));
1802                         break;
1803
1804                         case ALIASINFONAME:
1805                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1806                         break;
1807
1808                         case ALIASINFODESCRIPTION:
1809                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1810                         break;
1811
1812                         default:
1813                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1814                 }
1815         }
1816         return NDR_ERR_SUCCESS;
1817 }
1818
1819 _PUBLIC_ void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r)
1820 {
1821         int level;
1822         level = ndr_print_get_switch_value(ndr, r);
1823         ndr_print_union(ndr, name, level, "samr_AliasInfo");
1824         switch (level) {
1825                 case ALIASINFOALL:
1826                         ndr_print_samr_AliasInfoAll(ndr, "all", &r->all);
1827                 break;
1828
1829                 case ALIASINFONAME:
1830                         ndr_print_lsa_String(ndr, "name", &r->name);
1831                 break;
1832
1833                 case ALIASINFODESCRIPTION:
1834                         ndr_print_lsa_String(ndr, "description", &r->description);
1835                 break;
1836
1837                 default:
1838                         ndr_print_bad_level(ndr, name, level);
1839         }
1840 }
1841
1842 static enum ndr_err_code ndr_push_samr_UserInfo1(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo1 *r)
1843 {
1844         if (ndr_flags & NDR_SCALARS) {
1845                 NDR_CHECK(ndr_push_align(ndr, 4));
1846                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1847                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1848                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
1849                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
1850                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
1851         }
1852         if (ndr_flags & NDR_BUFFERS) {
1853                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1854                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1855                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
1856                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
1857         }
1858         return NDR_ERR_SUCCESS;
1859 }
1860
1861 static enum ndr_err_code ndr_pull_samr_UserInfo1(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo1 *r)
1862 {
1863         if (ndr_flags & NDR_SCALARS) {
1864                 NDR_CHECK(ndr_pull_align(ndr, 4));
1865                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1866                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1867                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1868                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
1869                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
1870         }
1871         if (ndr_flags & NDR_BUFFERS) {
1872                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1873                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1874                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
1875                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
1876         }
1877         return NDR_ERR_SUCCESS;
1878 }
1879
1880 _PUBLIC_ void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r)
1881 {
1882         ndr_print_struct(ndr, name, "samr_UserInfo1");
1883         ndr->depth++;
1884         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
1885         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
1886         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
1887         ndr_print_lsa_String(ndr, "description", &r->description);
1888         ndr_print_lsa_String(ndr, "comment", &r->comment);
1889         ndr->depth--;
1890 }
1891
1892 static enum ndr_err_code ndr_push_samr_UserInfo2(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo2 *r)
1893 {
1894         if (ndr_flags & NDR_SCALARS) {
1895                 NDR_CHECK(ndr_push_align(ndr, 4));
1896                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
1897                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown));
1898                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
1899                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
1900         }
1901         if (ndr_flags & NDR_BUFFERS) {
1902                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
1903                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown));
1904         }
1905         return NDR_ERR_SUCCESS;
1906 }
1907
1908 static enum ndr_err_code ndr_pull_samr_UserInfo2(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo2 *r)
1909 {
1910         if (ndr_flags & NDR_SCALARS) {
1911                 NDR_CHECK(ndr_pull_align(ndr, 4));
1912                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
1913                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown));
1914                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
1915                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
1916         }
1917         if (ndr_flags & NDR_BUFFERS) {
1918                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
1919                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown));
1920         }
1921         return NDR_ERR_SUCCESS;
1922 }
1923
1924 _PUBLIC_ void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r)
1925 {
1926         ndr_print_struct(ndr, name, "samr_UserInfo2");
1927         ndr->depth++;
1928         ndr_print_lsa_String(ndr, "comment", &r->comment);
1929         ndr_print_lsa_String(ndr, "unknown", &r->unknown);
1930         ndr_print_uint16(ndr, "country_code", r->country_code);
1931         ndr_print_uint16(ndr, "code_page", r->code_page);
1932         ndr->depth--;
1933 }
1934
1935 _PUBLIC_ enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, int ndr_flags, const struct samr_LogonHours *r)
1936 {
1937         {
1938                 uint32_t _flags_save_STRUCT = ndr->flags;
1939                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1940                 if (ndr_flags & NDR_SCALARS) {
1941                         NDR_CHECK(ndr_push_align(ndr, 4));
1942                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->units_per_week));
1943                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->bits));
1944                 }
1945                 if (ndr_flags & NDR_BUFFERS) {
1946                         if (r->bits) {
1947                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1260));
1948                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1949                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->units_per_week / 8));
1950                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->bits, r->units_per_week / 8));
1951                         }
1952                 }
1953                 ndr->flags = _flags_save_STRUCT;
1954         }
1955         return NDR_ERR_SUCCESS;
1956 }
1957
1958 _PUBLIC_ enum ndr_err_code ndr_pull_samr_LogonHours(struct ndr_pull *ndr, int ndr_flags, struct samr_LogonHours *r)
1959 {
1960         uint32_t _ptr_bits;
1961         TALLOC_CTX *_mem_save_bits_0;
1962         {
1963                 uint32_t _flags_save_STRUCT = ndr->flags;
1964                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1965                 if (ndr_flags & NDR_SCALARS) {
1966                         NDR_CHECK(ndr_pull_align(ndr, 4));
1967                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->units_per_week));
1968                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bits));
1969                         if (_ptr_bits) {
1970                                 NDR_PULL_ALLOC(ndr, r->bits);
1971                         } else {
1972                                 r->bits = NULL;
1973                         }
1974                 }
1975                 if (ndr_flags & NDR_BUFFERS) {
1976                         if (r->bits) {
1977                                 _mem_save_bits_0 = NDR_PULL_GET_MEM_CTX(ndr);
1978                                 NDR_PULL_SET_MEM_CTX(ndr, r->bits, 0);
1979                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->bits));
1980                                 NDR_CHECK(ndr_pull_array_length(ndr, &r->bits));
1981                                 if (ndr_get_array_length(ndr, &r->bits) > ndr_get_array_size(ndr, &r->bits)) {
1982                                         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));
1983                                 }
1984                                 NDR_PULL_ALLOC_N(ndr, r->bits, ndr_get_array_size(ndr, &r->bits));
1985                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->bits, ndr_get_array_length(ndr, &r->bits)));
1986                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bits_0, 0);
1987                         }
1988                         if (r->bits) {
1989                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bits, 1260));
1990                         }
1991                         if (r->bits) {
1992                                 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bits, r->units_per_week / 8));
1993                         }
1994                 }
1995                 ndr->flags = _flags_save_STRUCT;
1996         }
1997         return NDR_ERR_SUCCESS;
1998 }
1999
2000 _PUBLIC_ void ndr_print_samr_LogonHours(struct ndr_print *ndr, const char *name, const struct samr_LogonHours *r)
2001 {
2002         ndr_print_struct(ndr, name, "samr_LogonHours");
2003         {
2004                 uint32_t _flags_save_STRUCT = ndr->flags;
2005                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2006                 ndr->depth++;
2007                 ndr_print_uint16(ndr, "units_per_week", r->units_per_week);
2008                 ndr_print_ptr(ndr, "bits", r->bits);
2009                 ndr->depth++;
2010                 if (r->bits) {
2011                         ndr_print_array_uint8(ndr, "bits", r->bits, r->units_per_week / 8);
2012                 }
2013                 ndr->depth--;
2014                 ndr->depth--;
2015                 ndr->flags = _flags_save_STRUCT;
2016         }
2017 }
2018
2019 static enum ndr_err_code ndr_push_samr_UserInfo3(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo3 *r)
2020 {
2021         if (ndr_flags & NDR_SCALARS) {
2022                 NDR_CHECK(ndr_push_align(ndr, 4));
2023                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2024                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2025                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2026                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2027                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2028                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2029                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2030                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2031                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2032                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2033                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2034                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2035                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
2036                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
2037                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2038                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2039                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2040                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2041         }
2042         if (ndr_flags & NDR_BUFFERS) {
2043                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2044                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2045                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2046                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2047                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2048                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2049                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2050                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2051         }
2052         return NDR_ERR_SUCCESS;
2053 }
2054
2055 static enum ndr_err_code ndr_pull_samr_UserInfo3(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo3 *r)
2056 {
2057         if (ndr_flags & NDR_SCALARS) {
2058                 NDR_CHECK(ndr_pull_align(ndr, 4));
2059                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2060                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2061                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2062                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2063                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2064                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2065                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2066                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2067                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2068                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2069                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2070                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2071                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
2072                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
2073                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2074                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2075                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2076                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2077         }
2078         if (ndr_flags & NDR_BUFFERS) {
2079                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2080                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2081                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2082                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2083                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2084                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2085                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2086                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2087         }
2088         return NDR_ERR_SUCCESS;
2089 }
2090
2091 _PUBLIC_ void ndr_print_samr_UserInfo3(struct ndr_print *ndr, const char *name, const struct samr_UserInfo3 *r)
2092 {
2093         ndr_print_struct(ndr, name, "samr_UserInfo3");
2094         ndr->depth++;
2095         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2096         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2097         ndr_print_uint32(ndr, "rid", r->rid);
2098         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2099         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2100         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2101         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2102         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2103         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2104         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2105         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2106         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2107         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
2108         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
2109         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2110         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2111         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2112         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2113         ndr->depth--;
2114 }
2115
2116 static enum ndr_err_code ndr_push_samr_UserInfo4(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo4 *r)
2117 {
2118         if (ndr_flags & NDR_SCALARS) {
2119                 NDR_CHECK(ndr_push_align(ndr, 4));
2120                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2121         }
2122         if (ndr_flags & NDR_BUFFERS) {
2123                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2124         }
2125         return NDR_ERR_SUCCESS;
2126 }
2127
2128 static enum ndr_err_code ndr_pull_samr_UserInfo4(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo4 *r)
2129 {
2130         if (ndr_flags & NDR_SCALARS) {
2131                 NDR_CHECK(ndr_pull_align(ndr, 4));
2132                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2133         }
2134         if (ndr_flags & NDR_BUFFERS) {
2135                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2136         }
2137         return NDR_ERR_SUCCESS;
2138 }
2139
2140 _PUBLIC_ void ndr_print_samr_UserInfo4(struct ndr_print *ndr, const char *name, const struct samr_UserInfo4 *r)
2141 {
2142         ndr_print_struct(ndr, name, "samr_UserInfo4");
2143         ndr->depth++;
2144         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2145         ndr->depth--;
2146 }
2147
2148 static enum ndr_err_code ndr_push_samr_UserInfo5(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo5 *r)
2149 {
2150         if (ndr_flags & NDR_SCALARS) {
2151                 NDR_CHECK(ndr_push_align(ndr, 4));
2152                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2153                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2154                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2155                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2156                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2157                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2158                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2159                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2160                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2161                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2162                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2163                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2164                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2165                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2166                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2167                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2168                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2169                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2170         }
2171         if (ndr_flags & NDR_BUFFERS) {
2172                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2173                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2174                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2175                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2176                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2177                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2178                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2179                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2180                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2181         }
2182         return NDR_ERR_SUCCESS;
2183 }
2184
2185 static enum ndr_err_code ndr_pull_samr_UserInfo5(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo5 *r)
2186 {
2187         if (ndr_flags & NDR_SCALARS) {
2188                 NDR_CHECK(ndr_pull_align(ndr, 4));
2189                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2190                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2191                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2192                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2193                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2194                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2195                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2196                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2197                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2198                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2199                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2200                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2201                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2202                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2203                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2204                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2205                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2206                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2207         }
2208         if (ndr_flags & NDR_BUFFERS) {
2209                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2210                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2211                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2212                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2213                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2214                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2215                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2216                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2217                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2218         }
2219         return NDR_ERR_SUCCESS;
2220 }
2221
2222 _PUBLIC_ void ndr_print_samr_UserInfo5(struct ndr_print *ndr, const char *name, const struct samr_UserInfo5 *r)
2223 {
2224         ndr_print_struct(ndr, name, "samr_UserInfo5");
2225         ndr->depth++;
2226         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2227         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2228         ndr_print_uint32(ndr, "rid", r->rid);
2229         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2230         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2231         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2232         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2233         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2234         ndr_print_lsa_String(ndr, "description", &r->description);
2235         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2236         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2237         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2238         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2239         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2240         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2241         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2242         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2243         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2244         ndr->depth--;
2245 }
2246
2247 static enum ndr_err_code ndr_push_samr_UserInfo6(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo6 *r)
2248 {
2249         if (ndr_flags & NDR_SCALARS) {
2250                 NDR_CHECK(ndr_push_align(ndr, 4));
2251                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2252                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2253         }
2254         if (ndr_flags & NDR_BUFFERS) {
2255                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2256                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2257         }
2258         return NDR_ERR_SUCCESS;
2259 }
2260
2261 static enum ndr_err_code ndr_pull_samr_UserInfo6(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo6 *r)
2262 {
2263         if (ndr_flags & NDR_SCALARS) {
2264                 NDR_CHECK(ndr_pull_align(ndr, 4));
2265                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2266                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2267         }
2268         if (ndr_flags & NDR_BUFFERS) {
2269                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2270                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2271         }
2272         return NDR_ERR_SUCCESS;
2273 }
2274
2275 _PUBLIC_ void ndr_print_samr_UserInfo6(struct ndr_print *ndr, const char *name, const struct samr_UserInfo6 *r)
2276 {
2277         ndr_print_struct(ndr, name, "samr_UserInfo6");
2278         ndr->depth++;
2279         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2280         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2281         ndr->depth--;
2282 }
2283
2284 static enum ndr_err_code ndr_push_samr_UserInfo7(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo7 *r)
2285 {
2286         if (ndr_flags & NDR_SCALARS) {
2287                 NDR_CHECK(ndr_push_align(ndr, 4));
2288                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2289         }
2290         if (ndr_flags & NDR_BUFFERS) {
2291                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2292         }
2293         return NDR_ERR_SUCCESS;
2294 }
2295
2296 static enum ndr_err_code ndr_pull_samr_UserInfo7(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo7 *r)
2297 {
2298         if (ndr_flags & NDR_SCALARS) {
2299                 NDR_CHECK(ndr_pull_align(ndr, 4));
2300                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2301         }
2302         if (ndr_flags & NDR_BUFFERS) {
2303                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2304         }
2305         return NDR_ERR_SUCCESS;
2306 }
2307
2308 _PUBLIC_ void ndr_print_samr_UserInfo7(struct ndr_print *ndr, const char *name, const struct samr_UserInfo7 *r)
2309 {
2310         ndr_print_struct(ndr, name, "samr_UserInfo7");
2311         ndr->depth++;
2312         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2313         ndr->depth--;
2314 }
2315
2316 static enum ndr_err_code ndr_push_samr_UserInfo8(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo8 *r)
2317 {
2318         if (ndr_flags & NDR_SCALARS) {
2319                 NDR_CHECK(ndr_push_align(ndr, 4));
2320                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2321         }
2322         if (ndr_flags & NDR_BUFFERS) {
2323                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2324         }
2325         return NDR_ERR_SUCCESS;
2326 }
2327
2328 static enum ndr_err_code ndr_pull_samr_UserInfo8(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo8 *r)
2329 {
2330         if (ndr_flags & NDR_SCALARS) {
2331                 NDR_CHECK(ndr_pull_align(ndr, 4));
2332                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2333         }
2334         if (ndr_flags & NDR_BUFFERS) {
2335                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2336         }
2337         return NDR_ERR_SUCCESS;
2338 }
2339
2340 _PUBLIC_ void ndr_print_samr_UserInfo8(struct ndr_print *ndr, const char *name, const struct samr_UserInfo8 *r)
2341 {
2342         ndr_print_struct(ndr, name, "samr_UserInfo8");
2343         ndr->depth++;
2344         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2345         ndr->depth--;
2346 }
2347
2348 static enum ndr_err_code ndr_push_samr_UserInfo9(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo9 *r)
2349 {
2350         if (ndr_flags & NDR_SCALARS) {
2351                 NDR_CHECK(ndr_push_align(ndr, 4));
2352                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2353         }
2354         if (ndr_flags & NDR_BUFFERS) {
2355         }
2356         return NDR_ERR_SUCCESS;
2357 }
2358
2359 static enum ndr_err_code ndr_pull_samr_UserInfo9(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo9 *r)
2360 {
2361         if (ndr_flags & NDR_SCALARS) {
2362                 NDR_CHECK(ndr_pull_align(ndr, 4));
2363                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2364         }
2365         if (ndr_flags & NDR_BUFFERS) {
2366         }
2367         return NDR_ERR_SUCCESS;
2368 }
2369
2370 _PUBLIC_ void ndr_print_samr_UserInfo9(struct ndr_print *ndr, const char *name, const struct samr_UserInfo9 *r)
2371 {
2372         ndr_print_struct(ndr, name, "samr_UserInfo9");
2373         ndr->depth++;
2374         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2375         ndr->depth--;
2376 }
2377
2378 static enum ndr_err_code ndr_push_samr_UserInfo10(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo10 *r)
2379 {
2380         if (ndr_flags & NDR_SCALARS) {
2381                 NDR_CHECK(ndr_push_align(ndr, 4));
2382                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2383                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2384         }
2385         if (ndr_flags & NDR_BUFFERS) {
2386                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2387                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2388         }
2389         return NDR_ERR_SUCCESS;
2390 }
2391
2392 static enum ndr_err_code ndr_pull_samr_UserInfo10(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo10 *r)
2393 {
2394         if (ndr_flags & NDR_SCALARS) {
2395                 NDR_CHECK(ndr_pull_align(ndr, 4));
2396                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2397                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2398         }
2399         if (ndr_flags & NDR_BUFFERS) {
2400                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2401                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2402         }
2403         return NDR_ERR_SUCCESS;
2404 }
2405
2406 _PUBLIC_ void ndr_print_samr_UserInfo10(struct ndr_print *ndr, const char *name, const struct samr_UserInfo10 *r)
2407 {
2408         ndr_print_struct(ndr, name, "samr_UserInfo10");
2409         ndr->depth++;
2410         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2411         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2412         ndr->depth--;
2413 }
2414
2415 static enum ndr_err_code ndr_push_samr_UserInfo11(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo11 *r)
2416 {
2417         if (ndr_flags & NDR_SCALARS) {
2418                 NDR_CHECK(ndr_push_align(ndr, 4));
2419                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2420         }
2421         if (ndr_flags & NDR_BUFFERS) {
2422                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2423         }
2424         return NDR_ERR_SUCCESS;
2425 }
2426
2427 static enum ndr_err_code ndr_pull_samr_UserInfo11(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo11 *r)
2428 {
2429         if (ndr_flags & NDR_SCALARS) {
2430                 NDR_CHECK(ndr_pull_align(ndr, 4));
2431                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2432         }
2433         if (ndr_flags & NDR_BUFFERS) {
2434                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2435         }
2436         return NDR_ERR_SUCCESS;
2437 }
2438
2439 _PUBLIC_ void ndr_print_samr_UserInfo11(struct ndr_print *ndr, const char *name, const struct samr_UserInfo11 *r)
2440 {
2441         ndr_print_struct(ndr, name, "samr_UserInfo11");
2442         ndr->depth++;
2443         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2444         ndr->depth--;
2445 }
2446
2447 static enum ndr_err_code ndr_push_samr_UserInfo12(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo12 *r)
2448 {
2449         if (ndr_flags & NDR_SCALARS) {
2450                 NDR_CHECK(ndr_push_align(ndr, 4));
2451                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2452         }
2453         if (ndr_flags & NDR_BUFFERS) {
2454                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2455         }
2456         return NDR_ERR_SUCCESS;
2457 }
2458
2459 static enum ndr_err_code ndr_pull_samr_UserInfo12(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo12 *r)
2460 {
2461         if (ndr_flags & NDR_SCALARS) {
2462                 NDR_CHECK(ndr_pull_align(ndr, 4));
2463                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2464         }
2465         if (ndr_flags & NDR_BUFFERS) {
2466                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2467         }
2468         return NDR_ERR_SUCCESS;
2469 }
2470
2471 _PUBLIC_ void ndr_print_samr_UserInfo12(struct ndr_print *ndr, const char *name, const struct samr_UserInfo12 *r)
2472 {
2473         ndr_print_struct(ndr, name, "samr_UserInfo12");
2474         ndr->depth++;
2475         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2476         ndr->depth--;
2477 }
2478
2479 static enum ndr_err_code ndr_push_samr_UserInfo13(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo13 *r)
2480 {
2481         if (ndr_flags & NDR_SCALARS) {
2482                 NDR_CHECK(ndr_push_align(ndr, 4));
2483                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2484         }
2485         if (ndr_flags & NDR_BUFFERS) {
2486                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2487         }
2488         return NDR_ERR_SUCCESS;
2489 }
2490
2491 static enum ndr_err_code ndr_pull_samr_UserInfo13(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo13 *r)
2492 {
2493         if (ndr_flags & NDR_SCALARS) {
2494                 NDR_CHECK(ndr_pull_align(ndr, 4));
2495                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2496         }
2497         if (ndr_flags & NDR_BUFFERS) {
2498                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2499         }
2500         return NDR_ERR_SUCCESS;
2501 }
2502
2503 _PUBLIC_ void ndr_print_samr_UserInfo13(struct ndr_print *ndr, const char *name, const struct samr_UserInfo13 *r)
2504 {
2505         ndr_print_struct(ndr, name, "samr_UserInfo13");
2506         ndr->depth++;
2507         ndr_print_lsa_String(ndr, "description", &r->description);
2508         ndr->depth--;
2509 }
2510
2511 static enum ndr_err_code ndr_push_samr_UserInfo14(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo14 *r)
2512 {
2513         if (ndr_flags & NDR_SCALARS) {
2514                 NDR_CHECK(ndr_push_align(ndr, 4));
2515                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2516         }
2517         if (ndr_flags & NDR_BUFFERS) {
2518                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2519         }
2520         return NDR_ERR_SUCCESS;
2521 }
2522
2523 static enum ndr_err_code ndr_pull_samr_UserInfo14(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo14 *r)
2524 {
2525         if (ndr_flags & NDR_SCALARS) {
2526                 NDR_CHECK(ndr_pull_align(ndr, 4));
2527                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2528         }
2529         if (ndr_flags & NDR_BUFFERS) {
2530                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2531         }
2532         return NDR_ERR_SUCCESS;
2533 }
2534
2535 _PUBLIC_ void ndr_print_samr_UserInfo14(struct ndr_print *ndr, const char *name, const struct samr_UserInfo14 *r)
2536 {
2537         ndr_print_struct(ndr, name, "samr_UserInfo14");
2538         ndr->depth++;
2539         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2540         ndr->depth--;
2541 }
2542
2543 static enum ndr_err_code ndr_push_samr_UserInfo16(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo16 *r)
2544 {
2545         if (ndr_flags & NDR_SCALARS) {
2546                 NDR_CHECK(ndr_push_align(ndr, 4));
2547                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2548         }
2549         if (ndr_flags & NDR_BUFFERS) {
2550         }
2551         return NDR_ERR_SUCCESS;
2552 }
2553
2554 static enum ndr_err_code ndr_pull_samr_UserInfo16(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo16 *r)
2555 {
2556         if (ndr_flags & NDR_SCALARS) {
2557                 NDR_CHECK(ndr_pull_align(ndr, 4));
2558                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2559         }
2560         if (ndr_flags & NDR_BUFFERS) {
2561         }
2562         return NDR_ERR_SUCCESS;
2563 }
2564
2565 _PUBLIC_ void ndr_print_samr_UserInfo16(struct ndr_print *ndr, const char *name, const struct samr_UserInfo16 *r)
2566 {
2567         ndr_print_struct(ndr, name, "samr_UserInfo16");
2568         ndr->depth++;
2569         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2570         ndr->depth--;
2571 }
2572
2573 static enum ndr_err_code ndr_push_samr_UserInfo17(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo17 *r)
2574 {
2575         if (ndr_flags & NDR_SCALARS) {
2576                 NDR_CHECK(ndr_push_align(ndr, 4));
2577                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2578         }
2579         if (ndr_flags & NDR_BUFFERS) {
2580         }
2581         return NDR_ERR_SUCCESS;
2582 }
2583
2584 static enum ndr_err_code ndr_pull_samr_UserInfo17(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo17 *r)
2585 {
2586         if (ndr_flags & NDR_SCALARS) {
2587                 NDR_CHECK(ndr_pull_align(ndr, 4));
2588                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2589         }
2590         if (ndr_flags & NDR_BUFFERS) {
2591         }
2592         return NDR_ERR_SUCCESS;
2593 }
2594
2595 _PUBLIC_ void ndr_print_samr_UserInfo17(struct ndr_print *ndr, const char *name, const struct samr_UserInfo17 *r)
2596 {
2597         ndr_print_struct(ndr, name, "samr_UserInfo17");
2598         ndr->depth++;
2599         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2600         ndr->depth--;
2601 }
2602
2603 _PUBLIC_ enum ndr_err_code ndr_push_samr_Password(struct ndr_push *ndr, int ndr_flags, const struct samr_Password *r)
2604 {
2605         {
2606                 uint32_t _flags_save_STRUCT = ndr->flags;
2607                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2608                 if (ndr_flags & NDR_SCALARS) {
2609                         NDR_CHECK(ndr_push_align(ndr, 1));
2610                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
2611                 }
2612                 if (ndr_flags & NDR_BUFFERS) {
2613                 }
2614                 ndr->flags = _flags_save_STRUCT;
2615         }
2616         return NDR_ERR_SUCCESS;
2617 }
2618
2619 _PUBLIC_ enum ndr_err_code ndr_pull_samr_Password(struct ndr_pull *ndr, int ndr_flags, struct samr_Password *r)
2620 {
2621         {
2622                 uint32_t _flags_save_STRUCT = ndr->flags;
2623                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2624                 if (ndr_flags & NDR_SCALARS) {
2625                         NDR_CHECK(ndr_pull_align(ndr, 1));
2626                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->hash, 16));
2627                 }
2628                 if (ndr_flags & NDR_BUFFERS) {
2629                 }
2630                 ndr->flags = _flags_save_STRUCT;
2631         }
2632         return NDR_ERR_SUCCESS;
2633 }
2634
2635 _PUBLIC_ void ndr_print_samr_Password(struct ndr_print *ndr, const char *name, const struct samr_Password *r)
2636 {
2637         ndr_print_struct(ndr, name, "samr_Password");
2638         {
2639                 uint32_t _flags_save_STRUCT = ndr->flags;
2640                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2641                 ndr->depth++;
2642                 ndr_print_array_uint8(ndr, "hash", r->hash, 16);
2643                 ndr->depth--;
2644                 ndr->flags = _flags_save_STRUCT;
2645         }
2646 }
2647
2648 static enum ndr_err_code ndr_push_samr_UserInfo18(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo18 *r)
2649 {
2650         if (ndr_flags & NDR_SCALARS) {
2651                 NDR_CHECK(ndr_push_align(ndr, 1));
2652                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
2653                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
2654                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_pwd_active));
2655                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_pwd_active));
2656                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2657         }
2658         if (ndr_flags & NDR_BUFFERS) {
2659         }
2660         return NDR_ERR_SUCCESS;
2661 }
2662
2663 static enum ndr_err_code ndr_pull_samr_UserInfo18(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo18 *r)
2664 {
2665         if (ndr_flags & NDR_SCALARS) {
2666                 NDR_CHECK(ndr_pull_align(ndr, 1));
2667                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->nt_pwd));
2668                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lm_pwd));
2669                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_pwd_active));
2670                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_pwd_active));
2671                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2672         }
2673         if (ndr_flags & NDR_BUFFERS) {
2674         }
2675         return NDR_ERR_SUCCESS;
2676 }
2677
2678 _PUBLIC_ void ndr_print_samr_UserInfo18(struct ndr_print *ndr, const char *name, const struct samr_UserInfo18 *r)
2679 {
2680         ndr_print_struct(ndr, name, "samr_UserInfo18");
2681         ndr->depth++;
2682         ndr_print_samr_Password(ndr, "nt_pwd", &r->nt_pwd);
2683         ndr_print_samr_Password(ndr, "lm_pwd", &r->lm_pwd);
2684         ndr_print_uint8(ndr, "nt_pwd_active", r->nt_pwd_active);
2685         ndr_print_uint8(ndr, "lm_pwd_active", r->lm_pwd_active);
2686         ndr_print_uint8(ndr, "password_expired", r->password_expired);
2687         ndr->depth--;
2688 }
2689
2690 static enum ndr_err_code ndr_push_samr_UserInfo20(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo20 *r)
2691 {
2692         if (ndr_flags & NDR_SCALARS) {
2693                 NDR_CHECK(ndr_push_align(ndr, 4));
2694                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2695         }
2696         if (ndr_flags & NDR_BUFFERS) {
2697                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2698         }
2699         return NDR_ERR_SUCCESS;
2700 }
2701
2702 static enum ndr_err_code ndr_pull_samr_UserInfo20(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo20 *r)
2703 {
2704         if (ndr_flags & NDR_SCALARS) {
2705                 NDR_CHECK(ndr_pull_align(ndr, 4));
2706                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2707         }
2708         if (ndr_flags & NDR_BUFFERS) {
2709                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2710         }
2711         return NDR_ERR_SUCCESS;
2712 }
2713
2714 _PUBLIC_ void ndr_print_samr_UserInfo20(struct ndr_print *ndr, const char *name, const struct samr_UserInfo20 *r)
2715 {
2716         ndr_print_struct(ndr, name, "samr_UserInfo20");
2717         ndr->depth++;
2718         ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2719         ndr->depth--;
2720 }
2721
2722 static enum ndr_err_code ndr_push_samr_FieldsPresent(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2723 {
2724         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2725         return NDR_ERR_SUCCESS;
2726 }
2727
2728 static enum ndr_err_code ndr_pull_samr_FieldsPresent(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2729 {
2730         uint32_t v;
2731         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2732         *r = v;
2733         return NDR_ERR_SUCCESS;
2734 }
2735
2736 _PUBLIC_ void ndr_print_samr_FieldsPresent(struct ndr_print *ndr, const char *name, uint32_t r)
2737 {
2738         ndr_print_uint32(ndr, name, r);
2739         ndr->depth++;
2740         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCOUNT_NAME", SAMR_FIELD_ACCOUNT_NAME, r);
2741         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FULL_NAME", SAMR_FIELD_FULL_NAME, r);
2742         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_RID", SAMR_FIELD_RID, r);
2743         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIMARY_GID", SAMR_FIELD_PRIMARY_GID, r);
2744         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_DESCRIPTION", SAMR_FIELD_DESCRIPTION, r);
2745         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COMMENT", SAMR_FIELD_COMMENT, r);
2746         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DIRECTORY", SAMR_FIELD_HOME_DIRECTORY, r);
2747         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_HOME_DRIVE", SAMR_FIELD_HOME_DRIVE, r);
2748         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_SCRIPT", SAMR_FIELD_LOGON_SCRIPT, r);
2749         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PROFILE_PATH", SAMR_FIELD_PROFILE_PATH, r);
2750         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_WORKSTATIONS", SAMR_FIELD_WORKSTATIONS, r);
2751         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGON", SAMR_FIELD_LAST_LOGON, r);
2752         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_LOGOFF", SAMR_FIELD_LAST_LOGOFF, r);
2753         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LOGON_HOURS", SAMR_FIELD_LOGON_HOURS, r);
2754         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_BAD_PWD_COUNT", SAMR_FIELD_BAD_PWD_COUNT, r);
2755         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NUM_LOGONS", SAMR_FIELD_NUM_LOGONS, r);
2756         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ALLOW_PWD_CHANGE", SAMR_FIELD_ALLOW_PWD_CHANGE, r);
2757         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_FORCE_PWD_CHANGE", SAMR_FIELD_FORCE_PWD_CHANGE, r);
2758         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LAST_PWD_CHANGE", SAMR_FIELD_LAST_PWD_CHANGE, r);
2759         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_EXPIRY", SAMR_FIELD_ACCT_EXPIRY, r);
2760         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_ACCT_FLAGS", SAMR_FIELD_ACCT_FLAGS, r);
2761         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PARAMETERS", SAMR_FIELD_PARAMETERS, r);
2762         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_COUNTRY_CODE", SAMR_FIELD_COUNTRY_CODE, r);
2763         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_CODE_PAGE", SAMR_FIELD_CODE_PAGE, r);
2764         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_NT_PASSWORD_PRESENT", SAMR_FIELD_NT_PASSWORD_PRESENT, r);
2765         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_LM_PASSWORD_PRESENT", SAMR_FIELD_LM_PASSWORD_PRESENT, r);
2766         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_PRIVATE_DATA", SAMR_FIELD_PRIVATE_DATA, r);
2767         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_EXPIRED_FLAG", SAMR_FIELD_EXPIRED_FLAG, r);
2768         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_SEC_DESC", SAMR_FIELD_SEC_DESC, r);
2769         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SAMR_FIELD_OWF_PWD", SAMR_FIELD_OWF_PWD, r);
2770         ndr->depth--;
2771 }
2772
2773 static enum ndr_err_code ndr_push_samr_UserInfo21(struct ndr_push *ndr, int ndr_flags, const struct samr_UserInfo21 *r)
2774 {
2775         if (ndr_flags & NDR_SCALARS) {
2776                 NDR_CHECK(ndr_push_align(ndr, 4));
2777                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2778                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2779                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2780                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2781                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
2782                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
2783                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2784                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2785                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2786                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2787                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2788                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2789                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2790                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2791                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2792                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2793                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password));
2794                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password));
2795                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2796                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count));
2797                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->buffer));
2798                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2799                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2800                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2801                 NDR_CHECK(ndr_push_samr_FieldsPresent(ndr, NDR_SCALARS, r->fields_present));
2802                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2803                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2804                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2805                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2806                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2807                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_set));
2808                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_set));
2809                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2810                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->unknown4));
2811         }
2812         if (ndr_flags & NDR_BUFFERS) {
2813                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2814                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2815                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2816                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2817                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2818                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2819                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2820                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2821                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2822                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2823                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password));
2824                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password));
2825                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2826                 if (r->buffer) {
2827                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->buf_count));
2828                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->buffer, r->buf_count));
2829                 }
2830                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2831         }
2832         return NDR_ERR_SUCCESS;
2833 }
2834
2835 static enum ndr_err_code ndr_pull_samr_UserInfo21(struct ndr_pull *ndr, int ndr_flags, struct samr_UserInfo21 *r)
2836 {
2837         uint32_t _ptr_buffer;
2838         TALLOC_CTX *_mem_save_buffer_0;
2839         if (ndr_flags & NDR_SCALARS) {
2840                 NDR_CHECK(ndr_pull_align(ndr, 4));
2841                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2842                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2843                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2844                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2845                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
2846                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
2847                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2848                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2849                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2850                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2851                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2852                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2853                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2854                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2855                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2856                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2857                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->lm_owf_password));
2858                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->nt_owf_password));
2859                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2860                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->buf_count));
2861                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
2862                 if (_ptr_buffer) {
2863                         NDR_PULL_ALLOC(ndr, r->buffer);
2864                 } else {
2865                         r->buffer = NULL;
2866                 }
2867                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2868                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2869                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2870                 NDR_CHECK(ndr_pull_samr_FieldsPresent(ndr, NDR_SCALARS, &r->fields_present));
2871                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2872                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2873                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2874                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2875                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2876                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_set));
2877                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_set));
2878                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2879                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->unknown4));
2880         }
2881         if (ndr_flags & NDR_BUFFERS) {
2882                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2883                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2884                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2885                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2886                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2887                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2888                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2889                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2890                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2891                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2892                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->lm_owf_password));
2893                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->nt_owf_password));
2894                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2895                 if (r->buffer) {
2896                         _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
2897                         NDR_PULL_SET_MEM_CTX(ndr, r->buffer, 0);
2898                         NDR_CHECK(ndr_pull_array_size(ndr, &r->buffer));
2899                         NDR_PULL_ALLOC_N(ndr, r->buffer, ndr_get_array_size(ndr, &r->buffer));
2900                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->buffer, ndr_get_array_size(ndr, &r->buffer)));
2901                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
2902                 }
2903                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2904                 if (r->buffer) {
2905                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->buffer, r->buf_count));
2906                 }
2907         }
2908         return NDR_ERR_SUCCESS;
2909 }
2910
2911 _PUBLIC_ void ndr_print_samr_UserInfo21(struct ndr_print *ndr, const char *name, const struct samr_UserInfo21 *r)
2912 {
2913         ndr_print_struct(ndr, name, "samr_UserInfo21");
2914         ndr->depth++;
2915         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2916         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2917         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2918         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2919         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
2920         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
2921         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2922         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2923         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2924         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2925         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2926         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2927         ndr_print_lsa_String(ndr, "description", &r->description);
2928         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2929         ndr_print_lsa_String(ndr, "comment", &r->comment);
2930         ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2931         ndr_print_lsa_BinaryString(ndr, "lm_owf_password", &r->lm_owf_password);
2932         ndr_print_lsa_BinaryString(ndr, "nt_owf_password", &r->nt_owf_password);
2933         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2934         ndr_print_uint32(ndr, "buf_count", r->buf_count);
2935         ndr_print_ptr(ndr, "buffer", r->buffer);
2936         ndr->depth++;
2937         if (r->buffer) {
2938                 ndr_print_array_uint8(ndr, "buffer", r->buffer, r->buf_count);
2939         }
2940         ndr->depth--;
2941         ndr_print_uint32(ndr, "rid", r->rid);
2942         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2943         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2944         ndr_print_samr_FieldsPresent(ndr, "fields_present", r->fields_present);
2945         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2946         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2947         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2948         ndr_print_uint16(ndr, "country_code", r->country_code);
2949         ndr_print_uint16(ndr, "code_page", r->code_page);
2950         ndr_print_uint8(ndr, "lm_password_set", r->lm_password_set);
2951         ndr_print_uint8(ndr, "nt_password_set", r->nt_password_set);
2952         ndr_print_uint8(ndr, "password_expired", r->password_expired);
2953         ndr_print_uint8(ndr, "unknown4", r->unknown4);
2954         ndr->depth--;
2955 }
2956
2957 _PUBLIC_ enum ndr_err_code ndr_push_samr_CryptPassword(struct ndr_push *ndr, int ndr_flags, const struct samr_CryptPassword *r)
2958 {
2959         {
2960                 uint32_t _flags_save_STRUCT = ndr->flags;
2961                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2962                 if (ndr_flags & NDR_SCALARS) {
2963                         NDR_CHECK(ndr_push_align(ndr, 1));
2964                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 516));
2965                 }
2966                 if (ndr_flags & NDR_BUFFERS) {
2967                 }
2968                 ndr->flags = _flags_save_STRUCT;
2969         }
2970         return NDR_ERR_SUCCESS;
2971 }
2972
2973 _PUBLIC_ enum ndr_err_code ndr_pull_samr_CryptPassword(struct ndr_pull *ndr, int ndr_flags, struct samr_CryptPassword *r)
2974 {
2975         {
2976                 uint32_t _flags_save_STRUCT = ndr->flags;
2977                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2978                 if (ndr_flags & NDR_SCALARS) {
2979                         NDR_CHECK(ndr_pull_align(ndr, 1));
2980                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 516));
2981                 }
2982                 if (ndr_flags & NDR_BUFFERS) {
2983                 }
2984                 ndr->flags = _flags_save_STRUCT;
2985         }
2986         return NDR_ERR_SUCCESS;
2987 }