util_strlist: Add some more "const"s - small correction
[Samba/ekacnet.git] / librpc / gen_ndr / srv_samr.c
blobe1b6951b3cca9c25e8804624f3dc5b7ebc358546
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_samr.h"
9 static bool api_samr_Connect(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 samr_Connect *r;
18 call = &ndr_table_samr.calls[NDR_SAMR_CONNECT];
20 r = talloc(talloc_tos(), struct samr_Connect);
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(samr_Connect, r);
47 ZERO_STRUCT(r->out);
48 r->out.connect_handle = talloc_zero(r, struct policy_handle);
49 if (r->out.connect_handle == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _samr_Connect(p, r);
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(samr_Connect, r);
66 push = ndr_push_init_ctx(r, NULL);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74 talloc_free(r);
75 return false;
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80 talloc_free(r);
81 return false;
84 talloc_free(r);
86 return true;
89 static bool api_samr_Close(pipes_struct *p)
91 const struct ndr_interface_call *call;
92 struct ndr_pull *pull;
93 struct ndr_push *push;
94 enum ndr_err_code ndr_err;
95 DATA_BLOB blob;
96 struct samr_Close *r;
98 call = &ndr_table_samr.calls[NDR_SAMR_CLOSE];
100 r = talloc(talloc_tos(), struct samr_Close);
101 if (r == NULL) {
102 return false;
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
110 pull = ndr_pull_init_blob(&blob, r, NULL);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
116 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117 ndr_err = call->ndr_pull(pull, NDR_IN, r);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119 talloc_free(r);
120 return false;
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(samr_Close, r);
127 ZERO_STRUCT(r->out);
128 r->out.handle = r->in.handle;
129 r->out.result = _samr_Close(p, r);
131 if (p->rng_fault_state) {
132 talloc_free(r);
133 /* Return true here, srv_pipe_hnd.c will take care */
134 return true;
137 if (DEBUGLEVEL >= 10) {
138 NDR_PRINT_OUT_DEBUG(samr_Close, r);
141 push = ndr_push_init_ctx(r, NULL);
142 if (push == NULL) {
143 talloc_free(r);
144 return false;
147 ndr_err = call->ndr_push(push, NDR_OUT, r);
148 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
149 talloc_free(r);
150 return false;
153 blob = ndr_push_blob(push);
154 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
155 talloc_free(r);
156 return false;
159 talloc_free(r);
161 return true;
164 static bool api_samr_SetSecurity(pipes_struct *p)
166 const struct ndr_interface_call *call;
167 struct ndr_pull *pull;
168 struct ndr_push *push;
169 enum ndr_err_code ndr_err;
170 DATA_BLOB blob;
171 struct samr_SetSecurity *r;
173 call = &ndr_table_samr.calls[NDR_SAMR_SETSECURITY];
175 r = talloc(talloc_tos(), struct samr_SetSecurity);
176 if (r == NULL) {
177 return false;
180 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
181 talloc_free(r);
182 return false;
185 pull = ndr_pull_init_blob(&blob, r, NULL);
186 if (pull == NULL) {
187 talloc_free(r);
188 return false;
191 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
192 ndr_err = call->ndr_pull(pull, NDR_IN, r);
193 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
194 talloc_free(r);
195 return false;
198 if (DEBUGLEVEL >= 10) {
199 NDR_PRINT_IN_DEBUG(samr_SetSecurity, r);
202 r->out.result = _samr_SetSecurity(p, r);
204 if (p->rng_fault_state) {
205 talloc_free(r);
206 /* Return true here, srv_pipe_hnd.c will take care */
207 return true;
210 if (DEBUGLEVEL >= 10) {
211 NDR_PRINT_OUT_DEBUG(samr_SetSecurity, r);
214 push = ndr_push_init_ctx(r, NULL);
215 if (push == NULL) {
216 talloc_free(r);
217 return false;
220 ndr_err = call->ndr_push(push, NDR_OUT, r);
221 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
222 talloc_free(r);
223 return false;
226 blob = ndr_push_blob(push);
227 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
228 talloc_free(r);
229 return false;
232 talloc_free(r);
234 return true;
237 static bool api_samr_QuerySecurity(pipes_struct *p)
239 const struct ndr_interface_call *call;
240 struct ndr_pull *pull;
241 struct ndr_push *push;
242 enum ndr_err_code ndr_err;
243 DATA_BLOB blob;
244 struct samr_QuerySecurity *r;
246 call = &ndr_table_samr.calls[NDR_SAMR_QUERYSECURITY];
248 r = talloc(talloc_tos(), struct samr_QuerySecurity);
249 if (r == NULL) {
250 return false;
253 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
254 talloc_free(r);
255 return false;
258 pull = ndr_pull_init_blob(&blob, r, NULL);
259 if (pull == NULL) {
260 talloc_free(r);
261 return false;
264 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
265 ndr_err = call->ndr_pull(pull, NDR_IN, r);
266 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
267 talloc_free(r);
268 return false;
271 if (DEBUGLEVEL >= 10) {
272 NDR_PRINT_IN_DEBUG(samr_QuerySecurity, r);
275 ZERO_STRUCT(r->out);
276 r->out.sdbuf = talloc_zero(r, struct sec_desc_buf *);
277 if (r->out.sdbuf == NULL) {
278 talloc_free(r);
279 return false;
282 r->out.result = _samr_QuerySecurity(p, r);
284 if (p->rng_fault_state) {
285 talloc_free(r);
286 /* Return true here, srv_pipe_hnd.c will take care */
287 return true;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, r);
294 push = ndr_push_init_ctx(r, NULL);
295 if (push == NULL) {
296 talloc_free(r);
297 return false;
300 ndr_err = call->ndr_push(push, NDR_OUT, r);
301 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
302 talloc_free(r);
303 return false;
306 blob = ndr_push_blob(push);
307 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
308 talloc_free(r);
309 return false;
312 talloc_free(r);
314 return true;
317 static bool api_samr_Shutdown(pipes_struct *p)
319 const struct ndr_interface_call *call;
320 struct ndr_pull *pull;
321 struct ndr_push *push;
322 enum ndr_err_code ndr_err;
323 DATA_BLOB blob;
324 struct samr_Shutdown *r;
326 call = &ndr_table_samr.calls[NDR_SAMR_SHUTDOWN];
328 r = talloc(talloc_tos(), struct samr_Shutdown);
329 if (r == NULL) {
330 return false;
333 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
334 talloc_free(r);
335 return false;
338 pull = ndr_pull_init_blob(&blob, r, NULL);
339 if (pull == NULL) {
340 talloc_free(r);
341 return false;
344 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
345 ndr_err = call->ndr_pull(pull, NDR_IN, r);
346 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
347 talloc_free(r);
348 return false;
351 if (DEBUGLEVEL >= 10) {
352 NDR_PRINT_IN_DEBUG(samr_Shutdown, r);
355 r->out.result = _samr_Shutdown(p, r);
357 if (p->rng_fault_state) {
358 talloc_free(r);
359 /* Return true here, srv_pipe_hnd.c will take care */
360 return true;
363 if (DEBUGLEVEL >= 10) {
364 NDR_PRINT_OUT_DEBUG(samr_Shutdown, r);
367 push = ndr_push_init_ctx(r, NULL);
368 if (push == NULL) {
369 talloc_free(r);
370 return false;
373 ndr_err = call->ndr_push(push, NDR_OUT, r);
374 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
375 talloc_free(r);
376 return false;
379 blob = ndr_push_blob(push);
380 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
381 talloc_free(r);
382 return false;
385 talloc_free(r);
387 return true;
390 static bool api_samr_LookupDomain(pipes_struct *p)
392 const struct ndr_interface_call *call;
393 struct ndr_pull *pull;
394 struct ndr_push *push;
395 enum ndr_err_code ndr_err;
396 DATA_BLOB blob;
397 struct samr_LookupDomain *r;
399 call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPDOMAIN];
401 r = talloc(talloc_tos(), struct samr_LookupDomain);
402 if (r == NULL) {
403 return false;
406 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
407 talloc_free(r);
408 return false;
411 pull = ndr_pull_init_blob(&blob, r, NULL);
412 if (pull == NULL) {
413 talloc_free(r);
414 return false;
417 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
418 ndr_err = call->ndr_pull(pull, NDR_IN, r);
419 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
420 talloc_free(r);
421 return false;
424 if (DEBUGLEVEL >= 10) {
425 NDR_PRINT_IN_DEBUG(samr_LookupDomain, r);
428 ZERO_STRUCT(r->out);
429 r->out.sid = talloc_zero(r, struct dom_sid2 *);
430 if (r->out.sid == NULL) {
431 talloc_free(r);
432 return false;
435 r->out.result = _samr_LookupDomain(p, r);
437 if (p->rng_fault_state) {
438 talloc_free(r);
439 /* Return true here, srv_pipe_hnd.c will take care */
440 return true;
443 if (DEBUGLEVEL >= 10) {
444 NDR_PRINT_OUT_DEBUG(samr_LookupDomain, r);
447 push = ndr_push_init_ctx(r, NULL);
448 if (push == NULL) {
449 talloc_free(r);
450 return false;
453 ndr_err = call->ndr_push(push, NDR_OUT, r);
454 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
455 talloc_free(r);
456 return false;
459 blob = ndr_push_blob(push);
460 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
461 talloc_free(r);
462 return false;
465 talloc_free(r);
467 return true;
470 static bool api_samr_EnumDomains(pipes_struct *p)
472 const struct ndr_interface_call *call;
473 struct ndr_pull *pull;
474 struct ndr_push *push;
475 enum ndr_err_code ndr_err;
476 DATA_BLOB blob;
477 struct samr_EnumDomains *r;
479 call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINS];
481 r = talloc(talloc_tos(), struct samr_EnumDomains);
482 if (r == NULL) {
483 return false;
486 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
487 talloc_free(r);
488 return false;
491 pull = ndr_pull_init_blob(&blob, r, NULL);
492 if (pull == NULL) {
493 talloc_free(r);
494 return false;
497 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
498 ndr_err = call->ndr_pull(pull, NDR_IN, r);
499 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
500 talloc_free(r);
501 return false;
504 if (DEBUGLEVEL >= 10) {
505 NDR_PRINT_IN_DEBUG(samr_EnumDomains, r);
508 ZERO_STRUCT(r->out);
509 r->out.resume_handle = r->in.resume_handle;
510 r->out.sam = talloc_zero(r, struct samr_SamArray *);
511 if (r->out.sam == NULL) {
512 talloc_free(r);
513 return false;
516 r->out.num_entries = talloc_zero(r, uint32_t);
517 if (r->out.num_entries == NULL) {
518 talloc_free(r);
519 return false;
522 r->out.result = _samr_EnumDomains(p, r);
524 if (p->rng_fault_state) {
525 talloc_free(r);
526 /* Return true here, srv_pipe_hnd.c will take care */
527 return true;
530 if (DEBUGLEVEL >= 10) {
531 NDR_PRINT_OUT_DEBUG(samr_EnumDomains, r);
534 push = ndr_push_init_ctx(r, NULL);
535 if (push == NULL) {
536 talloc_free(r);
537 return false;
540 ndr_err = call->ndr_push(push, NDR_OUT, r);
541 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
542 talloc_free(r);
543 return false;
546 blob = ndr_push_blob(push);
547 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
548 talloc_free(r);
549 return false;
552 talloc_free(r);
554 return true;
557 static bool api_samr_OpenDomain(pipes_struct *p)
559 const struct ndr_interface_call *call;
560 struct ndr_pull *pull;
561 struct ndr_push *push;
562 enum ndr_err_code ndr_err;
563 DATA_BLOB blob;
564 struct samr_OpenDomain *r;
566 call = &ndr_table_samr.calls[NDR_SAMR_OPENDOMAIN];
568 r = talloc(talloc_tos(), struct samr_OpenDomain);
569 if (r == NULL) {
570 return false;
573 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
574 talloc_free(r);
575 return false;
578 pull = ndr_pull_init_blob(&blob, r, NULL);
579 if (pull == NULL) {
580 talloc_free(r);
581 return false;
584 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
585 ndr_err = call->ndr_pull(pull, NDR_IN, r);
586 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
587 talloc_free(r);
588 return false;
591 if (DEBUGLEVEL >= 10) {
592 NDR_PRINT_IN_DEBUG(samr_OpenDomain, r);
595 ZERO_STRUCT(r->out);
596 r->out.domain_handle = talloc_zero(r, struct policy_handle);
597 if (r->out.domain_handle == NULL) {
598 talloc_free(r);
599 return false;
602 r->out.result = _samr_OpenDomain(p, r);
604 if (p->rng_fault_state) {
605 talloc_free(r);
606 /* Return true here, srv_pipe_hnd.c will take care */
607 return true;
610 if (DEBUGLEVEL >= 10) {
611 NDR_PRINT_OUT_DEBUG(samr_OpenDomain, r);
614 push = ndr_push_init_ctx(r, NULL);
615 if (push == NULL) {
616 talloc_free(r);
617 return false;
620 ndr_err = call->ndr_push(push, NDR_OUT, r);
621 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
622 talloc_free(r);
623 return false;
626 blob = ndr_push_blob(push);
627 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
628 talloc_free(r);
629 return false;
632 talloc_free(r);
634 return true;
637 static bool api_samr_QueryDomainInfo(pipes_struct *p)
639 const struct ndr_interface_call *call;
640 struct ndr_pull *pull;
641 struct ndr_push *push;
642 enum ndr_err_code ndr_err;
643 DATA_BLOB blob;
644 struct samr_QueryDomainInfo *r;
646 call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO];
648 r = talloc(talloc_tos(), struct samr_QueryDomainInfo);
649 if (r == NULL) {
650 return false;
653 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
654 talloc_free(r);
655 return false;
658 pull = ndr_pull_init_blob(&blob, r, NULL);
659 if (pull == NULL) {
660 talloc_free(r);
661 return false;
664 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
665 ndr_err = call->ndr_pull(pull, NDR_IN, r);
666 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
667 talloc_free(r);
668 return false;
671 if (DEBUGLEVEL >= 10) {
672 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, r);
675 ZERO_STRUCT(r->out);
676 r->out.info = talloc_zero(r, union samr_DomainInfo *);
677 if (r->out.info == NULL) {
678 talloc_free(r);
679 return false;
682 r->out.result = _samr_QueryDomainInfo(p, r);
684 if (p->rng_fault_state) {
685 talloc_free(r);
686 /* Return true here, srv_pipe_hnd.c will take care */
687 return true;
690 if (DEBUGLEVEL >= 10) {
691 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, r);
694 push = ndr_push_init_ctx(r, NULL);
695 if (push == NULL) {
696 talloc_free(r);
697 return false;
700 ndr_err = call->ndr_push(push, NDR_OUT, r);
701 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
702 talloc_free(r);
703 return false;
706 blob = ndr_push_blob(push);
707 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
708 talloc_free(r);
709 return false;
712 talloc_free(r);
714 return true;
717 static bool api_samr_SetDomainInfo(pipes_struct *p)
719 const struct ndr_interface_call *call;
720 struct ndr_pull *pull;
721 struct ndr_push *push;
722 enum ndr_err_code ndr_err;
723 DATA_BLOB blob;
724 struct samr_SetDomainInfo *r;
726 call = &ndr_table_samr.calls[NDR_SAMR_SETDOMAININFO];
728 r = talloc(talloc_tos(), struct samr_SetDomainInfo);
729 if (r == NULL) {
730 return false;
733 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
734 talloc_free(r);
735 return false;
738 pull = ndr_pull_init_blob(&blob, r, NULL);
739 if (pull == NULL) {
740 talloc_free(r);
741 return false;
744 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
745 ndr_err = call->ndr_pull(pull, NDR_IN, r);
746 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
747 talloc_free(r);
748 return false;
751 if (DEBUGLEVEL >= 10) {
752 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, r);
755 r->out.result = _samr_SetDomainInfo(p, r);
757 if (p->rng_fault_state) {
758 talloc_free(r);
759 /* Return true here, srv_pipe_hnd.c will take care */
760 return true;
763 if (DEBUGLEVEL >= 10) {
764 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, r);
767 push = ndr_push_init_ctx(r, NULL);
768 if (push == NULL) {
769 talloc_free(r);
770 return false;
773 ndr_err = call->ndr_push(push, NDR_OUT, r);
774 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
775 talloc_free(r);
776 return false;
779 blob = ndr_push_blob(push);
780 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
781 talloc_free(r);
782 return false;
785 talloc_free(r);
787 return true;
790 static bool api_samr_CreateDomainGroup(pipes_struct *p)
792 const struct ndr_interface_call *call;
793 struct ndr_pull *pull;
794 struct ndr_push *push;
795 enum ndr_err_code ndr_err;
796 DATA_BLOB blob;
797 struct samr_CreateDomainGroup *r;
799 call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMAINGROUP];
801 r = talloc(talloc_tos(), struct samr_CreateDomainGroup);
802 if (r == NULL) {
803 return false;
806 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
807 talloc_free(r);
808 return false;
811 pull = ndr_pull_init_blob(&blob, r, NULL);
812 if (pull == NULL) {
813 talloc_free(r);
814 return false;
817 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
818 ndr_err = call->ndr_pull(pull, NDR_IN, r);
819 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
820 talloc_free(r);
821 return false;
824 if (DEBUGLEVEL >= 10) {
825 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, r);
828 ZERO_STRUCT(r->out);
829 r->out.group_handle = talloc_zero(r, struct policy_handle);
830 if (r->out.group_handle == NULL) {
831 talloc_free(r);
832 return false;
835 r->out.rid = talloc_zero(r, uint32_t);
836 if (r->out.rid == NULL) {
837 talloc_free(r);
838 return false;
841 r->out.result = _samr_CreateDomainGroup(p, r);
843 if (p->rng_fault_state) {
844 talloc_free(r);
845 /* Return true here, srv_pipe_hnd.c will take care */
846 return true;
849 if (DEBUGLEVEL >= 10) {
850 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, r);
853 push = ndr_push_init_ctx(r, NULL);
854 if (push == NULL) {
855 talloc_free(r);
856 return false;
859 ndr_err = call->ndr_push(push, NDR_OUT, r);
860 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
861 talloc_free(r);
862 return false;
865 blob = ndr_push_blob(push);
866 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
867 talloc_free(r);
868 return false;
871 talloc_free(r);
873 return true;
876 static bool api_samr_EnumDomainGroups(pipes_struct *p)
878 const struct ndr_interface_call *call;
879 struct ndr_pull *pull;
880 struct ndr_push *push;
881 enum ndr_err_code ndr_err;
882 DATA_BLOB blob;
883 struct samr_EnumDomainGroups *r;
885 call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINGROUPS];
887 r = talloc(talloc_tos(), struct samr_EnumDomainGroups);
888 if (r == NULL) {
889 return false;
892 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
893 talloc_free(r);
894 return false;
897 pull = ndr_pull_init_blob(&blob, r, NULL);
898 if (pull == NULL) {
899 talloc_free(r);
900 return false;
903 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
904 ndr_err = call->ndr_pull(pull, NDR_IN, r);
905 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
906 talloc_free(r);
907 return false;
910 if (DEBUGLEVEL >= 10) {
911 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, r);
914 ZERO_STRUCT(r->out);
915 r->out.resume_handle = r->in.resume_handle;
916 r->out.sam = talloc_zero(r, struct samr_SamArray *);
917 if (r->out.sam == NULL) {
918 talloc_free(r);
919 return false;
922 r->out.num_entries = talloc_zero(r, uint32_t);
923 if (r->out.num_entries == NULL) {
924 talloc_free(r);
925 return false;
928 r->out.result = _samr_EnumDomainGroups(p, r);
930 if (p->rng_fault_state) {
931 talloc_free(r);
932 /* Return true here, srv_pipe_hnd.c will take care */
933 return true;
936 if (DEBUGLEVEL >= 10) {
937 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, r);
940 push = ndr_push_init_ctx(r, NULL);
941 if (push == NULL) {
942 talloc_free(r);
943 return false;
946 ndr_err = call->ndr_push(push, NDR_OUT, r);
947 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
948 talloc_free(r);
949 return false;
952 blob = ndr_push_blob(push);
953 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
954 talloc_free(r);
955 return false;
958 talloc_free(r);
960 return true;
963 static bool api_samr_CreateUser(pipes_struct *p)
965 const struct ndr_interface_call *call;
966 struct ndr_pull *pull;
967 struct ndr_push *push;
968 enum ndr_err_code ndr_err;
969 DATA_BLOB blob;
970 struct samr_CreateUser *r;
972 call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER];
974 r = talloc(talloc_tos(), struct samr_CreateUser);
975 if (r == NULL) {
976 return false;
979 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
980 talloc_free(r);
981 return false;
984 pull = ndr_pull_init_blob(&blob, r, NULL);
985 if (pull == NULL) {
986 talloc_free(r);
987 return false;
990 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
991 ndr_err = call->ndr_pull(pull, NDR_IN, r);
992 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
993 talloc_free(r);
994 return false;
997 if (DEBUGLEVEL >= 10) {
998 NDR_PRINT_IN_DEBUG(samr_CreateUser, r);
1001 ZERO_STRUCT(r->out);
1002 r->out.user_handle = talloc_zero(r, struct policy_handle);
1003 if (r->out.user_handle == NULL) {
1004 talloc_free(r);
1005 return false;
1008 r->out.rid = talloc_zero(r, uint32_t);
1009 if (r->out.rid == NULL) {
1010 talloc_free(r);
1011 return false;
1014 r->out.result = _samr_CreateUser(p, r);
1016 if (p->rng_fault_state) {
1017 talloc_free(r);
1018 /* Return true here, srv_pipe_hnd.c will take care */
1019 return true;
1022 if (DEBUGLEVEL >= 10) {
1023 NDR_PRINT_OUT_DEBUG(samr_CreateUser, r);
1026 push = ndr_push_init_ctx(r, NULL);
1027 if (push == NULL) {
1028 talloc_free(r);
1029 return false;
1032 ndr_err = call->ndr_push(push, NDR_OUT, r);
1033 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1034 talloc_free(r);
1035 return false;
1038 blob = ndr_push_blob(push);
1039 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1040 talloc_free(r);
1041 return false;
1044 talloc_free(r);
1046 return true;
1049 static bool api_samr_EnumDomainUsers(pipes_struct *p)
1051 const struct ndr_interface_call *call;
1052 struct ndr_pull *pull;
1053 struct ndr_push *push;
1054 enum ndr_err_code ndr_err;
1055 DATA_BLOB blob;
1056 struct samr_EnumDomainUsers *r;
1058 call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINUSERS];
1060 r = talloc(talloc_tos(), struct samr_EnumDomainUsers);
1061 if (r == NULL) {
1062 return false;
1065 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1066 talloc_free(r);
1067 return false;
1070 pull = ndr_pull_init_blob(&blob, r, NULL);
1071 if (pull == NULL) {
1072 talloc_free(r);
1073 return false;
1076 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1077 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1078 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1079 talloc_free(r);
1080 return false;
1083 if (DEBUGLEVEL >= 10) {
1084 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, r);
1087 ZERO_STRUCT(r->out);
1088 r->out.resume_handle = r->in.resume_handle;
1089 r->out.sam = talloc_zero(r, struct samr_SamArray *);
1090 if (r->out.sam == NULL) {
1091 talloc_free(r);
1092 return false;
1095 r->out.num_entries = talloc_zero(r, uint32_t);
1096 if (r->out.num_entries == NULL) {
1097 talloc_free(r);
1098 return false;
1101 r->out.result = _samr_EnumDomainUsers(p, r);
1103 if (p->rng_fault_state) {
1104 talloc_free(r);
1105 /* Return true here, srv_pipe_hnd.c will take care */
1106 return true;
1109 if (DEBUGLEVEL >= 10) {
1110 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, r);
1113 push = ndr_push_init_ctx(r, NULL);
1114 if (push == NULL) {
1115 talloc_free(r);
1116 return false;
1119 ndr_err = call->ndr_push(push, NDR_OUT, r);
1120 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1121 talloc_free(r);
1122 return false;
1125 blob = ndr_push_blob(push);
1126 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1127 talloc_free(r);
1128 return false;
1131 talloc_free(r);
1133 return true;
1136 static bool api_samr_CreateDomAlias(pipes_struct *p)
1138 const struct ndr_interface_call *call;
1139 struct ndr_pull *pull;
1140 struct ndr_push *push;
1141 enum ndr_err_code ndr_err;
1142 DATA_BLOB blob;
1143 struct samr_CreateDomAlias *r;
1145 call = &ndr_table_samr.calls[NDR_SAMR_CREATEDOMALIAS];
1147 r = talloc(talloc_tos(), struct samr_CreateDomAlias);
1148 if (r == NULL) {
1149 return false;
1152 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1153 talloc_free(r);
1154 return false;
1157 pull = ndr_pull_init_blob(&blob, r, NULL);
1158 if (pull == NULL) {
1159 talloc_free(r);
1160 return false;
1163 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1164 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1165 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1166 talloc_free(r);
1167 return false;
1170 if (DEBUGLEVEL >= 10) {
1171 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, r);
1174 ZERO_STRUCT(r->out);
1175 r->out.alias_handle = talloc_zero(r, struct policy_handle);
1176 if (r->out.alias_handle == NULL) {
1177 talloc_free(r);
1178 return false;
1181 r->out.rid = talloc_zero(r, uint32_t);
1182 if (r->out.rid == NULL) {
1183 talloc_free(r);
1184 return false;
1187 r->out.result = _samr_CreateDomAlias(p, r);
1189 if (p->rng_fault_state) {
1190 talloc_free(r);
1191 /* Return true here, srv_pipe_hnd.c will take care */
1192 return true;
1195 if (DEBUGLEVEL >= 10) {
1196 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, r);
1199 push = ndr_push_init_ctx(r, NULL);
1200 if (push == NULL) {
1201 talloc_free(r);
1202 return false;
1205 ndr_err = call->ndr_push(push, NDR_OUT, r);
1206 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1207 talloc_free(r);
1208 return false;
1211 blob = ndr_push_blob(push);
1212 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1213 talloc_free(r);
1214 return false;
1217 talloc_free(r);
1219 return true;
1222 static bool api_samr_EnumDomainAliases(pipes_struct *p)
1224 const struct ndr_interface_call *call;
1225 struct ndr_pull *pull;
1226 struct ndr_push *push;
1227 enum ndr_err_code ndr_err;
1228 DATA_BLOB blob;
1229 struct samr_EnumDomainAliases *r;
1231 call = &ndr_table_samr.calls[NDR_SAMR_ENUMDOMAINALIASES];
1233 r = talloc(talloc_tos(), struct samr_EnumDomainAliases);
1234 if (r == NULL) {
1235 return false;
1238 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1239 talloc_free(r);
1240 return false;
1243 pull = ndr_pull_init_blob(&blob, r, NULL);
1244 if (pull == NULL) {
1245 talloc_free(r);
1246 return false;
1249 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1250 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1251 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1252 talloc_free(r);
1253 return false;
1256 if (DEBUGLEVEL >= 10) {
1257 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, r);
1260 ZERO_STRUCT(r->out);
1261 r->out.resume_handle = r->in.resume_handle;
1262 r->out.sam = talloc_zero(r, struct samr_SamArray *);
1263 if (r->out.sam == NULL) {
1264 talloc_free(r);
1265 return false;
1268 r->out.num_entries = talloc_zero(r, uint32_t);
1269 if (r->out.num_entries == NULL) {
1270 talloc_free(r);
1271 return false;
1274 r->out.result = _samr_EnumDomainAliases(p, r);
1276 if (p->rng_fault_state) {
1277 talloc_free(r);
1278 /* Return true here, srv_pipe_hnd.c will take care */
1279 return true;
1282 if (DEBUGLEVEL >= 10) {
1283 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, r);
1286 push = ndr_push_init_ctx(r, NULL);
1287 if (push == NULL) {
1288 talloc_free(r);
1289 return false;
1292 ndr_err = call->ndr_push(push, NDR_OUT, r);
1293 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1294 talloc_free(r);
1295 return false;
1298 blob = ndr_push_blob(push);
1299 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1300 talloc_free(r);
1301 return false;
1304 talloc_free(r);
1306 return true;
1309 static bool api_samr_GetAliasMembership(pipes_struct *p)
1311 const struct ndr_interface_call *call;
1312 struct ndr_pull *pull;
1313 struct ndr_push *push;
1314 enum ndr_err_code ndr_err;
1315 DATA_BLOB blob;
1316 struct samr_GetAliasMembership *r;
1318 call = &ndr_table_samr.calls[NDR_SAMR_GETALIASMEMBERSHIP];
1320 r = talloc(talloc_tos(), struct samr_GetAliasMembership);
1321 if (r == NULL) {
1322 return false;
1325 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1326 talloc_free(r);
1327 return false;
1330 pull = ndr_pull_init_blob(&blob, r, NULL);
1331 if (pull == NULL) {
1332 talloc_free(r);
1333 return false;
1336 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1337 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1338 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1339 talloc_free(r);
1340 return false;
1343 if (DEBUGLEVEL >= 10) {
1344 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, r);
1347 ZERO_STRUCT(r->out);
1348 r->out.rids = talloc_zero(r, struct samr_Ids);
1349 if (r->out.rids == NULL) {
1350 talloc_free(r);
1351 return false;
1354 r->out.result = _samr_GetAliasMembership(p, r);
1356 if (p->rng_fault_state) {
1357 talloc_free(r);
1358 /* Return true here, srv_pipe_hnd.c will take care */
1359 return true;
1362 if (DEBUGLEVEL >= 10) {
1363 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, r);
1366 push = ndr_push_init_ctx(r, NULL);
1367 if (push == NULL) {
1368 talloc_free(r);
1369 return false;
1372 ndr_err = call->ndr_push(push, NDR_OUT, r);
1373 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1374 talloc_free(r);
1375 return false;
1378 blob = ndr_push_blob(push);
1379 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1380 talloc_free(r);
1381 return false;
1384 talloc_free(r);
1386 return true;
1389 static bool api_samr_LookupNames(pipes_struct *p)
1391 const struct ndr_interface_call *call;
1392 struct ndr_pull *pull;
1393 struct ndr_push *push;
1394 enum ndr_err_code ndr_err;
1395 DATA_BLOB blob;
1396 struct samr_LookupNames *r;
1398 call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPNAMES];
1400 r = talloc(talloc_tos(), struct samr_LookupNames);
1401 if (r == NULL) {
1402 return false;
1405 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1406 talloc_free(r);
1407 return false;
1410 pull = ndr_pull_init_blob(&blob, r, NULL);
1411 if (pull == NULL) {
1412 talloc_free(r);
1413 return false;
1416 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1417 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1418 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1419 talloc_free(r);
1420 return false;
1423 if (DEBUGLEVEL >= 10) {
1424 NDR_PRINT_IN_DEBUG(samr_LookupNames, r);
1427 ZERO_STRUCT(r->out);
1428 r->out.rids = talloc_zero(r, struct samr_Ids);
1429 if (r->out.rids == NULL) {
1430 talloc_free(r);
1431 return false;
1434 r->out.types = talloc_zero(r, struct samr_Ids);
1435 if (r->out.types == NULL) {
1436 talloc_free(r);
1437 return false;
1440 r->out.result = _samr_LookupNames(p, r);
1442 if (p->rng_fault_state) {
1443 talloc_free(r);
1444 /* Return true here, srv_pipe_hnd.c will take care */
1445 return true;
1448 if (DEBUGLEVEL >= 10) {
1449 NDR_PRINT_OUT_DEBUG(samr_LookupNames, r);
1452 push = ndr_push_init_ctx(r, NULL);
1453 if (push == NULL) {
1454 talloc_free(r);
1455 return false;
1458 ndr_err = call->ndr_push(push, NDR_OUT, r);
1459 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1460 talloc_free(r);
1461 return false;
1464 blob = ndr_push_blob(push);
1465 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1466 talloc_free(r);
1467 return false;
1470 talloc_free(r);
1472 return true;
1475 static bool api_samr_LookupRids(pipes_struct *p)
1477 const struct ndr_interface_call *call;
1478 struct ndr_pull *pull;
1479 struct ndr_push *push;
1480 enum ndr_err_code ndr_err;
1481 DATA_BLOB blob;
1482 struct samr_LookupRids *r;
1484 call = &ndr_table_samr.calls[NDR_SAMR_LOOKUPRIDS];
1486 r = talloc(talloc_tos(), struct samr_LookupRids);
1487 if (r == NULL) {
1488 return false;
1491 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1492 talloc_free(r);
1493 return false;
1496 pull = ndr_pull_init_blob(&blob, r, NULL);
1497 if (pull == NULL) {
1498 talloc_free(r);
1499 return false;
1502 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1503 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1504 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1505 talloc_free(r);
1506 return false;
1509 if (DEBUGLEVEL >= 10) {
1510 NDR_PRINT_IN_DEBUG(samr_LookupRids, r);
1513 ZERO_STRUCT(r->out);
1514 r->out.names = talloc_zero(r, struct lsa_Strings);
1515 if (r->out.names == NULL) {
1516 talloc_free(r);
1517 return false;
1520 r->out.types = talloc_zero(r, struct samr_Ids);
1521 if (r->out.types == NULL) {
1522 talloc_free(r);
1523 return false;
1526 r->out.result = _samr_LookupRids(p, r);
1528 if (p->rng_fault_state) {
1529 talloc_free(r);
1530 /* Return true here, srv_pipe_hnd.c will take care */
1531 return true;
1534 if (DEBUGLEVEL >= 10) {
1535 NDR_PRINT_OUT_DEBUG(samr_LookupRids, r);
1538 push = ndr_push_init_ctx(r, NULL);
1539 if (push == NULL) {
1540 talloc_free(r);
1541 return false;
1544 ndr_err = call->ndr_push(push, NDR_OUT, r);
1545 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1546 talloc_free(r);
1547 return false;
1550 blob = ndr_push_blob(push);
1551 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1552 talloc_free(r);
1553 return false;
1556 talloc_free(r);
1558 return true;
1561 static bool api_samr_OpenGroup(pipes_struct *p)
1563 const struct ndr_interface_call *call;
1564 struct ndr_pull *pull;
1565 struct ndr_push *push;
1566 enum ndr_err_code ndr_err;
1567 DATA_BLOB blob;
1568 struct samr_OpenGroup *r;
1570 call = &ndr_table_samr.calls[NDR_SAMR_OPENGROUP];
1572 r = talloc(talloc_tos(), struct samr_OpenGroup);
1573 if (r == NULL) {
1574 return false;
1577 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1578 talloc_free(r);
1579 return false;
1582 pull = ndr_pull_init_blob(&blob, r, NULL);
1583 if (pull == NULL) {
1584 talloc_free(r);
1585 return false;
1588 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1589 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1590 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1591 talloc_free(r);
1592 return false;
1595 if (DEBUGLEVEL >= 10) {
1596 NDR_PRINT_IN_DEBUG(samr_OpenGroup, r);
1599 ZERO_STRUCT(r->out);
1600 r->out.group_handle = talloc_zero(r, struct policy_handle);
1601 if (r->out.group_handle == NULL) {
1602 talloc_free(r);
1603 return false;
1606 r->out.result = _samr_OpenGroup(p, r);
1608 if (p->rng_fault_state) {
1609 talloc_free(r);
1610 /* Return true here, srv_pipe_hnd.c will take care */
1611 return true;
1614 if (DEBUGLEVEL >= 10) {
1615 NDR_PRINT_OUT_DEBUG(samr_OpenGroup, r);
1618 push = ndr_push_init_ctx(r, NULL);
1619 if (push == NULL) {
1620 talloc_free(r);
1621 return false;
1624 ndr_err = call->ndr_push(push, NDR_OUT, r);
1625 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1626 talloc_free(r);
1627 return false;
1630 blob = ndr_push_blob(push);
1631 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1632 talloc_free(r);
1633 return false;
1636 talloc_free(r);
1638 return true;
1641 static bool api_samr_QueryGroupInfo(pipes_struct *p)
1643 const struct ndr_interface_call *call;
1644 struct ndr_pull *pull;
1645 struct ndr_push *push;
1646 enum ndr_err_code ndr_err;
1647 DATA_BLOB blob;
1648 struct samr_QueryGroupInfo *r;
1650 call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPINFO];
1652 r = talloc(talloc_tos(), struct samr_QueryGroupInfo);
1653 if (r == NULL) {
1654 return false;
1657 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1658 talloc_free(r);
1659 return false;
1662 pull = ndr_pull_init_blob(&blob, r, NULL);
1663 if (pull == NULL) {
1664 talloc_free(r);
1665 return false;
1668 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1669 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1670 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1671 talloc_free(r);
1672 return false;
1675 if (DEBUGLEVEL >= 10) {
1676 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, r);
1679 ZERO_STRUCT(r->out);
1680 r->out.info = talloc_zero(r, union samr_GroupInfo *);
1681 if (r->out.info == NULL) {
1682 talloc_free(r);
1683 return false;
1686 r->out.result = _samr_QueryGroupInfo(p, r);
1688 if (p->rng_fault_state) {
1689 talloc_free(r);
1690 /* Return true here, srv_pipe_hnd.c will take care */
1691 return true;
1694 if (DEBUGLEVEL >= 10) {
1695 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, r);
1698 push = ndr_push_init_ctx(r, NULL);
1699 if (push == NULL) {
1700 talloc_free(r);
1701 return false;
1704 ndr_err = call->ndr_push(push, NDR_OUT, r);
1705 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1706 talloc_free(r);
1707 return false;
1710 blob = ndr_push_blob(push);
1711 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1712 talloc_free(r);
1713 return false;
1716 talloc_free(r);
1718 return true;
1721 static bool api_samr_SetGroupInfo(pipes_struct *p)
1723 const struct ndr_interface_call *call;
1724 struct ndr_pull *pull;
1725 struct ndr_push *push;
1726 enum ndr_err_code ndr_err;
1727 DATA_BLOB blob;
1728 struct samr_SetGroupInfo *r;
1730 call = &ndr_table_samr.calls[NDR_SAMR_SETGROUPINFO];
1732 r = talloc(talloc_tos(), struct samr_SetGroupInfo);
1733 if (r == NULL) {
1734 return false;
1737 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1738 talloc_free(r);
1739 return false;
1742 pull = ndr_pull_init_blob(&blob, r, NULL);
1743 if (pull == NULL) {
1744 talloc_free(r);
1745 return false;
1748 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1749 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1750 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1751 talloc_free(r);
1752 return false;
1755 if (DEBUGLEVEL >= 10) {
1756 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, r);
1759 r->out.result = _samr_SetGroupInfo(p, r);
1761 if (p->rng_fault_state) {
1762 talloc_free(r);
1763 /* Return true here, srv_pipe_hnd.c will take care */
1764 return true;
1767 if (DEBUGLEVEL >= 10) {
1768 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, r);
1771 push = ndr_push_init_ctx(r, NULL);
1772 if (push == NULL) {
1773 talloc_free(r);
1774 return false;
1777 ndr_err = call->ndr_push(push, NDR_OUT, r);
1778 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1779 talloc_free(r);
1780 return false;
1783 blob = ndr_push_blob(push);
1784 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1785 talloc_free(r);
1786 return false;
1789 talloc_free(r);
1791 return true;
1794 static bool api_samr_AddGroupMember(pipes_struct *p)
1796 const struct ndr_interface_call *call;
1797 struct ndr_pull *pull;
1798 struct ndr_push *push;
1799 enum ndr_err_code ndr_err;
1800 DATA_BLOB blob;
1801 struct samr_AddGroupMember *r;
1803 call = &ndr_table_samr.calls[NDR_SAMR_ADDGROUPMEMBER];
1805 r = talloc(talloc_tos(), struct samr_AddGroupMember);
1806 if (r == NULL) {
1807 return false;
1810 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1811 talloc_free(r);
1812 return false;
1815 pull = ndr_pull_init_blob(&blob, r, NULL);
1816 if (pull == NULL) {
1817 talloc_free(r);
1818 return false;
1821 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1822 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1823 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1824 talloc_free(r);
1825 return false;
1828 if (DEBUGLEVEL >= 10) {
1829 NDR_PRINT_IN_DEBUG(samr_AddGroupMember, r);
1832 r->out.result = _samr_AddGroupMember(p, r);
1834 if (p->rng_fault_state) {
1835 talloc_free(r);
1836 /* Return true here, srv_pipe_hnd.c will take care */
1837 return true;
1840 if (DEBUGLEVEL >= 10) {
1841 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, r);
1844 push = ndr_push_init_ctx(r, NULL);
1845 if (push == NULL) {
1846 talloc_free(r);
1847 return false;
1850 ndr_err = call->ndr_push(push, NDR_OUT, r);
1851 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1852 talloc_free(r);
1853 return false;
1856 blob = ndr_push_blob(push);
1857 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1858 talloc_free(r);
1859 return false;
1862 talloc_free(r);
1864 return true;
1867 static bool api_samr_DeleteDomainGroup(pipes_struct *p)
1869 const struct ndr_interface_call *call;
1870 struct ndr_pull *pull;
1871 struct ndr_push *push;
1872 enum ndr_err_code ndr_err;
1873 DATA_BLOB blob;
1874 struct samr_DeleteDomainGroup *r;
1876 call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMAINGROUP];
1878 r = talloc(talloc_tos(), struct samr_DeleteDomainGroup);
1879 if (r == NULL) {
1880 return false;
1883 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1884 talloc_free(r);
1885 return false;
1888 pull = ndr_pull_init_blob(&blob, r, NULL);
1889 if (pull == NULL) {
1890 talloc_free(r);
1891 return false;
1894 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1895 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1896 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1897 talloc_free(r);
1898 return false;
1901 if (DEBUGLEVEL >= 10) {
1902 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, r);
1905 ZERO_STRUCT(r->out);
1906 r->out.group_handle = r->in.group_handle;
1907 r->out.result = _samr_DeleteDomainGroup(p, r);
1909 if (p->rng_fault_state) {
1910 talloc_free(r);
1911 /* Return true here, srv_pipe_hnd.c will take care */
1912 return true;
1915 if (DEBUGLEVEL >= 10) {
1916 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, r);
1919 push = ndr_push_init_ctx(r, NULL);
1920 if (push == NULL) {
1921 talloc_free(r);
1922 return false;
1925 ndr_err = call->ndr_push(push, NDR_OUT, r);
1926 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1927 talloc_free(r);
1928 return false;
1931 blob = ndr_push_blob(push);
1932 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1933 talloc_free(r);
1934 return false;
1937 talloc_free(r);
1939 return true;
1942 static bool api_samr_DeleteGroupMember(pipes_struct *p)
1944 const struct ndr_interface_call *call;
1945 struct ndr_pull *pull;
1946 struct ndr_push *push;
1947 enum ndr_err_code ndr_err;
1948 DATA_BLOB blob;
1949 struct samr_DeleteGroupMember *r;
1951 call = &ndr_table_samr.calls[NDR_SAMR_DELETEGROUPMEMBER];
1953 r = talloc(talloc_tos(), struct samr_DeleteGroupMember);
1954 if (r == NULL) {
1955 return false;
1958 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1959 talloc_free(r);
1960 return false;
1963 pull = ndr_pull_init_blob(&blob, r, NULL);
1964 if (pull == NULL) {
1965 talloc_free(r);
1966 return false;
1969 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1970 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1971 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1972 talloc_free(r);
1973 return false;
1976 if (DEBUGLEVEL >= 10) {
1977 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, r);
1980 r->out.result = _samr_DeleteGroupMember(p, r);
1982 if (p->rng_fault_state) {
1983 talloc_free(r);
1984 /* Return true here, srv_pipe_hnd.c will take care */
1985 return true;
1988 if (DEBUGLEVEL >= 10) {
1989 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, r);
1992 push = ndr_push_init_ctx(r, NULL);
1993 if (push == NULL) {
1994 talloc_free(r);
1995 return false;
1998 ndr_err = call->ndr_push(push, NDR_OUT, r);
1999 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2000 talloc_free(r);
2001 return false;
2004 blob = ndr_push_blob(push);
2005 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2006 talloc_free(r);
2007 return false;
2010 talloc_free(r);
2012 return true;
2015 static bool api_samr_QueryGroupMember(pipes_struct *p)
2017 const struct ndr_interface_call *call;
2018 struct ndr_pull *pull;
2019 struct ndr_push *push;
2020 enum ndr_err_code ndr_err;
2021 DATA_BLOB blob;
2022 struct samr_QueryGroupMember *r;
2024 call = &ndr_table_samr.calls[NDR_SAMR_QUERYGROUPMEMBER];
2026 r = talloc(talloc_tos(), struct samr_QueryGroupMember);
2027 if (r == NULL) {
2028 return false;
2031 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2032 talloc_free(r);
2033 return false;
2036 pull = ndr_pull_init_blob(&blob, r, NULL);
2037 if (pull == NULL) {
2038 talloc_free(r);
2039 return false;
2042 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2043 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2044 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2045 talloc_free(r);
2046 return false;
2049 if (DEBUGLEVEL >= 10) {
2050 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, r);
2053 ZERO_STRUCT(r->out);
2054 r->out.rids = talloc_zero(r, struct samr_RidTypeArray *);
2055 if (r->out.rids == NULL) {
2056 talloc_free(r);
2057 return false;
2060 r->out.result = _samr_QueryGroupMember(p, r);
2062 if (p->rng_fault_state) {
2063 talloc_free(r);
2064 /* Return true here, srv_pipe_hnd.c will take care */
2065 return true;
2068 if (DEBUGLEVEL >= 10) {
2069 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, r);
2072 push = ndr_push_init_ctx(r, NULL);
2073 if (push == NULL) {
2074 talloc_free(r);
2075 return false;
2078 ndr_err = call->ndr_push(push, NDR_OUT, r);
2079 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2080 talloc_free(r);
2081 return false;
2084 blob = ndr_push_blob(push);
2085 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2086 talloc_free(r);
2087 return false;
2090 talloc_free(r);
2092 return true;
2095 static bool api_samr_SetMemberAttributesOfGroup(pipes_struct *p)
2097 const struct ndr_interface_call *call;
2098 struct ndr_pull *pull;
2099 struct ndr_push *push;
2100 enum ndr_err_code ndr_err;
2101 DATA_BLOB blob;
2102 struct samr_SetMemberAttributesOfGroup *r;
2104 call = &ndr_table_samr.calls[NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP];
2106 r = talloc(talloc_tos(), struct samr_SetMemberAttributesOfGroup);
2107 if (r == NULL) {
2108 return false;
2111 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2112 talloc_free(r);
2113 return false;
2116 pull = ndr_pull_init_blob(&blob, r, NULL);
2117 if (pull == NULL) {
2118 talloc_free(r);
2119 return false;
2122 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2123 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2124 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2125 talloc_free(r);
2126 return false;
2129 if (DEBUGLEVEL >= 10) {
2130 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, r);
2133 r->out.result = _samr_SetMemberAttributesOfGroup(p, r);
2135 if (p->rng_fault_state) {
2136 talloc_free(r);
2137 /* Return true here, srv_pipe_hnd.c will take care */
2138 return true;
2141 if (DEBUGLEVEL >= 10) {
2142 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, r);
2145 push = ndr_push_init_ctx(r, NULL);
2146 if (push == NULL) {
2147 talloc_free(r);
2148 return false;
2151 ndr_err = call->ndr_push(push, NDR_OUT, r);
2152 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2153 talloc_free(r);
2154 return false;
2157 blob = ndr_push_blob(push);
2158 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2159 talloc_free(r);
2160 return false;
2163 talloc_free(r);
2165 return true;
2168 static bool api_samr_OpenAlias(pipes_struct *p)
2170 const struct ndr_interface_call *call;
2171 struct ndr_pull *pull;
2172 struct ndr_push *push;
2173 enum ndr_err_code ndr_err;
2174 DATA_BLOB blob;
2175 struct samr_OpenAlias *r;
2177 call = &ndr_table_samr.calls[NDR_SAMR_OPENALIAS];
2179 r = talloc(talloc_tos(), struct samr_OpenAlias);
2180 if (r == NULL) {
2181 return false;
2184 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2185 talloc_free(r);
2186 return false;
2189 pull = ndr_pull_init_blob(&blob, r, NULL);
2190 if (pull == NULL) {
2191 talloc_free(r);
2192 return false;
2195 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2196 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2197 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2198 talloc_free(r);
2199 return false;
2202 if (DEBUGLEVEL >= 10) {
2203 NDR_PRINT_IN_DEBUG(samr_OpenAlias, r);
2206 ZERO_STRUCT(r->out);
2207 r->out.alias_handle = talloc_zero(r, struct policy_handle);
2208 if (r->out.alias_handle == NULL) {
2209 talloc_free(r);
2210 return false;
2213 r->out.result = _samr_OpenAlias(p, r);
2215 if (p->rng_fault_state) {
2216 talloc_free(r);
2217 /* Return true here, srv_pipe_hnd.c will take care */
2218 return true;
2221 if (DEBUGLEVEL >= 10) {
2222 NDR_PRINT_OUT_DEBUG(samr_OpenAlias, r);
2225 push = ndr_push_init_ctx(r, NULL);
2226 if (push == NULL) {
2227 talloc_free(r);
2228 return false;
2231 ndr_err = call->ndr_push(push, NDR_OUT, r);
2232 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2233 talloc_free(r);
2234 return false;
2237 blob = ndr_push_blob(push);
2238 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2239 talloc_free(r);
2240 return false;
2243 talloc_free(r);
2245 return true;
2248 static bool api_samr_QueryAliasInfo(pipes_struct *p)
2250 const struct ndr_interface_call *call;
2251 struct ndr_pull *pull;
2252 struct ndr_push *push;
2253 enum ndr_err_code ndr_err;
2254 DATA_BLOB blob;
2255 struct samr_QueryAliasInfo *r;
2257 call = &ndr_table_samr.calls[NDR_SAMR_QUERYALIASINFO];
2259 r = talloc(talloc_tos(), struct samr_QueryAliasInfo);
2260 if (r == NULL) {
2261 return false;
2264 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2265 talloc_free(r);
2266 return false;
2269 pull = ndr_pull_init_blob(&blob, r, NULL);
2270 if (pull == NULL) {
2271 talloc_free(r);
2272 return false;
2275 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2276 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2277 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2278 talloc_free(r);
2279 return false;
2282 if (DEBUGLEVEL >= 10) {
2283 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, r);
2286 ZERO_STRUCT(r->out);
2287 r->out.info = talloc_zero(r, union samr_AliasInfo *);
2288 if (r->out.info == NULL) {
2289 talloc_free(r);
2290 return false;
2293 r->out.result = _samr_QueryAliasInfo(p, r);
2295 if (p->rng_fault_state) {
2296 talloc_free(r);
2297 /* Return true here, srv_pipe_hnd.c will take care */
2298 return true;
2301 if (DEBUGLEVEL >= 10) {
2302 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, r);
2305 push = ndr_push_init_ctx(r, NULL);
2306 if (push == NULL) {
2307 talloc_free(r);
2308 return false;
2311 ndr_err = call->ndr_push(push, NDR_OUT, r);
2312 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2313 talloc_free(r);
2314 return false;
2317 blob = ndr_push_blob(push);
2318 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2319 talloc_free(r);
2320 return false;
2323 talloc_free(r);
2325 return true;
2328 static bool api_samr_SetAliasInfo(pipes_struct *p)
2330 const struct ndr_interface_call *call;
2331 struct ndr_pull *pull;
2332 struct ndr_push *push;
2333 enum ndr_err_code ndr_err;
2334 DATA_BLOB blob;
2335 struct samr_SetAliasInfo *r;
2337 call = &ndr_table_samr.calls[NDR_SAMR_SETALIASINFO];
2339 r = talloc(talloc_tos(), struct samr_SetAliasInfo);
2340 if (r == NULL) {
2341 return false;
2344 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2345 talloc_free(r);
2346 return false;
2349 pull = ndr_pull_init_blob(&blob, r, NULL);
2350 if (pull == NULL) {
2351 talloc_free(r);
2352 return false;
2355 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2356 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2357 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2358 talloc_free(r);
2359 return false;
2362 if (DEBUGLEVEL >= 10) {
2363 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, r);
2366 r->out.result = _samr_SetAliasInfo(p, r);
2368 if (p->rng_fault_state) {
2369 talloc_free(r);
2370 /* Return true here, srv_pipe_hnd.c will take care */
2371 return true;
2374 if (DEBUGLEVEL >= 10) {
2375 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, r);
2378 push = ndr_push_init_ctx(r, NULL);
2379 if (push == NULL) {
2380 talloc_free(r);
2381 return false;
2384 ndr_err = call->ndr_push(push, NDR_OUT, r);
2385 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2386 talloc_free(r);
2387 return false;
2390 blob = ndr_push_blob(push);
2391 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2392 talloc_free(r);
2393 return false;
2396 talloc_free(r);
2398 return true;
2401 static bool api_samr_DeleteDomAlias(pipes_struct *p)
2403 const struct ndr_interface_call *call;
2404 struct ndr_pull *pull;
2405 struct ndr_push *push;
2406 enum ndr_err_code ndr_err;
2407 DATA_BLOB blob;
2408 struct samr_DeleteDomAlias *r;
2410 call = &ndr_table_samr.calls[NDR_SAMR_DELETEDOMALIAS];
2412 r = talloc(talloc_tos(), struct samr_DeleteDomAlias);
2413 if (r == NULL) {
2414 return false;
2417 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2418 talloc_free(r);
2419 return false;
2422 pull = ndr_pull_init_blob(&blob, r, NULL);
2423 if (pull == NULL) {
2424 talloc_free(r);
2425 return false;
2428 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2429 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2430 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2431 talloc_free(r);
2432 return false;
2435 if (DEBUGLEVEL >= 10) {
2436 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, r);
2439 ZERO_STRUCT(r->out);
2440 r->out.alias_handle = r->in.alias_handle;
2441 r->out.result = _samr_DeleteDomAlias(p, r);
2443 if (p->rng_fault_state) {
2444 talloc_free(r);
2445 /* Return true here, srv_pipe_hnd.c will take care */
2446 return true;
2449 if (DEBUGLEVEL >= 10) {
2450 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, r);
2453 push = ndr_push_init_ctx(r, NULL);
2454 if (push == NULL) {
2455 talloc_free(r);
2456 return false;
2459 ndr_err = call->ndr_push(push, NDR_OUT, r);
2460 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2461 talloc_free(r);
2462 return false;
2465 blob = ndr_push_blob(push);
2466 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2467 talloc_free(r);
2468 return false;
2471 talloc_free(r);
2473 return true;
2476 static bool api_samr_AddAliasMember(pipes_struct *p)
2478 const struct ndr_interface_call *call;
2479 struct ndr_pull *pull;
2480 struct ndr_push *push;
2481 enum ndr_err_code ndr_err;
2482 DATA_BLOB blob;
2483 struct samr_AddAliasMember *r;
2485 call = &ndr_table_samr.calls[NDR_SAMR_ADDALIASMEMBER];
2487 r = talloc(talloc_tos(), struct samr_AddAliasMember);
2488 if (r == NULL) {
2489 return false;
2492 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2493 talloc_free(r);
2494 return false;
2497 pull = ndr_pull_init_blob(&blob, r, NULL);
2498 if (pull == NULL) {
2499 talloc_free(r);
2500 return false;
2503 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2504 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2505 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2506 talloc_free(r);
2507 return false;
2510 if (DEBUGLEVEL >= 10) {
2511 NDR_PRINT_IN_DEBUG(samr_AddAliasMember, r);
2514 r->out.result = _samr_AddAliasMember(p, r);
2516 if (p->rng_fault_state) {
2517 talloc_free(r);
2518 /* Return true here, srv_pipe_hnd.c will take care */
2519 return true;
2522 if (DEBUGLEVEL >= 10) {
2523 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, r);
2526 push = ndr_push_init_ctx(r, NULL);
2527 if (push == NULL) {
2528 talloc_free(r);
2529 return false;
2532 ndr_err = call->ndr_push(push, NDR_OUT, r);
2533 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2534 talloc_free(r);
2535 return false;
2538 blob = ndr_push_blob(push);
2539 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2540 talloc_free(r);
2541 return false;
2544 talloc_free(r);
2546 return true;
2549 static bool api_samr_DeleteAliasMember(pipes_struct *p)
2551 const struct ndr_interface_call *call;
2552 struct ndr_pull *pull;
2553 struct ndr_push *push;
2554 enum ndr_err_code ndr_err;
2555 DATA_BLOB blob;
2556 struct samr_DeleteAliasMember *r;
2558 call = &ndr_table_samr.calls[NDR_SAMR_DELETEALIASMEMBER];
2560 r = talloc(talloc_tos(), struct samr_DeleteAliasMember);
2561 if (r == NULL) {
2562 return false;
2565 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2566 talloc_free(r);
2567 return false;
2570 pull = ndr_pull_init_blob(&blob, r, NULL);
2571 if (pull == NULL) {
2572 talloc_free(r);
2573 return false;
2576 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2577 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2578 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2579 talloc_free(r);
2580 return false;
2583 if (DEBUGLEVEL >= 10) {
2584 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, r);
2587 r->out.result = _samr_DeleteAliasMember(p, r);
2589 if (p->rng_fault_state) {
2590 talloc_free(r);
2591 /* Return true here, srv_pipe_hnd.c will take care */
2592 return true;
2595 if (DEBUGLEVEL >= 10) {
2596 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, r);
2599 push = ndr_push_init_ctx(r, NULL);
2600 if (push == NULL) {
2601 talloc_free(r);
2602 return false;
2605 ndr_err = call->ndr_push(push, NDR_OUT, r);
2606 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2607 talloc_free(r);
2608 return false;
2611 blob = ndr_push_blob(push);
2612 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2613 talloc_free(r);
2614 return false;
2617 talloc_free(r);
2619 return true;
2622 static bool api_samr_GetMembersInAlias(pipes_struct *p)
2624 const struct ndr_interface_call *call;
2625 struct ndr_pull *pull;
2626 struct ndr_push *push;
2627 enum ndr_err_code ndr_err;
2628 DATA_BLOB blob;
2629 struct samr_GetMembersInAlias *r;
2631 call = &ndr_table_samr.calls[NDR_SAMR_GETMEMBERSINALIAS];
2633 r = talloc(talloc_tos(), struct samr_GetMembersInAlias);
2634 if (r == NULL) {
2635 return false;
2638 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2639 talloc_free(r);
2640 return false;
2643 pull = ndr_pull_init_blob(&blob, r, NULL);
2644 if (pull == NULL) {
2645 talloc_free(r);
2646 return false;
2649 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2650 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2651 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2652 talloc_free(r);
2653 return false;
2656 if (DEBUGLEVEL >= 10) {
2657 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, r);
2660 ZERO_STRUCT(r->out);
2661 r->out.sids = talloc_zero(r, struct lsa_SidArray);
2662 if (r->out.sids == NULL) {
2663 talloc_free(r);
2664 return false;
2667 r->out.result = _samr_GetMembersInAlias(p, r);
2669 if (p->rng_fault_state) {
2670 talloc_free(r);
2671 /* Return true here, srv_pipe_hnd.c will take care */
2672 return true;
2675 if (DEBUGLEVEL >= 10) {
2676 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, r);
2679 push = ndr_push_init_ctx(r, NULL);
2680 if (push == NULL) {
2681 talloc_free(r);
2682 return false;
2685 ndr_err = call->ndr_push(push, NDR_OUT, r);
2686 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2687 talloc_free(r);
2688 return false;
2691 blob = ndr_push_blob(push);
2692 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2693 talloc_free(r);
2694 return false;
2697 talloc_free(r);
2699 return true;
2702 static bool api_samr_OpenUser(pipes_struct *p)
2704 const struct ndr_interface_call *call;
2705 struct ndr_pull *pull;
2706 struct ndr_push *push;
2707 enum ndr_err_code ndr_err;
2708 DATA_BLOB blob;
2709 struct samr_OpenUser *r;
2711 call = &ndr_table_samr.calls[NDR_SAMR_OPENUSER];
2713 r = talloc(talloc_tos(), struct samr_OpenUser);
2714 if (r == NULL) {
2715 return false;
2718 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2719 talloc_free(r);
2720 return false;
2723 pull = ndr_pull_init_blob(&blob, r, NULL);
2724 if (pull == NULL) {
2725 talloc_free(r);
2726 return false;
2729 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2730 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2731 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2732 talloc_free(r);
2733 return false;
2736 if (DEBUGLEVEL >= 10) {
2737 NDR_PRINT_IN_DEBUG(samr_OpenUser, r);
2740 ZERO_STRUCT(r->out);
2741 r->out.user_handle = talloc_zero(r, struct policy_handle);
2742 if (r->out.user_handle == NULL) {
2743 talloc_free(r);
2744 return false;
2747 r->out.result = _samr_OpenUser(p, r);
2749 if (p->rng_fault_state) {
2750 talloc_free(r);
2751 /* Return true here, srv_pipe_hnd.c will take care */
2752 return true;
2755 if (DEBUGLEVEL >= 10) {
2756 NDR_PRINT_OUT_DEBUG(samr_OpenUser, r);
2759 push = ndr_push_init_ctx(r, NULL);
2760 if (push == NULL) {
2761 talloc_free(r);
2762 return false;
2765 ndr_err = call->ndr_push(push, NDR_OUT, r);
2766 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2767 talloc_free(r);
2768 return false;
2771 blob = ndr_push_blob(push);
2772 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2773 talloc_free(r);
2774 return false;
2777 talloc_free(r);
2779 return true;
2782 static bool api_samr_DeleteUser(pipes_struct *p)
2784 const struct ndr_interface_call *call;
2785 struct ndr_pull *pull;
2786 struct ndr_push *push;
2787 enum ndr_err_code ndr_err;
2788 DATA_BLOB blob;
2789 struct samr_DeleteUser *r;
2791 call = &ndr_table_samr.calls[NDR_SAMR_DELETEUSER];
2793 r = talloc(talloc_tos(), struct samr_DeleteUser);
2794 if (r == NULL) {
2795 return false;
2798 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2799 talloc_free(r);
2800 return false;
2803 pull = ndr_pull_init_blob(&blob, r, NULL);
2804 if (pull == NULL) {
2805 talloc_free(r);
2806 return false;
2809 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2810 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2811 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2812 talloc_free(r);
2813 return false;
2816 if (DEBUGLEVEL >= 10) {
2817 NDR_PRINT_IN_DEBUG(samr_DeleteUser, r);
2820 ZERO_STRUCT(r->out);
2821 r->out.user_handle = r->in.user_handle;
2822 r->out.result = _samr_DeleteUser(p, r);
2824 if (p->rng_fault_state) {
2825 talloc_free(r);
2826 /* Return true here, srv_pipe_hnd.c will take care */
2827 return true;
2830 if (DEBUGLEVEL >= 10) {
2831 NDR_PRINT_OUT_DEBUG(samr_DeleteUser, r);
2834 push = ndr_push_init_ctx(r, NULL);
2835 if (push == NULL) {
2836 talloc_free(r);
2837 return false;
2840 ndr_err = call->ndr_push(push, NDR_OUT, r);
2841 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2842 talloc_free(r);
2843 return false;
2846 blob = ndr_push_blob(push);
2847 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2848 talloc_free(r);
2849 return false;
2852 talloc_free(r);
2854 return true;
2857 static bool api_samr_QueryUserInfo(pipes_struct *p)
2859 const struct ndr_interface_call *call;
2860 struct ndr_pull *pull;
2861 struct ndr_push *push;
2862 enum ndr_err_code ndr_err;
2863 DATA_BLOB blob;
2864 struct samr_QueryUserInfo *r;
2866 call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO];
2868 r = talloc(talloc_tos(), struct samr_QueryUserInfo);
2869 if (r == NULL) {
2870 return false;
2873 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2874 talloc_free(r);
2875 return false;
2878 pull = ndr_pull_init_blob(&blob, r, NULL);
2879 if (pull == NULL) {
2880 talloc_free(r);
2881 return false;
2884 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2885 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2886 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2887 talloc_free(r);
2888 return false;
2891 if (DEBUGLEVEL >= 10) {
2892 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, r);
2895 ZERO_STRUCT(r->out);
2896 r->out.info = talloc_zero(r, union samr_UserInfo *);
2897 if (r->out.info == NULL) {
2898 talloc_free(r);
2899 return false;
2902 r->out.result = _samr_QueryUserInfo(p, r);
2904 if (p->rng_fault_state) {
2905 talloc_free(r);
2906 /* Return true here, srv_pipe_hnd.c will take care */
2907 return true;
2910 if (DEBUGLEVEL >= 10) {
2911 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, r);
2914 push = ndr_push_init_ctx(r, NULL);
2915 if (push == NULL) {
2916 talloc_free(r);
2917 return false;
2920 ndr_err = call->ndr_push(push, NDR_OUT, r);
2921 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2922 talloc_free(r);
2923 return false;
2926 blob = ndr_push_blob(push);
2927 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2928 talloc_free(r);
2929 return false;
2932 talloc_free(r);
2934 return true;
2937 static bool api_samr_SetUserInfo(pipes_struct *p)
2939 const struct ndr_interface_call *call;
2940 struct ndr_pull *pull;
2941 struct ndr_push *push;
2942 enum ndr_err_code ndr_err;
2943 DATA_BLOB blob;
2944 struct samr_SetUserInfo *r;
2946 call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO];
2948 r = talloc(talloc_tos(), struct samr_SetUserInfo);
2949 if (r == NULL) {
2950 return false;
2953 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2954 talloc_free(r);
2955 return false;
2958 pull = ndr_pull_init_blob(&blob, r, NULL);
2959 if (pull == NULL) {
2960 talloc_free(r);
2961 return false;
2964 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2965 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2966 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2967 talloc_free(r);
2968 return false;
2971 if (DEBUGLEVEL >= 10) {
2972 NDR_PRINT_IN_DEBUG(samr_SetUserInfo, r);
2975 r->out.result = _samr_SetUserInfo(p, r);
2977 if (p->rng_fault_state) {
2978 talloc_free(r);
2979 /* Return true here, srv_pipe_hnd.c will take care */
2980 return true;
2983 if (DEBUGLEVEL >= 10) {
2984 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, r);
2987 push = ndr_push_init_ctx(r, NULL);
2988 if (push == NULL) {
2989 talloc_free(r);
2990 return false;
2993 ndr_err = call->ndr_push(push, NDR_OUT, r);
2994 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2995 talloc_free(r);
2996 return false;
2999 blob = ndr_push_blob(push);
3000 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3001 talloc_free(r);
3002 return false;
3005 talloc_free(r);
3007 return true;
3010 static bool api_samr_ChangePasswordUser(pipes_struct *p)
3012 const struct ndr_interface_call *call;
3013 struct ndr_pull *pull;
3014 struct ndr_push *push;
3015 enum ndr_err_code ndr_err;
3016 DATA_BLOB blob;
3017 struct samr_ChangePasswordUser *r;
3019 call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER];
3021 r = talloc(talloc_tos(), struct samr_ChangePasswordUser);
3022 if (r == NULL) {
3023 return false;
3026 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3027 talloc_free(r);
3028 return false;
3031 pull = ndr_pull_init_blob(&blob, r, NULL);
3032 if (pull == NULL) {
3033 talloc_free(r);
3034 return false;
3037 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3038 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3039 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3040 talloc_free(r);
3041 return false;
3044 if (DEBUGLEVEL >= 10) {
3045 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, r);
3048 r->out.result = _samr_ChangePasswordUser(p, r);
3050 if (p->rng_fault_state) {
3051 talloc_free(r);
3052 /* Return true here, srv_pipe_hnd.c will take care */
3053 return true;
3056 if (DEBUGLEVEL >= 10) {
3057 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, r);
3060 push = ndr_push_init_ctx(r, NULL);
3061 if (push == NULL) {
3062 talloc_free(r);
3063 return false;
3066 ndr_err = call->ndr_push(push, NDR_OUT, r);
3067 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3068 talloc_free(r);
3069 return false;
3072 blob = ndr_push_blob(push);
3073 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3074 talloc_free(r);
3075 return false;
3078 talloc_free(r);
3080 return true;
3083 static bool api_samr_GetGroupsForUser(pipes_struct *p)
3085 const struct ndr_interface_call *call;
3086 struct ndr_pull *pull;
3087 struct ndr_push *push;
3088 enum ndr_err_code ndr_err;
3089 DATA_BLOB blob;
3090 struct samr_GetGroupsForUser *r;
3092 call = &ndr_table_samr.calls[NDR_SAMR_GETGROUPSFORUSER];
3094 r = talloc(talloc_tos(), struct samr_GetGroupsForUser);
3095 if (r == NULL) {
3096 return false;
3099 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3100 talloc_free(r);
3101 return false;
3104 pull = ndr_pull_init_blob(&blob, r, NULL);
3105 if (pull == NULL) {
3106 talloc_free(r);
3107 return false;
3110 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3111 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3112 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3113 talloc_free(r);
3114 return false;
3117 if (DEBUGLEVEL >= 10) {
3118 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, r);
3121 ZERO_STRUCT(r->out);
3122 r->out.rids = talloc_zero(r, struct samr_RidWithAttributeArray *);
3123 if (r->out.rids == NULL) {
3124 talloc_free(r);
3125 return false;
3128 r->out.result = _samr_GetGroupsForUser(p, r);
3130 if (p->rng_fault_state) {
3131 talloc_free(r);
3132 /* Return true here, srv_pipe_hnd.c will take care */
3133 return true;
3136 if (DEBUGLEVEL >= 10) {
3137 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, r);
3140 push = ndr_push_init_ctx(r, NULL);
3141 if (push == NULL) {
3142 talloc_free(r);
3143 return false;
3146 ndr_err = call->ndr_push(push, NDR_OUT, r);
3147 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3148 talloc_free(r);
3149 return false;
3152 blob = ndr_push_blob(push);
3153 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3154 talloc_free(r);
3155 return false;
3158 talloc_free(r);
3160 return true;
3163 static bool api_samr_QueryDisplayInfo(pipes_struct *p)
3165 const struct ndr_interface_call *call;
3166 struct ndr_pull *pull;
3167 struct ndr_push *push;
3168 enum ndr_err_code ndr_err;
3169 DATA_BLOB blob;
3170 struct samr_QueryDisplayInfo *r;
3172 call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO];
3174 r = talloc(talloc_tos(), struct samr_QueryDisplayInfo);
3175 if (r == NULL) {
3176 return false;
3179 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3180 talloc_free(r);
3181 return false;
3184 pull = ndr_pull_init_blob(&blob, r, NULL);
3185 if (pull == NULL) {
3186 talloc_free(r);
3187 return false;
3190 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3191 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3192 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3193 talloc_free(r);
3194 return false;
3197 if (DEBUGLEVEL >= 10) {
3198 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, r);
3201 ZERO_STRUCT(r->out);
3202 r->out.total_size = talloc_zero(r, uint32_t);
3203 if (r->out.total_size == NULL) {
3204 talloc_free(r);
3205 return false;
3208 r->out.returned_size = talloc_zero(r, uint32_t);
3209 if (r->out.returned_size == NULL) {
3210 talloc_free(r);
3211 return false;
3214 r->out.info = talloc_zero(r, union samr_DispInfo);
3215 if (r->out.info == NULL) {
3216 talloc_free(r);
3217 return false;
3220 r->out.result = _samr_QueryDisplayInfo(p, r);
3222 if (p->rng_fault_state) {
3223 talloc_free(r);
3224 /* Return true here, srv_pipe_hnd.c will take care */
3225 return true;
3228 if (DEBUGLEVEL >= 10) {
3229 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, r);
3232 push = ndr_push_init_ctx(r, NULL);
3233 if (push == NULL) {
3234 talloc_free(r);
3235 return false;
3238 ndr_err = call->ndr_push(push, NDR_OUT, r);
3239 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3240 talloc_free(r);
3241 return false;
3244 blob = ndr_push_blob(push);
3245 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3246 talloc_free(r);
3247 return false;
3250 talloc_free(r);
3252 return true;
3255 static bool api_samr_GetDisplayEnumerationIndex(pipes_struct *p)
3257 const struct ndr_interface_call *call;
3258 struct ndr_pull *pull;
3259 struct ndr_push *push;
3260 enum ndr_err_code ndr_err;
3261 DATA_BLOB blob;
3262 struct samr_GetDisplayEnumerationIndex *r;
3264 call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX];
3266 r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex);
3267 if (r == NULL) {
3268 return false;
3271 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3272 talloc_free(r);
3273 return false;
3276 pull = ndr_pull_init_blob(&blob, r, NULL);
3277 if (pull == NULL) {
3278 talloc_free(r);
3279 return false;
3282 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3283 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3284 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3285 talloc_free(r);
3286 return false;
3289 if (DEBUGLEVEL >= 10) {
3290 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, r);
3293 ZERO_STRUCT(r->out);
3294 r->out.idx = talloc_zero(r, uint32_t);
3295 if (r->out.idx == NULL) {
3296 talloc_free(r);
3297 return false;
3300 r->out.result = _samr_GetDisplayEnumerationIndex(p, r);
3302 if (p->rng_fault_state) {
3303 talloc_free(r);
3304 /* Return true here, srv_pipe_hnd.c will take care */
3305 return true;
3308 if (DEBUGLEVEL >= 10) {
3309 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, r);
3312 push = ndr_push_init_ctx(r, NULL);
3313 if (push == NULL) {
3314 talloc_free(r);
3315 return false;
3318 ndr_err = call->ndr_push(push, NDR_OUT, r);
3319 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3320 talloc_free(r);
3321 return false;
3324 blob = ndr_push_blob(push);
3325 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3326 talloc_free(r);
3327 return false;
3330 talloc_free(r);
3332 return true;
3335 static bool api_samr_TestPrivateFunctionsDomain(pipes_struct *p)
3337 const struct ndr_interface_call *call;
3338 struct ndr_pull *pull;
3339 struct ndr_push *push;
3340 enum ndr_err_code ndr_err;
3341 DATA_BLOB blob;
3342 struct samr_TestPrivateFunctionsDomain *r;
3344 call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN];
3346 r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsDomain);
3347 if (r == NULL) {
3348 return false;
3351 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3352 talloc_free(r);
3353 return false;
3356 pull = ndr_pull_init_blob(&blob, r, NULL);
3357 if (pull == NULL) {
3358 talloc_free(r);
3359 return false;
3362 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3363 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3364 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3365 talloc_free(r);
3366 return false;
3369 if (DEBUGLEVEL >= 10) {
3370 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, r);
3373 r->out.result = _samr_TestPrivateFunctionsDomain(p, r);
3375 if (p->rng_fault_state) {
3376 talloc_free(r);
3377 /* Return true here, srv_pipe_hnd.c will take care */
3378 return true;
3381 if (DEBUGLEVEL >= 10) {
3382 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, r);
3385 push = ndr_push_init_ctx(r, NULL);
3386 if (push == NULL) {
3387 talloc_free(r);
3388 return false;
3391 ndr_err = call->ndr_push(push, NDR_OUT, r);
3392 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3393 talloc_free(r);
3394 return false;
3397 blob = ndr_push_blob(push);
3398 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3399 talloc_free(r);
3400 return false;
3403 talloc_free(r);
3405 return true;
3408 static bool api_samr_TestPrivateFunctionsUser(pipes_struct *p)
3410 const struct ndr_interface_call *call;
3411 struct ndr_pull *pull;
3412 struct ndr_push *push;
3413 enum ndr_err_code ndr_err;
3414 DATA_BLOB blob;
3415 struct samr_TestPrivateFunctionsUser *r;
3417 call = &ndr_table_samr.calls[NDR_SAMR_TESTPRIVATEFUNCTIONSUSER];
3419 r = talloc(talloc_tos(), struct samr_TestPrivateFunctionsUser);
3420 if (r == NULL) {
3421 return false;
3424 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3425 talloc_free(r);
3426 return false;
3429 pull = ndr_pull_init_blob(&blob, r, NULL);
3430 if (pull == NULL) {
3431 talloc_free(r);
3432 return false;
3435 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3436 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3437 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3438 talloc_free(r);
3439 return false;
3442 if (DEBUGLEVEL >= 10) {
3443 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, r);
3446 r->out.result = _samr_TestPrivateFunctionsUser(p, r);
3448 if (p->rng_fault_state) {
3449 talloc_free(r);
3450 /* Return true here, srv_pipe_hnd.c will take care */
3451 return true;
3454 if (DEBUGLEVEL >= 10) {
3455 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, r);
3458 push = ndr_push_init_ctx(r, NULL);
3459 if (push == NULL) {
3460 talloc_free(r);
3461 return false;
3464 ndr_err = call->ndr_push(push, NDR_OUT, r);
3465 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3466 talloc_free(r);
3467 return false;
3470 blob = ndr_push_blob(push);
3471 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3472 talloc_free(r);
3473 return false;
3476 talloc_free(r);
3478 return true;
3481 static bool api_samr_GetUserPwInfo(pipes_struct *p)
3483 const struct ndr_interface_call *call;
3484 struct ndr_pull *pull;
3485 struct ndr_push *push;
3486 enum ndr_err_code ndr_err;
3487 DATA_BLOB blob;
3488 struct samr_GetUserPwInfo *r;
3490 call = &ndr_table_samr.calls[NDR_SAMR_GETUSERPWINFO];
3492 r = talloc(talloc_tos(), struct samr_GetUserPwInfo);
3493 if (r == NULL) {
3494 return false;
3497 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3498 talloc_free(r);
3499 return false;
3502 pull = ndr_pull_init_blob(&blob, r, NULL);
3503 if (pull == NULL) {
3504 talloc_free(r);
3505 return false;
3508 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3509 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3510 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3511 talloc_free(r);
3512 return false;
3515 if (DEBUGLEVEL >= 10) {
3516 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, r);
3519 ZERO_STRUCT(r->out);
3520 r->out.info = talloc_zero(r, struct samr_PwInfo);
3521 if (r->out.info == NULL) {
3522 talloc_free(r);
3523 return false;
3526 r->out.result = _samr_GetUserPwInfo(p, r);
3528 if (p->rng_fault_state) {
3529 talloc_free(r);
3530 /* Return true here, srv_pipe_hnd.c will take care */
3531 return true;
3534 if (DEBUGLEVEL >= 10) {
3535 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, r);
3538 push = ndr_push_init_ctx(r, NULL);
3539 if (push == NULL) {
3540 talloc_free(r);
3541 return false;
3544 ndr_err = call->ndr_push(push, NDR_OUT, r);
3545 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3546 talloc_free(r);
3547 return false;
3550 blob = ndr_push_blob(push);
3551 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3552 talloc_free(r);
3553 return false;
3556 talloc_free(r);
3558 return true;
3561 static bool api_samr_RemoveMemberFromForeignDomain(pipes_struct *p)
3563 const struct ndr_interface_call *call;
3564 struct ndr_pull *pull;
3565 struct ndr_push *push;
3566 enum ndr_err_code ndr_err;
3567 DATA_BLOB blob;
3568 struct samr_RemoveMemberFromForeignDomain *r;
3570 call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN];
3572 r = talloc(talloc_tos(), struct samr_RemoveMemberFromForeignDomain);
3573 if (r == NULL) {
3574 return false;
3577 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3578 talloc_free(r);
3579 return false;
3582 pull = ndr_pull_init_blob(&blob, r, NULL);
3583 if (pull == NULL) {
3584 talloc_free(r);
3585 return false;
3588 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3589 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3590 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3591 talloc_free(r);
3592 return false;
3595 if (DEBUGLEVEL >= 10) {
3596 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, r);
3599 r->out.result = _samr_RemoveMemberFromForeignDomain(p, r);
3601 if (p->rng_fault_state) {
3602 talloc_free(r);
3603 /* Return true here, srv_pipe_hnd.c will take care */
3604 return true;
3607 if (DEBUGLEVEL >= 10) {
3608 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, r);
3611 push = ndr_push_init_ctx(r, NULL);
3612 if (push == NULL) {
3613 talloc_free(r);
3614 return false;
3617 ndr_err = call->ndr_push(push, NDR_OUT, r);
3618 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3619 talloc_free(r);
3620 return false;
3623 blob = ndr_push_blob(push);
3624 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3625 talloc_free(r);
3626 return false;
3629 talloc_free(r);
3631 return true;
3634 static bool api_samr_QueryDomainInfo2(pipes_struct *p)
3636 const struct ndr_interface_call *call;
3637 struct ndr_pull *pull;
3638 struct ndr_push *push;
3639 enum ndr_err_code ndr_err;
3640 DATA_BLOB blob;
3641 struct samr_QueryDomainInfo2 *r;
3643 call = &ndr_table_samr.calls[NDR_SAMR_QUERYDOMAININFO2];
3645 r = talloc(talloc_tos(), struct samr_QueryDomainInfo2);
3646 if (r == NULL) {
3647 return false;
3650 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3651 talloc_free(r);
3652 return false;
3655 pull = ndr_pull_init_blob(&blob, r, NULL);
3656 if (pull == NULL) {
3657 talloc_free(r);
3658 return false;
3661 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3662 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3663 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3664 talloc_free(r);
3665 return false;
3668 if (DEBUGLEVEL >= 10) {
3669 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, r);
3672 ZERO_STRUCT(r->out);
3673 r->out.info = talloc_zero(r, union samr_DomainInfo *);
3674 if (r->out.info == NULL) {
3675 talloc_free(r);
3676 return false;
3679 r->out.result = _samr_QueryDomainInfo2(p, r);
3681 if (p->rng_fault_state) {
3682 talloc_free(r);
3683 /* Return true here, srv_pipe_hnd.c will take care */
3684 return true;
3687 if (DEBUGLEVEL >= 10) {
3688 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, r);
3691 push = ndr_push_init_ctx(r, NULL);
3692 if (push == NULL) {
3693 talloc_free(r);
3694 return false;
3697 ndr_err = call->ndr_push(push, NDR_OUT, r);
3698 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3699 talloc_free(r);
3700 return false;
3703 blob = ndr_push_blob(push);
3704 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3705 talloc_free(r);
3706 return false;
3709 talloc_free(r);
3711 return true;
3714 static bool api_samr_QueryUserInfo2(pipes_struct *p)
3716 const struct ndr_interface_call *call;
3717 struct ndr_pull *pull;
3718 struct ndr_push *push;
3719 enum ndr_err_code ndr_err;
3720 DATA_BLOB blob;
3721 struct samr_QueryUserInfo2 *r;
3723 call = &ndr_table_samr.calls[NDR_SAMR_QUERYUSERINFO2];
3725 r = talloc(talloc_tos(), struct samr_QueryUserInfo2);
3726 if (r == NULL) {
3727 return false;
3730 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3731 talloc_free(r);
3732 return false;
3735 pull = ndr_pull_init_blob(&blob, r, NULL);
3736 if (pull == NULL) {
3737 talloc_free(r);
3738 return false;
3741 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3742 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3743 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3744 talloc_free(r);
3745 return false;
3748 if (DEBUGLEVEL >= 10) {
3749 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, r);
3752 ZERO_STRUCT(r->out);
3753 r->out.info = talloc_zero(r, union samr_UserInfo *);
3754 if (r->out.info == NULL) {
3755 talloc_free(r);
3756 return false;
3759 r->out.result = _samr_QueryUserInfo2(p, r);
3761 if (p->rng_fault_state) {
3762 talloc_free(r);
3763 /* Return true here, srv_pipe_hnd.c will take care */
3764 return true;
3767 if (DEBUGLEVEL >= 10) {
3768 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, r);
3771 push = ndr_push_init_ctx(r, NULL);
3772 if (push == NULL) {
3773 talloc_free(r);
3774 return false;
3777 ndr_err = call->ndr_push(push, NDR_OUT, r);
3778 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3779 talloc_free(r);
3780 return false;
3783 blob = ndr_push_blob(push);
3784 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3785 talloc_free(r);
3786 return false;
3789 talloc_free(r);
3791 return true;
3794 static bool api_samr_QueryDisplayInfo2(pipes_struct *p)
3796 const struct ndr_interface_call *call;
3797 struct ndr_pull *pull;
3798 struct ndr_push *push;
3799 enum ndr_err_code ndr_err;
3800 DATA_BLOB blob;
3801 struct samr_QueryDisplayInfo2 *r;
3803 call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO2];
3805 r = talloc(talloc_tos(), struct samr_QueryDisplayInfo2);
3806 if (r == NULL) {
3807 return false;
3810 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3811 talloc_free(r);
3812 return false;
3815 pull = ndr_pull_init_blob(&blob, r, NULL);
3816 if (pull == NULL) {
3817 talloc_free(r);
3818 return false;
3821 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3822 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3823 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3824 talloc_free(r);
3825 return false;
3828 if (DEBUGLEVEL >= 10) {
3829 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, r);
3832 ZERO_STRUCT(r->out);
3833 r->out.total_size = talloc_zero(r, uint32_t);
3834 if (r->out.total_size == NULL) {
3835 talloc_free(r);
3836 return false;
3839 r->out.returned_size = talloc_zero(r, uint32_t);
3840 if (r->out.returned_size == NULL) {
3841 talloc_free(r);
3842 return false;
3845 r->out.info = talloc_zero(r, union samr_DispInfo);
3846 if (r->out.info == NULL) {
3847 talloc_free(r);
3848 return false;
3851 r->out.result = _samr_QueryDisplayInfo2(p, r);
3853 if (p->rng_fault_state) {
3854 talloc_free(r);
3855 /* Return true here, srv_pipe_hnd.c will take care */
3856 return true;
3859 if (DEBUGLEVEL >= 10) {
3860 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, r);
3863 push = ndr_push_init_ctx(r, NULL);
3864 if (push == NULL) {
3865 talloc_free(r);
3866 return false;
3869 ndr_err = call->ndr_push(push, NDR_OUT, r);
3870 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3871 talloc_free(r);
3872 return false;
3875 blob = ndr_push_blob(push);
3876 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3877 talloc_free(r);
3878 return false;
3881 talloc_free(r);
3883 return true;
3886 static bool api_samr_GetDisplayEnumerationIndex2(pipes_struct *p)
3888 const struct ndr_interface_call *call;
3889 struct ndr_pull *pull;
3890 struct ndr_push *push;
3891 enum ndr_err_code ndr_err;
3892 DATA_BLOB blob;
3893 struct samr_GetDisplayEnumerationIndex2 *r;
3895 call = &ndr_table_samr.calls[NDR_SAMR_GETDISPLAYENUMERATIONINDEX2];
3897 r = talloc(talloc_tos(), struct samr_GetDisplayEnumerationIndex2);
3898 if (r == NULL) {
3899 return false;
3902 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3903 talloc_free(r);
3904 return false;
3907 pull = ndr_pull_init_blob(&blob, r, NULL);
3908 if (pull == NULL) {
3909 talloc_free(r);
3910 return false;
3913 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3914 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3915 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3916 talloc_free(r);
3917 return false;
3920 if (DEBUGLEVEL >= 10) {
3921 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, r);
3924 ZERO_STRUCT(r->out);
3925 r->out.idx = talloc_zero(r, uint32_t);
3926 if (r->out.idx == NULL) {
3927 talloc_free(r);
3928 return false;
3931 r->out.result = _samr_GetDisplayEnumerationIndex2(p, r);
3933 if (p->rng_fault_state) {
3934 talloc_free(r);
3935 /* Return true here, srv_pipe_hnd.c will take care */
3936 return true;
3939 if (DEBUGLEVEL >= 10) {
3940 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, r);
3943 push = ndr_push_init_ctx(r, NULL);
3944 if (push == NULL) {
3945 talloc_free(r);
3946 return false;
3949 ndr_err = call->ndr_push(push, NDR_OUT, r);
3950 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3951 talloc_free(r);
3952 return false;
3955 blob = ndr_push_blob(push);
3956 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3957 talloc_free(r);
3958 return false;
3961 talloc_free(r);
3963 return true;
3966 static bool api_samr_CreateUser2(pipes_struct *p)
3968 const struct ndr_interface_call *call;
3969 struct ndr_pull *pull;
3970 struct ndr_push *push;
3971 enum ndr_err_code ndr_err;
3972 DATA_BLOB blob;
3973 struct samr_CreateUser2 *r;
3975 call = &ndr_table_samr.calls[NDR_SAMR_CREATEUSER2];
3977 r = talloc(talloc_tos(), struct samr_CreateUser2);
3978 if (r == NULL) {
3979 return false;
3982 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3983 talloc_free(r);
3984 return false;
3987 pull = ndr_pull_init_blob(&blob, r, NULL);
3988 if (pull == NULL) {
3989 talloc_free(r);
3990 return false;
3993 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3994 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3995 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3996 talloc_free(r);
3997 return false;
4000 if (DEBUGLEVEL >= 10) {
4001 NDR_PRINT_IN_DEBUG(samr_CreateUser2, r);
4004 ZERO_STRUCT(r->out);
4005 r->out.user_handle = talloc_zero(r, struct policy_handle);
4006 if (r->out.user_handle == NULL) {
4007 talloc_free(r);
4008 return false;
4011 r->out.access_granted = talloc_zero(r, uint32_t);
4012 if (r->out.access_granted == NULL) {
4013 talloc_free(r);
4014 return false;
4017 r->out.rid = talloc_zero(r, uint32_t);
4018 if (r->out.rid == NULL) {
4019 talloc_free(r);
4020 return false;
4023 r->out.result = _samr_CreateUser2(p, r);
4025 if (p->rng_fault_state) {
4026 talloc_free(r);
4027 /* Return true here, srv_pipe_hnd.c will take care */
4028 return true;
4031 if (DEBUGLEVEL >= 10) {
4032 NDR_PRINT_OUT_DEBUG(samr_CreateUser2, r);
4035 push = ndr_push_init_ctx(r, NULL);
4036 if (push == NULL) {
4037 talloc_free(r);
4038 return false;
4041 ndr_err = call->ndr_push(push, NDR_OUT, r);
4042 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4043 talloc_free(r);
4044 return false;
4047 blob = ndr_push_blob(push);
4048 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4049 talloc_free(r);
4050 return false;
4053 talloc_free(r);
4055 return true;
4058 static bool api_samr_QueryDisplayInfo3(pipes_struct *p)
4060 const struct ndr_interface_call *call;
4061 struct ndr_pull *pull;
4062 struct ndr_push *push;
4063 enum ndr_err_code ndr_err;
4064 DATA_BLOB blob;
4065 struct samr_QueryDisplayInfo3 *r;
4067 call = &ndr_table_samr.calls[NDR_SAMR_QUERYDISPLAYINFO3];
4069 r = talloc(talloc_tos(), struct samr_QueryDisplayInfo3);
4070 if (r == NULL) {
4071 return false;
4074 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4075 talloc_free(r);
4076 return false;
4079 pull = ndr_pull_init_blob(&blob, r, NULL);
4080 if (pull == NULL) {
4081 talloc_free(r);
4082 return false;
4085 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4086 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4087 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4088 talloc_free(r);
4089 return false;
4092 if (DEBUGLEVEL >= 10) {
4093 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, r);
4096 ZERO_STRUCT(r->out);
4097 r->out.total_size = talloc_zero(r, uint32_t);
4098 if (r->out.total_size == NULL) {
4099 talloc_free(r);
4100 return false;
4103 r->out.returned_size = talloc_zero(r, uint32_t);
4104 if (r->out.returned_size == NULL) {
4105 talloc_free(r);
4106 return false;
4109 r->out.info = talloc_zero(r, union samr_DispInfo);
4110 if (r->out.info == NULL) {
4111 talloc_free(r);
4112 return false;
4115 r->out.result = _samr_QueryDisplayInfo3(p, r);
4117 if (p->rng_fault_state) {
4118 talloc_free(r);
4119 /* Return true here, srv_pipe_hnd.c will take care */
4120 return true;
4123 if (DEBUGLEVEL >= 10) {
4124 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, r);
4127 push = ndr_push_init_ctx(r, NULL);
4128 if (push == NULL) {
4129 talloc_free(r);
4130 return false;
4133 ndr_err = call->ndr_push(push, NDR_OUT, r);
4134 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4135 talloc_free(r);
4136 return false;
4139 blob = ndr_push_blob(push);
4140 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4141 talloc_free(r);
4142 return false;
4145 talloc_free(r);
4147 return true;
4150 static bool api_samr_AddMultipleMembersToAlias(pipes_struct *p)
4152 const struct ndr_interface_call *call;
4153 struct ndr_pull *pull;
4154 struct ndr_push *push;
4155 enum ndr_err_code ndr_err;
4156 DATA_BLOB blob;
4157 struct samr_AddMultipleMembersToAlias *r;
4159 call = &ndr_table_samr.calls[NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS];
4161 r = talloc(talloc_tos(), struct samr_AddMultipleMembersToAlias);
4162 if (r == NULL) {
4163 return false;
4166 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4167 talloc_free(r);
4168 return false;
4171 pull = ndr_pull_init_blob(&blob, r, NULL);
4172 if (pull == NULL) {
4173 talloc_free(r);
4174 return false;
4177 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4178 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4179 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4180 talloc_free(r);
4181 return false;
4184 if (DEBUGLEVEL >= 10) {
4185 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, r);
4188 r->out.result = _samr_AddMultipleMembersToAlias(p, r);
4190 if (p->rng_fault_state) {
4191 talloc_free(r);
4192 /* Return true here, srv_pipe_hnd.c will take care */
4193 return true;
4196 if (DEBUGLEVEL >= 10) {
4197 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, r);
4200 push = ndr_push_init_ctx(r, NULL);
4201 if (push == NULL) {
4202 talloc_free(r);
4203 return false;
4206 ndr_err = call->ndr_push(push, NDR_OUT, r);
4207 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4208 talloc_free(r);
4209 return false;
4212 blob = ndr_push_blob(push);
4213 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4214 talloc_free(r);
4215 return false;
4218 talloc_free(r);
4220 return true;
4223 static bool api_samr_RemoveMultipleMembersFromAlias(pipes_struct *p)
4225 const struct ndr_interface_call *call;
4226 struct ndr_pull *pull;
4227 struct ndr_push *push;
4228 enum ndr_err_code ndr_err;
4229 DATA_BLOB blob;
4230 struct samr_RemoveMultipleMembersFromAlias *r;
4232 call = &ndr_table_samr.calls[NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS];
4234 r = talloc(talloc_tos(), struct samr_RemoveMultipleMembersFromAlias);
4235 if (r == NULL) {
4236 return false;
4239 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4240 talloc_free(r);
4241 return false;
4244 pull = ndr_pull_init_blob(&blob, r, NULL);
4245 if (pull == NULL) {
4246 talloc_free(r);
4247 return false;
4250 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4251 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4252 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4253 talloc_free(r);
4254 return false;
4257 if (DEBUGLEVEL >= 10) {
4258 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, r);
4261 r->out.result = _samr_RemoveMultipleMembersFromAlias(p, r);
4263 if (p->rng_fault_state) {
4264 talloc_free(r);
4265 /* Return true here, srv_pipe_hnd.c will take care */
4266 return true;
4269 if (DEBUGLEVEL >= 10) {
4270 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, r);
4273 push = ndr_push_init_ctx(r, NULL);
4274 if (push == NULL) {
4275 talloc_free(r);
4276 return false;
4279 ndr_err = call->ndr_push(push, NDR_OUT, r);
4280 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4281 talloc_free(r);
4282 return false;
4285 blob = ndr_push_blob(push);
4286 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4287 talloc_free(r);
4288 return false;
4291 talloc_free(r);
4293 return true;
4296 static bool api_samr_OemChangePasswordUser2(pipes_struct *p)
4298 const struct ndr_interface_call *call;
4299 struct ndr_pull *pull;
4300 struct ndr_push *push;
4301 enum ndr_err_code ndr_err;
4302 DATA_BLOB blob;
4303 struct samr_OemChangePasswordUser2 *r;
4305 call = &ndr_table_samr.calls[NDR_SAMR_OEMCHANGEPASSWORDUSER2];
4307 r = talloc(talloc_tos(), struct samr_OemChangePasswordUser2);
4308 if (r == NULL) {
4309 return false;
4312 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4313 talloc_free(r);
4314 return false;
4317 pull = ndr_pull_init_blob(&blob, r, NULL);
4318 if (pull == NULL) {
4319 talloc_free(r);
4320 return false;
4323 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4324 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4325 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4326 talloc_free(r);
4327 return false;
4330 if (DEBUGLEVEL >= 10) {
4331 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, r);
4334 r->out.result = _samr_OemChangePasswordUser2(p, r);
4336 if (p->rng_fault_state) {
4337 talloc_free(r);
4338 /* Return true here, srv_pipe_hnd.c will take care */
4339 return true;
4342 if (DEBUGLEVEL >= 10) {
4343 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, r);
4346 push = ndr_push_init_ctx(r, NULL);
4347 if (push == NULL) {
4348 talloc_free(r);
4349 return false;
4352 ndr_err = call->ndr_push(push, NDR_OUT, r);
4353 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4354 talloc_free(r);
4355 return false;
4358 blob = ndr_push_blob(push);
4359 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4360 talloc_free(r);
4361 return false;
4364 talloc_free(r);
4366 return true;
4369 static bool api_samr_ChangePasswordUser2(pipes_struct *p)
4371 const struct ndr_interface_call *call;
4372 struct ndr_pull *pull;
4373 struct ndr_push *push;
4374 enum ndr_err_code ndr_err;
4375 DATA_BLOB blob;
4376 struct samr_ChangePasswordUser2 *r;
4378 call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER2];
4380 r = talloc(talloc_tos(), struct samr_ChangePasswordUser2);
4381 if (r == NULL) {
4382 return false;
4385 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4386 talloc_free(r);
4387 return false;
4390 pull = ndr_pull_init_blob(&blob, r, NULL);
4391 if (pull == NULL) {
4392 talloc_free(r);
4393 return false;
4396 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4397 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4398 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4399 talloc_free(r);
4400 return false;
4403 if (DEBUGLEVEL >= 10) {
4404 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, r);
4407 r->out.result = _samr_ChangePasswordUser2(p, r);
4409 if (p->rng_fault_state) {
4410 talloc_free(r);
4411 /* Return true here, srv_pipe_hnd.c will take care */
4412 return true;
4415 if (DEBUGLEVEL >= 10) {
4416 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, r);
4419 push = ndr_push_init_ctx(r, NULL);
4420 if (push == NULL) {
4421 talloc_free(r);
4422 return false;
4425 ndr_err = call->ndr_push(push, NDR_OUT, r);
4426 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4427 talloc_free(r);
4428 return false;
4431 blob = ndr_push_blob(push);
4432 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4433 talloc_free(r);
4434 return false;
4437 talloc_free(r);
4439 return true;
4442 static bool api_samr_GetDomPwInfo(pipes_struct *p)
4444 const struct ndr_interface_call *call;
4445 struct ndr_pull *pull;
4446 struct ndr_push *push;
4447 enum ndr_err_code ndr_err;
4448 DATA_BLOB blob;
4449 struct samr_GetDomPwInfo *r;
4451 call = &ndr_table_samr.calls[NDR_SAMR_GETDOMPWINFO];
4453 r = talloc(talloc_tos(), struct samr_GetDomPwInfo);
4454 if (r == NULL) {
4455 return false;
4458 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4459 talloc_free(r);
4460 return false;
4463 pull = ndr_pull_init_blob(&blob, r, NULL);
4464 if (pull == NULL) {
4465 talloc_free(r);
4466 return false;
4469 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4470 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4471 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4472 talloc_free(r);
4473 return false;
4476 if (DEBUGLEVEL >= 10) {
4477 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, r);
4480 ZERO_STRUCT(r->out);
4481 r->out.info = talloc_zero(r, struct samr_PwInfo);
4482 if (r->out.info == NULL) {
4483 talloc_free(r);
4484 return false;
4487 r->out.result = _samr_GetDomPwInfo(p, r);
4489 if (p->rng_fault_state) {
4490 talloc_free(r);
4491 /* Return true here, srv_pipe_hnd.c will take care */
4492 return true;
4495 if (DEBUGLEVEL >= 10) {
4496 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, r);
4499 push = ndr_push_init_ctx(r, NULL);
4500 if (push == NULL) {
4501 talloc_free(r);
4502 return false;
4505 ndr_err = call->ndr_push(push, NDR_OUT, r);
4506 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4507 talloc_free(r);
4508 return false;
4511 blob = ndr_push_blob(push);
4512 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4513 talloc_free(r);
4514 return false;
4517 talloc_free(r);
4519 return true;
4522 static bool api_samr_Connect2(pipes_struct *p)
4524 const struct ndr_interface_call *call;
4525 struct ndr_pull *pull;
4526 struct ndr_push *push;
4527 enum ndr_err_code ndr_err;
4528 DATA_BLOB blob;
4529 struct samr_Connect2 *r;
4531 call = &ndr_table_samr.calls[NDR_SAMR_CONNECT2];
4533 r = talloc(talloc_tos(), struct samr_Connect2);
4534 if (r == NULL) {
4535 return false;
4538 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4539 talloc_free(r);
4540 return false;
4543 pull = ndr_pull_init_blob(&blob, r, NULL);
4544 if (pull == NULL) {
4545 talloc_free(r);
4546 return false;
4549 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4550 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4551 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4552 talloc_free(r);
4553 return false;
4556 if (DEBUGLEVEL >= 10) {
4557 NDR_PRINT_IN_DEBUG(samr_Connect2, r);
4560 ZERO_STRUCT(r->out);
4561 r->out.connect_handle = talloc_zero(r, struct policy_handle);
4562 if (r->out.connect_handle == NULL) {
4563 talloc_free(r);
4564 return false;
4567 r->out.result = _samr_Connect2(p, r);
4569 if (p->rng_fault_state) {
4570 talloc_free(r);
4571 /* Return true here, srv_pipe_hnd.c will take care */
4572 return true;
4575 if (DEBUGLEVEL >= 10) {
4576 NDR_PRINT_OUT_DEBUG(samr_Connect2, r);
4579 push = ndr_push_init_ctx(r, NULL);
4580 if (push == NULL) {
4581 talloc_free(r);
4582 return false;
4585 ndr_err = call->ndr_push(push, NDR_OUT, r);
4586 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4587 talloc_free(r);
4588 return false;
4591 blob = ndr_push_blob(push);
4592 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4593 talloc_free(r);
4594 return false;
4597 talloc_free(r);
4599 return true;
4602 static bool api_samr_SetUserInfo2(pipes_struct *p)
4604 const struct ndr_interface_call *call;
4605 struct ndr_pull *pull;
4606 struct ndr_push *push;
4607 enum ndr_err_code ndr_err;
4608 DATA_BLOB blob;
4609 struct samr_SetUserInfo2 *r;
4611 call = &ndr_table_samr.calls[NDR_SAMR_SETUSERINFO2];
4613 r = talloc(talloc_tos(), struct samr_SetUserInfo2);
4614 if (r == NULL) {
4615 return false;
4618 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4619 talloc_free(r);
4620 return false;
4623 pull = ndr_pull_init_blob(&blob, r, NULL);
4624 if (pull == NULL) {
4625 talloc_free(r);
4626 return false;
4629 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4630 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4631 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4632 talloc_free(r);
4633 return false;
4636 if (DEBUGLEVEL >= 10) {
4637 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, r);
4640 r->out.result = _samr_SetUserInfo2(p, r);
4642 if (p->rng_fault_state) {
4643 talloc_free(r);
4644 /* Return true here, srv_pipe_hnd.c will take care */
4645 return true;
4648 if (DEBUGLEVEL >= 10) {
4649 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, r);
4652 push = ndr_push_init_ctx(r, NULL);
4653 if (push == NULL) {
4654 talloc_free(r);
4655 return false;
4658 ndr_err = call->ndr_push(push, NDR_OUT, r);
4659 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4660 talloc_free(r);
4661 return false;
4664 blob = ndr_push_blob(push);
4665 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4666 talloc_free(r);
4667 return false;
4670 talloc_free(r);
4672 return true;
4675 static bool api_samr_SetBootKeyInformation(pipes_struct *p)
4677 const struct ndr_interface_call *call;
4678 struct ndr_pull *pull;
4679 struct ndr_push *push;
4680 enum ndr_err_code ndr_err;
4681 DATA_BLOB blob;
4682 struct samr_SetBootKeyInformation *r;
4684 call = &ndr_table_samr.calls[NDR_SAMR_SETBOOTKEYINFORMATION];
4686 r = talloc(talloc_tos(), struct samr_SetBootKeyInformation);
4687 if (r == NULL) {
4688 return false;
4691 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4692 talloc_free(r);
4693 return false;
4696 pull = ndr_pull_init_blob(&blob, r, NULL);
4697 if (pull == NULL) {
4698 talloc_free(r);
4699 return false;
4702 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4703 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4704 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4705 talloc_free(r);
4706 return false;
4709 if (DEBUGLEVEL >= 10) {
4710 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, r);
4713 r->out.result = _samr_SetBootKeyInformation(p, r);
4715 if (p->rng_fault_state) {
4716 talloc_free(r);
4717 /* Return true here, srv_pipe_hnd.c will take care */
4718 return true;
4721 if (DEBUGLEVEL >= 10) {
4722 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, r);
4725 push = ndr_push_init_ctx(r, NULL);
4726 if (push == NULL) {
4727 talloc_free(r);
4728 return false;
4731 ndr_err = call->ndr_push(push, NDR_OUT, r);
4732 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4733 talloc_free(r);
4734 return false;
4737 blob = ndr_push_blob(push);
4738 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4739 talloc_free(r);
4740 return false;
4743 talloc_free(r);
4745 return true;
4748 static bool api_samr_GetBootKeyInformation(pipes_struct *p)
4750 const struct ndr_interface_call *call;
4751 struct ndr_pull *pull;
4752 struct ndr_push *push;
4753 enum ndr_err_code ndr_err;
4754 DATA_BLOB blob;
4755 struct samr_GetBootKeyInformation *r;
4757 call = &ndr_table_samr.calls[NDR_SAMR_GETBOOTKEYINFORMATION];
4759 r = talloc(talloc_tos(), struct samr_GetBootKeyInformation);
4760 if (r == NULL) {
4761 return false;
4764 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4765 talloc_free(r);
4766 return false;
4769 pull = ndr_pull_init_blob(&blob, r, NULL);
4770 if (pull == NULL) {
4771 talloc_free(r);
4772 return false;
4775 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4776 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4777 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4778 talloc_free(r);
4779 return false;
4782 if (DEBUGLEVEL >= 10) {
4783 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, r);
4786 ZERO_STRUCT(r->out);
4787 r->out.unknown = talloc_zero(r, uint32_t);
4788 if (r->out.unknown == NULL) {
4789 talloc_free(r);
4790 return false;
4793 r->out.result = _samr_GetBootKeyInformation(p, r);
4795 if (p->rng_fault_state) {
4796 talloc_free(r);
4797 /* Return true here, srv_pipe_hnd.c will take care */
4798 return true;
4801 if (DEBUGLEVEL >= 10) {
4802 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, r);
4805 push = ndr_push_init_ctx(r, NULL);
4806 if (push == NULL) {
4807 talloc_free(r);
4808 return false;
4811 ndr_err = call->ndr_push(push, NDR_OUT, r);
4812 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4813 talloc_free(r);
4814 return false;
4817 blob = ndr_push_blob(push);
4818 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4819 talloc_free(r);
4820 return false;
4823 talloc_free(r);
4825 return true;
4828 static bool api_samr_Connect3(pipes_struct *p)
4830 const struct ndr_interface_call *call;
4831 struct ndr_pull *pull;
4832 struct ndr_push *push;
4833 enum ndr_err_code ndr_err;
4834 DATA_BLOB blob;
4835 struct samr_Connect3 *r;
4837 call = &ndr_table_samr.calls[NDR_SAMR_CONNECT3];
4839 r = talloc(talloc_tos(), struct samr_Connect3);
4840 if (r == NULL) {
4841 return false;
4844 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4845 talloc_free(r);
4846 return false;
4849 pull = ndr_pull_init_blob(&blob, r, NULL);
4850 if (pull == NULL) {
4851 talloc_free(r);
4852 return false;
4855 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4856 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4857 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4858 talloc_free(r);
4859 return false;
4862 if (DEBUGLEVEL >= 10) {
4863 NDR_PRINT_IN_DEBUG(samr_Connect3, r);
4866 ZERO_STRUCT(r->out);
4867 r->out.connect_handle = talloc_zero(r, struct policy_handle);
4868 if (r->out.connect_handle == NULL) {
4869 talloc_free(r);
4870 return false;
4873 r->out.result = _samr_Connect3(p, r);
4875 if (p->rng_fault_state) {
4876 talloc_free(r);
4877 /* Return true here, srv_pipe_hnd.c will take care */
4878 return true;
4881 if (DEBUGLEVEL >= 10) {
4882 NDR_PRINT_OUT_DEBUG(samr_Connect3, r);
4885 push = ndr_push_init_ctx(r, NULL);
4886 if (push == NULL) {
4887 talloc_free(r);
4888 return false;
4891 ndr_err = call->ndr_push(push, NDR_OUT, r);
4892 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4893 talloc_free(r);
4894 return false;
4897 blob = ndr_push_blob(push);
4898 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4899 talloc_free(r);
4900 return false;
4903 talloc_free(r);
4905 return true;
4908 static bool api_samr_Connect4(pipes_struct *p)
4910 const struct ndr_interface_call *call;
4911 struct ndr_pull *pull;
4912 struct ndr_push *push;
4913 enum ndr_err_code ndr_err;
4914 DATA_BLOB blob;
4915 struct samr_Connect4 *r;
4917 call = &ndr_table_samr.calls[NDR_SAMR_CONNECT4];
4919 r = talloc(talloc_tos(), struct samr_Connect4);
4920 if (r == NULL) {
4921 return false;
4924 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4925 talloc_free(r);
4926 return false;
4929 pull = ndr_pull_init_blob(&blob, r, NULL);
4930 if (pull == NULL) {
4931 talloc_free(r);
4932 return false;
4935 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4936 ndr_err = call->ndr_pull(pull, NDR_IN, r);
4937 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4938 talloc_free(r);
4939 return false;
4942 if (DEBUGLEVEL >= 10) {
4943 NDR_PRINT_IN_DEBUG(samr_Connect4, r);
4946 ZERO_STRUCT(r->out);
4947 r->out.connect_handle = talloc_zero(r, struct policy_handle);
4948 if (r->out.connect_handle == NULL) {
4949 talloc_free(r);
4950 return false;
4953 r->out.result = _samr_Connect4(p, r);
4955 if (p->rng_fault_state) {
4956 talloc_free(r);
4957 /* Return true here, srv_pipe_hnd.c will take care */
4958 return true;
4961 if (DEBUGLEVEL >= 10) {
4962 NDR_PRINT_OUT_DEBUG(samr_Connect4, r);
4965 push = ndr_push_init_ctx(r, NULL);
4966 if (push == NULL) {
4967 talloc_free(r);
4968 return false;
4971 ndr_err = call->ndr_push(push, NDR_OUT, r);
4972 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
4973 talloc_free(r);
4974 return false;
4977 blob = ndr_push_blob(push);
4978 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
4979 talloc_free(r);
4980 return false;
4983 talloc_free(r);
4985 return true;
4988 static bool api_samr_ChangePasswordUser3(pipes_struct *p)
4990 const struct ndr_interface_call *call;
4991 struct ndr_pull *pull;
4992 struct ndr_push *push;
4993 enum ndr_err_code ndr_err;
4994 DATA_BLOB blob;
4995 struct samr_ChangePasswordUser3 *r;
4997 call = &ndr_table_samr.calls[NDR_SAMR_CHANGEPASSWORDUSER3];
4999 r = talloc(talloc_tos(), struct samr_ChangePasswordUser3);
5000 if (r == NULL) {
5001 return false;
5004 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5005 talloc_free(r);
5006 return false;
5009 pull = ndr_pull_init_blob(&blob, r, NULL);
5010 if (pull == NULL) {
5011 talloc_free(r);
5012 return false;
5015 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5016 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5017 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5018 talloc_free(r);
5019 return false;
5022 if (DEBUGLEVEL >= 10) {
5023 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, r);
5026 ZERO_STRUCT(r->out);
5027 r->out.dominfo = talloc_zero(r, struct samr_DomInfo1 *);
5028 if (r->out.dominfo == NULL) {
5029 talloc_free(r);
5030 return false;
5033 r->out.reject = talloc_zero(r, struct samr_ChangeReject *);
5034 if (r->out.reject == NULL) {
5035 talloc_free(r);
5036 return false;
5039 r->out.result = _samr_ChangePasswordUser3(p, r);
5041 if (p->rng_fault_state) {
5042 talloc_free(r);
5043 /* Return true here, srv_pipe_hnd.c will take care */
5044 return true;
5047 if (DEBUGLEVEL >= 10) {
5048 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, r);
5051 push = ndr_push_init_ctx(r, NULL);
5052 if (push == NULL) {
5053 talloc_free(r);
5054 return false;
5057 ndr_err = call->ndr_push(push, NDR_OUT, r);
5058 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5059 talloc_free(r);
5060 return false;
5063 blob = ndr_push_blob(push);
5064 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5065 talloc_free(r);
5066 return false;
5069 talloc_free(r);
5071 return true;
5074 static bool api_samr_Connect5(pipes_struct *p)
5076 const struct ndr_interface_call *call;
5077 struct ndr_pull *pull;
5078 struct ndr_push *push;
5079 enum ndr_err_code ndr_err;
5080 DATA_BLOB blob;
5081 struct samr_Connect5 *r;
5083 call = &ndr_table_samr.calls[NDR_SAMR_CONNECT5];
5085 r = talloc(talloc_tos(), struct samr_Connect5);
5086 if (r == NULL) {
5087 return false;
5090 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5091 talloc_free(r);
5092 return false;
5095 pull = ndr_pull_init_blob(&blob, r, NULL);
5096 if (pull == NULL) {
5097 talloc_free(r);
5098 return false;
5101 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5102 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5103 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5104 talloc_free(r);
5105 return false;
5108 if (DEBUGLEVEL >= 10) {
5109 NDR_PRINT_IN_DEBUG(samr_Connect5, r);
5112 ZERO_STRUCT(r->out);
5113 r->out.level_out = talloc_zero(r, uint32_t);
5114 if (r->out.level_out == NULL) {
5115 talloc_free(r);
5116 return false;
5119 r->out.info_out = talloc_zero(r, union samr_ConnectInfo);
5120 if (r->out.info_out == NULL) {
5121 talloc_free(r);
5122 return false;
5125 r->out.connect_handle = talloc_zero(r, struct policy_handle);
5126 if (r->out.connect_handle == NULL) {
5127 talloc_free(r);
5128 return false;
5131 r->out.result = _samr_Connect5(p, r);
5133 if (p->rng_fault_state) {
5134 talloc_free(r);
5135 /* Return true here, srv_pipe_hnd.c will take care */
5136 return true;
5139 if (DEBUGLEVEL >= 10) {
5140 NDR_PRINT_OUT_DEBUG(samr_Connect5, r);
5143 push = ndr_push_init_ctx(r, NULL);
5144 if (push == NULL) {
5145 talloc_free(r);
5146 return false;
5149 ndr_err = call->ndr_push(push, NDR_OUT, r);
5150 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5151 talloc_free(r);
5152 return false;
5155 blob = ndr_push_blob(push);
5156 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5157 talloc_free(r);
5158 return false;
5161 talloc_free(r);
5163 return true;
5166 static bool api_samr_RidToSid(pipes_struct *p)
5168 const struct ndr_interface_call *call;
5169 struct ndr_pull *pull;
5170 struct ndr_push *push;
5171 enum ndr_err_code ndr_err;
5172 DATA_BLOB blob;
5173 struct samr_RidToSid *r;
5175 call = &ndr_table_samr.calls[NDR_SAMR_RIDTOSID];
5177 r = talloc(talloc_tos(), struct samr_RidToSid);
5178 if (r == NULL) {
5179 return false;
5182 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5183 talloc_free(r);
5184 return false;
5187 pull = ndr_pull_init_blob(&blob, r, NULL);
5188 if (pull == NULL) {
5189 talloc_free(r);
5190 return false;
5193 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5194 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5195 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5196 talloc_free(r);
5197 return false;
5200 if (DEBUGLEVEL >= 10) {
5201 NDR_PRINT_IN_DEBUG(samr_RidToSid, r);
5204 ZERO_STRUCT(r->out);
5205 r->out.sid = talloc_zero(r, struct dom_sid2 *);
5206 if (r->out.sid == NULL) {
5207 talloc_free(r);
5208 return false;
5211 r->out.result = _samr_RidToSid(p, r);
5213 if (p->rng_fault_state) {
5214 talloc_free(r);
5215 /* Return true here, srv_pipe_hnd.c will take care */
5216 return true;
5219 if (DEBUGLEVEL >= 10) {
5220 NDR_PRINT_OUT_DEBUG(samr_RidToSid, r);
5223 push = ndr_push_init_ctx(r, NULL);
5224 if (push == NULL) {
5225 talloc_free(r);
5226 return false;
5229 ndr_err = call->ndr_push(push, NDR_OUT, r);
5230 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5231 talloc_free(r);
5232 return false;
5235 blob = ndr_push_blob(push);
5236 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5237 talloc_free(r);
5238 return false;
5241 talloc_free(r);
5243 return true;
5246 static bool api_samr_SetDsrmPassword(pipes_struct *p)
5248 const struct ndr_interface_call *call;
5249 struct ndr_pull *pull;
5250 struct ndr_push *push;
5251 enum ndr_err_code ndr_err;
5252 DATA_BLOB blob;
5253 struct samr_SetDsrmPassword *r;
5255 call = &ndr_table_samr.calls[NDR_SAMR_SETDSRMPASSWORD];
5257 r = talloc(talloc_tos(), struct samr_SetDsrmPassword);
5258 if (r == NULL) {
5259 return false;
5262 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5263 talloc_free(r);
5264 return false;
5267 pull = ndr_pull_init_blob(&blob, r, NULL);
5268 if (pull == NULL) {
5269 talloc_free(r);
5270 return false;
5273 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5274 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5275 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5276 talloc_free(r);
5277 return false;
5280 if (DEBUGLEVEL >= 10) {
5281 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, r);
5284 r->out.result = _samr_SetDsrmPassword(p, r);
5286 if (p->rng_fault_state) {
5287 talloc_free(r);
5288 /* Return true here, srv_pipe_hnd.c will take care */
5289 return true;
5292 if (DEBUGLEVEL >= 10) {
5293 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, r);
5296 push = ndr_push_init_ctx(r, NULL);
5297 if (push == NULL) {
5298 talloc_free(r);
5299 return false;
5302 ndr_err = call->ndr_push(push, NDR_OUT, r);
5303 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5304 talloc_free(r);
5305 return false;
5308 blob = ndr_push_blob(push);
5309 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5310 talloc_free(r);
5311 return false;
5314 talloc_free(r);
5316 return true;
5319 static bool api_samr_ValidatePassword(pipes_struct *p)
5321 const struct ndr_interface_call *call;
5322 struct ndr_pull *pull;
5323 struct ndr_push *push;
5324 enum ndr_err_code ndr_err;
5325 DATA_BLOB blob;
5326 struct samr_ValidatePassword *r;
5328 call = &ndr_table_samr.calls[NDR_SAMR_VALIDATEPASSWORD];
5330 r = talloc(talloc_tos(), struct samr_ValidatePassword);
5331 if (r == NULL) {
5332 return false;
5335 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5336 talloc_free(r);
5337 return false;
5340 pull = ndr_pull_init_blob(&blob, r, NULL);
5341 if (pull == NULL) {
5342 talloc_free(r);
5343 return false;
5346 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5347 ndr_err = call->ndr_pull(pull, NDR_IN, r);
5348 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5349 talloc_free(r);
5350 return false;
5353 if (DEBUGLEVEL >= 10) {
5354 NDR_PRINT_IN_DEBUG(samr_ValidatePassword, r);
5357 ZERO_STRUCT(r->out);
5358 r->out.rep = talloc_zero(r, union samr_ValidatePasswordRep *);
5359 if (r->out.rep == NULL) {
5360 talloc_free(r);
5361 return false;
5364 r->out.result = _samr_ValidatePassword(p, r);
5366 if (p->rng_fault_state) {
5367 talloc_free(r);
5368 /* Return true here, srv_pipe_hnd.c will take care */
5369 return true;
5372 if (DEBUGLEVEL >= 10) {
5373 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, r);
5376 push = ndr_push_init_ctx(r, NULL);
5377 if (push == NULL) {
5378 talloc_free(r);
5379 return false;
5382 ndr_err = call->ndr_push(push, NDR_OUT, r);
5383 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
5384 talloc_free(r);
5385 return false;
5388 blob = ndr_push_blob(push);
5389 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
5390 talloc_free(r);
5391 return false;
5394 talloc_free(r);
5396 return true;
5400 /* Tables */
5401 static struct api_struct api_samr_cmds[] =
5403 {"SAMR_CONNECT", NDR_SAMR_CONNECT, api_samr_Connect},
5404 {"SAMR_CLOSE", NDR_SAMR_CLOSE, api_samr_Close},
5405 {"SAMR_SETSECURITY", NDR_SAMR_SETSECURITY, api_samr_SetSecurity},
5406 {"SAMR_QUERYSECURITY", NDR_SAMR_QUERYSECURITY, api_samr_QuerySecurity},
5407 {"SAMR_SHUTDOWN", NDR_SAMR_SHUTDOWN, api_samr_Shutdown},
5408 {"SAMR_LOOKUPDOMAIN", NDR_SAMR_LOOKUPDOMAIN, api_samr_LookupDomain},
5409 {"SAMR_ENUMDOMAINS", NDR_SAMR_ENUMDOMAINS, api_samr_EnumDomains},
5410 {"SAMR_OPENDOMAIN", NDR_SAMR_OPENDOMAIN, api_samr_OpenDomain},
5411 {"SAMR_QUERYDOMAININFO", NDR_SAMR_QUERYDOMAININFO, api_samr_QueryDomainInfo},
5412 {"SAMR_SETDOMAININFO", NDR_SAMR_SETDOMAININFO, api_samr_SetDomainInfo},
5413 {"SAMR_CREATEDOMAINGROUP", NDR_SAMR_CREATEDOMAINGROUP, api_samr_CreateDomainGroup},
5414 {"SAMR_ENUMDOMAINGROUPS", NDR_SAMR_ENUMDOMAINGROUPS, api_samr_EnumDomainGroups},
5415 {"SAMR_CREATEUSER", NDR_SAMR_CREATEUSER, api_samr_CreateUser},
5416 {"SAMR_ENUMDOMAINUSERS", NDR_SAMR_ENUMDOMAINUSERS, api_samr_EnumDomainUsers},
5417 {"SAMR_CREATEDOMALIAS", NDR_SAMR_CREATEDOMALIAS, api_samr_CreateDomAlias},
5418 {"SAMR_ENUMDOMAINALIASES", NDR_SAMR_ENUMDOMAINALIASES, api_samr_EnumDomainAliases},
5419 {"SAMR_GETALIASMEMBERSHIP", NDR_SAMR_GETALIASMEMBERSHIP, api_samr_GetAliasMembership},
5420 {"SAMR_LOOKUPNAMES", NDR_SAMR_LOOKUPNAMES, api_samr_LookupNames},
5421 {"SAMR_LOOKUPRIDS", NDR_SAMR_LOOKUPRIDS, api_samr_LookupRids},
5422 {"SAMR_OPENGROUP", NDR_SAMR_OPENGROUP, api_samr_OpenGroup},
5423 {"SAMR_QUERYGROUPINFO", NDR_SAMR_QUERYGROUPINFO, api_samr_QueryGroupInfo},
5424 {"SAMR_SETGROUPINFO", NDR_SAMR_SETGROUPINFO, api_samr_SetGroupInfo},
5425 {"SAMR_ADDGROUPMEMBER", NDR_SAMR_ADDGROUPMEMBER, api_samr_AddGroupMember},
5426 {"SAMR_DELETEDOMAINGROUP", NDR_SAMR_DELETEDOMAINGROUP, api_samr_DeleteDomainGroup},
5427 {"SAMR_DELETEGROUPMEMBER", NDR_SAMR_DELETEGROUPMEMBER, api_samr_DeleteGroupMember},
5428 {"SAMR_QUERYGROUPMEMBER", NDR_SAMR_QUERYGROUPMEMBER, api_samr_QueryGroupMember},
5429 {"SAMR_SETMEMBERATTRIBUTESOFGROUP", NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP, api_samr_SetMemberAttributesOfGroup},
5430 {"SAMR_OPENALIAS", NDR_SAMR_OPENALIAS, api_samr_OpenAlias},
5431 {"SAMR_QUERYALIASINFO", NDR_SAMR_QUERYALIASINFO, api_samr_QueryAliasInfo},
5432 {"SAMR_SETALIASINFO", NDR_SAMR_SETALIASINFO, api_samr_SetAliasInfo},
5433 {"SAMR_DELETEDOMALIAS", NDR_SAMR_DELETEDOMALIAS, api_samr_DeleteDomAlias},
5434 {"SAMR_ADDALIASMEMBER", NDR_SAMR_ADDALIASMEMBER, api_samr_AddAliasMember},
5435 {"SAMR_DELETEALIASMEMBER", NDR_SAMR_DELETEALIASMEMBER, api_samr_DeleteAliasMember},
5436 {"SAMR_GETMEMBERSINALIAS", NDR_SAMR_GETMEMBERSINALIAS, api_samr_GetMembersInAlias},
5437 {"SAMR_OPENUSER", NDR_SAMR_OPENUSER, api_samr_OpenUser},
5438 {"SAMR_DELETEUSER", NDR_SAMR_DELETEUSER, api_samr_DeleteUser},
5439 {"SAMR_QUERYUSERINFO", NDR_SAMR_QUERYUSERINFO, api_samr_QueryUserInfo},
5440 {"SAMR_SETUSERINFO", NDR_SAMR_SETUSERINFO, api_samr_SetUserInfo},
5441 {"SAMR_CHANGEPASSWORDUSER", NDR_SAMR_CHANGEPASSWORDUSER, api_samr_ChangePasswordUser},
5442 {"SAMR_GETGROUPSFORUSER", NDR_SAMR_GETGROUPSFORUSER, api_samr_GetGroupsForUser},
5443 {"SAMR_QUERYDISPLAYINFO", NDR_SAMR_QUERYDISPLAYINFO, api_samr_QueryDisplayInfo},
5444 {"SAMR_GETDISPLAYENUMERATIONINDEX", NDR_SAMR_GETDISPLAYENUMERATIONINDEX, api_samr_GetDisplayEnumerationIndex},
5445 {"SAMR_TESTPRIVATEFUNCTIONSDOMAIN", NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN, api_samr_TestPrivateFunctionsDomain},
5446 {"SAMR_TESTPRIVATEFUNCTIONSUSER", NDR_SAMR_TESTPRIVATEFUNCTIONSUSER, api_samr_TestPrivateFunctionsUser},
5447 {"SAMR_GETUSERPWINFO", NDR_SAMR_GETUSERPWINFO, api_samr_GetUserPwInfo},
5448 {"SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN", NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN, api_samr_RemoveMemberFromForeignDomain},
5449 {"SAMR_QUERYDOMAININFO2", NDR_SAMR_QUERYDOMAININFO2, api_samr_QueryDomainInfo2},
5450 {"SAMR_QUERYUSERINFO2", NDR_SAMR_QUERYUSERINFO2, api_samr_QueryUserInfo2},
5451 {"SAMR_QUERYDISPLAYINFO2", NDR_SAMR_QUERYDISPLAYINFO2, api_samr_QueryDisplayInfo2},
5452 {"SAMR_GETDISPLAYENUMERATIONINDEX2", NDR_SAMR_GETDISPLAYENUMERATIONINDEX2, api_samr_GetDisplayEnumerationIndex2},
5453 {"SAMR_CREATEUSER2", NDR_SAMR_CREATEUSER2, api_samr_CreateUser2},
5454 {"SAMR_QUERYDISPLAYINFO3", NDR_SAMR_QUERYDISPLAYINFO3, api_samr_QueryDisplayInfo3},
5455 {"SAMR_ADDMULTIPLEMEMBERSTOALIAS", NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS, api_samr_AddMultipleMembersToAlias},
5456 {"SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS", NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS, api_samr_RemoveMultipleMembersFromAlias},
5457 {"SAMR_OEMCHANGEPASSWORDUSER2", NDR_SAMR_OEMCHANGEPASSWORDUSER2, api_samr_OemChangePasswordUser2},
5458 {"SAMR_CHANGEPASSWORDUSER2", NDR_SAMR_CHANGEPASSWORDUSER2, api_samr_ChangePasswordUser2},
5459 {"SAMR_GETDOMPWINFO", NDR_SAMR_GETDOMPWINFO, api_samr_GetDomPwInfo},
5460 {"SAMR_CONNECT2", NDR_SAMR_CONNECT2, api_samr_Connect2},
5461 {"SAMR_SETUSERINFO2", NDR_SAMR_SETUSERINFO2, api_samr_SetUserInfo2},
5462 {"SAMR_SETBOOTKEYINFORMATION", NDR_SAMR_SETBOOTKEYINFORMATION, api_samr_SetBootKeyInformation},
5463 {"SAMR_GETBOOTKEYINFORMATION", NDR_SAMR_GETBOOTKEYINFORMATION, api_samr_GetBootKeyInformation},
5464 {"SAMR_CONNECT3", NDR_SAMR_CONNECT3, api_samr_Connect3},
5465 {"SAMR_CONNECT4", NDR_SAMR_CONNECT4, api_samr_Connect4},
5466 {"SAMR_CHANGEPASSWORDUSER3", NDR_SAMR_CHANGEPASSWORDUSER3, api_samr_ChangePasswordUser3},
5467 {"SAMR_CONNECT5", NDR_SAMR_CONNECT5, api_samr_Connect5},
5468 {"SAMR_RIDTOSID", NDR_SAMR_RIDTOSID, api_samr_RidToSid},
5469 {"SAMR_SETDSRMPASSWORD", NDR_SAMR_SETDSRMPASSWORD, api_samr_SetDsrmPassword},
5470 {"SAMR_VALIDATEPASSWORD", NDR_SAMR_VALIDATEPASSWORD, api_samr_ValidatePassword},
5473 void samr_get_pipe_fns(struct api_struct **fns, int *n_fns)
5475 *fns = api_samr_cmds;
5476 *n_fns = sizeof(api_samr_cmds) / sizeof(struct api_struct);
5479 NTSTATUS rpc_samr_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
5481 if (cli->pipes_struct == NULL) {
5482 return NT_STATUS_INVALID_PARAMETER;
5485 switch (opnum)
5487 case NDR_SAMR_CONNECT: {
5488 struct samr_Connect *r = (struct samr_Connect *)_r;
5489 ZERO_STRUCT(r->out);
5490 r->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
5491 if (r->out.connect_handle == NULL) {
5492 return NT_STATUS_NO_MEMORY;
5495 r->out.result = _samr_Connect(cli->pipes_struct, r);
5496 return NT_STATUS_OK;
5499 case NDR_SAMR_CLOSE: {
5500 struct samr_Close *r = (struct samr_Close *)_r;
5501 ZERO_STRUCT(r->out);
5502 r->out.handle = r->in.handle;
5503 r->out.result = _samr_Close(cli->pipes_struct, r);
5504 return NT_STATUS_OK;
5507 case NDR_SAMR_SETSECURITY: {
5508 struct samr_SetSecurity *r = (struct samr_SetSecurity *)_r;
5509 r->out.result = _samr_SetSecurity(cli->pipes_struct, r);
5510 return NT_STATUS_OK;
5513 case NDR_SAMR_QUERYSECURITY: {
5514 struct samr_QuerySecurity *r = (struct samr_QuerySecurity *)_r;
5515 ZERO_STRUCT(r->out);
5516 r->out.sdbuf = talloc_zero(mem_ctx, struct sec_desc_buf *);
5517 if (r->out.sdbuf == NULL) {
5518 return NT_STATUS_NO_MEMORY;
5521 r->out.result = _samr_QuerySecurity(cli->pipes_struct, r);
5522 return NT_STATUS_OK;
5525 case NDR_SAMR_SHUTDOWN: {
5526 struct samr_Shutdown *r = (struct samr_Shutdown *)_r;
5527 r->out.result = _samr_Shutdown(cli->pipes_struct, r);
5528 return NT_STATUS_OK;
5531 case NDR_SAMR_LOOKUPDOMAIN: {
5532 struct samr_LookupDomain *r = (struct samr_LookupDomain *)_r;
5533 ZERO_STRUCT(r->out);
5534 r->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *);
5535 if (r->out.sid == NULL) {
5536 return NT_STATUS_NO_MEMORY;
5539 r->out.result = _samr_LookupDomain(cli->pipes_struct, r);
5540 return NT_STATUS_OK;
5543 case NDR_SAMR_ENUMDOMAINS: {
5544 struct samr_EnumDomains *r = (struct samr_EnumDomains *)_r;
5545 ZERO_STRUCT(r->out);
5546 r->out.resume_handle = r->in.resume_handle;
5547 r->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
5548 if (r->out.sam == NULL) {
5549 return NT_STATUS_NO_MEMORY;
5552 r->out.num_entries = talloc_zero(mem_ctx, uint32_t);
5553 if (r->out.num_entries == NULL) {
5554 return NT_STATUS_NO_MEMORY;
5557 r->out.result = _samr_EnumDomains(cli->pipes_struct, r);
5558 return NT_STATUS_OK;
5561 case NDR_SAMR_OPENDOMAIN: {
5562 struct samr_OpenDomain *r = (struct samr_OpenDomain *)_r;
5563 ZERO_STRUCT(r->out);
5564 r->out.domain_handle = talloc_zero(mem_ctx, struct policy_handle);
5565 if (r->out.domain_handle == NULL) {
5566 return NT_STATUS_NO_MEMORY;
5569 r->out.result = _samr_OpenDomain(cli->pipes_struct, r);
5570 return NT_STATUS_OK;
5573 case NDR_SAMR_QUERYDOMAININFO: {
5574 struct samr_QueryDomainInfo *r = (struct samr_QueryDomainInfo *)_r;
5575 ZERO_STRUCT(r->out);
5576 r->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *);
5577 if (r->out.info == NULL) {
5578 return NT_STATUS_NO_MEMORY;
5581 r->out.result = _samr_QueryDomainInfo(cli->pipes_struct, r);
5582 return NT_STATUS_OK;
5585 case NDR_SAMR_SETDOMAININFO: {
5586 struct samr_SetDomainInfo *r = (struct samr_SetDomainInfo *)_r;
5587 r->out.result = _samr_SetDomainInfo(cli->pipes_struct, r);
5588 return NT_STATUS_OK;
5591 case NDR_SAMR_CREATEDOMAINGROUP: {
5592 struct samr_CreateDomainGroup *r = (struct samr_CreateDomainGroup *)_r;
5593 ZERO_STRUCT(r->out);
5594 r->out.group_handle = talloc_zero(mem_ctx, struct policy_handle);
5595 if (r->out.group_handle == NULL) {
5596 return NT_STATUS_NO_MEMORY;
5599 r->out.rid = talloc_zero(mem_ctx, uint32_t);
5600 if (r->out.rid == NULL) {
5601 return NT_STATUS_NO_MEMORY;
5604 r->out.result = _samr_CreateDomainGroup(cli->pipes_struct, r);
5605 return NT_STATUS_OK;
5608 case NDR_SAMR_ENUMDOMAINGROUPS: {
5609 struct samr_EnumDomainGroups *r = (struct samr_EnumDomainGroups *)_r;
5610 ZERO_STRUCT(r->out);
5611 r->out.resume_handle = r->in.resume_handle;
5612 r->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
5613 if (r->out.sam == NULL) {
5614 return NT_STATUS_NO_MEMORY;
5617 r->out.num_entries = talloc_zero(mem_ctx, uint32_t);
5618 if (r->out.num_entries == NULL) {
5619 return NT_STATUS_NO_MEMORY;
5622 r->out.result = _samr_EnumDomainGroups(cli->pipes_struct, r);
5623 return NT_STATUS_OK;
5626 case NDR_SAMR_CREATEUSER: {
5627 struct samr_CreateUser *r = (struct samr_CreateUser *)_r;
5628 ZERO_STRUCT(r->out);
5629 r->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
5630 if (r->out.user_handle == NULL) {
5631 return NT_STATUS_NO_MEMORY;
5634 r->out.rid = talloc_zero(mem_ctx, uint32_t);
5635 if (r->out.rid == NULL) {
5636 return NT_STATUS_NO_MEMORY;
5639 r->out.result = _samr_CreateUser(cli->pipes_struct, r);
5640 return NT_STATUS_OK;
5643 case NDR_SAMR_ENUMDOMAINUSERS: {
5644 struct samr_EnumDomainUsers *r = (struct samr_EnumDomainUsers *)_r;
5645 ZERO_STRUCT(r->out);
5646 r->out.resume_handle = r->in.resume_handle;
5647 r->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
5648 if (r->out.sam == NULL) {
5649 return NT_STATUS_NO_MEMORY;
5652 r->out.num_entries = talloc_zero(mem_ctx, uint32_t);
5653 if (r->out.num_entries == NULL) {
5654 return NT_STATUS_NO_MEMORY;
5657 r->out.result = _samr_EnumDomainUsers(cli->pipes_struct, r);
5658 return NT_STATUS_OK;
5661 case NDR_SAMR_CREATEDOMALIAS: {
5662 struct samr_CreateDomAlias *r = (struct samr_CreateDomAlias *)_r;
5663 ZERO_STRUCT(r->out);
5664 r->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
5665 if (r->out.alias_handle == NULL) {
5666 return NT_STATUS_NO_MEMORY;
5669 r->out.rid = talloc_zero(mem_ctx, uint32_t);
5670 if (r->out.rid == NULL) {
5671 return NT_STATUS_NO_MEMORY;
5674 r->out.result = _samr_CreateDomAlias(cli->pipes_struct, r);
5675 return NT_STATUS_OK;
5678 case NDR_SAMR_ENUMDOMAINALIASES: {
5679 struct samr_EnumDomainAliases *r = (struct samr_EnumDomainAliases *)_r;
5680 ZERO_STRUCT(r->out);
5681 r->out.resume_handle = r->in.resume_handle;
5682 r->out.sam = talloc_zero(mem_ctx, struct samr_SamArray *);
5683 if (r->out.sam == NULL) {
5684 return NT_STATUS_NO_MEMORY;
5687 r->out.num_entries = talloc_zero(mem_ctx, uint32_t);
5688 if (r->out.num_entries == NULL) {
5689 return NT_STATUS_NO_MEMORY;
5692 r->out.result = _samr_EnumDomainAliases(cli->pipes_struct, r);
5693 return NT_STATUS_OK;
5696 case NDR_SAMR_GETALIASMEMBERSHIP: {
5697 struct samr_GetAliasMembership *r = (struct samr_GetAliasMembership *)_r;
5698 ZERO_STRUCT(r->out);
5699 r->out.rids = talloc_zero(mem_ctx, struct samr_Ids);
5700 if (r->out.rids == NULL) {
5701 return NT_STATUS_NO_MEMORY;
5704 r->out.result = _samr_GetAliasMembership(cli->pipes_struct, r);
5705 return NT_STATUS_OK;
5708 case NDR_SAMR_LOOKUPNAMES: {
5709 struct samr_LookupNames *r = (struct samr_LookupNames *)_r;
5710 ZERO_STRUCT(r->out);
5711 r->out.rids = talloc_zero(mem_ctx, struct samr_Ids);
5712 if (r->out.rids == NULL) {
5713 return NT_STATUS_NO_MEMORY;
5716 r->out.types = talloc_zero(mem_ctx, struct samr_Ids);
5717 if (r->out.types == NULL) {
5718 return NT_STATUS_NO_MEMORY;
5721 r->out.result = _samr_LookupNames(cli->pipes_struct, r);
5722 return NT_STATUS_OK;
5725 case NDR_SAMR_LOOKUPRIDS: {
5726 struct samr_LookupRids *r = (struct samr_LookupRids *)_r;
5727 ZERO_STRUCT(r->out);
5728 r->out.names = talloc_zero(mem_ctx, struct lsa_Strings);
5729 if (r->out.names == NULL) {
5730 return NT_STATUS_NO_MEMORY;
5733 r->out.types = talloc_zero(mem_ctx, struct samr_Ids);
5734 if (r->out.types == NULL) {
5735 return NT_STATUS_NO_MEMORY;
5738 r->out.result = _samr_LookupRids(cli->pipes_struct, r);
5739 return NT_STATUS_OK;
5742 case NDR_SAMR_OPENGROUP: {
5743 struct samr_OpenGroup *r = (struct samr_OpenGroup *)_r;
5744 ZERO_STRUCT(r->out);
5745 r->out.group_handle = talloc_zero(mem_ctx, struct policy_handle);
5746 if (r->out.group_handle == NULL) {
5747 return NT_STATUS_NO_MEMORY;
5750 r->out.result = _samr_OpenGroup(cli->pipes_struct, r);
5751 return NT_STATUS_OK;
5754 case NDR_SAMR_QUERYGROUPINFO: {
5755 struct samr_QueryGroupInfo *r = (struct samr_QueryGroupInfo *)_r;
5756 ZERO_STRUCT(r->out);
5757 r->out.info = talloc_zero(mem_ctx, union samr_GroupInfo *);
5758 if (r->out.info == NULL) {
5759 return NT_STATUS_NO_MEMORY;
5762 r->out.result = _samr_QueryGroupInfo(cli->pipes_struct, r);
5763 return NT_STATUS_OK;
5766 case NDR_SAMR_SETGROUPINFO: {
5767 struct samr_SetGroupInfo *r = (struct samr_SetGroupInfo *)_r;
5768 r->out.result = _samr_SetGroupInfo(cli->pipes_struct, r);
5769 return NT_STATUS_OK;
5772 case NDR_SAMR_ADDGROUPMEMBER: {
5773 struct samr_AddGroupMember *r = (struct samr_AddGroupMember *)_r;
5774 r->out.result = _samr_AddGroupMember(cli->pipes_struct, r);
5775 return NT_STATUS_OK;
5778 case NDR_SAMR_DELETEDOMAINGROUP: {
5779 struct samr_DeleteDomainGroup *r = (struct samr_DeleteDomainGroup *)_r;
5780 ZERO_STRUCT(r->out);
5781 r->out.group_handle = r->in.group_handle;
5782 r->out.result = _samr_DeleteDomainGroup(cli->pipes_struct, r);
5783 return NT_STATUS_OK;
5786 case NDR_SAMR_DELETEGROUPMEMBER: {
5787 struct samr_DeleteGroupMember *r = (struct samr_DeleteGroupMember *)_r;
5788 r->out.result = _samr_DeleteGroupMember(cli->pipes_struct, r);
5789 return NT_STATUS_OK;
5792 case NDR_SAMR_QUERYGROUPMEMBER: {
5793 struct samr_QueryGroupMember *r = (struct samr_QueryGroupMember *)_r;
5794 ZERO_STRUCT(r->out);
5795 r->out.rids = talloc_zero(mem_ctx, struct samr_RidTypeArray *);
5796 if (r->out.rids == NULL) {
5797 return NT_STATUS_NO_MEMORY;
5800 r->out.result = _samr_QueryGroupMember(cli->pipes_struct, r);
5801 return NT_STATUS_OK;
5804 case NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP: {
5805 struct samr_SetMemberAttributesOfGroup *r = (struct samr_SetMemberAttributesOfGroup *)_r;
5806 r->out.result = _samr_SetMemberAttributesOfGroup(cli->pipes_struct, r);
5807 return NT_STATUS_OK;
5810 case NDR_SAMR_OPENALIAS: {
5811 struct samr_OpenAlias *r = (struct samr_OpenAlias *)_r;
5812 ZERO_STRUCT(r->out);
5813 r->out.alias_handle = talloc_zero(mem_ctx, struct policy_handle);
5814 if (r->out.alias_handle == NULL) {
5815 return NT_STATUS_NO_MEMORY;
5818 r->out.result = _samr_OpenAlias(cli->pipes_struct, r);
5819 return NT_STATUS_OK;
5822 case NDR_SAMR_QUERYALIASINFO: {
5823 struct samr_QueryAliasInfo *r = (struct samr_QueryAliasInfo *)_r;
5824 ZERO_STRUCT(r->out);
5825 r->out.info = talloc_zero(mem_ctx, union samr_AliasInfo *);
5826 if (r->out.info == NULL) {
5827 return NT_STATUS_NO_MEMORY;
5830 r->out.result = _samr_QueryAliasInfo(cli->pipes_struct, r);
5831 return NT_STATUS_OK;
5834 case NDR_SAMR_SETALIASINFO: {
5835 struct samr_SetAliasInfo *r = (struct samr_SetAliasInfo *)_r;
5836 r->out.result = _samr_SetAliasInfo(cli->pipes_struct, r);
5837 return NT_STATUS_OK;
5840 case NDR_SAMR_DELETEDOMALIAS: {
5841 struct samr_DeleteDomAlias *r = (struct samr_DeleteDomAlias *)_r;
5842 ZERO_STRUCT(r->out);
5843 r->out.alias_handle = r->in.alias_handle;
5844 r->out.result = _samr_DeleteDomAlias(cli->pipes_struct, r);
5845 return NT_STATUS_OK;
5848 case NDR_SAMR_ADDALIASMEMBER: {
5849 struct samr_AddAliasMember *r = (struct samr_AddAliasMember *)_r;
5850 r->out.result = _samr_AddAliasMember(cli->pipes_struct, r);
5851 return NT_STATUS_OK;
5854 case NDR_SAMR_DELETEALIASMEMBER: {
5855 struct samr_DeleteAliasMember *r = (struct samr_DeleteAliasMember *)_r;
5856 r->out.result = _samr_DeleteAliasMember(cli->pipes_struct, r);
5857 return NT_STATUS_OK;
5860 case NDR_SAMR_GETMEMBERSINALIAS: {
5861 struct samr_GetMembersInAlias *r = (struct samr_GetMembersInAlias *)_r;
5862 ZERO_STRUCT(r->out);
5863 r->out.sids = talloc_zero(mem_ctx, struct lsa_SidArray);
5864 if (r->out.sids == NULL) {
5865 return NT_STATUS_NO_MEMORY;
5868 r->out.result = _samr_GetMembersInAlias(cli->pipes_struct, r);
5869 return NT_STATUS_OK;
5872 case NDR_SAMR_OPENUSER: {
5873 struct samr_OpenUser *r = (struct samr_OpenUser *)_r;
5874 ZERO_STRUCT(r->out);
5875 r->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
5876 if (r->out.user_handle == NULL) {
5877 return NT_STATUS_NO_MEMORY;
5880 r->out.result = _samr_OpenUser(cli->pipes_struct, r);
5881 return NT_STATUS_OK;
5884 case NDR_SAMR_DELETEUSER: {
5885 struct samr_DeleteUser *r = (struct samr_DeleteUser *)_r;
5886 ZERO_STRUCT(r->out);
5887 r->out.user_handle = r->in.user_handle;
5888 r->out.result = _samr_DeleteUser(cli->pipes_struct, r);
5889 return NT_STATUS_OK;
5892 case NDR_SAMR_QUERYUSERINFO: {
5893 struct samr_QueryUserInfo *r = (struct samr_QueryUserInfo *)_r;
5894 ZERO_STRUCT(r->out);
5895 r->out.info = talloc_zero(mem_ctx, union samr_UserInfo *);
5896 if (r->out.info == NULL) {
5897 return NT_STATUS_NO_MEMORY;
5900 r->out.result = _samr_QueryUserInfo(cli->pipes_struct, r);
5901 return NT_STATUS_OK;
5904 case NDR_SAMR_SETUSERINFO: {
5905 struct samr_SetUserInfo *r = (struct samr_SetUserInfo *)_r;
5906 r->out.result = _samr_SetUserInfo(cli->pipes_struct, r);
5907 return NT_STATUS_OK;
5910 case NDR_SAMR_CHANGEPASSWORDUSER: {
5911 struct samr_ChangePasswordUser *r = (struct samr_ChangePasswordUser *)_r;
5912 r->out.result = _samr_ChangePasswordUser(cli->pipes_struct, r);
5913 return NT_STATUS_OK;
5916 case NDR_SAMR_GETGROUPSFORUSER: {
5917 struct samr_GetGroupsForUser *r = (struct samr_GetGroupsForUser *)_r;
5918 ZERO_STRUCT(r->out);
5919 r->out.rids = talloc_zero(mem_ctx, struct samr_RidWithAttributeArray *);
5920 if (r->out.rids == NULL) {
5921 return NT_STATUS_NO_MEMORY;
5924 r->out.result = _samr_GetGroupsForUser(cli->pipes_struct, r);
5925 return NT_STATUS_OK;
5928 case NDR_SAMR_QUERYDISPLAYINFO: {
5929 struct samr_QueryDisplayInfo *r = (struct samr_QueryDisplayInfo *)_r;
5930 ZERO_STRUCT(r->out);
5931 r->out.total_size = talloc_zero(mem_ctx, uint32_t);
5932 if (r->out.total_size == NULL) {
5933 return NT_STATUS_NO_MEMORY;
5936 r->out.returned_size = talloc_zero(mem_ctx, uint32_t);
5937 if (r->out.returned_size == NULL) {
5938 return NT_STATUS_NO_MEMORY;
5941 r->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
5942 if (r->out.info == NULL) {
5943 return NT_STATUS_NO_MEMORY;
5946 r->out.result = _samr_QueryDisplayInfo(cli->pipes_struct, r);
5947 return NT_STATUS_OK;
5950 case NDR_SAMR_GETDISPLAYENUMERATIONINDEX: {
5951 struct samr_GetDisplayEnumerationIndex *r = (struct samr_GetDisplayEnumerationIndex *)_r;
5952 ZERO_STRUCT(r->out);
5953 r->out.idx = talloc_zero(mem_ctx, uint32_t);
5954 if (r->out.idx == NULL) {
5955 return NT_STATUS_NO_MEMORY;
5958 r->out.result = _samr_GetDisplayEnumerationIndex(cli->pipes_struct, r);
5959 return NT_STATUS_OK;
5962 case NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN: {
5963 struct samr_TestPrivateFunctionsDomain *r = (struct samr_TestPrivateFunctionsDomain *)_r;
5964 r->out.result = _samr_TestPrivateFunctionsDomain(cli->pipes_struct, r);
5965 return NT_STATUS_OK;
5968 case NDR_SAMR_TESTPRIVATEFUNCTIONSUSER: {
5969 struct samr_TestPrivateFunctionsUser *r = (struct samr_TestPrivateFunctionsUser *)_r;
5970 r->out.result = _samr_TestPrivateFunctionsUser(cli->pipes_struct, r);
5971 return NT_STATUS_OK;
5974 case NDR_SAMR_GETUSERPWINFO: {
5975 struct samr_GetUserPwInfo *r = (struct samr_GetUserPwInfo *)_r;
5976 ZERO_STRUCT(r->out);
5977 r->out.info = talloc_zero(mem_ctx, struct samr_PwInfo);
5978 if (r->out.info == NULL) {
5979 return NT_STATUS_NO_MEMORY;
5982 r->out.result = _samr_GetUserPwInfo(cli->pipes_struct, r);
5983 return NT_STATUS_OK;
5986 case NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN: {
5987 struct samr_RemoveMemberFromForeignDomain *r = (struct samr_RemoveMemberFromForeignDomain *)_r;
5988 r->out.result = _samr_RemoveMemberFromForeignDomain(cli->pipes_struct, r);
5989 return NT_STATUS_OK;
5992 case NDR_SAMR_QUERYDOMAININFO2: {
5993 struct samr_QueryDomainInfo2 *r = (struct samr_QueryDomainInfo2 *)_r;
5994 ZERO_STRUCT(r->out);
5995 r->out.info = talloc_zero(mem_ctx, union samr_DomainInfo *);
5996 if (r->out.info == NULL) {
5997 return NT_STATUS_NO_MEMORY;
6000 r->out.result = _samr_QueryDomainInfo2(cli->pipes_struct, r);
6001 return NT_STATUS_OK;
6004 case NDR_SAMR_QUERYUSERINFO2: {
6005 struct samr_QueryUserInfo2 *r = (struct samr_QueryUserInfo2 *)_r;
6006 ZERO_STRUCT(r->out);
6007 r->out.info = talloc_zero(mem_ctx, union samr_UserInfo *);
6008 if (r->out.info == NULL) {
6009 return NT_STATUS_NO_MEMORY;
6012 r->out.result = _samr_QueryUserInfo2(cli->pipes_struct, r);
6013 return NT_STATUS_OK;
6016 case NDR_SAMR_QUERYDISPLAYINFO2: {
6017 struct samr_QueryDisplayInfo2 *r = (struct samr_QueryDisplayInfo2 *)_r;
6018 ZERO_STRUCT(r->out);
6019 r->out.total_size = talloc_zero(mem_ctx, uint32_t);
6020 if (r->out.total_size == NULL) {
6021 return NT_STATUS_NO_MEMORY;
6024 r->out.returned_size = talloc_zero(mem_ctx, uint32_t);
6025 if (r->out.returned_size == NULL) {
6026 return NT_STATUS_NO_MEMORY;
6029 r->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
6030 if (r->out.info == NULL) {
6031 return NT_STATUS_NO_MEMORY;
6034 r->out.result = _samr_QueryDisplayInfo2(cli->pipes_struct, r);
6035 return NT_STATUS_OK;
6038 case NDR_SAMR_GETDISPLAYENUMERATIONINDEX2: {
6039 struct samr_GetDisplayEnumerationIndex2 *r = (struct samr_GetDisplayEnumerationIndex2 *)_r;
6040 ZERO_STRUCT(r->out);
6041 r->out.idx = talloc_zero(mem_ctx, uint32_t);
6042 if (r->out.idx == NULL) {
6043 return NT_STATUS_NO_MEMORY;
6046 r->out.result = _samr_GetDisplayEnumerationIndex2(cli->pipes_struct, r);
6047 return NT_STATUS_OK;
6050 case NDR_SAMR_CREATEUSER2: {
6051 struct samr_CreateUser2 *r = (struct samr_CreateUser2 *)_r;
6052 ZERO_STRUCT(r->out);
6053 r->out.user_handle = talloc_zero(mem_ctx, struct policy_handle);
6054 if (r->out.user_handle == NULL) {
6055 return NT_STATUS_NO_MEMORY;
6058 r->out.access_granted = talloc_zero(mem_ctx, uint32_t);
6059 if (r->out.access_granted == NULL) {
6060 return NT_STATUS_NO_MEMORY;
6063 r->out.rid = talloc_zero(mem_ctx, uint32_t);
6064 if (r->out.rid == NULL) {
6065 return NT_STATUS_NO_MEMORY;
6068 r->out.result = _samr_CreateUser2(cli->pipes_struct, r);
6069 return NT_STATUS_OK;
6072 case NDR_SAMR_QUERYDISPLAYINFO3: {
6073 struct samr_QueryDisplayInfo3 *r = (struct samr_QueryDisplayInfo3 *)_r;
6074 ZERO_STRUCT(r->out);
6075 r->out.total_size = talloc_zero(mem_ctx, uint32_t);
6076 if (r->out.total_size == NULL) {
6077 return NT_STATUS_NO_MEMORY;
6080 r->out.returned_size = talloc_zero(mem_ctx, uint32_t);
6081 if (r->out.returned_size == NULL) {
6082 return NT_STATUS_NO_MEMORY;
6085 r->out.info = talloc_zero(mem_ctx, union samr_DispInfo);
6086 if (r->out.info == NULL) {
6087 return NT_STATUS_NO_MEMORY;
6090 r->out.result = _samr_QueryDisplayInfo3(cli->pipes_struct, r);
6091 return NT_STATUS_OK;
6094 case NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS: {
6095 struct samr_AddMultipleMembersToAlias *r = (struct samr_AddMultipleMembersToAlias *)_r;
6096 r->out.result = _samr_AddMultipleMembersToAlias(cli->pipes_struct, r);
6097 return NT_STATUS_OK;
6100 case NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS: {
6101 struct samr_RemoveMultipleMembersFromAlias *r = (struct samr_RemoveMultipleMembersFromAlias *)_r;
6102 r->out.result = _samr_RemoveMultipleMembersFromAlias(cli->pipes_struct, r);
6103 return NT_STATUS_OK;
6106 case NDR_SAMR_OEMCHANGEPASSWORDUSER2: {
6107 struct samr_OemChangePasswordUser2 *r = (struct samr_OemChangePasswordUser2 *)_r;
6108 r->out.result = _samr_OemChangePasswordUser2(cli->pipes_struct, r);
6109 return NT_STATUS_OK;
6112 case NDR_SAMR_CHANGEPASSWORDUSER2: {
6113 struct samr_ChangePasswordUser2 *r = (struct samr_ChangePasswordUser2 *)_r;
6114 r->out.result = _samr_ChangePasswordUser2(cli->pipes_struct, r);
6115 return NT_STATUS_OK;
6118 case NDR_SAMR_GETDOMPWINFO: {
6119 struct samr_GetDomPwInfo *r = (struct samr_GetDomPwInfo *)_r;
6120 ZERO_STRUCT(r->out);
6121 r->out.info = talloc_zero(mem_ctx, struct samr_PwInfo);
6122 if (r->out.info == NULL) {
6123 return NT_STATUS_NO_MEMORY;
6126 r->out.result = _samr_GetDomPwInfo(cli->pipes_struct, r);
6127 return NT_STATUS_OK;
6130 case NDR_SAMR_CONNECT2: {
6131 struct samr_Connect2 *r = (struct samr_Connect2 *)_r;
6132 ZERO_STRUCT(r->out);
6133 r->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
6134 if (r->out.connect_handle == NULL) {
6135 return NT_STATUS_NO_MEMORY;
6138 r->out.result = _samr_Connect2(cli->pipes_struct, r);
6139 return NT_STATUS_OK;
6142 case NDR_SAMR_SETUSERINFO2: {
6143 struct samr_SetUserInfo2 *r = (struct samr_SetUserInfo2 *)_r;
6144 r->out.result = _samr_SetUserInfo2(cli->pipes_struct, r);
6145 return NT_STATUS_OK;
6148 case NDR_SAMR_SETBOOTKEYINFORMATION: {
6149 struct samr_SetBootKeyInformation *r = (struct samr_SetBootKeyInformation *)_r;
6150 r->out.result = _samr_SetBootKeyInformation(cli->pipes_struct, r);
6151 return NT_STATUS_OK;
6154 case NDR_SAMR_GETBOOTKEYINFORMATION: {
6155 struct samr_GetBootKeyInformation *r = (struct samr_GetBootKeyInformation *)_r;
6156 ZERO_STRUCT(r->out);
6157 r->out.unknown = talloc_zero(mem_ctx, uint32_t);
6158 if (r->out.unknown == NULL) {
6159 return NT_STATUS_NO_MEMORY;
6162 r->out.result = _samr_GetBootKeyInformation(cli->pipes_struct, r);
6163 return NT_STATUS_OK;
6166 case NDR_SAMR_CONNECT3: {
6167 struct samr_Connect3 *r = (struct samr_Connect3 *)_r;
6168 ZERO_STRUCT(r->out);
6169 r->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
6170 if (r->out.connect_handle == NULL) {
6171 return NT_STATUS_NO_MEMORY;
6174 r->out.result = _samr_Connect3(cli->pipes_struct, r);
6175 return NT_STATUS_OK;
6178 case NDR_SAMR_CONNECT4: {
6179 struct samr_Connect4 *r = (struct samr_Connect4 *)_r;
6180 ZERO_STRUCT(r->out);
6181 r->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
6182 if (r->out.connect_handle == NULL) {
6183 return NT_STATUS_NO_MEMORY;
6186 r->out.result = _samr_Connect4(cli->pipes_struct, r);
6187 return NT_STATUS_OK;
6190 case NDR_SAMR_CHANGEPASSWORDUSER3: {
6191 struct samr_ChangePasswordUser3 *r = (struct samr_ChangePasswordUser3 *)_r;
6192 ZERO_STRUCT(r->out);
6193 r->out.dominfo = talloc_zero(mem_ctx, struct samr_DomInfo1 *);
6194 if (r->out.dominfo == NULL) {
6195 return NT_STATUS_NO_MEMORY;
6198 r->out.reject = talloc_zero(mem_ctx, struct samr_ChangeReject *);
6199 if (r->out.reject == NULL) {
6200 return NT_STATUS_NO_MEMORY;
6203 r->out.result = _samr_ChangePasswordUser3(cli->pipes_struct, r);
6204 return NT_STATUS_OK;
6207 case NDR_SAMR_CONNECT5: {
6208 struct samr_Connect5 *r = (struct samr_Connect5 *)_r;
6209 ZERO_STRUCT(r->out);
6210 r->out.level_out = talloc_zero(mem_ctx, uint32_t);
6211 if (r->out.level_out == NULL) {
6212 return NT_STATUS_NO_MEMORY;
6215 r->out.info_out = talloc_zero(mem_ctx, union samr_ConnectInfo);
6216 if (r->out.info_out == NULL) {
6217 return NT_STATUS_NO_MEMORY;
6220 r->out.connect_handle = talloc_zero(mem_ctx, struct policy_handle);
6221 if (r->out.connect_handle == NULL) {
6222 return NT_STATUS_NO_MEMORY;
6225 r->out.result = _samr_Connect5(cli->pipes_struct, r);
6226 return NT_STATUS_OK;
6229 case NDR_SAMR_RIDTOSID: {
6230 struct samr_RidToSid *r = (struct samr_RidToSid *)_r;
6231 ZERO_STRUCT(r->out);
6232 r->out.sid = talloc_zero(mem_ctx, struct dom_sid2 *);
6233 if (r->out.sid == NULL) {
6234 return NT_STATUS_NO_MEMORY;
6237 r->out.result = _samr_RidToSid(cli->pipes_struct, r);
6238 return NT_STATUS_OK;
6241 case NDR_SAMR_SETDSRMPASSWORD: {
6242 struct samr_SetDsrmPassword *r = (struct samr_SetDsrmPassword *)_r;
6243 r->out.result = _samr_SetDsrmPassword(cli->pipes_struct, r);
6244 return NT_STATUS_OK;
6247 case NDR_SAMR_VALIDATEPASSWORD: {
6248 struct samr_ValidatePassword *r = (struct samr_ValidatePassword *)_r;
6249 ZERO_STRUCT(r->out);
6250 r->out.rep = talloc_zero(mem_ctx, union samr_ValidatePasswordRep *);
6251 if (r->out.rep == NULL) {
6252 return NT_STATUS_NO_MEMORY;
6255 r->out.result = _samr_ValidatePassword(cli->pipes_struct, r);
6256 return NT_STATUS_OK;
6259 default:
6260 return NT_STATUS_NOT_IMPLEMENTED;
6264 NTSTATUS rpc_samr_init(void)
6266 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "samr", "samr", &ndr_table_samr, api_samr_cmds, sizeof(api_samr_cmds) / sizeof(struct api_struct));