Add new script for building IDL files in librpc/idl, generating both
[sfrench/samba-autobuild/.git] / librpc / gen_ndr / ndr_lsa.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_lsa.h"
5
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 _PUBLIC_ enum ndr_err_code ndr_push_lsa_String(struct ndr_push *ndr, int ndr_flags, const struct lsa_String *r)
9 {
10         if (ndr_flags & NDR_SCALARS) {
11                 NDR_CHECK(ndr_push_align(ndr, 4));
12                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string)));
13                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string)));
14                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
15         }
16         if (ndr_flags & NDR_BUFFERS) {
17                 if (r->string) {
18                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2));
19                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
20                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2));
21                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16));
22                 }
23         }
24         return NDR_ERR_SUCCESS;
25 }
26
27 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_String(struct ndr_pull *ndr, int ndr_flags, struct lsa_String *r)
28 {
29         uint32_t _ptr_string;
30         TALLOC_CTX *_mem_save_string_0;
31         if (ndr_flags & NDR_SCALARS) {
32                 NDR_CHECK(ndr_pull_align(ndr, 4));
33                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
34                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
35                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
36                 if (_ptr_string) {
37                         NDR_PULL_ALLOC(ndr, r->string);
38                 } else {
39                         r->string = NULL;
40                 }
41         }
42         if (ndr_flags & NDR_BUFFERS) {
43                 if (r->string) {
44                         _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
45                         NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
46                         NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
47                         NDR_CHECK(ndr_pull_array_length(ndr, &r->string));
48                         if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) {
49                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string));
50                         }
51                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16));
52                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
53                 }
54                 if (r->string) {
55                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2));
56                 }
57                 if (r->string) {
58                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2));
59                 }
60         }
61         return NDR_ERR_SUCCESS;
62 }
63
64 _PUBLIC_ void ndr_print_lsa_String(struct ndr_print *ndr, const char *name, const struct lsa_String *r)
65 {
66         ndr_print_struct(ndr, name, "lsa_String");
67         ndr->depth++;
68         ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length);
69         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->size);
70         ndr_print_ptr(ndr, "string", r->string);
71         ndr->depth++;
72         if (r->string) {
73                 ndr_print_string(ndr, "string", r->string);
74         }
75         ndr->depth--;
76         ndr->depth--;
77 }
78
79 _PUBLIC_ enum ndr_err_code ndr_push_lsa_StringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_StringLarge *r)
80 {
81         if (ndr_flags & NDR_SCALARS) {
82                 NDR_CHECK(ndr_push_align(ndr, 4));
83                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->string)));
84                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string)));
85                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
86         }
87         if (ndr_flags & NDR_BUFFERS) {
88                 if (r->string) {
89                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->string) / 2));
90                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
91                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m(r->string) / 2));
92                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, 2 * strlen_m(r->string) / 2, sizeof(uint16_t), CH_UTF16));
93                 }
94         }
95         return NDR_ERR_SUCCESS;
96 }
97
98 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_StringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_StringLarge *r)
99 {
100         uint32_t _ptr_string;
101         TALLOC_CTX *_mem_save_string_0;
102         if (ndr_flags & NDR_SCALARS) {
103                 NDR_CHECK(ndr_pull_align(ndr, 4));
104                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
105                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
106                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
107                 if (_ptr_string) {
108                         NDR_PULL_ALLOC(ndr, r->string);
109                 } else {
110                         r->string = NULL;
111                 }
112         }
113         if (ndr_flags & NDR_BUFFERS) {
114                 if (r->string) {
115                         _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
116                         NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
117                         NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
118                         NDR_CHECK(ndr_pull_array_length(ndr, &r->string));
119                         if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) {
120                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string));
121                         }
122                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint16_t), CH_UTF16));
123                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
124                 }
125                 if (r->string) {
126                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size / 2));
127                 }
128                 if (r->string) {
129                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length / 2));
130                 }
131         }
132         return NDR_ERR_SUCCESS;
133 }
134
135 _PUBLIC_ void ndr_print_lsa_StringLarge(struct ndr_print *ndr, const char *name, const struct lsa_StringLarge *r)
136 {
137         ndr_print_struct(ndr, name, "lsa_StringLarge");
138         ndr->depth++;
139         ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->string):r->length);
140         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m_term(r->string):r->size);
141         ndr_print_ptr(ndr, "string", r->string);
142         ndr->depth++;
143         if (r->string) {
144                 ndr_print_string(ndr, "string", r->string);
145         }
146         ndr->depth--;
147         ndr->depth--;
148 }
149
150 _PUBLIC_ enum ndr_err_code ndr_push_lsa_Strings(struct ndr_push *ndr, int ndr_flags, const struct lsa_Strings *r)
151 {
152         uint32_t cntr_names_1;
153         if (ndr_flags & NDR_SCALARS) {
154                 NDR_CHECK(ndr_push_align(ndr, 4));
155                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
156                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->names));
157         }
158         if (ndr_flags & NDR_BUFFERS) {
159                 if (r->names) {
160                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
161                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
162                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
163                         }
164                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
165                                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
166                         }
167                 }
168         }
169         return NDR_ERR_SUCCESS;
170 }
171
172 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_Strings(struct ndr_pull *ndr, int ndr_flags, struct lsa_Strings *r)
173 {
174         uint32_t _ptr_names;
175         uint32_t cntr_names_1;
176         TALLOC_CTX *_mem_save_names_0;
177         TALLOC_CTX *_mem_save_names_1;
178         if (ndr_flags & NDR_SCALARS) {
179                 NDR_CHECK(ndr_pull_align(ndr, 4));
180                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
181                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names));
182                 if (_ptr_names) {
183                         NDR_PULL_ALLOC(ndr, r->names);
184                 } else {
185                         r->names = NULL;
186                 }
187         }
188         if (ndr_flags & NDR_BUFFERS) {
189                 if (r->names) {
190                         _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
191                         NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
192                         NDR_CHECK(ndr_pull_array_size(ndr, &r->names));
193                         NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names));
194                         _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
195                         NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
196                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
197                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
198                         }
199                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
200                                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
201                         }
202                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0);
203                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
204                 }
205                 if (r->names) {
206                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count));
207                 }
208         }
209         return NDR_ERR_SUCCESS;
210 }
211
212 _PUBLIC_ void ndr_print_lsa_Strings(struct ndr_print *ndr, const char *name, const struct lsa_Strings *r)
213 {
214         uint32_t cntr_names_1;
215         ndr_print_struct(ndr, name, "lsa_Strings");
216         ndr->depth++;
217         ndr_print_uint32(ndr, "count", r->count);
218         ndr_print_ptr(ndr, "names", r->names);
219         ndr->depth++;
220         if (r->names) {
221                 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count);
222                 ndr->depth++;
223                 for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) {
224                         char *idx_1=NULL;
225                         if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) {
226                                 ndr_print_lsa_String(ndr, "names", &r->names[cntr_names_1]);
227                                 free(idx_1);
228                         }
229                 }
230                 ndr->depth--;
231         }
232         ndr->depth--;
233         ndr->depth--;
234 }
235
236 _PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiString(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiString *r)
237 {
238         if (ndr_flags & NDR_SCALARS) {
239                 NDR_CHECK(ndr_push_align(ndr, 4));
240                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string)));
241                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string)));
242                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
243         }
244         if (ndr_flags & NDR_BUFFERS) {
245                 if (r->string) {
246                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string)));
247                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
248                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string)));
249                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS));
250                 }
251         }
252         return NDR_ERR_SUCCESS;
253 }
254
255 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiString(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiString *r)
256 {
257         uint32_t _ptr_string;
258         TALLOC_CTX *_mem_save_string_0;
259         if (ndr_flags & NDR_SCALARS) {
260                 NDR_CHECK(ndr_pull_align(ndr, 4));
261                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
262                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
263                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
264                 if (_ptr_string) {
265                         NDR_PULL_ALLOC(ndr, r->string);
266                 } else {
267                         r->string = NULL;
268                 }
269         }
270         if (ndr_flags & NDR_BUFFERS) {
271                 if (r->string) {
272                         _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
273                         NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
274                         NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
275                         NDR_CHECK(ndr_pull_array_length(ndr, &r->string));
276                         if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) {
277                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string));
278                         }
279                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS));
280                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
281                 }
282                 if (r->string) {
283                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size));
284                 }
285                 if (r->string) {
286                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length));
287                 }
288         }
289         return NDR_ERR_SUCCESS;
290 }
291
292 _PUBLIC_ void ndr_print_lsa_AsciiString(struct ndr_print *ndr, const char *name, const struct lsa_AsciiString *r)
293 {
294         ndr_print_struct(ndr, name, "lsa_AsciiString");
295         ndr->depth++;
296         ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length);
297         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->size);
298         ndr_print_ptr(ndr, "string", r->string);
299         ndr->depth++;
300         if (r->string) {
301                 ndr_print_string(ndr, "string", r->string);
302         }
303         ndr->depth--;
304         ndr->depth--;
305 }
306
307 _PUBLIC_ enum ndr_err_code ndr_push_lsa_AsciiStringLarge(struct ndr_push *ndr, int ndr_flags, const struct lsa_AsciiStringLarge *r)
308 {
309         if (ndr_flags & NDR_SCALARS) {
310                 NDR_CHECK(ndr_push_align(ndr, 4));
311                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->string)));
312                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m_term(r->string)));
313                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->string));
314         }
315         if (ndr_flags & NDR_BUFFERS) {
316                 if (r->string) {
317                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m_term(r->string)));
318                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
319                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, strlen_m(r->string)));
320                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->string, strlen_m(r->string), sizeof(uint8_t), CH_DOS));
321                 }
322         }
323         return NDR_ERR_SUCCESS;
324 }
325
326 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_AsciiStringLarge(struct ndr_pull *ndr, int ndr_flags, struct lsa_AsciiStringLarge *r)
327 {
328         uint32_t _ptr_string;
329         TALLOC_CTX *_mem_save_string_0;
330         if (ndr_flags & NDR_SCALARS) {
331                 NDR_CHECK(ndr_pull_align(ndr, 4));
332                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
333                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
334                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_string));
335                 if (_ptr_string) {
336                         NDR_PULL_ALLOC(ndr, r->string);
337                 } else {
338                         r->string = NULL;
339                 }
340         }
341         if (ndr_flags & NDR_BUFFERS) {
342                 if (r->string) {
343                         _mem_save_string_0 = NDR_PULL_GET_MEM_CTX(ndr);
344                         NDR_PULL_SET_MEM_CTX(ndr, r->string, 0);
345                         NDR_CHECK(ndr_pull_array_size(ndr, &r->string));
346                         NDR_CHECK(ndr_pull_array_length(ndr, &r->string));
347                         if (ndr_get_array_length(ndr, &r->string) > ndr_get_array_size(ndr, &r->string)) {
348                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->string), ndr_get_array_length(ndr, &r->string));
349                         }
350                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->string, ndr_get_array_length(ndr, &r->string), sizeof(uint8_t), CH_DOS));
351                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_string_0, 0);
352                 }
353                 if (r->string) {
354                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->string, r->size));
355                 }
356                 if (r->string) {
357                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->string, r->length));
358                 }
359         }
360         return NDR_ERR_SUCCESS;
361 }
362
363 _PUBLIC_ void ndr_print_lsa_AsciiStringLarge(struct ndr_print *ndr, const char *name, const struct lsa_AsciiStringLarge *r)
364 {
365         ndr_print_struct(ndr, name, "lsa_AsciiStringLarge");
366         ndr->depth++;
367         ndr_print_uint16(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->string):r->length);
368         ndr_print_uint16(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m_term(r->string):r->size);
369         ndr_print_ptr(ndr, "string", r->string);
370         ndr->depth++;
371         if (r->string) {
372                 ndr_print_string(ndr, "string", r->string);
373         }
374         ndr->depth--;
375         ndr->depth--;
376 }
377
378 _PUBLIC_ enum ndr_err_code ndr_push_lsa_BinaryString(struct ndr_push *ndr, int ndr_flags, const struct lsa_BinaryString *r)
379 {
380         uint32_t cntr_array_1;
381         if (ndr_flags & NDR_SCALARS) {
382                 NDR_CHECK(ndr_push_align(ndr, 4));
383                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->length));
384                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
385                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->array));
386         }
387         if (ndr_flags & NDR_BUFFERS) {
388                 if (r->array) {
389                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size / 2));
390                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
391                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length / 2));
392                         for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) {
393                                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->array[cntr_array_1]));
394                         }
395                 }
396         }
397         return NDR_ERR_SUCCESS;
398 }
399
400 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_BinaryString(struct ndr_pull *ndr, int ndr_flags, struct lsa_BinaryString *r)
401 {
402         uint32_t _ptr_array;
403         uint32_t cntr_array_1;
404         TALLOC_CTX *_mem_save_array_0;
405         TALLOC_CTX *_mem_save_array_1;
406         if (ndr_flags & NDR_SCALARS) {
407                 NDR_CHECK(ndr_pull_align(ndr, 4));
408                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->length));
409                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
410                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_array));
411                 if (_ptr_array) {
412                         NDR_PULL_ALLOC(ndr, r->array);
413                 } else {
414                         r->array = NULL;
415                 }
416         }
417         if (ndr_flags & NDR_BUFFERS) {
418                 if (r->array) {
419                         _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr);
420                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
421                         NDR_CHECK(ndr_pull_array_size(ndr, &r->array));
422                         NDR_CHECK(ndr_pull_array_length(ndr, &r->array));
423                         if (ndr_get_array_length(ndr, &r->array) > ndr_get_array_size(ndr, &r->array)) {
424                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->array), ndr_get_array_length(ndr, &r->array));
425                         }
426                         NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
427                         _mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
428                         NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
429                         for (cntr_array_1 = 0; cntr_array_1 < r->length / 2; cntr_array_1++) {
430                                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
431                         }
432                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
433                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);
434                 }
435                 if (r->array) {
436                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->array, r->size / 2));
437                 }
438                 if (r->array) {
439                         NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->array, r->length / 2));
440                 }
441         }
442         return NDR_ERR_SUCCESS;
443 }
444
445 _PUBLIC_ void ndr_print_lsa_BinaryString(struct ndr_print *ndr, const char *name, const struct lsa_BinaryString *r)
446 {
447         uint32_t cntr_array_1;
448         ndr_print_struct(ndr, name, "lsa_BinaryString");
449         ndr->depth++;
450         ndr_print_uint16(ndr, "length", r->length);
451         ndr_print_uint16(ndr, "size", r->size);
452         ndr_print_ptr(ndr, "array", r->array);
453         ndr->depth++;
454         if (r->array) {
455                 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)r->length / 2);
456                 ndr->depth++;
457                 for (cntr_array_1=0;cntr_array_1<r->length / 2;cntr_array_1++) {
458                         char *idx_1=NULL;
459                         if (asprintf(&idx_1, "[%d]", cntr_array_1) != -1) {
460                                 ndr_print_uint16(ndr, "array", r->array[cntr_array_1]);
461                                 free(idx_1);
462                         }
463                 }
464                 ndr->depth--;
465         }
466         ndr->depth--;
467         ndr->depth--;
468 }
469
470 static enum ndr_err_code ndr_push_lsa_LUID(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUID *r)
471 {
472         if (ndr_flags & NDR_SCALARS) {
473                 NDR_CHECK(ndr_push_align(ndr, 4));
474                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->low));
475                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high));
476         }
477         if (ndr_flags & NDR_BUFFERS) {
478         }
479         return NDR_ERR_SUCCESS;
480 }
481
482 static enum ndr_err_code ndr_pull_lsa_LUID(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUID *r)
483 {
484         if (ndr_flags & NDR_SCALARS) {
485                 NDR_CHECK(ndr_pull_align(ndr, 4));
486                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->low));
487                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high));
488         }
489         if (ndr_flags & NDR_BUFFERS) {
490         }
491         return NDR_ERR_SUCCESS;
492 }
493
494 _PUBLIC_ void ndr_print_lsa_LUID(struct ndr_print *ndr, const char *name, const struct lsa_LUID *r)
495 {
496         ndr_print_struct(ndr, name, "lsa_LUID");
497         ndr->depth++;
498         ndr_print_uint32(ndr, "low", r->low);
499         ndr_print_uint32(ndr, "high", r->high);
500         ndr->depth--;
501 }
502
503 static enum ndr_err_code ndr_push_lsa_PrivEntry(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivEntry *r)
504 {
505         if (ndr_flags & NDR_SCALARS) {
506                 NDR_CHECK(ndr_push_align(ndr, 4));
507                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
508                 NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid));
509         }
510         if (ndr_flags & NDR_BUFFERS) {
511                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
512         }
513         return NDR_ERR_SUCCESS;
514 }
515
516 static enum ndr_err_code ndr_pull_lsa_PrivEntry(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivEntry *r)
517 {
518         if (ndr_flags & NDR_SCALARS) {
519                 NDR_CHECK(ndr_pull_align(ndr, 4));
520                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
521                 NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid));
522         }
523         if (ndr_flags & NDR_BUFFERS) {
524                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
525         }
526         return NDR_ERR_SUCCESS;
527 }
528
529 _PUBLIC_ void ndr_print_lsa_PrivEntry(struct ndr_print *ndr, const char *name, const struct lsa_PrivEntry *r)
530 {
531         ndr_print_struct(ndr, name, "lsa_PrivEntry");
532         ndr->depth++;
533         ndr_print_lsa_StringLarge(ndr, "name", &r->name);
534         ndr_print_lsa_LUID(ndr, "luid", &r->luid);
535         ndr->depth--;
536 }
537
538 static enum ndr_err_code ndr_push_lsa_PrivArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivArray *r)
539 {
540         uint32_t cntr_privs_1;
541         if (ndr_flags & NDR_SCALARS) {
542                 NDR_CHECK(ndr_push_align(ndr, 4));
543                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
544                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->privs));
545         }
546         if (ndr_flags & NDR_BUFFERS) {
547                 if (r->privs) {
548                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
549                         for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) {
550                                 NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1]));
551                         }
552                         for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) {
553                                 NDR_CHECK(ndr_push_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1]));
554                         }
555                 }
556         }
557         return NDR_ERR_SUCCESS;
558 }
559
560 static enum ndr_err_code ndr_pull_lsa_PrivArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivArray *r)
561 {
562         uint32_t _ptr_privs;
563         uint32_t cntr_privs_1;
564         TALLOC_CTX *_mem_save_privs_0;
565         TALLOC_CTX *_mem_save_privs_1;
566         if (ndr_flags & NDR_SCALARS) {
567                 NDR_CHECK(ndr_pull_align(ndr, 4));
568                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
569                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_privs));
570                 if (_ptr_privs) {
571                         NDR_PULL_ALLOC(ndr, r->privs);
572                 } else {
573                         r->privs = NULL;
574                 }
575         }
576         if (ndr_flags & NDR_BUFFERS) {
577                 if (r->privs) {
578                         _mem_save_privs_0 = NDR_PULL_GET_MEM_CTX(ndr);
579                         NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0);
580                         NDR_CHECK(ndr_pull_array_size(ndr, &r->privs));
581                         NDR_PULL_ALLOC_N(ndr, r->privs, ndr_get_array_size(ndr, &r->privs));
582                         _mem_save_privs_1 = NDR_PULL_GET_MEM_CTX(ndr);
583                         NDR_PULL_SET_MEM_CTX(ndr, r->privs, 0);
584                         for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) {
585                                 NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_SCALARS, &r->privs[cntr_privs_1]));
586                         }
587                         for (cntr_privs_1 = 0; cntr_privs_1 < r->count; cntr_privs_1++) {
588                                 NDR_CHECK(ndr_pull_lsa_PrivEntry(ndr, NDR_BUFFERS, &r->privs[cntr_privs_1]));
589                         }
590                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_1, 0);
591                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_privs_0, 0);
592                 }
593                 if (r->privs) {
594                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->privs, r->count));
595                 }
596         }
597         return NDR_ERR_SUCCESS;
598 }
599
600 _PUBLIC_ void ndr_print_lsa_PrivArray(struct ndr_print *ndr, const char *name, const struct lsa_PrivArray *r)
601 {
602         uint32_t cntr_privs_1;
603         ndr_print_struct(ndr, name, "lsa_PrivArray");
604         ndr->depth++;
605         ndr_print_uint32(ndr, "count", r->count);
606         ndr_print_ptr(ndr, "privs", r->privs);
607         ndr->depth++;
608         if (r->privs) {
609                 ndr->print(ndr, "%s: ARRAY(%d)", "privs", (int)r->count);
610                 ndr->depth++;
611                 for (cntr_privs_1=0;cntr_privs_1<r->count;cntr_privs_1++) {
612                         char *idx_1=NULL;
613                         if (asprintf(&idx_1, "[%d]", cntr_privs_1) != -1) {
614                                 ndr_print_lsa_PrivEntry(ndr, "privs", &r->privs[cntr_privs_1]);
615                                 free(idx_1);
616                         }
617                 }
618                 ndr->depth--;
619         }
620         ndr->depth--;
621         ndr->depth--;
622 }
623
624 static enum ndr_err_code ndr_push_lsa_QosInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_QosInfo *r)
625 {
626         if (ndr_flags & NDR_SCALARS) {
627                 NDR_CHECK(ndr_push_align(ndr, 4));
628                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
629                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->impersonation_level));
630                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->context_mode));
631                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->effective_only));
632         }
633         if (ndr_flags & NDR_BUFFERS) {
634         }
635         return NDR_ERR_SUCCESS;
636 }
637
638 static enum ndr_err_code ndr_pull_lsa_QosInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_QosInfo *r)
639 {
640         if (ndr_flags & NDR_SCALARS) {
641                 NDR_CHECK(ndr_pull_align(ndr, 4));
642                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len));
643                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->impersonation_level));
644                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->context_mode));
645                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->effective_only));
646         }
647         if (ndr_flags & NDR_BUFFERS) {
648         }
649         return NDR_ERR_SUCCESS;
650 }
651
652 _PUBLIC_ void ndr_print_lsa_QosInfo(struct ndr_print *ndr, const char *name, const struct lsa_QosInfo *r)
653 {
654         ndr_print_struct(ndr, name, "lsa_QosInfo");
655         ndr->depth++;
656         ndr_print_uint32(ndr, "len", r->len);
657         ndr_print_uint16(ndr, "impersonation_level", r->impersonation_level);
658         ndr_print_uint8(ndr, "context_mode", r->context_mode);
659         ndr_print_uint8(ndr, "effective_only", r->effective_only);
660         ndr->depth--;
661 }
662
663 static enum ndr_err_code ndr_push_lsa_ObjectAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_ObjectAttribute *r)
664 {
665         if (ndr_flags & NDR_SCALARS) {
666                 NDR_CHECK(ndr_push_align(ndr, 4));
667                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->len));
668                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->root_dir));
669                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->object_name));
670                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attributes));
671                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_desc));
672                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sec_qos));
673         }
674         if (ndr_flags & NDR_BUFFERS) {
675                 if (r->root_dir) {
676                         NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, *r->root_dir));
677                 }
678                 if (r->object_name) {
679                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16)));
680                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
681                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->object_name, CH_UTF16)));
682                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->object_name, ndr_charset_length(r->object_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
683                 }
684                 if (r->sec_desc) {
685                         NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc));
686                 }
687                 if (r->sec_qos) {
688                         NDR_CHECK(ndr_push_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos));
689                 }
690         }
691         return NDR_ERR_SUCCESS;
692 }
693
694 static enum ndr_err_code ndr_pull_lsa_ObjectAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_ObjectAttribute *r)
695 {
696         uint32_t _ptr_root_dir;
697         TALLOC_CTX *_mem_save_root_dir_0;
698         uint32_t _ptr_object_name;
699         TALLOC_CTX *_mem_save_object_name_0;
700         uint32_t _ptr_sec_desc;
701         TALLOC_CTX *_mem_save_sec_desc_0;
702         uint32_t _ptr_sec_qos;
703         TALLOC_CTX *_mem_save_sec_qos_0;
704         if (ndr_flags & NDR_SCALARS) {
705                 NDR_CHECK(ndr_pull_align(ndr, 4));
706                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->len));
707                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_root_dir));
708                 if (_ptr_root_dir) {
709                         NDR_PULL_ALLOC(ndr, r->root_dir);
710                 } else {
711                         r->root_dir = NULL;
712                 }
713                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_object_name));
714                 if (_ptr_object_name) {
715                         NDR_PULL_ALLOC(ndr, r->object_name);
716                 } else {
717                         r->object_name = NULL;
718                 }
719                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attributes));
720                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_desc));
721                 if (_ptr_sec_desc) {
722                         NDR_PULL_ALLOC(ndr, r->sec_desc);
723                 } else {
724                         r->sec_desc = NULL;
725                 }
726                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sec_qos));
727                 if (_ptr_sec_qos) {
728                         NDR_PULL_ALLOC(ndr, r->sec_qos);
729                 } else {
730                         r->sec_qos = NULL;
731                 }
732         }
733         if (ndr_flags & NDR_BUFFERS) {
734                 if (r->root_dir) {
735                         _mem_save_root_dir_0 = NDR_PULL_GET_MEM_CTX(ndr);
736                         NDR_PULL_SET_MEM_CTX(ndr, r->root_dir, 0);
737                         NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, r->root_dir));
738                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_root_dir_0, 0);
739                 }
740                 if (r->object_name) {
741                         _mem_save_object_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
742                         NDR_PULL_SET_MEM_CTX(ndr, r->object_name, 0);
743                         NDR_CHECK(ndr_pull_array_size(ndr, &r->object_name));
744                         NDR_CHECK(ndr_pull_array_length(ndr, &r->object_name));
745                         if (ndr_get_array_length(ndr, &r->object_name) > ndr_get_array_size(ndr, &r->object_name)) {
746                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->object_name), ndr_get_array_length(ndr, &r->object_name));
747                         }
748                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t)));
749                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->object_name, ndr_get_array_length(ndr, &r->object_name), sizeof(uint16_t), CH_UTF16));
750                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_object_name_0, 0);
751                 }
752                 if (r->sec_desc) {
753                         _mem_save_sec_desc_0 = NDR_PULL_GET_MEM_CTX(ndr);
754                         NDR_PULL_SET_MEM_CTX(ndr, r->sec_desc, 0);
755                         NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->sec_desc));
756                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_desc_0, 0);
757                 }
758                 if (r->sec_qos) {
759                         _mem_save_sec_qos_0 = NDR_PULL_GET_MEM_CTX(ndr);
760                         NDR_PULL_SET_MEM_CTX(ndr, r->sec_qos, 0);
761                         NDR_CHECK(ndr_pull_lsa_QosInfo(ndr, NDR_SCALARS, r->sec_qos));
762                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sec_qos_0, 0);
763                 }
764         }
765         return NDR_ERR_SUCCESS;
766 }
767
768 _PUBLIC_ void ndr_print_lsa_ObjectAttribute(struct ndr_print *ndr, const char *name, const struct lsa_ObjectAttribute *r)
769 {
770         ndr_print_struct(ndr, name, "lsa_ObjectAttribute");
771         ndr->depth++;
772         ndr_print_uint32(ndr, "len", r->len);
773         ndr_print_ptr(ndr, "root_dir", r->root_dir);
774         ndr->depth++;
775         if (r->root_dir) {
776                 ndr_print_uint8(ndr, "root_dir", *r->root_dir);
777         }
778         ndr->depth--;
779         ndr_print_ptr(ndr, "object_name", r->object_name);
780         ndr->depth++;
781         if (r->object_name) {
782                 ndr_print_string(ndr, "object_name", r->object_name);
783         }
784         ndr->depth--;
785         ndr_print_uint32(ndr, "attributes", r->attributes);
786         ndr_print_ptr(ndr, "sec_desc", r->sec_desc);
787         ndr->depth++;
788         if (r->sec_desc) {
789                 ndr_print_security_descriptor(ndr, "sec_desc", r->sec_desc);
790         }
791         ndr->depth--;
792         ndr_print_ptr(ndr, "sec_qos", r->sec_qos);
793         ndr->depth++;
794         if (r->sec_qos) {
795                 ndr_print_lsa_QosInfo(ndr, "sec_qos", r->sec_qos);
796         }
797         ndr->depth--;
798         ndr->depth--;
799 }
800
801 _PUBLIC_ enum ndr_err_code ndr_push_lsa_PolicyAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
802 {
803         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
804         return NDR_ERR_SUCCESS;
805 }
806
807 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_PolicyAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
808 {
809         uint32_t v;
810         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
811         *r = v;
812         return NDR_ERR_SUCCESS;
813 }
814
815 _PUBLIC_ void ndr_print_lsa_PolicyAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
816 {
817         ndr_print_uint32(ndr, name, r);
818         ndr->depth++;
819         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_LOCAL_INFORMATION", LSA_POLICY_VIEW_LOCAL_INFORMATION, r);
820         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_VIEW_AUDIT_INFORMATION", LSA_POLICY_VIEW_AUDIT_INFORMATION, r);
821         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_GET_PRIVATE_INFORMATION", LSA_POLICY_GET_PRIVATE_INFORMATION, r);
822         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_TRUST_ADMIN", LSA_POLICY_TRUST_ADMIN, r);
823         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_ACCOUNT", LSA_POLICY_CREATE_ACCOUNT, r);
824         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_SECRET", LSA_POLICY_CREATE_SECRET, r);
825         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_CREATE_PRIVILEGE", LSA_POLICY_CREATE_PRIVILEGE, r);
826         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS", LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS, r);
827         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SET_AUDIT_REQUIREMENTS", LSA_POLICY_SET_AUDIT_REQUIREMENTS, r);
828         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_AUDIT_LOG_ADMIN", LSA_POLICY_AUDIT_LOG_ADMIN, r);
829         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_SERVER_ADMIN", LSA_POLICY_SERVER_ADMIN, r);
830         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_POLICY_LOOKUP_NAMES", LSA_POLICY_LOOKUP_NAMES, r);
831         ndr->depth--;
832 }
833
834 static enum ndr_err_code ndr_push_lsa_AuditLogInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditLogInfo *r)
835 {
836         if (ndr_flags & NDR_SCALARS) {
837                 NDR_CHECK(ndr_push_align(ndr, 8));
838                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->percent_full));
839                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->maximum_log_size));
840                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->retention_time));
841                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_in_progress));
842                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->time_to_shutdown));
843                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->next_audit_record));
844         }
845         if (ndr_flags & NDR_BUFFERS) {
846         }
847         return NDR_ERR_SUCCESS;
848 }
849
850 static enum ndr_err_code ndr_pull_lsa_AuditLogInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditLogInfo *r)
851 {
852         if (ndr_flags & NDR_SCALARS) {
853                 NDR_CHECK(ndr_pull_align(ndr, 8));
854                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->percent_full));
855                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->maximum_log_size));
856                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->retention_time));
857                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_in_progress));
858                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->time_to_shutdown));
859                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->next_audit_record));
860         }
861         if (ndr_flags & NDR_BUFFERS) {
862         }
863         return NDR_ERR_SUCCESS;
864 }
865
866 _PUBLIC_ void ndr_print_lsa_AuditLogInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditLogInfo *r)
867 {
868         ndr_print_struct(ndr, name, "lsa_AuditLogInfo");
869         ndr->depth++;
870         ndr_print_uint32(ndr, "percent_full", r->percent_full);
871         ndr_print_uint32(ndr, "maximum_log_size", r->maximum_log_size);
872         ndr_print_hyper(ndr, "retention_time", r->retention_time);
873         ndr_print_uint8(ndr, "shutdown_in_progress", r->shutdown_in_progress);
874         ndr_print_hyper(ndr, "time_to_shutdown", r->time_to_shutdown);
875         ndr_print_uint32(ndr, "next_audit_record", r->next_audit_record);
876         ndr->depth--;
877 }
878
879 static enum ndr_err_code ndr_push_lsa_PolicyAuditPolicy(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy r)
880 {
881         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
882         return NDR_ERR_SUCCESS;
883 }
884
885 static enum ndr_err_code ndr_pull_lsa_PolicyAuditPolicy(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyAuditPolicy *r)
886 {
887         uint32_t v;
888         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
889         *r = v;
890         return NDR_ERR_SUCCESS;
891 }
892
893 _PUBLIC_ void ndr_print_lsa_PolicyAuditPolicy(struct ndr_print *ndr, const char *name, enum lsa_PolicyAuditPolicy r)
894 {
895         const char *val = NULL;
896
897         switch (r) {
898                 case LSA_AUDIT_POLICY_NONE: val = "LSA_AUDIT_POLICY_NONE"; break;
899                 case LSA_AUDIT_POLICY_SUCCESS: val = "LSA_AUDIT_POLICY_SUCCESS"; break;
900                 case LSA_AUDIT_POLICY_FAILURE: val = "LSA_AUDIT_POLICY_FAILURE"; break;
901                 case LSA_AUDIT_POLICY_ALL: val = "LSA_AUDIT_POLICY_ALL"; break;
902                 case LSA_AUDIT_POLICY_CLEAR: val = "LSA_AUDIT_POLICY_CLEAR"; break;
903         }
904         ndr_print_enum(ndr, name, "ENUM", val, r);
905 }
906
907 static enum ndr_err_code ndr_push_lsa_AuditEventsInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditEventsInfo *r)
908 {
909         uint32_t cntr_settings_1;
910         if (ndr_flags & NDR_SCALARS) {
911                 NDR_CHECK(ndr_push_align(ndr, 4));
912                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->auditing_mode));
913                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->settings));
914                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
915         }
916         if (ndr_flags & NDR_BUFFERS) {
917                 if (r->settings) {
918                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
919                         for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) {
920                                 NDR_CHECK(ndr_push_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, r->settings[cntr_settings_1]));
921                         }
922                 }
923         }
924         return NDR_ERR_SUCCESS;
925 }
926
927 static enum ndr_err_code ndr_pull_lsa_AuditEventsInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditEventsInfo *r)
928 {
929         uint32_t _ptr_settings;
930         uint32_t cntr_settings_1;
931         TALLOC_CTX *_mem_save_settings_0;
932         TALLOC_CTX *_mem_save_settings_1;
933         if (ndr_flags & NDR_SCALARS) {
934                 NDR_CHECK(ndr_pull_align(ndr, 4));
935                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->auditing_mode));
936                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_settings));
937                 if (_ptr_settings) {
938                         NDR_PULL_ALLOC(ndr, r->settings);
939                 } else {
940                         r->settings = NULL;
941                 }
942                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
943         }
944         if (ndr_flags & NDR_BUFFERS) {
945                 if (r->settings) {
946                         _mem_save_settings_0 = NDR_PULL_GET_MEM_CTX(ndr);
947                         NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0);
948                         NDR_CHECK(ndr_pull_array_size(ndr, &r->settings));
949                         NDR_PULL_ALLOC_N(ndr, r->settings, ndr_get_array_size(ndr, &r->settings));
950                         _mem_save_settings_1 = NDR_PULL_GET_MEM_CTX(ndr);
951                         NDR_PULL_SET_MEM_CTX(ndr, r->settings, 0);
952                         for (cntr_settings_1 = 0; cntr_settings_1 < r->count; cntr_settings_1++) {
953                                 NDR_CHECK(ndr_pull_lsa_PolicyAuditPolicy(ndr, NDR_SCALARS, &r->settings[cntr_settings_1]));
954                         }
955                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_1, 0);
956                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_settings_0, 0);
957                 }
958                 if (r->settings) {
959                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->settings, r->count));
960                 }
961         }
962         return NDR_ERR_SUCCESS;
963 }
964
965 _PUBLIC_ void ndr_print_lsa_AuditEventsInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditEventsInfo *r)
966 {
967         uint32_t cntr_settings_1;
968         ndr_print_struct(ndr, name, "lsa_AuditEventsInfo");
969         ndr->depth++;
970         ndr_print_uint32(ndr, "auditing_mode", r->auditing_mode);
971         ndr_print_ptr(ndr, "settings", r->settings);
972         ndr->depth++;
973         if (r->settings) {
974                 ndr->print(ndr, "%s: ARRAY(%d)", "settings", (int)r->count);
975                 ndr->depth++;
976                 for (cntr_settings_1=0;cntr_settings_1<r->count;cntr_settings_1++) {
977                         char *idx_1=NULL;
978                         if (asprintf(&idx_1, "[%d]", cntr_settings_1) != -1) {
979                                 ndr_print_lsa_PolicyAuditPolicy(ndr, "settings", r->settings[cntr_settings_1]);
980                                 free(idx_1);
981                         }
982                 }
983                 ndr->depth--;
984         }
985         ndr->depth--;
986         ndr_print_uint32(ndr, "count", r->count);
987         ndr->depth--;
988 }
989
990 static enum ndr_err_code ndr_push_lsa_DomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainInfo *r)
991 {
992         if (ndr_flags & NDR_SCALARS) {
993                 NDR_CHECK(ndr_push_align(ndr, 4));
994                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
995                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
996         }
997         if (ndr_flags & NDR_BUFFERS) {
998                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
999                 if (r->sid) {
1000                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1001                 }
1002         }
1003         return NDR_ERR_SUCCESS;
1004 }
1005
1006 static enum ndr_err_code ndr_pull_lsa_DomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainInfo *r)
1007 {
1008         uint32_t _ptr_sid;
1009         TALLOC_CTX *_mem_save_sid_0;
1010         if (ndr_flags & NDR_SCALARS) {
1011                 NDR_CHECK(ndr_pull_align(ndr, 4));
1012                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
1013                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1014                 if (_ptr_sid) {
1015                         NDR_PULL_ALLOC(ndr, r->sid);
1016                 } else {
1017                         r->sid = NULL;
1018                 }
1019         }
1020         if (ndr_flags & NDR_BUFFERS) {
1021                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
1022                 if (r->sid) {
1023                         _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1024                         NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1025                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1026                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1027                 }
1028         }
1029         return NDR_ERR_SUCCESS;
1030 }
1031
1032 _PUBLIC_ void ndr_print_lsa_DomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DomainInfo *r)
1033 {
1034         ndr_print_struct(ndr, name, "lsa_DomainInfo");
1035         ndr->depth++;
1036         ndr_print_lsa_StringLarge(ndr, "name", &r->name);
1037         ndr_print_ptr(ndr, "sid", r->sid);
1038         ndr->depth++;
1039         if (r->sid) {
1040                 ndr_print_dom_sid2(ndr, "sid", r->sid);
1041         }
1042         ndr->depth--;
1043         ndr->depth--;
1044 }
1045
1046 static enum ndr_err_code ndr_push_lsa_PDAccountInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_PDAccountInfo *r)
1047 {
1048         if (ndr_flags & NDR_SCALARS) {
1049                 NDR_CHECK(ndr_push_align(ndr, 4));
1050                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
1051         }
1052         if (ndr_flags & NDR_BUFFERS) {
1053                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
1054         }
1055         return NDR_ERR_SUCCESS;
1056 }
1057
1058 static enum ndr_err_code ndr_pull_lsa_PDAccountInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_PDAccountInfo *r)
1059 {
1060         if (ndr_flags & NDR_SCALARS) {
1061                 NDR_CHECK(ndr_pull_align(ndr, 4));
1062                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
1063         }
1064         if (ndr_flags & NDR_BUFFERS) {
1065                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
1066         }
1067         return NDR_ERR_SUCCESS;
1068 }
1069
1070 _PUBLIC_ void ndr_print_lsa_PDAccountInfo(struct ndr_print *ndr, const char *name, const struct lsa_PDAccountInfo *r)
1071 {
1072         ndr_print_struct(ndr, name, "lsa_PDAccountInfo");
1073         ndr->depth++;
1074         ndr_print_lsa_String(ndr, "name", &r->name);
1075         ndr->depth--;
1076 }
1077
1078 static enum ndr_err_code ndr_push_lsa_Role(struct ndr_push *ndr, int ndr_flags, enum lsa_Role r)
1079 {
1080         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1081         return NDR_ERR_SUCCESS;
1082 }
1083
1084 static enum ndr_err_code ndr_pull_lsa_Role(struct ndr_pull *ndr, int ndr_flags, enum lsa_Role *r)
1085 {
1086         uint32_t v;
1087         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1088         *r = v;
1089         return NDR_ERR_SUCCESS;
1090 }
1091
1092 _PUBLIC_ void ndr_print_lsa_Role(struct ndr_print *ndr, const char *name, enum lsa_Role r)
1093 {
1094         const char *val = NULL;
1095
1096         switch (r) {
1097                 case LSA_ROLE_BACKUP: val = "LSA_ROLE_BACKUP"; break;
1098                 case LSA_ROLE_PRIMARY: val = "LSA_ROLE_PRIMARY"; break;
1099         }
1100         ndr_print_enum(ndr, name, "ENUM", val, r);
1101 }
1102
1103 static enum ndr_err_code ndr_push_lsa_ServerRole(struct ndr_push *ndr, int ndr_flags, const struct lsa_ServerRole *r)
1104 {
1105         if (ndr_flags & NDR_SCALARS) {
1106                 NDR_CHECK(ndr_push_align(ndr, 4));
1107                 NDR_CHECK(ndr_push_lsa_Role(ndr, NDR_SCALARS, r->role));
1108         }
1109         if (ndr_flags & NDR_BUFFERS) {
1110         }
1111         return NDR_ERR_SUCCESS;
1112 }
1113
1114 static enum ndr_err_code ndr_pull_lsa_ServerRole(struct ndr_pull *ndr, int ndr_flags, struct lsa_ServerRole *r)
1115 {
1116         if (ndr_flags & NDR_SCALARS) {
1117                 NDR_CHECK(ndr_pull_align(ndr, 4));
1118                 NDR_CHECK(ndr_pull_lsa_Role(ndr, NDR_SCALARS, &r->role));
1119         }
1120         if (ndr_flags & NDR_BUFFERS) {
1121         }
1122         return NDR_ERR_SUCCESS;
1123 }
1124
1125 _PUBLIC_ void ndr_print_lsa_ServerRole(struct ndr_print *ndr, const char *name, const struct lsa_ServerRole *r)
1126 {
1127         ndr_print_struct(ndr, name, "lsa_ServerRole");
1128         ndr->depth++;
1129         ndr_print_lsa_Role(ndr, "role", r->role);
1130         ndr->depth--;
1131 }
1132
1133 static enum ndr_err_code ndr_push_lsa_ReplicaSourceInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ReplicaSourceInfo *r)
1134 {
1135         if (ndr_flags & NDR_SCALARS) {
1136                 NDR_CHECK(ndr_push_align(ndr, 4));
1137                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->source));
1138                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->account));
1139         }
1140         if (ndr_flags & NDR_BUFFERS) {
1141                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->source));
1142                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->account));
1143         }
1144         return NDR_ERR_SUCCESS;
1145 }
1146
1147 static enum ndr_err_code ndr_pull_lsa_ReplicaSourceInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ReplicaSourceInfo *r)
1148 {
1149         if (ndr_flags & NDR_SCALARS) {
1150                 NDR_CHECK(ndr_pull_align(ndr, 4));
1151                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->source));
1152                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->account));
1153         }
1154         if (ndr_flags & NDR_BUFFERS) {
1155                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->source));
1156                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->account));
1157         }
1158         return NDR_ERR_SUCCESS;
1159 }
1160
1161 _PUBLIC_ void ndr_print_lsa_ReplicaSourceInfo(struct ndr_print *ndr, const char *name, const struct lsa_ReplicaSourceInfo *r)
1162 {
1163         ndr_print_struct(ndr, name, "lsa_ReplicaSourceInfo");
1164         ndr->depth++;
1165         ndr_print_lsa_String(ndr, "source", &r->source);
1166         ndr_print_lsa_String(ndr, "account", &r->account);
1167         ndr->depth--;
1168 }
1169
1170 static enum ndr_err_code ndr_push_lsa_DefaultQuotaInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DefaultQuotaInfo *r)
1171 {
1172         if (ndr_flags & NDR_SCALARS) {
1173                 NDR_CHECK(ndr_push_align(ndr, 8));
1174                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->paged_pool));
1175                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->non_paged_pool));
1176                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->min_wss));
1177                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_wss));
1178                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pagefile));
1179                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->unknown));
1180         }
1181         if (ndr_flags & NDR_BUFFERS) {
1182         }
1183         return NDR_ERR_SUCCESS;
1184 }
1185
1186 static enum ndr_err_code ndr_pull_lsa_DefaultQuotaInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DefaultQuotaInfo *r)
1187 {
1188         if (ndr_flags & NDR_SCALARS) {
1189                 NDR_CHECK(ndr_pull_align(ndr, 8));
1190                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->paged_pool));
1191                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->non_paged_pool));
1192                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->min_wss));
1193                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_wss));
1194                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pagefile));
1195                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->unknown));
1196         }
1197         if (ndr_flags & NDR_BUFFERS) {
1198         }
1199         return NDR_ERR_SUCCESS;
1200 }
1201
1202 _PUBLIC_ void ndr_print_lsa_DefaultQuotaInfo(struct ndr_print *ndr, const char *name, const struct lsa_DefaultQuotaInfo *r)
1203 {
1204         ndr_print_struct(ndr, name, "lsa_DefaultQuotaInfo");
1205         ndr->depth++;
1206         ndr_print_uint32(ndr, "paged_pool", r->paged_pool);
1207         ndr_print_uint32(ndr, "non_paged_pool", r->non_paged_pool);
1208         ndr_print_uint32(ndr, "min_wss", r->min_wss);
1209         ndr_print_uint32(ndr, "max_wss", r->max_wss);
1210         ndr_print_uint32(ndr, "pagefile", r->pagefile);
1211         ndr_print_hyper(ndr, "unknown", r->unknown);
1212         ndr->depth--;
1213 }
1214
1215 static enum ndr_err_code ndr_push_lsa_ModificationInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_ModificationInfo *r)
1216 {
1217         if (ndr_flags & NDR_SCALARS) {
1218                 NDR_CHECK(ndr_push_align(ndr, 8));
1219                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->modified_id));
1220                 NDR_CHECK(ndr_push_NTTIME_hyper(ndr, NDR_SCALARS, r->db_create_time));
1221         }
1222         if (ndr_flags & NDR_BUFFERS) {
1223         }
1224         return NDR_ERR_SUCCESS;
1225 }
1226
1227 static enum ndr_err_code ndr_pull_lsa_ModificationInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_ModificationInfo *r)
1228 {
1229         if (ndr_flags & NDR_SCALARS) {
1230                 NDR_CHECK(ndr_pull_align(ndr, 8));
1231                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->modified_id));
1232                 NDR_CHECK(ndr_pull_NTTIME_hyper(ndr, NDR_SCALARS, &r->db_create_time));
1233         }
1234         if (ndr_flags & NDR_BUFFERS) {
1235         }
1236         return NDR_ERR_SUCCESS;
1237 }
1238
1239 _PUBLIC_ void ndr_print_lsa_ModificationInfo(struct ndr_print *ndr, const char *name, const struct lsa_ModificationInfo *r)
1240 {
1241         ndr_print_struct(ndr, name, "lsa_ModificationInfo");
1242         ndr->depth++;
1243         ndr_print_hyper(ndr, "modified_id", r->modified_id);
1244         ndr_print_NTTIME_hyper(ndr, "db_create_time", r->db_create_time);
1245         ndr->depth--;
1246 }
1247
1248 static enum ndr_err_code ndr_push_lsa_AuditFullSetInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullSetInfo *r)
1249 {
1250         if (ndr_flags & NDR_SCALARS) {
1251                 NDR_CHECK(ndr_push_align(ndr, 1));
1252                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full));
1253         }
1254         if (ndr_flags & NDR_BUFFERS) {
1255         }
1256         return NDR_ERR_SUCCESS;
1257 }
1258
1259 static enum ndr_err_code ndr_pull_lsa_AuditFullSetInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullSetInfo *r)
1260 {
1261         if (ndr_flags & NDR_SCALARS) {
1262                 NDR_CHECK(ndr_pull_align(ndr, 1));
1263                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full));
1264         }
1265         if (ndr_flags & NDR_BUFFERS) {
1266         }
1267         return NDR_ERR_SUCCESS;
1268 }
1269
1270 _PUBLIC_ void ndr_print_lsa_AuditFullSetInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullSetInfo *r)
1271 {
1272         ndr_print_struct(ndr, name, "lsa_AuditFullSetInfo");
1273         ndr->depth++;
1274         ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full);
1275         ndr->depth--;
1276 }
1277
1278 static enum ndr_err_code ndr_push_lsa_AuditFullQueryInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_AuditFullQueryInfo *r)
1279 {
1280         if (ndr_flags & NDR_SCALARS) {
1281                 NDR_CHECK(ndr_push_align(ndr, 1));
1282                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->shutdown_on_full));
1283                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->log_is_full));
1284         }
1285         if (ndr_flags & NDR_BUFFERS) {
1286         }
1287         return NDR_ERR_SUCCESS;
1288 }
1289
1290 static enum ndr_err_code ndr_pull_lsa_AuditFullQueryInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_AuditFullQueryInfo *r)
1291 {
1292         if (ndr_flags & NDR_SCALARS) {
1293                 NDR_CHECK(ndr_pull_align(ndr, 1));
1294                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->shutdown_on_full));
1295                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->log_is_full));
1296         }
1297         if (ndr_flags & NDR_BUFFERS) {
1298         }
1299         return NDR_ERR_SUCCESS;
1300 }
1301
1302 _PUBLIC_ void ndr_print_lsa_AuditFullQueryInfo(struct ndr_print *ndr, const char *name, const struct lsa_AuditFullQueryInfo *r)
1303 {
1304         ndr_print_struct(ndr, name, "lsa_AuditFullQueryInfo");
1305         ndr->depth++;
1306         ndr_print_uint8(ndr, "shutdown_on_full", r->shutdown_on_full);
1307         ndr_print_uint8(ndr, "log_is_full", r->log_is_full);
1308         ndr->depth--;
1309 }
1310
1311 static enum ndr_err_code ndr_push_lsa_DnsDomainInfo(struct ndr_push *ndr, int ndr_flags, const struct lsa_DnsDomainInfo *r)
1312 {
1313         if (ndr_flags & NDR_SCALARS) {
1314                 NDR_CHECK(ndr_push_align(ndr, 4));
1315                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
1316                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain));
1317                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest));
1318                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_guid));
1319                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1320         }
1321         if (ndr_flags & NDR_BUFFERS) {
1322                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
1323                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain));
1324                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest));
1325                 if (r->sid) {
1326                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1327                 }
1328         }
1329         return NDR_ERR_SUCCESS;
1330 }
1331
1332 static enum ndr_err_code ndr_pull_lsa_DnsDomainInfo(struct ndr_pull *ndr, int ndr_flags, struct lsa_DnsDomainInfo *r)
1333 {
1334         uint32_t _ptr_sid;
1335         TALLOC_CTX *_mem_save_sid_0;
1336         if (ndr_flags & NDR_SCALARS) {
1337                 NDR_CHECK(ndr_pull_align(ndr, 4));
1338                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->name));
1339                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_domain));
1340                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->dns_forest));
1341                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_guid));
1342                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1343                 if (_ptr_sid) {
1344                         NDR_PULL_ALLOC(ndr, r->sid);
1345                 } else {
1346                         r->sid = NULL;
1347                 }
1348         }
1349         if (ndr_flags & NDR_BUFFERS) {
1350                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->name));
1351                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_domain));
1352                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->dns_forest));
1353                 if (r->sid) {
1354                         _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1355                         NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1356                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1357                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1358                 }
1359         }
1360         return NDR_ERR_SUCCESS;
1361 }
1362
1363 _PUBLIC_ void ndr_print_lsa_DnsDomainInfo(struct ndr_print *ndr, const char *name, const struct lsa_DnsDomainInfo *r)
1364 {
1365         ndr_print_struct(ndr, name, "lsa_DnsDomainInfo");
1366         ndr->depth++;
1367         ndr_print_lsa_StringLarge(ndr, "name", &r->name);
1368         ndr_print_lsa_StringLarge(ndr, "dns_domain", &r->dns_domain);
1369         ndr_print_lsa_StringLarge(ndr, "dns_forest", &r->dns_forest);
1370         ndr_print_GUID(ndr, "domain_guid", &r->domain_guid);
1371         ndr_print_ptr(ndr, "sid", r->sid);
1372         ndr->depth++;
1373         if (r->sid) {
1374                 ndr_print_dom_sid2(ndr, "sid", r->sid);
1375         }
1376         ndr->depth--;
1377         ndr->depth--;
1378 }
1379
1380 static enum ndr_err_code ndr_push_lsa_PolicyInfo(struct ndr_push *ndr, int ndr_flags, enum lsa_PolicyInfo r)
1381 {
1382         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
1383         return NDR_ERR_SUCCESS;
1384 }
1385
1386 static enum ndr_err_code ndr_pull_lsa_PolicyInfo(struct ndr_pull *ndr, int ndr_flags, enum lsa_PolicyInfo *r)
1387 {
1388         uint16_t v;
1389         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
1390         *r = v;
1391         return NDR_ERR_SUCCESS;
1392 }
1393
1394 _PUBLIC_ void ndr_print_lsa_PolicyInfo(struct ndr_print *ndr, const char *name, enum lsa_PolicyInfo r)
1395 {
1396         const char *val = NULL;
1397
1398         switch (r) {
1399                 case LSA_POLICY_INFO_AUDIT_LOG: val = "LSA_POLICY_INFO_AUDIT_LOG"; break;
1400                 case LSA_POLICY_INFO_AUDIT_EVENTS: val = "LSA_POLICY_INFO_AUDIT_EVENTS"; break;
1401                 case LSA_POLICY_INFO_DOMAIN: val = "LSA_POLICY_INFO_DOMAIN"; break;
1402                 case LSA_POLICY_INFO_PD: val = "LSA_POLICY_INFO_PD"; break;
1403                 case LSA_POLICY_INFO_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_ACCOUNT_DOMAIN"; break;
1404                 case LSA_POLICY_INFO_ROLE: val = "LSA_POLICY_INFO_ROLE"; break;
1405                 case LSA_POLICY_INFO_REPLICA: val = "LSA_POLICY_INFO_REPLICA"; break;
1406                 case LSA_POLICY_INFO_QUOTA: val = "LSA_POLICY_INFO_QUOTA"; break;
1407                 case LSA_POLICY_INFO_MOD: val = "LSA_POLICY_INFO_MOD"; break;
1408                 case LSA_POLICY_INFO_AUDIT_FULL_SET: val = "LSA_POLICY_INFO_AUDIT_FULL_SET"; break;
1409                 case LSA_POLICY_INFO_AUDIT_FULL_QUERY: val = "LSA_POLICY_INFO_AUDIT_FULL_QUERY"; break;
1410                 case LSA_POLICY_INFO_DNS: val = "LSA_POLICY_INFO_DNS"; break;
1411                 case LSA_POLICY_INFO_DNS_INT: val = "LSA_POLICY_INFO_DNS_INT"; break;
1412                 case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: val = "LSA_POLICY_INFO_L_ACCOUNT_DOMAIN"; break;
1413         }
1414         ndr_print_enum(ndr, name, "ENUM", val, r);
1415 }
1416
1417 static enum ndr_err_code ndr_push_lsa_PolicyInformation(struct ndr_push *ndr, int ndr_flags, const union lsa_PolicyInformation *r)
1418 {
1419         if (ndr_flags & NDR_SCALARS) {
1420                 int level = ndr_push_get_switch_value(ndr, r);
1421                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
1422                 switch (level) {
1423                         case LSA_POLICY_INFO_AUDIT_LOG: {
1424                                 NDR_CHECK(ndr_push_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log));
1425                         break; }
1426
1427                         case LSA_POLICY_INFO_AUDIT_EVENTS: {
1428                                 NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events));
1429                         break; }
1430
1431                         case LSA_POLICY_INFO_DOMAIN: {
1432                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain));
1433                         break; }
1434
1435                         case LSA_POLICY_INFO_PD: {
1436                                 NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd));
1437                         break; }
1438
1439                         case LSA_POLICY_INFO_ACCOUNT_DOMAIN: {
1440                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain));
1441                         break; }
1442
1443                         case LSA_POLICY_INFO_ROLE: {
1444                                 NDR_CHECK(ndr_push_lsa_ServerRole(ndr, NDR_SCALARS, &r->role));
1445                         break; }
1446
1447                         case LSA_POLICY_INFO_REPLICA: {
1448                                 NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica));
1449                         break; }
1450
1451                         case LSA_POLICY_INFO_QUOTA: {
1452                                 NDR_CHECK(ndr_push_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota));
1453                         break; }
1454
1455                         case LSA_POLICY_INFO_MOD: {
1456                                 NDR_CHECK(ndr_push_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod));
1457                         break; }
1458
1459                         case LSA_POLICY_INFO_AUDIT_FULL_SET: {
1460                                 NDR_CHECK(ndr_push_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset));
1461                         break; }
1462
1463                         case LSA_POLICY_INFO_AUDIT_FULL_QUERY: {
1464                                 NDR_CHECK(ndr_push_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery));
1465                         break; }
1466
1467                         case LSA_POLICY_INFO_DNS: {
1468                                 NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
1469                         break; }
1470
1471                         case LSA_POLICY_INFO_DNS_INT: {
1472                                 NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
1473                         break; }
1474
1475                         case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: {
1476                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain));
1477                         break; }
1478
1479                         default:
1480                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1481                 }
1482         }
1483         if (ndr_flags & NDR_BUFFERS) {
1484                 int level = ndr_push_get_switch_value(ndr, r);
1485                 switch (level) {
1486                         case LSA_POLICY_INFO_AUDIT_LOG:
1487                         break;
1488
1489                         case LSA_POLICY_INFO_AUDIT_EVENTS:
1490                                 NDR_CHECK(ndr_push_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events));
1491                         break;
1492
1493                         case LSA_POLICY_INFO_DOMAIN:
1494                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain));
1495                         break;
1496
1497                         case LSA_POLICY_INFO_PD:
1498                                 NDR_CHECK(ndr_push_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd));
1499                         break;
1500
1501                         case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
1502                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain));
1503                         break;
1504
1505                         case LSA_POLICY_INFO_ROLE:
1506                         break;
1507
1508                         case LSA_POLICY_INFO_REPLICA:
1509                                 NDR_CHECK(ndr_push_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica));
1510                         break;
1511
1512                         case LSA_POLICY_INFO_QUOTA:
1513                         break;
1514
1515                         case LSA_POLICY_INFO_MOD:
1516                         break;
1517
1518                         case LSA_POLICY_INFO_AUDIT_FULL_SET:
1519                         break;
1520
1521                         case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
1522                         break;
1523
1524                         case LSA_POLICY_INFO_DNS:
1525                                 NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
1526                         break;
1527
1528                         case LSA_POLICY_INFO_DNS_INT:
1529                                 NDR_CHECK(ndr_push_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
1530                         break;
1531
1532                         case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
1533                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain));
1534                         break;
1535
1536                         default:
1537                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1538                 }
1539         }
1540         return NDR_ERR_SUCCESS;
1541 }
1542
1543 static enum ndr_err_code ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, union lsa_PolicyInformation *r)
1544 {
1545         int level;
1546         uint16_t _level;
1547         level = ndr_pull_get_switch_value(ndr, r);
1548         if (ndr_flags & NDR_SCALARS) {
1549                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
1550                 if (_level != level) {
1551                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
1552                 }
1553                 switch (level) {
1554                         case LSA_POLICY_INFO_AUDIT_LOG: {
1555                                 NDR_CHECK(ndr_pull_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log));
1556                         break; }
1557
1558                         case LSA_POLICY_INFO_AUDIT_EVENTS: {
1559                                 NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_SCALARS, &r->audit_events));
1560                         break; }
1561
1562                         case LSA_POLICY_INFO_DOMAIN: {
1563                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domain));
1564                         break; }
1565
1566                         case LSA_POLICY_INFO_PD: {
1567                                 NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_SCALARS, &r->pd));
1568                         break; }
1569
1570                         case LSA_POLICY_INFO_ACCOUNT_DOMAIN: {
1571                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->account_domain));
1572                         break; }
1573
1574                         case LSA_POLICY_INFO_ROLE: {
1575                                 NDR_CHECK(ndr_pull_lsa_ServerRole(ndr, NDR_SCALARS, &r->role));
1576                         break; }
1577
1578                         case LSA_POLICY_INFO_REPLICA: {
1579                                 NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_SCALARS, &r->replica));
1580                         break; }
1581
1582                         case LSA_POLICY_INFO_QUOTA: {
1583                                 NDR_CHECK(ndr_pull_lsa_DefaultQuotaInfo(ndr, NDR_SCALARS, &r->quota));
1584                         break; }
1585
1586                         case LSA_POLICY_INFO_MOD: {
1587                                 NDR_CHECK(ndr_pull_lsa_ModificationInfo(ndr, NDR_SCALARS, &r->mod));
1588                         break; }
1589
1590                         case LSA_POLICY_INFO_AUDIT_FULL_SET: {
1591                                 NDR_CHECK(ndr_pull_lsa_AuditFullSetInfo(ndr, NDR_SCALARS, &r->auditfullset));
1592                         break; }
1593
1594                         case LSA_POLICY_INFO_AUDIT_FULL_QUERY: {
1595                                 NDR_CHECK(ndr_pull_lsa_AuditFullQueryInfo(ndr, NDR_SCALARS, &r->auditfullquery));
1596                         break; }
1597
1598                         case LSA_POLICY_INFO_DNS: {
1599                                 NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
1600                         break; }
1601
1602                         case LSA_POLICY_INFO_DNS_INT: {
1603                                 NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_SCALARS, &r->dns));
1604                         break; }
1605
1606                         case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN: {
1607                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->l_account_domain));
1608                         break; }
1609
1610                         default:
1611                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1612                 }
1613         }
1614         if (ndr_flags & NDR_BUFFERS) {
1615                 switch (level) {
1616                         case LSA_POLICY_INFO_AUDIT_LOG:
1617                         break;
1618
1619                         case LSA_POLICY_INFO_AUDIT_EVENTS:
1620                                 NDR_CHECK(ndr_pull_lsa_AuditEventsInfo(ndr, NDR_BUFFERS, &r->audit_events));
1621                         break;
1622
1623                         case LSA_POLICY_INFO_DOMAIN:
1624                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domain));
1625                         break;
1626
1627                         case LSA_POLICY_INFO_PD:
1628                                 NDR_CHECK(ndr_pull_lsa_PDAccountInfo(ndr, NDR_BUFFERS, &r->pd));
1629                         break;
1630
1631                         case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
1632                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->account_domain));
1633                         break;
1634
1635                         case LSA_POLICY_INFO_ROLE:
1636                         break;
1637
1638                         case LSA_POLICY_INFO_REPLICA:
1639                                 NDR_CHECK(ndr_pull_lsa_ReplicaSourceInfo(ndr, NDR_BUFFERS, &r->replica));
1640                         break;
1641
1642                         case LSA_POLICY_INFO_QUOTA:
1643                         break;
1644
1645                         case LSA_POLICY_INFO_MOD:
1646                         break;
1647
1648                         case LSA_POLICY_INFO_AUDIT_FULL_SET:
1649                         break;
1650
1651                         case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
1652                         break;
1653
1654                         case LSA_POLICY_INFO_DNS:
1655                                 NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
1656                         break;
1657
1658                         case LSA_POLICY_INFO_DNS_INT:
1659                                 NDR_CHECK(ndr_pull_lsa_DnsDomainInfo(ndr, NDR_BUFFERS, &r->dns));
1660                         break;
1661
1662                         case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
1663                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->l_account_domain));
1664                         break;
1665
1666                         default:
1667                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
1668                 }
1669         }
1670         return NDR_ERR_SUCCESS;
1671 }
1672
1673 _PUBLIC_ void ndr_print_lsa_PolicyInformation(struct ndr_print *ndr, const char *name, const union lsa_PolicyInformation *r)
1674 {
1675         int level;
1676         level = ndr_print_get_switch_value(ndr, r);
1677         ndr_print_union(ndr, name, level, "lsa_PolicyInformation");
1678         switch (level) {
1679                 case LSA_POLICY_INFO_AUDIT_LOG:
1680                         ndr_print_lsa_AuditLogInfo(ndr, "audit_log", &r->audit_log);
1681                 break;
1682
1683                 case LSA_POLICY_INFO_AUDIT_EVENTS:
1684                         ndr_print_lsa_AuditEventsInfo(ndr, "audit_events", &r->audit_events);
1685                 break;
1686
1687                 case LSA_POLICY_INFO_DOMAIN:
1688                         ndr_print_lsa_DomainInfo(ndr, "domain", &r->domain);
1689                 break;
1690
1691                 case LSA_POLICY_INFO_PD:
1692                         ndr_print_lsa_PDAccountInfo(ndr, "pd", &r->pd);
1693                 break;
1694
1695                 case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
1696                         ndr_print_lsa_DomainInfo(ndr, "account_domain", &r->account_domain);
1697                 break;
1698
1699                 case LSA_POLICY_INFO_ROLE:
1700                         ndr_print_lsa_ServerRole(ndr, "role", &r->role);
1701                 break;
1702
1703                 case LSA_POLICY_INFO_REPLICA:
1704                         ndr_print_lsa_ReplicaSourceInfo(ndr, "replica", &r->replica);
1705                 break;
1706
1707                 case LSA_POLICY_INFO_QUOTA:
1708                         ndr_print_lsa_DefaultQuotaInfo(ndr, "quota", &r->quota);
1709                 break;
1710
1711                 case LSA_POLICY_INFO_MOD:
1712                         ndr_print_lsa_ModificationInfo(ndr, "mod", &r->mod);
1713                 break;
1714
1715                 case LSA_POLICY_INFO_AUDIT_FULL_SET:
1716                         ndr_print_lsa_AuditFullSetInfo(ndr, "auditfullset", &r->auditfullset);
1717                 break;
1718
1719                 case LSA_POLICY_INFO_AUDIT_FULL_QUERY:
1720                         ndr_print_lsa_AuditFullQueryInfo(ndr, "auditfullquery", &r->auditfullquery);
1721                 break;
1722
1723                 case LSA_POLICY_INFO_DNS:
1724                         ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns);
1725                 break;
1726
1727                 case LSA_POLICY_INFO_DNS_INT:
1728                         ndr_print_lsa_DnsDomainInfo(ndr, "dns", &r->dns);
1729                 break;
1730
1731                 case LSA_POLICY_INFO_L_ACCOUNT_DOMAIN:
1732                         ndr_print_lsa_DomainInfo(ndr, "l_account_domain", &r->l_account_domain);
1733                 break;
1734
1735                 default:
1736                         ndr_print_bad_level(ndr, name, level);
1737         }
1738 }
1739
1740 static enum ndr_err_code ndr_push_lsa_SidPtr(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidPtr *r)
1741 {
1742         if (ndr_flags & NDR_SCALARS) {
1743                 NDR_CHECK(ndr_push_align(ndr, 4));
1744                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
1745         }
1746         if (ndr_flags & NDR_BUFFERS) {
1747                 if (r->sid) {
1748                         NDR_CHECK(ndr_push_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1749                 }
1750         }
1751         return NDR_ERR_SUCCESS;
1752 }
1753
1754 static enum ndr_err_code ndr_pull_lsa_SidPtr(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidPtr *r)
1755 {
1756         uint32_t _ptr_sid;
1757         TALLOC_CTX *_mem_save_sid_0;
1758         if (ndr_flags & NDR_SCALARS) {
1759                 NDR_CHECK(ndr_pull_align(ndr, 4));
1760                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
1761                 if (_ptr_sid) {
1762                         NDR_PULL_ALLOC(ndr, r->sid);
1763                 } else {
1764                         r->sid = NULL;
1765                 }
1766         }
1767         if (ndr_flags & NDR_BUFFERS) {
1768                 if (r->sid) {
1769                         _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1770                         NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
1771                         NDR_CHECK(ndr_pull_dom_sid2(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
1772                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
1773                 }
1774         }
1775         return NDR_ERR_SUCCESS;
1776 }
1777
1778 _PUBLIC_ void ndr_print_lsa_SidPtr(struct ndr_print *ndr, const char *name, const struct lsa_SidPtr *r)
1779 {
1780         ndr_print_struct(ndr, name, "lsa_SidPtr");
1781         ndr->depth++;
1782         ndr_print_ptr(ndr, "sid", r->sid);
1783         ndr->depth++;
1784         if (r->sid) {
1785                 ndr_print_dom_sid2(ndr, "sid", r->sid);
1786         }
1787         ndr->depth--;
1788         ndr->depth--;
1789 }
1790
1791 _PUBLIC_ enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_SidArray *r)
1792 {
1793         uint32_t cntr_sids_1;
1794         if (ndr_flags & NDR_SCALARS) {
1795                 NDR_CHECK(ndr_push_align(ndr, 4));
1796                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
1797                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
1798         }
1799         if (ndr_flags & NDR_BUFFERS) {
1800                 if (r->sids) {
1801                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
1802                         for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
1803                                 NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1804                         }
1805                         for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
1806                                 NDR_CHECK(ndr_push_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1807                         }
1808                 }
1809         }
1810         return NDR_ERR_SUCCESS;
1811 }
1812
1813 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r)
1814 {
1815         uint32_t _ptr_sids;
1816         uint32_t cntr_sids_1;
1817         TALLOC_CTX *_mem_save_sids_0;
1818         TALLOC_CTX *_mem_save_sids_1;
1819         if (ndr_flags & NDR_SCALARS) {
1820                 NDR_CHECK(ndr_pull_align(ndr, 4));
1821                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
1822                 if (r->num_sids < 0 || r->num_sids > 1000) {
1823                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1824                 }
1825                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
1826                 if (_ptr_sids) {
1827                         NDR_PULL_ALLOC(ndr, r->sids);
1828                 } else {
1829                         r->sids = NULL;
1830                 }
1831         }
1832         if (ndr_flags & NDR_BUFFERS) {
1833                 if (r->sids) {
1834                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1835                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1836                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
1837                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
1838                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
1839                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
1840                         for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
1841                                 NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
1842                         }
1843                         for (cntr_sids_1 = 0; cntr_sids_1 < r->num_sids; cntr_sids_1++) {
1844                                 NDR_CHECK(ndr_pull_lsa_SidPtr(ndr, NDR_BUFFERS, &r->sids[cntr_sids_1]));
1845                         }
1846                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
1847                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
1848                 }
1849                 if (r->sids) {
1850                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
1851                 }
1852         }
1853         return NDR_ERR_SUCCESS;
1854 }
1855
1856 _PUBLIC_ void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r)
1857 {
1858         uint32_t cntr_sids_1;
1859         ndr_print_struct(ndr, name, "lsa_SidArray");
1860         ndr->depth++;
1861         ndr_print_uint32(ndr, "num_sids", r->num_sids);
1862         ndr_print_ptr(ndr, "sids", r->sids);
1863         ndr->depth++;
1864         if (r->sids) {
1865                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
1866                 ndr->depth++;
1867                 for (cntr_sids_1=0;cntr_sids_1<r->num_sids;cntr_sids_1++) {
1868                         char *idx_1=NULL;
1869                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
1870                                 ndr_print_lsa_SidPtr(ndr, "sids", &r->sids[cntr_sids_1]);
1871                                 free(idx_1);
1872                         }
1873                 }
1874                 ndr->depth--;
1875         }
1876         ndr->depth--;
1877         ndr->depth--;
1878 }
1879
1880 static enum ndr_err_code ndr_push_lsa_DomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_DomainList *r)
1881 {
1882         uint32_t cntr_domains_1;
1883         if (ndr_flags & NDR_SCALARS) {
1884                 NDR_CHECK(ndr_push_align(ndr, 4));
1885                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1886                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains));
1887         }
1888         if (ndr_flags & NDR_BUFFERS) {
1889                 if (r->domains) {
1890                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
1891                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
1892                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1]));
1893                         }
1894                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
1895                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1]));
1896                         }
1897                 }
1898         }
1899         return NDR_ERR_SUCCESS;
1900 }
1901
1902 static enum ndr_err_code ndr_pull_lsa_DomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_DomainList *r)
1903 {
1904         uint32_t _ptr_domains;
1905         uint32_t cntr_domains_1;
1906         TALLOC_CTX *_mem_save_domains_0;
1907         TALLOC_CTX *_mem_save_domains_1;
1908         if (ndr_flags & NDR_SCALARS) {
1909                 NDR_CHECK(ndr_pull_align(ndr, 4));
1910                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
1911                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains));
1912                 if (_ptr_domains) {
1913                         NDR_PULL_ALLOC(ndr, r->domains);
1914                 } else {
1915                         r->domains = NULL;
1916                 }
1917         }
1918         if (ndr_flags & NDR_BUFFERS) {
1919                 if (r->domains) {
1920                         _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
1921                         NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0);
1922                         NDR_CHECK(ndr_pull_array_size(ndr, &r->domains));
1923                         NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains));
1924                         _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr);
1925                         NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0);
1926                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
1927                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1]));
1928                         }
1929                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
1930                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1]));
1931                         }
1932                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0);
1933                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0);
1934                 }
1935                 if (r->domains) {
1936                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count));
1937                 }
1938         }
1939         return NDR_ERR_SUCCESS;
1940 }
1941
1942 _PUBLIC_ void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r)
1943 {
1944         uint32_t cntr_domains_1;
1945         ndr_print_struct(ndr, name, "lsa_DomainList");
1946         ndr->depth++;
1947         ndr_print_uint32(ndr, "count", r->count);
1948         ndr_print_ptr(ndr, "domains", r->domains);
1949         ndr->depth++;
1950         if (r->domains) {
1951                 ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count);
1952                 ndr->depth++;
1953                 for (cntr_domains_1=0;cntr_domains_1<r->count;cntr_domains_1++) {
1954                         char *idx_1=NULL;
1955                         if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) {
1956                                 ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]);
1957                                 free(idx_1);
1958                         }
1959                 }
1960                 ndr->depth--;
1961         }
1962         ndr->depth--;
1963         ndr->depth--;
1964 }
1965
1966 _PUBLIC_ enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r)
1967 {
1968         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
1969         return NDR_ERR_SUCCESS;
1970 }
1971
1972 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r)
1973 {
1974         uint16_t v;
1975         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
1976         *r = v;
1977         return NDR_ERR_SUCCESS;
1978 }
1979
1980 _PUBLIC_ void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r)
1981 {
1982         const char *val = NULL;
1983
1984         switch (r) {
1985                 case SID_NAME_USE_NONE: val = "SID_NAME_USE_NONE"; break;
1986                 case SID_NAME_USER: val = "SID_NAME_USER"; break;
1987                 case SID_NAME_DOM_GRP: val = "SID_NAME_DOM_GRP"; break;
1988                 case SID_NAME_DOMAIN: val = "SID_NAME_DOMAIN"; break;
1989                 case SID_NAME_ALIAS: val = "SID_NAME_ALIAS"; break;
1990                 case SID_NAME_WKN_GRP: val = "SID_NAME_WKN_GRP"; break;
1991                 case SID_NAME_DELETED: val = "SID_NAME_DELETED"; break;
1992                 case SID_NAME_INVALID: val = "SID_NAME_INVALID"; break;
1993                 case SID_NAME_UNKNOWN: val = "SID_NAME_UNKNOWN"; break;
1994                 case SID_NAME_COMPUTER: val = "SID_NAME_COMPUTER"; break;
1995         }
1996         ndr_print_enum(ndr, name, "ENUM", val, r);
1997 }
1998
1999 static enum ndr_err_code ndr_push_lsa_TranslatedSid(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedSid *r)
2000 {
2001         if (ndr_flags & NDR_SCALARS) {
2002                 NDR_CHECK(ndr_push_align(ndr, 4));
2003                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type));
2004                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
2005                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index));
2006         }
2007         if (ndr_flags & NDR_BUFFERS) {
2008         }
2009         return NDR_ERR_SUCCESS;
2010 }
2011
2012 static enum ndr_err_code ndr_pull_lsa_TranslatedSid(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedSid *r)
2013 {
2014         if (ndr_flags & NDR_SCALARS) {
2015                 NDR_CHECK(ndr_pull_align(ndr, 4));
2016                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type));
2017                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
2018                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index));
2019         }
2020         if (ndr_flags & NDR_BUFFERS) {
2021         }
2022         return NDR_ERR_SUCCESS;
2023 }
2024
2025 _PUBLIC_ void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r)
2026 {
2027         ndr_print_struct(ndr, name, "lsa_TranslatedSid");
2028         ndr->depth++;
2029         ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type);
2030         ndr_print_uint32(ndr, "rid", r->rid);
2031         ndr_print_uint32(ndr, "sid_index", r->sid_index);
2032         ndr->depth--;
2033 }
2034
2035 static enum ndr_err_code ndr_push_lsa_TransSidArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransSidArray *r)
2036 {
2037         uint32_t cntr_sids_1;
2038         if (ndr_flags & NDR_SCALARS) {
2039                 NDR_CHECK(ndr_push_align(ndr, 4));
2040                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2041                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->sids));
2042         }
2043         if (ndr_flags & NDR_BUFFERS) {
2044                 if (r->sids) {
2045                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2046                         for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) {
2047                                 NDR_CHECK(ndr_push_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
2048                         }
2049                 }
2050         }
2051         return NDR_ERR_SUCCESS;
2052 }
2053
2054 static enum ndr_err_code ndr_pull_lsa_TransSidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransSidArray *r)
2055 {
2056         uint32_t _ptr_sids;
2057         uint32_t cntr_sids_1;
2058         TALLOC_CTX *_mem_save_sids_0;
2059         TALLOC_CTX *_mem_save_sids_1;
2060         if (ndr_flags & NDR_SCALARS) {
2061                 NDR_CHECK(ndr_pull_align(ndr, 4));
2062                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2063                 if (r->count < 0 || r->count > 1000) {
2064                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2065                 }
2066                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sids));
2067                 if (_ptr_sids) {
2068                         NDR_PULL_ALLOC(ndr, r->sids);
2069                 } else {
2070                         r->sids = NULL;
2071                 }
2072         }
2073         if (ndr_flags & NDR_BUFFERS) {
2074                 if (r->sids) {
2075                         _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2076                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
2077                         NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
2078                         NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
2079                         _mem_save_sids_1 = NDR_PULL_GET_MEM_CTX(ndr);
2080                         NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
2081                         for (cntr_sids_1 = 0; cntr_sids_1 < r->count; cntr_sids_1++) {
2082                                 NDR_CHECK(ndr_pull_lsa_TranslatedSid(ndr, NDR_SCALARS, &r->sids[cntr_sids_1]));
2083                         }
2084                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_1, 0);
2085                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
2086                 }
2087                 if (r->sids) {
2088                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->count));
2089                 }
2090         }
2091         return NDR_ERR_SUCCESS;
2092 }
2093
2094 _PUBLIC_ void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r)
2095 {
2096         uint32_t cntr_sids_1;
2097         ndr_print_struct(ndr, name, "lsa_TransSidArray");
2098         ndr->depth++;
2099         ndr_print_uint32(ndr, "count", r->count);
2100         ndr_print_ptr(ndr, "sids", r->sids);
2101         ndr->depth++;
2102         if (r->sids) {
2103                 ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->count);
2104                 ndr->depth++;
2105                 for (cntr_sids_1=0;cntr_sids_1<r->count;cntr_sids_1++) {
2106                         char *idx_1=NULL;
2107                         if (asprintf(&idx_1, "[%d]", cntr_sids_1) != -1) {
2108                                 ndr_print_lsa_TranslatedSid(ndr, "sids", &r->sids[cntr_sids_1]);
2109                                 free(idx_1);
2110                         }
2111                 }
2112                 ndr->depth--;
2113         }
2114         ndr->depth--;
2115         ndr->depth--;
2116 }
2117
2118 static enum ndr_err_code ndr_push_lsa_RefDomainList(struct ndr_push *ndr, int ndr_flags, const struct lsa_RefDomainList *r)
2119 {
2120         uint32_t cntr_domains_1;
2121         if (ndr_flags & NDR_SCALARS) {
2122                 NDR_CHECK(ndr_push_align(ndr, 4));
2123                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2124                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->domains));
2125                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_size));
2126         }
2127         if (ndr_flags & NDR_BUFFERS) {
2128                 if (r->domains) {
2129                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2130                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
2131                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1]));
2132                         }
2133                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
2134                                 NDR_CHECK(ndr_push_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1]));
2135                         }
2136                 }
2137         }
2138         return NDR_ERR_SUCCESS;
2139 }
2140
2141 static enum ndr_err_code ndr_pull_lsa_RefDomainList(struct ndr_pull *ndr, int ndr_flags, struct lsa_RefDomainList *r)
2142 {
2143         uint32_t _ptr_domains;
2144         uint32_t cntr_domains_1;
2145         TALLOC_CTX *_mem_save_domains_0;
2146         TALLOC_CTX *_mem_save_domains_1;
2147         if (ndr_flags & NDR_SCALARS) {
2148                 NDR_CHECK(ndr_pull_align(ndr, 4));
2149                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2150                 if (r->count < 0 || r->count > 1000) {
2151                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2152                 }
2153                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domains));
2154                 if (_ptr_domains) {
2155                         NDR_PULL_ALLOC(ndr, r->domains);
2156                 } else {
2157                         r->domains = NULL;
2158                 }
2159                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_size));
2160         }
2161         if (ndr_flags & NDR_BUFFERS) {
2162                 if (r->domains) {
2163                         _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
2164                         NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0);
2165                         NDR_CHECK(ndr_pull_array_size(ndr, &r->domains));
2166                         NDR_PULL_ALLOC_N(ndr, r->domains, ndr_get_array_size(ndr, &r->domains));
2167                         _mem_save_domains_1 = NDR_PULL_GET_MEM_CTX(ndr);
2168                         NDR_PULL_SET_MEM_CTX(ndr, r->domains, 0);
2169                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
2170                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_SCALARS, &r->domains[cntr_domains_1]));
2171                         }
2172                         for (cntr_domains_1 = 0; cntr_domains_1 < r->count; cntr_domains_1++) {
2173                                 NDR_CHECK(ndr_pull_lsa_DomainInfo(ndr, NDR_BUFFERS, &r->domains[cntr_domains_1]));
2174                         }
2175                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_1, 0);
2176                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, 0);
2177                 }
2178                 if (r->domains) {
2179                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->domains, r->count));
2180                 }
2181         }
2182         return NDR_ERR_SUCCESS;
2183 }
2184
2185 _PUBLIC_ void ndr_print_lsa_RefDomainList(struct ndr_print *ndr, const char *name, const struct lsa_RefDomainList *r)
2186 {
2187         uint32_t cntr_domains_1;
2188         ndr_print_struct(ndr, name, "lsa_RefDomainList");
2189         ndr->depth++;
2190         ndr_print_uint32(ndr, "count", r->count);
2191         ndr_print_ptr(ndr, "domains", r->domains);
2192         ndr->depth++;
2193         if (r->domains) {
2194                 ndr->print(ndr, "%s: ARRAY(%d)", "domains", (int)r->count);
2195                 ndr->depth++;
2196                 for (cntr_domains_1=0;cntr_domains_1<r->count;cntr_domains_1++) {
2197                         char *idx_1=NULL;
2198                         if (asprintf(&idx_1, "[%d]", cntr_domains_1) != -1) {
2199                                 ndr_print_lsa_DomainInfo(ndr, "domains", &r->domains[cntr_domains_1]);
2200                                 free(idx_1);
2201                         }
2202                 }
2203                 ndr->depth--;
2204         }
2205         ndr->depth--;
2206         ndr_print_uint32(ndr, "max_size", r->max_size);
2207         ndr->depth--;
2208 }
2209
2210 static enum ndr_err_code ndr_push_lsa_LookupNamesLevel(struct ndr_push *ndr, int ndr_flags, enum lsa_LookupNamesLevel r)
2211 {
2212         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
2213         return NDR_ERR_SUCCESS;
2214 }
2215
2216 static enum ndr_err_code ndr_pull_lsa_LookupNamesLevel(struct ndr_pull *ndr, int ndr_flags, enum lsa_LookupNamesLevel *r)
2217 {
2218         uint16_t v;
2219         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
2220         *r = v;
2221         return NDR_ERR_SUCCESS;
2222 }
2223
2224 _PUBLIC_ void ndr_print_lsa_LookupNamesLevel(struct ndr_print *ndr, const char *name, enum lsa_LookupNamesLevel r)
2225 {
2226         const char *val = NULL;
2227
2228         switch (r) {
2229                 case LSA_LOOKUP_NAMES_ALL: val = "LSA_LOOKUP_NAMES_ALL"; break;
2230                 case LSA_LOOKUP_NAMES_DOMAINS_ONLY: val = "LSA_LOOKUP_NAMES_DOMAINS_ONLY"; break;
2231                 case LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY: val = "LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY"; break;
2232                 case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY"; break;
2233                 case LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY: val = "LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY"; break;
2234                 case LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2: val = "LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2"; break;
2235                 case LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC: val = "LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC"; break;
2236         }
2237         ndr_print_enum(ndr, name, "ENUM", val, r);
2238 }
2239
2240 static enum ndr_err_code ndr_push_lsa_TranslatedName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TranslatedName *r)
2241 {
2242         if (ndr_flags & NDR_SCALARS) {
2243                 NDR_CHECK(ndr_push_align(ndr, 4));
2244                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->sid_type));
2245                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS, &r->name));
2246                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_index));
2247         }
2248         if (ndr_flags & NDR_BUFFERS) {
2249                 NDR_CHECK(ndr_push_lsa_String(ndr, NDR_BUFFERS, &r->name));
2250         }
2251         return NDR_ERR_SUCCESS;
2252 }
2253
2254 static enum ndr_err_code ndr_pull_lsa_TranslatedName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TranslatedName *r)
2255 {
2256         if (ndr_flags & NDR_SCALARS) {
2257                 NDR_CHECK(ndr_pull_align(ndr, 4));
2258                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->sid_type));
2259                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS, &r->name));
2260                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_index));
2261         }
2262         if (ndr_flags & NDR_BUFFERS) {
2263                 NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_BUFFERS, &r->name));
2264         }
2265         return NDR_ERR_SUCCESS;
2266 }
2267
2268 _PUBLIC_ void ndr_print_lsa_TranslatedName(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedName *r)
2269 {
2270         ndr_print_struct(ndr, name, "lsa_TranslatedName");
2271         ndr->depth++;
2272         ndr_print_lsa_SidType(ndr, "sid_type", r->sid_type);
2273         ndr_print_lsa_String(ndr, "name", &r->name);
2274         ndr_print_uint32(ndr, "sid_index", r->sid_index);
2275         ndr->depth--;
2276 }
2277
2278 static enum ndr_err_code ndr_push_lsa_TransNameArray(struct ndr_push *ndr, int ndr_flags, const struct lsa_TransNameArray *r)
2279 {
2280         uint32_t cntr_names_1;
2281         if (ndr_flags & NDR_SCALARS) {
2282                 NDR_CHECK(ndr_push_align(ndr, 4));
2283                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2284                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->names));
2285         }
2286         if (ndr_flags & NDR_BUFFERS) {
2287                 if (r->names) {
2288                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2289                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
2290                                 NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
2291                         }
2292                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
2293                                 NDR_CHECK(ndr_push_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
2294                         }
2295                 }
2296         }
2297         return NDR_ERR_SUCCESS;
2298 }
2299
2300 static enum ndr_err_code ndr_pull_lsa_TransNameArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_TransNameArray *r)
2301 {
2302         uint32_t _ptr_names;
2303         uint32_t cntr_names_1;
2304         TALLOC_CTX *_mem_save_names_0;
2305         TALLOC_CTX *_mem_save_names_1;
2306         if (ndr_flags & NDR_SCALARS) {
2307                 NDR_CHECK(ndr_pull_align(ndr, 4));
2308                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2309                 if (r->count < 0 || r->count > 1000) {
2310                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2311                 }
2312                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_names));
2313                 if (_ptr_names) {
2314                         NDR_PULL_ALLOC(ndr, r->names);
2315                 } else {
2316                         r->names = NULL;
2317                 }
2318         }
2319         if (ndr_flags & NDR_BUFFERS) {
2320                 if (r->names) {
2321                         _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
2322                         NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
2323                         NDR_CHECK(ndr_pull_array_size(ndr, &r->names));
2324                         NDR_PULL_ALLOC_N(ndr, r->names, ndr_get_array_size(ndr, &r->names));
2325                         _mem_save_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
2326                         NDR_PULL_SET_MEM_CTX(ndr, r->names, 0);
2327                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
2328                                 NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_SCALARS, &r->names[cntr_names_1]));
2329                         }
2330                         for (cntr_names_1 = 0; cntr_names_1 < r->count; cntr_names_1++) {
2331                                 NDR_CHECK(ndr_pull_lsa_TranslatedName(ndr, NDR_BUFFERS, &r->names[cntr_names_1]));
2332                         }
2333                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_1, 0);
2334                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, 0);
2335                 }
2336                 if (r->names) {
2337                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->names, r->count));
2338                 }
2339         }
2340         return NDR_ERR_SUCCESS;
2341 }
2342
2343 _PUBLIC_ void ndr_print_lsa_TransNameArray(struct ndr_print *ndr, const char *name, const struct lsa_TransNameArray *r)
2344 {
2345         uint32_t cntr_names_1;
2346         ndr_print_struct(ndr, name, "lsa_TransNameArray");
2347         ndr->depth++;
2348         ndr_print_uint32(ndr, "count", r->count);
2349         ndr_print_ptr(ndr, "names", r->names);
2350         ndr->depth++;
2351         if (r->names) {
2352                 ndr->print(ndr, "%s: ARRAY(%d)", "names", (int)r->count);
2353                 ndr->depth++;
2354                 for (cntr_names_1=0;cntr_names_1<r->count;cntr_names_1++) {
2355                         char *idx_1=NULL;
2356                         if (asprintf(&idx_1, "[%d]", cntr_names_1) != -1) {
2357                                 ndr_print_lsa_TranslatedName(ndr, "names", &r->names[cntr_names_1]);
2358                                 free(idx_1);
2359                         }
2360                 }
2361                 ndr->depth--;
2362         }
2363         ndr->depth--;
2364         ndr->depth--;
2365 }
2366
2367 static enum ndr_err_code ndr_push_lsa_LUIDAttribute(struct ndr_push *ndr, int ndr_flags, const struct lsa_LUIDAttribute *r)
2368 {
2369         if (ndr_flags & NDR_SCALARS) {
2370                 NDR_CHECK(ndr_push_align(ndr, 4));
2371                 NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, &r->luid));
2372                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->attribute));
2373         }
2374         if (ndr_flags & NDR_BUFFERS) {
2375         }
2376         return NDR_ERR_SUCCESS;
2377 }
2378
2379 static enum ndr_err_code ndr_pull_lsa_LUIDAttribute(struct ndr_pull *ndr, int ndr_flags, struct lsa_LUIDAttribute *r)
2380 {
2381         if (ndr_flags & NDR_SCALARS) {
2382                 NDR_CHECK(ndr_pull_align(ndr, 4));
2383                 NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, &r->luid));
2384                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->attribute));
2385         }
2386         if (ndr_flags & NDR_BUFFERS) {
2387         }
2388         return NDR_ERR_SUCCESS;
2389 }
2390
2391 _PUBLIC_ void ndr_print_lsa_LUIDAttribute(struct ndr_print *ndr, const char *name, const struct lsa_LUIDAttribute *r)
2392 {
2393         ndr_print_struct(ndr, name, "lsa_LUIDAttribute");
2394         ndr->depth++;
2395         ndr_print_lsa_LUID(ndr, "luid", &r->luid);
2396         ndr_print_uint32(ndr, "attribute", r->attribute);
2397         ndr->depth--;
2398 }
2399
2400 static enum ndr_err_code ndr_push_lsa_PrivilegeSet(struct ndr_push *ndr, int ndr_flags, const struct lsa_PrivilegeSet *r)
2401 {
2402         uint32_t cntr_set_0;
2403         if (ndr_flags & NDR_SCALARS) {
2404                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2405                 NDR_CHECK(ndr_push_align(ndr, 4));
2406                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
2407                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown));
2408                 for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) {
2409                         NDR_CHECK(ndr_push_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0]));
2410                 }
2411         }
2412         if (ndr_flags & NDR_BUFFERS) {
2413         }
2414         return NDR_ERR_SUCCESS;
2415 }
2416
2417 static enum ndr_err_code ndr_pull_lsa_PrivilegeSet(struct ndr_pull *ndr, int ndr_flags, struct lsa_PrivilegeSet *r)
2418 {
2419         uint32_t cntr_set_0;
2420         TALLOC_CTX *_mem_save_set_0;
2421         if (ndr_flags & NDR_SCALARS) {
2422                 NDR_CHECK(ndr_pull_array_size(ndr, &r->set));
2423                 NDR_CHECK(ndr_pull_align(ndr, 4));
2424                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
2425                 if (r->count < 0 || r->count > 1000) {
2426                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2427                 }
2428                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
2429                 NDR_PULL_ALLOC_N(ndr, r->set, ndr_get_array_size(ndr, &r->set));
2430                 _mem_save_set_0 = NDR_PULL_GET_MEM_CTX(ndr);
2431                 NDR_PULL_SET_MEM_CTX(ndr, r->set, 0);
2432                 for (cntr_set_0 = 0; cntr_set_0 < r->count; cntr_set_0++) {
2433                         NDR_CHECK(ndr_pull_lsa_LUIDAttribute(ndr, NDR_SCALARS, &r->set[cntr_set_0]));
2434                 }
2435                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_set_0, 0);
2436                 if (r->set) {
2437                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->set, r->count));
2438                 }
2439         }
2440         if (ndr_flags & NDR_BUFFERS) {
2441         }
2442         return NDR_ERR_SUCCESS;
2443 }
2444
2445 _PUBLIC_ void ndr_print_lsa_PrivilegeSet(struct ndr_print *ndr, const char *name, const struct lsa_PrivilegeSet *r)
2446 {
2447         uint32_t cntr_set_0;
2448         ndr_print_struct(ndr, name, "lsa_PrivilegeSet");
2449         ndr->depth++;
2450         ndr_print_uint32(ndr, "count", r->count);
2451         ndr_print_uint32(ndr, "unknown", r->unknown);
2452         ndr->print(ndr, "%s: ARRAY(%d)", "set", (int)r->count);
2453         ndr->depth++;
2454         for (cntr_set_0=0;cntr_set_0<r->count;cntr_set_0++) {
2455                 char *idx_0=NULL;
2456                 if (asprintf(&idx_0, "[%d]", cntr_set_0) != -1) {
2457                         ndr_print_lsa_LUIDAttribute(ndr, "set", &r->set[cntr_set_0]);
2458                         free(idx_0);
2459                 }
2460         }
2461         ndr->depth--;
2462         ndr->depth--;
2463 }
2464
2465 static enum ndr_err_code ndr_push_lsa_DATA_BUF(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF *r)
2466 {
2467         {
2468                 uint32_t _flags_save_STRUCT = ndr->flags;
2469                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2470                 if (ndr_flags & NDR_SCALARS) {
2471                         NDR_CHECK(ndr_push_align(ndr, 4));
2472                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
2473                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
2474                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
2475                 }
2476                 if (ndr_flags & NDR_BUFFERS) {
2477                         if (r->data) {
2478                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
2479                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2480                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->length));
2481                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->length));
2482                         }
2483                 }
2484                 ndr->flags = _flags_save_STRUCT;
2485         }
2486         return NDR_ERR_SUCCESS;
2487 }
2488
2489 static enum ndr_err_code ndr_pull_lsa_DATA_BUF(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF *r)
2490 {
2491         uint32_t _ptr_data;
2492         TALLOC_CTX *_mem_save_data_0;
2493         {
2494                 uint32_t _flags_save_STRUCT = ndr->flags;
2495                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2496                 if (ndr_flags & NDR_SCALARS) {
2497                         NDR_CHECK(ndr_pull_align(ndr, 4));
2498                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
2499                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
2500                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
2501                         if (_ptr_data) {
2502                                 NDR_PULL_ALLOC(ndr, r->data);
2503                         } else {
2504                                 r->data = NULL;
2505                         }
2506                 }
2507                 if (ndr_flags & NDR_BUFFERS) {
2508                         if (r->data) {
2509                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2510                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
2511                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
2512                                 NDR_CHECK(ndr_pull_array_length(ndr, &r->data));
2513                                 if (ndr_get_array_length(ndr, &r->data) > ndr_get_array_size(ndr, &r->data)) {
2514                                         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));
2515                                 }
2516                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
2517                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_length(ndr, &r->data)));
2518                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
2519                         }
2520                         if (r->data) {
2521                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size));
2522                         }
2523                         if (r->data) {
2524                                 NDR_CHECK(ndr_check_array_length(ndr, (void*)&r->data, r->length));
2525                         }
2526                 }
2527                 ndr->flags = _flags_save_STRUCT;
2528         }
2529         return NDR_ERR_SUCCESS;
2530 }
2531
2532 _PUBLIC_ void ndr_print_lsa_DATA_BUF(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF *r)
2533 {
2534         ndr_print_struct(ndr, name, "lsa_DATA_BUF");
2535         {
2536                 uint32_t _flags_save_STRUCT = ndr->flags;
2537                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2538                 ndr->depth++;
2539                 ndr_print_uint32(ndr, "length", r->length);
2540                 ndr_print_uint32(ndr, "size", r->size);
2541                 ndr_print_ptr(ndr, "data", r->data);
2542                 ndr->depth++;
2543                 if (r->data) {
2544                         ndr_print_array_uint8(ndr, "data", r->data, r->length);
2545                 }
2546                 ndr->depth--;
2547                 ndr->depth--;
2548                 ndr->flags = _flags_save_STRUCT;
2549         }
2550 }
2551
2552 static enum ndr_err_code ndr_push_lsa_DATA_BUF2(struct ndr_push *ndr, int ndr_flags, const struct lsa_DATA_BUF2 *r)
2553 {
2554         {
2555                 uint32_t _flags_save_STRUCT = ndr->flags;
2556                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2557                 if (ndr_flags & NDR_SCALARS) {
2558                         NDR_CHECK(ndr_push_align(ndr, 4));
2559                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
2560                         NDR_CHECK(ndr_push_unique_ptr(ndr, r->data));
2561                 }
2562                 if (ndr_flags & NDR_BUFFERS) {
2563                         if (r->data) {
2564                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
2565                                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size));
2566                         }
2567                 }
2568                 ndr->flags = _flags_save_STRUCT;
2569         }
2570         return NDR_ERR_SUCCESS;
2571 }
2572
2573 static enum ndr_err_code ndr_pull_lsa_DATA_BUF2(struct ndr_pull *ndr, int ndr_flags, struct lsa_DATA_BUF2 *r)
2574 {
2575         uint32_t _ptr_data;
2576         TALLOC_CTX *_mem_save_data_0;
2577         {
2578                 uint32_t _flags_save_STRUCT = ndr->flags;
2579                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2580                 if (ndr_flags & NDR_SCALARS) {
2581                         NDR_CHECK(ndr_pull_align(ndr, 4));
2582                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
2583                         if (r->size < 0 || r->size > 65536) {
2584                                 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2585                         }
2586                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
2587                         if (_ptr_data) {
2588                                 NDR_PULL_ALLOC(ndr, r->data);
2589                         } else {
2590                                 r->data = NULL;
2591                         }
2592                 }
2593                 if (ndr_flags & NDR_BUFFERS) {
2594                         if (r->data) {
2595                                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
2596                                 NDR_PULL_SET_MEM_CTX(ndr, r->data, 0);
2597                                 NDR_CHECK(ndr_pull_array_size(ndr, &r->data));
2598                                 NDR_PULL_ALLOC_N(ndr, r->data, ndr_get_array_size(ndr, &r->data));
2599                                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, ndr_get_array_size(ndr, &r->data)));
2600                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0);
2601                         }
2602                         if (r->data) {
2603                                 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->data, r->size));
2604                         }
2605                 }
2606                 ndr->flags = _flags_save_STRUCT;
2607         }
2608         return NDR_ERR_SUCCESS;
2609 }
2610
2611 _PUBLIC_ void ndr_print_lsa_DATA_BUF2(struct ndr_print *ndr, const char *name, const struct lsa_DATA_BUF2 *r)
2612 {
2613         ndr_print_struct(ndr, name, "lsa_DATA_BUF2");
2614         {
2615                 uint32_t _flags_save_STRUCT = ndr->flags;
2616                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2617                 ndr->depth++;
2618                 ndr_print_uint32(ndr, "size", r->size);
2619                 ndr_print_ptr(ndr, "data", r->data);
2620                 ndr->depth++;
2621                 if (r->data) {
2622                         ndr_print_array_uint8(ndr, "data", r->data, r->size);
2623                 }
2624                 ndr->depth--;
2625                 ndr->depth--;
2626                 ndr->flags = _flags_save_STRUCT;
2627         }
2628 }
2629
2630 static enum ndr_err_code ndr_push_lsa_TrustDomInfoEnum(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum r)
2631 {
2632         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
2633         return NDR_ERR_SUCCESS;
2634 }
2635
2636 static enum ndr_err_code ndr_pull_lsa_TrustDomInfoEnum(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustDomInfoEnum *r)
2637 {
2638         uint16_t v;
2639         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
2640         *r = v;
2641         return NDR_ERR_SUCCESS;
2642 }
2643
2644 _PUBLIC_ void ndr_print_lsa_TrustDomInfoEnum(struct ndr_print *ndr, const char *name, enum lsa_TrustDomInfoEnum r)
2645 {
2646         const char *val = NULL;
2647
2648         switch (r) {
2649                 case LSA_TRUSTED_DOMAIN_INFO_NAME: val = "LSA_TRUSTED_DOMAIN_INFO_NAME"; break;
2650                 case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS: val = "LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS"; break;
2651                 case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET: val = "LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET"; break;
2652                 case LSA_TRUSTED_DOMAIN_INFO_PASSWORD: val = "LSA_TRUSTED_DOMAIN_INFO_PASSWORD"; break;
2653                 case LSA_TRUSTED_DOMAIN_INFO_BASIC: val = "LSA_TRUSTED_DOMAIN_INFO_BASIC"; break;
2654                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX"; break;
2655                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO"; break;
2656                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO"; break;
2657                 case LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL"; break;
2658                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL"; break;
2659                 case LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL"; break;
2660                 case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL: val = "LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL"; break;
2661                 case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES: val = "LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRTYPION_TYPES"; break;
2662         }
2663         ndr_print_enum(ndr, name, "ENUM", val, r);
2664 }
2665
2666 _PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustDirection(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2667 {
2668         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2669         return NDR_ERR_SUCCESS;
2670 }
2671
2672 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustDirection(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2673 {
2674         uint32_t v;
2675         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2676         *r = v;
2677         return NDR_ERR_SUCCESS;
2678 }
2679
2680 _PUBLIC_ void ndr_print_lsa_TrustDirection(struct ndr_print *ndr, const char *name, uint32_t r)
2681 {
2682         ndr_print_uint32(ndr, name, r);
2683         ndr->depth++;
2684         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_INBOUND", LSA_TRUST_DIRECTION_INBOUND, r);
2685         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_DIRECTION_OUTBOUND", LSA_TRUST_DIRECTION_OUTBOUND, r);
2686         ndr->depth--;
2687 }
2688
2689 static enum ndr_err_code ndr_push_lsa_TrustType(struct ndr_push *ndr, int ndr_flags, enum lsa_TrustType r)
2690 {
2691         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2692         return NDR_ERR_SUCCESS;
2693 }
2694
2695 static enum ndr_err_code ndr_pull_lsa_TrustType(struct ndr_pull *ndr, int ndr_flags, enum lsa_TrustType *r)
2696 {
2697         uint32_t v;
2698         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2699         *r = v;
2700         return NDR_ERR_SUCCESS;
2701 }
2702
2703 _PUBLIC_ void ndr_print_lsa_TrustType(struct ndr_print *ndr, const char *name, enum lsa_TrustType r)
2704 {
2705         const char *val = NULL;
2706
2707         switch (r) {
2708                 case LSA_TRUST_TYPE_DOWNLEVEL: val = "LSA_TRUST_TYPE_DOWNLEVEL"; break;
2709                 case LSA_TRUST_TYPE_UPLEVEL: val = "LSA_TRUST_TYPE_UPLEVEL"; break;
2710                 case LSA_TRUST_TYPE_MIT: val = "LSA_TRUST_TYPE_MIT"; break;
2711         }
2712         ndr_print_enum(ndr, name, "ENUM", val, r);
2713 }
2714
2715 _PUBLIC_ enum ndr_err_code ndr_push_lsa_TrustAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
2716 {
2717         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
2718         return NDR_ERR_SUCCESS;
2719 }
2720
2721 _PUBLIC_ enum ndr_err_code ndr_pull_lsa_TrustAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
2722 {
2723         uint32_t v;
2724         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
2725         *r = v;
2726         return NDR_ERR_SUCCESS;
2727 }
2728
2729 _PUBLIC_ void ndr_print_lsa_TrustAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
2730 {
2731         ndr_print_uint32(ndr, name, r);
2732         ndr->depth++;
2733         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE", LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE, r);
2734         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY", LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY, r);
2735         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN", LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN, r);
2736         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE", LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE, r);
2737         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION", LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION, r);
2738         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_WITHIN_FOREST", LSA_TRUST_ATTRIBUTE_WITHIN_FOREST, r);
2739         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL", LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL, r);
2740         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION", LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION, r);
2741         ndr->depth--;
2742 }
2743
2744 static enum ndr_err_code ndr_push_lsa_TrustDomainInfoName(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoName *r)
2745 {
2746         if (ndr_flags & NDR_SCALARS) {
2747                 NDR_CHECK(ndr_push_align(ndr, 4));
2748                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name));
2749         }
2750         if (ndr_flags & NDR_BUFFERS) {
2751                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name));
2752         }
2753         return NDR_ERR_SUCCESS;
2754 }
2755
2756 static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoName(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoName *r)
2757 {
2758         if (ndr_flags & NDR_SCALARS) {
2759                 NDR_CHECK(ndr_pull_align(ndr, 4));
2760                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_name));
2761         }
2762         if (ndr_flags & NDR_BUFFERS) {
2763                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_name));
2764         }
2765         return NDR_ERR_SUCCESS;
2766 }
2767
2768 _PUBLIC_ void ndr_print_lsa_TrustDomainInfoName(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoName *r)
2769 {
2770         ndr_print_struct(ndr, name, "lsa_TrustDomainInfoName");
2771         ndr->depth++;
2772         ndr_print_lsa_StringLarge(ndr, "netbios_name", &r->netbios_name);
2773         ndr->depth--;
2774 }
2775
2776 static enum ndr_err_code ndr_push_lsa_TrustDomainInfoControllers(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoControllers *r)
2777 {
2778         uint32_t cntr_netbios_names_1;
2779         if (ndr_flags & NDR_SCALARS) {
2780                 NDR_CHECK(ndr_push_align(ndr, 4));
2781                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries));
2782                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->netbios_names));
2783         }
2784         if (ndr_flags & NDR_BUFFERS) {
2785                 if (r->netbios_names) {
2786                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->entries));
2787                         for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
2788                                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1]));
2789                         }
2790                         for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
2791                                 NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1]));
2792                         }
2793                 }
2794         }
2795         return NDR_ERR_SUCCESS;
2796 }
2797
2798 static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoControllers(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoControllers *r)
2799 {
2800         uint32_t _ptr_netbios_names;
2801         uint32_t cntr_netbios_names_1;
2802         TALLOC_CTX *_mem_save_netbios_names_0;
2803         TALLOC_CTX *_mem_save_netbios_names_1;
2804         if (ndr_flags & NDR_SCALARS) {
2805                 NDR_CHECK(ndr_pull_align(ndr, 4));
2806                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->entries));
2807                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_netbios_names));
2808                 if (_ptr_netbios_names) {
2809                         NDR_PULL_ALLOC(ndr, r->netbios_names);
2810                 } else {
2811                         r->netbios_names = NULL;
2812                 }
2813         }
2814         if (ndr_flags & NDR_BUFFERS) {
2815                 if (r->netbios_names) {
2816                         _mem_save_netbios_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
2817                         NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0);
2818                         NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_names));
2819                         NDR_PULL_ALLOC_N(ndr, r->netbios_names, ndr_get_array_size(ndr, &r->netbios_names));
2820                         _mem_save_netbios_names_1 = NDR_PULL_GET_MEM_CTX(ndr);
2821                         NDR_PULL_SET_MEM_CTX(ndr, r->netbios_names, 0);
2822                         for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
2823                                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS, &r->netbios_names[cntr_netbios_names_1]));
2824                         }
2825                         for (cntr_netbios_names_1 = 0; cntr_netbios_names_1 < r->entries; cntr_netbios_names_1++) {
2826                                 NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_BUFFERS, &r->netbios_names[cntr_netbios_names_1]));
2827                         }
2828                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_1, 0);
2829                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_netbios_names_0, 0);
2830                 }
2831                 if (r->netbios_names) {
2832                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->netbios_names, r->entries));
2833                 }
2834         }
2835         return NDR_ERR_SUCCESS;
2836 }
2837
2838 _PUBLIC_ void ndr_print_lsa_TrustDomainInfoControllers(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoControllers *r)
2839 {
2840         uint32_t cntr_netbios_names_1;
2841         ndr_print_struct(ndr, name, "lsa_TrustDomainInfoControllers");
2842         ndr->depth++;
2843         ndr_print_uint32(ndr, "entries", r->entries);
2844         ndr_print_ptr(ndr, "netbios_names", r->netbios_names);
2845         ndr->depth++;
2846         if (r->netbios_names) {
2847                 ndr->print(ndr, "%s: ARRAY(%d)", "netbios_names", (int)r->entries);
2848                 ndr->depth++;
2849                 for (cntr_netbios_names_1=0;cntr_netbios_names_1<r->entries;cntr_netbios_names_1++) {
2850                         char *idx_1=NULL;
2851                         if (asprintf(&idx_1, "[%d]", cntr_netbios_names_1) != -1) {
2852                                 ndr_print_lsa_StringLarge(ndr, "netbios_names", &r->netbios_names[cntr_netbios_names_1]);
2853                                 free(idx_1);
2854                         }
2855                 }
2856                 ndr->depth--;
2857         }
2858         ndr->depth--;
2859         ndr->depth--;
2860 }
2861
2862 static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPosixOffset(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPosixOffset *r)
2863 {
2864         if (ndr_flags & NDR_SCALARS) {
2865                 NDR_CHECK(ndr_push_align(ndr, 4));
2866                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->posix_offset));
2867         }
2868         if (ndr_flags & NDR_BUFFERS) {
2869         }
2870         return NDR_ERR_SUCCESS;
2871 }
2872
2873 static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPosixOffset(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPosixOffset *r)
2874 {
2875         if (ndr_flags & NDR_SCALARS) {
2876                 NDR_CHECK(ndr_pull_align(ndr, 4));
2877                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->posix_offset));
2878         }
2879         if (ndr_flags & NDR_BUFFERS) {
2880         }
2881         return NDR_ERR_SUCCESS;
2882 }
2883
2884 _PUBLIC_ void ndr_print_lsa_TrustDomainInfoPosixOffset(struct ndr_print *ndr, const char *name, const struct lsa_TrustDomainInfoPosixOffset *r)
2885 {
2886         ndr_print_struct(ndr, name, "lsa_TrustDomainInfoPosixOffset");
2887         ndr->depth++;
2888         ndr_print_uint32(ndr, "posix_offset", r->posix_offset);
2889         ndr->depth--;
2890 }
2891
2892 static enum ndr_err_code ndr_push_lsa_TrustDomainInfoPassword(struct ndr_push *ndr, int ndr_flags, const struct lsa_TrustDomainInfoPassword *r)
2893 {
2894         if (ndr_flags & NDR_SCALARS) {
2895                 NDR_CHECK(ndr_push_align(ndr, 4));
2896                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->password));
2897                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->old_password));
2898         }
2899         if (ndr_flags & NDR_BUFFERS) {
2900                 if (r->password) {
2901                         NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->password));
2902                 }
2903                 if (r->old_password) {
2904                         NDR_CHECK(ndr_push_lsa_DATA_BUF(ndr, NDR_SCALARS|NDR_BUFFERS, r->old_password));
2905                 }
2906         }
2907         return NDR_ERR_SUCCESS;
2908 }
2909
2910 static enum ndr_err_code ndr_pull_lsa_TrustDomainInfoPassword(struct ndr_pull *ndr, int ndr_flags, struct lsa_TrustDomainInfoPassword *r)
2911 {
2912         uint32_t _ptr_password;
2913         TALLOC_CTX *_mem_save_password_0;
2914         uint32_t _ptr_old_password;
2915         TALLOC_CTX *_mem_save_old_password_0;
2916         if (ndr_flags & NDR_SCALARS) {
2917                 NDR_CHECK(ndr_pull_align(ndr, 4));
2918                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
2919                 if (_ptr_password) {
2920                         NDR_PULL_ALLOC(ndr, r->password);
2921                 } else {
2922                         r->password = NULL;
2923                 }
2924                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_old_password));
2925                 if (_ptr_old_password) {
2926                         NDR_PULL_ALLOC(ndr, r->old_password);
2927                 } else {
2928                         r->old_password = NULL;
2929                 }
2930         }