81fc9aca9bd90055cd206f1e575496ad2a867273
[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_DONT_TRY_GUEST_ACCOUNT", MSV1_0_DONT_TRY_GUEST_ACCOUNT, r);
300         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT", MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT, r);
301         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PASSWORD_EXPIRY", MSV1_0_RETURN_PASSWORD_EXPIRY, r);
302         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_CLIENT_CHALLENGE", MSV1_0_USE_CLIENT_CHALLENGE, r);
303         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_GUEST_ACCOUNT_ONLY", MSV1_0_TRY_GUEST_ACCOUNT_ONLY, r);
304         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_RETURN_PROFILE_PATH", MSV1_0_RETURN_PROFILE_PATH, r);
305         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY", MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY, r);
306         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT", MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, r);
307         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_DISABLE_PERSONAL_FALLBACK", MSV1_0_DISABLE_PERSONAL_FALLBACK, r);
308         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_FORCE_GUEST", MSV1_0_ALLOW_FORCE_GUEST, r);
309         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED", MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED, r);
310         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY", MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY, r);
311         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_ALLOW_MSVCHAPV2", MSV1_0_ALLOW_MSVCHAPV2, r);
312         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_S4U2SELF", MSV1_0_S4U2SELF, r);
313         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_CHECK_LOGONHOURS_FOR_S4U", MSV1_0_CHECK_LOGONHOURS_FOR_S4U, r);
314         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "MSV1_0_SUBAUTHENTICATION_DLL_EX", MSV1_0_SUBAUTHENTICATION_DLL_EX, r);
315         ndr->depth--;
316 }
317
318 static enum ndr_err_code ndr_push_netr_IdentityInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_IdentityInfo *r)
319 {
320         if (ndr_flags & NDR_SCALARS) {
321                 NDR_CHECK(ndr_push_align(ndr, 4));
322                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
323                 NDR_CHECK(ndr_push_netr_LogonParameterControl(ndr, NDR_SCALARS, r->parameter_control));
324                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_low));
325                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_id_high));
326                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
327                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstation));
328         }
329         if (ndr_flags & NDR_BUFFERS) {
330                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
331                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
332                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
333         }
334         return NDR_ERR_SUCCESS;
335 }
336
337 static enum ndr_err_code ndr_pull_netr_IdentityInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_IdentityInfo *r)
338 {
339         if (ndr_flags & NDR_SCALARS) {
340                 NDR_CHECK(ndr_pull_align(ndr, 4));
341                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
342                 NDR_CHECK(ndr_pull_netr_LogonParameterControl(ndr, NDR_SCALARS, &r->parameter_control));
343                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_low));
344                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_id_high));
345                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
346                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstation));
347         }
348         if (ndr_flags & NDR_BUFFERS) {
349                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
350                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
351                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstation));
352         }
353         return NDR_ERR_SUCCESS;
354 }
355
356 _PUBLIC_ void ndr_print_netr_IdentityInfo(struct ndr_print *ndr, const char *name, const struct netr_IdentityInfo *r)
357 {
358         ndr_print_struct(ndr, name, "netr_IdentityInfo");
359         ndr->depth++;
360         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
361         ndr_print_netr_LogonParameterControl(ndr, "parameter_control", r->parameter_control);
362         ndr_print_uint32(ndr, "logon_id_low", r->logon_id_low);
363         ndr_print_uint32(ndr, "logon_id_high", r->logon_id_high);
364         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
365         ndr_print_lsa_String(ndr, "workstation", &r->workstation);
366         ndr->depth--;
367 }
368
369 static enum ndr_err_code ndr_push_netr_PasswordInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordInfo *r)
370 {
371         if (ndr_flags & NDR_SCALARS) {
372                 NDR_CHECK(ndr_push_align(ndr, 4));
373                 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
374                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
375                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
376         }
377         if (ndr_flags & NDR_BUFFERS) {
378                 NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
379         }
380         return NDR_ERR_SUCCESS;
381 }
382
383 static enum ndr_err_code ndr_pull_netr_PasswordInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordInfo *r)
384 {
385         if (ndr_flags & NDR_SCALARS) {
386                 NDR_CHECK(ndr_pull_align(ndr, 4));
387                 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
388                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
389                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
390         }
391         if (ndr_flags & NDR_BUFFERS) {
392                 NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
393         }
394         return NDR_ERR_SUCCESS;
395 }
396
397 _PUBLIC_ void ndr_print_netr_PasswordInfo(struct ndr_print *ndr, const char *name, const struct netr_PasswordInfo *r)
398 {
399         ndr_print_struct(ndr, name, "netr_PasswordInfo");
400         ndr->depth++;
401         ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
402         ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
403         ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
404         ndr->depth--;
405 }
406
407 static enum ndr_err_code ndr_push_netr_ChallengeResponse(struct ndr_push *ndr, int ndr_flags, const struct netr_ChallengeResponse *r)
408 {
409         {
410                 uint32_t _flags_save_STRUCT = ndr->flags;
411                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
412                 if (ndr_flags & NDR_SCALARS) {
413                         NDR_CHECK(ndr_push_align(ndr, 4));
414                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
415                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
416                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
417                 }
418                 if (ndr_flags & NDR_BUFFERS) {
419                         if (r->data) {
420                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
421                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
422                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
423                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
424                         }
425                 }
426                 ndr->flags = _flags_save_STRUCT;
427         }
428         return NDR_ERR_SUCCESS;
429 }
430
431 static enum ndr_err_code ndr_pull_netr_ChallengeResponse(struct ndr_pull *ndr, int ndr_flags, struct netr_ChallengeResponse *r)
432 {
433         uint32_t _ptr_data;
434         TALLOC_CTX *_mem_save_data_0;
435         {
436                 uint32_t _flags_save_STRUCT = ndr->flags;
437                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
438                 if (ndr_flags & NDR_SCALARS) {
439                         NDR_CHECK(ndr_pull_align(ndr, 4));
440                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
441                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
442                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
443                         if (_ptr_data) {
444                                 NDR_PULL_ALLOC(ndr, r->data);
445                         } else {
446                                 r->data = NULL;
447                         }
448                 }
449                 if (ndr_flags & NDR_BUFFERS) {
450                         if (r->data) {
451                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
452                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
453                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
454                                 NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
455                                 if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) {
456                                         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));
457                                 }
458                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
459                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data)));
460                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
461                         }
462                         if (r->data) {
463                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
464                         }
465                         if (r->data) {
466                                 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length));
467                         }
468                 }
469                 ndr->flags = _flags_save_STRUCT;
470         }
471         return NDR_ERR_SUCCESS;
472 }
473
474 _PUBLIC_ void ndr_print_netr_ChallengeResponse(struct ndr_print *ndr, const char *name, const struct netr_ChallengeResponse *r)
475 {
476         ndr_print_struct(ndr, name, "netr_ChallengeResponse");
477         {
478                 uint32_t _flags_save_STRUCT = ndr->flags;
479                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
480                 ndr->depth++;
481                 ndr_print_uint16(ndr, "length", r->length);
482                 ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
483                 ndr_print_ptr(ndr, "data", r->data);
484                 ndr->depth++;
485                 if (r->data) {
486                         ndr_print_array_uint8(ndr, "data", r->data, r->length);
487                 }
488                 ndr->depth--;
489                 ndr->depth--;
490                 ndr->flags = _flags_save_STRUCT;
491         }
492 }
493
494 static enum ndr_err_code ndr_push_netr_NetworkInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_NetworkInfo *r)
495 {
496         {
497                 uint32_t _flags_save_STRUCT = ndr->flags;
498                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
499                 if (ndr_flags & NDR_SCALARS) {
500                         NDR_CHECK(ndr_push_align(ndr, 4));
501                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
502                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
503                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
504                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
505                 }
506                 if (ndr_flags & NDR_BUFFERS) {
507                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
508                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
509                         NDR_CHECK(ndr_push_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
510                 }
511                 ndr->flags = _flags_save_STRUCT;
512         }
513         return NDR_ERR_SUCCESS;
514 }
515
516 static enum ndr_err_code ndr_pull_netr_NetworkInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_NetworkInfo *r)
517 {
518         {
519                 uint32_t _flags_save_STRUCT = ndr->flags;
520                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
521                 if (ndr_flags & NDR_SCALARS) {
522                         NDR_CHECK(ndr_pull_align(ndr, 4));
523                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
524                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->challenge, 8));
525                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->nt));
526                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_SCALARS, &r->lm));
527                 }
528                 if (ndr_flags & NDR_BUFFERS) {
529                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
530                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->nt));
531                         NDR_CHECK(ndr_pull_netr_ChallengeResponse(ndr, NDR_BUFFERS, &r->lm));
532                 }
533                 ndr->flags = _flags_save_STRUCT;
534         }
535         return NDR_ERR_SUCCESS;
536 }
537
538 _PUBLIC_ void ndr_print_netr_NetworkInfo(struct ndr_print *ndr, const char *name, const struct netr_NetworkInfo *r)
539 {
540         ndr_print_struct(ndr, name, "netr_NetworkInfo");
541         {
542                 uint32_t _flags_save_STRUCT = ndr->flags;
543                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
544                 ndr->depth++;
545                 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
546                 ndr_print_array_uint8(ndr, "challenge", r->challenge, 8);
547                 ndr_print_netr_ChallengeResponse(ndr, "nt", &r->nt);
548                 ndr_print_netr_ChallengeResponse(ndr, "lm", &r->lm);
549                 ndr->depth--;
550                 ndr->flags = _flags_save_STRUCT;
551         }
552 }
553
554 static enum ndr_err_code ndr_push_netr_GenericInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo *r)
555 {
556         {
557                 uint32_t _flags_save_STRUCT = ndr->flags;
558                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
559                 if (ndr_flags & NDR_SCALARS) {
560                         NDR_CHECK(ndr_push_align(ndr, 4));
561                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
562                         NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->package_name));
563                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
564                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
565                 }
566                 if (ndr_flags & NDR_BUFFERS) {
567                         NDR_CHECK(ndr_push_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
568                         NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
569                         if (r->data) {
570                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
571                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
572                         }
573                 }
574                 ndr->flags = _flags_save_STRUCT;
575         }
576         return NDR_ERR_SUCCESS;
577 }
578
579 static enum ndr_err_code ndr_pull_netr_GenericInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo *r)
580 {
581         uint32_t _ptr_data;
582         TALLOC_CTX *_mem_save_data_0;
583         {
584                 uint32_t _flags_save_STRUCT = ndr->flags;
585                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
586                 if (ndr_flags & NDR_SCALARS) {
587                         NDR_CHECK(ndr_pull_align(ndr, 4));
588                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_SCALARS, &r->identity_info));
589                         NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->package_name));
590                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
591                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
592                         if (_ptr_data) {
593                                 NDR_PULL_ALLOC(ndr, r->data);
594                         } else {
595                                 r->data = NULL;
596                         }
597                 }
598                 if (ndr_flags & NDR_BUFFERS) {
599                         NDR_CHECK(ndr_pull_netr_IdentityInfo(ndr, NDR_BUFFERS, &r->identity_info));
600                         NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->package_name));
601                         if (r->data) {
602                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
603                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
604                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
605                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
606                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
607                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
608                         }
609                         if (r->data) {
610                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
611                         }
612                 }
613                 ndr->flags = _flags_save_STRUCT;
614         }
615         return NDR_ERR_SUCCESS;
616 }
617
618 _PUBLIC_ void ndr_print_netr_GenericInfo(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo *r)
619 {
620         ndr_print_struct(ndr, name, "netr_GenericInfo");
621         {
622                 uint32_t _flags_save_STRUCT = ndr->flags;
623                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
624                 ndr->depth++;
625                 ndr_print_netr_IdentityInfo(ndr, "identity_info", &r->identity_info);
626                 ndr_print_lsa_String(ndr, "package_name", &r->package_name);
627                 ndr_print_uint32(ndr, "length", r->length);
628                 ndr_print_ptr(ndr, "data", r->data);
629                 ndr->depth++;
630                 if (r->data) {
631                         ndr_print_array_uint8(ndr, "data", r->data, r->length);
632                 }
633                 ndr->depth--;
634                 ndr->depth--;
635                 ndr->flags = _flags_save_STRUCT;
636         }
637 }
638
639 static enum ndr_err_code ndr_push_netr_LogonInfoClass(struct ndr_push *ndr, int ndr_flags, enum netr_LogonInfoClass r)
640 {
641         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
642         return NDR_ERR_SUCCESS;
643 }
644
645 static enum ndr_err_code ndr_pull_netr_LogonInfoClass(struct ndr_pull *ndr, int ndr_flags, enum netr_LogonInfoClass *r)
646 {
647         uint16_t v;
648         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
649         *r = v;
650         return NDR_ERR_SUCCESS;
651 }
652
653 _PUBLIC_ void ndr_print_netr_LogonInfoClass(struct ndr_print *ndr, const char *name, enum netr_LogonInfoClass r)
654 {
655         const char *val = NULL;
656
657         switch (r) {
658                 case NetlogonInteractiveInformation: val = "NetlogonInteractiveInformation"; break;
659                 case NetlogonNetworkInformation: val = "NetlogonNetworkInformation"; break;
660                 case NetlogonServiceInformation: val = "NetlogonServiceInformation"; break;
661                 case NetlogonGenericInformation: val = "NetlogonGenericInformation"; break;
662                 case NetlogonInteractiveTransitiveInformation: val = "NetlogonInteractiveTransitiveInformation"; break;
663                 case NetlogonNetworkTransitiveInformation: val = "NetlogonNetworkTransitiveInformation"; break;
664                 case NetlogonServiceTransitiveInformation: val = "NetlogonServiceTransitiveInformation"; break;
665         }
666         ndr_print_enum(ndr, name, "ENUM", val, r);
667 }
668
669 _PUBLIC_ enum ndr_err_code ndr_push_netr_LogonLevel(struct ndr_push *ndr, int ndr_flags, const union netr_LogonLevel *r)
670 {
671         if (ndr_flags & NDR_SCALARS) {
672                 int level = ndr_push_get_switch_value(ndr, r);
673                 NDR_CHECK(ndr_push_netr_LogonInfoClass(ndr, NDR_SCALARS, level));
674                 switch (level) {
675                         case NetlogonInteractiveInformation: {
676                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
677                         break; }
678
679                         case NetlogonNetworkInformation: {
680                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
681                         break; }
682
683                         case NetlogonServiceInformation: {
684                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
685                         break; }
686
687                         case NetlogonGenericInformation: {
688                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
689                         break; }
690
691                         case NetlogonInteractiveTransitiveInformation: {
692                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
693                         break; }
694
695                         case NetlogonNetworkTransitiveInformation: {
696                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->network));
697                         break; }
698
699                         case NetlogonServiceTransitiveInformation: {
700                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
701                         break; }
702
703                         default:
704                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
705                 }
706         }
707         if (ndr_flags & NDR_BUFFERS) {
708                 int level = ndr_push_get_switch_value(ndr, r);
709                 switch (level) {
710                         case NetlogonInteractiveInformation:
711                                 if (r->password) {
712                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
713                                 }
714                         break;
715
716                         case NetlogonNetworkInformation:
717                                 if (r->network) {
718                                         NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
719                                 }
720                         break;
721
722                         case NetlogonServiceInformation:
723                                 if (r->password) {
724                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
725                                 }
726                         break;
727
728                         case NetlogonGenericInformation:
729                                 if (r->generic) {
730                                         NDR_CHECK(ndr_push_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
731                                 }
732                         break;
733
734                         case NetlogonInteractiveTransitiveInformation:
735                                 if (r->password) {
736                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
737                                 }
738                         break;
739
740                         case NetlogonNetworkTransitiveInformation:
741                                 if (r->network) {
742                                         NDR_CHECK(ndr_push_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
743                                 }
744                         break;
745
746                         case NetlogonServiceTransitiveInformation:
747                                 if (r->password) {
748                                         NDR_CHECK(ndr_push_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
749                                 }
750                         break;
751
752                         default:
753                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
754                 }
755         }
756         return NDR_ERR_SUCCESS;
757 }
758
759 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LogonLevel(struct ndr_pull *ndr, int ndr_flags, union netr_LogonLevel *r)
760 {
761         int level;
762         uint16_t _level;
763         TALLOC_CTX *_mem_save_password_0;
764         TALLOC_CTX *_mem_save_network_0;
765         TALLOC_CTX *_mem_save_generic_0;
766         level = ndr_pull_get_switch_value(ndr, r);
767         if (ndr_flags & NDR_SCALARS) {
768                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
769                 if (_level != level) {
770                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
771                 }
772                 switch (level) {
773                         case NetlogonInteractiveInformation: {
774                                 uint32_t _ptr_password;
775                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
776                                 if (_ptr_password) {
777                                         NDR_PULL_ALLOC(ndr, r->password);
778                                 } else {
779                                         r->password = NULL;
780                                 }
781                         break; }
782
783                         case NetlogonNetworkInformation: {
784                                 uint32_t _ptr_network;
785                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
786                                 if (_ptr_network) {
787                                         NDR_PULL_ALLOC(ndr, r->network);
788                                 } else {
789                                         r->network = NULL;
790                                 }
791                         break; }
792
793                         case NetlogonServiceInformation: {
794                                 uint32_t _ptr_password;
795                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
796                                 if (_ptr_password) {
797                                         NDR_PULL_ALLOC(ndr, r->password);
798                                 } else {
799                                         r->password = NULL;
800                                 }
801                         break; }
802
803                         case NetlogonGenericInformation: {
804                                 uint32_t _ptr_generic;
805                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
806                                 if (_ptr_generic) {
807                                         NDR_PULL_ALLOC(ndr, r->generic);
808                                 } else {
809                                         r->generic = NULL;
810                                 }
811                         break; }
812
813                         case NetlogonInteractiveTransitiveInformation: {
814                                 uint32_t _ptr_password;
815                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
816                                 if (_ptr_password) {
817                                         NDR_PULL_ALLOC(ndr, r->password);
818                                 } else {
819                                         r->password = NULL;
820                                 }
821                         break; }
822
823                         case NetlogonNetworkTransitiveInformation: {
824                                 uint32_t _ptr_network;
825                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_network));
826                                 if (_ptr_network) {
827                                         NDR_PULL_ALLOC(ndr, r->network);
828                                 } else {
829                                         r->network = NULL;
830                                 }
831                         break; }
832
833                         case NetlogonServiceTransitiveInformation: {
834                                 uint32_t _ptr_password;
835                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
836                                 if (_ptr_password) {
837                                         NDR_PULL_ALLOC(ndr, r->password);
838                                 } else {
839                                         r->password = NULL;
840                                 }
841                         break; }
842
843                         default:
844                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
845                 }
846         }
847         if (ndr_flags & NDR_BUFFERS) {
848                 switch (level) {
849                         case NetlogonInteractiveInformation:
850                                 if (r->password) {
851                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
852                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
853                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
854                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
855                                 }
856                         break;
857
858                         case NetlogonNetworkInformation:
859                                 if (r->network) {
860                                         _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
861                                         NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
862                                         NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
863                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
864                                 }
865                         break;
866
867                         case NetlogonServiceInformation:
868                                 if (r->password) {
869                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
870                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
871                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
872                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
873                                 }
874                         break;
875
876                         case NetlogonGenericInformation:
877                                 if (r->generic) {
878                                         _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
879                                         NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
880                                         NDR_CHECK(ndr_pull_netr_GenericInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
881                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
882                                 }
883                         break;
884
885                         case NetlogonInteractiveTransitiveInformation:
886                                 if (r->password) {
887                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
888                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
889                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
890                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
891                                 }
892                         break;
893
894                         case NetlogonNetworkTransitiveInformation:
895                                 if (r->network) {
896                                         _mem_save_network_0 = NDR_PULL_GET_MEM_CTX(ndr);
897                                         NDR_PULL_SET_MEM_CTX(ndr, r->network, 0);
898                                         NDR_CHECK(ndr_pull_netr_NetworkInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->network));
899                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_network_0, 0);
900                                 }
901                         break;
902
903                         case NetlogonServiceTransitiveInformation:
904                                 if (r->password) {
905                                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
906                                         NDR_PULL_SET_MEM_CTX(ndr, r->password, 0);
907                                         NDR_CHECK(ndr_pull_netr_PasswordInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
908                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
909                                 }
910                         break;
911
912                         default:
913                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
914                 }
915         }
916         return NDR_ERR_SUCCESS;
917 }
918
919 _PUBLIC_ void ndr_print_netr_LogonLevel(struct ndr_print *ndr, const char *name, const union netr_LogonLevel *r)
920 {
921         int level;
922         level = ndr_print_get_switch_value(ndr, r);
923         ndr_print_union(ndr, name, level, "netr_LogonLevel");
924         switch (level) {
925                 case NetlogonInteractiveInformation:
926                         ndr_print_ptr(ndr, "password", r->password);
927                         ndr->depth++;
928                         if (r->password) {
929                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
930                         }
931                         ndr->depth--;
932                 break;
933
934                 case NetlogonNetworkInformation:
935                         ndr_print_ptr(ndr, "network", r->network);
936                         ndr->depth++;
937                         if (r->network) {
938                                 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
939                         }
940                         ndr->depth--;
941                 break;
942
943                 case NetlogonServiceInformation:
944                         ndr_print_ptr(ndr, "password", r->password);
945                         ndr->depth++;
946                         if (r->password) {
947                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
948                         }
949                         ndr->depth--;
950                 break;
951
952                 case NetlogonGenericInformation:
953                         ndr_print_ptr(ndr, "generic", r->generic);
954                         ndr->depth++;
955                         if (r->generic) {
956                                 ndr_print_netr_GenericInfo(ndr, "generic", r->generic);
957                         }
958                         ndr->depth--;
959                 break;
960
961                 case NetlogonInteractiveTransitiveInformation:
962                         ndr_print_ptr(ndr, "password", r->password);
963                         ndr->depth++;
964                         if (r->password) {
965                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
966                         }
967                         ndr->depth--;
968                 break;
969
970                 case NetlogonNetworkTransitiveInformation:
971                         ndr_print_ptr(ndr, "network", r->network);
972                         ndr->depth++;
973                         if (r->network) {
974                                 ndr_print_netr_NetworkInfo(ndr, "network", r->network);
975                         }
976                         ndr->depth--;
977                 break;
978
979                 case NetlogonServiceTransitiveInformation:
980                         ndr_print_ptr(ndr, "password", r->password);
981                         ndr->depth++;
982                         if (r->password) {
983                                 ndr_print_netr_PasswordInfo(ndr, "password", r->password);
984                         }
985                         ndr->depth--;
986                 break;
987
988                 default:
989                         ndr_print_bad_level(ndr, name, level);
990         }
991 }
992
993 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_UserSessionKey *r)
994 {
995         {
996                 uint32_t _flags_save_STRUCT = ndr->flags;
997                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
998                 if (ndr_flags & NDR_SCALARS) {
999                         NDR_CHECK(ndr_push_align(ndr, 1));
1000                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 16));
1001                 }
1002                 if (ndr_flags & NDR_BUFFERS) {
1003                 }
1004                 ndr->flags = _flags_save_STRUCT;
1005         }
1006         return NDR_ERR_SUCCESS;
1007 }
1008
1009 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_UserSessionKey *r)
1010 {
1011         {
1012                 uint32_t _flags_save_STRUCT = ndr->flags;
1013                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1014                 if (ndr_flags & NDR_SCALARS) {
1015                         NDR_CHECK(ndr_pull_align(ndr, 1));
1016                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 16));
1017                 }
1018                 if (ndr_flags & NDR_BUFFERS) {
1019                 }
1020                 ndr->flags = _flags_save_STRUCT;
1021         }
1022         return NDR_ERR_SUCCESS;
1023 }
1024
1025 _PUBLIC_ void ndr_print_netr_UserSessionKey(struct ndr_print *ndr, const char *name, const struct netr_UserSessionKey *r)
1026 {
1027         ndr_print_struct(ndr, name, "netr_UserSessionKey");
1028         {
1029                 uint32_t _flags_save_STRUCT = ndr->flags;
1030                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1031                 ndr->depth++;
1032                 ndr_print_array_uint8(ndr, "key", r->key, 16);
1033                 ndr->depth--;
1034                 ndr->flags = _flags_save_STRUCT;
1035         }
1036 }
1037
1038 _PUBLIC_ enum ndr_err_code ndr_push_netr_LMSessionKey(struct ndr_push *ndr, int ndr_flags, const struct netr_LMSessionKey *r)
1039 {
1040         {
1041                 uint32_t _flags_save_STRUCT = ndr->flags;
1042                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1043                 if (ndr_flags & NDR_SCALARS) {
1044                         NDR_CHECK(ndr_push_align(ndr, 1));
1045                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->key, 8));
1046                 }
1047                 if (ndr_flags & NDR_BUFFERS) {
1048                 }
1049                 ndr->flags = _flags_save_STRUCT;
1050         }
1051         return NDR_ERR_SUCCESS;
1052 }
1053
1054 _PUBLIC_ enum ndr_err_code ndr_pull_netr_LMSessionKey(struct ndr_pull *ndr, int ndr_flags, struct netr_LMSessionKey *r)
1055 {
1056         {
1057                 uint32_t _flags_save_STRUCT = ndr->flags;
1058                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1059                 if (ndr_flags & NDR_SCALARS) {
1060                         NDR_CHECK(ndr_pull_align(ndr, 1));
1061                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->key, 8));
1062                 }
1063                 if (ndr_flags & NDR_BUFFERS) {
1064                 }
1065                 ndr->flags = _flags_save_STRUCT;
1066         }
1067         return NDR_ERR_SUCCESS;
1068 }
1069
1070 _PUBLIC_ void ndr_print_netr_LMSessionKey(struct ndr_print *ndr, const char *name, const struct netr_LMSessionKey *r)
1071 {
1072         ndr_print_struct(ndr, name, "netr_LMSessionKey");
1073         {
1074                 uint32_t _flags_save_STRUCT = ndr->flags;
1075                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1076                 ndr->depth++;
1077                 ndr_print_array_uint8(ndr, "key", r->key, 8);
1078                 ndr->depth--;
1079                 ndr->flags = _flags_save_STRUCT;
1080         }
1081 }
1082
1083 _PUBLIC_ enum ndr_err_code ndr_push_netr_UserFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
1084 {
1085         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1086         return NDR_ERR_SUCCESS;
1087 }
1088
1089 _PUBLIC_ enum ndr_err_code ndr_pull_netr_UserFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
1090 {
1091         uint32_t v;
1092         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1093         *r = v;
1094         return NDR_ERR_SUCCESS;
1095 }
1096
1097 _PUBLIC_ void ndr_print_netr_UserFlags(struct ndr_print *ndr, const char *name, uint32_t r)
1098 {
1099         ndr_print_uint32(ndr, name, r);
1100         ndr->depth++;
1101         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GUEST", NETLOGON_GUEST, r);
1102         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NOENCRYPTION", NETLOGON_NOENCRYPTION, r);
1103         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_CACHED_ACCOUNT", NETLOGON_CACHED_ACCOUNT, r);
1104         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_USED_LM_PASSWORD", NETLOGON_USED_LM_PASSWORD, r);
1105         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_EXTRA_SIDS", NETLOGON_EXTRA_SIDS, r);
1106         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SUBAUTH_SESSION_KEY", NETLOGON_SUBAUTH_SESSION_KEY, r);
1107         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_SERVER_TRUST_ACCOUNT", NETLOGON_SERVER_TRUST_ACCOUNT, r);
1108         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_NTLMV2_ENABLED", NETLOGON_NTLMV2_ENABLED, r);
1109         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_RESOURCE_GROUPS", NETLOGON_RESOURCE_GROUPS, r);
1110         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_PROFILE_PATH_RETURNED", NETLOGON_PROFILE_PATH_RETURNED, r);
1111         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NETLOGON_GRACE_LOGON", NETLOGON_GRACE_LOGON, r);
1112         ndr->depth--;
1113 }
1114
1115 static enum ndr_err_code ndr_push_netr_SamBaseInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_SamBaseInfo *r)
1116 {
1117         uint32_t cntr_unknown_0;
1118         if (ndr_flags & NDR_SCALARS) {
1119                 NDR_CHECK(ndr_push_align(ndr, 4));
1120                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
1121                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
1122                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
1123                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
1124                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->allow_password_change));
1125                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->force_password_change));
1126                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1127                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1128                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1129                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1130                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1131                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1132                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
1133                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
1134                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
1135                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
1136                 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1137                 NDR_CHECK(ndr_push_netr_UserFlags(ndr, NDR_SCALARS, r->user_flags));
1138                 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1139                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1140                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1141                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domain_sid));
1142                 NDR_CHECK(ndr_push_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1143                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
1144                 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1145                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown[cntr_unknown_0]));
1146                 }
1147         }
1148         if (ndr_flags & NDR_BUFFERS) {
1149                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1150                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1151                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1152                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1153                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1154                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1155                 NDR_CHECK(ndr_push_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1156                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1157                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1158                 if (r->domain_sid) {
1159                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1160                 }
1161         }
1162         return NDR_ERR_SUCCESS;
1163 }
1164
1165 static enum ndr_err_code ndr_pull_netr_SamBaseInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_SamBaseInfo *r)
1166 {
1167         uint32_t _ptr_domain_sid;
1168         TALLOC_CTX *_mem_save_domain_sid_0;
1169         uint32_t cntr_unknown_0;
1170         if (ndr_flags & NDR_SCALARS) {
1171                 NDR_CHECK(ndr_pull_align(ndr, 4));
1172                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
1173                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
1174                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
1175                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
1176                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->allow_password_change));
1177                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->force_password_change));
1178                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
1179                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
1180                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
1181                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
1182                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
1183                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
1184                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
1185                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
1186                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
1187                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
1188                 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_SCALARS, &r->groups));
1189                 NDR_CHECK(ndr_pull_netr_UserFlags(ndr, NDR_SCALARS, &r->user_flags));
1190                 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->key));
1191                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->logon_server));
1192                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->domain));
1193                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_sid));
1194                 if (_ptr_domain_sid) {
1195                         NDR_PULL_ALLOC(ndr, r->domain_sid);
1196                 } else {
1197                         r->domain_sid = NULL;
1198                 }
1199                 NDR_CHECK(ndr_pull_netr_LMSessionKey(ndr, NDR_SCALARS, &r->LMSessKey));
1200                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
1201                 for (cntr_unknown_0 = 0; cntr_unknown_0 < 7; cntr_unknown_0++) {
1202                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown[cntr_unknown_0]));
1203                 }
1204         }
1205         if (ndr_flags & NDR_BUFFERS) {
1206                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
1207                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
1208                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
1209                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
1210                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
1211                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
1212                 NDR_CHECK(ndr_pull_samr_RidWithAttributeArray(ndr, NDR_BUFFERS, &r->groups));
1213                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->logon_server));
1214                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->domain));
1215                 if (r->domain_sid) {
1216                         _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1217                         NDR_PULL_SET_MEM_CTX(ndr, r->domain_sid, 0);
1218                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->domain_sid));
1219                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, 0);
1220                 }
1221         }
1222         return NDR_ERR_SUCCESS;
1223 }
1224
1225 _PUBLIC_ void ndr_print_netr_SamBaseInfo(struct ndr_print *ndr, const char *name, const struct netr_SamBaseInfo *r)
1226 {
1227         uint32_t cntr_unknown_0;
1228         ndr_print_struct(ndr, name, "netr_SamBaseInfo");
1229         ndr->depth++;
1230         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
1231         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
1232         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
1233         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
1234         ndr_print_NTTIME(ndr, "allow_password_change", r->allow_password_change);
1235         ndr_print_NTTIME(ndr, "force_password_change", r->force_password_change);
1236         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
1237         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
1238         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
1239         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
1240         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
1241         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
1242         ndr_print_uint16(ndr, "logon_count", r->logon_count);
1243         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
1244         ndr_print_uint32(ndr, "rid", r->rid);
1245         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
1246         ndr_print_samr_RidWithAttributeArray(ndr, "groups", &r->groups);
1247         ndr_print_netr_UserFlags(ndr, "user_flags", r->user_flags);
1248         ndr_print_netr_UserSessionKey(ndr, "key", &r->key);
1249         ndr_print_lsa_StringLarge(ndr, "logon_server", &r->logon_server);
1250         ndr_print_lsa_StringLarge(ndr, "domain", &r->domain);
1251         ndr_print_ptr(ndr, "domain_sid", r->domain_sid);
1252         ndr->depth++;
1253         if (r->domain_sid) {
1254                 ndr_print_dom_sid2(ndr, "domain_sid", r->domain_sid);
1255         }
1256         ndr->depth--;
1257         ndr_print_netr_LMSessionKey(ndr, "LMSessKey", &r->LMSessKey);
1258         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
1259         ndr->print(ndr, "%s: ARRAY(%d)", "unknown", (int)7);
1260         ndr->depth++;
1261         for (cntr_unknown_0=0;cntr_unknown_0<7;cntr_unknown_0++) {
1262                 char *idx_0=NULL;
1263                 if (asprintf(&idx_0, "[%d]", cntr_unknown_0) != -1) {
1264                         ndr_print_uint32(ndr, "unknown", r->unknown[cntr_unknown_0]);
1265                         free(idx_0);
1266                 }
1267         }
1268         ndr->depth--;
1269         ndr->depth--;
1270 }
1271
1272 static enum ndr_err_code ndr_push_netr_SamInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo2 *r)
1273 {
1274         if (ndr_flags & NDR_SCALARS) {
1275                 NDR_CHECK(ndr_push_align(ndr, 4));
1276                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1277         }
1278         if (ndr_flags & NDR_BUFFERS) {
1279                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1280         }
1281         return NDR_ERR_SUCCESS;
1282 }
1283
1284 static enum ndr_err_code ndr_pull_netr_SamInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo2 *r)
1285 {
1286         if (ndr_flags & NDR_SCALARS) {
1287                 NDR_CHECK(ndr_pull_align(ndr, 4));
1288                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1289         }
1290         if (ndr_flags & NDR_BUFFERS) {
1291                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1292         }
1293         return NDR_ERR_SUCCESS;
1294 }
1295
1296 _PUBLIC_ void ndr_print_netr_SamInfo2(struct ndr_print *ndr, const char *name, const struct netr_SamInfo2 *r)
1297 {
1298         ndr_print_struct(ndr, name, "netr_SamInfo2");
1299         ndr->depth++;
1300         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1301         ndr->depth--;
1302 }
1303
1304 static enum ndr_err_code ndr_push_netr_SidAttr(struct ndr_push *ndr, int ndr_flags, const struct netr_SidAttr *r)
1305 {
1306         if (ndr_flags & NDR_SCALARS) {
1307                 NDR_CHECK(ndr_push_align(ndr, 4));
1308                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1309                 NDR_CHECK(ndr_push_samr_GroupAttrs(ndr, NDR_SCALARS, r->attributes));
1310         }
1311         if (ndr_flags & NDR_BUFFERS) {
1312                 if (r->sid) {
1313                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1314                 }
1315         }
1316         return NDR_ERR_SUCCESS;
1317 }
1318
1319 static enum ndr_err_code ndr_pull_netr_SidAttr(struct ndr_pull *ndr, int ndr_flags, struct netr_SidAttr *r)
1320 {
1321         uint32_t _ptr_sid;
1322         TALLOC_CTX *_mem_save_sid_0;
1323         if (ndr_flags & NDR_SCALARS) {
1324                 NDR_CHECK(ndr_pull_align(ndr, 4));
1325                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1326                 if (_ptr_sid) {
1327                         NDR_PULL_ALLOC(ndr, r->sid);
1328                 } else {
1329                         r->sid = NULL;
1330                 }
1331                 NDR_CHECK(ndr_pull_samr_GroupAttrs(ndr, NDR_SCALARS, &r->attributes));
1332         }
1333         if (ndr_flags & NDR_BUFFERS) {
1334                 if (r->sid) {
1335                         _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1336                         NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1337                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1338                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1339                 }
1340         }
1341         return NDR_ERR_SUCCESS;
1342 }
1343
1344 _PUBLIC_ void ndr_print_netr_SidAttr(struct ndr_print *ndr, const char *name, const struct netr_SidAttr *r)
1345 {
1346         ndr_print_struct(ndr, name, "netr_SidAttr");
1347         ndr->depth++;
1348         ndr_print_ptr(ndr, "sid", r->sid);
1349         ndr->depth++;
1350         if (r->sid) {
1351                 ndr_print_dom_sid2(ndr, "sid", r->sid);
1352         }
1353         ndr->depth--;
1354         ndr_print_samr_GroupAttrs(ndr, "attributes", r->attributes);
1355         ndr->depth--;
1356 }
1357
1358 _PUBLIC_ enum ndr_err_code ndr_push_netr_SamInfo3(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo3 *r)
1359 {
1360         uint32_t cntr_sids_1;
1361         if (ndr_flags & NDR_SCALARS) {
1362                 NDR_CHECK(ndr_push_align(ndr, 4));
1363                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1364                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1365                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1366         }
1367         if (ndr_flags & NDR_BUFFERS) {
1368                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1369                 if (r->sids) {
1370                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1371                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1372                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1373                         }
1374                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1375                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1376                         }
1377                 }
1378         }
1379         return NDR_ERR_SUCCESS;
1380 }
1381
1382 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SamInfo3(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo3 *r)
1383 {
1384         uint32_t _ptr_sids;
1385         uint32_t cntr_sids_1;
1386         TALLOC_CTX *_mem_save_sids_0;
1387         TALLOC_CTX *_mem_save_sids_1;
1388         if (ndr_flags & NDR_SCALARS) {
1389                 NDR_CHECK(ndr_pull_align(ndr, 4));
1390                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1391                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1392                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1393                 if (_ptr_sids) {
1394                         NDR_PULL_ALLOC(ndr, r->sids);
1395                 } else {
1396                         r->sids = NULL;
1397                 }
1398         }
1399         if (ndr_flags & NDR_BUFFERS) {
1400                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1401                 if (r->sids) {
1402                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1403                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1404                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1405                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1406                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1407                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1408                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1409                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1410                         }
1411                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1412                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1413                         }
1414                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1415                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1416                 }
1417                 if (r->sids) {
1418                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1419                 }
1420         }
1421         return NDR_ERR_SUCCESS;
1422 }
1423
1424 _PUBLIC_ void ndr_print_netr_SamInfo3(struct ndr_print *ndr, const char *name, const struct netr_SamInfo3 *r)
1425 {
1426         uint32_t cntr_sids_1;
1427         ndr_print_struct(ndr, name, "netr_SamInfo3");
1428         ndr->depth++;
1429         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1430         ndr_print_uint32(ndr, "sidcount", r->sidcount);
1431         ndr_print_ptr(ndr, "sids", r->sids);
1432         ndr->depth++;
1433         if (r->sids) {
1434                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1435                 ndr->depth++;
1436                 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1437                         char *idx_1=NULL;
1438                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1439                                 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1440                                 free(idx_1);
1441                         }
1442                 }
1443                 ndr->depth--;
1444         }
1445         ndr->depth--;
1446         ndr->depth--;
1447 }
1448
1449 static enum ndr_err_code ndr_push_netr_SamInfo6(struct ndr_push *ndr, int ndr_flags, const struct netr_SamInfo6 *r)
1450 {
1451         uint32_t cntr_sids_1;
1452         uint32_t cntr_unknown4_0;
1453         if (ndr_flags & NDR_SCALARS) {
1454                 NDR_CHECK(ndr_push_align(ndr, 4));
1455                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1456                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1457                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1458                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->forest));
1459                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principle));
1460                 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1461                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4[cntr_unknown4_0]));
1462                 }
1463         }
1464         if (ndr_flags & NDR_BUFFERS) {
1465                 NDR_CHECK(ndr_push_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1466                 if (r->sids) {
1467                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sidcount));
1468                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1469                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1470                         }
1471                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1472                                 NDR_CHECK(ndr_push_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1473                         }
1474                 }
1475                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1476                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1477         }
1478         return NDR_ERR_SUCCESS;
1479 }
1480
1481 static enum ndr_err_code ndr_pull_netr_SamInfo6(struct ndr_pull *ndr, int ndr_flags, struct netr_SamInfo6 *r)
1482 {
1483         uint32_t _ptr_sids;
1484         uint32_t cntr_sids_1;
1485         TALLOC_CTX *_mem_save_sids_0;
1486         TALLOC_CTX *_mem_save_sids_1;
1487         uint32_t cntr_unknown4_0;
1488         if (ndr_flags & NDR_SCALARS) {
1489                 NDR_CHECK(ndr_pull_align(ndr, 4));
1490                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_SCALARS, &r->base));
1491                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sidcount));
1492                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1493                 if (_ptr_sids) {
1494                         NDR_PULL_ALLOC(ndr, r->sids);
1495                 } else {
1496                         r->sids = NULL;
1497                 }
1498                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->forest));
1499                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principle));
1500                 for (cntr_unknown4_0 = 0; cntr_unknown4_0 < 20; cntr_unknown4_0++) {
1501                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4[cntr_unknown4_0]));
1502                 }
1503         }
1504         if (ndr_flags & NDR_BUFFERS) {
1505                 NDR_CHECK(ndr_pull_netr_SamBaseInfo(ndr, NDR_BUFFERS, &r->base));
1506                 if (r->sids) {
1507                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1508                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1509                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1510                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1511                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1512                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1513                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1514                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1515                         }
1516                         for (cntr_sids_1 = 0; cntr_sids_1 < r->sidcount; cntr_sids_1++) {
1517                                 NDR_CHECK(ndr_pull_netr_SidAttr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1518                         }
1519                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1520                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1521                 }
1522                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->forest));
1523                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principle));
1524                 if (r->sids) {
1525                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->sidcount));
1526                 }
1527         }
1528         return NDR_ERR_SUCCESS;
1529 }
1530
1531 _PUBLIC_ void ndr_print_netr_SamInfo6(struct ndr_print *ndr, const char *name, const struct netr_SamInfo6 *r)
1532 {
1533         uint32_t cntr_sids_1;
1534         uint32_t cntr_unknown4_0;
1535         ndr_print_struct(ndr, name, "netr_SamInfo6");
1536         ndr->depth++;
1537         ndr_print_netr_SamBaseInfo(ndr, "base", &r->base);
1538         ndr_print_uint32(ndr, "sidcount", r->sidcount);
1539         ndr_print_ptr(ndr, "sids", r->sids);
1540         ndr->depth++;
1541         if (r->sids) {
1542                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->sidcount);
1543                 ndr->depth++;
1544                 for (cntr_sids_1=0;cntr_sids_1<r->sidcount;cntr_sids_1++) {
1545                         char *idx_1=NULL;
1546                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1547                                 ndr_print_netr_SidAttr(ndr, "sids", &r->sids[cntr_sids_1]);
1548                                 free(idx_1);
1549                         }
1550                 }
1551                 ndr->depth--;
1552         }
1553         ndr->depth--;
1554         ndr_print_lsa_String(ndr, "forest", &r->forest);
1555         ndr_print_lsa_String(ndr, "principle", &r->principle);
1556         ndr->print(ndr, "%s: ARRAY(%d)", "unknown4", (int)20);
1557         ndr->depth++;
1558         for (cntr_unknown4_0=0;cntr_unknown4_0<20;cntr_unknown4_0++) {
1559                 char *idx_0=NULL;
1560                 if (asprintf(&idx_0, "[%d]", cntr_unknown4_0) != -1) {
1561                         ndr_print_uint32(ndr, "unknown4", r->unknown4[cntr_unknown4_0]);
1562                         free(idx_0);
1563                 }
1564         }
1565         ndr->depth--;
1566         ndr->depth--;
1567 }
1568
1569 static enum ndr_err_code ndr_push_netr_PacInfo(struct ndr_push *ndr, int ndr_flags, const struct netr_PacInfo *r)
1570 {
1571         uint32_t cntr_expansionroom_0;
1572         if (ndr_flags & NDR_SCALARS) {
1573                 NDR_CHECK(ndr_push_align(ndr, 4));
1574                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1575                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1576                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1577                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1578                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1579                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1580                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->auth));
1581                 NDR_CHECK(ndr_push_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1582                 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1583                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->expansionroom[cntr_expansionroom_0]));
1584                 }
1585                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1586                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1587                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1588                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1589         }
1590         if (ndr_flags & NDR_BUFFERS) {
1591                 if (r->pac) {
1592                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pac_size));
1593                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->pac, r->pac_size));
1594                 }
1595                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1596                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1597                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1598                 if (r->auth) {
1599                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auth_size));
1600                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->auth, r->auth_size));
1601                 }
1602                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1603                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1604                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1605                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1606         }
1607         return NDR_ERR_SUCCESS;
1608 }
1609
1610 static enum ndr_err_code ndr_pull_netr_PacInfo(struct ndr_pull *ndr, int ndr_flags, struct netr_PacInfo *r)
1611 {
1612         uint32_t _ptr_pac;
1613         TALLOC_CTX *_mem_save_pac_0;
1614         uint32_t _ptr_auth;
1615         TALLOC_CTX *_mem_save_auth_0;
1616         uint32_t cntr_expansionroom_0;
1617         if (ndr_flags & NDR_SCALARS) {
1618                 NDR_CHECK(ndr_pull_align(ndr, 4));
1619                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pac_size));
1620                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1621                 if (_ptr_pac) {
1622                         NDR_PULL_ALLOC(ndr, r->pac);
1623                 } else {
1624                         r->pac = NULL;
1625                 }
1626                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_domain));
1627                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_server));
1628                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->principal_name));
1629                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auth_size));
1630                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_auth));
1631                 if (_ptr_auth) {
1632                         NDR_PULL_ALLOC(ndr, r->auth);
1633                 } else {
1634                         r->auth = NULL;
1635                 }
1636                 NDR_CHECK(ndr_pull_netr_UserSessionKey(ndr, NDR_SCALARS, &r->user_session_key));
1637                 for (cntr_expansionroom_0 = 0; cntr_expansionroom_0 < 10; cntr_expansionroom_0++) {
1638                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->expansionroom[cntr_expansionroom_0]));
1639                 }
1640                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
1641                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
1642                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
1643                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
1644         }
1645         if (ndr_flags & NDR_BUFFERS) {
1646                 if (r->pac) {
1647                         _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1648                         NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1649                         NDR_CHECK(ndr_pull_array_size(ndr, &r->pac));
1650                         NDR_PULL_ALLOC_N(ndr, r->pac, ndr_get_array_size(ndr, &r->pac));
1651                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->pac, ndr_get_array_size(ndr, &r->pac)));
1652                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1653                 }
1654                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_domain));
1655                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_server));
1656                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->principal_name));
1657                 if (r->auth) {
1658                         _mem_save_auth_0 = NDR_PULL_GET_MEM_CTX(ndr);
1659                         NDR_PULL_SET_MEM_CTX(ndr, r->auth, 0);
1660                         NDR_CHECK(ndr_pull_array_size(ndr, &r->auth));
1661                         NDR_PULL_ALLOC_N(ndr, r->auth, ndr_get_array_size(ndr, &r->auth));
1662                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->auth, ndr_get_array_size(ndr, &r->auth)));
1663                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_auth_0, 0);
1664                 }
1665                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
1666                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
1667                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
1668                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
1669                 if (r->pac) {
1670                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->pac, r->pac_size));
1671                 }
1672                 if (r->auth) {
1673                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->auth, r->auth_size));
1674                 }
1675         }
1676         return NDR_ERR_SUCCESS;
1677 }
1678
1679 _PUBLIC_ void ndr_print_netr_PacInfo(struct ndr_print *ndr, const char *name, const struct netr_PacInfo *r)
1680 {
1681         uint32_t cntr_expansionroom_0;
1682         ndr_print_struct(ndr, name, "netr_PacInfo");
1683         ndr->depth++;
1684         ndr_print_uint32(ndr, "pac_size", r->pac_size);
1685         ndr_print_ptr(ndr, "pac", r->pac);
1686         ndr->depth++;
1687         if (r->pac) {
1688                 ndr_print_array_uint8(ndr, "pac", r->pac, r->pac_size);
1689         }
1690         ndr->depth--;
1691         ndr_print_lsa_String(ndr, "logon_domain", &r->logon_domain);
1692         ndr_print_lsa_String(ndr, "logon_server", &r->logon_server);
1693         ndr_print_lsa_String(ndr, "principal_name", &r->principal_name);
1694         ndr_print_uint32(ndr, "auth_size", r->auth_size);
1695         ndr_print_ptr(ndr, "auth", r->auth);
1696         ndr->depth++;
1697         if (r->auth) {
1698                 ndr_print_array_uint8(ndr, "auth", r->auth, r->auth_size);
1699         }
1700         ndr->depth--;
1701         ndr_print_netr_UserSessionKey(ndr, "user_session_key", &r->user_session_key);
1702         ndr->print(ndr, "%s: ARRAY(%d)", "expansionroom", (int)10);
1703         ndr->depth++;
1704         for (cntr_expansionroom_0=0;cntr_expansionroom_0<10;cntr_expansionroom_0++) {
1705                 char *idx_0=NULL;
1706                 if (asprintf(&idx_0, "[%d]", cntr_expansionroom_0) != -1) {
1707                         ndr_print_uint32(ndr, "expansionroom", r->expansionroom[cntr_expansionroom_0]);
1708                         free(idx_0);
1709                 }
1710         }
1711         ndr->depth--;
1712         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
1713         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
1714         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
1715         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
1716         ndr->depth--;
1717 }
1718
1719 static enum ndr_err_code ndr_push_netr_GenericInfo2(struct ndr_push *ndr, int ndr_flags, const struct netr_GenericInfo2 *r)
1720 {
1721         {
1722                 uint32_t _flags_save_STRUCT = ndr->flags;
1723                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1724                 if (ndr_flags & NDR_SCALARS) {
1725                         NDR_CHECK(ndr_push_align(ndr, 4));
1726                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
1727                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
1728                 }
1729                 if (ndr_flags & NDR_BUFFERS) {
1730                         if (r->data) {
1731                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
1732                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
1733                         }
1734                 }
1735                 ndr->flags = _flags_save_STRUCT;
1736         }
1737         return NDR_ERR_SUCCESS;
1738 }
1739
1740 static enum ndr_err_code ndr_pull_netr_GenericInfo2(struct ndr_pull *ndr, int ndr_flags, struct netr_GenericInfo2 *r)
1741 {
1742         uint32_t _ptr_data;
1743         TALLOC_CTX *_mem_save_data_0;
1744         {
1745                 uint32_t _flags_save_STRUCT = ndr->flags;
1746                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1747                 if (ndr_flags & NDR_SCALARS) {
1748                         NDR_CHECK(ndr_pull_align(ndr, 4));
1749                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
1750                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1751                         if (_ptr_data) {
1752                                 NDR_PULL_ALLOC(ndr, r->data);
1753                         } else {
1754                                 r->data = NULL;
1755                         }
1756                 }
1757                 if (ndr_flags & NDR_BUFFERS) {
1758                         if (r->data) {
1759                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1760                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
1761                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
1762                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
1763                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
1764                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
1765                         }
1766                         if (r->data) {
1767                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->length));
1768                         }
1769                 }
1770                 ndr->flags = _flags_save_STRUCT;
1771         }
1772         return NDR_ERR_SUCCESS;
1773 }
1774
1775 _PUBLIC_ void ndr_print_netr_GenericInfo2(struct ndr_print *ndr, const char *name, const struct netr_GenericInfo2 *r)
1776 {
1777         ndr_print_struct(ndr, name, "netr_GenericInfo2");
1778         {
1779                 uint32_t _flags_save_STRUCT = ndr->flags;
1780                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1781                 ndr->depth++;
1782                 ndr_print_uint32(ndr, "length", r->length);
1783                 ndr_print_ptr(ndr, "data", r->data);
1784                 ndr->depth++;
1785                 if (r->data) {
1786                         ndr_print_array_uint8(ndr, "data", r->data, r->length);
1787                 }
1788                 ndr->depth--;
1789                 ndr->depth--;
1790                 ndr->flags = _flags_save_STRUCT;
1791         }
1792 }
1793
1794 _PUBLIC_ enum ndr_err_code ndr_push_netr_Validation(struct ndr_push *ndr, int ndr_flags, const union netr_Validation *r)
1795 {
1796         if (ndr_flags & NDR_SCALARS) {
1797                 int level = ndr_push_get_switch_value(ndr, r);
1798                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
1799                 switch (level) {
1800                         case NetlogonValidationSamInfo: {
1801                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam2));
1802                         break; }
1803
1804                         case NetlogonValidationSamInfo2: {
1805                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam3));
1806                         break; }
1807
1808                         case 4: {
1809                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pac));
1810                         break; }
1811
1812                         case NetlogonValidationGenericInfo2: {
1813                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->generic));
1814                         break; }
1815
1816                         case NetlogonValidationSamInfo4: {
1817                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam6));
1818                         break; }
1819
1820                         default:
1821                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1822                 }
1823         }
1824         if (ndr_flags & NDR_BUFFERS) {
1825                 int level = ndr_push_get_switch_value(ndr, r);
1826                 switch (level) {
1827                         case NetlogonValidationSamInfo:
1828                                 if (r->sam2) {
1829                                         NDR_CHECK(ndr_push_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1830                                 }
1831                         break;
1832
1833                         case NetlogonValidationSamInfo2:
1834                                 if (r->sam3) {
1835                                         NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1836                                 }
1837                         break;
1838
1839                         case 4:
1840                                 if (r->pac) {
1841                                         NDR_CHECK(ndr_push_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1842                                 }
1843                         break;
1844
1845                         case NetlogonValidationGenericInfo2:
1846                                 if (r->generic) {
1847                                         NDR_CHECK(ndr_push_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
1848                                 }
1849                         break;
1850
1851                         case NetlogonValidationSamInfo4:
1852                                 if (r->sam6) {
1853                                         NDR_CHECK(ndr_push_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1854                                 }
1855                         break;
1856
1857                         default:
1858                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1859                 }
1860         }
1861         return NDR_ERR_SUCCESS;
1862 }
1863
1864 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Validation(struct ndr_pull *ndr, int ndr_flags, union netr_Validation *r)
1865 {
1866         int level;
1867         uint16_t _level;
1868         TALLOC_CTX *_mem_save_sam2_0;
1869         TALLOC_CTX *_mem_save_sam3_0;
1870         TALLOC_CTX *_mem_save_pac_0;
1871         TALLOC_CTX *_mem_save_generic_0;
1872         TALLOC_CTX *_mem_save_sam6_0;
1873         level = ndr_pull_get_switch_value(ndr, r);
1874         if (ndr_flags & NDR_SCALARS) {
1875                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1876                 if (_level != level) {
1877                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
1878                 }
1879                 switch (level) {
1880                         case NetlogonValidationSamInfo: {
1881                                 uint32_t _ptr_sam2;
1882                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam2));
1883                                 if (_ptr_sam2) {
1884                                         NDR_PULL_ALLOC(ndr, r->sam2);
1885                                 } else {
1886                                         r->sam2 = NULL;
1887                                 }
1888                         break; }
1889
1890                         case NetlogonValidationSamInfo2: {
1891                                 uint32_t _ptr_sam3;
1892                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam3));
1893                                 if (_ptr_sam3) {
1894                                         NDR_PULL_ALLOC(ndr, r->sam3);
1895                                 } else {
1896                                         r->sam3 = NULL;
1897                                 }
1898                         break; }
1899
1900                         case 4: {
1901                                 uint32_t _ptr_pac;
1902                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pac));
1903                                 if (_ptr_pac) {
1904                                         NDR_PULL_ALLOC(ndr, r->pac);
1905                                 } else {
1906                                         r->pac = NULL;
1907                                 }
1908                         break; }
1909
1910                         case NetlogonValidationGenericInfo2: {
1911                                 uint32_t _ptr_generic;
1912                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_generic));
1913                                 if (_ptr_generic) {
1914                                         NDR_PULL_ALLOC(ndr, r->generic);
1915                                 } else {
1916                                         r->generic = NULL;
1917                                 }
1918                         break; }
1919
1920                         case NetlogonValidationSamInfo4: {
1921                                 uint32_t _ptr_sam6;
1922                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam6));
1923                                 if (_ptr_sam6) {
1924                                         NDR_PULL_ALLOC(ndr, r->sam6);
1925                                 } else {
1926                                         r->sam6 = NULL;
1927                                 }
1928                         break; }
1929
1930                         default:
1931                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1932                 }
1933         }
1934         if (ndr_flags & NDR_BUFFERS) {
1935                 switch (level) {
1936                         case NetlogonValidationSamInfo:
1937                                 if (r->sam2) {
1938                                         _mem_save_sam2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1939                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam2, 0);
1940                                         NDR_CHECK(ndr_pull_netr_SamInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam2));
1941                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam2_0, 0);
1942                                 }
1943                         break;
1944
1945                         case NetlogonValidationSamInfo2:
1946                                 if (r->sam3) {
1947                                         _mem_save_sam3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1948                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam3, 0);
1949                                         NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam3));
1950                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam3_0, 0);
1951                                 }
1952                         break;
1953
1954                         case 4:
1955                                 if (r->pac) {
1956                                         _mem_save_pac_0 = NDR_PULL_GET_MEM_CTX(ndr);
1957                                         NDR_PULL_SET_MEM_CTX(ndr, r->pac, 0);
1958                                         NDR_CHECK(ndr_pull_netr_PacInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pac));
1959                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pac_0, 0);
1960                                 }
1961                         break;
1962
1963                         case NetlogonValidationGenericInfo2:
1964                                 if (r->generic) {
1965                                         _mem_save_generic_0 = NDR_PULL_GET_MEM_CTX(ndr);
1966                                         NDR_PULL_SET_MEM_CTX(ndr, r->generic, 0);
1967                                         NDR_CHECK(ndr_pull_netr_GenericInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->generic));
1968                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_generic_0, 0);
1969                                 }
1970                         break;
1971
1972                         case NetlogonValidationSamInfo4:
1973                                 if (r->sam6) {
1974                                         _mem_save_sam6_0 = NDR_PULL_GET_MEM_CTX(ndr);
1975                                         NDR_PULL_SET_MEM_CTX(ndr, r->sam6, 0);
1976                                         NDR_CHECK(ndr_pull_netr_SamInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam6));
1977                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam6_0, 0);
1978                                 }
1979                         break;
1980
1981                         default:
1982                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
1983                 }
1984         }
1985         return NDR_ERR_SUCCESS;
1986 }
1987
1988 _PUBLIC_ void ndr_print_netr_Validation(struct ndr_print *ndr, const char *name, const union netr_Validation *r)
1989 {
1990         int level;
1991         level = ndr_print_get_switch_value(ndr, r);
1992         ndr_print_union(ndr, name, level, "netr_Validation");
1993         switch (level) {
1994                 case NetlogonValidationSamInfo:
1995                         ndr_print_ptr(ndr, "sam2", r->sam2);
1996                         ndr->depth++;
1997                         if (r->sam2) {
1998                                 ndr_print_netr_SamInfo2(ndr, "sam2", r->sam2);
1999                         }
2000                         ndr->depth--;
2001                 break;
2002
2003                 case NetlogonValidationSamInfo2:
2004                         ndr_print_ptr(ndr, "sam3", r->sam3);
2005                         ndr->depth++;
2006                         if (r->sam3) {
2007                                 ndr_print_netr_SamInfo3(ndr, "sam3", r->sam3);
2008                         }
2009                         ndr->depth--;
2010                 break;
2011
2012                 case 4:
2013                         ndr_print_ptr(ndr, "pac", r->pac);
2014                         ndr->depth++;
2015                         if (r->pac) {
2016                                 ndr_print_netr_PacInfo(ndr, "pac", r->pac);
2017                         }
2018                         ndr->depth--;
2019                 break;
2020
2021                 case NetlogonValidationGenericInfo2:
2022                         ndr_print_ptr(ndr, "generic", r->generic);
2023                         ndr->depth++;
2024                         if (r->generic) {
2025                                 ndr_print_netr_GenericInfo2(ndr, "generic", r->generic);
2026                         }
2027                         ndr->depth--;
2028                 break;
2029
2030                 case NetlogonValidationSamInfo4:
2031                         ndr_print_ptr(ndr, "sam6", r->sam6);
2032                         ndr->depth++;
2033                         if (r->sam6) {
2034                                 ndr_print_netr_SamInfo6(ndr, "sam6", r->sam6);
2035                         }
2036                         ndr->depth--;
2037                 break;
2038
2039                 default:
2040                         ndr_print_bad_level(ndr, name, level);
2041         }
2042 }
2043
2044 _PUBLIC_ enum ndr_err_code ndr_push_netr_Credential(struct ndr_push *ndr, int ndr_flags, const struct netr_Credential *r)
2045 {
2046         {
2047                 uint32_t _flags_save_STRUCT = ndr->flags;
2048                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2049                 if (ndr_flags & NDR_SCALARS) {
2050                         NDR_CHECK(ndr_push_align(ndr, 1));
2051                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, 8));
2052                 }
2053                 if (ndr_flags & NDR_BUFFERS) {
2054                 }
2055                 ndr->flags = _flags_save_STRUCT;
2056         }
2057         return NDR_ERR_SUCCESS;
2058 }
2059
2060 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Credential(struct ndr_pull *ndr, int ndr_flags, struct netr_Credential *r)
2061 {
2062         {
2063                 uint32_t _flags_save_STRUCT = ndr->flags;
2064                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2065                 if (ndr_flags & NDR_SCALARS) {
2066                         NDR_CHECK(ndr_pull_align(ndr, 1));
2067                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, 8));
2068                 }
2069                 if (ndr_flags & NDR_BUFFERS) {
2070                 }
2071                 ndr->flags = _flags_save_STRUCT;
2072         }
2073         return NDR_ERR_SUCCESS;
2074 }
2075
2076 _PUBLIC_ void ndr_print_netr_Credential(struct ndr_print *ndr, const char *name, const struct netr_Credential *r)
2077 {
2078         ndr_print_struct(ndr, name, "netr_Credential");
2079         {
2080                 uint32_t _flags_save_STRUCT = ndr->flags;
2081                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2082                 ndr->depth++;
2083                 ndr_print_array_uint8(ndr, "data", r->data, 8);
2084                 ndr->depth--;
2085                 ndr->flags = _flags_save_STRUCT;
2086         }
2087 }
2088
2089 _PUBLIC_ enum ndr_err_code ndr_push_netr_Authenticator(struct ndr_push *ndr, int ndr_flags, const struct netr_Authenticator *r)
2090 {
2091         if (ndr_flags & NDR_SCALARS) {
2092                 NDR_CHECK(ndr_push_align(ndr, 4));
2093                 NDR_CHECK(ndr_push_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2094                 NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->timestamp));
2095         }
2096         if (ndr_flags & NDR_BUFFERS) {
2097         }
2098         return NDR_ERR_SUCCESS;
2099 }
2100
2101 _PUBLIC_ enum ndr_err_code ndr_pull_netr_Authenticator(struct ndr_pull *ndr, int ndr_flags, struct netr_Authenticator *r)
2102 {
2103         if (ndr_flags & NDR_SCALARS) {
2104                 NDR_CHECK(ndr_pull_align(ndr, 4));
2105                 NDR_CHECK(ndr_pull_netr_Credential(ndr, NDR_SCALARS, &r->cred));
2106                 NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->timestamp));
2107         }
2108         if (ndr_flags & NDR_BUFFERS) {
2109         }
2110         return NDR_ERR_SUCCESS;
2111 }
2112
2113 _PUBLIC_ void ndr_print_netr_Authenticator(struct ndr_print *ndr, const char *name, const struct netr_Authenticator *r)
2114 {
2115         ndr_print_struct(ndr, name, "netr_Authenticator");
2116         ndr->depth++;
2117         ndr_print_netr_Credential(ndr, "cred", &r->cred);
2118         ndr_print_time_t(ndr, "timestamp", r->timestamp);
2119         ndr->depth--;
2120 }
2121
2122 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)
2123 {
2124         if (ndr_flags & NDR_SCALARS) {
2125                 NDR_CHECK(ndr_push_align(ndr, 4));
2126                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->account_name));
2127                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2128                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2129                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2130                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2131                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2132                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2133                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2134                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2135         }
2136         if (ndr_flags & NDR_BUFFERS) {
2137                 if (r->account_name) {
2138                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2139                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2140                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF16)));
2141                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2142                 }
2143                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2144                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2145                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2146                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2147         }
2148         return NDR_ERR_SUCCESS;
2149 }
2150
2151 static enum ndr_err_code ndr_pull_netr_DELTA_DELETE_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DELETE_USER *r)
2152 {
2153         uint32_t _ptr_account_name;
2154         TALLOC_CTX *_mem_save_account_name_0;
2155         if (ndr_flags & NDR_SCALARS) {
2156                 NDR_CHECK(ndr_pull_align(ndr, 4));
2157                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_account_name));
2158                 if (_ptr_account_name) {
2159                         NDR_PULL_ALLOC(ndr, r->account_name);
2160                 } else {
2161                         r->account_name = NULL;
2162                 }
2163                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2164                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2165                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2166                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2167                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2168                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2169                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2170                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2171         }
2172         if (ndr_flags & NDR_BUFFERS) {
2173                 if (r->account_name) {
2174                         _mem_save_account_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2175                         NDR_PULL_SET_MEM_CTX(ndr, r->account_name, 0);
2176                         NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
2177                         NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
2178                         if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_name)) {
2179                                 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));
2180                         }
2181                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t)));
2182                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint16_t), CH_UTF16));
2183                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_account_name_0, 0);
2184                 }
2185                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2186                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2187                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2188                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2189         }
2190         return NDR_ERR_SUCCESS;
2191 }
2192
2193 _PUBLIC_ void ndr_print_netr_DELTA_DELETE_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DELETE_USER *r)
2194 {
2195         ndr_print_struct(ndr, name, "netr_DELTA_DELETE_USER");
2196         ndr->depth++;
2197         ndr_print_ptr(ndr, "account_name", r->account_name);
2198         ndr->depth++;
2199         if (r->account_name) {
2200                 ndr_print_string(ndr, "account_name", r->account_name);
2201         }
2202         ndr->depth--;
2203         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2204         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2205         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2206         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2207         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2208         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2209         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2210         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2211         ndr->depth--;
2212 }
2213
2214 static enum ndr_err_code ndr_push_netr_USER_KEY16(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEY16 *r)
2215 {
2216         if (ndr_flags & NDR_SCALARS) {
2217                 NDR_CHECK(ndr_push_align(ndr, 4));
2218                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2219                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
2220                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags));
2221                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2222         }
2223         if (ndr_flags & NDR_BUFFERS) {
2224         }
2225         return NDR_ERR_SUCCESS;
2226 }
2227
2228 static enum ndr_err_code ndr_pull_netr_USER_KEY16(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY16 *r)
2229 {
2230         if (ndr_flags & NDR_SCALARS) {
2231                 NDR_CHECK(ndr_pull_align(ndr, 4));
2232                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
2233                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
2234                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags));
2235                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->pwd));
2236         }
2237         if (ndr_flags & NDR_BUFFERS) {
2238         }
2239         return NDR_ERR_SUCCESS;
2240 }
2241
2242 _PUBLIC_ void ndr_print_netr_USER_KEY16(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY16 *r)
2243 {
2244         ndr_print_struct(ndr, name, "netr_USER_KEY16");
2245         ndr->depth++;
2246         ndr_print_uint16(ndr, "length", r->length);
2247         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->length:r->size);
2248         ndr_print_uint32(ndr, "flags", r->flags);
2249         ndr_print_samr_Password(ndr, "pwd", &r->pwd);
2250         ndr->depth--;
2251 }
2252
2253 static enum ndr_err_code ndr_push_netr_PasswordHistory(struct ndr_push *ndr, int ndr_flags, const struct netr_PasswordHistory *r)
2254 {
2255         if (ndr_flags & NDR_SCALARS) {
2256                 NDR_CHECK(ndr_push_align(ndr, 4));
2257                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2258                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->nt_length));
2259                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_flags));
2260                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2261                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm_length));
2262                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lm_flags));
2263                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2264                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2265         }
2266         if (ndr_flags & NDR_BUFFERS) {
2267         }
2268         return NDR_ERR_SUCCESS;
2269 }
2270
2271 static enum ndr_err_code ndr_pull_netr_PasswordHistory(struct ndr_pull *ndr, int ndr_flags, struct netr_PasswordHistory *r)
2272 {
2273         if (ndr_flags & NDR_SCALARS) {
2274                 NDR_CHECK(ndr_pull_align(ndr, 4));
2275                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_length));
2276                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->nt_size));
2277                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_flags));
2278                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_length));
2279                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm_size));
2280                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lm_flags));
2281                 NDR_PULL_ALLOC_N(ndr, r->nt_history, r->nt_length);
2282                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->nt_history, r->nt_length));
2283                 NDR_PULL_ALLOC_N(ndr, r->lm_history, r->lm_length);
2284                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->lm_history, r->lm_length));
2285         }
2286         if (ndr_flags & NDR_BUFFERS) {
2287         }
2288         return NDR_ERR_SUCCESS;
2289 }
2290
2291 _PUBLIC_ void ndr_print_netr_PasswordHistory(struct ndr_print *ndr, const char *name, const struct netr_PasswordHistory *r)
2292 {
2293         ndr_print_struct(ndr, name, "netr_PasswordHistory");
2294         ndr->depth++;
2295         ndr_print_uint16(ndr, "nt_length", r->nt_length);
2296         ndr_print_uint16(ndr, "nt_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->nt_length:r->nt_size);
2297         ndr_print_uint32(ndr, "nt_flags", r->nt_flags);
2298         ndr_print_uint16(ndr, "lm_length", r->lm_length);
2299         ndr_print_uint16(ndr, "lm_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->lm_length:r->lm_size);
2300         ndr_print_uint32(ndr, "lm_flags", r->lm_flags);
2301         ndr_print_array_uint8(ndr, "nt_history", r->nt_history, r->nt_length);
2302         ndr_print_array_uint8(ndr, "lm_history", r->lm_history, r->lm_length);
2303         ndr->depth--;
2304 }
2305
2306 static enum ndr_err_code ndr_push_netr_USER_KEYS2(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS2 *r)
2307 {
2308         if (ndr_flags & NDR_SCALARS) {
2309                 NDR_CHECK(ndr_push_align(ndr, 4));
2310                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2311                 NDR_CHECK(ndr_push_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2312                 NDR_CHECK(ndr_push_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2313         }
2314         if (ndr_flags & NDR_BUFFERS) {
2315         }
2316         return NDR_ERR_SUCCESS;
2317 }
2318
2319 static enum ndr_err_code ndr_pull_netr_USER_KEYS2(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS2 *r)
2320 {
2321         if (ndr_flags & NDR_SCALARS) {
2322                 NDR_CHECK(ndr_pull_align(ndr, 4));
2323                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->lmpassword));
2324                 NDR_CHECK(ndr_pull_netr_USER_KEY16(ndr, NDR_SCALARS, &r->ntpassword));
2325                 NDR_CHECK(ndr_pull_netr_PasswordHistory(ndr, NDR_SCALARS, &r->history));
2326         }
2327         if (ndr_flags & NDR_BUFFERS) {
2328         }
2329         return NDR_ERR_SUCCESS;
2330 }
2331
2332 _PUBLIC_ void ndr_print_netr_USER_KEYS2(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS2 *r)
2333 {
2334         ndr_print_struct(ndr, name, "netr_USER_KEYS2");
2335         ndr->depth++;
2336         ndr_print_netr_USER_KEY16(ndr, "lmpassword", &r->lmpassword);
2337         ndr_print_netr_USER_KEY16(ndr, "ntpassword", &r->ntpassword);
2338         ndr_print_netr_PasswordHistory(ndr, "history", &r->history);
2339         ndr->depth--;
2340 }
2341
2342 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)
2343 {
2344         if (ndr_flags & NDR_SCALARS) {
2345                 NDR_CHECK(ndr_push_align(ndr, 4));
2346                 NDR_CHECK(ndr_push_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2347         }
2348         if (ndr_flags & NDR_BUFFERS) {
2349         }
2350         return NDR_ERR_SUCCESS;
2351 }
2352
2353 static enum ndr_err_code ndr_pull_netr_USER_KEY_UNION(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEY_UNION *r)
2354 {
2355         if (ndr_flags & NDR_SCALARS) {
2356                 NDR_CHECK(ndr_pull_align(ndr, 4));
2357                 NDR_CHECK(ndr_pull_netr_USER_KEYS2(ndr, NDR_SCALARS, &r->keys2));
2358         }
2359         if (ndr_flags & NDR_BUFFERS) {
2360         }
2361         return NDR_ERR_SUCCESS;
2362 }
2363
2364 _PUBLIC_ void ndr_print_netr_USER_KEY_UNION(struct ndr_print *ndr, const char *name, const struct netr_USER_KEY_UNION *r)
2365 {
2366         ndr_print_struct(ndr, name, "netr_USER_KEY_UNION");
2367         ndr->depth++;
2368         ndr_print_netr_USER_KEYS2(ndr, "keys2", &r->keys2);
2369         ndr->depth--;
2370 }
2371
2372 _PUBLIC_ enum ndr_err_code ndr_push_netr_USER_KEYS(struct ndr_push *ndr, int ndr_flags, const struct netr_USER_KEYS *r)
2373 {
2374         if (ndr_flags & NDR_SCALARS) {
2375                 NDR_CHECK(ndr_push_align(ndr, 4));
2376                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
2377                 NDR_CHECK(ndr_push_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2378         }
2379         if (ndr_flags & NDR_BUFFERS) {
2380         }
2381         return NDR_ERR_SUCCESS;
2382 }
2383
2384 _PUBLIC_ enum ndr_err_code ndr_pull_netr_USER_KEYS(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_KEYS *r)
2385 {
2386         if (ndr_flags & NDR_SCALARS) {
2387                 NDR_CHECK(ndr_pull_align(ndr, 4));
2388                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
2389                 NDR_CHECK(ndr_pull_netr_USER_KEY_UNION(ndr, NDR_SCALARS, &r->keys));
2390         }
2391         if (ndr_flags & NDR_BUFFERS) {
2392         }
2393         return NDR_ERR_SUCCESS;
2394 }
2395
2396 _PUBLIC_ void ndr_print_netr_USER_KEYS(struct ndr_print *ndr, const char *name, const struct netr_USER_KEYS *r)
2397 {
2398         ndr_print_struct(ndr, name, "netr_USER_KEYS");
2399         ndr->depth++;
2400         ndr_print_uint32(ndr, "version", r->version);
2401         ndr_print_netr_USER_KEY_UNION(ndr, "keys", &r->keys);
2402         ndr->depth--;
2403 }
2404
2405 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)
2406 {
2407         if (ndr_flags & NDR_SCALARS) {
2408                 NDR_CHECK(ndr_push_align(ndr, 4));
2409                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->SensitiveDataFlag));
2410                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2411                 {
2412                         uint32_t _flags_save_uint8 = ndr->flags;
2413                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2414                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->SensitiveData));
2415                         ndr->flags = _flags_save_uint8;
2416                 }
2417         }
2418         if (ndr_flags & NDR_BUFFERS) {
2419                 {
2420                         uint32_t _flags_save_uint8 = ndr->flags;
2421                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2422                         if (r->SensitiveData) {
2423                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->DataLength));
2424                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, r->DataLength));
2425                         }
2426                         ndr->flags = _flags_save_uint8;
2427                 }
2428         }
2429         return NDR_ERR_SUCCESS;
2430 }
2431
2432 static enum ndr_err_code ndr_pull_netr_USER_PRIVATE_INFO(struct ndr_pull *ndr, int ndr_flags, struct netr_USER_PRIVATE_INFO *r)
2433 {
2434         uint32_t _ptr_SensitiveData;
2435         TALLOC_CTX *_mem_save_SensitiveData_0;
2436         if (ndr_flags & NDR_SCALARS) {
2437                 NDR_CHECK(ndr_pull_align(ndr, 4));
2438                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->SensitiveDataFlag));
2439                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->DataLength));
2440                 {
2441                         uint32_t _flags_save_uint8 = ndr->flags;
2442                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2443                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_SensitiveData));
2444                         if (_ptr_SensitiveData) {
2445                                 NDR_PULL_ALLOC(ndr, r->SensitiveData);
2446                         } else {
2447                                 r->SensitiveData = NULL;
2448                         }
2449                         ndr->flags = _flags_save_uint8;
2450                 }
2451         }
2452         if (ndr_flags & NDR_BUFFERS) {
2453                 {
2454                         uint32_t _flags_save_uint8 = ndr->flags;
2455                         ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2456                         if (r->SensitiveData) {
2457                                 _mem_save_SensitiveData_0 = NDR_PULL_GET_MEM_CTX(ndr);
2458                                 NDR_PULL_SET_MEM_CTX(ndr, r->SensitiveData, 0);
2459                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->SensitiveData));
2460                                 NDR_PULL_ALLOC_N(ndr, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData));
2461                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->SensitiveData, ndr_get_array_size(ndr, &r->SensitiveData)));
2462                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_SensitiveData_0, 0);
2463                         }
2464                         ndr->flags = _flags_save_uint8;
2465                 }
2466                 if (r->SensitiveData) {
2467                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->SensitiveData, r->DataLength));
2468                 }
2469         }
2470         return NDR_ERR_SUCCESS;
2471 }
2472
2473 _PUBLIC_ void ndr_print_netr_USER_PRIVATE_INFO(struct ndr_print *ndr, const char *name, const struct netr_USER_PRIVATE_INFO *r)
2474 {
2475         ndr_print_struct(ndr, name, "netr_USER_PRIVATE_INFO");
2476         ndr->depth++;
2477         ndr_print_uint8(ndr, "SensitiveDataFlag", r->SensitiveDataFlag);
2478         ndr_print_uint32(ndr, "DataLength", r->DataLength);
2479         ndr_print_ptr(ndr, "SensitiveData", r->SensitiveData);
2480         ndr->depth++;
2481         if (r->SensitiveData) {
2482                 ndr_print_array_uint8(ndr, "SensitiveData", r->SensitiveData, r->DataLength);
2483         }
2484         ndr->depth--;
2485         ndr->depth--;
2486 }
2487
2488 static enum ndr_err_code ndr_push_netr_DELTA_USER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_USER *r)
2489 {
2490         if (ndr_flags & NDR_SCALARS) {
2491                 NDR_CHECK(ndr_push_align(ndr, 4));
2492                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2493                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2494                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2495                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->primary_gid));
2496                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2497                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2498                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2499                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2500                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2501                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logon));
2502                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_logoff));
2503                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2504                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->bad_password_count));
2505                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logon_count));
2506                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->last_password_change));
2507                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->acct_expiry));
2508                 NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_flags));
2509                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2510                 NDR_CHECK(ndr_push_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2511                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->nt_password_present));
2512                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->lm_password_present));
2513                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
2514                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->comment));
2515                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2516                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->country_code));
2517                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->code_page));
2518                 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2519                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2520                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2521                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2522                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2523                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2524                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2525                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2526                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2527                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2528                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2529         }
2530         if (ndr_flags & NDR_BUFFERS) {
2531                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2532                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2533                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2534                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2535                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2536                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2537                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2538                 NDR_CHECK(ndr_push_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2539                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2540                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2541                 NDR_CHECK(ndr_push_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2542                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2543                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2544                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2545                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2546                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2547         }
2548         return NDR_ERR_SUCCESS;
2549 }
2550
2551 static enum ndr_err_code ndr_pull_netr_DELTA_USER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_USER *r)
2552 {
2553         if (ndr_flags & NDR_SCALARS) {
2554                 NDR_CHECK(ndr_pull_align(ndr, 4));
2555                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account_name));
2556                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->full_name));
2557                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2558                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->primary_gid));
2559                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_directory));
2560                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->home_drive));
2561                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->logon_script));
2562                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2563                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->workstations));
2564                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logon));
2565                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_logoff));
2566                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_SCALARS, &r->logon_hours));
2567                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->bad_password_count));
2568                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logon_count));
2569                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->last_password_change));
2570                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->acct_expiry));
2571                 NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_flags));
2572                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->lmpassword));
2573                 NDR_CHECK(ndr_pull_samr_Password(ndr, NDR_SCALARS, &r->ntpassword));
2574                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->nt_password_present));
2575                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->lm_password_present));
2576                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
2577                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->comment));
2578                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->parameters));
2579                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->country_code));
2580                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->code_page));
2581                 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_SCALARS, &r->user_private_info));
2582                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2583                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2584                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->profile_path));
2585                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2586                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2587                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2588                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2589                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2590                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2591                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2592         }
2593         if (ndr_flags & NDR_BUFFERS) {
2594                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account_name));
2595                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->full_name));
2596                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_directory));
2597                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->home_drive));
2598                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->logon_script));
2599                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2600                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->workstations));
2601                 NDR_CHECK(ndr_pull_samr_LogonHours(ndr, NDR_BUFFERS, &r->logon_hours));
2602                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->comment));
2603                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->parameters));
2604                 NDR_CHECK(ndr_pull_netr_USER_PRIVATE_INFO(ndr, NDR_BUFFERS, &r->user_private_info));
2605                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2606                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->profile_path));
2607                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2608                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2609                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2610         }
2611         return NDR_ERR_SUCCESS;
2612 }
2613
2614 _PUBLIC_ void ndr_print_netr_DELTA_USER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_USER *r)
2615 {
2616         ndr_print_struct(ndr, name, "netr_DELTA_USER");
2617         ndr->depth++;
2618         ndr_print_lsa_String(ndr, "account_name", &r->account_name);
2619         ndr_print_lsa_String(ndr, "full_name", &r->full_name);
2620         ndr_print_uint32(ndr, "rid", r->rid);
2621         ndr_print_uint32(ndr, "primary_gid", r->primary_gid);
2622         ndr_print_lsa_String(ndr, "home_directory", &r->home_directory);
2623         ndr_print_lsa_String(ndr, "home_drive", &r->home_drive);
2624         ndr_print_lsa_String(ndr, "logon_script", &r->logon_script);
2625         ndr_print_lsa_String(ndr, "description", &r->description);
2626         ndr_print_lsa_String(ndr, "workstations", &r->workstations);
2627         ndr_print_NTTIME(ndr, "last_logon", r->last_logon);
2628         ndr_print_NTTIME(ndr, "last_logoff", r->last_logoff);
2629         ndr_print_samr_LogonHours(ndr, "logon_hours", &r->logon_hours);
2630         ndr_print_uint16(ndr, "bad_password_count", r->bad_password_count);
2631         ndr_print_uint16(ndr, "logon_count", r->logon_count);
2632         ndr_print_NTTIME(ndr, "last_password_change", r->last_password_change);
2633         ndr_print_NTTIME(ndr, "acct_expiry", r->acct_expiry);
2634         ndr_print_samr_AcctFlags(ndr, "acct_flags", r->acct_flags);
2635         ndr_print_samr_Password(ndr, "lmpassword", &r->lmpassword);
2636         ndr_print_samr_Password(ndr, "ntpassword", &r->ntpassword);
2637         ndr_print_uint8(ndr, "nt_password_present", r->nt_password_present);
2638         ndr_print_uint8(ndr, "lm_password_present", r->lm_password_present);
2639         ndr_print_uint8(ndr, "password_expired", r->password_expired);
2640         ndr_print_lsa_String(ndr, "comment", &r->comment);
2641         ndr_print_lsa_BinaryString(ndr, "parameters", &r->parameters);
2642         ndr_print_uint16(ndr, "country_code", r->country_code);
2643         ndr_print_uint16(ndr, "code_page", r->code_page);
2644         ndr_print_netr_USER_PRIVATE_INFO(ndr, "user_private_info", &r->user_private_info);
2645         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2646         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2647         ndr_print_lsa_String(ndr, "profile_path", &r->profile_path);
2648         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2649         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2650         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2651         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2652         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2653         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2654         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2655         ndr->depth--;
2656 }
2657
2658 static enum ndr_err_code ndr_push_netr_DELTA_DOMAIN(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_DOMAIN *r)
2659 {
2660         if (ndr_flags & NDR_SCALARS) {
2661                 NDR_CHECK(ndr_push_align(ndr, 4));
2662                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2663                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2664                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->force_logoff_time));
2665                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->min_password_length));
2666                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->password_history_length));
2667                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->max_password_age));
2668                 NDR_CHECK(ndr_push_dlong(ndr, NDR_SCALARS, r->min_password_age));
2669                 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
2670                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->domain_create_time));
2671                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2672                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2673                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2674                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2675                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2676                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2677                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->logon_to_chgpass));
2678                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2679                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2680                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2681         }
2682         if (ndr_flags & NDR_BUFFERS) {
2683                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2684                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2685                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2686                 NDR_CHECK(ndr_push_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2687                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2688                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2689                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2690         }
2691         return NDR_ERR_SUCCESS;
2692 }
2693
2694 static enum ndr_err_code ndr_pull_netr_DELTA_DOMAIN(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_DOMAIN *r)
2695 {
2696         if (ndr_flags & NDR_SCALARS) {
2697                 NDR_CHECK(ndr_pull_align(ndr, 4));
2698                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->domain_name));
2699                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->oem_information));
2700                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->force_logoff_time));
2701                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->min_password_length));
2702                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->password_history_length));
2703                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->max_password_age));
2704                 NDR_CHECK(ndr_pull_dlong(ndr, NDR_SCALARS, &r->min_password_age));
2705                 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
2706                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->domain_create_time));
2707                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2708                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2709                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_SCALARS, &r->account_lockout));
2710                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2711                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2712                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2713                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->logon_to_chgpass));
2714                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2715                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2716                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2717         }
2718         if (ndr_flags & NDR_BUFFERS) {
2719                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->domain_name));
2720                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->oem_information));
2721                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2722                 NDR_CHECK(ndr_pull_lsa_BinaryString(ndr, NDR_BUFFERS, &r->account_lockout));
2723                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2724                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2725                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2726         }
2727         return NDR_ERR_SUCCESS;
2728 }
2729
2730 _PUBLIC_ void ndr_print_netr_DELTA_DOMAIN(struct ndr_print *ndr, const char *name, const struct netr_DELTA_DOMAIN *r)
2731 {
2732         ndr_print_struct(ndr, name, "netr_DELTA_DOMAIN");
2733         ndr->depth++;
2734         ndr_print_lsa_String(ndr, "domain_name", &r->domain_name);
2735         ndr_print_lsa_String(ndr, "oem_information", &r->oem_information);
2736         ndr_print_dlong(ndr, "force_logoff_time", r->force_logoff_time);
2737         ndr_print_uint16(ndr, "min_password_length", r->min_password_length);
2738         ndr_print_uint16(ndr, "password_history_length", r->password_history_length);
2739         ndr_print_dlong(ndr, "max_password_age", r->max_password_age);
2740         ndr_print_dlong(ndr, "min_password_age", r->min_password_age);
2741         ndr_print_udlong(ndr, "sequence_num", r->sequence_num);
2742         ndr_print_NTTIME(ndr, "domain_create_time", r->domain_create_time);
2743         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2744         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2745         ndr_print_lsa_BinaryString(ndr, "account_lockout", &r->account_lockout);
2746         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2747         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2748         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2749         ndr_print_uint32(ndr, "logon_to_chgpass", r->logon_to_chgpass);
2750         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2751         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2752         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2753         ndr->depth--;
2754 }
2755
2756 static enum ndr_err_code ndr_push_netr_DELTA_GROUP(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP *r)
2757 {
2758         if (ndr_flags & NDR_SCALARS) {
2759                 NDR_CHECK(ndr_push_align(ndr, 4));
2760                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2761                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2762                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
2763                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
2764                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
2765                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2766                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2767                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2768                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2769                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2770                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2771                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2772                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2773                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2774         }
2775         if (ndr_flags & NDR_BUFFERS) {
2776                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2777                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
2778                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2779                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2780                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2781                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2782                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2783         }
2784         return NDR_ERR_SUCCESS;
2785 }
2786
2787 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP *r)
2788 {
2789         if (ndr_flags & NDR_SCALARS) {
2790                 NDR_CHECK(ndr_pull_align(ndr, 4));
2791                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->group_name));
2792                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2793                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
2794                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
2795                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
2796                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
2797                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2798                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2799                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2800                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2801                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2802                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2803                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2804                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2805         }
2806         if (ndr_flags & NDR_BUFFERS) {
2807                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->group_name));
2808                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
2809                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
2810                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2811                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2812                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2813                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2814         }
2815         return NDR_ERR_SUCCESS;
2816 }
2817
2818 _PUBLIC_ void ndr_print_netr_DELTA_GROUP(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP *r)
2819 {
2820         ndr_print_struct(ndr, name, "netr_DELTA_GROUP");
2821         ndr->depth++;
2822         ndr_print_lsa_String(ndr, "group_name", &r->group_name);
2823         ndr_print_uint32(ndr, "rid", r->rid);
2824         ndr_print_uint32(ndr, "attributes", r->attributes);
2825         ndr_print_lsa_String(ndr, "description", &r->description);
2826         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
2827         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
2828         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2829         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2830         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2831         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2832         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2833         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2834         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2835         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2836         ndr->depth--;
2837 }
2838
2839 static enum ndr_err_code ndr_push_netr_DELTA_RENAME(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_RENAME *r)
2840 {
2841         if (ndr_flags & NDR_SCALARS) {
2842                 NDR_CHECK(ndr_push_align(ndr, 4));
2843                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2844                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2845                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2846                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2847                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2848                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2849                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
2850                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
2851                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
2852                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
2853         }
2854         if (ndr_flags & NDR_BUFFERS) {
2855                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2856                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2857                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2858                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2859                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2860                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2861         }
2862         return NDR_ERR_SUCCESS;
2863 }
2864
2865 static enum ndr_err_code ndr_pull_netr_DELTA_RENAME(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_RENAME *r)
2866 {
2867         if (ndr_flags & NDR_SCALARS) {
2868                 NDR_CHECK(ndr_pull_align(ndr, 4));
2869                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->OldName));
2870                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->NewName));
2871                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
2872                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
2873                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
2874                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
2875                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
2876                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
2877                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
2878                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
2879         }
2880         if (ndr_flags & NDR_BUFFERS) {
2881                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->OldName));
2882                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->NewName));
2883                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
2884                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
2885                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
2886                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
2887         }
2888         return NDR_ERR_SUCCESS;
2889 }
2890
2891 _PUBLIC_ void ndr_print_netr_DELTA_RENAME(struct ndr_print *ndr, const char *name, const struct netr_DELTA_RENAME *r)
2892 {
2893         ndr_print_struct(ndr, name, "netr_DELTA_RENAME");
2894         ndr->depth++;
2895         ndr_print_lsa_String(ndr, "OldName", &r->OldName);
2896         ndr_print_lsa_String(ndr, "NewName", &r->NewName);
2897         ndr_print_lsa_String(ndr, "unknown1", &r->unknown1);
2898         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
2899         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
2900         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
2901         ndr_print_uint32(ndr, "unknown5", r->unknown5);
2902         ndr_print_uint32(ndr, "unknown6", r->unknown6);
2903         ndr_print_uint32(ndr, "unknown7", r->unknown7);
2904         ndr_print_uint32(ndr, "unknown8", r->unknown8);
2905         ndr->depth--;
2906 }
2907
2908 static enum ndr_err_code ndr_push_netr_DELTA_GROUP_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_GROUP_MEMBER *r)
2909 {
2910         uint32_t cntr_rids_1;
2911         uint32_t cntr_attribs_1;
2912         if (ndr_flags & NDR_SCALARS) {
2913                 NDR_CHECK(ndr_push_align(ndr, 4));
2914                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->rids));
2915                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->attribs));
2916                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2917                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
2918                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
2919                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
2920                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
2921         }
2922         if (ndr_flags & NDR_BUFFERS) {
2923                 if (r->rids) {
2924                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2925                         for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
2926                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_1]));
2927                         }
2928                 }
2929                 if (r->attribs) {
2930                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
2931                         for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
2932                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribs[cntr_attribs_1]));
2933                         }
2934                 }
2935         }
2936         return NDR_ERR_SUCCESS;
2937 }
2938
2939 static enum ndr_err_code ndr_pull_netr_DELTA_GROUP_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_GROUP_MEMBER *r)
2940 {
2941         uint32_t _ptr_rids;
2942         uint32_t cntr_rids_1;
2943         TALLOC_CTX *_mem_save_rids_0;
2944         TALLOC_CTX *_mem_save_rids_1;
2945         uint32_t _ptr_attribs;
2946         uint32_t cntr_attribs_1;
2947         TALLOC_CTX *_mem_save_attribs_0;
2948         TALLOC_CTX *_mem_save_attribs_1;
2949         if (ndr_flags & NDR_SCALARS) {
2950                 NDR_CHECK(ndr_pull_align(ndr, 4));
2951                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rids));
2952                 if (_ptr_rids) {
2953                         NDR_PULL_ALLOC(ndr, r->rids);
2954                 } else {
2955                         r->rids = NULL;
2956                 }
2957                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_attribs));
2958                 if (_ptr_attribs) {
2959                         NDR_PULL_ALLOC(ndr, r->attribs);
2960                 } else {
2961                         r->attribs = NULL;
2962                 }
2963                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
2964                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
2965                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
2966                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
2967                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
2968         }
2969         if (ndr_flags & NDR_BUFFERS) {
2970                 if (r->rids) {
2971                         _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2972                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
2973                         NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
2974                         NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
2975                         _mem_save_rids_1 = NDR_PULL_GET_MEM_CTX(ndr);
2976                         NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
2977                         for (cntr_rids_1 = 0; cntr_rids_1 < r->num_rids; cntr_rids_1++) {
2978                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_1]));
2979                         }
2980                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_1, 0);
2981                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
2982                 }
2983                 if (r->attribs) {
2984                         _mem_save_attribs_0 = NDR_PULL_GET_MEM_CTX(ndr);
2985                         NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
2986                         NDR_CHECK(ndr_pull_array_size(ndr, &r->attribs));
2987                         NDR_PULL_ALLOC_N(ndr, r->attribs, ndr_get_array_size(ndr, &r->attribs));
2988                         _mem_save_attribs_1 = NDR_PULL_GET_MEM_CTX(ndr);
2989                         NDR_PULL_SET_MEM_CTX(ndr, r->attribs, 0);
2990                         for (cntr_attribs_1 = 0; cntr_attribs_1 < r->num_rids; cntr_attribs_1++) {
2991                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribs[cntr_attribs_1]));
2992                         }
2993                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_1, 0);
2994                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_attribs_0, 0);
2995                 }
2996                 if (r->rids) {
2997                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
2998                 }
2999                 if (r->attribs) {
3000                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->attribs, r->num_rids));
3001                 }
3002         }
3003         return NDR_ERR_SUCCESS;
3004 }
3005
3006 _PUBLIC_ void ndr_print_netr_DELTA_GROUP_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_GROUP_MEMBER *r)
3007 {
3008         uint32_t cntr_rids_1;
3009         uint32_t cntr_attribs_1;
3010         ndr_print_struct(ndr, name, "netr_DELTA_GROUP_MEMBER");
3011         ndr->depth++;
3012         ndr_print_ptr(ndr, "rids", r->rids);
3013         ndr->depth++;
3014         if (r->rids) {
3015                 ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
3016                 ndr->depth++;
3017                 for (cntr_rids_1=0;cntr_rids_1<r->num_rids;cntr_rids_1++) {
3018                         char *idx_1=NULL;
3019                         if (asprintf(&idx_1, "[%d]", cntr_rids_1) != -1) {
3020                                 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_1]);
3021                                 free(idx_1);
3022                         }
3023                 }
3024                 ndr->depth--;
3025         }
3026         ndr->depth--;
3027         ndr_print_ptr(ndr, "attribs", r->attribs);
3028         ndr->depth++;
3029         if (r->attribs) {
3030                 ndr->print(ndr, "%s: ARRAY(%d)", "attribs", (int)r->num_rids);
3031                 ndr->depth++;
3032                 for (cntr_attribs_1=0;cntr_attribs_1<r->num_rids;cntr_attribs_1++) {
3033                         char *idx_1=NULL;
3034                         if (asprintf(&idx_1, "[%d]", cntr_attribs_1) != -1) {
3035                                 ndr_print_uint32(ndr, "attribs", r->attribs[cntr_attribs_1]);
3036                                 free(idx_1);
3037                         }
3038                 }
3039                 ndr->depth--;
3040         }
3041         ndr->depth--;
3042         ndr_print_uint32(ndr, "num_rids", r->num_rids);
3043         ndr_print_uint32(ndr, "unknown1", r->unknown1);
3044         ndr_print_uint32(ndr, "unknown2", r->unknown2);
3045         ndr_print_uint32(ndr, "unknown3", r->unknown3);
3046         ndr_print_uint32(ndr, "unknown4", r->unknown4);
3047         ndr->depth--;
3048 }
3049
3050 static enum ndr_err_code ndr_push_netr_DELTA_ALIAS(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS *r)
3051 {
3052         if (ndr_flags & NDR_SCALARS) {
3053                 NDR_CHECK(ndr_push_align(ndr, 4));
3054                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3055                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
3056                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3057                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3058                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->description));
3059                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3060                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3061                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3062                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3063                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3064                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3065                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3066         }
3067         if (ndr_flags & NDR_BUFFERS) {
3068                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3069                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3070                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->description));
3071                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3072                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3073                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3074         }
3075         return NDR_ERR_SUCCESS;
3076 }
3077
3078 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS *r)
3079 {
3080         if (ndr_flags & NDR_SCALARS) {
3081                 NDR_CHECK(ndr_pull_align(ndr, 4));
3082                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->alias_name));
3083                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
3084                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3085                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3086                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->description));
3087                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3088                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3089                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3090                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown5));
3091                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown6));
3092                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown7));
3093                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown8));
3094         }
3095         if (ndr_flags & NDR_BUFFERS) {
3096                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->alias_name));
3097                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3098                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->description));
3099                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3100                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3101                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3102         }
3103         return NDR_ERR_SUCCESS;
3104 }
3105
3106 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS *r)
3107 {
3108         ndr_print_struct(ndr, name, "netr_DELTA_ALIAS");
3109         ndr->depth++;
3110         ndr_print_lsa_String(ndr, "alias_name", &r->alias_name);
3111         ndr_print_uint32(ndr, "rid", r->rid);
3112         ndr_print_uint32(ndr, "SecurityInformation", r->SecurityInformation);
3113         ndr_print_sec_desc_buf(ndr, "sdbuf", &r->sdbuf);
3114         ndr_print_lsa_String(ndr, "description", &r->description);
3115         ndr_print_lsa_String(ndr, "unknown2", &r->unknown2);
3116         ndr_print_lsa_String(ndr, "unknown3", &r->unknown3);
3117         ndr_print_lsa_String(ndr, "unknown4", &r->unknown4);
3118         ndr_print_uint32(ndr, "unknown5", r->unknown5);
3119         ndr_print_uint32(ndr, "unknown6", r->unknown6);
3120         ndr_print_uint32(ndr, "unknown7", r->unknown7);
3121         ndr_print_uint32(ndr, "unknown8", r->unknown8);
3122         ndr->depth--;
3123 }
3124
3125 static enum ndr_err_code ndr_push_netr_DELTA_ALIAS_MEMBER(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_ALIAS_MEMBER *r)
3126 {
3127         if (ndr_flags & NDR_SCALARS) {
3128                 NDR_CHECK(ndr_push_align(ndr, 4));
3129                 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3130                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
3131                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
3132                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
3133                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown4));
3134         }
3135         if (ndr_flags & NDR_BUFFERS) {
3136                 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3137         }
3138         return NDR_ERR_SUCCESS;
3139 }
3140
3141 static enum ndr_err_code ndr_pull_netr_DELTA_ALIAS_MEMBER(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_ALIAS_MEMBER *r)
3142 {
3143         if (ndr_flags & NDR_SCALARS) {
3144                 NDR_CHECK(ndr_pull_align(ndr, 4));
3145                 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS, &r->sids));
3146                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
3147                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
3148                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
3149                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown4));
3150         }
3151         if (ndr_flags & NDR_BUFFERS) {
3152                 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_BUFFERS, &r->sids));
3153         }
3154         return NDR_ERR_SUCCESS;
3155 }
3156
3157 _PUBLIC_ void ndr_print_netr_DELTA_ALIAS_MEMBER(struct ndr_print *ndr, const char *name, const struct netr_DELTA_ALIAS_MEMBER *r)
3158 {
3159         ndr_print_struct(ndr, name, "netr_DELTA_ALIAS_MEMBER");
3160         ndr->depth++;
3161         ndr_print_lsa_SidArray(ndr, "sids", &r->sids);
3162         ndr_print_uint32(ndr, "unknown1", r->unknown1);
3163         ndr_print_uint32(ndr, "unknown2", r->unknown2);
3164         ndr_print_uint32(ndr, "unknown3", r->unknown3);
3165         ndr_print_uint32(ndr, "unknown4", r->unknown4);
3166         ndr->depth--;
3167 }
3168
3169 static enum ndr_err_code ndr_push_netr_QUOTA_LIMITS(struct ndr_push *ndr, int ndr_flags, const struct netr_QUOTA_LIMITS *r)
3170 {
3171         if (ndr_flags & NDR_SCALARS) {
3172                 NDR_CHECK(ndr_push_align(ndr, 4));
3173                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagedpoollimit));
3174                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nonpagedpoollimit));
3175                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minimumworkingsetsize));
3176                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximumworkingsetsize));
3177                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefilelimit));
3178                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->timelimit));
3179         }
3180         if (ndr_flags & NDR_BUFFERS) {
3181         }
3182         return NDR_ERR_SUCCESS;
3183 }
3184
3185 static enum ndr_err_code ndr_pull_netr_QUOTA_LIMITS(struct ndr_pull *ndr, int ndr_flags, struct netr_QUOTA_LIMITS *r)
3186 {
3187         if (ndr_flags & NDR_SCALARS) {
3188                 NDR_CHECK(ndr_pull_align(ndr, 4));
3189                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagedpoollimit));
3190                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nonpagedpoollimit));
3191                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minimumworkingsetsize));
3192                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximumworkingsetsize));
3193                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefilelimit));
3194                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->timelimit));
3195         }
3196         if (ndr_flags & NDR_BUFFERS) {
3197         }
3198         return NDR_ERR_SUCCESS;
3199 }
3200
3201 _PUBLIC_ void ndr_print_netr_QUOTA_LIMITS(struct ndr_print *ndr, const char *name, const struct netr_QUOTA_LIMITS *r)
3202 {
3203         ndr_print_struct(ndr, name, "netr_QUOTA_LIMITS");
3204         ndr->depth++;
3205         ndr_print_uint32(ndr, "pagedpoollimit", r->pagedpoollimit);
3206         ndr_print_uint32(ndr, "nonpagedpoollimit", r->nonpagedpoollimit);
3207         ndr_print_uint32(ndr, "minimumworkingsetsize", r->minimumworkingsetsize);
3208         ndr_print_uint32(ndr, "maximumworkingsetsize", r->maximumworkingsetsize);
3209         ndr_print_uint32(ndr, "pagefilelimit", r->pagefilelimit);
3210         ndr_print_NTTIME(ndr, "timelimit", r->timelimit);
3211         ndr->depth--;
3212 }
3213
3214 static enum ndr_err_code ndr_push_netr_DELTA_POLICY(struct ndr_push *ndr, int ndr_flags, const struct netr_DELTA_POLICY *r)
3215 {
3216         uint32_t cntr_eventauditoptions_1;
3217         if (ndr_flags & NDR_SCALARS) {
3218                 NDR_CHECK(ndr_push_align(ndr, 4));
3219                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxlogsize));
3220                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->auditretentionperiod));
3221                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->auditingmode));
3222                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount));
3223                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->eventauditoptions));
3224                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3225                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
3226                 NDR_CHECK(ndr_push_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3227                 NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->sequence_num));
3228                 NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->db_create_time));
3229                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SecurityInformation));
3230                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3231                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3232                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown2));
3233                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown3));
3234                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->unknown4));
3235                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown5));
3236                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown6));
3237                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown7));
3238                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown8));
3239         }
3240         if (ndr_flags & NDR_BUFFERS) {
3241                 if (r->eventauditoptions) {
3242                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maxauditeventcount + 1));
3243                         for (cntr_eventauditoptions_1 = 0; cntr_eventauditoptions_1 < r->maxauditeventcount + 1; cntr_eventauditoptions_1++) {
3244                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->eventauditoptions[cntr_eventauditoptions_1]));
3245                         }
3246                 }
3247                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->primary_domain_name));
3248                 if (r->sid) {
3249                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
3250                 }
3251                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->sdbuf));
3252                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown1));
3253                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown2));
3254                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown3));
3255                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->unknown4));
3256         }
3257         return NDR_ERR_SUCCESS;
3258 }
3259
3260 static enum ndr_err_code ndr_pull_netr_DELTA_POLICY(struct ndr_pull *ndr, int ndr_flags, struct netr_DELTA_POLICY *r)
3261 {
3262         uint32_t _ptr_eventauditoptions;
3263         uint32_t cntr_eventauditoptions_1;
3264         TALLOC_CTX *_mem_save_eventauditoptions_0;
3265         TALLOC_CTX *_mem_save_eventauditoptions_1;
3266         uint32_t _ptr_sid;
3267         TALLOC_CTX *_mem_save_sid_0;
3268         if (ndr_flags & NDR_SCALARS) {
3269                 NDR_CHECK(ndr_pull_align(ndr, 4));
3270                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxlogsize));
3271                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->auditretentionperiod));
3272                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->auditingmode));
3273                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maxauditeventcount));
3274                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_eventauditoptions));
3275                 if (_ptr_eventauditoptions) {
3276                         NDR_PULL_ALLOC(ndr, r->eventauditoptions);
3277                 } else {
3278                         r->eventauditoptions = NULL;
3279                 }
3280                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->primary_domain_name));
3281                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
3282                 if (_ptr_sid) {
3283                         NDR_PULL_ALLOC(ndr, r->sid);
3284                 } else {
3285                         r->sid = NULL;
3286                 }
3287                 NDR_CHECK(ndr_pull_netr_QUOTA_LIMITS(ndr, NDR_SCALARS, &r->quota_limits));
3288                 NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->sequence_num));
3289                 NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->db_create_time));
3290                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SecurityInformation));
3291                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->sdbuf));
3292                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown1));
3293                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->unknown2));