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