r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_netlogon.c
blob9b87c61853350a71c66d07731c84d2f2916668f3
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 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct netr_LogonUasLogon r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonUasLogon");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL) {
25 talloc_free(mem_ctx);
26 return False;
29 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
30 status = ndr_pull_netr_LogonUasLogon(pull, NDR_IN, &r);
31 if (NT_STATUS_IS_ERR(status)) {
32 talloc_free(mem_ctx);
33 return False;
36 if (DEBUGLEVEL >= 10)
37 NDR_PRINT_IN_DEBUG(netr_LogonUasLogon, &r);
39 ZERO_STRUCT(r.out);
40 r.out.info = talloc_zero(mem_ctx, struct netr_UasInfo);
41 if (r.out.info == NULL) {
42 talloc_free(mem_ctx);
43 return False;
46 r.out.result = _netr_LogonUasLogon(p, &r);
48 if (p->rng_fault_state) {
49 talloc_free(mem_ctx);
50 /* Return True here, srv_pipe_hnd.c will take care */
51 return True;
54 if (DEBUGLEVEL >= 10)
55 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r);
57 push = ndr_push_init_ctx(mem_ctx);
58 if (push == NULL) {
59 talloc_free(mem_ctx);
60 return False;
63 status = ndr_push_netr_LogonUasLogon(push, NDR_OUT, &r);
64 if (NT_STATUS_IS_ERR(status)) {
65 talloc_free(mem_ctx);
66 return False;
69 blob = ndr_push_blob(push);
70 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
71 talloc_free(mem_ctx);
72 return False;
75 talloc_free(mem_ctx);
77 return True;
80 static BOOL api_netr_LogonUasLogoff(pipes_struct *p)
82 struct ndr_pull *pull;
83 struct ndr_push *push;
84 NTSTATUS status;
85 DATA_BLOB blob;
86 struct netr_LogonUasLogoff r;
87 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonUasLogoff");
89 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
90 talloc_free(mem_ctx);
91 return False;
94 pull = ndr_pull_init_blob(&blob, mem_ctx);
95 if (pull == NULL) {
96 talloc_free(mem_ctx);
97 return False;
100 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
101 status = ndr_pull_netr_LogonUasLogoff(pull, NDR_IN, &r);
102 if (NT_STATUS_IS_ERR(status)) {
103 talloc_free(mem_ctx);
104 return False;
107 if (DEBUGLEVEL >= 10)
108 NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff, &r);
110 ZERO_STRUCT(r.out);
111 r.out.info = talloc_zero(mem_ctx, struct netr_UasLogoffInfo);
112 if (r.out.info == NULL) {
113 talloc_free(mem_ctx);
114 return False;
117 r.out.result = _netr_LogonUasLogoff(p, &r);
119 if (p->rng_fault_state) {
120 talloc_free(mem_ctx);
121 /* Return True here, srv_pipe_hnd.c will take care */
122 return True;
125 if (DEBUGLEVEL >= 10)
126 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r);
128 push = ndr_push_init_ctx(mem_ctx);
129 if (push == NULL) {
130 talloc_free(mem_ctx);
131 return False;
134 status = ndr_push_netr_LogonUasLogoff(push, NDR_OUT, &r);
135 if (NT_STATUS_IS_ERR(status)) {
136 talloc_free(mem_ctx);
137 return False;
140 blob = ndr_push_blob(push);
141 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
142 talloc_free(mem_ctx);
143 return False;
146 talloc_free(mem_ctx);
148 return True;
151 static BOOL api_netr_LogonSamLogon(pipes_struct *p)
153 struct ndr_pull *pull;
154 struct ndr_push *push;
155 NTSTATUS status;
156 DATA_BLOB blob;
157 struct netr_LogonSamLogon r;
158 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonSamLogon");
160 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
161 talloc_free(mem_ctx);
162 return False;
165 pull = ndr_pull_init_blob(&blob, mem_ctx);
166 if (pull == NULL) {
167 talloc_free(mem_ctx);
168 return False;
171 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
172 status = ndr_pull_netr_LogonSamLogon(pull, NDR_IN, &r);
173 if (NT_STATUS_IS_ERR(status)) {
174 talloc_free(mem_ctx);
175 return False;
178 if (DEBUGLEVEL >= 10)
179 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r);
181 ZERO_STRUCT(r.out);
182 r.out.return_authenticator = r.in.return_authenticator;
183 r.out.validation = talloc_zero(mem_ctx, union netr_Validation);
184 if (r.out.validation == NULL) {
185 talloc_free(mem_ctx);
186 return False;
189 r.out.authoritative = talloc_zero(mem_ctx, uint8_t);
190 if (r.out.authoritative == NULL) {
191 talloc_free(mem_ctx);
192 return False;
195 r.out.result = _netr_LogonSamLogon(p, &r);
197 if (p->rng_fault_state) {
198 talloc_free(mem_ctx);
199 /* Return True here, srv_pipe_hnd.c will take care */
200 return True;
203 if (DEBUGLEVEL >= 10)
204 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r);
206 push = ndr_push_init_ctx(mem_ctx);
207 if (push == NULL) {
208 talloc_free(mem_ctx);
209 return False;
212 status = ndr_push_netr_LogonSamLogon(push, NDR_OUT, &r);
213 if (NT_STATUS_IS_ERR(status)) {
214 talloc_free(mem_ctx);
215 return False;
218 blob = ndr_push_blob(push);
219 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
220 talloc_free(mem_ctx);
221 return False;
224 talloc_free(mem_ctx);
226 return True;
229 static BOOL api_netr_LogonSamLogoff(pipes_struct *p)
231 struct ndr_pull *pull;
232 struct ndr_push *push;
233 NTSTATUS status;
234 DATA_BLOB blob;
235 struct netr_LogonSamLogoff r;
236 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonSamLogoff");
238 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
239 talloc_free(mem_ctx);
240 return False;
243 pull = ndr_pull_init_blob(&blob, mem_ctx);
244 if (pull == NULL) {
245 talloc_free(mem_ctx);
246 return False;
249 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
250 status = ndr_pull_netr_LogonSamLogoff(pull, NDR_IN, &r);
251 if (NT_STATUS_IS_ERR(status)) {
252 talloc_free(mem_ctx);
253 return False;
256 if (DEBUGLEVEL >= 10)
257 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r);
259 ZERO_STRUCT(r.out);
260 r.out.return_authenticator = r.in.return_authenticator;
261 r.out.result = _netr_LogonSamLogoff(p, &r);
263 if (p->rng_fault_state) {
264 talloc_free(mem_ctx);
265 /* Return True here, srv_pipe_hnd.c will take care */
266 return True;
269 if (DEBUGLEVEL >= 10)
270 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r);
272 push = ndr_push_init_ctx(mem_ctx);
273 if (push == NULL) {
274 talloc_free(mem_ctx);
275 return False;
278 status = ndr_push_netr_LogonSamLogoff(push, NDR_OUT, &r);
279 if (NT_STATUS_IS_ERR(status)) {
280 talloc_free(mem_ctx);
281 return False;
284 blob = ndr_push_blob(push);
285 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
286 talloc_free(mem_ctx);
287 return False;
290 talloc_free(mem_ctx);
292 return True;
295 static BOOL api_netr_ServerReqChallenge(pipes_struct *p)
297 struct ndr_pull *pull;
298 struct ndr_push *push;
299 NTSTATUS status;
300 DATA_BLOB blob;
301 struct netr_ServerReqChallenge r;
302 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerReqChallenge");
304 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
305 talloc_free(mem_ctx);
306 return False;
309 pull = ndr_pull_init_blob(&blob, mem_ctx);
310 if (pull == NULL) {
311 talloc_free(mem_ctx);
312 return False;
315 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
316 status = ndr_pull_netr_ServerReqChallenge(pull, NDR_IN, &r);
317 if (NT_STATUS_IS_ERR(status)) {
318 talloc_free(mem_ctx);
319 return False;
322 if (DEBUGLEVEL >= 10)
323 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge, &r);
325 ZERO_STRUCT(r.out);
326 r.out.credentials = r.in.credentials;
327 r.out.result = _netr_ServerReqChallenge(p, &r);
329 if (p->rng_fault_state) {
330 talloc_free(mem_ctx);
331 /* Return True here, srv_pipe_hnd.c will take care */
332 return True;
335 if (DEBUGLEVEL >= 10)
336 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
338 push = ndr_push_init_ctx(mem_ctx);
339 if (push == NULL) {
340 talloc_free(mem_ctx);
341 return False;
344 status = ndr_push_netr_ServerReqChallenge(push, NDR_OUT, &r);
345 if (NT_STATUS_IS_ERR(status)) {
346 talloc_free(mem_ctx);
347 return False;
350 blob = ndr_push_blob(push);
351 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
352 talloc_free(mem_ctx);
353 return False;
356 talloc_free(mem_ctx);
358 return True;
361 static BOOL api_netr_ServerAuthenticate(pipes_struct *p)
363 struct ndr_pull *pull;
364 struct ndr_push *push;
365 NTSTATUS status;
366 DATA_BLOB blob;
367 struct netr_ServerAuthenticate r;
368 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerAuthenticate");
370 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
371 talloc_free(mem_ctx);
372 return False;
375 pull = ndr_pull_init_blob(&blob, mem_ctx);
376 if (pull == NULL) {
377 talloc_free(mem_ctx);
378 return False;
381 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
382 status = ndr_pull_netr_ServerAuthenticate(pull, NDR_IN, &r);
383 if (NT_STATUS_IS_ERR(status)) {
384 talloc_free(mem_ctx);
385 return False;
388 if (DEBUGLEVEL >= 10)
389 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate, &r);
391 ZERO_STRUCT(r.out);
392 r.out.credentials = r.in.credentials;
393 r.out.result = _netr_ServerAuthenticate(p, &r);
395 if (p->rng_fault_state) {
396 talloc_free(mem_ctx);
397 /* Return True here, srv_pipe_hnd.c will take care */
398 return True;
401 if (DEBUGLEVEL >= 10)
402 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
404 push = ndr_push_init_ctx(mem_ctx);
405 if (push == NULL) {
406 talloc_free(mem_ctx);
407 return False;
410 status = ndr_push_netr_ServerAuthenticate(push, NDR_OUT, &r);
411 if (NT_STATUS_IS_ERR(status)) {
412 talloc_free(mem_ctx);
413 return False;
416 blob = ndr_push_blob(push);
417 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
418 talloc_free(mem_ctx);
419 return False;
422 talloc_free(mem_ctx);
424 return True;
427 static BOOL api_netr_ServerPasswordSet(pipes_struct *p)
429 struct ndr_pull *pull;
430 struct ndr_push *push;
431 NTSTATUS status;
432 DATA_BLOB blob;
433 struct netr_ServerPasswordSet r;
434 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerPasswordSet");
436 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
437 talloc_free(mem_ctx);
438 return False;
441 pull = ndr_pull_init_blob(&blob, mem_ctx);
442 if (pull == NULL) {
443 talloc_free(mem_ctx);
444 return False;
447 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
448 status = ndr_pull_netr_ServerPasswordSet(pull, NDR_IN, &r);
449 if (NT_STATUS_IS_ERR(status)) {
450 talloc_free(mem_ctx);
451 return False;
454 if (DEBUGLEVEL >= 10)
455 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet, &r);
457 ZERO_STRUCT(r.out);
458 r.out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
459 if (r.out.return_authenticator == NULL) {
460 talloc_free(mem_ctx);
461 return False;
464 r.out.result = _netr_ServerPasswordSet(p, &r);
466 if (p->rng_fault_state) {
467 talloc_free(mem_ctx);
468 /* Return True here, srv_pipe_hnd.c will take care */
469 return True;
472 if (DEBUGLEVEL >= 10)
473 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
475 push = ndr_push_init_ctx(mem_ctx);
476 if (push == NULL) {
477 talloc_free(mem_ctx);
478 return False;
481 status = ndr_push_netr_ServerPasswordSet(push, NDR_OUT, &r);
482 if (NT_STATUS_IS_ERR(status)) {
483 talloc_free(mem_ctx);
484 return False;
487 blob = ndr_push_blob(push);
488 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
489 talloc_free(mem_ctx);
490 return False;
493 talloc_free(mem_ctx);
495 return True;
498 static BOOL api_netr_DatabaseDeltas(pipes_struct *p)
500 struct ndr_pull *pull;
501 struct ndr_push *push;
502 NTSTATUS status;
503 DATA_BLOB blob;
504 struct netr_DatabaseDeltas r;
505 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DatabaseDeltas");
507 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
508 talloc_free(mem_ctx);
509 return False;
512 pull = ndr_pull_init_blob(&blob, mem_ctx);
513 if (pull == NULL) {
514 talloc_free(mem_ctx);
515 return False;
518 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
519 status = ndr_pull_netr_DatabaseDeltas(pull, NDR_IN, &r);
520 if (NT_STATUS_IS_ERR(status)) {
521 talloc_free(mem_ctx);
522 return False;
525 if (DEBUGLEVEL >= 10)
526 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas, &r);
528 ZERO_STRUCT(r.out);
529 r.out.return_authenticator = r.in.return_authenticator;
530 r.out.sequence_num = r.in.sequence_num;
531 r.out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY);
532 if (r.out.delta_enum_array == NULL) {
533 talloc_free(mem_ctx);
534 return False;
537 r.out.result = _netr_DatabaseDeltas(p, &r);
539 if (p->rng_fault_state) {
540 talloc_free(mem_ctx);
541 /* Return True here, srv_pipe_hnd.c will take care */
542 return True;
545 if (DEBUGLEVEL >= 10)
546 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
548 push = ndr_push_init_ctx(mem_ctx);
549 if (push == NULL) {
550 talloc_free(mem_ctx);
551 return False;
554 status = ndr_push_netr_DatabaseDeltas(push, NDR_OUT, &r);
555 if (NT_STATUS_IS_ERR(status)) {
556 talloc_free(mem_ctx);
557 return False;
560 blob = ndr_push_blob(push);
561 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
562 talloc_free(mem_ctx);
563 return False;
566 talloc_free(mem_ctx);
568 return True;
571 static BOOL api_netr_DatabaseSync(pipes_struct *p)
573 struct ndr_pull *pull;
574 struct ndr_push *push;
575 NTSTATUS status;
576 DATA_BLOB blob;
577 struct netr_DatabaseSync r;
578 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DatabaseSync");
580 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
581 talloc_free(mem_ctx);
582 return False;
585 pull = ndr_pull_init_blob(&blob, mem_ctx);
586 if (pull == NULL) {
587 talloc_free(mem_ctx);
588 return False;
591 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
592 status = ndr_pull_netr_DatabaseSync(pull, NDR_IN, &r);
593 if (NT_STATUS_IS_ERR(status)) {
594 talloc_free(mem_ctx);
595 return False;
598 if (DEBUGLEVEL >= 10)
599 NDR_PRINT_IN_DEBUG(netr_DatabaseSync, &r);
601 ZERO_STRUCT(r.out);
602 r.out.return_authenticator = r.in.return_authenticator;
603 r.out.sync_context = r.in.sync_context;
604 r.out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY);
605 if (r.out.delta_enum_array == NULL) {
606 talloc_free(mem_ctx);
607 return False;
610 r.out.result = _netr_DatabaseSync(p, &r);
612 if (p->rng_fault_state) {
613 talloc_free(mem_ctx);
614 /* Return True here, srv_pipe_hnd.c will take care */
615 return True;
618 if (DEBUGLEVEL >= 10)
619 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
621 push = ndr_push_init_ctx(mem_ctx);
622 if (push == NULL) {
623 talloc_free(mem_ctx);
624 return False;
627 status = ndr_push_netr_DatabaseSync(push, NDR_OUT, &r);
628 if (NT_STATUS_IS_ERR(status)) {
629 talloc_free(mem_ctx);
630 return False;
633 blob = ndr_push_blob(push);
634 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
635 talloc_free(mem_ctx);
636 return False;
639 talloc_free(mem_ctx);
641 return True;
644 static BOOL api_netr_AccountDeltas(pipes_struct *p)
646 struct ndr_pull *pull;
647 struct ndr_push *push;
648 NTSTATUS status;
649 DATA_BLOB blob;
650 struct netr_AccountDeltas r;
651 TALLOC_CTX *mem_ctx = talloc_init("api_netr_AccountDeltas");
653 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
654 talloc_free(mem_ctx);
655 return False;
658 pull = ndr_pull_init_blob(&blob, mem_ctx);
659 if (pull == NULL) {
660 talloc_free(mem_ctx);
661 return False;
664 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
665 status = ndr_pull_netr_AccountDeltas(pull, NDR_IN, &r);
666 if (NT_STATUS_IS_ERR(status)) {
667 talloc_free(mem_ctx);
668 return False;
671 if (DEBUGLEVEL >= 10)
672 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
674 ZERO_STRUCT(r.out);
675 r.out.return_authenticator = r.in.return_authenticator;
676 r.out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
677 if (r.out.buffer == NULL) {
678 talloc_free(mem_ctx);
679 return False;
682 r.out.count_returned = talloc_zero(mem_ctx, uint32_t);
683 if (r.out.count_returned == NULL) {
684 talloc_free(mem_ctx);
685 return False;
688 r.out.total_entries = talloc_zero(mem_ctx, uint32_t);
689 if (r.out.total_entries == NULL) {
690 talloc_free(mem_ctx);
691 return False;
694 r.out.recordid = talloc_zero(mem_ctx, struct netr_UAS_INFO_0);
695 if (r.out.recordid == NULL) {
696 talloc_free(mem_ctx);
697 return False;
700 r.out.result = _netr_AccountDeltas(p, &r);
702 if (p->rng_fault_state) {
703 talloc_free(mem_ctx);
704 /* Return True here, srv_pipe_hnd.c will take care */
705 return True;
708 if (DEBUGLEVEL >= 10)
709 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
711 push = ndr_push_init_ctx(mem_ctx);
712 if (push == NULL) {
713 talloc_free(mem_ctx);
714 return False;
717 status = ndr_push_netr_AccountDeltas(push, NDR_OUT, &r);
718 if (NT_STATUS_IS_ERR(status)) {
719 talloc_free(mem_ctx);
720 return False;
723 blob = ndr_push_blob(push);
724 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
725 talloc_free(mem_ctx);
726 return False;
729 talloc_free(mem_ctx);
731 return True;
734 static BOOL api_netr_AccountSync(pipes_struct *p)
736 struct ndr_pull *pull;
737 struct ndr_push *push;
738 NTSTATUS status;
739 DATA_BLOB blob;
740 struct netr_AccountSync r;
741 TALLOC_CTX *mem_ctx = talloc_init("api_netr_AccountSync");
743 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
744 talloc_free(mem_ctx);
745 return False;
748 pull = ndr_pull_init_blob(&blob, mem_ctx);
749 if (pull == NULL) {
750 talloc_free(mem_ctx);
751 return False;
754 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
755 status = ndr_pull_netr_AccountSync(pull, NDR_IN, &r);
756 if (NT_STATUS_IS_ERR(status)) {
757 talloc_free(mem_ctx);
758 return False;
761 if (DEBUGLEVEL >= 10)
762 NDR_PRINT_IN_DEBUG(netr_AccountSync, &r);
764 ZERO_STRUCT(r.out);
765 r.out.return_authenticator = r.in.return_authenticator;
766 r.out.buffer = talloc_zero(mem_ctx, struct netr_AccountBuffer);
767 if (r.out.buffer == NULL) {
768 talloc_free(mem_ctx);
769 return False;
772 r.out.count_returned = talloc_zero(mem_ctx, uint32_t);
773 if (r.out.count_returned == NULL) {
774 talloc_free(mem_ctx);
775 return False;
778 r.out.total_entries = talloc_zero(mem_ctx, uint32_t);
779 if (r.out.total_entries == NULL) {
780 talloc_free(mem_ctx);
781 return False;
784 r.out.next_reference = talloc_zero(mem_ctx, uint32_t);
785 if (r.out.next_reference == NULL) {
786 talloc_free(mem_ctx);
787 return False;
790 r.out.recordid = r.in.recordid;
791 r.out.result = _netr_AccountSync(p, &r);
793 if (p->rng_fault_state) {
794 talloc_free(mem_ctx);
795 /* Return True here, srv_pipe_hnd.c will take care */
796 return True;
799 if (DEBUGLEVEL >= 10)
800 NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
802 push = ndr_push_init_ctx(mem_ctx);
803 if (push == NULL) {
804 talloc_free(mem_ctx);
805 return False;
808 status = ndr_push_netr_AccountSync(push, NDR_OUT, &r);
809 if (NT_STATUS_IS_ERR(status)) {
810 talloc_free(mem_ctx);
811 return False;
814 blob = ndr_push_blob(push);
815 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
816 talloc_free(mem_ctx);
817 return False;
820 talloc_free(mem_ctx);
822 return True;
825 static BOOL api_netr_GetDcName(pipes_struct *p)
827 struct ndr_pull *pull;
828 struct ndr_push *push;
829 NTSTATUS status;
830 DATA_BLOB blob;
831 struct netr_GetDcName r;
832 TALLOC_CTX *mem_ctx = talloc_init("api_netr_GetDcName");
834 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
835 talloc_free(mem_ctx);
836 return False;
839 pull = ndr_pull_init_blob(&blob, mem_ctx);
840 if (pull == NULL) {
841 talloc_free(mem_ctx);
842 return False;
845 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
846 status = ndr_pull_netr_GetDcName(pull, NDR_IN, &r);
847 if (NT_STATUS_IS_ERR(status)) {
848 talloc_free(mem_ctx);
849 return False;
852 if (DEBUGLEVEL >= 10)
853 NDR_PRINT_IN_DEBUG(netr_GetDcName, &r);
855 ZERO_STRUCT(r.out);
856 r.out.dcname = talloc_zero(mem_ctx, const char *);
857 if (r.out.dcname == NULL) {
858 talloc_free(mem_ctx);
859 return False;
862 r.out.result = _netr_GetDcName(p, &r);
864 if (p->rng_fault_state) {
865 talloc_free(mem_ctx);
866 /* Return True here, srv_pipe_hnd.c will take care */
867 return True;
870 if (DEBUGLEVEL >= 10)
871 NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
873 push = ndr_push_init_ctx(mem_ctx);
874 if (push == NULL) {
875 talloc_free(mem_ctx);
876 return False;
879 status = ndr_push_netr_GetDcName(push, NDR_OUT, &r);
880 if (NT_STATUS_IS_ERR(status)) {
881 talloc_free(mem_ctx);
882 return False;
885 blob = ndr_push_blob(push);
886 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
887 talloc_free(mem_ctx);
888 return False;
891 talloc_free(mem_ctx);
893 return True;
896 static BOOL api_netr_LogonControl(pipes_struct *p)
898 struct ndr_pull *pull;
899 struct ndr_push *push;
900 NTSTATUS status;
901 DATA_BLOB blob;
902 struct netr_LogonControl r;
903 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonControl");
905 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
906 talloc_free(mem_ctx);
907 return False;
910 pull = ndr_pull_init_blob(&blob, mem_ctx);
911 if (pull == NULL) {
912 talloc_free(mem_ctx);
913 return False;
916 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
917 status = ndr_pull_netr_LogonControl(pull, NDR_IN, &r);
918 if (NT_STATUS_IS_ERR(status)) {
919 talloc_free(mem_ctx);
920 return False;
923 if (DEBUGLEVEL >= 10)
924 NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
926 ZERO_STRUCT(r.out);
927 r.out.info = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
928 if (r.out.info == NULL) {
929 talloc_free(mem_ctx);
930 return False;
933 r.out.result = _netr_LogonControl(p, &r);
935 if (p->rng_fault_state) {
936 talloc_free(mem_ctx);
937 /* Return True here, srv_pipe_hnd.c will take care */
938 return True;
941 if (DEBUGLEVEL >= 10)
942 NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
944 push = ndr_push_init_ctx(mem_ctx);
945 if (push == NULL) {
946 talloc_free(mem_ctx);
947 return False;
950 status = ndr_push_netr_LogonControl(push, NDR_OUT, &r);
951 if (NT_STATUS_IS_ERR(status)) {
952 talloc_free(mem_ctx);
953 return False;
956 blob = ndr_push_blob(push);
957 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
958 talloc_free(mem_ctx);
959 return False;
962 talloc_free(mem_ctx);
964 return True;
967 static BOOL api_netr_GetAnyDCName(pipes_struct *p)
969 struct ndr_pull *pull;
970 struct ndr_push *push;
971 NTSTATUS status;
972 DATA_BLOB blob;
973 struct netr_GetAnyDCName r;
974 TALLOC_CTX *mem_ctx = talloc_init("api_netr_GetAnyDCName");
976 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
977 talloc_free(mem_ctx);
978 return False;
981 pull = ndr_pull_init_blob(&blob, mem_ctx);
982 if (pull == NULL) {
983 talloc_free(mem_ctx);
984 return False;
987 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
988 status = ndr_pull_netr_GetAnyDCName(pull, NDR_IN, &r);
989 if (NT_STATUS_IS_ERR(status)) {
990 talloc_free(mem_ctx);
991 return False;
994 if (DEBUGLEVEL >= 10)
995 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName, &r);
997 ZERO_STRUCT(r.out);
998 r.out.dcname = talloc_zero(mem_ctx, const char *);
999 if (r.out.dcname == NULL) {
1000 talloc_free(mem_ctx);
1001 return False;
1004 r.out.result = _netr_GetAnyDCName(p, &r);
1006 if (p->rng_fault_state) {
1007 talloc_free(mem_ctx);
1008 /* Return True here, srv_pipe_hnd.c will take care */
1009 return True;
1012 if (DEBUGLEVEL >= 10)
1013 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
1015 push = ndr_push_init_ctx(mem_ctx);
1016 if (push == NULL) {
1017 talloc_free(mem_ctx);
1018 return False;
1021 status = ndr_push_netr_GetAnyDCName(push, NDR_OUT, &r);
1022 if (NT_STATUS_IS_ERR(status)) {
1023 talloc_free(mem_ctx);
1024 return False;
1027 blob = ndr_push_blob(push);
1028 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1029 talloc_free(mem_ctx);
1030 return False;
1033 talloc_free(mem_ctx);
1035 return True;
1038 static BOOL api_netr_LogonControl2(pipes_struct *p)
1040 struct ndr_pull *pull;
1041 struct ndr_push *push;
1042 NTSTATUS status;
1043 DATA_BLOB blob;
1044 struct netr_LogonControl2 r;
1045 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonControl2");
1047 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1048 talloc_free(mem_ctx);
1049 return False;
1052 pull = ndr_pull_init_blob(&blob, mem_ctx);
1053 if (pull == NULL) {
1054 talloc_free(mem_ctx);
1055 return False;
1058 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1059 status = ndr_pull_netr_LogonControl2(pull, NDR_IN, &r);
1060 if (NT_STATUS_IS_ERR(status)) {
1061 talloc_free(mem_ctx);
1062 return False;
1065 if (DEBUGLEVEL >= 10)
1066 NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
1068 ZERO_STRUCT(r.out);
1069 r.out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
1070 if (r.out.query == NULL) {
1071 talloc_free(mem_ctx);
1072 return False;
1075 r.out.result = _netr_LogonControl2(p, &r);
1077 if (p->rng_fault_state) {
1078 talloc_free(mem_ctx);
1079 /* Return True here, srv_pipe_hnd.c will take care */
1080 return True;
1083 if (DEBUGLEVEL >= 10)
1084 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
1086 push = ndr_push_init_ctx(mem_ctx);
1087 if (push == NULL) {
1088 talloc_free(mem_ctx);
1089 return False;
1092 status = ndr_push_netr_LogonControl2(push, NDR_OUT, &r);
1093 if (NT_STATUS_IS_ERR(status)) {
1094 talloc_free(mem_ctx);
1095 return False;
1098 blob = ndr_push_blob(push);
1099 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1100 talloc_free(mem_ctx);
1101 return False;
1104 talloc_free(mem_ctx);
1106 return True;
1109 static BOOL api_netr_ServerAuthenticate2(pipes_struct *p)
1111 struct ndr_pull *pull;
1112 struct ndr_push *push;
1113 NTSTATUS status;
1114 DATA_BLOB blob;
1115 struct netr_ServerAuthenticate2 r;
1116 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerAuthenticate2");
1118 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1119 talloc_free(mem_ctx);
1120 return False;
1123 pull = ndr_pull_init_blob(&blob, mem_ctx);
1124 if (pull == NULL) {
1125 talloc_free(mem_ctx);
1126 return False;
1129 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1130 status = ndr_pull_netr_ServerAuthenticate2(pull, NDR_IN, &r);
1131 if (NT_STATUS_IS_ERR(status)) {
1132 talloc_free(mem_ctx);
1133 return False;
1136 if (DEBUGLEVEL >= 10)
1137 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2, &r);
1139 ZERO_STRUCT(r.out);
1140 r.out.credentials = r.in.credentials;
1141 r.out.negotiate_flags = r.in.negotiate_flags;
1142 r.out.result = _netr_ServerAuthenticate2(p, &r);
1144 if (p->rng_fault_state) {
1145 talloc_free(mem_ctx);
1146 /* Return True here, srv_pipe_hnd.c will take care */
1147 return True;
1150 if (DEBUGLEVEL >= 10)
1151 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
1153 push = ndr_push_init_ctx(mem_ctx);
1154 if (push == NULL) {
1155 talloc_free(mem_ctx);
1156 return False;
1159 status = ndr_push_netr_ServerAuthenticate2(push, NDR_OUT, &r);
1160 if (NT_STATUS_IS_ERR(status)) {
1161 talloc_free(mem_ctx);
1162 return False;
1165 blob = ndr_push_blob(push);
1166 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1167 talloc_free(mem_ctx);
1168 return False;
1171 talloc_free(mem_ctx);
1173 return True;
1176 static BOOL api_netr_DatabaseSync2(pipes_struct *p)
1178 struct ndr_pull *pull;
1179 struct ndr_push *push;
1180 NTSTATUS status;
1181 DATA_BLOB blob;
1182 struct netr_DatabaseSync2 r;
1183 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DatabaseSync2");
1185 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1186 talloc_free(mem_ctx);
1187 return False;
1190 pull = ndr_pull_init_blob(&blob, mem_ctx);
1191 if (pull == NULL) {
1192 talloc_free(mem_ctx);
1193 return False;
1196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1197 status = ndr_pull_netr_DatabaseSync2(pull, NDR_IN, &r);
1198 if (NT_STATUS_IS_ERR(status)) {
1199 talloc_free(mem_ctx);
1200 return False;
1203 if (DEBUGLEVEL >= 10)
1204 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2, &r);
1206 ZERO_STRUCT(r.out);
1207 r.out.return_authenticator = r.in.return_authenticator;
1208 r.out.sync_context = r.in.sync_context;
1209 r.out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY);
1210 if (r.out.delta_enum_array == NULL) {
1211 talloc_free(mem_ctx);
1212 return False;
1215 r.out.result = _netr_DatabaseSync2(p, &r);
1217 if (p->rng_fault_state) {
1218 talloc_free(mem_ctx);
1219 /* Return True here, srv_pipe_hnd.c will take care */
1220 return True;
1223 if (DEBUGLEVEL >= 10)
1224 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
1226 push = ndr_push_init_ctx(mem_ctx);
1227 if (push == NULL) {
1228 talloc_free(mem_ctx);
1229 return False;
1232 status = ndr_push_netr_DatabaseSync2(push, NDR_OUT, &r);
1233 if (NT_STATUS_IS_ERR(status)) {
1234 talloc_free(mem_ctx);
1235 return False;
1238 blob = ndr_push_blob(push);
1239 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1240 talloc_free(mem_ctx);
1241 return False;
1244 talloc_free(mem_ctx);
1246 return True;
1249 static BOOL api_netr_DatabaseRedo(pipes_struct *p)
1251 struct ndr_pull *pull;
1252 struct ndr_push *push;
1253 NTSTATUS status;
1254 DATA_BLOB blob;
1255 struct netr_DatabaseRedo r;
1256 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DatabaseRedo");
1258 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1259 talloc_free(mem_ctx);
1260 return False;
1263 pull = ndr_pull_init_blob(&blob, mem_ctx);
1264 if (pull == NULL) {
1265 talloc_free(mem_ctx);
1266 return False;
1269 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1270 status = ndr_pull_netr_DatabaseRedo(pull, NDR_IN, &r);
1271 if (NT_STATUS_IS_ERR(status)) {
1272 talloc_free(mem_ctx);
1273 return False;
1276 if (DEBUGLEVEL >= 10)
1277 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo, &r);
1279 ZERO_STRUCT(r.out);
1280 r.out.return_authenticator = r.in.return_authenticator;
1281 r.out.delta_enum_array = talloc_zero(mem_ctx, struct netr_DELTA_ENUM_ARRAY);
1282 if (r.out.delta_enum_array == NULL) {
1283 talloc_free(mem_ctx);
1284 return False;
1287 r.out.result = _netr_DatabaseRedo(p, &r);
1289 if (p->rng_fault_state) {
1290 talloc_free(mem_ctx);
1291 /* Return True here, srv_pipe_hnd.c will take care */
1292 return True;
1295 if (DEBUGLEVEL >= 10)
1296 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
1298 push = ndr_push_init_ctx(mem_ctx);
1299 if (push == NULL) {
1300 talloc_free(mem_ctx);
1301 return False;
1304 status = ndr_push_netr_DatabaseRedo(push, NDR_OUT, &r);
1305 if (NT_STATUS_IS_ERR(status)) {
1306 talloc_free(mem_ctx);
1307 return False;
1310 blob = ndr_push_blob(push);
1311 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1312 talloc_free(mem_ctx);
1313 return False;
1316 talloc_free(mem_ctx);
1318 return True;
1321 static BOOL api_netr_LogonControl2Ex(pipes_struct *p)
1323 struct ndr_pull *pull;
1324 struct ndr_push *push;
1325 NTSTATUS status;
1326 DATA_BLOB blob;
1327 struct netr_LogonControl2Ex r;
1328 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonControl2Ex");
1330 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1331 talloc_free(mem_ctx);
1332 return False;
1335 pull = ndr_pull_init_blob(&blob, mem_ctx);
1336 if (pull == NULL) {
1337 talloc_free(mem_ctx);
1338 return False;
1341 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1342 status = ndr_pull_netr_LogonControl2Ex(pull, NDR_IN, &r);
1343 if (NT_STATUS_IS_ERR(status)) {
1344 talloc_free(mem_ctx);
1345 return False;
1348 if (DEBUGLEVEL >= 10)
1349 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
1351 ZERO_STRUCT(r.out);
1352 r.out.query = talloc_zero(mem_ctx, union netr_CONTROL_QUERY_INFORMATION);
1353 if (r.out.query == NULL) {
1354 talloc_free(mem_ctx);
1355 return False;
1358 r.out.result = _netr_LogonControl2Ex(p, &r);
1360 if (p->rng_fault_state) {
1361 talloc_free(mem_ctx);
1362 /* Return True here, srv_pipe_hnd.c will take care */
1363 return True;
1366 if (DEBUGLEVEL >= 10)
1367 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
1369 push = ndr_push_init_ctx(mem_ctx);
1370 if (push == NULL) {
1371 talloc_free(mem_ctx);
1372 return False;
1375 status = ndr_push_netr_LogonControl2Ex(push, NDR_OUT, &r);
1376 if (NT_STATUS_IS_ERR(status)) {
1377 talloc_free(mem_ctx);
1378 return False;
1381 blob = ndr_push_blob(push);
1382 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1383 talloc_free(mem_ctx);
1384 return False;
1387 talloc_free(mem_ctx);
1389 return True;
1392 static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINS(pipes_struct *p)
1394 struct ndr_pull *pull;
1395 struct ndr_push *push;
1396 NTSTATUS status;
1397 DATA_BLOB blob;
1398 struct netr_NETRENUMERATETRUSTEDDOMAINS r;
1399 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRENUMERATETRUSTEDDOMAINS");
1401 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1402 talloc_free(mem_ctx);
1403 return False;
1406 pull = ndr_pull_init_blob(&blob, mem_ctx);
1407 if (pull == NULL) {
1408 talloc_free(mem_ctx);
1409 return False;
1412 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1413 status = ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINS(pull, NDR_IN, &r);
1414 if (NT_STATUS_IS_ERR(status)) {
1415 talloc_free(mem_ctx);
1416 return False;
1419 if (DEBUGLEVEL >= 10)
1420 NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r);
1422 r.out.result = _netr_NETRENUMERATETRUSTEDDOMAINS(p, &r);
1424 if (p->rng_fault_state) {
1425 talloc_free(mem_ctx);
1426 /* Return True here, srv_pipe_hnd.c will take care */
1427 return True;
1430 if (DEBUGLEVEL >= 10)
1431 NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINS, &r);
1433 push = ndr_push_init_ctx(mem_ctx);
1434 if (push == NULL) {
1435 talloc_free(mem_ctx);
1436 return False;
1439 status = ndr_push_netr_NETRENUMERATETRUSTEDDOMAINS(push, NDR_OUT, &r);
1440 if (NT_STATUS_IS_ERR(status)) {
1441 talloc_free(mem_ctx);
1442 return False;
1445 blob = ndr_push_blob(push);
1446 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1447 talloc_free(mem_ctx);
1448 return False;
1451 talloc_free(mem_ctx);
1453 return True;
1456 static BOOL api_netr_DsRGetDCName(pipes_struct *p)
1458 struct ndr_pull *pull;
1459 struct ndr_push *push;
1460 NTSTATUS status;
1461 DATA_BLOB blob;
1462 struct netr_DsRGetDCName r;
1463 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DsRGetDCName");
1465 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1466 talloc_free(mem_ctx);
1467 return False;
1470 pull = ndr_pull_init_blob(&blob, mem_ctx);
1471 if (pull == NULL) {
1472 talloc_free(mem_ctx);
1473 return False;
1476 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1477 status = ndr_pull_netr_DsRGetDCName(pull, NDR_IN, &r);
1478 if (NT_STATUS_IS_ERR(status)) {
1479 talloc_free(mem_ctx);
1480 return False;
1483 if (DEBUGLEVEL >= 10)
1484 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
1486 ZERO_STRUCT(r.out);
1487 r.out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo);
1488 if (r.out.info == NULL) {
1489 talloc_free(mem_ctx);
1490 return False;
1493 r.out.result = _netr_DsRGetDCName(p, &r);
1495 if (p->rng_fault_state) {
1496 talloc_free(mem_ctx);
1497 /* Return True here, srv_pipe_hnd.c will take care */
1498 return True;
1501 if (DEBUGLEVEL >= 10)
1502 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
1504 push = ndr_push_init_ctx(mem_ctx);
1505 if (push == NULL) {
1506 talloc_free(mem_ctx);
1507 return False;
1510 status = ndr_push_netr_DsRGetDCName(push, NDR_OUT, &r);
1511 if (NT_STATUS_IS_ERR(status)) {
1512 talloc_free(mem_ctx);
1513 return False;
1516 blob = ndr_push_blob(push);
1517 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1518 talloc_free(mem_ctx);
1519 return False;
1522 talloc_free(mem_ctx);
1524 return True;
1527 static BOOL api_netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p)
1529 struct ndr_pull *pull;
1530 struct ndr_push *push;
1531 NTSTATUS status;
1532 DATA_BLOB blob;
1533 struct netr_NETRLOGONDUMMYROUTINE1 r;
1534 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONDUMMYROUTINE1");
1536 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1537 talloc_free(mem_ctx);
1538 return False;
1541 pull = ndr_pull_init_blob(&blob, mem_ctx);
1542 if (pull == NULL) {
1543 talloc_free(mem_ctx);
1544 return False;
1547 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1548 status = ndr_pull_netr_NETRLOGONDUMMYROUTINE1(pull, NDR_IN, &r);
1549 if (NT_STATUS_IS_ERR(status)) {
1550 talloc_free(mem_ctx);
1551 return False;
1554 if (DEBUGLEVEL >= 10)
1555 NDR_PRINT_IN_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
1557 r.out.result = _netr_NETRLOGONDUMMYROUTINE1(p, &r);
1559 if (p->rng_fault_state) {
1560 talloc_free(mem_ctx);
1561 /* Return True here, srv_pipe_hnd.c will take care */
1562 return True;
1565 if (DEBUGLEVEL >= 10)
1566 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONDUMMYROUTINE1, &r);
1568 push = ndr_push_init_ctx(mem_ctx);
1569 if (push == NULL) {
1570 talloc_free(mem_ctx);
1571 return False;
1574 status = ndr_push_netr_NETRLOGONDUMMYROUTINE1(push, NDR_OUT, &r);
1575 if (NT_STATUS_IS_ERR(status)) {
1576 talloc_free(mem_ctx);
1577 return False;
1580 blob = ndr_push_blob(push);
1581 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1582 talloc_free(mem_ctx);
1583 return False;
1586 talloc_free(mem_ctx);
1588 return True;
1591 static BOOL api_netr_NETRLOGONSETSERVICEBITS(pipes_struct *p)
1593 struct ndr_pull *pull;
1594 struct ndr_push *push;
1595 NTSTATUS status;
1596 DATA_BLOB blob;
1597 struct netr_NETRLOGONSETSERVICEBITS r;
1598 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONSETSERVICEBITS");
1600 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1601 talloc_free(mem_ctx);
1602 return False;
1605 pull = ndr_pull_init_blob(&blob, mem_ctx);
1606 if (pull == NULL) {
1607 talloc_free(mem_ctx);
1608 return False;
1611 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1612 status = ndr_pull_netr_NETRLOGONSETSERVICEBITS(pull, NDR_IN, &r);
1613 if (NT_STATUS_IS_ERR(status)) {
1614 talloc_free(mem_ctx);
1615 return False;
1618 if (DEBUGLEVEL >= 10)
1619 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
1621 r.out.result = _netr_NETRLOGONSETSERVICEBITS(p, &r);
1623 if (p->rng_fault_state) {
1624 talloc_free(mem_ctx);
1625 /* Return True here, srv_pipe_hnd.c will take care */
1626 return True;
1629 if (DEBUGLEVEL >= 10)
1630 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
1632 push = ndr_push_init_ctx(mem_ctx);
1633 if (push == NULL) {
1634 talloc_free(mem_ctx);
1635 return False;
1638 status = ndr_push_netr_NETRLOGONSETSERVICEBITS(push, NDR_OUT, &r);
1639 if (NT_STATUS_IS_ERR(status)) {
1640 talloc_free(mem_ctx);
1641 return False;
1644 blob = ndr_push_blob(push);
1645 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1646 talloc_free(mem_ctx);
1647 return False;
1650 talloc_free(mem_ctx);
1652 return True;
1655 static BOOL api_netr_NETRLOGONGETTRUSTRID(pipes_struct *p)
1657 struct ndr_pull *pull;
1658 struct ndr_push *push;
1659 NTSTATUS status;
1660 DATA_BLOB blob;
1661 struct netr_NETRLOGONGETTRUSTRID r;
1662 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONGETTRUSTRID");
1664 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1665 talloc_free(mem_ctx);
1666 return False;
1669 pull = ndr_pull_init_blob(&blob, mem_ctx);
1670 if (pull == NULL) {
1671 talloc_free(mem_ctx);
1672 return False;
1675 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1676 status = ndr_pull_netr_NETRLOGONGETTRUSTRID(pull, NDR_IN, &r);
1677 if (NT_STATUS_IS_ERR(status)) {
1678 talloc_free(mem_ctx);
1679 return False;
1682 if (DEBUGLEVEL >= 10)
1683 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTRUSTRID, &r);
1685 r.out.result = _netr_NETRLOGONGETTRUSTRID(p, &r);
1687 if (p->rng_fault_state) {
1688 talloc_free(mem_ctx);
1689 /* Return True here, srv_pipe_hnd.c will take care */
1690 return True;
1693 if (DEBUGLEVEL >= 10)
1694 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTRUSTRID, &r);
1696 push = ndr_push_init_ctx(mem_ctx);
1697 if (push == NULL) {
1698 talloc_free(mem_ctx);
1699 return False;
1702 status = ndr_push_netr_NETRLOGONGETTRUSTRID(push, NDR_OUT, &r);
1703 if (NT_STATUS_IS_ERR(status)) {
1704 talloc_free(mem_ctx);
1705 return False;
1708 blob = ndr_push_blob(push);
1709 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1710 talloc_free(mem_ctx);
1711 return False;
1714 talloc_free(mem_ctx);
1716 return True;
1719 static BOOL api_netr_NETRLOGONCOMPUTESERVERDIGEST(pipes_struct *p)
1721 struct ndr_pull *pull;
1722 struct ndr_push *push;
1723 NTSTATUS status;
1724 DATA_BLOB blob;
1725 struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
1726 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONCOMPUTESERVERDIGEST");
1728 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1729 talloc_free(mem_ctx);
1730 return False;
1733 pull = ndr_pull_init_blob(&blob, mem_ctx);
1734 if (pull == NULL) {
1735 talloc_free(mem_ctx);
1736 return False;
1739 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1740 status = ndr_pull_netr_NETRLOGONCOMPUTESERVERDIGEST(pull, NDR_IN, &r);
1741 if (NT_STATUS_IS_ERR(status)) {
1742 talloc_free(mem_ctx);
1743 return False;
1746 if (DEBUGLEVEL >= 10)
1747 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
1749 r.out.result = _netr_NETRLOGONCOMPUTESERVERDIGEST(p, &r);
1751 if (p->rng_fault_state) {
1752 talloc_free(mem_ctx);
1753 /* Return True here, srv_pipe_hnd.c will take care */
1754 return True;
1757 if (DEBUGLEVEL >= 10)
1758 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
1760 push = ndr_push_init_ctx(mem_ctx);
1761 if (push == NULL) {
1762 talloc_free(mem_ctx);
1763 return False;
1766 status = ndr_push_netr_NETRLOGONCOMPUTESERVERDIGEST(push, NDR_OUT, &r);
1767 if (NT_STATUS_IS_ERR(status)) {
1768 talloc_free(mem_ctx);
1769 return False;
1772 blob = ndr_push_blob(push);
1773 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1774 talloc_free(mem_ctx);
1775 return False;
1778 talloc_free(mem_ctx);
1780 return True;
1783 static BOOL api_netr_NETRLOGONCOMPUTECLIENTDIGEST(pipes_struct *p)
1785 struct ndr_pull *pull;
1786 struct ndr_push *push;
1787 NTSTATUS status;
1788 DATA_BLOB blob;
1789 struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
1790 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONCOMPUTECLIENTDIGEST");
1792 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1793 talloc_free(mem_ctx);
1794 return False;
1797 pull = ndr_pull_init_blob(&blob, mem_ctx);
1798 if (pull == NULL) {
1799 talloc_free(mem_ctx);
1800 return False;
1803 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1804 status = ndr_pull_netr_NETRLOGONCOMPUTECLIENTDIGEST(pull, NDR_IN, &r);
1805 if (NT_STATUS_IS_ERR(status)) {
1806 talloc_free(mem_ctx);
1807 return False;
1810 if (DEBUGLEVEL >= 10)
1811 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
1813 r.out.result = _netr_NETRLOGONCOMPUTECLIENTDIGEST(p, &r);
1815 if (p->rng_fault_state) {
1816 talloc_free(mem_ctx);
1817 /* Return True here, srv_pipe_hnd.c will take care */
1818 return True;
1821 if (DEBUGLEVEL >= 10)
1822 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
1824 push = ndr_push_init_ctx(mem_ctx);
1825 if (push == NULL) {
1826 talloc_free(mem_ctx);
1827 return False;
1830 status = ndr_push_netr_NETRLOGONCOMPUTECLIENTDIGEST(push, NDR_OUT, &r);
1831 if (NT_STATUS_IS_ERR(status)) {
1832 talloc_free(mem_ctx);
1833 return False;
1836 blob = ndr_push_blob(push);
1837 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1838 talloc_free(mem_ctx);
1839 return False;
1842 talloc_free(mem_ctx);
1844 return True;
1847 static BOOL api_netr_ServerAuthenticate3(pipes_struct *p)
1849 struct ndr_pull *pull;
1850 struct ndr_push *push;
1851 NTSTATUS status;
1852 DATA_BLOB blob;
1853 struct netr_ServerAuthenticate3 r;
1854 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerAuthenticate3");
1856 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1857 talloc_free(mem_ctx);
1858 return False;
1861 pull = ndr_pull_init_blob(&blob, mem_ctx);
1862 if (pull == NULL) {
1863 talloc_free(mem_ctx);
1864 return False;
1867 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1868 status = ndr_pull_netr_ServerAuthenticate3(pull, NDR_IN, &r);
1869 if (NT_STATUS_IS_ERR(status)) {
1870 talloc_free(mem_ctx);
1871 return False;
1874 if (DEBUGLEVEL >= 10)
1875 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3, &r);
1877 ZERO_STRUCT(r.out);
1878 r.out.credentials = r.in.credentials;
1879 r.out.negotiate_flags = r.in.negotiate_flags;
1880 r.out.rid = talloc_zero(mem_ctx, uint32_t);
1881 if (r.out.rid == NULL) {
1882 talloc_free(mem_ctx);
1883 return False;
1886 r.out.result = _netr_ServerAuthenticate3(p, &r);
1888 if (p->rng_fault_state) {
1889 talloc_free(mem_ctx);
1890 /* Return True here, srv_pipe_hnd.c will take care */
1891 return True;
1894 if (DEBUGLEVEL >= 10)
1895 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r);
1897 push = ndr_push_init_ctx(mem_ctx);
1898 if (push == NULL) {
1899 talloc_free(mem_ctx);
1900 return False;
1903 status = ndr_push_netr_ServerAuthenticate3(push, NDR_OUT, &r);
1904 if (NT_STATUS_IS_ERR(status)) {
1905 talloc_free(mem_ctx);
1906 return False;
1909 blob = ndr_push_blob(push);
1910 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1911 talloc_free(mem_ctx);
1912 return False;
1915 talloc_free(mem_ctx);
1917 return True;
1920 static BOOL api_netr_DsRGetDCNameEx(pipes_struct *p)
1922 struct ndr_pull *pull;
1923 struct ndr_push *push;
1924 NTSTATUS status;
1925 DATA_BLOB blob;
1926 struct netr_DsRGetDCNameEx r;
1927 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DsRGetDCNameEx");
1929 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1930 talloc_free(mem_ctx);
1931 return False;
1934 pull = ndr_pull_init_blob(&blob, mem_ctx);
1935 if (pull == NULL) {
1936 talloc_free(mem_ctx);
1937 return False;
1940 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1941 status = ndr_pull_netr_DsRGetDCNameEx(pull, NDR_IN, &r);
1942 if (NT_STATUS_IS_ERR(status)) {
1943 talloc_free(mem_ctx);
1944 return False;
1947 if (DEBUGLEVEL >= 10)
1948 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r);
1950 ZERO_STRUCT(r.out);
1951 r.out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo);
1952 if (r.out.info == NULL) {
1953 talloc_free(mem_ctx);
1954 return False;
1957 r.out.result = _netr_DsRGetDCNameEx(p, &r);
1959 if (p->rng_fault_state) {
1960 talloc_free(mem_ctx);
1961 /* Return True here, srv_pipe_hnd.c will take care */
1962 return True;
1965 if (DEBUGLEVEL >= 10)
1966 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r);
1968 push = ndr_push_init_ctx(mem_ctx);
1969 if (push == NULL) {
1970 talloc_free(mem_ctx);
1971 return False;
1974 status = ndr_push_netr_DsRGetDCNameEx(push, NDR_OUT, &r);
1975 if (NT_STATUS_IS_ERR(status)) {
1976 talloc_free(mem_ctx);
1977 return False;
1980 blob = ndr_push_blob(push);
1981 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1982 talloc_free(mem_ctx);
1983 return False;
1986 talloc_free(mem_ctx);
1988 return True;
1991 static BOOL api_netr_DsRGetSiteName(pipes_struct *p)
1993 struct ndr_pull *pull;
1994 struct ndr_push *push;
1995 NTSTATUS status;
1996 DATA_BLOB blob;
1997 struct netr_DsRGetSiteName r;
1998 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DsRGetSiteName");
2000 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2001 talloc_free(mem_ctx);
2002 return False;
2005 pull = ndr_pull_init_blob(&blob, mem_ctx);
2006 if (pull == NULL) {
2007 talloc_free(mem_ctx);
2008 return False;
2011 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2012 status = ndr_pull_netr_DsRGetSiteName(pull, NDR_IN, &r);
2013 if (NT_STATUS_IS_ERR(status)) {
2014 talloc_free(mem_ctx);
2015 return False;
2018 if (DEBUGLEVEL >= 10)
2019 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r);
2021 ZERO_STRUCT(r.out);
2022 r.out.site = talloc_zero(mem_ctx, const char *);
2023 if (r.out.site == NULL) {
2024 talloc_free(mem_ctx);
2025 return False;
2028 r.out.result = _netr_DsRGetSiteName(p, &r);
2030 if (p->rng_fault_state) {
2031 talloc_free(mem_ctx);
2032 /* Return True here, srv_pipe_hnd.c will take care */
2033 return True;
2036 if (DEBUGLEVEL >= 10)
2037 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r);
2039 push = ndr_push_init_ctx(mem_ctx);
2040 if (push == NULL) {
2041 talloc_free(mem_ctx);
2042 return False;
2045 status = ndr_push_netr_DsRGetSiteName(push, NDR_OUT, &r);
2046 if (NT_STATUS_IS_ERR(status)) {
2047 talloc_free(mem_ctx);
2048 return False;
2051 blob = ndr_push_blob(push);
2052 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2053 talloc_free(mem_ctx);
2054 return False;
2057 talloc_free(mem_ctx);
2059 return True;
2062 static BOOL api_netr_LogonGetDomainInfo(pipes_struct *p)
2064 struct ndr_pull *pull;
2065 struct ndr_push *push;
2066 NTSTATUS status;
2067 DATA_BLOB blob;
2068 struct netr_LogonGetDomainInfo r;
2069 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonGetDomainInfo");
2071 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2072 talloc_free(mem_ctx);
2073 return False;
2076 pull = ndr_pull_init_blob(&blob, mem_ctx);
2077 if (pull == NULL) {
2078 talloc_free(mem_ctx);
2079 return False;
2082 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2083 status = ndr_pull_netr_LogonGetDomainInfo(pull, NDR_IN, &r);
2084 if (NT_STATUS_IS_ERR(status)) {
2085 talloc_free(mem_ctx);
2086 return False;
2089 if (DEBUGLEVEL >= 10)
2090 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r);
2092 ZERO_STRUCT(r.out);
2093 r.out.return_authenticator = r.in.return_authenticator;
2094 r.out.info = talloc_zero(mem_ctx, union netr_DomainInfo);
2095 if (r.out.info == NULL) {
2096 talloc_free(mem_ctx);
2097 return False;
2100 r.out.result = _netr_LogonGetDomainInfo(p, &r);
2102 if (p->rng_fault_state) {
2103 talloc_free(mem_ctx);
2104 /* Return True here, srv_pipe_hnd.c will take care */
2105 return True;
2108 if (DEBUGLEVEL >= 10)
2109 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r);
2111 push = ndr_push_init_ctx(mem_ctx);
2112 if (push == NULL) {
2113 talloc_free(mem_ctx);
2114 return False;
2117 status = ndr_push_netr_LogonGetDomainInfo(push, NDR_OUT, &r);
2118 if (NT_STATUS_IS_ERR(status)) {
2119 talloc_free(mem_ctx);
2120 return False;
2123 blob = ndr_push_blob(push);
2124 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2125 talloc_free(mem_ctx);
2126 return False;
2129 talloc_free(mem_ctx);
2131 return True;
2134 static BOOL api_netr_ServerPasswordSet2(pipes_struct *p)
2136 struct ndr_pull *pull;
2137 struct ndr_push *push;
2138 NTSTATUS status;
2139 DATA_BLOB blob;
2140 struct netr_ServerPasswordSet2 r;
2141 TALLOC_CTX *mem_ctx = talloc_init("api_netr_ServerPasswordSet2");
2143 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2144 talloc_free(mem_ctx);
2145 return False;
2148 pull = ndr_pull_init_blob(&blob, mem_ctx);
2149 if (pull == NULL) {
2150 talloc_free(mem_ctx);
2151 return False;
2154 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2155 status = ndr_pull_netr_ServerPasswordSet2(pull, NDR_IN, &r);
2156 if (NT_STATUS_IS_ERR(status)) {
2157 talloc_free(mem_ctx);
2158 return False;
2161 if (DEBUGLEVEL >= 10)
2162 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2, &r);
2164 ZERO_STRUCT(r.out);
2165 r.out.return_authenticator = talloc_zero(mem_ctx, struct netr_Authenticator);
2166 if (r.out.return_authenticator == NULL) {
2167 talloc_free(mem_ctx);
2168 return False;
2171 r.out.result = _netr_ServerPasswordSet2(p, &r);
2173 if (p->rng_fault_state) {
2174 talloc_free(mem_ctx);
2175 /* Return True here, srv_pipe_hnd.c will take care */
2176 return True;
2179 if (DEBUGLEVEL >= 10)
2180 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
2182 push = ndr_push_init_ctx(mem_ctx);
2183 if (push == NULL) {
2184 talloc_free(mem_ctx);
2185 return False;
2188 status = ndr_push_netr_ServerPasswordSet2(push, NDR_OUT, &r);
2189 if (NT_STATUS_IS_ERR(status)) {
2190 talloc_free(mem_ctx);
2191 return False;
2194 blob = ndr_push_blob(push);
2195 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2196 talloc_free(mem_ctx);
2197 return False;
2200 talloc_free(mem_ctx);
2202 return True;
2205 static BOOL api_netr_NETRSERVERPASSWORDGET(pipes_struct *p)
2207 struct ndr_pull *pull;
2208 struct ndr_push *push;
2209 NTSTATUS status;
2210 DATA_BLOB blob;
2211 struct netr_NETRSERVERPASSWORDGET r;
2212 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRSERVERPASSWORDGET");
2214 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2215 talloc_free(mem_ctx);
2216 return False;
2219 pull = ndr_pull_init_blob(&blob, mem_ctx);
2220 if (pull == NULL) {
2221 talloc_free(mem_ctx);
2222 return False;
2225 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2226 status = ndr_pull_netr_NETRSERVERPASSWORDGET(pull, NDR_IN, &r);
2227 if (NT_STATUS_IS_ERR(status)) {
2228 talloc_free(mem_ctx);
2229 return False;
2232 if (DEBUGLEVEL >= 10)
2233 NDR_PRINT_IN_DEBUG(netr_NETRSERVERPASSWORDGET, &r);
2235 r.out.result = _netr_NETRSERVERPASSWORDGET(p, &r);
2237 if (p->rng_fault_state) {
2238 talloc_free(mem_ctx);
2239 /* Return True here, srv_pipe_hnd.c will take care */
2240 return True;
2243 if (DEBUGLEVEL >= 10)
2244 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERPASSWORDGET, &r);
2246 push = ndr_push_init_ctx(mem_ctx);
2247 if (push == NULL) {
2248 talloc_free(mem_ctx);
2249 return False;
2252 status = ndr_push_netr_NETRSERVERPASSWORDGET(push, NDR_OUT, &r);
2253 if (NT_STATUS_IS_ERR(status)) {
2254 talloc_free(mem_ctx);
2255 return False;
2258 blob = ndr_push_blob(push);
2259 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2260 talloc_free(mem_ctx);
2261 return False;
2264 talloc_free(mem_ctx);
2266 return True;
2269 static BOOL api_netr_NETRLOGONSENDTOSAM(pipes_struct *p)
2271 struct ndr_pull *pull;
2272 struct ndr_push *push;
2273 NTSTATUS status;
2274 DATA_BLOB blob;
2275 struct netr_NETRLOGONSENDTOSAM r;
2276 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONSENDTOSAM");
2278 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2279 talloc_free(mem_ctx);
2280 return False;
2283 pull = ndr_pull_init_blob(&blob, mem_ctx);
2284 if (pull == NULL) {
2285 talloc_free(mem_ctx);
2286 return False;
2289 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2290 status = ndr_pull_netr_NETRLOGONSENDTOSAM(pull, NDR_IN, &r);
2291 if (NT_STATUS_IS_ERR(status)) {
2292 talloc_free(mem_ctx);
2293 return False;
2296 if (DEBUGLEVEL >= 10)
2297 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
2299 r.out.result = _netr_NETRLOGONSENDTOSAM(p, &r);
2301 if (p->rng_fault_state) {
2302 talloc_free(mem_ctx);
2303 /* Return True here, srv_pipe_hnd.c will take care */
2304 return True;
2307 if (DEBUGLEVEL >= 10)
2308 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
2310 push = ndr_push_init_ctx(mem_ctx);
2311 if (push == NULL) {
2312 talloc_free(mem_ctx);
2313 return False;
2316 status = ndr_push_netr_NETRLOGONSENDTOSAM(push, NDR_OUT, &r);
2317 if (NT_STATUS_IS_ERR(status)) {
2318 talloc_free(mem_ctx);
2319 return False;
2322 blob = ndr_push_blob(push);
2323 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2324 talloc_free(mem_ctx);
2325 return False;
2328 talloc_free(mem_ctx);
2330 return True;
2333 static BOOL api_netr_DSRADDRESSTOSITENAMESW(pipes_struct *p)
2335 struct ndr_pull *pull;
2336 struct ndr_push *push;
2337 NTSTATUS status;
2338 DATA_BLOB blob;
2339 struct netr_DSRADDRESSTOSITENAMESW r;
2340 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DSRADDRESSTOSITENAMESW");
2342 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2343 talloc_free(mem_ctx);
2344 return False;
2347 pull = ndr_pull_init_blob(&blob, mem_ctx);
2348 if (pull == NULL) {
2349 talloc_free(mem_ctx);
2350 return False;
2353 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2354 status = ndr_pull_netr_DSRADDRESSTOSITENAMESW(pull, NDR_IN, &r);
2355 if (NT_STATUS_IS_ERR(status)) {
2356 talloc_free(mem_ctx);
2357 return False;
2360 if (DEBUGLEVEL >= 10)
2361 NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r);
2363 r.out.result = _netr_DSRADDRESSTOSITENAMESW(p, &r);
2365 if (p->rng_fault_state) {
2366 talloc_free(mem_ctx);
2367 /* Return True here, srv_pipe_hnd.c will take care */
2368 return True;
2371 if (DEBUGLEVEL >= 10)
2372 NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESW, &r);
2374 push = ndr_push_init_ctx(mem_ctx);
2375 if (push == NULL) {
2376 talloc_free(mem_ctx);
2377 return False;
2380 status = ndr_push_netr_DSRADDRESSTOSITENAMESW(push, NDR_OUT, &r);
2381 if (NT_STATUS_IS_ERR(status)) {
2382 talloc_free(mem_ctx);
2383 return False;
2386 blob = ndr_push_blob(push);
2387 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2388 talloc_free(mem_ctx);
2389 return False;
2392 talloc_free(mem_ctx);
2394 return True;
2397 static BOOL api_netr_DsRGetDCNameEx2(pipes_struct *p)
2399 struct ndr_pull *pull;
2400 struct ndr_push *push;
2401 NTSTATUS status;
2402 DATA_BLOB blob;
2403 struct netr_DsRGetDCNameEx2 r;
2404 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DsRGetDCNameEx2");
2406 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2407 talloc_free(mem_ctx);
2408 return False;
2411 pull = ndr_pull_init_blob(&blob, mem_ctx);
2412 if (pull == NULL) {
2413 talloc_free(mem_ctx);
2414 return False;
2417 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2418 status = ndr_pull_netr_DsRGetDCNameEx2(pull, NDR_IN, &r);
2419 if (NT_STATUS_IS_ERR(status)) {
2420 talloc_free(mem_ctx);
2421 return False;
2424 if (DEBUGLEVEL >= 10)
2425 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r);
2427 ZERO_STRUCT(r.out);
2428 r.out.info = talloc_zero(mem_ctx, struct netr_DsRGetDCNameInfo);
2429 if (r.out.info == NULL) {
2430 talloc_free(mem_ctx);
2431 return False;
2434 r.out.result = _netr_DsRGetDCNameEx2(p, &r);
2436 if (p->rng_fault_state) {
2437 talloc_free(mem_ctx);
2438 /* Return True here, srv_pipe_hnd.c will take care */
2439 return True;
2442 if (DEBUGLEVEL >= 10)
2443 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r);
2445 push = ndr_push_init_ctx(mem_ctx);
2446 if (push == NULL) {
2447 talloc_free(mem_ctx);
2448 return False;
2451 status = ndr_push_netr_DsRGetDCNameEx2(push, NDR_OUT, &r);
2452 if (NT_STATUS_IS_ERR(status)) {
2453 talloc_free(mem_ctx);
2454 return False;
2457 blob = ndr_push_blob(push);
2458 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2459 talloc_free(mem_ctx);
2460 return False;
2463 talloc_free(mem_ctx);
2465 return True;
2468 static BOOL api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pipes_struct *p)
2470 struct ndr_pull *pull;
2471 struct ndr_push *push;
2472 NTSTATUS status;
2473 DATA_BLOB blob;
2474 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
2475 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN");
2477 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2478 talloc_free(mem_ctx);
2479 return False;
2482 pull = ndr_pull_init_blob(&blob, mem_ctx);
2483 if (pull == NULL) {
2484 talloc_free(mem_ctx);
2485 return False;
2488 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2489 status = ndr_pull_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(pull, NDR_IN, &r);
2490 if (NT_STATUS_IS_ERR(status)) {
2491 talloc_free(mem_ctx);
2492 return False;
2495 if (DEBUGLEVEL >= 10)
2496 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
2498 r.out.result = _netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(p, &r);
2500 if (p->rng_fault_state) {
2501 talloc_free(mem_ctx);
2502 /* Return True here, srv_pipe_hnd.c will take care */
2503 return True;
2506 if (DEBUGLEVEL >= 10)
2507 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
2509 push = ndr_push_init_ctx(mem_ctx);
2510 if (push == NULL) {
2511 talloc_free(mem_ctx);
2512 return False;
2515 status = ndr_push_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(push, NDR_OUT, &r);
2516 if (NT_STATUS_IS_ERR(status)) {
2517 talloc_free(mem_ctx);
2518 return False;
2521 blob = ndr_push_blob(push);
2522 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2523 talloc_free(mem_ctx);
2524 return False;
2527 talloc_free(mem_ctx);
2529 return True;
2532 static BOOL api_netr_NETRENUMERATETRUSTEDDOMAINSEX(pipes_struct *p)
2534 struct ndr_pull *pull;
2535 struct ndr_push *push;
2536 NTSTATUS status;
2537 DATA_BLOB blob;
2538 struct netr_NETRENUMERATETRUSTEDDOMAINSEX r;
2539 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRENUMERATETRUSTEDDOMAINSEX");
2541 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2542 talloc_free(mem_ctx);
2543 return False;
2546 pull = ndr_pull_init_blob(&blob, mem_ctx);
2547 if (pull == NULL) {
2548 talloc_free(mem_ctx);
2549 return False;
2552 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2553 status = ndr_pull_netr_NETRENUMERATETRUSTEDDOMAINSEX(pull, NDR_IN, &r);
2554 if (NT_STATUS_IS_ERR(status)) {
2555 talloc_free(mem_ctx);
2556 return False;
2559 if (DEBUGLEVEL >= 10)
2560 NDR_PRINT_IN_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r);
2562 r.out.result = _netr_NETRENUMERATETRUSTEDDOMAINSEX(p, &r);
2564 if (p->rng_fault_state) {
2565 talloc_free(mem_ctx);
2566 /* Return True here, srv_pipe_hnd.c will take care */
2567 return True;
2570 if (DEBUGLEVEL >= 10)
2571 NDR_PRINT_OUT_DEBUG(netr_NETRENUMERATETRUSTEDDOMAINSEX, &r);
2573 push = ndr_push_init_ctx(mem_ctx);
2574 if (push == NULL) {
2575 talloc_free(mem_ctx);
2576 return False;
2579 status = ndr_push_netr_NETRENUMERATETRUSTEDDOMAINSEX(push, NDR_OUT, &r);
2580 if (NT_STATUS_IS_ERR(status)) {
2581 talloc_free(mem_ctx);
2582 return False;
2585 blob = ndr_push_blob(push);
2586 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2587 talloc_free(mem_ctx);
2588 return False;
2591 talloc_free(mem_ctx);
2593 return True;
2596 static BOOL api_netr_DSRADDRESSTOSITENAMESEXW(pipes_struct *p)
2598 struct ndr_pull *pull;
2599 struct ndr_push *push;
2600 NTSTATUS status;
2601 DATA_BLOB blob;
2602 struct netr_DSRADDRESSTOSITENAMESEXW r;
2603 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DSRADDRESSTOSITENAMESEXW");
2605 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2606 talloc_free(mem_ctx);
2607 return False;
2610 pull = ndr_pull_init_blob(&blob, mem_ctx);
2611 if (pull == NULL) {
2612 talloc_free(mem_ctx);
2613 return False;
2616 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2617 status = ndr_pull_netr_DSRADDRESSTOSITENAMESEXW(pull, NDR_IN, &r);
2618 if (NT_STATUS_IS_ERR(status)) {
2619 talloc_free(mem_ctx);
2620 return False;
2623 if (DEBUGLEVEL >= 10)
2624 NDR_PRINT_IN_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r);
2626 r.out.result = _netr_DSRADDRESSTOSITENAMESEXW(p, &r);
2628 if (p->rng_fault_state) {
2629 talloc_free(mem_ctx);
2630 /* Return True here, srv_pipe_hnd.c will take care */
2631 return True;
2634 if (DEBUGLEVEL >= 10)
2635 NDR_PRINT_OUT_DEBUG(netr_DSRADDRESSTOSITENAMESEXW, &r);
2637 push = ndr_push_init_ctx(mem_ctx);
2638 if (push == NULL) {
2639 talloc_free(mem_ctx);
2640 return False;
2643 status = ndr_push_netr_DSRADDRESSTOSITENAMESEXW(push, NDR_OUT, &r);
2644 if (NT_STATUS_IS_ERR(status)) {
2645 talloc_free(mem_ctx);
2646 return False;
2649 blob = ndr_push_blob(push);
2650 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2651 talloc_free(mem_ctx);
2652 return False;
2655 talloc_free(mem_ctx);
2657 return True;
2660 static BOOL api_netr_DSRGETDCSITECOVERAGEW(pipes_struct *p)
2662 struct ndr_pull *pull;
2663 struct ndr_push *push;
2664 NTSTATUS status;
2665 DATA_BLOB blob;
2666 struct netr_DSRGETDCSITECOVERAGEW r;
2667 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DSRGETDCSITECOVERAGEW");
2669 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2670 talloc_free(mem_ctx);
2671 return False;
2674 pull = ndr_pull_init_blob(&blob, mem_ctx);
2675 if (pull == NULL) {
2676 talloc_free(mem_ctx);
2677 return False;
2680 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2681 status = ndr_pull_netr_DSRGETDCSITECOVERAGEW(pull, NDR_IN, &r);
2682 if (NT_STATUS_IS_ERR(status)) {
2683 talloc_free(mem_ctx);
2684 return False;
2687 if (DEBUGLEVEL >= 10)
2688 NDR_PRINT_IN_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r);
2690 r.out.result = _netr_DSRGETDCSITECOVERAGEW(p, &r);
2692 if (p->rng_fault_state) {
2693 talloc_free(mem_ctx);
2694 /* Return True here, srv_pipe_hnd.c will take care */
2695 return True;
2698 if (DEBUGLEVEL >= 10)
2699 NDR_PRINT_OUT_DEBUG(netr_DSRGETDCSITECOVERAGEW, &r);
2701 push = ndr_push_init_ctx(mem_ctx);
2702 if (push == NULL) {
2703 talloc_free(mem_ctx);
2704 return False;
2707 status = ndr_push_netr_DSRGETDCSITECOVERAGEW(push, NDR_OUT, &r);
2708 if (NT_STATUS_IS_ERR(status)) {
2709 talloc_free(mem_ctx);
2710 return False;
2713 blob = ndr_push_blob(push);
2714 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2715 talloc_free(mem_ctx);
2716 return False;
2719 talloc_free(mem_ctx);
2721 return True;
2724 static BOOL api_netr_LogonSamLogonEx(pipes_struct *p)
2726 struct ndr_pull *pull;
2727 struct ndr_push *push;
2728 NTSTATUS status;
2729 DATA_BLOB blob;
2730 struct netr_LogonSamLogonEx r;
2731 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonSamLogonEx");
2733 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2734 talloc_free(mem_ctx);
2735 return False;
2738 pull = ndr_pull_init_blob(&blob, mem_ctx);
2739 if (pull == NULL) {
2740 talloc_free(mem_ctx);
2741 return False;
2744 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2745 status = ndr_pull_netr_LogonSamLogonEx(pull, NDR_IN, &r);
2746 if (NT_STATUS_IS_ERR(status)) {
2747 talloc_free(mem_ctx);
2748 return False;
2751 if (DEBUGLEVEL >= 10)
2752 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r);
2754 ZERO_STRUCT(r.out);
2755 r.out.validation = talloc_zero(mem_ctx, union netr_Validation);
2756 if (r.out.validation == NULL) {
2757 talloc_free(mem_ctx);
2758 return False;
2761 r.out.authoritative = talloc_zero(mem_ctx, uint8_t);
2762 if (r.out.authoritative == NULL) {
2763 talloc_free(mem_ctx);
2764 return False;
2767 r.out.flags = r.in.flags;
2768 r.out.result = _netr_LogonSamLogonEx(p, &r);
2770 if (p->rng_fault_state) {
2771 talloc_free(mem_ctx);
2772 /* Return True here, srv_pipe_hnd.c will take care */
2773 return True;
2776 if (DEBUGLEVEL >= 10)
2777 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r);
2779 push = ndr_push_init_ctx(mem_ctx);
2780 if (push == NULL) {
2781 talloc_free(mem_ctx);
2782 return False;
2785 status = ndr_push_netr_LogonSamLogonEx(push, NDR_OUT, &r);
2786 if (NT_STATUS_IS_ERR(status)) {
2787 talloc_free(mem_ctx);
2788 return False;
2791 blob = ndr_push_blob(push);
2792 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2793 talloc_free(mem_ctx);
2794 return False;
2797 talloc_free(mem_ctx);
2799 return True;
2802 static BOOL api_netr_DsrEnumerateDomainTrusts(pipes_struct *p)
2804 struct ndr_pull *pull;
2805 struct ndr_push *push;
2806 NTSTATUS status;
2807 DATA_BLOB blob;
2808 struct netr_DsrEnumerateDomainTrusts r;
2809 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DsrEnumerateDomainTrusts");
2811 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2812 talloc_free(mem_ctx);
2813 return False;
2816 pull = ndr_pull_init_blob(&blob, mem_ctx);
2817 if (pull == NULL) {
2818 talloc_free(mem_ctx);
2819 return False;
2822 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2823 status = ndr_pull_netr_DsrEnumerateDomainTrusts(pull, NDR_IN, &r);
2824 if (NT_STATUS_IS_ERR(status)) {
2825 talloc_free(mem_ctx);
2826 return False;
2829 if (DEBUGLEVEL >= 10)
2830 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
2832 ZERO_STRUCT(r.out);
2833 r.out.count = talloc_zero(mem_ctx, uint32_t);
2834 if (r.out.count == NULL) {
2835 talloc_free(mem_ctx);
2836 return False;
2839 r.out.trusts = talloc_zero_array(mem_ctx, struct netr_DomainTrust *, count);
2840 if (r.out.trusts == NULL) {
2841 talloc_free(mem_ctx);
2842 return False;
2845 r.out.result = _netr_DsrEnumerateDomainTrusts(p, &r);
2847 if (p->rng_fault_state) {
2848 talloc_free(mem_ctx);
2849 /* Return True here, srv_pipe_hnd.c will take care */
2850 return True;
2853 if (DEBUGLEVEL >= 10)
2854 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
2856 push = ndr_push_init_ctx(mem_ctx);
2857 if (push == NULL) {
2858 talloc_free(mem_ctx);
2859 return False;
2862 status = ndr_push_netr_DsrEnumerateDomainTrusts(push, NDR_OUT, &r);
2863 if (NT_STATUS_IS_ERR(status)) {
2864 talloc_free(mem_ctx);
2865 return False;
2868 blob = ndr_push_blob(push);
2869 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2870 talloc_free(mem_ctx);
2871 return False;
2874 talloc_free(mem_ctx);
2876 return True;
2879 static BOOL api_netr_DSRDEREGISTERDNSHOSTRECORDS(pipes_struct *p)
2881 struct ndr_pull *pull;
2882 struct ndr_push *push;
2883 NTSTATUS status;
2884 DATA_BLOB blob;
2885 struct netr_DSRDEREGISTERDNSHOSTRECORDS r;
2886 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DSRDEREGISTERDNSHOSTRECORDS");
2888 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2889 talloc_free(mem_ctx);
2890 return False;
2893 pull = ndr_pull_init_blob(&blob, mem_ctx);
2894 if (pull == NULL) {
2895 talloc_free(mem_ctx);
2896 return False;
2899 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2900 status = ndr_pull_netr_DSRDEREGISTERDNSHOSTRECORDS(pull, NDR_IN, &r);
2901 if (NT_STATUS_IS_ERR(status)) {
2902 talloc_free(mem_ctx);
2903 return False;
2906 if (DEBUGLEVEL >= 10)
2907 NDR_PRINT_IN_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r);
2909 r.out.result = _netr_DSRDEREGISTERDNSHOSTRECORDS(p, &r);
2911 if (p->rng_fault_state) {
2912 talloc_free(mem_ctx);
2913 /* Return True here, srv_pipe_hnd.c will take care */
2914 return True;
2917 if (DEBUGLEVEL >= 10)
2918 NDR_PRINT_OUT_DEBUG(netr_DSRDEREGISTERDNSHOSTRECORDS, &r);
2920 push = ndr_push_init_ctx(mem_ctx);
2921 if (push == NULL) {
2922 talloc_free(mem_ctx);
2923 return False;
2926 status = ndr_push_netr_DSRDEREGISTERDNSHOSTRECORDS(push, NDR_OUT, &r);
2927 if (NT_STATUS_IS_ERR(status)) {
2928 talloc_free(mem_ctx);
2929 return False;
2932 blob = ndr_push_blob(push);
2933 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2934 talloc_free(mem_ctx);
2935 return False;
2938 talloc_free(mem_ctx);
2940 return True;
2943 static BOOL api_netr_NETRSERVERTRUSTPASSWORDSGET(pipes_struct *p)
2945 struct ndr_pull *pull;
2946 struct ndr_push *push;
2947 NTSTATUS status;
2948 DATA_BLOB blob;
2949 struct netr_NETRSERVERTRUSTPASSWORDSGET r;
2950 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRSERVERTRUSTPASSWORDSGET");
2952 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
2953 talloc_free(mem_ctx);
2954 return False;
2957 pull = ndr_pull_init_blob(&blob, mem_ctx);
2958 if (pull == NULL) {
2959 talloc_free(mem_ctx);
2960 return False;
2963 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2964 status = ndr_pull_netr_NETRSERVERTRUSTPASSWORDSGET(pull, NDR_IN, &r);
2965 if (NT_STATUS_IS_ERR(status)) {
2966 talloc_free(mem_ctx);
2967 return False;
2970 if (DEBUGLEVEL >= 10)
2971 NDR_PRINT_IN_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r);
2973 r.out.result = _netr_NETRSERVERTRUSTPASSWORDSGET(p, &r);
2975 if (p->rng_fault_state) {
2976 talloc_free(mem_ctx);
2977 /* Return True here, srv_pipe_hnd.c will take care */
2978 return True;
2981 if (DEBUGLEVEL >= 10)
2982 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERTRUSTPASSWORDSGET, &r);
2984 push = ndr_push_init_ctx(mem_ctx);
2985 if (push == NULL) {
2986 talloc_free(mem_ctx);
2987 return False;
2990 status = ndr_push_netr_NETRSERVERTRUSTPASSWORDSGET(push, NDR_OUT, &r);
2991 if (NT_STATUS_IS_ERR(status)) {
2992 talloc_free(mem_ctx);
2993 return False;
2996 blob = ndr_push_blob(push);
2997 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2998 talloc_free(mem_ctx);
2999 return False;
3002 talloc_free(mem_ctx);
3004 return True;
3007 static BOOL api_netr_DSRGETFORESTTRUSTINFORMATION(pipes_struct *p)
3009 struct ndr_pull *pull;
3010 struct ndr_push *push;
3011 NTSTATUS status;
3012 DATA_BLOB blob;
3013 struct netr_DSRGETFORESTTRUSTINFORMATION r;
3014 TALLOC_CTX *mem_ctx = talloc_init("api_netr_DSRGETFORESTTRUSTINFORMATION");
3016 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3017 talloc_free(mem_ctx);
3018 return False;
3021 pull = ndr_pull_init_blob(&blob, mem_ctx);
3022 if (pull == NULL) {
3023 talloc_free(mem_ctx);
3024 return False;
3027 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3028 status = ndr_pull_netr_DSRGETFORESTTRUSTINFORMATION(pull, NDR_IN, &r);
3029 if (NT_STATUS_IS_ERR(status)) {
3030 talloc_free(mem_ctx);
3031 return False;
3034 if (DEBUGLEVEL >= 10)
3035 NDR_PRINT_IN_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r);
3037 r.out.result = _netr_DSRGETFORESTTRUSTINFORMATION(p, &r);
3039 if (p->rng_fault_state) {
3040 talloc_free(mem_ctx);
3041 /* Return True here, srv_pipe_hnd.c will take care */
3042 return True;
3045 if (DEBUGLEVEL >= 10)
3046 NDR_PRINT_OUT_DEBUG(netr_DSRGETFORESTTRUSTINFORMATION, &r);
3048 push = ndr_push_init_ctx(mem_ctx);
3049 if (push == NULL) {
3050 talloc_free(mem_ctx);
3051 return False;
3054 status = ndr_push_netr_DSRGETFORESTTRUSTINFORMATION(push, NDR_OUT, &r);
3055 if (NT_STATUS_IS_ERR(status)) {
3056 talloc_free(mem_ctx);
3057 return False;
3060 blob = ndr_push_blob(push);
3061 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3062 talloc_free(mem_ctx);
3063 return False;
3066 talloc_free(mem_ctx);
3068 return True;
3071 static BOOL api_netr_NETRGETFORESTTRUSTINFORMATION(pipes_struct *p)
3073 struct ndr_pull *pull;
3074 struct ndr_push *push;
3075 NTSTATUS status;
3076 DATA_BLOB blob;
3077 struct netr_NETRGETFORESTTRUSTINFORMATION r;
3078 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRGETFORESTTRUSTINFORMATION");
3080 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3081 talloc_free(mem_ctx);
3082 return False;
3085 pull = ndr_pull_init_blob(&blob, mem_ctx);
3086 if (pull == NULL) {
3087 talloc_free(mem_ctx);
3088 return False;
3091 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3092 status = ndr_pull_netr_NETRGETFORESTTRUSTINFORMATION(pull, NDR_IN, &r);
3093 if (NT_STATUS_IS_ERR(status)) {
3094 talloc_free(mem_ctx);
3095 return False;
3098 if (DEBUGLEVEL >= 10)
3099 NDR_PRINT_IN_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r);
3101 r.out.result = _netr_NETRGETFORESTTRUSTINFORMATION(p, &r);
3103 if (p->rng_fault_state) {
3104 talloc_free(mem_ctx);
3105 /* Return True here, srv_pipe_hnd.c will take care */
3106 return True;
3109 if (DEBUGLEVEL >= 10)
3110 NDR_PRINT_OUT_DEBUG(netr_NETRGETFORESTTRUSTINFORMATION, &r);
3112 push = ndr_push_init_ctx(mem_ctx);
3113 if (push == NULL) {
3114 talloc_free(mem_ctx);
3115 return False;
3118 status = ndr_push_netr_NETRGETFORESTTRUSTINFORMATION(push, NDR_OUT, &r);
3119 if (NT_STATUS_IS_ERR(status)) {
3120 talloc_free(mem_ctx);
3121 return False;
3124 blob = ndr_push_blob(push);
3125 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3126 talloc_free(mem_ctx);
3127 return False;
3130 talloc_free(mem_ctx);
3132 return True;
3135 static BOOL api_netr_LogonSamLogonWithFlags(pipes_struct *p)
3137 struct ndr_pull *pull;
3138 struct ndr_push *push;
3139 NTSTATUS status;
3140 DATA_BLOB blob;
3141 struct netr_LogonSamLogonWithFlags r;
3142 TALLOC_CTX *mem_ctx = talloc_init("api_netr_LogonSamLogonWithFlags");
3144 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3145 talloc_free(mem_ctx);
3146 return False;
3149 pull = ndr_pull_init_blob(&blob, mem_ctx);
3150 if (pull == NULL) {
3151 talloc_free(mem_ctx);
3152 return False;
3155 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3156 status = ndr_pull_netr_LogonSamLogonWithFlags(pull, NDR_IN, &r);
3157 if (NT_STATUS_IS_ERR(status)) {
3158 talloc_free(mem_ctx);
3159 return False;
3162 if (DEBUGLEVEL >= 10)
3163 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r);
3165 ZERO_STRUCT(r.out);
3166 r.out.return_authenticator = r.in.return_authenticator;
3167 r.out.validation = talloc_zero(mem_ctx, union netr_Validation);
3168 if (r.out.validation == NULL) {
3169 talloc_free(mem_ctx);
3170 return False;
3173 r.out.authoritative = talloc_zero(mem_ctx, uint8_t);
3174 if (r.out.authoritative == NULL) {
3175 talloc_free(mem_ctx);
3176 return False;
3179 r.out.flags = r.in.flags;
3180 r.out.result = _netr_LogonSamLogonWithFlags(p, &r);
3182 if (p->rng_fault_state) {
3183 talloc_free(mem_ctx);
3184 /* Return True here, srv_pipe_hnd.c will take care */
3185 return True;
3188 if (DEBUGLEVEL >= 10)
3189 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r);
3191 push = ndr_push_init_ctx(mem_ctx);
3192 if (push == NULL) {
3193 talloc_free(mem_ctx);
3194 return False;
3197 status = ndr_push_netr_LogonSamLogonWithFlags(push, NDR_OUT, &r);
3198 if (NT_STATUS_IS_ERR(status)) {
3199 talloc_free(mem_ctx);
3200 return False;
3203 blob = ndr_push_blob(push);
3204 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3205 talloc_free(mem_ctx);
3206 return False;
3209 talloc_free(mem_ctx);
3211 return True;
3214 static BOOL api_netr_NETRSERVERGETTRUSTINFO(pipes_struct *p)
3216 struct ndr_pull *pull;
3217 struct ndr_push *push;
3218 NTSTATUS status;
3219 DATA_BLOB blob;
3220 struct netr_NETRSERVERGETTRUSTINFO r;
3221 TALLOC_CTX *mem_ctx = talloc_init("api_netr_NETRSERVERGETTRUSTINFO");
3223 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
3224 talloc_free(mem_ctx);
3225 return False;
3228 pull = ndr_pull_init_blob(&blob, mem_ctx);
3229 if (pull == NULL) {
3230 talloc_free(mem_ctx);
3231 return False;
3234 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3235 status = ndr_pull_netr_NETRSERVERGETTRUSTINFO(pull, NDR_IN, &r);
3236 if (NT_STATUS_IS_ERR(status)) {
3237 talloc_free(mem_ctx);
3238 return False;
3241 if (DEBUGLEVEL >= 10)
3242 NDR_PRINT_IN_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
3244 r.out.result = _netr_NETRSERVERGETTRUSTINFO(p, &r);
3246 if (p->rng_fault_state) {
3247 talloc_free(mem_ctx);
3248 /* Return True here, srv_pipe_hnd.c will take care */
3249 return True;
3252 if (DEBUGLEVEL >= 10)
3253 NDR_PRINT_OUT_DEBUG(netr_NETRSERVERGETTRUSTINFO, &r);
3255 push = ndr_push_init_ctx(mem_ctx);
3256 if (push == NULL) {
3257 talloc_free(mem_ctx);
3258 return False;
3261 status = ndr_push_netr_NETRSERVERGETTRUSTINFO(push, NDR_OUT, &r);
3262 if (NT_STATUS_IS_ERR(status)) {
3263 talloc_free(mem_ctx);
3264 return False;
3267 blob = ndr_push_blob(push);
3268 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3269 talloc_free(mem_ctx);
3270 return False;
3273 talloc_free(mem_ctx);
3275 return True;
3279 /* Tables */
3280 static struct api_struct api_netlogon_cmds[] =
3282 {"NETR_LOGONUASLOGON", DCERPC_NETR_LOGONUASLOGON, api_netr_LogonUasLogon},
3283 {"NETR_LOGONUASLOGOFF", DCERPC_NETR_LOGONUASLOGOFF, api_netr_LogonUasLogoff},
3284 {"NETR_LOGONSAMLOGON", DCERPC_NETR_LOGONSAMLOGON, api_netr_LogonSamLogon},
3285 {"NETR_LOGONSAMLOGOFF", DCERPC_NETR_LOGONSAMLOGOFF, api_netr_LogonSamLogoff},
3286 {"NETR_SERVERREQCHALLENGE", DCERPC_NETR_SERVERREQCHALLENGE, api_netr_ServerReqChallenge},
3287 {"NETR_SERVERAUTHENTICATE", DCERPC_NETR_SERVERAUTHENTICATE, api_netr_ServerAuthenticate},
3288 {"NETR_SERVERPASSWORDSET", DCERPC_NETR_SERVERPASSWORDSET, api_netr_ServerPasswordSet},
3289 {"NETR_DATABASEDELTAS", DCERPC_NETR_DATABASEDELTAS, api_netr_DatabaseDeltas},
3290 {"NETR_DATABASESYNC", DCERPC_NETR_DATABASESYNC, api_netr_DatabaseSync},
3291 {"NETR_ACCOUNTDELTAS", DCERPC_NETR_ACCOUNTDELTAS, api_netr_AccountDeltas},
3292 {"NETR_ACCOUNTSYNC", DCERPC_NETR_ACCOUNTSYNC, api_netr_AccountSync},
3293 {"NETR_GETDCNAME", DCERPC_NETR_GETDCNAME, api_netr_GetDcName},
3294 {"NETR_LOGONCONTROL", DCERPC_NETR_LOGONCONTROL, api_netr_LogonControl},
3295 {"NETR_GETANYDCNAME", DCERPC_NETR_GETANYDCNAME, api_netr_GetAnyDCName},
3296 {"NETR_LOGONCONTROL2", DCERPC_NETR_LOGONCONTROL2, api_netr_LogonControl2},
3297 {"NETR_SERVERAUTHENTICATE2", DCERPC_NETR_SERVERAUTHENTICATE2, api_netr_ServerAuthenticate2},
3298 {"NETR_DATABASESYNC2", DCERPC_NETR_DATABASESYNC2, api_netr_DatabaseSync2},
3299 {"NETR_DATABASEREDO", DCERPC_NETR_DATABASEREDO, api_netr_DatabaseRedo},
3300 {"NETR_LOGONCONTROL2EX", DCERPC_NETR_LOGONCONTROL2EX, api_netr_LogonControl2Ex},
3301 {"NETR_NETRENUMERATETRUSTEDDOMAINS", DCERPC_NETR_NETRENUMERATETRUSTEDDOMAINS, api_netr_NETRENUMERATETRUSTEDDOMAINS},
3302 {"NETR_DSRGETDCNAME", DCERPC_NETR_DSRGETDCNAME, api_netr_DsRGetDCName},
3303 {"NETR_NETRLOGONDUMMYROUTINE1", DCERPC_NETR_NETRLOGONDUMMYROUTINE1, api_netr_NETRLOGONDUMMYROUTINE1},
3304 {"NETR_NETRLOGONSETSERVICEBITS", DCERPC_NETR_NETRLOGONSETSERVICEBITS, api_netr_NETRLOGONSETSERVICEBITS},
3305 {"NETR_NETRLOGONGETTRUSTRID", DCERPC_NETR_NETRLOGONGETTRUSTRID, api_netr_NETRLOGONGETTRUSTRID},
3306 {"NETR_NETRLOGONCOMPUTESERVERDIGEST", DCERPC_NETR_NETRLOGONCOMPUTESERVERDIGEST, api_netr_NETRLOGONCOMPUTESERVERDIGEST},
3307 {"NETR_NETRLOGONCOMPUTECLIENTDIGEST", DCERPC_NETR_NETRLOGONCOMPUTECLIENTDIGEST, api_netr_NETRLOGONCOMPUTECLIENTDIGEST},
3308 {"NETR_SERVERAUTHENTICATE3", DCERPC_NETR_SERVERAUTHENTICATE3, api_netr_ServerAuthenticate3},
3309 {"NETR_DSRGETDCNAMEEX", DCERPC_NETR_DSRGETDCNAMEEX, api_netr_DsRGetDCNameEx},
3310 {"NETR_DSRGETSITENAME", DCERPC_NETR_DSRGETSITENAME, api_netr_DsRGetSiteName},
3311 {"NETR_LOGONGETDOMAININFO", DCERPC_NETR_LOGONGETDOMAININFO, api_netr_LogonGetDomainInfo},
3312 {"NETR_SERVERPASSWORDSET2", DCERPC_NETR_SERVERPASSWORDSET2, api_netr_ServerPasswordSet2},
3313 {"NETR_NETRSERVERPASSWORDGET", DCERPC_NETR_NETRSERVERPASSWORDGET, api_netr_NETRSERVERPASSWORDGET},
3314 {"NETR_NETRLOGONSENDTOSAM", DCERPC_NETR_NETRLOGONSENDTOSAM, api_netr_NETRLOGONSENDTOSAM},
3315 {"NETR_DSRADDRESSTOSITENAMESW", DCERPC_NETR_DSRADDRESSTOSITENAMESW, api_netr_DSRADDRESSTOSITENAMESW},
3316 {"NETR_DSRGETDCNAMEEX2", DCERPC_NETR_DSRGETDCNAMEEX2, api_netr_DsRGetDCNameEx2},
3317 {"NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN", DCERPC_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN, api_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN},
3318 {"NETR_NETRENUMERATETRUSTEDDOMAINSEX", DCERPC_NETR_NETRENUMERATETRUSTEDDOMAINSEX, api_netr_NETRENUMERATETRUSTEDDOMAINSEX},
3319 {"NETR_DSRADDRESSTOSITENAMESEXW", DCERPC_NETR_DSRADDRESSTOSITENAMESEXW, api_netr_DSRADDRESSTOSITENAMESEXW},
3320 {"NETR_DSRGETDCSITECOVERAGEW", DCERPC_NETR_DSRGETDCSITECOVERAGEW, api_netr_DSRGETDCSITECOVERAGEW},
3321 {"NETR_LOGONSAMLOGONEX", DCERPC_NETR_LOGONSAMLOGONEX, api_netr_LogonSamLogonEx},
3322 {"NETR_DSRENUMERATEDOMAINTRUSTS", DCERPC_NETR_DSRENUMERATEDOMAINTRUSTS, api_netr_DsrEnumerateDomainTrusts},
3323 {"NETR_DSRDEREGISTERDNSHOSTRECORDS", DCERPC_NETR_DSRDEREGISTERDNSHOSTRECORDS, api_netr_DSRDEREGISTERDNSHOSTRECORDS},
3324 {"NETR_NETRSERVERTRUSTPASSWORDSGET", DCERPC_NETR_NETRSERVERTRUSTPASSWORDSGET, api_netr_NETRSERVERTRUSTPASSWORDSGET},
3325 {"NETR_DSRGETFORESTTRUSTINFORMATION", DCERPC_NETR_DSRGETFORESTTRUSTINFORMATION, api_netr_DSRGETFORESTTRUSTINFORMATION},
3326 {"NETR_NETRGETFORESTTRUSTINFORMATION", DCERPC_NETR_NETRGETFORESTTRUSTINFORMATION, api_netr_NETRGETFORESTTRUSTINFORMATION},
3327 {"NETR_LOGONSAMLOGONWITHFLAGS", DCERPC_NETR_LOGONSAMLOGONWITHFLAGS, api_netr_LogonSamLogonWithFlags},
3328 {"NETR_NETRSERVERGETTRUSTINFO", DCERPC_NETR_NETRSERVERGETTRUSTINFO, api_netr_NETRSERVERGETTRUSTINFO},
3331 void netlogon_get_pipe_fns(struct api_struct **fns, int *n_fns)
3333 *fns = api_netlogon_cmds;
3334 *n_fns = sizeof(api_netlogon_cmds) / sizeof(struct api_struct);
3337 NTSTATUS rpc_netlogon_init(void)
3339 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "netlogon", "netlogon", api_netlogon_cmds, sizeof(api_netlogon_cmds) / sizeof(struct api_struct));