r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_eventlog.c
blob51740e15c1dfe42a8b792c61b58e79e7ffab419c
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_eventlog.h"
9 static BOOL api_eventlog_ClearEventLogW(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct eventlog_ClearEventLogW r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ClearEventLogW");
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_eventlog_ClearEventLogW(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(eventlog_ClearEventLogW, &r);
39 r.out.result = _eventlog_ClearEventLogW(p, &r);
41 if (p->rng_fault_state) {
42 talloc_free(mem_ctx);
43 /* Return True here, srv_pipe_hnd.c will take care */
44 return True;
47 if (DEBUGLEVEL >= 10)
48 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, &r);
50 push = ndr_push_init_ctx(mem_ctx);
51 if (push == NULL) {
52 talloc_free(mem_ctx);
53 return False;
56 status = ndr_push_eventlog_ClearEventLogW(push, NDR_OUT, &r);
57 if (NT_STATUS_IS_ERR(status)) {
58 talloc_free(mem_ctx);
59 return False;
62 blob = ndr_push_blob(push);
63 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
64 talloc_free(mem_ctx);
65 return False;
68 talloc_free(mem_ctx);
70 return True;
73 static BOOL api_eventlog_BackupEventLogW(pipes_struct *p)
75 struct ndr_pull *pull;
76 struct ndr_push *push;
77 NTSTATUS status;
78 DATA_BLOB blob;
79 struct eventlog_BackupEventLogW r;
80 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_BackupEventLogW");
82 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
83 talloc_free(mem_ctx);
84 return False;
87 pull = ndr_pull_init_blob(&blob, mem_ctx);
88 if (pull == NULL) {
89 talloc_free(mem_ctx);
90 return False;
93 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
94 status = ndr_pull_eventlog_BackupEventLogW(pull, NDR_IN, &r);
95 if (NT_STATUS_IS_ERR(status)) {
96 talloc_free(mem_ctx);
97 return False;
100 if (DEBUGLEVEL >= 10)
101 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, &r);
103 r.out.result = _eventlog_BackupEventLogW(p, &r);
105 if (p->rng_fault_state) {
106 talloc_free(mem_ctx);
107 /* Return True here, srv_pipe_hnd.c will take care */
108 return True;
111 if (DEBUGLEVEL >= 10)
112 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, &r);
114 push = ndr_push_init_ctx(mem_ctx);
115 if (push == NULL) {
116 talloc_free(mem_ctx);
117 return False;
120 status = ndr_push_eventlog_BackupEventLogW(push, NDR_OUT, &r);
121 if (NT_STATUS_IS_ERR(status)) {
122 talloc_free(mem_ctx);
123 return False;
126 blob = ndr_push_blob(push);
127 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
128 talloc_free(mem_ctx);
129 return False;
132 talloc_free(mem_ctx);
134 return True;
137 static BOOL api_eventlog_CloseEventLog(pipes_struct *p)
139 struct ndr_pull *pull;
140 struct ndr_push *push;
141 NTSTATUS status;
142 DATA_BLOB blob;
143 struct eventlog_CloseEventLog r;
144 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_CloseEventLog");
146 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
147 talloc_free(mem_ctx);
148 return False;
151 pull = ndr_pull_init_blob(&blob, mem_ctx);
152 if (pull == NULL) {
153 talloc_free(mem_ctx);
154 return False;
157 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
158 status = ndr_pull_eventlog_CloseEventLog(pull, NDR_IN, &r);
159 if (NT_STATUS_IS_ERR(status)) {
160 talloc_free(mem_ctx);
161 return False;
164 if (DEBUGLEVEL >= 10)
165 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, &r);
167 ZERO_STRUCT(r.out);
168 r.out.handle = r.in.handle;
169 r.out.result = _eventlog_CloseEventLog(p, &r);
171 if (p->rng_fault_state) {
172 talloc_free(mem_ctx);
173 /* Return True here, srv_pipe_hnd.c will take care */
174 return True;
177 if (DEBUGLEVEL >= 10)
178 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, &r);
180 push = ndr_push_init_ctx(mem_ctx);
181 if (push == NULL) {
182 talloc_free(mem_ctx);
183 return False;
186 status = ndr_push_eventlog_CloseEventLog(push, NDR_OUT, &r);
187 if (NT_STATUS_IS_ERR(status)) {
188 talloc_free(mem_ctx);
189 return False;
192 blob = ndr_push_blob(push);
193 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
194 talloc_free(mem_ctx);
195 return False;
198 talloc_free(mem_ctx);
200 return True;
203 static BOOL api_eventlog_DeregisterEventSource(pipes_struct *p)
205 struct ndr_pull *pull;
206 struct ndr_push *push;
207 NTSTATUS status;
208 DATA_BLOB blob;
209 struct eventlog_DeregisterEventSource r;
210 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_DeregisterEventSource");
212 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
213 talloc_free(mem_ctx);
214 return False;
217 pull = ndr_pull_init_blob(&blob, mem_ctx);
218 if (pull == NULL) {
219 talloc_free(mem_ctx);
220 return False;
223 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
224 status = ndr_pull_eventlog_DeregisterEventSource(pull, NDR_IN, &r);
225 if (NT_STATUS_IS_ERR(status)) {
226 talloc_free(mem_ctx);
227 return False;
230 if (DEBUGLEVEL >= 10)
231 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, &r);
233 r.out.result = _eventlog_DeregisterEventSource(p, &r);
235 if (p->rng_fault_state) {
236 talloc_free(mem_ctx);
237 /* Return True here, srv_pipe_hnd.c will take care */
238 return True;
241 if (DEBUGLEVEL >= 10)
242 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, &r);
244 push = ndr_push_init_ctx(mem_ctx);
245 if (push == NULL) {
246 talloc_free(mem_ctx);
247 return False;
250 status = ndr_push_eventlog_DeregisterEventSource(push, NDR_OUT, &r);
251 if (NT_STATUS_IS_ERR(status)) {
252 talloc_free(mem_ctx);
253 return False;
256 blob = ndr_push_blob(push);
257 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
258 talloc_free(mem_ctx);
259 return False;
262 talloc_free(mem_ctx);
264 return True;
267 static BOOL api_eventlog_GetNumRecords(pipes_struct *p)
269 struct ndr_pull *pull;
270 struct ndr_push *push;
271 NTSTATUS status;
272 DATA_BLOB blob;
273 struct eventlog_GetNumRecords r;
274 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetNumRecords");
276 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
277 talloc_free(mem_ctx);
278 return False;
281 pull = ndr_pull_init_blob(&blob, mem_ctx);
282 if (pull == NULL) {
283 talloc_free(mem_ctx);
284 return False;
287 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
288 status = ndr_pull_eventlog_GetNumRecords(pull, NDR_IN, &r);
289 if (NT_STATUS_IS_ERR(status)) {
290 talloc_free(mem_ctx);
291 return False;
294 if (DEBUGLEVEL >= 10)
295 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, &r);
297 ZERO_STRUCT(r.out);
298 r.out.number = talloc_zero(mem_ctx, uint32_t);
299 if (r.out.number == NULL) {
300 talloc_free(mem_ctx);
301 return False;
304 r.out.result = _eventlog_GetNumRecords(p, &r);
306 if (p->rng_fault_state) {
307 talloc_free(mem_ctx);
308 /* Return True here, srv_pipe_hnd.c will take care */
309 return True;
312 if (DEBUGLEVEL >= 10)
313 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, &r);
315 push = ndr_push_init_ctx(mem_ctx);
316 if (push == NULL) {
317 talloc_free(mem_ctx);
318 return False;
321 status = ndr_push_eventlog_GetNumRecords(push, NDR_OUT, &r);
322 if (NT_STATUS_IS_ERR(status)) {
323 talloc_free(mem_ctx);
324 return False;
327 blob = ndr_push_blob(push);
328 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
329 talloc_free(mem_ctx);
330 return False;
333 talloc_free(mem_ctx);
335 return True;
338 static BOOL api_eventlog_GetOldestRecord(pipes_struct *p)
340 struct ndr_pull *pull;
341 struct ndr_push *push;
342 NTSTATUS status;
343 DATA_BLOB blob;
344 struct eventlog_GetOldestRecord r;
345 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetOldestRecord");
347 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
348 talloc_free(mem_ctx);
349 return False;
352 pull = ndr_pull_init_blob(&blob, mem_ctx);
353 if (pull == NULL) {
354 talloc_free(mem_ctx);
355 return False;
358 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
359 status = ndr_pull_eventlog_GetOldestRecord(pull, NDR_IN, &r);
360 if (NT_STATUS_IS_ERR(status)) {
361 talloc_free(mem_ctx);
362 return False;
365 if (DEBUGLEVEL >= 10)
366 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, &r);
368 r.out.result = _eventlog_GetOldestRecord(p, &r);
370 if (p->rng_fault_state) {
371 talloc_free(mem_ctx);
372 /* Return True here, srv_pipe_hnd.c will take care */
373 return True;
376 if (DEBUGLEVEL >= 10)
377 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, &r);
379 push = ndr_push_init_ctx(mem_ctx);
380 if (push == NULL) {
381 talloc_free(mem_ctx);
382 return False;
385 status = ndr_push_eventlog_GetOldestRecord(push, NDR_OUT, &r);
386 if (NT_STATUS_IS_ERR(status)) {
387 talloc_free(mem_ctx);
388 return False;
391 blob = ndr_push_blob(push);
392 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
393 talloc_free(mem_ctx);
394 return False;
397 talloc_free(mem_ctx);
399 return True;
402 static BOOL api_eventlog_ChangeNotify(pipes_struct *p)
404 struct ndr_pull *pull;
405 struct ndr_push *push;
406 NTSTATUS status;
407 DATA_BLOB blob;
408 struct eventlog_ChangeNotify r;
409 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ChangeNotify");
411 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
412 talloc_free(mem_ctx);
413 return False;
416 pull = ndr_pull_init_blob(&blob, mem_ctx);
417 if (pull == NULL) {
418 talloc_free(mem_ctx);
419 return False;
422 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
423 status = ndr_pull_eventlog_ChangeNotify(pull, NDR_IN, &r);
424 if (NT_STATUS_IS_ERR(status)) {
425 talloc_free(mem_ctx);
426 return False;
429 if (DEBUGLEVEL >= 10)
430 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, &r);
432 r.out.result = _eventlog_ChangeNotify(p, &r);
434 if (p->rng_fault_state) {
435 talloc_free(mem_ctx);
436 /* Return True here, srv_pipe_hnd.c will take care */
437 return True;
440 if (DEBUGLEVEL >= 10)
441 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, &r);
443 push = ndr_push_init_ctx(mem_ctx);
444 if (push == NULL) {
445 talloc_free(mem_ctx);
446 return False;
449 status = ndr_push_eventlog_ChangeNotify(push, NDR_OUT, &r);
450 if (NT_STATUS_IS_ERR(status)) {
451 talloc_free(mem_ctx);
452 return False;
455 blob = ndr_push_blob(push);
456 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
457 talloc_free(mem_ctx);
458 return False;
461 talloc_free(mem_ctx);
463 return True;
466 static BOOL api_eventlog_OpenEventLogW(pipes_struct *p)
468 struct ndr_pull *pull;
469 struct ndr_push *push;
470 NTSTATUS status;
471 DATA_BLOB blob;
472 struct eventlog_OpenEventLogW r;
473 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenEventLogW");
475 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
476 talloc_free(mem_ctx);
477 return False;
480 pull = ndr_pull_init_blob(&blob, mem_ctx);
481 if (pull == NULL) {
482 talloc_free(mem_ctx);
483 return False;
486 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
487 status = ndr_pull_eventlog_OpenEventLogW(pull, NDR_IN, &r);
488 if (NT_STATUS_IS_ERR(status)) {
489 talloc_free(mem_ctx);
490 return False;
493 if (DEBUGLEVEL >= 10)
494 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, &r);
496 ZERO_STRUCT(r.out);
497 r.out.handle = talloc_zero(mem_ctx, struct policy_handle);
498 if (r.out.handle == NULL) {
499 talloc_free(mem_ctx);
500 return False;
503 r.out.result = _eventlog_OpenEventLogW(p, &r);
505 if (p->rng_fault_state) {
506 talloc_free(mem_ctx);
507 /* Return True here, srv_pipe_hnd.c will take care */
508 return True;
511 if (DEBUGLEVEL >= 10)
512 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, &r);
514 push = ndr_push_init_ctx(mem_ctx);
515 if (push == NULL) {
516 talloc_free(mem_ctx);
517 return False;
520 status = ndr_push_eventlog_OpenEventLogW(push, NDR_OUT, &r);
521 if (NT_STATUS_IS_ERR(status)) {
522 talloc_free(mem_ctx);
523 return False;
526 blob = ndr_push_blob(push);
527 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
528 talloc_free(mem_ctx);
529 return False;
532 talloc_free(mem_ctx);
534 return True;
537 static BOOL api_eventlog_RegisterEventSourceW(pipes_struct *p)
539 struct ndr_pull *pull;
540 struct ndr_push *push;
541 NTSTATUS status;
542 DATA_BLOB blob;
543 struct eventlog_RegisterEventSourceW r;
544 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterEventSourceW");
546 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
547 talloc_free(mem_ctx);
548 return False;
551 pull = ndr_pull_init_blob(&blob, mem_ctx);
552 if (pull == NULL) {
553 talloc_free(mem_ctx);
554 return False;
557 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
558 status = ndr_pull_eventlog_RegisterEventSourceW(pull, NDR_IN, &r);
559 if (NT_STATUS_IS_ERR(status)) {
560 talloc_free(mem_ctx);
561 return False;
564 if (DEBUGLEVEL >= 10)
565 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, &r);
567 r.out.result = _eventlog_RegisterEventSourceW(p, &r);
569 if (p->rng_fault_state) {
570 talloc_free(mem_ctx);
571 /* Return True here, srv_pipe_hnd.c will take care */
572 return True;
575 if (DEBUGLEVEL >= 10)
576 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, &r);
578 push = ndr_push_init_ctx(mem_ctx);
579 if (push == NULL) {
580 talloc_free(mem_ctx);
581 return False;
584 status = ndr_push_eventlog_RegisterEventSourceW(push, NDR_OUT, &r);
585 if (NT_STATUS_IS_ERR(status)) {
586 talloc_free(mem_ctx);
587 return False;
590 blob = ndr_push_blob(push);
591 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
592 talloc_free(mem_ctx);
593 return False;
596 talloc_free(mem_ctx);
598 return True;
601 static BOOL api_eventlog_OpenBackupEventLogW(pipes_struct *p)
603 struct ndr_pull *pull;
604 struct ndr_push *push;
605 NTSTATUS status;
606 DATA_BLOB blob;
607 struct eventlog_OpenBackupEventLogW r;
608 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenBackupEventLogW");
610 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
611 talloc_free(mem_ctx);
612 return False;
615 pull = ndr_pull_init_blob(&blob, mem_ctx);
616 if (pull == NULL) {
617 talloc_free(mem_ctx);
618 return False;
621 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
622 status = ndr_pull_eventlog_OpenBackupEventLogW(pull, NDR_IN, &r);
623 if (NT_STATUS_IS_ERR(status)) {
624 talloc_free(mem_ctx);
625 return False;
628 if (DEBUGLEVEL >= 10)
629 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, &r);
631 r.out.result = _eventlog_OpenBackupEventLogW(p, &r);
633 if (p->rng_fault_state) {
634 talloc_free(mem_ctx);
635 /* Return True here, srv_pipe_hnd.c will take care */
636 return True;
639 if (DEBUGLEVEL >= 10)
640 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, &r);
642 push = ndr_push_init_ctx(mem_ctx);
643 if (push == NULL) {
644 talloc_free(mem_ctx);
645 return False;
648 status = ndr_push_eventlog_OpenBackupEventLogW(push, NDR_OUT, &r);
649 if (NT_STATUS_IS_ERR(status)) {
650 talloc_free(mem_ctx);
651 return False;
654 blob = ndr_push_blob(push);
655 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
656 talloc_free(mem_ctx);
657 return False;
660 talloc_free(mem_ctx);
662 return True;
665 static BOOL api_eventlog_ReadEventLogW(pipes_struct *p)
667 struct ndr_pull *pull;
668 struct ndr_push *push;
669 NTSTATUS status;
670 DATA_BLOB blob;
671 struct eventlog_ReadEventLogW r;
672 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReadEventLogW");
674 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
675 talloc_free(mem_ctx);
676 return False;
679 pull = ndr_pull_init_blob(&blob, mem_ctx);
680 if (pull == NULL) {
681 talloc_free(mem_ctx);
682 return False;
685 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
686 status = ndr_pull_eventlog_ReadEventLogW(pull, NDR_IN, &r);
687 if (NT_STATUS_IS_ERR(status)) {
688 talloc_free(mem_ctx);
689 return False;
692 if (DEBUGLEVEL >= 10)
693 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, &r);
695 ZERO_STRUCT(r.out);
696 r.out.data = talloc_zero_array(mem_ctx, uint8_t, r.in.number_of_bytes);
697 if (r.out.data == NULL) {
698 talloc_free(mem_ctx);
699 return False;
702 r.out.sent_size = talloc_zero(mem_ctx, uint32_t);
703 if (r.out.sent_size == NULL) {
704 talloc_free(mem_ctx);
705 return False;
708 r.out.real_size = talloc_zero(mem_ctx, uint32_t);
709 if (r.out.real_size == NULL) {
710 talloc_free(mem_ctx);
711 return False;
714 r.out.result = _eventlog_ReadEventLogW(p, &r);
716 if (p->rng_fault_state) {
717 talloc_free(mem_ctx);
718 /* Return True here, srv_pipe_hnd.c will take care */
719 return True;
722 if (DEBUGLEVEL >= 10)
723 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, &r);
725 push = ndr_push_init_ctx(mem_ctx);
726 if (push == NULL) {
727 talloc_free(mem_ctx);
728 return False;
731 status = ndr_push_eventlog_ReadEventLogW(push, NDR_OUT, &r);
732 if (NT_STATUS_IS_ERR(status)) {
733 talloc_free(mem_ctx);
734 return False;
737 blob = ndr_push_blob(push);
738 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
739 talloc_free(mem_ctx);
740 return False;
743 talloc_free(mem_ctx);
745 return True;
748 static BOOL api_eventlog_ReportEventW(pipes_struct *p)
750 struct ndr_pull *pull;
751 struct ndr_push *push;
752 NTSTATUS status;
753 DATA_BLOB blob;
754 struct eventlog_ReportEventW r;
755 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReportEventW");
757 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
758 talloc_free(mem_ctx);
759 return False;
762 pull = ndr_pull_init_blob(&blob, mem_ctx);
763 if (pull == NULL) {
764 talloc_free(mem_ctx);
765 return False;
768 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
769 status = ndr_pull_eventlog_ReportEventW(pull, NDR_IN, &r);
770 if (NT_STATUS_IS_ERR(status)) {
771 talloc_free(mem_ctx);
772 return False;
775 if (DEBUGLEVEL >= 10)
776 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, &r);
778 r.out.result = _eventlog_ReportEventW(p, &r);
780 if (p->rng_fault_state) {
781 talloc_free(mem_ctx);
782 /* Return True here, srv_pipe_hnd.c will take care */
783 return True;
786 if (DEBUGLEVEL >= 10)
787 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, &r);
789 push = ndr_push_init_ctx(mem_ctx);
790 if (push == NULL) {
791 talloc_free(mem_ctx);
792 return False;
795 status = ndr_push_eventlog_ReportEventW(push, NDR_OUT, &r);
796 if (NT_STATUS_IS_ERR(status)) {
797 talloc_free(mem_ctx);
798 return False;
801 blob = ndr_push_blob(push);
802 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
803 talloc_free(mem_ctx);
804 return False;
807 talloc_free(mem_ctx);
809 return True;
812 static BOOL api_eventlog_ClearEventLogA(pipes_struct *p)
814 struct ndr_pull *pull;
815 struct ndr_push *push;
816 NTSTATUS status;
817 DATA_BLOB blob;
818 struct eventlog_ClearEventLogA r;
819 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ClearEventLogA");
821 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
822 talloc_free(mem_ctx);
823 return False;
826 pull = ndr_pull_init_blob(&blob, mem_ctx);
827 if (pull == NULL) {
828 talloc_free(mem_ctx);
829 return False;
832 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
833 status = ndr_pull_eventlog_ClearEventLogA(pull, NDR_IN, &r);
834 if (NT_STATUS_IS_ERR(status)) {
835 talloc_free(mem_ctx);
836 return False;
839 if (DEBUGLEVEL >= 10)
840 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, &r);
842 r.out.result = _eventlog_ClearEventLogA(p, &r);
844 if (p->rng_fault_state) {
845 talloc_free(mem_ctx);
846 /* Return True here, srv_pipe_hnd.c will take care */
847 return True;
850 if (DEBUGLEVEL >= 10)
851 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, &r);
853 push = ndr_push_init_ctx(mem_ctx);
854 if (push == NULL) {
855 talloc_free(mem_ctx);
856 return False;
859 status = ndr_push_eventlog_ClearEventLogA(push, NDR_OUT, &r);
860 if (NT_STATUS_IS_ERR(status)) {
861 talloc_free(mem_ctx);
862 return False;
865 blob = ndr_push_blob(push);
866 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
867 talloc_free(mem_ctx);
868 return False;
871 talloc_free(mem_ctx);
873 return True;
876 static BOOL api_eventlog_BackupEventLogA(pipes_struct *p)
878 struct ndr_pull *pull;
879 struct ndr_push *push;
880 NTSTATUS status;
881 DATA_BLOB blob;
882 struct eventlog_BackupEventLogA r;
883 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_BackupEventLogA");
885 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
886 talloc_free(mem_ctx);
887 return False;
890 pull = ndr_pull_init_blob(&blob, mem_ctx);
891 if (pull == NULL) {
892 talloc_free(mem_ctx);
893 return False;
896 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
897 status = ndr_pull_eventlog_BackupEventLogA(pull, NDR_IN, &r);
898 if (NT_STATUS_IS_ERR(status)) {
899 talloc_free(mem_ctx);
900 return False;
903 if (DEBUGLEVEL >= 10)
904 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, &r);
906 r.out.result = _eventlog_BackupEventLogA(p, &r);
908 if (p->rng_fault_state) {
909 talloc_free(mem_ctx);
910 /* Return True here, srv_pipe_hnd.c will take care */
911 return True;
914 if (DEBUGLEVEL >= 10)
915 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, &r);
917 push = ndr_push_init_ctx(mem_ctx);
918 if (push == NULL) {
919 talloc_free(mem_ctx);
920 return False;
923 status = ndr_push_eventlog_BackupEventLogA(push, NDR_OUT, &r);
924 if (NT_STATUS_IS_ERR(status)) {
925 talloc_free(mem_ctx);
926 return False;
929 blob = ndr_push_blob(push);
930 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
931 talloc_free(mem_ctx);
932 return False;
935 talloc_free(mem_ctx);
937 return True;
940 static BOOL api_eventlog_OpenEventLogA(pipes_struct *p)
942 struct ndr_pull *pull;
943 struct ndr_push *push;
944 NTSTATUS status;
945 DATA_BLOB blob;
946 struct eventlog_OpenEventLogA r;
947 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenEventLogA");
949 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
950 talloc_free(mem_ctx);
951 return False;
954 pull = ndr_pull_init_blob(&blob, mem_ctx);
955 if (pull == NULL) {
956 talloc_free(mem_ctx);
957 return False;
960 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
961 status = ndr_pull_eventlog_OpenEventLogA(pull, NDR_IN, &r);
962 if (NT_STATUS_IS_ERR(status)) {
963 talloc_free(mem_ctx);
964 return False;
967 if (DEBUGLEVEL >= 10)
968 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, &r);
970 r.out.result = _eventlog_OpenEventLogA(p, &r);
972 if (p->rng_fault_state) {
973 talloc_free(mem_ctx);
974 /* Return True here, srv_pipe_hnd.c will take care */
975 return True;
978 if (DEBUGLEVEL >= 10)
979 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, &r);
981 push = ndr_push_init_ctx(mem_ctx);
982 if (push == NULL) {
983 talloc_free(mem_ctx);
984 return False;
987 status = ndr_push_eventlog_OpenEventLogA(push, NDR_OUT, &r);
988 if (NT_STATUS_IS_ERR(status)) {
989 talloc_free(mem_ctx);
990 return False;
993 blob = ndr_push_blob(push);
994 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
995 talloc_free(mem_ctx);
996 return False;
999 talloc_free(mem_ctx);
1001 return True;
1004 static BOOL api_eventlog_RegisterEventSourceA(pipes_struct *p)
1006 struct ndr_pull *pull;
1007 struct ndr_push *push;
1008 NTSTATUS status;
1009 DATA_BLOB blob;
1010 struct eventlog_RegisterEventSourceA r;
1011 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterEventSourceA");
1013 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1014 talloc_free(mem_ctx);
1015 return False;
1018 pull = ndr_pull_init_blob(&blob, mem_ctx);
1019 if (pull == NULL) {
1020 talloc_free(mem_ctx);
1021 return False;
1024 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1025 status = ndr_pull_eventlog_RegisterEventSourceA(pull, NDR_IN, &r);
1026 if (NT_STATUS_IS_ERR(status)) {
1027 talloc_free(mem_ctx);
1028 return False;
1031 if (DEBUGLEVEL >= 10)
1032 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, &r);
1034 r.out.result = _eventlog_RegisterEventSourceA(p, &r);
1036 if (p->rng_fault_state) {
1037 talloc_free(mem_ctx);
1038 /* Return True here, srv_pipe_hnd.c will take care */
1039 return True;
1042 if (DEBUGLEVEL >= 10)
1043 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, &r);
1045 push = ndr_push_init_ctx(mem_ctx);
1046 if (push == NULL) {
1047 talloc_free(mem_ctx);
1048 return False;
1051 status = ndr_push_eventlog_RegisterEventSourceA(push, NDR_OUT, &r);
1052 if (NT_STATUS_IS_ERR(status)) {
1053 talloc_free(mem_ctx);
1054 return False;
1057 blob = ndr_push_blob(push);
1058 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1059 talloc_free(mem_ctx);
1060 return False;
1063 talloc_free(mem_ctx);
1065 return True;
1068 static BOOL api_eventlog_OpenBackupEventLogA(pipes_struct *p)
1070 struct ndr_pull *pull;
1071 struct ndr_push *push;
1072 NTSTATUS status;
1073 DATA_BLOB blob;
1074 struct eventlog_OpenBackupEventLogA r;
1075 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_OpenBackupEventLogA");
1077 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1078 talloc_free(mem_ctx);
1079 return False;
1082 pull = ndr_pull_init_blob(&blob, mem_ctx);
1083 if (pull == NULL) {
1084 talloc_free(mem_ctx);
1085 return False;
1088 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1089 status = ndr_pull_eventlog_OpenBackupEventLogA(pull, NDR_IN, &r);
1090 if (NT_STATUS_IS_ERR(status)) {
1091 talloc_free(mem_ctx);
1092 return False;
1095 if (DEBUGLEVEL >= 10)
1096 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, &r);
1098 r.out.result = _eventlog_OpenBackupEventLogA(p, &r);
1100 if (p->rng_fault_state) {
1101 talloc_free(mem_ctx);
1102 /* Return True here, srv_pipe_hnd.c will take care */
1103 return True;
1106 if (DEBUGLEVEL >= 10)
1107 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, &r);
1109 push = ndr_push_init_ctx(mem_ctx);
1110 if (push == NULL) {
1111 talloc_free(mem_ctx);
1112 return False;
1115 status = ndr_push_eventlog_OpenBackupEventLogA(push, NDR_OUT, &r);
1116 if (NT_STATUS_IS_ERR(status)) {
1117 talloc_free(mem_ctx);
1118 return False;
1121 blob = ndr_push_blob(push);
1122 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1123 talloc_free(mem_ctx);
1124 return False;
1127 talloc_free(mem_ctx);
1129 return True;
1132 static BOOL api_eventlog_ReadEventLogA(pipes_struct *p)
1134 struct ndr_pull *pull;
1135 struct ndr_push *push;
1136 NTSTATUS status;
1137 DATA_BLOB blob;
1138 struct eventlog_ReadEventLogA r;
1139 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReadEventLogA");
1141 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1142 talloc_free(mem_ctx);
1143 return False;
1146 pull = ndr_pull_init_blob(&blob, mem_ctx);
1147 if (pull == NULL) {
1148 talloc_free(mem_ctx);
1149 return False;
1152 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1153 status = ndr_pull_eventlog_ReadEventLogA(pull, NDR_IN, &r);
1154 if (NT_STATUS_IS_ERR(status)) {
1155 talloc_free(mem_ctx);
1156 return False;
1159 if (DEBUGLEVEL >= 10)
1160 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, &r);
1162 r.out.result = _eventlog_ReadEventLogA(p, &r);
1164 if (p->rng_fault_state) {
1165 talloc_free(mem_ctx);
1166 /* Return True here, srv_pipe_hnd.c will take care */
1167 return True;
1170 if (DEBUGLEVEL >= 10)
1171 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, &r);
1173 push = ndr_push_init_ctx(mem_ctx);
1174 if (push == NULL) {
1175 talloc_free(mem_ctx);
1176 return False;
1179 status = ndr_push_eventlog_ReadEventLogA(push, NDR_OUT, &r);
1180 if (NT_STATUS_IS_ERR(status)) {
1181 talloc_free(mem_ctx);
1182 return False;
1185 blob = ndr_push_blob(push);
1186 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1187 talloc_free(mem_ctx);
1188 return False;
1191 talloc_free(mem_ctx);
1193 return True;
1196 static BOOL api_eventlog_ReportEventA(pipes_struct *p)
1198 struct ndr_pull *pull;
1199 struct ndr_push *push;
1200 NTSTATUS status;
1201 DATA_BLOB blob;
1202 struct eventlog_ReportEventA r;
1203 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_ReportEventA");
1205 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1206 talloc_free(mem_ctx);
1207 return False;
1210 pull = ndr_pull_init_blob(&blob, mem_ctx);
1211 if (pull == NULL) {
1212 talloc_free(mem_ctx);
1213 return False;
1216 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1217 status = ndr_pull_eventlog_ReportEventA(pull, NDR_IN, &r);
1218 if (NT_STATUS_IS_ERR(status)) {
1219 talloc_free(mem_ctx);
1220 return False;
1223 if (DEBUGLEVEL >= 10)
1224 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, &r);
1226 r.out.result = _eventlog_ReportEventA(p, &r);
1228 if (p->rng_fault_state) {
1229 talloc_free(mem_ctx);
1230 /* Return True here, srv_pipe_hnd.c will take care */
1231 return True;
1234 if (DEBUGLEVEL >= 10)
1235 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, &r);
1237 push = ndr_push_init_ctx(mem_ctx);
1238 if (push == NULL) {
1239 talloc_free(mem_ctx);
1240 return False;
1243 status = ndr_push_eventlog_ReportEventA(push, NDR_OUT, &r);
1244 if (NT_STATUS_IS_ERR(status)) {
1245 talloc_free(mem_ctx);
1246 return False;
1249 blob = ndr_push_blob(push);
1250 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1251 talloc_free(mem_ctx);
1252 return False;
1255 talloc_free(mem_ctx);
1257 return True;
1260 static BOOL api_eventlog_RegisterClusterSvc(pipes_struct *p)
1262 struct ndr_pull *pull;
1263 struct ndr_push *push;
1264 NTSTATUS status;
1265 DATA_BLOB blob;
1266 struct eventlog_RegisterClusterSvc r;
1267 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_RegisterClusterSvc");
1269 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1270 talloc_free(mem_ctx);
1271 return False;
1274 pull = ndr_pull_init_blob(&blob, mem_ctx);
1275 if (pull == NULL) {
1276 talloc_free(mem_ctx);
1277 return False;
1280 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1281 status = ndr_pull_eventlog_RegisterClusterSvc(pull, NDR_IN, &r);
1282 if (NT_STATUS_IS_ERR(status)) {
1283 talloc_free(mem_ctx);
1284 return False;
1287 if (DEBUGLEVEL >= 10)
1288 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, &r);
1290 r.out.result = _eventlog_RegisterClusterSvc(p, &r);
1292 if (p->rng_fault_state) {
1293 talloc_free(mem_ctx);
1294 /* Return True here, srv_pipe_hnd.c will take care */
1295 return True;
1298 if (DEBUGLEVEL >= 10)
1299 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, &r);
1301 push = ndr_push_init_ctx(mem_ctx);
1302 if (push == NULL) {
1303 talloc_free(mem_ctx);
1304 return False;
1307 status = ndr_push_eventlog_RegisterClusterSvc(push, NDR_OUT, &r);
1308 if (NT_STATUS_IS_ERR(status)) {
1309 talloc_free(mem_ctx);
1310 return False;
1313 blob = ndr_push_blob(push);
1314 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1315 talloc_free(mem_ctx);
1316 return False;
1319 talloc_free(mem_ctx);
1321 return True;
1324 static BOOL api_eventlog_DeregisterClusterSvc(pipes_struct *p)
1326 struct ndr_pull *pull;
1327 struct ndr_push *push;
1328 NTSTATUS status;
1329 DATA_BLOB blob;
1330 struct eventlog_DeregisterClusterSvc r;
1331 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_DeregisterClusterSvc");
1333 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1334 talloc_free(mem_ctx);
1335 return False;
1338 pull = ndr_pull_init_blob(&blob, mem_ctx);
1339 if (pull == NULL) {
1340 talloc_free(mem_ctx);
1341 return False;
1344 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1345 status = ndr_pull_eventlog_DeregisterClusterSvc(pull, NDR_IN, &r);
1346 if (NT_STATUS_IS_ERR(status)) {
1347 talloc_free(mem_ctx);
1348 return False;
1351 if (DEBUGLEVEL >= 10)
1352 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, &r);
1354 r.out.result = _eventlog_DeregisterClusterSvc(p, &r);
1356 if (p->rng_fault_state) {
1357 talloc_free(mem_ctx);
1358 /* Return True here, srv_pipe_hnd.c will take care */
1359 return True;
1362 if (DEBUGLEVEL >= 10)
1363 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, &r);
1365 push = ndr_push_init_ctx(mem_ctx);
1366 if (push == NULL) {
1367 talloc_free(mem_ctx);
1368 return False;
1371 status = ndr_push_eventlog_DeregisterClusterSvc(push, NDR_OUT, &r);
1372 if (NT_STATUS_IS_ERR(status)) {
1373 talloc_free(mem_ctx);
1374 return False;
1377 blob = ndr_push_blob(push);
1378 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1379 talloc_free(mem_ctx);
1380 return False;
1383 talloc_free(mem_ctx);
1385 return True;
1388 static BOOL api_eventlog_WriteClusterEvents(pipes_struct *p)
1390 struct ndr_pull *pull;
1391 struct ndr_push *push;
1392 NTSTATUS status;
1393 DATA_BLOB blob;
1394 struct eventlog_WriteClusterEvents r;
1395 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_WriteClusterEvents");
1397 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1398 talloc_free(mem_ctx);
1399 return False;
1402 pull = ndr_pull_init_blob(&blob, mem_ctx);
1403 if (pull == NULL) {
1404 talloc_free(mem_ctx);
1405 return False;
1408 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1409 status = ndr_pull_eventlog_WriteClusterEvents(pull, NDR_IN, &r);
1410 if (NT_STATUS_IS_ERR(status)) {
1411 talloc_free(mem_ctx);
1412 return False;
1415 if (DEBUGLEVEL >= 10)
1416 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, &r);
1418 r.out.result = _eventlog_WriteClusterEvents(p, &r);
1420 if (p->rng_fault_state) {
1421 talloc_free(mem_ctx);
1422 /* Return True here, srv_pipe_hnd.c will take care */
1423 return True;
1426 if (DEBUGLEVEL >= 10)
1427 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, &r);
1429 push = ndr_push_init_ctx(mem_ctx);
1430 if (push == NULL) {
1431 talloc_free(mem_ctx);
1432 return False;
1435 status = ndr_push_eventlog_WriteClusterEvents(push, NDR_OUT, &r);
1436 if (NT_STATUS_IS_ERR(status)) {
1437 talloc_free(mem_ctx);
1438 return False;
1441 blob = ndr_push_blob(push);
1442 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1443 talloc_free(mem_ctx);
1444 return False;
1447 talloc_free(mem_ctx);
1449 return True;
1452 static BOOL api_eventlog_GetLogIntormation(pipes_struct *p)
1454 struct ndr_pull *pull;
1455 struct ndr_push *push;
1456 NTSTATUS status;
1457 DATA_BLOB blob;
1458 struct eventlog_GetLogIntormation r;
1459 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_GetLogIntormation");
1461 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1462 talloc_free(mem_ctx);
1463 return False;
1466 pull = ndr_pull_init_blob(&blob, mem_ctx);
1467 if (pull == NULL) {
1468 talloc_free(mem_ctx);
1469 return False;
1472 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1473 status = ndr_pull_eventlog_GetLogIntormation(pull, NDR_IN, &r);
1474 if (NT_STATUS_IS_ERR(status)) {
1475 talloc_free(mem_ctx);
1476 return False;
1479 if (DEBUGLEVEL >= 10)
1480 NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, &r);
1482 r.out.result = _eventlog_GetLogIntormation(p, &r);
1484 if (p->rng_fault_state) {
1485 talloc_free(mem_ctx);
1486 /* Return True here, srv_pipe_hnd.c will take care */
1487 return True;
1490 if (DEBUGLEVEL >= 10)
1491 NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, &r);
1493 push = ndr_push_init_ctx(mem_ctx);
1494 if (push == NULL) {
1495 talloc_free(mem_ctx);
1496 return False;
1499 status = ndr_push_eventlog_GetLogIntormation(push, NDR_OUT, &r);
1500 if (NT_STATUS_IS_ERR(status)) {
1501 talloc_free(mem_ctx);
1502 return False;
1505 blob = ndr_push_blob(push);
1506 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1507 talloc_free(mem_ctx);
1508 return False;
1511 talloc_free(mem_ctx);
1513 return True;
1516 static BOOL api_eventlog_FlushEventLog(pipes_struct *p)
1518 struct ndr_pull *pull;
1519 struct ndr_push *push;
1520 NTSTATUS status;
1521 DATA_BLOB blob;
1522 struct eventlog_FlushEventLog r;
1523 TALLOC_CTX *mem_ctx = talloc_init("api_eventlog_FlushEventLog");
1525 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
1526 talloc_free(mem_ctx);
1527 return False;
1530 pull = ndr_pull_init_blob(&blob, mem_ctx);
1531 if (pull == NULL) {
1532 talloc_free(mem_ctx);
1533 return False;
1536 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1537 status = ndr_pull_eventlog_FlushEventLog(pull, NDR_IN, &r);
1538 if (NT_STATUS_IS_ERR(status)) {
1539 talloc_free(mem_ctx);
1540 return False;
1543 if (DEBUGLEVEL >= 10)
1544 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, &r);
1546 r.out.result = _eventlog_FlushEventLog(p, &r);
1548 if (p->rng_fault_state) {
1549 talloc_free(mem_ctx);
1550 /* Return True here, srv_pipe_hnd.c will take care */
1551 return True;
1554 if (DEBUGLEVEL >= 10)
1555 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, &r);
1557 push = ndr_push_init_ctx(mem_ctx);
1558 if (push == NULL) {
1559 talloc_free(mem_ctx);
1560 return False;
1563 status = ndr_push_eventlog_FlushEventLog(push, NDR_OUT, &r);
1564 if (NT_STATUS_IS_ERR(status)) {
1565 talloc_free(mem_ctx);
1566 return False;
1569 blob = ndr_push_blob(push);
1570 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1571 talloc_free(mem_ctx);
1572 return False;
1575 talloc_free(mem_ctx);
1577 return True;
1581 /* Tables */
1582 static struct api_struct api_eventlog_cmds[] =
1584 {"EVENTLOG_CLEAREVENTLOGW", DCERPC_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW},
1585 {"EVENTLOG_BACKUPEVENTLOGW", DCERPC_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW},
1586 {"EVENTLOG_CLOSEEVENTLOG", DCERPC_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog},
1587 {"EVENTLOG_DEREGISTEREVENTSOURCE", DCERPC_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource},
1588 {"EVENTLOG_GETNUMRECORDS", DCERPC_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords},
1589 {"EVENTLOG_GETOLDESTRECORD", DCERPC_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord},
1590 {"EVENTLOG_CHANGENOTIFY", DCERPC_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify},
1591 {"EVENTLOG_OPENEVENTLOGW", DCERPC_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW},
1592 {"EVENTLOG_REGISTEREVENTSOURCEW", DCERPC_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW},
1593 {"EVENTLOG_OPENBACKUPEVENTLOGW", DCERPC_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW},
1594 {"EVENTLOG_READEVENTLOGW", DCERPC_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW},
1595 {"EVENTLOG_REPORTEVENTW", DCERPC_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW},
1596 {"EVENTLOG_CLEAREVENTLOGA", DCERPC_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA},
1597 {"EVENTLOG_BACKUPEVENTLOGA", DCERPC_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA},
1598 {"EVENTLOG_OPENEVENTLOGA", DCERPC_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA},
1599 {"EVENTLOG_REGISTEREVENTSOURCEA", DCERPC_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA},
1600 {"EVENTLOG_OPENBACKUPEVENTLOGA", DCERPC_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA},
1601 {"EVENTLOG_READEVENTLOGA", DCERPC_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA},
1602 {"EVENTLOG_REPORTEVENTA", DCERPC_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA},
1603 {"EVENTLOG_REGISTERCLUSTERSVC", DCERPC_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc},
1604 {"EVENTLOG_DEREGISTERCLUSTERSVC", DCERPC_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc},
1605 {"EVENTLOG_WRITECLUSTEREVENTS", DCERPC_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents},
1606 {"EVENTLOG_GETLOGINTORMATION", DCERPC_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation},
1607 {"EVENTLOG_FLUSHEVENTLOG", DCERPC_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog},
1610 void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
1612 *fns = api_eventlog_cmds;
1613 *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct);
1616 NTSTATUS rpc_eventlog_init(void)
1618 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));