git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / source3 / librpc / gen_ndr / ndr_wbint.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "bin/default/source3/librpc/gen_ndr/ndr_wbint.h"
5
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 #include "librpc/gen_ndr/ndr_netlogon.h"
8 #include "librpc/gen_ndr/ndr_misc.h"
9 #include "librpc/gen_ndr/ndr_security.h"
10 #include "librpc/gen_ndr/ndr_idmap.h"
11 static enum ndr_err_code ndr_push_wbint_TransID(struct ndr_push *ndr, int ndr_flags, const struct wbint_TransID *r)
12 {
13         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
14         if (ndr_flags & NDR_SCALARS) {
15                 NDR_CHECK(ndr_push_align(ndr, 4));
16                 NDR_CHECK(ndr_push_id_type(ndr, NDR_SCALARS, r->type));
17                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->domain_index));
18                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rid));
19                 NDR_CHECK(ndr_push_unixid(ndr, NDR_SCALARS, &r->xid));
20                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
21         }
22         if (ndr_flags & NDR_BUFFERS) {
23         }
24         return NDR_ERR_SUCCESS;
25 }
26
27 static enum ndr_err_code ndr_pull_wbint_TransID(struct ndr_pull *ndr, int ndr_flags, struct wbint_TransID *r)
28 {
29         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
30         if (ndr_flags & NDR_SCALARS) {
31                 NDR_CHECK(ndr_pull_align(ndr, 4));
32                 NDR_CHECK(ndr_pull_id_type(ndr, NDR_SCALARS, &r->type));
33                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->domain_index));
34                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rid));
35                 NDR_CHECK(ndr_pull_unixid(ndr, NDR_SCALARS, &r->xid));
36                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
37         }
38         if (ndr_flags & NDR_BUFFERS) {
39         }
40         return NDR_ERR_SUCCESS;
41 }
42
43 _PUBLIC_ void ndr_print_wbint_TransID(struct ndr_print *ndr, const char *name, const struct wbint_TransID *r)
44 {
45         ndr_print_struct(ndr, name, "wbint_TransID");
46         if (r == NULL) { ndr_print_null(ndr); return; }
47         ndr->depth++;
48         ndr_print_id_type(ndr, "type", r->type);
49         ndr_print_uint32(ndr, "domain_index", r->domain_index);
50         ndr_print_uint32(ndr, "rid", r->rid);
51         ndr_print_unixid(ndr, "xid", &r->xid);
52         ndr->depth--;
53 }
54
55 static enum ndr_err_code ndr_push_wbint_TransIDArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_TransIDArray *r)
56 {
57         uint32_t cntr_ids_0;
58         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
59         if (ndr_flags & NDR_SCALARS) {
60                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_ids));
61                 NDR_CHECK(ndr_push_align(ndr, 4));
62                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_ids));
63                 for (cntr_ids_0 = 0; cntr_ids_0 < r->num_ids; cntr_ids_0++) {
64                         NDR_CHECK(ndr_push_wbint_TransID(ndr, NDR_SCALARS, &r->ids[cntr_ids_0]));
65                 }
66                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
67         }
68         if (ndr_flags & NDR_BUFFERS) {
69         }
70         return NDR_ERR_SUCCESS;
71 }
72
73 static enum ndr_err_code ndr_pull_wbint_TransIDArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_TransIDArray *r)
74 {
75         uint32_t size_ids_0 = 0;
76         uint32_t cntr_ids_0;
77         TALLOC_CTX *_mem_save_ids_0;
78         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
79         if (ndr_flags & NDR_SCALARS) {
80                 NDR_CHECK(ndr_pull_array_size(ndr, &r->ids));
81                 NDR_CHECK(ndr_pull_align(ndr, 4));
82                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_ids));
83                 size_ids_0 = ndr_get_array_size(ndr, &r->ids);
84                 NDR_PULL_ALLOC_N(ndr, r->ids, size_ids_0);
85                 _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr);
86                 NDR_PULL_SET_MEM_CTX(ndr, r->ids, 0);
87                 for (cntr_ids_0 = 0; cntr_ids_0 < size_ids_0; cntr_ids_0++) {
88                         NDR_CHECK(ndr_pull_wbint_TransID(ndr, NDR_SCALARS, &r->ids[cntr_ids_0]));
89                 }
90                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, 0);
91                 if (r->ids) {
92                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->ids, r->num_ids));
93                 }
94                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
95         }
96         if (ndr_flags & NDR_BUFFERS) {
97         }
98         return NDR_ERR_SUCCESS;
99 }
100
101 _PUBLIC_ void ndr_print_wbint_TransIDArray(struct ndr_print *ndr, const char *name, const struct wbint_TransIDArray *r)
102 {
103         uint32_t cntr_ids_0;
104         ndr_print_struct(ndr, name, "wbint_TransIDArray");
105         if (r == NULL) { ndr_print_null(ndr); return; }
106         ndr->depth++;
107         ndr_print_uint32(ndr, "num_ids", r->num_ids);
108         ndr->print(ndr, "%s: ARRAY(%d)", "ids", (int)r->num_ids);
109         ndr->depth++;
110         for (cntr_ids_0=0;cntr_ids_0<r->num_ids;cntr_ids_0++) {
111                 ndr_print_wbint_TransID(ndr, "ids", &r->ids[cntr_ids_0]);
112         }
113         ndr->depth--;
114         ndr->depth--;
115 }
116
117 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfo(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfo *r)
118 {
119         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
120         if (ndr_flags & NDR_SCALARS) {
121                 NDR_CHECK(ndr_push_align(ndr, 8));
122                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->acct_name));
123                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->full_name));
124                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir));
125                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell));
126                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->primary_gid));
127                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
128                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
129                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
130         }
131         if (ndr_flags & NDR_BUFFERS) {
132                 if (r->acct_name) {
133                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
134                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
135                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
136                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->acct_name, ndr_charset_length(r->acct_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
137                 }
138                 if (r->full_name) {
139                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
140                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
141                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
142                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->full_name, ndr_charset_length(r->full_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
143                 }
144                 if (r->homedir) {
145                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
146                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
147                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
148                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
149                 }
150                 if (r->shell) {
151                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
152                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
153                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
154                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
155                 }
156         }
157         return NDR_ERR_SUCCESS;
158 }
159
160 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r)
161 {
162         uint32_t _ptr_acct_name;
163         uint32_t size_acct_name_1 = 0;
164         uint32_t length_acct_name_1 = 0;
165         TALLOC_CTX *_mem_save_acct_name_0;
166         uint32_t _ptr_full_name;
167         uint32_t size_full_name_1 = 0;
168         uint32_t length_full_name_1 = 0;
169         TALLOC_CTX *_mem_save_full_name_0;
170         uint32_t _ptr_homedir;
171         uint32_t size_homedir_1 = 0;
172         uint32_t length_homedir_1 = 0;
173         TALLOC_CTX *_mem_save_homedir_0;
174         uint32_t _ptr_shell;
175         uint32_t size_shell_1 = 0;
176         uint32_t length_shell_1 = 0;
177         TALLOC_CTX *_mem_save_shell_0;
178         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
179         if (ndr_flags & NDR_SCALARS) {
180                 NDR_CHECK(ndr_pull_align(ndr, 8));
181                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_name));
182                 if (_ptr_acct_name) {
183                         NDR_PULL_ALLOC(ndr, r->acct_name);
184                 } else {
185                         r->acct_name = NULL;
186                 }
187                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_full_name));
188                 if (_ptr_full_name) {
189                         NDR_PULL_ALLOC(ndr, r->full_name);
190                 } else {
191                         r->full_name = NULL;
192                 }
193                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
194                 if (_ptr_homedir) {
195                         NDR_PULL_ALLOC(ndr, r->homedir);
196                 } else {
197                         r->homedir = NULL;
198                 }
199                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
200                 if (_ptr_shell) {
201                         NDR_PULL_ALLOC(ndr, r->shell);
202                 } else {
203                         r->shell = NULL;
204                 }
205                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->primary_gid));
206                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
207                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
208                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
209         }
210         if (ndr_flags & NDR_BUFFERS) {
211                 if (r->acct_name) {
212                         _mem_save_acct_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
213                         NDR_PULL_SET_MEM_CTX(ndr, r->acct_name, 0);
214                         NDR_CHECK(ndr_pull_array_size(ndr, &r->acct_name));
215                         NDR_CHECK(ndr_pull_array_length(ndr, &r->acct_name));
216                         size_acct_name_1 = ndr_get_array_size(ndr, &r->acct_name);
217                         length_acct_name_1 = ndr_get_array_length(ndr, &r->acct_name);
218                         if (length_acct_name_1 > size_acct_name_1) {
219                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_acct_name_1, length_acct_name_1);
220                         }
221                         NDR_CHECK(ndr_check_string_terminator(ndr, length_acct_name_1, sizeof(uint8_t)));
222                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->acct_name, length_acct_name_1, sizeof(uint8_t), CH_UTF8));
223                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_name_0, 0);
224                 }
225                 if (r->full_name) {
226                         _mem_save_full_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
227                         NDR_PULL_SET_MEM_CTX(ndr, r->full_name, 0);
228                         NDR_CHECK(ndr_pull_array_size(ndr, &r->full_name));
229                         NDR_CHECK(ndr_pull_array_length(ndr, &r->full_name));
230                         size_full_name_1 = ndr_get_array_size(ndr, &r->full_name);
231                         length_full_name_1 = ndr_get_array_length(ndr, &r->full_name);
232                         if (length_full_name_1 > size_full_name_1) {
233                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_full_name_1, length_full_name_1);
234                         }
235                         NDR_CHECK(ndr_check_string_terminator(ndr, length_full_name_1, sizeof(uint8_t)));
236                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->full_name, length_full_name_1, sizeof(uint8_t), CH_UTF8));
237                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_full_name_0, 0);
238                 }
239                 if (r->homedir) {
240                         _mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr);
241                         NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0);
242                         NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
243                         NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
244                         size_homedir_1 = ndr_get_array_size(ndr, &r->homedir);
245                         length_homedir_1 = ndr_get_array_length(ndr, &r->homedir);
246                         if (length_homedir_1 > size_homedir_1) {
247                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_homedir_1, length_homedir_1);
248                         }
249                         NDR_CHECK(ndr_check_string_terminator(ndr, length_homedir_1, sizeof(uint8_t)));
250                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, length_homedir_1, sizeof(uint8_t), CH_UTF8));
251                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0);
252                 }
253                 if (r->shell) {
254                         _mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr);
255                         NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0);
256                         NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
257                         NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
258                         size_shell_1 = ndr_get_array_size(ndr, &r->shell);
259                         length_shell_1 = ndr_get_array_length(ndr, &r->shell);
260                         if (length_shell_1 > size_shell_1) {
261                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_shell_1, length_shell_1);
262                         }
263                         NDR_CHECK(ndr_check_string_terminator(ndr, length_shell_1, sizeof(uint8_t)));
264                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, length_shell_1, sizeof(uint8_t), CH_UTF8));
265                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0);
266                 }
267         }
268         return NDR_ERR_SUCCESS;
269 }
270
271 _PUBLIC_ void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r)
272 {
273         ndr_print_struct(ndr, name, "wbint_userinfo");
274         if (r == NULL) { ndr_print_null(ndr); return; }
275         ndr->depth++;
276         ndr_print_ptr(ndr, "acct_name", r->acct_name);
277         ndr->depth++;
278         if (r->acct_name) {
279                 ndr_print_string(ndr, "acct_name", r->acct_name);
280         }
281         ndr->depth--;
282         ndr_print_ptr(ndr, "full_name", r->full_name);
283         ndr->depth++;
284         if (r->full_name) {
285                 ndr_print_string(ndr, "full_name", r->full_name);
286         }
287         ndr->depth--;
288         ndr_print_ptr(ndr, "homedir", r->homedir);
289         ndr->depth++;
290         if (r->homedir) {
291                 ndr_print_string(ndr, "homedir", r->homedir);
292         }
293         ndr->depth--;
294         ndr_print_ptr(ndr, "shell", r->shell);
295         ndr->depth++;
296         if (r->shell) {
297                 ndr_print_string(ndr, "shell", r->shell);
298         }
299         ndr->depth--;
300         ndr_print_hyper(ndr, "primary_gid", r->primary_gid);
301         ndr_print_dom_sid(ndr, "user_sid", &r->user_sid);
302         ndr_print_dom_sid(ndr, "group_sid", &r->group_sid);
303         ndr->depth--;
304 }
305
306 _PUBLIC_ enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r)
307 {
308         uint32_t cntr_sids_0;
309         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
310         if (ndr_flags & NDR_SCALARS) {
311                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_sids));
312                 NDR_CHECK(ndr_push_align(ndr, 4));
313                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
314                 for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) {
315                         NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
316                 }
317                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
318         }
319         if (ndr_flags & NDR_BUFFERS) {
320         }
321         return NDR_ERR_SUCCESS;
322 }
323
324 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r)
325 {
326         uint32_t size_sids_0 = 0;
327         uint32_t cntr_sids_0;
328         TALLOC_CTX *_mem_save_sids_0;
329         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
330         if (ndr_flags & NDR_SCALARS) {
331                 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
332                 NDR_CHECK(ndr_pull_align(ndr, 4));
333                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
334                 size_sids_0 = ndr_get_array_size(ndr, &r->sids);
335                 NDR_PULL_ALLOC_N(ndr, r->sids, size_sids_0);
336                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
337                 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
338                 for (cntr_sids_0 = 0; cntr_sids_0 < size_sids_0; cntr_sids_0++) {
339                         NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
340                 }
341                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
342                 if (r->sids) {
343                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
344                 }
345                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
346         }
347         if (ndr_flags & NDR_BUFFERS) {
348         }
349         return NDR_ERR_SUCCESS;
350 }
351
352 _PUBLIC_ void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r)
353 {
354         uint32_t cntr_sids_0;
355         ndr_print_struct(ndr, name, "wbint_SidArray");
356         if (r == NULL) { ndr_print_null(ndr); return; }
357         ndr->depth++;
358         ndr_print_uint32(ndr, "num_sids", r->num_sids);
359         ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
360         ndr->depth++;
361         for (cntr_sids_0=0;cntr_sids_0<r->num_sids;cntr_sids_0++) {
362                 ndr_print_dom_sid(ndr, "sids", &r->sids[cntr_sids_0]);
363         }
364         ndr->depth--;
365         ndr->depth--;
366 }
367
368 _PUBLIC_ enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r)
369 {
370         uint32_t cntr_rids_0;
371         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
372         if (ndr_flags & NDR_SCALARS) {
373                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_rids));
374                 NDR_CHECK(ndr_push_align(ndr, 4));
375                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
376                 for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) {
377                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_0]));
378                 }
379                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
380         }
381         if (ndr_flags & NDR_BUFFERS) {
382         }
383         return NDR_ERR_SUCCESS;
384 }
385
386 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r)
387 {
388         uint32_t size_rids_0 = 0;
389         uint32_t cntr_rids_0;
390         TALLOC_CTX *_mem_save_rids_0;
391         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
392         if (ndr_flags & NDR_SCALARS) {
393                 NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
394                 NDR_CHECK(ndr_pull_align(ndr, 4));
395                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
396                 size_rids_0 = ndr_get_array_size(ndr, &r->rids);
397                 NDR_PULL_ALLOC_N(ndr, r->rids, size_rids_0);
398                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
399                 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
400                 for (cntr_rids_0 = 0; cntr_rids_0 < size_rids_0; cntr_rids_0++) {
401                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_0]));
402                 }
403                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
404                 if (r->rids) {
405                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
406                 }
407                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
408         }
409         if (ndr_flags & NDR_BUFFERS) {
410         }
411         return NDR_ERR_SUCCESS;
412 }
413
414 _PUBLIC_ void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r)
415 {
416         uint32_t cntr_rids_0;
417         ndr_print_struct(ndr, name, "wbint_RidArray");
418         if (r == NULL) { ndr_print_null(ndr); return; }
419         ndr->depth++;
420         ndr_print_uint32(ndr, "num_rids", r->num_rids);
421         ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
422         ndr->depth++;
423         for (cntr_rids_0=0;cntr_rids_0<r->num_rids;cntr_rids_0++) {
424                 ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_0]);
425         }
426         ndr->depth--;
427         ndr->depth--;
428 }
429
430 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principal(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principal *r)
431 {
432         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
433         if (ndr_flags & NDR_SCALARS) {
434                 NDR_CHECK(ndr_push_align(ndr, 5));
435                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
436                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->type));
437                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
438                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
439         }
440         if (ndr_flags & NDR_BUFFERS) {
441                 if (r->name) {
442                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
443                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
444                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
445                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
446                 }
447         }
448         return NDR_ERR_SUCCESS;
449 }
450
451 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principal(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principal *r)
452 {
453         uint32_t _ptr_name;
454         uint32_t size_name_1 = 0;
455         uint32_t length_name_1 = 0;
456         TALLOC_CTX *_mem_save_name_0;
457         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
458         if (ndr_flags & NDR_SCALARS) {
459                 NDR_CHECK(ndr_pull_align(ndr, 5));
460                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sid));
461                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->type));
462                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
463                 if (_ptr_name) {
464                         NDR_PULL_ALLOC(ndr, r->name);
465                 } else {
466                         r->name = NULL;
467                 }
468                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
469         }
470         if (ndr_flags & NDR_BUFFERS) {
471                 if (r->name) {
472                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
473                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
474                         NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
475                         NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
476                         size_name_1 = ndr_get_array_size(ndr, &r->name);
477                         length_name_1 = ndr_get_array_length(ndr, &r->name);
478                         if (length_name_1 > size_name_1) {
479                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_name_1, length_name_1);
480                         }
481                         NDR_CHECK(ndr_check_string_terminator(ndr, length_name_1, sizeof(uint8_t)));
482                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, length_name_1, sizeof(uint8_t), CH_UTF8));
483                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
484                 }
485         }
486         return NDR_ERR_SUCCESS;
487 }
488
489 _PUBLIC_ void ndr_print_wbint_Principal(struct ndr_print *ndr, const char *name, const struct wbint_Principal *r)
490 {
491         ndr_print_struct(ndr, name, "wbint_Principal");
492         if (r == NULL) { ndr_print_null(ndr); return; }
493         ndr->depth++;
494         ndr_print_dom_sid(ndr, "sid", &r->sid);
495         ndr_print_lsa_SidType(ndr, "type", r->type);
496         ndr_print_ptr(ndr, "name", r->name);
497         ndr->depth++;
498         if (r->name) {
499                 ndr_print_string(ndr, "name", r->name);
500         }
501         ndr->depth--;
502         ndr->depth--;
503 }
504
505 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principals(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principals *r)
506 {
507         uint32_t cntr_principals_0;
508         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
509         if (ndr_flags & NDR_SCALARS) {
510                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_principals));
511                 NDR_CHECK(ndr_push_align(ndr, 5));
512                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->num_principals));
513                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
514                         NDR_CHECK(ndr_push_wbint_Principal(ndr, NDR_SCALARS, &r->principals[cntr_principals_0]));
515                 }
516                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
517         }
518         if (ndr_flags & NDR_BUFFERS) {
519                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
520                         NDR_CHECK(ndr_push_wbint_Principal(ndr, NDR_BUFFERS, &r->principals[cntr_principals_0]));
521                 }
522         }
523         return NDR_ERR_SUCCESS;
524 }
525
526 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principals(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principals *r)
527 {
528         uint32_t size_principals_0 = 0;
529         uint32_t cntr_principals_0;
530         TALLOC_CTX *_mem_save_principals_0;
531         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
532         if (ndr_flags & NDR_SCALARS) {
533                 NDR_CHECK(ndr_pull_array_size(ndr, &r->principals));
534                 NDR_CHECK(ndr_pull_align(ndr, 5));
535                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->num_principals));
536                 size_principals_0 = ndr_get_array_size(ndr, &r->principals);
537                 NDR_PULL_ALLOC_N(ndr, r->principals, size_principals_0);
538                 _mem_save_principals_0 = NDR_PULL_GET_MEM_CTX(ndr);
539                 NDR_PULL_SET_MEM_CTX(ndr, r->principals, 0);
540                 for (cntr_principals_0 = 0; cntr_principals_0 < size_principals_0; cntr_principals_0++) {
541                         NDR_CHECK(ndr_pull_wbint_Principal(ndr, NDR_SCALARS, &r->principals[cntr_principals_0]));
542                 }
543                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_principals_0, 0);
544                 if (r->principals) {
545                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->principals, r->num_principals));
546                 }
547                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
548         }
549         if (ndr_flags & NDR_BUFFERS) {
550                 size_principals_0 = ndr_get_array_size(ndr, &r->principals);
551                 _mem_save_principals_0 = NDR_PULL_GET_MEM_CTX(ndr);
552                 NDR_PULL_SET_MEM_CTX(ndr, r->principals, 0);
553                 for (cntr_principals_0 = 0; cntr_principals_0 < size_principals_0; cntr_principals_0++) {
554                         NDR_CHECK(ndr_pull_wbint_Principal(ndr, NDR_BUFFERS, &r->principals[cntr_principals_0]));
555                 }
556                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_principals_0, 0);
557         }
558         return NDR_ERR_SUCCESS;
559 }
560
561 _PUBLIC_ void ndr_print_wbint_Principals(struct ndr_print *ndr, const char *name, const struct wbint_Principals *r)
562 {
563         uint32_t cntr_principals_0;
564         ndr_print_struct(ndr, name, "wbint_Principals");
565         if (r == NULL) { ndr_print_null(ndr); return; }
566         ndr->depth++;
567         ndr_print_int32(ndr, "num_principals", r->num_principals);
568         ndr->print(ndr, "%s: ARRAY(%d)", "principals", (int)r->num_principals);
569         ndr->depth++;
570         for (cntr_principals_0=0;cntr_principals_0<r->num_principals;cntr_principals_0++) {
571                 ndr_print_wbint_Principal(ndr, "principals", &r->principals[cntr_principals_0]);
572         }
573         ndr->depth--;
574         ndr->depth--;
575 }
576
577 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfos(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfos *r)
578 {
579         uint32_t cntr_userinfos_0;
580         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
581         if (ndr_flags & NDR_SCALARS) {
582                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_userinfos));
583                 NDR_CHECK(ndr_push_align(ndr, 8));
584                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_userinfos));
585                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
586                         NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS, &r->userinfos[cntr_userinfos_0]));
587                 }
588                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
589         }
590         if (ndr_flags & NDR_BUFFERS) {
591                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
592                         NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_BUFFERS, &r->userinfos[cntr_userinfos_0]));
593                 }
594         }
595         return NDR_ERR_SUCCESS;
596 }
597
598 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfos(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfos *r)
599 {
600         uint32_t size_userinfos_0 = 0;
601         uint32_t cntr_userinfos_0;
602         TALLOC_CTX *_mem_save_userinfos_0;
603         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
604         if (ndr_flags & NDR_SCALARS) {
605                 NDR_CHECK(ndr_pull_array_size(ndr, &r->userinfos));
606                 NDR_CHECK(ndr_pull_align(ndr, 8));
607                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_userinfos));
608                 size_userinfos_0 = ndr_get_array_size(ndr, &r->userinfos);
609                 NDR_PULL_ALLOC_N(ndr, r->userinfos, size_userinfos_0);
610                 _mem_save_userinfos_0 = NDR_PULL_GET_MEM_CTX(ndr);
611                 NDR_PULL_SET_MEM_CTX(ndr, r->userinfos, 0);
612                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < size_userinfos_0; cntr_userinfos_0++) {
613                         NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS, &r->userinfos[cntr_userinfos_0]));
614                 }
615                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userinfos_0, 0);
616                 if (r->userinfos) {
617                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->userinfos, r->num_userinfos));
618                 }
619                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
620         }
621         if (ndr_flags & NDR_BUFFERS) {
622                 size_userinfos_0 = ndr_get_array_size(ndr, &r->userinfos);
623                 _mem_save_userinfos_0 = NDR_PULL_GET_MEM_CTX(ndr);
624                 NDR_PULL_SET_MEM_CTX(ndr, r->userinfos, 0);
625                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < size_userinfos_0; cntr_userinfos_0++) {
626                         NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_BUFFERS, &r->userinfos[cntr_userinfos_0]));
627                 }
628                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userinfos_0, 0);
629         }
630         return NDR_ERR_SUCCESS;
631 }
632
633 _PUBLIC_ void ndr_print_wbint_userinfos(struct ndr_print *ndr, const char *name, const struct wbint_userinfos *r)
634 {
635         uint32_t cntr_userinfos_0;
636         ndr_print_struct(ndr, name, "wbint_userinfos");
637         if (r == NULL) { ndr_print_null(ndr); return; }
638         ndr->depth++;
639         ndr_print_uint32(ndr, "num_userinfos", r->num_userinfos);
640         ndr->print(ndr, "%s: ARRAY(%d)", "userinfos", (int)r->num_userinfos);
641         ndr->depth++;
642         for (cntr_userinfos_0=0;cntr_userinfos_0<r->num_userinfos;cntr_userinfos_0++) {
643                 ndr_print_wbint_userinfo(ndr, "userinfos", &r->userinfos[cntr_userinfos_0]);
644         }
645         ndr->depth--;
646         ndr->depth--;
647 }
648
649 static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r)
650 {
651         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
652         if (flags & NDR_IN) {
653                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
654         }
655         if (flags & NDR_OUT) {
656                 if (r->out.out_data == NULL) {
657                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
658                 }
659                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
660         }
661         return NDR_ERR_SUCCESS;
662 }
663
664 static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r)
665 {
666         TALLOC_CTX *_mem_save_out_data_0;
667         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
668         if (flags & NDR_IN) {
669                 ZERO_STRUCT(r->out);
670
671                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
672                 NDR_PULL_ALLOC(ndr, r->out.out_data);
673                 ZERO_STRUCTP(r->out.out_data);
674         }
675         if (flags & NDR_OUT) {
676                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
677                         NDR_PULL_ALLOC(ndr, r->out.out_data);
678                 }
679                 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
680                 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
681                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
682                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
683         }
684         return NDR_ERR_SUCCESS;
685 }
686
687 _PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r)
688 {
689         ndr_print_struct(ndr, name, "wbint_Ping");
690         if (r == NULL) { ndr_print_null(ndr); return; }
691         ndr->depth++;
692         if (flags & NDR_SET_VALUES) {
693                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
694         }
695         if (flags & NDR_IN) {
696                 ndr_print_struct(ndr, "in", "wbint_Ping");
697                 ndr->depth++;
698                 ndr_print_uint32(ndr, "in_data", r->in.in_data);
699                 ndr->depth--;
700         }
701         if (flags & NDR_OUT) {
702                 ndr_print_struct(ndr, "out", "wbint_Ping");
703                 ndr->depth++;
704                 ndr_print_ptr(ndr, "out_data", r->out.out_data);
705                 ndr->depth++;
706                 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
707                 ndr->depth--;
708                 ndr->depth--;
709         }
710         ndr->depth--;
711 }
712
713 static enum ndr_err_code ndr_push_wbint_LookupSid(struct ndr_push *ndr, int flags, const struct wbint_LookupSid *r)
714 {
715         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
716         if (flags & NDR_IN) {
717                 if (r->in.sid == NULL) {
718                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
719                 }
720                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
721         }
722         if (flags & NDR_OUT) {
723                 if (r->out.type == NULL) {
724                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
725                 }
726                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
727                 if (r->out.domain == NULL) {
728                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
729                 }
730                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain));
731                 if (*r->out.domain) {
732                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
733                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
734                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
735                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain, ndr_charset_length(*r->out.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
736                 }
737                 if (r->out.name == NULL) {
738                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
739                 }
740                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name));
741                 if (*r->out.name) {
742                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
743                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
744                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
745                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name, ndr_charset_length(*r->out.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
746                 }
747                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
748         }
749         return NDR_ERR_SUCCESS;
750 }
751
752 static enum ndr_err_code ndr_pull_wbint_LookupSid(struct ndr_pull *ndr, int flags, struct wbint_LookupSid *r)
753 {
754         uint32_t _ptr_domain;
755         uint32_t size_domain_2 = 0;
756         uint32_t length_domain_2 = 0;
757         uint32_t _ptr_name;
758         uint32_t size_name_2 = 0;
759         uint32_t length_name_2 = 0;
760         TALLOC_CTX *_mem_save_sid_0;
761         TALLOC_CTX *_mem_save_type_0;
762         TALLOC_CTX *_mem_save_domain_0;
763         TALLOC_CTX *_mem_save_domain_1;
764         TALLOC_CTX *_mem_save_name_0;
765         TALLOC_CTX *_mem_save_name_1;
766         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
767         if (flags & NDR_IN) {
768                 ZERO_STRUCT(r->out);
769
770                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
771                         NDR_PULL_ALLOC(ndr, r->in.sid);
772                 }
773                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
774                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
775                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
776                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
777                 NDR_PULL_ALLOC(ndr, r->out.type);
778                 ZERO_STRUCTP(r->out.type);
779                 NDR_PULL_ALLOC(ndr, r->out.domain);
780                 ZERO_STRUCTP(r->out.domain);
781                 NDR_PULL_ALLOC(ndr, r->out.name);
782                 ZERO_STRUCTP(r->out.name);
783         }
784         if (flags & NDR_OUT) {
785                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
786                         NDR_PULL_ALLOC(ndr, r->out.type);
787                 }
788                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
789                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
790                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
791                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
792                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
793                         NDR_PULL_ALLOC(ndr, r->out.domain);
794                 }
795                 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
796                 NDR_PULL_SET_MEM_CTX(ndr, r->out.domain, LIBNDR_FLAG_REF_ALLOC);
797                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
798                 if (_ptr_domain) {
799                         NDR_PULL_ALLOC(ndr, *r->out.domain);
800                 } else {
801                         *r->out.domain = NULL;
802                 }
803                 if (*r->out.domain) {
804                         _mem_save_domain_1 = NDR_PULL_GET_MEM_CTX(ndr);
805                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain, 0);
806                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain));
807                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain));
808                         size_domain_2 = ndr_get_array_size(ndr, r->out.domain);
809                         length_domain_2 = ndr_get_array_length(ndr, r->out.domain);
810                         if (length_domain_2 > size_domain_2) {
811                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_2, length_domain_2);
812                         }
813                         NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_2, sizeof(uint8_t)));
814                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain, length_domain_2, sizeof(uint8_t), CH_UTF8));
815                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_1, 0);
816                 }
817                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, LIBNDR_FLAG_REF_ALLOC);
818                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
819                         NDR_PULL_ALLOC(ndr, r->out.name);
820                 }
821                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
822                 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
823                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
824                 if (_ptr_name) {
825                         NDR_PULL_ALLOC(ndr, *r->out.name);
826                 } else {
827                         *r->out.name = NULL;
828                 }
829                 if (*r->out.name) {
830                         _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
831                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0);
832                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.name));
833                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.name));
834                         size_name_2 = ndr_get_array_size(ndr, r->out.name);
835                         length_name_2 = ndr_get_array_length(ndr, r->out.name);
836                         if (length_name_2 > size_name_2) {
837                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_name_2, length_name_2);
838                         }
839                         NDR_CHECK(ndr_check_string_terminator(ndr, length_name_2, sizeof(uint8_t)));
840                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name, length_name_2, sizeof(uint8_t), CH_UTF8));
841                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0);
842                 }
843                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
844                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
845         }
846         return NDR_ERR_SUCCESS;
847 }
848
849 _PUBLIC_ void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r)
850 {
851         ndr_print_struct(ndr, name, "wbint_LookupSid");
852         if (r == NULL) { ndr_print_null(ndr); return; }
853         ndr->depth++;
854         if (flags & NDR_SET_VALUES) {
855                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
856         }
857         if (flags & NDR_IN) {
858                 ndr_print_struct(ndr, "in", "wbint_LookupSid");
859                 ndr->depth++;
860                 ndr_print_ptr(ndr, "sid", r->in.sid);
861                 ndr->depth++;
862                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
863                 ndr->depth--;
864                 ndr->depth--;
865         }
866         if (flags & NDR_OUT) {
867                 ndr_print_struct(ndr, "out", "wbint_LookupSid");
868                 ndr->depth++;
869                 ndr_print_ptr(ndr, "type", r->out.type);
870                 ndr->depth++;
871                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
872                 ndr->depth--;
873                 ndr_print_ptr(ndr, "domain", r->out.domain);
874                 ndr->depth++;
875                 ndr_print_ptr(ndr, "domain", *r->out.domain);
876                 ndr->depth++;
877                 if (*r->out.domain) {
878                         ndr_print_string(ndr, "domain", *r->out.domain);
879                 }
880                 ndr->depth--;
881                 ndr->depth--;
882                 ndr_print_ptr(ndr, "name", r->out.name);
883                 ndr->depth++;
884                 ndr_print_ptr(ndr, "name", *r->out.name);
885                 ndr->depth++;
886                 if (*r->out.name) {
887                         ndr_print_string(ndr, "name", *r->out.name);
888                 }
889                 ndr->depth--;
890                 ndr->depth--;
891                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
892                 ndr->depth--;
893         }
894         ndr->depth--;
895 }
896
897 static enum ndr_err_code ndr_push_wbint_LookupSids(struct ndr_push *ndr, int flags, const struct wbint_LookupSids *r)
898 {
899         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
900         if (flags & NDR_IN) {
901                 if (r->in.sids == NULL) {
902                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
903                 }
904                 NDR_CHECK(ndr_push_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids));
905         }
906         if (flags & NDR_OUT) {
907                 if (r->out.domains == NULL) {
908                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
909                 }
910                 NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains));
911                 if (r->out.names == NULL) {
912                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
913                 }
914                 NDR_CHECK(ndr_push_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
915                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
916         }
917         return NDR_ERR_SUCCESS;
918 }
919
920 static enum ndr_err_code ndr_pull_wbint_LookupSids(struct ndr_pull *ndr, int flags, struct wbint_LookupSids *r)
921 {
922         TALLOC_CTX *_mem_save_sids_0;
923         TALLOC_CTX *_mem_save_domains_0;
924         TALLOC_CTX *_mem_save_names_0;
925         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
926         if (flags & NDR_IN) {
927                 ZERO_STRUCT(r->out);
928
929                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
930                         NDR_PULL_ALLOC(ndr, r->in.sids);
931                 }
932                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
933                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC);
934                 NDR_CHECK(ndr_pull_lsa_SidArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sids));
935                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
936                 NDR_PULL_ALLOC(ndr, r->out.domains);
937                 ZERO_STRUCTP(r->out.domains);
938                 NDR_PULL_ALLOC(ndr, r->out.names);
939                 ZERO_STRUCTP(r->out.names);
940         }
941         if (flags & NDR_OUT) {
942                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
943                         NDR_PULL_ALLOC(ndr, r->out.domains);
944                 }
945                 _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
946                 NDR_PULL_SET_MEM_CTX(ndr, r->out.domains, LIBNDR_FLAG_REF_ALLOC);
947                 NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domains));
948                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC);
949                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
950                         NDR_PULL_ALLOC(ndr, r->out.names);
951                 }
952                 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
953                 NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC);
954                 NDR_CHECK(ndr_pull_lsa_TransNameArray(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
955                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC);
956                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
957         }
958         return NDR_ERR_SUCCESS;
959 }
960
961 _PUBLIC_ void ndr_print_wbint_LookupSids(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSids *r)
962 {
963         ndr_print_struct(ndr, name, "wbint_LookupSids");
964         if (r == NULL) { ndr_print_null(ndr); return; }
965         ndr->depth++;
966         if (flags & NDR_SET_VALUES) {
967                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
968         }
969         if (flags & NDR_IN) {
970                 ndr_print_struct(ndr, "in", "wbint_LookupSids");
971                 ndr->depth++;
972                 ndr_print_ptr(ndr, "sids", r->in.sids);
973                 ndr->depth++;
974                 ndr_print_lsa_SidArray(ndr, "sids", r->in.sids);
975                 ndr->depth--;
976                 ndr->depth--;
977         }
978         if (flags & NDR_OUT) {
979                 ndr_print_struct(ndr, "out", "wbint_LookupSids");
980                 ndr->depth++;
981                 ndr_print_ptr(ndr, "domains", r->out.domains);
982                 ndr->depth++;
983                 ndr_print_lsa_RefDomainList(ndr, "domains", r->out.domains);
984                 ndr->depth--;
985                 ndr_print_ptr(ndr, "names", r->out.names);
986                 ndr->depth++;
987                 ndr_print_lsa_TransNameArray(ndr, "names", r->out.names);
988                 ndr->depth--;
989                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
990                 ndr->depth--;
991         }
992         ndr->depth--;
993 }
994
995 static enum ndr_err_code ndr_push_wbint_LookupName(struct ndr_push *ndr, int flags, const struct wbint_LookupName *r)
996 {
997         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
998         if (flags & NDR_IN) {
999                 if (r->in.domain == NULL) {
1000                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1001                 }
1002                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
1003                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1004                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
1005                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
1006                 if (r->in.name == NULL) {
1007                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1008                 }
1009                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
1010                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1011                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
1012                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
1013                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
1014         }
1015         if (flags & NDR_OUT) {
1016                 if (r->out.type == NULL) {
1017                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1018                 }
1019                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
1020                 if (r->out.sid == NULL) {
1021                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1022                 }
1023                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1024                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1025         }
1026         return NDR_ERR_SUCCESS;
1027 }
1028
1029 static enum ndr_err_code ndr_pull_wbint_LookupName(struct ndr_pull *ndr, int flags, struct wbint_LookupName *r)
1030 {
1031         uint32_t size_domain_1 = 0;
1032         uint32_t length_domain_1 = 0;
1033         uint32_t size_name_1 = 0;
1034         uint32_t length_name_1 = 0;
1035         TALLOC_CTX *_mem_save_type_0;
1036         TALLOC_CTX *_mem_save_sid_0;
1037         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1038         if (flags & NDR_IN) {
1039                 ZERO_STRUCT(r->out);
1040
1041                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
1042                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
1043                 size_domain_1 = ndr_get_array_size(ndr, &r->in.domain);
1044                 length_domain_1 = ndr_get_array_length(ndr, &r->in.domain);
1045                 if (length_domain_1 > size_domain_1) {
1046                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_1, length_domain_1);
1047                 }
1048                 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_1, sizeof(uint8_t)));
1049                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, length_domain_1, sizeof(uint8_t), CH_UTF8));
1050                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name));
1051                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name));
1052                 size_name_1 = ndr_get_array_size(ndr, &r->in.name);
1053                 length_name_1 = ndr_get_array_length(ndr, &r->in.name);
1054                 if (length_name_1 > size_name_1) {
1055                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_name_1, length_name_1);
1056                 }
1057                 NDR_CHECK(ndr_check_string_terminator(ndr, length_name_1, sizeof(uint8_t)));
1058                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, length_name_1, sizeof(uint8_t), CH_UTF8));
1059                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
1060                 NDR_PULL_ALLOC(ndr, r->out.type);
1061                 ZERO_STRUCTP(r->out.type);
1062                 NDR_PULL_ALLOC(ndr, r->out.sid);
1063                 ZERO_STRUCTP(r->out.sid);
1064         }
1065         if (flags & NDR_OUT) {
1066                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1067                         NDR_PULL_ALLOC(ndr, r->out.type);
1068                 }
1069                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
1070                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
1071                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
1072                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
1073                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1074                         NDR_PULL_ALLOC(ndr, r->out.sid);
1075                 }
1076                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1077                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1078                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1079                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1080                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1081         }
1082         return NDR_ERR_SUCCESS;
1083 }
1084
1085 _PUBLIC_ void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r)
1086 {
1087         ndr_print_struct(ndr, name, "wbint_LookupName");
1088         if (r == NULL) { ndr_print_null(ndr); return; }
1089         ndr->depth++;
1090         if (flags & NDR_SET_VALUES) {
1091                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1092         }
1093         if (flags & NDR_IN) {
1094                 ndr_print_struct(ndr, "in", "wbint_LookupName");
1095                 ndr->depth++;
1096                 ndr_print_ptr(ndr, "domain", r->in.domain);
1097                 ndr->depth++;
1098                 ndr_print_string(ndr, "domain", r->in.domain);
1099                 ndr->depth--;
1100                 ndr_print_ptr(ndr, "name", r->in.name);
1101                 ndr->depth++;
1102                 ndr_print_string(ndr, "name", r->in.name);
1103                 ndr->depth--;
1104                 ndr_print_uint32(ndr, "flags", r->in.flags);
1105                 ndr->depth--;
1106         }
1107         if (flags & NDR_OUT) {
1108                 ndr_print_struct(ndr, "out", "wbint_LookupName");
1109                 ndr->depth++;
1110                 ndr_print_ptr(ndr, "type", r->out.type);
1111                 ndr->depth++;
1112                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
1113                 ndr->depth--;
1114                 ndr_print_ptr(ndr, "sid", r->out.sid);
1115                 ndr->depth++;
1116                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1117                 ndr->depth--;
1118                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1119                 ndr->depth--;
1120         }
1121         ndr->depth--;
1122 }
1123
1124 static enum ndr_err_code ndr_push_wbint_Sids2UnixIDs(struct ndr_push *ndr, int flags, const struct wbint_Sids2UnixIDs *r)
1125 {
1126         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1127         if (flags & NDR_IN) {
1128                 if (r->in.domains == NULL) {
1129                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1130                 }
1131                 NDR_CHECK(ndr_push_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domains));
1132                 if (r->in.ids == NULL) {
1133                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1134                 }
1135                 NDR_CHECK(ndr_push_wbint_TransIDArray(ndr, NDR_SCALARS, r->in.ids));
1136         }
1137         if (flags & NDR_OUT) {
1138                 if (r->out.ids == NULL) {
1139                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1140                 }
1141                 NDR_CHECK(ndr_push_wbint_TransIDArray(ndr, NDR_SCALARS, r->out.ids));
1142                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1143         }
1144         return NDR_ERR_SUCCESS;
1145 }
1146
1147 static enum ndr_err_code ndr_pull_wbint_Sids2UnixIDs(struct ndr_pull *ndr, int flags, struct wbint_Sids2UnixIDs *r)
1148 {
1149         TALLOC_CTX *_mem_save_domains_0;
1150         TALLOC_CTX *_mem_save_ids_0;
1151         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1152         if (flags & NDR_IN) {
1153                 ZERO_STRUCT(r->out);
1154
1155                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1156                         NDR_PULL_ALLOC(ndr, r->in.domains);
1157                 }
1158                 _mem_save_domains_0 = NDR_PULL_GET_MEM_CTX(ndr);
1159                 NDR_PULL_SET_MEM_CTX(ndr, r->in.domains, LIBNDR_FLAG_REF_ALLOC);
1160                 NDR_CHECK(ndr_pull_lsa_RefDomainList(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.domains));
1161                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domains_0, LIBNDR_FLAG_REF_ALLOC);
1162                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1163                         NDR_PULL_ALLOC(ndr, r->in.ids);
1164                 }
1165                 _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1166                 NDR_PULL_SET_MEM_CTX(ndr, r->in.ids, LIBNDR_FLAG_REF_ALLOC);
1167                 NDR_CHECK(ndr_pull_wbint_TransIDArray(ndr, NDR_SCALARS, r->in.ids));
1168                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, LIBNDR_FLAG_REF_ALLOC);
1169                 NDR_PULL_ALLOC(ndr, r->out.ids);
1170                 *r->out.ids = *r->in.ids;
1171         }
1172         if (flags & NDR_OUT) {
1173                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1174                         NDR_PULL_ALLOC(ndr, r->out.ids);
1175                 }
1176                 _mem_save_ids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1177                 NDR_PULL_SET_MEM_CTX(ndr, r->out.ids, LIBNDR_FLAG_REF_ALLOC);
1178                 NDR_CHECK(ndr_pull_wbint_TransIDArray(ndr, NDR_SCALARS, r->out.ids));
1179                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ids_0, LIBNDR_FLAG_REF_ALLOC);
1180                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1181         }
1182         return NDR_ERR_SUCCESS;
1183 }
1184
1185 _PUBLIC_ void ndr_print_wbint_Sids2UnixIDs(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sids2UnixIDs *r)
1186 {
1187         ndr_print_struct(ndr, name, "wbint_Sids2UnixIDs");
1188         if (r == NULL) { ndr_print_null(ndr); return; }
1189         ndr->depth++;
1190         if (flags & NDR_SET_VALUES) {
1191                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1192         }
1193         if (flags & NDR_IN) {
1194                 ndr_print_struct(ndr, "in", "wbint_Sids2UnixIDs");
1195                 ndr->depth++;
1196                 ndr_print_ptr(ndr, "domains", r->in.domains);
1197                 ndr->depth++;
1198                 ndr_print_lsa_RefDomainList(ndr, "domains", r->in.domains);
1199                 ndr->depth--;
1200                 ndr_print_ptr(ndr, "ids", r->in.ids);
1201                 ndr->depth++;
1202                 ndr_print_wbint_TransIDArray(ndr, "ids", r->in.ids);
1203                 ndr->depth--;
1204                 ndr->depth--;
1205         }
1206         if (flags & NDR_OUT) {
1207                 ndr_print_struct(ndr, "out", "wbint_Sids2UnixIDs");
1208                 ndr->depth++;
1209                 ndr_print_ptr(ndr, "ids", r->out.ids);
1210                 ndr->depth++;
1211                 ndr_print_wbint_TransIDArray(ndr, "ids", r->out.ids);
1212                 ndr->depth--;
1213                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1214                 ndr->depth--;
1215         }
1216         ndr->depth--;
1217 }
1218
1219 static enum ndr_err_code ndr_push_wbint_Uid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Uid2Sid *r)
1220 {
1221         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1222         if (flags & NDR_IN) {
1223                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1224                 if (r->in.dom_name) {
1225                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1226                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1227                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1228                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
1229                 }
1230                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
1231         }
1232         if (flags & NDR_OUT) {
1233                 if (r->out.sid == NULL) {
1234                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1235                 }
1236                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1237                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1238         }
1239         return NDR_ERR_SUCCESS;
1240 }
1241
1242 static enum ndr_err_code ndr_pull_wbint_Uid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Uid2Sid *r)
1243 {
1244         uint32_t _ptr_dom_name;
1245         uint32_t size_dom_name_1 = 0;
1246         uint32_t length_dom_name_1 = 0;
1247         TALLOC_CTX *_mem_save_dom_name_0;
1248         TALLOC_CTX *_mem_save_sid_0;
1249         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1250         if (flags & NDR_IN) {
1251                 ZERO_STRUCT(r->out);
1252
1253                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1254                 if (_ptr_dom_name) {
1255                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
1256                 } else {
1257                         r->in.dom_name = NULL;
1258                 }
1259                 if (r->in.dom_name) {
1260                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1261                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1262                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1263                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1264                         size_dom_name_1 = ndr_get_array_size(ndr, &r->in.dom_name);
1265                         length_dom_name_1 = ndr_get_array_length(ndr, &r->in.dom_name);
1266                         if (length_dom_name_1 > size_dom_name_1) {
1267                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dom_name_1, length_dom_name_1);
1268                         }
1269                         NDR_CHECK(ndr_check_string_terminator(ndr, length_dom_name_1, sizeof(uint8_t)));
1270                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, length_dom_name_1, sizeof(uint8_t), CH_UTF8));
1271                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1272                 }
1273                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
1274                 NDR_PULL_ALLOC(ndr, r->out.sid);
1275                 ZERO_STRUCTP(r->out.sid);
1276         }
1277         if (flags & NDR_OUT) {
1278                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1279                         NDR_PULL_ALLOC(ndr, r->out.sid);
1280                 }
1281                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1282                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1283                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1284                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1285                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1286         }
1287         return NDR_ERR_SUCCESS;
1288 }
1289
1290 _PUBLIC_ void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r)
1291 {
1292         ndr_print_struct(ndr, name, "wbint_Uid2Sid");
1293         if (r == NULL) { ndr_print_null(ndr); return; }
1294         ndr->depth++;
1295         if (flags & NDR_SET_VALUES) {
1296                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1297         }
1298         if (flags & NDR_IN) {
1299                 ndr_print_struct(ndr, "in", "wbint_Uid2Sid");
1300                 ndr->depth++;
1301                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1302                 ndr->depth++;
1303                 if (r->in.dom_name) {
1304                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1305                 }
1306                 ndr->depth--;
1307                 ndr_print_hyper(ndr, "uid", r->in.uid);
1308                 ndr->depth--;
1309         }
1310         if (flags & NDR_OUT) {
1311                 ndr_print_struct(ndr, "out", "wbint_Uid2Sid");
1312                 ndr->depth++;
1313                 ndr_print_ptr(ndr, "sid", r->out.sid);
1314                 ndr->depth++;
1315                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1316                 ndr->depth--;
1317                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1318                 ndr->depth--;
1319         }
1320         ndr->depth--;
1321 }
1322
1323 static enum ndr_err_code ndr_push_wbint_Gid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Gid2Sid *r)
1324 {
1325         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1326         if (flags & NDR_IN) {
1327                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1328                 if (r->in.dom_name) {
1329                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1330                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
1331                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1332                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dom_name, ndr_charset_length(r->in.dom_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
1333                 }
1334                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
1335         }
1336         if (flags & NDR_OUT) {
1337                 if (r->out.sid == NULL) {
1338                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1339                 }
1340                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1341                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1342         }
1343         return NDR_ERR_SUCCESS;
1344 }
1345
1346 static enum ndr_err_code ndr_pull_wbint_Gid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Gid2Sid *r)
1347 {
1348         uint32_t _ptr_dom_name;
1349         uint32_t size_dom_name_1 = 0;
1350         uint32_t length_dom_name_1 = 0;
1351         TALLOC_CTX *_mem_save_dom_name_0;
1352         TALLOC_CTX *_mem_save_sid_0;
1353         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1354         if (flags & NDR_IN) {
1355                 ZERO_STRUCT(r->out);
1356
1357                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1358                 if (_ptr_dom_name) {
1359                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
1360                 } else {
1361                         r->in.dom_name = NULL;
1362                 }
1363                 if (r->in.dom_name) {
1364                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1365                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1366                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1367                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1368                         size_dom_name_1 = ndr_get_array_size(ndr, &r->in.dom_name);
1369                         length_dom_name_1 = ndr_get_array_length(ndr, &r->in.dom_name);
1370                         if (length_dom_name_1 > size_dom_name_1) {
1371                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dom_name_1, length_dom_name_1);
1372                         }
1373                         NDR_CHECK(ndr_check_string_terminator(ndr, length_dom_name_1, sizeof(uint8_t)));
1374                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, length_dom_name_1, sizeof(uint8_t), CH_UTF8));
1375                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1376                 }
1377                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
1378                 NDR_PULL_ALLOC(ndr, r->out.sid);
1379                 ZERO_STRUCTP(r->out.sid);
1380         }
1381         if (flags & NDR_OUT) {
1382                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1383                         NDR_PULL_ALLOC(ndr, r->out.sid);
1384                 }
1385                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1386                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1387                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1388                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1389                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1390         }
1391         return NDR_ERR_SUCCESS;
1392 }
1393
1394 _PUBLIC_ void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r)
1395 {
1396         ndr_print_struct(ndr, name, "wbint_Gid2Sid");
1397         if (r == NULL) { ndr_print_null(ndr); return; }
1398         ndr->depth++;
1399         if (flags & NDR_SET_VALUES) {
1400                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1401         }
1402         if (flags & NDR_IN) {
1403                 ndr_print_struct(ndr, "in", "wbint_Gid2Sid");
1404                 ndr->depth++;
1405                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1406                 ndr->depth++;
1407                 if (r->in.dom_name) {
1408                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1409                 }
1410                 ndr->depth--;
1411                 ndr_print_hyper(ndr, "gid", r->in.gid);
1412                 ndr->depth--;
1413         }
1414         if (flags & NDR_OUT) {
1415                 ndr_print_struct(ndr, "out", "wbint_Gid2Sid");
1416                 ndr->depth++;
1417                 ndr_print_ptr(ndr, "sid", r->out.sid);
1418                 ndr->depth++;
1419                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1420                 ndr->depth--;
1421                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1422                 ndr->depth--;
1423         }
1424         ndr->depth--;
1425 }
1426
1427 static enum ndr_err_code ndr_push_wbint_AllocateUid(struct ndr_push *ndr, int flags, const struct wbint_AllocateUid *r)
1428 {
1429         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1430         if (flags & NDR_IN) {
1431         }
1432         if (flags & NDR_OUT) {
1433                 if (r->out.uid == NULL) {
1434                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1435                 }
1436                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
1437                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1438         }
1439         return NDR_ERR_SUCCESS;
1440 }
1441
1442 static enum ndr_err_code ndr_pull_wbint_AllocateUid(struct ndr_pull *ndr, int flags, struct wbint_AllocateUid *r)
1443 {
1444         TALLOC_CTX *_mem_save_uid_0;
1445         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1446         if (flags & NDR_IN) {
1447                 ZERO_STRUCT(r->out);
1448
1449                 NDR_PULL_ALLOC(ndr, r->out.uid);
1450                 ZERO_STRUCTP(r->out.uid);
1451         }
1452         if (flags & NDR_OUT) {
1453                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1454                         NDR_PULL_ALLOC(ndr, r->out.uid);
1455                 }
1456                 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1457                 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
1458                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
1459                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
1460                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1461         }
1462         return NDR_ERR_SUCCESS;
1463 }
1464
1465 _PUBLIC_ void ndr_print_wbint_AllocateUid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_AllocateUid *r)
1466 {
1467         ndr_print_struct(ndr, name, "wbint_AllocateUid");
1468         if (r == NULL) { ndr_print_null(ndr); return; }
1469         ndr->depth++;
1470         if (flags & NDR_SET_VALUES) {
1471                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1472         }
1473         if (flags & NDR_IN) {
1474                 ndr_print_struct(ndr, "in", "wbint_AllocateUid");
1475                 ndr->depth++;
1476                 ndr->depth--;
1477         }
1478         if (flags & NDR_OUT) {
1479                 ndr_print_struct(ndr, "out", "wbint_AllocateUid");
1480                 ndr->depth++;
1481                 ndr_print_ptr(ndr, "uid", r->out.uid);
1482                 ndr->depth++;
1483                 ndr_print_hyper(ndr, "uid", *r->out.uid);
1484                 ndr->depth--;
1485                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1486                 ndr->depth--;
1487         }
1488         ndr->depth--;
1489 }
1490
1491 static enum ndr_err_code ndr_push_wbint_AllocateGid(struct ndr_push *ndr, int flags, const struct wbint_AllocateGid *r)
1492 {
1493         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1494         if (flags & NDR_IN) {
1495         }
1496         if (flags & NDR_OUT) {
1497                 if (r->out.gid == NULL) {
1498                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1499                 }
1500                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
1501                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1502         }
1503         return NDR_ERR_SUCCESS;
1504 }
1505
1506 static enum ndr_err_code ndr_pull_wbint_AllocateGid(struct ndr_pull *ndr, int flags, struct wbint_AllocateGid *r)
1507 {
1508         TALLOC_CTX *_mem_save_gid_0;
1509         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1510         if (flags & NDR_IN) {
1511                 ZERO_STRUCT(r->out);
1512
1513                 NDR_PULL_ALLOC(ndr, r->out.gid);
1514                 ZERO_STRUCTP(r->out.gid);
1515         }
1516         if (flags & NDR_OUT) {
1517                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1518                         NDR_PULL_ALLOC(ndr, r->out.gid);
1519                 }
1520                 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1521                 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
1522                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
1523                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
1524                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1525         }
1526         return NDR_ERR_SUCCESS;
1527 }
1528
1529 _PUBLIC_ void ndr_print_wbint_AllocateGid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_AllocateGid *r)
1530 {
1531         ndr_print_struct(ndr, name, "wbint_AllocateGid");
1532         if (r == NULL) { ndr_print_null(ndr); return; }
1533         ndr->depth++;
1534         if (flags & NDR_SET_VALUES) {
1535                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1536         }
1537         if (flags & NDR_IN) {
1538                 ndr_print_struct(ndr, "in", "wbint_AllocateGid");
1539                 ndr->depth++;
1540                 ndr->depth--;
1541         }
1542         if (flags & NDR_OUT) {
1543                 ndr_print_struct(ndr, "out", "wbint_AllocateGid");
1544                 ndr->depth++;
1545                 ndr_print_ptr(ndr, "gid", r->out.gid);
1546                 ndr->depth++;
1547                 ndr_print_hyper(ndr, "gid", *r->out.gid);
1548                 ndr->depth--;
1549                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1550                 ndr->depth--;
1551         }
1552         ndr->depth--;
1553 }
1554
1555 static enum ndr_err_code ndr_push_wbint_QueryUser(struct ndr_push *ndr, int flags, const struct wbint_QueryUser *r)
1556 {
1557         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1558         if (flags & NDR_IN) {
1559                 if (r->in.sid == NULL) {
1560                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1561                 }
1562                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1563         }
1564         if (flags & NDR_OUT) {
1565                 if (r->out.info == NULL) {
1566                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1567                 }
1568                 NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1569                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1570         }
1571         return NDR_ERR_SUCCESS;
1572 }
1573
1574 static enum ndr_err_code ndr_pull_wbint_QueryUser(struct ndr_pull *ndr, int flags, struct wbint_QueryUser *r)
1575 {
1576         TALLOC_CTX *_mem_save_sid_0;
1577         TALLOC_CTX *_mem_save_info_0;
1578         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1579         if (flags & NDR_IN) {
1580                 ZERO_STRUCT(r->out);
1581
1582                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1583                         NDR_PULL_ALLOC(ndr, r->in.sid);
1584                 }
1585                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1586                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1587                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1588                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1589                 NDR_PULL_ALLOC(ndr, r->out.info);
1590                 ZERO_STRUCTP(r->out.info);
1591         }
1592         if (flags & NDR_OUT) {
1593                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1594                         NDR_PULL_ALLOC(ndr, r->out.info);
1595                 }
1596                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1597                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1598                 NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1599                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1600                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1601         }
1602         return NDR_ERR_SUCCESS;
1603 }
1604
1605 _PUBLIC_ void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r)
1606 {
1607         ndr_print_struct(ndr, name, "wbint_QueryUser");
1608         if (r == NULL) { ndr_print_null(ndr); return; }
1609         ndr->depth++;
1610         if (flags & NDR_SET_VALUES) {
1611                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1612         }
1613         if (flags & NDR_IN) {
1614                 ndr_print_struct(ndr, "in", "wbint_QueryUser");
1615                 ndr->depth++;
1616                 ndr_print_ptr(ndr, "sid", r->in.sid);
1617                 ndr->depth++;
1618                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1619                 ndr->depth--;
1620                 ndr->depth--;
1621         }
1622         if (flags & NDR_OUT) {
1623                 ndr_print_struct(ndr, "out", "wbint_QueryUser");
1624                 ndr->depth++;
1625                 ndr_print_ptr(ndr, "info", r->out.info);
1626                 ndr->depth++;
1627                 ndr_print_wbint_userinfo(ndr, "info", r->out.info);
1628                 ndr->depth--;
1629                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1630                 ndr->depth--;
1631         }
1632         ndr->depth--;
1633 }
1634
1635 static enum ndr_err_code ndr_push_wbint_LookupUserAliases(struct ndr_push *ndr, int flags, const struct wbint_LookupUserAliases *r)
1636 {
1637         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1638         if (flags & NDR_IN) {
1639                 if (r->in.sids == NULL) {
1640                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1641                 }
1642                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1643         }
1644         if (flags & NDR_OUT) {
1645                 if (r->out.rids == NULL) {
1646                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1647                 }
1648                 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1649                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1650         }
1651         return NDR_ERR_SUCCESS;
1652 }
1653
1654 static enum ndr_err_code ndr_pull_wbint_LookupUserAliases(struct ndr_pull *ndr, int flags, struct wbint_LookupUserAliases *r)
1655 {
1656         TALLOC_CTX *_mem_save_sids_0;
1657         TALLOC_CTX *_mem_save_rids_0;
1658         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1659         if (flags & NDR_IN) {
1660                 ZERO_STRUCT(r->out);
1661
1662                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1663                         NDR_PULL_ALLOC(ndr, r->in.sids);
1664                 }
1665                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1666                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC);
1667                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1668                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1669                 NDR_PULL_ALLOC(ndr, r->out.rids);
1670                 ZERO_STRUCTP(r->out.rids);
1671         }
1672         if (flags & NDR_OUT) {
1673                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1674                         NDR_PULL_ALLOC(ndr, r->out.rids);
1675                 }
1676                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1677                 NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC);
1678                 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1679                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
1680                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1681         }
1682         return NDR_ERR_SUCCESS;
1683 }
1684
1685 _PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r)
1686 {
1687         ndr_print_struct(ndr, name, "wbint_LookupUserAliases");
1688         if (r == NULL) { ndr_print_null(ndr); return; }
1689         ndr->depth++;
1690         if (flags & NDR_SET_VALUES) {
1691                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1692         }
1693         if (flags & NDR_IN) {
1694                 ndr_print_struct(ndr, "in", "wbint_LookupUserAliases");
1695                 ndr->depth++;
1696                 ndr_print_ptr(ndr, "sids", r->in.sids);
1697                 ndr->depth++;
1698                 ndr_print_wbint_SidArray(ndr, "sids", r->in.sids);
1699                 ndr->depth--;
1700                 ndr->depth--;
1701         }
1702         if (flags & NDR_OUT) {
1703                 ndr_print_struct(ndr, "out", "wbint_LookupUserAliases");
1704                 ndr->depth++;
1705                 ndr_print_ptr(ndr, "rids", r->out.rids);
1706                 ndr->depth++;
1707                 ndr_print_wbint_RidArray(ndr, "rids", r->out.rids);
1708                 ndr->depth--;
1709                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1710                 ndr->depth--;
1711         }
1712         ndr->depth--;
1713 }
1714
1715 static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r)
1716 {
1717         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1718         if (flags & NDR_IN) {
1719                 if (r->in.sid == NULL) {
1720                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1721                 }
1722                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1723         }
1724         if (flags & NDR_OUT) {
1725                 if (r->out.sids == NULL) {
1726                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1727                 }
1728                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1729                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1730         }
1731         return NDR_ERR_SUCCESS;
1732 }
1733
1734 static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r)
1735 {
1736         TALLOC_CTX *_mem_save_sid_0;
1737         TALLOC_CTX *_mem_save_sids_0;
1738         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1739         if (flags & NDR_IN) {
1740                 ZERO_STRUCT(r->out);
1741
1742                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1743                         NDR_PULL_ALLOC(ndr, r->in.sid);
1744                 }
1745                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1746                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1747                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1748                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1749                 NDR_PULL_ALLOC(ndr, r->out.sids);
1750                 ZERO_STRUCTP(r->out.sids);
1751         }
1752         if (flags & NDR_OUT) {
1753                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1754                         NDR_PULL_ALLOC(ndr, r->out.sids);
1755                 }
1756                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1757                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC);
1758                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1759                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1760                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1761         }
1762         return NDR_ERR_SUCCESS;
1763 }
1764
1765 _PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r)
1766 {
1767         ndr_print_struct(ndr, name, "wbint_LookupUserGroups");
1768         if (r == NULL) { ndr_print_null(ndr); return; }
1769         ndr->depth++;
1770         if (flags & NDR_SET_VALUES) {
1771                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1772         }
1773         if (flags & NDR_IN) {
1774                 ndr_print_struct(ndr, "in", "wbint_LookupUserGroups");
1775                 ndr->depth++;
1776                 ndr_print_ptr(ndr, "sid", r->in.sid);
1777                 ndr->depth++;
1778                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1779                 ndr->depth--;
1780                 ndr->depth--;
1781         }
1782         if (flags & NDR_OUT) {
1783                 ndr_print_struct(ndr, "out", "wbint_LookupUserGroups");
1784                 ndr->depth++;
1785                 ndr_print_ptr(ndr, "sids", r->out.sids);
1786                 ndr->depth++;
1787                 ndr_print_wbint_SidArray(ndr, "sids", r->out.sids);
1788                 ndr->depth--;
1789                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1790                 ndr->depth--;
1791         }
1792         ndr->depth--;
1793 }
1794
1795 static enum ndr_err_code ndr_push_wbint_QuerySequenceNumber(struct ndr_push *ndr, int flags, const struct wbint_QuerySequenceNumber *r)
1796 {
1797         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1798         if (flags & NDR_IN) {
1799         }
1800         if (flags & NDR_OUT) {
1801                 if (r->out.sequence == NULL) {
1802                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1803                 }
1804                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sequence));
1805                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1806         }
1807         return NDR_ERR_SUCCESS;
1808 }
1809
1810 static enum ndr_err_code ndr_pull_wbint_QuerySequenceNumber(struct ndr_pull *ndr, int flags, struct wbint_QuerySequenceNumber *r)
1811 {
1812         TALLOC_CTX *_mem_save_sequence_0;
1813         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1814         if (flags & NDR_IN) {
1815                 ZERO_STRUCT(r->out);
1816
1817                 NDR_PULL_ALLOC(ndr, r->out.sequence);
1818                 ZERO_STRUCTP(r->out.sequence);
1819         }
1820         if (flags & NDR_OUT) {
1821                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1822                         NDR_PULL_ALLOC(ndr, r->out.sequence);
1823                 }
1824                 _mem_save_sequence_0 = NDR_PULL_GET_MEM_CTX(ndr);
1825                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence, LIBNDR_FLAG_REF_ALLOC);
1826                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sequence));
1827                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_0, LIBNDR_FLAG_REF_ALLOC);
1828                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1829         }
1830         return NDR_ERR_SUCCESS;
1831 }
1832
1833 _PUBLIC_ void ndr_print_wbint_QuerySequenceNumber(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QuerySequenceNumber *r)
1834 {
1835         ndr_print_struct(ndr, name, "wbint_QuerySequenceNumber");
1836         if (r == NULL) { ndr_print_null(ndr); return; }
1837         ndr->depth++;
1838         if (flags & NDR_SET_VALUES) {
1839                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1840         }
1841         if (flags & NDR_IN) {
1842                 ndr_print_struct(ndr, "in", "wbint_QuerySequenceNumber");
1843                 ndr->depth++;
1844                 ndr->depth--;
1845         }
1846         if (flags & NDR_OUT) {
1847                 ndr_print_struct(ndr, "out", "wbint_QuerySequenceNumber");
1848                 ndr->depth++;
1849                 ndr_print_ptr(ndr, "sequence", r->out.sequence);
1850                 ndr->depth++;
1851                 ndr_print_uint32(ndr, "sequence", *r->out.sequence);
1852                 ndr->depth--;
1853                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1854                 ndr->depth--;
1855         }
1856         ndr->depth--;
1857 }
1858
1859 static enum ndr_err_code ndr_push_wbint_LookupGroupMembers(struct ndr_push *ndr, int flags, const struct wbint_LookupGroupMembers *r)
1860 {
1861         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1862         if (flags & NDR_IN) {
1863                 if (r->in.sid == NULL) {
1864                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1865                 }
1866                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1867                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->in.type));
1868         }
1869         if (flags & NDR_OUT) {
1870                 if (r->out.members == NULL) {
1871                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1872                 }
1873                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1874                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1875         }
1876         return NDR_ERR_SUCCESS;
1877 }
1878
1879 static enum ndr_err_code ndr_pull_wbint_LookupGroupMembers(struct ndr_pull *ndr, int flags, struct wbint_LookupGroupMembers *r)
1880 {
1881         TALLOC_CTX *_mem_save_sid_0;
1882         TALLOC_CTX *_mem_save_members_0;
1883         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1884         if (flags & NDR_IN) {
1885                 ZERO_STRUCT(r->out);
1886
1887                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1888                         NDR_PULL_ALLOC(ndr, r->in.sid);
1889                 }
1890                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1891                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1892                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1893                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1894                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->in.type));
1895                 NDR_PULL_ALLOC(ndr, r->out.members);
1896                 ZERO_STRUCTP(r->out.members);
1897         }
1898         if (flags & NDR_OUT) {
1899                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1900                         NDR_PULL_ALLOC(ndr, r->out.members);
1901                 }
1902                 _mem_save_members_0 = NDR_PULL_GET_MEM_CTX(ndr);
1903                 NDR_PULL_SET_MEM_CTX(ndr, r->out.members, LIBNDR_FLAG_REF_ALLOC);
1904                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1905                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_members_0, LIBNDR_FLAG_REF_ALLOC);
1906                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1907         }
1908         return NDR_ERR_SUCCESS;
1909 }
1910
1911 _PUBLIC_ void ndr_print_wbint_LookupGroupMembers(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupGroupMembers *r)
1912 {
1913         ndr_print_struct(ndr, name, "wbint_LookupGroupMembers");
1914         if (r == NULL) { ndr_print_null(ndr); return; }
1915         ndr->depth++;
1916         if (flags & NDR_SET_VALUES) {
1917                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1918         }
1919         if (flags & NDR_IN) {
1920                 ndr_print_struct(ndr, "in", "wbint_LookupGroupMembers");
1921                 ndr->depth++;
1922                 ndr_print_ptr(ndr, "sid", r->in.sid);
1923                 ndr->depth++;
1924                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1925                 ndr->depth--;
1926                 ndr_print_lsa_SidType(ndr, "type", r->in.type);
1927                 ndr->depth--;
1928         }
1929         if (flags & NDR_OUT) {
1930                 ndr_print_struct(ndr, "out", "wbint_LookupGroupMembers");
1931                 ndr->depth++;
1932                 ndr_print_ptr(ndr, "members", r->out.members);
1933                 ndr->depth++;
1934                 ndr_print_wbint_Principals(ndr, "members", r->out.members);
1935                 ndr->depth--;
1936                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1937                 ndr->depth--;
1938         }
1939         ndr->depth--;
1940 }
1941
1942 static enum ndr_err_code ndr_push_wbint_QueryUserList(struct ndr_push *ndr, int flags, const struct wbint_QueryUserList *r)
1943 {
1944         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
1945         if (flags & NDR_IN) {
1946         }
1947         if (flags & NDR_OUT) {
1948                 if (r->out.users == NULL) {
1949                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1950                 }
1951                 NDR_CHECK(ndr_push_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1952                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1953         }
1954         return NDR_ERR_SUCCESS;
1955 }
1956
1957 static enum ndr_err_code ndr_pull_wbint_QueryUserList(struct ndr_pull *ndr, int flags, struct wbint_QueryUserList *r)
1958 {
1959         TALLOC_CTX *_mem_save_users_0;
1960         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
1961         if (flags & NDR_IN) {
1962                 ZERO_STRUCT(r->out);
1963
1964                 NDR_PULL_ALLOC(ndr, r->out.users);
1965                 ZERO_STRUCTP(r->out.users);
1966         }
1967         if (flags & NDR_OUT) {
1968                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1969                         NDR_PULL_ALLOC(ndr, r->out.users);
1970                 }
1971                 _mem_save_users_0 = NDR_PULL_GET_MEM_CTX(ndr);
1972                 NDR_PULL_SET_MEM_CTX(ndr, r->out.users, LIBNDR_FLAG_REF_ALLOC);
1973                 NDR_CHECK(ndr_pull_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1974                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_users_0, LIBNDR_FLAG_REF_ALLOC);
1975                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1976         }
1977         return NDR_ERR_SUCCESS;
1978 }
1979
1980 _PUBLIC_ void ndr_print_wbint_QueryUserList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUserList *r)
1981 {
1982         ndr_print_struct(ndr, name, "wbint_QueryUserList");
1983         if (r == NULL) { ndr_print_null(ndr); return; }
1984         ndr->depth++;
1985         if (flags & NDR_SET_VALUES) {
1986                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1987         }
1988         if (flags & NDR_IN) {
1989                 ndr_print_struct(ndr, "in", "wbint_QueryUserList");
1990                 ndr->depth++;
1991                 ndr->depth--;
1992         }
1993         if (flags & NDR_OUT) {
1994                 ndr_print_struct(ndr, "out", "wbint_QueryUserList");
1995                 ndr->depth++;
1996                 ndr_print_ptr(ndr, "users", r->out.users);
1997                 ndr->depth++;
1998                 ndr_print_wbint_userinfos(ndr, "users", r->out.users);
1999                 ndr->depth--;
2000                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2001                 ndr->depth--;
2002         }
2003         ndr->depth--;
2004 }
2005
2006 static enum ndr_err_code ndr_push_wbint_QueryGroupList(struct ndr_push *ndr, int flags, const struct wbint_QueryGroupList *r)
2007 {
2008         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2009         if (flags & NDR_IN) {
2010         }
2011         if (flags & NDR_OUT) {
2012                 if (r->out.groups == NULL) {
2013                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2014                 }
2015                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
2016                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2017         }
2018         return NDR_ERR_SUCCESS;
2019 }
2020
2021 static enum ndr_err_code ndr_pull_wbint_QueryGroupList(struct ndr_pull *ndr, int flags, struct wbint_QueryGroupList *r)
2022 {
2023         TALLOC_CTX *_mem_save_groups_0;
2024         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2025         if (flags & NDR_IN) {
2026                 ZERO_STRUCT(r->out);
2027
2028                 NDR_PULL_ALLOC(ndr, r->out.groups);
2029                 ZERO_STRUCTP(r->out.groups);
2030         }
2031         if (flags & NDR_OUT) {
2032                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2033                         NDR_PULL_ALLOC(ndr, r->out.groups);
2034                 }
2035                 _mem_save_groups_0 = NDR_PULL_GET_MEM_CTX(ndr);
2036                 NDR_PULL_SET_MEM_CTX(ndr, r->out.groups, LIBNDR_FLAG_REF_ALLOC);
2037                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
2038                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_groups_0, LIBNDR_FLAG_REF_ALLOC);
2039                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2040         }
2041         return NDR_ERR_SUCCESS;
2042 }
2043
2044 _PUBLIC_ void ndr_print_wbint_QueryGroupList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryGroupList *r)
2045 {
2046         ndr_print_struct(ndr, name, "wbint_QueryGroupList");
2047         if (r == NULL) { ndr_print_null(ndr); return; }
2048         ndr->depth++;
2049         if (flags & NDR_SET_VALUES) {
2050                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2051         }
2052         if (flags & NDR_IN) {
2053                 ndr_print_struct(ndr, "in", "wbint_QueryGroupList");
2054                 ndr->depth++;
2055                 ndr->depth--;
2056         }
2057         if (flags & NDR_OUT) {
2058                 ndr_print_struct(ndr, "out", "wbint_QueryGroupList");
2059                 ndr->depth++;
2060                 ndr_print_ptr(ndr, "groups", r->out.groups);
2061                 ndr->depth++;
2062                 ndr_print_wbint_Principals(ndr, "groups", r->out.groups);
2063                 ndr->depth--;
2064                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2065                 ndr->depth--;
2066         }
2067         ndr->depth--;
2068 }
2069
2070 static enum ndr_err_code ndr_push_wbint_DsGetDcName(struct ndr_push *ndr, int flags, const struct wbint_DsGetDcName *r)
2071 {
2072         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2073         if (flags & NDR_IN) {
2074                 if (r->in.domain_name == NULL) {
2075                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2076                 }
2077                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
2078                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2079                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
2080                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
2081                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
2082                 if (r->in.domain_guid) {
2083                         NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
2084                 }
2085                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
2086                 if (r->in.site_name) {
2087                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
2088                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2089                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
2090                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.site_name, ndr_charset_length(r->in.site_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
2091                 }
2092                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
2093         }
2094         if (flags & NDR_OUT) {
2095                 if (r->out.dc_info == NULL) {
2096                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2097                 }
2098                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dc_info));
2099                 if (*r->out.dc_info) {
2100                         NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
2101                 }
2102                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2103         }
2104         return NDR_ERR_SUCCESS;
2105 }
2106
2107 static enum ndr_err_code ndr_pull_wbint_DsGetDcName(struct ndr_pull *ndr, int flags, struct wbint_DsGetDcName *r)
2108 {
2109         uint32_t size_domain_name_1 = 0;
2110         uint32_t length_domain_name_1 = 0;
2111         uint32_t _ptr_domain_guid;
2112         uint32_t _ptr_site_name;
2113         uint32_t size_site_name_1 = 0;
2114         uint32_t length_site_name_1 = 0;
2115         uint32_t _ptr_dc_info;
2116         TALLOC_CTX *_mem_save_domain_guid_0;
2117         TALLOC_CTX *_mem_save_site_name_0;
2118         TALLOC_CTX *_mem_save_dc_info_0;
2119         TALLOC_CTX *_mem_save_dc_info_1;
2120         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2121         if (flags & NDR_IN) {
2122                 ZERO_STRUCT(r->out);
2123
2124                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
2125                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
2126                 size_domain_name_1 = ndr_get_array_size(ndr, &r->in.domain_name);
2127                 length_domain_name_1 = ndr_get_array_length(ndr, &r->in.domain_name);
2128                 if (length_domain_name_1 > size_domain_name_1) {
2129                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_1, length_domain_name_1);
2130                 }
2131                 NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_1, sizeof(uint8_t)));
2132                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, length_domain_name_1, sizeof(uint8_t), CH_UTF8));
2133                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
2134                 if (_ptr_domain_guid) {
2135                         NDR_PULL_ALLOC(ndr, r->in.domain_guid);
2136                 } else {
2137                         r->in.domain_guid = NULL;
2138                 }
2139                 if (r->in.domain_guid) {
2140                         _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2141                         NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
2142                         NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
2143                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
2144                 }
2145                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
2146                 if (_ptr_site_name) {
2147                         NDR_PULL_ALLOC(ndr, r->in.site_name);
2148                 } else {
2149                         r->in.site_name = NULL;
2150                 }
2151                 if (r->in.site_name) {
2152                         _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2153                         NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
2154                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
2155                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
2156                         size_site_name_1 = ndr_get_array_size(ndr, &r->in.site_name);
2157                         length_site_name_1 = ndr_get_array_length(ndr, &r->in.site_name);
2158                         if (length_site_name_1 > size_site_name_1) {
2159                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_site_name_1, length_site_name_1);
2160                         }
2161                         NDR_CHECK(ndr_check_string_terminator(ndr, length_site_name_1, sizeof(uint8_t)));
2162                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, length_site_name_1, sizeof(uint8_t), CH_UTF8));
2163                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
2164                 }
2165                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
2166                 NDR_PULL_ALLOC(ndr, r->out.dc_info);
2167                 ZERO_STRUCTP(r->out.dc_info);
2168         }
2169         if (flags & NDR_OUT) {
2170                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2171                         NDR_PULL_ALLOC(ndr, r->out.dc_info);
2172                 }
2173                 _mem_save_dc_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
2174                 NDR_PULL_SET_MEM_CTX(ndr, r->out.dc_info, LIBNDR_FLAG_REF_ALLOC);
2175                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_info));
2176                 if (_ptr_dc_info) {
2177                         NDR_PULL_ALLOC(ndr, *r->out.dc_info);
2178                 } else {
2179                         *r->out.dc_info = NULL;
2180                 }
2181                 if (*r->out.dc_info) {
2182                         _mem_save_dc_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
2183                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.dc_info, 0);
2184                         NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
2185                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_1, 0);
2186                 }
2187                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_0, LIBNDR_FLAG_REF_ALLOC);
2188                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2189         }
2190         return NDR_ERR_SUCCESS;
2191 }
2192
2193 _PUBLIC_ void ndr_print_wbint_DsGetDcName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_DsGetDcName *r)
2194 {
2195         ndr_print_struct(ndr, name, "wbint_DsGetDcName");
2196         if (r == NULL) { ndr_print_null(ndr); return; }
2197         ndr->depth++;
2198         if (flags & NDR_SET_VALUES) {
2199                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2200         }
2201         if (flags & NDR_IN) {
2202                 ndr_print_struct(ndr, "in", "wbint_DsGetDcName");
2203                 ndr->depth++;
2204                 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
2205                 ndr->depth++;
2206                 ndr_print_string(ndr, "domain_name", r->in.domain_name);
2207                 ndr->depth--;
2208                 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
2209                 ndr->depth++;
2210                 if (r->in.domain_guid) {
2211                         ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
2212                 }
2213                 ndr->depth--;
2214                 ndr_print_ptr(ndr, "site_name", r->in.site_name);
2215                 ndr->depth++;
2216                 if (r->in.site_name) {
2217                         ndr_print_string(ndr, "site_name", r->in.site_name);
2218                 }
2219                 ndr->depth--;
2220                 ndr_print_uint32(ndr, "flags", r->in.flags);
2221                 ndr->depth--;
2222         }
2223         if (flags & NDR_OUT) {
2224                 ndr_print_struct(ndr, "out", "wbint_DsGetDcName");
2225                 ndr->depth++;
2226                 ndr_print_ptr(ndr, "dc_info", r->out.dc_info);
2227                 ndr->depth++;
2228                 ndr_print_ptr(ndr, "dc_info", *r->out.dc_info);
2229                 ndr->depth++;
2230                 if (*r->out.dc_info) {
2231                         ndr_print_netr_DsRGetDCNameInfo(ndr, "dc_info", *r->out.dc_info);
2232                 }
2233                 ndr->depth--;
2234                 ndr->depth--;
2235                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2236                 ndr->depth--;
2237         }
2238         ndr->depth--;
2239 }
2240
2241 static enum ndr_err_code ndr_push_wbint_LookupRids(struct ndr_push *ndr, int flags, const struct wbint_LookupRids *r)
2242 {
2243         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2244         if (flags & NDR_IN) {
2245                 if (r->in.domain_sid == NULL) {
2246                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2247                 }
2248                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.domain_sid));
2249                 if (r->in.rids == NULL) {
2250                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2251                 }
2252                 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
2253         }
2254         if (flags & NDR_OUT) {
2255                 if (r->out.domain_name == NULL) {
2256                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2257                 }
2258                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain_name));
2259                 if (*r->out.domain_name) {
2260                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain_name, CH_UTF8)));
2261                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2262                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain_name, CH_UTF8)));
2263                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain_name, ndr_charset_length(*r->out.domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
2264                 }
2265                 if (r->out.names == NULL) {
2266                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2267                 }
2268                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
2269                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2270         }
2271         return NDR_ERR_SUCCESS;
2272 }
2273
2274 static enum ndr_err_code ndr_pull_wbint_LookupRids(struct ndr_pull *ndr, int flags, struct wbint_LookupRids *r)
2275 {
2276         uint32_t _ptr_domain_name;
2277         uint32_t size_domain_name_2 = 0;
2278         uint32_t length_domain_name_2 = 0;
2279         TALLOC_CTX *_mem_save_domain_sid_0;
2280         TALLOC_CTX *_mem_save_rids_0;
2281         TALLOC_CTX *_mem_save_domain_name_0;
2282         TALLOC_CTX *_mem_save_domain_name_1;
2283         TALLOC_CTX *_mem_save_names_0;
2284         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2285         if (flags & NDR_IN) {
2286                 ZERO_STRUCT(r->out);
2287
2288                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2289                         NDR_PULL_ALLOC(ndr, r->in.domain_sid);
2290                 }
2291                 _mem_save_domain_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2292                 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_sid, LIBNDR_FLAG_REF_ALLOC);
2293                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.domain_sid));
2294                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_sid_0, LIBNDR_FLAG_REF_ALLOC);
2295                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2296                         NDR_PULL_ALLOC(ndr, r->in.rids);
2297                 }
2298                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2299                 NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, LIBNDR_FLAG_REF_ALLOC);
2300                 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
2301                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
2302                 NDR_PULL_ALLOC(ndr, r->out.domain_name);
2303                 ZERO_STRUCTP(r->out.domain_name);
2304                 NDR_PULL_ALLOC(ndr, r->out.names);
2305                 ZERO_STRUCTP(r->out.names);
2306         }
2307         if (flags & NDR_OUT) {
2308                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2309                         NDR_PULL_ALLOC(ndr, r->out.domain_name);
2310                 }
2311                 _mem_save_domain_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2312                 NDR_PULL_SET_MEM_CTX(ndr, r->out.domain_name, LIBNDR_FLAG_REF_ALLOC);
2313                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_name));
2314                 if (_ptr_domain_name) {
2315                         NDR_PULL_ALLOC(ndr, *r->out.domain_name);
2316                 } else {
2317                         *r->out.domain_name = NULL;
2318                 }
2319                 if (*r->out.domain_name) {
2320                         _mem_save_domain_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
2321                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain_name, 0);
2322                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain_name));
2323                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain_name));
2324                         size_domain_name_2 = ndr_get_array_size(ndr, r->out.domain_name);
2325                         length_domain_name_2 = ndr_get_array_length(ndr, r->out.domain_name);
2326                         if (length_domain_name_2 > size_domain_name_2) {
2327                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_domain_name_2, length_domain_name_2);
2328                         }
2329                         NDR_CHECK(ndr_check_string_terminator(ndr, length_domain_name_2, sizeof(uint8_t)));
2330                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain_name, length_domain_name_2, sizeof(uint8_t), CH_UTF8));
2331                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_1, 0);
2332                 }
2333                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_name_0, LIBNDR_FLAG_REF_ALLOC);
2334                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2335                         NDR_PULL_ALLOC(ndr, r->out.names);
2336                 }
2337                 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
2338                 NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC);
2339                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
2340                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC);
2341                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2342         }
2343         return NDR_ERR_SUCCESS;
2344 }
2345
2346 _PUBLIC_ void ndr_print_wbint_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupRids *r)
2347 {
2348         ndr_print_struct(ndr, name, "wbint_LookupRids");
2349         if (r == NULL) { ndr_print_null(ndr); return; }
2350         ndr->depth++;
2351         if (flags & NDR_SET_VALUES) {
2352                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2353         }
2354         if (flags & NDR_IN) {
2355                 ndr_print_struct(ndr, "in", "wbint_LookupRids");
2356                 ndr->depth++;
2357                 ndr_print_ptr(ndr, "domain_sid", r->in.domain_sid);
2358                 ndr->depth++;
2359                 ndr_print_dom_sid(ndr, "domain_sid", r->in.domain_sid);
2360                 ndr->depth--;
2361                 ndr_print_ptr(ndr, "rids", r->in.rids);
2362                 ndr->depth++;
2363                 ndr_print_wbint_RidArray(ndr, "rids", r->in.rids);
2364                 ndr->depth--;
2365                 ndr->depth--;
2366         }
2367         if (flags & NDR_OUT) {
2368                 ndr_print_struct(ndr, "out", "wbint_LookupRids");
2369                 ndr->depth++;
2370                 ndr_print_ptr(ndr, "domain_name", r->out.domain_name);
2371                 ndr->depth++;
2372                 ndr_print_ptr(ndr, "domain_name", *r->out.domain_name);
2373                 ndr->depth++;
2374                 if (*r->out.domain_name) {
2375                         ndr_print_string(ndr, "domain_name", *r->out.domain_name);
2376                 }
2377                 ndr->depth--;
2378                 ndr->depth--;
2379                 ndr_print_ptr(ndr, "names", r->out.names);
2380                 ndr->depth++;
2381                 ndr_print_wbint_Principals(ndr, "names", r->out.names);
2382                 ndr->depth--;
2383                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2384                 ndr->depth--;
2385         }
2386         ndr->depth--;
2387 }
2388
2389 static enum ndr_err_code ndr_push_wbint_CheckMachineAccount(struct ndr_push *ndr, int flags, const struct wbint_CheckMachineAccount *r)
2390 {
2391         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2392         if (flags & NDR_IN) {
2393         }
2394         if (flags & NDR_OUT) {
2395                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2396         }
2397         return NDR_ERR_SUCCESS;
2398 }
2399
2400 static enum ndr_err_code ndr_pull_wbint_CheckMachineAccount(struct ndr_pull *ndr, int flags, struct wbint_CheckMachineAccount *r)
2401 {
2402         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2403         if (flags & NDR_IN) {
2404         }
2405         if (flags & NDR_OUT) {
2406                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2407         }
2408         return NDR_ERR_SUCCESS;
2409 }
2410
2411 _PUBLIC_ void ndr_print_wbint_CheckMachineAccount(struct ndr_print *ndr, const char *name, int flags, const struct wbint_CheckMachineAccount *r)
2412 {
2413         ndr_print_struct(ndr, name, "wbint_CheckMachineAccount");
2414         if (r == NULL) { ndr_print_null(ndr); return; }
2415         ndr->depth++;
2416         if (flags & NDR_SET_VALUES) {
2417                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2418         }
2419         if (flags & NDR_IN) {
2420                 ndr_print_struct(ndr, "in", "wbint_CheckMachineAccount");
2421                 ndr->depth++;
2422                 ndr->depth--;
2423         }
2424         if (flags & NDR_OUT) {
2425                 ndr_print_struct(ndr, "out", "wbint_CheckMachineAccount");
2426                 ndr->depth++;
2427                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2428                 ndr->depth--;
2429         }
2430         ndr->depth--;
2431 }
2432
2433 static enum ndr_err_code ndr_push_wbint_ChangeMachineAccount(struct ndr_push *ndr, int flags, const struct wbint_ChangeMachineAccount *r)
2434 {
2435         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2436         if (flags & NDR_IN) {
2437         }
2438         if (flags & NDR_OUT) {
2439                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2440         }
2441         return NDR_ERR_SUCCESS;
2442 }
2443
2444 static enum ndr_err_code ndr_pull_wbint_ChangeMachineAccount(struct ndr_pull *ndr, int flags, struct wbint_ChangeMachineAccount *r)
2445 {
2446         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2447         if (flags & NDR_IN) {
2448         }
2449         if (flags & NDR_OUT) {
2450                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2451         }
2452         return NDR_ERR_SUCCESS;
2453 }
2454
2455 _PUBLIC_ void ndr_print_wbint_ChangeMachineAccount(struct ndr_print *ndr, const char *name, int flags, const struct wbint_ChangeMachineAccount *r)
2456 {
2457         ndr_print_struct(ndr, name, "wbint_ChangeMachineAccount");
2458         if (r == NULL) { ndr_print_null(ndr); return; }
2459         ndr->depth++;
2460         if (flags & NDR_SET_VALUES) {
2461                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2462         }
2463         if (flags & NDR_IN) {
2464                 ndr_print_struct(ndr, "in", "wbint_ChangeMachineAccount");
2465                 ndr->depth++;
2466                 ndr->depth--;
2467         }
2468         if (flags & NDR_OUT) {
2469                 ndr_print_struct(ndr, "out", "wbint_ChangeMachineAccount");
2470                 ndr->depth++;
2471                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2472                 ndr->depth--;
2473         }
2474         ndr->depth--;
2475 }
2476
2477 static enum ndr_err_code ndr_push_wbint_PingDc(struct ndr_push *ndr, int flags, const struct wbint_PingDc *r)
2478 {
2479         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
2480         if (flags & NDR_IN) {
2481         }
2482         if (flags & NDR_OUT) {
2483                 if (r->out.dcname == NULL) {
2484                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2485                 }
2486                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dcname));
2487                 if (*r->out.dcname) {
2488                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF8)));
2489                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
2490                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(*r->out.dcname, CH_UTF8)));
2491                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.dcname, ndr_charset_length(*r->out.dcname, CH_UTF8), sizeof(uint8_t), CH_UTF8));
2492                 }
2493                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2494         }
2495         return NDR_ERR_SUCCESS;
2496 }
2497
2498 static enum ndr_err_code ndr_pull_wbint_PingDc(struct ndr_pull *ndr, int flags, struct wbint_PingDc *r)
2499 {
2500         uint32_t _ptr_dcname;
2501         uint32_t size_dcname_2 = 0;
2502         uint32_t length_dcname_2 = 0;
2503         TALLOC_CTX *_mem_save_dcname_0;
2504         TALLOC_CTX *_mem_save_dcname_1;
2505         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
2506         if (flags & NDR_IN) {
2507                 ZERO_STRUCT(r->out);
2508
2509                 NDR_PULL_ALLOC(ndr, r->out.dcname);
2510                 ZERO_STRUCTP(r->out.dcname);
2511         }
2512         if (flags & NDR_OUT) {
2513                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2514                         NDR_PULL_ALLOC(ndr, r->out.dcname);
2515                 }
2516                 _mem_save_dcname_0 = NDR_PULL_GET_MEM_CTX(ndr);
2517                 NDR_PULL_SET_MEM_CTX(ndr, r->out.dcname, LIBNDR_FLAG_REF_ALLOC);
2518                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dcname));
2519                 if (_ptr_dcname) {
2520                         NDR_PULL_ALLOC(ndr, *r->out.dcname);
2521                 } else {
2522                         *r->out.dcname = NULL;
2523                 }
2524                 if (*r->out.dcname) {
2525                         _mem_save_dcname_1 = NDR_PULL_GET_MEM_CTX(ndr);
2526                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.dcname, 0);
2527                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.dcname));
2528                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.dcname));
2529                         size_dcname_2 = ndr_get_array_size(ndr, r->out.dcname);
2530                         length_dcname_2 = ndr_get_array_length(ndr, r->out.dcname);
2531                         if (length_dcname_2 > size_dcname_2) {
2532                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_dcname_2, length_dcname_2);
2533                         }
2534                         NDR_CHECK(ndr_check_string_terminator(ndr, length_dcname_2, sizeof(uint8_t)));
2535                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.dcname, length_dcname_2, sizeof(uint8_t), CH_UTF8));
2536                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_1, 0);
2537                 }
2538                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dcname_0, LIBNDR_FLAG_REF_ALLOC);
2539                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2540         }
2541         return NDR_ERR_SUCCESS;
2542 }
2543
2544 _PUBLIC_ void ndr_print_wbint_PingDc(struct ndr_print *ndr, const char *name, int flags, const struct wbint_PingDc *r)
2545 {
2546         ndr_print_struct(ndr, name, "wbint_PingDc");
2547         if (r == NULL) { ndr_print_null(ndr); return; }
2548         ndr->depth++;
2549         if (flags & NDR_SET_VALUES) {
2550                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2551         }
2552         if (flags & NDR_IN) {
2553                 ndr_print_struct(ndr, "in", "wbint_PingDc");
2554                 ndr->depth++;
2555                 ndr->depth--;
2556         }
2557         if (flags & NDR_OUT) {
2558                 ndr_print_struct(ndr, "out", "wbint_PingDc");
2559                 ndr->depth++;
2560                 ndr_print_ptr(ndr, "dcname", r->out.dcname);
2561                 ndr->depth++;
2562                 ndr_print_ptr(ndr, "dcname", *r->out.dcname);
2563                 ndr->depth++;
2564                 if (*r->out.dcname) {
2565                         ndr_print_string(ndr, "dcname", *r->out.dcname);
2566                 }
2567                 ndr->depth--;
2568                 ndr->depth--;
2569                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2570                 ndr->depth--;
2571         }
2572         ndr->depth--;
2573 }
2574
2575 static const struct ndr_interface_call wbint_calls[] = {
2576         {
2577                 "wbint_Ping",
2578                 sizeof(struct wbint_Ping),
2579                 (ndr_push_flags_fn_t) ndr_push_wbint_Ping,
2580                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping,
2581                 (ndr_print_function_t) ndr_print_wbint_Ping,
2582                 { 0, NULL },
2583                 { 0, NULL },
2584         },
2585         {
2586                 "wbint_LookupSid",
2587                 sizeof(struct wbint_LookupSid),
2588                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid,
2589                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid,
2590                 (ndr_print_function_t) ndr_print_wbint_LookupSid,
2591                 { 0, NULL },
2592                 { 0, NULL },
2593         },
2594         {
2595                 "wbint_LookupSids",
2596                 sizeof(struct wbint_LookupSids),
2597                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupSids,
2598                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSids,
2599                 (ndr_print_function_t) ndr_print_wbint_LookupSids,
2600                 { 0, NULL },
2601                 { 0, NULL },
2602         },
2603         {
2604                 "wbint_LookupName",
2605                 sizeof(struct wbint_LookupName),
2606                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupName,
2607                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName,
2608                 (ndr_print_function_t) ndr_print_wbint_LookupName,
2609                 { 0, NULL },
2610                 { 0, NULL },
2611         },
2612         {
2613                 "wbint_Sids2UnixIDs",
2614                 sizeof(struct wbint_Sids2UnixIDs),
2615                 (ndr_push_flags_fn_t) ndr_push_wbint_Sids2UnixIDs,
2616                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sids2UnixIDs,
2617                 (ndr_print_function_t) ndr_print_wbint_Sids2UnixIDs,
2618                 { 0, NULL },
2619                 { 0, NULL },
2620         },
2621         {
2622                 "wbint_Uid2Sid",
2623                 sizeof(struct wbint_Uid2Sid),
2624                 (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid,
2625                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid,
2626                 (ndr_print_function_t) ndr_print_wbint_Uid2Sid,
2627                 { 0, NULL },
2628                 { 0, NULL },
2629         },
2630         {
2631                 "wbint_Gid2Sid",
2632                 sizeof(struct wbint_Gid2Sid),
2633                 (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid,
2634                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid,
2635                 (ndr_print_function_t) ndr_print_wbint_Gid2Sid,
2636                 { 0, NULL },
2637                 { 0, NULL },
2638         },
2639         {
2640                 "wbint_AllocateUid",
2641                 sizeof(struct wbint_AllocateUid),
2642                 (ndr_push_flags_fn_t) ndr_push_wbint_AllocateUid,
2643                 (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateUid,
2644                 (ndr_print_function_t) ndr_print_wbint_AllocateUid,
2645                 { 0, NULL },
2646                 { 0, NULL },
2647         },
2648         {
2649                 "wbint_AllocateGid",
2650                 sizeof(struct wbint_AllocateGid),
2651                 (ndr_push_flags_fn_t) ndr_push_wbint_AllocateGid,
2652                 (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateGid,
2653                 (ndr_print_function_t) ndr_print_wbint_AllocateGid,
2654                 { 0, NULL },
2655                 { 0, NULL },
2656         },
2657         {
2658                 "wbint_QueryUser",
2659                 sizeof(struct wbint_QueryUser),
2660                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser,
2661                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser,
2662                 (ndr_print_function_t) ndr_print_wbint_QueryUser,
2663                 { 0, NULL },
2664                 { 0, NULL },
2665         },
2666         {
2667                 "wbint_LookupUserAliases",
2668                 sizeof(struct wbint_LookupUserAliases),
2669                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases,
2670                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases,
2671                 (ndr_print_function_t) ndr_print_wbint_LookupUserAliases,
2672                 { 0, NULL },
2673                 { 0, NULL },
2674         },
2675         {
2676                 "wbint_LookupUserGroups",
2677                 sizeof(struct wbint_LookupUserGroups),
2678                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups,
2679                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups,
2680                 (ndr_print_function_t) ndr_print_wbint_LookupUserGroups,
2681                 { 0, NULL },
2682                 { 0, NULL },
2683         },
2684         {
2685                 "wbint_QuerySequenceNumber",
2686                 sizeof(struct wbint_QuerySequenceNumber),
2687                 (ndr_push_flags_fn_t) ndr_push_wbint_QuerySequenceNumber,
2688                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QuerySequenceNumber,
2689                 (ndr_print_function_t) ndr_print_wbint_QuerySequenceNumber,
2690                 { 0, NULL },
2691                 { 0, NULL },
2692         },
2693         {
2694                 "wbint_LookupGroupMembers",
2695                 sizeof(struct wbint_LookupGroupMembers),
2696                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupGroupMembers,
2697                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupGroupMembers,
2698                 (ndr_print_function_t) ndr_print_wbint_LookupGroupMembers,
2699                 { 0, NULL },
2700                 { 0, NULL },
2701         },
2702         {
2703                 "wbint_QueryUserList",
2704                 sizeof(struct wbint_QueryUserList),
2705                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUserList,
2706                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUserList,
2707                 (ndr_print_function_t) ndr_print_wbint_QueryUserList,
2708                 { 0, NULL },
2709                 { 0, NULL },
2710         },
2711         {
2712                 "wbint_QueryGroupList",
2713                 sizeof(struct wbint_QueryGroupList),
2714                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryGroupList,
2715                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryGroupList,
2716                 (ndr_print_function_t) ndr_print_wbint_QueryGroupList,
2717                 { 0, NULL },
2718                 { 0, NULL },
2719         },
2720         {
2721                 "wbint_DsGetDcName",
2722                 sizeof(struct wbint_DsGetDcName),
2723                 (ndr_push_flags_fn_t) ndr_push_wbint_DsGetDcName,
2724                 (ndr_pull_flags_fn_t) ndr_pull_wbint_DsGetDcName,
2725                 (ndr_print_function_t) ndr_print_wbint_DsGetDcName,
2726                 { 0, NULL },
2727                 { 0, NULL },
2728         },
2729         {
2730                 "wbint_LookupRids",
2731                 sizeof(struct wbint_LookupRids),
2732                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupRids,
2733                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupRids,
2734                 (ndr_print_function_t) ndr_print_wbint_LookupRids,
2735                 { 0, NULL },
2736                 { 0, NULL },
2737         },
2738         {
2739                 "wbint_CheckMachineAccount",
2740                 sizeof(struct wbint_CheckMachineAccount),
2741                 (ndr_push_flags_fn_t) ndr_push_wbint_CheckMachineAccount,
2742                 (ndr_pull_flags_fn_t) ndr_pull_wbint_CheckMachineAccount,
2743                 (ndr_print_function_t) ndr_print_wbint_CheckMachineAccount,
2744                 { 0, NULL },
2745                 { 0, NULL },
2746         },
2747         {
2748                 "wbint_ChangeMachineAccount",
2749                 sizeof(struct wbint_ChangeMachineAccount),
2750                 (ndr_push_flags_fn_t) ndr_push_wbint_ChangeMachineAccount,
2751                 (ndr_pull_flags_fn_t) ndr_pull_wbint_ChangeMachineAccount,
2752                 (ndr_print_function_t) ndr_print_wbint_ChangeMachineAccount,
2753                 { 0, NULL },
2754                 { 0, NULL },
2755         },
2756         {
2757                 "wbint_PingDc",
2758                 sizeof(struct wbint_PingDc),
2759                 (ndr_push_flags_fn_t) ndr_push_wbint_PingDc,
2760                 (ndr_pull_flags_fn_t) ndr_pull_wbint_PingDc,
2761                 (ndr_print_function_t) ndr_print_wbint_PingDc,
2762                 { 0, NULL },
2763                 { 0, NULL },
2764         },
2765         { NULL, 0, NULL, NULL, NULL }
2766 };
2767
2768 static const char * const wbint_endpoint_strings[] = {
2769         "ncalrpc:", 
2770 };
2771
2772 static const struct ndr_interface_string_array wbint_endpoints = {
2773         .count  = 1,
2774         .names  = wbint_endpoint_strings
2775 };
2776
2777 static const char * const wbint_authservice_strings[] = {
2778         "host", 
2779 };
2780
2781 static const struct ndr_interface_string_array wbint_authservices = {
2782         .count  = 1,
2783         .names  = wbint_authservice_strings
2784 };
2785
2786
2787 const struct ndr_interface_table ndr_table_wbint = {
2788         .name           = "wbint",
2789         .syntax_id      = {
2790                 {0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}},
2791                 NDR_WBINT_VERSION
2792         },
2793         .helpstring     = NDR_WBINT_HELPSTRING,
2794         .num_calls      = 21,
2795         .calls          = wbint_calls,
2796         .endpoints      = &wbint_endpoints,
2797         .authservices   = &wbint_authservices
2798 };
2799