Revert "s4: Let the "setpassword" script finally use the "samdb_set_password" routine"
[Samba/aatanasov.git] / librpc / gen_ndr / srv_lsa.c
blobf1b4a06d0d403b80bc22c35c835e08dd2a683161
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_lsa.h"
9 static bool api_lsa_Close(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 lsa_Close *r;
18 call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSE];
20 r = talloc(talloc_tos(), struct lsa_Close);
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(lsa_Close, r);
47 ZERO_STRUCT(r->out);
48 r->out.handle = r->in.handle;
49 r->out.result = _lsa_Close(p, r);
51 if (p->rng_fault_state) {
52 talloc_free(r);
53 /* Return true here, srv_pipe_hnd.c will take care */
54 return true;
57 if (DEBUGLEVEL >= 10) {
58 NDR_PRINT_OUT_DEBUG(lsa_Close, r);
61 push = ndr_push_init_ctx(r, NULL);
62 if (push == NULL) {
63 talloc_free(r);
64 return false;
67 ndr_err = call->ndr_push(push, NDR_OUT, r);
68 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
69 talloc_free(r);
70 return false;
73 blob = ndr_push_blob(push);
74 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
75 talloc_free(r);
76 return false;
79 talloc_free(r);
81 return true;
84 static bool api_lsa_Delete(pipes_struct *p)
86 const struct ndr_interface_call *call;
87 struct ndr_pull *pull;
88 struct ndr_push *push;
89 enum ndr_err_code ndr_err;
90 DATA_BLOB blob;
91 struct lsa_Delete *r;
93 call = &ndr_table_lsarpc.calls[NDR_LSA_DELETE];
95 r = talloc(talloc_tos(), struct lsa_Delete);
96 if (r == NULL) {
97 return false;
100 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
101 talloc_free(r);
102 return false;
105 pull = ndr_pull_init_blob(&blob, r, NULL);
106 if (pull == NULL) {
107 talloc_free(r);
108 return false;
111 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
112 ndr_err = call->ndr_pull(pull, NDR_IN, r);
113 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
114 talloc_free(r);
115 return false;
118 if (DEBUGLEVEL >= 10) {
119 NDR_PRINT_IN_DEBUG(lsa_Delete, r);
122 r->out.result = _lsa_Delete(p, r);
124 if (p->rng_fault_state) {
125 talloc_free(r);
126 /* Return true here, srv_pipe_hnd.c will take care */
127 return true;
130 if (DEBUGLEVEL >= 10) {
131 NDR_PRINT_OUT_DEBUG(lsa_Delete, r);
134 push = ndr_push_init_ctx(r, NULL);
135 if (push == NULL) {
136 talloc_free(r);
137 return false;
140 ndr_err = call->ndr_push(push, NDR_OUT, r);
141 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
142 talloc_free(r);
143 return false;
146 blob = ndr_push_blob(push);
147 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
148 talloc_free(r);
149 return false;
152 talloc_free(r);
154 return true;
157 static bool api_lsa_EnumPrivs(pipes_struct *p)
159 const struct ndr_interface_call *call;
160 struct ndr_pull *pull;
161 struct ndr_push *push;
162 enum ndr_err_code ndr_err;
163 DATA_BLOB blob;
164 struct lsa_EnumPrivs *r;
166 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVS];
168 r = talloc(talloc_tos(), struct lsa_EnumPrivs);
169 if (r == NULL) {
170 return false;
173 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
174 talloc_free(r);
175 return false;
178 pull = ndr_pull_init_blob(&blob, r, NULL);
179 if (pull == NULL) {
180 talloc_free(r);
181 return false;
184 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
185 ndr_err = call->ndr_pull(pull, NDR_IN, r);
186 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
187 talloc_free(r);
188 return false;
191 if (DEBUGLEVEL >= 10) {
192 NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, r);
195 ZERO_STRUCT(r->out);
196 r->out.resume_handle = r->in.resume_handle;
197 r->out.privs = talloc_zero(r, struct lsa_PrivArray);
198 if (r->out.privs == NULL) {
199 talloc_free(r);
200 return false;
203 r->out.result = _lsa_EnumPrivs(p, r);
205 if (p->rng_fault_state) {
206 talloc_free(r);
207 /* Return true here, srv_pipe_hnd.c will take care */
208 return true;
211 if (DEBUGLEVEL >= 10) {
212 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, r);
215 push = ndr_push_init_ctx(r, NULL);
216 if (push == NULL) {
217 talloc_free(r);
218 return false;
221 ndr_err = call->ndr_push(push, NDR_OUT, r);
222 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
223 talloc_free(r);
224 return false;
227 blob = ndr_push_blob(push);
228 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
229 talloc_free(r);
230 return false;
233 talloc_free(r);
235 return true;
238 static bool api_lsa_QuerySecurity(pipes_struct *p)
240 const struct ndr_interface_call *call;
241 struct ndr_pull *pull;
242 struct ndr_push *push;
243 enum ndr_err_code ndr_err;
244 DATA_BLOB blob;
245 struct lsa_QuerySecurity *r;
247 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECURITY];
249 r = talloc(talloc_tos(), struct lsa_QuerySecurity);
250 if (r == NULL) {
251 return false;
254 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
255 talloc_free(r);
256 return false;
259 pull = ndr_pull_init_blob(&blob, r, NULL);
260 if (pull == NULL) {
261 talloc_free(r);
262 return false;
265 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
266 ndr_err = call->ndr_pull(pull, NDR_IN, r);
267 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
268 talloc_free(r);
269 return false;
272 if (DEBUGLEVEL >= 10) {
273 NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, r);
276 ZERO_STRUCT(r->out);
277 r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *);
278 if (r->out.sdbuf == NULL) {
279 talloc_free(r);
280 return false;
283 r->out.result = _lsa_QuerySecurity(p, r);
285 if (p->rng_fault_state) {
286 talloc_free(r);
287 /* Return true here, srv_pipe_hnd.c will take care */
288 return true;
291 if (DEBUGLEVEL >= 10) {
292 NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, r);
295 push = ndr_push_init_ctx(r, NULL);
296 if (push == NULL) {
297 talloc_free(r);
298 return false;
301 ndr_err = call->ndr_push(push, NDR_OUT, r);
302 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
303 talloc_free(r);
304 return false;
307 blob = ndr_push_blob(push);
308 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
309 talloc_free(r);
310 return false;
313 talloc_free(r);
315 return true;
318 static bool api_lsa_SetSecObj(pipes_struct *p)
320 const struct ndr_interface_call *call;
321 struct ndr_pull *pull;
322 struct ndr_push *push;
323 enum ndr_err_code ndr_err;
324 DATA_BLOB blob;
325 struct lsa_SetSecObj *r;
327 call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECOBJ];
329 r = talloc(talloc_tos(), struct lsa_SetSecObj);
330 if (r == NULL) {
331 return false;
334 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
335 talloc_free(r);
336 return false;
339 pull = ndr_pull_init_blob(&blob, r, NULL);
340 if (pull == NULL) {
341 talloc_free(r);
342 return false;
345 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
346 ndr_err = call->ndr_pull(pull, NDR_IN, r);
347 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
348 talloc_free(r);
349 return false;
352 if (DEBUGLEVEL >= 10) {
353 NDR_PRINT_IN_DEBUG(lsa_SetSecObj, r);
356 r->out.result = _lsa_SetSecObj(p, r);
358 if (p->rng_fault_state) {
359 talloc_free(r);
360 /* Return true here, srv_pipe_hnd.c will take care */
361 return true;
364 if (DEBUGLEVEL >= 10) {
365 NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, r);
368 push = ndr_push_init_ctx(r, NULL);
369 if (push == NULL) {
370 talloc_free(r);
371 return false;
374 ndr_err = call->ndr_push(push, NDR_OUT, r);
375 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
376 talloc_free(r);
377 return false;
380 blob = ndr_push_blob(push);
381 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
382 talloc_free(r);
383 return false;
386 talloc_free(r);
388 return true;
391 static bool api_lsa_ChangePassword(pipes_struct *p)
393 const struct ndr_interface_call *call;
394 struct ndr_pull *pull;
395 struct ndr_push *push;
396 enum ndr_err_code ndr_err;
397 DATA_BLOB blob;
398 struct lsa_ChangePassword *r;
400 call = &ndr_table_lsarpc.calls[NDR_LSA_CHANGEPASSWORD];
402 r = talloc(talloc_tos(), struct lsa_ChangePassword);
403 if (r == NULL) {
404 return false;
407 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
408 talloc_free(r);
409 return false;
412 pull = ndr_pull_init_blob(&blob, r, NULL);
413 if (pull == NULL) {
414 talloc_free(r);
415 return false;
418 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
419 ndr_err = call->ndr_pull(pull, NDR_IN, r);
420 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
421 talloc_free(r);
422 return false;
425 if (DEBUGLEVEL >= 10) {
426 NDR_PRINT_IN_DEBUG(lsa_ChangePassword, r);
429 r->out.result = _lsa_ChangePassword(p, r);
431 if (p->rng_fault_state) {
432 talloc_free(r);
433 /* Return true here, srv_pipe_hnd.c will take care */
434 return true;
437 if (DEBUGLEVEL >= 10) {
438 NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, r);
441 push = ndr_push_init_ctx(r, NULL);
442 if (push == NULL) {
443 talloc_free(r);
444 return false;
447 ndr_err = call->ndr_push(push, NDR_OUT, r);
448 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
449 talloc_free(r);
450 return false;
453 blob = ndr_push_blob(push);
454 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
455 talloc_free(r);
456 return false;
459 talloc_free(r);
461 return true;
464 static bool api_lsa_OpenPolicy(pipes_struct *p)
466 const struct ndr_interface_call *call;
467 struct ndr_pull *pull;
468 struct ndr_push *push;
469 enum ndr_err_code ndr_err;
470 DATA_BLOB blob;
471 struct lsa_OpenPolicy *r;
473 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY];
475 r = talloc(talloc_tos(), struct lsa_OpenPolicy);
476 if (r == NULL) {
477 return false;
480 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
481 talloc_free(r);
482 return false;
485 pull = ndr_pull_init_blob(&blob, r, NULL);
486 if (pull == NULL) {
487 talloc_free(r);
488 return false;
491 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
492 ndr_err = call->ndr_pull(pull, NDR_IN, r);
493 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
494 talloc_free(r);
495 return false;
498 if (DEBUGLEVEL >= 10) {
499 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, r);
502 ZERO_STRUCT(r->out);
503 r->out.handle = talloc_zero(r, struct policy_handle);
504 if (r->out.handle == NULL) {
505 talloc_free(r);
506 return false;
509 r->out.result = _lsa_OpenPolicy(p, r);
511 if (p->rng_fault_state) {
512 talloc_free(r);
513 /* Return true here, srv_pipe_hnd.c will take care */
514 return true;
517 if (DEBUGLEVEL >= 10) {
518 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, r);
521 push = ndr_push_init_ctx(r, NULL);
522 if (push == NULL) {
523 talloc_free(r);
524 return false;
527 ndr_err = call->ndr_push(push, NDR_OUT, r);
528 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
529 talloc_free(r);
530 return false;
533 blob = ndr_push_blob(push);
534 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
535 talloc_free(r);
536 return false;
539 talloc_free(r);
541 return true;
544 static bool api_lsa_QueryInfoPolicy(pipes_struct *p)
546 const struct ndr_interface_call *call;
547 struct ndr_pull *pull;
548 struct ndr_push *push;
549 enum ndr_err_code ndr_err;
550 DATA_BLOB blob;
551 struct lsa_QueryInfoPolicy *r;
553 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY];
555 r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy);
556 if (r == NULL) {
557 return false;
560 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
561 talloc_free(r);
562 return false;
565 pull = ndr_pull_init_blob(&blob, r, NULL);
566 if (pull == NULL) {
567 talloc_free(r);
568 return false;
571 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
572 ndr_err = call->ndr_pull(pull, NDR_IN, r);
573 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
574 talloc_free(r);
575 return false;
578 if (DEBUGLEVEL >= 10) {
579 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, r);
582 ZERO_STRUCT(r->out);
583 r->out.info = talloc_zero(r, union lsa_PolicyInformation *);
584 if (r->out.info == NULL) {
585 talloc_free(r);
586 return false;
589 r->out.result = _lsa_QueryInfoPolicy(p, r);
591 if (p->rng_fault_state) {
592 talloc_free(r);
593 /* Return true here, srv_pipe_hnd.c will take care */
594 return true;
597 if (DEBUGLEVEL >= 10) {
598 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, r);
601 push = ndr_push_init_ctx(r, NULL);
602 if (push == NULL) {
603 talloc_free(r);
604 return false;
607 ndr_err = call->ndr_push(push, NDR_OUT, r);
608 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
609 talloc_free(r);
610 return false;
613 blob = ndr_push_blob(push);
614 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
615 talloc_free(r);
616 return false;
619 talloc_free(r);
621 return true;
624 static bool api_lsa_SetInfoPolicy(pipes_struct *p)
626 const struct ndr_interface_call *call;
627 struct ndr_pull *pull;
628 struct ndr_push *push;
629 enum ndr_err_code ndr_err;
630 DATA_BLOB blob;
631 struct lsa_SetInfoPolicy *r;
633 call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY];
635 r = talloc(talloc_tos(), struct lsa_SetInfoPolicy);
636 if (r == NULL) {
637 return false;
640 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
641 talloc_free(r);
642 return false;
645 pull = ndr_pull_init_blob(&blob, r, NULL);
646 if (pull == NULL) {
647 talloc_free(r);
648 return false;
651 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
652 ndr_err = call->ndr_pull(pull, NDR_IN, r);
653 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
654 talloc_free(r);
655 return false;
658 if (DEBUGLEVEL >= 10) {
659 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, r);
662 r->out.result = _lsa_SetInfoPolicy(p, r);
664 if (p->rng_fault_state) {
665 talloc_free(r);
666 /* Return true here, srv_pipe_hnd.c will take care */
667 return true;
670 if (DEBUGLEVEL >= 10) {
671 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, r);
674 push = ndr_push_init_ctx(r, NULL);
675 if (push == NULL) {
676 talloc_free(r);
677 return false;
680 ndr_err = call->ndr_push(push, NDR_OUT, r);
681 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
682 talloc_free(r);
683 return false;
686 blob = ndr_push_blob(push);
687 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
688 talloc_free(r);
689 return false;
692 talloc_free(r);
694 return true;
697 static bool api_lsa_ClearAuditLog(pipes_struct *p)
699 const struct ndr_interface_call *call;
700 struct ndr_pull *pull;
701 struct ndr_push *push;
702 enum ndr_err_code ndr_err;
703 DATA_BLOB blob;
704 struct lsa_ClearAuditLog *r;
706 call = &ndr_table_lsarpc.calls[NDR_LSA_CLEARAUDITLOG];
708 r = talloc(talloc_tos(), struct lsa_ClearAuditLog);
709 if (r == NULL) {
710 return false;
713 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
714 talloc_free(r);
715 return false;
718 pull = ndr_pull_init_blob(&blob, r, NULL);
719 if (pull == NULL) {
720 talloc_free(r);
721 return false;
724 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
725 ndr_err = call->ndr_pull(pull, NDR_IN, r);
726 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
727 talloc_free(r);
728 return false;
731 if (DEBUGLEVEL >= 10) {
732 NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, r);
735 r->out.result = _lsa_ClearAuditLog(p, r);
737 if (p->rng_fault_state) {
738 talloc_free(r);
739 /* Return true here, srv_pipe_hnd.c will take care */
740 return true;
743 if (DEBUGLEVEL >= 10) {
744 NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, r);
747 push = ndr_push_init_ctx(r, NULL);
748 if (push == NULL) {
749 talloc_free(r);
750 return false;
753 ndr_err = call->ndr_push(push, NDR_OUT, r);
754 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
755 talloc_free(r);
756 return false;
759 blob = ndr_push_blob(push);
760 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
761 talloc_free(r);
762 return false;
765 talloc_free(r);
767 return true;
770 static bool api_lsa_CreateAccount(pipes_struct *p)
772 const struct ndr_interface_call *call;
773 struct ndr_pull *pull;
774 struct ndr_push *push;
775 enum ndr_err_code ndr_err;
776 DATA_BLOB blob;
777 struct lsa_CreateAccount *r;
779 call = &ndr_table_lsarpc.calls[NDR_LSA_CREATEACCOUNT];
781 r = talloc(talloc_tos(), struct lsa_CreateAccount);
782 if (r == NULL) {
783 return false;
786 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
787 talloc_free(r);
788 return false;
791 pull = ndr_pull_init_blob(&blob, r, NULL);
792 if (pull == NULL) {
793 talloc_free(r);
794 return false;
797 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
798 ndr_err = call->ndr_pull(pull, NDR_IN, r);
799 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
800 talloc_free(r);
801 return false;
804 if (DEBUGLEVEL >= 10) {
805 NDR_PRINT_IN_DEBUG(lsa_CreateAccount, r);
808 ZERO_STRUCT(r->out);
809 r->out.acct_handle = talloc_zero(r, struct policy_handle);
810 if (r->out.acct_handle == NULL) {
811 talloc_free(r);
812 return false;
815 r->out.result = _lsa_CreateAccount(p, r);
817 if (p->rng_fault_state) {
818 talloc_free(r);
819 /* Return true here, srv_pipe_hnd.c will take care */
820 return true;
823 if (DEBUGLEVEL >= 10) {
824 NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, r);
827 push = ndr_push_init_ctx(r, NULL);
828 if (push == NULL) {
829 talloc_free(r);
830 return false;
833 ndr_err = call->ndr_push(push, NDR_OUT, r);
834 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
835 talloc_free(r);
836 return false;
839 blob = ndr_push_blob(push);
840 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
841 talloc_free(r);
842 return false;
845 talloc_free(r);
847 return true;
850 static bool api_lsa_EnumAccounts(pipes_struct *p)
852 const struct ndr_interface_call *call;
853 struct ndr_pull *pull;
854 struct ndr_push *push;
855 enum ndr_err_code ndr_err;
856 DATA_BLOB blob;
857 struct lsa_EnumAccounts *r;
859 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTS];
861 r = talloc(talloc_tos(), struct lsa_EnumAccounts);
862 if (r == NULL) {
863 return false;
866 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
867 talloc_free(r);
868 return false;
871 pull = ndr_pull_init_blob(&blob, r, NULL);
872 if (pull == NULL) {
873 talloc_free(r);
874 return false;
877 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
878 ndr_err = call->ndr_pull(pull, NDR_IN, r);
879 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
880 talloc_free(r);
881 return false;
884 if (DEBUGLEVEL >= 10) {
885 NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, r);
888 ZERO_STRUCT(r->out);
889 r->out.resume_handle = r->in.resume_handle;
890 r->out.sids = talloc_zero(r, struct lsa_SidArray);
891 if (r->out.sids == NULL) {
892 talloc_free(r);
893 return false;
896 r->out.result = _lsa_EnumAccounts(p, r);
898 if (p->rng_fault_state) {
899 talloc_free(r);
900 /* Return true here, srv_pipe_hnd.c will take care */
901 return true;
904 if (DEBUGLEVEL >= 10) {
905 NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, r);
908 push = ndr_push_init_ctx(r, NULL);
909 if (push == NULL) {
910 talloc_free(r);
911 return false;
914 ndr_err = call->ndr_push(push, NDR_OUT, r);
915 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
916 talloc_free(r);
917 return false;
920 blob = ndr_push_blob(push);
921 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
922 talloc_free(r);
923 return false;
926 talloc_free(r);
928 return true;
931 static bool api_lsa_CreateTrustedDomain(pipes_struct *p)
933 const struct ndr_interface_call *call;
934 struct ndr_pull *pull;
935 struct ndr_push *push;
936 enum ndr_err_code ndr_err;
937 DATA_BLOB blob;
938 struct lsa_CreateTrustedDomain *r;
940 call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAIN];
942 r = talloc(talloc_tos(), struct lsa_CreateTrustedDomain);
943 if (r == NULL) {
944 return false;
947 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
948 talloc_free(r);
949 return false;
952 pull = ndr_pull_init_blob(&blob, r, NULL);
953 if (pull == NULL) {
954 talloc_free(r);
955 return false;
958 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
959 ndr_err = call->ndr_pull(pull, NDR_IN, r);
960 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
961 talloc_free(r);
962 return false;
965 if (DEBUGLEVEL >= 10) {
966 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, r);
969 ZERO_STRUCT(r->out);
970 r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
971 if (r->out.trustdom_handle == NULL) {
972 talloc_free(r);
973 return false;
976 r->out.result = _lsa_CreateTrustedDomain(p, r);
978 if (p->rng_fault_state) {
979 talloc_free(r);
980 /* Return true here, srv_pipe_hnd.c will take care */
981 return true;
984 if (DEBUGLEVEL >= 10) {
985 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, r);
988 push = ndr_push_init_ctx(r, NULL);
989 if (push == NULL) {
990 talloc_free(r);
991 return false;
994 ndr_err = call->ndr_push(push, NDR_OUT, r);
995 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
996 talloc_free(r);
997 return false;
1000 blob = ndr_push_blob(push);
1001 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1002 talloc_free(r);
1003 return false;
1006 talloc_free(r);
1008 return true;
1011 static bool api_lsa_EnumTrustDom(pipes_struct *p)
1013 const struct ndr_interface_call *call;
1014 struct ndr_pull *pull;
1015 struct ndr_push *push;
1016 enum ndr_err_code ndr_err;
1017 DATA_BLOB blob;
1018 struct lsa_EnumTrustDom *r;
1020 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTDOM];
1022 r = talloc(talloc_tos(), struct lsa_EnumTrustDom);
1023 if (r == NULL) {
1024 return false;
1027 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1028 talloc_free(r);
1029 return false;
1032 pull = ndr_pull_init_blob(&blob, r, NULL);
1033 if (pull == NULL) {
1034 talloc_free(r);
1035 return false;
1038 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1039 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1040 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1041 talloc_free(r);
1042 return false;
1045 if (DEBUGLEVEL >= 10) {
1046 NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, r);
1049 ZERO_STRUCT(r->out);
1050 r->out.resume_handle = r->in.resume_handle;
1051 r->out.domains = talloc_zero(r, struct lsa_DomainList);
1052 if (r->out.domains == NULL) {
1053 talloc_free(r);
1054 return false;
1057 r->out.result = _lsa_EnumTrustDom(p, r);
1059 if (p->rng_fault_state) {
1060 talloc_free(r);
1061 /* Return true here, srv_pipe_hnd.c will take care */
1062 return true;
1065 if (DEBUGLEVEL >= 10) {
1066 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, r);
1069 push = ndr_push_init_ctx(r, NULL);
1070 if (push == NULL) {
1071 talloc_free(r);
1072 return false;
1075 ndr_err = call->ndr_push(push, NDR_OUT, r);
1076 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1077 talloc_free(r);
1078 return false;
1081 blob = ndr_push_blob(push);
1082 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1083 talloc_free(r);
1084 return false;
1087 talloc_free(r);
1089 return true;
1092 static bool api_lsa_LookupNames(pipes_struct *p)
1094 const struct ndr_interface_call *call;
1095 struct ndr_pull *pull;
1096 struct ndr_push *push;
1097 enum ndr_err_code ndr_err;
1098 DATA_BLOB blob;
1099 struct lsa_LookupNames *r;
1101 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES];
1103 r = talloc(talloc_tos(), struct lsa_LookupNames);
1104 if (r == NULL) {
1105 return false;
1108 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1109 talloc_free(r);
1110 return false;
1113 pull = ndr_pull_init_blob(&blob, r, NULL);
1114 if (pull == NULL) {
1115 talloc_free(r);
1116 return false;
1119 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1120 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1121 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1122 talloc_free(r);
1123 return false;
1126 if (DEBUGLEVEL >= 10) {
1127 NDR_PRINT_IN_DEBUG(lsa_LookupNames, r);
1130 ZERO_STRUCT(r->out);
1131 r->out.sids = r->in.sids;
1132 r->out.count = r->in.count;
1133 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
1134 if (r->out.domains == NULL) {
1135 talloc_free(r);
1136 return false;
1139 r->out.result = _lsa_LookupNames(p, r);
1141 if (p->rng_fault_state) {
1142 talloc_free(r);
1143 /* Return true here, srv_pipe_hnd.c will take care */
1144 return true;
1147 if (DEBUGLEVEL >= 10) {
1148 NDR_PRINT_OUT_DEBUG(lsa_LookupNames, r);
1151 push = ndr_push_init_ctx(r, NULL);
1152 if (push == NULL) {
1153 talloc_free(r);
1154 return false;
1157 ndr_err = call->ndr_push(push, NDR_OUT, r);
1158 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1159 talloc_free(r);
1160 return false;
1163 blob = ndr_push_blob(push);
1164 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1165 talloc_free(r);
1166 return false;
1169 talloc_free(r);
1171 return true;
1174 static bool api_lsa_LookupSids(pipes_struct *p)
1176 const struct ndr_interface_call *call;
1177 struct ndr_pull *pull;
1178 struct ndr_push *push;
1179 enum ndr_err_code ndr_err;
1180 DATA_BLOB blob;
1181 struct lsa_LookupSids *r;
1183 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS];
1185 r = talloc(talloc_tos(), struct lsa_LookupSids);
1186 if (r == NULL) {
1187 return false;
1190 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1191 talloc_free(r);
1192 return false;
1195 pull = ndr_pull_init_blob(&blob, r, NULL);
1196 if (pull == NULL) {
1197 talloc_free(r);
1198 return false;
1201 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1202 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1204 talloc_free(r);
1205 return false;
1208 if (DEBUGLEVEL >= 10) {
1209 NDR_PRINT_IN_DEBUG(lsa_LookupSids, r);
1212 ZERO_STRUCT(r->out);
1213 r->out.names = r->in.names;
1214 r->out.count = r->in.count;
1215 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
1216 if (r->out.domains == NULL) {
1217 talloc_free(r);
1218 return false;
1221 r->out.result = _lsa_LookupSids(p, r);
1223 if (p->rng_fault_state) {
1224 talloc_free(r);
1225 /* Return true here, srv_pipe_hnd.c will take care */
1226 return true;
1229 if (DEBUGLEVEL >= 10) {
1230 NDR_PRINT_OUT_DEBUG(lsa_LookupSids, r);
1233 push = ndr_push_init_ctx(r, NULL);
1234 if (push == NULL) {
1235 talloc_free(r);
1236 return false;
1239 ndr_err = call->ndr_push(push, NDR_OUT, r);
1240 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1241 talloc_free(r);
1242 return false;
1245 blob = ndr_push_blob(push);
1246 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1247 talloc_free(r);
1248 return false;
1251 talloc_free(r);
1253 return true;
1256 static bool api_lsa_CreateSecret(pipes_struct *p)
1258 const struct ndr_interface_call *call;
1259 struct ndr_pull *pull;
1260 struct ndr_push *push;
1261 enum ndr_err_code ndr_err;
1262 DATA_BLOB blob;
1263 struct lsa_CreateSecret *r;
1265 call = &ndr_table_lsarpc.calls[NDR_LSA_CREATESECRET];
1267 r = talloc(talloc_tos(), struct lsa_CreateSecret);
1268 if (r == NULL) {
1269 return false;
1272 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1273 talloc_free(r);
1274 return false;
1277 pull = ndr_pull_init_blob(&blob, r, NULL);
1278 if (pull == NULL) {
1279 talloc_free(r);
1280 return false;
1283 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1284 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1285 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1286 talloc_free(r);
1287 return false;
1290 if (DEBUGLEVEL >= 10) {
1291 NDR_PRINT_IN_DEBUG(lsa_CreateSecret, r);
1294 ZERO_STRUCT(r->out);
1295 r->out.sec_handle = talloc_zero(r, struct policy_handle);
1296 if (r->out.sec_handle == NULL) {
1297 talloc_free(r);
1298 return false;
1301 r->out.result = _lsa_CreateSecret(p, r);
1303 if (p->rng_fault_state) {
1304 talloc_free(r);
1305 /* Return true here, srv_pipe_hnd.c will take care */
1306 return true;
1309 if (DEBUGLEVEL >= 10) {
1310 NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, r);
1313 push = ndr_push_init_ctx(r, NULL);
1314 if (push == NULL) {
1315 talloc_free(r);
1316 return false;
1319 ndr_err = call->ndr_push(push, NDR_OUT, r);
1320 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1321 talloc_free(r);
1322 return false;
1325 blob = ndr_push_blob(push);
1326 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1327 talloc_free(r);
1328 return false;
1331 talloc_free(r);
1333 return true;
1336 static bool api_lsa_OpenAccount(pipes_struct *p)
1338 const struct ndr_interface_call *call;
1339 struct ndr_pull *pull;
1340 struct ndr_push *push;
1341 enum ndr_err_code ndr_err;
1342 DATA_BLOB blob;
1343 struct lsa_OpenAccount *r;
1345 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENACCOUNT];
1347 r = talloc(talloc_tos(), struct lsa_OpenAccount);
1348 if (r == NULL) {
1349 return false;
1352 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1353 talloc_free(r);
1354 return false;
1357 pull = ndr_pull_init_blob(&blob, r, NULL);
1358 if (pull == NULL) {
1359 talloc_free(r);
1360 return false;
1363 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1364 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1365 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1366 talloc_free(r);
1367 return false;
1370 if (DEBUGLEVEL >= 10) {
1371 NDR_PRINT_IN_DEBUG(lsa_OpenAccount, r);
1374 ZERO_STRUCT(r->out);
1375 r->out.acct_handle = talloc_zero(r, struct policy_handle);
1376 if (r->out.acct_handle == NULL) {
1377 talloc_free(r);
1378 return false;
1381 r->out.result = _lsa_OpenAccount(p, r);
1383 if (p->rng_fault_state) {
1384 talloc_free(r);
1385 /* Return true here, srv_pipe_hnd.c will take care */
1386 return true;
1389 if (DEBUGLEVEL >= 10) {
1390 NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, r);
1393 push = ndr_push_init_ctx(r, NULL);
1394 if (push == NULL) {
1395 talloc_free(r);
1396 return false;
1399 ndr_err = call->ndr_push(push, NDR_OUT, r);
1400 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1401 talloc_free(r);
1402 return false;
1405 blob = ndr_push_blob(push);
1406 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1407 talloc_free(r);
1408 return false;
1411 talloc_free(r);
1413 return true;
1416 static bool api_lsa_EnumPrivsAccount(pipes_struct *p)
1418 const struct ndr_interface_call *call;
1419 struct ndr_pull *pull;
1420 struct ndr_push *push;
1421 enum ndr_err_code ndr_err;
1422 DATA_BLOB blob;
1423 struct lsa_EnumPrivsAccount *r;
1425 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVSACCOUNT];
1427 r = talloc(talloc_tos(), struct lsa_EnumPrivsAccount);
1428 if (r == NULL) {
1429 return false;
1432 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1433 talloc_free(r);
1434 return false;
1437 pull = ndr_pull_init_blob(&blob, r, NULL);
1438 if (pull == NULL) {
1439 talloc_free(r);
1440 return false;
1443 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1444 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1445 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1446 talloc_free(r);
1447 return false;
1450 if (DEBUGLEVEL >= 10) {
1451 NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, r);
1454 ZERO_STRUCT(r->out);
1455 r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet *);
1456 if (r->out.privs == NULL) {
1457 talloc_free(r);
1458 return false;
1461 r->out.result = _lsa_EnumPrivsAccount(p, r);
1463 if (p->rng_fault_state) {
1464 talloc_free(r);
1465 /* Return true here, srv_pipe_hnd.c will take care */
1466 return true;
1469 if (DEBUGLEVEL >= 10) {
1470 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, r);
1473 push = ndr_push_init_ctx(r, NULL);
1474 if (push == NULL) {
1475 talloc_free(r);
1476 return false;
1479 ndr_err = call->ndr_push(push, NDR_OUT, r);
1480 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1481 talloc_free(r);
1482 return false;
1485 blob = ndr_push_blob(push);
1486 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1487 talloc_free(r);
1488 return false;
1491 talloc_free(r);
1493 return true;
1496 static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p)
1498 const struct ndr_interface_call *call;
1499 struct ndr_pull *pull;
1500 struct ndr_push *push;
1501 enum ndr_err_code ndr_err;
1502 DATA_BLOB blob;
1503 struct lsa_AddPrivilegesToAccount *r;
1505 call = &ndr_table_lsarpc.calls[NDR_LSA_ADDPRIVILEGESTOACCOUNT];
1507 r = talloc(talloc_tos(), struct lsa_AddPrivilegesToAccount);
1508 if (r == NULL) {
1509 return false;
1512 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1513 talloc_free(r);
1514 return false;
1517 pull = ndr_pull_init_blob(&blob, r, NULL);
1518 if (pull == NULL) {
1519 talloc_free(r);
1520 return false;
1523 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1524 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1525 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1526 talloc_free(r);
1527 return false;
1530 if (DEBUGLEVEL >= 10) {
1531 NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, r);
1534 r->out.result = _lsa_AddPrivilegesToAccount(p, r);
1536 if (p->rng_fault_state) {
1537 talloc_free(r);
1538 /* Return true here, srv_pipe_hnd.c will take care */
1539 return true;
1542 if (DEBUGLEVEL >= 10) {
1543 NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, r);
1546 push = ndr_push_init_ctx(r, NULL);
1547 if (push == NULL) {
1548 talloc_free(r);
1549 return false;
1552 ndr_err = call->ndr_push(push, NDR_OUT, r);
1553 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1554 talloc_free(r);
1555 return false;
1558 blob = ndr_push_blob(push);
1559 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1560 talloc_free(r);
1561 return false;
1564 talloc_free(r);
1566 return true;
1569 static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p)
1571 const struct ndr_interface_call *call;
1572 struct ndr_pull *pull;
1573 struct ndr_push *push;
1574 enum ndr_err_code ndr_err;
1575 DATA_BLOB blob;
1576 struct lsa_RemovePrivilegesFromAccount *r;
1578 call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT];
1580 r = talloc(talloc_tos(), struct lsa_RemovePrivilegesFromAccount);
1581 if (r == NULL) {
1582 return false;
1585 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1586 talloc_free(r);
1587 return false;
1590 pull = ndr_pull_init_blob(&blob, r, NULL);
1591 if (pull == NULL) {
1592 talloc_free(r);
1593 return false;
1596 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1597 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1598 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1599 talloc_free(r);
1600 return false;
1603 if (DEBUGLEVEL >= 10) {
1604 NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, r);
1607 r->out.result = _lsa_RemovePrivilegesFromAccount(p, r);
1609 if (p->rng_fault_state) {
1610 talloc_free(r);
1611 /* Return true here, srv_pipe_hnd.c will take care */
1612 return true;
1615 if (DEBUGLEVEL >= 10) {
1616 NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, r);
1619 push = ndr_push_init_ctx(r, NULL);
1620 if (push == NULL) {
1621 talloc_free(r);
1622 return false;
1625 ndr_err = call->ndr_push(push, NDR_OUT, r);
1626 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1627 talloc_free(r);
1628 return false;
1631 blob = ndr_push_blob(push);
1632 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1633 talloc_free(r);
1634 return false;
1637 talloc_free(r);
1639 return true;
1642 static bool api_lsa_GetQuotasForAccount(pipes_struct *p)
1644 const struct ndr_interface_call *call;
1645 struct ndr_pull *pull;
1646 struct ndr_push *push;
1647 enum ndr_err_code ndr_err;
1648 DATA_BLOB blob;
1649 struct lsa_GetQuotasForAccount *r;
1651 call = &ndr_table_lsarpc.calls[NDR_LSA_GETQUOTASFORACCOUNT];
1653 r = talloc(talloc_tos(), struct lsa_GetQuotasForAccount);
1654 if (r == NULL) {
1655 return false;
1658 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1659 talloc_free(r);
1660 return false;
1663 pull = ndr_pull_init_blob(&blob, r, NULL);
1664 if (pull == NULL) {
1665 talloc_free(r);
1666 return false;
1669 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1670 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1671 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1672 talloc_free(r);
1673 return false;
1676 if (DEBUGLEVEL >= 10) {
1677 NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, r);
1680 r->out.result = _lsa_GetQuotasForAccount(p, r);
1682 if (p->rng_fault_state) {
1683 talloc_free(r);
1684 /* Return true here, srv_pipe_hnd.c will take care */
1685 return true;
1688 if (DEBUGLEVEL >= 10) {
1689 NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, r);
1692 push = ndr_push_init_ctx(r, NULL);
1693 if (push == NULL) {
1694 talloc_free(r);
1695 return false;
1698 ndr_err = call->ndr_push(push, NDR_OUT, r);
1699 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1700 talloc_free(r);
1701 return false;
1704 blob = ndr_push_blob(push);
1705 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1706 talloc_free(r);
1707 return false;
1710 talloc_free(r);
1712 return true;
1715 static bool api_lsa_SetQuotasForAccount(pipes_struct *p)
1717 const struct ndr_interface_call *call;
1718 struct ndr_pull *pull;
1719 struct ndr_push *push;
1720 enum ndr_err_code ndr_err;
1721 DATA_BLOB blob;
1722 struct lsa_SetQuotasForAccount *r;
1724 call = &ndr_table_lsarpc.calls[NDR_LSA_SETQUOTASFORACCOUNT];
1726 r = talloc(talloc_tos(), struct lsa_SetQuotasForAccount);
1727 if (r == NULL) {
1728 return false;
1731 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1732 talloc_free(r);
1733 return false;
1736 pull = ndr_pull_init_blob(&blob, r, NULL);
1737 if (pull == NULL) {
1738 talloc_free(r);
1739 return false;
1742 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1743 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1744 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1745 talloc_free(r);
1746 return false;
1749 if (DEBUGLEVEL >= 10) {
1750 NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, r);
1753 r->out.result = _lsa_SetQuotasForAccount(p, r);
1755 if (p->rng_fault_state) {
1756 talloc_free(r);
1757 /* Return true here, srv_pipe_hnd.c will take care */
1758 return true;
1761 if (DEBUGLEVEL >= 10) {
1762 NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, r);
1765 push = ndr_push_init_ctx(r, NULL);
1766 if (push == NULL) {
1767 talloc_free(r);
1768 return false;
1771 ndr_err = call->ndr_push(push, NDR_OUT, r);
1772 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1773 talloc_free(r);
1774 return false;
1777 blob = ndr_push_blob(push);
1778 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1779 talloc_free(r);
1780 return false;
1783 talloc_free(r);
1785 return true;
1788 static bool api_lsa_GetSystemAccessAccount(pipes_struct *p)
1790 const struct ndr_interface_call *call;
1791 struct ndr_pull *pull;
1792 struct ndr_push *push;
1793 enum ndr_err_code ndr_err;
1794 DATA_BLOB blob;
1795 struct lsa_GetSystemAccessAccount *r;
1797 call = &ndr_table_lsarpc.calls[NDR_LSA_GETSYSTEMACCESSACCOUNT];
1799 r = talloc(talloc_tos(), struct lsa_GetSystemAccessAccount);
1800 if (r == NULL) {
1801 return false;
1804 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1805 talloc_free(r);
1806 return false;
1809 pull = ndr_pull_init_blob(&blob, r, NULL);
1810 if (pull == NULL) {
1811 talloc_free(r);
1812 return false;
1815 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1816 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1817 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1818 talloc_free(r);
1819 return false;
1822 if (DEBUGLEVEL >= 10) {
1823 NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, r);
1826 ZERO_STRUCT(r->out);
1827 r->out.access_mask = talloc_zero(r, uint32_t);
1828 if (r->out.access_mask == NULL) {
1829 talloc_free(r);
1830 return false;
1833 r->out.result = _lsa_GetSystemAccessAccount(p, r);
1835 if (p->rng_fault_state) {
1836 talloc_free(r);
1837 /* Return true here, srv_pipe_hnd.c will take care */
1838 return true;
1841 if (DEBUGLEVEL >= 10) {
1842 NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, r);
1845 push = ndr_push_init_ctx(r, NULL);
1846 if (push == NULL) {
1847 talloc_free(r);
1848 return false;
1851 ndr_err = call->ndr_push(push, NDR_OUT, r);
1852 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1853 talloc_free(r);
1854 return false;
1857 blob = ndr_push_blob(push);
1858 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1859 talloc_free(r);
1860 return false;
1863 talloc_free(r);
1865 return true;
1868 static bool api_lsa_SetSystemAccessAccount(pipes_struct *p)
1870 const struct ndr_interface_call *call;
1871 struct ndr_pull *pull;
1872 struct ndr_push *push;
1873 enum ndr_err_code ndr_err;
1874 DATA_BLOB blob;
1875 struct lsa_SetSystemAccessAccount *r;
1877 call = &ndr_table_lsarpc.calls[NDR_LSA_SETSYSTEMACCESSACCOUNT];
1879 r = talloc(talloc_tos(), struct lsa_SetSystemAccessAccount);
1880 if (r == NULL) {
1881 return false;
1884 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1885 talloc_free(r);
1886 return false;
1889 pull = ndr_pull_init_blob(&blob, r, NULL);
1890 if (pull == NULL) {
1891 talloc_free(r);
1892 return false;
1895 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1896 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1897 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1898 talloc_free(r);
1899 return false;
1902 if (DEBUGLEVEL >= 10) {
1903 NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, r);
1906 r->out.result = _lsa_SetSystemAccessAccount(p, r);
1908 if (p->rng_fault_state) {
1909 talloc_free(r);
1910 /* Return true here, srv_pipe_hnd.c will take care */
1911 return true;
1914 if (DEBUGLEVEL >= 10) {
1915 NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, r);
1918 push = ndr_push_init_ctx(r, NULL);
1919 if (push == NULL) {
1920 talloc_free(r);
1921 return false;
1924 ndr_err = call->ndr_push(push, NDR_OUT, r);
1925 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1926 talloc_free(r);
1927 return false;
1930 blob = ndr_push_blob(push);
1931 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1932 talloc_free(r);
1933 return false;
1936 talloc_free(r);
1938 return true;
1941 static bool api_lsa_OpenTrustedDomain(pipes_struct *p)
1943 const struct ndr_interface_call *call;
1944 struct ndr_pull *pull;
1945 struct ndr_push *push;
1946 enum ndr_err_code ndr_err;
1947 DATA_BLOB blob;
1948 struct lsa_OpenTrustedDomain *r;
1950 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAIN];
1952 r = talloc(talloc_tos(), struct lsa_OpenTrustedDomain);
1953 if (r == NULL) {
1954 return false;
1957 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1958 talloc_free(r);
1959 return false;
1962 pull = ndr_pull_init_blob(&blob, r, NULL);
1963 if (pull == NULL) {
1964 talloc_free(r);
1965 return false;
1968 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1969 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1970 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1971 talloc_free(r);
1972 return false;
1975 if (DEBUGLEVEL >= 10) {
1976 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, r);
1979 ZERO_STRUCT(r->out);
1980 r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
1981 if (r->out.trustdom_handle == NULL) {
1982 talloc_free(r);
1983 return false;
1986 r->out.result = _lsa_OpenTrustedDomain(p, r);
1988 if (p->rng_fault_state) {
1989 talloc_free(r);
1990 /* Return true here, srv_pipe_hnd.c will take care */
1991 return true;
1994 if (DEBUGLEVEL >= 10) {
1995 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, r);
1998 push = ndr_push_init_ctx(r, NULL);
1999 if (push == NULL) {
2000 talloc_free(r);
2001 return false;
2004 ndr_err = call->ndr_push(push, NDR_OUT, r);
2005 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2006 talloc_free(r);
2007 return false;
2010 blob = ndr_push_blob(push);
2011 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2012 talloc_free(r);
2013 return false;
2016 talloc_free(r);
2018 return true;
2021 static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p)
2023 const struct ndr_interface_call *call;
2024 struct ndr_pull *pull;
2025 struct ndr_push *push;
2026 enum ndr_err_code ndr_err;
2027 DATA_BLOB blob;
2028 struct lsa_QueryTrustedDomainInfo *r;
2030 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFO];
2032 r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfo);
2033 if (r == NULL) {
2034 return false;
2037 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2038 talloc_free(r);
2039 return false;
2042 pull = ndr_pull_init_blob(&blob, r, NULL);
2043 if (pull == NULL) {
2044 talloc_free(r);
2045 return false;
2048 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2049 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2050 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2051 talloc_free(r);
2052 return false;
2055 if (DEBUGLEVEL >= 10) {
2056 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, r);
2059 ZERO_STRUCT(r->out);
2060 r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
2061 if (r->out.info == NULL) {
2062 talloc_free(r);
2063 return false;
2066 r->out.result = _lsa_QueryTrustedDomainInfo(p, r);
2068 if (p->rng_fault_state) {
2069 talloc_free(r);
2070 /* Return true here, srv_pipe_hnd.c will take care */
2071 return true;
2074 if (DEBUGLEVEL >= 10) {
2075 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, r);
2078 push = ndr_push_init_ctx(r, NULL);
2079 if (push == NULL) {
2080 talloc_free(r);
2081 return false;
2084 ndr_err = call->ndr_push(push, NDR_OUT, r);
2085 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2086 talloc_free(r);
2087 return false;
2090 blob = ndr_push_blob(push);
2091 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2092 talloc_free(r);
2093 return false;
2096 talloc_free(r);
2098 return true;
2101 static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p)
2103 const struct ndr_interface_call *call;
2104 struct ndr_pull *pull;
2105 struct ndr_push *push;
2106 enum ndr_err_code ndr_err;
2107 DATA_BLOB blob;
2108 struct lsa_SetInformationTrustedDomain *r;
2110 call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN];
2112 r = talloc(talloc_tos(), struct lsa_SetInformationTrustedDomain);
2113 if (r == NULL) {
2114 return false;
2117 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2118 talloc_free(r);
2119 return false;
2122 pull = ndr_pull_init_blob(&blob, r, NULL);
2123 if (pull == NULL) {
2124 talloc_free(r);
2125 return false;
2128 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2129 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2130 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2131 talloc_free(r);
2132 return false;
2135 if (DEBUGLEVEL >= 10) {
2136 NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, r);
2139 r->out.result = _lsa_SetInformationTrustedDomain(p, r);
2141 if (p->rng_fault_state) {
2142 talloc_free(r);
2143 /* Return true here, srv_pipe_hnd.c will take care */
2144 return true;
2147 if (DEBUGLEVEL >= 10) {
2148 NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, r);
2151 push = ndr_push_init_ctx(r, NULL);
2152 if (push == NULL) {
2153 talloc_free(r);
2154 return false;
2157 ndr_err = call->ndr_push(push, NDR_OUT, r);
2158 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2159 talloc_free(r);
2160 return false;
2163 blob = ndr_push_blob(push);
2164 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2165 talloc_free(r);
2166 return false;
2169 talloc_free(r);
2171 return true;
2174 static bool api_lsa_OpenSecret(pipes_struct *p)
2176 const struct ndr_interface_call *call;
2177 struct ndr_pull *pull;
2178 struct ndr_push *push;
2179 enum ndr_err_code ndr_err;
2180 DATA_BLOB blob;
2181 struct lsa_OpenSecret *r;
2183 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENSECRET];
2185 r = talloc(talloc_tos(), struct lsa_OpenSecret);
2186 if (r == NULL) {
2187 return false;
2190 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2191 talloc_free(r);
2192 return false;
2195 pull = ndr_pull_init_blob(&blob, r, NULL);
2196 if (pull == NULL) {
2197 talloc_free(r);
2198 return false;
2201 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2202 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2204 talloc_free(r);
2205 return false;
2208 if (DEBUGLEVEL >= 10) {
2209 NDR_PRINT_IN_DEBUG(lsa_OpenSecret, r);
2212 ZERO_STRUCT(r->out);
2213 r->out.sec_handle = talloc_zero(r, struct policy_handle);
2214 if (r->out.sec_handle == NULL) {
2215 talloc_free(r);
2216 return false;
2219 r->out.result = _lsa_OpenSecret(p, r);
2221 if (p->rng_fault_state) {
2222 talloc_free(r);
2223 /* Return true here, srv_pipe_hnd.c will take care */
2224 return true;
2227 if (DEBUGLEVEL >= 10) {
2228 NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, r);
2231 push = ndr_push_init_ctx(r, NULL);
2232 if (push == NULL) {
2233 talloc_free(r);
2234 return false;
2237 ndr_err = call->ndr_push(push, NDR_OUT, r);
2238 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2239 talloc_free(r);
2240 return false;
2243 blob = ndr_push_blob(push);
2244 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2245 talloc_free(r);
2246 return false;
2249 talloc_free(r);
2251 return true;
2254 static bool api_lsa_SetSecret(pipes_struct *p)
2256 const struct ndr_interface_call *call;
2257 struct ndr_pull *pull;
2258 struct ndr_push *push;
2259 enum ndr_err_code ndr_err;
2260 DATA_BLOB blob;
2261 struct lsa_SetSecret *r;
2263 call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECRET];
2265 r = talloc(talloc_tos(), struct lsa_SetSecret);
2266 if (r == NULL) {
2267 return false;
2270 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2271 talloc_free(r);
2272 return false;
2275 pull = ndr_pull_init_blob(&blob, r, NULL);
2276 if (pull == NULL) {
2277 talloc_free(r);
2278 return false;
2281 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2282 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2284 talloc_free(r);
2285 return false;
2288 if (DEBUGLEVEL >= 10) {
2289 NDR_PRINT_IN_DEBUG(lsa_SetSecret, r);
2292 r->out.result = _lsa_SetSecret(p, r);
2294 if (p->rng_fault_state) {
2295 talloc_free(r);
2296 /* Return true here, srv_pipe_hnd.c will take care */
2297 return true;
2300 if (DEBUGLEVEL >= 10) {
2301 NDR_PRINT_OUT_DEBUG(lsa_SetSecret, r);
2304 push = ndr_push_init_ctx(r, NULL);
2305 if (push == NULL) {
2306 talloc_free(r);
2307 return false;
2310 ndr_err = call->ndr_push(push, NDR_OUT, r);
2311 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2312 talloc_free(r);
2313 return false;
2316 blob = ndr_push_blob(push);
2317 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2318 talloc_free(r);
2319 return false;
2322 talloc_free(r);
2324 return true;
2327 static bool api_lsa_QuerySecret(pipes_struct *p)
2329 const struct ndr_interface_call *call;
2330 struct ndr_pull *pull;
2331 struct ndr_push *push;
2332 enum ndr_err_code ndr_err;
2333 DATA_BLOB blob;
2334 struct lsa_QuerySecret *r;
2336 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECRET];
2338 r = talloc(talloc_tos(), struct lsa_QuerySecret);
2339 if (r == NULL) {
2340 return false;
2343 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2344 talloc_free(r);
2345 return false;
2348 pull = ndr_pull_init_blob(&blob, r, NULL);
2349 if (pull == NULL) {
2350 talloc_free(r);
2351 return false;
2354 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2355 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2356 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2357 talloc_free(r);
2358 return false;
2361 if (DEBUGLEVEL >= 10) {
2362 NDR_PRINT_IN_DEBUG(lsa_QuerySecret, r);
2365 ZERO_STRUCT(r->out);
2366 r->out.new_val = r->in.new_val;
2367 r->out.new_mtime = r->in.new_mtime;
2368 r->out.old_val = r->in.old_val;
2369 r->out.old_mtime = r->in.old_mtime;
2370 r->out.result = _lsa_QuerySecret(p, r);
2372 if (p->rng_fault_state) {
2373 talloc_free(r);
2374 /* Return true here, srv_pipe_hnd.c will take care */
2375 return true;
2378 if (DEBUGLEVEL >= 10) {
2379 NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, r);
2382 push = ndr_push_init_ctx(r, NULL);
2383 if (push == NULL) {
2384 talloc_free(r);
2385 return false;
2388 ndr_err = call->ndr_push(push, NDR_OUT, r);
2389 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2390 talloc_free(r);
2391 return false;
2394 blob = ndr_push_blob(push);
2395 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2396 talloc_free(r);
2397 return false;
2400 talloc_free(r);
2402 return true;
2405 static bool api_lsa_LookupPrivValue(pipes_struct *p)
2407 const struct ndr_interface_call *call;
2408 struct ndr_pull *pull;
2409 struct ndr_push *push;
2410 enum ndr_err_code ndr_err;
2411 DATA_BLOB blob;
2412 struct lsa_LookupPrivValue *r;
2414 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVVALUE];
2416 r = talloc(talloc_tos(), struct lsa_LookupPrivValue);
2417 if (r == NULL) {
2418 return false;
2421 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2422 talloc_free(r);
2423 return false;
2426 pull = ndr_pull_init_blob(&blob, r, NULL);
2427 if (pull == NULL) {
2428 talloc_free(r);
2429 return false;
2432 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2433 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2434 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2435 talloc_free(r);
2436 return false;
2439 if (DEBUGLEVEL >= 10) {
2440 NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, r);
2443 ZERO_STRUCT(r->out);
2444 r->out.luid = talloc_zero(r, struct lsa_LUID);
2445 if (r->out.luid == NULL) {
2446 talloc_free(r);
2447 return false;
2450 r->out.result = _lsa_LookupPrivValue(p, r);
2452 if (p->rng_fault_state) {
2453 talloc_free(r);
2454 /* Return true here, srv_pipe_hnd.c will take care */
2455 return true;
2458 if (DEBUGLEVEL >= 10) {
2459 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, r);
2462 push = ndr_push_init_ctx(r, NULL);
2463 if (push == NULL) {
2464 talloc_free(r);
2465 return false;
2468 ndr_err = call->ndr_push(push, NDR_OUT, r);
2469 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2470 talloc_free(r);
2471 return false;
2474 blob = ndr_push_blob(push);
2475 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2476 talloc_free(r);
2477 return false;
2480 talloc_free(r);
2482 return true;
2485 static bool api_lsa_LookupPrivName(pipes_struct *p)
2487 const struct ndr_interface_call *call;
2488 struct ndr_pull *pull;
2489 struct ndr_push *push;
2490 enum ndr_err_code ndr_err;
2491 DATA_BLOB blob;
2492 struct lsa_LookupPrivName *r;
2494 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVNAME];
2496 r = talloc(talloc_tos(), struct lsa_LookupPrivName);
2497 if (r == NULL) {
2498 return false;
2501 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2502 talloc_free(r);
2503 return false;
2506 pull = ndr_pull_init_blob(&blob, r, NULL);
2507 if (pull == NULL) {
2508 talloc_free(r);
2509 return false;
2512 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2513 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2514 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2515 talloc_free(r);
2516 return false;
2519 if (DEBUGLEVEL >= 10) {
2520 NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, r);
2523 ZERO_STRUCT(r->out);
2524 r->out.name = talloc_zero(r, struct lsa_StringLarge *);
2525 if (r->out.name == NULL) {
2526 talloc_free(r);
2527 return false;
2530 r->out.result = _lsa_LookupPrivName(p, r);
2532 if (p->rng_fault_state) {
2533 talloc_free(r);
2534 /* Return true here, srv_pipe_hnd.c will take care */
2535 return true;
2538 if (DEBUGLEVEL >= 10) {
2539 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, r);
2542 push = ndr_push_init_ctx(r, NULL);
2543 if (push == NULL) {
2544 talloc_free(r);
2545 return false;
2548 ndr_err = call->ndr_push(push, NDR_OUT, r);
2549 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2550 talloc_free(r);
2551 return false;
2554 blob = ndr_push_blob(push);
2555 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2556 talloc_free(r);
2557 return false;
2560 talloc_free(r);
2562 return true;
2565 static bool api_lsa_LookupPrivDisplayName(pipes_struct *p)
2567 const struct ndr_interface_call *call;
2568 struct ndr_pull *pull;
2569 struct ndr_push *push;
2570 enum ndr_err_code ndr_err;
2571 DATA_BLOB blob;
2572 struct lsa_LookupPrivDisplayName *r;
2574 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVDISPLAYNAME];
2576 r = talloc(talloc_tos(), struct lsa_LookupPrivDisplayName);
2577 if (r == NULL) {
2578 return false;
2581 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2582 talloc_free(r);
2583 return false;
2586 pull = ndr_pull_init_blob(&blob, r, NULL);
2587 if (pull == NULL) {
2588 talloc_free(r);
2589 return false;
2592 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2593 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2594 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2595 talloc_free(r);
2596 return false;
2599 if (DEBUGLEVEL >= 10) {
2600 NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, r);
2603 ZERO_STRUCT(r->out);
2604 r->out.disp_name = talloc_zero(r, struct lsa_StringLarge *);
2605 if (r->out.disp_name == NULL) {
2606 talloc_free(r);
2607 return false;
2610 r->out.returned_language_id = talloc_zero(r, uint16_t);
2611 if (r->out.returned_language_id == NULL) {
2612 talloc_free(r);
2613 return false;
2616 r->out.result = _lsa_LookupPrivDisplayName(p, r);
2618 if (p->rng_fault_state) {
2619 talloc_free(r);
2620 /* Return true here, srv_pipe_hnd.c will take care */
2621 return true;
2624 if (DEBUGLEVEL >= 10) {
2625 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, r);
2628 push = ndr_push_init_ctx(r, NULL);
2629 if (push == NULL) {
2630 talloc_free(r);
2631 return false;
2634 ndr_err = call->ndr_push(push, NDR_OUT, r);
2635 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2636 talloc_free(r);
2637 return false;
2640 blob = ndr_push_blob(push);
2641 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2642 talloc_free(r);
2643 return false;
2646 talloc_free(r);
2648 return true;
2651 static bool api_lsa_DeleteObject(pipes_struct *p)
2653 const struct ndr_interface_call *call;
2654 struct ndr_pull *pull;
2655 struct ndr_push *push;
2656 enum ndr_err_code ndr_err;
2657 DATA_BLOB blob;
2658 struct lsa_DeleteObject *r;
2660 call = &ndr_table_lsarpc.calls[NDR_LSA_DELETEOBJECT];
2662 r = talloc(talloc_tos(), struct lsa_DeleteObject);
2663 if (r == NULL) {
2664 return false;
2667 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2668 talloc_free(r);
2669 return false;
2672 pull = ndr_pull_init_blob(&blob, r, NULL);
2673 if (pull == NULL) {
2674 talloc_free(r);
2675 return false;
2678 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2679 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2680 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2681 talloc_free(r);
2682 return false;
2685 if (DEBUGLEVEL >= 10) {
2686 NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r);
2689 ZERO_STRUCT(r->out);
2690 r->out.handle = r->in.handle;
2691 r->out.result = _lsa_DeleteObject(p, r);
2693 if (p->rng_fault_state) {
2694 talloc_free(r);
2695 /* Return true here, srv_pipe_hnd.c will take care */
2696 return true;
2699 if (DEBUGLEVEL >= 10) {
2700 NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, r);
2703 push = ndr_push_init_ctx(r, NULL);
2704 if (push == NULL) {
2705 talloc_free(r);
2706 return false;
2709 ndr_err = call->ndr_push(push, NDR_OUT, r);
2710 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2711 talloc_free(r);
2712 return false;
2715 blob = ndr_push_blob(push);
2716 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2717 talloc_free(r);
2718 return false;
2721 talloc_free(r);
2723 return true;
2726 static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p)
2728 const struct ndr_interface_call *call;
2729 struct ndr_pull *pull;
2730 struct ndr_push *push;
2731 enum ndr_err_code ndr_err;
2732 DATA_BLOB blob;
2733 struct lsa_EnumAccountsWithUserRight *r;
2735 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT];
2737 r = talloc(talloc_tos(), struct lsa_EnumAccountsWithUserRight);
2738 if (r == NULL) {
2739 return false;
2742 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2743 talloc_free(r);
2744 return false;
2747 pull = ndr_pull_init_blob(&blob, r, NULL);
2748 if (pull == NULL) {
2749 talloc_free(r);
2750 return false;
2753 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2754 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2755 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2756 talloc_free(r);
2757 return false;
2760 if (DEBUGLEVEL >= 10) {
2761 NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, r);
2764 ZERO_STRUCT(r->out);
2765 r->out.sids = talloc_zero(r, struct lsa_SidArray);
2766 if (r->out.sids == NULL) {
2767 talloc_free(r);
2768 return false;
2771 r->out.result = _lsa_EnumAccountsWithUserRight(p, r);
2773 if (p->rng_fault_state) {
2774 talloc_free(r);
2775 /* Return true here, srv_pipe_hnd.c will take care */
2776 return true;
2779 if (DEBUGLEVEL >= 10) {
2780 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, r);
2783 push = ndr_push_init_ctx(r, NULL);
2784 if (push == NULL) {
2785 talloc_free(r);
2786 return false;
2789 ndr_err = call->ndr_push(push, NDR_OUT, r);
2790 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2791 talloc_free(r);
2792 return false;
2795 blob = ndr_push_blob(push);
2796 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2797 talloc_free(r);
2798 return false;
2801 talloc_free(r);
2803 return true;
2806 static bool api_lsa_EnumAccountRights(pipes_struct *p)
2808 const struct ndr_interface_call *call;
2809 struct ndr_pull *pull;
2810 struct ndr_push *push;
2811 enum ndr_err_code ndr_err;
2812 DATA_BLOB blob;
2813 struct lsa_EnumAccountRights *r;
2815 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTRIGHTS];
2817 r = talloc(talloc_tos(), struct lsa_EnumAccountRights);
2818 if (r == NULL) {
2819 return false;
2822 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2823 talloc_free(r);
2824 return false;
2827 pull = ndr_pull_init_blob(&blob, r, NULL);
2828 if (pull == NULL) {
2829 talloc_free(r);
2830 return false;
2833 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2834 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2835 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2836 talloc_free(r);
2837 return false;
2840 if (DEBUGLEVEL >= 10) {
2841 NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, r);
2844 ZERO_STRUCT(r->out);
2845 r->out.rights = talloc_zero(r, struct lsa_RightSet);
2846 if (r->out.rights == NULL) {
2847 talloc_free(r);
2848 return false;
2851 r->out.result = _lsa_EnumAccountRights(p, r);
2853 if (p->rng_fault_state) {
2854 talloc_free(r);
2855 /* Return true here, srv_pipe_hnd.c will take care */
2856 return true;
2859 if (DEBUGLEVEL >= 10) {
2860 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, r);
2863 push = ndr_push_init_ctx(r, NULL);
2864 if (push == NULL) {
2865 talloc_free(r);
2866 return false;
2869 ndr_err = call->ndr_push(push, NDR_OUT, r);
2870 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2871 talloc_free(r);
2872 return false;
2875 blob = ndr_push_blob(push);
2876 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2877 talloc_free(r);
2878 return false;
2881 talloc_free(r);
2883 return true;
2886 static bool api_lsa_AddAccountRights(pipes_struct *p)
2888 const struct ndr_interface_call *call;
2889 struct ndr_pull *pull;
2890 struct ndr_push *push;
2891 enum ndr_err_code ndr_err;
2892 DATA_BLOB blob;
2893 struct lsa_AddAccountRights *r;
2895 call = &ndr_table_lsarpc.calls[NDR_LSA_ADDACCOUNTRIGHTS];
2897 r = talloc(talloc_tos(), struct lsa_AddAccountRights);
2898 if (r == NULL) {
2899 return false;
2902 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2903 talloc_free(r);
2904 return false;
2907 pull = ndr_pull_init_blob(&blob, r, NULL);
2908 if (pull == NULL) {
2909 talloc_free(r);
2910 return false;
2913 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2914 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2915 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2916 talloc_free(r);
2917 return false;
2920 if (DEBUGLEVEL >= 10) {
2921 NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, r);
2924 r->out.result = _lsa_AddAccountRights(p, r);
2926 if (p->rng_fault_state) {
2927 talloc_free(r);
2928 /* Return true here, srv_pipe_hnd.c will take care */
2929 return true;
2932 if (DEBUGLEVEL >= 10) {
2933 NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, r);
2936 push = ndr_push_init_ctx(r, NULL);
2937 if (push == NULL) {
2938 talloc_free(r);
2939 return false;
2942 ndr_err = call->ndr_push(push, NDR_OUT, r);
2943 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2944 talloc_free(r);
2945 return false;
2948 blob = ndr_push_blob(push);
2949 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2950 talloc_free(r);
2951 return false;
2954 talloc_free(r);
2956 return true;
2959 static bool api_lsa_RemoveAccountRights(pipes_struct *p)
2961 const struct ndr_interface_call *call;
2962 struct ndr_pull *pull;
2963 struct ndr_push *push;
2964 enum ndr_err_code ndr_err;
2965 DATA_BLOB blob;
2966 struct lsa_RemoveAccountRights *r;
2968 call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEACCOUNTRIGHTS];
2970 r = talloc(talloc_tos(), struct lsa_RemoveAccountRights);
2971 if (r == NULL) {
2972 return false;
2975 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2976 talloc_free(r);
2977 return false;
2980 pull = ndr_pull_init_blob(&blob, r, NULL);
2981 if (pull == NULL) {
2982 talloc_free(r);
2983 return false;
2986 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2987 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2988 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2989 talloc_free(r);
2990 return false;
2993 if (DEBUGLEVEL >= 10) {
2994 NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, r);
2997 r->out.result = _lsa_RemoveAccountRights(p, r);
2999 if (p->rng_fault_state) {
3000 talloc_free(r);
3001 /* Return true here, srv_pipe_hnd.c will take care */
3002 return true;
3005 if (DEBUGLEVEL >= 10) {
3006 NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, r);
3009 push = ndr_push_init_ctx(r, NULL);
3010 if (push == NULL) {
3011 talloc_free(r);
3012 return false;
3015 ndr_err = call->ndr_push(push, NDR_OUT, r);
3016 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3017 talloc_free(r);
3018 return false;
3021 blob = ndr_push_blob(push);
3022 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3023 talloc_free(r);
3024 return false;
3027 talloc_free(r);
3029 return true;
3032 static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p)
3034 const struct ndr_interface_call *call;
3035 struct ndr_pull *pull;
3036 struct ndr_push *push;
3037 enum ndr_err_code ndr_err;
3038 DATA_BLOB blob;
3039 struct lsa_QueryTrustedDomainInfoBySid *r;
3041 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID];
3043 r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoBySid);
3044 if (r == NULL) {
3045 return false;
3048 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3049 talloc_free(r);
3050 return false;
3053 pull = ndr_pull_init_blob(&blob, r, NULL);
3054 if (pull == NULL) {
3055 talloc_free(r);
3056 return false;
3059 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3060 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3061 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3062 talloc_free(r);
3063 return false;
3066 if (DEBUGLEVEL >= 10) {
3067 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, r);
3070 ZERO_STRUCT(r->out);
3071 r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
3072 if (r->out.info == NULL) {
3073 talloc_free(r);
3074 return false;
3077 r->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r);
3079 if (p->rng_fault_state) {
3080 talloc_free(r);
3081 /* Return true here, srv_pipe_hnd.c will take care */
3082 return true;
3085 if (DEBUGLEVEL >= 10) {
3086 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, r);
3089 push = ndr_push_init_ctx(r, NULL);
3090 if (push == NULL) {
3091 talloc_free(r);
3092 return false;
3095 ndr_err = call->ndr_push(push, NDR_OUT, r);
3096 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3097 talloc_free(r);
3098 return false;
3101 blob = ndr_push_blob(push);
3102 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3103 talloc_free(r);
3104 return false;
3107 talloc_free(r);
3109 return true;
3112 static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p)
3114 const struct ndr_interface_call *call;
3115 struct ndr_pull *pull;
3116 struct ndr_push *push;
3117 enum ndr_err_code ndr_err;
3118 DATA_BLOB blob;
3119 struct lsa_SetTrustedDomainInfo *r;
3121 call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFO];
3123 r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfo);
3124 if (r == NULL) {
3125 return false;
3128 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3129 talloc_free(r);
3130 return false;
3133 pull = ndr_pull_init_blob(&blob, r, NULL);
3134 if (pull == NULL) {
3135 talloc_free(r);
3136 return false;
3139 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3140 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3141 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3142 talloc_free(r);
3143 return false;
3146 if (DEBUGLEVEL >= 10) {
3147 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, r);
3150 r->out.result = _lsa_SetTrustedDomainInfo(p, r);
3152 if (p->rng_fault_state) {
3153 talloc_free(r);
3154 /* Return true here, srv_pipe_hnd.c will take care */
3155 return true;
3158 if (DEBUGLEVEL >= 10) {
3159 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, r);
3162 push = ndr_push_init_ctx(r, NULL);
3163 if (push == NULL) {
3164 talloc_free(r);
3165 return false;
3168 ndr_err = call->ndr_push(push, NDR_OUT, r);
3169 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3170 talloc_free(r);
3171 return false;
3174 blob = ndr_push_blob(push);
3175 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3176 talloc_free(r);
3177 return false;
3180 talloc_free(r);
3182 return true;
3185 static bool api_lsa_DeleteTrustedDomain(pipes_struct *p)
3187 const struct ndr_interface_call *call;
3188 struct ndr_pull *pull;
3189 struct ndr_push *push;
3190 enum ndr_err_code ndr_err;
3191 DATA_BLOB blob;
3192 struct lsa_DeleteTrustedDomain *r;
3194 call = &ndr_table_lsarpc.calls[NDR_LSA_DELETETRUSTEDDOMAIN];
3196 r = talloc(talloc_tos(), struct lsa_DeleteTrustedDomain);
3197 if (r == NULL) {
3198 return false;
3201 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3202 talloc_free(r);
3203 return false;
3206 pull = ndr_pull_init_blob(&blob, r, NULL);
3207 if (pull == NULL) {
3208 talloc_free(r);
3209 return false;
3212 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3213 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3214 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3215 talloc_free(r);
3216 return false;
3219 if (DEBUGLEVEL >= 10) {
3220 NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, r);
3223 r->out.result = _lsa_DeleteTrustedDomain(p, r);
3225 if (p->rng_fault_state) {
3226 talloc_free(r);
3227 /* Return true here, srv_pipe_hnd.c will take care */
3228 return true;
3231 if (DEBUGLEVEL >= 10) {
3232 NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, r);
3235 push = ndr_push_init_ctx(r, NULL);
3236 if (push == NULL) {
3237 talloc_free(r);
3238 return false;
3241 ndr_err = call->ndr_push(push, NDR_OUT, r);
3242 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3243 talloc_free(r);
3244 return false;
3247 blob = ndr_push_blob(push);
3248 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3249 talloc_free(r);
3250 return false;
3253 talloc_free(r);
3255 return true;
3258 static bool api_lsa_StorePrivateData(pipes_struct *p)
3260 const struct ndr_interface_call *call;
3261 struct ndr_pull *pull;
3262 struct ndr_push *push;
3263 enum ndr_err_code ndr_err;
3264 DATA_BLOB blob;
3265 struct lsa_StorePrivateData *r;
3267 call = &ndr_table_lsarpc.calls[NDR_LSA_STOREPRIVATEDATA];
3269 r = talloc(talloc_tos(), struct lsa_StorePrivateData);
3270 if (r == NULL) {
3271 return false;
3274 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3275 talloc_free(r);
3276 return false;
3279 pull = ndr_pull_init_blob(&blob, r, NULL);
3280 if (pull == NULL) {
3281 talloc_free(r);
3282 return false;
3285 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3286 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3287 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3288 talloc_free(r);
3289 return false;
3292 if (DEBUGLEVEL >= 10) {
3293 NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, r);
3296 r->out.result = _lsa_StorePrivateData(p, r);
3298 if (p->rng_fault_state) {
3299 talloc_free(r);
3300 /* Return true here, srv_pipe_hnd.c will take care */
3301 return true;
3304 if (DEBUGLEVEL >= 10) {
3305 NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, r);
3308 push = ndr_push_init_ctx(r, NULL);
3309 if (push == NULL) {
3310 talloc_free(r);
3311 return false;
3314 ndr_err = call->ndr_push(push, NDR_OUT, r);
3315 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3316 talloc_free(r);
3317 return false;
3320 blob = ndr_push_blob(push);
3321 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3322 talloc_free(r);
3323 return false;
3326 talloc_free(r);
3328 return true;
3331 static bool api_lsa_RetrievePrivateData(pipes_struct *p)
3333 const struct ndr_interface_call *call;
3334 struct ndr_pull *pull;
3335 struct ndr_push *push;
3336 enum ndr_err_code ndr_err;
3337 DATA_BLOB blob;
3338 struct lsa_RetrievePrivateData *r;
3340 call = &ndr_table_lsarpc.calls[NDR_LSA_RETRIEVEPRIVATEDATA];
3342 r = talloc(talloc_tos(), struct lsa_RetrievePrivateData);
3343 if (r == NULL) {
3344 return false;
3347 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3348 talloc_free(r);
3349 return false;
3352 pull = ndr_pull_init_blob(&blob, r, NULL);
3353 if (pull == NULL) {
3354 talloc_free(r);
3355 return false;
3358 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3359 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3360 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3361 talloc_free(r);
3362 return false;
3365 if (DEBUGLEVEL >= 10) {
3366 NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, r);
3369 ZERO_STRUCT(r->out);
3370 r->out.val = r->in.val;
3371 r->out.result = _lsa_RetrievePrivateData(p, r);
3373 if (p->rng_fault_state) {
3374 talloc_free(r);
3375 /* Return true here, srv_pipe_hnd.c will take care */
3376 return true;
3379 if (DEBUGLEVEL >= 10) {
3380 NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, r);
3383 push = ndr_push_init_ctx(r, NULL);
3384 if (push == NULL) {
3385 talloc_free(r);
3386 return false;
3389 ndr_err = call->ndr_push(push, NDR_OUT, r);
3390 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3391 talloc_free(r);
3392 return false;
3395 blob = ndr_push_blob(push);
3396 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3397 talloc_free(r);
3398 return false;
3401 talloc_free(r);
3403 return true;
3406 static bool api_lsa_OpenPolicy2(pipes_struct *p)
3408 const struct ndr_interface_call *call;
3409 struct ndr_pull *pull;
3410 struct ndr_push *push;
3411 enum ndr_err_code ndr_err;
3412 DATA_BLOB blob;
3413 struct lsa_OpenPolicy2 *r;
3415 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY2];
3417 r = talloc(talloc_tos(), struct lsa_OpenPolicy2);
3418 if (r == NULL) {
3419 return false;
3422 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3423 talloc_free(r);
3424 return false;
3427 pull = ndr_pull_init_blob(&blob, r, NULL);
3428 if (pull == NULL) {
3429 talloc_free(r);
3430 return false;
3433 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3434 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3435 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3436 talloc_free(r);
3437 return false;
3440 if (DEBUGLEVEL >= 10) {
3441 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, r);
3444 ZERO_STRUCT(r->out);
3445 r->out.handle = talloc_zero(r, struct policy_handle);
3446 if (r->out.handle == NULL) {
3447 talloc_free(r);
3448 return false;
3451 r->out.result = _lsa_OpenPolicy2(p, r);
3453 if (p->rng_fault_state) {
3454 talloc_free(r);
3455 /* Return true here, srv_pipe_hnd.c will take care */
3456 return true;
3459 if (DEBUGLEVEL >= 10) {
3460 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, r);
3463 push = ndr_push_init_ctx(r, NULL);
3464 if (push == NULL) {
3465 talloc_free(r);
3466 return false;
3469 ndr_err = call->ndr_push(push, NDR_OUT, r);
3470 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3471 talloc_free(r);
3472 return false;
3475 blob = ndr_push_blob(push);
3476 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3477 talloc_free(r);
3478 return false;
3481 talloc_free(r);
3483 return true;
3486 static bool api_lsa_GetUserName(pipes_struct *p)
3488 const struct ndr_interface_call *call;
3489 struct ndr_pull *pull;
3490 struct ndr_push *push;
3491 enum ndr_err_code ndr_err;
3492 DATA_BLOB blob;
3493 struct lsa_GetUserName *r;
3495 call = &ndr_table_lsarpc.calls[NDR_LSA_GETUSERNAME];
3497 r = talloc(talloc_tos(), struct lsa_GetUserName);
3498 if (r == NULL) {
3499 return false;
3502 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3503 talloc_free(r);
3504 return false;
3507 pull = ndr_pull_init_blob(&blob, r, NULL);
3508 if (pull == NULL) {
3509 talloc_free(r);
3510 return false;
3513 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3514 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3515 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3516 talloc_free(r);
3517 return false;
3520 if (DEBUGLEVEL >= 10) {
3521 NDR_PRINT_IN_DEBUG(lsa_GetUserName, r);
3524 ZERO_STRUCT(r->out);
3525 r->out.account_name = r->in.account_name;
3526 r->out.authority_name = r->in.authority_name;
3527 r->out.result = _lsa_GetUserName(p, r);
3529 if (p->rng_fault_state) {
3530 talloc_free(r);
3531 /* Return true here, srv_pipe_hnd.c will take care */
3532 return true;
3535 if (DEBUGLEVEL >= 10) {
3536 NDR_PRINT_OUT_DEBUG(lsa_GetUserName, r);
3539 push = ndr_push_init_ctx(r, NULL);
3540 if (push == NULL) {
3541 talloc_free(r);
3542 return false;
3545 ndr_err = call->ndr_push(push, NDR_OUT, r);
3546 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3547 talloc_free(r);
3548 return false;
3551 blob = ndr_push_blob(push);
3552 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3553 talloc_free(r);
3554 return false;
3557 talloc_free(r);
3559 return true;
3562 static bool api_lsa_QueryInfoPolicy2(pipes_struct *p)
3564 const struct ndr_interface_call *call;
3565 struct ndr_pull *pull;
3566 struct ndr_push *push;
3567 enum ndr_err_code ndr_err;
3568 DATA_BLOB blob;
3569 struct lsa_QueryInfoPolicy2 *r;
3571 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY2];
3573 r = talloc(talloc_tos(), struct lsa_QueryInfoPolicy2);
3574 if (r == NULL) {
3575 return false;
3578 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3579 talloc_free(r);
3580 return false;
3583 pull = ndr_pull_init_blob(&blob, r, NULL);
3584 if (pull == NULL) {
3585 talloc_free(r);
3586 return false;
3589 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3590 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3591 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3592 talloc_free(r);
3593 return false;
3596 if (DEBUGLEVEL >= 10) {
3597 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, r);
3600 ZERO_STRUCT(r->out);
3601 r->out.info = talloc_zero(r, union lsa_PolicyInformation *);
3602 if (r->out.info == NULL) {
3603 talloc_free(r);
3604 return false;
3607 r->out.result = _lsa_QueryInfoPolicy2(p, r);
3609 if (p->rng_fault_state) {
3610 talloc_free(r);
3611 /* Return true here, srv_pipe_hnd.c will take care */
3612 return true;
3615 if (DEBUGLEVEL >= 10) {
3616 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, r);
3619 push = ndr_push_init_ctx(r, NULL);
3620 if (push == NULL) {
3621 talloc_free(r);
3622 return false;
3625 ndr_err = call->ndr_push(push, NDR_OUT, r);
3626 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3627 talloc_free(r);
3628 return false;
3631 blob = ndr_push_blob(push);
3632 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3633 talloc_free(r);
3634 return false;
3637 talloc_free(r);
3639 return true;
3642 static bool api_lsa_SetInfoPolicy2(pipes_struct *p)
3644 const struct ndr_interface_call *call;
3645 struct ndr_pull *pull;
3646 struct ndr_push *push;
3647 enum ndr_err_code ndr_err;
3648 DATA_BLOB blob;
3649 struct lsa_SetInfoPolicy2 *r;
3651 call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY2];
3653 r = talloc(talloc_tos(), struct lsa_SetInfoPolicy2);
3654 if (r == NULL) {
3655 return false;
3658 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3659 talloc_free(r);
3660 return false;
3663 pull = ndr_pull_init_blob(&blob, r, NULL);
3664 if (pull == NULL) {
3665 talloc_free(r);
3666 return false;
3669 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3670 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3671 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3672 talloc_free(r);
3673 return false;
3676 if (DEBUGLEVEL >= 10) {
3677 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, r);
3680 r->out.result = _lsa_SetInfoPolicy2(p, r);
3682 if (p->rng_fault_state) {
3683 talloc_free(r);
3684 /* Return true here, srv_pipe_hnd.c will take care */
3685 return true;
3688 if (DEBUGLEVEL >= 10) {
3689 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, r);
3692 push = ndr_push_init_ctx(r, NULL);
3693 if (push == NULL) {
3694 talloc_free(r);
3695 return false;
3698 ndr_err = call->ndr_push(push, NDR_OUT, r);
3699 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3700 talloc_free(r);
3701 return false;
3704 blob = ndr_push_blob(push);
3705 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3706 talloc_free(r);
3707 return false;
3710 talloc_free(r);
3712 return true;
3715 static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p)
3717 const struct ndr_interface_call *call;
3718 struct ndr_pull *pull;
3719 struct ndr_push *push;
3720 enum ndr_err_code ndr_err;
3721 DATA_BLOB blob;
3722 struct lsa_QueryTrustedDomainInfoByName *r;
3724 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME];
3726 r = talloc(talloc_tos(), struct lsa_QueryTrustedDomainInfoByName);
3727 if (r == NULL) {
3728 return false;
3731 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3732 talloc_free(r);
3733 return false;
3736 pull = ndr_pull_init_blob(&blob, r, NULL);
3737 if (pull == NULL) {
3738 talloc_free(r);
3739 return false;
3742 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3743 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3744 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3745 talloc_free(r);
3746 return false;
3749 if (DEBUGLEVEL >= 10) {
3750 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, r);
3753 ZERO_STRUCT(r->out);
3754 r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo *);
3755 if (r->out.info == NULL) {
3756 talloc_free(r);
3757 return false;
3760 r->out.result = _lsa_QueryTrustedDomainInfoByName(p, r);
3762 if (p->rng_fault_state) {
3763 talloc_free(r);
3764 /* Return true here, srv_pipe_hnd.c will take care */
3765 return true;
3768 if (DEBUGLEVEL >= 10) {
3769 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, r);
3772 push = ndr_push_init_ctx(r, NULL);
3773 if (push == NULL) {
3774 talloc_free(r);
3775 return false;
3778 ndr_err = call->ndr_push(push, NDR_OUT, r);
3779 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3780 talloc_free(r);
3781 return false;
3784 blob = ndr_push_blob(push);
3785 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3786 talloc_free(r);
3787 return false;
3790 talloc_free(r);
3792 return true;
3795 static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p)
3797 const struct ndr_interface_call *call;
3798 struct ndr_pull *pull;
3799 struct ndr_push *push;
3800 enum ndr_err_code ndr_err;
3801 DATA_BLOB blob;
3802 struct lsa_SetTrustedDomainInfoByName *r;
3804 call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFOBYNAME];
3806 r = talloc(talloc_tos(), struct lsa_SetTrustedDomainInfoByName);
3807 if (r == NULL) {
3808 return false;
3811 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3812 talloc_free(r);
3813 return false;
3816 pull = ndr_pull_init_blob(&blob, r, NULL);
3817 if (pull == NULL) {
3818 talloc_free(r);
3819 return false;
3822 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3823 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3824 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3825 talloc_free(r);
3826 return false;
3829 if (DEBUGLEVEL >= 10) {
3830 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, r);
3833 r->out.result = _lsa_SetTrustedDomainInfoByName(p, r);
3835 if (p->rng_fault_state) {
3836 talloc_free(r);
3837 /* Return true here, srv_pipe_hnd.c will take care */
3838 return true;
3841 if (DEBUGLEVEL >= 10) {
3842 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, r);
3845 push = ndr_push_init_ctx(r, NULL);
3846 if (push == NULL) {
3847 talloc_free(r);
3848 return false;
3851 ndr_err = call->ndr_push(push, NDR_OUT, r);
3852 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3853 talloc_free(r);
3854 return false;
3857 blob = ndr_push_blob(push);
3858 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3859 talloc_free(r);
3860 return false;
3863 talloc_free(r);
3865 return true;
3868 static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p)
3870 const struct ndr_interface_call *call;
3871 struct ndr_pull *pull;
3872 struct ndr_push *push;
3873 enum ndr_err_code ndr_err;
3874 DATA_BLOB blob;
3875 struct lsa_EnumTrustedDomainsEx *r;
3877 call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTEDDOMAINSEX];
3879 r = talloc(talloc_tos(), struct lsa_EnumTrustedDomainsEx);
3880 if (r == NULL) {
3881 return false;
3884 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3885 talloc_free(r);
3886 return false;
3889 pull = ndr_pull_init_blob(&blob, r, NULL);
3890 if (pull == NULL) {
3891 talloc_free(r);
3892 return false;
3895 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3896 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3897 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3898 talloc_free(r);
3899 return false;
3902 if (DEBUGLEVEL >= 10) {
3903 NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, r);
3906 ZERO_STRUCT(r->out);
3907 r->out.resume_handle = r->in.resume_handle;
3908 r->out.domains = talloc_zero(r, struct lsa_DomainListEx);
3909 if (r->out.domains == NULL) {
3910 talloc_free(r);
3911 return false;
3914 r->out.result = _lsa_EnumTrustedDomainsEx(p, r);
3916 if (p->rng_fault_state) {
3917 talloc_free(r);
3918 /* Return true here, srv_pipe_hnd.c will take care */
3919 return true;
3922 if (DEBUGLEVEL >= 10) {
3923 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, r);
3926 push = ndr_push_init_ctx(r, NULL);
3927 if (push == NULL) {
3928 talloc_free(r);
3929 return false;
3932 ndr_err = call->ndr_push(push, NDR_OUT, r);
3933 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3934 talloc_free(r);
3935 return false;
3938 blob = ndr_push_blob(push);
3939 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3940 talloc_free(r);
3941 return false;
3944 talloc_free(r);
3946 return true;
3949 static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p)
3951 const struct ndr_interface_call *call;
3952 struct ndr_pull *pull;
3953 struct ndr_push *push;
3954 enum ndr_err_code ndr_err;
3955 DATA_BLOB blob;
3956 struct lsa_CreateTrustedDomainEx *r;
3958 call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX];
3960 r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx);
3961 if (r == NULL) {
3962 return false;
3965 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3966 talloc_free(r);
3967 return false;
3970 pull = ndr_pull_init_blob(&blob, r, NULL);
3971 if (pull == NULL) {
3972 talloc_free(r);
3973 return false;
3976 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3977 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3978 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3979 talloc_free(r);
3980 return false;
3983 if (DEBUGLEVEL >= 10) {
3984 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, r);
3987 ZERO_STRUCT(r->out);
3988 r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
3989 if (r->out.trustdom_handle == NULL) {
3990 talloc_free(r);
3991 return false;
3994 r->out.result = _lsa_CreateTrustedDomainEx(p, r);
3996 if (p->rng_fault_state) {
3997 talloc_free(r);
3998 /* Return true here, srv_pipe_hnd.c will take care */
3999 return true;
4002 if (DEBUGLEVEL >= 10) {
4003 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, r);
4006 push = ndr_push_init_ctx(r, NULL);
4007 if (push == NULL) {
4008 talloc_free(r);
4009 return false;
4012 ndr_err = call->ndr_push(push, NDR_OUT, r);
4013 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4014 talloc_free(r);
4015 return false;
4018 blob = ndr_push_blob(push);
4019 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4020 talloc_free(r);
4021 return false;
4024 talloc_free(r);
4026 return true;
4029 static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p)
4031 const struct ndr_interface_call *call;
4032 struct ndr_pull *pull;
4033 struct ndr_push *push;
4034 enum ndr_err_code ndr_err;
4035 DATA_BLOB blob;
4036 struct lsa_CloseTrustedDomainEx *r;
4038 call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSETRUSTEDDOMAINEX];
4040 r = talloc(talloc_tos(), struct lsa_CloseTrustedDomainEx);
4041 if (r == NULL) {
4042 return false;
4045 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4046 talloc_free(r);
4047 return false;
4050 pull = ndr_pull_init_blob(&blob, r, NULL);
4051 if (pull == NULL) {
4052 talloc_free(r);
4053 return false;
4056 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4057 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4058 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4059 talloc_free(r);
4060 return false;
4063 if (DEBUGLEVEL >= 10) {
4064 NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, r);
4067 ZERO_STRUCT(r->out);
4068 r->out.handle = r->in.handle;
4069 r->out.result = _lsa_CloseTrustedDomainEx(p, r);
4071 if (p->rng_fault_state) {
4072 talloc_free(r);
4073 /* Return true here, srv_pipe_hnd.c will take care */
4074 return true;
4077 if (DEBUGLEVEL >= 10) {
4078 NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, r);
4081 push = ndr_push_init_ctx(r, NULL);
4082 if (push == NULL) {
4083 talloc_free(r);
4084 return false;
4087 ndr_err = call->ndr_push(push, NDR_OUT, r);
4088 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4089 talloc_free(r);
4090 return false;
4093 blob = ndr_push_blob(push);
4094 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4095 talloc_free(r);
4096 return false;
4099 talloc_free(r);
4101 return true;
4104 static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p)
4106 const struct ndr_interface_call *call;
4107 struct ndr_pull *pull;
4108 struct ndr_push *push;
4109 enum ndr_err_code ndr_err;
4110 DATA_BLOB blob;
4111 struct lsa_QueryDomainInformationPolicy *r;
4113 call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYDOMAININFORMATIONPOLICY];
4115 r = talloc(talloc_tos(), struct lsa_QueryDomainInformationPolicy);
4116 if (r == NULL) {
4117 return false;
4120 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4121 talloc_free(r);
4122 return false;
4125 pull = ndr_pull_init_blob(&blob, r, NULL);
4126 if (pull == NULL) {
4127 talloc_free(r);
4128 return false;
4131 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4132 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4133 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4134 talloc_free(r);
4135 return false;
4138 if (DEBUGLEVEL >= 10) {
4139 NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, r);
4142 ZERO_STRUCT(r->out);
4143 r->out.info = talloc_zero(r, union lsa_DomainInformationPolicy *);
4144 if (r->out.info == NULL) {
4145 talloc_free(r);
4146 return false;
4149 r->out.result = _lsa_QueryDomainInformationPolicy(p, r);
4151 if (p->rng_fault_state) {
4152 talloc_free(r);
4153 /* Return true here, srv_pipe_hnd.c will take care */
4154 return true;
4157 if (DEBUGLEVEL >= 10) {
4158 NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, r);
4161 push = ndr_push_init_ctx(r, NULL);
4162 if (push == NULL) {
4163 talloc_free(r);
4164 return false;
4167 ndr_err = call->ndr_push(push, NDR_OUT, r);
4168 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4169 talloc_free(r);
4170 return false;
4173 blob = ndr_push_blob(push);
4174 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4175 talloc_free(r);
4176 return false;
4179 talloc_free(r);
4181 return true;
4184 static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p)
4186 const struct ndr_interface_call *call;
4187 struct ndr_pull *pull;
4188 struct ndr_push *push;
4189 enum ndr_err_code ndr_err;
4190 DATA_BLOB blob;
4191 struct lsa_SetDomainInformationPolicy *r;
4193 call = &ndr_table_lsarpc.calls[NDR_LSA_SETDOMAININFORMATIONPOLICY];
4195 r = talloc(talloc_tos(), struct lsa_SetDomainInformationPolicy);
4196 if (r == NULL) {
4197 return false;
4200 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4201 talloc_free(r);
4202 return false;
4205 pull = ndr_pull_init_blob(&blob, r, NULL);
4206 if (pull == NULL) {
4207 talloc_free(r);
4208 return false;
4211 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4212 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4213 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4214 talloc_free(r);
4215 return false;
4218 if (DEBUGLEVEL >= 10) {
4219 NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, r);
4222 r->out.result = _lsa_SetDomainInformationPolicy(p, r);
4224 if (p->rng_fault_state) {
4225 talloc_free(r);
4226 /* Return true here, srv_pipe_hnd.c will take care */
4227 return true;
4230 if (DEBUGLEVEL >= 10) {
4231 NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, r);
4234 push = ndr_push_init_ctx(r, NULL);
4235 if (push == NULL) {
4236 talloc_free(r);
4237 return false;
4240 ndr_err = call->ndr_push(push, NDR_OUT, r);
4241 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4242 talloc_free(r);
4243 return false;
4246 blob = ndr_push_blob(push);
4247 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4248 talloc_free(r);
4249 return false;
4252 talloc_free(r);
4254 return true;
4257 static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p)
4259 const struct ndr_interface_call *call;
4260 struct ndr_pull *pull;
4261 struct ndr_push *push;
4262 enum ndr_err_code ndr_err;
4263 DATA_BLOB blob;
4264 struct lsa_OpenTrustedDomainByName *r;
4266 call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAINBYNAME];
4268 r = talloc(talloc_tos(), struct lsa_OpenTrustedDomainByName);
4269 if (r == NULL) {
4270 return false;
4273 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4274 talloc_free(r);
4275 return false;
4278 pull = ndr_pull_init_blob(&blob, r, NULL);
4279 if (pull == NULL) {
4280 talloc_free(r);
4281 return false;
4284 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4285 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4286 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4287 talloc_free(r);
4288 return false;
4291 if (DEBUGLEVEL >= 10) {
4292 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, r);
4295 ZERO_STRUCT(r->out);
4296 r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
4297 if (r->out.trustdom_handle == NULL) {
4298 talloc_free(r);
4299 return false;
4302 r->out.result = _lsa_OpenTrustedDomainByName(p, r);
4304 if (p->rng_fault_state) {
4305 talloc_free(r);
4306 /* Return true here, srv_pipe_hnd.c will take care */
4307 return true;
4310 if (DEBUGLEVEL >= 10) {
4311 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, r);
4314 push = ndr_push_init_ctx(r, NULL);
4315 if (push == NULL) {
4316 talloc_free(r);
4317 return false;
4320 ndr_err = call->ndr_push(push, NDR_OUT, r);
4321 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4322 talloc_free(r);
4323 return false;
4326 blob = ndr_push_blob(push);
4327 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4328 talloc_free(r);
4329 return false;
4332 talloc_free(r);
4334 return true;
4337 static bool api_lsa_TestCall(pipes_struct *p)
4339 const struct ndr_interface_call *call;
4340 struct ndr_pull *pull;
4341 struct ndr_push *push;
4342 enum ndr_err_code ndr_err;
4343 DATA_BLOB blob;
4344 struct lsa_TestCall *r;
4346 call = &ndr_table_lsarpc.calls[NDR_LSA_TESTCALL];
4348 r = talloc(talloc_tos(), struct lsa_TestCall);
4349 if (r == NULL) {
4350 return false;
4353 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4354 talloc_free(r);
4355 return false;
4358 pull = ndr_pull_init_blob(&blob, r, NULL);
4359 if (pull == NULL) {
4360 talloc_free(r);
4361 return false;
4364 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4365 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4366 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4367 talloc_free(r);
4368 return false;
4371 if (DEBUGLEVEL >= 10) {
4372 NDR_PRINT_IN_DEBUG(lsa_TestCall, r);
4375 r->out.result = _lsa_TestCall(p, r);
4377 if (p->rng_fault_state) {
4378 talloc_free(r);
4379 /* Return true here, srv_pipe_hnd.c will take care */
4380 return true;
4383 if (DEBUGLEVEL >= 10) {
4384 NDR_PRINT_OUT_DEBUG(lsa_TestCall, r);
4387 push = ndr_push_init_ctx(r, NULL);
4388 if (push == NULL) {
4389 talloc_free(r);
4390 return false;
4393 ndr_err = call->ndr_push(push, NDR_OUT, r);
4394 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4395 talloc_free(r);
4396 return false;
4399 blob = ndr_push_blob(push);
4400 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4401 talloc_free(r);
4402 return false;
4405 talloc_free(r);
4407 return true;
4410 static bool api_lsa_LookupSids2(pipes_struct *p)
4412 const struct ndr_interface_call *call;
4413 struct ndr_pull *pull;
4414 struct ndr_push *push;
4415 enum ndr_err_code ndr_err;
4416 DATA_BLOB blob;
4417 struct lsa_LookupSids2 *r;
4419 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS2];
4421 r = talloc(talloc_tos(), struct lsa_LookupSids2);
4422 if (r == NULL) {
4423 return false;
4426 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4427 talloc_free(r);
4428 return false;
4431 pull = ndr_pull_init_blob(&blob, r, NULL);
4432 if (pull == NULL) {
4433 talloc_free(r);
4434 return false;
4437 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4438 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4439 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4440 talloc_free(r);
4441 return false;
4444 if (DEBUGLEVEL >= 10) {
4445 NDR_PRINT_IN_DEBUG(lsa_LookupSids2, r);
4448 ZERO_STRUCT(r->out);
4449 r->out.names = r->in.names;
4450 r->out.count = r->in.count;
4451 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
4452 if (r->out.domains == NULL) {
4453 talloc_free(r);
4454 return false;
4457 r->out.result = _lsa_LookupSids2(p, r);
4459 if (p->rng_fault_state) {
4460 talloc_free(r);
4461 /* Return true here, srv_pipe_hnd.c will take care */
4462 return true;
4465 if (DEBUGLEVEL >= 10) {
4466 NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, r);
4469 push = ndr_push_init_ctx(r, NULL);
4470 if (push == NULL) {
4471 talloc_free(r);
4472 return false;
4475 ndr_err = call->ndr_push(push, NDR_OUT, r);
4476 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4477 talloc_free(r);
4478 return false;
4481 blob = ndr_push_blob(push);
4482 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4483 talloc_free(r);
4484 return false;
4487 talloc_free(r);
4489 return true;
4492 static bool api_lsa_LookupNames2(pipes_struct *p)
4494 const struct ndr_interface_call *call;
4495 struct ndr_pull *pull;
4496 struct ndr_push *push;
4497 enum ndr_err_code ndr_err;
4498 DATA_BLOB blob;
4499 struct lsa_LookupNames2 *r;
4501 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES2];
4503 r = talloc(talloc_tos(), struct lsa_LookupNames2);
4504 if (r == NULL) {
4505 return false;
4508 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4509 talloc_free(r);
4510 return false;
4513 pull = ndr_pull_init_blob(&blob, r, NULL);
4514 if (pull == NULL) {
4515 talloc_free(r);
4516 return false;
4519 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4520 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4521 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4522 talloc_free(r);
4523 return false;
4526 if (DEBUGLEVEL >= 10) {
4527 NDR_PRINT_IN_DEBUG(lsa_LookupNames2, r);
4530 ZERO_STRUCT(r->out);
4531 r->out.sids = r->in.sids;
4532 r->out.count = r->in.count;
4533 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
4534 if (r->out.domains == NULL) {
4535 talloc_free(r);
4536 return false;
4539 r->out.result = _lsa_LookupNames2(p, r);
4541 if (p->rng_fault_state) {
4542 talloc_free(r);
4543 /* Return true here, srv_pipe_hnd.c will take care */
4544 return true;
4547 if (DEBUGLEVEL >= 10) {
4548 NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, r);
4551 push = ndr_push_init_ctx(r, NULL);
4552 if (push == NULL) {
4553 talloc_free(r);
4554 return false;
4557 ndr_err = call->ndr_push(push, NDR_OUT, r);
4558 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4559 talloc_free(r);
4560 return false;
4563 blob = ndr_push_blob(push);
4564 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4565 talloc_free(r);
4566 return false;
4569 talloc_free(r);
4571 return true;
4574 static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p)
4576 const struct ndr_interface_call *call;
4577 struct ndr_pull *pull;
4578 struct ndr_push *push;
4579 enum ndr_err_code ndr_err;
4580 DATA_BLOB blob;
4581 struct lsa_CreateTrustedDomainEx2 *r;
4583 call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX2];
4585 r = talloc(talloc_tos(), struct lsa_CreateTrustedDomainEx2);
4586 if (r == NULL) {
4587 return false;
4590 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4591 talloc_free(r);
4592 return false;
4595 pull = ndr_pull_init_blob(&blob, r, NULL);
4596 if (pull == NULL) {
4597 talloc_free(r);
4598 return false;
4601 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4602 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4603 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4604 talloc_free(r);
4605 return false;
4608 if (DEBUGLEVEL >= 10) {
4609 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, r);
4612 ZERO_STRUCT(r->out);
4613 r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
4614 if (r->out.trustdom_handle == NULL) {
4615 talloc_free(r);
4616 return false;
4619 r->out.result = _lsa_CreateTrustedDomainEx2(p, r);
4621 if (p->rng_fault_state) {
4622 talloc_free(r);
4623 /* Return true here, srv_pipe_hnd.c will take care */
4624 return true;
4627 if (DEBUGLEVEL >= 10) {
4628 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, r);
4631 push = ndr_push_init_ctx(r, NULL);
4632 if (push == NULL) {
4633 talloc_free(r);
4634 return false;
4637 ndr_err = call->ndr_push(push, NDR_OUT, r);
4638 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4639 talloc_free(r);
4640 return false;
4643 blob = ndr_push_blob(push);
4644 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4645 talloc_free(r);
4646 return false;
4649 talloc_free(r);
4651 return true;
4654 static bool api_lsa_CREDRWRITE(pipes_struct *p)
4656 const struct ndr_interface_call *call;
4657 struct ndr_pull *pull;
4658 struct ndr_push *push;
4659 enum ndr_err_code ndr_err;
4660 DATA_BLOB blob;
4661 struct lsa_CREDRWRITE *r;
4663 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITE];
4665 r = talloc(talloc_tos(), struct lsa_CREDRWRITE);
4666 if (r == NULL) {
4667 return false;
4670 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4671 talloc_free(r);
4672 return false;
4675 pull = ndr_pull_init_blob(&blob, r, NULL);
4676 if (pull == NULL) {
4677 talloc_free(r);
4678 return false;
4681 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4682 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4683 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4684 talloc_free(r);
4685 return false;
4688 if (DEBUGLEVEL >= 10) {
4689 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, r);
4692 r->out.result = _lsa_CREDRWRITE(p, r);
4694 if (p->rng_fault_state) {
4695 talloc_free(r);
4696 /* Return true here, srv_pipe_hnd.c will take care */
4697 return true;
4700 if (DEBUGLEVEL >= 10) {
4701 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, r);
4704 push = ndr_push_init_ctx(r, NULL);
4705 if (push == NULL) {
4706 talloc_free(r);
4707 return false;
4710 ndr_err = call->ndr_push(push, NDR_OUT, r);
4711 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4712 talloc_free(r);
4713 return false;
4716 blob = ndr_push_blob(push);
4717 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4718 talloc_free(r);
4719 return false;
4722 talloc_free(r);
4724 return true;
4727 static bool api_lsa_CREDRREAD(pipes_struct *p)
4729 const struct ndr_interface_call *call;
4730 struct ndr_pull *pull;
4731 struct ndr_push *push;
4732 enum ndr_err_code ndr_err;
4733 DATA_BLOB blob;
4734 struct lsa_CREDRREAD *r;
4736 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREAD];
4738 r = talloc(talloc_tos(), struct lsa_CREDRREAD);
4739 if (r == NULL) {
4740 return false;
4743 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4744 talloc_free(r);
4745 return false;
4748 pull = ndr_pull_init_blob(&blob, r, NULL);
4749 if (pull == NULL) {
4750 talloc_free(r);
4751 return false;
4754 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4755 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4756 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4757 talloc_free(r);
4758 return false;
4761 if (DEBUGLEVEL >= 10) {
4762 NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, r);
4765 r->out.result = _lsa_CREDRREAD(p, r);
4767 if (p->rng_fault_state) {
4768 talloc_free(r);
4769 /* Return true here, srv_pipe_hnd.c will take care */
4770 return true;
4773 if (DEBUGLEVEL >= 10) {
4774 NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, r);
4777 push = ndr_push_init_ctx(r, NULL);
4778 if (push == NULL) {
4779 talloc_free(r);
4780 return false;
4783 ndr_err = call->ndr_push(push, NDR_OUT, r);
4784 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4785 talloc_free(r);
4786 return false;
4789 blob = ndr_push_blob(push);
4790 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4791 talloc_free(r);
4792 return false;
4795 talloc_free(r);
4797 return true;
4800 static bool api_lsa_CREDRENUMERATE(pipes_struct *p)
4802 const struct ndr_interface_call *call;
4803 struct ndr_pull *pull;
4804 struct ndr_push *push;
4805 enum ndr_err_code ndr_err;
4806 DATA_BLOB blob;
4807 struct lsa_CREDRENUMERATE *r;
4809 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRENUMERATE];
4811 r = talloc(talloc_tos(), struct lsa_CREDRENUMERATE);
4812 if (r == NULL) {
4813 return false;
4816 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4817 talloc_free(r);
4818 return false;
4821 pull = ndr_pull_init_blob(&blob, r, NULL);
4822 if (pull == NULL) {
4823 talloc_free(r);
4824 return false;
4827 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4828 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4829 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4830 talloc_free(r);
4831 return false;
4834 if (DEBUGLEVEL >= 10) {
4835 NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, r);
4838 r->out.result = _lsa_CREDRENUMERATE(p, r);
4840 if (p->rng_fault_state) {
4841 talloc_free(r);
4842 /* Return true here, srv_pipe_hnd.c will take care */
4843 return true;
4846 if (DEBUGLEVEL >= 10) {
4847 NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, r);
4850 push = ndr_push_init_ctx(r, NULL);
4851 if (push == NULL) {
4852 talloc_free(r);
4853 return false;
4856 ndr_err = call->ndr_push(push, NDR_OUT, r);
4857 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4858 talloc_free(r);
4859 return false;
4862 blob = ndr_push_blob(push);
4863 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4864 talloc_free(r);
4865 return false;
4868 talloc_free(r);
4870 return true;
4873 static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p)
4875 const struct ndr_interface_call *call;
4876 struct ndr_pull *pull;
4877 struct ndr_push *push;
4878 enum ndr_err_code ndr_err;
4879 DATA_BLOB blob;
4880 struct lsa_CREDRWRITEDOMAINCREDENTIALS *r;
4882 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITEDOMAINCREDENTIALS];
4884 r = talloc(talloc_tos(), struct lsa_CREDRWRITEDOMAINCREDENTIALS);
4885 if (r == NULL) {
4886 return false;
4889 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4890 talloc_free(r);
4891 return false;
4894 pull = ndr_pull_init_blob(&blob, r, NULL);
4895 if (pull == NULL) {
4896 talloc_free(r);
4897 return false;
4900 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4901 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4902 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4903 talloc_free(r);
4904 return false;
4907 if (DEBUGLEVEL >= 10) {
4908 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r);
4911 r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r);
4913 if (p->rng_fault_state) {
4914 talloc_free(r);
4915 /* Return true here, srv_pipe_hnd.c will take care */
4916 return true;
4919 if (DEBUGLEVEL >= 10) {
4920 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r);
4923 push = ndr_push_init_ctx(r, NULL);
4924 if (push == NULL) {
4925 talloc_free(r);
4926 return false;
4929 ndr_err = call->ndr_push(push, NDR_OUT, r);
4930 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4931 talloc_free(r);
4932 return false;
4935 blob = ndr_push_blob(push);
4936 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4937 talloc_free(r);
4938 return false;
4941 talloc_free(r);
4943 return true;
4946 static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p)
4948 const struct ndr_interface_call *call;
4949 struct ndr_pull *pull;
4950 struct ndr_push *push;
4951 enum ndr_err_code ndr_err;
4952 DATA_BLOB blob;
4953 struct lsa_CREDRREADDOMAINCREDENTIALS *r;
4955 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREADDOMAINCREDENTIALS];
4957 r = talloc(talloc_tos(), struct lsa_CREDRREADDOMAINCREDENTIALS);
4958 if (r == NULL) {
4959 return false;
4962 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4963 talloc_free(r);
4964 return false;
4967 pull = ndr_pull_init_blob(&blob, r, NULL);
4968 if (pull == NULL) {
4969 talloc_free(r);
4970 return false;
4973 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4974 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4975 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4976 talloc_free(r);
4977 return false;
4980 if (DEBUGLEVEL >= 10) {
4981 NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r);
4984 r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r);
4986 if (p->rng_fault_state) {
4987 talloc_free(r);
4988 /* Return true here, srv_pipe_hnd.c will take care */
4989 return true;
4992 if (DEBUGLEVEL >= 10) {
4993 NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r);
4996 push = ndr_push_init_ctx(r, NULL);
4997 if (push == NULL) {
4998 talloc_free(r);
4999 return false;
5002 ndr_err = call->ndr_push(push, NDR_OUT, r);
5003 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5004 talloc_free(r);
5005 return false;
5008 blob = ndr_push_blob(push);
5009 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5010 talloc_free(r);
5011 return false;
5014 talloc_free(r);
5016 return true;
5019 static bool api_lsa_CREDRDELETE(pipes_struct *p)
5021 const struct ndr_interface_call *call;
5022 struct ndr_pull *pull;
5023 struct ndr_push *push;
5024 enum ndr_err_code ndr_err;
5025 DATA_BLOB blob;
5026 struct lsa_CREDRDELETE *r;
5028 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRDELETE];
5030 r = talloc(talloc_tos(), struct lsa_CREDRDELETE);
5031 if (r == NULL) {
5032 return false;
5035 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5036 talloc_free(r);
5037 return false;
5040 pull = ndr_pull_init_blob(&blob, r, NULL);
5041 if (pull == NULL) {
5042 talloc_free(r);
5043 return false;
5046 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5047 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5048 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5049 talloc_free(r);
5050 return false;
5053 if (DEBUGLEVEL >= 10) {
5054 NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, r);
5057 r->out.result = _lsa_CREDRDELETE(p, r);
5059 if (p->rng_fault_state) {
5060 talloc_free(r);
5061 /* Return true here, srv_pipe_hnd.c will take care */
5062 return true;
5065 if (DEBUGLEVEL >= 10) {
5066 NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, r);
5069 push = ndr_push_init_ctx(r, NULL);
5070 if (push == NULL) {
5071 talloc_free(r);
5072 return false;
5075 ndr_err = call->ndr_push(push, NDR_OUT, r);
5076 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5077 talloc_free(r);
5078 return false;
5081 blob = ndr_push_blob(push);
5082 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5083 talloc_free(r);
5084 return false;
5087 talloc_free(r);
5089 return true;
5092 static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p)
5094 const struct ndr_interface_call *call;
5095 struct ndr_pull *pull;
5096 struct ndr_push *push;
5097 enum ndr_err_code ndr_err;
5098 DATA_BLOB blob;
5099 struct lsa_CREDRGETTARGETINFO *r;
5101 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETTARGETINFO];
5103 r = talloc(talloc_tos(), struct lsa_CREDRGETTARGETINFO);
5104 if (r == NULL) {
5105 return false;
5108 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5109 talloc_free(r);
5110 return false;
5113 pull = ndr_pull_init_blob(&blob, r, NULL);
5114 if (pull == NULL) {
5115 talloc_free(r);
5116 return false;
5119 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5120 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5121 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5122 talloc_free(r);
5123 return false;
5126 if (DEBUGLEVEL >= 10) {
5127 NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, r);
5130 r->out.result = _lsa_CREDRGETTARGETINFO(p, r);
5132 if (p->rng_fault_state) {
5133 talloc_free(r);
5134 /* Return true here, srv_pipe_hnd.c will take care */
5135 return true;
5138 if (DEBUGLEVEL >= 10) {
5139 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, r);
5142 push = ndr_push_init_ctx(r, NULL);
5143 if (push == NULL) {
5144 talloc_free(r);
5145 return false;
5148 ndr_err = call->ndr_push(push, NDR_OUT, r);
5149 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5150 talloc_free(r);
5151 return false;
5154 blob = ndr_push_blob(push);
5155 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5156 talloc_free(r);
5157 return false;
5160 talloc_free(r);
5162 return true;
5165 static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p)
5167 const struct ndr_interface_call *call;
5168 struct ndr_pull *pull;
5169 struct ndr_push *push;
5170 enum ndr_err_code ndr_err;
5171 DATA_BLOB blob;
5172 struct lsa_CREDRPROFILELOADED *r;
5174 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRPROFILELOADED];
5176 r = talloc(talloc_tos(), struct lsa_CREDRPROFILELOADED);
5177 if (r == NULL) {
5178 return false;
5181 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5182 talloc_free(r);
5183 return false;
5186 pull = ndr_pull_init_blob(&blob, r, NULL);
5187 if (pull == NULL) {
5188 talloc_free(r);
5189 return false;
5192 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5193 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5194 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5195 talloc_free(r);
5196 return false;
5199 if (DEBUGLEVEL >= 10) {
5200 NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, r);
5203 r->out.result = _lsa_CREDRPROFILELOADED(p, r);
5205 if (p->rng_fault_state) {
5206 talloc_free(r);
5207 /* Return true here, srv_pipe_hnd.c will take care */
5208 return true;
5211 if (DEBUGLEVEL >= 10) {
5212 NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, r);
5215 push = ndr_push_init_ctx(r, NULL);
5216 if (push == NULL) {
5217 talloc_free(r);
5218 return false;
5221 ndr_err = call->ndr_push(push, NDR_OUT, r);
5222 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5223 talloc_free(r);
5224 return false;
5227 blob = ndr_push_blob(push);
5228 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5229 talloc_free(r);
5230 return false;
5233 talloc_free(r);
5235 return true;
5238 static bool api_lsa_LookupNames3(pipes_struct *p)
5240 const struct ndr_interface_call *call;
5241 struct ndr_pull *pull;
5242 struct ndr_push *push;
5243 enum ndr_err_code ndr_err;
5244 DATA_BLOB blob;
5245 struct lsa_LookupNames3 *r;
5247 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES3];
5249 r = talloc(talloc_tos(), struct lsa_LookupNames3);
5250 if (r == NULL) {
5251 return false;
5254 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5255 talloc_free(r);
5256 return false;
5259 pull = ndr_pull_init_blob(&blob, r, NULL);
5260 if (pull == NULL) {
5261 talloc_free(r);
5262 return false;
5265 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5266 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5267 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5268 talloc_free(r);
5269 return false;
5272 if (DEBUGLEVEL >= 10) {
5273 NDR_PRINT_IN_DEBUG(lsa_LookupNames3, r);
5276 ZERO_STRUCT(r->out);
5277 r->out.sids = r->in.sids;
5278 r->out.count = r->in.count;
5279 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
5280 if (r->out.domains == NULL) {
5281 talloc_free(r);
5282 return false;
5285 r->out.result = _lsa_LookupNames3(p, r);
5287 if (p->rng_fault_state) {
5288 talloc_free(r);
5289 /* Return true here, srv_pipe_hnd.c will take care */
5290 return true;
5293 if (DEBUGLEVEL >= 10) {
5294 NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, r);
5297 push = ndr_push_init_ctx(r, NULL);
5298 if (push == NULL) {
5299 talloc_free(r);
5300 return false;
5303 ndr_err = call->ndr_push(push, NDR_OUT, r);
5304 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5305 talloc_free(r);
5306 return false;
5309 blob = ndr_push_blob(push);
5310 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5311 talloc_free(r);
5312 return false;
5315 talloc_free(r);
5317 return true;
5320 static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p)
5322 const struct ndr_interface_call *call;
5323 struct ndr_pull *pull;
5324 struct ndr_push *push;
5325 enum ndr_err_code ndr_err;
5326 DATA_BLOB blob;
5327 struct lsa_CREDRGETSESSIONTYPES *r;
5329 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETSESSIONTYPES];
5331 r = talloc(talloc_tos(), struct lsa_CREDRGETSESSIONTYPES);
5332 if (r == NULL) {
5333 return false;
5336 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5337 talloc_free(r);
5338 return false;
5341 pull = ndr_pull_init_blob(&blob, r, NULL);
5342 if (pull == NULL) {
5343 talloc_free(r);
5344 return false;
5347 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5348 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5349 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5350 talloc_free(r);
5351 return false;
5354 if (DEBUGLEVEL >= 10) {
5355 NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, r);
5358 r->out.result = _lsa_CREDRGETSESSIONTYPES(p, r);
5360 if (p->rng_fault_state) {
5361 talloc_free(r);
5362 /* Return true here, srv_pipe_hnd.c will take care */
5363 return true;
5366 if (DEBUGLEVEL >= 10) {
5367 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, r);
5370 push = ndr_push_init_ctx(r, NULL);
5371 if (push == NULL) {
5372 talloc_free(r);
5373 return false;
5376 ndr_err = call->ndr_push(push, NDR_OUT, r);
5377 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5378 talloc_free(r);
5379 return false;
5382 blob = ndr_push_blob(push);
5383 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5384 talloc_free(r);
5385 return false;
5388 talloc_free(r);
5390 return true;
5393 static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p)
5395 const struct ndr_interface_call *call;
5396 struct ndr_pull *pull;
5397 struct ndr_push *push;
5398 enum ndr_err_code ndr_err;
5399 DATA_BLOB blob;
5400 struct lsa_LSARREGISTERAUDITEVENT *r;
5402 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARREGISTERAUDITEVENT];
5404 r = talloc(talloc_tos(), struct lsa_LSARREGISTERAUDITEVENT);
5405 if (r == NULL) {
5406 return false;
5409 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5410 talloc_free(r);
5411 return false;
5414 pull = ndr_pull_init_blob(&blob, r, NULL);
5415 if (pull == NULL) {
5416 talloc_free(r);
5417 return false;
5420 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5421 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5422 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5423 talloc_free(r);
5424 return false;
5427 if (DEBUGLEVEL >= 10) {
5428 NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, r);
5431 r->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r);
5433 if (p->rng_fault_state) {
5434 talloc_free(r);
5435 /* Return true here, srv_pipe_hnd.c will take care */
5436 return true;
5439 if (DEBUGLEVEL >= 10) {
5440 NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, r);
5443 push = ndr_push_init_ctx(r, NULL);
5444 if (push == NULL) {
5445 talloc_free(r);
5446 return false;
5449 ndr_err = call->ndr_push(push, NDR_OUT, r);
5450 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5451 talloc_free(r);
5452 return false;
5455 blob = ndr_push_blob(push);
5456 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5457 talloc_free(r);
5458 return false;
5461 talloc_free(r);
5463 return true;
5466 static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p)
5468 const struct ndr_interface_call *call;
5469 struct ndr_pull *pull;
5470 struct ndr_push *push;
5471 enum ndr_err_code ndr_err;
5472 DATA_BLOB blob;
5473 struct lsa_LSARGENAUDITEVENT *r;
5475 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARGENAUDITEVENT];
5477 r = talloc(talloc_tos(), struct lsa_LSARGENAUDITEVENT);
5478 if (r == NULL) {
5479 return false;
5482 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5483 talloc_free(r);
5484 return false;
5487 pull = ndr_pull_init_blob(&blob, r, NULL);
5488 if (pull == NULL) {
5489 talloc_free(r);
5490 return false;
5493 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5494 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5495 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5496 talloc_free(r);
5497 return false;
5500 if (DEBUGLEVEL >= 10) {
5501 NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, r);
5504 r->out.result = _lsa_LSARGENAUDITEVENT(p, r);
5506 if (p->rng_fault_state) {
5507 talloc_free(r);
5508 /* Return true here, srv_pipe_hnd.c will take care */
5509 return true;
5512 if (DEBUGLEVEL >= 10) {
5513 NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, r);
5516 push = ndr_push_init_ctx(r, NULL);
5517 if (push == NULL) {
5518 talloc_free(r);
5519 return false;
5522 ndr_err = call->ndr_push(push, NDR_OUT, r);
5523 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5524 talloc_free(r);
5525 return false;
5528 blob = ndr_push_blob(push);
5529 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5530 talloc_free(r);
5531 return false;
5534 talloc_free(r);
5536 return true;
5539 static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p)
5541 const struct ndr_interface_call *call;
5542 struct ndr_pull *pull;
5543 struct ndr_push *push;
5544 enum ndr_err_code ndr_err;
5545 DATA_BLOB blob;
5546 struct lsa_LSARUNREGISTERAUDITEVENT *r;
5548 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARUNREGISTERAUDITEVENT];
5550 r = talloc(talloc_tos(), struct lsa_LSARUNREGISTERAUDITEVENT);
5551 if (r == NULL) {
5552 return false;
5555 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5556 talloc_free(r);
5557 return false;
5560 pull = ndr_pull_init_blob(&blob, r, NULL);
5561 if (pull == NULL) {
5562 talloc_free(r);
5563 return false;
5566 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5567 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5568 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5569 talloc_free(r);
5570 return false;
5573 if (DEBUGLEVEL >= 10) {
5574 NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r);
5577 r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r);
5579 if (p->rng_fault_state) {
5580 talloc_free(r);
5581 /* Return true here, srv_pipe_hnd.c will take care */
5582 return true;
5585 if (DEBUGLEVEL >= 10) {
5586 NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r);
5589 push = ndr_push_init_ctx(r, NULL);
5590 if (push == NULL) {
5591 talloc_free(r);
5592 return false;
5595 ndr_err = call->ndr_push(push, NDR_OUT, r);
5596 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5597 talloc_free(r);
5598 return false;
5601 blob = ndr_push_blob(push);
5602 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5603 talloc_free(r);
5604 return false;
5607 talloc_free(r);
5609 return true;
5612 static bool api_lsa_lsaRQueryForestTrustInformation(pipes_struct *p)
5614 const struct ndr_interface_call *call;
5615 struct ndr_pull *pull;
5616 struct ndr_push *push;
5617 enum ndr_err_code ndr_err;
5618 DATA_BLOB blob;
5619 struct lsa_lsaRQueryForestTrustInformation *r;
5621 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION];
5623 r = talloc(talloc_tos(), struct lsa_lsaRQueryForestTrustInformation);
5624 if (r == NULL) {
5625 return false;
5628 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5629 talloc_free(r);
5630 return false;
5633 pull = ndr_pull_init_blob(&blob, r, NULL);
5634 if (pull == NULL) {
5635 talloc_free(r);
5636 return false;
5639 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5640 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5641 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5642 talloc_free(r);
5643 return false;
5646 if (DEBUGLEVEL >= 10) {
5647 NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, r);
5650 ZERO_STRUCT(r->out);
5651 r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
5652 if (r->out.forest_trust_info == NULL) {
5653 talloc_free(r);
5654 return false;
5657 r->out.result = _lsa_lsaRQueryForestTrustInformation(p, r);
5659 if (p->rng_fault_state) {
5660 talloc_free(r);
5661 /* Return true here, srv_pipe_hnd.c will take care */
5662 return true;
5665 if (DEBUGLEVEL >= 10) {
5666 NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, r);
5669 push = ndr_push_init_ctx(r, NULL);
5670 if (push == NULL) {
5671 talloc_free(r);
5672 return false;
5675 ndr_err = call->ndr_push(push, NDR_OUT, r);
5676 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5677 talloc_free(r);
5678 return false;
5681 blob = ndr_push_blob(push);
5682 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5683 talloc_free(r);
5684 return false;
5687 talloc_free(r);
5689 return true;
5692 static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p)
5694 const struct ndr_interface_call *call;
5695 struct ndr_pull *pull;
5696 struct ndr_push *push;
5697 enum ndr_err_code ndr_err;
5698 DATA_BLOB blob;
5699 struct lsa_LSARSETFORESTTRUSTINFORMATION *r;
5701 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARSETFORESTTRUSTINFORMATION];
5703 r = talloc(talloc_tos(), struct lsa_LSARSETFORESTTRUSTINFORMATION);
5704 if (r == NULL) {
5705 return false;
5708 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5709 talloc_free(r);
5710 return false;
5713 pull = ndr_pull_init_blob(&blob, r, NULL);
5714 if (pull == NULL) {
5715 talloc_free(r);
5716 return false;
5719 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5720 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5721 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5722 talloc_free(r);
5723 return false;
5726 if (DEBUGLEVEL >= 10) {
5727 NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r);
5730 r->out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p, r);
5732 if (p->rng_fault_state) {
5733 talloc_free(r);
5734 /* Return true here, srv_pipe_hnd.c will take care */
5735 return true;
5738 if (DEBUGLEVEL >= 10) {
5739 NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r);
5742 push = ndr_push_init_ctx(r, NULL);
5743 if (push == NULL) {
5744 talloc_free(r);
5745 return false;
5748 ndr_err = call->ndr_push(push, NDR_OUT, r);
5749 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5750 talloc_free(r);
5751 return false;
5754 blob = ndr_push_blob(push);
5755 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5756 talloc_free(r);
5757 return false;
5760 talloc_free(r);
5762 return true;
5765 static bool api_lsa_CREDRRENAME(pipes_struct *p)
5767 const struct ndr_interface_call *call;
5768 struct ndr_pull *pull;
5769 struct ndr_push *push;
5770 enum ndr_err_code ndr_err;
5771 DATA_BLOB blob;
5772 struct lsa_CREDRRENAME *r;
5774 call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRRENAME];
5776 r = talloc(talloc_tos(), struct lsa_CREDRRENAME);
5777 if (r == NULL) {
5778 return false;
5781 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5782 talloc_free(r);
5783 return false;
5786 pull = ndr_pull_init_blob(&blob, r, NULL);
5787 if (pull == NULL) {
5788 talloc_free(r);
5789 return false;
5792 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5793 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5794 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5795 talloc_free(r);
5796 return false;
5799 if (DEBUGLEVEL >= 10) {
5800 NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, r);
5803 r->out.result = _lsa_CREDRRENAME(p, r);
5805 if (p->rng_fault_state) {
5806 talloc_free(r);
5807 /* Return true here, srv_pipe_hnd.c will take care */
5808 return true;
5811 if (DEBUGLEVEL >= 10) {
5812 NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, r);
5815 push = ndr_push_init_ctx(r, NULL);
5816 if (push == NULL) {
5817 talloc_free(r);
5818 return false;
5821 ndr_err = call->ndr_push(push, NDR_OUT, r);
5822 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5823 talloc_free(r);
5824 return false;
5827 blob = ndr_push_blob(push);
5828 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5829 talloc_free(r);
5830 return false;
5833 talloc_free(r);
5835 return true;
5838 static bool api_lsa_LookupSids3(pipes_struct *p)
5840 const struct ndr_interface_call *call;
5841 struct ndr_pull *pull;
5842 struct ndr_push *push;
5843 enum ndr_err_code ndr_err;
5844 DATA_BLOB blob;
5845 struct lsa_LookupSids3 *r;
5847 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS3];
5849 r = talloc(talloc_tos(), struct lsa_LookupSids3);
5850 if (r == NULL) {
5851 return false;
5854 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5855 talloc_free(r);
5856 return false;
5859 pull = ndr_pull_init_blob(&blob, r, NULL);
5860 if (pull == NULL) {
5861 talloc_free(r);
5862 return false;
5865 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5866 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5867 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5868 talloc_free(r);
5869 return false;
5872 if (DEBUGLEVEL >= 10) {
5873 NDR_PRINT_IN_DEBUG(lsa_LookupSids3, r);
5876 ZERO_STRUCT(r->out);
5877 r->out.names = r->in.names;
5878 r->out.count = r->in.count;
5879 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
5880 if (r->out.domains == NULL) {
5881 talloc_free(r);
5882 return false;
5885 r->out.result = _lsa_LookupSids3(p, r);
5887 if (p->rng_fault_state) {
5888 talloc_free(r);
5889 /* Return true here, srv_pipe_hnd.c will take care */
5890 return true;
5893 if (DEBUGLEVEL >= 10) {
5894 NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, r);
5897 push = ndr_push_init_ctx(r, NULL);
5898 if (push == NULL) {
5899 talloc_free(r);
5900 return false;
5903 ndr_err = call->ndr_push(push, NDR_OUT, r);
5904 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5905 talloc_free(r);
5906 return false;
5909 blob = ndr_push_blob(push);
5910 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5911 talloc_free(r);
5912 return false;
5915 talloc_free(r);
5917 return true;
5920 static bool api_lsa_LookupNames4(pipes_struct *p)
5922 const struct ndr_interface_call *call;
5923 struct ndr_pull *pull;
5924 struct ndr_push *push;
5925 enum ndr_err_code ndr_err;
5926 DATA_BLOB blob;
5927 struct lsa_LookupNames4 *r;
5929 call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES4];
5931 r = talloc(talloc_tos(), struct lsa_LookupNames4);
5932 if (r == NULL) {
5933 return false;
5936 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5937 talloc_free(r);
5938 return false;
5941 pull = ndr_pull_init_blob(&blob, r, NULL);
5942 if (pull == NULL) {
5943 talloc_free(r);
5944 return false;
5947 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5948 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5949 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5950 talloc_free(r);
5951 return false;
5954 if (DEBUGLEVEL >= 10) {
5955 NDR_PRINT_IN_DEBUG(lsa_LookupNames4, r);
5958 ZERO_STRUCT(r->out);
5959 r->out.sids = r->in.sids;
5960 r->out.count = r->in.count;
5961 r->out.domains = talloc_zero(r, struct lsa_RefDomainList *);
5962 if (r->out.domains == NULL) {
5963 talloc_free(r);
5964 return false;
5967 r->out.result = _lsa_LookupNames4(p, r);
5969 if (p->rng_fault_state) {
5970 talloc_free(r);
5971 /* Return true here, srv_pipe_hnd.c will take care */
5972 return true;
5975 if (DEBUGLEVEL >= 10) {
5976 NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, r);
5979 push = ndr_push_init_ctx(r, NULL);
5980 if (push == NULL) {
5981 talloc_free(r);
5982 return false;
5985 ndr_err = call->ndr_push(push, NDR_OUT, r);
5986 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5987 talloc_free(r);
5988 return false;
5991 blob = ndr_push_blob(push);
5992 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5993 talloc_free(r);
5994 return false;
5997 talloc_free(r);
5999 return true;
6002 static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p)
6004 const struct ndr_interface_call *call;
6005 struct ndr_pull *pull;
6006 struct ndr_push *push;
6007 enum ndr_err_code ndr_err;
6008 DATA_BLOB blob;
6009 struct lsa_LSAROPENPOLICYSCE *r;
6011 call = &ndr_table_lsarpc.calls[NDR_LSA_LSAROPENPOLICYSCE];
6013 r = talloc(talloc_tos(), struct lsa_LSAROPENPOLICYSCE);
6014 if (r == NULL) {
6015 return false;
6018 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6019 talloc_free(r);
6020 return false;
6023 pull = ndr_pull_init_blob(&blob, r, NULL);
6024 if (pull == NULL) {
6025 talloc_free(r);
6026 return false;
6029 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6030 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6031 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6032 talloc_free(r);
6033 return false;
6036 if (DEBUGLEVEL >= 10) {
6037 NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, r);
6040 r->out.result = _lsa_LSAROPENPOLICYSCE(p, r);
6042 if (p->rng_fault_state) {
6043 talloc_free(r);
6044 /* Return true here, srv_pipe_hnd.c will take care */
6045 return true;
6048 if (DEBUGLEVEL >= 10) {
6049 NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, r);
6052 push = ndr_push_init_ctx(r, NULL);
6053 if (push == NULL) {
6054 talloc_free(r);
6055 return false;
6058 ndr_err = call->ndr_push(push, NDR_OUT, r);
6059 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6060 talloc_free(r);
6061 return false;
6064 blob = ndr_push_blob(push);
6065 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6066 talloc_free(r);
6067 return false;
6070 talloc_free(r);
6072 return true;
6075 static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
6077 const struct ndr_interface_call *call;
6078 struct ndr_pull *pull;
6079 struct ndr_push *push;
6080 enum ndr_err_code ndr_err;
6081 DATA_BLOB blob;
6082 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r;
6084 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE];
6086 r = talloc(talloc_tos(), struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE);
6087 if (r == NULL) {
6088 return false;
6091 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6092 talloc_free(r);
6093 return false;
6096 pull = ndr_pull_init_blob(&blob, r, NULL);
6097 if (pull == NULL) {
6098 talloc_free(r);
6099 return false;
6102 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6103 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6104 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6105 talloc_free(r);
6106 return false;
6109 if (DEBUGLEVEL >= 10) {
6110 NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r);
6113 r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r);
6115 if (p->rng_fault_state) {
6116 talloc_free(r);
6117 /* Return true here, srv_pipe_hnd.c will take care */
6118 return true;
6121 if (DEBUGLEVEL >= 10) {
6122 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r);
6125 push = ndr_push_init_ctx(r, NULL);
6126 if (push == NULL) {
6127 talloc_free(r);
6128 return false;
6131 ndr_err = call->ndr_push(push, NDR_OUT, r);
6132 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6133 talloc_free(r);
6134 return false;
6137 blob = ndr_push_blob(push);
6138 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6139 talloc_free(r);
6140 return false;
6143 talloc_free(r);
6145 return true;
6148 static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
6150 const struct ndr_interface_call *call;
6151 struct ndr_pull *pull;
6152 struct ndr_push *push;
6153 enum ndr_err_code ndr_err;
6154 DATA_BLOB blob;
6155 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r;
6157 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE];
6159 r = talloc(talloc_tos(), struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE);
6160 if (r == NULL) {
6161 return false;
6164 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6165 talloc_free(r);
6166 return false;
6169 pull = ndr_pull_init_blob(&blob, r, NULL);
6170 if (pull == NULL) {
6171 talloc_free(r);
6172 return false;
6175 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6176 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6177 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6178 talloc_free(r);
6179 return false;
6182 if (DEBUGLEVEL >= 10) {
6183 NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r);
6186 r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r);
6188 if (p->rng_fault_state) {
6189 talloc_free(r);
6190 /* Return true here, srv_pipe_hnd.c will take care */
6191 return true;
6194 if (DEBUGLEVEL >= 10) {
6195 NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r);
6198 push = ndr_push_init_ctx(r, NULL);
6199 if (push == NULL) {
6200 talloc_free(r);
6201 return false;
6204 ndr_err = call->ndr_push(push, NDR_OUT, r);
6205 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6206 talloc_free(r);
6207 return false;
6210 blob = ndr_push_blob(push);
6211 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6212 talloc_free(r);
6213 return false;
6216 talloc_free(r);
6218 return true;
6221 static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p)
6223 const struct ndr_interface_call *call;
6224 struct ndr_pull *pull;
6225 struct ndr_push *push;
6226 enum ndr_err_code ndr_err;
6227 DATA_BLOB blob;
6228 struct lsa_LSARADTREPORTSECURITYEVENT *r;
6230 call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREPORTSECURITYEVENT];
6232 r = talloc(talloc_tos(), struct lsa_LSARADTREPORTSECURITYEVENT);
6233 if (r == NULL) {
6234 return false;
6237 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6238 talloc_free(r);
6239 return false;
6242 pull = ndr_pull_init_blob(&blob, r, NULL);
6243 if (pull == NULL) {
6244 talloc_free(r);
6245 return false;
6248 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6249 ndr_err = call->ndr_pull(pull, NDR_IN, r);
6250 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6251 talloc_free(r);
6252 return false;
6255 if (DEBUGLEVEL >= 10) {
6256 NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r);
6259 r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r);
6261 if (p->rng_fault_state) {
6262 talloc_free(r);
6263 /* Return true here, srv_pipe_hnd.c will take care */
6264 return true;
6267 if (DEBUGLEVEL >= 10) {
6268 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r);
6271 push = ndr_push_init_ctx(r, NULL);
6272 if (push == NULL) {
6273 talloc_free(r);
6274 return false;
6277 ndr_err = call->ndr_push(push, NDR_OUT, r);
6278 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
6279 talloc_free(r);
6280 return false;
6283 blob = ndr_push_blob(push);
6284 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
6285 talloc_free(r);
6286 return false;
6289 talloc_free(r);
6291 return true;
6295 /* Tables */
6296 static struct api_struct api_lsarpc_cmds[] =
6298 {"LSA_CLOSE", NDR_LSA_CLOSE, api_lsa_Close},
6299 {"LSA_DELETE", NDR_LSA_DELETE, api_lsa_Delete},
6300 {"LSA_ENUMPRIVS", NDR_LSA_ENUMPRIVS, api_lsa_EnumPrivs},
6301 {"LSA_QUERYSECURITY", NDR_LSA_QUERYSECURITY, api_lsa_QuerySecurity},
6302 {"LSA_SETSECOBJ", NDR_LSA_SETSECOBJ, api_lsa_SetSecObj},
6303 {"LSA_CHANGEPASSWORD", NDR_LSA_CHANGEPASSWORD, api_lsa_ChangePassword},
6304 {"LSA_OPENPOLICY", NDR_LSA_OPENPOLICY, api_lsa_OpenPolicy},
6305 {"LSA_QUERYINFOPOLICY", NDR_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy},
6306 {"LSA_SETINFOPOLICY", NDR_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy},
6307 {"LSA_CLEARAUDITLOG", NDR_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog},
6308 {"LSA_CREATEACCOUNT", NDR_LSA_CREATEACCOUNT, api_lsa_CreateAccount},
6309 {"LSA_ENUMACCOUNTS", NDR_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts},
6310 {"LSA_CREATETRUSTEDDOMAIN", NDR_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain},
6311 {"LSA_ENUMTRUSTDOM", NDR_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom},
6312 {"LSA_LOOKUPNAMES", NDR_LSA_LOOKUPNAMES, api_lsa_LookupNames},
6313 {"LSA_LOOKUPSIDS", NDR_LSA_LOOKUPSIDS, api_lsa_LookupSids},
6314 {"LSA_CREATESECRET", NDR_LSA_CREATESECRET, api_lsa_CreateSecret},
6315 {"LSA_OPENACCOUNT", NDR_LSA_OPENACCOUNT, api_lsa_OpenAccount},
6316 {"LSA_ENUMPRIVSACCOUNT", NDR_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount},
6317 {"LSA_ADDPRIVILEGESTOACCOUNT", NDR_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount},
6318 {"LSA_REMOVEPRIVILEGESFROMACCOUNT", NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount},
6319 {"LSA_GETQUOTASFORACCOUNT", NDR_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount},
6320 {"LSA_SETQUOTASFORACCOUNT", NDR_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount},
6321 {"LSA_GETSYSTEMACCESSACCOUNT", NDR_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount},
6322 {"LSA_SETSYSTEMACCESSACCOUNT", NDR_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount},
6323 {"LSA_OPENTRUSTEDDOMAIN", NDR_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain},
6324 {"LSA_QUERYTRUSTEDDOMAININFO", NDR_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo},
6325 {"LSA_SETINFORMATIONTRUSTEDDOMAIN", NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain},
6326 {"LSA_OPENSECRET", NDR_LSA_OPENSECRET, api_lsa_OpenSecret},
6327 {"LSA_SETSECRET", NDR_LSA_SETSECRET, api_lsa_SetSecret},
6328 {"LSA_QUERYSECRET", NDR_LSA_QUERYSECRET, api_lsa_QuerySecret},
6329 {"LSA_LOOKUPPRIVVALUE", NDR_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue},
6330 {"LSA_LOOKUPPRIVNAME", NDR_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName},
6331 {"LSA_LOOKUPPRIVDISPLAYNAME", NDR_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName},
6332 {"LSA_DELETEOBJECT", NDR_LSA_DELETEOBJECT, api_lsa_DeleteObject},
6333 {"LSA_ENUMACCOUNTSWITHUSERRIGHT", NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight},
6334 {"LSA_ENUMACCOUNTRIGHTS", NDR_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights},
6335 {"LSA_ADDACCOUNTRIGHTS", NDR_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights},
6336 {"LSA_REMOVEACCOUNTRIGHTS", NDR_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights},
6337 {"LSA_QUERYTRUSTEDDOMAININFOBYSID", NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid},
6338 {"LSA_SETTRUSTEDDOMAININFO", NDR_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo},
6339 {"LSA_DELETETRUSTEDDOMAIN", NDR_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain},
6340 {"LSA_STOREPRIVATEDATA", NDR_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData},
6341 {"LSA_RETRIEVEPRIVATEDATA", NDR_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData},
6342 {"LSA_OPENPOLICY2", NDR_LSA_OPENPOLICY2, api_lsa_OpenPolicy2},
6343 {"LSA_GETUSERNAME", NDR_LSA_GETUSERNAME, api_lsa_GetUserName},
6344 {"LSA_QUERYINFOPOLICY2", NDR_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2},
6345 {"LSA_SETINFOPOLICY2", NDR_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2},
6346 {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName},
6347 {"LSA_SETTRUSTEDDOMAININFOBYNAME", NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName},
6348 {"LSA_ENUMTRUSTEDDOMAINSEX", NDR_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx},
6349 {"LSA_CREATETRUSTEDDOMAINEX", NDR_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx},
6350 {"LSA_CLOSETRUSTEDDOMAINEX", NDR_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx},
6351 {"LSA_QUERYDOMAININFORMATIONPOLICY", NDR_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy},
6352 {"LSA_SETDOMAININFORMATIONPOLICY", NDR_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy},
6353 {"LSA_OPENTRUSTEDDOMAINBYNAME", NDR_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName},
6354 {"LSA_TESTCALL", NDR_LSA_TESTCALL, api_lsa_TestCall},
6355 {"LSA_LOOKUPSIDS2", NDR_LSA_LOOKUPSIDS2, api_lsa_LookupSids2},
6356 {"LSA_LOOKUPNAMES2", NDR_LSA_LOOKUPNAMES2, api_lsa_LookupNames2},
6357 {"LSA_CREATETRUSTEDDOMAINEX2", NDR_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2},
6358 {"LSA_CREDRWRITE", NDR_LSA_CREDRWRITE, api_lsa_CREDRWRITE},
6359 {"LSA_CREDRREAD", NDR_LSA_CREDRREAD, api_lsa_CREDRREAD},
6360 {"LSA_CREDRENUMERATE", NDR_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE},
6361 {"LSA_CREDRWRITEDOMAINCREDENTIALS", NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS},
6362 {"LSA_CREDRREADDOMAINCREDENTIALS", NDR_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS},
6363 {"LSA_CREDRDELETE", NDR_LSA_CREDRDELETE, api_lsa_CREDRDELETE},
6364 {"LSA_CREDRGETTARGETINFO", NDR_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO},
6365 {"LSA_CREDRPROFILELOADED", NDR_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED},
6366 {"LSA_LOOKUPNAMES3", NDR_LSA_LOOKUPNAMES3, api_lsa_LookupNames3},
6367 {"LSA_CREDRGETSESSIONTYPES", NDR_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES},
6368 {"LSA_LSARREGISTERAUDITEVENT", NDR_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT},
6369 {"LSA_LSARGENAUDITEVENT", NDR_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT},
6370 {"LSA_LSARUNREGISTERAUDITEVENT", NDR_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT},
6371 {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_lsaRQueryForestTrustInformation},
6372 {"LSA_LSARSETFORESTTRUSTINFORMATION", NDR_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION},
6373 {"LSA_CREDRRENAME", NDR_LSA_CREDRRENAME, api_lsa_CREDRRENAME},
6374 {"LSA_LOOKUPSIDS3", NDR_LSA_LOOKUPSIDS3, api_lsa_LookupSids3},
6375 {"LSA_LOOKUPNAMES4", NDR_LSA_LOOKUPNAMES4, api_lsa_LookupNames4},
6376 {"LSA_LSAROPENPOLICYSCE", NDR_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE},
6377 {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE},
6378 {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE},
6379 {"LSA_LSARADTREPORTSECURITYEVENT", NDR_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT},
6382 void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns)
6384 *fns = api_lsarpc_cmds;
6385 *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct);
6388 NTSTATUS rpc_lsarpc_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
6390 if (cli->pipes_struct == NULL) {
6391 return NT_STATUS_INVALID_PARAMETER;
6394 switch (opnum)
6396 case NDR_LSA_CLOSE: {
6397 struct lsa_Close *r = (struct lsa_Close *)_r;
6398 ZERO_STRUCT(r->out);
6399 r->out.handle = r->in.handle;
6400 r->out.result = _lsa_Close(cli->pipes_struct, r);
6401 return NT_STATUS_OK;
6404 case NDR_LSA_DELETE: {
6405 struct lsa_Delete *r = (struct lsa_Delete *)_r;
6406 r->out.result = _lsa_Delete(cli->pipes_struct, r);
6407 return NT_STATUS_OK;
6410 case NDR_LSA_ENUMPRIVS: {
6411 struct lsa_EnumPrivs *r = (struct lsa_EnumPrivs *)_r;
6412 ZERO_STRUCT(r->out);
6413 r->out.resume_handle = r->in.resume_handle;
6414 r->out.privs = talloc_zero(mem_ctx, struct lsa_PrivArray);
6415 if (r->out.privs == NULL) {
6416 return NT_STATUS_NO_MEMORY;
6419 r->out.result = _lsa_EnumPrivs(cli->pipes_struct, r);
6420 return NT_STATUS_OK;
6423 case NDR_LSA_QUERYSECURITY: {
6424 struct lsa_QuerySecurity *r = (struct lsa_QuerySecurity *)_r;
6425 ZERO_STRUCT(r->out);
6426 r->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
6427 if (r->out.sdbuf == NULL) {
6428 return NT_STATUS_NO_MEMORY;
6431 r->out.result = _lsa_QuerySecurity(cli->pipes_struct, r);
6432 return NT_STATUS_OK;
6435 case NDR_LSA_SETSECOBJ: {
6436 struct lsa_SetSecObj *r = (struct lsa_SetSecObj *)_r;
6437 r->out.result = _lsa_SetSecObj(cli->pipes_struct, r);
6438 return NT_STATUS_OK;
6441 case NDR_LSA_CHANGEPASSWORD: {
6442 struct lsa_ChangePassword *r = (struct lsa_ChangePassword *)_r;
6443 r->out.result = _lsa_ChangePassword(cli->pipes_struct, r);
6444 return NT_STATUS_OK;
6447 case NDR_LSA_OPENPOLICY: {
6448 struct lsa_OpenPolicy *r = (struct lsa_OpenPolicy *)_r;
6449 ZERO_STRUCT(r->out);
6450 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
6451 if (r->out.handle == NULL) {
6452 return NT_STATUS_NO_MEMORY;
6455 r->out.result = _lsa_OpenPolicy(cli->pipes_struct, r);
6456 return NT_STATUS_OK;
6459 case NDR_LSA_QUERYINFOPOLICY: {
6460 struct lsa_QueryInfoPolicy *r = (struct lsa_QueryInfoPolicy *)_r;
6461 ZERO_STRUCT(r->out);
6462 r->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
6463 if (r->out.info == NULL) {
6464 return NT_STATUS_NO_MEMORY;
6467 r->out.result = _lsa_QueryInfoPolicy(cli->pipes_struct, r);
6468 return NT_STATUS_OK;
6471 case NDR_LSA_SETINFOPOLICY: {
6472 struct lsa_SetInfoPolicy *r = (struct lsa_SetInfoPolicy *)_r;
6473 r->out.result = _lsa_SetInfoPolicy(cli->pipes_struct, r);
6474 return NT_STATUS_OK;
6477 case NDR_LSA_CLEARAUDITLOG: {
6478 struct lsa_ClearAuditLog *r = (struct lsa_ClearAuditLog *)_r;
6479 r->out.result = _lsa_ClearAuditLog(cli->pipes_struct, r);
6480 return NT_STATUS_OK;
6483 case NDR_LSA_CREATEACCOUNT: {
6484 struct lsa_CreateAccount *r = (struct lsa_CreateAccount *)_r;
6485 ZERO_STRUCT(r->out);
6486 r->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
6487 if (r->out.acct_handle == NULL) {
6488 return NT_STATUS_NO_MEMORY;
6491 r->out.result = _lsa_CreateAccount(cli->pipes_struct, r);
6492 return NT_STATUS_OK;
6495 case NDR_LSA_ENUMACCOUNTS: {
6496 struct lsa_EnumAccounts *r = (struct lsa_EnumAccounts *)_r;
6497 ZERO_STRUCT(r->out);
6498 r->out.resume_handle = r->in.resume_handle;
6499 r->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
6500 if (r->out.sids == NULL) {
6501 return NT_STATUS_NO_MEMORY;
6504 r->out.result = _lsa_EnumAccounts(cli->pipes_struct, r);
6505 return NT_STATUS_OK;
6508 case NDR_LSA_CREATETRUSTEDDOMAIN: {
6509 struct lsa_CreateTrustedDomain *r = (struct lsa_CreateTrustedDomain *)_r;
6510 ZERO_STRUCT(r->out);
6511 r->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
6512 if (r->out.trustdom_handle == NULL) {
6513 return NT_STATUS_NO_MEMORY;
6516 r->out.result = _lsa_CreateTrustedDomain(cli->pipes_struct, r);
6517 return NT_STATUS_OK;
6520 case NDR_LSA_ENUMTRUSTDOM: {
6521 struct lsa_EnumTrustDom *r = (struct lsa_EnumTrustDom *)_r;
6522 ZERO_STRUCT(r->out);
6523 r->out.resume_handle = r->in.resume_handle;
6524 r->out.domains = talloc_zero(mem_ctx, struct lsa_DomainList);
6525 if (r->out.domains == NULL) {
6526 return NT_STATUS_NO_MEMORY;
6529 r->out.result = _lsa_EnumTrustDom(cli->pipes_struct, r);
6530 return NT_STATUS_OK;
6533 case NDR_LSA_LOOKUPNAMES: {
6534 struct lsa_LookupNames *r = (struct lsa_LookupNames *)_r;
6535 ZERO_STRUCT(r->out);
6536 r->out.sids = r->in.sids;
6537 r->out.count = r->in.count;
6538 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
6539 if (r->out.domains == NULL) {
6540 return NT_STATUS_NO_MEMORY;
6543 r->out.result = _lsa_LookupNames(cli->pipes_struct, r);
6544 return NT_STATUS_OK;
6547 case NDR_LSA_LOOKUPSIDS: {
6548 struct lsa_LookupSids *r = (struct lsa_LookupSids *)_r;
6549 ZERO_STRUCT(r->out);
6550 r->out.names = r->in.names;
6551 r->out.count = r->in.count;
6552 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
6553 if (r->out.domains == NULL) {
6554 return NT_STATUS_NO_MEMORY;
6557 r->out.result = _lsa_LookupSids(cli->pipes_struct, r);
6558 return NT_STATUS_OK;
6561 case NDR_LSA_CREATESECRET: {
6562 struct lsa_CreateSecret *r = (struct lsa_CreateSecret *)_r;
6563 ZERO_STRUCT(r->out);
6564 r->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
6565 if (r->out.sec_handle == NULL) {
6566 return NT_STATUS_NO_MEMORY;
6569 r->out.result = _lsa_CreateSecret(cli->pipes_struct, r);
6570 return NT_STATUS_OK;
6573 case NDR_LSA_OPENACCOUNT: {
6574 struct lsa_OpenAccount *r = (struct lsa_OpenAccount *)_r;
6575 ZERO_STRUCT(r->out);
6576 r->out.acct_handle = talloc_zero(mem_ctx, struct policy_handle);
6577 if (r->out.acct_handle == NULL) {
6578 return NT_STATUS_NO_MEMORY;
6581 r->out.result = _lsa_OpenAccount(cli->pipes_struct, r);
6582 return NT_STATUS_OK;
6585 case NDR_LSA_ENUMPRIVSACCOUNT: {
6586 struct lsa_EnumPrivsAccount *r = (struct lsa_EnumPrivsAccount *)_r;
6587 ZERO_STRUCT(r->out);
6588 r->out.privs = talloc_zero(mem_ctx, struct lsa_PrivilegeSet *);
6589 if (r->out.privs == NULL) {
6590 return NT_STATUS_NO_MEMORY;
6593 r->out.result = _lsa_EnumPrivsAccount(cli->pipes_struct, r);
6594 return NT_STATUS_OK;
6597 case NDR_LSA_ADDPRIVILEGESTOACCOUNT: {
6598 struct lsa_AddPrivilegesToAccount *r = (struct lsa_AddPrivilegesToAccount *)_r;
6599 r->out.result = _lsa_AddPrivilegesToAccount(cli->pipes_struct, r);
6600 return NT_STATUS_OK;
6603 case NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT: {
6604 struct lsa_RemovePrivilegesFromAccount *r = (struct lsa_RemovePrivilegesFromAccount *)_r;
6605 r->out.result = _lsa_RemovePrivilegesFromAccount(cli->pipes_struct, r);
6606 return NT_STATUS_OK;
6609 case NDR_LSA_GETQUOTASFORACCOUNT: {
6610 struct lsa_GetQuotasForAccount *r = (struct lsa_GetQuotasForAccount *)_r;
6611 r->out.result = _lsa_GetQuotasForAccount(cli->pipes_struct, r);
6612 return NT_STATUS_OK;
6615 case NDR_LSA_SETQUOTASFORACCOUNT: {
6616 struct lsa_SetQuotasForAccount *r = (struct lsa_SetQuotasForAccount *)_r;
6617 r->out.result = _lsa_SetQuotasForAccount(cli->pipes_struct, r);
6618 return NT_STATUS_OK;
6621 case NDR_LSA_GETSYSTEMACCESSACCOUNT: {
6622 struct lsa_GetSystemAccessAccount *r = (struct lsa_GetSystemAccessAccount *)_r;
6623 ZERO_STRUCT(r->out);
6624 r->out.access_mask = talloc_zero(mem_ctx, uint32_t);
6625 if (r->out.access_mask == NULL) {
6626 return NT_STATUS_NO_MEMORY;
6629 r->out.result = _lsa_GetSystemAccessAccount(cli->pipes_struct, r);
6630 return NT_STATUS_OK;
6633 case NDR_LSA_SETSYSTEMACCESSACCOUNT: {
6634 struct lsa_SetSystemAccessAccount *r = (struct lsa_SetSystemAccessAccount *)_r;
6635 r->out.result = _lsa_SetSystemAccessAccount(cli->pipes_struct, r);
6636 return NT_STATUS_OK;
6639 case NDR_LSA_OPENTRUSTEDDOMAIN: {
6640 struct lsa_OpenTrustedDomain *r = (struct lsa_OpenTrustedDomain *)_r;
6641 ZERO_STRUCT(r->out);
6642 r->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
6643 if (r->out.trustdom_handle == NULL) {
6644 return NT_STATUS_NO_MEMORY;
6647 r->out.result = _lsa_OpenTrustedDomain(cli->pipes_struct, r);
6648 return NT_STATUS_OK;
6651 case NDR_LSA_QUERYTRUSTEDDOMAININFO: {
6652 struct lsa_QueryTrustedDomainInfo *r = (struct lsa_QueryTrustedDomainInfo *)_r;
6653 ZERO_STRUCT(r->out);
6654 r->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
6655 if (r->out.info == NULL) {
6656 return NT_STATUS_NO_MEMORY;
6659 r->out.result = _lsa_QueryTrustedDomainInfo(cli->pipes_struct, r);
6660 return NT_STATUS_OK;
6663 case NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN: {
6664 struct lsa_SetInformationTrustedDomain *r = (struct lsa_SetInformationTrustedDomain *)_r;
6665 r->out.result = _lsa_SetInformationTrustedDomain(cli->pipes_struct, r);
6666 return NT_STATUS_OK;
6669 case NDR_LSA_OPENSECRET: {
6670 struct lsa_OpenSecret *r = (struct lsa_OpenSecret *)_r;
6671 ZERO_STRUCT(r->out);
6672 r->out.sec_handle = talloc_zero(mem_ctx, struct policy_handle);
6673 if (r->out.sec_handle == NULL) {
6674 return NT_STATUS_NO_MEMORY;
6677 r->out.result = _lsa_OpenSecret(cli->pipes_struct, r);
6678 return NT_STATUS_OK;
6681 case NDR_LSA_SETSECRET: {
6682 struct lsa_SetSecret *r = (struct lsa_SetSecret *)_r;
6683 r->out.result = _lsa_SetSecret(cli->pipes_struct, r);
6684 return NT_STATUS_OK;
6687 case NDR_LSA_QUERYSECRET: {
6688 struct lsa_QuerySecret *r = (struct lsa_QuerySecret *)_r;
6689 ZERO_STRUCT(r->out);
6690 r->out.new_val = r->in.new_val;
6691 r->out.new_mtime = r->in.new_mtime;
6692 r->out.old_val = r->in.old_val;
6693 r->out.old_mtime = r->in.old_mtime;
6694 r->out.result = _lsa_QuerySecret(cli->pipes_struct, r);
6695 return NT_STATUS_OK;
6698 case NDR_LSA_LOOKUPPRIVVALUE: {
6699 struct lsa_LookupPrivValue *r = (struct lsa_LookupPrivValue *)_r;
6700 ZERO_STRUCT(r->out);
6701 r->out.luid = talloc_zero(mem_ctx, struct lsa_LUID);
6702 if (r->out.luid == NULL) {
6703 return NT_STATUS_NO_MEMORY;
6706 r->out.result = _lsa_LookupPrivValue(cli->pipes_struct, r);
6707 return NT_STATUS_OK;
6710 case NDR_LSA_LOOKUPPRIVNAME: {
6711 struct lsa_LookupPrivName *r = (struct lsa_LookupPrivName *)_r;
6712 ZERO_STRUCT(r->out);
6713 r->out.name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
6714 if (r->out.name == NULL) {
6715 return NT_STATUS_NO_MEMORY;
6718 r->out.result = _lsa_LookupPrivName(cli->pipes_struct, r);
6719 return NT_STATUS_OK;
6722 case NDR_LSA_LOOKUPPRIVDISPLAYNAME: {
6723 struct lsa_LookupPrivDisplayName *r = (struct lsa_LookupPrivDisplayName *)_r;
6724 ZERO_STRUCT(r->out);
6725 r->out.disp_name = talloc_zero(mem_ctx, struct lsa_StringLarge *);
6726 if (r->out.disp_name == NULL) {
6727 return NT_STATUS_NO_MEMORY;
6730 r->out.returned_language_id = talloc_zero(mem_ctx, uint16_t);
6731 if (r->out.returned_language_id == NULL) {
6732 return NT_STATUS_NO_MEMORY;
6735 r->out.result = _lsa_LookupPrivDisplayName(cli->pipes_struct, r);
6736 return NT_STATUS_OK;
6739 case NDR_LSA_DELETEOBJECT: {
6740 struct lsa_DeleteObject *r = (struct lsa_DeleteObject *)_r;
6741 ZERO_STRUCT(r->out);
6742 r->out.handle = r->in.handle;
6743 r->out.result = _lsa_DeleteObject(cli->pipes_struct, r);
6744 return NT_STATUS_OK;
6747 case NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT: {
6748 struct lsa_EnumAccountsWithUserRight *r = (struct lsa_EnumAccountsWithUserRight *)_r;
6749 ZERO_STRUCT(r->out);
6750 r->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
6751 if (r->out.sids == NULL) {
6752 return NT_STATUS_NO_MEMORY;
6755 r->out.result = _lsa_EnumAccountsWithUserRight(cli->pipes_struct, r);
6756 return NT_STATUS_OK;
6759 case NDR_LSA_ENUMACCOUNTRIGHTS: {
6760 struct lsa_EnumAccountRights *r = (struct lsa_EnumAccountRights *)_r;
6761 ZERO_STRUCT(r->out);
6762 r->out.rights = talloc_zero(mem_ctx, struct lsa_RightSet);
6763 if (r->out.rights == NULL) {
6764 return NT_STATUS_NO_MEMORY;
6767 r->out.result = _lsa_EnumAccountRights(cli->pipes_struct, r);
6768 return NT_STATUS_OK;
6771 case NDR_LSA_ADDACCOUNTRIGHTS: {
6772 struct lsa_AddAccountRights *r = (struct lsa_AddAccountRights *)_r;
6773 r->out.result = _lsa_AddAccountRights(cli->pipes_struct, r);
6774 return NT_STATUS_OK;
6777 case NDR_LSA_REMOVEACCOUNTRIGHTS: {
6778 struct lsa_RemoveAccountRights *r = (struct lsa_RemoveAccountRights *)_r;
6779 r->out.result = _lsa_RemoveAccountRights(cli->pipes_struct, r);
6780 return NT_STATUS_OK;
6783 case NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID: {
6784 struct lsa_QueryTrustedDomainInfoBySid *r = (struct lsa_QueryTrustedDomainInfoBySid *)_r;
6785 ZERO_STRUCT(r->out);
6786 r->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
6787 if (r->out.info == NULL) {
6788 return NT_STATUS_NO_MEMORY;
6791 r->out.result = _lsa_QueryTrustedDomainInfoBySid(cli->pipes_struct, r);
6792 return NT_STATUS_OK;
6795 case NDR_LSA_SETTRUSTEDDOMAININFO: {
6796 struct lsa_SetTrustedDomainInfo *r = (struct lsa_SetTrustedDomainInfo *)_r;
6797 r->out.result = _lsa_SetTrustedDomainInfo(cli->pipes_struct, r);
6798 return NT_STATUS_OK;
6801 case NDR_LSA_DELETETRUSTEDDOMAIN: {
6802 struct lsa_DeleteTrustedDomain *r = (struct lsa_DeleteTrustedDomain *)_r;
6803 r->out.result = _lsa_DeleteTrustedDomain(cli->pipes_struct, r);
6804 return NT_STATUS_OK;
6807 case NDR_LSA_STOREPRIVATEDATA: {
6808 struct lsa_StorePrivateData *r = (struct lsa_StorePrivateData *)_r;
6809 r->out.result = _lsa_StorePrivateData(cli->pipes_struct, r);
6810 return NT_STATUS_OK;
6813 case NDR_LSA_RETRIEVEPRIVATEDATA: {
6814 struct lsa_RetrievePrivateData *r = (struct lsa_RetrievePrivateData *)_r;
6815 ZERO_STRUCT(r->out);
6816 r->out.val = r->in.val;
6817 r->out.result = _lsa_RetrievePrivateData(cli->pipes_struct, r);
6818 return NT_STATUS_OK;
6821 case NDR_LSA_OPENPOLICY2: {
6822 struct lsa_OpenPolicy2 *r = (struct lsa_OpenPolicy2 *)_r;
6823 ZERO_STRUCT(r->out);
6824 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
6825 if (r->out.handle == NULL) {
6826 return NT_STATUS_NO_MEMORY;
6829 r->out.result = _lsa_OpenPolicy2(cli->pipes_struct, r);
6830 return NT_STATUS_OK;
6833 case NDR_LSA_GETUSERNAME: {
6834 struct lsa_GetUserName *r = (struct lsa_GetUserName *)_r;
6835 ZERO_STRUCT(r->out);
6836 r->out.account_name = r->in.account_name;
6837 r->out.authority_name = r->in.authority_name;
6838 r->out.result = _lsa_GetUserName(cli->pipes_struct, r);
6839 return NT_STATUS_OK;
6842 case NDR_LSA_QUERYINFOPOLICY2: {
6843 struct lsa_QueryInfoPolicy2 *r = (struct lsa_QueryInfoPolicy2 *)_r;
6844 ZERO_STRUCT(r->out);
6845 r->out.info = talloc_zero(mem_ctx, union lsa_PolicyInformation *);
6846 if (r->out.info == NULL) {
6847 return NT_STATUS_NO_MEMORY;
6850 r->out.result = _lsa_QueryInfoPolicy2(cli->pipes_struct, r);
6851 return NT_STATUS_OK;
6854 case NDR_LSA_SETINFOPOLICY2: {
6855 struct lsa_SetInfoPolicy2 *r = (struct lsa_SetInfoPolicy2 *)_r;
6856 r->out.result = _lsa_SetInfoPolicy2(cli->pipes_struct, r);
6857 return NT_STATUS_OK;
6860 case NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME: {
6861 struct lsa_QueryTrustedDomainInfoByName *r = (struct lsa_QueryTrustedDomainInfoByName *)_r;
6862 ZERO_STRUCT(r->out);
6863 r->out.info = talloc_zero(mem_ctx, union lsa_TrustedDomainInfo *);
6864 if (r->out.info == NULL) {
6865 return NT_STATUS_NO_MEMORY;
6868 r->out.result = _lsa_QueryTrustedDomainInfoByName(cli->pipes_struct, r);
6869 return NT_STATUS_OK;
6872 case NDR_LSA_SETTRUSTEDDOMAININFOBYNAME: {
6873 struct lsa_SetTrustedDomainInfoByName *r = (struct lsa_SetTrustedDomainInfoByName *)_r;
6874 r->out.result = _lsa_SetTrustedDomainInfoByName(cli->pipes_struct, r);
6875 return NT_STATUS_OK;
6878 case NDR_LSA_ENUMTRUSTEDDOMAINSEX: {
6879 struct lsa_EnumTrustedDomainsEx *r = (struct lsa_EnumTrustedDomainsEx *)_r;
6880 ZERO_STRUCT(r->out);
6881 r->out.resume_handle = r->in.resume_handle;
6882 r->out.domains = talloc_zero(mem_ctx, struct lsa_DomainListEx);
6883 if (r->out.domains == NULL) {
6884 return NT_STATUS_NO_MEMORY;
6887 r->out.result = _lsa_EnumTrustedDomainsEx(cli->pipes_struct, r);
6888 return NT_STATUS_OK;
6891 case NDR_LSA_CREATETRUSTEDDOMAINEX: {
6892 struct lsa_CreateTrustedDomainEx *r = (struct lsa_CreateTrustedDomainEx *)_r;
6893 ZERO_STRUCT(r->out);
6894 r->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
6895 if (r->out.trustdom_handle == NULL) {
6896 return NT_STATUS_NO_MEMORY;
6899 r->out.result = _lsa_CreateTrustedDomainEx(cli->pipes_struct, r);
6900 return NT_STATUS_OK;
6903 case NDR_LSA_CLOSETRUSTEDDOMAINEX: {
6904 struct lsa_CloseTrustedDomainEx *r = (struct lsa_CloseTrustedDomainEx *)_r;
6905 ZERO_STRUCT(r->out);
6906 r->out.handle = r->in.handle;
6907 r->out.result = _lsa_CloseTrustedDomainEx(cli->pipes_struct, r);
6908 return NT_STATUS_OK;
6911 case NDR_LSA_QUERYDOMAININFORMATIONPOLICY: {
6912 struct lsa_QueryDomainInformationPolicy *r = (struct lsa_QueryDomainInformationPolicy *)_r;
6913 ZERO_STRUCT(r->out);
6914 r->out.info = talloc_zero(mem_ctx, union lsa_DomainInformationPolicy *);
6915 if (r->out.info == NULL) {
6916 return NT_STATUS_NO_MEMORY;
6919 r->out.result = _lsa_QueryDomainInformationPolicy(cli->pipes_struct, r);
6920 return NT_STATUS_OK;
6923 case NDR_LSA_SETDOMAININFORMATIONPOLICY: {
6924 struct lsa_SetDomainInformationPolicy *r = (struct lsa_SetDomainInformationPolicy *)_r;
6925 r->out.result = _lsa_SetDomainInformationPolicy(cli->pipes_struct, r);
6926 return NT_STATUS_OK;
6929 case NDR_LSA_OPENTRUSTEDDOMAINBYNAME: {
6930 struct lsa_OpenTrustedDomainByName *r = (struct lsa_OpenTrustedDomainByName *)_r;
6931 ZERO_STRUCT(r->out);
6932 r->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
6933 if (r->out.trustdom_handle == NULL) {
6934 return NT_STATUS_NO_MEMORY;
6937 r->out.result = _lsa_OpenTrustedDomainByName(cli->pipes_struct, r);
6938 return NT_STATUS_OK;
6941 case NDR_LSA_TESTCALL: {
6942 struct lsa_TestCall *r = (struct lsa_TestCall *)_r;
6943 r->out.result = _lsa_TestCall(cli->pipes_struct, r);
6944 return NT_STATUS_OK;
6947 case NDR_LSA_LOOKUPSIDS2: {
6948 struct lsa_LookupSids2 *r = (struct lsa_LookupSids2 *)_r;
6949 ZERO_STRUCT(r->out);
6950 r->out.names = r->in.names;
6951 r->out.count = r->in.count;
6952 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
6953 if (r->out.domains == NULL) {
6954 return NT_STATUS_NO_MEMORY;
6957 r->out.result = _lsa_LookupSids2(cli->pipes_struct, r);
6958 return NT_STATUS_OK;
6961 case NDR_LSA_LOOKUPNAMES2: {
6962 struct lsa_LookupNames2 *r = (struct lsa_LookupNames2 *)_r;
6963 ZERO_STRUCT(r->out);
6964 r->out.sids = r->in.sids;
6965 r->out.count = r->in.count;
6966 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
6967 if (r->out.domains == NULL) {
6968 return NT_STATUS_NO_MEMORY;
6971 r->out.result = _lsa_LookupNames2(cli->pipes_struct, r);
6972 return NT_STATUS_OK;
6975 case NDR_LSA_CREATETRUSTEDDOMAINEX2: {
6976 struct lsa_CreateTrustedDomainEx2 *r = (struct lsa_CreateTrustedDomainEx2 *)_r;
6977 ZERO_STRUCT(r->out);
6978 r->out.trustdom_handle = talloc_zero(mem_ctx, struct policy_handle);
6979 if (r->out.trustdom_handle == NULL) {
6980 return NT_STATUS_NO_MEMORY;
6983 r->out.result = _lsa_CreateTrustedDomainEx2(cli->pipes_struct, r);
6984 return NT_STATUS_OK;
6987 case NDR_LSA_CREDRWRITE: {
6988 struct lsa_CREDRWRITE *r = (struct lsa_CREDRWRITE *)_r;
6989 r->out.result = _lsa_CREDRWRITE(cli->pipes_struct, r);
6990 return NT_STATUS_OK;
6993 case NDR_LSA_CREDRREAD: {
6994 struct lsa_CREDRREAD *r = (struct lsa_CREDRREAD *)_r;
6995 r->out.result = _lsa_CREDRREAD(cli->pipes_struct, r);
6996 return NT_STATUS_OK;
6999 case NDR_LSA_CREDRENUMERATE: {
7000 struct lsa_CREDRENUMERATE *r = (struct lsa_CREDRENUMERATE *)_r;
7001 r->out.result = _lsa_CREDRENUMERATE(cli->pipes_struct, r);
7002 return NT_STATUS_OK;
7005 case NDR_LSA_CREDRWRITEDOMAINCREDENTIALS: {
7006 struct lsa_CREDRWRITEDOMAINCREDENTIALS *r = (struct lsa_CREDRWRITEDOMAINCREDENTIALS *)_r;
7007 r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(cli->pipes_struct, r);
7008 return NT_STATUS_OK;
7011 case NDR_LSA_CREDRREADDOMAINCREDENTIALS: {
7012 struct lsa_CREDRREADDOMAINCREDENTIALS *r = (struct lsa_CREDRREADDOMAINCREDENTIALS *)_r;
7013 r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(cli->pipes_struct, r);
7014 return NT_STATUS_OK;
7017 case NDR_LSA_CREDRDELETE: {
7018 struct lsa_CREDRDELETE *r = (struct lsa_CREDRDELETE *)_r;
7019 r->out.result = _lsa_CREDRDELETE(cli->pipes_struct, r);
7020 return NT_STATUS_OK;
7023 case NDR_LSA_CREDRGETTARGETINFO: {
7024 struct lsa_CREDRGETTARGETINFO *r = (struct lsa_CREDRGETTARGETINFO *)_r;
7025 r->out.result = _lsa_CREDRGETTARGETINFO(cli->pipes_struct, r);
7026 return NT_STATUS_OK;
7029 case NDR_LSA_CREDRPROFILELOADED: {
7030 struct lsa_CREDRPROFILELOADED *r = (struct lsa_CREDRPROFILELOADED *)_r;
7031 r->out.result = _lsa_CREDRPROFILELOADED(cli->pipes_struct, r);
7032 return NT_STATUS_OK;
7035 case NDR_LSA_LOOKUPNAMES3: {
7036 struct lsa_LookupNames3 *r = (struct lsa_LookupNames3 *)_r;
7037 ZERO_STRUCT(r->out);
7038 r->out.sids = r->in.sids;
7039 r->out.count = r->in.count;
7040 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
7041 if (r->out.domains == NULL) {
7042 return NT_STATUS_NO_MEMORY;
7045 r->out.result = _lsa_LookupNames3(cli->pipes_struct, r);
7046 return NT_STATUS_OK;
7049 case NDR_LSA_CREDRGETSESSIONTYPES: {
7050 struct lsa_CREDRGETSESSIONTYPES *r = (struct lsa_CREDRGETSESSIONTYPES *)_r;
7051 r->out.result = _lsa_CREDRGETSESSIONTYPES(cli->pipes_struct, r);
7052 return NT_STATUS_OK;
7055 case NDR_LSA_LSARREGISTERAUDITEVENT: {
7056 struct lsa_LSARREGISTERAUDITEVENT *r = (struct lsa_LSARREGISTERAUDITEVENT *)_r;
7057 r->out.result = _lsa_LSARREGISTERAUDITEVENT(cli->pipes_struct, r);
7058 return NT_STATUS_OK;
7061 case NDR_LSA_LSARGENAUDITEVENT: {
7062 struct lsa_LSARGENAUDITEVENT *r = (struct lsa_LSARGENAUDITEVENT *)_r;
7063 r->out.result = _lsa_LSARGENAUDITEVENT(cli->pipes_struct, r);
7064 return NT_STATUS_OK;
7067 case NDR_LSA_LSARUNREGISTERAUDITEVENT: {
7068 struct lsa_LSARUNREGISTERAUDITEVENT *r = (struct lsa_LSARUNREGISTERAUDITEVENT *)_r;
7069 r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(cli->pipes_struct, r);
7070 return NT_STATUS_OK;
7073 case NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION: {
7074 struct lsa_lsaRQueryForestTrustInformation *r = (struct lsa_lsaRQueryForestTrustInformation *)_r;
7075 ZERO_STRUCT(r->out);
7076 r->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
7077 if (r->out.forest_trust_info == NULL) {
7078 return NT_STATUS_NO_MEMORY;
7081 r->out.result = _lsa_lsaRQueryForestTrustInformation(cli->pipes_struct, r);
7082 return NT_STATUS_OK;
7085 case NDR_LSA_LSARSETFORESTTRUSTINFORMATION: {
7086 struct lsa_LSARSETFORESTTRUSTINFORMATION *r = (struct lsa_LSARSETFORESTTRUSTINFORMATION *)_r;
7087 r->out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(cli->pipes_struct, r);
7088 return NT_STATUS_OK;
7091 case NDR_LSA_CREDRRENAME: {
7092 struct lsa_CREDRRENAME *r = (struct lsa_CREDRRENAME *)_r;
7093 r->out.result = _lsa_CREDRRENAME(cli->pipes_struct, r);
7094 return NT_STATUS_OK;
7097 case NDR_LSA_LOOKUPSIDS3: {
7098 struct lsa_LookupSids3 *r = (struct lsa_LookupSids3 *)_r;
7099 ZERO_STRUCT(r->out);
7100 r->out.names = r->in.names;
7101 r->out.count = r->in.count;
7102 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
7103 if (r->out.domains == NULL) {
7104 return NT_STATUS_NO_MEMORY;
7107 r->out.result = _lsa_LookupSids3(cli->pipes_struct, r);
7108 return NT_STATUS_OK;
7111 case NDR_LSA_LOOKUPNAMES4: {
7112 struct lsa_LookupNames4 *r = (struct lsa_LookupNames4 *)_r;
7113 ZERO_STRUCT(r->out);
7114 r->out.sids = r->in.sids;
7115 r->out.count = r->in.count;
7116 r->out.domains = talloc_zero(mem_ctx, struct lsa_RefDomainList *);
7117 if (r->out.domains == NULL) {
7118 return NT_STATUS_NO_MEMORY;
7121 r->out.result = _lsa_LookupNames4(cli->pipes_struct, r);
7122 return NT_STATUS_OK;
7125 case NDR_LSA_LSAROPENPOLICYSCE: {
7126 struct lsa_LSAROPENPOLICYSCE *r = (struct lsa_LSAROPENPOLICYSCE *)_r;
7127 r->out.result = _lsa_LSAROPENPOLICYSCE(cli->pipes_struct, r);
7128 return NT_STATUS_OK;
7131 case NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE: {
7132 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r = (struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *)_r;
7133 r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(cli->pipes_struct, r);
7134 return NT_STATUS_OK;
7137 case NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE: {
7138 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r = (struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *)_r;
7139 r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(cli->pipes_struct, r);
7140 return NT_STATUS_OK;
7143 case NDR_LSA_LSARADTREPORTSECURITYEVENT: {
7144 struct lsa_LSARADTREPORTSECURITYEVENT *r = (struct lsa_LSARADTREPORTSECURITYEVENT *)_r;
7145 r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(cli->pipes_struct, r);
7146 return NT_STATUS_OK;
7149 default:
7150 return NT_STATUS_NOT_IMPLEMENTED;
7154 NTSTATUS rpc_lsarpc_init(void)
7156 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", &ndr_table_lsarpc, api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct));