Allow calling DCE/RPC server implementations directly using
[Samba/gebeck_regimport.git] / librpc / gen_ndr / srv_netlogon.c
blobc1e3a8aafdfe9634dfa5437daa62c134555e40ce
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_netlogon.h"
9 static bool api_netr_LogonUasLogon(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 netr_LogonUasLogon *r;
18 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGON];
20 r = talloc(talloc_tos(), struct netr_LogonUasLogon);
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(netr_LogonUasLogon, r);
47 ZERO_STRUCT(r->out);
48 r->out.info = talloc_zero(r, struct netr_UasInfo *);
49 if (r->out.info == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _netr_LogonUasLogon(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(netr_LogonUasLogon, 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_netr_LogonUasLogoff(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 netr_LogonUasLogoff *r;
98 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONUASLOGOFF];
100 r = talloc(talloc_tos(), struct netr_LogonUasLogoff);
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(netr_LogonUasLogoff, r);
127 ZERO_STRUCT(r->out);
128 r->out.info = talloc_zero(r, struct netr_UasLogoffInfo);
129 if (r->out.info == NULL) {
130 talloc_free(r);
131 return false;
134 r->out.result = _netr_LogonUasLogoff(p, r);
136 if (p->rng_fault_state) {
137 talloc_free(r);
138 /* Return true here, srv_pipe_hnd.c will take care */
139 return true;
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, r);
146 push = ndr_push_init_ctx(r, NULL);
147 if (push == NULL) {
148 talloc_free(r);
149 return false;
152 ndr_err = call->ndr_push(push, NDR_OUT, r);
153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
154 talloc_free(r);
155 return false;
158 blob = ndr_push_blob(push);
159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
160 talloc_free(r);
161 return false;
164 talloc_free(r);
166 return true;
169 static bool api_netr_LogonSamLogon(pipes_struct *p)
171 const struct ndr_interface_call *call;
172 struct ndr_pull *pull;
173 struct ndr_push *push;
174 enum ndr_err_code ndr_err;
175 DATA_BLOB blob;
176 struct netr_LogonSamLogon *r;
178 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGON];
180 r = talloc(talloc_tos(), struct netr_LogonSamLogon);
181 if (r == NULL) {
182 return false;
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 talloc_free(r);
187 return false;
190 pull = ndr_pull_init_blob(&blob, r, NULL);
191 if (pull == NULL) {
192 talloc_free(r);
193 return false;
196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
197 ndr_err = call->ndr_pull(pull, NDR_IN, r);
198 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
199 talloc_free(r);
200 return false;
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, r);
207 ZERO_STRUCT(r->out);
208 r->out.return_authenticator = r->in.return_authenticator;
209 r->out.validation = talloc_zero(r, union netr_Validation);
210 if (r->out.validation == NULL) {
211 talloc_free(r);
212 return false;
215 r->out.authoritative = talloc_zero(r, uint8_t);
216 if (r->out.authoritative == NULL) {
217 talloc_free(r);
218 return false;
221 r->out.result = _netr_LogonSamLogon(p, r);
223 if (p->rng_fault_state) {
224 talloc_free(r);
225 /* Return true here, srv_pipe_hnd.c will take care */
226 return true;
229 if (DEBUGLEVEL >= 10) {
230 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, r);
233 push = ndr_push_init_ctx(r, NULL);
234 if (push == NULL) {
235 talloc_free(r);
236 return false;
239 ndr_err = call->ndr_push(push, NDR_OUT, r);
240 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
241 talloc_free(r);
242 return false;
245 blob = ndr_push_blob(push);
246 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
247 talloc_free(r);
248 return false;
251 talloc_free(r);
253 return true;
256 static bool api_netr_LogonSamLogoff(pipes_struct *p)
258 const struct ndr_interface_call *call;
259 struct ndr_pull *pull;
260 struct ndr_push *push;
261 enum ndr_err_code ndr_err;
262 DATA_BLOB blob;
263 struct netr_LogonSamLogoff *r;
265 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGOFF];
267 r = talloc(talloc_tos(), struct netr_LogonSamLogoff);
268 if (r == NULL) {
269 return false;
272 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
273 talloc_free(r);
274 return false;
277 pull = ndr_pull_init_blob(&blob, r, NULL);
278 if (pull == NULL) {
279 talloc_free(r);
280 return false;
283 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
284 ndr_err = call->ndr_pull(pull, NDR_IN, r);
285 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
286 talloc_free(r);
287 return false;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, r);
294 ZERO_STRUCT(r->out);
295 r->out.return_authenticator = r->in.return_authenticator;
296 r->out.result = _netr_LogonSamLogoff(p, r);
298 if (p->rng_fault_state) {
299 talloc_free(r);
300 /* Return true here, srv_pipe_hnd.c will take care */
301 return true;
304 if (DEBUGLEVEL >= 10) {
305 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, r);
308 push = ndr_push_init_ctx(r, NULL);
309 if (push == NULL) {
310 talloc_free(r);
311 return false;
314 ndr_err = call->ndr_push(push, NDR_OUT, r);
315 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
316 talloc_free(r);
317 return false;
320 blob = ndr_push_blob(push);
321 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
322 talloc_free(r);
323 return false;
326 talloc_free(r);
328 return true;
331 static bool api_netr_ServerReqChallenge(pipes_struct *p)
333 const struct ndr_interface_call *call;
334 struct ndr_pull *pull;
335 struct ndr_push *push;
336 enum ndr_err_code ndr_err;
337 DATA_BLOB blob;
338 struct netr_ServerReqChallenge *r;
340 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERREQCHALLENGE];
342 r = talloc(talloc_tos(), struct netr_ServerReqChallenge);
343 if (r == NULL) {
344 return false;
347 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
348 talloc_free(r);
349 return false;
352 pull = ndr_pull_init_blob(&blob, r, NULL);
353 if (pull == NULL) {
354 talloc_free(r);
355 return false;
358 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
359 ndr_err = call->ndr_pull(pull, NDR_IN, r);
360 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
361 talloc_free(r);
362 return false;
365 if (DEBUGLEVEL >= 10) {
366 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, r);
369 ZERO_STRUCT(r->out);
370 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
371 if (r->out.return_credentials == NULL) {
372 talloc_free(r);
373 return false;
376 r->out.result = _netr_ServerReqChallenge(p, r);
378 if (p->rng_fault_state) {
379 talloc_free(r);
380 /* Return true here, srv_pipe_hnd.c will take care */
381 return true;
384 if (DEBUGLEVEL >= 10) {
385 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, r);
388 push = ndr_push_init_ctx(r, NULL);
389 if (push == NULL) {
390 talloc_free(r);
391 return false;
394 ndr_err = call->ndr_push(push, NDR_OUT, r);
395 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
396 talloc_free(r);
397 return false;
400 blob = ndr_push_blob(push);
401 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
402 talloc_free(r);
403 return false;
406 talloc_free(r);
408 return true;
411 static bool api_netr_ServerAuthenticate(pipes_struct *p)
413 const struct ndr_interface_call *call;
414 struct ndr_pull *pull;
415 struct ndr_push *push;
416 enum ndr_err_code ndr_err;
417 DATA_BLOB blob;
418 struct netr_ServerAuthenticate *r;
420 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE];
422 r = talloc(talloc_tos(), struct netr_ServerAuthenticate);
423 if (r == NULL) {
424 return false;
427 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
428 talloc_free(r);
429 return false;
432 pull = ndr_pull_init_blob(&blob, r, NULL);
433 if (pull == NULL) {
434 talloc_free(r);
435 return false;
438 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
439 ndr_err = call->ndr_pull(pull, NDR_IN, r);
440 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
441 talloc_free(r);
442 return false;
445 if (DEBUGLEVEL >= 10) {
446 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, r);
449 ZERO_STRUCT(r->out);
450 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
451 if (r->out.return_credentials == NULL) {
452 talloc_free(r);
453 return false;
456 r->out.result = _netr_ServerAuthenticate(p, r);
458 if (p->rng_fault_state) {
459 talloc_free(r);
460 /* Return true here, srv_pipe_hnd.c will take care */
461 return true;
464 if (DEBUGLEVEL >= 10) {
465 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, r);
468 push = ndr_push_init_ctx(r, NULL);
469 if (push == NULL) {
470 talloc_free(r);
471 return false;
474 ndr_err = call->ndr_push(push, NDR_OUT, r);
475 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
476 talloc_free(r);
477 return false;
480 blob = ndr_push_blob(push);
481 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
482 talloc_free(r);
483 return false;
486 talloc_free(r);
488 return true;
491 static bool api_netr_ServerPasswordSet(pipes_struct *p)
493 const struct ndr_interface_call *call;
494 struct ndr_pull *pull;
495 struct ndr_push *push;
496 enum ndr_err_code ndr_err;
497 DATA_BLOB blob;
498 struct netr_ServerPasswordSet *r;
500 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET];
502 r = talloc(talloc_tos(), struct netr_ServerPasswordSet);
503 if (r == NULL) {
504 return false;
507 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
508 talloc_free(r);
509 return false;
512 pull = ndr_pull_init_blob(&blob, r, NULL);
513 if (pull == NULL) {
514 talloc_free(r);
515 return false;
518 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
519 ndr_err = call->ndr_pull(pull, NDR_IN, r);
520 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
521 talloc_free(r);
522 return false;
525 if (DEBUGLEVEL >= 10) {
526 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, r);
529 ZERO_STRUCT(r->out);
530 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
531 if (r->out.return_authenticator == NULL) {
532 talloc_free(r);
533 return false;
536 r->out.result = _netr_ServerPasswordSet(p, r);
538 if (p->rng_fault_state) {
539 talloc_free(r);
540 /* Return true here, srv_pipe_hnd.c will take care */
541 return true;
544 if (DEBUGLEVEL >= 10) {
545 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, r);
548 push = ndr_push_init_ctx(r, NULL);
549 if (push == NULL) {
550 talloc_free(r);
551 return false;
554 ndr_err = call->ndr_push(push, NDR_OUT, r);
555 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
556 talloc_free(r);
557 return false;
560 blob = ndr_push_blob(push);
561 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
562 talloc_free(r);
563 return false;
566 talloc_free(r);
568 return true;
571 static bool api_netr_DatabaseDeltas(pipes_struct *p)
573 const struct ndr_interface_call *call;
574 struct ndr_pull *pull;
575 struct ndr_push *push;
576 enum ndr_err_code ndr_err;
577 DATA_BLOB blob;
578 struct netr_DatabaseDeltas *r;
580 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEDELTAS];
582 r = talloc(talloc_tos(), struct netr_DatabaseDeltas);
583 if (r == NULL) {
584 return false;
587 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
588 talloc_free(r);
589 return false;
592 pull = ndr_pull_init_blob(&blob, r, NULL);
593 if (pull == NULL) {
594 talloc_free(r);
595 return false;
598 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
599 ndr_err = call->ndr_pull(pull, NDR_IN, r);
600 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
601 talloc_free(r);
602 return false;
605 if (DEBUGLEVEL >= 10) {
606 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, r);
609 ZERO_STRUCT(r->out);
610 r->out.return_authenticator = r->in.return_authenticator;
611 r->out.sequence_num = r->in.sequence_num;
612 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
613 if (r->out.delta_enum_array == NULL) {
614 talloc_free(r);
615 return false;
618 r->out.result = _netr_DatabaseDeltas(p, r);
620 if (p->rng_fault_state) {
621 talloc_free(r);
622 /* Return true here, srv_pipe_hnd.c will take care */
623 return true;
626 if (DEBUGLEVEL >= 10) {
627 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, r);
630 push = ndr_push_init_ctx(r, NULL);
631 if (push == NULL) {
632 talloc_free(r);
633 return false;
636 ndr_err = call->ndr_push(push, NDR_OUT, r);
637 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
638 talloc_free(r);
639 return false;
642 blob = ndr_push_blob(push);
643 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
644 talloc_free(r);
645 return false;
648 talloc_free(r);
650 return true;
653 static bool api_netr_DatabaseSync(pipes_struct *p)
655 const struct ndr_interface_call *call;
656 struct ndr_pull *pull;
657 struct ndr_push *push;
658 enum ndr_err_code ndr_err;
659 DATA_BLOB blob;
660 struct netr_DatabaseSync *r;
662 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC];
664 r = talloc(talloc_tos(), struct netr_DatabaseSync);
665 if (r == NULL) {
666 return false;
669 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
670 talloc_free(r);
671 return false;
674 pull = ndr_pull_init_blob(&blob, r, NULL);
675 if (pull == NULL) {
676 talloc_free(r);
677 return false;
680 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
681 ndr_err = call->ndr_pull(pull, NDR_IN, r);
682 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
683 talloc_free(r);
684 return false;
687 if (DEBUGLEVEL >= 10) {
688 NDR_PRINT_IN_DEBUG(netr_DatabaseSync, r);
691 ZERO_STRUCT(r->out);
692 r->out.return_authenticator = r->in.return_authenticator;
693 r->out.sync_context = r->in.sync_context;
694 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
695 if (r->out.delta_enum_array == NULL) {
696 talloc_free(r);
697 return false;
700 r->out.result = _netr_DatabaseSync(p, r);
702 if (p->rng_fault_state) {
703 talloc_free(r);
704 /* Return true here, srv_pipe_hnd.c will take care */
705 return true;
708 if (DEBUGLEVEL >= 10) {
709 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, r);
712 push = ndr_push_init_ctx(r, NULL);
713 if (push == NULL) {
714 talloc_free(r);
715 return false;
718 ndr_err = call->ndr_push(push, NDR_OUT, r);
719 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
720 talloc_free(r);
721 return false;
724 blob = ndr_push_blob(push);
725 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
726 talloc_free(r);
727 return false;
730 talloc_free(r);
732 return true;
735 static bool api_netr_AccountDeltas(pipes_struct *p)
737 const struct ndr_interface_call *call;
738 struct ndr_pull *pull;
739 struct ndr_push *push;
740 enum ndr_err_code ndr_err;
741 DATA_BLOB blob;
742 struct netr_AccountDeltas *r;
744 call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTDELTAS];
746 r = talloc(talloc_tos(), struct netr_AccountDeltas);
747 if (r == NULL) {
748 return false;
751 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
752 talloc_free(r);
753 return false;
756 pull = ndr_pull_init_blob(&blob, r, NULL);
757 if (pull == NULL) {
758 talloc_free(r);
759 return false;
762 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
763 ndr_err = call->ndr_pull(pull, NDR_IN, r);
764 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
765 talloc_free(r);
766 return false;
769 if (DEBUGLEVEL >= 10) {
770 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, r);
773 ZERO_STRUCT(r->out);
774 r->out.return_authenticator = r->in.return_authenticator;
775 r->out.buffer = talloc_zero(r, struct netr_AccountBuffer);
776 if (r->out.buffer == NULL) {
777 talloc_free(r);
778 return false;
781 r->out.count_returned = talloc_zero(r, uint32_t);
782 if (r->out.count_returned == NULL) {
783 talloc_free(r);
784 return false;
787 r->out.total_entries = talloc_zero(r, uint32_t);
788 if (r->out.total_entries == NULL) {
789 talloc_free(r);
790 return false;
793 r->out.recordid = talloc_zero(r, struct netr_UAS_INFO_0);
794 if (r->out.recordid == NULL) {
795 talloc_free(r);
796 return false;
799 r->out.result = _netr_AccountDeltas(p, r);
801 if (p->rng_fault_state) {
802 talloc_free(r);
803 /* Return true here, srv_pipe_hnd.c will take care */
804 return true;
807 if (DEBUGLEVEL >= 10) {
808 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, r);
811 push = ndr_push_init_ctx(r, NULL);
812 if (push == NULL) {
813 talloc_free(r);
814 return false;
817 ndr_err = call->ndr_push(push, NDR_OUT, r);
818 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
819 talloc_free(r);
820 return false;
823 blob = ndr_push_blob(push);
824 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
825 talloc_free(r);
826 return false;
829 talloc_free(r);
831 return true;
834 static bool api_netr_AccountSync(pipes_struct *p)
836 const struct ndr_interface_call *call;
837 struct ndr_pull *pull;
838 struct ndr_push *push;
839 enum ndr_err_code ndr_err;
840 DATA_BLOB blob;
841 struct netr_AccountSync *r;
843 call = &ndr_table_netlogon.calls[NDR_NETR_ACCOUNTSYNC];
845 r = talloc(talloc_tos(), struct netr_AccountSync);
846 if (r == NULL) {
847 return false;
850 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
851 talloc_free(r);
852 return false;
855 pull = ndr_pull_init_blob(&blob, r, NULL);
856 if (pull == NULL) {
857 talloc_free(r);
858 return false;
861 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
862 ndr_err = call->ndr_pull(pull, NDR_IN, r);
863 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
864 talloc_free(r);
865 return false;
868 if (DEBUGLEVEL >= 10) {
869 NDR_PRINT_IN_DEBUG(netr_AccountSync, r);
872 ZERO_STRUCT(r->out);
873 r->out.return_authenticator = r->in.return_authenticator;
874 r->out.recordid = r->in.recordid;
875 r->out.buffer = talloc_zero(r, struct netr_AccountBuffer);
876 if (r->out.buffer == NULL) {
877 talloc_free(r);
878 return false;
881 r->out.count_returned = talloc_zero(r, uint32_t);
882 if (r->out.count_returned == NULL) {
883 talloc_free(r);
884 return false;
887 r->out.total_entries = talloc_zero(r, uint32_t);
888 if (r->out.total_entries == NULL) {
889 talloc_free(r);
890 return false;
893 r->out.next_reference = talloc_zero(r, uint32_t);
894 if (r->out.next_reference == NULL) {
895 talloc_free(r);
896 return false;
899 r->out.result = _netr_AccountSync(p, r);
901 if (p->rng_fault_state) {
902 talloc_free(r);
903 /* Return true here, srv_pipe_hnd.c will take care */
904 return true;
907 if (DEBUGLEVEL >= 10) {
908 NDR_PRINT_OUT_DEBUG(netr_AccountSync, r);
911 push = ndr_push_init_ctx(r, NULL);
912 if (push == NULL) {
913 talloc_free(r);
914 return false;
917 ndr_err = call->ndr_push(push, NDR_OUT, r);
918 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
919 talloc_free(r);
920 return false;
923 blob = ndr_push_blob(push);
924 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
925 talloc_free(r);
926 return false;
929 talloc_free(r);
931 return true;
934 static bool api_netr_GetDcName(pipes_struct *p)
936 const struct ndr_interface_call *call;
937 struct ndr_pull *pull;
938 struct ndr_push *push;
939 enum ndr_err_code ndr_err;
940 DATA_BLOB blob;
941 struct netr_GetDcName *r;
943 call = &ndr_table_netlogon.calls[NDR_NETR_GETDCNAME];
945 r = talloc(talloc_tos(), struct netr_GetDcName);
946 if (r == NULL) {
947 return false;
950 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
951 talloc_free(r);
952 return false;
955 pull = ndr_pull_init_blob(&blob, r, NULL);
956 if (pull == NULL) {
957 talloc_free(r);
958 return false;
961 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
962 ndr_err = call->ndr_pull(pull, NDR_IN, r);
963 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
964 talloc_free(r);
965 return false;
968 if (DEBUGLEVEL >= 10) {
969 NDR_PRINT_IN_DEBUG(netr_GetDcName, r);
972 ZERO_STRUCT(r->out);
973 r->out.dcname = talloc_zero(r, const char *);
974 if (r->out.dcname == NULL) {
975 talloc_free(r);
976 return false;
979 r->out.result = _netr_GetDcName(p, r);
981 if (p->rng_fault_state) {
982 talloc_free(r);
983 /* Return true here, srv_pipe_hnd.c will take care */
984 return true;
987 if (DEBUGLEVEL >= 10) {
988 NDR_PRINT_OUT_DEBUG(netr_GetDcName, r);
991 push = ndr_push_init_ctx(r, NULL);
992 if (push == NULL) {
993 talloc_free(r);
994 return false;
997 ndr_err = call->ndr_push(push, NDR_OUT, r);
998 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
999 talloc_free(r);
1000 return false;
1003 blob = ndr_push_blob(push);
1004 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1005 talloc_free(r);
1006 return false;
1009 talloc_free(r);
1011 return true;
1014 static bool api_netr_LogonControl(pipes_struct *p)
1016 const struct ndr_interface_call *call;
1017 struct ndr_pull *pull;
1018 struct ndr_push *push;
1019 enum ndr_err_code ndr_err;
1020 DATA_BLOB blob;
1021 struct netr_LogonControl *r;
1023 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL];
1025 r = talloc(talloc_tos(), struct netr_LogonControl);
1026 if (r == NULL) {
1027 return false;
1030 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1031 talloc_free(r);
1032 return false;
1035 pull = ndr_pull_init_blob(&blob, r, NULL);
1036 if (pull == NULL) {
1037 talloc_free(r);
1038 return false;
1041 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1042 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1043 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1044 talloc_free(r);
1045 return false;
1048 if (DEBUGLEVEL >= 10) {
1049 NDR_PRINT_IN_DEBUG(netr_LogonControl, r);
1052 ZERO_STRUCT(r->out);
1053 r->out.info = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1054 if (r->out.info == NULL) {
1055 talloc_free(r);
1056 return false;
1059 r->out.result = _netr_LogonControl(p, r);
1061 if (p->rng_fault_state) {
1062 talloc_free(r);
1063 /* Return true here, srv_pipe_hnd.c will take care */
1064 return true;
1067 if (DEBUGLEVEL >= 10) {
1068 NDR_PRINT_OUT_DEBUG(netr_LogonControl, r);
1071 push = ndr_push_init_ctx(r, NULL);
1072 if (push == NULL) {
1073 talloc_free(r);
1074 return false;
1077 ndr_err = call->ndr_push(push, NDR_OUT, r);
1078 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1079 talloc_free(r);
1080 return false;
1083 blob = ndr_push_blob(push);
1084 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1085 talloc_free(r);
1086 return false;
1089 talloc_free(r);
1091 return true;
1094 static bool api_netr_GetAnyDCName(pipes_struct *p)
1096 const struct ndr_interface_call *call;
1097 struct ndr_pull *pull;
1098 struct ndr_push *push;
1099 enum ndr_err_code ndr_err;
1100 DATA_BLOB blob;
1101 struct netr_GetAnyDCName *r;
1103 call = &ndr_table_netlogon.calls[NDR_NETR_GETANYDCNAME];
1105 r = talloc(talloc_tos(), struct netr_GetAnyDCName);
1106 if (r == NULL) {
1107 return false;
1110 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1111 talloc_free(r);
1112 return false;
1115 pull = ndr_pull_init_blob(&blob, r, NULL);
1116 if (pull == NULL) {
1117 talloc_free(r);
1118 return false;
1121 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1122 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1123 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1124 talloc_free(r);
1125 return false;
1128 if (DEBUGLEVEL >= 10) {
1129 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, r);
1132 ZERO_STRUCT(r->out);
1133 r->out.dcname = talloc_zero(r, const char *);
1134 if (r->out.dcname == NULL) {
1135 talloc_free(r);
1136 return false;
1139 r->out.result = _netr_GetAnyDCName(p, r);
1141 if (p->rng_fault_state) {
1142 talloc_free(r);
1143 /* Return true here, srv_pipe_hnd.c will take care */
1144 return true;
1147 if (DEBUGLEVEL >= 10) {
1148 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, r);
1151 push = ndr_push_init_ctx(r, NULL);
1152 if (push == NULL) {
1153 talloc_free(r);
1154 return false;
1157 ndr_err = call->ndr_push(push, NDR_OUT, r);
1158 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1159 talloc_free(r);
1160 return false;
1163 blob = ndr_push_blob(push);
1164 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1165 talloc_free(r);
1166 return false;
1169 talloc_free(r);
1171 return true;
1174 static bool api_netr_LogonControl2(pipes_struct *p)
1176 const struct ndr_interface_call *call;
1177 struct ndr_pull *pull;
1178 struct ndr_push *push;
1179 enum ndr_err_code ndr_err;
1180 DATA_BLOB blob;
1181 struct netr_LogonControl2 *r;
1183 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2];
1185 r = talloc(talloc_tos(), struct netr_LogonControl2);
1186 if (r == NULL) {
1187 return false;
1190 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1191 talloc_free(r);
1192 return false;
1195 pull = ndr_pull_init_blob(&blob, r, NULL);
1196 if (pull == NULL) {
1197 talloc_free(r);
1198 return false;
1201 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1202 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1204 talloc_free(r);
1205 return false;
1208 if (DEBUGLEVEL >= 10) {
1209 NDR_PRINT_IN_DEBUG(netr_LogonControl2, r);
1212 ZERO_STRUCT(r->out);
1213 r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1214 if (r->out.query == NULL) {
1215 talloc_free(r);
1216 return false;
1219 r->out.result = _netr_LogonControl2(p, r);
1221 if (p->rng_fault_state) {
1222 talloc_free(r);
1223 /* Return true here, srv_pipe_hnd.c will take care */
1224 return true;
1227 if (DEBUGLEVEL >= 10) {
1228 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, r);
1231 push = ndr_push_init_ctx(r, NULL);
1232 if (push == NULL) {
1233 talloc_free(r);
1234 return false;
1237 ndr_err = call->ndr_push(push, NDR_OUT, r);
1238 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1239 talloc_free(r);
1240 return false;
1243 blob = ndr_push_blob(push);
1244 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1245 talloc_free(r);
1246 return false;
1249 talloc_free(r);
1251 return true;
1254 static bool api_netr_ServerAuthenticate2(pipes_struct *p)
1256 const struct ndr_interface_call *call;
1257 struct ndr_pull *pull;
1258 struct ndr_push *push;
1259 enum ndr_err_code ndr_err;
1260 DATA_BLOB blob;
1261 struct netr_ServerAuthenticate2 *r;
1263 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE2];
1265 r = talloc(talloc_tos(), struct netr_ServerAuthenticate2);
1266 if (r == NULL) {
1267 return false;
1270 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1271 talloc_free(r);
1272 return false;
1275 pull = ndr_pull_init_blob(&blob, r, NULL);
1276 if (pull == NULL) {
1277 talloc_free(r);
1278 return false;
1281 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1282 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1283 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1284 talloc_free(r);
1285 return false;
1288 if (DEBUGLEVEL >= 10) {
1289 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, r);
1292 ZERO_STRUCT(r->out);
1293 r->out.negotiate_flags = r->in.negotiate_flags;
1294 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
1295 if (r->out.return_credentials == NULL) {
1296 talloc_free(r);
1297 return false;
1300 r->out.result = _netr_ServerAuthenticate2(p, r);
1302 if (p->rng_fault_state) {
1303 talloc_free(r);
1304 /* Return true here, srv_pipe_hnd.c will take care */
1305 return true;
1308 if (DEBUGLEVEL >= 10) {
1309 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, r);
1312 push = ndr_push_init_ctx(r, NULL);
1313 if (push == NULL) {
1314 talloc_free(r);
1315 return false;
1318 ndr_err = call->ndr_push(push, NDR_OUT, r);
1319 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1320 talloc_free(r);
1321 return false;
1324 blob = ndr_push_blob(push);
1325 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1326 talloc_free(r);
1327 return false;
1330 talloc_free(r);
1332 return true;
1335 static bool api_netr_DatabaseSync2(pipes_struct *p)
1337 const struct ndr_interface_call *call;
1338 struct ndr_pull *pull;
1339 struct ndr_push *push;
1340 enum ndr_err_code ndr_err;
1341 DATA_BLOB blob;
1342 struct netr_DatabaseSync2 *r;
1344 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASESYNC2];
1346 r = talloc(talloc_tos(), struct netr_DatabaseSync2);
1347 if (r == NULL) {
1348 return false;
1351 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1352 talloc_free(r);
1353 return false;
1356 pull = ndr_pull_init_blob(&blob, r, NULL);
1357 if (pull == NULL) {
1358 talloc_free(r);
1359 return false;
1362 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1363 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1364 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1365 talloc_free(r);
1366 return false;
1369 if (DEBUGLEVEL >= 10) {
1370 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, r);
1373 ZERO_STRUCT(r->out);
1374 r->out.return_authenticator = r->in.return_authenticator;
1375 r->out.sync_context = r->in.sync_context;
1376 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
1377 if (r->out.delta_enum_array == NULL) {
1378 talloc_free(r);
1379 return false;
1382 r->out.result = _netr_DatabaseSync2(p, r);
1384 if (p->rng_fault_state) {
1385 talloc_free(r);
1386 /* Return true here, srv_pipe_hnd.c will take care */
1387 return true;
1390 if (DEBUGLEVEL >= 10) {
1391 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, r);
1394 push = ndr_push_init_ctx(r, NULL);
1395 if (push == NULL) {
1396 talloc_free(r);
1397 return false;
1400 ndr_err = call->ndr_push(push, NDR_OUT, r);
1401 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1402 talloc_free(r);
1403 return false;
1406 blob = ndr_push_blob(push);
1407 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1408 talloc_free(r);
1409 return false;
1412 talloc_free(r);
1414 return true;
1417 static bool api_netr_DatabaseRedo(pipes_struct *p)
1419 const struct ndr_interface_call *call;
1420 struct ndr_pull *pull;
1421 struct ndr_push *push;
1422 enum ndr_err_code ndr_err;
1423 DATA_BLOB blob;
1424 struct netr_DatabaseRedo *r;
1426 call = &ndr_table_netlogon.calls[NDR_NETR_DATABASEREDO];
1428 r = talloc(talloc_tos(), struct netr_DatabaseRedo);
1429 if (r == NULL) {
1430 return false;
1433 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1434 talloc_free(r);
1435 return false;
1438 pull = ndr_pull_init_blob(&blob, r, NULL);
1439 if (pull == NULL) {
1440 talloc_free(r);
1441 return false;
1444 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1445 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1446 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1447 talloc_free(r);
1448 return false;
1451 if (DEBUGLEVEL >= 10) {
1452 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, r);
1455 ZERO_STRUCT(r->out);
1456 r->out.return_authenticator = r->in.return_authenticator;
1457 r->out.delta_enum_array = talloc_zero(r, struct netr_DELTA_ENUM_ARRAY *);
1458 if (r->out.delta_enum_array == NULL) {
1459 talloc_free(r);
1460 return false;
1463 r->out.result = _netr_DatabaseRedo(p, r);
1465 if (p->rng_fault_state) {
1466 talloc_free(r);
1467 /* Return true here, srv_pipe_hnd.c will take care */
1468 return true;
1471 if (DEBUGLEVEL >= 10) {
1472 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, r);
1475 push = ndr_push_init_ctx(r, NULL);
1476 if (push == NULL) {
1477 talloc_free(r);
1478 return false;
1481 ndr_err = call->ndr_push(push, NDR_OUT, r);
1482 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1483 talloc_free(r);
1484 return false;
1487 blob = ndr_push_blob(push);
1488 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1489 talloc_free(r);
1490 return false;
1493 talloc_free(r);
1495 return true;
1498 static bool api_netr_LogonControl2Ex(pipes_struct *p)
1500 const struct ndr_interface_call *call;
1501 struct ndr_pull *pull;
1502 struct ndr_push *push;
1503 enum ndr_err_code ndr_err;
1504 DATA_BLOB blob;
1505 struct netr_LogonControl2Ex *r;
1507 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONCONTROL2EX];
1509 r = talloc(talloc_tos(), struct netr_LogonControl2Ex);
1510 if (r == NULL) {
1511 return false;
1514 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1515 talloc_free(r);
1516 return false;
1519 pull = ndr_pull_init_blob(&blob, r, NULL);
1520 if (pull == NULL) {
1521 talloc_free(r);
1522 return false;
1525 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1526 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1527 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1528 talloc_free(r);
1529 return false;
1532 if (DEBUGLEVEL >= 10) {
1533 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, r);
1536 ZERO_STRUCT(r->out);
1537 r->out.query = talloc_zero(r, union netr_CONTROL_QUERY_INFORMATION);
1538 if (r->out.query == NULL) {
1539 talloc_free(r);
1540 return false;
1543 r->out.result = _netr_LogonControl2Ex(p, r);
1545 if (p->rng_fault_state) {
1546 talloc_free(r);
1547 /* Return true here, srv_pipe_hnd.c will take care */
1548 return true;
1551 if (DEBUGLEVEL >= 10) {
1552 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, r);
1555 push = ndr_push_init_ctx(r, NULL);
1556 if (push == NULL) {
1557 talloc_free(r);
1558 return false;
1561 ndr_err = call->ndr_push(push, NDR_OUT, r);
1562 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1563 talloc_free(r);
1564 return false;
1567 blob = ndr_push_blob(push);
1568 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1569 talloc_free(r);
1570 return false;
1573 talloc_free(r);
1575 return true;
1578 static bool api_netr_NetrEnumerateTrustedDomains(pipes_struct *p)
1580 const struct ndr_interface_call *call;
1581 struct ndr_pull *pull;
1582 struct ndr_push *push;
1583 enum ndr_err_code ndr_err;
1584 DATA_BLOB blob;
1585 struct netr_NetrEnumerateTrustedDomains *r;
1587 call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINS];
1589 r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomains);
1590 if (r == NULL) {
1591 return false;
1594 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1595 talloc_free(r);
1596 return false;
1599 pull = ndr_pull_init_blob(&blob, r, NULL);
1600 if (pull == NULL) {
1601 talloc_free(r);
1602 return false;
1605 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1606 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1607 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1608 talloc_free(r);
1609 return false;
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, r);
1616 ZERO_STRUCT(r->out);
1617 r->out.trusted_domains_blob = talloc_zero(r, struct netr_Blob);
1618 if (r->out.trusted_domains_blob == NULL) {
1619 talloc_free(r);
1620 return false;
1623 r->out.result = _netr_NetrEnumerateTrustedDomains(p, r);
1625 if (p->rng_fault_state) {
1626 talloc_free(r);
1627 /* Return true here, srv_pipe_hnd.c will take care */
1628 return true;
1631 if (DEBUGLEVEL >= 10) {
1632 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, r);
1635 push = ndr_push_init_ctx(r, NULL);
1636 if (push == NULL) {
1637 talloc_free(r);
1638 return false;
1641 ndr_err = call->ndr_push(push, NDR_OUT, r);
1642 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1643 talloc_free(r);
1644 return false;
1647 blob = ndr_push_blob(push);
1648 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1649 talloc_free(r);
1650 return false;
1653 talloc_free(r);
1655 return true;
1658 static bool api_netr_DsRGetDCName(pipes_struct *p)
1660 const struct ndr_interface_call *call;
1661 struct ndr_pull *pull;
1662 struct ndr_push *push;
1663 enum ndr_err_code ndr_err;
1664 DATA_BLOB blob;
1665 struct netr_DsRGetDCName *r;
1667 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAME];
1669 r = talloc(talloc_tos(), struct netr_DsRGetDCName);
1670 if (r == NULL) {
1671 return false;
1674 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1675 talloc_free(r);
1676 return false;
1679 pull = ndr_pull_init_blob(&blob, r, NULL);
1680 if (pull == NULL) {
1681 talloc_free(r);
1682 return false;
1685 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1686 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1687 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1688 talloc_free(r);
1689 return false;
1692 if (DEBUGLEVEL >= 10) {
1693 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, r);
1696 ZERO_STRUCT(r->out);
1697 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
1698 if (r->out.info == NULL) {
1699 talloc_free(r);
1700 return false;
1703 r->out.result = _netr_DsRGetDCName(p, r);
1705 if (p->rng_fault_state) {
1706 talloc_free(r);
1707 /* Return true here, srv_pipe_hnd.c will take care */
1708 return true;
1711 if (DEBUGLEVEL >= 10) {
1712 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, r);
1715 push = ndr_push_init_ctx(r, NULL);
1716 if (push == NULL) {
1717 talloc_free(r);
1718 return false;
1721 ndr_err = call->ndr_push(push, NDR_OUT, r);
1722 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1723 talloc_free(r);
1724 return false;
1727 blob = ndr_push_blob(push);
1728 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1729 talloc_free(r);
1730 return false;
1733 talloc_free(r);
1735 return true;
1738 static bool api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p)
1740 const struct ndr_interface_call *call;
1741 struct ndr_pull *pull;
1742 struct ndr_push *push;
1743 enum ndr_err_code ndr_err;
1744 DATA_BLOB blob;
1745 struct netr_NETRLOGONDUMMYROUTINE1 *r;
1747 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONDUMMYROUTINE1];
1749 r = talloc(talloc_tos(), struct netr_NETRLOGONDUMMYROUTINE1);
1750 if (r == NULL) {
1751 return false;
1754 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1755 talloc_free(r);
1756 return false;
1759 pull = ndr_pull_init_blob(&blob, r, NULL);
1760 if (pull == NULL) {
1761 talloc_free(r);
1762 return false;
1765 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1766 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1767 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1768 talloc_free(r);
1769 return false;
1772 if (DEBUGLEVEL >= 10) {
1773 NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r);
1776 r->out.result = _netr_NETRLOGONDUMMYROUTINE1(p, r);
1778 if (p->rng_fault_state) {
1779 talloc_free(r);
1780 /* Return true here, srv_pipe_hnd.c will take care */
1781 return true;
1784 if (DEBUGLEVEL >= 10) {
1785 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, r);
1788 push = ndr_push_init_ctx(r, NULL);
1789 if (push == NULL) {
1790 talloc_free(r);
1791 return false;
1794 ndr_err = call->ndr_push(push, NDR_OUT, r);
1795 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1796 talloc_free(r);
1797 return false;
1800 blob = ndr_push_blob(push);
1801 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1802 talloc_free(r);
1803 return false;
1806 talloc_free(r);
1808 return true;
1811 static bool api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p)
1813 const struct ndr_interface_call *call;
1814 struct ndr_pull *pull;
1815 struct ndr_push *push;
1816 enum ndr_err_code ndr_err;
1817 DATA_BLOB blob;
1818 struct netr_NETRLOGONSETSERVICEBITS *r;
1820 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSETSERVICEBITS];
1822 r = talloc(talloc_tos(), struct netr_NETRLOGONSETSERVICEBITS);
1823 if (r == NULL) {
1824 return false;
1827 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1828 talloc_free(r);
1829 return false;
1832 pull = ndr_pull_init_blob(&blob, r, NULL);
1833 if (pull == NULL) {
1834 talloc_free(r);
1835 return false;
1838 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1839 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1840 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1841 talloc_free(r);
1842 return false;
1845 if (DEBUGLEVEL >= 10) {
1846 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, r);
1849 r->out.result = _netr_NETRLOGONSETSERVICEBITS(p, r);
1851 if (p->rng_fault_state) {
1852 talloc_free(r);
1853 /* Return true here, srv_pipe_hnd.c will take care */
1854 return true;
1857 if (DEBUGLEVEL >= 10) {
1858 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, r);
1861 push = ndr_push_init_ctx(r, NULL);
1862 if (push == NULL) {
1863 talloc_free(r);
1864 return false;
1867 ndr_err = call->ndr_push(push, NDR_OUT, r);
1868 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1869 talloc_free(r);
1870 return false;
1873 blob = ndr_push_blob(push);
1874 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1875 talloc_free(r);
1876 return false;
1879 talloc_free(r);
1881 return true;
1884 static bool api_netr_LogonGetTrustRid(pipes_struct *p)
1886 const struct ndr_interface_call *call;
1887 struct ndr_pull *pull;
1888 struct ndr_push *push;
1889 enum ndr_err_code ndr_err;
1890 DATA_BLOB blob;
1891 struct netr_LogonGetTrustRid *r;
1893 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETTRUSTRID];
1895 r = talloc(talloc_tos(), struct netr_LogonGetTrustRid);
1896 if (r == NULL) {
1897 return false;
1900 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1901 talloc_free(r);
1902 return false;
1905 pull = ndr_pull_init_blob(&blob, r, NULL);
1906 if (pull == NULL) {
1907 talloc_free(r);
1908 return false;
1911 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1912 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1913 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1914 talloc_free(r);
1915 return false;
1918 if (DEBUGLEVEL >= 10) {
1919 NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid, r);
1922 ZERO_STRUCT(r->out);
1923 r->out.rid = talloc_zero(r, uint32_t);
1924 if (r->out.rid == NULL) {
1925 talloc_free(r);
1926 return false;
1929 r->out.result = _netr_LogonGetTrustRid(p, r);
1931 if (p->rng_fault_state) {
1932 talloc_free(r);
1933 /* Return true here, srv_pipe_hnd.c will take care */
1934 return true;
1937 if (DEBUGLEVEL >= 10) {
1938 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, r);
1941 push = ndr_push_init_ctx(r, NULL);
1942 if (push == NULL) {
1943 talloc_free(r);
1944 return false;
1947 ndr_err = call->ndr_push(push, NDR_OUT, r);
1948 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1949 talloc_free(r);
1950 return false;
1953 blob = ndr_push_blob(push);
1954 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1955 talloc_free(r);
1956 return false;
1959 talloc_free(r);
1961 return true;
1964 static bool api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p)
1966 const struct ndr_interface_call *call;
1967 struct ndr_pull *pull;
1968 struct ndr_push *push;
1969 enum ndr_err_code ndr_err;
1970 DATA_BLOB blob;
1971 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r;
1973 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST];
1975 r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTESERVERDIGEST);
1976 if (r == NULL) {
1977 return false;
1980 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1981 talloc_free(r);
1982 return false;
1985 pull = ndr_pull_init_blob(&blob, r, NULL);
1986 if (pull == NULL) {
1987 talloc_free(r);
1988 return false;
1991 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1992 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1993 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1994 talloc_free(r);
1995 return false;
1998 if (DEBUGLEVEL >= 10) {
1999 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r);
2002 r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, r);
2004 if (p->rng_fault_state) {
2005 talloc_free(r);
2006 /* Return true here, srv_pipe_hnd.c will take care */
2007 return true;
2010 if (DEBUGLEVEL >= 10) {
2011 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, r);
2014 push = ndr_push_init_ctx(r, NULL);
2015 if (push == NULL) {
2016 talloc_free(r);
2017 return false;
2020 ndr_err = call->ndr_push(push, NDR_OUT, r);
2021 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2022 talloc_free(r);
2023 return false;
2026 blob = ndr_push_blob(push);
2027 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2028 talloc_free(r);
2029 return false;
2032 talloc_free(r);
2034 return true;
2037 static bool api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p)
2039 const struct ndr_interface_call *call;
2040 struct ndr_pull *pull;
2041 struct ndr_push *push;
2042 enum ndr_err_code ndr_err;
2043 DATA_BLOB blob;
2044 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r;
2046 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST];
2048 r = talloc(talloc_tos(), struct netr_NETRLOGONCOMPUTECLIENTDIGEST);
2049 if (r == NULL) {
2050 return false;
2053 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2054 talloc_free(r);
2055 return false;
2058 pull = ndr_pull_init_blob(&blob, r, NULL);
2059 if (pull == NULL) {
2060 talloc_free(r);
2061 return false;
2064 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2065 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2066 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2067 talloc_free(r);
2068 return false;
2071 if (DEBUGLEVEL >= 10) {
2072 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r);
2075 r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, r);
2077 if (p->rng_fault_state) {
2078 talloc_free(r);
2079 /* Return true here, srv_pipe_hnd.c will take care */
2080 return true;
2083 if (DEBUGLEVEL >= 10) {
2084 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, r);
2087 push = ndr_push_init_ctx(r, NULL);
2088 if (push == NULL) {
2089 talloc_free(r);
2090 return false;
2093 ndr_err = call->ndr_push(push, NDR_OUT, r);
2094 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2095 talloc_free(r);
2096 return false;
2099 blob = ndr_push_blob(push);
2100 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2101 talloc_free(r);
2102 return false;
2105 talloc_free(r);
2107 return true;
2110 static bool api_netr_ServerAuthenticate3(pipes_struct *p)
2112 const struct ndr_interface_call *call;
2113 struct ndr_pull *pull;
2114 struct ndr_push *push;
2115 enum ndr_err_code ndr_err;
2116 DATA_BLOB blob;
2117 struct netr_ServerAuthenticate3 *r;
2119 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERAUTHENTICATE3];
2121 r = talloc(talloc_tos(), struct netr_ServerAuthenticate3);
2122 if (r == NULL) {
2123 return false;
2126 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2127 talloc_free(r);
2128 return false;
2131 pull = ndr_pull_init_blob(&blob, r, NULL);
2132 if (pull == NULL) {
2133 talloc_free(r);
2134 return false;
2137 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2138 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2139 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2140 talloc_free(r);
2141 return false;
2144 if (DEBUGLEVEL >= 10) {
2145 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, r);
2148 ZERO_STRUCT(r->out);
2149 r->out.negotiate_flags = r->in.negotiate_flags;
2150 r->out.return_credentials = talloc_zero(r, struct netr_Credential);
2151 if (r->out.return_credentials == NULL) {
2152 talloc_free(r);
2153 return false;
2156 r->out.rid = talloc_zero(r, uint32_t);
2157 if (r->out.rid == NULL) {
2158 talloc_free(r);
2159 return false;
2162 r->out.result = _netr_ServerAuthenticate3(p, r);
2164 if (p->rng_fault_state) {
2165 talloc_free(r);
2166 /* Return true here, srv_pipe_hnd.c will take care */
2167 return true;
2170 if (DEBUGLEVEL >= 10) {
2171 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, r);
2174 push = ndr_push_init_ctx(r, NULL);
2175 if (push == NULL) {
2176 talloc_free(r);
2177 return false;
2180 ndr_err = call->ndr_push(push, NDR_OUT, r);
2181 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2182 talloc_free(r);
2183 return false;
2186 blob = ndr_push_blob(push);
2187 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2188 talloc_free(r);
2189 return false;
2192 talloc_free(r);
2194 return true;
2197 static bool api_netr_DsRGetDCNameEx(pipes_struct *p)
2199 const struct ndr_interface_call *call;
2200 struct ndr_pull *pull;
2201 struct ndr_push *push;
2202 enum ndr_err_code ndr_err;
2203 DATA_BLOB blob;
2204 struct netr_DsRGetDCNameEx *r;
2206 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX];
2208 r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx);
2209 if (r == NULL) {
2210 return false;
2213 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2214 talloc_free(r);
2215 return false;
2218 pull = ndr_pull_init_blob(&blob, r, NULL);
2219 if (pull == NULL) {
2220 talloc_free(r);
2221 return false;
2224 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2225 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2226 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2227 talloc_free(r);
2228 return false;
2231 if (DEBUGLEVEL >= 10) {
2232 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, r);
2235 ZERO_STRUCT(r->out);
2236 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
2237 if (r->out.info == NULL) {
2238 talloc_free(r);
2239 return false;
2242 r->out.result = _netr_DsRGetDCNameEx(p, r);
2244 if (p->rng_fault_state) {
2245 talloc_free(r);
2246 /* Return true here, srv_pipe_hnd.c will take care */
2247 return true;
2250 if (DEBUGLEVEL >= 10) {
2251 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, r);
2254 push = ndr_push_init_ctx(r, NULL);
2255 if (push == NULL) {
2256 talloc_free(r);
2257 return false;
2260 ndr_err = call->ndr_push(push, NDR_OUT, r);
2261 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2262 talloc_free(r);
2263 return false;
2266 blob = ndr_push_blob(push);
2267 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2268 talloc_free(r);
2269 return false;
2272 talloc_free(r);
2274 return true;
2277 static bool api_netr_DsRGetSiteName(pipes_struct *p)
2279 const struct ndr_interface_call *call;
2280 struct ndr_pull *pull;
2281 struct ndr_push *push;
2282 enum ndr_err_code ndr_err;
2283 DATA_BLOB blob;
2284 struct netr_DsRGetSiteName *r;
2286 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETSITENAME];
2288 r = talloc(talloc_tos(), struct netr_DsRGetSiteName);
2289 if (r == NULL) {
2290 return false;
2293 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2294 talloc_free(r);
2295 return false;
2298 pull = ndr_pull_init_blob(&blob, r, NULL);
2299 if (pull == NULL) {
2300 talloc_free(r);
2301 return false;
2304 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2305 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2306 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2307 talloc_free(r);
2308 return false;
2311 if (DEBUGLEVEL >= 10) {
2312 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, r);
2315 ZERO_STRUCT(r->out);
2316 r->out.site = talloc_zero(r, const char *);
2317 if (r->out.site == NULL) {
2318 talloc_free(r);
2319 return false;
2322 r->out.result = _netr_DsRGetSiteName(p, r);
2324 if (p->rng_fault_state) {
2325 talloc_free(r);
2326 /* Return true here, srv_pipe_hnd.c will take care */
2327 return true;
2330 if (DEBUGLEVEL >= 10) {
2331 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, r);
2334 push = ndr_push_init_ctx(r, NULL);
2335 if (push == NULL) {
2336 talloc_free(r);
2337 return false;
2340 ndr_err = call->ndr_push(push, NDR_OUT, r);
2341 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2342 talloc_free(r);
2343 return false;
2346 blob = ndr_push_blob(push);
2347 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2348 talloc_free(r);
2349 return false;
2352 talloc_free(r);
2354 return true;
2357 static bool api_netr_LogonGetDomainInfo(pipes_struct *p)
2359 const struct ndr_interface_call *call;
2360 struct ndr_pull *pull;
2361 struct ndr_push *push;
2362 enum ndr_err_code ndr_err;
2363 DATA_BLOB blob;
2364 struct netr_LogonGetDomainInfo *r;
2366 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONGETDOMAININFO];
2368 r = talloc(talloc_tos(), struct netr_LogonGetDomainInfo);
2369 if (r == NULL) {
2370 return false;
2373 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2374 talloc_free(r);
2375 return false;
2378 pull = ndr_pull_init_blob(&blob, r, NULL);
2379 if (pull == NULL) {
2380 talloc_free(r);
2381 return false;
2384 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2385 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2386 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2387 talloc_free(r);
2388 return false;
2391 if (DEBUGLEVEL >= 10) {
2392 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, r);
2395 ZERO_STRUCT(r->out);
2396 r->out.return_authenticator = r->in.return_authenticator;
2397 r->out.info = talloc_zero(r, union netr_DomainInfo);
2398 if (r->out.info == NULL) {
2399 talloc_free(r);
2400 return false;
2403 r->out.result = _netr_LogonGetDomainInfo(p, r);
2405 if (p->rng_fault_state) {
2406 talloc_free(r);
2407 /* Return true here, srv_pipe_hnd.c will take care */
2408 return true;
2411 if (DEBUGLEVEL >= 10) {
2412 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, r);
2415 push = ndr_push_init_ctx(r, NULL);
2416 if (push == NULL) {
2417 talloc_free(r);
2418 return false;
2421 ndr_err = call->ndr_push(push, NDR_OUT, r);
2422 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2423 talloc_free(r);
2424 return false;
2427 blob = ndr_push_blob(push);
2428 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2429 talloc_free(r);
2430 return false;
2433 talloc_free(r);
2435 return true;
2438 static bool api_netr_ServerPasswordSet2(pipes_struct *p)
2440 const struct ndr_interface_call *call;
2441 struct ndr_pull *pull;
2442 struct ndr_push *push;
2443 enum ndr_err_code ndr_err;
2444 DATA_BLOB blob;
2445 struct netr_ServerPasswordSet2 *r;
2447 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDSET2];
2449 r = talloc(talloc_tos(), struct netr_ServerPasswordSet2);
2450 if (r == NULL) {
2451 return false;
2454 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2455 talloc_free(r);
2456 return false;
2459 pull = ndr_pull_init_blob(&blob, r, NULL);
2460 if (pull == NULL) {
2461 talloc_free(r);
2462 return false;
2465 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2466 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2467 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2468 talloc_free(r);
2469 return false;
2472 if (DEBUGLEVEL >= 10) {
2473 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, r);
2476 ZERO_STRUCT(r->out);
2477 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
2478 if (r->out.return_authenticator == NULL) {
2479 talloc_free(r);
2480 return false;
2483 r->out.result = _netr_ServerPasswordSet2(p, r);
2485 if (p->rng_fault_state) {
2486 talloc_free(r);
2487 /* Return true here, srv_pipe_hnd.c will take care */
2488 return true;
2491 if (DEBUGLEVEL >= 10) {
2492 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, r);
2495 push = ndr_push_init_ctx(r, NULL);
2496 if (push == NULL) {
2497 talloc_free(r);
2498 return false;
2501 ndr_err = call->ndr_push(push, NDR_OUT, r);
2502 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2503 talloc_free(r);
2504 return false;
2507 blob = ndr_push_blob(push);
2508 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2509 talloc_free(r);
2510 return false;
2513 talloc_free(r);
2515 return true;
2518 static bool api_netr_ServerPasswordGet(pipes_struct *p)
2520 const struct ndr_interface_call *call;
2521 struct ndr_pull *pull;
2522 struct ndr_push *push;
2523 enum ndr_err_code ndr_err;
2524 DATA_BLOB blob;
2525 struct netr_ServerPasswordGet *r;
2527 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERPASSWORDGET];
2529 r = talloc(talloc_tos(), struct netr_ServerPasswordGet);
2530 if (r == NULL) {
2531 return false;
2534 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2535 talloc_free(r);
2536 return false;
2539 pull = ndr_pull_init_blob(&blob, r, NULL);
2540 if (pull == NULL) {
2541 talloc_free(r);
2542 return false;
2545 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2546 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2547 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2548 talloc_free(r);
2549 return false;
2552 if (DEBUGLEVEL >= 10) {
2553 NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet, r);
2556 ZERO_STRUCT(r->out);
2557 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
2558 if (r->out.return_authenticator == NULL) {
2559 talloc_free(r);
2560 return false;
2563 r->out.password = talloc_zero(r, struct samr_Password);
2564 if (r->out.password == NULL) {
2565 talloc_free(r);
2566 return false;
2569 r->out.result = _netr_ServerPasswordGet(p, r);
2571 if (p->rng_fault_state) {
2572 talloc_free(r);
2573 /* Return true here, srv_pipe_hnd.c will take care */
2574 return true;
2577 if (DEBUGLEVEL >= 10) {
2578 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, r);
2581 push = ndr_push_init_ctx(r, NULL);
2582 if (push == NULL) {
2583 talloc_free(r);
2584 return false;
2587 ndr_err = call->ndr_push(push, NDR_OUT, r);
2588 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2589 talloc_free(r);
2590 return false;
2593 blob = ndr_push_blob(push);
2594 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2595 talloc_free(r);
2596 return false;
2599 talloc_free(r);
2601 return true;
2604 static bool api_netr_NETRLOGONSENDTOSAM(pipes_struct *p)
2606 const struct ndr_interface_call *call;
2607 struct ndr_pull *pull;
2608 struct ndr_push *push;
2609 enum ndr_err_code ndr_err;
2610 DATA_BLOB blob;
2611 struct netr_NETRLOGONSENDTOSAM *r;
2613 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONSENDTOSAM];
2615 r = talloc(talloc_tos(), struct netr_NETRLOGONSENDTOSAM);
2616 if (r == NULL) {
2617 return false;
2620 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2621 talloc_free(r);
2622 return false;
2625 pull = ndr_pull_init_blob(&blob, r, NULL);
2626 if (pull == NULL) {
2627 talloc_free(r);
2628 return false;
2631 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2632 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2633 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2634 talloc_free(r);
2635 return false;
2638 if (DEBUGLEVEL >= 10) {
2639 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, r);
2642 r->out.result = _netr_NETRLOGONSENDTOSAM(p, r);
2644 if (p->rng_fault_state) {
2645 talloc_free(r);
2646 /* Return true here, srv_pipe_hnd.c will take care */
2647 return true;
2650 if (DEBUGLEVEL >= 10) {
2651 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, r);
2654 push = ndr_push_init_ctx(r, NULL);
2655 if (push == NULL) {
2656 talloc_free(r);
2657 return false;
2660 ndr_err = call->ndr_push(push, NDR_OUT, r);
2661 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2662 talloc_free(r);
2663 return false;
2666 blob = ndr_push_blob(push);
2667 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2668 talloc_free(r);
2669 return false;
2672 talloc_free(r);
2674 return true;
2677 static bool api_netr_DsRAddressToSitenamesW(pipes_struct *p)
2679 const struct ndr_interface_call *call;
2680 struct ndr_pull *pull;
2681 struct ndr_push *push;
2682 enum ndr_err_code ndr_err;
2683 DATA_BLOB blob;
2684 struct netr_DsRAddressToSitenamesW *r;
2686 call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESW];
2688 r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesW);
2689 if (r == NULL) {
2690 return false;
2693 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2694 talloc_free(r);
2695 return false;
2698 pull = ndr_pull_init_blob(&blob, r, NULL);
2699 if (pull == NULL) {
2700 talloc_free(r);
2701 return false;
2704 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2705 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2706 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2707 talloc_free(r);
2708 return false;
2711 if (DEBUGLEVEL >= 10) {
2712 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, r);
2715 ZERO_STRUCT(r->out);
2716 r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesWCtr *);
2717 if (r->out.ctr == NULL) {
2718 talloc_free(r);
2719 return false;
2722 r->out.result = _netr_DsRAddressToSitenamesW(p, r);
2724 if (p->rng_fault_state) {
2725 talloc_free(r);
2726 /* Return true here, srv_pipe_hnd.c will take care */
2727 return true;
2730 if (DEBUGLEVEL >= 10) {
2731 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, r);
2734 push = ndr_push_init_ctx(r, NULL);
2735 if (push == NULL) {
2736 talloc_free(r);
2737 return false;
2740 ndr_err = call->ndr_push(push, NDR_OUT, r);
2741 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2742 talloc_free(r);
2743 return false;
2746 blob = ndr_push_blob(push);
2747 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2748 talloc_free(r);
2749 return false;
2752 talloc_free(r);
2754 return true;
2757 static bool api_netr_DsRGetDCNameEx2(pipes_struct *p)
2759 const struct ndr_interface_call *call;
2760 struct ndr_pull *pull;
2761 struct ndr_push *push;
2762 enum ndr_err_code ndr_err;
2763 DATA_BLOB blob;
2764 struct netr_DsRGetDCNameEx2 *r;
2766 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCNAMEEX2];
2768 r = talloc(talloc_tos(), struct netr_DsRGetDCNameEx2);
2769 if (r == NULL) {
2770 return false;
2773 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2774 talloc_free(r);
2775 return false;
2778 pull = ndr_pull_init_blob(&blob, r, NULL);
2779 if (pull == NULL) {
2780 talloc_free(r);
2781 return false;
2784 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2785 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2786 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2787 talloc_free(r);
2788 return false;
2791 if (DEBUGLEVEL >= 10) {
2792 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, r);
2795 ZERO_STRUCT(r->out);
2796 r->out.info = talloc_zero(r, struct netr_DsRGetDCNameInfo *);
2797 if (r->out.info == NULL) {
2798 talloc_free(r);
2799 return false;
2802 r->out.result = _netr_DsRGetDCNameEx2(p, r);
2804 if (p->rng_fault_state) {
2805 talloc_free(r);
2806 /* Return true here, srv_pipe_hnd.c will take care */
2807 return true;
2810 if (DEBUGLEVEL >= 10) {
2811 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, r);
2814 push = ndr_push_init_ctx(r, NULL);
2815 if (push == NULL) {
2816 talloc_free(r);
2817 return false;
2820 ndr_err = call->ndr_push(push, NDR_OUT, r);
2821 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2822 talloc_free(r);
2823 return false;
2826 blob = ndr_push_blob(push);
2827 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2828 talloc_free(r);
2829 return false;
2832 talloc_free(r);
2834 return true;
2837 static bool api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p)
2839 const struct ndr_interface_call *call;
2840 struct ndr_pull *pull;
2841 struct ndr_push *push;
2842 enum ndr_err_code ndr_err;
2843 DATA_BLOB blob;
2844 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r;
2846 call = &ndr_table_netlogon.calls[NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN];
2848 r = talloc(talloc_tos(), struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN);
2849 if (r == NULL) {
2850 return false;
2853 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2854 talloc_free(r);
2855 return false;
2858 pull = ndr_pull_init_blob(&blob, r, NULL);
2859 if (pull == NULL) {
2860 talloc_free(r);
2861 return false;
2864 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2865 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2866 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2867 talloc_free(r);
2868 return false;
2871 if (DEBUGLEVEL >= 10) {
2872 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r);
2875 r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, r);
2877 if (p->rng_fault_state) {
2878 talloc_free(r);
2879 /* Return true here, srv_pipe_hnd.c will take care */
2880 return true;
2883 if (DEBUGLEVEL >= 10) {
2884 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, r);
2887 push = ndr_push_init_ctx(r, NULL);
2888 if (push == NULL) {
2889 talloc_free(r);
2890 return false;
2893 ndr_err = call->ndr_push(push, NDR_OUT, r);
2894 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2895 talloc_free(r);
2896 return false;
2899 blob = ndr_push_blob(push);
2900 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2901 talloc_free(r);
2902 return false;
2905 talloc_free(r);
2907 return true;
2910 static bool api_netr_NetrEnumerateTrustedDomainsEx(pipes_struct *p)
2912 const struct ndr_interface_call *call;
2913 struct ndr_pull *pull;
2914 struct ndr_push *push;
2915 enum ndr_err_code ndr_err;
2916 DATA_BLOB blob;
2917 struct netr_NetrEnumerateTrustedDomainsEx *r;
2919 call = &ndr_table_netlogon.calls[NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX];
2921 r = talloc(talloc_tos(), struct netr_NetrEnumerateTrustedDomainsEx);
2922 if (r == NULL) {
2923 return false;
2926 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2927 talloc_free(r);
2928 return false;
2931 pull = ndr_pull_init_blob(&blob, r, NULL);
2932 if (pull == NULL) {
2933 talloc_free(r);
2934 return false;
2937 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2938 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2939 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2940 talloc_free(r);
2941 return false;
2944 if (DEBUGLEVEL >= 10) {
2945 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r);
2948 ZERO_STRUCT(r->out);
2949 r->out.dom_trust_list = talloc_zero(r, struct netr_DomainTrustList);
2950 if (r->out.dom_trust_list == NULL) {
2951 talloc_free(r);
2952 return false;
2955 r->out.result = _netr_NetrEnumerateTrustedDomainsEx(p, r);
2957 if (p->rng_fault_state) {
2958 talloc_free(r);
2959 /* Return true here, srv_pipe_hnd.c will take care */
2960 return true;
2963 if (DEBUGLEVEL >= 10) {
2964 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, r);
2967 push = ndr_push_init_ctx(r, NULL);
2968 if (push == NULL) {
2969 talloc_free(r);
2970 return false;
2973 ndr_err = call->ndr_push(push, NDR_OUT, r);
2974 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2975 talloc_free(r);
2976 return false;
2979 blob = ndr_push_blob(push);
2980 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2981 talloc_free(r);
2982 return false;
2985 talloc_free(r);
2987 return true;
2990 static bool api_netr_DsRAddressToSitenamesExW(pipes_struct *p)
2992 const struct ndr_interface_call *call;
2993 struct ndr_pull *pull;
2994 struct ndr_push *push;
2995 enum ndr_err_code ndr_err;
2996 DATA_BLOB blob;
2997 struct netr_DsRAddressToSitenamesExW *r;
2999 call = &ndr_table_netlogon.calls[NDR_NETR_DSRADDRESSTOSITENAMESEXW];
3001 r = talloc(talloc_tos(), struct netr_DsRAddressToSitenamesExW);
3002 if (r == NULL) {
3003 return false;
3006 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3007 talloc_free(r);
3008 return false;
3011 pull = ndr_pull_init_blob(&blob, r, NULL);
3012 if (pull == NULL) {
3013 talloc_free(r);
3014 return false;
3017 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3018 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3019 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3020 talloc_free(r);
3021 return false;
3024 if (DEBUGLEVEL >= 10) {
3025 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, r);
3028 ZERO_STRUCT(r->out);
3029 r->out.ctr = talloc_zero(r, struct netr_DsRAddressToSitenamesExWCtr *);
3030 if (r->out.ctr == NULL) {
3031 talloc_free(r);
3032 return false;
3035 r->out.result = _netr_DsRAddressToSitenamesExW(p, r);
3037 if (p->rng_fault_state) {
3038 talloc_free(r);
3039 /* Return true here, srv_pipe_hnd.c will take care */
3040 return true;
3043 if (DEBUGLEVEL >= 10) {
3044 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, r);
3047 push = ndr_push_init_ctx(r, NULL);
3048 if (push == NULL) {
3049 talloc_free(r);
3050 return false;
3053 ndr_err = call->ndr_push(push, NDR_OUT, r);
3054 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3055 talloc_free(r);
3056 return false;
3059 blob = ndr_push_blob(push);
3060 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3061 talloc_free(r);
3062 return false;
3065 talloc_free(r);
3067 return true;
3070 static bool api_netr_DsrGetDcSiteCoverageW(pipes_struct *p)
3072 const struct ndr_interface_call *call;
3073 struct ndr_pull *pull;
3074 struct ndr_push *push;
3075 enum ndr_err_code ndr_err;
3076 DATA_BLOB blob;
3077 struct netr_DsrGetDcSiteCoverageW *r;
3079 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETDCSITECOVERAGEW];
3081 r = talloc(talloc_tos(), struct netr_DsrGetDcSiteCoverageW);
3082 if (r == NULL) {
3083 return false;
3086 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3087 talloc_free(r);
3088 return false;
3091 pull = ndr_pull_init_blob(&blob, r, NULL);
3092 if (pull == NULL) {
3093 talloc_free(r);
3094 return false;
3097 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3098 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3099 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3100 talloc_free(r);
3101 return false;
3104 if (DEBUGLEVEL >= 10) {
3105 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, r);
3108 ZERO_STRUCT(r->out);
3109 r->out.ctr = talloc_zero(r, struct DcSitesCtr *);
3110 if (r->out.ctr == NULL) {
3111 talloc_free(r);
3112 return false;
3115 r->out.result = _netr_DsrGetDcSiteCoverageW(p, r);
3117 if (p->rng_fault_state) {
3118 talloc_free(r);
3119 /* Return true here, srv_pipe_hnd.c will take care */
3120 return true;
3123 if (DEBUGLEVEL >= 10) {
3124 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, r);
3127 push = ndr_push_init_ctx(r, NULL);
3128 if (push == NULL) {
3129 talloc_free(r);
3130 return false;
3133 ndr_err = call->ndr_push(push, NDR_OUT, r);
3134 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3135 talloc_free(r);
3136 return false;
3139 blob = ndr_push_blob(push);
3140 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3141 talloc_free(r);
3142 return false;
3145 talloc_free(r);
3147 return true;
3150 static bool api_netr_LogonSamLogonEx(pipes_struct *p)
3152 const struct ndr_interface_call *call;
3153 struct ndr_pull *pull;
3154 struct ndr_push *push;
3155 enum ndr_err_code ndr_err;
3156 DATA_BLOB blob;
3157 struct netr_LogonSamLogonEx *r;
3159 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONEX];
3161 r = talloc(talloc_tos(), struct netr_LogonSamLogonEx);
3162 if (r == NULL) {
3163 return false;
3166 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3167 talloc_free(r);
3168 return false;
3171 pull = ndr_pull_init_blob(&blob, r, NULL);
3172 if (pull == NULL) {
3173 talloc_free(r);
3174 return false;
3177 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3178 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3179 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3180 talloc_free(r);
3181 return false;
3184 if (DEBUGLEVEL >= 10) {
3185 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, r);
3188 ZERO_STRUCT(r->out);
3189 r->out.flags = r->in.flags;
3190 r->out.validation = talloc_zero(r, union netr_Validation);
3191 if (r->out.validation == NULL) {
3192 talloc_free(r);
3193 return false;
3196 r->out.authoritative = talloc_zero(r, uint8_t);
3197 if (r->out.authoritative == NULL) {
3198 talloc_free(r);
3199 return false;
3202 r->out.result = _netr_LogonSamLogonEx(p, r);
3204 if (p->rng_fault_state) {
3205 talloc_free(r);
3206 /* Return true here, srv_pipe_hnd.c will take care */
3207 return true;
3210 if (DEBUGLEVEL >= 10) {
3211 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, r);
3214 push = ndr_push_init_ctx(r, NULL);
3215 if (push == NULL) {
3216 talloc_free(r);
3217 return false;
3220 ndr_err = call->ndr_push(push, NDR_OUT, r);
3221 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3222 talloc_free(r);
3223 return false;
3226 blob = ndr_push_blob(push);
3227 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3228 talloc_free(r);
3229 return false;
3232 talloc_free(r);
3234 return true;
3237 static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p)
3239 const struct ndr_interface_call *call;
3240 struct ndr_pull *pull;
3241 struct ndr_push *push;
3242 enum ndr_err_code ndr_err;
3243 DATA_BLOB blob;
3244 struct netr_DsrEnumerateDomainTrusts *r;
3246 call = &ndr_table_netlogon.calls[NDR_NETR_DSRENUMERATEDOMAINTRUSTS];
3248 r = talloc(talloc_tos(), struct netr_DsrEnumerateDomainTrusts);
3249 if (r == NULL) {
3250 return false;
3253 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3254 talloc_free(r);
3255 return false;
3258 pull = ndr_pull_init_blob(&blob, r, NULL);
3259 if (pull == NULL) {
3260 talloc_free(r);
3261 return false;
3264 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3265 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3266 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3267 talloc_free(r);
3268 return false;
3271 if (DEBUGLEVEL >= 10) {
3272 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, r);
3275 ZERO_STRUCT(r->out);
3276 r->out.trusts = talloc_zero(r, struct netr_DomainTrustList);
3277 if (r->out.trusts == NULL) {
3278 talloc_free(r);
3279 return false;
3282 r->out.result = _netr_DsrEnumerateDomainTrusts(p, r);
3284 if (p->rng_fault_state) {
3285 talloc_free(r);
3286 /* Return true here, srv_pipe_hnd.c will take care */
3287 return true;
3290 if (DEBUGLEVEL >= 10) {
3291 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, r);
3294 push = ndr_push_init_ctx(r, NULL);
3295 if (push == NULL) {
3296 talloc_free(r);
3297 return false;
3300 ndr_err = call->ndr_push(push, NDR_OUT, r);
3301 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3302 talloc_free(r);
3303 return false;
3306 blob = ndr_push_blob(push);
3307 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3308 talloc_free(r);
3309 return false;
3312 talloc_free(r);
3314 return true;
3317 static bool api_netr_DsrDeregisterDNSHostRecords(pipes_struct *p)
3319 const struct ndr_interface_call *call;
3320 struct ndr_pull *pull;
3321 struct ndr_push *push;
3322 enum ndr_err_code ndr_err;
3323 DATA_BLOB blob;
3324 struct netr_DsrDeregisterDNSHostRecords *r;
3326 call = &ndr_table_netlogon.calls[NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS];
3328 r = talloc(talloc_tos(), struct netr_DsrDeregisterDNSHostRecords);
3329 if (r == NULL) {
3330 return false;
3333 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3334 talloc_free(r);
3335 return false;
3338 pull = ndr_pull_init_blob(&blob, r, NULL);
3339 if (pull == NULL) {
3340 talloc_free(r);
3341 return false;
3344 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3345 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3346 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3347 talloc_free(r);
3348 return false;
3351 if (DEBUGLEVEL >= 10) {
3352 NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords, r);
3355 r->out.result = _netr_DsrDeregisterDNSHostRecords(p, r);
3357 if (p->rng_fault_state) {
3358 talloc_free(r);
3359 /* Return true here, srv_pipe_hnd.c will take care */
3360 return true;
3363 if (DEBUGLEVEL >= 10) {
3364 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, r);
3367 push = ndr_push_init_ctx(r, NULL);
3368 if (push == NULL) {
3369 talloc_free(r);
3370 return false;
3373 ndr_err = call->ndr_push(push, NDR_OUT, r);
3374 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3375 talloc_free(r);
3376 return false;
3379 blob = ndr_push_blob(push);
3380 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3381 talloc_free(r);
3382 return false;
3385 talloc_free(r);
3387 return true;
3390 static bool api_netr_ServerTrustPasswordsGet(pipes_struct *p)
3392 const struct ndr_interface_call *call;
3393 struct ndr_pull *pull;
3394 struct ndr_push *push;
3395 enum ndr_err_code ndr_err;
3396 DATA_BLOB blob;
3397 struct netr_ServerTrustPasswordsGet *r;
3399 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERTRUSTPASSWORDSGET];
3401 r = talloc(talloc_tos(), struct netr_ServerTrustPasswordsGet);
3402 if (r == NULL) {
3403 return false;
3406 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3407 talloc_free(r);
3408 return false;
3411 pull = ndr_pull_init_blob(&blob, r, NULL);
3412 if (pull == NULL) {
3413 talloc_free(r);
3414 return false;
3417 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3418 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3419 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3420 talloc_free(r);
3421 return false;
3424 if (DEBUGLEVEL >= 10) {
3425 NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet, r);
3428 ZERO_STRUCT(r->out);
3429 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3430 if (r->out.return_authenticator == NULL) {
3431 talloc_free(r);
3432 return false;
3435 r->out.password = talloc_zero(r, struct samr_Password);
3436 if (r->out.password == NULL) {
3437 talloc_free(r);
3438 return false;
3441 r->out.password2 = talloc_zero(r, struct samr_Password);
3442 if (r->out.password2 == NULL) {
3443 talloc_free(r);
3444 return false;
3447 r->out.result = _netr_ServerTrustPasswordsGet(p, r);
3449 if (p->rng_fault_state) {
3450 talloc_free(r);
3451 /* Return true here, srv_pipe_hnd.c will take care */
3452 return true;
3455 if (DEBUGLEVEL >= 10) {
3456 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, r);
3459 push = ndr_push_init_ctx(r, NULL);
3460 if (push == NULL) {
3461 talloc_free(r);
3462 return false;
3465 ndr_err = call->ndr_push(push, NDR_OUT, r);
3466 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3467 talloc_free(r);
3468 return false;
3471 blob = ndr_push_blob(push);
3472 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3473 talloc_free(r);
3474 return false;
3477 talloc_free(r);
3479 return true;
3482 static bool api_netr_DsRGetForestTrustInformation(pipes_struct *p)
3484 const struct ndr_interface_call *call;
3485 struct ndr_pull *pull;
3486 struct ndr_push *push;
3487 enum ndr_err_code ndr_err;
3488 DATA_BLOB blob;
3489 struct netr_DsRGetForestTrustInformation *r;
3491 call = &ndr_table_netlogon.calls[NDR_NETR_DSRGETFORESTTRUSTINFORMATION];
3493 r = talloc(talloc_tos(), struct netr_DsRGetForestTrustInformation);
3494 if (r == NULL) {
3495 return false;
3498 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3499 talloc_free(r);
3500 return false;
3503 pull = ndr_pull_init_blob(&blob, r, NULL);
3504 if (pull == NULL) {
3505 talloc_free(r);
3506 return false;
3509 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3510 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3511 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3512 talloc_free(r);
3513 return false;
3516 if (DEBUGLEVEL >= 10) {
3517 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, r);
3520 ZERO_STRUCT(r->out);
3521 r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
3522 if (r->out.forest_trust_info == NULL) {
3523 talloc_free(r);
3524 return false;
3527 r->out.result = _netr_DsRGetForestTrustInformation(p, r);
3529 if (p->rng_fault_state) {
3530 talloc_free(r);
3531 /* Return true here, srv_pipe_hnd.c will take care */
3532 return true;
3535 if (DEBUGLEVEL >= 10) {
3536 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, r);
3539 push = ndr_push_init_ctx(r, NULL);
3540 if (push == NULL) {
3541 talloc_free(r);
3542 return false;
3545 ndr_err = call->ndr_push(push, NDR_OUT, r);
3546 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3547 talloc_free(r);
3548 return false;
3551 blob = ndr_push_blob(push);
3552 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3553 talloc_free(r);
3554 return false;
3557 talloc_free(r);
3559 return true;
3562 static bool api_netr_GetForestTrustInformation(pipes_struct *p)
3564 const struct ndr_interface_call *call;
3565 struct ndr_pull *pull;
3566 struct ndr_push *push;
3567 enum ndr_err_code ndr_err;
3568 DATA_BLOB blob;
3569 struct netr_GetForestTrustInformation *r;
3571 call = &ndr_table_netlogon.calls[NDR_NETR_GETFORESTTRUSTINFORMATION];
3573 r = talloc(talloc_tos(), struct netr_GetForestTrustInformation);
3574 if (r == NULL) {
3575 return false;
3578 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3579 talloc_free(r);
3580 return false;
3583 pull = ndr_pull_init_blob(&blob, r, NULL);
3584 if (pull == NULL) {
3585 talloc_free(r);
3586 return false;
3589 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3590 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3591 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3592 talloc_free(r);
3593 return false;
3596 if (DEBUGLEVEL >= 10) {
3597 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, r);
3600 ZERO_STRUCT(r->out);
3601 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3602 if (r->out.return_authenticator == NULL) {
3603 talloc_free(r);
3604 return false;
3607 r->out.forest_trust_info = talloc_zero(r, struct lsa_ForestTrustInformation *);
3608 if (r->out.forest_trust_info == NULL) {
3609 talloc_free(r);
3610 return false;
3613 r->out.result = _netr_GetForestTrustInformation(p, r);
3615 if (p->rng_fault_state) {
3616 talloc_free(r);
3617 /* Return true here, srv_pipe_hnd.c will take care */
3618 return true;
3621 if (DEBUGLEVEL >= 10) {
3622 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, r);
3625 push = ndr_push_init_ctx(r, NULL);
3626 if (push == NULL) {
3627 talloc_free(r);
3628 return false;
3631 ndr_err = call->ndr_push(push, NDR_OUT, r);
3632 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3633 talloc_free(r);
3634 return false;
3637 blob = ndr_push_blob(push);
3638 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3639 talloc_free(r);
3640 return false;
3643 talloc_free(r);
3645 return true;
3648 static bool api_netr_LogonSamLogonWithFlags(pipes_struct *p)
3650 const struct ndr_interface_call *call;
3651 struct ndr_pull *pull;
3652 struct ndr_push *push;
3653 enum ndr_err_code ndr_err;
3654 DATA_BLOB blob;
3655 struct netr_LogonSamLogonWithFlags *r;
3657 call = &ndr_table_netlogon.calls[NDR_NETR_LOGONSAMLOGONWITHFLAGS];
3659 r = talloc(talloc_tos(), struct netr_LogonSamLogonWithFlags);
3660 if (r == NULL) {
3661 return false;
3664 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3665 talloc_free(r);
3666 return false;
3669 pull = ndr_pull_init_blob(&blob, r, NULL);
3670 if (pull == NULL) {
3671 talloc_free(r);
3672 return false;
3675 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3676 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3677 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3678 talloc_free(r);
3679 return false;
3682 if (DEBUGLEVEL >= 10) {
3683 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, r);
3686 ZERO_STRUCT(r->out);
3687 r->out.return_authenticator = r->in.return_authenticator;
3688 r->out.flags = r->in.flags;
3689 r->out.validation = talloc_zero(r, union netr_Validation);
3690 if (r->out.validation == NULL) {
3691 talloc_free(r);
3692 return false;
3695 r->out.authoritative = talloc_zero(r, uint8_t);
3696 if (r->out.authoritative == NULL) {
3697 talloc_free(r);
3698 return false;
3701 r->out.result = _netr_LogonSamLogonWithFlags(p, r);
3703 if (p->rng_fault_state) {
3704 talloc_free(r);
3705 /* Return true here, srv_pipe_hnd.c will take care */
3706 return true;
3709 if (DEBUGLEVEL >= 10) {
3710 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, r);
3713 push = ndr_push_init_ctx(r, NULL);
3714 if (push == NULL) {
3715 talloc_free(r);
3716 return false;
3719 ndr_err = call->ndr_push(push, NDR_OUT, r);
3720 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3721 talloc_free(r);
3722 return false;
3725 blob = ndr_push_blob(push);
3726 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3727 talloc_free(r);
3728 return false;
3731 talloc_free(r);
3733 return true;
3736 static bool api_netr_ServerGetTrustInfo(pipes_struct *p)
3738 const struct ndr_interface_call *call;
3739 struct ndr_pull *pull;
3740 struct ndr_push *push;
3741 enum ndr_err_code ndr_err;
3742 DATA_BLOB blob;
3743 struct netr_ServerGetTrustInfo *r;
3745 call = &ndr_table_netlogon.calls[NDR_NETR_SERVERGETTRUSTINFO];
3747 r = talloc(talloc_tos(), struct netr_ServerGetTrustInfo);
3748 if (r == NULL) {
3749 return false;
3752 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3753 talloc_free(r);
3754 return false;
3757 pull = ndr_pull_init_blob(&blob, r, NULL);
3758 if (pull == NULL) {
3759 talloc_free(r);
3760 return false;
3763 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3764 ndr_err = call->ndr_pull(pull, NDR_IN, r);
3765 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3766 talloc_free(r);
3767 return false;
3770 if (DEBUGLEVEL >= 10) {
3771 NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo, r);
3774 ZERO_STRUCT(r->out);
3775 r->out.return_authenticator = talloc_zero(r, struct netr_Authenticator);
3776 if (r->out.return_authenticator == NULL) {
3777 talloc_free(r);
3778 return false;
3781 r->out.new_owf_password = talloc_zero(r, struct samr_Password);
3782 if (r->out.new_owf_password == NULL) {
3783 talloc_free(r);
3784 return false;
3787 r->out.old_owf_password = talloc_zero(r, struct samr_Password);
3788 if (r->out.old_owf_password == NULL) {
3789 talloc_free(r);
3790 return false;
3793 r->out.trust_info = talloc_zero(r, struct netr_TrustInfo *);
3794 if (r->out.trust_info == NULL) {
3795 talloc_free(r);
3796 return false;
3799 r->out.result = _netr_ServerGetTrustInfo(p, r);
3801 if (p->rng_fault_state) {
3802 talloc_free(r);
3803 /* Return true here, srv_pipe_hnd.c will take care */
3804 return true;
3807 if (DEBUGLEVEL >= 10) {
3808 NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, r);
3811 push = ndr_push_init_ctx(r, NULL);
3812 if (push == NULL) {
3813 talloc_free(r);
3814 return false;
3817 ndr_err = call->ndr_push(push, NDR_OUT, r);
3818 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
3819 talloc_free(r);
3820 return false;
3823 blob = ndr_push_blob(push);
3824 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
3825 talloc_free(r);
3826 return false;
3829 talloc_free(r);
3831 return true;
3835 /* Tables */
3836 static struct api_struct api_netlogon_cmds[] =
3838 {"NETR_LOGONUASLOGON", NDR_NETR_LOGONUASLOGON, api_netr_LogonUasLogon},
3839 {"NETR_LOGONUASLOGOFF", NDR_NETR_LOGONUASLOGOFF, api_netr_LogonUasLogoff},
3840 {"NETR_LOGONSAMLOGON", NDR_NETR_LOGONSAMLOGON, api_netr_LogonSamLogon},
3841 {"NETR_LOGONSAMLOGOFF", NDR_NETR_LOGONSAMLOGOFF, api_netr_LogonSamLogoff},
3842 {"NETR_SERVERREQCHALLENGE", NDR_NETR_SERVERREQCHALLENGE, api_netr_ServerReqChallenge},
3843 {"NETR_SERVERAUTHENTICATE", NDR_NETR_SERVERAUTHENTICATE, api_netr_ServerAuthenticate},
3844 {"NETR_SERVERPASSWORDSET", NDR_NETR_SERVERPASSWORDSET, api_netr_ServerPasswordSet},
3845 {"NETR_DATABASEDELTAS", NDR_NETR_DATABASEDELTAS, api_netr_DatabaseDeltas},
3846 {"NETR_DATABASESYNC", NDR_NETR_DATABASESYNC, api_netr_DatabaseSync},
3847 {"NETR_ACCOUNTDELTAS", NDR_NETR_ACCOUNTDELTAS, api_netr_AccountDeltas},
3848 {"NETR_ACCOUNTSYNC", NDR_NETR_ACCOUNTSYNC, api_netr_AccountSync},
3849 {"NETR_GETDCNAME", NDR_NETR_GETDCNAME, api_netr_GetDcName},
3850 {"NETR_LOGONCONTROL", NDR_NETR_LOGONCONTROL, api_netr_LogonControl},
3851 {"NETR_GETANYDCNAME", NDR_NETR_GETANYDCNAME, api_netr_GetAnyDCName},
3852 {"NETR_LOGONCONTROL2", NDR_NETR_LOGONCONTROL2, api_netr_LogonControl2},
3853 {"NETR_SERVERAUTHENTICATE2", NDR_NETR_SERVERAUTHENTICATE2, api_netr_ServerAuthenticate2},
3854 {"NETR_DATABASESYNC2", NDR_NETR_DATABASESYNC2, api_netr_DatabaseSync2},
3855 {"NETR_DATABASEREDO", NDR_NETR_DATABASEREDO, api_netr_DatabaseRedo},
3856 {"NETR_LOGONCONTROL2EX", NDR_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex},
3857 {"NETR_NETRENUMERATETRUSTEDDOMAINS", NDR_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NetrEnumerateTrustedDomains},
3858 {"NETR_DSRGETDCNAME", NDR_NETR_DSRGETDCNAME, api_netr_DsRGetDCName},
3859 {"NETR_NETRLOGONDUMMYROUTINE1", NDR_NETR_NETRLOGONDUMMYROUTINE1, api_netr_NETRLOGONDUMMYROUTINE1},
3860 {"NETR_NETRLOGONSETSERVICEBITS", NDR_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS},
3861 {"NETR_LOGONGETTRUSTRID", NDR_NETR_LOGONGETTRUSTRID, api_netr_LogonGetTrustRid},
3862 {"NETR_NETRLOGONCOMPUTESERVERDIGEST", NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST},
3863 {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST},
3864 {"NETR_SERVERAUTHENTICATE3", NDR_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3},
3865 {"NETR_DSRGETDCNAMEEX", NDR_NETR_DSRGETDCNAMEEX, api_netr_DsRGetDCNameEx},
3866 {"NETR_DSRGETSITENAME", NDR_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName},
3867 {"NETR_LOGONGETDOMAININFO", NDR_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo},
3868 {"NETR_SERVERPASSWORDSET2", NDR_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2},
3869 {"NETR_SERVERPASSWORDGET", NDR_NETR_SERVERPASSWORDGET, api_netr_ServerPasswordGet},
3870 {"NETR_NETRLOGONSENDTOSAM", NDR_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM},
3871 {"NETR_DSRADDRESSTOSITENAMESW", NDR_NETR_DSRADDRESSTOSITENAMESW, api_netr_DsRAddressToSitenamesW},
3872 {"NETR_DSRGETDCNAMEEX2", NDR_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2},
3873 {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN},
3874 {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NetrEnumerateTrustedDomainsEx},
3875 {"NETR_DSRADDRESSTOSITENAMESEXW", NDR_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DsRAddressToSitenamesExW},
3876 {"NETR_DSRGETDCSITECOVERAGEW", NDR_NETR_DSRGETDCSITECOVERAGEW, api_netr_DsrGetDcSiteCoverageW},
3877 {"NETR_LOGONSAMLOGONEX", NDR_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx},
3878 {"NETR_DSRENUMERATEDOMAINTRUSTS", NDR_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts},
3879 {"NETR_DSRDEREGISTERDNSHOSTRECORDS", NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DsrDeregisterDNSHostRecords},
3880 {"NETR_SERVERTRUSTPASSWORDSGET", NDR_NETR_SERVERTRUSTPASSWORDSGET, api_netr_ServerTrustPasswordsGet},
3881 {"NETR_DSRGETFORESTTRUSTINFORMATION", NDR_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DsRGetForestTrustInformation},
3882 {"NETR_GETFORESTTRUSTINFORMATION", NDR_NETR_GETFORESTTRUSTINFORMATION, api_netr_GetForestTrustInformation},
3883 {"NETR_LOGONSAMLOGONWITHFLAGS", NDR_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags},
3884 {"NETR_SERVERGETTRUSTINFO", NDR_NETR_SERVERGETTRUSTINFO, api_netr_ServerGetTrustInfo},
3887 void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns)
3889 *fns = api_netlogon_cmds;
3890 *n_fns = sizeof(api_netlogon_cmds) / sizeof(struct api_struct);
3893 NTSTATUS rpc_netlogon_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
3895 if (cli->pipes_struct == NULL) {
3896 return NT_STATUS_INVALID_PARAMETER;
3899 switch (opnum)
3901 case NDR_NETR_LOGONUASLOGON: {
3902 struct netr_LogonUasLogon *r = _r;
3903 ZERO_STRUCT(r->out);
3904 r->out.info = talloc_zero(mem_ctx, struct netr_UasInfo *);
3905 if (r->out.info == NULL) {
3906 return NT_STATUS_NO_MEMORY;
3909 r->out.result = _netr_LogonUasLogon(cli->pipes_struct, r);
3910 return NT_STATUS_OK;
3913 case NDR_NETR_LOGONUASLOGOFF: {
3914 struct netr_LogonUasLogoff *r = _r;
3915 ZERO_STRUCT(r->out);
3916 r->out.info = talloc_zero(mem_ctx, struct netr_UasLogoffInfo);
3917 if (r->out.info == NULL) {
3918 return NT_STATUS_NO_MEMORY;
3921 r->out.result = _netr_LogonUasLogoff(cli->pipes_struct, r);
3922 return NT_STATUS_OK;
3925 case NDR_NETR_LOGONSAMLOGON: {
3926 struct netr_LogonSamLogon *r = _r;
3927 ZERO_STRUCT(r->out);
3928 r->out.return_authenticator = r->in.return_authenticator;
3929 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
3930 if (r->out.validation == NULL) {
3931 return NT_STATUS_NO_MEMORY;
3934 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
3935 if (r->out.authoritative == NULL) {
3936 return NT_STATUS_NO_MEMORY;
3939 r->out.result = _netr_LogonSamLogon(cli->pipes_struct, r);
3940 return NT_STATUS_OK;
3943 case NDR_NETR_LOGONSAMLOGOFF: {
3944 struct netr_LogonSamLogoff *r = _r;
3945 ZERO_STRUCT(r->out);
3946 r->out.return_authenticator = r->in.return_authenticator;
3947 r->out.result = _netr_LogonSamLogoff(cli->pipes_struct, r);
3948 return NT_STATUS_OK;
3951 case NDR_NETR_SERVERREQCHALLENGE: {
3952 struct netr_ServerReqChallenge *r = _r;
3953 ZERO_STRUCT(r->out);
3954 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
3955 if (r->out.return_credentials == NULL) {
3956 return NT_STATUS_NO_MEMORY;
3959 r->out.result = _netr_ServerReqChallenge(cli->pipes_struct, r);
3960 return NT_STATUS_OK;
3963 case NDR_NETR_SERVERAUTHENTICATE: {
3964 struct netr_ServerAuthenticate *r = _r;
3965 ZERO_STRUCT(r->out);
3966 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
3967 if (r->out.return_credentials == NULL) {
3968 return NT_STATUS_NO_MEMORY;
3971 r->out.result = _netr_ServerAuthenticate(cli->pipes_struct, r);
3972 return NT_STATUS_OK;
3975 case NDR_NETR_SERVERPASSWORDSET: {
3976 struct netr_ServerPasswordSet *r = _r;
3977 ZERO_STRUCT(r->out);
3978 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
3979 if (r->out.return_authenticator == NULL) {
3980 return NT_STATUS_NO_MEMORY;
3983 r->out.result = _netr_ServerPasswordSet(cli->pipes_struct, r);
3984 return NT_STATUS_OK;
3987 case NDR_NETR_DATABASEDELTAS: {
3988 struct netr_DatabaseDeltas *r = _r;
3989 ZERO_STRUCT(r->out);
3990 r->out.return_authenticator = r->in.return_authenticator;
3991 r->out.sequence_num = r->in.sequence_num;
3992 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
3993 if (r->out.delta_enum_array == NULL) {
3994 return NT_STATUS_NO_MEMORY;
3997 r->out.result = _netr_DatabaseDeltas(cli->pipes_struct, r);
3998 return NT_STATUS_OK;
4001 case NDR_NETR_DATABASESYNC: {
4002 struct netr_DatabaseSync *r = _r;
4003 ZERO_STRUCT(r->out);
4004 r->out.return_authenticator = r->in.return_authenticator;
4005 r->out.sync_context = r->in.sync_context;
4006 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4007 if (r->out.delta_enum_array == NULL) {
4008 return NT_STATUS_NO_MEMORY;
4011 r->out.result = _netr_DatabaseSync(cli->pipes_struct, r);
4012 return NT_STATUS_OK;
4015 case NDR_NETR_ACCOUNTDELTAS: {
4016 struct netr_AccountDeltas *r = _r;
4017 ZERO_STRUCT(r->out);
4018 r->out.return_authenticator = r->in.return_authenticator;
4019 r->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
4020 if (r->out.buffer == NULL) {
4021 return NT_STATUS_NO_MEMORY;
4024 r->out.count_returned = talloc_zero(mem_ctx, uint32_t);
4025 if (r->out.count_returned == NULL) {
4026 return NT_STATUS_NO_MEMORY;
4029 r->out.total_entries = talloc_zero(mem_ctx, uint32_t);
4030 if (r->out.total_entries == NULL) {
4031 return NT_STATUS_NO_MEMORY;
4034 r->out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
4035 if (r->out.recordid == NULL) {
4036 return NT_STATUS_NO_MEMORY;
4039 r->out.result = _netr_AccountDeltas(cli->pipes_struct, r);
4040 return NT_STATUS_OK;
4043 case NDR_NETR_ACCOUNTSYNC: {
4044 struct netr_AccountSync *r = _r;
4045 ZERO_STRUCT(r->out);
4046 r->out.return_authenticator = r->in.return_authenticator;
4047 r->out.recordid = r->in.recordid;
4048 r->out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
4049 if (r->out.buffer == NULL) {
4050 return NT_STATUS_NO_MEMORY;
4053 r->out.count_returned = talloc_zero(mem_ctx, uint32_t);
4054 if (r->out.count_returned == NULL) {
4055 return NT_STATUS_NO_MEMORY;
4058 r->out.total_entries = talloc_zero(mem_ctx, uint32_t);
4059 if (r->out.total_entries == NULL) {
4060 return NT_STATUS_NO_MEMORY;
4063 r->out.next_reference = talloc_zero(mem_ctx, uint32_t);
4064 if (r->out.next_reference == NULL) {
4065 return NT_STATUS_NO_MEMORY;
4068 r->out.result = _netr_AccountSync(cli->pipes_struct, r);
4069 return NT_STATUS_OK;
4072 case NDR_NETR_GETDCNAME: {
4073 struct netr_GetDcName *r = _r;
4074 ZERO_STRUCT(r->out);
4075 r->out.dcname = talloc_zero(mem_ctx, const char *);
4076 if (r->out.dcname == NULL) {
4077 return NT_STATUS_NO_MEMORY;
4080 r->out.result = _netr_GetDcName(cli->pipes_struct, r);
4081 return NT_STATUS_OK;
4084 case NDR_NETR_LOGONCONTROL: {
4085 struct netr_LogonControl *r = _r;
4086 ZERO_STRUCT(r->out);
4087 r->out.info = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4088 if (r->out.info == NULL) {
4089 return NT_STATUS_NO_MEMORY;
4092 r->out.result = _netr_LogonControl(cli->pipes_struct, r);
4093 return NT_STATUS_OK;
4096 case NDR_NETR_GETANYDCNAME: {
4097 struct netr_GetAnyDCName *r = _r;
4098 ZERO_STRUCT(r->out);
4099 r->out.dcname = talloc_zero(mem_ctx, const char *);
4100 if (r->out.dcname == NULL) {
4101 return NT_STATUS_NO_MEMORY;
4104 r->out.result = _netr_GetAnyDCName(cli->pipes_struct, r);
4105 return NT_STATUS_OK;
4108 case NDR_NETR_LOGONCONTROL2: {
4109 struct netr_LogonControl2 *r = _r;
4110 ZERO_STRUCT(r->out);
4111 r->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4112 if (r->out.query == NULL) {
4113 return NT_STATUS_NO_MEMORY;
4116 r->out.result = _netr_LogonControl2(cli->pipes_struct, r);
4117 return NT_STATUS_OK;
4120 case NDR_NETR_SERVERAUTHENTICATE2: {
4121 struct netr_ServerAuthenticate2 *r = _r;
4122 ZERO_STRUCT(r->out);
4123 r->out.negotiate_flags = r->in.negotiate_flags;
4124 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
4125 if (r->out.return_credentials == NULL) {
4126 return NT_STATUS_NO_MEMORY;
4129 r->out.result = _netr_ServerAuthenticate2(cli->pipes_struct, r);
4130 return NT_STATUS_OK;
4133 case NDR_NETR_DATABASESYNC2: {
4134 struct netr_DatabaseSync2 *r = _r;
4135 ZERO_STRUCT(r->out);
4136 r->out.return_authenticator = r->in.return_authenticator;
4137 r->out.sync_context = r->in.sync_context;
4138 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4139 if (r->out.delta_enum_array == NULL) {
4140 return NT_STATUS_NO_MEMORY;
4143 r->out.result = _netr_DatabaseSync2(cli->pipes_struct, r);
4144 return NT_STATUS_OK;
4147 case NDR_NETR_DATABASEREDO: {
4148 struct netr_DatabaseRedo *r = _r;
4149 ZERO_STRUCT(r->out);
4150 r->out.return_authenticator = r->in.return_authenticator;
4151 r->out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY *);
4152 if (r->out.delta_enum_array == NULL) {
4153 return NT_STATUS_NO_MEMORY;
4156 r->out.result = _netr_DatabaseRedo(cli->pipes_struct, r);
4157 return NT_STATUS_OK;
4160 case NDR_NETR_LOGONCONTROL2EX: {
4161 struct netr_LogonControl2Ex *r = _r;
4162 ZERO_STRUCT(r->out);
4163 r->out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
4164 if (r->out.query == NULL) {
4165 return NT_STATUS_NO_MEMORY;
4168 r->out.result = _netr_LogonControl2Ex(cli->pipes_struct, r);
4169 return NT_STATUS_OK;
4172 case NDR_NETR_NETRENUMERATETRUSTEDDOMAINS: {
4173 struct netr_NetrEnumerateTrustedDomains *r = _r;
4174 ZERO_STRUCT(r->out);
4175 r->out.trusted_domains_blob = talloc_zero(mem_ctx, struct netr_Blob);
4176 if (r->out.trusted_domains_blob == NULL) {
4177 return NT_STATUS_NO_MEMORY;
4180 r->out.result = _netr_NetrEnumerateTrustedDomains(cli->pipes_struct, r);
4181 return NT_STATUS_OK;
4184 case NDR_NETR_DSRGETDCNAME: {
4185 struct netr_DsRGetDCName *r = _r;
4186 ZERO_STRUCT(r->out);
4187 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4188 if (r->out.info == NULL) {
4189 return NT_STATUS_NO_MEMORY;
4192 r->out.result = _netr_DsRGetDCName(cli->pipes_struct, r);
4193 return NT_STATUS_OK;
4196 case NDR_NETR_NETRLOGONDUMMYROUTINE1: {
4197 struct netr_NETRLOGONDUMMYROUTINE1 *r = _r;
4198 r->out.result = _netr_NETRLOGONDUMMYROUTINE1(cli->pipes_struct, r);
4199 return NT_STATUS_OK;
4202 case NDR_NETR_NETRLOGONSETSERVICEBITS: {
4203 struct netr_NETRLOGONSETSERVICEBITS *r = _r;
4204 r->out.result = _netr_NETRLOGONSETSERVICEBITS(cli->pipes_struct, r);
4205 return NT_STATUS_OK;
4208 case NDR_NETR_LOGONGETTRUSTRID: {
4209 struct netr_LogonGetTrustRid *r = _r;
4210 ZERO_STRUCT(r->out);
4211 r->out.rid = talloc_zero(mem_ctx, uint32_t);
4212 if (r->out.rid == NULL) {
4213 return NT_STATUS_NO_MEMORY;
4216 r->out.result = _netr_LogonGetTrustRid(cli->pipes_struct, r);
4217 return NT_STATUS_OK;
4220 case NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST: {
4221 struct netr_NETRLOGONCOMPUTESERVERDIGEST *r = _r;
4222 r->out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(cli->pipes_struct, r);
4223 return NT_STATUS_OK;
4226 case NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST: {
4227 struct netr_NETRLOGONCOMPUTECLIENTDIGEST *r = _r;
4228 r->out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(cli->pipes_struct, r);
4229 return NT_STATUS_OK;
4232 case NDR_NETR_SERVERAUTHENTICATE3: {
4233 struct netr_ServerAuthenticate3 *r = _r;
4234 ZERO_STRUCT(r->out);
4235 r->out.negotiate_flags = r->in.negotiate_flags;
4236 r->out.return_credentials = talloc_zero(mem_ctx, struct netr_Credential);
4237 if (r->out.return_credentials == NULL) {
4238 return NT_STATUS_NO_MEMORY;
4241 r->out.rid = talloc_zero(mem_ctx, uint32_t);
4242 if (r->out.rid == NULL) {
4243 return NT_STATUS_NO_MEMORY;
4246 r->out.result = _netr_ServerAuthenticate3(cli->pipes_struct, r);
4247 return NT_STATUS_OK;
4250 case NDR_NETR_DSRGETDCNAMEEX: {
4251 struct netr_DsRGetDCNameEx *r = _r;
4252 ZERO_STRUCT(r->out);
4253 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4254 if (r->out.info == NULL) {
4255 return NT_STATUS_NO_MEMORY;
4258 r->out.result = _netr_DsRGetDCNameEx(cli->pipes_struct, r);
4259 return NT_STATUS_OK;
4262 case NDR_NETR_DSRGETSITENAME: {
4263 struct netr_DsRGetSiteName *r = _r;
4264 ZERO_STRUCT(r->out);
4265 r->out.site = talloc_zero(mem_ctx, const char *);
4266 if (r->out.site == NULL) {
4267 return NT_STATUS_NO_MEMORY;
4270 r->out.result = _netr_DsRGetSiteName(cli->pipes_struct, r);
4271 return NT_STATUS_OK;
4274 case NDR_NETR_LOGONGETDOMAININFO: {
4275 struct netr_LogonGetDomainInfo *r = _r;
4276 ZERO_STRUCT(r->out);
4277 r->out.return_authenticator = r->in.return_authenticator;
4278 r->out.info = talloc_zero(mem_ctx, union netr_DomainInfo);
4279 if (r->out.info == NULL) {
4280 return NT_STATUS_NO_MEMORY;
4283 r->out.result = _netr_LogonGetDomainInfo(cli->pipes_struct, r);
4284 return NT_STATUS_OK;
4287 case NDR_NETR_SERVERPASSWORDSET2: {
4288 struct netr_ServerPasswordSet2 *r = _r;
4289 ZERO_STRUCT(r->out);
4290 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4291 if (r->out.return_authenticator == NULL) {
4292 return NT_STATUS_NO_MEMORY;
4295 r->out.result = _netr_ServerPasswordSet2(cli->pipes_struct, r);
4296 return NT_STATUS_OK;
4299 case NDR_NETR_SERVERPASSWORDGET: {
4300 struct netr_ServerPasswordGet *r = _r;
4301 ZERO_STRUCT(r->out);
4302 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4303 if (r->out.return_authenticator == NULL) {
4304 return NT_STATUS_NO_MEMORY;
4307 r->out.password = talloc_zero(mem_ctx, struct samr_Password);
4308 if (r->out.password == NULL) {
4309 return NT_STATUS_NO_MEMORY;
4312 r->out.result = _netr_ServerPasswordGet(cli->pipes_struct, r);
4313 return NT_STATUS_OK;
4316 case NDR_NETR_NETRLOGONSENDTOSAM: {
4317 struct netr_NETRLOGONSENDTOSAM *r = _r;
4318 r->out.result = _netr_NETRLOGONSENDTOSAM(cli->pipes_struct, r);
4319 return NT_STATUS_OK;
4322 case NDR_NETR_DSRADDRESSTOSITENAMESW: {
4323 struct netr_DsRAddressToSitenamesW *r = _r;
4324 ZERO_STRUCT(r->out);
4325 r->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesWCtr *);
4326 if (r->out.ctr == NULL) {
4327 return NT_STATUS_NO_MEMORY;
4330 r->out.result = _netr_DsRAddressToSitenamesW(cli->pipes_struct, r);
4331 return NT_STATUS_OK;
4334 case NDR_NETR_DSRGETDCNAMEEX2: {
4335 struct netr_DsRGetDCNameEx2 *r = _r;
4336 ZERO_STRUCT(r->out);
4337 r->out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo *);
4338 if (r->out.info == NULL) {
4339 return NT_STATUS_NO_MEMORY;
4342 r->out.result = _netr_DsRGetDCNameEx2(cli->pipes_struct, r);
4343 return NT_STATUS_OK;
4346 case NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN: {
4347 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN *r = _r;
4348 r->out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(cli->pipes_struct, r);
4349 return NT_STATUS_OK;
4352 case NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX: {
4353 struct netr_NetrEnumerateTrustedDomainsEx *r = _r;
4354 ZERO_STRUCT(r->out);
4355 r->out.dom_trust_list = talloc_zero(mem_ctx, struct netr_DomainTrustList);
4356 if (r->out.dom_trust_list == NULL) {
4357 return NT_STATUS_NO_MEMORY;
4360 r->out.result = _netr_NetrEnumerateTrustedDomainsEx(cli->pipes_struct, r);
4361 return NT_STATUS_OK;
4364 case NDR_NETR_DSRADDRESSTOSITENAMESEXW: {
4365 struct netr_DsRAddressToSitenamesExW *r = _r;
4366 ZERO_STRUCT(r->out);
4367 r->out.ctr = talloc_zero(mem_ctx, struct netr_DsRAddressToSitenamesExWCtr *);
4368 if (r->out.ctr == NULL) {
4369 return NT_STATUS_NO_MEMORY;
4372 r->out.result = _netr_DsRAddressToSitenamesExW(cli->pipes_struct, r);
4373 return NT_STATUS_OK;
4376 case NDR_NETR_DSRGETDCSITECOVERAGEW: {
4377 struct netr_DsrGetDcSiteCoverageW *r = _r;
4378 ZERO_STRUCT(r->out);
4379 r->out.ctr = talloc_zero(mem_ctx, struct DcSitesCtr *);
4380 if (r->out.ctr == NULL) {
4381 return NT_STATUS_NO_MEMORY;
4384 r->out.result = _netr_DsrGetDcSiteCoverageW(cli->pipes_struct, r);
4385 return NT_STATUS_OK;
4388 case NDR_NETR_LOGONSAMLOGONEX: {
4389 struct netr_LogonSamLogonEx *r = _r;
4390 ZERO_STRUCT(r->out);
4391 r->out.flags = r->in.flags;
4392 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
4393 if (r->out.validation == NULL) {
4394 return NT_STATUS_NO_MEMORY;
4397 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
4398 if (r->out.authoritative == NULL) {
4399 return NT_STATUS_NO_MEMORY;
4402 r->out.result = _netr_LogonSamLogonEx(cli->pipes_struct, r);
4403 return NT_STATUS_OK;
4406 case NDR_NETR_DSRENUMERATEDOMAINTRUSTS: {
4407 struct netr_DsrEnumerateDomainTrusts *r = _r;
4408 ZERO_STRUCT(r->out);
4409 r->out.trusts = talloc_zero(mem_ctx, struct netr_DomainTrustList);
4410 if (r->out.trusts == NULL) {
4411 return NT_STATUS_NO_MEMORY;
4414 r->out.result = _netr_DsrEnumerateDomainTrusts(cli->pipes_struct, r);
4415 return NT_STATUS_OK;
4418 case NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS: {
4419 struct netr_DsrDeregisterDNSHostRecords *r = _r;
4420 r->out.result = _netr_DsrDeregisterDNSHostRecords(cli->pipes_struct, r);
4421 return NT_STATUS_OK;
4424 case NDR_NETR_SERVERTRUSTPASSWORDSGET: {
4425 struct netr_ServerTrustPasswordsGet *r = _r;
4426 ZERO_STRUCT(r->out);
4427 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4428 if (r->out.return_authenticator == NULL) {
4429 return NT_STATUS_NO_MEMORY;
4432 r->out.password = talloc_zero(mem_ctx, struct samr_Password);
4433 if (r->out.password == NULL) {
4434 return NT_STATUS_NO_MEMORY;
4437 r->out.password2 = talloc_zero(mem_ctx, struct samr_Password);
4438 if (r->out.password2 == NULL) {
4439 return NT_STATUS_NO_MEMORY;
4442 r->out.result = _netr_ServerTrustPasswordsGet(cli->pipes_struct, r);
4443 return NT_STATUS_OK;
4446 case NDR_NETR_DSRGETFORESTTRUSTINFORMATION: {
4447 struct netr_DsRGetForestTrustInformation *r = _r;
4448 ZERO_STRUCT(r->out);
4449 r->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
4450 if (r->out.forest_trust_info == NULL) {
4451 return NT_STATUS_NO_MEMORY;
4454 r->out.result = _netr_DsRGetForestTrustInformation(cli->pipes_struct, r);
4455 return NT_STATUS_OK;
4458 case NDR_NETR_GETFORESTTRUSTINFORMATION: {
4459 struct netr_GetForestTrustInformation *r = _r;
4460 ZERO_STRUCT(r->out);
4461 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4462 if (r->out.return_authenticator == NULL) {
4463 return NT_STATUS_NO_MEMORY;
4466 r->out.forest_trust_info = talloc_zero(mem_ctx, struct lsa_ForestTrustInformation *);
4467 if (r->out.forest_trust_info == NULL) {
4468 return NT_STATUS_NO_MEMORY;
4471 r->out.result = _netr_GetForestTrustInformation(cli->pipes_struct, r);
4472 return NT_STATUS_OK;
4475 case NDR_NETR_LOGONSAMLOGONWITHFLAGS: {
4476 struct netr_LogonSamLogonWithFlags *r = _r;
4477 ZERO_STRUCT(r->out);
4478 r->out.return_authenticator = r->in.return_authenticator;
4479 r->out.flags = r->in.flags;
4480 r->out.validation = talloc_zero(mem_ctx, union netr_Validation);
4481 if (r->out.validation == NULL) {
4482 return NT_STATUS_NO_MEMORY;
4485 r->out.authoritative = talloc_zero(mem_ctx, uint8_t);
4486 if (r->out.authoritative == NULL) {
4487 return NT_STATUS_NO_MEMORY;
4490 r->out.result = _netr_LogonSamLogonWithFlags(cli->pipes_struct, r);
4491 return NT_STATUS_OK;
4494 case NDR_NETR_SERVERGETTRUSTINFO: {
4495 struct netr_ServerGetTrustInfo *r = _r;
4496 ZERO_STRUCT(r->out);
4497 r->out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
4498 if (r->out.return_authenticator == NULL) {
4499 return NT_STATUS_NO_MEMORY;
4502 r->out.new_owf_password = talloc_zero(mem_ctx, struct samr_Password);
4503 if (r->out.new_owf_password == NULL) {
4504 return NT_STATUS_NO_MEMORY;
4507 r->out.old_owf_password = talloc_zero(mem_ctx, struct samr_Password);
4508 if (r->out.old_owf_password == NULL) {
4509 return NT_STATUS_NO_MEMORY;
4512 r->out.trust_info = talloc_zero(mem_ctx, struct netr_TrustInfo *);
4513 if (r->out.trust_info == NULL) {
4514 return NT_STATUS_NO_MEMORY;
4517 r->out.result = _netr_ServerGetTrustInfo(cli->pipes_struct, r);
4518 return NT_STATUS_OK;
4521 default:
4522 return NT_STATUS_NOT_IMPLEMENTED;
4526 NTSTATUS rpc_netlogon_init(void)
4528 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", &ndr_table_netlogon, api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct));