source: branches/samba-3.5.x/librpc/gen_ndr/srv_eventlog.c

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 48.6 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
5
6#include "includes.h"
7#include "../librpc/gen_ndr/srv_eventlog.h"
8
9static bool api_eventlog_ClearEventLogW(pipes_struct *p)
10{
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;
17
18 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGW];
19
20 r = talloc(talloc_tos(), struct eventlog_ClearEventLogW);
21 if (r == NULL) {
22 return false;
23 }
24
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
28 }
29
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
34 }
35
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;
41 }
42
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogW, r);
45 }
46
47 r->out.result = _eventlog_ClearEventLogW(p, r);
48
49 if (p->rng_fault_state) {
50 talloc_free(r);
51 /* Return true here, srv_pipe_hnd.c will take care */
52 return true;
53 }
54
55 if (DEBUGLEVEL >= 10) {
56 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogW, r);
57 }
58
59 push = ndr_push_init_ctx(r, NULL);
60 if (push == NULL) {
61 talloc_free(r);
62 return false;
63 }
64
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;
69 }
70
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;
75 }
76
77 talloc_free(r);
78
79 return true;
80}
81
82static bool api_eventlog_BackupEventLogW(pipes_struct *p)
83{
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;
90
91 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGW];
92
93 r = talloc(talloc_tos(), struct eventlog_BackupEventLogW);
94 if (r == NULL) {
95 return false;
96 }
97
98 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
99 talloc_free(r);
100 return false;
101 }
102
103 pull = ndr_pull_init_blob(&blob, r, NULL);
104 if (pull == NULL) {
105 talloc_free(r);
106 return false;
107 }
108
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;
114 }
115
116 if (DEBUGLEVEL >= 10) {
117 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogW, r);
118 }
119
120 r->out.result = _eventlog_BackupEventLogW(p, r);
121
122 if (p->rng_fault_state) {
123 talloc_free(r);
124 /* Return true here, srv_pipe_hnd.c will take care */
125 return true;
126 }
127
128 if (DEBUGLEVEL >= 10) {
129 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogW, r);
130 }
131
132 push = ndr_push_init_ctx(r, NULL);
133 if (push == NULL) {
134 talloc_free(r);
135 return false;
136 }
137
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;
142 }
143
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;
148 }
149
150 talloc_free(r);
151
152 return true;
153}
154
155static bool api_eventlog_CloseEventLog(pipes_struct *p)
156{
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;
163
164 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLOSEEVENTLOG];
165
166 r = talloc(talloc_tos(), struct eventlog_CloseEventLog);
167 if (r == NULL) {
168 return false;
169 }
170
171 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
172 talloc_free(r);
173 return false;
174 }
175
176 pull = ndr_pull_init_blob(&blob, r, NULL);
177 if (pull == NULL) {
178 talloc_free(r);
179 return false;
180 }
181
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;
187 }
188
189 if (DEBUGLEVEL >= 10) {
190 NDR_PRINT_IN_DEBUG(eventlog_CloseEventLog, r);
191 }
192
193 ZERO_STRUCT(r->out);
194 r->out.handle = r->in.handle;
195 r->out.result = _eventlog_CloseEventLog(p, r);
196
197 if (p->rng_fault_state) {
198 talloc_free(r);
199 /* Return true here, srv_pipe_hnd.c will take care */
200 return true;
201 }
202
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_OUT_DEBUG(eventlog_CloseEventLog, r);
205 }
206
207 push = ndr_push_init_ctx(r, NULL);
208 if (push == NULL) {
209 talloc_free(r);
210 return false;
211 }
212
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;
217 }
218
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;
223 }
224
225 talloc_free(r);
226
227 return true;
228}
229
230static bool api_eventlog_DeregisterEventSource(pipes_struct *p)
231{
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;
238
239 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTEREVENTSOURCE];
240
241 r = talloc(talloc_tos(), struct eventlog_DeregisterEventSource);
242 if (r == NULL) {
243 return false;
244 }
245
246 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
247 talloc_free(r);
248 return false;
249 }
250
251 pull = ndr_pull_init_blob(&blob, r, NULL);
252 if (pull == NULL) {
253 talloc_free(r);
254 return false;
255 }
256
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;
262 }
263
264 if (DEBUGLEVEL >= 10) {
265 NDR_PRINT_IN_DEBUG(eventlog_DeregisterEventSource, r);
266 }
267
268 ZERO_STRUCT(r->out);
269 r->out.handle = r->in.handle;
270 r->out.result = _eventlog_DeregisterEventSource(p, r);
271
272 if (p->rng_fault_state) {
273 talloc_free(r);
274 /* Return true here, srv_pipe_hnd.c will take care */
275 return true;
276 }
277
278 if (DEBUGLEVEL >= 10) {
279 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r);
280 }
281
282 push = ndr_push_init_ctx(r, NULL);
283 if (push == NULL) {
284 talloc_free(r);
285 return false;
286 }
287
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;
292 }
293
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;
298 }
299
300 talloc_free(r);
301
302 return true;
303}
304
305static bool api_eventlog_GetNumRecords(pipes_struct *p)
306{
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;
313
314 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS];
315
316 r = talloc(talloc_tos(), struct eventlog_GetNumRecords);
317 if (r == NULL) {
318 return false;
319 }
320
321 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
322 talloc_free(r);
323 return false;
324 }
325
326 pull = ndr_pull_init_blob(&blob, r, NULL);
327 if (pull == NULL) {
328 talloc_free(r);
329 return false;
330 }
331
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;
337 }
338
339 if (DEBUGLEVEL >= 10) {
340 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, r);
341 }
342
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;
348 }
349
350 r->out.result = _eventlog_GetNumRecords(p, r);
351
352 if (p->rng_fault_state) {
353 talloc_free(r);
354 /* Return true here, srv_pipe_hnd.c will take care */
355 return true;
356 }
357
358 if (DEBUGLEVEL >= 10) {
359 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r);
360 }
361
362 push = ndr_push_init_ctx(r, NULL);
363 if (push == NULL) {
364 talloc_free(r);
365 return false;
366 }
367
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;
372 }
373
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;
378 }
379
380 talloc_free(r);
381
382 return true;
383}
384
385static bool api_eventlog_GetOldestRecord(pipes_struct *p)
386{
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;
393
394 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD];
395
396 r = talloc(talloc_tos(), struct eventlog_GetOldestRecord);
397 if (r == NULL) {
398 return false;
399 }
400
401 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
402 talloc_free(r);
403 return false;
404 }
405
406 pull = ndr_pull_init_blob(&blob, r, NULL);
407 if (pull == NULL) {
408 talloc_free(r);
409 return false;
410 }
411
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;
417 }
418
419 if (DEBUGLEVEL >= 10) {
420 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r);
421 }
422
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;
428 }
429
430 r->out.result = _eventlog_GetOldestRecord(p, r);
431
432 if (p->rng_fault_state) {
433 talloc_free(r);
434 /* Return true here, srv_pipe_hnd.c will take care */
435 return true;
436 }
437
438 if (DEBUGLEVEL >= 10) {
439 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r);
440 }
441
442 push = ndr_push_init_ctx(r, NULL);
443 if (push == NULL) {
444 talloc_free(r);
445 return false;
446 }
447
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;
452 }
453
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;
458 }
459
460 talloc_free(r);
461
462 return true;
463}
464
465static bool api_eventlog_ChangeNotify(pipes_struct *p)
466{
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;
473
474 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY];
475
476 r = talloc(talloc_tos(), struct eventlog_ChangeNotify);
477 if (r == NULL) {
478 return false;
479 }
480
481 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
482 talloc_free(r);
483 return false;
484 }
485
486 pull = ndr_pull_init_blob(&blob, r, NULL);
487 if (pull == NULL) {
488 talloc_free(r);
489 return false;
490 }
491
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;
497 }
498
499 if (DEBUGLEVEL >= 10) {
500 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, r);
501 }
502
503 r->out.result = _eventlog_ChangeNotify(p, r);
504
505 if (p->rng_fault_state) {
506 talloc_free(r);
507 /* Return true here, srv_pipe_hnd.c will take care */
508 return true;
509 }
510
511 if (DEBUGLEVEL >= 10) {
512 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r);
513 }
514
515 push = ndr_push_init_ctx(r, NULL);
516 if (push == NULL) {
517 talloc_free(r);
518 return false;
519 }
520
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;
525 }
526
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;
531 }
532
533 talloc_free(r);
534
535 return true;
536}
537
538static bool api_eventlog_OpenEventLogW(pipes_struct *p)
539{
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;
546
547 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW];
548
549 r = talloc(talloc_tos(), struct eventlog_OpenEventLogW);
550 if (r == NULL) {
551 return false;
552 }
553
554 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
555 talloc_free(r);
556 return false;
557 }
558
559 pull = ndr_pull_init_blob(&blob, r, NULL);
560 if (pull == NULL) {
561 talloc_free(r);
562 return false;
563 }
564
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;
570 }
571
572 if (DEBUGLEVEL >= 10) {
573 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, r);
574 }
575
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;
581 }
582
583 r->out.result = _eventlog_OpenEventLogW(p, r);
584
585 if (p->rng_fault_state) {
586 talloc_free(r);
587 /* Return true here, srv_pipe_hnd.c will take care */
588 return true;
589 }
590
591 if (DEBUGLEVEL >= 10) {
592 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r);
593 }
594
595 push = ndr_push_init_ctx(r, NULL);
596 if (push == NULL) {
597 talloc_free(r);
598 return false;
599 }
600
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;
605 }
606
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;
611 }
612
613 talloc_free(r);
614
615 return true;
616}
617
618static bool api_eventlog_RegisterEventSourceW(pipes_struct *p)
619{
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;
626
627 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW];
628
629 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW);
630 if (r == NULL) {
631 return false;
632 }
633
634 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
635 talloc_free(r);
636 return false;
637 }
638
639 pull = ndr_pull_init_blob(&blob, r, NULL);
640 if (pull == NULL) {
641 talloc_free(r);
642 return false;
643 }
644
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;
650 }
651
652 if (DEBUGLEVEL >= 10) {
653 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r);
654 }
655
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;
661 }
662
663 r->out.result = _eventlog_RegisterEventSourceW(p, r);
664
665 if (p->rng_fault_state) {
666 talloc_free(r);
667 /* Return true here, srv_pipe_hnd.c will take care */
668 return true;
669 }
670
671 if (DEBUGLEVEL >= 10) {
672 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r);
673 }
674
675 push = ndr_push_init_ctx(r, NULL);
676 if (push == NULL) {
677 talloc_free(r);
678 return false;
679 }
680
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;
685 }
686
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;
691 }
692
693 talloc_free(r);
694
695 return true;
696}
697
698static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p)
699{
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;
706
707 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW];
708
709 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW);
710 if (r == NULL) {
711 return false;
712 }
713
714 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
715 talloc_free(r);
716 return false;
717 }
718
719 pull = ndr_pull_init_blob(&blob, r, NULL);
720 if (pull == NULL) {
721 talloc_free(r);
722 return false;
723 }
724
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;
730 }
731
732 if (DEBUGLEVEL >= 10) {
733 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r);
734 }
735
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;
741 }
742
743 r->out.result = _eventlog_OpenBackupEventLogW(p, r);
744
745 if (p->rng_fault_state) {
746 talloc_free(r);
747 /* Return true here, srv_pipe_hnd.c will take care */
748 return true;
749 }
750
751 if (DEBUGLEVEL >= 10) {
752 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r);
753 }
754
755 push = ndr_push_init_ctx(r, NULL);
756 if (push == NULL) {
757 talloc_free(r);
758 return false;
759 }
760
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;
765 }
766
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;
771 }
772
773 talloc_free(r);
774
775 return true;
776}
777
778static bool api_eventlog_ReadEventLogW(pipes_struct *p)
779{
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;
786
787 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW];
788
789 r = talloc(talloc_tos(), struct eventlog_ReadEventLogW);
790 if (r == NULL) {
791 return false;
792 }
793
794 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
795 talloc_free(r);
796 return false;
797 }
798
799 pull = ndr_pull_init_blob(&blob, r, NULL);
800 if (pull == NULL) {
801 talloc_free(r);
802 return false;
803 }
804
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;
810 }
811
812 if (DEBUGLEVEL >= 10) {
813 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, r);
814 }
815
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;
821 }
822
823 r->out.sent_size = talloc_zero(r, uint32_t);
824 if (r->out.sent_size == NULL) {
825 talloc_free(r);
826 return false;
827 }
828
829 r->out.real_size = talloc_zero(r, uint32_t);
830 if (r->out.real_size == NULL) {
831 talloc_free(r);
832 return false;
833 }
834
835 r->out.result = _eventlog_ReadEventLogW(p, r);
836
837 if (p->rng_fault_state) {
838 talloc_free(r);
839 /* Return true here, srv_pipe_hnd.c will take care */
840 return true;
841 }
842
843 if (DEBUGLEVEL >= 10) {
844 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r);
845 }
846
847 push = ndr_push_init_ctx(r, NULL);
848 if (push == NULL) {
849 talloc_free(r);
850 return false;
851 }
852
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;
857 }
858
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;
863 }
864
865 talloc_free(r);
866
867 return true;
868}
869
870static bool api_eventlog_ReportEventW(pipes_struct *p)
871{
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;
878
879 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW];
880
881 r = talloc(talloc_tos(), struct eventlog_ReportEventW);
882 if (r == NULL) {
883 return false;
884 }
885
886 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
887 talloc_free(r);
888 return false;
889 }
890
891 pull = ndr_pull_init_blob(&blob, r, NULL);
892 if (pull == NULL) {
893 talloc_free(r);
894 return false;
895 }
896
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;
902 }
903
904 if (DEBUGLEVEL >= 10) {
905 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r);
906 }
907
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);
912
913 if (p->rng_fault_state) {
914 talloc_free(r);
915 /* Return true here, srv_pipe_hnd.c will take care */
916 return true;
917 }
918
919 if (DEBUGLEVEL >= 10) {
920 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r);
921 }
922
923 push = ndr_push_init_ctx(r, NULL);
924 if (push == NULL) {
925 talloc_free(r);
926 return false;
927 }
928
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;
933 }
934
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;
939 }
940
941 talloc_free(r);
942
943 return true;
944}
945
946static bool api_eventlog_ClearEventLogA(pipes_struct *p)
947{
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;
954
955 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA];
956
957 r = talloc(talloc_tos(), struct eventlog_ClearEventLogA);
958 if (r == NULL) {
959 return false;
960 }
961
962 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
963 talloc_free(r);
964 return false;
965 }
966
967 pull = ndr_pull_init_blob(&blob, r, NULL);
968 if (pull == NULL) {
969 talloc_free(r);
970 return false;
971 }
972
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;
978 }
979
980 if (DEBUGLEVEL >= 10) {
981 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, r);
982 }
983
984 r->out.result = _eventlog_ClearEventLogA(p, r);
985
986 if (p->rng_fault_state) {
987 talloc_free(r);
988 /* Return true here, srv_pipe_hnd.c will take care */
989 return true;
990 }
991
992 if (DEBUGLEVEL >= 10) {
993 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r);
994 }
995
996 push = ndr_push_init_ctx(r, NULL);
997 if (push == NULL) {
998 talloc_free(r);
999 return false;
1000 }
1001
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;
1006 }
1007
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;
1012 }
1013
1014 talloc_free(r);
1015
1016 return true;
1017}
1018
1019static bool api_eventlog_BackupEventLogA(pipes_struct *p)
1020{
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;
1027
1028 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA];
1029
1030 r = talloc(talloc_tos(), struct eventlog_BackupEventLogA);
1031 if (r == NULL) {
1032 return false;
1033 }
1034
1035 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1036 talloc_free(r);
1037 return false;
1038 }
1039
1040 pull = ndr_pull_init_blob(&blob, r, NULL);
1041 if (pull == NULL) {
1042 talloc_free(r);
1043 return false;
1044 }
1045
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;
1051 }
1052
1053 if (DEBUGLEVEL >= 10) {
1054 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, r);
1055 }
1056
1057 r->out.result = _eventlog_BackupEventLogA(p, r);
1058
1059 if (p->rng_fault_state) {
1060 talloc_free(r);
1061 /* Return true here, srv_pipe_hnd.c will take care */
1062 return true;
1063 }
1064
1065 if (DEBUGLEVEL >= 10) {
1066 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r);
1067 }
1068
1069 push = ndr_push_init_ctx(r, NULL);
1070 if (push == NULL) {
1071 talloc_free(r);
1072 return false;
1073 }
1074
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;
1079 }
1080
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;
1085 }
1086
1087 talloc_free(r);
1088
1089 return true;
1090}
1091
1092static bool api_eventlog_OpenEventLogA(pipes_struct *p)
1093{
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;
1100
1101 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA];
1102
1103 r = talloc(talloc_tos(), struct eventlog_OpenEventLogA);
1104 if (r == NULL) {
1105 return false;
1106 }
1107
1108 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1109 talloc_free(r);
1110 return false;
1111 }
1112
1113 pull = ndr_pull_init_blob(&blob, r, NULL);
1114 if (pull == NULL) {
1115 talloc_free(r);
1116 return false;
1117 }
1118
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;
1124 }
1125
1126 if (DEBUGLEVEL >= 10) {
1127 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, r);
1128 }
1129
1130 r->out.result = _eventlog_OpenEventLogA(p, r);
1131
1132 if (p->rng_fault_state) {
1133 talloc_free(r);
1134 /* Return true here, srv_pipe_hnd.c will take care */
1135 return true;
1136 }
1137
1138 if (DEBUGLEVEL >= 10) {
1139 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r);
1140 }
1141
1142 push = ndr_push_init_ctx(r, NULL);
1143 if (push == NULL) {
1144 talloc_free(r);
1145 return false;
1146 }
1147
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;
1152 }
1153
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;
1158 }
1159
1160 talloc_free(r);
1161
1162 return true;
1163}
1164
1165static bool api_eventlog_RegisterEventSourceA(pipes_struct *p)
1166{
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;
1173
1174 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA];
1175
1176 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA);
1177 if (r == NULL) {
1178 return false;
1179 }
1180
1181 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1182 talloc_free(r);
1183 return false;
1184 }
1185
1186 pull = ndr_pull_init_blob(&blob, r, NULL);
1187 if (pull == NULL) {
1188 talloc_free(r);
1189 return false;
1190 }
1191
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;
1197 }
1198
1199 if (DEBUGLEVEL >= 10) {
1200 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, r);
1201 }
1202
1203 r->out.result = _eventlog_RegisterEventSourceA(p, r);
1204
1205 if (p->rng_fault_state) {
1206 talloc_free(r);
1207 /* Return true here, srv_pipe_hnd.c will take care */
1208 return true;
1209 }
1210
1211 if (DEBUGLEVEL >= 10) {
1212 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r);
1213 }
1214
1215 push = ndr_push_init_ctx(r, NULL);
1216 if (push == NULL) {
1217 talloc_free(r);
1218 return false;
1219 }
1220
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;
1225 }
1226
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;
1231 }
1232
1233 talloc_free(r);
1234
1235 return true;
1236}
1237
1238static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p)
1239{
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;
1246
1247 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA];
1248
1249 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA);
1250 if (r == NULL) {
1251 return false;
1252 }
1253
1254 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1255 talloc_free(r);
1256 return false;
1257 }
1258
1259 pull = ndr_pull_init_blob(&blob, r, NULL);
1260 if (pull == NULL) {
1261 talloc_free(r);
1262 return false;
1263 }
1264
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;
1270 }
1271
1272 if (DEBUGLEVEL >= 10) {
1273 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, r);
1274 }
1275
1276 r->out.result = _eventlog_OpenBackupEventLogA(p, r);
1277
1278 if (p->rng_fault_state) {
1279 talloc_free(r);
1280 /* Return true here, srv_pipe_hnd.c will take care */
1281 return true;
1282 }
1283
1284 if (DEBUGLEVEL >= 10) {
1285 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r);
1286 }
1287
1288 push = ndr_push_init_ctx(r, NULL);
1289 if (push == NULL) {
1290 talloc_free(r);
1291 return false;
1292 }
1293
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;
1298 }
1299
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;
1304 }
1305
1306 talloc_free(r);
1307
1308 return true;
1309}
1310
1311static bool api_eventlog_ReadEventLogA(pipes_struct *p)
1312{
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;
1319
1320 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA];
1321
1322 r = talloc(talloc_tos(), struct eventlog_ReadEventLogA);
1323 if (r == NULL) {
1324 return false;
1325 }
1326
1327 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1328 talloc_free(r);
1329 return false;
1330 }
1331
1332 pull = ndr_pull_init_blob(&blob, r, NULL);
1333 if (pull == NULL) {
1334 talloc_free(r);
1335 return false;
1336 }
1337
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;
1343 }
1344
1345 if (DEBUGLEVEL >= 10) {
1346 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, r);
1347 }
1348
1349 r->out.result = _eventlog_ReadEventLogA(p, r);
1350
1351 if (p->rng_fault_state) {
1352 talloc_free(r);
1353 /* Return true here, srv_pipe_hnd.c will take care */
1354 return true;
1355 }
1356
1357 if (DEBUGLEVEL >= 10) {
1358 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r);
1359 }
1360
1361 push = ndr_push_init_ctx(r, NULL);
1362 if (push == NULL) {
1363 talloc_free(r);
1364 return false;
1365 }
1366
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;
1371 }
1372
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;
1377 }
1378
1379 talloc_free(r);
1380
1381 return true;
1382}
1383
1384static bool api_eventlog_ReportEventA(pipes_struct *p)
1385{
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;
1392
1393 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA];
1394
1395 r = talloc(talloc_tos(), struct eventlog_ReportEventA);
1396 if (r == NULL) {
1397 return false;
1398 }
1399
1400 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1401 talloc_free(r);
1402 return false;
1403 }
1404
1405 pull = ndr_pull_init_blob(&blob, r, NULL);
1406 if (pull == NULL) {
1407 talloc_free(r);
1408 return false;
1409 }
1410
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;
1416 }
1417
1418 if (DEBUGLEVEL >= 10) {
1419 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, r);
1420 }
1421
1422 r->out.result = _eventlog_ReportEventA(p, r);
1423
1424 if (p->rng_fault_state) {
1425 talloc_free(r);
1426 /* Return true here, srv_pipe_hnd.c will take care */
1427 return true;
1428 }
1429
1430 if (DEBUGLEVEL >= 10) {
1431 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r);
1432 }
1433
1434 push = ndr_push_init_ctx(r, NULL);
1435 if (push == NULL) {
1436 talloc_free(r);
1437 return false;
1438 }
1439
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;
1444 }
1445
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;
1450 }
1451
1452 talloc_free(r);
1453
1454 return true;
1455}
1456
1457static bool api_eventlog_RegisterClusterSvc(pipes_struct *p)
1458{
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;
1465
1466 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC];
1467
1468 r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc);
1469 if (r == NULL) {
1470 return false;
1471 }
1472
1473 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1474 talloc_free(r);
1475 return false;
1476 }
1477
1478 pull = ndr_pull_init_blob(&blob, r, NULL);
1479 if (pull == NULL) {
1480 talloc_free(r);
1481 return false;
1482 }
1483
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;
1489 }
1490
1491 if (DEBUGLEVEL >= 10) {
1492 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, r);
1493 }
1494
1495 r->out.result = _eventlog_RegisterClusterSvc(p, r);
1496
1497 if (p->rng_fault_state) {
1498 talloc_free(r);
1499 /* Return true here, srv_pipe_hnd.c will take care */
1500 return true;
1501 }
1502
1503 if (DEBUGLEVEL >= 10) {
1504 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r);
1505 }
1506
1507 push = ndr_push_init_ctx(r, NULL);
1508 if (push == NULL) {
1509 talloc_free(r);
1510 return false;
1511 }
1512
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;
1517 }
1518
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;
1523 }
1524
1525 talloc_free(r);
1526
1527 return true;
1528}
1529
1530static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p)
1531{
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;
1538
1539 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC];
1540
1541 r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc);
1542 if (r == NULL) {
1543 return false;
1544 }
1545
1546 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1547 talloc_free(r);
1548 return false;
1549 }
1550
1551 pull = ndr_pull_init_blob(&blob, r, NULL);
1552 if (pull == NULL) {
1553 talloc_free(r);
1554 return false;
1555 }
1556
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;
1562 }
1563
1564 if (DEBUGLEVEL >= 10) {
1565 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, r);
1566 }
1567
1568 r->out.result = _eventlog_DeregisterClusterSvc(p, r);
1569
1570 if (p->rng_fault_state) {
1571 talloc_free(r);
1572 /* Return true here, srv_pipe_hnd.c will take care */
1573 return true;
1574 }
1575
1576 if (DEBUGLEVEL >= 10) {
1577 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r);
1578 }
1579
1580 push = ndr_push_init_ctx(r, NULL);
1581 if (push == NULL) {
1582 talloc_free(r);
1583 return false;
1584 }
1585
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;
1590 }
1591
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;
1596 }
1597
1598 talloc_free(r);
1599
1600 return true;
1601}
1602
1603static bool api_eventlog_WriteClusterEvents(pipes_struct *p)
1604{
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;
1611
1612 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS];
1613
1614 r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents);
1615 if (r == NULL) {
1616 return false;
1617 }
1618
1619 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1620 talloc_free(r);
1621 return false;
1622 }
1623
1624 pull = ndr_pull_init_blob(&blob, r, NULL);
1625 if (pull == NULL) {
1626 talloc_free(r);
1627 return false;
1628 }
1629
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;
1635 }
1636
1637 if (DEBUGLEVEL >= 10) {
1638 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, r);
1639 }
1640
1641 r->out.result = _eventlog_WriteClusterEvents(p, r);
1642
1643 if (p->rng_fault_state) {
1644 talloc_free(r);
1645 /* Return true here, srv_pipe_hnd.c will take care */
1646 return true;
1647 }
1648
1649 if (DEBUGLEVEL >= 10) {
1650 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r);
1651 }
1652
1653 push = ndr_push_init_ctx(r, NULL);
1654 if (push == NULL) {
1655 talloc_free(r);
1656 return false;
1657 }
1658
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;
1663 }
1664
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;
1669 }
1670
1671 talloc_free(r);
1672
1673 return true;
1674}
1675
1676static bool api_eventlog_GetLogInformation(pipes_struct *p)
1677{
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;
1684
1685 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINFORMATION];
1686
1687 r = talloc(talloc_tos(), struct eventlog_GetLogInformation);
1688 if (r == NULL) {
1689 return false;
1690 }
1691
1692 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1693 talloc_free(r);
1694 return false;
1695 }
1696
1697 pull = ndr_pull_init_blob(&blob, r, NULL);
1698 if (pull == NULL) {
1699 talloc_free(r);
1700 return false;
1701 }
1702
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;
1708 }
1709
1710 if (DEBUGLEVEL >= 10) {
1711 NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, r);
1712 }
1713
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;
1719 }
1720
1721 r->out.bytes_needed = talloc_zero(r, uint32_t);
1722 if (r->out.bytes_needed == NULL) {
1723 talloc_free(r);
1724 return false;
1725 }
1726
1727 r->out.result = _eventlog_GetLogInformation(p, r);
1728
1729 if (p->rng_fault_state) {
1730 talloc_free(r);
1731 /* Return true here, srv_pipe_hnd.c will take care */
1732 return true;
1733 }
1734
1735 if (DEBUGLEVEL >= 10) {
1736 NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, r);
1737 }
1738
1739 push = ndr_push_init_ctx(r, NULL);
1740 if (push == NULL) {
1741 talloc_free(r);
1742 return false;
1743 }
1744
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;
1749 }
1750
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;
1755 }
1756
1757 talloc_free(r);
1758
1759 return true;
1760}
1761
1762static bool api_eventlog_FlushEventLog(pipes_struct *p)
1763{
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;
1770
1771 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG];
1772
1773 r = talloc(talloc_tos(), struct eventlog_FlushEventLog);
1774 if (r == NULL) {
1775 return false;
1776 }
1777
1778 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1779 talloc_free(r);
1780 return false;
1781 }
1782
1783 pull = ndr_pull_init_blob(&blob, r, NULL);
1784 if (pull == NULL) {
1785 talloc_free(r);
1786 return false;
1787 }
1788
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;
1794 }
1795
1796 if (DEBUGLEVEL >= 10) {
1797 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, r);
1798 }
1799
1800 r->out.result = _eventlog_FlushEventLog(p, r);
1801
1802 if (p->rng_fault_state) {
1803 talloc_free(r);
1804 /* Return true here, srv_pipe_hnd.c will take care */
1805 return true;
1806 }
1807
1808 if (DEBUGLEVEL >= 10) {
1809 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r);
1810 }
1811
1812 push = ndr_push_init_ctx(r, NULL);
1813 if (push == NULL) {
1814 talloc_free(r);
1815 return false;
1816 }
1817
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;
1822 }
1823
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;
1828 }
1829
1830 talloc_free(r);
1831
1832 return true;
1833}
1834
1835static bool api_eventlog_ReportEventAndSourceW(pipes_struct *p)
1836{
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;
1843
1844 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTANDSOURCEW];
1845
1846 r = talloc(talloc_tos(), struct eventlog_ReportEventAndSourceW);
1847 if (r == NULL) {
1848 return false;
1849 }
1850
1851 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1852 talloc_free(r);
1853 return false;
1854 }
1855
1856 pull = ndr_pull_init_blob(&blob, r, NULL);
1857 if (pull == NULL) {
1858 talloc_free(r);
1859 return false;
1860 }
1861
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;
1867 }
1868
1869 if (DEBUGLEVEL >= 10) {
1870 NDR_PRINT_IN_DEBUG(eventlog_ReportEventAndSourceW, r);
1871 }
1872
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);
1877
1878 if (p->rng_fault_state) {
1879 talloc_free(r);
1880 /* Return true here, srv_pipe_hnd.c will take care */
1881 return true;
1882 }
1883
1884 if (DEBUGLEVEL >= 10) {
1885 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventAndSourceW, r);
1886 }
1887
1888 push = ndr_push_init_ctx(r, NULL);
1889 if (push == NULL) {
1890 talloc_free(r);
1891 return false;
1892 }
1893
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;
1898 }
1899
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;
1904 }
1905
1906 talloc_free(r);
1907
1908 return true;
1909}
1910
1911
1912/* Tables */
1913static struct api_struct api_eventlog_cmds[] =
1914{
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},
1940};
1941
1942void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
1943{
1944 *fns = api_eventlog_cmds;
1945 *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct);
1946}
1947
1948NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
1949{
1950 if (cli->pipes_struct == NULL) {
1951 return NT_STATUS_INVALID_PARAMETER;
1952 }
1953
1954 switch (opnum)
1955 {
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;
1960 }
1961
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;
1966 }
1967
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;
1974 }
1975
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;
1982 }
1983
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;
1990 }
1991
1992 r->out.result = _eventlog_GetNumRecords(cli->pipes_struct, r);
1993 return NT_STATUS_OK;
1994 }
1995
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;
2002 }
2003
2004 r->out.result = _eventlog_GetOldestRecord(cli->pipes_struct, r);
2005 return NT_STATUS_OK;
2006 }
2007
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;
2012 }
2013
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;
2020 }
2021
2022 r->out.result = _eventlog_OpenEventLogW(cli->pipes_struct, r);
2023 return NT_STATUS_OK;
2024 }
2025
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;
2032 }
2033
2034 r->out.result = _eventlog_RegisterEventSourceW(cli->pipes_struct, r);
2035 return NT_STATUS_OK;
2036 }
2037
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;
2044 }
2045
2046 r->out.result = _eventlog_OpenBackupEventLogW(cli->pipes_struct, r);
2047 return NT_STATUS_OK;
2048 }
2049
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;
2056 }
2057
2058 r->out.sent_size = talloc_zero(mem_ctx, uint32_t);
2059 if (r->out.sent_size == NULL) {
2060 return NT_STATUS_NO_MEMORY;
2061 }
2062
2063 r->out.real_size = talloc_zero(mem_ctx, uint32_t);
2064 if (r->out.real_size == NULL) {
2065 return NT_STATUS_NO_MEMORY;
2066 }
2067
2068 r->out.result = _eventlog_ReadEventLogW(cli->pipes_struct, r);
2069 return NT_STATUS_OK;
2070 }
2071
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;
2079 }
2080
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;
2085 }
2086
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;
2091 }
2092
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;
2097 }
2098
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;
2103 }
2104
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;
2109 }
2110
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;
2115 }
2116
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;
2121 }
2122
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;
2127 }
2128
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;
2133 }
2134
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;
2139 }
2140
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;
2147 }
2148
2149 r->out.bytes_needed = talloc_zero(mem_ctx, uint32_t);
2150 if (r->out.bytes_needed == NULL) {
2151 return NT_STATUS_NO_MEMORY;
2152 }
2153
2154 r->out.result = _eventlog_GetLogInformation(cli->pipes_struct, r);
2155 return NT_STATUS_OK;
2156 }
2157
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;
2162 }
2163
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;
2171 }
2172
2173 default:
2174 return NT_STATUS_NOT_IMPLEMENTED;
2175 }
2176}
2177
2178NTSTATUS rpc_eventlog_init(void)
2179{
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));
2181}
Note: See TracBrowser for help on using the repository browser.