s3: Fix bug 7842: WINBINDD_LOOKUPRIDS does not return the domain name
[Samba.git] / source3 / librpc / gen_ndr / srv_wbint.c
blobafa50cac5fee4c2ff992fc371f1544c926edc06c
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_wbint.h"
9 static bool api_wbint_Ping(pipes_struct *p)
11 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct wbint_Ping *r;
18 call = &ndr_table_wbint.calls[NDR_WBINT_PING];
20 r = talloc(talloc_tos(), struct wbint_Ping);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(wbint_Ping, r);
47 ZERO_STRUCT(r->out);
48 r->out.out_data = talloc_zero(r, uint32_t);
49 if (r->out.out_data == NULL) {
50 talloc_free(r);
51 return false;
54 _wbint_Ping(p, r);
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(wbint_Ping, r);
66 push = ndr_push_init_ctx(r, NULL);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74 talloc_free(r);
75 return false;
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80 talloc_free(r);
81 return false;
84 talloc_free(r);
86 return true;
89 static bool api_wbint_LookupSid(pipes_struct *p)
91 const struct ndr_interface_call *call;
92 struct ndr_pull *pull;
93 struct ndr_push *push;
94 enum ndr_err_code ndr_err;
95 DATA_BLOB blob;
96 struct wbint_LookupSid *r;
98 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPSID];
100 r = talloc(talloc_tos(), struct wbint_LookupSid);
101 if (r == NULL) {
102 return false;
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
110 pull = ndr_pull_init_blob(&blob, r, NULL);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
116 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117 ndr_err = call->ndr_pull(pull, NDR_IN, r);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119 talloc_free(r);
120 return false;
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(wbint_LookupSid, r);
127 ZERO_STRUCT(r->out);
128 r->out.type = talloc_zero(r, enum lsa_SidType);
129 if (r->out.type == NULL) {
130 talloc_free(r);
131 return false;
134 r->out.domain = talloc_zero(r, const char *);
135 if (r->out.domain == NULL) {
136 talloc_free(r);
137 return false;
140 r->out.name = talloc_zero(r, const char *);
141 if (r->out.name == NULL) {
142 talloc_free(r);
143 return false;
146 r->out.result = _wbint_LookupSid(p, r);
148 if (p->rng_fault_state) {
149 talloc_free(r);
150 /* Return true here, srv_pipe_hnd.c will take care */
151 return true;
154 if (DEBUGLEVEL >= 10) {
155 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, r);
158 push = ndr_push_init_ctx(r, NULL);
159 if (push == NULL) {
160 talloc_free(r);
161 return false;
164 ndr_err = call->ndr_push(push, NDR_OUT, r);
165 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
166 talloc_free(r);
167 return false;
170 blob = ndr_push_blob(push);
171 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
172 talloc_free(r);
173 return false;
176 talloc_free(r);
178 return true;
181 static bool api_wbint_LookupName(pipes_struct *p)
183 const struct ndr_interface_call *call;
184 struct ndr_pull *pull;
185 struct ndr_push *push;
186 enum ndr_err_code ndr_err;
187 DATA_BLOB blob;
188 struct wbint_LookupName *r;
190 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPNAME];
192 r = talloc(talloc_tos(), struct wbint_LookupName);
193 if (r == NULL) {
194 return false;
197 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
198 talloc_free(r);
199 return false;
202 pull = ndr_pull_init_blob(&blob, r, NULL);
203 if (pull == NULL) {
204 talloc_free(r);
205 return false;
208 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
209 ndr_err = call->ndr_pull(pull, NDR_IN, r);
210 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
211 talloc_free(r);
212 return false;
215 if (DEBUGLEVEL >= 10) {
216 NDR_PRINT_IN_DEBUG(wbint_LookupName, r);
219 ZERO_STRUCT(r->out);
220 r->out.type = talloc_zero(r, enum lsa_SidType);
221 if (r->out.type == NULL) {
222 talloc_free(r);
223 return false;
226 r->out.sid = talloc_zero(r, struct dom_sid);
227 if (r->out.sid == NULL) {
228 talloc_free(r);
229 return false;
232 r->out.result = _wbint_LookupName(p, r);
234 if (p->rng_fault_state) {
235 talloc_free(r);
236 /* Return true here, srv_pipe_hnd.c will take care */
237 return true;
240 if (DEBUGLEVEL >= 10) {
241 NDR_PRINT_OUT_DEBUG(wbint_LookupName, r);
244 push = ndr_push_init_ctx(r, NULL);
245 if (push == NULL) {
246 talloc_free(r);
247 return false;
250 ndr_err = call->ndr_push(push, NDR_OUT, r);
251 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
252 talloc_free(r);
253 return false;
256 blob = ndr_push_blob(push);
257 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
258 talloc_free(r);
259 return false;
262 talloc_free(r);
264 return true;
267 static bool api_wbint_Sid2Uid(pipes_struct *p)
269 const struct ndr_interface_call *call;
270 struct ndr_pull *pull;
271 struct ndr_push *push;
272 enum ndr_err_code ndr_err;
273 DATA_BLOB blob;
274 struct wbint_Sid2Uid *r;
276 call = &ndr_table_wbint.calls[NDR_WBINT_SID2UID];
278 r = talloc(talloc_tos(), struct wbint_Sid2Uid);
279 if (r == NULL) {
280 return false;
283 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
284 talloc_free(r);
285 return false;
288 pull = ndr_pull_init_blob(&blob, r, NULL);
289 if (pull == NULL) {
290 talloc_free(r);
291 return false;
294 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
295 ndr_err = call->ndr_pull(pull, NDR_IN, r);
296 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
297 talloc_free(r);
298 return false;
301 if (DEBUGLEVEL >= 10) {
302 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, r);
305 ZERO_STRUCT(r->out);
306 r->out.uid = talloc_zero(r, uint64_t);
307 if (r->out.uid == NULL) {
308 talloc_free(r);
309 return false;
312 r->out.result = _wbint_Sid2Uid(p, r);
314 if (p->rng_fault_state) {
315 talloc_free(r);
316 /* Return true here, srv_pipe_hnd.c will take care */
317 return true;
320 if (DEBUGLEVEL >= 10) {
321 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, r);
324 push = ndr_push_init_ctx(r, NULL);
325 if (push == NULL) {
326 talloc_free(r);
327 return false;
330 ndr_err = call->ndr_push(push, NDR_OUT, r);
331 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
332 talloc_free(r);
333 return false;
336 blob = ndr_push_blob(push);
337 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
338 talloc_free(r);
339 return false;
342 talloc_free(r);
344 return true;
347 static bool api_wbint_Sid2Gid(pipes_struct *p)
349 const struct ndr_interface_call *call;
350 struct ndr_pull *pull;
351 struct ndr_push *push;
352 enum ndr_err_code ndr_err;
353 DATA_BLOB blob;
354 struct wbint_Sid2Gid *r;
356 call = &ndr_table_wbint.calls[NDR_WBINT_SID2GID];
358 r = talloc(talloc_tos(), struct wbint_Sid2Gid);
359 if (r == NULL) {
360 return false;
363 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
364 talloc_free(r);
365 return false;
368 pull = ndr_pull_init_blob(&blob, r, NULL);
369 if (pull == NULL) {
370 talloc_free(r);
371 return false;
374 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
375 ndr_err = call->ndr_pull(pull, NDR_IN, r);
376 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
377 talloc_free(r);
378 return false;
381 if (DEBUGLEVEL >= 10) {
382 NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, r);
385 ZERO_STRUCT(r->out);
386 r->out.gid = talloc_zero(r, uint64_t);
387 if (r->out.gid == NULL) {
388 talloc_free(r);
389 return false;
392 r->out.result = _wbint_Sid2Gid(p, r);
394 if (p->rng_fault_state) {
395 talloc_free(r);
396 /* Return true here, srv_pipe_hnd.c will take care */
397 return true;
400 if (DEBUGLEVEL >= 10) {
401 NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, r);
404 push = ndr_push_init_ctx(r, NULL);
405 if (push == NULL) {
406 talloc_free(r);
407 return false;
410 ndr_err = call->ndr_push(push, NDR_OUT, r);
411 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
412 talloc_free(r);
413 return false;
416 blob = ndr_push_blob(push);
417 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
418 talloc_free(r);
419 return false;
422 talloc_free(r);
424 return true;
427 static bool api_wbint_Uid2Sid(pipes_struct *p)
429 const struct ndr_interface_call *call;
430 struct ndr_pull *pull;
431 struct ndr_push *push;
432 enum ndr_err_code ndr_err;
433 DATA_BLOB blob;
434 struct wbint_Uid2Sid *r;
436 call = &ndr_table_wbint.calls[NDR_WBINT_UID2SID];
438 r = talloc(talloc_tos(), struct wbint_Uid2Sid);
439 if (r == NULL) {
440 return false;
443 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
444 talloc_free(r);
445 return false;
448 pull = ndr_pull_init_blob(&blob, r, NULL);
449 if (pull == NULL) {
450 talloc_free(r);
451 return false;
454 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
455 ndr_err = call->ndr_pull(pull, NDR_IN, r);
456 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
457 talloc_free(r);
458 return false;
461 if (DEBUGLEVEL >= 10) {
462 NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, r);
465 ZERO_STRUCT(r->out);
466 r->out.sid = talloc_zero(r, struct dom_sid);
467 if (r->out.sid == NULL) {
468 talloc_free(r);
469 return false;
472 r->out.result = _wbint_Uid2Sid(p, r);
474 if (p->rng_fault_state) {
475 talloc_free(r);
476 /* Return true here, srv_pipe_hnd.c will take care */
477 return true;
480 if (DEBUGLEVEL >= 10) {
481 NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, r);
484 push = ndr_push_init_ctx(r, NULL);
485 if (push == NULL) {
486 talloc_free(r);
487 return false;
490 ndr_err = call->ndr_push(push, NDR_OUT, r);
491 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
492 talloc_free(r);
493 return false;
496 blob = ndr_push_blob(push);
497 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
498 talloc_free(r);
499 return false;
502 talloc_free(r);
504 return true;
507 static bool api_wbint_Gid2Sid(pipes_struct *p)
509 const struct ndr_interface_call *call;
510 struct ndr_pull *pull;
511 struct ndr_push *push;
512 enum ndr_err_code ndr_err;
513 DATA_BLOB blob;
514 struct wbint_Gid2Sid *r;
516 call = &ndr_table_wbint.calls[NDR_WBINT_GID2SID];
518 r = talloc(talloc_tos(), struct wbint_Gid2Sid);
519 if (r == NULL) {
520 return false;
523 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
524 talloc_free(r);
525 return false;
528 pull = ndr_pull_init_blob(&blob, r, NULL);
529 if (pull == NULL) {
530 talloc_free(r);
531 return false;
534 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
535 ndr_err = call->ndr_pull(pull, NDR_IN, r);
536 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
537 talloc_free(r);
538 return false;
541 if (DEBUGLEVEL >= 10) {
542 NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, r);
545 ZERO_STRUCT(r->out);
546 r->out.sid = talloc_zero(r, struct dom_sid);
547 if (r->out.sid == NULL) {
548 talloc_free(r);
549 return false;
552 r->out.result = _wbint_Gid2Sid(p, r);
554 if (p->rng_fault_state) {
555 talloc_free(r);
556 /* Return true here, srv_pipe_hnd.c will take care */
557 return true;
560 if (DEBUGLEVEL >= 10) {
561 NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, r);
564 push = ndr_push_init_ctx(r, NULL);
565 if (push == NULL) {
566 talloc_free(r);
567 return false;
570 ndr_err = call->ndr_push(push, NDR_OUT, r);
571 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
572 talloc_free(r);
573 return false;
576 blob = ndr_push_blob(push);
577 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
578 talloc_free(r);
579 return false;
582 talloc_free(r);
584 return true;
587 static bool api_wbint_AllocateUid(pipes_struct *p)
589 const struct ndr_interface_call *call;
590 struct ndr_pull *pull;
591 struct ndr_push *push;
592 enum ndr_err_code ndr_err;
593 DATA_BLOB blob;
594 struct wbint_AllocateUid *r;
596 call = &ndr_table_wbint.calls[NDR_WBINT_ALLOCATEUID];
598 r = talloc(talloc_tos(), struct wbint_AllocateUid);
599 if (r == NULL) {
600 return false;
603 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
604 talloc_free(r);
605 return false;
608 pull = ndr_pull_init_blob(&blob, r, NULL);
609 if (pull == NULL) {
610 talloc_free(r);
611 return false;
614 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
615 ndr_err = call->ndr_pull(pull, NDR_IN, r);
616 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
617 talloc_free(r);
618 return false;
621 if (DEBUGLEVEL >= 10) {
622 NDR_PRINT_IN_DEBUG(wbint_AllocateUid, r);
625 ZERO_STRUCT(r->out);
626 r->out.uid = talloc_zero(r, uint64_t);
627 if (r->out.uid == NULL) {
628 talloc_free(r);
629 return false;
632 r->out.result = _wbint_AllocateUid(p, r);
634 if (p->rng_fault_state) {
635 talloc_free(r);
636 /* Return true here, srv_pipe_hnd.c will take care */
637 return true;
640 if (DEBUGLEVEL >= 10) {
641 NDR_PRINT_OUT_DEBUG(wbint_AllocateUid, r);
644 push = ndr_push_init_ctx(r, NULL);
645 if (push == NULL) {
646 talloc_free(r);
647 return false;
650 ndr_err = call->ndr_push(push, NDR_OUT, r);
651 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
652 talloc_free(r);
653 return false;
656 blob = ndr_push_blob(push);
657 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
658 talloc_free(r);
659 return false;
662 talloc_free(r);
664 return true;
667 static bool api_wbint_AllocateGid(pipes_struct *p)
669 const struct ndr_interface_call *call;
670 struct ndr_pull *pull;
671 struct ndr_push *push;
672 enum ndr_err_code ndr_err;
673 DATA_BLOB blob;
674 struct wbint_AllocateGid *r;
676 call = &ndr_table_wbint.calls[NDR_WBINT_ALLOCATEGID];
678 r = talloc(talloc_tos(), struct wbint_AllocateGid);
679 if (r == NULL) {
680 return false;
683 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
684 talloc_free(r);
685 return false;
688 pull = ndr_pull_init_blob(&blob, r, NULL);
689 if (pull == NULL) {
690 talloc_free(r);
691 return false;
694 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
695 ndr_err = call->ndr_pull(pull, NDR_IN, r);
696 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
697 talloc_free(r);
698 return false;
701 if (DEBUGLEVEL >= 10) {
702 NDR_PRINT_IN_DEBUG(wbint_AllocateGid, r);
705 ZERO_STRUCT(r->out);
706 r->out.gid = talloc_zero(r, uint64_t);
707 if (r->out.gid == NULL) {
708 talloc_free(r);
709 return false;
712 r->out.result = _wbint_AllocateGid(p, r);
714 if (p->rng_fault_state) {
715 talloc_free(r);
716 /* Return true here, srv_pipe_hnd.c will take care */
717 return true;
720 if (DEBUGLEVEL >= 10) {
721 NDR_PRINT_OUT_DEBUG(wbint_AllocateGid, r);
724 push = ndr_push_init_ctx(r, NULL);
725 if (push == NULL) {
726 talloc_free(r);
727 return false;
730 ndr_err = call->ndr_push(push, NDR_OUT, r);
731 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
732 talloc_free(r);
733 return false;
736 blob = ndr_push_blob(push);
737 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
738 talloc_free(r);
739 return false;
742 talloc_free(r);
744 return true;
747 static bool api_wbint_QueryUser(pipes_struct *p)
749 const struct ndr_interface_call *call;
750 struct ndr_pull *pull;
751 struct ndr_push *push;
752 enum ndr_err_code ndr_err;
753 DATA_BLOB blob;
754 struct wbint_QueryUser *r;
756 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSER];
758 r = talloc(talloc_tos(), struct wbint_QueryUser);
759 if (r == NULL) {
760 return false;
763 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
764 talloc_free(r);
765 return false;
768 pull = ndr_pull_init_blob(&blob, r, NULL);
769 if (pull == NULL) {
770 talloc_free(r);
771 return false;
774 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
775 ndr_err = call->ndr_pull(pull, NDR_IN, r);
776 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
777 talloc_free(r);
778 return false;
781 if (DEBUGLEVEL >= 10) {
782 NDR_PRINT_IN_DEBUG(wbint_QueryUser, r);
785 ZERO_STRUCT(r->out);
786 r->out.info = talloc_zero(r, struct wbint_userinfo);
787 if (r->out.info == NULL) {
788 talloc_free(r);
789 return false;
792 r->out.result = _wbint_QueryUser(p, r);
794 if (p->rng_fault_state) {
795 talloc_free(r);
796 /* Return true here, srv_pipe_hnd.c will take care */
797 return true;
800 if (DEBUGLEVEL >= 10) {
801 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, r);
804 push = ndr_push_init_ctx(r, NULL);
805 if (push == NULL) {
806 talloc_free(r);
807 return false;
810 ndr_err = call->ndr_push(push, NDR_OUT, r);
811 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
812 talloc_free(r);
813 return false;
816 blob = ndr_push_blob(push);
817 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
818 talloc_free(r);
819 return false;
822 talloc_free(r);
824 return true;
827 static bool api_wbint_LookupUserAliases(pipes_struct *p)
829 const struct ndr_interface_call *call;
830 struct ndr_pull *pull;
831 struct ndr_push *push;
832 enum ndr_err_code ndr_err;
833 DATA_BLOB blob;
834 struct wbint_LookupUserAliases *r;
836 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERALIASES];
838 r = talloc(talloc_tos(), struct wbint_LookupUserAliases);
839 if (r == NULL) {
840 return false;
843 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
844 talloc_free(r);
845 return false;
848 pull = ndr_pull_init_blob(&blob, r, NULL);
849 if (pull == NULL) {
850 talloc_free(r);
851 return false;
854 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
855 ndr_err = call->ndr_pull(pull, NDR_IN, r);
856 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
857 talloc_free(r);
858 return false;
861 if (DEBUGLEVEL >= 10) {
862 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, r);
865 ZERO_STRUCT(r->out);
866 r->out.rids = talloc_zero(r, struct wbint_RidArray);
867 if (r->out.rids == NULL) {
868 talloc_free(r);
869 return false;
872 r->out.result = _wbint_LookupUserAliases(p, r);
874 if (p->rng_fault_state) {
875 talloc_free(r);
876 /* Return true here, srv_pipe_hnd.c will take care */
877 return true;
880 if (DEBUGLEVEL >= 10) {
881 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, r);
884 push = ndr_push_init_ctx(r, NULL);
885 if (push == NULL) {
886 talloc_free(r);
887 return false;
890 ndr_err = call->ndr_push(push, NDR_OUT, r);
891 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
892 talloc_free(r);
893 return false;
896 blob = ndr_push_blob(push);
897 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
898 talloc_free(r);
899 return false;
902 talloc_free(r);
904 return true;
907 static bool api_wbint_LookupUserGroups(pipes_struct *p)
909 const struct ndr_interface_call *call;
910 struct ndr_pull *pull;
911 struct ndr_push *push;
912 enum ndr_err_code ndr_err;
913 DATA_BLOB blob;
914 struct wbint_LookupUserGroups *r;
916 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERGROUPS];
918 r = talloc(talloc_tos(), struct wbint_LookupUserGroups);
919 if (r == NULL) {
920 return false;
923 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
924 talloc_free(r);
925 return false;
928 pull = ndr_pull_init_blob(&blob, r, NULL);
929 if (pull == NULL) {
930 talloc_free(r);
931 return false;
934 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
935 ndr_err = call->ndr_pull(pull, NDR_IN, r);
936 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
937 talloc_free(r);
938 return false;
941 if (DEBUGLEVEL >= 10) {
942 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, r);
945 ZERO_STRUCT(r->out);
946 r->out.sids = talloc_zero(r, struct wbint_SidArray);
947 if (r->out.sids == NULL) {
948 talloc_free(r);
949 return false;
952 r->out.result = _wbint_LookupUserGroups(p, r);
954 if (p->rng_fault_state) {
955 talloc_free(r);
956 /* Return true here, srv_pipe_hnd.c will take care */
957 return true;
960 if (DEBUGLEVEL >= 10) {
961 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, r);
964 push = ndr_push_init_ctx(r, NULL);
965 if (push == NULL) {
966 talloc_free(r);
967 return false;
970 ndr_err = call->ndr_push(push, NDR_OUT, r);
971 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
972 talloc_free(r);
973 return false;
976 blob = ndr_push_blob(push);
977 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
978 talloc_free(r);
979 return false;
982 talloc_free(r);
984 return true;
987 static bool api_wbint_QuerySequenceNumber(pipes_struct *p)
989 const struct ndr_interface_call *call;
990 struct ndr_pull *pull;
991 struct ndr_push *push;
992 enum ndr_err_code ndr_err;
993 DATA_BLOB blob;
994 struct wbint_QuerySequenceNumber *r;
996 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYSEQUENCENUMBER];
998 r = talloc(talloc_tos(), struct wbint_QuerySequenceNumber);
999 if (r == NULL) {
1000 return false;
1003 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1004 talloc_free(r);
1005 return false;
1008 pull = ndr_pull_init_blob(&blob, r, NULL);
1009 if (pull == NULL) {
1010 talloc_free(r);
1011 return false;
1014 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1015 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1016 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1017 talloc_free(r);
1018 return false;
1021 if (DEBUGLEVEL >= 10) {
1022 NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, r);
1025 ZERO_STRUCT(r->out);
1026 r->out.sequence = talloc_zero(r, uint32_t);
1027 if (r->out.sequence == NULL) {
1028 talloc_free(r);
1029 return false;
1032 r->out.result = _wbint_QuerySequenceNumber(p, r);
1034 if (p->rng_fault_state) {
1035 talloc_free(r);
1036 /* Return true here, srv_pipe_hnd.c will take care */
1037 return true;
1040 if (DEBUGLEVEL >= 10) {
1041 NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, r);
1044 push = ndr_push_init_ctx(r, NULL);
1045 if (push == NULL) {
1046 talloc_free(r);
1047 return false;
1050 ndr_err = call->ndr_push(push, NDR_OUT, r);
1051 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1052 talloc_free(r);
1053 return false;
1056 blob = ndr_push_blob(push);
1057 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1058 talloc_free(r);
1059 return false;
1062 talloc_free(r);
1064 return true;
1067 static bool api_wbint_LookupGroupMembers(pipes_struct *p)
1069 const struct ndr_interface_call *call;
1070 struct ndr_pull *pull;
1071 struct ndr_push *push;
1072 enum ndr_err_code ndr_err;
1073 DATA_BLOB blob;
1074 struct wbint_LookupGroupMembers *r;
1076 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPGROUPMEMBERS];
1078 r = talloc(talloc_tos(), struct wbint_LookupGroupMembers);
1079 if (r == NULL) {
1080 return false;
1083 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1084 talloc_free(r);
1085 return false;
1088 pull = ndr_pull_init_blob(&blob, r, NULL);
1089 if (pull == NULL) {
1090 talloc_free(r);
1091 return false;
1094 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1095 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1096 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1097 talloc_free(r);
1098 return false;
1101 if (DEBUGLEVEL >= 10) {
1102 NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, r);
1105 ZERO_STRUCT(r->out);
1106 r->out.members = talloc_zero(r, struct wbint_Principals);
1107 if (r->out.members == NULL) {
1108 talloc_free(r);
1109 return false;
1112 r->out.result = _wbint_LookupGroupMembers(p, r);
1114 if (p->rng_fault_state) {
1115 talloc_free(r);
1116 /* Return true here, srv_pipe_hnd.c will take care */
1117 return true;
1120 if (DEBUGLEVEL >= 10) {
1121 NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, r);
1124 push = ndr_push_init_ctx(r, NULL);
1125 if (push == NULL) {
1126 talloc_free(r);
1127 return false;
1130 ndr_err = call->ndr_push(push, NDR_OUT, r);
1131 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1132 talloc_free(r);
1133 return false;
1136 blob = ndr_push_blob(push);
1137 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1138 talloc_free(r);
1139 return false;
1142 talloc_free(r);
1144 return true;
1147 static bool api_wbint_QueryUserList(pipes_struct *p)
1149 const struct ndr_interface_call *call;
1150 struct ndr_pull *pull;
1151 struct ndr_push *push;
1152 enum ndr_err_code ndr_err;
1153 DATA_BLOB blob;
1154 struct wbint_QueryUserList *r;
1156 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSERLIST];
1158 r = talloc(talloc_tos(), struct wbint_QueryUserList);
1159 if (r == NULL) {
1160 return false;
1163 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1164 talloc_free(r);
1165 return false;
1168 pull = ndr_pull_init_blob(&blob, r, NULL);
1169 if (pull == NULL) {
1170 talloc_free(r);
1171 return false;
1174 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1175 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1176 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1177 talloc_free(r);
1178 return false;
1181 if (DEBUGLEVEL >= 10) {
1182 NDR_PRINT_IN_DEBUG(wbint_QueryUserList, r);
1185 ZERO_STRUCT(r->out);
1186 r->out.users = talloc_zero(r, struct wbint_userinfos);
1187 if (r->out.users == NULL) {
1188 talloc_free(r);
1189 return false;
1192 r->out.result = _wbint_QueryUserList(p, r);
1194 if (p->rng_fault_state) {
1195 talloc_free(r);
1196 /* Return true here, srv_pipe_hnd.c will take care */
1197 return true;
1200 if (DEBUGLEVEL >= 10) {
1201 NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, r);
1204 push = ndr_push_init_ctx(r, NULL);
1205 if (push == NULL) {
1206 talloc_free(r);
1207 return false;
1210 ndr_err = call->ndr_push(push, NDR_OUT, r);
1211 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1212 talloc_free(r);
1213 return false;
1216 blob = ndr_push_blob(push);
1217 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1218 talloc_free(r);
1219 return false;
1222 talloc_free(r);
1224 return true;
1227 static bool api_wbint_QueryGroupList(pipes_struct *p)
1229 const struct ndr_interface_call *call;
1230 struct ndr_pull *pull;
1231 struct ndr_push *push;
1232 enum ndr_err_code ndr_err;
1233 DATA_BLOB blob;
1234 struct wbint_QueryGroupList *r;
1236 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYGROUPLIST];
1238 r = talloc(talloc_tos(), struct wbint_QueryGroupList);
1239 if (r == NULL) {
1240 return false;
1243 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1244 talloc_free(r);
1245 return false;
1248 pull = ndr_pull_init_blob(&blob, r, NULL);
1249 if (pull == NULL) {
1250 talloc_free(r);
1251 return false;
1254 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1255 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1256 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1257 talloc_free(r);
1258 return false;
1261 if (DEBUGLEVEL >= 10) {
1262 NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, r);
1265 ZERO_STRUCT(r->out);
1266 r->out.groups = talloc_zero(r, struct wbint_Principals);
1267 if (r->out.groups == NULL) {
1268 talloc_free(r);
1269 return false;
1272 r->out.result = _wbint_QueryGroupList(p, r);
1274 if (p->rng_fault_state) {
1275 talloc_free(r);
1276 /* Return true here, srv_pipe_hnd.c will take care */
1277 return true;
1280 if (DEBUGLEVEL >= 10) {
1281 NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, r);
1284 push = ndr_push_init_ctx(r, NULL);
1285 if (push == NULL) {
1286 talloc_free(r);
1287 return false;
1290 ndr_err = call->ndr_push(push, NDR_OUT, r);
1291 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1292 talloc_free(r);
1293 return false;
1296 blob = ndr_push_blob(push);
1297 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1298 talloc_free(r);
1299 return false;
1302 talloc_free(r);
1304 return true;
1307 static bool api_wbint_DsGetDcName(pipes_struct *p)
1309 const struct ndr_interface_call *call;
1310 struct ndr_pull *pull;
1311 struct ndr_push *push;
1312 enum ndr_err_code ndr_err;
1313 DATA_BLOB blob;
1314 struct wbint_DsGetDcName *r;
1316 call = &ndr_table_wbint.calls[NDR_WBINT_DSGETDCNAME];
1318 r = talloc(talloc_tos(), struct wbint_DsGetDcName);
1319 if (r == NULL) {
1320 return false;
1323 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1324 talloc_free(r);
1325 return false;
1328 pull = ndr_pull_init_blob(&blob, r, NULL);
1329 if (pull == NULL) {
1330 talloc_free(r);
1331 return false;
1334 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1335 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1336 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1337 talloc_free(r);
1338 return false;
1341 if (DEBUGLEVEL >= 10) {
1342 NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, r);
1345 ZERO_STRUCT(r->out);
1346 r->out.dc_info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
1347 if (r->out.dc_info == NULL) {
1348 talloc_free(r);
1349 return false;
1352 r->out.result = _wbint_DsGetDcName(p, r);
1354 if (p->rng_fault_state) {
1355 talloc_free(r);
1356 /* Return true here, srv_pipe_hnd.c will take care */
1357 return true;
1360 if (DEBUGLEVEL >= 10) {
1361 NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, r);
1364 push = ndr_push_init_ctx(r, NULL);
1365 if (push == NULL) {
1366 talloc_free(r);
1367 return false;
1370 ndr_err = call->ndr_push(push, NDR_OUT, r);
1371 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1372 talloc_free(r);
1373 return false;
1376 blob = ndr_push_blob(push);
1377 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1378 talloc_free(r);
1379 return false;
1382 talloc_free(r);
1384 return true;
1387 static bool api_wbint_LookupRids(pipes_struct *p)
1389 const struct ndr_interface_call *call;
1390 struct ndr_pull *pull;
1391 struct ndr_push *push;
1392 enum ndr_err_code ndr_err;
1393 DATA_BLOB blob;
1394 struct wbint_LookupRids *r;
1396 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPRIDS];
1398 r = talloc(talloc_tos(), struct wbint_LookupRids);
1399 if (r == NULL) {
1400 return false;
1403 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1404 talloc_free(r);
1405 return false;
1408 pull = ndr_pull_init_blob(&blob, r, NULL);
1409 if (pull == NULL) {
1410 talloc_free(r);
1411 return false;
1414 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1415 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1416 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1417 talloc_free(r);
1418 return false;
1421 if (DEBUGLEVEL >= 10) {
1422 NDR_PRINT_IN_DEBUG(wbint_LookupRids, r);
1425 ZERO_STRUCT(r->out);
1426 r->out.domain_name = talloc_zero(r, const char *);
1427 if (r->out.domain_name == NULL) {
1428 talloc_free(r);
1429 return false;
1432 r->out.names = talloc_zero(r, struct wbint_Principals);
1433 if (r->out.names == NULL) {
1434 talloc_free(r);
1435 return false;
1438 r->out.result = _wbint_LookupRids(p, r);
1440 if (p->rng_fault_state) {
1441 talloc_free(r);
1442 /* Return true here, srv_pipe_hnd.c will take care */
1443 return true;
1446 if (DEBUGLEVEL >= 10) {
1447 NDR_PRINT_OUT_DEBUG(wbint_LookupRids, r);
1450 push = ndr_push_init_ctx(r, NULL);
1451 if (push == NULL) {
1452 talloc_free(r);
1453 return false;
1456 ndr_err = call->ndr_push(push, NDR_OUT, r);
1457 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1458 talloc_free(r);
1459 return false;
1462 blob = ndr_push_blob(push);
1463 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1464 talloc_free(r);
1465 return false;
1468 talloc_free(r);
1470 return true;
1473 static bool api_wbint_CheckMachineAccount(pipes_struct *p)
1475 const struct ndr_interface_call *call;
1476 struct ndr_pull *pull;
1477 struct ndr_push *push;
1478 enum ndr_err_code ndr_err;
1479 DATA_BLOB blob;
1480 struct wbint_CheckMachineAccount *r;
1482 call = &ndr_table_wbint.calls[NDR_WBINT_CHECKMACHINEACCOUNT];
1484 r = talloc(talloc_tos(), struct wbint_CheckMachineAccount);
1485 if (r == NULL) {
1486 return false;
1489 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1490 talloc_free(r);
1491 return false;
1494 pull = ndr_pull_init_blob(&blob, r, NULL);
1495 if (pull == NULL) {
1496 talloc_free(r);
1497 return false;
1500 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1501 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1502 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1503 talloc_free(r);
1504 return false;
1507 if (DEBUGLEVEL >= 10) {
1508 NDR_PRINT_IN_DEBUG(wbint_CheckMachineAccount, r);
1511 r->out.result = _wbint_CheckMachineAccount(p, r);
1513 if (p->rng_fault_state) {
1514 talloc_free(r);
1515 /* Return true here, srv_pipe_hnd.c will take care */
1516 return true;
1519 if (DEBUGLEVEL >= 10) {
1520 NDR_PRINT_OUT_DEBUG(wbint_CheckMachineAccount, r);
1523 push = ndr_push_init_ctx(r, NULL);
1524 if (push == NULL) {
1525 talloc_free(r);
1526 return false;
1529 ndr_err = call->ndr_push(push, NDR_OUT, r);
1530 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1531 talloc_free(r);
1532 return false;
1535 blob = ndr_push_blob(push);
1536 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1537 talloc_free(r);
1538 return false;
1541 talloc_free(r);
1543 return true;
1546 static bool api_wbint_ChangeMachineAccount(pipes_struct *p)
1548 const struct ndr_interface_call *call;
1549 struct ndr_pull *pull;
1550 struct ndr_push *push;
1551 enum ndr_err_code ndr_err;
1552 DATA_BLOB blob;
1553 struct wbint_ChangeMachineAccount *r;
1555 call = &ndr_table_wbint.calls[NDR_WBINT_CHANGEMACHINEACCOUNT];
1557 r = talloc(talloc_tos(), struct wbint_ChangeMachineAccount);
1558 if (r == NULL) {
1559 return false;
1562 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1563 talloc_free(r);
1564 return false;
1567 pull = ndr_pull_init_blob(&blob, r, NULL);
1568 if (pull == NULL) {
1569 talloc_free(r);
1570 return false;
1573 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1574 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1575 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1576 talloc_free(r);
1577 return false;
1580 if (DEBUGLEVEL >= 10) {
1581 NDR_PRINT_IN_DEBUG(wbint_ChangeMachineAccount, r);
1584 r->out.result = _wbint_ChangeMachineAccount(p, r);
1586 if (p->rng_fault_state) {
1587 talloc_free(r);
1588 /* Return true here, srv_pipe_hnd.c will take care */
1589 return true;
1592 if (DEBUGLEVEL >= 10) {
1593 NDR_PRINT_OUT_DEBUG(wbint_ChangeMachineAccount, r);
1596 push = ndr_push_init_ctx(r, NULL);
1597 if (push == NULL) {
1598 talloc_free(r);
1599 return false;
1602 ndr_err = call->ndr_push(push, NDR_OUT, r);
1603 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1604 talloc_free(r);
1605 return false;
1608 blob = ndr_push_blob(push);
1609 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1610 talloc_free(r);
1611 return false;
1614 talloc_free(r);
1616 return true;
1619 static bool api_wbint_PingDc(pipes_struct *p)
1621 const struct ndr_interface_call *call;
1622 struct ndr_pull *pull;
1623 struct ndr_push *push;
1624 enum ndr_err_code ndr_err;
1625 DATA_BLOB blob;
1626 struct wbint_PingDc *r;
1628 call = &ndr_table_wbint.calls[NDR_WBINT_PINGDC];
1630 r = talloc(talloc_tos(), struct wbint_PingDc);
1631 if (r == NULL) {
1632 return false;
1635 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1636 talloc_free(r);
1637 return false;
1640 pull = ndr_pull_init_blob(&blob, r, NULL);
1641 if (pull == NULL) {
1642 talloc_free(r);
1643 return false;
1646 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1647 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1648 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1649 talloc_free(r);
1650 return false;
1653 if (DEBUGLEVEL >= 10) {
1654 NDR_PRINT_IN_DEBUG(wbint_PingDc, r);
1657 r->out.result = _wbint_PingDc(p, r);
1659 if (p->rng_fault_state) {
1660 talloc_free(r);
1661 /* Return true here, srv_pipe_hnd.c will take care */
1662 return true;
1665 if (DEBUGLEVEL >= 10) {
1666 NDR_PRINT_OUT_DEBUG(wbint_PingDc, r);
1669 push = ndr_push_init_ctx(r, NULL);
1670 if (push == NULL) {
1671 talloc_free(r);
1672 return false;
1675 ndr_err = call->ndr_push(push, NDR_OUT, r);
1676 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1677 talloc_free(r);
1678 return false;
1681 blob = ndr_push_blob(push);
1682 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1683 talloc_free(r);
1684 return false;
1687 talloc_free(r);
1689 return true;
1692 static bool api_wbint_SetMapping(pipes_struct *p)
1694 const struct ndr_interface_call *call;
1695 struct ndr_pull *pull;
1696 struct ndr_push *push;
1697 enum ndr_err_code ndr_err;
1698 DATA_BLOB blob;
1699 struct wbint_SetMapping *r;
1701 call = &ndr_table_wbint.calls[NDR_WBINT_SETMAPPING];
1703 r = talloc(talloc_tos(), struct wbint_SetMapping);
1704 if (r == NULL) {
1705 return false;
1708 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1709 talloc_free(r);
1710 return false;
1713 pull = ndr_pull_init_blob(&blob, r, NULL);
1714 if (pull == NULL) {
1715 talloc_free(r);
1716 return false;
1719 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1720 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1721 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1722 talloc_free(r);
1723 return false;
1726 if (DEBUGLEVEL >= 10) {
1727 NDR_PRINT_IN_DEBUG(wbint_SetMapping, r);
1730 r->out.result = _wbint_SetMapping(p, r);
1732 if (p->rng_fault_state) {
1733 talloc_free(r);
1734 /* Return true here, srv_pipe_hnd.c will take care */
1735 return true;
1738 if (DEBUGLEVEL >= 10) {
1739 NDR_PRINT_OUT_DEBUG(wbint_SetMapping, r);
1742 push = ndr_push_init_ctx(r, NULL);
1743 if (push == NULL) {
1744 talloc_free(r);
1745 return false;
1748 ndr_err = call->ndr_push(push, NDR_OUT, r);
1749 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1750 talloc_free(r);
1751 return false;
1754 blob = ndr_push_blob(push);
1755 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1756 talloc_free(r);
1757 return false;
1760 talloc_free(r);
1762 return true;
1765 static bool api_wbint_RemoveMapping(pipes_struct *p)
1767 const struct ndr_interface_call *call;
1768 struct ndr_pull *pull;
1769 struct ndr_push *push;
1770 enum ndr_err_code ndr_err;
1771 DATA_BLOB blob;
1772 struct wbint_RemoveMapping *r;
1774 call = &ndr_table_wbint.calls[NDR_WBINT_REMOVEMAPPING];
1776 r = talloc(talloc_tos(), struct wbint_RemoveMapping);
1777 if (r == NULL) {
1778 return false;
1781 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1782 talloc_free(r);
1783 return false;
1786 pull = ndr_pull_init_blob(&blob, r, NULL);
1787 if (pull == NULL) {
1788 talloc_free(r);
1789 return false;
1792 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1793 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1794 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1795 talloc_free(r);
1796 return false;
1799 if (DEBUGLEVEL >= 10) {
1800 NDR_PRINT_IN_DEBUG(wbint_RemoveMapping, r);
1803 r->out.result = _wbint_RemoveMapping(p, r);
1805 if (p->rng_fault_state) {
1806 talloc_free(r);
1807 /* Return true here, srv_pipe_hnd.c will take care */
1808 return true;
1811 if (DEBUGLEVEL >= 10) {
1812 NDR_PRINT_OUT_DEBUG(wbint_RemoveMapping, r);
1815 push = ndr_push_init_ctx(r, NULL);
1816 if (push == NULL) {
1817 talloc_free(r);
1818 return false;
1821 ndr_err = call->ndr_push(push, NDR_OUT, r);
1822 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1823 talloc_free(r);
1824 return false;
1827 blob = ndr_push_blob(push);
1828 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1829 talloc_free(r);
1830 return false;
1833 talloc_free(r);
1835 return true;
1838 static bool api_wbint_SetHWM(pipes_struct *p)
1840 const struct ndr_interface_call *call;
1841 struct ndr_pull *pull;
1842 struct ndr_push *push;
1843 enum ndr_err_code ndr_err;
1844 DATA_BLOB blob;
1845 struct wbint_SetHWM *r;
1847 call = &ndr_table_wbint.calls[NDR_WBINT_SETHWM];
1849 r = talloc(talloc_tos(), struct wbint_SetHWM);
1850 if (r == NULL) {
1851 return false;
1854 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1855 talloc_free(r);
1856 return false;
1859 pull = ndr_pull_init_blob(&blob, r, NULL);
1860 if (pull == NULL) {
1861 talloc_free(r);
1862 return false;
1865 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1866 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1867 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1868 talloc_free(r);
1869 return false;
1872 if (DEBUGLEVEL >= 10) {
1873 NDR_PRINT_IN_DEBUG(wbint_SetHWM, r);
1876 r->out.result = _wbint_SetHWM(p, r);
1878 if (p->rng_fault_state) {
1879 talloc_free(r);
1880 /* Return true here, srv_pipe_hnd.c will take care */
1881 return true;
1884 if (DEBUGLEVEL >= 10) {
1885 NDR_PRINT_OUT_DEBUG(wbint_SetHWM, r);
1888 push = ndr_push_init_ctx(r, NULL);
1889 if (push == NULL) {
1890 talloc_free(r);
1891 return false;
1894 ndr_err = call->ndr_push(push, NDR_OUT, r);
1895 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1896 talloc_free(r);
1897 return false;
1900 blob = ndr_push_blob(push);
1901 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1902 talloc_free(r);
1903 return false;
1906 talloc_free(r);
1908 return true;
1912 /* Tables */
1913 static struct api_struct api_wbint_cmds[] =
1915 {"WBINT_PING", NDR_WBINT_PING, api_wbint_Ping},
1916 {"WBINT_LOOKUPSID", NDR_WBINT_LOOKUPSID, api_wbint_LookupSid},
1917 {"WBINT_LOOKUPNAME", NDR_WBINT_LOOKUPNAME, api_wbint_LookupName},
1918 {"WBINT_SID2UID", NDR_WBINT_SID2UID, api_wbint_Sid2Uid},
1919 {"WBINT_SID2GID", NDR_WBINT_SID2GID, api_wbint_Sid2Gid},
1920 {"WBINT_UID2SID", NDR_WBINT_UID2SID, api_wbint_Uid2Sid},
1921 {"WBINT_GID2SID", NDR_WBINT_GID2SID, api_wbint_Gid2Sid},
1922 {"WBINT_ALLOCATEUID", NDR_WBINT_ALLOCATEUID, api_wbint_AllocateUid},
1923 {"WBINT_ALLOCATEGID", NDR_WBINT_ALLOCATEGID, api_wbint_AllocateGid},
1924 {"WBINT_QUERYUSER", NDR_WBINT_QUERYUSER, api_wbint_QueryUser},
1925 {"WBINT_LOOKUPUSERALIASES", NDR_WBINT_LOOKUPUSERALIASES, api_wbint_LookupUserAliases},
1926 {"WBINT_LOOKUPUSERGROUPS", NDR_WBINT_LOOKUPUSERGROUPS, api_wbint_LookupUserGroups},
1927 {"WBINT_QUERYSEQUENCENUMBER", NDR_WBINT_QUERYSEQUENCENUMBER, api_wbint_QuerySequenceNumber},
1928 {"WBINT_LOOKUPGROUPMEMBERS", NDR_WBINT_LOOKUPGROUPMEMBERS, api_wbint_LookupGroupMembers},
1929 {"WBINT_QUERYUSERLIST", NDR_WBINT_QUERYUSERLIST, api_wbint_QueryUserList},
1930 {"WBINT_QUERYGROUPLIST", NDR_WBINT_QUERYGROUPLIST, api_wbint_QueryGroupList},
1931 {"WBINT_DSGETDCNAME", NDR_WBINT_DSGETDCNAME, api_wbint_DsGetDcName},
1932 {"WBINT_LOOKUPRIDS", NDR_WBINT_LOOKUPRIDS, api_wbint_LookupRids},
1933 {"WBINT_CHECKMACHINEACCOUNT", NDR_WBINT_CHECKMACHINEACCOUNT, api_wbint_CheckMachineAccount},
1934 {"WBINT_CHANGEMACHINEACCOUNT", NDR_WBINT_CHANGEMACHINEACCOUNT, api_wbint_ChangeMachineAccount},
1935 {"WBINT_PINGDC", NDR_WBINT_PINGDC, api_wbint_PingDc},
1936 {"WBINT_SETMAPPING", NDR_WBINT_SETMAPPING, api_wbint_SetMapping},
1937 {"WBINT_REMOVEMAPPING", NDR_WBINT_REMOVEMAPPING, api_wbint_RemoveMapping},
1938 {"WBINT_SETHWM", NDR_WBINT_SETHWM, api_wbint_SetHWM},
1941 void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns)
1943 *fns = api_wbint_cmds;
1944 *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct);
1947 NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
1949 if (cli->pipes_struct == NULL) {
1950 return NT_STATUS_INVALID_PARAMETER;
1953 switch (opnum)
1955 case NDR_WBINT_PING: {
1956 struct wbint_Ping *r = (struct wbint_Ping *)_r;
1957 ZERO_STRUCT(r->out);
1958 r->out.out_data = talloc_zero(mem_ctx, uint32_t);
1959 if (r->out.out_data == NULL) {
1960 return NT_STATUS_NO_MEMORY;
1963 _wbint_Ping(cli->pipes_struct, r);
1964 return NT_STATUS_OK;
1967 case NDR_WBINT_LOOKUPSID: {
1968 struct wbint_LookupSid *r = (struct wbint_LookupSid *)_r;
1969 ZERO_STRUCT(r->out);
1970 r->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
1971 if (r->out.type == NULL) {
1972 return NT_STATUS_NO_MEMORY;
1975 r->out.domain = talloc_zero(mem_ctx, const char *);
1976 if (r->out.domain == NULL) {
1977 return NT_STATUS_NO_MEMORY;
1980 r->out.name = talloc_zero(mem_ctx, const char *);
1981 if (r->out.name == NULL) {
1982 return NT_STATUS_NO_MEMORY;
1985 r->out.result = _wbint_LookupSid(cli->pipes_struct, r);
1986 return NT_STATUS_OK;
1989 case NDR_WBINT_LOOKUPNAME: {
1990 struct wbint_LookupName *r = (struct wbint_LookupName *)_r;
1991 ZERO_STRUCT(r->out);
1992 r->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
1993 if (r->out.type == NULL) {
1994 return NT_STATUS_NO_MEMORY;
1997 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
1998 if (r->out.sid == NULL) {
1999 return NT_STATUS_NO_MEMORY;
2002 r->out.result = _wbint_LookupName(cli->pipes_struct, r);
2003 return NT_STATUS_OK;
2006 case NDR_WBINT_SID2UID: {
2007 struct wbint_Sid2Uid *r = (struct wbint_Sid2Uid *)_r;
2008 ZERO_STRUCT(r->out);
2009 r->out.uid = talloc_zero(mem_ctx, uint64_t);
2010 if (r->out.uid == NULL) {
2011 return NT_STATUS_NO_MEMORY;
2014 r->out.result = _wbint_Sid2Uid(cli->pipes_struct, r);
2015 return NT_STATUS_OK;
2018 case NDR_WBINT_SID2GID: {
2019 struct wbint_Sid2Gid *r = (struct wbint_Sid2Gid *)_r;
2020 ZERO_STRUCT(r->out);
2021 r->out.gid = talloc_zero(mem_ctx, uint64_t);
2022 if (r->out.gid == NULL) {
2023 return NT_STATUS_NO_MEMORY;
2026 r->out.result = _wbint_Sid2Gid(cli->pipes_struct, r);
2027 return NT_STATUS_OK;
2030 case NDR_WBINT_UID2SID: {
2031 struct wbint_Uid2Sid *r = (struct wbint_Uid2Sid *)_r;
2032 ZERO_STRUCT(r->out);
2033 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
2034 if (r->out.sid == NULL) {
2035 return NT_STATUS_NO_MEMORY;
2038 r->out.result = _wbint_Uid2Sid(cli->pipes_struct, r);
2039 return NT_STATUS_OK;
2042 case NDR_WBINT_GID2SID: {
2043 struct wbint_Gid2Sid *r = (struct wbint_Gid2Sid *)_r;
2044 ZERO_STRUCT(r->out);
2045 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
2046 if (r->out.sid == NULL) {
2047 return NT_STATUS_NO_MEMORY;
2050 r->out.result = _wbint_Gid2Sid(cli->pipes_struct, r);
2051 return NT_STATUS_OK;
2054 case NDR_WBINT_ALLOCATEUID: {
2055 struct wbint_AllocateUid *r = (struct wbint_AllocateUid *)_r;
2056 ZERO_STRUCT(r->out);
2057 r->out.uid = talloc_zero(mem_ctx, uint64_t);
2058 if (r->out.uid == NULL) {
2059 return NT_STATUS_NO_MEMORY;
2062 r->out.result = _wbint_AllocateUid(cli->pipes_struct, r);
2063 return NT_STATUS_OK;
2066 case NDR_WBINT_ALLOCATEGID: {
2067 struct wbint_AllocateGid *r = (struct wbint_AllocateGid *)_r;
2068 ZERO_STRUCT(r->out);
2069 r->out.gid = talloc_zero(mem_ctx, uint64_t);
2070 if (r->out.gid == NULL) {
2071 return NT_STATUS_NO_MEMORY;
2074 r->out.result = _wbint_AllocateGid(cli->pipes_struct, r);
2075 return NT_STATUS_OK;
2078 case NDR_WBINT_QUERYUSER: {
2079 struct wbint_QueryUser *r = (struct wbint_QueryUser *)_r;
2080 ZERO_STRUCT(r->out);
2081 r->out.info = talloc_zero(mem_ctx, struct wbint_userinfo);
2082 if (r->out.info == NULL) {
2083 return NT_STATUS_NO_MEMORY;
2086 r->out.result = _wbint_QueryUser(cli->pipes_struct, r);
2087 return NT_STATUS_OK;
2090 case NDR_WBINT_LOOKUPUSERALIASES: {
2091 struct wbint_LookupUserAliases *r = (struct wbint_LookupUserAliases *)_r;
2092 ZERO_STRUCT(r->out);
2093 r->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
2094 if (r->out.rids == NULL) {
2095 return NT_STATUS_NO_MEMORY;
2098 r->out.result = _wbint_LookupUserAliases(cli->pipes_struct, r);
2099 return NT_STATUS_OK;
2102 case NDR_WBINT_LOOKUPUSERGROUPS: {
2103 struct wbint_LookupUserGroups *r = (struct wbint_LookupUserGroups *)_r;
2104 ZERO_STRUCT(r->out);
2105 r->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
2106 if (r->out.sids == NULL) {
2107 return NT_STATUS_NO_MEMORY;
2110 r->out.result = _wbint_LookupUserGroups(cli->pipes_struct, r);
2111 return NT_STATUS_OK;
2114 case NDR_WBINT_QUERYSEQUENCENUMBER: {
2115 struct wbint_QuerySequenceNumber *r = (struct wbint_QuerySequenceNumber *)_r;
2116 ZERO_STRUCT(r->out);
2117 r->out.sequence = talloc_zero(mem_ctx, uint32_t);
2118 if (r->out.sequence == NULL) {
2119 return NT_STATUS_NO_MEMORY;
2122 r->out.result = _wbint_QuerySequenceNumber(cli->pipes_struct, r);
2123 return NT_STATUS_OK;
2126 case NDR_WBINT_LOOKUPGROUPMEMBERS: {
2127 struct wbint_LookupGroupMembers *r = (struct wbint_LookupGroupMembers *)_r;
2128 ZERO_STRUCT(r->out);
2129 r->out.members = talloc_zero(mem_ctx, struct wbint_Principals);
2130 if (r->out.members == NULL) {
2131 return NT_STATUS_NO_MEMORY;
2134 r->out.result = _wbint_LookupGroupMembers(cli->pipes_struct, r);
2135 return NT_STATUS_OK;
2138 case NDR_WBINT_QUERYUSERLIST: {
2139 struct wbint_QueryUserList *r = (struct wbint_QueryUserList *)_r;
2140 ZERO_STRUCT(r->out);
2141 r->out.users = talloc_zero(mem_ctx, struct wbint_userinfos);
2142 if (r->out.users == NULL) {
2143 return NT_STATUS_NO_MEMORY;
2146 r->out.result = _wbint_QueryUserList(cli->pipes_struct, r);
2147 return NT_STATUS_OK;
2150 case NDR_WBINT_QUERYGROUPLIST: {
2151 struct wbint_QueryGroupList *r = (struct wbint_QueryGroupList *)_r;
2152 ZERO_STRUCT(r->out);
2153 r->out.groups = talloc_zero(mem_ctx, struct wbint_Principals);
2154 if (r->out.groups == NULL) {
2155 return NT_STATUS_NO_MEMORY;
2158 r->out.result = _wbint_QueryGroupList(cli->pipes_struct, r);
2159 return NT_STATUS_OK;
2162 case NDR_WBINT_DSGETDCNAME: {
2163 struct wbint_DsGetDcName *r = (struct wbint_DsGetDcName *)_r;
2164 ZERO_STRUCT(r->out);
2165 r->out.dc_info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
2166 if (r->out.dc_info == NULL) {
2167 return NT_STATUS_NO_MEMORY;
2170 r->out.result = _wbint_DsGetDcName(cli->pipes_struct, r);
2171 return NT_STATUS_OK;
2174 case NDR_WBINT_LOOKUPRIDS: {
2175 struct wbint_LookupRids *r = (struct wbint_LookupRids *)_r;
2176 ZERO_STRUCT(r->out);
2177 r->out.domain_name = talloc_zero(mem_ctx, const char *);
2178 if (r->out.domain_name == NULL) {
2179 return NT_STATUS_NO_MEMORY;
2182 r->out.names = talloc_zero(mem_ctx, struct wbint_Principals);
2183 if (r->out.names == NULL) {
2184 return NT_STATUS_NO_MEMORY;
2187 r->out.result = _wbint_LookupRids(cli->pipes_struct, r);
2188 return NT_STATUS_OK;
2191 case NDR_WBINT_CHECKMACHINEACCOUNT: {
2192 struct wbint_CheckMachineAccount *r = (struct wbint_CheckMachineAccount *)_r;
2193 r->out.result = _wbint_CheckMachineAccount(cli->pipes_struct, r);
2194 return NT_STATUS_OK;
2197 case NDR_WBINT_CHANGEMACHINEACCOUNT: {
2198 struct wbint_ChangeMachineAccount *r = (struct wbint_ChangeMachineAccount *)_r;
2199 r->out.result = _wbint_ChangeMachineAccount(cli->pipes_struct, r);
2200 return NT_STATUS_OK;
2203 case NDR_WBINT_PINGDC: {
2204 struct wbint_PingDc *r = (struct wbint_PingDc *)_r;
2205 r->out.result = _wbint_PingDc(cli->pipes_struct, r);
2206 return NT_STATUS_OK;
2209 case NDR_WBINT_SETMAPPING: {
2210 struct wbint_SetMapping *r = (struct wbint_SetMapping *)_r;
2211 r->out.result = _wbint_SetMapping(cli->pipes_struct, r);
2212 return NT_STATUS_OK;
2215 case NDR_WBINT_REMOVEMAPPING: {
2216 struct wbint_RemoveMapping *r = (struct wbint_RemoveMapping *)_r;
2217 r->out.result = _wbint_RemoveMapping(cli->pipes_struct, r);
2218 return NT_STATUS_OK;
2221 case NDR_WBINT_SETHWM: {
2222 struct wbint_SetHWM *r = (struct wbint_SetHWM *)_r;
2223 r->out.result = _wbint_SetHWM(cli->pipes_struct, r);
2224 return NT_STATUS_OK;
2227 default:
2228 return NT_STATUS_NOT_IMPLEMENTED;
2232 NTSTATUS rpc_wbint_init(void)
2234 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", &ndr_table_wbint, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct));