s4:drepl_out_helpers: don't look at the internals of 'struct rpc_request'
[Samba/nascimento.git] / librpc / gen_ndr / srv_eventlog.c
blob2cab792adf9b146f935d0792be71f986ca626be7
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 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct eventlog_ClearEventLogW *r;
18 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGW];
20 r = talloc(talloc_tos(), struct eventlog_ClearEventLogW);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, r);
47 r->out.result = _eventlog_ClearEventLogW(p, r);
49 if (p->rng_fault_state) {
50 talloc_free(r);
51 /* Return true here, srv_pipe_hnd.c will take care */
52 return true;
55 if (DEBUGLEVEL >= 10) {
56 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, r);
59 push = ndr_push_init_ctx(r, NULL);
60 if (push == NULL) {
61 talloc_free(r);
62 return false;
65 ndr_err = call->ndr_push(push, NDR_OUT, r);
66 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
67 talloc_free(r);
68 return false;
71 blob = ndr_push_blob(push);
72 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
73 talloc_free(r);
74 return false;
77 talloc_free(r);
79 return true;
82 static bool api_eventlog_BackupEventLogW(pipes_struct *p)
84 const struct ndr_interface_call *call;
85 struct ndr_pull *pull;
86 struct ndr_push *push;
87 enum ndr_err_code ndr_err;
88 DATA_BLOB blob;
89 struct eventlog_BackupEventLogW *r;
91 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGW];
93 r = talloc(talloc_tos(), struct eventlog_BackupEventLogW);
94 if (r == NULL) {
95 return false;
98 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
99 talloc_free(r);
100 return false;
103 pull = ndr_pull_init_blob(&blob, r, NULL);
104 if (pull == NULL) {
105 talloc_free(r);
106 return false;
109 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
110 ndr_err = call->ndr_pull(pull, NDR_IN, r);
111 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
112 talloc_free(r);
113 return false;
116 if (DEBUGLEVEL >= 10) {
117 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, r);
120 r->out.result = _eventlog_BackupEventLogW(p, r);
122 if (p->rng_fault_state) {
123 talloc_free(r);
124 /* Return true here, srv_pipe_hnd.c will take care */
125 return true;
128 if (DEBUGLEVEL >= 10) {
129 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, r);
132 push = ndr_push_init_ctx(r, NULL);
133 if (push == NULL) {
134 talloc_free(r);
135 return false;
138 ndr_err = call->ndr_push(push, NDR_OUT, r);
139 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
140 talloc_free(r);
141 return false;
144 blob = ndr_push_blob(push);
145 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
146 talloc_free(r);
147 return false;
150 talloc_free(r);
152 return true;
155 static bool api_eventlog_CloseEventLog(pipes_struct *p)
157 const struct ndr_interface_call *call;
158 struct ndr_pull *pull;
159 struct ndr_push *push;
160 enum ndr_err_code ndr_err;
161 DATA_BLOB blob;
162 struct eventlog_CloseEventLog *r;
164 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLOSEEVENTLOG];
166 r = talloc(talloc_tos(), struct eventlog_CloseEventLog);
167 if (r == NULL) {
168 return false;
171 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
172 talloc_free(r);
173 return false;
176 pull = ndr_pull_init_blob(&blob, r, NULL);
177 if (pull == NULL) {
178 talloc_free(r);
179 return false;
182 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
183 ndr_err = call->ndr_pull(pull, NDR_IN, r);
184 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
185 talloc_free(r);
186 return false;
189 if (DEBUGLEVEL >= 10) {
190 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, r);
193 ZERO_STRUCT(r->out);
194 r->out.handle = r->in.handle;
195 r->out.result = _eventlog_CloseEventLog(p, r);
197 if (p->rng_fault_state) {
198 talloc_free(r);
199 /* Return true here, srv_pipe_hnd.c will take care */
200 return true;
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, r);
207 push = ndr_push_init_ctx(r, NULL);
208 if (push == NULL) {
209 talloc_free(r);
210 return false;
213 ndr_err = call->ndr_push(push, NDR_OUT, r);
214 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
215 talloc_free(r);
216 return false;
219 blob = ndr_push_blob(push);
220 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
221 talloc_free(r);
222 return false;
225 talloc_free(r);
227 return true;
230 static bool api_eventlog_DeregisterEventSource(pipes_struct *p)
232 const struct ndr_interface_call *call;
233 struct ndr_pull *pull;
234 struct ndr_push *push;
235 enum ndr_err_code ndr_err;
236 DATA_BLOB blob;
237 struct eventlog_DeregisterEventSource *r;
239 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTEREVENTSOURCE];
241 r = talloc(talloc_tos(), struct eventlog_DeregisterEventSource);
242 if (r == NULL) {
243 return false;
246 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
247 talloc_free(r);
248 return false;
251 pull = ndr_pull_init_blob(&blob, r, NULL);
252 if (pull == NULL) {
253 talloc_free(r);
254 return false;
257 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
258 ndr_err = call->ndr_pull(pull, NDR_IN, r);
259 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
260 talloc_free(r);
261 return false;
264 if (DEBUGLEVEL >= 10) {
265 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, r);
268 ZERO_STRUCT(r->out);
269 r->out.handle = r->in.handle;
270 r->out.result = _eventlog_DeregisterEventSource(p, r);
272 if (p->rng_fault_state) {
273 talloc_free(r);
274 /* Return true here, srv_pipe_hnd.c will take care */
275 return true;
278 if (DEBUGLEVEL >= 10) {
279 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r);
282 push = ndr_push_init_ctx(r, NULL);
283 if (push == NULL) {
284 talloc_free(r);
285 return false;
288 ndr_err = call->ndr_push(push, NDR_OUT, r);
289 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
290 talloc_free(r);
291 return false;
294 blob = ndr_push_blob(push);
295 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
296 talloc_free(r);
297 return false;
300 talloc_free(r);
302 return true;
305 static bool api_eventlog_GetNumRecords(pipes_struct *p)
307 const struct ndr_interface_call *call;
308 struct ndr_pull *pull;
309 struct ndr_push *push;
310 enum ndr_err_code ndr_err;
311 DATA_BLOB blob;
312 struct eventlog_GetNumRecords *r;
314 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS];
316 r = talloc(talloc_tos(), struct eventlog_GetNumRecords);
317 if (r == NULL) {
318 return false;
321 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
322 talloc_free(r);
323 return false;
326 pull = ndr_pull_init_blob(&blob, r, NULL);
327 if (pull == NULL) {
328 talloc_free(r);
329 return false;
332 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
333 ndr_err = call->ndr_pull(pull, NDR_IN, r);
334 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
335 talloc_free(r);
336 return false;
339 if (DEBUGLEVEL >= 10) {
340 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, r);
343 ZERO_STRUCT(r->out);
344 r->out.number = talloc_zero(r, uint32_t);
345 if (r->out.number == NULL) {
346 talloc_free(r);
347 return false;
350 r->out.result = _eventlog_GetNumRecords(p, r);
352 if (p->rng_fault_state) {
353 talloc_free(r);
354 /* Return true here, srv_pipe_hnd.c will take care */
355 return true;
358 if (DEBUGLEVEL >= 10) {
359 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r);
362 push = ndr_push_init_ctx(r, NULL);
363 if (push == NULL) {
364 talloc_free(r);
365 return false;
368 ndr_err = call->ndr_push(push, NDR_OUT, r);
369 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
370 talloc_free(r);
371 return false;
374 blob = ndr_push_blob(push);
375 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
376 talloc_free(r);
377 return false;
380 talloc_free(r);
382 return true;
385 static bool api_eventlog_GetOldestRecord(pipes_struct *p)
387 const struct ndr_interface_call *call;
388 struct ndr_pull *pull;
389 struct ndr_push *push;
390 enum ndr_err_code ndr_err;
391 DATA_BLOB blob;
392 struct eventlog_GetOldestRecord *r;
394 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD];
396 r = talloc(talloc_tos(), struct eventlog_GetOldestRecord);
397 if (r == NULL) {
398 return false;
401 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
402 talloc_free(r);
403 return false;
406 pull = ndr_pull_init_blob(&blob, r, NULL);
407 if (pull == NULL) {
408 talloc_free(r);
409 return false;
412 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
413 ndr_err = call->ndr_pull(pull, NDR_IN, r);
414 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
415 talloc_free(r);
416 return false;
419 if (DEBUGLEVEL >= 10) {
420 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r);
423 ZERO_STRUCT(r->out);
424 r->out.oldest_entry = talloc_zero(r, uint32_t);
425 if (r->out.oldest_entry == NULL) {
426 talloc_free(r);
427 return false;
430 r->out.result = _eventlog_GetOldestRecord(p, r);
432 if (p->rng_fault_state) {
433 talloc_free(r);
434 /* Return true here, srv_pipe_hnd.c will take care */
435 return true;
438 if (DEBUGLEVEL >= 10) {
439 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r);
442 push = ndr_push_init_ctx(r, NULL);
443 if (push == NULL) {
444 talloc_free(r);
445 return false;
448 ndr_err = call->ndr_push(push, NDR_OUT, r);
449 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
450 talloc_free(r);
451 return false;
454 blob = ndr_push_blob(push);
455 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
456 talloc_free(r);
457 return false;
460 talloc_free(r);
462 return true;
465 static bool api_eventlog_ChangeNotify(pipes_struct *p)
467 const struct ndr_interface_call *call;
468 struct ndr_pull *pull;
469 struct ndr_push *push;
470 enum ndr_err_code ndr_err;
471 DATA_BLOB blob;
472 struct eventlog_ChangeNotify *r;
474 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY];
476 r = talloc(talloc_tos(), struct eventlog_ChangeNotify);
477 if (r == NULL) {
478 return false;
481 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
482 talloc_free(r);
483 return false;
486 pull = ndr_pull_init_blob(&blob, r, NULL);
487 if (pull == NULL) {
488 talloc_free(r);
489 return false;
492 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
493 ndr_err = call->ndr_pull(pull, NDR_IN, r);
494 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
495 talloc_free(r);
496 return false;
499 if (DEBUGLEVEL >= 10) {
500 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, r);
503 r->out.result = _eventlog_ChangeNotify(p, r);
505 if (p->rng_fault_state) {
506 talloc_free(r);
507 /* Return true here, srv_pipe_hnd.c will take care */
508 return true;
511 if (DEBUGLEVEL >= 10) {
512 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r);
515 push = ndr_push_init_ctx(r, NULL);
516 if (push == NULL) {
517 talloc_free(r);
518 return false;
521 ndr_err = call->ndr_push(push, NDR_OUT, r);
522 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
523 talloc_free(r);
524 return false;
527 blob = ndr_push_blob(push);
528 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
529 talloc_free(r);
530 return false;
533 talloc_free(r);
535 return true;
538 static bool api_eventlog_OpenEventLogW(pipes_struct *p)
540 const struct ndr_interface_call *call;
541 struct ndr_pull *pull;
542 struct ndr_push *push;
543 enum ndr_err_code ndr_err;
544 DATA_BLOB blob;
545 struct eventlog_OpenEventLogW *r;
547 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW];
549 r = talloc(talloc_tos(), struct eventlog_OpenEventLogW);
550 if (r == NULL) {
551 return false;
554 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
555 talloc_free(r);
556 return false;
559 pull = ndr_pull_init_blob(&blob, r, NULL);
560 if (pull == NULL) {
561 talloc_free(r);
562 return false;
565 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
566 ndr_err = call->ndr_pull(pull, NDR_IN, r);
567 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
568 talloc_free(r);
569 return false;
572 if (DEBUGLEVEL >= 10) {
573 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, r);
576 ZERO_STRUCT(r->out);
577 r->out.handle = talloc_zero(r, struct policy_handle);
578 if (r->out.handle == NULL) {
579 talloc_free(r);
580 return false;
583 r->out.result = _eventlog_OpenEventLogW(p, r);
585 if (p->rng_fault_state) {
586 talloc_free(r);
587 /* Return true here, srv_pipe_hnd.c will take care */
588 return true;
591 if (DEBUGLEVEL >= 10) {
592 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r);
595 push = ndr_push_init_ctx(r, NULL);
596 if (push == NULL) {
597 talloc_free(r);
598 return false;
601 ndr_err = call->ndr_push(push, NDR_OUT, r);
602 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
603 talloc_free(r);
604 return false;
607 blob = ndr_push_blob(push);
608 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
609 talloc_free(r);
610 return false;
613 talloc_free(r);
615 return true;
618 static bool api_eventlog_RegisterEventSourceW(pipes_struct *p)
620 const struct ndr_interface_call *call;
621 struct ndr_pull *pull;
622 struct ndr_push *push;
623 enum ndr_err_code ndr_err;
624 DATA_BLOB blob;
625 struct eventlog_RegisterEventSourceW *r;
627 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW];
629 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW);
630 if (r == NULL) {
631 return false;
634 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
635 talloc_free(r);
636 return false;
639 pull = ndr_pull_init_blob(&blob, r, NULL);
640 if (pull == NULL) {
641 talloc_free(r);
642 return false;
645 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
646 ndr_err = call->ndr_pull(pull, NDR_IN, r);
647 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
648 talloc_free(r);
649 return false;
652 if (DEBUGLEVEL >= 10) {
653 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r);
656 ZERO_STRUCT(r->out);
657 r->out.log_handle = talloc_zero(r, struct policy_handle);
658 if (r->out.log_handle == NULL) {
659 talloc_free(r);
660 return false;
663 r->out.result = _eventlog_RegisterEventSourceW(p, r);
665 if (p->rng_fault_state) {
666 talloc_free(r);
667 /* Return true here, srv_pipe_hnd.c will take care */
668 return true;
671 if (DEBUGLEVEL >= 10) {
672 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r);
675 push = ndr_push_init_ctx(r, NULL);
676 if (push == NULL) {
677 talloc_free(r);
678 return false;
681 ndr_err = call->ndr_push(push, NDR_OUT, r);
682 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
683 talloc_free(r);
684 return false;
687 blob = ndr_push_blob(push);
688 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
689 talloc_free(r);
690 return false;
693 talloc_free(r);
695 return true;
698 static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p)
700 const struct ndr_interface_call *call;
701 struct ndr_pull *pull;
702 struct ndr_push *push;
703 enum ndr_err_code ndr_err;
704 DATA_BLOB blob;
705 struct eventlog_OpenBackupEventLogW *r;
707 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW];
709 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW);
710 if (r == NULL) {
711 return false;
714 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
715 talloc_free(r);
716 return false;
719 pull = ndr_pull_init_blob(&blob, r, NULL);
720 if (pull == NULL) {
721 talloc_free(r);
722 return false;
725 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
726 ndr_err = call->ndr_pull(pull, NDR_IN, r);
727 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
728 talloc_free(r);
729 return false;
732 if (DEBUGLEVEL >= 10) {
733 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r);
736 ZERO_STRUCT(r->out);
737 r->out.handle = talloc_zero(r, struct policy_handle);
738 if (r->out.handle == NULL) {
739 talloc_free(r);
740 return false;
743 r->out.result = _eventlog_OpenBackupEventLogW(p, r);
745 if (p->rng_fault_state) {
746 talloc_free(r);
747 /* Return true here, srv_pipe_hnd.c will take care */
748 return true;
751 if (DEBUGLEVEL >= 10) {
752 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r);
755 push = ndr_push_init_ctx(r, NULL);
756 if (push == NULL) {
757 talloc_free(r);
758 return false;
761 ndr_err = call->ndr_push(push, NDR_OUT, r);
762 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
763 talloc_free(r);
764 return false;
767 blob = ndr_push_blob(push);
768 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
769 talloc_free(r);
770 return false;
773 talloc_free(r);
775 return true;
778 static bool api_eventlog_ReadEventLogW(pipes_struct *p)
780 const struct ndr_interface_call *call;
781 struct ndr_pull *pull;
782 struct ndr_push *push;
783 enum ndr_err_code ndr_err;
784 DATA_BLOB blob;
785 struct eventlog_ReadEventLogW *r;
787 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW];
789 r = talloc(talloc_tos(), struct eventlog_ReadEventLogW);
790 if (r == NULL) {
791 return false;
794 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
795 talloc_free(r);
796 return false;
799 pull = ndr_pull_init_blob(&blob, r, NULL);
800 if (pull == NULL) {
801 talloc_free(r);
802 return false;
805 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
806 ndr_err = call->ndr_pull(pull, NDR_IN, r);
807 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
808 talloc_free(r);
809 return false;
812 if (DEBUGLEVEL >= 10) {
813 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, r);
816 ZERO_STRUCT(r->out);
817 r->out.data = talloc_zero_array(r, uint8_t, r->in.number_of_bytes);
818 if (r->out.data == NULL) {
819 talloc_free(r);
820 return false;
823 r->out.sent_size = talloc_zero(r, uint32_t);
824 if (r->out.sent_size == NULL) {
825 talloc_free(r);
826 return false;
829 r->out.real_size = talloc_zero(r, uint32_t);
830 if (r->out.real_size == NULL) {
831 talloc_free(r);
832 return false;
835 r->out.result = _eventlog_ReadEventLogW(p, r);
837 if (p->rng_fault_state) {
838 talloc_free(r);
839 /* Return true here, srv_pipe_hnd.c will take care */
840 return true;
843 if (DEBUGLEVEL >= 10) {
844 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r);
847 push = ndr_push_init_ctx(r, NULL);
848 if (push == NULL) {
849 talloc_free(r);
850 return false;
853 ndr_err = call->ndr_push(push, NDR_OUT, r);
854 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
855 talloc_free(r);
856 return false;
859 blob = ndr_push_blob(push);
860 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
861 talloc_free(r);
862 return false;
865 talloc_free(r);
867 return true;
870 static bool api_eventlog_ReportEventW(pipes_struct *p)
872 const struct ndr_interface_call *call;
873 struct ndr_pull *pull;
874 struct ndr_push *push;
875 enum ndr_err_code ndr_err;
876 DATA_BLOB blob;
877 struct eventlog_ReportEventW *r;
879 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW];
881 r = talloc(talloc_tos(), struct eventlog_ReportEventW);
882 if (r == NULL) {
883 return false;
886 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
887 talloc_free(r);
888 return false;
891 pull = ndr_pull_init_blob(&blob, r, NULL);
892 if (pull == NULL) {
893 talloc_free(r);
894 return false;
897 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
898 ndr_err = call->ndr_pull(pull, NDR_IN, r);
899 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
900 talloc_free(r);
901 return false;
904 if (DEBUGLEVEL >= 10) {
905 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r);
908 ZERO_STRUCT(r->out);
909 r->out.record_number = r->in.record_number;
910 r->out.time_written = r->in.time_written;
911 r->out.result = _eventlog_ReportEventW(p, r);
913 if (p->rng_fault_state) {
914 talloc_free(r);
915 /* Return true here, srv_pipe_hnd.c will take care */
916 return true;
919 if (DEBUGLEVEL >= 10) {
920 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r);
923 push = ndr_push_init_ctx(r, NULL);
924 if (push == NULL) {
925 talloc_free(r);
926 return false;
929 ndr_err = call->ndr_push(push, NDR_OUT, r);
930 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
931 talloc_free(r);
932 return false;
935 blob = ndr_push_blob(push);
936 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
937 talloc_free(r);
938 return false;
941 talloc_free(r);
943 return true;
946 static bool api_eventlog_ClearEventLogA(pipes_struct *p)
948 const struct ndr_interface_call *call;
949 struct ndr_pull *pull;
950 struct ndr_push *push;
951 enum ndr_err_code ndr_err;
952 DATA_BLOB blob;
953 struct eventlog_ClearEventLogA *r;
955 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA];
957 r = talloc(talloc_tos(), struct eventlog_ClearEventLogA);
958 if (r == NULL) {
959 return false;
962 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
963 talloc_free(r);
964 return false;
967 pull = ndr_pull_init_blob(&blob, r, NULL);
968 if (pull == NULL) {
969 talloc_free(r);
970 return false;
973 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
974 ndr_err = call->ndr_pull(pull, NDR_IN, r);
975 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
976 talloc_free(r);
977 return false;
980 if (DEBUGLEVEL >= 10) {
981 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, r);
984 r->out.result = _eventlog_ClearEventLogA(p, r);
986 if (p->rng_fault_state) {
987 talloc_free(r);
988 /* Return true here, srv_pipe_hnd.c will take care */
989 return true;
992 if (DEBUGLEVEL >= 10) {
993 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r);
996 push = ndr_push_init_ctx(r, NULL);
997 if (push == NULL) {
998 talloc_free(r);
999 return false;
1002 ndr_err = call->ndr_push(push, NDR_OUT, r);
1003 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1004 talloc_free(r);
1005 return false;
1008 blob = ndr_push_blob(push);
1009 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1010 talloc_free(r);
1011 return false;
1014 talloc_free(r);
1016 return true;
1019 static bool api_eventlog_BackupEventLogA(pipes_struct *p)
1021 const struct ndr_interface_call *call;
1022 struct ndr_pull *pull;
1023 struct ndr_push *push;
1024 enum ndr_err_code ndr_err;
1025 DATA_BLOB blob;
1026 struct eventlog_BackupEventLogA *r;
1028 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA];
1030 r = talloc(talloc_tos(), struct eventlog_BackupEventLogA);
1031 if (r == NULL) {
1032 return false;
1035 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1036 talloc_free(r);
1037 return false;
1040 pull = ndr_pull_init_blob(&blob, r, NULL);
1041 if (pull == NULL) {
1042 talloc_free(r);
1043 return false;
1046 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1047 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1048 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1049 talloc_free(r);
1050 return false;
1053 if (DEBUGLEVEL >= 10) {
1054 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, r);
1057 r->out.result = _eventlog_BackupEventLogA(p, r);
1059 if (p->rng_fault_state) {
1060 talloc_free(r);
1061 /* Return true here, srv_pipe_hnd.c will take care */
1062 return true;
1065 if (DEBUGLEVEL >= 10) {
1066 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r);
1069 push = ndr_push_init_ctx(r, NULL);
1070 if (push == NULL) {
1071 talloc_free(r);
1072 return false;
1075 ndr_err = call->ndr_push(push, NDR_OUT, r);
1076 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1077 talloc_free(r);
1078 return false;
1081 blob = ndr_push_blob(push);
1082 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1083 talloc_free(r);
1084 return false;
1087 talloc_free(r);
1089 return true;
1092 static bool api_eventlog_OpenEventLogA(pipes_struct *p)
1094 const struct ndr_interface_call *call;
1095 struct ndr_pull *pull;
1096 struct ndr_push *push;
1097 enum ndr_err_code ndr_err;
1098 DATA_BLOB blob;
1099 struct eventlog_OpenEventLogA *r;
1101 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA];
1103 r = talloc(talloc_tos(), struct eventlog_OpenEventLogA);
1104 if (r == NULL) {
1105 return false;
1108 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1109 talloc_free(r);
1110 return false;
1113 pull = ndr_pull_init_blob(&blob, r, NULL);
1114 if (pull == NULL) {
1115 talloc_free(r);
1116 return false;
1119 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1120 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1121 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1122 talloc_free(r);
1123 return false;
1126 if (DEBUGLEVEL >= 10) {
1127 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, r);
1130 r->out.result = _eventlog_OpenEventLogA(p, r);
1132 if (p->rng_fault_state) {
1133 talloc_free(r);
1134 /* Return true here, srv_pipe_hnd.c will take care */
1135 return true;
1138 if (DEBUGLEVEL >= 10) {
1139 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r);
1142 push = ndr_push_init_ctx(r, NULL);
1143 if (push == NULL) {
1144 talloc_free(r);
1145 return false;
1148 ndr_err = call->ndr_push(push, NDR_OUT, r);
1149 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1150 talloc_free(r);
1151 return false;
1154 blob = ndr_push_blob(push);
1155 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1156 talloc_free(r);
1157 return false;
1160 talloc_free(r);
1162 return true;
1165 static bool api_eventlog_RegisterEventSourceA(pipes_struct *p)
1167 const struct ndr_interface_call *call;
1168 struct ndr_pull *pull;
1169 struct ndr_push *push;
1170 enum ndr_err_code ndr_err;
1171 DATA_BLOB blob;
1172 struct eventlog_RegisterEventSourceA *r;
1174 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA];
1176 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA);
1177 if (r == NULL) {
1178 return false;
1181 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1182 talloc_free(r);
1183 return false;
1186 pull = ndr_pull_init_blob(&blob, r, NULL);
1187 if (pull == NULL) {
1188 talloc_free(r);
1189 return false;
1192 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1193 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1194 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1195 talloc_free(r);
1196 return false;
1199 if (DEBUGLEVEL >= 10) {
1200 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, r);
1203 r->out.result = _eventlog_RegisterEventSourceA(p, r);
1205 if (p->rng_fault_state) {
1206 talloc_free(r);
1207 /* Return true here, srv_pipe_hnd.c will take care */
1208 return true;
1211 if (DEBUGLEVEL >= 10) {
1212 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r);
1215 push = ndr_push_init_ctx(r, NULL);
1216 if (push == NULL) {
1217 talloc_free(r);
1218 return false;
1221 ndr_err = call->ndr_push(push, NDR_OUT, r);
1222 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1223 talloc_free(r);
1224 return false;
1227 blob = ndr_push_blob(push);
1228 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1229 talloc_free(r);
1230 return false;
1233 talloc_free(r);
1235 return true;
1238 static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p)
1240 const struct ndr_interface_call *call;
1241 struct ndr_pull *pull;
1242 struct ndr_push *push;
1243 enum ndr_err_code ndr_err;
1244 DATA_BLOB blob;
1245 struct eventlog_OpenBackupEventLogA *r;
1247 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA];
1249 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA);
1250 if (r == NULL) {
1251 return false;
1254 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1255 talloc_free(r);
1256 return false;
1259 pull = ndr_pull_init_blob(&blob, r, NULL);
1260 if (pull == NULL) {
1261 talloc_free(r);
1262 return false;
1265 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1266 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1267 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1268 talloc_free(r);
1269 return false;
1272 if (DEBUGLEVEL >= 10) {
1273 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, r);
1276 r->out.result = _eventlog_OpenBackupEventLogA(p, r);
1278 if (p->rng_fault_state) {
1279 talloc_free(r);
1280 /* Return true here, srv_pipe_hnd.c will take care */
1281 return true;
1284 if (DEBUGLEVEL >= 10) {
1285 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r);
1288 push = ndr_push_init_ctx(r, NULL);
1289 if (push == NULL) {
1290 talloc_free(r);
1291 return false;
1294 ndr_err = call->ndr_push(push, NDR_OUT, r);
1295 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1296 talloc_free(r);
1297 return false;
1300 blob = ndr_push_blob(push);
1301 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1302 talloc_free(r);
1303 return false;
1306 talloc_free(r);
1308 return true;
1311 static bool api_eventlog_ReadEventLogA(pipes_struct *p)
1313 const struct ndr_interface_call *call;
1314 struct ndr_pull *pull;
1315 struct ndr_push *push;
1316 enum ndr_err_code ndr_err;
1317 DATA_BLOB blob;
1318 struct eventlog_ReadEventLogA *r;
1320 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA];
1322 r = talloc(talloc_tos(), struct eventlog_ReadEventLogA);
1323 if (r == NULL) {
1324 return false;
1327 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1328 talloc_free(r);
1329 return false;
1332 pull = ndr_pull_init_blob(&blob, r, NULL);
1333 if (pull == NULL) {
1334 talloc_free(r);
1335 return false;
1338 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1339 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1340 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1341 talloc_free(r);
1342 return false;
1345 if (DEBUGLEVEL >= 10) {
1346 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, r);
1349 r->out.result = _eventlog_ReadEventLogA(p, r);
1351 if (p->rng_fault_state) {
1352 talloc_free(r);
1353 /* Return true here, srv_pipe_hnd.c will take care */
1354 return true;
1357 if (DEBUGLEVEL >= 10) {
1358 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r);
1361 push = ndr_push_init_ctx(r, NULL);
1362 if (push == NULL) {
1363 talloc_free(r);
1364 return false;
1367 ndr_err = call->ndr_push(push, NDR_OUT, r);
1368 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1369 talloc_free(r);
1370 return false;
1373 blob = ndr_push_blob(push);
1374 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1375 talloc_free(r);
1376 return false;
1379 talloc_free(r);
1381 return true;
1384 static bool api_eventlog_ReportEventA(pipes_struct *p)
1386 const struct ndr_interface_call *call;
1387 struct ndr_pull *pull;
1388 struct ndr_push *push;
1389 enum ndr_err_code ndr_err;
1390 DATA_BLOB blob;
1391 struct eventlog_ReportEventA *r;
1393 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA];
1395 r = talloc(talloc_tos(), struct eventlog_ReportEventA);
1396 if (r == NULL) {
1397 return false;
1400 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1401 talloc_free(r);
1402 return false;
1405 pull = ndr_pull_init_blob(&blob, r, NULL);
1406 if (pull == NULL) {
1407 talloc_free(r);
1408 return false;
1411 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1412 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1413 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1414 talloc_free(r);
1415 return false;
1418 if (DEBUGLEVEL >= 10) {
1419 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, r);
1422 r->out.result = _eventlog_ReportEventA(p, r);
1424 if (p->rng_fault_state) {
1425 talloc_free(r);
1426 /* Return true here, srv_pipe_hnd.c will take care */
1427 return true;
1430 if (DEBUGLEVEL >= 10) {
1431 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r);
1434 push = ndr_push_init_ctx(r, NULL);
1435 if (push == NULL) {
1436 talloc_free(r);
1437 return false;
1440 ndr_err = call->ndr_push(push, NDR_OUT, r);
1441 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1442 talloc_free(r);
1443 return false;
1446 blob = ndr_push_blob(push);
1447 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1448 talloc_free(r);
1449 return false;
1452 talloc_free(r);
1454 return true;
1457 static bool api_eventlog_RegisterClusterSvc(pipes_struct *p)
1459 const struct ndr_interface_call *call;
1460 struct ndr_pull *pull;
1461 struct ndr_push *push;
1462 enum ndr_err_code ndr_err;
1463 DATA_BLOB blob;
1464 struct eventlog_RegisterClusterSvc *r;
1466 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC];
1468 r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc);
1469 if (r == NULL) {
1470 return false;
1473 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1474 talloc_free(r);
1475 return false;
1478 pull = ndr_pull_init_blob(&blob, r, NULL);
1479 if (pull == NULL) {
1480 talloc_free(r);
1481 return false;
1484 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1485 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1486 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1487 talloc_free(r);
1488 return false;
1491 if (DEBUGLEVEL >= 10) {
1492 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, r);
1495 r->out.result = _eventlog_RegisterClusterSvc(p, r);
1497 if (p->rng_fault_state) {
1498 talloc_free(r);
1499 /* Return true here, srv_pipe_hnd.c will take care */
1500 return true;
1503 if (DEBUGLEVEL >= 10) {
1504 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r);
1507 push = ndr_push_init_ctx(r, NULL);
1508 if (push == NULL) {
1509 talloc_free(r);
1510 return false;
1513 ndr_err = call->ndr_push(push, NDR_OUT, r);
1514 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1515 talloc_free(r);
1516 return false;
1519 blob = ndr_push_blob(push);
1520 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1521 talloc_free(r);
1522 return false;
1525 talloc_free(r);
1527 return true;
1530 static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p)
1532 const struct ndr_interface_call *call;
1533 struct ndr_pull *pull;
1534 struct ndr_push *push;
1535 enum ndr_err_code ndr_err;
1536 DATA_BLOB blob;
1537 struct eventlog_DeregisterClusterSvc *r;
1539 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC];
1541 r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc);
1542 if (r == NULL) {
1543 return false;
1546 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1547 talloc_free(r);
1548 return false;
1551 pull = ndr_pull_init_blob(&blob, r, NULL);
1552 if (pull == NULL) {
1553 talloc_free(r);
1554 return false;
1557 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1558 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1559 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1560 talloc_free(r);
1561 return false;
1564 if (DEBUGLEVEL >= 10) {
1565 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, r);
1568 r->out.result = _eventlog_DeregisterClusterSvc(p, r);
1570 if (p->rng_fault_state) {
1571 talloc_free(r);
1572 /* Return true here, srv_pipe_hnd.c will take care */
1573 return true;
1576 if (DEBUGLEVEL >= 10) {
1577 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r);
1580 push = ndr_push_init_ctx(r, NULL);
1581 if (push == NULL) {
1582 talloc_free(r);
1583 return false;
1586 ndr_err = call->ndr_push(push, NDR_OUT, r);
1587 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1588 talloc_free(r);
1589 return false;
1592 blob = ndr_push_blob(push);
1593 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1594 talloc_free(r);
1595 return false;
1598 talloc_free(r);
1600 return true;
1603 static bool api_eventlog_WriteClusterEvents(pipes_struct *p)
1605 const struct ndr_interface_call *call;
1606 struct ndr_pull *pull;
1607 struct ndr_push *push;
1608 enum ndr_err_code ndr_err;
1609 DATA_BLOB blob;
1610 struct eventlog_WriteClusterEvents *r;
1612 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS];
1614 r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents);
1615 if (r == NULL) {
1616 return false;
1619 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1620 talloc_free(r);
1621 return false;
1624 pull = ndr_pull_init_blob(&blob, r, NULL);
1625 if (pull == NULL) {
1626 talloc_free(r);
1627 return false;
1630 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1631 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1632 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1633 talloc_free(r);
1634 return false;
1637 if (DEBUGLEVEL >= 10) {
1638 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, r);
1641 r->out.result = _eventlog_WriteClusterEvents(p, r);
1643 if (p->rng_fault_state) {
1644 talloc_free(r);
1645 /* Return true here, srv_pipe_hnd.c will take care */
1646 return true;
1649 if (DEBUGLEVEL >= 10) {
1650 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r);
1653 push = ndr_push_init_ctx(r, NULL);
1654 if (push == NULL) {
1655 talloc_free(r);
1656 return false;
1659 ndr_err = call->ndr_push(push, NDR_OUT, r);
1660 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1661 talloc_free(r);
1662 return false;
1665 blob = ndr_push_blob(push);
1666 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1667 talloc_free(r);
1668 return false;
1671 talloc_free(r);
1673 return true;
1676 static bool api_eventlog_GetLogInformation(pipes_struct *p)
1678 const struct ndr_interface_call *call;
1679 struct ndr_pull *pull;
1680 struct ndr_push *push;
1681 enum ndr_err_code ndr_err;
1682 DATA_BLOB blob;
1683 struct eventlog_GetLogInformation *r;
1685 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINFORMATION];
1687 r = talloc(talloc_tos(), struct eventlog_GetLogInformation);
1688 if (r == NULL) {
1689 return false;
1692 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1693 talloc_free(r);
1694 return false;
1697 pull = ndr_pull_init_blob(&blob, r, NULL);
1698 if (pull == NULL) {
1699 talloc_free(r);
1700 return false;
1703 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1704 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1705 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1706 talloc_free(r);
1707 return false;
1710 if (DEBUGLEVEL >= 10) {
1711 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, r);
1714 ZERO_STRUCT(r->out);
1715 r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buf_size);
1716 if (r->out.buffer == NULL) {
1717 talloc_free(r);
1718 return false;
1721 r->out.bytes_needed = talloc_zero(r, uint32_t);
1722 if (r->out.bytes_needed == NULL) {
1723 talloc_free(r);
1724 return false;
1727 r->out.result = _eventlog_GetLogInformation(p, r);
1729 if (p->rng_fault_state) {
1730 talloc_free(r);
1731 /* Return true here, srv_pipe_hnd.c will take care */
1732 return true;
1735 if (DEBUGLEVEL >= 10) {
1736 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, r);
1739 push = ndr_push_init_ctx(r, NULL);
1740 if (push == NULL) {
1741 talloc_free(r);
1742 return false;
1745 ndr_err = call->ndr_push(push, NDR_OUT, r);
1746 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1747 talloc_free(r);
1748 return false;
1751 blob = ndr_push_blob(push);
1752 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1753 talloc_free(r);
1754 return false;
1757 talloc_free(r);
1759 return true;
1762 static bool api_eventlog_FlushEventLog(pipes_struct *p)
1764 const struct ndr_interface_call *call;
1765 struct ndr_pull *pull;
1766 struct ndr_push *push;
1767 enum ndr_err_code ndr_err;
1768 DATA_BLOB blob;
1769 struct eventlog_FlushEventLog *r;
1771 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG];
1773 r = talloc(talloc_tos(), struct eventlog_FlushEventLog);
1774 if (r == NULL) {
1775 return false;
1778 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1779 talloc_free(r);
1780 return false;
1783 pull = ndr_pull_init_blob(&blob, r, NULL);
1784 if (pull == NULL) {
1785 talloc_free(r);
1786 return false;
1789 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1790 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1791 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1792 talloc_free(r);
1793 return false;
1796 if (DEBUGLEVEL >= 10) {
1797 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, r);
1800 r->out.result = _eventlog_FlushEventLog(p, r);
1802 if (p->rng_fault_state) {
1803 talloc_free(r);
1804 /* Return true here, srv_pipe_hnd.c will take care */
1805 return true;
1808 if (DEBUGLEVEL >= 10) {
1809 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r);
1812 push = ndr_push_init_ctx(r, NULL);
1813 if (push == NULL) {
1814 talloc_free(r);
1815 return false;
1818 ndr_err = call->ndr_push(push, NDR_OUT, r);
1819 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1820 talloc_free(r);
1821 return false;
1824 blob = ndr_push_blob(push);
1825 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1826 talloc_free(r);
1827 return false;
1830 talloc_free(r);
1832 return true;
1835 static bool api_eventlog_ReportEventAndSourceW(pipes_struct *p)
1837 const struct ndr_interface_call *call;
1838 struct ndr_pull *pull;
1839 struct ndr_push *push;
1840 enum ndr_err_code ndr_err;
1841 DATA_BLOB blob;
1842 struct eventlog_ReportEventAndSourceW *r;
1844 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTANDSOURCEW];
1846 r = talloc(talloc_tos(), struct eventlog_ReportEventAndSourceW);
1847 if (r == NULL) {
1848 return false;
1851 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1852 talloc_free(r);
1853 return false;
1856 pull = ndr_pull_init_blob(&blob, r, NULL);
1857 if (pull == NULL) {
1858 talloc_free(r);
1859 return false;
1862 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1863 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1864 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1865 talloc_free(r);
1866 return false;
1869 if (DEBUGLEVEL >= 10) {
1870 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, r);
1873 ZERO_STRUCT(r->out);
1874 r->out.record_number = r->in.record_number;
1875 r->out.time_written = r->in.time_written;
1876 r->out.result = _eventlog_ReportEventAndSourceW(p, r);
1878 if (p->rng_fault_state) {
1879 talloc_free(r);
1880 /* Return true here, srv_pipe_hnd.c will take care */
1881 return true;
1884 if (DEBUGLEVEL >= 10) {
1885 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, r);
1888 push = ndr_push_init_ctx(r, NULL);
1889 if (push == NULL) {
1890 talloc_free(r);
1891 return false;
1894 ndr_err = call->ndr_push(push, NDR_OUT, r);
1895 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1896 talloc_free(r);
1897 return false;
1900 blob = ndr_push_blob(push);
1901 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1902 talloc_free(r);
1903 return false;
1906 talloc_free(r);
1908 return true;
1912 /* Tables */
1913 static struct api_struct api_eventlog_cmds[] =
1915 {"EVENTLOG_CLEAREVENTLOGW", NDR_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW},
1916 {"EVENTLOG_BACKUPEVENTLOGW", NDR_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW},
1917 {"EVENTLOG_CLOSEEVENTLOG", NDR_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog},
1918 {"EVENTLOG_DEREGISTEREVENTSOURCE", NDR_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource},
1919 {"EVENTLOG_GETNUMRECORDS", NDR_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords},
1920 {"EVENTLOG_GETOLDESTRECORD", NDR_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord},
1921 {"EVENTLOG_CHANGENOTIFY", NDR_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify},
1922 {"EVENTLOG_OPENEVENTLOGW", NDR_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW},
1923 {"EVENTLOG_REGISTEREVENTSOURCEW", NDR_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW},
1924 {"EVENTLOG_OPENBACKUPEVENTLOGW", NDR_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW},
1925 {"EVENTLOG_READEVENTLOGW", NDR_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW},
1926 {"EVENTLOG_REPORTEVENTW", NDR_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW},
1927 {"EVENTLOG_CLEAREVENTLOGA", NDR_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA},
1928 {"EVENTLOG_BACKUPEVENTLOGA", NDR_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA},
1929 {"EVENTLOG_OPENEVENTLOGA", NDR_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA},
1930 {"EVENTLOG_REGISTEREVENTSOURCEA", NDR_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA},
1931 {"EVENTLOG_OPENBACKUPEVENTLOGA", NDR_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA},
1932 {"EVENTLOG_READEVENTLOGA", NDR_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA},
1933 {"EVENTLOG_REPORTEVENTA", NDR_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA},
1934 {"EVENTLOG_REGISTERCLUSTERSVC", NDR_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc},
1935 {"EVENTLOG_DEREGISTERCLUSTERSVC", NDR_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc},
1936 {"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents},
1937 {"EVENTLOG_GETLOGINFORMATION", NDR_EVENTLOG_GETLOGINFORMATION, api_eventlog_GetLogInformation},
1938 {"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog},
1939 {"EVENTLOG_REPORTEVENTANDSOURCEW", NDR_EVENTLOG_REPORTEVENTANDSOURCEW, api_eventlog_ReportEventAndSourceW},
1942 void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
1944 *fns = api_eventlog_cmds;
1945 *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct);
1948 NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
1950 if (cli->pipes_struct == NULL) {
1951 return NT_STATUS_INVALID_PARAMETER;
1954 switch (opnum)
1956 case NDR_EVENTLOG_CLEAREVENTLOGW: {
1957 struct eventlog_ClearEventLogW *r = (struct eventlog_ClearEventLogW *)_r;
1958 r->out.result = _eventlog_ClearEventLogW(cli->pipes_struct, r);
1959 return NT_STATUS_OK;
1962 case NDR_EVENTLOG_BACKUPEVENTLOGW: {
1963 struct eventlog_BackupEventLogW *r = (struct eventlog_BackupEventLogW *)_r;
1964 r->out.result = _eventlog_BackupEventLogW(cli->pipes_struct, r);
1965 return NT_STATUS_OK;
1968 case NDR_EVENTLOG_CLOSEEVENTLOG: {
1969 struct eventlog_CloseEventLog *r = (struct eventlog_CloseEventLog *)_r;
1970 ZERO_STRUCT(r->out);
1971 r->out.handle = r->in.handle;
1972 r->out.result = _eventlog_CloseEventLog(cli->pipes_struct, r);
1973 return NT_STATUS_OK;
1976 case NDR_EVENTLOG_DEREGISTEREVENTSOURCE: {
1977 struct eventlog_DeregisterEventSource *r = (struct eventlog_DeregisterEventSource *)_r;
1978 ZERO_STRUCT(r->out);
1979 r->out.handle = r->in.handle;
1980 r->out.result = _eventlog_DeregisterEventSource(cli->pipes_struct, r);
1981 return NT_STATUS_OK;
1984 case NDR_EVENTLOG_GETNUMRECORDS: {
1985 struct eventlog_GetNumRecords *r = (struct eventlog_GetNumRecords *)_r;
1986 ZERO_STRUCT(r->out);
1987 r->out.number = talloc_zero(mem_ctx, uint32_t);
1988 if (r->out.number == NULL) {
1989 return NT_STATUS_NO_MEMORY;
1992 r->out.result = _eventlog_GetNumRecords(cli->pipes_struct, r);
1993 return NT_STATUS_OK;
1996 case NDR_EVENTLOG_GETOLDESTRECORD: {
1997 struct eventlog_GetOldestRecord *r = (struct eventlog_GetOldestRecord *)_r;
1998 ZERO_STRUCT(r->out);
1999 r->out.oldest_entry = talloc_zero(mem_ctx, uint32_t);
2000 if (r->out.oldest_entry == NULL) {
2001 return NT_STATUS_NO_MEMORY;
2004 r->out.result = _eventlog_GetOldestRecord(cli->pipes_struct, r);
2005 return NT_STATUS_OK;
2008 case NDR_EVENTLOG_CHANGENOTIFY: {
2009 struct eventlog_ChangeNotify *r = (struct eventlog_ChangeNotify *)_r;
2010 r->out.result = _eventlog_ChangeNotify(cli->pipes_struct, r);
2011 return NT_STATUS_OK;
2014 case NDR_EVENTLOG_OPENEVENTLOGW: {
2015 struct eventlog_OpenEventLogW *r = (struct eventlog_OpenEventLogW *)_r;
2016 ZERO_STRUCT(r->out);
2017 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2018 if (r->out.handle == NULL) {
2019 return NT_STATUS_NO_MEMORY;
2022 r->out.result = _eventlog_OpenEventLogW(cli->pipes_struct, r);
2023 return NT_STATUS_OK;
2026 case NDR_EVENTLOG_REGISTEREVENTSOURCEW: {
2027 struct eventlog_RegisterEventSourceW *r = (struct eventlog_RegisterEventSourceW *)_r;
2028 ZERO_STRUCT(r->out);
2029 r->out.log_handle = talloc_zero(mem_ctx, struct policy_handle);
2030 if (r->out.log_handle == NULL) {
2031 return NT_STATUS_NO_MEMORY;
2034 r->out.result = _eventlog_RegisterEventSourceW(cli->pipes_struct, r);
2035 return NT_STATUS_OK;
2038 case NDR_EVENTLOG_OPENBACKUPEVENTLOGW: {
2039 struct eventlog_OpenBackupEventLogW *r = (struct eventlog_OpenBackupEventLogW *)_r;
2040 ZERO_STRUCT(r->out);
2041 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2042 if (r->out.handle == NULL) {
2043 return NT_STATUS_NO_MEMORY;
2046 r->out.result = _eventlog_OpenBackupEventLogW(cli->pipes_struct, r);
2047 return NT_STATUS_OK;
2050 case NDR_EVENTLOG_READEVENTLOGW: {
2051 struct eventlog_ReadEventLogW *r = (struct eventlog_ReadEventLogW *)_r;
2052 ZERO_STRUCT(r->out);
2053 r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.number_of_bytes);
2054 if (r->out.data == NULL) {
2055 return NT_STATUS_NO_MEMORY;
2058 r->out.sent_size = talloc_zero(mem_ctx, uint32_t);
2059 if (r->out.sent_size == NULL) {
2060 return NT_STATUS_NO_MEMORY;
2063 r->out.real_size = talloc_zero(mem_ctx, uint32_t);
2064 if (r->out.real_size == NULL) {
2065 return NT_STATUS_NO_MEMORY;
2068 r->out.result = _eventlog_ReadEventLogW(cli->pipes_struct, r);
2069 return NT_STATUS_OK;
2072 case NDR_EVENTLOG_REPORTEVENTW: {
2073 struct eventlog_ReportEventW *r = (struct eventlog_ReportEventW *)_r;
2074 ZERO_STRUCT(r->out);
2075 r->out.record_number = r->in.record_number;
2076 r->out.time_written = r->in.time_written;
2077 r->out.result = _eventlog_ReportEventW(cli->pipes_struct, r);
2078 return NT_STATUS_OK;
2081 case NDR_EVENTLOG_CLEAREVENTLOGA: {
2082 struct eventlog_ClearEventLogA *r = (struct eventlog_ClearEventLogA *)_r;
2083 r->out.result = _eventlog_ClearEventLogA(cli->pipes_struct, r);
2084 return NT_STATUS_OK;
2087 case NDR_EVENTLOG_BACKUPEVENTLOGA: {
2088 struct eventlog_BackupEventLogA *r = (struct eventlog_BackupEventLogA *)_r;
2089 r->out.result = _eventlog_BackupEventLogA(cli->pipes_struct, r);
2090 return NT_STATUS_OK;
2093 case NDR_EVENTLOG_OPENEVENTLOGA: {
2094 struct eventlog_OpenEventLogA *r = (struct eventlog_OpenEventLogA *)_r;
2095 r->out.result = _eventlog_OpenEventLogA(cli->pipes_struct, r);
2096 return NT_STATUS_OK;
2099 case NDR_EVENTLOG_REGISTEREVENTSOURCEA: {
2100 struct eventlog_RegisterEventSourceA *r = (struct eventlog_RegisterEventSourceA *)_r;
2101 r->out.result = _eventlog_RegisterEventSourceA(cli->pipes_struct, r);
2102 return NT_STATUS_OK;
2105 case NDR_EVENTLOG_OPENBACKUPEVENTLOGA: {
2106 struct eventlog_OpenBackupEventLogA *r = (struct eventlog_OpenBackupEventLogA *)_r;
2107 r->out.result = _eventlog_OpenBackupEventLogA(cli->pipes_struct, r);
2108 return NT_STATUS_OK;
2111 case NDR_EVENTLOG_READEVENTLOGA: {
2112 struct eventlog_ReadEventLogA *r = (struct eventlog_ReadEventLogA *)_r;
2113 r->out.result = _eventlog_ReadEventLogA(cli->pipes_struct, r);
2114 return NT_STATUS_OK;
2117 case NDR_EVENTLOG_REPORTEVENTA: {
2118 struct eventlog_ReportEventA *r = (struct eventlog_ReportEventA *)_r;
2119 r->out.result = _eventlog_ReportEventA(cli->pipes_struct, r);
2120 return NT_STATUS_OK;
2123 case NDR_EVENTLOG_REGISTERCLUSTERSVC: {
2124 struct eventlog_RegisterClusterSvc *r = (struct eventlog_RegisterClusterSvc *)_r;
2125 r->out.result = _eventlog_RegisterClusterSvc(cli->pipes_struct, r);
2126 return NT_STATUS_OK;
2129 case NDR_EVENTLOG_DEREGISTERCLUSTERSVC: {
2130 struct eventlog_DeregisterClusterSvc *r = (struct eventlog_DeregisterClusterSvc *)_r;
2131 r->out.result = _eventlog_DeregisterClusterSvc(cli->pipes_struct, r);
2132 return NT_STATUS_OK;
2135 case NDR_EVENTLOG_WRITECLUSTEREVENTS: {
2136 struct eventlog_WriteClusterEvents *r = (struct eventlog_WriteClusterEvents *)_r;
2137 r->out.result = _eventlog_WriteClusterEvents(cli->pipes_struct, r);
2138 return NT_STATUS_OK;
2141 case NDR_EVENTLOG_GETLOGINFORMATION: {
2142 struct eventlog_GetLogInformation *r = (struct eventlog_GetLogInformation *)_r;
2143 ZERO_STRUCT(r->out);
2144 r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.buf_size);
2145 if (r->out.buffer == NULL) {
2146 return NT_STATUS_NO_MEMORY;
2149 r->out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2150 if (r->out.bytes_needed == NULL) {
2151 return NT_STATUS_NO_MEMORY;
2154 r->out.result = _eventlog_GetLogInformation(cli->pipes_struct, r);
2155 return NT_STATUS_OK;
2158 case NDR_EVENTLOG_FLUSHEVENTLOG: {
2159 struct eventlog_FlushEventLog *r = (struct eventlog_FlushEventLog *)_r;
2160 r->out.result = _eventlog_FlushEventLog(cli->pipes_struct, r);
2161 return NT_STATUS_OK;
2164 case NDR_EVENTLOG_REPORTEVENTANDSOURCEW: {
2165 struct eventlog_ReportEventAndSourceW *r = (struct eventlog_ReportEventAndSourceW *)_r;
2166 ZERO_STRUCT(r->out);
2167 r->out.record_number = r->in.record_number;
2168 r->out.time_written = r->in.time_written;
2169 r->out.result = _eventlog_ReportEventAndSourceW(cli->pipes_struct, r);
2170 return NT_STATUS_OK;
2173 default:
2174 return NT_STATUS_NOT_IMPLEMENTED;
2178 NTSTATUS rpc_eventlog_init(void)
2180 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", &ndr_table_eventlog, api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));