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