1476e06e759d366ab4e820369a5ad49851169ff7
[ira/wip.git] / source3 / librpc / gen_ndr / ndr_wbint.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_wbint.h"
5
6 #include "librpc/gen_ndr/ndr_lsa.h"
7 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfo(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfo *r)
8 {
9         if (ndr_flags & NDR_SCALARS) {
10                 NDR_CHECK(ndr_push_align(ndr, 8));
11                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->acct_name));
12                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->full_name));
13                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir));
14                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell));
15                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->primary_gid));
16                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
17                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
18         }
19         if (ndr_flags & NDR_BUFFERS) {
20                 if (r->acct_name) {
21                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
22                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
23                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->acct_name, CH_UTF8)));
24                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->acct_name, ndr_charset_length(r->acct_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
25                 }
26                 if (r->full_name) {
27                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
28                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
29                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->full_name, CH_UTF8)));
30                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->full_name, ndr_charset_length(r->full_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
31                 }
32                 if (r->homedir) {
33                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
34                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
35                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
36                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
37                 }
38                 if (r->shell) {
39                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
40                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
41                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
42                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
43                 }
44         }
45         return NDR_ERR_SUCCESS;
46 }
47
48 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r)
49 {
50         uint32_t _ptr_acct_name;
51         TALLOC_CTX *_mem_save_acct_name_0;
52         uint32_t _ptr_full_name;
53         TALLOC_CTX *_mem_save_full_name_0;
54         uint32_t _ptr_homedir;
55         TALLOC_CTX *_mem_save_homedir_0;
56         uint32_t _ptr_shell;
57         TALLOC_CTX *_mem_save_shell_0;
58         if (ndr_flags & NDR_SCALARS) {
59                 NDR_CHECK(ndr_pull_align(ndr, 8));
60                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_acct_name));
61                 if (_ptr_acct_name) {
62                         NDR_PULL_ALLOC(ndr, r->acct_name);
63                 } else {
64                         r->acct_name = NULL;
65                 }
66                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_full_name));
67                 if (_ptr_full_name) {
68                         NDR_PULL_ALLOC(ndr, r->full_name);
69                 } else {
70                         r->full_name = NULL;
71                 }
72                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
73                 if (_ptr_homedir) {
74                         NDR_PULL_ALLOC(ndr, r->homedir);
75                 } else {
76                         r->homedir = NULL;
77                 }
78                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
79                 if (_ptr_shell) {
80                         NDR_PULL_ALLOC(ndr, r->shell);
81                 } else {
82                         r->shell = NULL;
83                 }
84                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->primary_gid));
85                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->user_sid));
86                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->group_sid));
87         }
88         if (ndr_flags & NDR_BUFFERS) {
89                 if (r->acct_name) {
90                         _mem_save_acct_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
91                         NDR_PULL_SET_MEM_CTX(ndr, r->acct_name, 0);
92                         NDR_CHECK(ndr_pull_array_size(ndr, &r->acct_name));
93                         NDR_CHECK(ndr_pull_array_length(ndr, &r->acct_name));
94                         if (ndr_get_array_length(ndr, &r->acct_name) > ndr_get_array_size(ndr, &r->acct_name)) {
95                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->acct_name), ndr_get_array_length(ndr, &r->acct_name));
96                         }
97                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t)));
98                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->acct_name, ndr_get_array_length(ndr, &r->acct_name), sizeof(uint8_t), CH_UTF8));
99                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acct_name_0, 0);
100                 }
101                 if (r->full_name) {
102                         _mem_save_full_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
103                         NDR_PULL_SET_MEM_CTX(ndr, r->full_name, 0);
104                         NDR_CHECK(ndr_pull_array_size(ndr, &r->full_name));
105                         NDR_CHECK(ndr_pull_array_length(ndr, &r->full_name));
106                         if (ndr_get_array_length(ndr, &r->full_name) > ndr_get_array_size(ndr, &r->full_name)) {
107                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->full_name), ndr_get_array_length(ndr, &r->full_name));
108                         }
109                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t)));
110                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->full_name, ndr_get_array_length(ndr, &r->full_name), sizeof(uint8_t), CH_UTF8));
111                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_full_name_0, 0);
112                 }
113                 if (r->homedir) {
114                         _mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr);
115                         NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0);
116                         NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
117                         NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
118                         if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) {
119                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->homedir), ndr_get_array_length(ndr, &r->homedir));
120                         }
121                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t)));
122                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8));
123                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0);
124                 }
125                 if (r->shell) {
126                         _mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr);
127                         NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0);
128                         NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
129                         NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
130                         if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) {
131                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->shell), ndr_get_array_length(ndr, &r->shell));
132                         }
133                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t)));
134                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8));
135                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0);
136                 }
137         }
138         return NDR_ERR_SUCCESS;
139 }
140
141 _PUBLIC_ void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r)
142 {
143         ndr_print_struct(ndr, name, "wbint_userinfo");
144         ndr->depth++;
145         ndr_print_ptr(ndr, "acct_name", r->acct_name);
146         ndr->depth++;
147         if (r->acct_name) {
148                 ndr_print_string(ndr, "acct_name", r->acct_name);
149         }
150         ndr->depth--;
151         ndr_print_ptr(ndr, "full_name", r->full_name);
152         ndr->depth++;
153         if (r->full_name) {
154                 ndr_print_string(ndr, "full_name", r->full_name);
155         }
156         ndr->depth--;
157         ndr_print_ptr(ndr, "homedir", r->homedir);
158         ndr->depth++;
159         if (r->homedir) {
160                 ndr_print_string(ndr, "homedir", r->homedir);
161         }
162         ndr->depth--;
163         ndr_print_ptr(ndr, "shell", r->shell);
164         ndr->depth++;
165         if (r->shell) {
166                 ndr_print_string(ndr, "shell", r->shell);
167         }
168         ndr->depth--;
169         ndr_print_hyper(ndr, "primary_gid", r->primary_gid);
170         ndr_print_dom_sid(ndr, "user_sid", &r->user_sid);
171         ndr_print_dom_sid(ndr, "group_sid", &r->group_sid);
172         ndr->depth--;
173 }
174
175 _PUBLIC_ enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r)
176 {
177         uint32_t cntr_sids_0;
178         if (ndr_flags & NDR_SCALARS) {
179                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
180                 NDR_CHECK(ndr_push_align(ndr, 4));
181                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_sids));
182                 for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) {
183                         NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
184                 }
185         }
186         if (ndr_flags & NDR_BUFFERS) {
187         }
188         return NDR_ERR_SUCCESS;
189 }
190
191 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r)
192 {
193         uint32_t cntr_sids_0;
194         TALLOC_CTX *_mem_save_sids_0;
195         if (ndr_flags & NDR_SCALARS) {
196                 NDR_CHECK(ndr_pull_array_size(ndr, &r->sids));
197                 NDR_CHECK(ndr_pull_align(ndr, 4));
198                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_sids));
199                 NDR_PULL_ALLOC_N(ndr, r->sids, ndr_get_array_size(ndr, &r->sids));
200                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
201                 NDR_PULL_SET_MEM_CTX(ndr, r->sids, 0);
202                 for (cntr_sids_0 = 0; cntr_sids_0 < r->num_sids; cntr_sids_0++) {
203                         NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sids[cntr_sids_0]));
204                 }
205                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, 0);
206                 if (r->sids) {
207                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->sids, r->num_sids));
208                 }
209         }
210         if (ndr_flags & NDR_BUFFERS) {
211         }
212         return NDR_ERR_SUCCESS;
213 }
214
215 _PUBLIC_ void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r)
216 {
217         uint32_t cntr_sids_0;
218         ndr_print_struct(ndr, name, "wbint_SidArray");
219         ndr->depth++;
220         ndr_print_uint32(ndr, "num_sids", r->num_sids);
221         ndr->print(ndr, "%s: ARRAY(%d)", "sids", (int)r->num_sids);
222         ndr->depth++;
223         for (cntr_sids_0=0;cntr_sids_0<r->num_sids;cntr_sids_0++) {
224                 char *idx_0=NULL;
225                 if (asprintf(&idx_0, "[%d]", cntr_sids_0) != -1) {
226                         ndr_print_dom_sid(ndr, "sids", &r->sids[cntr_sids_0]);
227                         free(idx_0);
228                 }
229         }
230         ndr->depth--;
231         ndr->depth--;
232 }
233
234 _PUBLIC_ enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r)
235 {
236         uint32_t cntr_rids_0;
237         if (ndr_flags & NDR_SCALARS) {
238                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
239                 NDR_CHECK(ndr_push_align(ndr, 4));
240                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_rids));
241                 for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) {
242                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->rids[cntr_rids_0]));
243                 }
244         }
245         if (ndr_flags & NDR_BUFFERS) {
246         }
247         return NDR_ERR_SUCCESS;
248 }
249
250 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r)
251 {
252         uint32_t cntr_rids_0;
253         TALLOC_CTX *_mem_save_rids_0;
254         if (ndr_flags & NDR_SCALARS) {
255                 NDR_CHECK(ndr_pull_array_size(ndr, &r->rids));
256                 NDR_CHECK(ndr_pull_align(ndr, 4));
257                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_rids));
258                 NDR_PULL_ALLOC_N(ndr, r->rids, ndr_get_array_size(ndr, &r->rids));
259                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
260                 NDR_PULL_SET_MEM_CTX(ndr, r->rids, 0);
261                 for (cntr_rids_0 = 0; cntr_rids_0 < r->num_rids; cntr_rids_0++) {
262                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->rids[cntr_rids_0]));
263                 }
264                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, 0);
265                 if (r->rids) {
266                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->rids, r->num_rids));
267                 }
268         }
269         if (ndr_flags & NDR_BUFFERS) {
270         }
271         return NDR_ERR_SUCCESS;
272 }
273
274 _PUBLIC_ void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r)
275 {
276         uint32_t cntr_rids_0;
277         ndr_print_struct(ndr, name, "wbint_RidArray");
278         ndr->depth++;
279         ndr_print_uint32(ndr, "num_rids", r->num_rids);
280         ndr->print(ndr, "%s: ARRAY(%d)", "rids", (int)r->num_rids);
281         ndr->depth++;
282         for (cntr_rids_0=0;cntr_rids_0<r->num_rids;cntr_rids_0++) {
283                 char *idx_0=NULL;
284                 if (asprintf(&idx_0, "[%d]", cntr_rids_0) != -1) {
285                         ndr_print_uint32(ndr, "rids", r->rids[cntr_rids_0]);
286                         free(idx_0);
287                 }
288         }
289         ndr->depth--;
290         ndr->depth--;
291 }
292
293 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principal(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principal *r)
294 {
295         if (ndr_flags & NDR_SCALARS) {
296                 NDR_CHECK(ndr_push_align(ndr, 4));
297                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
298                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->type));
299                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
300         }
301         if (ndr_flags & NDR_BUFFERS) {
302                 if (r->name) {
303                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
304                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
305                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
306                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
307                 }
308         }
309         return NDR_ERR_SUCCESS;
310 }
311
312 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principal(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principal *r)
313 {
314         uint32_t _ptr_name;
315         TALLOC_CTX *_mem_save_name_0;
316         if (ndr_flags & NDR_SCALARS) {
317                 NDR_CHECK(ndr_pull_align(ndr, 4));
318                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sid));
319                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->type));
320                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
321                 if (_ptr_name) {
322                         NDR_PULL_ALLOC(ndr, r->name);
323                 } else {
324                         r->name = NULL;
325                 }
326         }
327         if (ndr_flags & NDR_BUFFERS) {
328                 if (r->name) {
329                         _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
330                         NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
331                         NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
332                         NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
333                         if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
334                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
335                         }
336                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t)));
337                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t), CH_UTF8));
338                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
339                 }
340         }
341         return NDR_ERR_SUCCESS;
342 }
343
344 _PUBLIC_ void ndr_print_wbint_Principal(struct ndr_print *ndr, const char *name, const struct wbint_Principal *r)
345 {
346         ndr_print_struct(ndr, name, "wbint_Principal");
347         ndr->depth++;
348         ndr_print_dom_sid(ndr, "sid", &r->sid);
349         ndr_print_lsa_SidType(ndr, "type", r->type);
350         ndr_print_ptr(ndr, "name", r->name);
351         ndr->depth++;
352         if (r->name) {
353                 ndr_print_string(ndr, "name", r->name);
354         }
355         ndr->depth--;
356         ndr->depth--;
357 }
358
359 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principals(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principals *r)
360 {
361         uint32_t cntr_principals_0;
362         if (ndr_flags & NDR_SCALARS) {
363                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_principals));
364                 NDR_CHECK(ndr_push_align(ndr, 4));
365                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->num_principals));
366                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
367                         NDR_CHECK(ndr_push_wbint_Principal(ndr, NDR_SCALARS, &r->principals[cntr_principals_0]));
368                 }
369         }
370         if (ndr_flags & NDR_BUFFERS) {
371                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
372                         NDR_CHECK(ndr_push_wbint_Principal(ndr, NDR_BUFFERS, &r->principals[cntr_principals_0]));
373                 }
374         }
375         return NDR_ERR_SUCCESS;
376 }
377
378 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principals(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principals *r)
379 {
380         uint32_t cntr_principals_0;
381         TALLOC_CTX *_mem_save_principals_0;
382         if (ndr_flags & NDR_SCALARS) {
383                 NDR_CHECK(ndr_pull_array_size(ndr, &r->principals));
384                 NDR_CHECK(ndr_pull_align(ndr, 4));
385                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->num_principals));
386                 NDR_PULL_ALLOC_N(ndr, r->principals, ndr_get_array_size(ndr, &r->principals));
387                 _mem_save_principals_0 = NDR_PULL_GET_MEM_CTX(ndr);
388                 NDR_PULL_SET_MEM_CTX(ndr, r->principals, 0);
389                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
390                         NDR_CHECK(ndr_pull_wbint_Principal(ndr, NDR_SCALARS, &r->principals[cntr_principals_0]));
391                 }
392                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_principals_0, 0);
393                 if (r->principals) {
394                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->principals, r->num_principals));
395                 }
396         }
397         if (ndr_flags & NDR_BUFFERS) {
398                 _mem_save_principals_0 = NDR_PULL_GET_MEM_CTX(ndr);
399                 NDR_PULL_SET_MEM_CTX(ndr, r->principals, 0);
400                 for (cntr_principals_0 = 0; cntr_principals_0 < r->num_principals; cntr_principals_0++) {
401                         NDR_CHECK(ndr_pull_wbint_Principal(ndr, NDR_BUFFERS, &r->principals[cntr_principals_0]));
402                 }
403                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_principals_0, 0);
404         }
405         return NDR_ERR_SUCCESS;
406 }
407
408 _PUBLIC_ void ndr_print_wbint_Principals(struct ndr_print *ndr, const char *name, const struct wbint_Principals *r)
409 {
410         uint32_t cntr_principals_0;
411         ndr_print_struct(ndr, name, "wbint_Principals");
412         ndr->depth++;
413         ndr_print_int32(ndr, "num_principals", r->num_principals);
414         ndr->print(ndr, "%s: ARRAY(%d)", "principals", (int)r->num_principals);
415         ndr->depth++;
416         for (cntr_principals_0=0;cntr_principals_0<r->num_principals;cntr_principals_0++) {
417                 char *idx_0=NULL;
418                 if (asprintf(&idx_0, "[%d]", cntr_principals_0) != -1) {
419                         ndr_print_wbint_Principal(ndr, "principals", &r->principals[cntr_principals_0]);
420                         free(idx_0);
421                 }
422         }
423         ndr->depth--;
424         ndr->depth--;
425 }
426
427 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfos(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfos *r)
428 {
429         uint32_t cntr_userinfos_0;
430         if (ndr_flags & NDR_SCALARS) {
431                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_userinfos));
432                 NDR_CHECK(ndr_push_align(ndr, 8));
433                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_userinfos));
434                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
435                         NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS, &r->userinfos[cntr_userinfos_0]));
436                 }
437         }
438         if (ndr_flags & NDR_BUFFERS) {
439                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
440                         NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_BUFFERS, &r->userinfos[cntr_userinfos_0]));
441                 }
442         }
443         return NDR_ERR_SUCCESS;
444 }
445
446 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfos(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfos *r)
447 {
448         uint32_t cntr_userinfos_0;
449         TALLOC_CTX *_mem_save_userinfos_0;
450         if (ndr_flags & NDR_SCALARS) {
451                 NDR_CHECK(ndr_pull_array_size(ndr, &r->userinfos));
452                 NDR_CHECK(ndr_pull_align(ndr, 8));
453                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_userinfos));
454                 NDR_PULL_ALLOC_N(ndr, r->userinfos, ndr_get_array_size(ndr, &r->userinfos));
455                 _mem_save_userinfos_0 = NDR_PULL_GET_MEM_CTX(ndr);
456                 NDR_PULL_SET_MEM_CTX(ndr, r->userinfos, 0);
457                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
458                         NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS, &r->userinfos[cntr_userinfos_0]));
459                 }
460                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userinfos_0, 0);
461                 if (r->userinfos) {
462                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->userinfos, r->num_userinfos));
463                 }
464         }
465         if (ndr_flags & NDR_BUFFERS) {
466                 _mem_save_userinfos_0 = NDR_PULL_GET_MEM_CTX(ndr);
467                 NDR_PULL_SET_MEM_CTX(ndr, r->userinfos, 0);
468                 for (cntr_userinfos_0 = 0; cntr_userinfos_0 < r->num_userinfos; cntr_userinfos_0++) {
469                         NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_BUFFERS, &r->userinfos[cntr_userinfos_0]));
470                 }
471                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userinfos_0, 0);
472         }
473         return NDR_ERR_SUCCESS;
474 }
475
476 _PUBLIC_ void ndr_print_wbint_userinfos(struct ndr_print *ndr, const char *name, const struct wbint_userinfos *r)
477 {
478         uint32_t cntr_userinfos_0;
479         ndr_print_struct(ndr, name, "wbint_userinfos");
480         ndr->depth++;
481         ndr_print_uint32(ndr, "num_userinfos", r->num_userinfos);
482         ndr->print(ndr, "%s: ARRAY(%d)", "userinfos", (int)r->num_userinfos);
483         ndr->depth++;
484         for (cntr_userinfos_0=0;cntr_userinfos_0<r->num_userinfos;cntr_userinfos_0++) {
485                 char *idx_0=NULL;
486                 if (asprintf(&idx_0, "[%d]", cntr_userinfos_0) != -1) {
487                         ndr_print_wbint_userinfo(ndr, "userinfos", &r->userinfos[cntr_userinfos_0]);
488                         free(idx_0);
489                 }
490         }
491         ndr->depth--;
492         ndr->depth--;
493 }
494
495 static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r)
496 {
497         if (flags & NDR_IN) {
498                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
499         }
500         if (flags & NDR_OUT) {
501                 if (r->out.out_data == NULL) {
502                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
503                 }
504                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
505         }
506         return NDR_ERR_SUCCESS;
507 }
508
509 static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r)
510 {
511         TALLOC_CTX *_mem_save_out_data_0;
512         if (flags & NDR_IN) {
513                 ZERO_STRUCT(r->out);
514
515                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
516                 NDR_PULL_ALLOC(ndr, r->out.out_data);
517                 ZERO_STRUCTP(r->out.out_data);
518         }
519         if (flags & NDR_OUT) {
520                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
521                         NDR_PULL_ALLOC(ndr, r->out.out_data);
522                 }
523                 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
524                 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
525                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
526                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
527         }
528         return NDR_ERR_SUCCESS;
529 }
530
531 _PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r)
532 {
533         ndr_print_struct(ndr, name, "wbint_Ping");
534         ndr->depth++;
535         if (flags & NDR_SET_VALUES) {
536                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
537         }
538         if (flags & NDR_IN) {
539                 ndr_print_struct(ndr, "in", "wbint_Ping");
540                 ndr->depth++;
541                 ndr_print_uint32(ndr, "in_data", r->in.in_data);
542                 ndr->depth--;
543         }
544         if (flags & NDR_OUT) {
545                 ndr_print_struct(ndr, "out", "wbint_Ping");
546                 ndr->depth++;
547                 ndr_print_ptr(ndr, "out_data", r->out.out_data);
548                 ndr->depth++;
549                 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
550                 ndr->depth--;
551                 ndr->depth--;
552         }
553         ndr->depth--;
554 }
555
556 static enum ndr_err_code ndr_push_wbint_LookupSid(struct ndr_push *ndr, int flags, const struct wbint_LookupSid *r)
557 {
558         if (flags & NDR_IN) {
559                 if (r->in.sid == NULL) {
560                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
561                 }
562                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
563         }
564         if (flags & NDR_OUT) {
565                 if (r->out.type == NULL) {
566                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
567                 }
568                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
569                 if (r->out.domain == NULL) {
570                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
571                 }
572                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain));
573                 if (*r->out.domain) {
574                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
575                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
576                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
577                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain, ndr_charset_length(*r->out.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
578                 }
579                 if (r->out.name == NULL) {
580                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
581                 }
582                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name));
583                 if (*r->out.name) {
584                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
585                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
586                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
587                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name, ndr_charset_length(*r->out.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
588                 }
589                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
590         }
591         return NDR_ERR_SUCCESS;
592 }
593
594 static enum ndr_err_code ndr_pull_wbint_LookupSid(struct ndr_pull *ndr, int flags, struct wbint_LookupSid *r)
595 {
596         uint32_t _ptr_domain;
597         uint32_t _ptr_name;
598         TALLOC_CTX *_mem_save_sid_0;
599         TALLOC_CTX *_mem_save_type_0;
600         TALLOC_CTX *_mem_save_domain_0;
601         TALLOC_CTX *_mem_save_domain_1;
602         TALLOC_CTX *_mem_save_name_0;
603         TALLOC_CTX *_mem_save_name_1;
604         if (flags & NDR_IN) {
605                 ZERO_STRUCT(r->out);
606
607                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
608                         NDR_PULL_ALLOC(ndr, r->in.sid);
609                 }
610                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
611                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
612                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
613                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
614                 NDR_PULL_ALLOC(ndr, r->out.type);
615                 ZERO_STRUCTP(r->out.type);
616                 NDR_PULL_ALLOC(ndr, r->out.domain);
617                 ZERO_STRUCTP(r->out.domain);
618                 NDR_PULL_ALLOC(ndr, r->out.name);
619                 ZERO_STRUCTP(r->out.name);
620         }
621         if (flags & NDR_OUT) {
622                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
623                         NDR_PULL_ALLOC(ndr, r->out.type);
624                 }
625                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
626                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
627                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
628                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
629                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
630                         NDR_PULL_ALLOC(ndr, r->out.domain);
631                 }
632                 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
633                 NDR_PULL_SET_MEM_CTX(ndr, r->out.domain, LIBNDR_FLAG_REF_ALLOC);
634                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
635                 if (_ptr_domain) {
636                         NDR_PULL_ALLOC(ndr, *r->out.domain);
637                 } else {
638                         *r->out.domain = NULL;
639                 }
640                 if (*r->out.domain) {
641                         _mem_save_domain_1 = NDR_PULL_GET_MEM_CTX(ndr);
642                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain, 0);
643                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain));
644                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain));
645                         if (ndr_get_array_length(ndr, r->out.domain) > ndr_get_array_size(ndr, r->out.domain)) {
646                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.domain), ndr_get_array_length(ndr, r->out.domain));
647                         }
648                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t)));
649                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t), CH_UTF8));
650                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_1, 0);
651                 }
652                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, LIBNDR_FLAG_REF_ALLOC);
653                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
654                         NDR_PULL_ALLOC(ndr, r->out.name);
655                 }
656                 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
657                 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
658                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
659                 if (_ptr_name) {
660                         NDR_PULL_ALLOC(ndr, *r->out.name);
661                 } else {
662                         *r->out.name = NULL;
663                 }
664                 if (*r->out.name) {
665                         _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
666                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0);
667                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.name));
668                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.name));
669                         if (ndr_get_array_length(ndr, r->out.name) > ndr_get_array_size(ndr, r->out.name)) {
670                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.name), ndr_get_array_length(ndr, r->out.name));
671                         }
672                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t)));
673                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t), CH_UTF8));
674                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0);
675                 }
676                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
677                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
678         }
679         return NDR_ERR_SUCCESS;
680 }
681
682 _PUBLIC_ void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r)
683 {
684         ndr_print_struct(ndr, name, "wbint_LookupSid");
685         ndr->depth++;
686         if (flags & NDR_SET_VALUES) {
687                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
688         }
689         if (flags & NDR_IN) {
690                 ndr_print_struct(ndr, "in", "wbint_LookupSid");
691                 ndr->depth++;
692                 ndr_print_ptr(ndr, "sid", r->in.sid);
693                 ndr->depth++;
694                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
695                 ndr->depth--;
696                 ndr->depth--;
697         }
698         if (flags & NDR_OUT) {
699                 ndr_print_struct(ndr, "out", "wbint_LookupSid");
700                 ndr->depth++;
701                 ndr_print_ptr(ndr, "type", r->out.type);
702                 ndr->depth++;
703                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
704                 ndr->depth--;
705                 ndr_print_ptr(ndr, "domain", r->out.domain);
706                 ndr->depth++;
707                 ndr_print_ptr(ndr, "domain", *r->out.domain);
708                 ndr->depth++;
709                 if (*r->out.domain) {
710                         ndr_print_string(ndr, "domain", *r->out.domain);
711                 }
712                 ndr->depth--;
713                 ndr->depth--;
714                 ndr_print_ptr(ndr, "name", r->out.name);
715                 ndr->depth++;
716                 ndr_print_ptr(ndr, "name", *r->out.name);
717                 ndr->depth++;
718                 if (*r->out.name) {
719                         ndr_print_string(ndr, "name", *r->out.name);
720                 }
721                 ndr->depth--;
722                 ndr->depth--;
723                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
724                 ndr->depth--;
725         }
726         ndr->depth--;
727 }
728
729 static enum ndr_err_code ndr_push_wbint_LookupName(struct ndr_push *ndr, int flags, const struct wbint_LookupName *r)
730 {
731         if (flags & NDR_IN) {
732                 if (r->in.domain == NULL) {
733                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
734                 }
735                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
736                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
737                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
738                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
739                 if (r->in.name == NULL) {
740                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
741                 }
742                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
743                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
744                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
745                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
746                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
747         }
748         if (flags & NDR_OUT) {
749                 if (r->out.type == NULL) {
750                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
751                 }
752                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
753                 if (r->out.sid == NULL) {
754                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
755                 }
756                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
757                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
758         }
759         return NDR_ERR_SUCCESS;
760 }
761
762 static enum ndr_err_code ndr_pull_wbint_LookupName(struct ndr_pull *ndr, int flags, struct wbint_LookupName *r)
763 {
764         TALLOC_CTX *_mem_save_type_0;
765         TALLOC_CTX *_mem_save_sid_0;
766         if (flags & NDR_IN) {
767                 ZERO_STRUCT(r->out);
768
769                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
770                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
771                 if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) {
772                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain), ndr_get_array_length(ndr, &r->in.domain));
773                 }
774                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t)));
775                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t), CH_UTF8));
776                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name));
777                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name));
778                 if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) {
779                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.name), ndr_get_array_length(ndr, &r->in.name));
780                 }
781                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t)));
782                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t), CH_UTF8));
783                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
784                 NDR_PULL_ALLOC(ndr, r->out.type);
785                 ZERO_STRUCTP(r->out.type);
786                 NDR_PULL_ALLOC(ndr, r->out.sid);
787                 ZERO_STRUCTP(r->out.sid);
788         }
789         if (flags & NDR_OUT) {
790                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
791                         NDR_PULL_ALLOC(ndr, r->out.type);
792                 }
793                 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
794                 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
795                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
796                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
797                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
798                         NDR_PULL_ALLOC(ndr, r->out.sid);
799                 }
800                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
801                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
802                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
803                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
804                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
805         }
806         return NDR_ERR_SUCCESS;
807 }
808
809 _PUBLIC_ void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r)
810 {
811         ndr_print_struct(ndr, name, "wbint_LookupName");
812         ndr->depth++;
813         if (flags & NDR_SET_VALUES) {
814                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
815         }
816         if (flags & NDR_IN) {
817                 ndr_print_struct(ndr, "in", "wbint_LookupName");
818                 ndr->depth++;
819                 ndr_print_ptr(ndr, "domain", r->in.domain);
820                 ndr->depth++;
821                 ndr_print_string(ndr, "domain", r->in.domain);
822                 ndr->depth--;
823                 ndr_print_ptr(ndr, "name", r->in.name);
824                 ndr->depth++;
825                 ndr_print_string(ndr, "name", r->in.name);
826                 ndr->depth--;
827                 ndr_print_uint32(ndr, "flags", r->in.flags);
828                 ndr->depth--;
829         }
830         if (flags & NDR_OUT) {
831                 ndr_print_struct(ndr, "out", "wbint_LookupName");
832                 ndr->depth++;
833                 ndr_print_ptr(ndr, "type", r->out.type);
834                 ndr->depth++;
835                 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
836                 ndr->depth--;
837                 ndr_print_ptr(ndr, "sid", r->out.sid);
838                 ndr->depth++;
839                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
840                 ndr->depth--;
841                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
842                 ndr->depth--;
843         }
844         ndr->depth--;
845 }
846
847 static enum ndr_err_code ndr_push_wbint_Sid2Uid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Uid *r)
848 {
849         if (flags & NDR_IN) {
850                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
851                 if (r->in.dom_name) {
852                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
853                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
854                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
855                         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));
856                 }
857                 if (r->in.sid == NULL) {
858                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
859                 }
860                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
861         }
862         if (flags & NDR_OUT) {
863                 if (r->out.uid == NULL) {
864                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
865                 }
866                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
867                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
868         }
869         return NDR_ERR_SUCCESS;
870 }
871
872 static enum ndr_err_code ndr_pull_wbint_Sid2Uid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Uid *r)
873 {
874         uint32_t _ptr_dom_name;
875         TALLOC_CTX *_mem_save_dom_name_0;
876         TALLOC_CTX *_mem_save_sid_0;
877         TALLOC_CTX *_mem_save_uid_0;
878         if (flags & NDR_IN) {
879                 ZERO_STRUCT(r->out);
880
881                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
882                 if (_ptr_dom_name) {
883                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
884                 } else {
885                         r->in.dom_name = NULL;
886                 }
887                 if (r->in.dom_name) {
888                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
889                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
890                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
891                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
892                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
893                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
894                         }
895                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
896                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
897                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
898                 }
899                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
900                         NDR_PULL_ALLOC(ndr, r->in.sid);
901                 }
902                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
903                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
904                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
905                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
906                 NDR_PULL_ALLOC(ndr, r->out.uid);
907                 ZERO_STRUCTP(r->out.uid);
908         }
909         if (flags & NDR_OUT) {
910                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
911                         NDR_PULL_ALLOC(ndr, r->out.uid);
912                 }
913                 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
914                 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
915                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
916                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
917                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
918         }
919         return NDR_ERR_SUCCESS;
920 }
921
922 _PUBLIC_ void ndr_print_wbint_Sid2Uid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Uid *r)
923 {
924         ndr_print_struct(ndr, name, "wbint_Sid2Uid");
925         ndr->depth++;
926         if (flags & NDR_SET_VALUES) {
927                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
928         }
929         if (flags & NDR_IN) {
930                 ndr_print_struct(ndr, "in", "wbint_Sid2Uid");
931                 ndr->depth++;
932                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
933                 ndr->depth++;
934                 if (r->in.dom_name) {
935                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
936                 }
937                 ndr->depth--;
938                 ndr_print_ptr(ndr, "sid", r->in.sid);
939                 ndr->depth++;
940                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
941                 ndr->depth--;
942                 ndr->depth--;
943         }
944         if (flags & NDR_OUT) {
945                 ndr_print_struct(ndr, "out", "wbint_Sid2Uid");
946                 ndr->depth++;
947                 ndr_print_ptr(ndr, "uid", r->out.uid);
948                 ndr->depth++;
949                 ndr_print_hyper(ndr, "uid", *r->out.uid);
950                 ndr->depth--;
951                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
952                 ndr->depth--;
953         }
954         ndr->depth--;
955 }
956
957 static enum ndr_err_code ndr_push_wbint_Sid2Gid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Gid *r)
958 {
959         if (flags & NDR_IN) {
960                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
961                 if (r->in.dom_name) {
962                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
963                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
964                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
965                         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));
966                 }
967                 if (r->in.sid == NULL) {
968                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
969                 }
970                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
971         }
972         if (flags & NDR_OUT) {
973                 if (r->out.gid == NULL) {
974                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
975                 }
976                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
977                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
978         }
979         return NDR_ERR_SUCCESS;
980 }
981
982 static enum ndr_err_code ndr_pull_wbint_Sid2Gid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Gid *r)
983 {
984         uint32_t _ptr_dom_name;
985         TALLOC_CTX *_mem_save_dom_name_0;
986         TALLOC_CTX *_mem_save_sid_0;
987         TALLOC_CTX *_mem_save_gid_0;
988         if (flags & NDR_IN) {
989                 ZERO_STRUCT(r->out);
990
991                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
992                 if (_ptr_dom_name) {
993                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
994                 } else {
995                         r->in.dom_name = NULL;
996                 }
997                 if (r->in.dom_name) {
998                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
999                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1000                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1001                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1002                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1003                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
1004                         }
1005                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1006                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
1007                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1008                 }
1009                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1010                         NDR_PULL_ALLOC(ndr, r->in.sid);
1011                 }
1012                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1013                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1014                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1015                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1016                 NDR_PULL_ALLOC(ndr, r->out.gid);
1017                 ZERO_STRUCTP(r->out.gid);
1018         }
1019         if (flags & NDR_OUT) {
1020                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1021                         NDR_PULL_ALLOC(ndr, r->out.gid);
1022                 }
1023                 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1024                 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
1025                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
1026                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
1027                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1028         }
1029         return NDR_ERR_SUCCESS;
1030 }
1031
1032 _PUBLIC_ void ndr_print_wbint_Sid2Gid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Gid *r)
1033 {
1034         ndr_print_struct(ndr, name, "wbint_Sid2Gid");
1035         ndr->depth++;
1036         if (flags & NDR_SET_VALUES) {
1037                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1038         }
1039         if (flags & NDR_IN) {
1040                 ndr_print_struct(ndr, "in", "wbint_Sid2Gid");
1041                 ndr->depth++;
1042                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1043                 ndr->depth++;
1044                 if (r->in.dom_name) {
1045                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1046                 }
1047                 ndr->depth--;
1048                 ndr_print_ptr(ndr, "sid", r->in.sid);
1049                 ndr->depth++;
1050                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1051                 ndr->depth--;
1052                 ndr->depth--;
1053         }
1054         if (flags & NDR_OUT) {
1055                 ndr_print_struct(ndr, "out", "wbint_Sid2Gid");
1056                 ndr->depth++;
1057                 ndr_print_ptr(ndr, "gid", r->out.gid);
1058                 ndr->depth++;
1059                 ndr_print_hyper(ndr, "gid", *r->out.gid);
1060                 ndr->depth--;
1061                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1062                 ndr->depth--;
1063         }
1064         ndr->depth--;
1065 }
1066
1067 static enum ndr_err_code ndr_push_wbint_Uid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Uid2Sid *r)
1068 {
1069         if (flags & NDR_IN) {
1070                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1071                 if (r->in.dom_name) {
1072                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1073                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1074                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1075                         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));
1076                 }
1077                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
1078         }
1079         if (flags & NDR_OUT) {
1080                 if (r->out.sid == NULL) {
1081                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1082                 }
1083                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1084                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1085         }
1086         return NDR_ERR_SUCCESS;
1087 }
1088
1089 static enum ndr_err_code ndr_pull_wbint_Uid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Uid2Sid *r)
1090 {
1091         uint32_t _ptr_dom_name;
1092         TALLOC_CTX *_mem_save_dom_name_0;
1093         TALLOC_CTX *_mem_save_sid_0;
1094         if (flags & NDR_IN) {
1095                 ZERO_STRUCT(r->out);
1096
1097                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1098                 if (_ptr_dom_name) {
1099                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
1100                 } else {
1101                         r->in.dom_name = NULL;
1102                 }
1103                 if (r->in.dom_name) {
1104                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1105                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1106                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1107                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1108                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1109                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
1110                         }
1111                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1112                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
1113                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1114                 }
1115                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
1116                 NDR_PULL_ALLOC(ndr, r->out.sid);
1117                 ZERO_STRUCTP(r->out.sid);
1118         }
1119         if (flags & NDR_OUT) {
1120                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1121                         NDR_PULL_ALLOC(ndr, r->out.sid);
1122                 }
1123                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1124                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1125                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1126                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1127                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1128         }
1129         return NDR_ERR_SUCCESS;
1130 }
1131
1132 _PUBLIC_ void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r)
1133 {
1134         ndr_print_struct(ndr, name, "wbint_Uid2Sid");
1135         ndr->depth++;
1136         if (flags & NDR_SET_VALUES) {
1137                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1138         }
1139         if (flags & NDR_IN) {
1140                 ndr_print_struct(ndr, "in", "wbint_Uid2Sid");
1141                 ndr->depth++;
1142                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1143                 ndr->depth++;
1144                 if (r->in.dom_name) {
1145                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1146                 }
1147                 ndr->depth--;
1148                 ndr_print_hyper(ndr, "uid", r->in.uid);
1149                 ndr->depth--;
1150         }
1151         if (flags & NDR_OUT) {
1152                 ndr_print_struct(ndr, "out", "wbint_Uid2Sid");
1153                 ndr->depth++;
1154                 ndr_print_ptr(ndr, "sid", r->out.sid);
1155                 ndr->depth++;
1156                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1157                 ndr->depth--;
1158                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1159                 ndr->depth--;
1160         }
1161         ndr->depth--;
1162 }
1163
1164 static enum ndr_err_code ndr_push_wbint_Gid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Gid2Sid *r)
1165 {
1166         if (flags & NDR_IN) {
1167                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1168                 if (r->in.dom_name) {
1169                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1170                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1171                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1172                         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));
1173                 }
1174                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
1175         }
1176         if (flags & NDR_OUT) {
1177                 if (r->out.sid == NULL) {
1178                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1179                 }
1180                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1181                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1182         }
1183         return NDR_ERR_SUCCESS;
1184 }
1185
1186 static enum ndr_err_code ndr_pull_wbint_Gid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Gid2Sid *r)
1187 {
1188         uint32_t _ptr_dom_name;
1189         TALLOC_CTX *_mem_save_dom_name_0;
1190         TALLOC_CTX *_mem_save_sid_0;
1191         if (flags & NDR_IN) {
1192                 ZERO_STRUCT(r->out);
1193
1194                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1195                 if (_ptr_dom_name) {
1196                         NDR_PULL_ALLOC(ndr, r->in.dom_name);
1197                 } else {
1198                         r->in.dom_name = NULL;
1199                 }
1200                 if (r->in.dom_name) {
1201                         _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1202                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1203                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1204                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1205                         if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1206                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dom_name), ndr_get_array_length(ndr, &r->in.dom_name));
1207                         }
1208                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1209                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dom_name, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t), CH_UTF8));
1210                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1211                 }
1212                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
1213                 NDR_PULL_ALLOC(ndr, r->out.sid);
1214                 ZERO_STRUCTP(r->out.sid);
1215         }
1216         if (flags & NDR_OUT) {
1217                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1218                         NDR_PULL_ALLOC(ndr, r->out.sid);
1219                 }
1220                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1221                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1222                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1223                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1224                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1225         }
1226         return NDR_ERR_SUCCESS;
1227 }
1228
1229 _PUBLIC_ void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r)
1230 {
1231         ndr_print_struct(ndr, name, "wbint_Gid2Sid");
1232         ndr->depth++;
1233         if (flags & NDR_SET_VALUES) {
1234                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1235         }
1236         if (flags & NDR_IN) {
1237                 ndr_print_struct(ndr, "in", "wbint_Gid2Sid");
1238                 ndr->depth++;
1239                 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1240                 ndr->depth++;
1241                 if (r->in.dom_name) {
1242                         ndr_print_string(ndr, "dom_name", r->in.dom_name);
1243                 }
1244                 ndr->depth--;
1245                 ndr_print_hyper(ndr, "gid", r->in.gid);
1246                 ndr->depth--;
1247         }
1248         if (flags & NDR_OUT) {
1249                 ndr_print_struct(ndr, "out", "wbint_Gid2Sid");
1250                 ndr->depth++;
1251                 ndr_print_ptr(ndr, "sid", r->out.sid);
1252                 ndr->depth++;
1253                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1254                 ndr->depth--;
1255                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1256                 ndr->depth--;
1257         }
1258         ndr->depth--;
1259 }
1260
1261 static enum ndr_err_code ndr_push_wbint_AllocateUid(struct ndr_push *ndr, int flags, const struct wbint_AllocateUid *r)
1262 {
1263         if (flags & NDR_IN) {
1264         }
1265         if (flags & NDR_OUT) {
1266                 if (r->out.uid == NULL) {
1267                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1268                 }
1269                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
1270                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1271         }
1272         return NDR_ERR_SUCCESS;
1273 }
1274
1275 static enum ndr_err_code ndr_pull_wbint_AllocateUid(struct ndr_pull *ndr, int flags, struct wbint_AllocateUid *r)
1276 {
1277         TALLOC_CTX *_mem_save_uid_0;
1278         if (flags & NDR_IN) {
1279                 ZERO_STRUCT(r->out);
1280
1281                 NDR_PULL_ALLOC(ndr, r->out.uid);
1282                 ZERO_STRUCTP(r->out.uid);
1283         }
1284         if (flags & NDR_OUT) {
1285                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1286                         NDR_PULL_ALLOC(ndr, r->out.uid);
1287                 }
1288                 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1289                 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
1290                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
1291                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
1292                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1293         }
1294         return NDR_ERR_SUCCESS;
1295 }
1296
1297 _PUBLIC_ void ndr_print_wbint_AllocateUid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_AllocateUid *r)
1298 {
1299         ndr_print_struct(ndr, name, "wbint_AllocateUid");
1300         ndr->depth++;
1301         if (flags & NDR_SET_VALUES) {
1302                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1303         }
1304         if (flags & NDR_IN) {
1305                 ndr_print_struct(ndr, "in", "wbint_AllocateUid");
1306                 ndr->depth++;
1307                 ndr->depth--;
1308         }
1309         if (flags & NDR_OUT) {
1310                 ndr_print_struct(ndr, "out", "wbint_AllocateUid");
1311                 ndr->depth++;
1312                 ndr_print_ptr(ndr, "uid", r->out.uid);
1313                 ndr->depth++;
1314                 ndr_print_hyper(ndr, "uid", *r->out.uid);
1315                 ndr->depth--;
1316                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1317                 ndr->depth--;
1318         }
1319         ndr->depth--;
1320 }
1321
1322 static enum ndr_err_code ndr_push_wbint_QueryUser(struct ndr_push *ndr, int flags, const struct wbint_QueryUser *r)
1323 {
1324         if (flags & NDR_IN) {
1325                 if (r->in.sid == NULL) {
1326                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1327                 }
1328                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1329         }
1330         if (flags & NDR_OUT) {
1331                 if (r->out.info == NULL) {
1332                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1333                 }
1334                 NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1335                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1336         }
1337         return NDR_ERR_SUCCESS;
1338 }
1339
1340 static enum ndr_err_code ndr_pull_wbint_QueryUser(struct ndr_pull *ndr, int flags, struct wbint_QueryUser *r)
1341 {
1342         TALLOC_CTX *_mem_save_sid_0;
1343         TALLOC_CTX *_mem_save_info_0;
1344         if (flags & NDR_IN) {
1345                 ZERO_STRUCT(r->out);
1346
1347                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1348                         NDR_PULL_ALLOC(ndr, r->in.sid);
1349                 }
1350                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1351                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1352                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1353                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1354                 NDR_PULL_ALLOC(ndr, r->out.info);
1355                 ZERO_STRUCTP(r->out.info);
1356         }
1357         if (flags & NDR_OUT) {
1358                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1359                         NDR_PULL_ALLOC(ndr, r->out.info);
1360                 }
1361                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1362                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1363                 NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1364                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1365                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1366         }
1367         return NDR_ERR_SUCCESS;
1368 }
1369
1370 _PUBLIC_ void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r)
1371 {
1372         ndr_print_struct(ndr, name, "wbint_QueryUser");
1373         ndr->depth++;
1374         if (flags & NDR_SET_VALUES) {
1375                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1376         }
1377         if (flags & NDR_IN) {
1378                 ndr_print_struct(ndr, "in", "wbint_QueryUser");
1379                 ndr->depth++;
1380                 ndr_print_ptr(ndr, "sid", r->in.sid);
1381                 ndr->depth++;
1382                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1383                 ndr->depth--;
1384                 ndr->depth--;
1385         }
1386         if (flags & NDR_OUT) {
1387                 ndr_print_struct(ndr, "out", "wbint_QueryUser");
1388                 ndr->depth++;
1389                 ndr_print_ptr(ndr, "info", r->out.info);
1390                 ndr->depth++;
1391                 ndr_print_wbint_userinfo(ndr, "info", r->out.info);
1392                 ndr->depth--;
1393                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1394                 ndr->depth--;
1395         }
1396         ndr->depth--;
1397 }
1398
1399 static enum ndr_err_code ndr_push_wbint_LookupUserAliases(struct ndr_push *ndr, int flags, const struct wbint_LookupUserAliases *r)
1400 {
1401         if (flags & NDR_IN) {
1402                 if (r->in.sids == NULL) {
1403                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1404                 }
1405                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1406         }
1407         if (flags & NDR_OUT) {
1408                 if (r->out.rids == NULL) {
1409                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1410                 }
1411                 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1412                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1413         }
1414         return NDR_ERR_SUCCESS;
1415 }
1416
1417 static enum ndr_err_code ndr_pull_wbint_LookupUserAliases(struct ndr_pull *ndr, int flags, struct wbint_LookupUserAliases *r)
1418 {
1419         TALLOC_CTX *_mem_save_sids_0;
1420         TALLOC_CTX *_mem_save_rids_0;
1421         if (flags & NDR_IN) {
1422                 ZERO_STRUCT(r->out);
1423
1424                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1425                         NDR_PULL_ALLOC(ndr, r->in.sids);
1426                 }
1427                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1428                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC);
1429                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1430                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1431                 NDR_PULL_ALLOC(ndr, r->out.rids);
1432                 ZERO_STRUCTP(r->out.rids);
1433         }
1434         if (flags & NDR_OUT) {
1435                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1436                         NDR_PULL_ALLOC(ndr, r->out.rids);
1437                 }
1438                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1439                 NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC);
1440                 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1441                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
1442                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1443         }
1444         return NDR_ERR_SUCCESS;
1445 }
1446
1447 _PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r)
1448 {
1449         ndr_print_struct(ndr, name, "wbint_LookupUserAliases");
1450         ndr->depth++;
1451         if (flags & NDR_SET_VALUES) {
1452                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1453         }
1454         if (flags & NDR_IN) {
1455                 ndr_print_struct(ndr, "in", "wbint_LookupUserAliases");
1456                 ndr->depth++;
1457                 ndr_print_ptr(ndr, "sids", r->in.sids);
1458                 ndr->depth++;
1459                 ndr_print_wbint_SidArray(ndr, "sids", r->in.sids);
1460                 ndr->depth--;
1461                 ndr->depth--;
1462         }
1463         if (flags & NDR_OUT) {
1464                 ndr_print_struct(ndr, "out", "wbint_LookupUserAliases");
1465                 ndr->depth++;
1466                 ndr_print_ptr(ndr, "rids", r->out.rids);
1467                 ndr->depth++;
1468                 ndr_print_wbint_RidArray(ndr, "rids", r->out.rids);
1469                 ndr->depth--;
1470                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1471                 ndr->depth--;
1472         }
1473         ndr->depth--;
1474 }
1475
1476 static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r)
1477 {
1478         if (flags & NDR_IN) {
1479                 if (r->in.sid == NULL) {
1480                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1481                 }
1482                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1483         }
1484         if (flags & NDR_OUT) {
1485                 if (r->out.sids == NULL) {
1486                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1487                 }
1488                 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1489                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1490         }
1491         return NDR_ERR_SUCCESS;
1492 }
1493
1494 static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r)
1495 {
1496         TALLOC_CTX *_mem_save_sid_0;
1497         TALLOC_CTX *_mem_save_sids_0;
1498         if (flags & NDR_IN) {
1499                 ZERO_STRUCT(r->out);
1500
1501                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1502                         NDR_PULL_ALLOC(ndr, r->in.sid);
1503                 }
1504                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1505                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1506                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1507                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1508                 NDR_PULL_ALLOC(ndr, r->out.sids);
1509                 ZERO_STRUCTP(r->out.sids);
1510         }
1511         if (flags & NDR_OUT) {
1512                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1513                         NDR_PULL_ALLOC(ndr, r->out.sids);
1514                 }
1515                 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1516                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC);
1517                 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1518                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1519                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1520         }
1521         return NDR_ERR_SUCCESS;
1522 }
1523
1524 _PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r)
1525 {
1526         ndr_print_struct(ndr, name, "wbint_LookupUserGroups");
1527         ndr->depth++;
1528         if (flags & NDR_SET_VALUES) {
1529                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1530         }
1531         if (flags & NDR_IN) {
1532                 ndr_print_struct(ndr, "in", "wbint_LookupUserGroups");
1533                 ndr->depth++;
1534                 ndr_print_ptr(ndr, "sid", r->in.sid);
1535                 ndr->depth++;
1536                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1537                 ndr->depth--;
1538                 ndr->depth--;
1539         }
1540         if (flags & NDR_OUT) {
1541                 ndr_print_struct(ndr, "out", "wbint_LookupUserGroups");
1542                 ndr->depth++;
1543                 ndr_print_ptr(ndr, "sids", r->out.sids);
1544                 ndr->depth++;
1545                 ndr_print_wbint_SidArray(ndr, "sids", r->out.sids);
1546                 ndr->depth--;
1547                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1548                 ndr->depth--;
1549         }
1550         ndr->depth--;
1551 }
1552
1553 static enum ndr_err_code ndr_push_wbint_QuerySequenceNumber(struct ndr_push *ndr, int flags, const struct wbint_QuerySequenceNumber *r)
1554 {
1555         if (flags & NDR_IN) {
1556         }
1557         if (flags & NDR_OUT) {
1558                 if (r->out.sequence == NULL) {
1559                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1560                 }
1561                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sequence));
1562                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1563         }
1564         return NDR_ERR_SUCCESS;
1565 }
1566
1567 static enum ndr_err_code ndr_pull_wbint_QuerySequenceNumber(struct ndr_pull *ndr, int flags, struct wbint_QuerySequenceNumber *r)
1568 {
1569         TALLOC_CTX *_mem_save_sequence_0;
1570         if (flags & NDR_IN) {
1571                 ZERO_STRUCT(r->out);
1572
1573                 NDR_PULL_ALLOC(ndr, r->out.sequence);
1574                 ZERO_STRUCTP(r->out.sequence);
1575         }
1576         if (flags & NDR_OUT) {
1577                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1578                         NDR_PULL_ALLOC(ndr, r->out.sequence);
1579                 }
1580                 _mem_save_sequence_0 = NDR_PULL_GET_MEM_CTX(ndr);
1581                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence, LIBNDR_FLAG_REF_ALLOC);
1582                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sequence));
1583                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_0, LIBNDR_FLAG_REF_ALLOC);
1584                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1585         }
1586         return NDR_ERR_SUCCESS;
1587 }
1588
1589 _PUBLIC_ void ndr_print_wbint_QuerySequenceNumber(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QuerySequenceNumber *r)
1590 {
1591         ndr_print_struct(ndr, name, "wbint_QuerySequenceNumber");
1592         ndr->depth++;
1593         if (flags & NDR_SET_VALUES) {
1594                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1595         }
1596         if (flags & NDR_IN) {
1597                 ndr_print_struct(ndr, "in", "wbint_QuerySequenceNumber");
1598                 ndr->depth++;
1599                 ndr->depth--;
1600         }
1601         if (flags & NDR_OUT) {
1602                 ndr_print_struct(ndr, "out", "wbint_QuerySequenceNumber");
1603                 ndr->depth++;
1604                 ndr_print_ptr(ndr, "sequence", r->out.sequence);
1605                 ndr->depth++;
1606                 ndr_print_uint32(ndr, "sequence", *r->out.sequence);
1607                 ndr->depth--;
1608                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1609                 ndr->depth--;
1610         }
1611         ndr->depth--;
1612 }
1613
1614 static enum ndr_err_code ndr_push_wbint_LookupGroupMembers(struct ndr_push *ndr, int flags, const struct wbint_LookupGroupMembers *r)
1615 {
1616         if (flags & NDR_IN) {
1617                 if (r->in.sid == NULL) {
1618                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1619                 }
1620                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1621                 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->in.type));
1622         }
1623         if (flags & NDR_OUT) {
1624                 if (r->out.members == NULL) {
1625                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1626                 }
1627                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1628                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1629         }
1630         return NDR_ERR_SUCCESS;
1631 }
1632
1633 static enum ndr_err_code ndr_pull_wbint_LookupGroupMembers(struct ndr_pull *ndr, int flags, struct wbint_LookupGroupMembers *r)
1634 {
1635         TALLOC_CTX *_mem_save_sid_0;
1636         TALLOC_CTX *_mem_save_members_0;
1637         if (flags & NDR_IN) {
1638                 ZERO_STRUCT(r->out);
1639
1640                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1641                         NDR_PULL_ALLOC(ndr, r->in.sid);
1642                 }
1643                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1644                 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1645                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1646                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1647                 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->in.type));
1648                 NDR_PULL_ALLOC(ndr, r->out.members);
1649                 ZERO_STRUCTP(r->out.members);
1650         }
1651         if (flags & NDR_OUT) {
1652                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1653                         NDR_PULL_ALLOC(ndr, r->out.members);
1654                 }
1655                 _mem_save_members_0 = NDR_PULL_GET_MEM_CTX(ndr);
1656                 NDR_PULL_SET_MEM_CTX(ndr, r->out.members, LIBNDR_FLAG_REF_ALLOC);
1657                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1658                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_members_0, LIBNDR_FLAG_REF_ALLOC);
1659                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1660         }
1661         return NDR_ERR_SUCCESS;
1662 }
1663
1664 _PUBLIC_ void ndr_print_wbint_LookupGroupMembers(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupGroupMembers *r)
1665 {
1666         ndr_print_struct(ndr, name, "wbint_LookupGroupMembers");
1667         ndr->depth++;
1668         if (flags & NDR_SET_VALUES) {
1669                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1670         }
1671         if (flags & NDR_IN) {
1672                 ndr_print_struct(ndr, "in", "wbint_LookupGroupMembers");
1673                 ndr->depth++;
1674                 ndr_print_ptr(ndr, "sid", r->in.sid);
1675                 ndr->depth++;
1676                 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1677                 ndr->depth--;
1678                 ndr_print_lsa_SidType(ndr, "type", r->in.type);
1679                 ndr->depth--;
1680         }
1681         if (flags & NDR_OUT) {
1682                 ndr_print_struct(ndr, "out", "wbint_LookupGroupMembers");
1683                 ndr->depth++;
1684                 ndr_print_ptr(ndr, "members", r->out.members);
1685                 ndr->depth++;
1686                 ndr_print_wbint_Principals(ndr, "members", r->out.members);
1687                 ndr->depth--;
1688                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1689                 ndr->depth--;
1690         }
1691         ndr->depth--;
1692 }
1693
1694 static enum ndr_err_code ndr_push_wbint_QueryUserList(struct ndr_push *ndr, int flags, const struct wbint_QueryUserList *r)
1695 {
1696         if (flags & NDR_IN) {
1697         }
1698         if (flags & NDR_OUT) {
1699                 if (r->out.users == NULL) {
1700                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1701                 }
1702                 NDR_CHECK(ndr_push_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1703                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1704         }
1705         return NDR_ERR_SUCCESS;
1706 }
1707
1708 static enum ndr_err_code ndr_pull_wbint_QueryUserList(struct ndr_pull *ndr, int flags, struct wbint_QueryUserList *r)
1709 {
1710         TALLOC_CTX *_mem_save_users_0;
1711         if (flags & NDR_IN) {
1712                 ZERO_STRUCT(r->out);
1713
1714                 NDR_PULL_ALLOC(ndr, r->out.users);
1715                 ZERO_STRUCTP(r->out.users);
1716         }
1717         if (flags & NDR_OUT) {
1718                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1719                         NDR_PULL_ALLOC(ndr, r->out.users);
1720                 }
1721                 _mem_save_users_0 = NDR_PULL_GET_MEM_CTX(ndr);
1722                 NDR_PULL_SET_MEM_CTX(ndr, r->out.users, LIBNDR_FLAG_REF_ALLOC);
1723                 NDR_CHECK(ndr_pull_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1724                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_users_0, LIBNDR_FLAG_REF_ALLOC);
1725                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1726         }
1727         return NDR_ERR_SUCCESS;
1728 }
1729
1730 _PUBLIC_ void ndr_print_wbint_QueryUserList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUserList *r)
1731 {
1732         ndr_print_struct(ndr, name, "wbint_QueryUserList");
1733         ndr->depth++;
1734         if (flags & NDR_SET_VALUES) {
1735                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1736         }
1737         if (flags & NDR_IN) {
1738                 ndr_print_struct(ndr, "in", "wbint_QueryUserList");
1739                 ndr->depth++;
1740                 ndr->depth--;
1741         }
1742         if (flags & NDR_OUT) {
1743                 ndr_print_struct(ndr, "out", "wbint_QueryUserList");
1744                 ndr->depth++;
1745                 ndr_print_ptr(ndr, "users", r->out.users);
1746                 ndr->depth++;
1747                 ndr_print_wbint_userinfos(ndr, "users", r->out.users);
1748                 ndr->depth--;
1749                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1750                 ndr->depth--;
1751         }
1752         ndr->depth--;
1753 }
1754
1755 static enum ndr_err_code ndr_push_wbint_QueryGroupList(struct ndr_push *ndr, int flags, const struct wbint_QueryGroupList *r)
1756 {
1757         if (flags & NDR_IN) {
1758         }
1759         if (flags & NDR_OUT) {
1760                 if (r->out.groups == NULL) {
1761                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1762                 }
1763                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
1764                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1765         }
1766         return NDR_ERR_SUCCESS;
1767 }
1768
1769 static enum ndr_err_code ndr_pull_wbint_QueryGroupList(struct ndr_pull *ndr, int flags, struct wbint_QueryGroupList *r)
1770 {
1771         TALLOC_CTX *_mem_save_groups_0;
1772         if (flags & NDR_IN) {
1773                 ZERO_STRUCT(r->out);
1774
1775                 NDR_PULL_ALLOC(ndr, r->out.groups);
1776                 ZERO_STRUCTP(r->out.groups);
1777         }
1778         if (flags & NDR_OUT) {
1779                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1780                         NDR_PULL_ALLOC(ndr, r->out.groups);
1781                 }
1782                 _mem_save_groups_0 = NDR_PULL_GET_MEM_CTX(ndr);
1783                 NDR_PULL_SET_MEM_CTX(ndr, r->out.groups, LIBNDR_FLAG_REF_ALLOC);
1784                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
1785                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_groups_0, LIBNDR_FLAG_REF_ALLOC);
1786                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1787         }
1788         return NDR_ERR_SUCCESS;
1789 }
1790
1791 _PUBLIC_ void ndr_print_wbint_QueryGroupList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryGroupList *r)
1792 {
1793         ndr_print_struct(ndr, name, "wbint_QueryGroupList");
1794         ndr->depth++;
1795         if (flags & NDR_SET_VALUES) {
1796                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1797         }
1798         if (flags & NDR_IN) {
1799                 ndr_print_struct(ndr, "in", "wbint_QueryGroupList");
1800                 ndr->depth++;
1801                 ndr->depth--;
1802         }
1803         if (flags & NDR_OUT) {
1804                 ndr_print_struct(ndr, "out", "wbint_QueryGroupList");
1805                 ndr->depth++;
1806                 ndr_print_ptr(ndr, "groups", r->out.groups);
1807                 ndr->depth++;
1808                 ndr_print_wbint_Principals(ndr, "groups", r->out.groups);
1809                 ndr->depth--;
1810                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1811                 ndr->depth--;
1812         }
1813         ndr->depth--;
1814 }
1815
1816 static enum ndr_err_code ndr_push_wbint_DsGetDcName(struct ndr_push *ndr, int flags, const struct wbint_DsGetDcName *r)
1817 {
1818         if (flags & NDR_IN) {
1819                 if (r->in.domain_name == NULL) {
1820                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1821                 }
1822                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
1823                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1824                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
1825                 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));
1826                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
1827                 if (r->in.domain_guid) {
1828                         NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
1829                 }
1830                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
1831                 if (r->in.site_name) {
1832                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
1833                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1834                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
1835                         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));
1836                 }
1837                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
1838         }
1839         if (flags & NDR_OUT) {
1840                 if (r->out.dc_info == NULL) {
1841                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1842                 }
1843                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dc_info));
1844                 if (*r->out.dc_info) {
1845                         NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
1846                 }
1847                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1848         }
1849         return NDR_ERR_SUCCESS;
1850 }
1851
1852 static enum ndr_err_code ndr_pull_wbint_DsGetDcName(struct ndr_pull *ndr, int flags, struct wbint_DsGetDcName *r)
1853 {
1854         uint32_t _ptr_domain_guid;
1855         uint32_t _ptr_site_name;
1856         uint32_t _ptr_dc_info;
1857         TALLOC_CTX *_mem_save_domain_guid_0;
1858         TALLOC_CTX *_mem_save_site_name_0;
1859         TALLOC_CTX *_mem_save_dc_info_0;
1860         TALLOC_CTX *_mem_save_dc_info_1;
1861         if (flags & NDR_IN) {
1862                 ZERO_STRUCT(r->out);
1863
1864                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
1865                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
1866                 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
1867                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
1868                 }
1869                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t)));
1870                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t), CH_UTF8));
1871                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
1872                 if (_ptr_domain_guid) {
1873                         NDR_PULL_ALLOC(ndr, r->in.domain_guid);
1874                 } else {
1875                         r->in.domain_guid = NULL;
1876                 }
1877                 if (r->in.domain_guid) {
1878                         _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1879                         NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
1880                         NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
1881                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
1882                 }
1883                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
1884                 if (_ptr_site_name) {
1885                         NDR_PULL_ALLOC(ndr, r->in.site_name);
1886                 } else {
1887                         r->in.site_name = NULL;
1888                 }
1889                 if (r->in.site_name) {
1890                         _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1891                         NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
1892                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
1893                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
1894                         if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) {
1895                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.site_name), ndr_get_array_length(ndr, &r->in.site_name));
1896                         }
1897                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint8_t)));
1898                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.site_name, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint8_t), CH_UTF8));
1899                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
1900                 }
1901                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
1902                 NDR_PULL_ALLOC(ndr, r->out.dc_info);
1903                 ZERO_STRUCTP(r->out.dc_info);
1904         }
1905         if (flags & NDR_OUT) {
1906                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1907                         NDR_PULL_ALLOC(ndr, r->out.dc_info);
1908                 }
1909                 _mem_save_dc_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1910                 NDR_PULL_SET_MEM_CTX(ndr, r->out.dc_info, LIBNDR_FLAG_REF_ALLOC);
1911                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_info));
1912                 if (_ptr_dc_info) {
1913                         NDR_PULL_ALLOC(ndr, *r->out.dc_info);
1914                 } else {
1915                         *r->out.dc_info = NULL;
1916                 }
1917                 if (*r->out.dc_info) {
1918                         _mem_save_dc_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
1919                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.dc_info, 0);
1920                         NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
1921                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_1, 0);
1922                 }
1923                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_0, LIBNDR_FLAG_REF_ALLOC);
1924                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1925         }
1926         return NDR_ERR_SUCCESS;
1927 }
1928
1929 _PUBLIC_ void ndr_print_wbint_DsGetDcName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_DsGetDcName *r)
1930 {
1931         ndr_print_struct(ndr, name, "wbint_DsGetDcName");
1932         ndr->depth++;
1933         if (flags & NDR_SET_VALUES) {
1934                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1935         }
1936         if (flags & NDR_IN) {
1937                 ndr_print_struct(ndr, "in", "wbint_DsGetDcName");
1938                 ndr->depth++;
1939                 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
1940                 ndr->depth++;
1941                 ndr_print_string(ndr, "domain_name", r->in.domain_name);
1942                 ndr->depth--;
1943                 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
1944                 ndr->depth++;
1945                 if (r->in.domain_guid) {
1946                         ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
1947                 }
1948                 ndr->depth--;
1949                 ndr_print_ptr(ndr, "site_name", r->in.site_name);
1950                 ndr->depth++;
1951                 if (r->in.site_name) {
1952                         ndr_print_string(ndr, "site_name", r->in.site_name);
1953                 }
1954                 ndr->depth--;
1955                 ndr_print_uint32(ndr, "flags", r->in.flags);
1956                 ndr->depth--;
1957         }
1958         if (flags & NDR_OUT) {
1959                 ndr_print_struct(ndr, "out", "wbint_DsGetDcName");
1960                 ndr->depth++;
1961                 ndr_print_ptr(ndr, "dc_info", r->out.dc_info);
1962                 ndr->depth++;
1963                 ndr_print_ptr(ndr, "dc_info", *r->out.dc_info);
1964                 ndr->depth++;
1965                 if (*r->out.dc_info) {
1966                         ndr_print_netr_DsRGetDCNameInfo(ndr, "dc_info", *r->out.dc_info);
1967                 }
1968                 ndr->depth--;
1969                 ndr->depth--;
1970                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1971                 ndr->depth--;
1972         }
1973         ndr->depth--;
1974 }
1975
1976 static enum ndr_err_code ndr_push_wbint_LookupRids(struct ndr_push *ndr, int flags, const struct wbint_LookupRids *r)
1977 {
1978         if (flags & NDR_IN) {
1979                 if (r->in.rids == NULL) {
1980                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1981                 }
1982                 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
1983         }
1984         if (flags & NDR_OUT) {
1985                 if (r->out.names == NULL) {
1986                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1987                 }
1988                 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
1989                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1990         }
1991         return NDR_ERR_SUCCESS;
1992 }
1993
1994 static enum ndr_err_code ndr_pull_wbint_LookupRids(struct ndr_pull *ndr, int flags, struct wbint_LookupRids *r)
1995 {
1996         TALLOC_CTX *_mem_save_rids_0;
1997         TALLOC_CTX *_mem_save_names_0;
1998         if (flags & NDR_IN) {
1999                 ZERO_STRUCT(r->out);
2000
2001                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2002                         NDR_PULL_ALLOC(ndr, r->in.rids);
2003                 }
2004                 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2005                 NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, LIBNDR_FLAG_REF_ALLOC);
2006                 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
2007                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
2008                 NDR_PULL_ALLOC(ndr, r->out.names);
2009                 ZERO_STRUCTP(r->out.names);
2010         }
2011         if (flags & NDR_OUT) {
2012                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2013                         NDR_PULL_ALLOC(ndr, r->out.names);
2014                 }
2015                 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
2016                 NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC);
2017                 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
2018                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC);
2019                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2020         }
2021         return NDR_ERR_SUCCESS;
2022 }
2023
2024 _PUBLIC_ void ndr_print_wbint_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupRids *r)
2025 {
2026         ndr_print_struct(ndr, name, "wbint_LookupRids");
2027         ndr->depth++;
2028         if (flags & NDR_SET_VALUES) {
2029                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2030         }
2031         if (flags & NDR_IN) {
2032                 ndr_print_struct(ndr, "in", "wbint_LookupRids");
2033                 ndr->depth++;
2034                 ndr_print_ptr(ndr, "rids", r->in.rids);
2035                 ndr->depth++;
2036                 ndr_print_wbint_RidArray(ndr, "rids", r->in.rids);
2037                 ndr->depth--;
2038                 ndr->depth--;
2039         }
2040         if (flags & NDR_OUT) {
2041                 ndr_print_struct(ndr, "out", "wbint_LookupRids");
2042                 ndr->depth++;
2043                 ndr_print_ptr(ndr, "names", r->out.names);
2044                 ndr->depth++;
2045                 ndr_print_wbint_Principals(ndr, "names", r->out.names);
2046                 ndr->depth--;
2047                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2048                 ndr->depth--;
2049         }
2050         ndr->depth--;
2051 }
2052
2053 static const struct ndr_interface_call wbint_calls[] = {
2054         {
2055                 "wbint_Ping",
2056                 sizeof(struct wbint_Ping),
2057                 (ndr_push_flags_fn_t) ndr_push_wbint_Ping,
2058                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping,
2059                 (ndr_print_function_t) ndr_print_wbint_Ping,
2060                 false,
2061         },
2062         {
2063                 "wbint_LookupSid",
2064                 sizeof(struct wbint_LookupSid),
2065                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid,
2066                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid,
2067                 (ndr_print_function_t) ndr_print_wbint_LookupSid,
2068                 false,
2069         },
2070         {
2071                 "wbint_LookupName",
2072                 sizeof(struct wbint_LookupName),
2073                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupName,
2074                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName,
2075                 (ndr_print_function_t) ndr_print_wbint_LookupName,
2076                 false,
2077         },
2078         {
2079                 "wbint_Sid2Uid",
2080                 sizeof(struct wbint_Sid2Uid),
2081                 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Uid,
2082                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Uid,
2083                 (ndr_print_function_t) ndr_print_wbint_Sid2Uid,
2084                 false,
2085         },
2086         {
2087                 "wbint_Sid2Gid",
2088                 sizeof(struct wbint_Sid2Gid),
2089                 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Gid,
2090                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Gid,
2091                 (ndr_print_function_t) ndr_print_wbint_Sid2Gid,
2092                 false,
2093         },
2094         {
2095                 "wbint_Uid2Sid",
2096                 sizeof(struct wbint_Uid2Sid),
2097                 (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid,
2098                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid,
2099                 (ndr_print_function_t) ndr_print_wbint_Uid2Sid,
2100                 false,
2101         },
2102         {
2103                 "wbint_Gid2Sid",
2104                 sizeof(struct wbint_Gid2Sid),
2105                 (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid,
2106                 (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid,
2107                 (ndr_print_function_t) ndr_print_wbint_Gid2Sid,
2108                 false,
2109         },
2110         {
2111                 "wbint_AllocateUid",
2112                 sizeof(struct wbint_AllocateUid),
2113                 (ndr_push_flags_fn_t) ndr_push_wbint_AllocateUid,
2114                 (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateUid,
2115                 (ndr_print_function_t) ndr_print_wbint_AllocateUid,
2116                 false,
2117         },
2118         {
2119                 "wbint_QueryUser",
2120                 sizeof(struct wbint_QueryUser),
2121                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser,
2122                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser,
2123                 (ndr_print_function_t) ndr_print_wbint_QueryUser,
2124                 false,
2125         },
2126         {
2127                 "wbint_LookupUserAliases",
2128                 sizeof(struct wbint_LookupUserAliases),
2129                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases,
2130                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases,
2131                 (ndr_print_function_t) ndr_print_wbint_LookupUserAliases,
2132                 false,
2133         },
2134         {
2135                 "wbint_LookupUserGroups",
2136                 sizeof(struct wbint_LookupUserGroups),
2137                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups,
2138                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups,
2139                 (ndr_print_function_t) ndr_print_wbint_LookupUserGroups,
2140                 false,
2141         },
2142         {
2143                 "wbint_QuerySequenceNumber",
2144                 sizeof(struct wbint_QuerySequenceNumber),
2145                 (ndr_push_flags_fn_t) ndr_push_wbint_QuerySequenceNumber,
2146                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QuerySequenceNumber,
2147                 (ndr_print_function_t) ndr_print_wbint_QuerySequenceNumber,
2148                 false,
2149         },
2150         {
2151                 "wbint_LookupGroupMembers",
2152                 sizeof(struct wbint_LookupGroupMembers),
2153                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupGroupMembers,
2154                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupGroupMembers,
2155                 (ndr_print_function_t) ndr_print_wbint_LookupGroupMembers,
2156                 false,
2157         },
2158         {
2159                 "wbint_QueryUserList",
2160                 sizeof(struct wbint_QueryUserList),
2161                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUserList,
2162                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUserList,
2163                 (ndr_print_function_t) ndr_print_wbint_QueryUserList,
2164                 false,
2165         },
2166         {
2167                 "wbint_QueryGroupList",
2168                 sizeof(struct wbint_QueryGroupList),
2169                 (ndr_push_flags_fn_t) ndr_push_wbint_QueryGroupList,
2170                 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryGroupList,
2171                 (ndr_print_function_t) ndr_print_wbint_QueryGroupList,
2172                 false,
2173         },
2174         {
2175                 "wbint_DsGetDcName",
2176                 sizeof(struct wbint_DsGetDcName),
2177                 (ndr_push_flags_fn_t) ndr_push_wbint_DsGetDcName,
2178                 (ndr_pull_flags_fn_t) ndr_pull_wbint_DsGetDcName,
2179                 (ndr_print_function_t) ndr_print_wbint_DsGetDcName,
2180                 false,
2181         },
2182         {
2183                 "wbint_LookupRids",
2184                 sizeof(struct wbint_LookupRids),
2185                 (ndr_push_flags_fn_t) ndr_push_wbint_LookupRids,
2186                 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupRids,
2187                 (ndr_print_function_t) ndr_print_wbint_LookupRids,
2188                 false,
2189         },
2190         { NULL, 0, NULL, NULL, NULL, false }
2191 };
2192
2193 static const char * const wbint_endpoint_strings[] = {
2194         "ncalrpc:", 
2195 };
2196
2197 static const struct ndr_interface_string_array wbint_endpoints = {
2198         .count  = 1,
2199         .names  = wbint_endpoint_strings
2200 };
2201
2202 static const char * const wbint_authservice_strings[] = {
2203         "host", 
2204 };
2205
2206 static const struct ndr_interface_string_array wbint_authservices = {
2207         .count  = 1,
2208         .names  = wbint_authservice_strings
2209 };
2210
2211
2212 const struct ndr_interface_table ndr_table_wbint = {
2213         .name           = "wbint",
2214         .syntax_id      = {
2215                 {0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}},
2216                 NDR_WBINT_VERSION
2217         },
2218         .helpstring     = NDR_WBINT_HELPSTRING,
2219         .num_calls      = 17,
2220         .calls          = wbint_calls,
2221         .endpoints      = &wbint_endpoints,
2222         .authservices   = &wbint_authservices
2223 };
2224