source: branches/samba-3.2.x/source/librpc/gen_ndr/srv_eventlog.c@ 553

Last change on this file since 553 was 133, checked in by Paul Smedley, 18 years ago

Update trunk to 3.2.0pre3

File size: 38.5 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);
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);
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);
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);
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);
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);
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);
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 r->out.result = _eventlog_DeregisterEventSource(p, r);
269
270 if (p->rng_fault_state) {
271 talloc_free(r);
272 /* Return true here, srv_pipe_hnd.c will take care */
273 return true;
274 }
275
276 if (DEBUGLEVEL >= 10) {
277 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterEventSource, r);
278 }
279
280 push = ndr_push_init_ctx(r);
281 if (push == NULL) {
282 talloc_free(r);
283 return false;
284 }
285
286 ndr_err = call->ndr_push(push, NDR_OUT, r);
287 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
288 talloc_free(r);
289 return false;
290 }
291
292 blob = ndr_push_blob(push);
293 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
294 talloc_free(r);
295 return false;
296 }
297
298 talloc_free(r);
299
300 return true;
301}
302
303static bool api_eventlog_GetNumRecords(pipes_struct *p)
304{
305 const struct ndr_interface_call *call;
306 struct ndr_pull *pull;
307 struct ndr_push *push;
308 enum ndr_err_code ndr_err;
309 DATA_BLOB blob;
310 struct eventlog_GetNumRecords *r;
311
312 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETNUMRECORDS];
313
314 r = talloc(talloc_tos(), struct eventlog_GetNumRecords);
315 if (r == NULL) {
316 return false;
317 }
318
319 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
320 talloc_free(r);
321 return false;
322 }
323
324 pull = ndr_pull_init_blob(&blob, r);
325 if (pull == NULL) {
326 talloc_free(r);
327 return false;
328 }
329
330 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
331 ndr_err = call->ndr_pull(pull, NDR_IN, r);
332 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
333 talloc_free(r);
334 return false;
335 }
336
337 if (DEBUGLEVEL >= 10) {
338 NDR_PRINT_IN_DEBUG(eventlog_GetNumRecords, r);
339 }
340
341 ZERO_STRUCT(r->out);
342 r->out.number = talloc_zero(r, uint32_t);
343 if (r->out.number == NULL) {
344 talloc_free(r);
345 return false;
346 }
347
348 r->out.result = _eventlog_GetNumRecords(p, r);
349
350 if (p->rng_fault_state) {
351 talloc_free(r);
352 /* Return true here, srv_pipe_hnd.c will take care */
353 return true;
354 }
355
356 if (DEBUGLEVEL >= 10) {
357 NDR_PRINT_OUT_DEBUG(eventlog_GetNumRecords, r);
358 }
359
360 push = ndr_push_init_ctx(r);
361 if (push == NULL) {
362 talloc_free(r);
363 return false;
364 }
365
366 ndr_err = call->ndr_push(push, NDR_OUT, r);
367 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
368 talloc_free(r);
369 return false;
370 }
371
372 blob = ndr_push_blob(push);
373 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
374 talloc_free(r);
375 return false;
376 }
377
378 talloc_free(r);
379
380 return true;
381}
382
383static bool api_eventlog_GetOldestRecord(pipes_struct *p)
384{
385 const struct ndr_interface_call *call;
386 struct ndr_pull *pull;
387 struct ndr_push *push;
388 enum ndr_err_code ndr_err;
389 DATA_BLOB blob;
390 struct eventlog_GetOldestRecord *r;
391
392 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETOLDESTRECORD];
393
394 r = talloc(talloc_tos(), struct eventlog_GetOldestRecord);
395 if (r == NULL) {
396 return false;
397 }
398
399 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
400 talloc_free(r);
401 return false;
402 }
403
404 pull = ndr_pull_init_blob(&blob, r);
405 if (pull == NULL) {
406 talloc_free(r);
407 return false;
408 }
409
410 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
411 ndr_err = call->ndr_pull(pull, NDR_IN, r);
412 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
413 talloc_free(r);
414 return false;
415 }
416
417 if (DEBUGLEVEL >= 10) {
418 NDR_PRINT_IN_DEBUG(eventlog_GetOldestRecord, r);
419 }
420
421 ZERO_STRUCT(r->out);
422 r->out.oldest_entry = talloc_zero(r, uint32_t);
423 if (r->out.oldest_entry == NULL) {
424 talloc_free(r);
425 return false;
426 }
427
428 r->out.result = _eventlog_GetOldestRecord(p, r);
429
430 if (p->rng_fault_state) {
431 talloc_free(r);
432 /* Return true here, srv_pipe_hnd.c will take care */
433 return true;
434 }
435
436 if (DEBUGLEVEL >= 10) {
437 NDR_PRINT_OUT_DEBUG(eventlog_GetOldestRecord, r);
438 }
439
440 push = ndr_push_init_ctx(r);
441 if (push == NULL) {
442 talloc_free(r);
443 return false;
444 }
445
446 ndr_err = call->ndr_push(push, NDR_OUT, r);
447 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
448 talloc_free(r);
449 return false;
450 }
451
452 blob = ndr_push_blob(push);
453 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
454 talloc_free(r);
455 return false;
456 }
457
458 talloc_free(r);
459
460 return true;
461}
462
463static bool api_eventlog_ChangeNotify(pipes_struct *p)
464{
465 const struct ndr_interface_call *call;
466 struct ndr_pull *pull;
467 struct ndr_push *push;
468 enum ndr_err_code ndr_err;
469 DATA_BLOB blob;
470 struct eventlog_ChangeNotify *r;
471
472 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CHANGENOTIFY];
473
474 r = talloc(talloc_tos(), struct eventlog_ChangeNotify);
475 if (r == NULL) {
476 return false;
477 }
478
479 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
480 talloc_free(r);
481 return false;
482 }
483
484 pull = ndr_pull_init_blob(&blob, r);
485 if (pull == NULL) {
486 talloc_free(r);
487 return false;
488 }
489
490 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
491 ndr_err = call->ndr_pull(pull, NDR_IN, r);
492 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
493 talloc_free(r);
494 return false;
495 }
496
497 if (DEBUGLEVEL >= 10) {
498 NDR_PRINT_IN_DEBUG(eventlog_ChangeNotify, r);
499 }
500
501 r->out.result = _eventlog_ChangeNotify(p, r);
502
503 if (p->rng_fault_state) {
504 talloc_free(r);
505 /* Return true here, srv_pipe_hnd.c will take care */
506 return true;
507 }
508
509 if (DEBUGLEVEL >= 10) {
510 NDR_PRINT_OUT_DEBUG(eventlog_ChangeNotify, r);
511 }
512
513 push = ndr_push_init_ctx(r);
514 if (push == NULL) {
515 talloc_free(r);
516 return false;
517 }
518
519 ndr_err = call->ndr_push(push, NDR_OUT, r);
520 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
521 talloc_free(r);
522 return false;
523 }
524
525 blob = ndr_push_blob(push);
526 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
527 talloc_free(r);
528 return false;
529 }
530
531 talloc_free(r);
532
533 return true;
534}
535
536static bool api_eventlog_OpenEventLogW(pipes_struct *p)
537{
538 const struct ndr_interface_call *call;
539 struct ndr_pull *pull;
540 struct ndr_push *push;
541 enum ndr_err_code ndr_err;
542 DATA_BLOB blob;
543 struct eventlog_OpenEventLogW *r;
544
545 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGW];
546
547 r = talloc(talloc_tos(), struct eventlog_OpenEventLogW);
548 if (r == NULL) {
549 return false;
550 }
551
552 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
553 talloc_free(r);
554 return false;
555 }
556
557 pull = ndr_pull_init_blob(&blob, r);
558 if (pull == NULL) {
559 talloc_free(r);
560 return false;
561 }
562
563 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
564 ndr_err = call->ndr_pull(pull, NDR_IN, r);
565 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
566 talloc_free(r);
567 return false;
568 }
569
570 if (DEBUGLEVEL >= 10) {
571 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogW, r);
572 }
573
574 ZERO_STRUCT(r->out);
575 r->out.handle = talloc_zero(r, struct policy_handle);
576 if (r->out.handle == NULL) {
577 talloc_free(r);
578 return false;
579 }
580
581 r->out.result = _eventlog_OpenEventLogW(p, r);
582
583 if (p->rng_fault_state) {
584 talloc_free(r);
585 /* Return true here, srv_pipe_hnd.c will take care */
586 return true;
587 }
588
589 if (DEBUGLEVEL >= 10) {
590 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogW, r);
591 }
592
593 push = ndr_push_init_ctx(r);
594 if (push == NULL) {
595 talloc_free(r);
596 return false;
597 }
598
599 ndr_err = call->ndr_push(push, NDR_OUT, r);
600 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
601 talloc_free(r);
602 return false;
603 }
604
605 blob = ndr_push_blob(push);
606 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
607 talloc_free(r);
608 return false;
609 }
610
611 talloc_free(r);
612
613 return true;
614}
615
616static bool api_eventlog_RegisterEventSourceW(pipes_struct *p)
617{
618 const struct ndr_interface_call *call;
619 struct ndr_pull *pull;
620 struct ndr_push *push;
621 enum ndr_err_code ndr_err;
622 DATA_BLOB blob;
623 struct eventlog_RegisterEventSourceW *r;
624
625 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEW];
626
627 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceW);
628 if (r == NULL) {
629 return false;
630 }
631
632 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
633 talloc_free(r);
634 return false;
635 }
636
637 pull = ndr_pull_init_blob(&blob, r);
638 if (pull == NULL) {
639 talloc_free(r);
640 return false;
641 }
642
643 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
644 ndr_err = call->ndr_pull(pull, NDR_IN, r);
645 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
646 talloc_free(r);
647 return false;
648 }
649
650 if (DEBUGLEVEL >= 10) {
651 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceW, r);
652 }
653
654 r->out.result = _eventlog_RegisterEventSourceW(p, r);
655
656 if (p->rng_fault_state) {
657 talloc_free(r);
658 /* Return true here, srv_pipe_hnd.c will take care */
659 return true;
660 }
661
662 if (DEBUGLEVEL >= 10) {
663 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceW, r);
664 }
665
666 push = ndr_push_init_ctx(r);
667 if (push == NULL) {
668 talloc_free(r);
669 return false;
670 }
671
672 ndr_err = call->ndr_push(push, NDR_OUT, r);
673 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
674 talloc_free(r);
675 return false;
676 }
677
678 blob = ndr_push_blob(push);
679 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
680 talloc_free(r);
681 return false;
682 }
683
684 talloc_free(r);
685
686 return true;
687}
688
689static bool api_eventlog_OpenBackupEventLogW(pipes_struct *p)
690{
691 const struct ndr_interface_call *call;
692 struct ndr_pull *pull;
693 struct ndr_push *push;
694 enum ndr_err_code ndr_err;
695 DATA_BLOB blob;
696 struct eventlog_OpenBackupEventLogW *r;
697
698 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGW];
699
700 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogW);
701 if (r == NULL) {
702 return false;
703 }
704
705 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
706 talloc_free(r);
707 return false;
708 }
709
710 pull = ndr_pull_init_blob(&blob, r);
711 if (pull == NULL) {
712 talloc_free(r);
713 return false;
714 }
715
716 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
717 ndr_err = call->ndr_pull(pull, NDR_IN, r);
718 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
719 talloc_free(r);
720 return false;
721 }
722
723 if (DEBUGLEVEL >= 10) {
724 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogW, r);
725 }
726
727 r->out.result = _eventlog_OpenBackupEventLogW(p, r);
728
729 if (p->rng_fault_state) {
730 talloc_free(r);
731 /* Return true here, srv_pipe_hnd.c will take care */
732 return true;
733 }
734
735 if (DEBUGLEVEL >= 10) {
736 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogW, r);
737 }
738
739 push = ndr_push_init_ctx(r);
740 if (push == NULL) {
741 talloc_free(r);
742 return false;
743 }
744
745 ndr_err = call->ndr_push(push, NDR_OUT, r);
746 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
747 talloc_free(r);
748 return false;
749 }
750
751 blob = ndr_push_blob(push);
752 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
753 talloc_free(r);
754 return false;
755 }
756
757 talloc_free(r);
758
759 return true;
760}
761
762static bool api_eventlog_ReadEventLogW(pipes_struct *p)
763{
764 const struct ndr_interface_call *call;
765 struct ndr_pull *pull;
766 struct ndr_push *push;
767 enum ndr_err_code ndr_err;
768 DATA_BLOB blob;
769 struct eventlog_ReadEventLogW *r;
770
771 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGW];
772
773 r = talloc(talloc_tos(), struct eventlog_ReadEventLogW);
774 if (r == NULL) {
775 return false;
776 }
777
778 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
779 talloc_free(r);
780 return false;
781 }
782
783 pull = ndr_pull_init_blob(&blob, r);
784 if (pull == NULL) {
785 talloc_free(r);
786 return false;
787 }
788
789 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
790 ndr_err = call->ndr_pull(pull, NDR_IN, r);
791 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
792 talloc_free(r);
793 return false;
794 }
795
796 if (DEBUGLEVEL >= 10) {
797 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogW, r);
798 }
799
800 ZERO_STRUCT(r->out);
801 r->out.data = talloc_zero_array(r, uint8_t, r->in.number_of_bytes);
802 if (r->out.data == NULL) {
803 talloc_free(r);
804 return false;
805 }
806
807 r->out.sent_size = talloc_zero(r, uint32_t);
808 if (r->out.sent_size == NULL) {
809 talloc_free(r);
810 return false;
811 }
812
813 r->out.real_size = talloc_zero(r, uint32_t);
814 if (r->out.real_size == NULL) {
815 talloc_free(r);
816 return false;
817 }
818
819 r->out.result = _eventlog_ReadEventLogW(p, r);
820
821 if (p->rng_fault_state) {
822 talloc_free(r);
823 /* Return true here, srv_pipe_hnd.c will take care */
824 return true;
825 }
826
827 if (DEBUGLEVEL >= 10) {
828 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogW, r);
829 }
830
831 push = ndr_push_init_ctx(r);
832 if (push == NULL) {
833 talloc_free(r);
834 return false;
835 }
836
837 ndr_err = call->ndr_push(push, NDR_OUT, r);
838 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
839 talloc_free(r);
840 return false;
841 }
842
843 blob = ndr_push_blob(push);
844 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
845 talloc_free(r);
846 return false;
847 }
848
849 talloc_free(r);
850
851 return true;
852}
853
854static bool api_eventlog_ReportEventW(pipes_struct *p)
855{
856 const struct ndr_interface_call *call;
857 struct ndr_pull *pull;
858 struct ndr_push *push;
859 enum ndr_err_code ndr_err;
860 DATA_BLOB blob;
861 struct eventlog_ReportEventW *r;
862
863 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTW];
864
865 r = talloc(talloc_tos(), struct eventlog_ReportEventW);
866 if (r == NULL) {
867 return false;
868 }
869
870 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
871 talloc_free(r);
872 return false;
873 }
874
875 pull = ndr_pull_init_blob(&blob, r);
876 if (pull == NULL) {
877 talloc_free(r);
878 return false;
879 }
880
881 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
882 ndr_err = call->ndr_pull(pull, NDR_IN, r);
883 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
884 talloc_free(r);
885 return false;
886 }
887
888 if (DEBUGLEVEL >= 10) {
889 NDR_PRINT_IN_DEBUG(eventlog_ReportEventW, r);
890 }
891
892 r->out.result = _eventlog_ReportEventW(p, r);
893
894 if (p->rng_fault_state) {
895 talloc_free(r);
896 /* Return true here, srv_pipe_hnd.c will take care */
897 return true;
898 }
899
900 if (DEBUGLEVEL >= 10) {
901 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventW, r);
902 }
903
904 push = ndr_push_init_ctx(r);
905 if (push == NULL) {
906 talloc_free(r);
907 return false;
908 }
909
910 ndr_err = call->ndr_push(push, NDR_OUT, r);
911 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
912 talloc_free(r);
913 return false;
914 }
915
916 blob = ndr_push_blob(push);
917 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
918 talloc_free(r);
919 return false;
920 }
921
922 talloc_free(r);
923
924 return true;
925}
926
927static bool api_eventlog_ClearEventLogA(pipes_struct *p)
928{
929 const struct ndr_interface_call *call;
930 struct ndr_pull *pull;
931 struct ndr_push *push;
932 enum ndr_err_code ndr_err;
933 DATA_BLOB blob;
934 struct eventlog_ClearEventLogA *r;
935
936 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_CLEAREVENTLOGA];
937
938 r = talloc(talloc_tos(), struct eventlog_ClearEventLogA);
939 if (r == NULL) {
940 return false;
941 }
942
943 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
944 talloc_free(r);
945 return false;
946 }
947
948 pull = ndr_pull_init_blob(&blob, r);
949 if (pull == NULL) {
950 talloc_free(r);
951 return false;
952 }
953
954 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
955 ndr_err = call->ndr_pull(pull, NDR_IN, r);
956 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
957 talloc_free(r);
958 return false;
959 }
960
961 if (DEBUGLEVEL >= 10) {
962 NDR_PRINT_IN_DEBUG(eventlog_ClearEventLogA, r);
963 }
964
965 r->out.result = _eventlog_ClearEventLogA(p, r);
966
967 if (p->rng_fault_state) {
968 talloc_free(r);
969 /* Return true here, srv_pipe_hnd.c will take care */
970 return true;
971 }
972
973 if (DEBUGLEVEL >= 10) {
974 NDR_PRINT_OUT_DEBUG(eventlog_ClearEventLogA, r);
975 }
976
977 push = ndr_push_init_ctx(r);
978 if (push == NULL) {
979 talloc_free(r);
980 return false;
981 }
982
983 ndr_err = call->ndr_push(push, NDR_OUT, r);
984 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
985 talloc_free(r);
986 return false;
987 }
988
989 blob = ndr_push_blob(push);
990 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
991 talloc_free(r);
992 return false;
993 }
994
995 talloc_free(r);
996
997 return true;
998}
999
1000static bool api_eventlog_BackupEventLogA(pipes_struct *p)
1001{
1002 const struct ndr_interface_call *call;
1003 struct ndr_pull *pull;
1004 struct ndr_push *push;
1005 enum ndr_err_code ndr_err;
1006 DATA_BLOB blob;
1007 struct eventlog_BackupEventLogA *r;
1008
1009 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_BACKUPEVENTLOGA];
1010
1011 r = talloc(talloc_tos(), struct eventlog_BackupEventLogA);
1012 if (r == NULL) {
1013 return false;
1014 }
1015
1016 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1017 talloc_free(r);
1018 return false;
1019 }
1020
1021 pull = ndr_pull_init_blob(&blob, r);
1022 if (pull == NULL) {
1023 talloc_free(r);
1024 return false;
1025 }
1026
1027 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1028 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1029 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1030 talloc_free(r);
1031 return false;
1032 }
1033
1034 if (DEBUGLEVEL >= 10) {
1035 NDR_PRINT_IN_DEBUG(eventlog_BackupEventLogA, r);
1036 }
1037
1038 r->out.result = _eventlog_BackupEventLogA(p, r);
1039
1040 if (p->rng_fault_state) {
1041 talloc_free(r);
1042 /* Return true here, srv_pipe_hnd.c will take care */
1043 return true;
1044 }
1045
1046 if (DEBUGLEVEL >= 10) {
1047 NDR_PRINT_OUT_DEBUG(eventlog_BackupEventLogA, r);
1048 }
1049
1050 push = ndr_push_init_ctx(r);
1051 if (push == NULL) {
1052 talloc_free(r);
1053 return false;
1054 }
1055
1056 ndr_err = call->ndr_push(push, NDR_OUT, r);
1057 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1058 talloc_free(r);
1059 return false;
1060 }
1061
1062 blob = ndr_push_blob(push);
1063 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1064 talloc_free(r);
1065 return false;
1066 }
1067
1068 talloc_free(r);
1069
1070 return true;
1071}
1072
1073static bool api_eventlog_OpenEventLogA(pipes_struct *p)
1074{
1075 const struct ndr_interface_call *call;
1076 struct ndr_pull *pull;
1077 struct ndr_push *push;
1078 enum ndr_err_code ndr_err;
1079 DATA_BLOB blob;
1080 struct eventlog_OpenEventLogA *r;
1081
1082 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENEVENTLOGA];
1083
1084 r = talloc(talloc_tos(), struct eventlog_OpenEventLogA);
1085 if (r == NULL) {
1086 return false;
1087 }
1088
1089 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1090 talloc_free(r);
1091 return false;
1092 }
1093
1094 pull = ndr_pull_init_blob(&blob, r);
1095 if (pull == NULL) {
1096 talloc_free(r);
1097 return false;
1098 }
1099
1100 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1101 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1102 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1103 talloc_free(r);
1104 return false;
1105 }
1106
1107 if (DEBUGLEVEL >= 10) {
1108 NDR_PRINT_IN_DEBUG(eventlog_OpenEventLogA, r);
1109 }
1110
1111 r->out.result = _eventlog_OpenEventLogA(p, r);
1112
1113 if (p->rng_fault_state) {
1114 talloc_free(r);
1115 /* Return true here, srv_pipe_hnd.c will take care */
1116 return true;
1117 }
1118
1119 if (DEBUGLEVEL >= 10) {
1120 NDR_PRINT_OUT_DEBUG(eventlog_OpenEventLogA, r);
1121 }
1122
1123 push = ndr_push_init_ctx(r);
1124 if (push == NULL) {
1125 talloc_free(r);
1126 return false;
1127 }
1128
1129 ndr_err = call->ndr_push(push, NDR_OUT, r);
1130 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1131 talloc_free(r);
1132 return false;
1133 }
1134
1135 blob = ndr_push_blob(push);
1136 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1137 talloc_free(r);
1138 return false;
1139 }
1140
1141 talloc_free(r);
1142
1143 return true;
1144}
1145
1146static bool api_eventlog_RegisterEventSourceA(pipes_struct *p)
1147{
1148 const struct ndr_interface_call *call;
1149 struct ndr_pull *pull;
1150 struct ndr_push *push;
1151 enum ndr_err_code ndr_err;
1152 DATA_BLOB blob;
1153 struct eventlog_RegisterEventSourceA *r;
1154
1155 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTEREVENTSOURCEA];
1156
1157 r = talloc(talloc_tos(), struct eventlog_RegisterEventSourceA);
1158 if (r == NULL) {
1159 return false;
1160 }
1161
1162 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1163 talloc_free(r);
1164 return false;
1165 }
1166
1167 pull = ndr_pull_init_blob(&blob, r);
1168 if (pull == NULL) {
1169 talloc_free(r);
1170 return false;
1171 }
1172
1173 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1174 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1175 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1176 talloc_free(r);
1177 return false;
1178 }
1179
1180 if (DEBUGLEVEL >= 10) {
1181 NDR_PRINT_IN_DEBUG(eventlog_RegisterEventSourceA, r);
1182 }
1183
1184 r->out.result = _eventlog_RegisterEventSourceA(p, r);
1185
1186 if (p->rng_fault_state) {
1187 talloc_free(r);
1188 /* Return true here, srv_pipe_hnd.c will take care */
1189 return true;
1190 }
1191
1192 if (DEBUGLEVEL >= 10) {
1193 NDR_PRINT_OUT_DEBUG(eventlog_RegisterEventSourceA, r);
1194 }
1195
1196 push = ndr_push_init_ctx(r);
1197 if (push == NULL) {
1198 talloc_free(r);
1199 return false;
1200 }
1201
1202 ndr_err = call->ndr_push(push, NDR_OUT, r);
1203 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1204 talloc_free(r);
1205 return false;
1206 }
1207
1208 blob = ndr_push_blob(push);
1209 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1210 talloc_free(r);
1211 return false;
1212 }
1213
1214 talloc_free(r);
1215
1216 return true;
1217}
1218
1219static bool api_eventlog_OpenBackupEventLogA(pipes_struct *p)
1220{
1221 const struct ndr_interface_call *call;
1222 struct ndr_pull *pull;
1223 struct ndr_push *push;
1224 enum ndr_err_code ndr_err;
1225 DATA_BLOB blob;
1226 struct eventlog_OpenBackupEventLogA *r;
1227
1228 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_OPENBACKUPEVENTLOGA];
1229
1230 r = talloc(talloc_tos(), struct eventlog_OpenBackupEventLogA);
1231 if (r == NULL) {
1232 return false;
1233 }
1234
1235 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1236 talloc_free(r);
1237 return false;
1238 }
1239
1240 pull = ndr_pull_init_blob(&blob, r);
1241 if (pull == NULL) {
1242 talloc_free(r);
1243 return false;
1244 }
1245
1246 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1247 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1248 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1249 talloc_free(r);
1250 return false;
1251 }
1252
1253 if (DEBUGLEVEL >= 10) {
1254 NDR_PRINT_IN_DEBUG(eventlog_OpenBackupEventLogA, r);
1255 }
1256
1257 r->out.result = _eventlog_OpenBackupEventLogA(p, r);
1258
1259 if (p->rng_fault_state) {
1260 talloc_free(r);
1261 /* Return true here, srv_pipe_hnd.c will take care */
1262 return true;
1263 }
1264
1265 if (DEBUGLEVEL >= 10) {
1266 NDR_PRINT_OUT_DEBUG(eventlog_OpenBackupEventLogA, r);
1267 }
1268
1269 push = ndr_push_init_ctx(r);
1270 if (push == NULL) {
1271 talloc_free(r);
1272 return false;
1273 }
1274
1275 ndr_err = call->ndr_push(push, NDR_OUT, r);
1276 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1277 talloc_free(r);
1278 return false;
1279 }
1280
1281 blob = ndr_push_blob(push);
1282 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1283 talloc_free(r);
1284 return false;
1285 }
1286
1287 talloc_free(r);
1288
1289 return true;
1290}
1291
1292static bool api_eventlog_ReadEventLogA(pipes_struct *p)
1293{
1294 const struct ndr_interface_call *call;
1295 struct ndr_pull *pull;
1296 struct ndr_push *push;
1297 enum ndr_err_code ndr_err;
1298 DATA_BLOB blob;
1299 struct eventlog_ReadEventLogA *r;
1300
1301 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_READEVENTLOGA];
1302
1303 r = talloc(talloc_tos(), struct eventlog_ReadEventLogA);
1304 if (r == NULL) {
1305 return false;
1306 }
1307
1308 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1309 talloc_free(r);
1310 return false;
1311 }
1312
1313 pull = ndr_pull_init_blob(&blob, r);
1314 if (pull == NULL) {
1315 talloc_free(r);
1316 return false;
1317 }
1318
1319 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1320 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1321 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1322 talloc_free(r);
1323 return false;
1324 }
1325
1326 if (DEBUGLEVEL >= 10) {
1327 NDR_PRINT_IN_DEBUG(eventlog_ReadEventLogA, r);
1328 }
1329
1330 r->out.result = _eventlog_ReadEventLogA(p, r);
1331
1332 if (p->rng_fault_state) {
1333 talloc_free(r);
1334 /* Return true here, srv_pipe_hnd.c will take care */
1335 return true;
1336 }
1337
1338 if (DEBUGLEVEL >= 10) {
1339 NDR_PRINT_OUT_DEBUG(eventlog_ReadEventLogA, r);
1340 }
1341
1342 push = ndr_push_init_ctx(r);
1343 if (push == NULL) {
1344 talloc_free(r);
1345 return false;
1346 }
1347
1348 ndr_err = call->ndr_push(push, NDR_OUT, r);
1349 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1350 talloc_free(r);
1351 return false;
1352 }
1353
1354 blob = ndr_push_blob(push);
1355 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1356 talloc_free(r);
1357 return false;
1358 }
1359
1360 talloc_free(r);
1361
1362 return true;
1363}
1364
1365static bool api_eventlog_ReportEventA(pipes_struct *p)
1366{
1367 const struct ndr_interface_call *call;
1368 struct ndr_pull *pull;
1369 struct ndr_push *push;
1370 enum ndr_err_code ndr_err;
1371 DATA_BLOB blob;
1372 struct eventlog_ReportEventA *r;
1373
1374 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REPORTEVENTA];
1375
1376 r = talloc(talloc_tos(), struct eventlog_ReportEventA);
1377 if (r == NULL) {
1378 return false;
1379 }
1380
1381 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1382 talloc_free(r);
1383 return false;
1384 }
1385
1386 pull = ndr_pull_init_blob(&blob, r);
1387 if (pull == NULL) {
1388 talloc_free(r);
1389 return false;
1390 }
1391
1392 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1393 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1394 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1395 talloc_free(r);
1396 return false;
1397 }
1398
1399 if (DEBUGLEVEL >= 10) {
1400 NDR_PRINT_IN_DEBUG(eventlog_ReportEventA, r);
1401 }
1402
1403 r->out.result = _eventlog_ReportEventA(p, r);
1404
1405 if (p->rng_fault_state) {
1406 talloc_free(r);
1407 /* Return true here, srv_pipe_hnd.c will take care */
1408 return true;
1409 }
1410
1411 if (DEBUGLEVEL >= 10) {
1412 NDR_PRINT_OUT_DEBUG(eventlog_ReportEventA, r);
1413 }
1414
1415 push = ndr_push_init_ctx(r);
1416 if (push == NULL) {
1417 talloc_free(r);
1418 return false;
1419 }
1420
1421 ndr_err = call->ndr_push(push, NDR_OUT, r);
1422 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1423 talloc_free(r);
1424 return false;
1425 }
1426
1427 blob = ndr_push_blob(push);
1428 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1429 talloc_free(r);
1430 return false;
1431 }
1432
1433 talloc_free(r);
1434
1435 return true;
1436}
1437
1438static bool api_eventlog_RegisterClusterSvc(pipes_struct *p)
1439{
1440 const struct ndr_interface_call *call;
1441 struct ndr_pull *pull;
1442 struct ndr_push *push;
1443 enum ndr_err_code ndr_err;
1444 DATA_BLOB blob;
1445 struct eventlog_RegisterClusterSvc *r;
1446
1447 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_REGISTERCLUSTERSVC];
1448
1449 r = talloc(talloc_tos(), struct eventlog_RegisterClusterSvc);
1450 if (r == NULL) {
1451 return false;
1452 }
1453
1454 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1455 talloc_free(r);
1456 return false;
1457 }
1458
1459 pull = ndr_pull_init_blob(&blob, r);
1460 if (pull == NULL) {
1461 talloc_free(r);
1462 return false;
1463 }
1464
1465 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1466 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1467 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1468 talloc_free(r);
1469 return false;
1470 }
1471
1472 if (DEBUGLEVEL >= 10) {
1473 NDR_PRINT_IN_DEBUG(eventlog_RegisterClusterSvc, r);
1474 }
1475
1476 r->out.result = _eventlog_RegisterClusterSvc(p, r);
1477
1478 if (p->rng_fault_state) {
1479 talloc_free(r);
1480 /* Return true here, srv_pipe_hnd.c will take care */
1481 return true;
1482 }
1483
1484 if (DEBUGLEVEL >= 10) {
1485 NDR_PRINT_OUT_DEBUG(eventlog_RegisterClusterSvc, r);
1486 }
1487
1488 push = ndr_push_init_ctx(r);
1489 if (push == NULL) {
1490 talloc_free(r);
1491 return false;
1492 }
1493
1494 ndr_err = call->ndr_push(push, NDR_OUT, r);
1495 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1496 talloc_free(r);
1497 return false;
1498 }
1499
1500 blob = ndr_push_blob(push);
1501 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1502 talloc_free(r);
1503 return false;
1504 }
1505
1506 talloc_free(r);
1507
1508 return true;
1509}
1510
1511static bool api_eventlog_DeregisterClusterSvc(pipes_struct *p)
1512{
1513 const struct ndr_interface_call *call;
1514 struct ndr_pull *pull;
1515 struct ndr_push *push;
1516 enum ndr_err_code ndr_err;
1517 DATA_BLOB blob;
1518 struct eventlog_DeregisterClusterSvc *r;
1519
1520 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_DEREGISTERCLUSTERSVC];
1521
1522 r = talloc(talloc_tos(), struct eventlog_DeregisterClusterSvc);
1523 if (r == NULL) {
1524 return false;
1525 }
1526
1527 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1528 talloc_free(r);
1529 return false;
1530 }
1531
1532 pull = ndr_pull_init_blob(&blob, r);
1533 if (pull == NULL) {
1534 talloc_free(r);
1535 return false;
1536 }
1537
1538 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1539 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1540 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1541 talloc_free(r);
1542 return false;
1543 }
1544
1545 if (DEBUGLEVEL >= 10) {
1546 NDR_PRINT_IN_DEBUG(eventlog_DeregisterClusterSvc, r);
1547 }
1548
1549 r->out.result = _eventlog_DeregisterClusterSvc(p, r);
1550
1551 if (p->rng_fault_state) {
1552 talloc_free(r);
1553 /* Return true here, srv_pipe_hnd.c will take care */
1554 return true;
1555 }
1556
1557 if (DEBUGLEVEL >= 10) {
1558 NDR_PRINT_OUT_DEBUG(eventlog_DeregisterClusterSvc, r);
1559 }
1560
1561 push = ndr_push_init_ctx(r);
1562 if (push == NULL) {
1563 talloc_free(r);
1564 return false;
1565 }
1566
1567 ndr_err = call->ndr_push(push, NDR_OUT, r);
1568 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1569 talloc_free(r);
1570 return false;
1571 }
1572
1573 blob = ndr_push_blob(push);
1574 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1575 talloc_free(r);
1576 return false;
1577 }
1578
1579 talloc_free(r);
1580
1581 return true;
1582}
1583
1584static bool api_eventlog_WriteClusterEvents(pipes_struct *p)
1585{
1586 const struct ndr_interface_call *call;
1587 struct ndr_pull *pull;
1588 struct ndr_push *push;
1589 enum ndr_err_code ndr_err;
1590 DATA_BLOB blob;
1591 struct eventlog_WriteClusterEvents *r;
1592
1593 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_WRITECLUSTEREVENTS];
1594
1595 r = talloc(talloc_tos(), struct eventlog_WriteClusterEvents);
1596 if (r == NULL) {
1597 return false;
1598 }
1599
1600 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1601 talloc_free(r);
1602 return false;
1603 }
1604
1605 pull = ndr_pull_init_blob(&blob, r);
1606 if (pull == NULL) {
1607 talloc_free(r);
1608 return false;
1609 }
1610
1611 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1612 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1613 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1614 talloc_free(r);
1615 return false;
1616 }
1617
1618 if (DEBUGLEVEL >= 10) {
1619 NDR_PRINT_IN_DEBUG(eventlog_WriteClusterEvents, r);
1620 }
1621
1622 r->out.result = _eventlog_WriteClusterEvents(p, r);
1623
1624 if (p->rng_fault_state) {
1625 talloc_free(r);
1626 /* Return true here, srv_pipe_hnd.c will take care */
1627 return true;
1628 }
1629
1630 if (DEBUGLEVEL >= 10) {
1631 NDR_PRINT_OUT_DEBUG(eventlog_WriteClusterEvents, r);
1632 }
1633
1634 push = ndr_push_init_ctx(r);
1635 if (push == NULL) {
1636 talloc_free(r);
1637 return false;
1638 }
1639
1640 ndr_err = call->ndr_push(push, NDR_OUT, r);
1641 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1642 talloc_free(r);
1643 return false;
1644 }
1645
1646 blob = ndr_push_blob(push);
1647 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1648 talloc_free(r);
1649 return false;
1650 }
1651
1652 talloc_free(r);
1653
1654 return true;
1655}
1656
1657static bool api_eventlog_GetLogIntormation(pipes_struct *p)
1658{
1659 const struct ndr_interface_call *call;
1660 struct ndr_pull *pull;
1661 struct ndr_push *push;
1662 enum ndr_err_code ndr_err;
1663 DATA_BLOB blob;
1664 struct eventlog_GetLogIntormation *r;
1665
1666 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINTORMATION];
1667
1668 r = talloc(talloc_tos(), struct eventlog_GetLogIntormation);
1669 if (r == NULL) {
1670 return false;
1671 }
1672
1673 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1674 talloc_free(r);
1675 return false;
1676 }
1677
1678 pull = ndr_pull_init_blob(&blob, r);
1679 if (pull == NULL) {
1680 talloc_free(r);
1681 return false;
1682 }
1683
1684 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1685 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1686 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1687 talloc_free(r);
1688 return false;
1689 }
1690
1691 if (DEBUGLEVEL >= 10) {
1692 NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, r);
1693 }
1694
1695 r->out.result = _eventlog_GetLogIntormation(p, r);
1696
1697 if (p->rng_fault_state) {
1698 talloc_free(r);
1699 /* Return true here, srv_pipe_hnd.c will take care */
1700 return true;
1701 }
1702
1703 if (DEBUGLEVEL >= 10) {
1704 NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, r);
1705 }
1706
1707 push = ndr_push_init_ctx(r);
1708 if (push == NULL) {
1709 talloc_free(r);
1710 return false;
1711 }
1712
1713 ndr_err = call->ndr_push(push, NDR_OUT, r);
1714 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1715 talloc_free(r);
1716 return false;
1717 }
1718
1719 blob = ndr_push_blob(push);
1720 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1721 talloc_free(r);
1722 return false;
1723 }
1724
1725 talloc_free(r);
1726
1727 return true;
1728}
1729
1730static bool api_eventlog_FlushEventLog(pipes_struct *p)
1731{
1732 const struct ndr_interface_call *call;
1733 struct ndr_pull *pull;
1734 struct ndr_push *push;
1735 enum ndr_err_code ndr_err;
1736 DATA_BLOB blob;
1737 struct eventlog_FlushEventLog *r;
1738
1739 call = &ndr_table_eventlog.calls[NDR_EVENTLOG_FLUSHEVENTLOG];
1740
1741 r = talloc(talloc_tos(), struct eventlog_FlushEventLog);
1742 if (r == NULL) {
1743 return false;
1744 }
1745
1746 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1747 talloc_free(r);
1748 return false;
1749 }
1750
1751 pull = ndr_pull_init_blob(&blob, r);
1752 if (pull == NULL) {
1753 talloc_free(r);
1754 return false;
1755 }
1756
1757 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1758 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1759 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1760 talloc_free(r);
1761 return false;
1762 }
1763
1764 if (DEBUGLEVEL >= 10) {
1765 NDR_PRINT_IN_DEBUG(eventlog_FlushEventLog, r);
1766 }
1767
1768 r->out.result = _eventlog_FlushEventLog(p, r);
1769
1770 if (p->rng_fault_state) {
1771 talloc_free(r);
1772 /* Return true here, srv_pipe_hnd.c will take care */
1773 return true;
1774 }
1775
1776 if (DEBUGLEVEL >= 10) {
1777 NDR_PRINT_OUT_DEBUG(eventlog_FlushEventLog, r);
1778 }
1779
1780 push = ndr_push_init_ctx(r);
1781 if (push == NULL) {
1782 talloc_free(r);
1783 return false;
1784 }
1785
1786 ndr_err = call->ndr_push(push, NDR_OUT, r);
1787 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1788 talloc_free(r);
1789 return false;
1790 }
1791
1792 blob = ndr_push_blob(push);
1793 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1794 talloc_free(r);
1795 return false;
1796 }
1797
1798 talloc_free(r);
1799
1800 return true;
1801}
1802
1803
1804/* Tables */
1805static struct api_struct api_eventlog_cmds[] =
1806{
1807 {"EVENTLOG_CLEAREVENTLOGW", NDR_EVENTLOG_CLEAREVENTLOGW, api_eventlog_ClearEventLogW},
1808 {"EVENTLOG_BACKUPEVENTLOGW", NDR_EVENTLOG_BACKUPEVENTLOGW, api_eventlog_BackupEventLogW},
1809 {"EVENTLOG_CLOSEEVENTLOG", NDR_EVENTLOG_CLOSEEVENTLOG, api_eventlog_CloseEventLog},
1810 {"EVENTLOG_DEREGISTEREVENTSOURCE", NDR_EVENTLOG_DEREGISTEREVENTSOURCE, api_eventlog_DeregisterEventSource},
1811 {"EVENTLOG_GETNUMRECORDS", NDR_EVENTLOG_GETNUMRECORDS, api_eventlog_GetNumRecords},
1812 {"EVENTLOG_GETOLDESTRECORD", NDR_EVENTLOG_GETOLDESTRECORD, api_eventlog_GetOldestRecord},
1813 {"EVENTLOG_CHANGENOTIFY", NDR_EVENTLOG_CHANGENOTIFY, api_eventlog_ChangeNotify},
1814 {"EVENTLOG_OPENEVENTLOGW", NDR_EVENTLOG_OPENEVENTLOGW, api_eventlog_OpenEventLogW},
1815 {"EVENTLOG_REGISTEREVENTSOURCEW", NDR_EVENTLOG_REGISTEREVENTSOURCEW, api_eventlog_RegisterEventSourceW},
1816 {"EVENTLOG_OPENBACKUPEVENTLOGW", NDR_EVENTLOG_OPENBACKUPEVENTLOGW, api_eventlog_OpenBackupEventLogW},
1817 {"EVENTLOG_READEVENTLOGW", NDR_EVENTLOG_READEVENTLOGW, api_eventlog_ReadEventLogW},
1818 {"EVENTLOG_REPORTEVENTW", NDR_EVENTLOG_REPORTEVENTW, api_eventlog_ReportEventW},
1819 {"EVENTLOG_CLEAREVENTLOGA", NDR_EVENTLOG_CLEAREVENTLOGA, api_eventlog_ClearEventLogA},
1820 {"EVENTLOG_BACKUPEVENTLOGA", NDR_EVENTLOG_BACKUPEVENTLOGA, api_eventlog_BackupEventLogA},
1821 {"EVENTLOG_OPENEVENTLOGA", NDR_EVENTLOG_OPENEVENTLOGA, api_eventlog_OpenEventLogA},
1822 {"EVENTLOG_REGISTEREVENTSOURCEA", NDR_EVENTLOG_REGISTEREVENTSOURCEA, api_eventlog_RegisterEventSourceA},
1823 {"EVENTLOG_OPENBACKUPEVENTLOGA", NDR_EVENTLOG_OPENBACKUPEVENTLOGA, api_eventlog_OpenBackupEventLogA},
1824 {"EVENTLOG_READEVENTLOGA", NDR_EVENTLOG_READEVENTLOGA, api_eventlog_ReadEventLogA},
1825 {"EVENTLOG_REPORTEVENTA", NDR_EVENTLOG_REPORTEVENTA, api_eventlog_ReportEventA},
1826 {"EVENTLOG_REGISTERCLUSTERSVC", NDR_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc},
1827 {"EVENTLOG_DEREGISTERCLUSTERSVC", NDR_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc},
1828 {"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents},
1829 {"EVENTLOG_GETLOGINTORMATION", NDR_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation},
1830 {"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog},
1831};
1832
1833void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns)
1834{
1835 *fns = api_eventlog_cmds;
1836 *n_fns = sizeof(api_eventlog_cmds) / sizeof(struct api_struct);
1837}
1838
1839NTSTATUS rpc_eventlog_init(void)
1840{
1841 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "eventlog", "eventlog", api_eventlog_cmds, sizeof(api_eventlog_cmds) / sizeof(struct api_struct));
1842}
Note: See TracBrowser for help on using the repository browser.