s3:winbind: Convert WINBINDD_SET_MAPPING to the new API
[Samba/aatanasov.git] / source3 / librpc / gen_ndr / ndr_wbint.c
blobcac05cc72c66d57379fc3c74be50f5e7c0be0e73
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "librpc/gen_ndr/ndr_wbint.h"
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)
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));
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));
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));
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));
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));
45 return NDR_ERR_SUCCESS;
48 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfo(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfo *r)
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;
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;
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;
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;
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));
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));
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);
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));
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);
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));
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);
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));
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);
138 return NDR_ERR_SUCCESS;
141 _PUBLIC_ void ndr_print_wbint_userinfo(struct ndr_print *ndr, const char *name, const struct wbint_userinfo *r)
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);
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);
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);
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);
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--;
175 _PUBLIC_ enum ndr_err_code ndr_push_wbint_SidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_SidArray *r)
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]));
186 if (ndr_flags & NDR_BUFFERS) {
188 return NDR_ERR_SUCCESS;
191 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_SidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_SidArray *r)
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]));
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));
210 if (ndr_flags & NDR_BUFFERS) {
212 return NDR_ERR_SUCCESS;
215 _PUBLIC_ void ndr_print_wbint_SidArray(struct ndr_print *ndr, const char *name, const struct wbint_SidArray *r)
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);
230 ndr->depth--;
231 ndr->depth--;
234 _PUBLIC_ enum ndr_err_code ndr_push_wbint_RidArray(struct ndr_push *ndr, int ndr_flags, const struct wbint_RidArray *r)
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]));
245 if (ndr_flags & NDR_BUFFERS) {
247 return NDR_ERR_SUCCESS;
250 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_RidArray(struct ndr_pull *ndr, int ndr_flags, struct wbint_RidArray *r)
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]));
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));
269 if (ndr_flags & NDR_BUFFERS) {
271 return NDR_ERR_SUCCESS;
274 _PUBLIC_ void ndr_print_wbint_RidArray(struct ndr_print *ndr, const char *name, const struct wbint_RidArray *r)
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);
289 ndr->depth--;
290 ndr->depth--;
293 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principal(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principal *r)
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));
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));
309 return NDR_ERR_SUCCESS;
312 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principal(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principal *r)
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;
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));
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);
341 return NDR_ERR_SUCCESS;
344 _PUBLIC_ void ndr_print_wbint_Principal(struct ndr_print *ndr, const char *name, const struct wbint_Principal *r)
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);
355 ndr->depth--;
356 ndr->depth--;
359 _PUBLIC_ enum ndr_err_code ndr_push_wbint_Principals(struct ndr_push *ndr, int ndr_flags, const struct wbint_Principals *r)
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]));
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]));
375 return NDR_ERR_SUCCESS;
378 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_Principals(struct ndr_pull *ndr, int ndr_flags, struct wbint_Principals *r)
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]));
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));
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]));
403 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_principals_0, 0);
405 return NDR_ERR_SUCCESS;
408 _PUBLIC_ void ndr_print_wbint_Principals(struct ndr_print *ndr, const char *name, const struct wbint_Principals *r)
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);
423 ndr->depth--;
424 ndr->depth--;
427 _PUBLIC_ enum ndr_err_code ndr_push_wbint_userinfos(struct ndr_push *ndr, int ndr_flags, const struct wbint_userinfos *r)
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]));
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]));
443 return NDR_ERR_SUCCESS;
446 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_userinfos(struct ndr_pull *ndr, int ndr_flags, struct wbint_userinfos *r)
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]));
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));
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]));
471 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_userinfos_0, 0);
473 return NDR_ERR_SUCCESS;
476 _PUBLIC_ void ndr_print_wbint_userinfos(struct ndr_print *ndr, const char *name, const struct wbint_userinfos *r)
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);
491 ndr->depth--;
492 ndr->depth--;
495 _PUBLIC_ enum ndr_err_code ndr_push_wbint_IdType(struct ndr_push *ndr, int ndr_flags, enum wbint_IdType r)
497 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
498 return NDR_ERR_SUCCESS;
501 _PUBLIC_ enum ndr_err_code ndr_pull_wbint_IdType(struct ndr_pull *ndr, int ndr_flags, enum wbint_IdType *r)
503 uint16_t v;
504 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
505 *r = v;
506 return NDR_ERR_SUCCESS;
509 _PUBLIC_ void ndr_print_wbint_IdType(struct ndr_print *ndr, const char *name, enum wbint_IdType r)
511 const char *val = NULL;
513 switch (r) {
514 case WBINT_ID_TYPE_NOT_SPECIFIED: val = "WBINT_ID_TYPE_NOT_SPECIFIED"; break;
515 case WBINT_ID_TYPE_UID: val = "WBINT_ID_TYPE_UID"; break;
516 case WBINT_ID_TYPE_GID: val = "WBINT_ID_TYPE_GID"; break;
518 ndr_print_enum(ndr, name, "ENUM", val, r);
521 static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r)
523 if (flags & NDR_IN) {
524 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
526 if (flags & NDR_OUT) {
527 if (r->out.out_data == NULL) {
528 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
530 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
532 return NDR_ERR_SUCCESS;
535 static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r)
537 TALLOC_CTX *_mem_save_out_data_0;
538 if (flags & NDR_IN) {
539 ZERO_STRUCT(r->out);
541 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
542 NDR_PULL_ALLOC(ndr, r->out.out_data);
543 ZERO_STRUCTP(r->out.out_data);
545 if (flags & NDR_OUT) {
546 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
547 NDR_PULL_ALLOC(ndr, r->out.out_data);
549 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
550 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
551 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
552 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
554 return NDR_ERR_SUCCESS;
557 _PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r)
559 ndr_print_struct(ndr, name, "wbint_Ping");
560 ndr->depth++;
561 if (flags & NDR_SET_VALUES) {
562 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
564 if (flags & NDR_IN) {
565 ndr_print_struct(ndr, "in", "wbint_Ping");
566 ndr->depth++;
567 ndr_print_uint32(ndr, "in_data", r->in.in_data);
568 ndr->depth--;
570 if (flags & NDR_OUT) {
571 ndr_print_struct(ndr, "out", "wbint_Ping");
572 ndr->depth++;
573 ndr_print_ptr(ndr, "out_data", r->out.out_data);
574 ndr->depth++;
575 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
576 ndr->depth--;
577 ndr->depth--;
579 ndr->depth--;
582 static enum ndr_err_code ndr_push_wbint_LookupSid(struct ndr_push *ndr, int flags, const struct wbint_LookupSid *r)
584 if (flags & NDR_IN) {
585 if (r->in.sid == NULL) {
586 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
588 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
590 if (flags & NDR_OUT) {
591 if (r->out.type == NULL) {
592 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
594 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
595 if (r->out.domain == NULL) {
596 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
598 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.domain));
599 if (*r->out.domain) {
600 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
601 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
602 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.domain, CH_UTF8)));
603 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.domain, ndr_charset_length(*r->out.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
605 if (r->out.name == NULL) {
606 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
608 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name));
609 if (*r->out.name) {
610 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
611 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
612 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.name, CH_UTF8)));
613 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.name, ndr_charset_length(*r->out.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
615 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
617 return NDR_ERR_SUCCESS;
620 static enum ndr_err_code ndr_pull_wbint_LookupSid(struct ndr_pull *ndr, int flags, struct wbint_LookupSid *r)
622 uint32_t _ptr_domain;
623 uint32_t _ptr_name;
624 TALLOC_CTX *_mem_save_sid_0;
625 TALLOC_CTX *_mem_save_type_0;
626 TALLOC_CTX *_mem_save_domain_0;
627 TALLOC_CTX *_mem_save_domain_1;
628 TALLOC_CTX *_mem_save_name_0;
629 TALLOC_CTX *_mem_save_name_1;
630 if (flags & NDR_IN) {
631 ZERO_STRUCT(r->out);
633 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
634 NDR_PULL_ALLOC(ndr, r->in.sid);
636 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
637 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
638 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
639 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
640 NDR_PULL_ALLOC(ndr, r->out.type);
641 ZERO_STRUCTP(r->out.type);
642 NDR_PULL_ALLOC(ndr, r->out.domain);
643 ZERO_STRUCTP(r->out.domain);
644 NDR_PULL_ALLOC(ndr, r->out.name);
645 ZERO_STRUCTP(r->out.name);
647 if (flags & NDR_OUT) {
648 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
649 NDR_PULL_ALLOC(ndr, r->out.type);
651 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
652 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
653 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
654 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
655 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
656 NDR_PULL_ALLOC(ndr, r->out.domain);
658 _mem_save_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
659 NDR_PULL_SET_MEM_CTX(ndr, r->out.domain, LIBNDR_FLAG_REF_ALLOC);
660 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain));
661 if (_ptr_domain) {
662 NDR_PULL_ALLOC(ndr, *r->out.domain);
663 } else {
664 *r->out.domain = NULL;
666 if (*r->out.domain) {
667 _mem_save_domain_1 = NDR_PULL_GET_MEM_CTX(ndr);
668 NDR_PULL_SET_MEM_CTX(ndr, *r->out.domain, 0);
669 NDR_CHECK(ndr_pull_array_size(ndr, r->out.domain));
670 NDR_CHECK(ndr_pull_array_length(ndr, r->out.domain));
671 if (ndr_get_array_length(ndr, r->out.domain) > ndr_get_array_size(ndr, r->out.domain)) {
672 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));
674 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t)));
675 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.domain, ndr_get_array_length(ndr, r->out.domain), sizeof(uint8_t), CH_UTF8));
676 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_1, 0);
678 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_0, LIBNDR_FLAG_REF_ALLOC);
679 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
680 NDR_PULL_ALLOC(ndr, r->out.name);
682 _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
683 NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
684 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
685 if (_ptr_name) {
686 NDR_PULL_ALLOC(ndr, *r->out.name);
687 } else {
688 *r->out.name = NULL;
690 if (*r->out.name) {
691 _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
692 NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0);
693 NDR_CHECK(ndr_pull_array_size(ndr, r->out.name));
694 NDR_CHECK(ndr_pull_array_length(ndr, r->out.name));
695 if (ndr_get_array_length(ndr, r->out.name) > ndr_get_array_size(ndr, r->out.name)) {
696 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));
698 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t)));
699 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.name, ndr_get_array_length(ndr, r->out.name), sizeof(uint8_t), CH_UTF8));
700 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0);
702 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
703 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
705 return NDR_ERR_SUCCESS;
708 _PUBLIC_ void ndr_print_wbint_LookupSid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupSid *r)
710 ndr_print_struct(ndr, name, "wbint_LookupSid");
711 ndr->depth++;
712 if (flags & NDR_SET_VALUES) {
713 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
715 if (flags & NDR_IN) {
716 ndr_print_struct(ndr, "in", "wbint_LookupSid");
717 ndr->depth++;
718 ndr_print_ptr(ndr, "sid", r->in.sid);
719 ndr->depth++;
720 ndr_print_dom_sid(ndr, "sid", r->in.sid);
721 ndr->depth--;
722 ndr->depth--;
724 if (flags & NDR_OUT) {
725 ndr_print_struct(ndr, "out", "wbint_LookupSid");
726 ndr->depth++;
727 ndr_print_ptr(ndr, "type", r->out.type);
728 ndr->depth++;
729 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
730 ndr->depth--;
731 ndr_print_ptr(ndr, "domain", r->out.domain);
732 ndr->depth++;
733 ndr_print_ptr(ndr, "domain", *r->out.domain);
734 ndr->depth++;
735 if (*r->out.domain) {
736 ndr_print_string(ndr, "domain", *r->out.domain);
738 ndr->depth--;
739 ndr->depth--;
740 ndr_print_ptr(ndr, "name", r->out.name);
741 ndr->depth++;
742 ndr_print_ptr(ndr, "name", *r->out.name);
743 ndr->depth++;
744 if (*r->out.name) {
745 ndr_print_string(ndr, "name", *r->out.name);
747 ndr->depth--;
748 ndr->depth--;
749 ndr_print_NTSTATUS(ndr, "result", r->out.result);
750 ndr->depth--;
752 ndr->depth--;
755 static enum ndr_err_code ndr_push_wbint_LookupName(struct ndr_push *ndr, int flags, const struct wbint_LookupName *r)
757 if (flags & NDR_IN) {
758 if (r->in.domain == NULL) {
759 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
761 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
762 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
763 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain, CH_UTF8)));
764 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain, ndr_charset_length(r->in.domain, CH_UTF8), sizeof(uint8_t), CH_UTF8));
765 if (r->in.name == NULL) {
766 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
768 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
769 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
770 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.name, CH_UTF8)));
771 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.name, ndr_charset_length(r->in.name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
772 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
774 if (flags & NDR_OUT) {
775 if (r->out.type == NULL) {
776 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
778 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, *r->out.type));
779 if (r->out.sid == NULL) {
780 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
782 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
783 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
785 return NDR_ERR_SUCCESS;
788 static enum ndr_err_code ndr_pull_wbint_LookupName(struct ndr_pull *ndr, int flags, struct wbint_LookupName *r)
790 TALLOC_CTX *_mem_save_type_0;
791 TALLOC_CTX *_mem_save_sid_0;
792 if (flags & NDR_IN) {
793 ZERO_STRUCT(r->out);
795 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain));
796 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain));
797 if (ndr_get_array_length(ndr, &r->in.domain) > ndr_get_array_size(ndr, &r->in.domain)) {
798 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));
800 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t)));
801 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain, ndr_get_array_length(ndr, &r->in.domain), sizeof(uint8_t), CH_UTF8));
802 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.name));
803 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.name));
804 if (ndr_get_array_length(ndr, &r->in.name) > ndr_get_array_size(ndr, &r->in.name)) {
805 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));
807 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t)));
808 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.name, ndr_get_array_length(ndr, &r->in.name), sizeof(uint8_t), CH_UTF8));
809 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
810 NDR_PULL_ALLOC(ndr, r->out.type);
811 ZERO_STRUCTP(r->out.type);
812 NDR_PULL_ALLOC(ndr, r->out.sid);
813 ZERO_STRUCTP(r->out.sid);
815 if (flags & NDR_OUT) {
816 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
817 NDR_PULL_ALLOC(ndr, r->out.type);
819 _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
820 NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC);
821 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, r->out.type));
822 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC);
823 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
824 NDR_PULL_ALLOC(ndr, r->out.sid);
826 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
827 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
828 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
829 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
830 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
832 return NDR_ERR_SUCCESS;
835 _PUBLIC_ void ndr_print_wbint_LookupName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupName *r)
837 ndr_print_struct(ndr, name, "wbint_LookupName");
838 ndr->depth++;
839 if (flags & NDR_SET_VALUES) {
840 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
842 if (flags & NDR_IN) {
843 ndr_print_struct(ndr, "in", "wbint_LookupName");
844 ndr->depth++;
845 ndr_print_ptr(ndr, "domain", r->in.domain);
846 ndr->depth++;
847 ndr_print_string(ndr, "domain", r->in.domain);
848 ndr->depth--;
849 ndr_print_ptr(ndr, "name", r->in.name);
850 ndr->depth++;
851 ndr_print_string(ndr, "name", r->in.name);
852 ndr->depth--;
853 ndr_print_uint32(ndr, "flags", r->in.flags);
854 ndr->depth--;
856 if (flags & NDR_OUT) {
857 ndr_print_struct(ndr, "out", "wbint_LookupName");
858 ndr->depth++;
859 ndr_print_ptr(ndr, "type", r->out.type);
860 ndr->depth++;
861 ndr_print_lsa_SidType(ndr, "type", *r->out.type);
862 ndr->depth--;
863 ndr_print_ptr(ndr, "sid", r->out.sid);
864 ndr->depth++;
865 ndr_print_dom_sid(ndr, "sid", r->out.sid);
866 ndr->depth--;
867 ndr_print_NTSTATUS(ndr, "result", r->out.result);
868 ndr->depth--;
870 ndr->depth--;
873 static enum ndr_err_code ndr_push_wbint_Sid2Uid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Uid *r)
875 if (flags & NDR_IN) {
876 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
877 if (r->in.dom_name) {
878 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
879 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
880 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
881 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));
883 if (r->in.sid == NULL) {
884 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
886 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
888 if (flags & NDR_OUT) {
889 if (r->out.uid == NULL) {
890 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
892 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
893 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
895 return NDR_ERR_SUCCESS;
898 static enum ndr_err_code ndr_pull_wbint_Sid2Uid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Uid *r)
900 uint32_t _ptr_dom_name;
901 TALLOC_CTX *_mem_save_dom_name_0;
902 TALLOC_CTX *_mem_save_sid_0;
903 TALLOC_CTX *_mem_save_uid_0;
904 if (flags & NDR_IN) {
905 ZERO_STRUCT(r->out);
907 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
908 if (_ptr_dom_name) {
909 NDR_PULL_ALLOC(ndr, r->in.dom_name);
910 } else {
911 r->in.dom_name = NULL;
913 if (r->in.dom_name) {
914 _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
915 NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
916 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
917 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
918 if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
919 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));
921 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
922 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));
923 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
925 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
926 NDR_PULL_ALLOC(ndr, r->in.sid);
928 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
929 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
930 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
931 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
932 NDR_PULL_ALLOC(ndr, r->out.uid);
933 ZERO_STRUCTP(r->out.uid);
935 if (flags & NDR_OUT) {
936 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
937 NDR_PULL_ALLOC(ndr, r->out.uid);
939 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
940 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
941 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
942 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
943 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
945 return NDR_ERR_SUCCESS;
948 _PUBLIC_ void ndr_print_wbint_Sid2Uid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Uid *r)
950 ndr_print_struct(ndr, name, "wbint_Sid2Uid");
951 ndr->depth++;
952 if (flags & NDR_SET_VALUES) {
953 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
955 if (flags & NDR_IN) {
956 ndr_print_struct(ndr, "in", "wbint_Sid2Uid");
957 ndr->depth++;
958 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
959 ndr->depth++;
960 if (r->in.dom_name) {
961 ndr_print_string(ndr, "dom_name", r->in.dom_name);
963 ndr->depth--;
964 ndr_print_ptr(ndr, "sid", r->in.sid);
965 ndr->depth++;
966 ndr_print_dom_sid(ndr, "sid", r->in.sid);
967 ndr->depth--;
968 ndr->depth--;
970 if (flags & NDR_OUT) {
971 ndr_print_struct(ndr, "out", "wbint_Sid2Uid");
972 ndr->depth++;
973 ndr_print_ptr(ndr, "uid", r->out.uid);
974 ndr->depth++;
975 ndr_print_hyper(ndr, "uid", *r->out.uid);
976 ndr->depth--;
977 ndr_print_NTSTATUS(ndr, "result", r->out.result);
978 ndr->depth--;
980 ndr->depth--;
983 static enum ndr_err_code ndr_push_wbint_Sid2Gid(struct ndr_push *ndr, int flags, const struct wbint_Sid2Gid *r)
985 if (flags & NDR_IN) {
986 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
987 if (r->in.dom_name) {
988 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
989 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
990 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
991 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));
993 if (r->in.sid == NULL) {
994 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
996 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
998 if (flags & NDR_OUT) {
999 if (r->out.gid == NULL) {
1000 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1002 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
1003 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1005 return NDR_ERR_SUCCESS;
1008 static enum ndr_err_code ndr_pull_wbint_Sid2Gid(struct ndr_pull *ndr, int flags, struct wbint_Sid2Gid *r)
1010 uint32_t _ptr_dom_name;
1011 TALLOC_CTX *_mem_save_dom_name_0;
1012 TALLOC_CTX *_mem_save_sid_0;
1013 TALLOC_CTX *_mem_save_gid_0;
1014 if (flags & NDR_IN) {
1015 ZERO_STRUCT(r->out);
1017 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1018 if (_ptr_dom_name) {
1019 NDR_PULL_ALLOC(ndr, r->in.dom_name);
1020 } else {
1021 r->in.dom_name = NULL;
1023 if (r->in.dom_name) {
1024 _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1025 NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1026 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1027 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1028 if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1029 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));
1031 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1032 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));
1033 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1035 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1036 NDR_PULL_ALLOC(ndr, r->in.sid);
1038 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1039 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1040 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1041 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1042 NDR_PULL_ALLOC(ndr, r->out.gid);
1043 ZERO_STRUCTP(r->out.gid);
1045 if (flags & NDR_OUT) {
1046 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1047 NDR_PULL_ALLOC(ndr, r->out.gid);
1049 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1050 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
1051 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
1052 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
1053 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1055 return NDR_ERR_SUCCESS;
1058 _PUBLIC_ void ndr_print_wbint_Sid2Gid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Sid2Gid *r)
1060 ndr_print_struct(ndr, name, "wbint_Sid2Gid");
1061 ndr->depth++;
1062 if (flags & NDR_SET_VALUES) {
1063 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1065 if (flags & NDR_IN) {
1066 ndr_print_struct(ndr, "in", "wbint_Sid2Gid");
1067 ndr->depth++;
1068 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1069 ndr->depth++;
1070 if (r->in.dom_name) {
1071 ndr_print_string(ndr, "dom_name", r->in.dom_name);
1073 ndr->depth--;
1074 ndr_print_ptr(ndr, "sid", r->in.sid);
1075 ndr->depth++;
1076 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1077 ndr->depth--;
1078 ndr->depth--;
1080 if (flags & NDR_OUT) {
1081 ndr_print_struct(ndr, "out", "wbint_Sid2Gid");
1082 ndr->depth++;
1083 ndr_print_ptr(ndr, "gid", r->out.gid);
1084 ndr->depth++;
1085 ndr_print_hyper(ndr, "gid", *r->out.gid);
1086 ndr->depth--;
1087 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1088 ndr->depth--;
1090 ndr->depth--;
1093 static enum ndr_err_code ndr_push_wbint_Uid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Uid2Sid *r)
1095 if (flags & NDR_IN) {
1096 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1097 if (r->in.dom_name) {
1098 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1099 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1100 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1101 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));
1103 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
1105 if (flags & NDR_OUT) {
1106 if (r->out.sid == NULL) {
1107 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1109 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1110 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1112 return NDR_ERR_SUCCESS;
1115 static enum ndr_err_code ndr_pull_wbint_Uid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Uid2Sid *r)
1117 uint32_t _ptr_dom_name;
1118 TALLOC_CTX *_mem_save_dom_name_0;
1119 TALLOC_CTX *_mem_save_sid_0;
1120 if (flags & NDR_IN) {
1121 ZERO_STRUCT(r->out);
1123 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1124 if (_ptr_dom_name) {
1125 NDR_PULL_ALLOC(ndr, r->in.dom_name);
1126 } else {
1127 r->in.dom_name = NULL;
1129 if (r->in.dom_name) {
1130 _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1131 NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1132 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1133 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1134 if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1135 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));
1137 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1138 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));
1139 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1141 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
1142 NDR_PULL_ALLOC(ndr, r->out.sid);
1143 ZERO_STRUCTP(r->out.sid);
1145 if (flags & NDR_OUT) {
1146 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1147 NDR_PULL_ALLOC(ndr, r->out.sid);
1149 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1150 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1151 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1152 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1153 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1155 return NDR_ERR_SUCCESS;
1158 _PUBLIC_ void ndr_print_wbint_Uid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Uid2Sid *r)
1160 ndr_print_struct(ndr, name, "wbint_Uid2Sid");
1161 ndr->depth++;
1162 if (flags & NDR_SET_VALUES) {
1163 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1165 if (flags & NDR_IN) {
1166 ndr_print_struct(ndr, "in", "wbint_Uid2Sid");
1167 ndr->depth++;
1168 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1169 ndr->depth++;
1170 if (r->in.dom_name) {
1171 ndr_print_string(ndr, "dom_name", r->in.dom_name);
1173 ndr->depth--;
1174 ndr_print_hyper(ndr, "uid", r->in.uid);
1175 ndr->depth--;
1177 if (flags & NDR_OUT) {
1178 ndr_print_struct(ndr, "out", "wbint_Uid2Sid");
1179 ndr->depth++;
1180 ndr_print_ptr(ndr, "sid", r->out.sid);
1181 ndr->depth++;
1182 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1183 ndr->depth--;
1184 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1185 ndr->depth--;
1187 ndr->depth--;
1190 static enum ndr_err_code ndr_push_wbint_Gid2Sid(struct ndr_push *ndr, int flags, const struct wbint_Gid2Sid *r)
1192 if (flags & NDR_IN) {
1193 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dom_name));
1194 if (r->in.dom_name) {
1195 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1196 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1197 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dom_name, CH_UTF8)));
1198 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));
1200 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
1202 if (flags & NDR_OUT) {
1203 if (r->out.sid == NULL) {
1204 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1206 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1207 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1209 return NDR_ERR_SUCCESS;
1212 static enum ndr_err_code ndr_pull_wbint_Gid2Sid(struct ndr_pull *ndr, int flags, struct wbint_Gid2Sid *r)
1214 uint32_t _ptr_dom_name;
1215 TALLOC_CTX *_mem_save_dom_name_0;
1216 TALLOC_CTX *_mem_save_sid_0;
1217 if (flags & NDR_IN) {
1218 ZERO_STRUCT(r->out);
1220 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dom_name));
1221 if (_ptr_dom_name) {
1222 NDR_PULL_ALLOC(ndr, r->in.dom_name);
1223 } else {
1224 r->in.dom_name = NULL;
1226 if (r->in.dom_name) {
1227 _mem_save_dom_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1228 NDR_PULL_SET_MEM_CTX(ndr, r->in.dom_name, 0);
1229 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dom_name));
1230 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dom_name));
1231 if (ndr_get_array_length(ndr, &r->in.dom_name) > ndr_get_array_size(ndr, &r->in.dom_name)) {
1232 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));
1234 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dom_name), sizeof(uint8_t)));
1235 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));
1236 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dom_name_0, 0);
1238 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
1239 NDR_PULL_ALLOC(ndr, r->out.sid);
1240 ZERO_STRUCTP(r->out.sid);
1242 if (flags & NDR_OUT) {
1243 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1244 NDR_PULL_ALLOC(ndr, r->out.sid);
1246 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1247 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
1248 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->out.sid));
1249 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1250 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1252 return NDR_ERR_SUCCESS;
1255 _PUBLIC_ void ndr_print_wbint_Gid2Sid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Gid2Sid *r)
1257 ndr_print_struct(ndr, name, "wbint_Gid2Sid");
1258 ndr->depth++;
1259 if (flags & NDR_SET_VALUES) {
1260 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1262 if (flags & NDR_IN) {
1263 ndr_print_struct(ndr, "in", "wbint_Gid2Sid");
1264 ndr->depth++;
1265 ndr_print_ptr(ndr, "dom_name", r->in.dom_name);
1266 ndr->depth++;
1267 if (r->in.dom_name) {
1268 ndr_print_string(ndr, "dom_name", r->in.dom_name);
1270 ndr->depth--;
1271 ndr_print_hyper(ndr, "gid", r->in.gid);
1272 ndr->depth--;
1274 if (flags & NDR_OUT) {
1275 ndr_print_struct(ndr, "out", "wbint_Gid2Sid");
1276 ndr->depth++;
1277 ndr_print_ptr(ndr, "sid", r->out.sid);
1278 ndr->depth++;
1279 ndr_print_dom_sid(ndr, "sid", r->out.sid);
1280 ndr->depth--;
1281 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1282 ndr->depth--;
1284 ndr->depth--;
1287 static enum ndr_err_code ndr_push_wbint_AllocateUid(struct ndr_push *ndr, int flags, const struct wbint_AllocateUid *r)
1289 if (flags & NDR_IN) {
1291 if (flags & NDR_OUT) {
1292 if (r->out.uid == NULL) {
1293 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1295 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
1296 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1298 return NDR_ERR_SUCCESS;
1301 static enum ndr_err_code ndr_pull_wbint_AllocateUid(struct ndr_pull *ndr, int flags, struct wbint_AllocateUid *r)
1303 TALLOC_CTX *_mem_save_uid_0;
1304 if (flags & NDR_IN) {
1305 ZERO_STRUCT(r->out);
1307 NDR_PULL_ALLOC(ndr, r->out.uid);
1308 ZERO_STRUCTP(r->out.uid);
1310 if (flags & NDR_OUT) {
1311 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1312 NDR_PULL_ALLOC(ndr, r->out.uid);
1314 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1315 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
1316 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
1317 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
1318 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1320 return NDR_ERR_SUCCESS;
1323 _PUBLIC_ void ndr_print_wbint_AllocateUid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_AllocateUid *r)
1325 ndr_print_struct(ndr, name, "wbint_AllocateUid");
1326 ndr->depth++;
1327 if (flags & NDR_SET_VALUES) {
1328 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1330 if (flags & NDR_IN) {
1331 ndr_print_struct(ndr, "in", "wbint_AllocateUid");
1332 ndr->depth++;
1333 ndr->depth--;
1335 if (flags & NDR_OUT) {
1336 ndr_print_struct(ndr, "out", "wbint_AllocateUid");
1337 ndr->depth++;
1338 ndr_print_ptr(ndr, "uid", r->out.uid);
1339 ndr->depth++;
1340 ndr_print_hyper(ndr, "uid", *r->out.uid);
1341 ndr->depth--;
1342 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1343 ndr->depth--;
1345 ndr->depth--;
1348 static enum ndr_err_code ndr_push_wbint_AllocateGid(struct ndr_push *ndr, int flags, const struct wbint_AllocateGid *r)
1350 if (flags & NDR_IN) {
1352 if (flags & NDR_OUT) {
1353 if (r->out.gid == NULL) {
1354 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1356 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
1357 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1359 return NDR_ERR_SUCCESS;
1362 static enum ndr_err_code ndr_pull_wbint_AllocateGid(struct ndr_pull *ndr, int flags, struct wbint_AllocateGid *r)
1364 TALLOC_CTX *_mem_save_gid_0;
1365 if (flags & NDR_IN) {
1366 ZERO_STRUCT(r->out);
1368 NDR_PULL_ALLOC(ndr, r->out.gid);
1369 ZERO_STRUCTP(r->out.gid);
1371 if (flags & NDR_OUT) {
1372 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1373 NDR_PULL_ALLOC(ndr, r->out.gid);
1375 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1376 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
1377 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
1378 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
1379 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1381 return NDR_ERR_SUCCESS;
1384 _PUBLIC_ void ndr_print_wbint_AllocateGid(struct ndr_print *ndr, const char *name, int flags, const struct wbint_AllocateGid *r)
1386 ndr_print_struct(ndr, name, "wbint_AllocateGid");
1387 ndr->depth++;
1388 if (flags & NDR_SET_VALUES) {
1389 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1391 if (flags & NDR_IN) {
1392 ndr_print_struct(ndr, "in", "wbint_AllocateGid");
1393 ndr->depth++;
1394 ndr->depth--;
1396 if (flags & NDR_OUT) {
1397 ndr_print_struct(ndr, "out", "wbint_AllocateGid");
1398 ndr->depth++;
1399 ndr_print_ptr(ndr, "gid", r->out.gid);
1400 ndr->depth++;
1401 ndr_print_hyper(ndr, "gid", *r->out.gid);
1402 ndr->depth--;
1403 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1404 ndr->depth--;
1406 ndr->depth--;
1409 static enum ndr_err_code ndr_push_wbint_QueryUser(struct ndr_push *ndr, int flags, const struct wbint_QueryUser *r)
1411 if (flags & NDR_IN) {
1412 if (r->in.sid == NULL) {
1413 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1415 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1417 if (flags & NDR_OUT) {
1418 if (r->out.info == NULL) {
1419 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1421 NDR_CHECK(ndr_push_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1422 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1424 return NDR_ERR_SUCCESS;
1427 static enum ndr_err_code ndr_pull_wbint_QueryUser(struct ndr_pull *ndr, int flags, struct wbint_QueryUser *r)
1429 TALLOC_CTX *_mem_save_sid_0;
1430 TALLOC_CTX *_mem_save_info_0;
1431 if (flags & NDR_IN) {
1432 ZERO_STRUCT(r->out);
1434 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1435 NDR_PULL_ALLOC(ndr, r->in.sid);
1437 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1438 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1439 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1440 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1441 NDR_PULL_ALLOC(ndr, r->out.info);
1442 ZERO_STRUCTP(r->out.info);
1444 if (flags & NDR_OUT) {
1445 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1446 NDR_PULL_ALLOC(ndr, r->out.info);
1448 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1449 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1450 NDR_CHECK(ndr_pull_wbint_userinfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.info));
1451 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1452 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1454 return NDR_ERR_SUCCESS;
1457 _PUBLIC_ void ndr_print_wbint_QueryUser(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUser *r)
1459 ndr_print_struct(ndr, name, "wbint_QueryUser");
1460 ndr->depth++;
1461 if (flags & NDR_SET_VALUES) {
1462 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1464 if (flags & NDR_IN) {
1465 ndr_print_struct(ndr, "in", "wbint_QueryUser");
1466 ndr->depth++;
1467 ndr_print_ptr(ndr, "sid", r->in.sid);
1468 ndr->depth++;
1469 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1470 ndr->depth--;
1471 ndr->depth--;
1473 if (flags & NDR_OUT) {
1474 ndr_print_struct(ndr, "out", "wbint_QueryUser");
1475 ndr->depth++;
1476 ndr_print_ptr(ndr, "info", r->out.info);
1477 ndr->depth++;
1478 ndr_print_wbint_userinfo(ndr, "info", r->out.info);
1479 ndr->depth--;
1480 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1481 ndr->depth--;
1483 ndr->depth--;
1486 static enum ndr_err_code ndr_push_wbint_LookupUserAliases(struct ndr_push *ndr, int flags, const struct wbint_LookupUserAliases *r)
1488 if (flags & NDR_IN) {
1489 if (r->in.sids == NULL) {
1490 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1492 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1494 if (flags & NDR_OUT) {
1495 if (r->out.rids == NULL) {
1496 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1498 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1499 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1501 return NDR_ERR_SUCCESS;
1504 static enum ndr_err_code ndr_pull_wbint_LookupUserAliases(struct ndr_pull *ndr, int flags, struct wbint_LookupUserAliases *r)
1506 TALLOC_CTX *_mem_save_sids_0;
1507 TALLOC_CTX *_mem_save_rids_0;
1508 if (flags & NDR_IN) {
1509 ZERO_STRUCT(r->out);
1511 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1512 NDR_PULL_ALLOC(ndr, r->in.sids);
1514 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1515 NDR_PULL_SET_MEM_CTX(ndr, r->in.sids, LIBNDR_FLAG_REF_ALLOC);
1516 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->in.sids));
1517 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1518 NDR_PULL_ALLOC(ndr, r->out.rids);
1519 ZERO_STRUCTP(r->out.rids);
1521 if (flags & NDR_OUT) {
1522 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1523 NDR_PULL_ALLOC(ndr, r->out.rids);
1525 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1526 NDR_PULL_SET_MEM_CTX(ndr, r->out.rids, LIBNDR_FLAG_REF_ALLOC);
1527 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->out.rids));
1528 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
1529 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1531 return NDR_ERR_SUCCESS;
1534 _PUBLIC_ void ndr_print_wbint_LookupUserAliases(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserAliases *r)
1536 ndr_print_struct(ndr, name, "wbint_LookupUserAliases");
1537 ndr->depth++;
1538 if (flags & NDR_SET_VALUES) {
1539 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1541 if (flags & NDR_IN) {
1542 ndr_print_struct(ndr, "in", "wbint_LookupUserAliases");
1543 ndr->depth++;
1544 ndr_print_ptr(ndr, "sids", r->in.sids);
1545 ndr->depth++;
1546 ndr_print_wbint_SidArray(ndr, "sids", r->in.sids);
1547 ndr->depth--;
1548 ndr->depth--;
1550 if (flags & NDR_OUT) {
1551 ndr_print_struct(ndr, "out", "wbint_LookupUserAliases");
1552 ndr->depth++;
1553 ndr_print_ptr(ndr, "rids", r->out.rids);
1554 ndr->depth++;
1555 ndr_print_wbint_RidArray(ndr, "rids", r->out.rids);
1556 ndr->depth--;
1557 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1558 ndr->depth--;
1560 ndr->depth--;
1563 static enum ndr_err_code ndr_push_wbint_LookupUserGroups(struct ndr_push *ndr, int flags, const struct wbint_LookupUserGroups *r)
1565 if (flags & NDR_IN) {
1566 if (r->in.sid == NULL) {
1567 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1569 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1571 if (flags & NDR_OUT) {
1572 if (r->out.sids == NULL) {
1573 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1575 NDR_CHECK(ndr_push_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1576 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1578 return NDR_ERR_SUCCESS;
1581 static enum ndr_err_code ndr_pull_wbint_LookupUserGroups(struct ndr_pull *ndr, int flags, struct wbint_LookupUserGroups *r)
1583 TALLOC_CTX *_mem_save_sid_0;
1584 TALLOC_CTX *_mem_save_sids_0;
1585 if (flags & NDR_IN) {
1586 ZERO_STRUCT(r->out);
1588 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1589 NDR_PULL_ALLOC(ndr, r->in.sid);
1591 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1592 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1593 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1594 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1595 NDR_PULL_ALLOC(ndr, r->out.sids);
1596 ZERO_STRUCTP(r->out.sids);
1598 if (flags & NDR_OUT) {
1599 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1600 NDR_PULL_ALLOC(ndr, r->out.sids);
1602 _mem_save_sids_0 = NDR_PULL_GET_MEM_CTX(ndr);
1603 NDR_PULL_SET_MEM_CTX(ndr, r->out.sids, LIBNDR_FLAG_REF_ALLOC);
1604 NDR_CHECK(ndr_pull_wbint_SidArray(ndr, NDR_SCALARS, r->out.sids));
1605 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sids_0, LIBNDR_FLAG_REF_ALLOC);
1606 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1608 return NDR_ERR_SUCCESS;
1611 _PUBLIC_ void ndr_print_wbint_LookupUserGroups(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupUserGroups *r)
1613 ndr_print_struct(ndr, name, "wbint_LookupUserGroups");
1614 ndr->depth++;
1615 if (flags & NDR_SET_VALUES) {
1616 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1618 if (flags & NDR_IN) {
1619 ndr_print_struct(ndr, "in", "wbint_LookupUserGroups");
1620 ndr->depth++;
1621 ndr_print_ptr(ndr, "sid", r->in.sid);
1622 ndr->depth++;
1623 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1624 ndr->depth--;
1625 ndr->depth--;
1627 if (flags & NDR_OUT) {
1628 ndr_print_struct(ndr, "out", "wbint_LookupUserGroups");
1629 ndr->depth++;
1630 ndr_print_ptr(ndr, "sids", r->out.sids);
1631 ndr->depth++;
1632 ndr_print_wbint_SidArray(ndr, "sids", r->out.sids);
1633 ndr->depth--;
1634 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1635 ndr->depth--;
1637 ndr->depth--;
1640 static enum ndr_err_code ndr_push_wbint_QuerySequenceNumber(struct ndr_push *ndr, int flags, const struct wbint_QuerySequenceNumber *r)
1642 if (flags & NDR_IN) {
1644 if (flags & NDR_OUT) {
1645 if (r->out.sequence == NULL) {
1646 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1648 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.sequence));
1649 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1651 return NDR_ERR_SUCCESS;
1654 static enum ndr_err_code ndr_pull_wbint_QuerySequenceNumber(struct ndr_pull *ndr, int flags, struct wbint_QuerySequenceNumber *r)
1656 TALLOC_CTX *_mem_save_sequence_0;
1657 if (flags & NDR_IN) {
1658 ZERO_STRUCT(r->out);
1660 NDR_PULL_ALLOC(ndr, r->out.sequence);
1661 ZERO_STRUCTP(r->out.sequence);
1663 if (flags & NDR_OUT) {
1664 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1665 NDR_PULL_ALLOC(ndr, r->out.sequence);
1667 _mem_save_sequence_0 = NDR_PULL_GET_MEM_CTX(ndr);
1668 NDR_PULL_SET_MEM_CTX(ndr, r->out.sequence, LIBNDR_FLAG_REF_ALLOC);
1669 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.sequence));
1670 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sequence_0, LIBNDR_FLAG_REF_ALLOC);
1671 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1673 return NDR_ERR_SUCCESS;
1676 _PUBLIC_ void ndr_print_wbint_QuerySequenceNumber(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QuerySequenceNumber *r)
1678 ndr_print_struct(ndr, name, "wbint_QuerySequenceNumber");
1679 ndr->depth++;
1680 if (flags & NDR_SET_VALUES) {
1681 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1683 if (flags & NDR_IN) {
1684 ndr_print_struct(ndr, "in", "wbint_QuerySequenceNumber");
1685 ndr->depth++;
1686 ndr->depth--;
1688 if (flags & NDR_OUT) {
1689 ndr_print_struct(ndr, "out", "wbint_QuerySequenceNumber");
1690 ndr->depth++;
1691 ndr_print_ptr(ndr, "sequence", r->out.sequence);
1692 ndr->depth++;
1693 ndr_print_uint32(ndr, "sequence", *r->out.sequence);
1694 ndr->depth--;
1695 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1696 ndr->depth--;
1698 ndr->depth--;
1701 static enum ndr_err_code ndr_push_wbint_LookupGroupMembers(struct ndr_push *ndr, int flags, const struct wbint_LookupGroupMembers *r)
1703 if (flags & NDR_IN) {
1704 if (r->in.sid == NULL) {
1705 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1707 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1708 NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->in.type));
1710 if (flags & NDR_OUT) {
1711 if (r->out.members == NULL) {
1712 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1714 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1715 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1717 return NDR_ERR_SUCCESS;
1720 static enum ndr_err_code ndr_pull_wbint_LookupGroupMembers(struct ndr_pull *ndr, int flags, struct wbint_LookupGroupMembers *r)
1722 TALLOC_CTX *_mem_save_sid_0;
1723 TALLOC_CTX *_mem_save_members_0;
1724 if (flags & NDR_IN) {
1725 ZERO_STRUCT(r->out);
1727 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1728 NDR_PULL_ALLOC(ndr, r->in.sid);
1730 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1731 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
1732 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
1733 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
1734 NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->in.type));
1735 NDR_PULL_ALLOC(ndr, r->out.members);
1736 ZERO_STRUCTP(r->out.members);
1738 if (flags & NDR_OUT) {
1739 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1740 NDR_PULL_ALLOC(ndr, r->out.members);
1742 _mem_save_members_0 = NDR_PULL_GET_MEM_CTX(ndr);
1743 NDR_PULL_SET_MEM_CTX(ndr, r->out.members, LIBNDR_FLAG_REF_ALLOC);
1744 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.members));
1745 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_members_0, LIBNDR_FLAG_REF_ALLOC);
1746 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1748 return NDR_ERR_SUCCESS;
1751 _PUBLIC_ void ndr_print_wbint_LookupGroupMembers(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupGroupMembers *r)
1753 ndr_print_struct(ndr, name, "wbint_LookupGroupMembers");
1754 ndr->depth++;
1755 if (flags & NDR_SET_VALUES) {
1756 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1758 if (flags & NDR_IN) {
1759 ndr_print_struct(ndr, "in", "wbint_LookupGroupMembers");
1760 ndr->depth++;
1761 ndr_print_ptr(ndr, "sid", r->in.sid);
1762 ndr->depth++;
1763 ndr_print_dom_sid(ndr, "sid", r->in.sid);
1764 ndr->depth--;
1765 ndr_print_lsa_SidType(ndr, "type", r->in.type);
1766 ndr->depth--;
1768 if (flags & NDR_OUT) {
1769 ndr_print_struct(ndr, "out", "wbint_LookupGroupMembers");
1770 ndr->depth++;
1771 ndr_print_ptr(ndr, "members", r->out.members);
1772 ndr->depth++;
1773 ndr_print_wbint_Principals(ndr, "members", r->out.members);
1774 ndr->depth--;
1775 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1776 ndr->depth--;
1778 ndr->depth--;
1781 static enum ndr_err_code ndr_push_wbint_QueryUserList(struct ndr_push *ndr, int flags, const struct wbint_QueryUserList *r)
1783 if (flags & NDR_IN) {
1785 if (flags & NDR_OUT) {
1786 if (r->out.users == NULL) {
1787 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1789 NDR_CHECK(ndr_push_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1790 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1792 return NDR_ERR_SUCCESS;
1795 static enum ndr_err_code ndr_pull_wbint_QueryUserList(struct ndr_pull *ndr, int flags, struct wbint_QueryUserList *r)
1797 TALLOC_CTX *_mem_save_users_0;
1798 if (flags & NDR_IN) {
1799 ZERO_STRUCT(r->out);
1801 NDR_PULL_ALLOC(ndr, r->out.users);
1802 ZERO_STRUCTP(r->out.users);
1804 if (flags & NDR_OUT) {
1805 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1806 NDR_PULL_ALLOC(ndr, r->out.users);
1808 _mem_save_users_0 = NDR_PULL_GET_MEM_CTX(ndr);
1809 NDR_PULL_SET_MEM_CTX(ndr, r->out.users, LIBNDR_FLAG_REF_ALLOC);
1810 NDR_CHECK(ndr_pull_wbint_userinfos(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.users));
1811 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_users_0, LIBNDR_FLAG_REF_ALLOC);
1812 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1814 return NDR_ERR_SUCCESS;
1817 _PUBLIC_ void ndr_print_wbint_QueryUserList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryUserList *r)
1819 ndr_print_struct(ndr, name, "wbint_QueryUserList");
1820 ndr->depth++;
1821 if (flags & NDR_SET_VALUES) {
1822 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1824 if (flags & NDR_IN) {
1825 ndr_print_struct(ndr, "in", "wbint_QueryUserList");
1826 ndr->depth++;
1827 ndr->depth--;
1829 if (flags & NDR_OUT) {
1830 ndr_print_struct(ndr, "out", "wbint_QueryUserList");
1831 ndr->depth++;
1832 ndr_print_ptr(ndr, "users", r->out.users);
1833 ndr->depth++;
1834 ndr_print_wbint_userinfos(ndr, "users", r->out.users);
1835 ndr->depth--;
1836 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1837 ndr->depth--;
1839 ndr->depth--;
1842 static enum ndr_err_code ndr_push_wbint_QueryGroupList(struct ndr_push *ndr, int flags, const struct wbint_QueryGroupList *r)
1844 if (flags & NDR_IN) {
1846 if (flags & NDR_OUT) {
1847 if (r->out.groups == NULL) {
1848 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1850 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
1851 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1853 return NDR_ERR_SUCCESS;
1856 static enum ndr_err_code ndr_pull_wbint_QueryGroupList(struct ndr_pull *ndr, int flags, struct wbint_QueryGroupList *r)
1858 TALLOC_CTX *_mem_save_groups_0;
1859 if (flags & NDR_IN) {
1860 ZERO_STRUCT(r->out);
1862 NDR_PULL_ALLOC(ndr, r->out.groups);
1863 ZERO_STRUCTP(r->out.groups);
1865 if (flags & NDR_OUT) {
1866 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1867 NDR_PULL_ALLOC(ndr, r->out.groups);
1869 _mem_save_groups_0 = NDR_PULL_GET_MEM_CTX(ndr);
1870 NDR_PULL_SET_MEM_CTX(ndr, r->out.groups, LIBNDR_FLAG_REF_ALLOC);
1871 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.groups));
1872 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_groups_0, LIBNDR_FLAG_REF_ALLOC);
1873 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1875 return NDR_ERR_SUCCESS;
1878 _PUBLIC_ void ndr_print_wbint_QueryGroupList(struct ndr_print *ndr, const char *name, int flags, const struct wbint_QueryGroupList *r)
1880 ndr_print_struct(ndr, name, "wbint_QueryGroupList");
1881 ndr->depth++;
1882 if (flags & NDR_SET_VALUES) {
1883 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1885 if (flags & NDR_IN) {
1886 ndr_print_struct(ndr, "in", "wbint_QueryGroupList");
1887 ndr->depth++;
1888 ndr->depth--;
1890 if (flags & NDR_OUT) {
1891 ndr_print_struct(ndr, "out", "wbint_QueryGroupList");
1892 ndr->depth++;
1893 ndr_print_ptr(ndr, "groups", r->out.groups);
1894 ndr->depth++;
1895 ndr_print_wbint_Principals(ndr, "groups", r->out.groups);
1896 ndr->depth--;
1897 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1898 ndr->depth--;
1900 ndr->depth--;
1903 static enum ndr_err_code ndr_push_wbint_DsGetDcName(struct ndr_push *ndr, int flags, const struct wbint_DsGetDcName *r)
1905 if (flags & NDR_IN) {
1906 if (r->in.domain_name == NULL) {
1907 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1909 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
1910 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1911 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
1912 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));
1913 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.domain_guid));
1914 if (r->in.domain_guid) {
1915 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
1917 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.site_name));
1918 if (r->in.site_name) {
1919 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
1920 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
1921 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.site_name, CH_UTF8)));
1922 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));
1924 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.flags));
1926 if (flags & NDR_OUT) {
1927 if (r->out.dc_info == NULL) {
1928 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1930 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.dc_info));
1931 if (*r->out.dc_info) {
1932 NDR_CHECK(ndr_push_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
1934 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
1936 return NDR_ERR_SUCCESS;
1939 static enum ndr_err_code ndr_pull_wbint_DsGetDcName(struct ndr_pull *ndr, int flags, struct wbint_DsGetDcName *r)
1941 uint32_t _ptr_domain_guid;
1942 uint32_t _ptr_site_name;
1943 uint32_t _ptr_dc_info;
1944 TALLOC_CTX *_mem_save_domain_guid_0;
1945 TALLOC_CTX *_mem_save_site_name_0;
1946 TALLOC_CTX *_mem_save_dc_info_0;
1947 TALLOC_CTX *_mem_save_dc_info_1;
1948 if (flags & NDR_IN) {
1949 ZERO_STRUCT(r->out);
1951 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
1952 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
1953 if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
1954 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));
1956 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t)));
1957 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));
1958 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_domain_guid));
1959 if (_ptr_domain_guid) {
1960 NDR_PULL_ALLOC(ndr, r->in.domain_guid);
1961 } else {
1962 r->in.domain_guid = NULL;
1964 if (r->in.domain_guid) {
1965 _mem_save_domain_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
1966 NDR_PULL_SET_MEM_CTX(ndr, r->in.domain_guid, 0);
1967 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, r->in.domain_guid));
1968 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_guid_0, 0);
1970 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_site_name));
1971 if (_ptr_site_name) {
1972 NDR_PULL_ALLOC(ndr, r->in.site_name);
1973 } else {
1974 r->in.site_name = NULL;
1976 if (r->in.site_name) {
1977 _mem_save_site_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
1978 NDR_PULL_SET_MEM_CTX(ndr, r->in.site_name, 0);
1979 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.site_name));
1980 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.site_name));
1981 if (ndr_get_array_length(ndr, &r->in.site_name) > ndr_get_array_size(ndr, &r->in.site_name)) {
1982 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));
1984 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.site_name), sizeof(uint8_t)));
1985 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));
1986 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_site_name_0, 0);
1988 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.flags));
1989 NDR_PULL_ALLOC(ndr, r->out.dc_info);
1990 ZERO_STRUCTP(r->out.dc_info);
1992 if (flags & NDR_OUT) {
1993 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1994 NDR_PULL_ALLOC(ndr, r->out.dc_info);
1996 _mem_save_dc_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1997 NDR_PULL_SET_MEM_CTX(ndr, r->out.dc_info, LIBNDR_FLAG_REF_ALLOC);
1998 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_info));
1999 if (_ptr_dc_info) {
2000 NDR_PULL_ALLOC(ndr, *r->out.dc_info);
2001 } else {
2002 *r->out.dc_info = NULL;
2004 if (*r->out.dc_info) {
2005 _mem_save_dc_info_1 = NDR_PULL_GET_MEM_CTX(ndr);
2006 NDR_PULL_SET_MEM_CTX(ndr, *r->out.dc_info, 0);
2007 NDR_CHECK(ndr_pull_netr_DsRGetDCNameInfo(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.dc_info));
2008 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_1, 0);
2010 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_0, LIBNDR_FLAG_REF_ALLOC);
2011 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2013 return NDR_ERR_SUCCESS;
2016 _PUBLIC_ void ndr_print_wbint_DsGetDcName(struct ndr_print *ndr, const char *name, int flags, const struct wbint_DsGetDcName *r)
2018 ndr_print_struct(ndr, name, "wbint_DsGetDcName");
2019 ndr->depth++;
2020 if (flags & NDR_SET_VALUES) {
2021 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2023 if (flags & NDR_IN) {
2024 ndr_print_struct(ndr, "in", "wbint_DsGetDcName");
2025 ndr->depth++;
2026 ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
2027 ndr->depth++;
2028 ndr_print_string(ndr, "domain_name", r->in.domain_name);
2029 ndr->depth--;
2030 ndr_print_ptr(ndr, "domain_guid", r->in.domain_guid);
2031 ndr->depth++;
2032 if (r->in.domain_guid) {
2033 ndr_print_GUID(ndr, "domain_guid", r->in.domain_guid);
2035 ndr->depth--;
2036 ndr_print_ptr(ndr, "site_name", r->in.site_name);
2037 ndr->depth++;
2038 if (r->in.site_name) {
2039 ndr_print_string(ndr, "site_name", r->in.site_name);
2041 ndr->depth--;
2042 ndr_print_uint32(ndr, "flags", r->in.flags);
2043 ndr->depth--;
2045 if (flags & NDR_OUT) {
2046 ndr_print_struct(ndr, "out", "wbint_DsGetDcName");
2047 ndr->depth++;
2048 ndr_print_ptr(ndr, "dc_info", r->out.dc_info);
2049 ndr->depth++;
2050 ndr_print_ptr(ndr, "dc_info", *r->out.dc_info);
2051 ndr->depth++;
2052 if (*r->out.dc_info) {
2053 ndr_print_netr_DsRGetDCNameInfo(ndr, "dc_info", *r->out.dc_info);
2055 ndr->depth--;
2056 ndr->depth--;
2057 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2058 ndr->depth--;
2060 ndr->depth--;
2063 static enum ndr_err_code ndr_push_wbint_LookupRids(struct ndr_push *ndr, int flags, const struct wbint_LookupRids *r)
2065 if (flags & NDR_IN) {
2066 if (r->in.rids == NULL) {
2067 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2069 NDR_CHECK(ndr_push_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
2071 if (flags & NDR_OUT) {
2072 if (r->out.names == NULL) {
2073 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2075 NDR_CHECK(ndr_push_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
2076 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2078 return NDR_ERR_SUCCESS;
2081 static enum ndr_err_code ndr_pull_wbint_LookupRids(struct ndr_pull *ndr, int flags, struct wbint_LookupRids *r)
2083 TALLOC_CTX *_mem_save_rids_0;
2084 TALLOC_CTX *_mem_save_names_0;
2085 if (flags & NDR_IN) {
2086 ZERO_STRUCT(r->out);
2088 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2089 NDR_PULL_ALLOC(ndr, r->in.rids);
2091 _mem_save_rids_0 = NDR_PULL_GET_MEM_CTX(ndr);
2092 NDR_PULL_SET_MEM_CTX(ndr, r->in.rids, LIBNDR_FLAG_REF_ALLOC);
2093 NDR_CHECK(ndr_pull_wbint_RidArray(ndr, NDR_SCALARS, r->in.rids));
2094 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rids_0, LIBNDR_FLAG_REF_ALLOC);
2095 NDR_PULL_ALLOC(ndr, r->out.names);
2096 ZERO_STRUCTP(r->out.names);
2098 if (flags & NDR_OUT) {
2099 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2100 NDR_PULL_ALLOC(ndr, r->out.names);
2102 _mem_save_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
2103 NDR_PULL_SET_MEM_CTX(ndr, r->out.names, LIBNDR_FLAG_REF_ALLOC);
2104 NDR_CHECK(ndr_pull_wbint_Principals(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.names));
2105 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_names_0, LIBNDR_FLAG_REF_ALLOC);
2106 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2108 return NDR_ERR_SUCCESS;
2111 _PUBLIC_ void ndr_print_wbint_LookupRids(struct ndr_print *ndr, const char *name, int flags, const struct wbint_LookupRids *r)
2113 ndr_print_struct(ndr, name, "wbint_LookupRids");
2114 ndr->depth++;
2115 if (flags & NDR_SET_VALUES) {
2116 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2118 if (flags & NDR_IN) {
2119 ndr_print_struct(ndr, "in", "wbint_LookupRids");
2120 ndr->depth++;
2121 ndr_print_ptr(ndr, "rids", r->in.rids);
2122 ndr->depth++;
2123 ndr_print_wbint_RidArray(ndr, "rids", r->in.rids);
2124 ndr->depth--;
2125 ndr->depth--;
2127 if (flags & NDR_OUT) {
2128 ndr_print_struct(ndr, "out", "wbint_LookupRids");
2129 ndr->depth++;
2130 ndr_print_ptr(ndr, "names", r->out.names);
2131 ndr->depth++;
2132 ndr_print_wbint_Principals(ndr, "names", r->out.names);
2133 ndr->depth--;
2134 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2135 ndr->depth--;
2137 ndr->depth--;
2140 static enum ndr_err_code ndr_push_wbint_CheckMachineAccount(struct ndr_push *ndr, int flags, const struct wbint_CheckMachineAccount *r)
2142 if (flags & NDR_IN) {
2144 if (flags & NDR_OUT) {
2145 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2147 return NDR_ERR_SUCCESS;
2150 static enum ndr_err_code ndr_pull_wbint_CheckMachineAccount(struct ndr_pull *ndr, int flags, struct wbint_CheckMachineAccount *r)
2152 if (flags & NDR_IN) {
2154 if (flags & NDR_OUT) {
2155 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2157 return NDR_ERR_SUCCESS;
2160 _PUBLIC_ void ndr_print_wbint_CheckMachineAccount(struct ndr_print *ndr, const char *name, int flags, const struct wbint_CheckMachineAccount *r)
2162 ndr_print_struct(ndr, name, "wbint_CheckMachineAccount");
2163 ndr->depth++;
2164 if (flags & NDR_SET_VALUES) {
2165 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2167 if (flags & NDR_IN) {
2168 ndr_print_struct(ndr, "in", "wbint_CheckMachineAccount");
2169 ndr->depth++;
2170 ndr->depth--;
2172 if (flags & NDR_OUT) {
2173 ndr_print_struct(ndr, "out", "wbint_CheckMachineAccount");
2174 ndr->depth++;
2175 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2176 ndr->depth--;
2178 ndr->depth--;
2181 static enum ndr_err_code ndr_push_wbint_SetMapping(struct ndr_push *ndr, int flags, const struct wbint_SetMapping *r)
2183 if (flags & NDR_IN) {
2184 if (r->in.sid == NULL) {
2185 return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2187 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->in.sid));
2188 NDR_CHECK(ndr_push_wbint_IdType(ndr, NDR_SCALARS, r->in.type));
2189 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.id));
2191 if (flags & NDR_OUT) {
2192 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
2194 return NDR_ERR_SUCCESS;
2197 static enum ndr_err_code ndr_pull_wbint_SetMapping(struct ndr_pull *ndr, int flags, struct wbint_SetMapping *r)
2199 TALLOC_CTX *_mem_save_sid_0;
2200 if (flags & NDR_IN) {
2201 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2202 NDR_PULL_ALLOC(ndr, r->in.sid);
2204 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
2205 NDR_PULL_SET_MEM_CTX(ndr, r->in.sid, LIBNDR_FLAG_REF_ALLOC);
2206 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, r->in.sid));
2207 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
2208 NDR_CHECK(ndr_pull_wbint_IdType(ndr, NDR_SCALARS, &r->in.type));
2209 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.id));
2211 if (flags & NDR_OUT) {
2212 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
2214 return NDR_ERR_SUCCESS;
2217 _PUBLIC_ void ndr_print_wbint_SetMapping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_SetMapping *r)
2219 ndr_print_struct(ndr, name, "wbint_SetMapping");
2220 ndr->depth++;
2221 if (flags & NDR_SET_VALUES) {
2222 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2224 if (flags & NDR_IN) {
2225 ndr_print_struct(ndr, "in", "wbint_SetMapping");
2226 ndr->depth++;
2227 ndr_print_ptr(ndr, "sid", r->in.sid);
2228 ndr->depth++;
2229 ndr_print_dom_sid(ndr, "sid", r->in.sid);
2230 ndr->depth--;
2231 ndr_print_wbint_IdType(ndr, "type", r->in.type);
2232 ndr_print_hyper(ndr, "id", r->in.id);
2233 ndr->depth--;
2235 if (flags & NDR_OUT) {
2236 ndr_print_struct(ndr, "out", "wbint_SetMapping");
2237 ndr->depth++;
2238 ndr_print_NTSTATUS(ndr, "result", r->out.result);
2239 ndr->depth--;
2241 ndr->depth--;
2244 static const struct ndr_interface_call wbint_calls[] = {
2246 "wbint_Ping",
2247 sizeof(struct wbint_Ping),
2248 (ndr_push_flags_fn_t) ndr_push_wbint_Ping,
2249 (ndr_pull_flags_fn_t) ndr_pull_wbint_Ping,
2250 (ndr_print_function_t) ndr_print_wbint_Ping,
2251 false,
2254 "wbint_LookupSid",
2255 sizeof(struct wbint_LookupSid),
2256 (ndr_push_flags_fn_t) ndr_push_wbint_LookupSid,
2257 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupSid,
2258 (ndr_print_function_t) ndr_print_wbint_LookupSid,
2259 false,
2262 "wbint_LookupName",
2263 sizeof(struct wbint_LookupName),
2264 (ndr_push_flags_fn_t) ndr_push_wbint_LookupName,
2265 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupName,
2266 (ndr_print_function_t) ndr_print_wbint_LookupName,
2267 false,
2270 "wbint_Sid2Uid",
2271 sizeof(struct wbint_Sid2Uid),
2272 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Uid,
2273 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Uid,
2274 (ndr_print_function_t) ndr_print_wbint_Sid2Uid,
2275 false,
2278 "wbint_Sid2Gid",
2279 sizeof(struct wbint_Sid2Gid),
2280 (ndr_push_flags_fn_t) ndr_push_wbint_Sid2Gid,
2281 (ndr_pull_flags_fn_t) ndr_pull_wbint_Sid2Gid,
2282 (ndr_print_function_t) ndr_print_wbint_Sid2Gid,
2283 false,
2286 "wbint_Uid2Sid",
2287 sizeof(struct wbint_Uid2Sid),
2288 (ndr_push_flags_fn_t) ndr_push_wbint_Uid2Sid,
2289 (ndr_pull_flags_fn_t) ndr_pull_wbint_Uid2Sid,
2290 (ndr_print_function_t) ndr_print_wbint_Uid2Sid,
2291 false,
2294 "wbint_Gid2Sid",
2295 sizeof(struct wbint_Gid2Sid),
2296 (ndr_push_flags_fn_t) ndr_push_wbint_Gid2Sid,
2297 (ndr_pull_flags_fn_t) ndr_pull_wbint_Gid2Sid,
2298 (ndr_print_function_t) ndr_print_wbint_Gid2Sid,
2299 false,
2302 "wbint_AllocateUid",
2303 sizeof(struct wbint_AllocateUid),
2304 (ndr_push_flags_fn_t) ndr_push_wbint_AllocateUid,
2305 (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateUid,
2306 (ndr_print_function_t) ndr_print_wbint_AllocateUid,
2307 false,
2310 "wbint_AllocateGid",
2311 sizeof(struct wbint_AllocateGid),
2312 (ndr_push_flags_fn_t) ndr_push_wbint_AllocateGid,
2313 (ndr_pull_flags_fn_t) ndr_pull_wbint_AllocateGid,
2314 (ndr_print_function_t) ndr_print_wbint_AllocateGid,
2315 false,
2318 "wbint_QueryUser",
2319 sizeof(struct wbint_QueryUser),
2320 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUser,
2321 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUser,
2322 (ndr_print_function_t) ndr_print_wbint_QueryUser,
2323 false,
2326 "wbint_LookupUserAliases",
2327 sizeof(struct wbint_LookupUserAliases),
2328 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserAliases,
2329 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserAliases,
2330 (ndr_print_function_t) ndr_print_wbint_LookupUserAliases,
2331 false,
2334 "wbint_LookupUserGroups",
2335 sizeof(struct wbint_LookupUserGroups),
2336 (ndr_push_flags_fn_t) ndr_push_wbint_LookupUserGroups,
2337 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupUserGroups,
2338 (ndr_print_function_t) ndr_print_wbint_LookupUserGroups,
2339 false,
2342 "wbint_QuerySequenceNumber",
2343 sizeof(struct wbint_QuerySequenceNumber),
2344 (ndr_push_flags_fn_t) ndr_push_wbint_QuerySequenceNumber,
2345 (ndr_pull_flags_fn_t) ndr_pull_wbint_QuerySequenceNumber,
2346 (ndr_print_function_t) ndr_print_wbint_QuerySequenceNumber,
2347 false,
2350 "wbint_LookupGroupMembers",
2351 sizeof(struct wbint_LookupGroupMembers),
2352 (ndr_push_flags_fn_t) ndr_push_wbint_LookupGroupMembers,
2353 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupGroupMembers,
2354 (ndr_print_function_t) ndr_print_wbint_LookupGroupMembers,
2355 false,
2358 "wbint_QueryUserList",
2359 sizeof(struct wbint_QueryUserList),
2360 (ndr_push_flags_fn_t) ndr_push_wbint_QueryUserList,
2361 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryUserList,
2362 (ndr_print_function_t) ndr_print_wbint_QueryUserList,
2363 false,
2366 "wbint_QueryGroupList",
2367 sizeof(struct wbint_QueryGroupList),
2368 (ndr_push_flags_fn_t) ndr_push_wbint_QueryGroupList,
2369 (ndr_pull_flags_fn_t) ndr_pull_wbint_QueryGroupList,
2370 (ndr_print_function_t) ndr_print_wbint_QueryGroupList,
2371 false,
2374 "wbint_DsGetDcName",
2375 sizeof(struct wbint_DsGetDcName),
2376 (ndr_push_flags_fn_t) ndr_push_wbint_DsGetDcName,
2377 (ndr_pull_flags_fn_t) ndr_pull_wbint_DsGetDcName,
2378 (ndr_print_function_t) ndr_print_wbint_DsGetDcName,
2379 false,
2382 "wbint_LookupRids",
2383 sizeof(struct wbint_LookupRids),
2384 (ndr_push_flags_fn_t) ndr_push_wbint_LookupRids,
2385 (ndr_pull_flags_fn_t) ndr_pull_wbint_LookupRids,
2386 (ndr_print_function_t) ndr_print_wbint_LookupRids,
2387 false,
2390 "wbint_CheckMachineAccount",
2391 sizeof(struct wbint_CheckMachineAccount),
2392 (ndr_push_flags_fn_t) ndr_push_wbint_CheckMachineAccount,
2393 (ndr_pull_flags_fn_t) ndr_pull_wbint_CheckMachineAccount,
2394 (ndr_print_function_t) ndr_print_wbint_CheckMachineAccount,
2395 false,
2398 "wbint_SetMapping",
2399 sizeof(struct wbint_SetMapping),
2400 (ndr_push_flags_fn_t) ndr_push_wbint_SetMapping,
2401 (ndr_pull_flags_fn_t) ndr_pull_wbint_SetMapping,
2402 (ndr_print_function_t) ndr_print_wbint_SetMapping,
2403 false,
2405 { NULL, 0, NULL, NULL, NULL, false }
2408 static const char * const wbint_endpoint_strings[] = {
2409 "ncalrpc:",
2412 static const struct ndr_interface_string_array wbint_endpoints = {
2413 .count = 1,
2414 .names = wbint_endpoint_strings
2417 static const char * const wbint_authservice_strings[] = {
2418 "host",
2421 static const struct ndr_interface_string_array wbint_authservices = {
2422 .count = 1,
2423 .names = wbint_authservice_strings
2427 const struct ndr_interface_table ndr_table_wbint = {
2428 .name = "wbint",
2429 .syntax_id = {
2430 {0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}},
2431 NDR_WBINT_VERSION
2433 .helpstring = NDR_WBINT_HELPSTRING,
2434 .num_calls = 20,
2435 .calls = wbint_calls,
2436 .endpoints = &wbint_endpoints,
2437 .authservices = &wbint_authservices