s3:winbind: Add an async dsgetdcname call
[Samba.git] / source3 / librpc / gen_ndr / srv_wbint.c
blob5dbd6474b6282c5ec3144ffcb6297922faab7202
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_QueryUser(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_QueryUser *r;
596 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSER];
598 r = talloc(talloc_tos(), struct wbint_QueryUser);
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_QueryUser, r);
625 ZERO_STRUCT(r->out);
626 r->out.info = talloc_zero(r, struct wbint_userinfo);
627 if (r->out.info == NULL) {
628 talloc_free(r);
629 return false;
632 r->out.result = _wbint_QueryUser(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_QueryUser, 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_LookupUserAliases(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_LookupUserAliases *r;
676 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERALIASES];
678 r = talloc(talloc_tos(), struct wbint_LookupUserAliases);
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_LookupUserAliases, r);
705 ZERO_STRUCT(r->out);
706 r->out.rids = talloc_zero(r, struct wbint_RidArray);
707 if (r->out.rids == NULL) {
708 talloc_free(r);
709 return false;
712 r->out.result = _wbint_LookupUserAliases(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_LookupUserAliases, 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_LookupUserGroups(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_LookupUserGroups *r;
756 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPUSERGROUPS];
758 r = talloc(talloc_tos(), struct wbint_LookupUserGroups);
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_LookupUserGroups, r);
785 ZERO_STRUCT(r->out);
786 r->out.sids = talloc_zero(r, struct wbint_SidArray);
787 if (r->out.sids == NULL) {
788 talloc_free(r);
789 return false;
792 r->out.result = _wbint_LookupUserGroups(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_LookupUserGroups, 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_QuerySequenceNumber(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_QuerySequenceNumber *r;
836 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYSEQUENCENUMBER];
838 r = talloc(talloc_tos(), struct wbint_QuerySequenceNumber);
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_QuerySequenceNumber, r);
865 ZERO_STRUCT(r->out);
866 r->out.sequence = talloc_zero(r, uint32_t);
867 if (r->out.sequence == NULL) {
868 talloc_free(r);
869 return false;
872 r->out.result = _wbint_QuerySequenceNumber(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_QuerySequenceNumber, 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_LookupGroupMembers(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_LookupGroupMembers *r;
916 call = &ndr_table_wbint.calls[NDR_WBINT_LOOKUPGROUPMEMBERS];
918 r = talloc(talloc_tos(), struct wbint_LookupGroupMembers);
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_LookupGroupMembers, r);
945 ZERO_STRUCT(r->out);
946 r->out.members = talloc_zero(r, struct wbint_Principals);
947 if (r->out.members == NULL) {
948 talloc_free(r);
949 return false;
952 r->out.result = _wbint_LookupGroupMembers(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_LookupGroupMembers, 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_QueryUserList(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_QueryUserList *r;
996 call = &ndr_table_wbint.calls[NDR_WBINT_QUERYUSERLIST];
998 r = talloc(talloc_tos(), struct wbint_QueryUserList);
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_QueryUserList, r);
1025 ZERO_STRUCT(r->out);
1026 r->out.users = talloc_zero(r, struct wbint_userinfos);
1027 if (r->out.users == NULL) {
1028 talloc_free(r);
1029 return false;
1032 r->out.result = _wbint_QueryUserList(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_QueryUserList, 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_DsGetDcName(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_DsGetDcName *r;
1076 call = &ndr_table_wbint.calls[NDR_WBINT_DSGETDCNAME];
1078 r = talloc(talloc_tos(), struct wbint_DsGetDcName);
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_DsGetDcName, r);
1105 ZERO_STRUCT(r->out);
1106 r->out.dc_info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
1107 if (r->out.dc_info == NULL) {
1108 talloc_free(r);
1109 return false;
1112 r->out.result = _wbint_DsGetDcName(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_DsGetDcName, 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;
1148 /* Tables */
1149 static struct api_struct api_wbint_cmds[] =
1151 {"WBINT_PING", NDR_WBINT_PING, api_wbint_Ping},
1152 {"WBINT_LOOKUPSID", NDR_WBINT_LOOKUPSID, api_wbint_LookupSid},
1153 {"WBINT_LOOKUPNAME", NDR_WBINT_LOOKUPNAME, api_wbint_LookupName},
1154 {"WBINT_SID2UID", NDR_WBINT_SID2UID, api_wbint_Sid2Uid},
1155 {"WBINT_SID2GID", NDR_WBINT_SID2GID, api_wbint_Sid2Gid},
1156 {"WBINT_UID2SID", NDR_WBINT_UID2SID, api_wbint_Uid2Sid},
1157 {"WBINT_GID2SID", NDR_WBINT_GID2SID, api_wbint_Gid2Sid},
1158 {"WBINT_QUERYUSER", NDR_WBINT_QUERYUSER, api_wbint_QueryUser},
1159 {"WBINT_LOOKUPUSERALIASES", NDR_WBINT_LOOKUPUSERALIASES, api_wbint_LookupUserAliases},
1160 {"WBINT_LOOKUPUSERGROUPS", NDR_WBINT_LOOKUPUSERGROUPS, api_wbint_LookupUserGroups},
1161 {"WBINT_QUERYSEQUENCENUMBER", NDR_WBINT_QUERYSEQUENCENUMBER, api_wbint_QuerySequenceNumber},
1162 {"WBINT_LOOKUPGROUPMEMBERS", NDR_WBINT_LOOKUPGROUPMEMBERS, api_wbint_LookupGroupMembers},
1163 {"WBINT_QUERYUSERLIST", NDR_WBINT_QUERYUSERLIST, api_wbint_QueryUserList},
1164 {"WBINT_DSGETDCNAME", NDR_WBINT_DSGETDCNAME, api_wbint_DsGetDcName},
1167 void wbint_get_pipe_fns(struct api_struct **fns, int *n_fns)
1169 *fns = api_wbint_cmds;
1170 *n_fns = sizeof(api_wbint_cmds) / sizeof(struct api_struct);
1173 NTSTATUS rpc_wbint_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
1175 if (cli->pipes_struct == NULL) {
1176 return NT_STATUS_INVALID_PARAMETER;
1179 switch (opnum)
1181 case NDR_WBINT_PING: {
1182 struct wbint_Ping *r = (struct wbint_Ping *)_r;
1183 ZERO_STRUCT(r->out);
1184 r->out.out_data = talloc_zero(mem_ctx, uint32_t);
1185 if (r->out.out_data == NULL) {
1186 return NT_STATUS_NO_MEMORY;
1189 _wbint_Ping(cli->pipes_struct, r);
1190 return NT_STATUS_OK;
1193 case NDR_WBINT_LOOKUPSID: {
1194 struct wbint_LookupSid *r = (struct wbint_LookupSid *)_r;
1195 ZERO_STRUCT(r->out);
1196 r->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
1197 if (r->out.type == NULL) {
1198 return NT_STATUS_NO_MEMORY;
1201 r->out.domain = talloc_zero(mem_ctx, const char *);
1202 if (r->out.domain == NULL) {
1203 return NT_STATUS_NO_MEMORY;
1206 r->out.name = talloc_zero(mem_ctx, const char *);
1207 if (r->out.name == NULL) {
1208 return NT_STATUS_NO_MEMORY;
1211 r->out.result = _wbint_LookupSid(cli->pipes_struct, r);
1212 return NT_STATUS_OK;
1215 case NDR_WBINT_LOOKUPNAME: {
1216 struct wbint_LookupName *r = (struct wbint_LookupName *)_r;
1217 ZERO_STRUCT(r->out);
1218 r->out.type = talloc_zero(mem_ctx, enum lsa_SidType);
1219 if (r->out.type == NULL) {
1220 return NT_STATUS_NO_MEMORY;
1223 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
1224 if (r->out.sid == NULL) {
1225 return NT_STATUS_NO_MEMORY;
1228 r->out.result = _wbint_LookupName(cli->pipes_struct, r);
1229 return NT_STATUS_OK;
1232 case NDR_WBINT_SID2UID: {
1233 struct wbint_Sid2Uid *r = (struct wbint_Sid2Uid *)_r;
1234 ZERO_STRUCT(r->out);
1235 r->out.uid = talloc_zero(mem_ctx, uint64_t);
1236 if (r->out.uid == NULL) {
1237 return NT_STATUS_NO_MEMORY;
1240 r->out.result = _wbint_Sid2Uid(cli->pipes_struct, r);
1241 return NT_STATUS_OK;
1244 case NDR_WBINT_SID2GID: {
1245 struct wbint_Sid2Gid *r = (struct wbint_Sid2Gid *)_r;
1246 ZERO_STRUCT(r->out);
1247 r->out.gid = talloc_zero(mem_ctx, uint64_t);
1248 if (r->out.gid == NULL) {
1249 return NT_STATUS_NO_MEMORY;
1252 r->out.result = _wbint_Sid2Gid(cli->pipes_struct, r);
1253 return NT_STATUS_OK;
1256 case NDR_WBINT_UID2SID: {
1257 struct wbint_Uid2Sid *r = (struct wbint_Uid2Sid *)_r;
1258 ZERO_STRUCT(r->out);
1259 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
1260 if (r->out.sid == NULL) {
1261 return NT_STATUS_NO_MEMORY;
1264 r->out.result = _wbint_Uid2Sid(cli->pipes_struct, r);
1265 return NT_STATUS_OK;
1268 case NDR_WBINT_GID2SID: {
1269 struct wbint_Gid2Sid *r = (struct wbint_Gid2Sid *)_r;
1270 ZERO_STRUCT(r->out);
1271 r->out.sid = talloc_zero(mem_ctx, struct dom_sid);
1272 if (r->out.sid == NULL) {
1273 return NT_STATUS_NO_MEMORY;
1276 r->out.result = _wbint_Gid2Sid(cli->pipes_struct, r);
1277 return NT_STATUS_OK;
1280 case NDR_WBINT_QUERYUSER: {
1281 struct wbint_QueryUser *r = (struct wbint_QueryUser *)_r;
1282 ZERO_STRUCT(r->out);
1283 r->out.info = talloc_zero(mem_ctx, struct wbint_userinfo);
1284 if (r->out.info == NULL) {
1285 return NT_STATUS_NO_MEMORY;
1288 r->out.result = _wbint_QueryUser(cli->pipes_struct, r);
1289 return NT_STATUS_OK;
1292 case NDR_WBINT_LOOKUPUSERALIASES: {
1293 struct wbint_LookupUserAliases *r = (struct wbint_LookupUserAliases *)_r;
1294 ZERO_STRUCT(r->out);
1295 r->out.rids = talloc_zero(mem_ctx, struct wbint_RidArray);
1296 if (r->out.rids == NULL) {
1297 return NT_STATUS_NO_MEMORY;
1300 r->out.result = _wbint_LookupUserAliases(cli->pipes_struct, r);
1301 return NT_STATUS_OK;
1304 case NDR_WBINT_LOOKUPUSERGROUPS: {
1305 struct wbint_LookupUserGroups *r = (struct wbint_LookupUserGroups *)_r;
1306 ZERO_STRUCT(r->out);
1307 r->out.sids = talloc_zero(mem_ctx, struct wbint_SidArray);
1308 if (r->out.sids == NULL) {
1309 return NT_STATUS_NO_MEMORY;
1312 r->out.result = _wbint_LookupUserGroups(cli->pipes_struct, r);
1313 return NT_STATUS_OK;
1316 case NDR_WBINT_QUERYSEQUENCENUMBER: {
1317 struct wbint_QuerySequenceNumber *r = (struct wbint_QuerySequenceNumber *)_r;
1318 ZERO_STRUCT(r->out);
1319 r->out.sequence = talloc_zero(mem_ctx, uint32_t);
1320 if (r->out.sequence == NULL) {
1321 return NT_STATUS_NO_MEMORY;
1324 r->out.result = _wbint_QuerySequenceNumber(cli->pipes_struct, r);
1325 return NT_STATUS_OK;
1328 case NDR_WBINT_LOOKUPGROUPMEMBERS: {
1329 struct wbint_LookupGroupMembers *r = (struct wbint_LookupGroupMembers *)_r;
1330 ZERO_STRUCT(r->out);
1331 r->out.members = talloc_zero(mem_ctx, struct wbint_Principals);
1332 if (r->out.members == NULL) {
1333 return NT_STATUS_NO_MEMORY;
1336 r->out.result = _wbint_LookupGroupMembers(cli->pipes_struct, r);
1337 return NT_STATUS_OK;
1340 case NDR_WBINT_QUERYUSERLIST: {
1341 struct wbint_QueryUserList *r = (struct wbint_QueryUserList *)_r;
1342 ZERO_STRUCT(r->out);
1343 r->out.users = talloc_zero(mem_ctx, struct wbint_userinfos);
1344 if (r->out.users == NULL) {
1345 return NT_STATUS_NO_MEMORY;
1348 r->out.result = _wbint_QueryUserList(cli->pipes_struct, r);
1349 return NT_STATUS_OK;
1352 case NDR_WBINT_DSGETDCNAME: {
1353 struct wbint_DsGetDcName *r = (struct wbint_DsGetDcName *)_r;
1354 ZERO_STRUCT(r->out);
1355 r->out.dc_info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
1356 if (r->out.dc_info == NULL) {
1357 return NT_STATUS_NO_MEMORY;
1360 r->out.result = _wbint_DsGetDcName(cli->pipes_struct, r);
1361 return NT_STATUS_OK;
1364 default:
1365 return NT_STATUS_NOT_IMPLEMENTED;
1369 NTSTATUS rpc_wbint_init(void)
1371 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "wbint", "wbint", &ndr_table_wbint, api_wbint_cmds, sizeof(api_wbint_cmds) / sizeof(struct api_struct));