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