Re-run make idl.
[ira/wip.git] / source3 / librpc / gen_ndr / ndr_netlogon.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_netlogon.h"
5
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 #include "librpc/gen_ndr/ndr_samr.h"
8 #include "librpc/gen_ndr/ndr_security.h"
9 static enum ndr_err_code ndr_push_netr_UasInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasInfo *r)
10 {
11         if (ndr_flags & NDR_SCALARS) {
12                 NDR_CHECK(ndr_push_align(ndr, 4));
13                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
14                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priv));
15                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_flags));
16                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_count));
17                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bad_pw_count));
18                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logon));
19                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->last_logoff));
20                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->logoff_time));
21                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->kickoff_time));
22                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->password_age));
23                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_can_change));
24                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->pw_must_change));
25                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->computer));
26                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain));
27                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->script_path));
28                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
29         }
30         if (ndr_flags & NDR_BUFFERS) {
31                 if (r->account_name) {
32                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
33                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
34                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
35                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
36                 }
37                 if (r->computer) {
38                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16)));
39                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
40                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->computer, CH_UTF16)));
41                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->computer, ndr_charset_length(r->computer, CH_UTF16), sizeof(uint16_t), CH_UTF16));
42                 }
43                 if (r->domain) {
44                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
45                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
46                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->domain, CH_UTF16)));
47                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain, ndr_charset_length(r->domain, CH_UTF16), sizeof(uint16_t), CH_UTF16));
48                 }
49                 if (r->script_path) {
50                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16)));
51                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
52                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->script_path, CH_UTF16)));
53                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->script_path, ndr_charset_length(r->script_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
54                 }
55         }
56         return NDR_ERR_SUCCESS;
57 }
58
59 static enum ndr_err_code ndr_pull_netr_UasInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasInfo *r)
60 {
61         uint32_t _ptr_account_name;
62         TALLOC_CTX *_mem_save_account_name_0;
63         uint32_t _ptr_computer;
64         TALLOC_CTX *_mem_save_computer_0;
65         uint32_t _ptr_domain;
66         TALLOC_CTX *_mem_save_domain_0;
67         uint32_t _ptr_script_path;
68         TALLOC_CTX *_mem_save_script_path_0;
69         if (ndr_flags & NDR_SCALARS) {
70                 NDR_CHECK(ndr_pull_align(ndr, 4));
71                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
72                 if (_ptr_account_name) {
73                         NDR_PULL_ALLOC(ndr, r->account_name);
74                 } else {
75                         r->account_name = NULL;
76                 }
77                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priv));
78                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_flags));
79                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_count));
80                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bad_pw_count));
81                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logon));
82                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->last_logoff));
83                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->logoff_time));
84                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->kickoff_time));
85                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->password_age));
86                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_can_change));
87                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->pw_must_change));
88                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_computer));
89                 if (_ptr_computer) {
90                         NDR_PULL_ALLOC(ndr, r->computer);
91                 } else {
92                         r->computer = NULL;
93                 }
94                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
95                 if (_ptr_domain) {
96                         NDR_PULL_ALLOC(ndr, r->domain);
97                 } else {
98                         r->domain = NULL;
99                 }
100                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_script_path));
101                 if (_ptr_script_path) {
102                         NDR_PULL_ALLOC(ndr, r->script_path);
103                 } else {
104                         r->script_path = NULL;
105                 }
106                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
107         }
108         if (ndr_flags & NDR_BUFFERS) {
109                 if (r->account_name) {
110                         _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
111                         NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
112                         NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
113                         NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
114                         if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
115                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name));
116                         }
117                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t)));
118                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16));
119                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
120                 }
121                 if (r->computer) {
122                         _mem_save_computer_0 = NDR_PULL_GET_MEM_CTX(ndr);
123                         NDR_PULL_SET_MEM_CTX(ndr, r->computer, 0);
124                         NDR_CHECK(ndr_pull_array_size(ndr, &r->computer));
125                         NDR_CHECK(ndr_pull_array_length(ndr, &r->computer));
126                         if (ndr_get_array_length(ndr, &r->computer) > ndr_get_array_size(ndr, &r->computer)) {
127                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->computer), ndr_get_array_length(ndr, &r->computer));
128                         }
129                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t)));
130                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->computer, ndr_get_array_length(ndr, &r->computer), sizeof(uint16_t), CH_UTF16));
131                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_computer_0, 0);
132                 }
133                 if (r->domain) {
134                         _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
135                         NDR_PULL_SET_MEM_CTX(ndr, r->domain, 0);
136                         NDR_CHECK(ndr_pull_array_size(ndr, &r->domain));
137                         NDR_CHECK(ndr_pull_array_length(ndr, &r->domain));
138                         if (ndr_get_array_length(ndr, &r->domain) > ndr_get_array_size(ndr, &r->domain)) {
139                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->domain), ndr_get_array_length(ndr, &r->domain));
140                         }
141                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t)));
142                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain, ndr_get_array_length(ndr, &r->domain), sizeof(uint16_t), CH_UTF16));
143                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, 0);
144                 }
145                 if (r->script_path) {
146                         _mem_save_script_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
147                         NDR_PULL_SET_MEM_CTX(ndr, r->script_path, 0);
148                         NDR_CHECK(ndr_pull_array_size(ndr, &r->script_path));
149                         NDR_CHECK(ndr_pull_array_length(ndr, &r->script_path));
150                         if (ndr_get_array_length(ndr, &r->script_path) > ndr_get_array_size(ndr, &r->script_path)) {
151                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->script_path), ndr_get_array_length(ndr, &r->script_path));
152                         }
153                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t)));
154                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->script_path, ndr_get_array_length(ndr, &r->script_path), sizeof(uint16_t), CH_UTF16));
155                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_script_path_0, 0);
156                 }
157         }
158         return NDR_ERR_SUCCESS;
159 }
160
161 _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r)
162 {
163         ndr_print_struct(ndr, name, "netr_UasInfo");
164         ndr->depth++;
165         ndr_print_ptr(ndr, "account_name", r->account_name);
166         ndr->depth++;
167         if (r->account_name) {
168                 ndr_print_string(ndr, "account_name", r->account_name);
169         }
170         ndr->depth--;
171         ndr_print_uint32(ndr, "priv", r->priv);
172         ndr_print_uint32(ndr, "auth_flags", r->auth_flags);
173         ndr_print_uint32(ndr, "logon_count", r->logon_count);
174         ndr_print_uint32(ndr, "bad_pw_count", r->bad_pw_count);
175         ndr_print_time_t(ndr, "last_logon", r->last_logon);
176         ndr_print_time_t(ndr, "last_logoff", r->last_logoff);
177         ndr_print_time_t(ndr, "logoff_time", r->logoff_time);
178         ndr_print_time_t(ndr, "kickoff_time", r->kickoff_time);
179         ndr_print_uint32(ndr, "password_age", r->password_age);
180         ndr_print_time_t(ndr, "pw_can_change", r->pw_can_change);
181         ndr_print_time_t(ndr, "pw_must_change", r->pw_must_change);
182         ndr_print_ptr(ndr, "computer", r->computer);
183         ndr->depth++;
184         if (r->computer) {
185                 ndr_print_string(ndr, "computer", r->computer);
186         }
187         ndr->depth--;
188         ndr_print_ptr(ndr, "domain", r->domain);
189         ndr->depth++;
190         if (r->domain) {
191                 ndr_print_string(ndr, "domain", r->domain);
192         }
193         ndr->depth--;
194         ndr_print_ptr(ndr, "script_path", r->script_path);
195         ndr->depth++;
196         if (r->script_path) {
197                 ndr_print_string(ndr, "script_path", r->script_path);
198         }
199         ndr->depth--;
200         ndr_print_uint32(ndr, "unknown", r->unknown);
201         ndr->depth--;
202 }
203
204 static enum ndr_err_code ndr_push_netr_UasLogoffInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_UasLogoffInfo *r)
205 {
206         if (ndr_flags & NDR_SCALARS) {
207                 NDR_CHECK(ndr_push_align(ndr, 4));
208                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->duration));
209                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
210         }
211         if (ndr_flags & NDR_BUFFERS) {
212         }
213         return NDR_ERR_SUCCESS;
214 }
215
216 static enum ndr_err_code ndr_pull_netr_UasLogoffInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_UasLogoffInfo *r)
217 {
218         if (ndr_flags & NDR_SCALARS) {
219                 NDR_CHECK(ndr_pull_align(ndr, 4));
220                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->duration));
221                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
222         }
223         if (ndr_flags & NDR_BUFFERS) {
224         }
225         return NDR_ERR_SUCCESS;
226 }
227
228 _PUBLIC_ void ndr_print_netr_UasLogoffInfo(struct ndr_print *ndr, const char *name, const struct netr_UasLogoffInfo *r)
229 {
230         ndr_print_struct(ndr, name, "netr_UasLogoffInfo");
231         ndr->depth++;
232         ndr_print_uint32(ndr, "duration", r->duration);
233         ndr_print_uint16(ndr, "logon_count", r->logon_count);
234         ndr->depth--;
235 }
236
237 static enum ndr_err_code ndr_push_netr_AcctLockStr(struct ndr_push *ndr, int ndr_flags, const struct netr_AcctLockStr *r)
238 {
239         uint32_t cntr_bindata_1;
240         if (ndr_flags & NDR_SCALARS) {
241                 NDR_CHECK(ndr_push_align(ndr, 4));
242                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
243                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
244                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->bindata));
245         }
246         if (ndr_flags & NDR_BUFFERS) {
247                 if (r->bindata) {
248                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2));
249                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
250                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2));
251                         for (cntr_bindata_1 = 0; cntr_bindata_1 < r->length / 2; cntr_bindata_1++) {
252                                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bindata[cntr_bindata_1]));
253                         }
254                 }
255         }
256         return NDR_ERR_SUCCESS;
257 }
258
259 static enum ndr_err_code ndr_pull_netr_AcctLockStr(struct ndr_pull *ndr, int ndr_flags, struct netr_AcctLockStr *r)
260 {
261         uint32_t _ptr_bindata;
262         uint32_t cntr_bindata_1;
263         TALLOC_CTX *_mem_save_bindata_0;
264         TALLOC_CTX *_mem_save_bindata_1;
265         if (ndr_flags & NDR_SCALARS) {
266                 NDR_CHECK(ndr_pull_align(ndr, 4));
267                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
268                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
269                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_bindata));
270                 if (_ptr_bindata) {
271                         NDR_PULL_ALLOC(ndr, r->bindata);
272                 } else {
273                         r->bindata = NULL;
274                 }
275         }
276         if (ndr_flags & NDR_BUFFERS) {
277                 if (r->bindata) {
278                         _mem_save_bindata_0 = NDR_PULL_GET_MEM_CTX(ndr);
279                         NDR_PULL_SET_MEM_CTX(ndr, r->bindata, 0);
280                         NDR_CHECK(ndr_pull_array_size(ndr, &r->bindata));
281                         NDR_CHECK(ndr_pull_array_length(ndr, &r->bindata));
282                         if (ndr_get_array_length(ndr, &r->bindata) > ndr_get_array_size(ndr, &r->bindata)) {
283                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->bindata), ndr_get_array_length(ndr, &r->bindata));
284                         }
285                         NDR_PULL_ALLOC_N(ndr, r->bindata, ndr_get_array_size(ndr, &r->bindata));
286                         _mem_save_bindata_1 = NDR_PULL_GET_MEM_CTX(ndr);
287                         NDR_PULL_SET_MEM_CTX(ndr, r->bindata, 0);
288                         for (cntr_bindata_1 = 0; cntr_bindata_1 < r->length / 2; cntr_bindata_1++) {
289                                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bindata[cntr_bindata_1]));
290                         }
291                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bindata_1, 0);
292                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_bindata_0, 0);
293                 }
294                 if (r->bindata) {
295                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->bindata, r->size / 2));
296                 }
297                 if (r->bindata) {
298                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->bindata, r->length / 2));
299                 }
300         }
301         return NDR_ERR_SUCCESS;
302 }
303
304 _PUBLIC_ void ndr_print_netr_AcctLockStr(struct ndr_print *ndr, const char *name, const struct netr_AcctLockStr *r)
305 {
306         uint32_t cntr_bindata_1;
307         ndr_print_struct(ndr, name, "netr_AcctLockStr");
308         ndr->depth++;
309         ndr_print_uint16(ndr, "size", r->size);
310         ndr_print_uint16(ndr, "length", r->length);
311         ndr_print_ptr(ndr, "bindata", r->bindata);
312         ndr->depth++;
313         if (r->bindata) {
314                 ndr->print(ndr, "%s: ARRAY(%d)", "bindata", r->length / 2);
315                 ndr->depth++;
316                 for (cntr_bindata_1=0;cntr_bindata_1<r->length / 2;cntr_bindata_1++) {
317                         char *idx_1=NULL;
318                         if (asprintf(&idx_1, "[%d]", cntr_bindata_1) != -1) {
319                                 ndr_print_uint16(ndr, "bindata", r->bindata[cntr_bindata_1]);
320                                 free(idx_1);
321                         }
322                 }
323                 ndr->depth--;
324         }
325         ndr->depth--;
326         ndr->depth--;
327 }
328
329 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonParameterControl(struct ndr_push *ndr, int ndr_flags, uint32_t r)
330 {
331         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
332         return NDR_ERR_SUCCESS;
333 }
334
335 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonParameterControl(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
336 {
337         uint32_t v;
338         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
339         *r = v;
340         return NDR_ERR_SUCCESS;
341 }
342
343 _PUBLIC_ void ndr_print_netr_LogonParameterControl(struct ndr_print *ndr, const char *name, uint32_t r)
344 {
345         ndr_print_uint32(ndr, name, r);
346         ndr->depth++;
347         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_ALLOWED", MSV1_0_CLEARTEXT_PASSWORD_ALLOWED, r);
348         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_UPDATE_LOGON_STATISTICS", MSV1_0_UPDATE_LOGON_STATISTICS, r);
349         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_USER_PARAMETERS", MSV1_0_RETURN_USER_PARAMETERS, r);
350         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r);
351         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r);
352         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r);
353         ndr->depth--;
354 }
355
356 static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
357 {
358         if (ndr_flags & NDR_SCALARS) {
359                 NDR_CHECK(ndr_push_align(ndr, 4));
360                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
361                 NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control));
362                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low));
363                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high));
364                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
365                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation));
366         }
367         if (ndr_flags & NDR_BUFFERS) {
368                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
369                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
370                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
371         }
372         return NDR_ERR_SUCCESS;
373 }
374
375 static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
376 {
377         if (ndr_flags & NDR_SCALARS) {
378                 NDR_CHECK(ndr_pull_align(ndr, 4));
379                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
380                 NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control));
381                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low));
382                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high));
383                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
384                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation));
385         }
386         if (ndr_flags & NDR_BUFFERS) {
387                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
388                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
389                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
390         }
391         return NDR_ERR_SUCCESS;
392 }
393
394 _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r)
395 {
396         ndr_print_struct(ndr, name, "netr_IdentityInfo");
397         ndr->depth++;
398         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
399         ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control);
400         ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low);
401         ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high);
402         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
403         ndr_print_lsa_String(ndr, "workstation", &r->workstation);
404         ndr->depth--;
405 }
406
407 static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
408 {
409         if (ndr_flags & NDR_SCALARS) {
410                 NDR_CHECK(ndr_push_align(ndr, 4));
411                 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
412                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
413                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
414         }
415         if (ndr_flags & NDR_BUFFERS) {
416                 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
417                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
418                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
419         }
420         return NDR_ERR_SUCCESS;
421 }
422
423 static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
424 {
425         if (ndr_flags & NDR_SCALARS) {
426                 NDR_CHECK(ndr_pull_align(ndr, 4));
427                 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
428                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
429                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
430         }
431         if (ndr_flags & NDR_BUFFERS) {
432                 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
433                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
434                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
435         }
436         return NDR_ERR_SUCCESS;
437 }
438
439 _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r)
440 {
441         ndr_print_struct(ndr, name, "netr_PasswordInfo");
442         ndr->depth++;
443         ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
444         ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
445         ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
446         ndr->depth--;
447 }
448
449 static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
450 {
451         {
452                 uint32_t _flags_save_STRUCT = ndr->flags;
453                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
454                 if (ndr_flags & NDR_SCALARS) {
455                         NDR_CHECK(ndr_push_align(ndr, 4));
456                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
457                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
458                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
459                 }
460                 if (ndr_flags & NDR_BUFFERS) {
461                         if (r->data) {
462                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
463                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
464                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
465                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
466                         }
467                 }
468                 ndr->flags = _flags_save_STRUCT;
469         }
470         return NDR_ERR_SUCCESS;
471 }
472
473 static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
474 {
475         uint32_t _ptr_data;
476         TALLOC_CTX *_mem_save_data_0;
477         {
478                 uint32_t _flags_save_STRUCT = ndr->flags;
479                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
480                 if (ndr_flags & NDR_SCALARS) {
481                         NDR_CHECK(ndr_pull_align(ndr, 4));
482                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
483                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
484                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
485                         if (_ptr_data) {
486                                 NDR_PULL_ALLOC(ndr, r->data);
487                         } else {
488                                 r->data = NULL;
489                         }
490                 }
491                 if (ndr_flags & NDR_BUFFERS) {
492                         if (r->data) {
493                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
494                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
495                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
496                                 NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
497                                 if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) {
498                                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data), ndr_get_array_length(ndr, &r->data));
499                                 }
500                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
501                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data)));
502                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
503                         }
504                         if (r->data) {
505                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
506                         }
507                         if (r->data) {
508                                 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length));
509                         }
510                 }
511                 ndr->flags = _flags_save_STRUCT;
512         }
513         return NDR_ERR_SUCCESS;
514 }
515
516 _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r)
517 {
518         ndr_print_struct(ndr, name, "netr_ChallengeResponse");
519         {
520                 uint32_t _flags_save_STRUCT = ndr->flags;
521                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
522                 ndr->depth++;
523                 ndr_print_uint16(ndr, "length", r->length);
524                 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
525                 ndr_print_ptr(ndr, "data", r->data);
526                 ndr->depth++;
527                 if (r->data) {
528                         ndr_print_array_uint8(ndr, "data", r->data, r->length);
529                 }
530                 ndr->depth--;
531                 ndr->depth--;
532                 ndr->flags = _flags_save_STRUCT;
533         }
534 }
535
536 static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
537 {
538         {
539                 uint32_t _flags_save_STRUCT = ndr->flags;
540                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
541                 if (ndr_flags & NDR_SCALARS) {
542                         NDR_CHECK(ndr_push_align(ndr, 4));
543                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
544                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
545                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
546                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
547                 }
548                 if (ndr_flags & NDR_BUFFERS) {
549                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
550                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
551                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
552                 }
553                 ndr->flags = _flags_save_STRUCT;
554         }
555         return NDR_ERR_SUCCESS;
556 }
557
558 static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
559 {
560         {
561                 uint32_t _flags_save_STRUCT = ndr->flags;
562                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
563                 if (ndr_flags & NDR_SCALARS) {
564                         NDR_CHECK(ndr_pull_align(ndr, 4));
565                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
566                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
567                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
568                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
569                 }
570                 if (ndr_flags & NDR_BUFFERS) {
571                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
572                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
573                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
574                 }
575                 ndr->flags = _flags_save_STRUCT;
576         }
577         return NDR_ERR_SUCCESS;
578 }
579
580 _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r)
581 {
582         ndr_print_struct(ndr, name, "netr_NetworkInfo");
583         {
584                 uint32_t _flags_save_STRUCT = ndr->flags;
585                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
586                 ndr->depth++;
587                 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
588                 ndr_print_array_uint8(ndr, "challenge", r->challenge, 8);
589                 ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt);
590                 ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm);
591                 ndr->depth--;
592                 ndr->flags = _flags_save_STRUCT;
593         }
594 }
595
596 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
597 {
598         if (ndr_flags & NDR_SCALARS) {
599                 int level = ndr_push_get_switch_value(ndr, r);
600                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
601                 switch (level) {
602                         case 1: {
603                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
604                         break; }
605
606                         case 2: {
607                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
608                         break; }
609
610                         case 3: {
611                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
612                         break; }
613
614                         case 5: {
615                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
616                         break; }
617
618                         case 6: {
619                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
620                         break; }
621
622                         default:
623                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
624                 }
625         }
626         if (ndr_flags & NDR_BUFFERS) {
627                 int level = ndr_push_get_switch_value(ndr, r);
628                 switch (level) {
629                         case 1:
630                                 if (r->password) {
631                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
632                                 }
633                         break;
634
635                         case 2:
636                                 if (r->network) {
637                                         NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
638                                 }
639                         break;
640
641                         case 3:
642                                 if (r->password) {
643                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
644                                 }
645                         break;
646
647                         case 5:
648                                 if (r->password) {
649                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
650                                 }
651                         break;
652
653                         case 6:
654                                 if (r->network) {
655                                         NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
656                                 }
657                         break;
658
659                         default:
660                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
661                 }
662         }
663         return NDR_ERR_SUCCESS;
664 }
665
666 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
667 {
668         int level;
669         uint16_t _level;
670         TALLOC_CTX *_mem_save_password_0;
671         TALLOC_CTX *_mem_save_network_0;
672         level = ndr_pull_get_switch_value(ndr, r);
673         if (ndr_flags & NDR_SCALARS) {
674                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
675                 if (_level != level) {
676                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
677                 }
678                 switch (level) {
679                         case 1: {
680                                 uint32_t _ptr_password;
681                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
682                                 if (_ptr_password) {
683                                         NDR_PULL_ALLOC(ndr, r->password);
684                                 } else {
685                                         r->password = NULL;
686                                 }
687                         break; }
688
689                         case 2: {
690                                 uint32_t _ptr_network;
691                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
692                                 if (_ptr_network) {
693                                         NDR_PULL_ALLOC(ndr, r->network);
694                                 } else {
695                                         r->network = NULL;
696                                 }
697                         break; }
698
699                         case 3: {
700                                 uint32_t _ptr_password;
701                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
702                                 if (_ptr_password) {
703                                         NDR_PULL_ALLOC(ndr, r->password);
704                                 } else {
705                                         r->password = NULL;
706                                 }
707                         break; }
708
709                         case 5: {
710                                 uint32_t _ptr_password;
711                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
712                                 if (_ptr_password) {
713                                         NDR_PULL_ALLOC(ndr, r->password);
714                                 } else {
715                                         r->password = NULL;
716                                 }
717                         break; }
718
719                         case 6: {
720                                 uint32_t _ptr_network;
721                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
722                                 if (_ptr_network) {
723                                         NDR_PULL_ALLOC(ndr, r->network);
724                                 } else {
725                                         r->network = NULL;
726                                 }
727                         break; }
728
729                         default:
730                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
731                 }
732         }
733         if (ndr_flags & NDR_BUFFERS) {
734                 switch (level) {
735                         case 1:
736                                 if (r->password) {
737                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
738                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
739                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
740                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
741                                 }
742                         break;
743
744                         case 2:
745                                 if (r->network) {
746                                         _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
747                                         NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
748                                         NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
749                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
750                                 }
751                         break;
752
753                         case 3:
754                                 if (r->password) {
755                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
756                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
757                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
758                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
759                                 }
760                         break;
761
762                         case 5:
763                                 if (r->password) {
764                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
765                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
766                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
767                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
768                                 }
769                         break;
770
771                         case 6:
772                                 if (r->network) {
773                                         _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
774                                         NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
775                                         NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
776                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
777                                 }
778                         break;
779
780                         default:
781                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
782                 }
783         }
784         return NDR_ERR_SUCCESS;
785 }
786
787 _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
788 {
789         int level;
790         level = ndr_print_get_switch_value(ndr, r);
791         ndr_print_union(ndr, name, level, "netr_LogonLevel");
792         switch (level) {
793                 case 1:
794                         ndr_print_ptr(ndr, "password", r->password);
795                         ndr->depth++;
796                         if (r->password) {
797                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
798                         }
799                         ndr->depth--;
800                 break;
801
802                 case 2:
803                         ndr_print_ptr(ndr, "network", r->network);
804                         ndr->depth++;
805                         if (r->network) {
806                                 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
807                         }
808                         ndr->depth--;
809                 break;
810
811                 case 3:
812                         ndr_print_ptr(ndr, "password", r->password);
813                         ndr->depth++;
814                         if (r->password) {
815                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
816                         }
817                         ndr->depth--;
818                 break;
819
820                 case 5:
821                         ndr_print_ptr(ndr, "password", r->password);
822                         ndr->depth++;
823                         if (r->password) {
824                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
825                         }
826                         ndr->depth--;
827                 break;
828
829                 case 6:
830                         ndr_print_ptr(ndr, "network", r->network);
831                         ndr->depth++;
832                         if (r->network) {
833                                 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
834                         }
835                         ndr->depth--;
836                 break;
837
838                 default:
839                         ndr_print_bad_level(ndr, name, level);
840         }
841 }
842
843 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
844 {
845         {
846                 uint32_t _flags_save_STRUCT = ndr->flags;
847                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
848                 if (ndr_flags & NDR_SCALARS) {
849                         NDR_CHECK(ndr_push_align(ndr, 1));
850                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16));
851                 }
852                 if (ndr_flags & NDR_BUFFERS) {
853                 }
854                 ndr->flags = _flags_save_STRUCT;
855         }
856         return NDR_ERR_SUCCESS;
857 }
858
859 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
860 {
861         {
862                 uint32_t _flags_save_STRUCT = ndr->flags;
863                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
864                 if (ndr_flags & NDR_SCALARS) {
865                         NDR_CHECK(ndr_pull_align(ndr, 1));
866                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 16));
867                 }
868                 if (ndr_flags & NDR_BUFFERS) {
869                 }
870                 ndr->flags = _flags_save_STRUCT;
871         }
872         return NDR_ERR_SUCCESS;
873 }
874
875 _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r)
876 {
877         ndr_print_struct(ndr, name, "netr_UserSessionKey");
878         {
879                 uint32_t _flags_save_STRUCT = ndr->flags;
880                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
881                 ndr->depth++;
882                 ndr_print_array_uint8(ndr, "key", r->key, 16);
883                 ndr->depth--;
884                 ndr->flags = _flags_save_STRUCT;
885         }
886 }
887
888 _PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
889 {
890         {
891                 uint32_t _flags_save_STRUCT = ndr->flags;
892                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
893                 if (ndr_flags & NDR_SCALARS) {
894                         NDR_CHECK(ndr_push_align(ndr, 1));
895                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8));
896                 }
897                 if (ndr_flags & NDR_BUFFERS) {
898                 }
899                 ndr->flags = _flags_save_STRUCT;
900         }
901         return NDR_ERR_SUCCESS;
902 }
903
904 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
905 {
906         {
907                 uint32_t _flags_save_STRUCT = ndr->flags;
908                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
909                 if (ndr_flags & NDR_SCALARS) {
910                         NDR_CHECK(ndr_pull_align(ndr, 1));
911                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 8));
912                 }
913                 if (ndr_flags & NDR_BUFFERS) {
914                 }
915                 ndr->flags = _flags_save_STRUCT;
916         }
917         return NDR_ERR_SUCCESS;
918 }
919
920 _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r)
921 {
922         ndr_print_struct(ndr, name, "netr_LMSessionKey");
923         {
924                 uint32_t _flags_save_STRUCT = ndr->flags;
925                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
926                 ndr->depth++;
927                 ndr_print_array_uint8(ndr, "key", r->key, 8);
928                 ndr->depth--;
929                 ndr->flags = _flags_save_STRUCT;
930         }
931 }
932
933 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
934 {
935         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
936         return NDR_ERR_SUCCESS;
937 }
938
939 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
940 {
941         uint32_t v;
942         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
943         *r = v;
944         return NDR_ERR_SUCCESS;
945 }
946
947 _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r)
948 {
949         ndr_print_uint32(ndr, name, r);
950         ndr->depth++;
951         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r);
952         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r);
953         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r);
954         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r);
955         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r);
956         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r);
957         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r);
958         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r);
959         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r);
960         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r);
961         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r);
962         ndr->depth--;
963 }
964
965 static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
966 {
967         uint32_t cntr_unknown_0;
968         if (ndr_flags & NDR_SCALARS) {
969                 NDR_CHECK(ndr_push_align(ndr, 4));
970                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
971                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
972                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
973                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
974                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
975                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
976                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
977                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
978                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
979                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
980                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
981                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
982                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
983                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
984                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
985                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
986                 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
987                 NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags));
988                 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
989                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
990                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
991                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
992                 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
993                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
994                 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
995                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
996                 }
997         }
998         if (ndr_flags & NDR_BUFFERS) {
999                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1000                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1001                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1002                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1003                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1004                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1005                 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1006                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1007                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1008                 if (r->domain_sid) {
1009                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1010                 }
1011         }
1012         return NDR_ERR_SUCCESS;
1013 }
1014
1015 static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
1016 {
1017         uint32_t _ptr_domain_sid;
1018         TALLOC_CTX *_mem_save_domain_sid_0;
1019         uint32_t cntr_unknown_0;
1020         if (ndr_flags & NDR_SCALARS) {
1021                 NDR_CHECK(ndr_pull_align(ndr, 4));
1022                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
1023                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
1024                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
1025                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
1026                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
1027                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
1028                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1029                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1030                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1031                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1032                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1033                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1034                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
1035                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
1036                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
1037                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1038                 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1039                 NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags));
1040                 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1041                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1042                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1043                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
1044                 if (_ptr_domain_sid) {
1045                         NDR_PULL_ALLOC(ndr, r->domain_sid);
1046                 } else {
1047                         r->domain_sid = NULL;
1048                 }
1049                 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1050                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
1051                 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1052                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
1053                 }
1054         }
1055         if (ndr_flags & NDR_BUFFERS) {
1056                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1057                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1058                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1059                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1060                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1061                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1062                 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1063                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1064                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1065                 if (r->domain_sid) {
1066                         _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1067                         NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
1068                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1069                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
1070                 }
1071         }
1072         return NDR_ERR_SUCCESS;
1073 }
1074
1075 _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r)
1076 {
1077         uint32_t cntr_unknown_0;
1078         ndr_print_struct(ndr, name, "netr_SamBaseInfo");
1079         ndr->depth++;
1080         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
1081         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
1082         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
1083         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
1084         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
1085         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
1086         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
1087         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
1088         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
1089         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
1090         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
1091         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
1092         ndr_print_uint16(ndr, "logon_count", r->logon_count);
1093         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
1094         ndr_print_uint32(ndr, "rid", r->rid);
1095         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
1096         ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups);
1097         ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags);
1098         ndr_print_netr_UserSessionKey(ndr, "key", &r->key);
1099         ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server);
1100         ndr_print_lsa_StringLarge(ndr, "domain", &r->domain);
1101         ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
1102         ndr->depth++;
1103         if (r->domain_sid) {
1104                 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
1105         }
1106         ndr->depth--;
1107         ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey);
1108         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
1109         ndr->print(ndr, "%s: ARRAY(%d)", "unknown", 7);
1110         ndr->depth++;
1111         for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) {
1112                 char *idx_0=NULL;
1113                 if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
1114                         ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
1115                         free(idx_0);
1116                 }
1117         }
1118         ndr->depth--;
1119         ndr->depth--;
1120 }
1121
1122 static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
1123 {
1124         if (ndr_flags & NDR_SCALARS) {
1125                 NDR_CHECK(ndr_push_align(ndr, 4));
1126                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1127         }
1128         if (ndr_flags & NDR_BUFFERS) {
1129                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1130         }
1131         return NDR_ERR_SUCCESS;
1132 }
1133
1134 static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
1135 {
1136         if (ndr_flags & NDR_SCALARS) {
1137                 NDR_CHECK(ndr_pull_align(ndr, 4));
1138                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1139         }
1140         if (ndr_flags & NDR_BUFFERS) {
1141                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1142         }
1143         return NDR_ERR_SUCCESS;
1144 }
1145
1146 _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r)
1147 {
1148         ndr_print_struct(ndr, name, "netr_SamInfo2");
1149         ndr->depth++;
1150         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1151         ndr->depth--;
1152 }
1153
1154 static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
1155 {
1156         if (ndr_flags & NDR_SCALARS) {
1157                 NDR_CHECK(ndr_push_align(ndr, 4));
1158                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1159                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1160         }
1161         if (ndr_flags & NDR_BUFFERS) {
1162                 if (r->sid) {
1163                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1164                 }
1165         }
1166         return NDR_ERR_SUCCESS;
1167 }
1168
1169 static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
1170 {
1171         uint32_t _ptr_sid;
1172         TALLOC_CTX *_mem_save_sid_0;
1173         if (ndr_flags & NDR_SCALARS) {
1174                 NDR_CHECK(ndr_pull_align(ndr, 4));
1175                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1176                 if (_ptr_sid) {
1177                         NDR_PULL_ALLOC(ndr, r->sid);
1178                 } else {
1179                         r->sid = NULL;
1180                 }
1181                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1182         }
1183         if (ndr_flags & NDR_BUFFERS) {
1184                 if (r->sid) {
1185                         _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1186                         NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1187                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1188                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1189                 }
1190         }
1191         return NDR_ERR_SUCCESS;
1192 }
1193
1194 _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r)
1195 {
1196         ndr_print_struct(ndr, name, "netr_SidAttr");
1197         ndr->depth++;
1198         ndr_print_ptr(ndr, "sid", r->sid);
1199         ndr->depth++;
1200         if (r->sid) {
1201                 ndr_print_dom_sid2(ndr, "sid", r->sid);
1202         }
1203         ndr->depth--;
1204         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1205         ndr->depth--;
1206 }
1207
1208 _PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
1209 {
1210         uint32_t cntr_sids_1;
1211         if (ndr_flags & NDR_SCALARS) {
1212                 NDR_CHECK(ndr_push_align(ndr, 4));
1213                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1214                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1215                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1216         }
1217         if (ndr_flags & NDR_BUFFERS) {
1218                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1219                 if (r->sids) {
1220                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1221                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1222                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1223                         }
1224                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1225                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1226                         }
1227                 }
1228         }
1229         return NDR_ERR_SUCCESS;
1230 }
1231
1232 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
1233 {
1234         uint32_t _ptr_sids;
1235         uint32_t cntr_sids_1;
1236         TALLOC_CTX *_mem_save_sids_0;
1237         TALLOC_CTX *_mem_save_sids_1;
1238         if (ndr_flags & NDR_SCALARS) {
1239                 NDR_CHECK(ndr_pull_align(ndr, 4));
1240                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1241                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1242                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1243                 if (_ptr_sids) {
1244                         NDR_PULL_ALLOC(ndr, r->sids);
1245                 } else {
1246                         r->sids = NULL;
1247                 }
1248         }
1249         if (ndr_flags & NDR_BUFFERS) {
1250                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1251                 if (r->sids) {
1252                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1253                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1254                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1255                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1256                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1257                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1258                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1259                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1260                         }
1261                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1262                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1263                         }
1264                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1265                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1266                 }
1267                 if (r->sids) {
1268                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1269                 }
1270         }
1271         return NDR_ERR_SUCCESS;
1272 }
1273
1274 _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r)
1275 {
1276         uint32_t cntr_sids_1;
1277         ndr_print_struct(ndr, name, "netr_SamInfo3");
1278         ndr->depth++;
1279         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1280         ndr_print_uint32(ndr, "sidcount", r->sidcount);
1281         ndr_print_ptr(ndr, "sids", r->sids);
1282         ndr->depth++;
1283         if (r->sids) {
1284                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", r->sidcount);
1285                 ndr->depth++;
1286                 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1287                         char *idx_1=NULL;
1288                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1289                                 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1290                                 free(idx_1);
1291                         }
1292                 }
1293                 ndr->depth--;
1294         }
1295         ndr->depth--;
1296         ndr->depth--;
1297 }
1298
1299 static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
1300 {
1301         uint32_t cntr_sids_1;
1302         uint32_t cntr_unknown4_0;
1303         if (ndr_flags & NDR_SCALARS) {
1304                 NDR_CHECK(ndr_push_align(ndr, 4));
1305                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1306                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1307                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1308                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
1309                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle));
1310                 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1311                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0]));
1312                 }
1313         }
1314         if (ndr_flags & NDR_BUFFERS) {
1315                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1316                 if (r->sids) {
1317                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1318                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1319                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1320                         }
1321                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1322                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1323                         }
1324                 }
1325                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1326                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1327         }
1328         return NDR_ERR_SUCCESS;
1329 }
1330
1331 static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
1332 {
1333         uint32_t _ptr_sids;
1334         uint32_t cntr_sids_1;
1335         TALLOC_CTX *_mem_save_sids_0;
1336         TALLOC_CTX *_mem_save_sids_1;
1337         uint32_t cntr_unknown4_0;
1338         if (ndr_flags & NDR_SCALARS) {
1339                 NDR_CHECK(ndr_pull_align(ndr, 4));
1340                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1341                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1342                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1343                 if (_ptr_sids) {
1344                         NDR_PULL_ALLOC(ndr, r->sids);
1345                 } else {
1346                         r->sids = NULL;
1347                 }
1348                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest));
1349                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle));
1350                 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1351                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0]));
1352                 }
1353         }
1354         if (ndr_flags & NDR_BUFFERS) {
1355                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1356                 if (r->sids) {
1357                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1358                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1359                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1360                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1361                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1362                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1363                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1364                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1365                         }
1366                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1367                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1368                         }
1369                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1370                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1371                 }
1372                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1373                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1374                 if (r->sids) {
1375                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1376                 }
1377         }
1378         return NDR_ERR_SUCCESS;
1379 }
1380
1381 _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r)
1382 {
1383         uint32_t cntr_sids_1;
1384         uint32_t cntr_unknown4_0;
1385         ndr_print_struct(ndr, name, "netr_SamInfo6");
1386         ndr->depth++;
1387         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1388         ndr_print_uint32(ndr, "sidcount", r->sidcount);
1389         ndr_print_ptr(ndr, "sids", r->sids);
1390         ndr->depth++;
1391         if (r->sids) {
1392                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", r->sidcount);
1393                 ndr->depth++;
1394                 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1395                         char *idx_1=NULL;
1396                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1397                                 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1398                                 free(idx_1);
1399                         }
1400                 }
1401                 ndr->depth--;
1402         }
1403         ndr->depth--;
1404         ndr_print_lsa_String(ndr, "forest", &r->forest);
1405         ndr_print_lsa_String(ndr, "principle", &r->principle);
1406         ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", 20);
1407         ndr->depth++;
1408         for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) {
1409                 char *idx_0=NULL;
1410                 if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) {
1411                         ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]);
1412                         free(idx_0);
1413                 }
1414         }
1415         ndr->depth--;
1416         ndr->depth--;
1417 }
1418
1419 static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
1420 {
1421         uint32_t cntr_expansionroom_0;
1422         if (ndr_flags & NDR_SCALARS) {
1423                 NDR_CHECK(ndr_push_align(ndr, 4));
1424                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1425                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1426                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1427                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1428                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1429                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1430                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth));
1431                 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1432                 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1433                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0]));
1434                 }
1435                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1436                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1437                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1438                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1439         }
1440         if (ndr_flags & NDR_BUFFERS) {
1441                 if (r->pac) {
1442                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1443                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size));
1444                 }
1445                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1446                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1447                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1448                 if (r->auth) {
1449                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1450                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size));
1451                 }
1452                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1453                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1454                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1455                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1456         }
1457         return NDR_ERR_SUCCESS;
1458 }
1459
1460 static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
1461 {
1462         uint32_t _ptr_pac;
1463         TALLOC_CTX *_mem_save_pac_0;
1464         uint32_t _ptr_auth;
1465         TALLOC_CTX *_mem_save_auth_0;
1466         uint32_t cntr_expansionroom_0;
1467         if (ndr_flags & NDR_SCALARS) {
1468                 NDR_CHECK(ndr_pull_align(ndr, 4));
1469                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size));
1470                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1471                 if (_ptr_pac) {
1472                         NDR_PULL_ALLOC(ndr, r->pac);
1473                 } else {
1474                         r->pac = NULL;
1475                 }
1476                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1477                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1478                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1479                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size));
1480                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth));
1481                 if (_ptr_auth) {
1482                         NDR_PULL_ALLOC(ndr, r->auth);
1483                 } else {
1484                         r->auth = NULL;
1485                 }
1486                 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1487                 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1488                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0]));
1489                 }
1490                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1491                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1492                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1493                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1494         }
1495         if (ndr_flags & NDR_BUFFERS) {
1496                 if (r->pac) {
1497                         _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1498                         NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1499                         NDR_CHECK(ndr_pull_array_size(ndr, &r->pac));
1500                         NDR_PULL_ALLOC_N(ndr, r->pac, ndr_get_array_size(ndr, &r->pac));
1501                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, ndr_get_array_size(ndr, &r->pac)));
1502                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1503                 }
1504                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1505                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1506                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1507                 if (r->auth) {
1508                         _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr);
1509                         NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0);
1510                         NDR_CHECK(ndr_pull_array_size(ndr, &r->auth));
1511                         NDR_PULL_ALLOC_N(ndr, r->auth, ndr_get_array_size(ndr, &r->auth));
1512                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, ndr_get_array_size(ndr, &r->auth)));
1513                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0);
1514                 }
1515                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1516                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1517                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1518                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1519                 if (r->pac) {
1520                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size));
1521                 }
1522                 if (r->auth) {
1523                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size));
1524                 }
1525         }
1526         return NDR_ERR_SUCCESS;
1527 }
1528
1529 _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r)
1530 {
1531         uint32_t cntr_expansionroom_0;
1532         ndr_print_struct(ndr, name, "netr_PacInfo");
1533         ndr->depth++;
1534         ndr_print_uint32(ndr, "pac_size", r->pac_size);
1535         ndr_print_ptr(ndr, "pac", r->pac);
1536         ndr->depth++;
1537         if (r->pac) {
1538                 ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size);
1539         }
1540         ndr->depth--;
1541         ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain);
1542         ndr_print_lsa_String(ndr, "logon_server", &r->logon_server);
1543         ndr_print_lsa_String(ndr, "principal_name", &r->principal_name);
1544         ndr_print_uint32(ndr, "auth_size", r->auth_size);
1545         ndr_print_ptr(ndr, "auth", r->auth);
1546         ndr->depth++;
1547         if (r->auth) {
1548                 ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size);
1549         }
1550         ndr->depth--;
1551         ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key);
1552         ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", 10);
1553         ndr->depth++;
1554         for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) {
1555                 char *idx_0=NULL;
1556                 if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) {
1557                         ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]);
1558                         free(idx_0);
1559                 }
1560         }
1561         ndr->depth--;
1562         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
1563         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
1564         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
1565         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
1566         ndr->depth--;
1567 }
1568
1569 _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
1570 {
1571         if (ndr_flags & NDR_SCALARS) {
1572                 int level = ndr_push_get_switch_value(ndr, r);
1573                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
1574                 switch (level) {
1575                         case 2: {
1576                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
1577                         break; }
1578
1579                         case 3: {
1580                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
1581                         break; }
1582
1583                         case 4: {
1584                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1585                         break; }
1586
1587                         case 5: {
1588                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1589                         break; }
1590
1591                         case 6: {
1592                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
1593                         break; }
1594
1595                         default:
1596                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1597                 }
1598         }
1599         if (ndr_flags & NDR_BUFFERS) {
1600                 int level = ndr_push_get_switch_value(ndr, r);
1601                 switch (level) {
1602                         case 2:
1603                                 if (r->sam2) {
1604                                         NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1605                                 }
1606                         break;
1607
1608                         case 3:
1609                                 if (r->sam3) {
1610                                         NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1611                                 }
1612                         break;
1613
1614                         case 4:
1615                                 if (r->pac) {
1616                                         NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1617                                 }
1618                         break;
1619
1620                         case 5:
1621                                 if (r->pac) {
1622                                         NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1623                                 }
1624                         break;
1625
1626                         case 6:
1627                                 if (r->sam6) {
1628                                         NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1629                                 }
1630                         break;
1631
1632                         default:
1633                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1634                 }
1635         }
1636         return NDR_ERR_SUCCESS;
1637 }
1638
1639 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
1640 {
1641         int level;
1642         uint16_t _level;
1643         TALLOC_CTX *_mem_save_sam2_0;
1644         TALLOC_CTX *_mem_save_sam3_0;
1645         TALLOC_CTX *_mem_save_pac_0;
1646         TALLOC_CTX *_mem_save_sam6_0;
1647         level = ndr_pull_get_switch_value(ndr, r);
1648         if (ndr_flags & NDR_SCALARS) {
1649                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1650                 if (_level != level) {
1651                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1652                 }
1653                 switch (level) {
1654                         case 2: {
1655                                 uint32_t _ptr_sam2;
1656                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2));
1657                                 if (_ptr_sam2) {
1658                                         NDR_PULL_ALLOC(ndr, r->sam2);
1659                                 } else {
1660                                         r->sam2 = NULL;
1661                                 }
1662                         break; }
1663
1664                         case 3: {
1665                                 uint32_t _ptr_sam3;
1666                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3));
1667                                 if (_ptr_sam3) {
1668                                         NDR_PULL_ALLOC(ndr, r->sam3);
1669                                 } else {
1670                                         r->sam3 = NULL;
1671                                 }
1672                         break; }
1673
1674                         case 4: {
1675                                 uint32_t _ptr_pac;
1676                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1677                                 if (_ptr_pac) {
1678                                         NDR_PULL_ALLOC(ndr, r->pac);
1679                                 } else {
1680                                         r->pac = NULL;
1681                                 }
1682                         break; }
1683
1684                         case 5: {
1685                                 uint32_t _ptr_pac;
1686                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1687                                 if (_ptr_pac) {
1688                                         NDR_PULL_ALLOC(ndr, r->pac);
1689                                 } else {
1690                                         r->pac = NULL;
1691                                 }
1692                         break; }
1693
1694                         case 6: {
1695                                 uint32_t _ptr_sam6;
1696                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6));
1697                                 if (_ptr_sam6) {
1698                                         NDR_PULL_ALLOC(ndr, r->sam6);
1699                                 } else {
1700                                         r->sam6 = NULL;
1701                                 }
1702                         break; }
1703
1704                         default:
1705                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1706                 }
1707         }
1708         if (ndr_flags & NDR_BUFFERS) {
1709                 switch (level) {
1710                         case 2:
1711                                 if (r->sam2) {
1712                                         _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1713                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0);
1714                                         NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1715                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0);
1716                                 }
1717                         break;
1718
1719                         case 3:
1720                                 if (r->sam3) {
1721                                         _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1722                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0);
1723                                         NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1724                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0);
1725                                 }
1726                         break;
1727
1728                         case 4:
1729                                 if (r->pac) {
1730                                         _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1731                                         NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1732                                         NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1733                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1734                                 }
1735                         break;
1736
1737                         case 5:
1738                                 if (r->pac) {
1739                                         _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1740                                         NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1741                                         NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1742                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1743                                 }
1744                         break;
1745
1746                         case 6:
1747                                 if (r->sam6) {
1748                                         _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr);
1749                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0);
1750                                         NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1751                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0);
1752                                 }
1753                         break;
1754
1755                         default:
1756                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1757                 }
1758         }
1759         return NDR_ERR_SUCCESS;
1760 }
1761
1762 _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r)
1763 {
1764         int level;
1765         level = ndr_print_get_switch_value(ndr, r);
1766         ndr_print_union(ndr, name, level, "netr_Validation");
1767         switch (level) {
1768                 case 2:
1769                         ndr_print_ptr(ndr, "sam2", r->sam2);
1770                         ndr->depth++;
1771                         if (r->sam2) {
1772                                 ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2);
1773                         }
1774                         ndr->depth--;
1775                 break;
1776
1777                 case 3:
1778                         ndr_print_ptr(ndr, "sam3", r->sam3);
1779                         ndr->depth++;
1780                         if (r->sam3) {
1781                                 ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3);
1782                         }
1783                         ndr->depth--;
1784                 break;
1785
1786                 case 4:
1787                         ndr_print_ptr(ndr, "pac", r->pac);
1788                         ndr->depth++;
1789                         if (r->pac) {
1790                                 ndr_print_netr_PacInfo(ndr, "pac", r->pac);
1791                         }
1792                         ndr->depth--;
1793                 break;
1794
1795                 case 5:
1796                         ndr_print_ptr(ndr, "pac", r->pac);
1797                         ndr->depth++;
1798                         if (r->pac) {
1799                                 ndr_print_netr_PacInfo(ndr, "pac", r->pac);
1800                         }
1801                         ndr->depth--;
1802                 break;
1803
1804                 case 6:
1805                         ndr_print_ptr(ndr, "sam6", r->sam6);
1806                         ndr->depth++;
1807                         if (r->sam6) {
1808                                 ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6);
1809                         }
1810                         ndr->depth--;
1811                 break;
1812
1813                 default:
1814                         ndr_print_bad_level(ndr, name, level);
1815         }
1816 }
1817
1818 _PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
1819 {
1820         {
1821                 uint32_t _flags_save_STRUCT = ndr->flags;
1822                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1823                 if (ndr_flags & NDR_SCALARS) {
1824                         NDR_CHECK(ndr_push_align(ndr, 1));
1825                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8));
1826                 }
1827                 if (ndr_flags & NDR_BUFFERS) {
1828                 }
1829                 ndr->flags = _flags_save_STRUCT;
1830         }
1831         return NDR_ERR_SUCCESS;
1832 }
1833
1834 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
1835 {
1836         {
1837                 uint32_t _flags_save_STRUCT = ndr->flags;
1838                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1839                 if (ndr_flags & NDR_SCALARS) {
1840                         NDR_CHECK(ndr_pull_align(ndr, 1));
1841                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 8));
1842                 }
1843                 if (ndr_flags & NDR_BUFFERS) {
1844                 }
1845                 ndr->flags = _flags_save_STRUCT;
1846         }
1847         return NDR_ERR_SUCCESS;
1848 }
1849
1850 _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r)
1851 {
1852         ndr_print_struct(ndr, name, "netr_Credential");
1853         {
1854                 uint32_t _flags_save_STRUCT = ndr->flags;
1855                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1856                 ndr->depth++;
1857                 ndr_print_array_uint8(ndr, "data", r->data, 8);
1858                 ndr->depth--;
1859                 ndr->flags = _flags_save_STRUCT;
1860         }
1861 }
1862
1863 _PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
1864 {
1865         if (ndr_flags & NDR_SCALARS) {
1866                 NDR_CHECK(ndr_push_align(ndr, 4));
1867                 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred));
1868                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
1869         }
1870         if (ndr_flags & NDR_BUFFERS) {
1871         }
1872         return NDR_ERR_SUCCESS;
1873 }
1874
1875 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
1876 {
1877         if (ndr_flags & NDR_SCALARS) {
1878                 NDR_CHECK(ndr_pull_align(ndr, 4));
1879                 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred));
1880                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
1881         }
1882         if (ndr_flags & NDR_BUFFERS) {
1883         }
1884         return NDR_ERR_SUCCESS;
1885 }
1886
1887 _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r)
1888 {
1889         ndr_print_struct(ndr, name, "netr_Authenticator");
1890         ndr->depth++;
1891         ndr_print_netr_Credential(ndr, "cred", &r->cred);
1892         ndr_print_time_t(ndr, "timestamp", r->timestamp);
1893         ndr->depth--;
1894 }
1895
1896 static enum ndr_err_code ndr_push_netr_DELTA_DELETE_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DELETE_USER *r)
1897 {
1898         if (ndr_flags & NDR_SCALARS) {
1899                 NDR_CHECK(ndr_push_align(ndr, 4));
1900                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
1901                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1902                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1903                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1904                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1905                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
1906                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
1907                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
1908                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
1909         }
1910         if (ndr_flags & NDR_BUFFERS) {
1911                 if (r->account_name) {
1912                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
1913                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1914                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
1915                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
1916                 }
1917                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1918                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1919                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1920                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1921         }
1922         return NDR_ERR_SUCCESS;
1923 }
1924
1925 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
1926 {
1927         uint32_t _ptr_account_name;
1928         TALLOC_CTX *_mem_save_account_name_0;
1929         if (ndr_flags & NDR_SCALARS) {
1930                 NDR_CHECK(ndr_pull_align(ndr, 4));
1931                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
1932                 if (_ptr_account_name) {
1933                         NDR_PULL_ALLOC(ndr, r->account_name);
1934                 } else {
1935                         r->account_name = NULL;
1936                 }
1937                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1938                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1939                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1940                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1941                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
1942                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
1943                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
1944                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
1945         }
1946         if (ndr_flags & NDR_BUFFERS) {
1947                 if (r->account_name) {
1948                         _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1949                         NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
1950                         NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
1951                         NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
1952                         if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
1953                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->account_name), ndr_get_array_length(ndr, &r->account_name));
1954                         }
1955                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t)));
1956                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16));
1957                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
1958                 }
1959                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1960                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1961                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1962                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1963         }
1964         return NDR_ERR_SUCCESS;
1965 }
1966
1967 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r)
1968 {
1969         ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER");
1970         ndr->depth++;
1971         ndr_print_ptr(ndr, "account_name", r->account_name);
1972         ndr->depth++;
1973         if (r->account_name) {
1974                 ndr_print_string(ndr, "account_name", r->account_name);
1975         }
1976         ndr->depth--;
1977         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
1978         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
1979         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
1980         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
1981         ndr_print_uint32(ndr, "unknown5", r->unknown5);
1982         ndr_print_uint32(ndr, "unknown6", r->unknown6);
1983         ndr_print_uint32(ndr, "unknown7", r->unknown7);
1984         ndr_print_uint32(ndr, "unknown8", r->unknown8);
1985         ndr->depth--;
1986 }
1987
1988 static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
1989 {
1990         if (ndr_flags & NDR_SCALARS) {
1991                 NDR_CHECK(ndr_push_align(ndr, 4));
1992                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
1993                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
1994                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
1995                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd));
1996         }
1997         if (ndr_flags & NDR_BUFFERS) {
1998                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->pwd));
1999         }
2000         return NDR_ERR_SUCCESS;
2001 }
2002
2003 static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
2004 {
2005         if (ndr_flags & NDR_SCALARS) {
2006                 NDR_CHECK(ndr_pull_align(ndr, 4));
2007                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
2008                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
2009                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
2010                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2011         }
2012         if (ndr_flags & NDR_BUFFERS) {
2013                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->pwd));
2014         }
2015         return NDR_ERR_SUCCESS;
2016 }
2017
2018 _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r)
2019 {
2020         ndr_print_struct(ndr, name, "netr_USER_KEY16");
2021         ndr->depth++;
2022         ndr_print_uint16(ndr, "length", r->length);
2023         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
2024         ndr_print_uint32(ndr, "flags", r->flags);
2025         ndr_print_samr_Password(ndr, "pwd", &r->pwd);
2026         ndr->depth--;
2027 }
2028
2029 static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
2030 {
2031         if (ndr_flags & NDR_SCALARS) {
2032                 NDR_CHECK(ndr_push_align(ndr, 4));
2033                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2034                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2035                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags));
2036                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2037                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2038                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags));
2039                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2040                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2041         }
2042         if (ndr_flags & NDR_BUFFERS) {
2043         }
2044         return NDR_ERR_SUCCESS;
2045 }
2046
2047 static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
2048 {
2049         if (ndr_flags & NDR_SCALARS) {
2050                 NDR_CHECK(ndr_pull_align(ndr, 4));
2051                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length));
2052                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size));
2053                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags));
2054                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length));
2055                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size));
2056                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags));
2057                 NDR_PULL_ALLOC_N(ndr, r->nt_history, r->nt_length);
2058                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2059                 NDR_PULL_ALLOC_N(ndr, r->lm_history, r->lm_length);
2060                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2061         }
2062         if (ndr_flags & NDR_BUFFERS) {
2063         }
2064         return NDR_ERR_SUCCESS;
2065 }
2066
2067 _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r)
2068 {
2069         ndr_print_struct(ndr, name, "netr_PasswordHistory");
2070         ndr->depth++;
2071         ndr_print_uint16(ndr, "nt_length", r->nt_length);
2072         ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size);
2073         ndr_print_uint32(ndr, "nt_flags", r->nt_flags);
2074         ndr_print_uint16(ndr, "lm_length", r->lm_length);
2075         ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size);
2076         ndr_print_uint32(ndr, "lm_flags", r->lm_flags);
2077         ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length);
2078         ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length);
2079         ndr->depth--;
2080 }
2081
2082 static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
2083 {
2084         if (ndr_flags & NDR_SCALARS) {
2085                 NDR_CHECK(ndr_push_align(ndr, 4));
2086                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2087                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2088                 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2089         }
2090         if (ndr_flags & NDR_BUFFERS) {
2091                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword));
2092                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->ntpassword));
2093         }
2094         return NDR_ERR_SUCCESS;
2095 }
2096
2097 static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
2098 {
2099         if (ndr_flags & NDR_SCALARS) {
2100                 NDR_CHECK(ndr_pull_align(ndr, 4));
2101                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2102                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2103                 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2104         }
2105         if (ndr_flags & NDR_BUFFERS) {
2106                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->lmpassword));
2107                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_BUFFERS, &r->ntpassword));
2108         }
2109         return NDR_ERR_SUCCESS;
2110 }
2111
2112 _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r)
2113 {
2114         ndr_print_struct(ndr, name, "netr_USER_KEYS2");
2115         ndr->depth++;
2116         ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword);
2117         ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword);
2118         ndr_print_netr_PasswordHistory(ndr, "history", &r->history);
2119         ndr->depth--;
2120 }
2121
2122 static enum ndr_err_code ndr_push_netr_USER_KEY_UNION(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY_UNION *r)
2123 {
2124         if (ndr_flags & NDR_SCALARS) {
2125                 NDR_CHECK(ndr_push_align(ndr, 4));
2126                 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2127         }
2128         if (ndr_flags & NDR_BUFFERS) {
2129                 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_BUFFERS, &r->keys2));
2130         }
2131         return NDR_ERR_SUCCESS;
2132 }
2133
2134 static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
2135 {
2136         if (ndr_flags & NDR_SCALARS) {
2137                 NDR_CHECK(ndr_pull_align(ndr, 4));
2138                 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2139         }
2140         if (ndr_flags & NDR_BUFFERS) {
2141                 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_BUFFERS, &r->keys2));
2142         }
2143         return NDR_ERR_SUCCESS;
2144 }
2145
2146 _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r)
2147 {
2148         ndr_print_struct(ndr, name, "netr_USER_KEY_UNION");
2149         ndr->depth++;
2150         ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2);
2151         ndr->depth--;
2152 }
2153
2154 _PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
2155 {
2156         if (ndr_flags & NDR_SCALARS) {
2157                 NDR_CHECK(ndr_push_align(ndr, 4));
2158                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2159                 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2160         }
2161         if (ndr_flags & NDR_BUFFERS) {
2162                 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_BUFFERS, &r->keys));
2163         }
2164         return NDR_ERR_SUCCESS;
2165 }
2166
2167 _PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
2168 {
2169         if (ndr_flags & NDR_SCALARS) {
2170                 NDR_CHECK(ndr_pull_align(ndr, 4));
2171                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2172                 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2173         }
2174         if (ndr_flags & NDR_BUFFERS) {
2175                 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_BUFFERS, &r->keys));
2176         }
2177         return NDR_ERR_SUCCESS;
2178 }
2179
2180 _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r)
2181 {
2182         ndr_print_struct(ndr, name, "netr_USER_KEYS");
2183         ndr->depth++;
2184         ndr_print_uint32(ndr, "version", r->version);
2185         ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys);
2186         ndr->depth--;
2187 }
2188
2189 static enum ndr_err_code ndr_push_netr_USER_PRIVATE_INFO(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_PRIVATE_INFO *r)
2190 {
2191         if (ndr_flags & NDR_SCALARS) {
2192                 NDR_CHECK(ndr_push_align(ndr, 4));
2193                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag));
2194                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2195                 {
2196                         uint32_t _flags_save_uint8 = ndr->flags;
2197                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2198                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData));
2199                         ndr->flags = _flags_save_uint8;
2200                 }
2201         }
2202         if (ndr_flags & NDR_BUFFERS) {
2203                 {
2204                         uint32_t _flags_save_uint8 = ndr->flags;
2205                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2206                         if (r->SensitiveData) {
2207                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2208                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength));
2209                         }
2210                         ndr->flags = _flags_save_uint8;
2211                 }
2212         }
2213         return NDR_ERR_SUCCESS;
2214 }
2215
2216 static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
2217 {
2218         uint32_t _ptr_SensitiveData;
2219         TALLOC_CTX *_mem_save_SensitiveData_0;
2220         if (ndr_flags & NDR_SCALARS) {
2221                 NDR_CHECK(ndr_pull_align(ndr, 4));
2222                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag));
2223                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength));
2224                 {
2225                         uint32_t _flags_save_uint8 = ndr->flags;
2226                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2227                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData));
2228                         if (_ptr_SensitiveData) {
2229                                 NDR_PULL_ALLOC(ndr, r->SensitiveData);
2230                         } else {
2231                                 r->SensitiveData = NULL;
2232                         }
2233                         ndr->flags = _flags_save_uint8;
2234                 }
2235         }
2236         if (ndr_flags & NDR_BUFFERS) {
2237                 {
2238                         uint32_t _flags_save_uint8 = ndr->flags;
2239                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2240                         if (r->SensitiveData) {
2241                                 _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr);
2242                                 NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0);
2243                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData));
2244                                 NDR_PULL_ALLOC_N(ndr, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData));
2245                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData)));
2246                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0);
2247                         }
2248                         ndr->flags = _flags_save_uint8;
2249                 }
2250                 if (r->SensitiveData) {
2251                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength));
2252                 }
2253         }
2254         return NDR_ERR_SUCCESS;
2255 }
2256
2257 _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r)
2258 {
2259         ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO");
2260         ndr->depth++;
2261         ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag);
2262         ndr_print_uint32(ndr, "DataLength", r->DataLength);
2263         ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData);
2264         ndr->depth++;
2265         if (r->SensitiveData) {
2266                 ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength);
2267         }
2268         ndr->depth--;
2269         ndr->depth--;
2270 }
2271
2272 static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
2273 {
2274         if (ndr_flags & NDR_SCALARS) {
2275                 NDR_CHECK(ndr_push_align(ndr, 4));
2276                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2277                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2278                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2279                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2280                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2281                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2282                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2283                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2284                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2285                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2286                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2287                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2288                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2289                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2290                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2291                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2292                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2293                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2294                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2295                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present));
2296                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present));
2297                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2298                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2299                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->parameters));
2300                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2301                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2302                 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2303                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2304                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2305                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2306                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2307                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2308                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2309                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2310                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2311                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2312                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2313         }
2314         if (ndr_flags & NDR_BUFFERS) {
2315                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2316                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2317                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2318                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2319                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2320                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2321                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2322                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2323                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
2324                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
2325                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2326                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->parameters));
2327                 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2328                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2329                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2330                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2331                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2332                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2333         }
2334         return NDR_ERR_SUCCESS;
2335 }
2336
2337 static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
2338 {
2339         if (ndr_flags & NDR_SCALARS) {
2340                 NDR_CHECK(ndr_pull_align(ndr, 4));
2341                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2342                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2343                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2344                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2345                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2346                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2347                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2348                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2349                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2350                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2351                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2352                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2353                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2354                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2355                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2356                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2357                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2358                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2359                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2360                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present));
2361                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present));
2362                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2363                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2364                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->parameters));
2365                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2366                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2367                 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2368                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2369                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2370                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2371                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2372                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2373                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2374                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2375                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2376                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2377                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2378         }
2379         if (ndr_flags & NDR_BUFFERS) {
2380                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2381                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2382                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2383                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2384                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2385                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2386                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2387                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2388                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->lmpassword));
2389                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_BUFFERS, &r->ntpassword));
2390                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2391                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->parameters));
2392                 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2393                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2394                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2395                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2396                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2397                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2398         }
2399         return NDR_ERR_SUCCESS;
2400 }
2401
2402 _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r)
2403 {
2404         ndr_print_struct(ndr, name, "netr_DELTA_USER");
2405         ndr->depth++;
2406         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2407         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2408         ndr_print_uint32(ndr, "rid", r->rid);
2409         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2410         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2411         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2412         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2413         ndr_print_lsa_String(ndr, "description", &r->description);
2414         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2415         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2416         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2417         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2418         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2419         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2420         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2421         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2422         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2423         ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
2424         ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
2425         ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present);
2426         ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present);
2427         ndr_print_uint8(ndr, "password_expired", r->password_expired);
2428         ndr_print_lsa_String(ndr, "comment", &r->comment);
2429         ndr_print_lsa_String(ndr, "parameters", &r->parameters);
2430         ndr_print_uint16(ndr, "country_code", r->country_code);
2431         ndr_print_uint16(ndr, "code_page", r->code_page);
2432         ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info);
2433         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2434         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2435         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2436         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2437         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2438         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2439         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2440         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2441         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2442         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2443         ndr->depth--;
2444 }
2445
2446 static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
2447 {
2448         if (ndr_flags & NDR_SCALARS) {
2449                 NDR_CHECK(ndr_push_align(ndr, 4));
2450                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2451                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2452                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time));
2453                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
2454                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
2455                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
2456                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
2457                 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
2458                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
2459                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2460                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2461                 NDR_CHECK(ndr_push_netr_AcctLockStr(ndr, NDR_SCALARS, &r->account_lockout));
2462                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2463                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2464                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2465                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass));
2466                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2467                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2468                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2469         }
2470         if (ndr_flags & NDR_BUFFERS) {
2471                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2472                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2473                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2474                 NDR_CHECK(ndr_push_netr_AcctLockStr(ndr, NDR_BUFFERS, &r->account_lockout));
2475                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2476                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2477                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2478         }
2479         return NDR_ERR_SUCCESS;
2480 }
2481
2482 static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
2483 {
2484         if (ndr_flags & NDR_SCALARS) {
2485                 NDR_CHECK(ndr_pull_align(ndr, 4));
2486                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2487                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2488                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time));
2489                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
2490                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
2491                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
2492                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
2493                 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
2494                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
2495                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2496                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2497                 NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr, NDR_SCALARS, &r->account_lockout));
2498                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2499                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2500                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2501                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass));
2502                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2503                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2504                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2505         }
2506         if (ndr_flags & NDR_BUFFERS) {
2507                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2508                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2509                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2510                 NDR_CHECK(ndr_pull_netr_AcctLockStr(ndr, NDR_BUFFERS, &r->account_lockout));
2511                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2512                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2513                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2514         }
2515         return NDR_ERR_SUCCESS;
2516 }
2517
2518 _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r)
2519 {
2520         ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN");
2521         ndr->depth++;
2522         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
2523         ndr_print_lsa_String(ndr, "comment", &r->comment);
2524         ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time);
2525         ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
2526         ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
2527         ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
2528         ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
2529         ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
2530         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
2531         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2532         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2533         ndr_print_netr_AcctLockStr(ndr, "account_lockout", &r->account_lockout);
2534         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2535         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2536         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2537         ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass);
2538         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2539         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2540         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2541         ndr->depth--;
2542 }
2543
2544 static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
2545 {
2546         if (ndr_flags & NDR_SCALARS) {
2547                 NDR_CHECK(ndr_push_align(ndr, 4));
2548                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2549                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2550                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
2551                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2552                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2553                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2554                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2555                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2556                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2557                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2558                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2559                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2560                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2561                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2562         }
2563         if (ndr_flags & NDR_BUFFERS) {
2564                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2565                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2566                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2567                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2568                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2569                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2570                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2571         }
2572         return NDR_ERR_SUCCESS;
2573 }
2574
2575 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
2576 {
2577         if (ndr_flags & NDR_SCALARS) {
2578                 NDR_CHECK(ndr_pull_align(ndr, 4));
2579                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2580                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2581                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
2582                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2583                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2584                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2585                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2586                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2587                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2588                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2589                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2590                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2591                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2592                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2593         }
2594         if (ndr_flags & NDR_BUFFERS) {
2595                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2596                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2597                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2598                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2599                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2600                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2601                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2602         }
2603         return NDR_ERR_SUCCESS;
2604 }
2605
2606 _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r)
2607 {
2608         ndr_print_struct(ndr, name, "netr_DELTA_GROUP");
2609         ndr->depth++;
2610         ndr_print_lsa_String(ndr, "group_name", &r->group_name);
2611         ndr_print_uint32(ndr, "rid", r->rid);
2612         ndr_print_uint32(ndr, "attributes", r->attributes);
2613         ndr_print_lsa_String(ndr, "description", &r->description);
2614         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2615         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2616         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2617         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2618         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2619         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2620         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2621         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2622         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2623         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2624         ndr->depth--;
2625 }
2626
2627 static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
2628 {
2629         if (ndr_flags & NDR_SCALARS) {
2630                 NDR_CHECK(ndr_push_align(ndr, 4));
2631                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2632                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2633                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2634                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2635                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2636                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2637                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2638                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2639                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2640                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2641         }
2642         if (ndr_flags & NDR_BUFFERS) {
2643                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2644                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2645                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2646                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2647                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2648                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2649         }
2650         return NDR_ERR_SUCCESS;
2651 }
2652
2653 static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
2654 {
2655         if (ndr_flags & NDR_SCALARS) {
2656                 NDR_CHECK(ndr_pull_align(ndr, 4));
2657                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2658                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2659                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2660                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2661                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2662                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2663                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2664                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2665                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2666                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2667         }
2668         if (ndr_flags & NDR_BUFFERS) {
2669                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2670                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2671                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2672                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2673                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2674                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2675         }
2676         return NDR_ERR_SUCCESS;
2677 }
2678
2679 _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r)
2680 {
2681         ndr_print_struct(ndr, name, "netr_DELTA_RENAME");
2682         ndr->depth++;
2683         ndr_print_lsa_String(ndr, "OldName", &r->OldName);
2684         ndr_print_lsa_String(ndr, "NewName", &r->NewName);
2685         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2686         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2687         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2688         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2689         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2690         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2691         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2692         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2693         ndr->depth--;
2694 }
2695
2696 static enum ndr_err_code ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r)
2697 {
2698         uint32_t cntr_rids_1;
2699         uint32_t cntr_attribs_1;
2700         if (ndr_flags & NDR_SCALARS) {
2701                 NDR_CHECK(ndr_push_align(ndr, 4));
2702                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
2703                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs));
2704                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2705                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
2706                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
2707                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
2708                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
2709         }
2710         if (ndr_flags & NDR_BUFFERS) {
2711                 if (r->rids) {
2712                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2713                         for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
2714                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
2715                         }
2716                 }
2717                 if (r->attribs) {
2718                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2719                         for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
2720                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1]));
2721                         }
2722                 }
2723         }
2724         return NDR_ERR_SUCCESS;
2725 }
2726
2727 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
2728 {
2729         uint32_t _ptr_rids;
2730         uint32_t cntr_rids_1;
2731         TALLOC_CTX *_mem_save_rids_0;
2732         TALLOC_CTX *_mem_save_rids_1;
2733         uint32_t _ptr_attribs;
2734         uint32_t cntr_attribs_1;
2735         TALLOC_CTX *_mem_save_attribs_0;
2736         TALLOC_CTX *_mem_save_attribs_1;
2737         if (ndr_flags & NDR_SCALARS) {
2738                 NDR_CHECK(ndr_pull_align(ndr, 4));
2739                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
2740                 if (_ptr_rids) {
2741                         NDR_PULL_ALLOC(ndr, r->rids);
2742                 } else {
2743                         r->rids = NULL;
2744                 }
2745                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs));
2746                 if (_ptr_attribs) {
2747                         NDR_PULL_ALLOC(ndr, r->attribs);
2748                 } else {
2749                         r->attribs = NULL;
2750                 }
2751                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
2752                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
2753                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
2754                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
2755                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
2756         }
2757         if (ndr_flags & NDR_BUFFERS) {
2758                 if (r->rids) {
2759                         _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2760                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
2761                         NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
2762                         NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
2763                         _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
2764                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
2765                         for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
2766                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
2767                         }
2768                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
2769                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
2770                 }
2771                 if (r->attribs) {
2772                         _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr);
2773                         NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
2774                         NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs));
2775                         NDR_PULL_ALLOC_N(ndr, r->attribs, ndr_get_array_size(ndr, &r->attribs));
2776                         _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr);
2777                         NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
2778                         for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
2779                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1]));
2780                         }
2781                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0);
2782                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0);
2783                 }
2784                 if (r->rids) {
2785                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
2786                 }
2787                 if (r->attribs) {
2788                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids));
2789                 }
2790         }
2791         return NDR_ERR_SUCCESS;
2792 }
2793
2794 _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r)
2795 {
2796         uint32_t cntr_rids_1;
2797         uint32_t cntr_attribs_1;
2798         ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER");
2799         ndr->depth++;
2800         ndr_print_ptr(ndr, "rids", r->rids);
2801         ndr->depth++;
2802         if (r->rids) {
2803                 ndr->print(ndr, "%s: ARRAY(%d)", "rids", r->num_rids);
2804                 ndr->depth++;
2805                 for (cntr_rids_1=0;cntr_rids_1<r->num_rids;cntr_rids_1++) {
2806                         char *idx_1=NULL;
2807                         if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
2808                                 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
2809                                 free(idx_1);
2810                         }
2811                 }
2812                 ndr->depth--;
2813         }
2814         ndr->depth--;
2815         ndr_print_ptr(ndr, "attribs", r->attribs);
2816         ndr->depth++;
2817         if (r->attribs) {
2818                 ndr->print(ndr, "%s: ARRAY(%d)", "attribs", r->num_rids);
2819                 ndr->depth++;
2820                 for (cntr_attribs_1=0;cntr_attribs_1<r->num_rids;cntr_attribs_1++) {
2821                         char *idx_1=NULL;
2822                         if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) {
2823                                 ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]);
2824                                 free(idx_1);
2825                         }
2826                 }
2827                 ndr->depth--;
2828         }